18328 lines
4.5 MiB
Plaintext
18328 lines
4.5 MiB
Plaintext
/**
|
|
* @license
|
|
* Cesium - https://github.com/CesiumGS/cesium
|
|
* Version 1.144.0
|
|
*
|
|
* 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 VLe=Object.create;var g7=Object.defineProperty;var jLe=Object.getOwnPropertyDescriptor;var HLe=Object.getOwnPropertyNames;var GLe=Object.getPrototypeOf,WLe=Object.prototype.hasOwnProperty;var qLe=(e,t,n)=>t in e?g7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var KO=(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 $d=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}};var YLe=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of HLe(t))!WLe.call(e,r)&&r!==n&&g7(e,r,{get:()=>t[r],enumerable:!(i=jLe(t,r))||i.enumerable});return e};var La=(e,t,n)=>(n=e!=null?VLe(GLe(e)):{},YLe(t||!e||!e.__esModule?g7(n,"default",{value:e,enumerable:!0}):n,e));var at=(e,t,n)=>qLe(e,typeof t!="symbol"?t+"":t,n);var $O=$d((KUt,Kre)=>{var c0=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)};c0.prototype.init_seed=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(((e&4294901760)>>>16)*1812433253<<16)+(e&65535)*1812433253+this.mti,this.mt[this.mti]>>>=0}};c0.prototype.init_by_array=function(e,t){var n,i,r;for(this.init_seed(19650218),n=1,i=0,r=this.N>t?this.N:t;r;r--){var o=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((o&4294901760)>>>16)*1664525<<16)+(o&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(r=this.N-1;r;r--){var o=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((o&4294901760)>>>16)*1566083941<<16)+(o&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};c0.prototype.random_int=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_seed(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[e&1];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^e>>>1^t[e&1];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[e&1],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=e<<7&2636928640,e^=e<<15&4022730752,e^=e>>>18,e>>>0};c0.prototype.random_int31=function(){return this.random_int()>>>1};c0.prototype.random_incl=function(){return this.random_int()*(1/4294967295)};c0.prototype.random=function(){return this.random_int()*(1/4294967296)};c0.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)};c0.prototype.random_long=function(){var e=this.random_int()>>>5,t=this.random_int()>>>6;return(e*67108864+t)*(1/9007199254740992)};Kre.exports=c0});var moe=$d((RT,OT)=>{/*! https://mths.be/punycode v1.4.0 by @mathias */(function(e){var t=typeof RT=="object"&&RT&&!RT.nodeType&&RT,n=typeof OT=="object"&&OT&&!OT.nodeType&&OT,i=typeof global=="object"&&global;(i.global===i||i.window===i||i.self===i)&&(e=i);var r,o=2147483647,a=36,s=1,c=26,u=38,f=700,d=72,p=128,g="-",m=/^xn--/,y=/[^\x20-\x7E]/,A=/[\x2E\u3002\uFF0E\uFF61]/g,b={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},x=a-s,T=Math.floor,C=String.fromCharCode,E;function w(z){throw new RangeError(b[z])}function D(z,j){for(var B=z.length,G=[];B--;)G[B]=j(z[B]);return G}function R(z,j){var B=z.split("@"),G="";B.length>1&&(G=B[0]+"@",z=B[1]),z=z.replace(A,".");var W=z.split("."),Q=D(W,j).join(".");return G+Q}function M(z){for(var j=[],B=0,G=z.length,W,Q;B<G;)W=z.charCodeAt(B++),W>=55296&&W<=56319&&B<G?(Q=z.charCodeAt(B++),(Q&64512)==56320?j.push(((W&1023)<<10)+(Q&1023)+65536):(j.push(W),B--)):j.push(W);return j}function N(z){return D(z,function(j){var B="";return j>65535&&(j-=65536,B+=C(j>>>10&1023|55296),j=56320|j&1023),B+=C(j),B}).join("")}function _(z){return z-48<10?z-22:z-65<26?z-65:z-97<26?z-97:a}function v(z,j){return z+22+75*(z<26)-((j!=0)<<5)}function S(z,j,B){var G=0;for(z=B?T(z/f):z>>1,z+=T(z/j);z>x*c>>1;G+=a)z=T(z/x);return T(G+(x+1)*z/(z+u))}function P(z){var j=[],B=z.length,G,W=0,Q=p,q=d,J,Z,ce,Ae,le,Ce,ye,ve,Ie;for(J=z.lastIndexOf(g),J<0&&(J=0),Z=0;Z<J;++Z)z.charCodeAt(Z)>=128&&w("not-basic"),j.push(z.charCodeAt(Z));for(ce=J>0?J+1:0;ce<B;){for(Ae=W,le=1,Ce=a;ce>=B&&w("invalid-input"),ye=_(z.charCodeAt(ce++)),(ye>=a||ye>T((o-W)/le))&&w("overflow"),W+=ye*le,ve=Ce<=q?s:Ce>=q+c?c:Ce-q,!(ye<ve);Ce+=a)Ie=a-ve,le>T(o/Ie)&&w("overflow"),le*=Ie;G=j.length+1,q=S(W-Ae,G,Ae==0),T(W/G)>o-Q&&w("overflow"),Q+=T(W/G),W%=G,j.splice(W++,0,Q)}return N(j)}function L(z){var j,B,G,W,Q,q,J,Z,ce,Ae,le,Ce=[],ye,ve,Ie,Le;for(z=M(z),ye=z.length,j=p,B=0,Q=d,q=0;q<ye;++q)le=z[q],le<128&&Ce.push(C(le));for(G=W=Ce.length,W&&Ce.push(g);G<ye;){for(J=o,q=0;q<ye;++q)le=z[q],le>=j&&le<J&&(J=le);for(ve=G+1,J-j>T((o-B)/ve)&&w("overflow"),B+=(J-j)*ve,j=J,q=0;q<ye;++q)if(le=z[q],le<j&&++B>o&&w("overflow"),le==j){for(Z=B,ce=a;Ae=ce<=Q?s:ce>=Q+c?c:ce-Q,!(Z<Ae);ce+=a)Le=Z-Ae,Ie=a-Ae,Ce.push(C(v(Ae+Le%Ie,0))),Z=T(Le/Ie);Ce.push(C(v(Z,0))),Q=S(B,ve,G==W),B=0,++G}++B,++j}return Ce.join("")}function F(z){return R(z,function(j){return m.test(j)?P(j.slice(4).toLowerCase()):j})}function V(z){return R(z,function(j){return y.test(j)?"xn--"+L(j):j})}if(r={version:"1.3.2",ucs2:{decode:M,encode:N},decode:P,encode:L,toASCII:V,toUnicode:F},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return r});else if(t&&n)if(OT.exports==t)n.exports=r;else for(E in r)r.hasOwnProperty(E)&&(t[E]=r[E]);else e.punycode=r})(RT)});var goe=$d((poe,oM)=>{/*!
|
|
* 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 oM=="object"&&oM.exports?oM.exports=t():typeof define=="function"&&define.amd?define(t):e.IPv6=t(e)})(poe,function(e){"use strict";var t=e&&e.IPv6;function n(r){var o=r.toLowerCase(),a=o.split(":"),s=a.length,c=8;a[0]===""&&a[1]===""&&a[2]===""?(a.shift(),a.shift()):a[0]===""&&a[1]===""?a.shift():a[s-1]===""&&a[s-2]===""&&a.pop(),s=a.length,a[s-1].indexOf(".")!==-1&&(c=7);var u;for(u=0;u<s&&a[u]!=="";u++);if(u<c)for(a.splice(u,1,"0000");a.length<c;)a.splice(u,0,"0000");for(var f,d=0;d<c;d++){f=a[d].split("");for(var p=0;p<3&&(f[0]==="0"&&f.length>1);p++)f.splice(0,1);a[d]=f.join("")}var g=-1,m=0,y=0,A=-1,b=!1;for(d=0;d<c;d++)b?a[d]==="0"?y+=1:(b=!1,y>m&&(g=A,m=y)):a[d]==="0"&&(b=!0,A=d,y=1);y>m&&(g=A,m=y),m>1&&a.splice(g,m,""),s=a.length;var x="";for(a[0]===""&&(x=":"),d=0;d<s&&(x+=a[d],d!==s-1);d++)x+=":";return a[s-1]===""&&(x+=":"),x}function i(){return e.IPv6===this&&(e.IPv6=t),this}return{best:n,noConflict:i}})});var yoe=$d((_oe,aM)=>{/*!
|
|
* 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 aM=="object"&&aM.exports?aM.exports=t():typeof define=="function"&&define.amd?define(t):e.SecondLevelDomains=t(e)})(_oe,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 r=i.lastIndexOf(".");if(r<=0||r>=i.length-1)return!1;var o=i.lastIndexOf(".",r-1);if(o<=0||o>=r-1)return!1;var a=n.list[i.slice(r+1)];return a?a.indexOf(" "+i.slice(o+1,r)+" ")>=0:!1},is:function(i){var r=i.lastIndexOf(".");if(r<=0||r>=i.length-1)return!1;var o=i.lastIndexOf(".",r-1);if(o>=0)return!1;var a=n.list[i.slice(r+1)];return a?a.indexOf(" "+i.slice(0,r)+" ")>=0:!1},get:function(i){var r=i.lastIndexOf(".");if(r<=0||r>=i.length-1)return null;var o=i.lastIndexOf(".",r-1);if(o<=0||o>=r-1)return null;var a=n.list[i.slice(r+1)];return!a||a.indexOf(" "+i.slice(o+1,r)+" ")<0?null:i.slice(o+1)},noConflict:function(){return e.SecondLevelDomains===this&&(e.SecondLevelDomains=t),this}};return n})});var Uu=$d((Aoe,sM)=>{/*!
|
|
* 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 sM=="object"&&sM.exports?sM.exports=t(moe(),goe(),yoe()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):e.URI=t(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(Aoe,function(e,t,n,i){"use strict";var r=i&&i.URI;function o(v,S){var P=arguments.length>=1,L=arguments.length>=2;if(!(this instanceof o))return P?L?new o(v,S):new o(v):new o;if(v===void 0){if(P)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?v=location.href+"":v=""}if(v===null&&P)throw new TypeError("null is not a valid argument for URI");return this.href(v),S!==void 0?this.absoluteTo(S):this}function a(v){return/^[0-9]+$/.test(v)}o.version="1.19.11";var s=o.prototype,c=Object.prototype.hasOwnProperty;function u(v){return v.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function f(v){return v===void 0?"Undefined":String(Object.prototype.toString.call(v)).slice(8,-1)}function d(v){return f(v)==="Array"}function p(v,S){var P={},L,F;if(f(S)==="RegExp")P=null;else if(d(S))for(L=0,F=S.length;L<F;L++)P[S[L]]=!0;else P[S]=!0;for(L=0,F=v.length;L<F;L++){var V=P&&P[v[L]]!==void 0||!P&&S.test(v[L]);V&&(v.splice(L,1),F--,L--)}return v}function g(v,S){var P,L;if(d(S)){for(P=0,L=S.length;P<L;P++)if(!g(v,S[P]))return!1;return!0}var F=f(S);for(P=0,L=v.length;P<L;P++)if(F==="RegExp"){if(typeof v[P]=="string"&&v[P].match(S))return!0}else if(v[P]===S)return!0;return!1}function m(v,S){if(!d(v)||!d(S)||v.length!==S.length)return!1;v.sort(),S.sort();for(var P=0,L=v.length;P<L;P++)if(v[P]!==S[P])return!1;return!0}function y(v){var S=/^\/+|\/+$/g;return v.replace(S,"")}o._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:o.preventInvalidHostname,duplicateQueryParameters:o.duplicateQueryParameters,escapeQuerySpace:o.escapeQuerySpace}},o.preventInvalidHostname=!1,o.duplicateQueryParameters=!1,o.escapeQuerySpace=!0,o.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,o.idn_expression=/[^a-z0-9\._-]/i,o.punycode_expression=/(xn--)/i,o.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,o.ip6_expression=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,o.find_uri_expression=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/ig,o.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},o.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,o.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,o.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},o.hostProtocols=["http","https"],o.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,o.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"},o.getDomAttribute=function(v){if(!(!v||!v.nodeName)){var S=v.nodeName.toLowerCase();if(!(S==="input"&&v.type!=="image"))return o.domAttributes[S]}};function A(v){return escape(v)}function b(v){return encodeURIComponent(v).replace(/[!'()*]/g,A).replace(/\*/g,"%2A")}o.encode=b,o.decode=decodeURIComponent,o.iso8859=function(){o.encode=escape,o.decode=unescape},o.unicode=function(){o.encode=b,o.decode=decodeURIComponent},o.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"}}}},o.encodeQuery=function(v,S){var P=o.encode(v+"");return S===void 0&&(S=o.escapeQuerySpace),S?P.replace(/%20/g,"+"):P},o.decodeQuery=function(v,S){v+="",S===void 0&&(S=o.escapeQuerySpace);try{return o.decode(S?v.replace(/\+/g,"%20"):v)}catch{return v}};var x={encode:"encode",decode:"decode"},T,C=function(v,S){return function(P){try{return o[S](P+"").replace(o.characters[v][S].expression,function(L){return o.characters[v][S].map[L]})}catch{return P}}};for(T in x)o[T+"PathSegment"]=C("pathname",x[T]),o[T+"UrnPathSegment"]=C("urnpath",x[T]);var E=function(v,S,P){return function(L){var F;P?F=function(B){return o[S](o[P](B))}:F=o[S];for(var V=(L+"").split(v),z=0,j=V.length;z<j;z++)V[z]=F(V[z]);return V.join(v)}};o.decodePath=E("/","decodePathSegment"),o.decodeUrnPath=E(":","decodeUrnPathSegment"),o.recodePath=E("/","encodePathSegment","decode"),o.recodeUrnPath=E(":","encodeUrnPathSegment","decode"),o.encodeReserved=C("reserved","encode"),o.parse=function(v,S){var P;return S||(S={preventInvalidHostname:o.preventInvalidHostname}),v=v.replace(o.leading_whitespace_expression,""),v=v.replace(o.ascii_tab_whitespace,""),P=v.indexOf("#"),P>-1&&(S.fragment=v.substring(P+1)||null,v=v.substring(0,P)),P=v.indexOf("?"),P>-1&&(S.query=v.substring(P+1)||null,v=v.substring(0,P)),v=v.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),v=v.replace(/^[/\\]{2,}/i,"//"),v.substring(0,2)==="//"?(S.protocol=null,v=v.substring(2),v=o.parseAuthority(v,S)):(P=v.indexOf(":"),P>-1&&(S.protocol=v.substring(0,P)||null,S.protocol&&!S.protocol.match(o.protocol_expression)?S.protocol=void 0:v.substring(P+1,P+3).replace(/\\/g,"/")==="//"?(v=v.substring(P+3),v=o.parseAuthority(v,S)):(v=v.substring(P+1),S.urn=!0))),S.path=v,S},o.parseHost=function(v,S){v||(v=""),v=v.replace(/\\/g,"/");var P=v.indexOf("/"),L,F;if(P===-1&&(P=v.length),v.charAt(0)==="[")L=v.indexOf("]"),S.hostname=v.substring(1,L)||null,S.port=v.substring(L+2,P)||null,S.port==="/"&&(S.port=null);else{var V=v.indexOf(":"),z=v.indexOf("/"),j=v.indexOf(":",V+1);j!==-1&&(z===-1||j<z)?(S.hostname=v.substring(0,P)||null,S.port=null):(F=v.substring(0,P).split(":"),S.hostname=F[0]||null,S.port=F[1]||null)}return S.hostname&&v.substring(P).charAt(0)!=="/"&&(P++,v="/"+v),S.preventInvalidHostname&&o.ensureValidHostname(S.hostname,S.protocol),S.port&&o.ensureValidPort(S.port),v.substring(P)||"/"},o.parseAuthority=function(v,S){return v=o.parseUserinfo(v,S),o.parseHost(v,S)},o.parseUserinfo=function(v,S){var P=v,L=v.indexOf("\\");L!==-1&&(v=v.replace(/\\/g,"/"));var F=v.indexOf("/"),V=v.lastIndexOf("@",F>-1?F:v.length-1),z;return V>-1&&(F===-1||V<F)?(z=v.substring(0,V).split(":"),S.username=z[0]?o.decode(z[0]):null,z.shift(),S.password=z[0]?o.decode(z.join(":")):null,v=P.substring(V+1)):(S.username=null,S.password=null),v},o.parseQuery=function(v,S){if(!v)return{};if(v=v.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!v)return{};for(var P={},L=v.split("&"),F=L.length,V,z,j,B=0;B<F;B++)V=L[B].split("="),z=o.decodeQuery(V.shift(),S),j=V.length?o.decodeQuery(V.join("="),S):null,z!=="__proto__"&&(c.call(P,z)?((typeof P[z]=="string"||P[z]===null)&&(P[z]=[P[z]]),P[z].push(j)):P[z]=j);return P},o.build=function(v){var S="",P=!1;return v.protocol&&(S+=v.protocol+":"),!v.urn&&(S||v.hostname)&&(S+="//",P=!0),S+=o.buildAuthority(v)||"",typeof v.path=="string"&&(v.path.charAt(0)!=="/"&&P&&(S+="/"),S+=v.path),typeof v.query=="string"&&v.query&&(S+="?"+v.query),typeof v.fragment=="string"&&v.fragment&&(S+="#"+v.fragment),S},o.buildHost=function(v){var S="";if(v.hostname)o.ip6_expression.test(v.hostname)?S+="["+v.hostname+"]":S+=v.hostname;else return"";return v.port&&(S+=":"+v.port),S},o.buildAuthority=function(v){return o.buildUserinfo(v)+o.buildHost(v)},o.buildUserinfo=function(v){var S="";return v.username&&(S+=o.encode(v.username)),v.password&&(S+=":"+o.encode(v.password)),S&&(S+="@"),S},o.buildQuery=function(v,S,P){var L="",F,V,z,j;for(V in v)if(V!=="__proto__"&&c.call(v,V))if(d(v[V]))for(F={},z=0,j=v[V].length;z<j;z++)v[V][z]!==void 0&&F[v[V][z]+""]===void 0&&(L+="&"+o.buildQueryParameter(V,v[V][z],P),S!==!0&&(F[v[V][z]+""]=!0));else v[V]!==void 0&&(L+="&"+o.buildQueryParameter(V,v[V],P));return L.substring(1)},o.buildQueryParameter=function(v,S,P){return o.encodeQuery(v,P)+(S!==null?"="+o.encodeQuery(S,P):"")},o.addQuery=function(v,S,P){if(typeof S=="object")for(var L in S)c.call(S,L)&&o.addQuery(v,L,S[L]);else if(typeof S=="string"){if(v[S]===void 0){v[S]=P;return}else typeof v[S]=="string"&&(v[S]=[v[S]]);d(P)||(P=[P]),v[S]=(v[S]||[]).concat(P)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},o.setQuery=function(v,S,P){if(typeof S=="object")for(var L in S)c.call(S,L)&&o.setQuery(v,L,S[L]);else if(typeof S=="string")v[S]=P===void 0?null:P;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},o.removeQuery=function(v,S,P){var L,F,V;if(d(S))for(L=0,F=S.length;L<F;L++)v[S[L]]=void 0;else if(f(S)==="RegExp")for(V in v)S.test(V)&&(v[V]=void 0);else if(typeof S=="object")for(V in S)c.call(S,V)&&o.removeQuery(v,V,S[V]);else if(typeof S=="string")P!==void 0?f(P)==="RegExp"?!d(v[S])&&P.test(v[S])?v[S]=void 0:v[S]=p(v[S],P):v[S]===String(P)&&(!d(P)||P.length===1)?v[S]=void 0:d(v[S])&&(v[S]=p(v[S],P)):v[S]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},o.hasQuery=function(v,S,P,L){switch(f(S)){case"String":break;case"RegExp":for(var F in v)if(c.call(v,F)&&S.test(F)&&(P===void 0||o.hasQuery(v,F,P)))return!0;return!1;case"Object":for(var V in S)if(c.call(S,V)&&!o.hasQuery(v,V,S[V]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(f(P)){case"Undefined":return S in v;case"Boolean":var z=!!(d(v[S])?v[S].length:v[S]);return P===z;case"Function":return!!P(v[S],S,v);case"Array":if(!d(v[S]))return!1;var j=L?g:m;return j(v[S],P);case"RegExp":return d(v[S])?L?g(v[S],P):!1:!!(v[S]&&v[S].match(P));case"Number":P=String(P);case"String":return d(v[S])?L?g(v[S],P):!1:v[S]===P;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},o.joinPaths=function(){for(var v=[],S=[],P=0,L=0;L<arguments.length;L++){var F=new o(arguments[L]);v.push(F);for(var V=F.segment(),z=0;z<V.length;z++)typeof V[z]=="string"&&S.push(V[z]),V[z]&&P++}if(!S.length||!P)return new o("");var j=new o("").segment(S);return(v[0].path()===""||v[0].path().slice(0,1)==="/")&&j.path("/"+j.path()),j.normalize()},o.commonPath=function(v,S){var P=Math.min(v.length,S.length),L;for(L=0;L<P;L++)if(v.charAt(L)!==S.charAt(L)){L--;break}return L<1?v.charAt(0)===S.charAt(0)&&v.charAt(0)==="/"?"/":"":((v.charAt(L)!=="/"||S.charAt(L)!=="/")&&(L=v.substring(0,L).lastIndexOf("/")),v.substring(0,L+1))},o.withinString=function(v,S,P){P||(P={});var L=P.start||o.findUri.start,F=P.end||o.findUri.end,V=P.trim||o.findUri.trim,z=P.parens||o.findUri.parens,j=/[a-z0-9-]=["']?$/i;for(L.lastIndex=0;;){var B=L.exec(v);if(!B)break;var G=B.index;if(P.ignoreHtml){var W=v.slice(Math.max(G-3,0),G);if(W&&j.test(W))continue}for(var Q=G+v.slice(G).search(F),q=v.slice(G,Q),J=-1;;){var Z=z.exec(q);if(!Z)break;var ce=Z.index+Z[0].length;J=Math.max(J,ce)}if(J>-1?q=q.slice(0,J)+q.slice(J).replace(V,""):q=q.replace(V,""),!(q.length<=B[0].length)&&!(P.ignore&&P.ignore.test(q))){Q=G+q.length;var Ae=S(q,G,Q,v);if(Ae===void 0){L.lastIndex=Q;continue}Ae=String(Ae),v=v.slice(0,G)+Ae+v.slice(Q),L.lastIndex=G+Ae.length}}return L.lastIndex=0,v},o.ensureValidHostname=function(v,S){var P=!!v,L=!!S,F=!1;if(L&&(F=g(o.hostProtocols,S)),F&&!P)throw new TypeError("Hostname cannot be empty, if protocol is "+S);if(v&&v.match(o.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+v+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(v).match(o.invalid_hostname_characters))throw new TypeError('Hostname "'+v+'" contains characters other than [A-Z0-9.-:_]')}},o.ensureValidPort=function(v){if(v){var S=Number(v);if(!(a(S)&&S>0&&S<65536))throw new TypeError('Port "'+v+'" is not a valid port')}},o.noConflict=function(v){if(v){var S={URI:this.noConflict()};return i.URITemplate&&typeof i.URITemplate.noConflict=="function"&&(S.URITemplate=i.URITemplate.noConflict()),i.IPv6&&typeof i.IPv6.noConflict=="function"&&(S.IPv6=i.IPv6.noConflict()),i.SecondLevelDomains&&typeof i.SecondLevelDomains.noConflict=="function"&&(S.SecondLevelDomains=i.SecondLevelDomains.noConflict()),S}else i.URI===this&&(i.URI=r);return this},s.build=function(v){return v===!0?this._deferred_build=!0:(v===void 0||this._deferred_build)&&(this._string=o.build(this._parts),this._deferred_build=!1),this},s.clone=function(){return new o(this)},s.valueOf=s.toString=function(){return this.build(!1)._string};function w(v){return function(S,P){return S===void 0?this._parts[v]||"":(this._parts[v]=S||null,this.build(!P),this)}}function D(v,S){return function(P,L){return P===void 0?this._parts[v]||"":(P!==null&&(P=P+"",P.charAt(0)===S&&(P=P.substring(1))),this._parts[v]=P,this.build(!L),this)}}s.protocol=w("protocol"),s.username=w("username"),s.password=w("password"),s.hostname=w("hostname"),s.port=w("port"),s.query=D("query","?"),s.fragment=D("fragment","#"),s.search=function(v,S){var P=this.query(v,S);return typeof P=="string"&&P.length?"?"+P:P},s.hash=function(v,S){var P=this.fragment(v,S);return typeof P=="string"&&P.length?"#"+P:P},s.pathname=function(v,S){if(v===void 0||v===!0){var P=this._parts.path||(this._parts.hostname?"/":"");return v?(this._parts.urn?o.decodeUrnPath:o.decodePath)(P):P}else return this._parts.urn?this._parts.path=v?o.recodeUrnPath(v):"":this._parts.path=v?o.recodePath(v):"/",this.build(!S),this},s.path=s.pathname,s.href=function(v,S){var P;if(v===void 0)return this.toString();this._string="",this._parts=o._parts();var L=v instanceof o,F=typeof v=="object"&&(v.hostname||v.path||v.pathname);if(v.nodeName){var V=o.getDomAttribute(v);v=v[V]||"",F=!1}if(!L&&F&&v.pathname!==void 0&&(v=v.toString()),typeof v=="string"||v instanceof String)this._parts=o.parse(String(v),this._parts);else if(L||F){var z=L?v._parts:v;for(P in z)P!=="query"&&c.call(this._parts,P)&&(this._parts[P]=z[P]);z.query&&this.query(z.query,!1)}else throw new TypeError("invalid input");return this.build(!S),this},s.is=function(v){var S=!1,P=!1,L=!1,F=!1,V=!1,z=!1,j=!1,B=!this._parts.urn;switch(this._parts.hostname&&(B=!1,P=o.ip4_expression.test(this._parts.hostname),L=o.ip6_expression.test(this._parts.hostname),S=P||L,F=!S,V=F&&n&&n.has(this._parts.hostname),z=F&&o.idn_expression.test(this._parts.hostname),j=F&&o.punycode_expression.test(this._parts.hostname)),v.toLowerCase()){case"relative":return B;case"absolute":return!B;case"domain":case"name":return F;case"sld":return V;case"ip":return S;case"ip4":case"ipv4":case"inet4":return P;case"ip6":case"ipv6":case"inet6":return L;case"idn":return z;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return j}return null};var R=s.protocol,M=s.port,N=s.hostname;s.protocol=function(v,S){if(v&&(v=v.replace(/:(\/\/)?$/,""),!v.match(o.protocol_expression)))throw new TypeError('Protocol "'+v+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return R.call(this,v,S)},s.scheme=s.protocol,s.port=function(v,S){return this._parts.urn?v===void 0?"":this:(v!==void 0&&(v===0&&(v=null),v&&(v+="",v.charAt(0)===":"&&(v=v.substring(1)),o.ensureValidPort(v))),M.call(this,v,S))},s.hostname=function(v,S){if(this._parts.urn)return v===void 0?"":this;if(v!==void 0){var P={preventInvalidHostname:this._parts.preventInvalidHostname},L=o.parseHost(v,P);if(L!=="/")throw new TypeError('Hostname "'+v+'" contains characters other than [A-Z0-9.-]');v=P.hostname,this._parts.preventInvalidHostname&&o.ensureValidHostname(v,this._parts.protocol)}return N.call(this,v,S)},s.origin=function(v,S){if(this._parts.urn)return v===void 0?"":this;if(v===void 0){var P=this.protocol(),L=this.authority();return L?(P?P+"://":"")+this.authority():""}else{var F=o(v);return this.protocol(F.protocol()).authority(F.authority()).build(!S),this}},s.host=function(v,S){if(this._parts.urn)return v===void 0?"":this;if(v===void 0)return this._parts.hostname?o.buildHost(this._parts):"";var P=o.parseHost(v,this._parts);if(P!=="/")throw new TypeError('Hostname "'+v+'" contains characters other than [A-Z0-9.-]');return this.build(!S),this},s.authority=function(v,S){if(this._parts.urn)return v===void 0?"":this;if(v===void 0)return this._parts.hostname?o.buildAuthority(this._parts):"";var P=o.parseAuthority(v,this._parts);if(P!=="/")throw new TypeError('Hostname "'+v+'" contains characters other than [A-Z0-9.-]');return this.build(!S),this},s.userinfo=function(v,S){if(this._parts.urn)return v===void 0?"":this;if(v===void 0){var P=o.buildUserinfo(this._parts);return P&&P.substring(0,P.length-1)}else return v[v.length-1]!=="@"&&(v+="@"),o.parseUserinfo(v,this._parts),this.build(!S),this},s.resource=function(v,S){var P;return v===void 0?this.path()+this.search()+this.hash():(P=o.parse(v),this._parts.path=P.path,this._parts.query=P.query,this._parts.fragment=P.fragment,this.build(!S),this)},s.subdomain=function(v,S){if(this._parts.urn)return v===void 0?"":this;if(v===void 0){if(!this._parts.hostname||this.is("IP"))return"";var P=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,P)||""}else{var L=this._parts.hostname.length-this.domain().length,F=this._parts.hostname.substring(0,L),V=new RegExp("^"+u(F));if(v&&v.charAt(v.length-1)!=="."&&(v+="."),v.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return v&&o.ensureValidHostname(v,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(V,v),this.build(!S),this}},s.domain=function(v,S){if(this._parts.urn)return v===void 0?"":this;if(typeof v=="boolean"&&(S=v,v=void 0),v===void 0){if(!this._parts.hostname||this.is("IP"))return"";var P=this._parts.hostname.match(/\./g);if(P&&P.length<2)return this._parts.hostname;var L=this._parts.hostname.length-this.tld(S).length-1;return L=this._parts.hostname.lastIndexOf(".",L-1)+1,this._parts.hostname.substring(L)||""}else{if(!v)throw new TypeError("cannot set domain empty");if(v.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(o.ensureValidHostname(v,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=v;else{var F=new RegExp(u(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(F,v)}return this.build(!S),this}},s.tld=function(v,S){if(this._parts.urn)return v===void 0?"":this;if(typeof v=="boolean"&&(S=v,v=void 0),v===void 0){if(!this._parts.hostname||this.is("IP"))return"";var P=this._parts.hostname.lastIndexOf("."),L=this._parts.hostname.substring(P+1);return S!==!0&&n&&n.list[L.toLowerCase()]&&n.get(this._parts.hostname)||L}else{var F;if(v)if(v.match(/[^a-zA-Z0-9-]/))if(n&&n.is(v))F=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(F,v);else throw new TypeError('TLD "'+v+'" 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");F=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(F,v)}else throw new TypeError("cannot set TLD empty");return this.build(!S),this}},s.directory=function(v,S){if(this._parts.urn)return v===void 0?"":this;if(v===void 0||v===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var P=this._parts.path.length-this.filename().length-1,L=this._parts.path.substring(0,P)||(this._parts.hostname?"/":"");return v?o.decodePath(L):L}else{var F=this._parts.path.length-this.filename().length,V=this._parts.path.substring(0,F),z=new RegExp("^"+u(V));return this.is("relative")||(v||(v="/"),v.charAt(0)!=="/"&&(v="/"+v)),v&&v.charAt(v.length-1)!=="/"&&(v+="/"),v=o.recodePath(v),this._parts.path=this._parts.path.replace(z,v),this.build(!S),this}},s.filename=function(v,S){if(this._parts.urn)return v===void 0?"":this;if(typeof v!="string"){if(!this._parts.path||this._parts.path==="/")return"";var P=this._parts.path.lastIndexOf("/"),L=this._parts.path.substring(P+1);return v?o.decodePathSegment(L):L}else{var F=!1;v.charAt(0)==="/"&&(v=v.substring(1)),v.match(/\.?\//)&&(F=!0);var V=new RegExp(u(this.filename())+"$");return v=o.recodePath(v),this._parts.path=this._parts.path.replace(V,v),F?this.normalizePath(S):this.build(!S),this}},s.suffix=function(v,S){if(this._parts.urn)return v===void 0?"":this;if(v===void 0||v===!0){if(!this._parts.path||this._parts.path==="/")return"";var P=this.filename(),L=P.lastIndexOf("."),F,V;return L===-1?"":(F=P.substring(L+1),V=/^[a-z0-9%]+$/i.test(F)?F:"",v?o.decodePathSegment(V):V)}else{v.charAt(0)==="."&&(v=v.substring(1));var z=this.suffix(),j;if(z)v?j=new RegExp(u(z)+"$"):j=new RegExp(u("."+z)+"$");else{if(!v)return this;this._parts.path+="."+o.recodePath(v)}return j&&(v=o.recodePath(v),this._parts.path=this._parts.path.replace(j,v)),this.build(!S),this}},s.segment=function(v,S,P){var L=this._parts.urn?":":"/",F=this.path(),V=F.substring(0,1)==="/",z=F.split(L);if(v!==void 0&&typeof v!="number"&&(P=S,S=v,v=void 0),v!==void 0&&typeof v!="number")throw new Error('Bad segment "'+v+'", must be 0-based integer');if(V&&z.shift(),v<0&&(v=Math.max(z.length+v,0)),S===void 0)return v===void 0?z:z[v];if(v===null||z[v]===void 0)if(d(S)){z=[];for(var j=0,B=S.length;j<B;j++)!S[j].length&&(!z.length||!z[z.length-1].length)||(z.length&&!z[z.length-1].length&&z.pop(),z.push(y(S[j])))}else(S||typeof S=="string")&&(S=y(S),z[z.length-1]===""?z[z.length-1]=S:z.push(S));else S?z[v]=y(S):z.splice(v,1);return V&&z.unshift(""),this.path(z.join(L),P)},s.segmentCoded=function(v,S,P){var L,F,V;if(typeof v!="number"&&(P=S,S=v,v=void 0),S===void 0){if(L=this.segment(v,S,P),!d(L))L=L!==void 0?o.decode(L):void 0;else for(F=0,V=L.length;F<V;F++)L[F]=o.decode(L[F]);return L}if(!d(S))S=typeof S=="string"||S instanceof String?o.encode(S):S;else for(F=0,V=S.length;F<V;F++)S[F]=o.encode(S[F]);return this.segment(v,S,P)};var _=s.query;return s.query=function(v,S){if(v===!0)return o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof v=="function"){var P=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace),L=v.call(this,P);return this._parts.query=o.buildQuery(L||P,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!S),this}else return v!==void 0&&typeof v!="string"?(this._parts.query=o.buildQuery(v,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!S),this):_.call(this,v,S)},s.setQuery=function(v,S,P){var L=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof v=="string"||v instanceof String)L[v]=S!==void 0?S:null;else if(typeof v=="object")for(var F in v)c.call(v,F)&&(L[F]=v[F]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=o.buildQuery(L,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof v!="string"&&(P=S),this.build(!P),this},s.addQuery=function(v,S,P){var L=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return o.addQuery(L,v,S===void 0?null:S),this._parts.query=o.buildQuery(L,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof v!="string"&&(P=S),this.build(!P),this},s.removeQuery=function(v,S,P){var L=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return o.removeQuery(L,v,S),this._parts.query=o.buildQuery(L,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof v!="string"&&(P=S),this.build(!P),this},s.hasQuery=function(v,S,P){var L=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return o.hasQuery(L,v,S,P)},s.setSearch=s.setQuery,s.addSearch=s.addQuery,s.removeSearch=s.removeQuery,s.hasSearch=s.hasQuery,s.normalize=function(){return this._parts.urn?this.normalizeProtocol(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build():this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()},s.normalizeProtocol=function(v){return typeof this._parts.protocol=="string"&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!v)),this},s.normalizeHostname=function(v){return this._parts.hostname&&(this.is("IDN")&&e?this._parts.hostname=e.toASCII(this._parts.hostname):this.is("IPv6")&&t&&(this._parts.hostname=t.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!v)),this},s.normalizePort=function(v){return typeof this._parts.protocol=="string"&&this._parts.port===o.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!v)),this},s.normalizePath=function(v){var S=this._parts.path;if(!S)return this;if(this._parts.urn)return this._parts.path=o.recodeUrnPath(this._parts.path),this.build(!v),this;if(this._parts.path==="/")return this;S=o.recodePath(S);var P,L="",F,V;for(S.charAt(0)!=="/"&&(P=!0,S="/"+S),(S.slice(-3)==="/.."||S.slice(-2)==="/.")&&(S+="/"),S=S.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),P&&(L=S.substring(1).match(/^(\.\.\/)+/)||"",L&&(L=L[0]));F=S.search(/\/\.\.(\/|$)/),F!==-1;){if(F===0){S=S.substring(3);continue}V=S.substring(0,F).lastIndexOf("/"),V===-1&&(V=F),S=S.substring(0,V)+S.substring(F+3)}return P&&this.is("relative")&&(S=L+S.substring(1)),this._parts.path=S,this.build(!v),this},s.normalizePathname=s.normalizePath,s.normalizeQuery=function(v){return typeof this._parts.query=="string"&&(this._parts.query.length?this.query(o.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!v)),this},s.normalizeFragment=function(v){return this._parts.fragment||(this._parts.fragment=null,this.build(!v)),this},s.normalizeSearch=s.normalizeQuery,s.normalizeHash=s.normalizeFragment,s.iso8859=function(){var v=o.encode,S=o.decode;o.encode=escape,o.decode=decodeURIComponent;try{this.normalize()}finally{o.encode=v,o.decode=S}return this},s.unicode=function(){var v=o.encode,S=o.decode;o.encode=b,o.decode=unescape;try{this.normalize()}finally{o.encode=v,o.decode=S}return this},s.readable=function(){var v=this.clone();v.username("").password("").normalize();var S="";if(v._parts.protocol&&(S+=v._parts.protocol+"://"),v._parts.hostname&&(v.is("punycode")&&e?(S+=e.toUnicode(v._parts.hostname),v._parts.port&&(S+=":"+v._parts.port)):S+=v.host()),v._parts.hostname&&v._parts.path&&v._parts.path.charAt(0)!=="/"&&(S+="/"),S+=v.path(!0),v._parts.query){for(var P="",L=0,F=v._parts.query.split("&"),V=F.length;L<V;L++){var z=(F[L]||"").split("=");P+="&"+o.decodeQuery(z[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),z[1]!==void 0&&(P+="="+o.decodeQuery(z[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}S+="?"+P.substring(1)}return S+=o.decodeQuery(v.hash(),!0),S},s.absoluteTo=function(v){var S=this.clone(),P=["protocol","username","password","hostname","port"],L,F,V;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(v instanceof o||(v=new o(v)),S._parts.protocol||(S._parts.protocol=v._parts.protocol,this._parts.hostname))return S;for(F=0;V=P[F];F++)S._parts[V]=v._parts[V];return S._parts.path?(S._parts.path.substring(-2)===".."&&(S._parts.path+="/"),S.path().charAt(0)!=="/"&&(L=v.directory(),L=L||(v.path().indexOf("/")===0?"/":""),S._parts.path=(L?L+"/":"")+S._parts.path,S.normalizePath())):(S._parts.path=v._parts.path,S._parts.query||(S._parts.query=v._parts.query)),S.build(),S},s.relativeTo=function(v){var S=this.clone().normalize(),P,L,F,V,z;if(S._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(v=new o(v).normalize(),P=S._parts,L=v._parts,V=S.path(),z=v.path(),V.charAt(0)!=="/")throw new Error("URI is already relative");if(z.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if(P.protocol===L.protocol&&(P.protocol=null),P.username!==L.username||P.password!==L.password||P.protocol!==null||P.username!==null||P.password!==null)return S.build();if(P.hostname===L.hostname&&P.port===L.port)P.hostname=null,P.port=null;else return S.build();if(V===z)return P.path="",S.build();if(F=o.commonPath(V,z),!F)return S.build();var j=L.path.substring(F.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return P.path=j+P.path.substring(F.length)||"./",S.build()},s.equals=function(v){var S=this.clone(),P=new o(v),L={},F={},V={},z,j,B;if(S.normalize(),P.normalize(),S.toString()===P.toString())return!0;if(z=S.query(),j=P.query(),S.query(""),P.query(""),S.toString()!==P.toString()||z.length!==j.length)return!1;L=o.parseQuery(z,this._parts.escapeQuerySpace),F=o.parseQuery(j,this._parts.escapeQuerySpace);for(B in L)if(c.call(L,B)){if(d(L[B])){if(!m(L[B],F[B]))return!1}else if(L[B]!==F[B])return!1;V[B]=!0}for(B in F)if(c.call(F,B)&&!V[B])return!1;return!0},s.preventInvalidHostname=function(v){return this._parts.preventInvalidHostname=!!v,this},s.duplicateQueryParameters=function(v){return this._parts.duplicateQueryParameters=!!v,this},s.escapeQuerySpace=function(v){return this._parts.escapeQuerySpace=!!v,this},o})});var gX=$d((Hun,oP)=>{/*!
|
|
* protobuf.js v8.7.1 (c) 2016, daniel wirtz
|
|
* compiled mon, 13 jul 2026 11:04:12 utc
|
|
* licensed under the bsd-3-clause license
|
|
* see: https://github.com/dcodeio/protobuf.js for details
|
|
*/(function(e){"use strict";(function(n,i,r){function o(s){var c=i[s];return c||n[s][0].call(c=i[s]={exports:{}},o,c,c.exports),c.exports}var a=o(r[0]);a.util.global.protobuf=a,typeof define=="function"&&define.amd&&define(["long"],function(s){return s&&s.isLong&&(a.util.Long=s,a.configure()),a}),typeof oP=="object"&&oP&&oP.exports&&(oP.exports=a)})({1:[function(t,n,i){"use strict";i.build="minimal",i.Writer=t(15),i.BufferWriter=t(16),i.Reader=t(2),i.BufferReader=t(3),i.util=t(12),i.rpc=t(5),i.roots=t(4),i.configure=r;function r(){i.util.LongBits._configure(i.util.Long),i.Writer._configure(i.BufferWriter),i.Reader._configure(i.BufferReader)}r()},{12:12,15:15,16:16,2:2,3:3,4:4,5:5}],2:[function(t,n,i){"use strict";n.exports=u;var r=t(12),o,a=r.LongBits,s=r.utf8;function c(x,T){return RangeError("index out of range: "+x.pos+" + "+(T||1)+" > "+x.len)}function u(x){this.buf=x,this.pos=0,this.len=x.length,this.view=null,this.discardUnknown=u.discardUnknown}function f(x){if(Array.isArray(x)&&(x=new Uint8Array(x)),x instanceof Uint8Array)return new u(x);throw Error("illegal buffer")}var d=function(){return r.Buffer?function(C){return(u.create=function(w){return r.Buffer.isBuffer(w)?new o(w):f(w)})(C)}:f};u.create=d(),u.prototype.raw=function(T,C){return this.buf.subarray(T,C)},u.prototype.uint32=function(){var T=this.buf,C=this.pos,E=(T[C]&127)>>>0;if(T[C++]<128)return this.pos=C,E;if(E=(E|(T[C]&127)<<7)>>>0,T[C++]<128)return this.pos=C,E;if(E=(E|(T[C]&127)<<14)>>>0,T[C++]<128)return this.pos=C,E;if(E=(E|(T[C]&127)<<21)>>>0,T[C++]<128)return this.pos=C,E;if(E=(E|(T[C]&15)<<28)>>>0,T[C++]<128)return this.pos=C,E;for(var w=0;w<5;++w){if(C>=this.len)throw this.pos=C,c(this);if(T[C++]<128)return this.pos=C,E}throw this.pos=C,Error("invalid varint encoding")},u.prototype.tag=function(){var T=this.buf,C=this.pos,E=(T[C]&127)>>>0;if(T[C++]<128)return this.pos=C,E;if(E=(E|(T[C]&127)<<7)>>>0,T[C++]<128)return this.pos=C,E;if(E=(E|(T[C]&127)<<14)>>>0,T[C++]<128)return this.pos=C,E;if(E=(E|(T[C]&127)<<21)>>>0,T[C++]<128)return this.pos=C,E;if(E=(E|(T[C]&15)<<28)>>>0,T[C]<128&&(T[C]&112)===0)return this.pos=C+1,E;throw this.pos=C+1,Error("invalid tag encoding")},u.prototype.int32=function(){return this.uint32()|0},u.prototype.sint32=function(){var T=this.uint32();return T>>>1^-(T&1)|0};function p(){var x=new a(0,0),T=0;if(this.len-this.pos>4){for(;T<4;++T)if(x.lo=(x.lo|(this.buf[this.pos]&127)<<T*7)>>>0,this.buf[this.pos++]<128)return x;if(x.lo=(x.lo|(this.buf[this.pos]&127)<<28)>>>0,x.hi=(x.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return x;T=0}else{for(;T<4;++T){if(this.pos>=this.len)throw c(this);if(x.lo=(x.lo|(this.buf[this.pos]&127)<<T*7)>>>0,this.buf[this.pos++]<128)return x}throw c(this)}if(this.len-this.pos>4){for(;T<5;++T)if(x.hi=(x.hi|(this.buf[this.pos]&127)<<T*7+3)>>>0,this.buf[this.pos++]<128)return x}else for(;T<5;++T){if(this.pos>=this.len)throw c(this);if(x.hi=(x.hi|(this.buf[this.pos]&127)<<T*7+3)>>>0,this.buf[this.pos++]<128)return x}throw Error("invalid varint encoding")}u.prototype.bool=function(){for(var T=!1,C,E=0;E<10;++E){if(this.pos>=this.len)throw c(this);if(C=this.buf[this.pos++],C&127&&(T=!0),C<128)return T}throw Error("invalid varint encoding")};function g(x,T){return(x[T-4]|x[T-3]<<8|x[T-2]<<16|x[T-1]<<24)>>>0}u.prototype.fixed32=function(){if(this.pos+4>this.len)throw c(this,4);return g(this.buf,this.pos+=4)},u.prototype.sfixed32=function(){if(this.pos+4>this.len)throw c(this,4);return g(this.buf,this.pos+=4)|0};function m(){if(this.pos+8>this.len)throw c(this,8);return new a(g(this.buf,this.pos+=4),g(this.buf,this.pos+=4))}u.prototype.float=function(){if(this.pos+4>this.len)throw c(this,4);var T=r.float.readFloatLE(this.buf,this.pos);return this.pos+=4,T},u.prototype.double=function(){if(this.pos+8>this.len)throw c(this,4);var T=r.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,T},u.prototype.uint32s=function(T){T===e&&(T=[]);for(var C=this.uint32()+this.pos;this.pos<C;)T.push(this.uint32());return T},u.prototype.int32s=function(T){T===e&&(T=[]);for(var C=this.uint32()+this.pos;this.pos<C;)T.push(this.int32());return T},u.prototype.sint32s=function(T){T===e&&(T=[]);for(var C=this.uint32()+this.pos;this.pos<C;)T.push(this.sint32());return T},u.prototype.bools=function(T){T===e&&(T=[]);for(var C=this.uint32()+this.pos;this.pos<C;)T.push(this.bool());return T};var y=8,A=128;function b(x,T,C){var E=x.view;if(E||T<C)return E;var w=x.buf;return x.view=new DataView(w.buffer,w.byteOffset,w.byteLength)}u.prototype.fixed32s=function(T){T===e&&(T=[]);var C=this.uint32(),E=this.pos+C;if(E>this.len)throw c(this,C);var w=C>>>2,D=T.length,R=this.pos;T.length=D+w;var M=b(this,w,A);if(M)for(var N=0;N<w;++N,R+=4)T[D++]=M.getUint32(R,!0);else for(var _=this.buf,v=0;v<w;++v,R+=4)T[D++]=g(_,R+4);if(this.pos=R,R!==E)throw c(this,4);return T},u.prototype.sfixed32s=function(T){T===e&&(T=[]);var C=this.uint32(),E=this.pos+C;if(E>this.len)throw c(this,C);var w=C>>>2,D=T.length,R=this.pos;T.length=D+w;var M=b(this,w,A);if(M)for(var N=0;N<w;++N,R+=4)T[D++]=M.getInt32(R,!0);else for(var _=this.buf,v=0;v<w;++v,R+=4)T[D++]=g(_,R+4)|0;if(this.pos=R,R!==E)throw c(this,4);return T},u.prototype.floats=function(T){T===e&&(T=[]);var C=this.uint32(),E=this.pos+C;if(E>this.len)throw c(this,C);var w=C>>>2,D=T.length,R=this.pos;T.length=D+w;var M=b(this,w,y);if(M)for(var N=0;N<w;++N,R+=4)T[D++]=M.getFloat32(R,!0);else for(var _=this.buf,v=0;v<w;++v,R+=4)T[D++]=r.float.readFloatLE(_,R);if(this.pos=R,R!==E)throw c(this,4);return T},u.prototype.doubles=function(T){T===e&&(T=[]);var C=this.uint32(),E=this.pos+C;if(E>this.len)throw c(this,C);var w=C>>>3,D=T.length,R=this.pos;T.length=D+w;var M=b(this,w,y);if(M)for(var N=0;N<w;++N,R+=8)T[D++]=M.getFloat64(R,!0);else for(var _=this.buf,v=0;v<w;++v,R+=8)T[D++]=r.float.readDoubleLE(_,R);if(this.pos=R,R!==E)throw c(this,8);return T},u.prototype.uint64s=function(T){T===e&&(T=[]);for(var C=this.uint32()+this.pos;this.pos<C;)T.push(this.uint64());return T},u.prototype.int64s=function(T){T===e&&(T=[]);for(var C=this.uint32()+this.pos;this.pos<C;)T.push(this.int64());return T},u.prototype.sint64s=function(T){T===e&&(T=[]);for(var C=this.uint32()+this.pos;this.pos<C;)T.push(this.sint64());return T},u.prototype.fixed64s=function(T){T===e&&(T=[]);var C=this.uint32(),E=this.pos+C,w=T.length;if(E>this.len)throw c(this,C);var D=C>>>3;T.length=w+D;for(var R=0;R<D;++R)T[w++]=this.fixed64();if(this.pos!==E)throw c(this,8);return T},u.prototype.sfixed64s=function(T){T===e&&(T=[]);var C=this.uint32(),E=this.pos+C,w=T.length;if(E>this.len)throw c(this,C);var D=C>>>3;T.length=w+D;for(var R=0;R<D;++R)T[w++]=this.sfixed64();if(this.pos!==E)throw c(this,8);return T},u.prototype.bytes=function(){var T=this.uint32(),C=this.pos,E=this.pos+T;if(E>this.len)throw c(this,T);return this.pos=E,this.raw(C,E)},u.prototype.string=function(){var T=this.uint32(),C=this.pos,E=this.pos+T;if(E>this.len)throw c(this,T);return this.pos=E,s.read(this.buf,C,E)},u.prototype.stringVerify=function(){var T=this.uint32(),C=this.pos,E=this.pos+T;if(E>this.len)throw c(this,T);return this.pos=E,s.readStrict(this.buf,C,E)},u.prototype.skip=function(T){if(typeof T=="number"){if(this.pos+T>this.len)throw c(this,T);this.pos+=T}else do if(this.pos>=this.len)throw c(this);while(this.buf[this.pos++]&128);return this},u.recursionLimit=r.recursionLimit,u.discardUnknown=!0,u.prototype.skipType=function(x,T,C){if(T===e&&(T=0),T>u.recursionLimit)throw Error("max depth exceeded");if(C===0)throw Error("illegal tag: field number 0");switch(x){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;;){var E=this.tag(),w=E>>>3;if(x=E&7,!w)throw Error("illegal tag: field number 0");if(x===4){if(C!==e&&w!==C)throw Error("invalid end group tag");break}this.skipType(x,T+1,w)}break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+x+" at offset "+this.pos)}return this},u._configure=function(x){o=x,u.create=d(),o._configure();var T=r.Long?"toLong":"toNumber";r.merge(u.prototype,{int64:function(){return p.call(this)[T](!1)},uint64:function(){return p.call(this)[T](!0)},sint64:function(){return p.call(this).zzDecode()[T](!1)},fixed64:function(){return m.call(this)[T](!0)},sfixed64:function(){return m.call(this)[T](!1)}})}},{12:12}],3:[function(t,n,i){"use strict";n.exports=a;var r=t(2);a.prototype=Object.create(r.prototype,{constructor:{value:a,writable:!0,enumerable:!1,configurable:!0}});var o=t(12);function a(s){r.call(this,s)}a._configure=function(){o.Buffer&&(a.prototype._slice=o.Buffer.prototype.slice)},a.prototype.raw=function(c,u){return this._slice.call(this.buf,c,u)},a.prototype.string=function(){var c=this.uint32(),u=this.pos,f=this.pos+c;if(f>this.len)throw RangeError("index out of range: "+this.pos+" + "+c+" > "+this.len);return this.pos=f,this.buf.utf8Slice?this.buf.utf8Slice(u,f):this.buf.toString("utf-8",u,f)},a._configure()},{12:12,2:2}],4:[function(t,n,i){"use strict";n.exports=Object.create(null)},{}],5:[function(t,n,i){"use strict";var r=i;r.Service=t(6)},{6:6}],6:[function(t,n,i){"use strict";n.exports=o;var r=t(12);o.prototype=Object.create(r.EventEmitter.prototype,{constructor:{value:o,writable:!0,enumerable:!1,configurable:!0}});function o(a,s,c){if(typeof a!="function")throw TypeError("rpcImpl must be a function");r.EventEmitter.call(this),this.rpcImpl=a,this.requestDelimited=!!s,this.responseDelimited=!!c}o.prototype.rpcCall=function a(s,c,u,f,d){if(!f)throw TypeError("request must be specified");var p=this;if(!d)return r.asPromise(a,p,s,c,u,f);if(!p.rpcImpl)return setTimeout(function(){d(Error("already ended"))},0),e;try{return p.rpcImpl(s,c[p.requestDelimited?"encodeDelimited":"encode"](f).finish(),function(m,y){if(m)return p.emit("error",m,s),d(m);if(y===null)return p.end(!0),e;if(!(y instanceof u))try{y=u[p.responseDelimited?"decodeDelimited":"decode"](y)}catch(A){return p.emit("error",A,s),d(A)}return p.emit("data",y,s),d(null,y)})}catch(g){return p.emit("error",g,s),setTimeout(function(){d(g)},0),e}},o.prototype.end=function(s){return this.rpcImpl&&(s||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},{12:12}],7:[function(t,n,i){"use strict";n.exports=r;function r(o,a){for(var s=new Array(arguments.length-1),c=0,u=2,f=!0;u<arguments.length;)s[c++]=arguments[u++];return new Promise(function(p,g){s[c]=function(y){if(f)if(f=!1,y)g(y);else{for(var A=new Array(arguments.length-1),b=0;b<A.length;)A[b++]=arguments[b];p.apply(null,A)}};try{o.apply(a||null,s)}catch(m){f&&(f=!1,g(m))}})}},{}],8:[function(t,n,i){"use strict";var r=i;r.length=function(g){var m=g.length;if(!m)return 0;for(;m>0&&g.charAt(m-1)==="=";)--m;return Math.floor(m*3/4)};for(var o=new Array(64),a=new Array(123),s=0;s<64;)a[o[s]=s<26?s+65:s<52?s+71:s<62?s-4:s-59|43]=s++;a[45]=62,a[95]=63,r.encode=function(g,m,y){for(var A=null,b=[],x=0,T=0,C;m<y;){var E=g[m++];switch(T){case 0:b[x++]=o[E>>2],C=(E&3)<<4,T=1;break;case 1:b[x++]=o[C|E>>4],C=(E&15)<<2,T=2;break;case 2:b[x++]=o[C|E>>6],b[x++]=o[E&63],T=0;break}x>8191&&((A||(A=[])).push(String.fromCharCode.apply(String,b)),x=0)}return T&&(b[x++]=o[C],b[x++]=61,T===1&&(b[x++]=61)),A?(x&&A.push(String.fromCharCode.apply(String,b.slice(0,x))),A.join("")):String.fromCharCode.apply(String,b.slice(0,x))};var c="invalid encoding";r.decode=function(g,m,y){for(var A=y,b=0,x,T=0;T<g.length;){var C=g.charCodeAt(T++);if(C===61&&b>1)break;if((C=a[C])===e)throw Error(c);switch(b){case 0:x=C,b=1;break;case 1:m[y++]=x<<2|(C&48)>>4,x=C,b=2;break;case 2:m[y++]=(x&15)<<4|(C&60)>>2,x=C,b=3;break;case 3:m[y++]=(x&3)<<6|C,b=0;break}}if(b===1)throw Error(c);return y-A};var u=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,f=/[-_]/,d=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2}(?:==)?|[A-Za-z0-9_-]{3}=?)?$/;r.test=function(g){return u.test(g)||f.test(g)&&d.test(g)}},{}],9:[function(t,n,i){"use strict";n.exports=r;function r(){this._listeners=Object.create(null)}r.prototype.on=function(a,s,c){return(this._listeners[a]||(this._listeners[a]=[])).push({fn:s,ctx:c||this}),this},r.prototype.off=function(a,s){if(a===e)this._listeners=Object.create(null);else if(s===e)this._listeners[a]=[];else{var c=this._listeners[a];if(!c)return this;for(var u=0;u<c.length;)c[u].fn===s?c.splice(u,1):++u}return this},r.prototype.emit=function(a){var s=this._listeners[a];if(s){for(var c=[],u=1;u<arguments.length;)c.push(arguments[u++]);for(u=0;u<s.length;)s[u].fn.apply(s[u++].ctx,c)}return this}},{}],10:[function(t,n,i){"use strict";n.exports=r(r);function r(u){return typeof Float32Array<"u"?(function(){var f=new Float32Array([-0]),d=new Uint8Array(f.buffer),p=d[3]===128;function g(b,x,T){f[0]=b,x[T]=d[0],x[T+1]=d[1],x[T+2]=d[2],x[T+3]=d[3]}function m(b,x,T){f[0]=b,x[T]=d[3],x[T+1]=d[2],x[T+2]=d[1],x[T+3]=d[0]}u.writeFloatLE=p?g:m,u.writeFloatBE=p?m:g;function y(b,x){return d[0]=b[x],d[1]=b[x+1],d[2]=b[x+2],d[3]=b[x+3],f[0]}function A(b,x){return d[3]=b[x],d[2]=b[x+1],d[1]=b[x+2],d[0]=b[x+3],f[0]}u.readFloatLE=p?y:A,u.readFloatBE=p?A:y})():(function(){function f(p,g,m,y){var A=g<0?1:0;if(A&&(g=-g),g===0)p(1/g>0?0:2147483648,m,y);else if(isNaN(g))p(2143289344,m,y);else if(g>34028234663852886e22)p((A<<31|2139095040)>>>0,m,y);else if(g<11754943508222875e-54)p((A<<31|Math.round(g/1401298464324817e-60))>>>0,m,y);else{var b=Math.floor(Math.log(g)/Math.LN2),x=Math.round(g*Math.pow(2,-b)*8388608)&8388607;p((A<<31|b+127<<23|x)>>>0,m,y)}}u.writeFloatLE=f.bind(null,o),u.writeFloatBE=f.bind(null,a);function d(p,g,m){var y=p(g,m),A=(y>>31)*2+1,b=y>>>23&255,x=y&8388607;return b===255?x?NaN:A*(1/0):b===0?A*1401298464324817e-60*x:A*Math.pow(2,b-150)*(x+8388608)}u.readFloatLE=d.bind(null,s),u.readFloatBE=d.bind(null,c)})(),typeof Float64Array<"u"?(function(){var f=new Float64Array([-0]),d=new Uint8Array(f.buffer),p=d[7]===128;function g(b,x,T){f[0]=b,x[T]=d[0],x[T+1]=d[1],x[T+2]=d[2],x[T+3]=d[3],x[T+4]=d[4],x[T+5]=d[5],x[T+6]=d[6],x[T+7]=d[7]}function m(b,x,T){f[0]=b,x[T]=d[7],x[T+1]=d[6],x[T+2]=d[5],x[T+3]=d[4],x[T+4]=d[3],x[T+5]=d[2],x[T+6]=d[1],x[T+7]=d[0]}u.writeDoubleLE=p?g:m,u.writeDoubleBE=p?m:g;function y(b,x){return d[0]=b[x],d[1]=b[x+1],d[2]=b[x+2],d[3]=b[x+3],d[4]=b[x+4],d[5]=b[x+5],d[6]=b[x+6],d[7]=b[x+7],f[0]}function A(b,x){return d[7]=b[x],d[6]=b[x+1],d[5]=b[x+2],d[4]=b[x+3],d[3]=b[x+4],d[2]=b[x+5],d[1]=b[x+6],d[0]=b[x+7],f[0]}u.readDoubleLE=p?y:A,u.readDoubleBE=p?A:y})():(function(){function f(p,g,m,y,A,b){var x=y<0?1:0;if(x&&(y=-y),y===0)p(0,A,b+g),p(1/y>0?0:2147483648,A,b+m);else if(isNaN(y))p(0,A,b+g),p(2146959360,A,b+m);else if(y>17976931348623157e292)p(0,A,b+g),p((x<<31|2146435072)>>>0,A,b+m);else{var T;if(y<22250738585072014e-324)T=y/5e-324,p(T>>>0,A,b+g),p((x<<31|T/4294967296)>>>0,A,b+m);else{var C=Math.floor(Math.log(y)/Math.LN2);C===1024&&(C=1023),T=y*Math.pow(2,-C),p(T*4503599627370496>>>0,A,b+g),p((x<<31|C+1023<<20|T*1048576&1048575)>>>0,A,b+m)}}}u.writeDoubleLE=f.bind(null,o,0,4),u.writeDoubleBE=f.bind(null,a,4,0);function d(p,g,m,y,A){var b=p(y,A+g),x=p(y,A+m),T=(x>>31)*2+1,C=x>>>20&2047,E=4294967296*(x&1048575)+b;return C===2047?E?NaN:T*(1/0):C===0?T*5e-324*E:T*Math.pow(2,C-1075)*(E+4503599627370496)}u.readDoubleLE=d.bind(null,s,0,4),u.readDoubleBE=d.bind(null,c,4,0)})(),u}function o(u,f,d){f[d]=u&255,f[d+1]=u>>>8&255,f[d+2]=u>>>16&255,f[d+3]=u>>>24}function a(u,f,d){f[d]=u>>>24,f[d+1]=u>>>16&255,f[d+2]=u>>>8&255,f[d+3]=u&255}function s(u,f){return(u[f]|u[f+1]<<8|u[f+2]<<16|u[f+3]<<24)>>>0}function c(u,f){return(u[f]<<24|u[f+1]<<16|u[f+2]<<8|u[f+3])>>>0}},{}],11:[function(t,n,i){"use strict";n.exports=o;var r;function o(u,f){this.lo=u>>>0,this.hi=f>>>0}var a=o.zero=new o(0,0);a.toNumber=function(){return 0},a.zzEncode=a.zzDecode=function(){return this},a.length=function(){return 1};var s=o.zeroHash="\0\0\0\0\0\0\0\0";o.fromNumber=function(f){if(f===0)return a;var d=f<0;d&&(f=-f);var p=f>>>0,g=(f-p)/4294967296>>>0;return d&&(g=~g>>>0,p=~p>>>0,++p>4294967295&&(p=0,++g>4294967295&&(g=0))),new o(p,g)},o.from=function(f){if(typeof f=="number")return o.fromNumber(f);if(typeof f=="string"||f instanceof String)if(r)f=r.fromString(f);else return o.fromNumber(parseInt(f,10));return f.low||f.high?new o(f.low>>>0,f.high>>>0):a},o.prototype.toNumber=function(f){if(!f&&this.hi>>>31){var d=~this.lo+1>>>0,p=~this.hi>>>0;return d||(p=p+1>>>0),-(d+p*4294967296)}return this.lo+this.hi*4294967296},o.prototype.toLong=function(f){return r?new r(this.lo|0,this.hi|0,!!f):{low:this.lo|0,high:this.hi|0,unsigned:!!f}};var c=String.prototype.charCodeAt;o.fromHash=function(f){return f===s?a:new o((c.call(f,0)|c.call(f,1)<<8|c.call(f,2)<<16|c.call(f,3)<<24)>>>0,(c.call(f,4)|c.call(f,5)<<8|c.call(f,6)<<16|c.call(f,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 f=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^f)>>>0,this.lo=(this.lo<<1^f)>>>0,this},o.prototype.zzDecode=function(){var f=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^f)>>>0,this.hi=(this.hi>>>1^f)>>>0,this},o.prototype.length=function(){var f=this.lo,d=(this.lo>>>28|this.hi<<4)>>>0,p=this.hi>>>24;return p===0?d===0?f<16384?f<128?1:2:f<2097152?3:4:d<16384?d<128?5:6:d<2097152?7:8:p<128?9:10},o._configure=function(u){r=u}},{}],12:[function(t,n,i){"use strict";var r=i;r.asPromise=t(7),r.base64=t(8),r.EventEmitter=t(9),r.float=t(10),r.utf8=t(14),r.pool=t(13),r.LongBits=t(11);function o(c){return c==="__proto__"||c==="prototype"||c==="constructor"}r.isUnsafeProperty=o,r.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node),r.global=r.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||typeof globalThis<"u"&&globalThis||this,r.emptyArray=Object.freeze?Object.freeze([]):[],r.emptyObject=Object.freeze?Object.freeze({}):{},r.isInteger=Number.isInteger||function(u){return typeof u=="number"&&isFinite(u)&&Math.floor(u)===u},r.isString=function(u){return typeof u=="string"||u instanceof String},r.isObject=function(u){return u&&typeof u=="object"},r.isset=r.isSet=function(u,f){var d=u[f];return d!=null&&Object.hasOwnProperty.call(u,f)?typeof d!="object"||(Array.isArray(d)?d.length:Object.keys(d).length)>0:!1},r.Buffer=(function(){try{var c=r.global.Buffer;return c.prototype.utf8Write||r.isNode?c:null}catch{return null}})(),r.newBuffer=function(u){var f=r.Buffer;return typeof u=="number"?f?f.allocUnsafe(u):new Uint8Array(u):f?f.from(u):new Uint8Array(u)},r.rawField=function(u,f,d){var p=[],g=u<<3|f;for(g>>>=0;g>127;)p.push(g&127|128),g>>>=7;p.push(g);for(var m=0;m<d.length;++m)p.push(d[m]);return r.newBuffer(p)},r.Array=Uint8Array,r.Long=r.global.dcodeIO&&r.global.dcodeIO.Long||r.global.Long||(function(){try{var c=t("long");return c&&c.isLong?c:null}catch{return null}})(),r.key2Re=/^(?:true|false|0|1)$/,r.key32Re=/^-?(?:0|[1-9][0-9]*)$/,r.key64Re=/^(?:[\x00-\xff]{8}|-?(?:0|[1-9][0-9]*))$/,r.longToHash=function(u){return u?r.LongBits.from(u).toHash():r.LongBits.zeroHash},r.longFromHash=function(u,f){var d=r.LongBits.fromHash(u);return r.Long?r.Long.fromBits(d.lo,d.hi,f):d.toNumber(!!f)},r.longFromKey=function(u,f){return r.key64Re.test(u)&&!r.key32Re.test(u)?r.longFromHash(u,f):u},r.boolFromKey=function(u){return u==="true"||u==="1"};function a(c){var u=typeof arguments[arguments.length-1]=="boolean",f=u?arguments.length-1:arguments.length;u=u&&arguments[arguments.length-1];for(var d=1;d<f;++d){var p=arguments[d];if(p)for(var g=Object.keys(p),m=0;m<g.length;++m)!o(g[m])&&(!u||!Object.prototype.hasOwnProperty.call(c,g[m])||c[g[m]]===e)&&(c[g[m]]=p[g[m]])}return c}r.merge=a,r.nestingLimit=32,r.recursionLimit=100,r.makeProp=function(u,f,d){Object.prototype.hasOwnProperty.call(u,f)||Object.defineProperty(u,f,{enumerable:d===e?!0:d,configurable:!0,writable:!0})},r.lcFirst=function(u){return u.charAt(0).toLowerCase()+u.substring(1)};function s(c){function u(f,d){if(!(this instanceof u))return new u(f,d);Object.defineProperty(this,"message",{get:function(){return f}}),Error.captureStackTrace?Error.captureStackTrace(this,u):Object.defineProperty(this,"stack",{value:new Error().stack||""}),d&&a(this,d)}return u.prototype=Object.create(Error.prototype,{constructor:{value:u,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return c},set:e,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),u}r.newError=s,r.ProtocolError=s("ProtocolError"),r.oneOfGetter=function(u){for(var f={},d=0;d<u.length;++d)f[u[d]]=1;return function(){for(var p=Object.keys(this),g=p.length-1;g>-1;--g)if(f[p[g]]===1&&this[p[g]]!==e&&this[p[g]]!==null)return p[g]}},r.oneOfSetter=function(u){return function(f){for(var d=0;d<u.length;++d)u[d]!==f&&delete this[u[d]]}},r.toJSONOptions={longs:String,enums:String,bytes:String,json:!0}},{10:10,11:11,13:13,14:14,7:7,8:8,9:9,long:"long"}],13:[function(t,n,i){"use strict";n.exports=r;function r(o,a,s){var c=s||8192,u=c>>>1,f=null,d=c;return function(g){if(g<1||g>u)return o(g);d+g>c&&(f=o(c),d=0);var m=a.call(f,d,d+=g);return d&7&&(d=(d|7)+1),m}}},{}],14:[function(t,n,i){"use strict";var r=i,o="\uFFFD",a=new TextDecoder("utf-8",{ignoreBOM:!0}),s,c=64;try{s=new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0})}catch{s=a}r.length=function(p){for(var g=0,m=0,y=0;y<p.length;++y)m=p.charCodeAt(y),m<128?g+=1:m<2048?g+=2:(m&64512)===55296&&(p.charCodeAt(y+1)&64512)===56320?(++y,g+=4):g+=3;return g};function u(d,p,g,m){for(var y=p;y<g;){var A=d[y++];if(A<=127)m+=String.fromCharCode(A);else if(A>=192&&A<224){var b=(A&31)<<6|d[y++]&63;m+=b>=128?String.fromCharCode(b):o}else if(A>=224&&A<240){var x=(A&15)<<12|(d[y++]&63)<<6|d[y++]&63;m+=x>=2048?String.fromCharCode(x):o}else if(A>=240){var T=(A&7)<<18|(d[y++]&63)<<12|(d[y++]&63)<<6|d[y++]&63;T<65536||T>1114111?m+=o:(T-=65536,m+=String.fromCharCode(55296+(T>>10)),m+=String.fromCharCode(56320+(T&1023)))}}return m}function f(d,p,g,m){var y=g===0&&m===p.length?p:p.subarray(g,m);return d.decode(y)}r.read=function(p,g,m){if(m-g<1)return"";if(m-g>=c)return f(a,p,g,m);for(var y="",A=g,b,x,T,C,E,w,D,R;A+7<m;A+=8){if(b=p[A],x=p[A+1],T=p[A+2],C=p[A+3],E=p[A+4],w=p[A+5],D=p[A+6],R=p[A+7],(b|x|T|C|E|w|D|R)&128)return u(p,A,m,y);y+=String.fromCharCode(b,x,T,C,E,w,D,R)}for(;A<m;++A){if(b=p[A],b&128)return u(p,A,m,y);y+=String.fromCharCode(b)}return y},r.readStrict=function(p,g,m){if(m-g<1)return"";if(m-g>=c)return f(s,p,g,m);for(var y="",A=g,b,x,T,C,E,w,D,R;A+7<m;A+=8){if(b=p[A],x=p[A+1],T=p[A+2],C=p[A+3],E=p[A+4],w=p[A+5],D=p[A+6],R=p[A+7],(b|x|T|C|E|w|D|R)&128)return y+f(s,p,A,m);y+=String.fromCharCode(b,x,T,C,E,w,D,R)}for(;A<m;++A){if(b=p[A],b&128)return y+f(s,p,A,m);y+=String.fromCharCode(b)}return y},r.write=function(p,g,m){for(var y=m,A,b,x=0;x<p.length;++x)A=p.charCodeAt(x),A<128?g[m++]=A:A<2048?(g[m++]=A>>6|192,g[m++]=A&63|128):(A&64512)===55296&&((b=p.charCodeAt(x+1))&64512)===56320?(A=65536+((A&1023)<<10)+(b&1023),++x,g[m++]=A>>18|240,g[m++]=A>>12&63|128,g[m++]=A>>6&63|128,g[m++]=A&63|128):(g[m++]=A>>12|224,g[m++]=A>>6&63|128,g[m++]=A&63|128);return m-y}},{}],15:[function(t,n,i){"use strict";n.exports=u;var r=t(12),o,a=r.LongBits,s=r.base64,c=r.utf8;function u(){this.pos=0,this.buf=this.constructor.alloc(64),this.view=null,this.states=null}Object.defineProperty(u.prototype,"len",{configurable:!0,enumerable:!0,get:function(){return this.pos}});var f=function(){return r.Buffer?function(){return(u.create=function(){return new o})()}:function(){return new u}};u.create=f(),u.alloc=function(C){return new Uint8Array(C)},u.alloc=r.pool(u.alloc,Uint8Array.prototype.subarray);function d(T){return T<128?1:T<16384?2:T<2097152?3:T<268435456?4:5}u.prototype._reserve=function(C){var E=this.pos+C;if(E>this.buf.length){var w=this.buf.length<<1;w<E&&(w=E);var D=this.constructor.alloc(w);D.set(this.buf.subarray(0,this.pos),0),this.buf=D,this.view=null}};function p(T,C,E){for(var w=0;w<T.length;)C[E++]=T.charCodeAt(w++)}function g(T,C,E){for(;T>127;)C[E++]=T&127|128,T>>>=7;return C[E]=T,E+1}u.prototype.uint32=function(C){C=C>>>0,this._reserve(5);var E=this.pos;return this.pos=g(C,this.buf,E),this},u.prototype.int32=function(C){return(C|=0)<0?(this._reserve(10),m(a.fromNumber(C),this.buf,this.pos),this.pos+=10,this):this.uint32(C)},u.prototype.sint32=function(C){return this.uint32((C<<1^C>>31)>>>0)};function m(T,C,E){for(var w=T.lo,D=T.hi;D;)C[E++]=w&127|128,w=(w>>>7|D<<25)>>>0,D>>>=7;for(;w>127;)C[E++]=w&127|128,w=w>>>7;return C[E]=w,E+1}u.prototype.uint64=function(C){var E=a.from(C);this._reserve(10);var w=this.pos;return this.pos=m(E,this.buf,w),this},u.prototype.int64=u.prototype.uint64,u.prototype.sint64=function(C){var E=a.from(C).zzEncode();this._reserve(10);var w=this.pos;return this.pos=m(E,this.buf,w),this},u.prototype.bool=function(C){return this._reserve(1),this.buf[this.pos++]=C?1:0,this};function y(T,C,E){C[E]=T&255,C[E+1]=T>>>8&255,C[E+2]=T>>>16&255,C[E+3]=T>>>24}u.prototype.fixed32=function(C){return this._reserve(4),y(C>>>0,this.buf,this.pos),this.pos+=4,this},u.prototype.sfixed32=u.prototype.fixed32,u.prototype.fixed64=function(C){var E=a.from(C);return this._reserve(8),y(E.lo,this.buf,this.pos),y(E.hi,this.buf,this.pos+4),this.pos+=8,this},u.prototype.sfixed64=u.prototype.fixed64,u.prototype.float=function(C){return this._reserve(4),r.float.writeFloatLE(C,this.buf,this.pos),this.pos+=4,this},u.prototype.double=function(C){return this._reserve(8),r.float.writeDoubleLE(C,this.buf,this.pos),this.pos+=8,this},u.prototype.bytes=function(C){var E=C.length>>>0;if(!E)return this._reserve(1),this.buf[this.pos++]=0,this;if(r.isString(C)){var w=u.alloc(E=s.length(C));s.decode(C,w,0),C=w}return this.uint32(E),this._reserve(E),this.buf.set(C,this.pos),this.pos+=E,this},u.prototype.raw=function(C){var E=C.length>>>0;return E?(this._reserve(E),this.buf.set(C,this.pos),this.pos+=E,this):this},u.prototype._delim=function(C,E){var w=d(E);return w>1&&this.buf.copyWithin(C+w,C+1,C+1+E),g(E,this.buf,C),this.pos=C+w+E,this},u.prototype.string=function(C){var E=C.length;if(!E)return this._reserve(1),this.buf[this.pos++]=0,this;if(E<128){this._reserve(E*3+5);var w=this.pos;return this._delim(w,c.write(C,this.buf,w+1))}var D=c.length(C);return this.uint32(D),this._reserve(D),D===C.length?p(C,this.buf,this.pos):c.write(C,this.buf,this.pos),this.pos+=D,this},u.prototype.uint32s=function(C){var E=C.length;this._reserve(E*5+5);for(var w=this.buf,D=this.pos,R=D+1,M=0;M<E;++M)R=g(C[M]>>>0,w,R);return this._delim(D,R-D-1)},u.prototype.int32s=function(C){var E=C.length;this._reserve(E*10+5);for(var w=this.buf,D=this.pos,R=D+1,M,N=0;N<E;++N)(M=C[N]|0)<0?R=m(a.fromNumber(M),w,R):R=g(M,w,R);return this._delim(D,R-D-1)},u.prototype.sint32s=function(C){var E=C.length;this._reserve(E*5+5);for(var w=this.buf,D=this.pos,R=D+1,M=0;M<E;++M)R=g((C[M]<<1^C[M]>>31)>>>0,w,R);return this._delim(D,R-D-1)},u.prototype.uint64s=function(C){var E=C.length;this._reserve(E*10+5);for(var w=this.buf,D=this.pos,R=D+1,M=0;M<E;++M)R=m(a.from(C[M]),w,R);return this._delim(D,R-D-1)},u.prototype.int64s=u.prototype.uint64s,u.prototype.sint64s=function(C){var E=C.length;this._reserve(E*10+5);for(var w=this.buf,D=this.pos,R=D+1,M=0;M<E;++M)R=m(a.from(C[M]).zzEncode(),w,R);return this._delim(D,R-D-1)},u.prototype.bools=function(C){var E=C.length;this.uint32(E),this._reserve(E);for(var w=this.buf,D=this.pos,R=0;R<E;++R)w[D++]=C[R]?1:0;return this.pos+=E,this};var A=16,b=128;function x(T,C,E){var w=T.view;if(w||C<E)return w;var D=T.buf;return T.view=new DataView(D.buffer,D.byteOffset,D.byteLength)}u.prototype.fixed32s=function(C){var E=C.length,w=E*4;this.uint32(w),this._reserve(w);var D=this.pos,R,M=x(this,E,b);if(M)for(R=0;R<E;++R)M.setUint32(D,C[R]>>>0,!0),D+=4;else{var N=this.buf;for(R=0;R<E;++R)y(C[R]>>>0,N,D),D+=4}return this.pos+=w,this},u.prototype.sfixed32s=u.prototype.fixed32s,u.prototype.fixed64s=function(C){var E=C.length,w=E*8;this.uint32(w),this._reserve(w);var D=this.pos,R,M,N=x(this,E,b);if(N)for(R=0;R<E;++R)M=a.from(C[R]),N.setUint32(D,M.lo,!0),N.setUint32(D+4,M.hi,!0),D+=8;else{var _=this.buf;for(R=0;R<E;++R)M=a.from(C[R]),y(M.lo,_,D),y(M.hi,_,D+4),D+=8}return this.pos+=w,this},u.prototype.sfixed64s=u.prototype.fixed64s,u.prototype.floats=function(C){var E=C.length,w=E*4;this.uint32(w),this._reserve(w);var D=this.pos,R,M=x(this,E,A);if(M)for(R=0;R<E;++R)M.setFloat32(D,C[R],!0),D+=4;else{var N=this.buf;for(R=0;R<E;++R)r.float.writeFloatLE(C[R],N,D),D+=4}return this.pos+=w,this},u.prototype.doubles=function(C){var E=C.length,w=E*8;this.uint32(w),this._reserve(w);var D=this.pos,R,M=x(this,E,A);if(M)for(R=0;R<E;++R)M.setFloat64(D,C[R],!0),D+=8;else{var N=this.buf;for(R=0;R<E;++R)r.float.writeDoubleLE(C[R],N,D),D+=8}return this.pos+=w,this},u.prototype.fork=function(){return this._reserve(1),(this.states||(this.states=[])).push(this.pos),this.pos+=1,this},u.prototype.reset=function(){var C=this.states;return C&&C.length?this.pos=C.pop():this.pos=0,this},u.prototype.ldelim=function(){var C=this.states,E,w;if(C&&C.length){var D=C.pop();E=this.pos-D-1,w=d(E),w>1?(this._reserve(w-1),this.buf.copyWithin(D+w,D+1,D+1+E),this.pos+=w-1,g(E,this.buf,D)):this.buf[D]=E}else E=this.pos,w=d(E),this._reserve(w),this.buf.copyWithin(w,0,E),g(E,this.buf,0),this.pos+=w;return this},u.prototype.finish=function(C){if(C)return this.buf.subarray(0,this.pos);var E=this.constructor.alloc(this.pos);return E.set(this.buf.subarray(0,this.pos),0),E},u.prototype.finishInto=function(C,E){return E===e&&(E=0),C.set(this.buf.subarray(0,this.pos),E),C},u._configure=function(T){o=T,u.create=f(),o._configure()}},{12:12}],16:[function(t,n,i){"use strict";n.exports=a;var r=t(15);a.prototype=Object.create(r.prototype,{constructor:{value:a,writable:!0,enumerable:!1,configurable:!0}});var o=t(12);function a(){r.call(this)}var s;a._configure=function(){a.alloc=o.Buffer&&o.Buffer.allocUnsafe,s=o.Buffer&&o.Buffer.prototype.utf8Write?function(u,f,d){return f.utf8Write(u,d)}:function(u,f,d){return f.write(u,d)}},a.prototype.bytes=function(u){o.isString(u)&&(u=o.Buffer.from(u,"base64"));var f=u.length>>>0;return this.uint32(f),f&&(this._reserve(f),this.buf.set(u,this.pos),this.pos+=f),this},a.prototype.string=function(u){var f=u.length;if(!f)return this._reserve(1),this.buf[this.pos++]=0,this;if(f<128){this._reserve(f*3+5);var d=this.pos,p=this.buf;return this._delim(d,f<40?o.utf8.write(u,p,d+1):s(u,p,d+1))}var g=o.Buffer.byteLength(u);return this.uint32(g),this._reserve(g),s(u,this.buf,this.pos),this.pos+=g,this},a._configure()},{12:12,15:15}]},{},[1])})()});var r_e=$d((Pkn,i_e)=>{"use strict";i_e.exports=FZe;var JP=1e20;function FZe(e,t){t||(t={});var n=t.cutoff==null?.25:t.cutoff,i=t.radius==null?8:t.radius,r=t.channel||0,o,a,s,c,u,f,d,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");o=t.width,a=t.height,c=e,t.stride?f=t.stride:f=Math.floor(e.length/o/a)}else window.HTMLCanvasElement&&e instanceof window.HTMLCanvasElement?(p=e,d=p.getContext("2d"),o=p.width,a=p.height,g=d.getImageData(0,0,o,a),c=g.data,f=4):window.CanvasRenderingContext2D&&e instanceof window.CanvasRenderingContext2D?(p=e.canvas,d=e,o=p.width,a=p.height,g=d.getImageData(0,0,o,a),c=g.data,f=4):window.ImageData&&e instanceof window.ImageData&&(g=e,o=e.width,a=e.height,c=g.data,f=4);if(s=Math.max(o,a),window.Uint8ClampedArray&&c instanceof window.Uint8ClampedArray||window.Uint8Array&&c instanceof window.Uint8Array)for(u=c,c=Array(o*a),m=0,y=Math.floor(u.length/f);m<y;m++)c[m]=u[m*f+r]/255;else if(f!==1)throw Error("Raw data can have only 1 value per pixel");var A=Array(o*a),b=Array(o*a),x=Array(s),T=Array(s),C=Array(s+1),E=Array(s);for(m=0,y=o*a;m<y;m++){var w=c[m];A[m]=w===1?0:w===0?JP:Math.pow(Math.max(0,.5-w),2),b[m]=w===1?JP:w===0?0:Math.pow(Math.max(0,w-.5),2)}t_e(A,o,a,x,T,E,C),t_e(b,o,a,x,T,E,C);var D=window.Float32Array?new Float32Array(o*a):new Array(o*a);for(m=0,y=o*a;m<y;m++)D[m]=Math.min(Math.max(1-((A[m]-b[m])/i+n),0),1);return D}function t_e(e,t,n,i,r,o,a){for(var s=0;s<t;s++){for(var c=0;c<n;c++)i[c]=e[c*t+s];for(n_e(i,r,o,a,n),c=0;c<n;c++)e[c*t+s]=r[c]}for(c=0;c<n;c++){for(s=0;s<t;s++)i[s]=e[c*t+s];for(n_e(i,r,o,a,t),s=0;s<t;s++)e[c*t+s]=Math.sqrt(r[s])}}function n_e(e,t,n,i,r){n[0]=0,i[0]=-JP,i[1]=+JP;for(var o=1,a=0;o<r;o++){for(var s=(e[o]+o*o-(e[n[a]]+n[a]*n[a]))/(2*o-2*n[a]);s<=i[a];)a--,s=(e[o]+o*o-(e[n[a]]+n[a]*n[a]))/(2*o-2*n[a]);a++,n[a]=o,i[a]=s,i[a+1]=+JP}for(o=0,a=0;o<r;o++){for(;i[a+1]<o;)a++;t[o]=(o-n[a])*(o-n[a])+e[n[a]]}}});var o_e=$d((Dkn,k3)=>{function BZe(){var e=0,t=1,n=2,i=3,r=4,o=5,a=6,s=7,c=8,u=9,f=10,d=11,p=12,g=13,m=14,y=15,A=16,b=17,x=0,T=1,C=2,E=3,w=4;function D(_,v){return 55296<=_.charCodeAt(v)&&_.charCodeAt(v)<=56319&&56320<=_.charCodeAt(v+1)&&_.charCodeAt(v+1)<=57343}function R(_,v){v===void 0&&(v=0);var S=_.charCodeAt(v);if(55296<=S&&S<=56319&&v<_.length-1){var P=S,L=_.charCodeAt(v+1);return 56320<=L&&L<=57343?(P-55296)*1024+(L-56320)+65536:P}if(56320<=S&&S<=57343&&v>=1){var P=_.charCodeAt(v-1),L=S;return 55296<=P&&P<=56319?(P-55296)*1024+(L-56320)+65536:L}return S}function M(_,v,S){var P=[_].concat(v).concat([S]),L=P[P.length-2],F=S,V=P.lastIndexOf(m);if(V>1&&P.slice(1,V).every(function(B){return B==i})&&[i,g,b].indexOf(_)==-1)return C;var z=P.lastIndexOf(r);if(z>0&&P.slice(1,z).every(function(B){return B==r})&&[p,r].indexOf(L)==-1)return P.filter(function(B){return B==r}).length%2==1?E:w;if(L==e&&F==t)return x;if(L==n||L==e||L==t)return F==m&&v.every(function(B){return B==i})?C:T;if(F==n||F==e||F==t)return T;if(L==a&&(F==a||F==s||F==u||F==f))return x;if((L==u||L==s)&&(F==s||F==c))return x;if((L==f||L==c)&&F==c)return x;if(F==i||F==y)return x;if(F==o)return x;if(L==p)return x;var j=P.indexOf(i)!=-1?P.lastIndexOf(i)-1:P.length-2;return[g,b].indexOf(P[j])!=-1&&P.slice(j+1,-1).every(function(B){return B==i})&&F==m||L==y&&[A,b].indexOf(F)!=-1?x:v.indexOf(r)!=-1?C:L==r&&F==r?x:T}this.nextBreak=function(_,v){if(v===void 0&&(v=0),v<0)return 0;if(v>=_.length-1)return _.length;for(var S=N(R(_,v)),P=[],L=v+1;L<_.length;L++)if(!D(_,L-1)){var F=N(R(_,L));if(M(S,P,F))return L;P.push(F)}return _.length},this.splitGraphemes=function(_){for(var v=[],S=0,P;(P=this.nextBreak(_,S))<_.length;)v.push(_.slice(S,P)),S=P;return S<_.length&&v.push(_.slice(S)),v},this.iterateGraphemes=function(_){var v=0,S={next:(function(){var P,L;return(L=this.nextBreak(_,v))<_.length?(P=_.slice(v,L),v=L,{value:P,done:!1}):v<_.length?(P=_.slice(v),v=_.length,{value:P,done:!1}):{value:void 0,done:!0}}).bind(this)};return typeof Symbol<"u"&&Symbol.iterator&&(S[Symbol.iterator]=function(){return S}),S},this.countGraphemes=function(_){for(var v=0,S=0,P;(P=this.nextBreak(_,S))<_.length;)S=P,v++;return S<_.length&&v++,v};function N(_){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?r:_==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?o:4352<=_&&_<=4447||43360<=_&&_<=43388?a:4448<=_&&_<=4519||55216<=_&&_<=55238?s:4520<=_&&_<=4607||55243<=_&&_<=55291?c:_==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?A:128102<=_&&_<=128105?b:d}return this}typeof k3<"u"&&k3.exports&&(k3.exports=BZe)});var WOe=$d((Cur,k5)=>{/* 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 r={};r.defaultNoDataValue=-34027999387901484e22,r.decode=function(f,d){d=d||{};var p=d.encodedMaskData||d.encodedMaskData===null,g=c(f,d.inputOffset||0,p),m=d.noDataValue!==null?d.noDataValue:r.defaultNoDataValue,y=o(g,d.pixelType||Float32Array,d.encodedMaskData,m,d.returnMask),A={width:g.width,height:g.height,pixelData:y.resultPixels,minValue:y.minValue,maxValue:g.pixels.maxValue,noDataValue:m};return y.resultMask&&(A.maskData=y.resultMask),d.returnEncodedMask&&g.mask&&(A.encodedMaskData=g.mask.bitset?g.mask.bitset:null),d.returnFileInfo&&(A.fileInfo=a(g),d.computeUsedBitDepths&&(A.fileInfo.bitDepths=s(g))),A};var o=function(f,d,p,g,m){var y=0,A=f.pixels.numBlocksX,b=f.pixels.numBlocksY,x=Math.floor(f.width/A),T=Math.floor(f.height/b),C=2*f.maxZError,E=Number.MAX_VALUE,w;p=p||(f.mask?f.mask.bitset:null);var D,R;D=new d(f.width*f.height),m&&p&&(R=new Uint8Array(f.width*f.height));for(var M=new Float32Array(x*T),N,_,v=0;v<=b;v++){var S=v!==b?T:f.height%b;if(S!==0)for(var P=0;P<=A;P++){var L=P!==A?x:f.width%A;if(L!==0){var F=v*f.width*T+P*x,V=f.width-L,z=f.pixels.blocks[y],j,B,G;z.encoding<2?(z.encoding===0?j=z.rawData:(u(z.stuffedData,z.bitsPerPixel,z.numValidPixels,z.offset,C,M,f.pixels.maxValue),j=M),B=0):z.encoding===2?G=0:G=z.offset;var W;if(p)for(_=0;_<S;_++){for(F&7&&(W=p[F>>3],W<<=F&7),N=0;N<L;N++)F&7||(W=p[F>>3]),W&128?(R&&(R[F]=1),w=z.encoding<2?j[B++]:G,E=E>w?w:E,D[F++]=w):(R&&(R[F]=0),D[F++]=g),W<<=1;F+=V}else if(z.encoding<2)for(_=0;_<S;_++){for(N=0;N<L;N++)w=j[B++],E=E>w?w:E,D[F++]=w;F+=V}else for(E=E>G?G:E,_=0;_<S;_++){for(N=0;N<L;N++)D[F++]=G;F+=V}if(z.encoding===1&&B!==z.numValidPixels)throw"Block and Mask do not match";y++}}}return{resultPixels:D,resultMask:R,minValue:E}},a=function(f){return{fileIdentifierString:f.fileIdentifierString,fileVersion:f.fileVersion,imageType:f.imageType,height:f.height,width:f.width,maxZError:f.maxZError,eofOffset:f.eofOffset,mask:f.mask?{numBlocksX:f.mask.numBlocksX,numBlocksY:f.mask.numBlocksY,numBytes:f.mask.numBytes,maxValue:f.mask.maxValue}:null,pixels:{numBlocksX:f.pixels.numBlocksX,numBlocksY:f.pixels.numBlocksY,numBytes:f.pixels.numBytes,maxValue:f.pixels.maxValue,noDataValue:f.noDataValue}}},s=function(f){for(var d=f.pixels.numBlocksX*f.pixels.numBlocksY,p={},g=0;g<d;g++){var m=f.pixels.blocks[g];m.encoding===0?p.float32=!0:m.encoding===1?p[m.bitsPerPixel]=!0:p[0]=!0}return Object.keys(p)},c=function(f,d,p){var g={},m=new Uint8Array(f,d,10);if(g.fileIdentifierString=String.fromCharCode.apply(null,m),g.fileIdentifierString.trim()!=="CntZImage")throw"Unexpected file identifier string: "+g.fileIdentifierString;d+=10;var y=new DataView(f,d,24);if(g.fileVersion=y.getInt32(0,!0),g.imageType=y.getInt32(4,!0),g.height=y.getUint32(8,!0),g.width=y.getUint32(12,!0),g.maxZError=y.getFloat64(16,!0),d+=24,!p)if(y=new DataView(f,d,16),g.mask={},g.mask.numBlocksY=y.getUint32(0,!0),g.mask.numBlocksX=y.getUint32(4,!0),g.mask.numBytes=y.getUint32(8,!0),g.mask.maxValue=y.getFloat32(12,!0),d+=16,g.mask.numBytes>0){var A=new Uint8Array(Math.ceil(g.width*g.height/8));y=new DataView(f,d,g.mask.numBytes);var b=y.getInt16(0,!0),x=2,T=0;do{if(b>0)for(;b--;)A[T++]=y.getUint8(x++);else{var C=y.getUint8(x++);for(b=-b;b--;)A[T++]=C}b=y.getInt16(x,!0),x+=2}while(x<g.mask.numBytes);if(b!==-32768||T<A.length)throw"Unexpected end of mask RLE encoding";g.mask.bitset=A,d+=g.mask.numBytes}else(g.mask.numBytes|g.mask.numBlocksY|g.mask.maxValue)===0&&(g.mask.bitset=new Uint8Array(Math.ceil(g.width*g.height/8)));y=new DataView(f,d,16),g.pixels={},g.pixels.numBlocksY=y.getUint32(0,!0),g.pixels.numBlocksX=y.getUint32(4,!0),g.pixels.numBytes=y.getUint32(8,!0),g.pixels.maxValue=y.getFloat32(12,!0),d+=16;var E=g.pixels.numBlocksX,w=g.pixels.numBlocksY,D=E+(g.width%E>0?1:0),R=w+(g.height%w>0?1:0);g.pixels.blocks=new Array(D*R);for(var M=0,N=0;N<R;N++)for(var _=0;_<D;_++){var v=0,S=f.byteLength-d;y=new DataView(f,d,Math.min(10,S));var P={};g.pixels.blocks[M++]=P;var L=y.getUint8(0);if(v++,P.encoding=L&63,P.encoding>3)throw"Invalid block encoding ("+P.encoding+")";if(P.encoding===2){d++;continue}if(L!==0&&L!==2){if(L>>=6,P.offsetType=L,L===2)P.offset=y.getInt8(1),v++;else if(L===1)P.offset=y.getInt16(1,!0),v+=2;else if(L===0)P.offset=y.getFloat32(1,!0),v+=4;else throw"Invalid block offset type";if(P.encoding===1)if(L=y.getUint8(v),v++,P.bitsPerPixel=L&63,L>>=6,P.numValidPixelsType=L,L===2)P.numValidPixels=y.getUint8(v),v++;else if(L===1)P.numValidPixels=y.getUint16(v,!0),v+=2;else if(L===0)P.numValidPixels=y.getUint32(v,!0),v+=4;else throw"Invalid valid pixel count type"}if(d+=v,P.encoding!==3){var F,V;if(P.encoding===0){var z=(g.pixels.numBytes-1)/4;if(z!==Math.floor(z))throw"uncompressed block has invalid length";F=new ArrayBuffer(z*4),V=new Uint8Array(F),V.set(new Uint8Array(f,d,z*4));var j=new Float32Array(F);P.rawData=j,d+=z*4}else if(P.encoding===1){var B=Math.ceil(P.numValidPixels*P.bitsPerPixel/8),G=Math.ceil(B/4);F=new ArrayBuffer(G*4),V=new Uint8Array(F),V.set(new Uint8Array(f,d,B)),P.stuffedData=new Uint32Array(F),d+=B}}}return g.eofOffset=d,g},u=function(f,d,p,g,m,y,A){var b=(1<<d)-1,x=0,T,C=0,E,w,D=Math.ceil((A-g)/m),R=f.length*4-Math.ceil(d*p/8);for(f[f.length-1]<<=8*R,T=0;T<p;T++){if(C===0&&(w=f[x++],C=32),C>=d)E=w>>>C-d&b,C-=d;else{var M=d-C;E=(w&b)<<M&b,w=f[x++],C=32-M,E+=w>>>C}y[T]=E<D?g+E*m:A}return y};return r})(),t=(function(){"use strict";var r={unstuff:function(c,u,f,d,p,g,m,y){var A=(1<<f)-1,b=0,x,T=0,C,E,w,D,R=c.length*4-Math.ceil(f*d/8);if(c[c.length-1]<<=8*R,p)for(x=0;x<d;x++)T===0&&(E=c[b++],T=32),T>=f?(C=E>>>T-f&A,T-=f):(w=f-T,C=(E&A)<<w&A,E=c[b++],T=32-w,C+=E>>>T),u[x]=p[C];else for(D=Math.ceil((y-g)/m),x=0;x<d;x++)T===0&&(E=c[b++],T=32),T>=f?(C=E>>>T-f&A,T-=f):(w=f-T,C=(E&A)<<w&A,E=c[b++],T=32-w,C+=E>>>T),u[x]=C<D?g+C*m:y},unstuffLUT:function(c,u,f,d,p,g){var m=(1<<u)-1,y=0,A=0,b=0,x=0,T=0,C,E=[],w=c.length*4-Math.ceil(u*f/8);c[c.length-1]<<=8*w;var D=Math.ceil((g-d)/p);for(A=0;A<f;A++)x===0&&(C=c[y++],x=32),x>=u?(T=C>>>x-u&m,x-=u):(b=u-x,T=(C&m)<<b&m,C=c[y++],x=32-b,T+=C>>>x),E[A]=T<D?d+T*p:g;return E.unshift(d),E},unstuff2:function(c,u,f,d,p,g,m,y){var A=(1<<f)-1,b=0,x,T=0,C=0,E,w,D;if(p)for(x=0;x<d;x++)T===0&&(w=c[b++],T=32,C=0),T>=f?(E=w>>>C&A,T-=f,C+=f):(D=f-T,E=w>>>C&A,w=c[b++],T=32-D,E|=(w&(1<<D)-1)<<f-D,C=D),u[x]=p[E];else{var R=Math.ceil((y-g)/m);for(x=0;x<d;x++)T===0&&(w=c[b++],T=32,C=0),T>=f?(E=w>>>C&A,T-=f,C+=f):(D=f-T,E=w>>>C&A,w=c[b++],T=32-D,E|=(w&(1<<D)-1)<<f-D,C=D),u[x]=E<R?g+E*m:y}return u},unstuffLUT2:function(c,u,f,d,p,g){var m=(1<<u)-1,y=0,A=0,b=0,x=0,T=0,C=0,E,w=[],D=Math.ceil((g-d)/p);for(A=0;A<f;A++)x===0&&(E=c[y++],x=32,C=0),x>=u?(T=E>>>C&m,x-=u,C+=u):(b=u-x,T=E>>>C&m,E=c[y++],x=32-b,T|=(E&(1<<b)-1)<<u-b,C=b),w[A]=T<D?d+T*p:g;return w.unshift(d),w},originalUnstuff:function(c,u,f,d){var p=(1<<f)-1,g=0,m,y=0,A,b,x,T=c.length*4-Math.ceil(f*d/8);for(c[c.length-1]<<=8*T,m=0;m<d;m++)y===0&&(b=c[g++],y=32),y>=f?(A=b>>>y-f&p,y-=f):(x=f-y,A=(b&p)<<x&p,b=c[g++],y=32-x,A+=b>>>y),u[m]=A;return u},originalUnstuff2:function(c,u,f,d){var p=(1<<f)-1,g=0,m,y=0,A=0,b,x,T;for(m=0;m<d;m++)y===0&&(x=c[g++],y=32,A=0),y>=f?(b=x>>>A&p,y-=f,A+=f):(T=f-y,b=x>>>A&p,x=c[g++],y=32-T,b|=(x&(1<<T)-1)<<f-T,A=T),u[m]=b;return u}},o={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(c){for(var u=65535,f=65535,d=c.length,p=Math.floor(d/2),g=0;p;){var m=p>=359?359:p;p-=m;do u+=c[g++]<<8,f+=u+=c[g++];while(--m);u=(u&65535)+(u>>>16),f=(f&65535)+(f>>>16)}return d&1&&(f+=u+=c[g]<<8),u=(u&65535)+(u>>>16),f=(f&65535)+(f>>>16),(f<<16|u)>>>0},readHeaderInfo:function(c,u){var f=u.ptr,d=new Uint8Array(c,f,6),p={};if(p.fileIdentifierString=String.fromCharCode.apply(null,d),p.fileIdentifierString.lastIndexOf("Lerc2",0)!==0)throw"Unexpected file identifier string (expect Lerc2 ): "+p.fileIdentifierString;f+=6;var g=new DataView(c,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(c,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(c,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,A;if(m>=3&&(A=m>=4?52:48,y=this.computeChecksumFletcher32(new Uint8Array(c,f-A,p.blobSize-14)),y!==p.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(c,u){var f=u.headerInfo,d=this.getDataTypeArray(f.imageType),p=f.numDims*this.getDataTypeSize(f.imageType),g=this.readSubArray(c,u.ptr,d,p),m=this.readSubArray(c,u.ptr+p,d,p);u.ptr+=2*p;var y,A=!0;for(y=0;y<f.numDims;y++)if(g[y]!==m[y]){A=!1;break}return f.minValues=g,f.maxValues=m,A},readSubArray:function(c,u,f,d){var p;if(f===Uint8Array)p=new Uint8Array(c,u,d);else{var g=new ArrayBuffer(d),m=new Uint8Array(g);m.set(new Uint8Array(c,u,d)),p=new f(g)}return p},readMask:function(c,u){var f=u.ptr,d=u.headerInfo,p=d.width*d.height,g=d.numValidPixel,m=new DataView(c,f,4),y={};if(y.numBytes=m.getUint32(0,!0),f+=4,(g===0||p===g)&&y.numBytes!==0)throw"invalid mask";var A,b;if(g===0)A=new Uint8Array(Math.ceil(p/8)),y.bitset=A,b=new Uint8Array(p),u.pixels.resultMask=b,f+=y.numBytes;else if(y.numBytes>0){A=new Uint8Array(Math.ceil(p/8)),m=new DataView(c,f,y.numBytes);var x=m.getInt16(0,!0),T=2,C=0,E=0;do{if(x>0)for(;x--;)A[C++]=m.getUint8(T++);else for(E=m.getUint8(T++),x=-x;x--;)A[C++]=E;x=m.getInt16(T,!0),T+=2}while(T<y.numBytes);if(x!==-32768||C<A.length)throw"Unexpected end of mask RLE encoding";b=new Uint8Array(p);var w=0,D=0;for(D=0;D<p;D++)D&7?(w=A[D>>3],w<<=D&7):w=A[D>>3],w&128&&(b[D]=1);u.pixels.resultMask=b,y.bitset=A,f+=y.numBytes}return u.ptr=f,u.mask=y,!0},readDataOneSweep:function(c,u,f){var d=u.ptr,p=u.headerInfo,g=p.numDims,m=p.width*p.height,y=p.imageType,A=p.numValidPixel*o.getDataTypeSize(y)*g,b,x=u.pixels.resultMask;if(f===Uint8Array)b=new Uint8Array(c,d,A);else{var T=new ArrayBuffer(A),C=new Uint8Array(T);C.set(new Uint8Array(c,d,A)),b=new f(T)}if(b.length===m*g)u.pixels.resultPixels=b;else{u.pixels.resultPixels=new f(m*g);var E=0,w=0,D=0,R=0;if(g>1)for(D=0;D<g;D++)for(R=D*m,w=0;w<m;w++)x[w]&&(u.pixels.resultPixels[R+w]=b[E++]);else for(w=0;w<m;w++)x[w]&&(u.pixels.resultPixels[w]=b[E++])}return d+=A,u.ptr=d,!0},readHuffmanTree:function(c,u){var f=this.HUFFMAN_LUT_BITS_MAX,d=new DataView(c,u.ptr,16);u.ptr+=16;var p=d.getInt32(0,!0);if(p<2)throw"unsupported Huffman version";var g=d.getInt32(4,!0),m=d.getInt32(8,!0),y=d.getInt32(12,!0);if(m>=y)return!1;var A=new Uint32Array(y-m);o.decodeBits(c,u,A);var b=[],x,T,C,E;for(x=m;x<y;x++)T=x-(x<g?0:g),b[T]={first:A[x-m],second:null};var w=c.byteLength-u.ptr,D=Math.ceil(w/4),R=new ArrayBuffer(D*4),M=new Uint8Array(R);M.set(new Uint8Array(c,u.ptr,w));var N=new Uint32Array(R),_=0,v,S=0;for(v=N[0],x=m;x<y;x++)T=x-(x<g?0:g),E=b[T].first,E>0&&(b[T].second=v<<_>>>32-E,32-_>=E?(_+=E,_===32&&(_=0,S++,v=N[S])):(_+=E-32,S++,v=N[S],b[T].second|=v>>>32-_));var P=0,L=0,F=new a;for(x=0;x<b.length;x++)b[x]!==void 0&&(P=Math.max(P,b[x].first));P>=f?L=f:L=P,P>=30&&console.log("WARning, large NUM LUT BITS IS "+P);var V=[],z,j,B,G,W,Q;for(x=m;x<y;x++)if(T=x-(x<g?0:g),E=b[T].first,E>0)if(z=[E,T],E<=L)for(j=b[T].second<<L-E,B=1<<L-E,C=0;C<B;C++)V[j|C]=z;else for(j=b[T].second,Q=F,G=E-1;G>=0;G--)W=j>>>G&1,W?(Q.right||(Q.right=new a),Q=Q.right):(Q.left||(Q.left=new a),Q=Q.left),G===0&&!Q.val&&(Q.val=z[1]);return{decodeLut:V,numBitsLUTQick:L,numBitsLUT:P,tree:F,stuffedData:N,srcPtr:S,bitPos:_}},readHuffman:function(c,u,f){var d=u.headerInfo,p=d.numDims,g=u.headerInfo.height,m=u.headerInfo.width,y=m*g,A=this.readHuffmanTree(c,u),b=A.decodeLut,x=A.tree,T=A.stuffedData,C=A.srcPtr,E=A.bitPos,w=A.numBitsLUTQick,D=A.numBitsLUT,R=u.headerInfo.imageType===0?128:0,M,N,_,v=u.pixels.resultMask,S,P,L,F,V,z,j,B=0;E>0&&(C++,E=0);var G=T[C],W=u.encodeMode===1,Q=new f(y*p),q=Q,J;for(J=0;J<d.numDims;J++){if(p>1&&(q=new f(Q.buffer,y*J,y),B=0),u.headerInfo.numValidPixel===m*g)for(z=0,F=0;F<g;F++)for(V=0;V<m;V++,z++){if(N=0,S=G<<E>>>32-w,P=S,32-E<w&&(S|=T[C+1]>>>64-E-w,P=S),b[P])N=b[P][1],E+=b[P][0];else for(S=G<<E>>>32-D,P=S,32-E<D&&(S|=T[C+1]>>>64-E-D,P=S),M=x,j=0;j<D;j++)if(L=S>>>D-j-1&1,M=L?M.right:M.left,!(M.left||M.right)){N=M.val,E=E+j+1;break}E>=32&&(E-=32,C++,G=T[C]),_=N-R,W?(V>0?_+=B:F>0?_+=q[z-m]:_+=B,_&=255,q[z]=_,B=_):q[z]=_}else for(z=0,F=0;F<g;F++)for(V=0;V<m;V++,z++)if(v[z]){if(N=0,S=G<<E>>>32-w,P=S,32-E<w&&(S|=T[C+1]>>>64-E-w,P=S),b[P])N=b[P][1],E+=b[P][0];else for(S=G<<E>>>32-D,P=S,32-E<D&&(S|=T[C+1]>>>64-E-D,P=S),M=x,j=0;j<D;j++)if(L=S>>>D-j-1&1,M=L?M.right:M.left,!(M.left||M.right)){N=M.val,E=E+j+1;break}E>=32&&(E-=32,C++,G=T[C]),_=N-R,W?(V>0&&v[z-1]?_+=B:F>0&&v[z-m]?_+=q[z-m]:_+=B,_&=255,q[z]=_,B=_):q[z]=_}u.ptr=u.ptr+(C+1)*4+(E>0?4:0)}u.pixels.resultPixels=Q},decodeBits:function(c,u,f,d,p){{var g=u.headerInfo,m=g.fileVersion,y=0,A=new DataView(c,u.ptr,5),b=A.getUint8(0);y++;var x=b>>6,T=x===0?4:3-x,C=(b&32)>0,E=b&31,w=0;if(T===1)w=A.getUint8(y),y++;else if(T===2)w=A.getUint16(y,!0),y+=2;else if(T===4)w=A.getUint32(y,!0),y+=4;else throw"Invalid valid pixel count type";var D=2*g.maxZError,R,M,N,_,v,S,P,L,F,V,z=g.numDims>1?g.maxValues[p]:g.zMax;if(C){for(u.counter.lut++,L=A.getUint8(y),F=E,y++,_=Math.ceil((L-1)*E/8),v=Math.ceil(_/4),M=new ArrayBuffer(v*4),N=new Uint8Array(M),u.ptr+=y,N.set(new Uint8Array(c,u.ptr,_)),P=new Uint32Array(M),u.ptr+=_,V=0;L-1>>>V;)V++;_=Math.ceil(w*V/8),v=Math.ceil(_/4),M=new ArrayBuffer(v*4),N=new Uint8Array(M),N.set(new Uint8Array(c,u.ptr,_)),R=new Uint32Array(M),u.ptr+=_,m>=3?S=r.unstuffLUT2(P,E,L-1,d,D,z):S=r.unstuffLUT(P,E,L-1,d,D,z),m>=3?r.unstuff2(R,f,V,w,S):r.unstuff(R,f,V,w,S)}else u.counter.bitstuffer++,V=E,u.ptr+=y,V>0&&(_=Math.ceil(w*V/8),v=Math.ceil(_/4),M=new ArrayBuffer(v*4),N=new Uint8Array(M),N.set(new Uint8Array(c,u.ptr,_)),R=new Uint32Array(M),u.ptr+=_,m>=3?d==null?r.originalUnstuff2(R,f,V,w):r.unstuff2(R,f,V,w,!1,d,D,z):d==null?r.originalUnstuff(R,f,V,w):r.unstuff(R,f,V,w,!1,d,D,z))}},readTiles:function(c,u,f){var d=u.headerInfo,p=d.width,g=d.height,m=d.microBlockSize,y=d.imageType,A=o.getDataTypeSize(y),b=Math.ceil(p/m),x=Math.ceil(g/m);u.pixels.numBlocksY=x,u.pixels.numBlocksX=b,u.pixels.ptr=0;var T=0,C=0,E=0,w=0,D=0,R=0,M=0,N=0,_=0,v=0,S=0,P=0,L=0,F=0,V=0,z=0,j,B,G,W,Q,q,J=new f(m*m),Z=g%m||m,ce=p%m||m,Ae,le,Ce=d.numDims,ye,ve=u.pixels.resultMask,Ie=u.pixels.resultPixels;for(E=0;E<x;E++)for(D=E!==x-1?m:Z,w=0;w<b;w++)for(R=w!==b-1?m:ce,S=E*p*m+w*m,P=p-R,ye=0;ye<Ce;ye++){if(Ce>1&&(Ie=new f(u.pixels.resultPixels.buffer,p*g*ye*A,p*g)),M=c.byteLength-u.ptr,j=new DataView(c,u.ptr,Math.min(10,M)),B={},z=0,N=j.getUint8(0),z++,_=N>>6&255,v=N>>2&15,v!==(w*m>>3&15))throw"integrity issue";if(q=N&3,q>3)throw u.ptr+=z,"Invalid block encoding ("+q+")";if(q===2){u.counter.constant++,u.ptr+=z;continue}else if(q===0){if(u.counter.uncompressed++,u.ptr+=z,L=D*R*A,F=c.byteLength-u.ptr,L=L<F?L:F,G=new ArrayBuffer(L%A===0?L:L+A-L%A),W=new Uint8Array(G),W.set(new Uint8Array(c,u.ptr,L)),Q=new f(G),V=0,ve)for(T=0;T<D;T++){for(C=0;C<R;C++)ve[S]&&(Ie[S]=Q[V++]),S++;S+=P}else for(T=0;T<D;T++){for(C=0;C<R;C++)Ie[S++]=Q[V++];S+=P}u.ptr+=V*A}else if(Ae=o.getDataTypeUsed(y,_),le=o.getOnePixel(B,z,Ae,j),z+=o.getDataTypeSize(Ae),q===3)if(u.ptr+=z,u.counter.constantoffset++,ve)for(T=0;T<D;T++){for(C=0;C<R;C++)ve[S]&&(Ie[S]=le),S++;S+=P}else for(T=0;T<D;T++){for(C=0;C<R;C++)Ie[S++]=le;S+=P}else if(u.ptr+=z,o.decodeBits(c,u,J,le,ye),z=0,ve)for(T=0;T<D;T++){for(C=0;C<R;C++)ve[S]&&(Ie[S]=J[z++]),S++;S+=P}else for(T=0;T<D;T++){for(C=0;C<R;C++)Ie[S++]=J[z++];S+=P}}},formatFileInfo:function(c){return{fileIdentifierString:c.headerInfo.fileIdentifierString,fileVersion:c.headerInfo.fileVersion,imageType:c.headerInfo.imageType,height:c.headerInfo.height,width:c.headerInfo.width,numValidPixel:c.headerInfo.numValidPixel,microBlockSize:c.headerInfo.microBlockSize,blobSize:c.headerInfo.blobSize,maxZError:c.headerInfo.maxZError,pixelType:o.getPixelType(c.headerInfo.imageType),eofOffset:c.eofOffset,mask:c.mask?{numBytes:c.mask.numBytes}:null,pixels:{numBlocksX:c.pixels.numBlocksX,numBlocksY:c.pixels.numBlocksY,maxValue:c.headerInfo.zMax,minValue:c.headerInfo.zMin,noDataValue:c.noDataValue}}},constructConstantSurface:function(c){var u=c.headerInfo.zMax,f=c.headerInfo.numDims,d=c.headerInfo.height*c.headerInfo.width,p=d*f,g=0,m=0,y=0,A=c.pixels.resultMask;if(A)if(f>1)for(g=0;g<f;g++)for(y=g*d,m=0;m<d;m++)A[m]&&(c.pixels.resultPixels[y+m]=u);else for(m=0;m<d;m++)A[m]&&(c.pixels.resultPixels[m]=u);else if(c.pixels.resultPixels.fill)c.pixels.resultPixels.fill(u);else for(m=0;m<p;m++)c.pixels.resultPixels[m]=u},getDataTypeArray:function(c){var u;switch(c){case 0:u=Int8Array;break;case 1:u=Uint8Array;break;case 2:u=Int16Array;break;case 3:u=Uint16Array;break;case 4:u=Int32Array;break;case 5:u=Uint32Array;break;case 6:u=Float32Array;break;case 7:u=Float64Array;break;default:u=Float32Array}return u},getPixelType:function(c){var u;switch(c){case 0:u="S8";break;case 1:u="U8";break;case 2:u="S16";break;case 3:u="U16";break;case 4:u="S32";break;case 5:u="U32";break;case 6:u="F32";break;case 7:u="F64";break;default:u="F32"}return u},isValidPixelValue:function(c,u){if(u==null)return!1;var f;switch(c){case 0:f=u>=-128&&u<=127;break;case 1:f=u>=0&&u<=255;break;case 2:f=u>=-32768&&u<=32767;break;case 3:f=u>=0&&u<=65536;break;case 4:f=u>=-2147483648&&u<=2147483647;break;case 5:f=u>=0&&u<=4294967296;break;case 6:f=u>=-34027999387901484e22&&u<=34027999387901484e22;break;case 7:f=u>=5e-324&&u<=17976931348623157e292;break;default:f=!1}return f},getDataTypeSize:function(c){var u=0;switch(c){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=c}return u},getDataTypeUsed:function(c,u){var f=c;switch(c){case 2:case 4:f=c-u;break;case 3:case 5:f=c-2*u;break;case 6:u===0?f=c:u===1?f=2:f=1;break;case 7:u===0?f=c:f=c-2*u+1;break;default:f=c;break}return f},getOnePixel:function(c,u,f,d){var p=0;switch(f){case 0:p=d.getInt8(u);break;case 1:p=d.getUint8(u);break;case 2:p=d.getInt16(u,!0);break;case 3:p=d.getUint16(u,!0);break;case 4:p=d.getInt32(u,!0);break;case 5:p=d.getUInt32(u,!0);break;case 6:p=d.getFloat32(u,!0);break;case 7:p=d.getFloat64(u,!0);break;default:throw"the decoder does not understand this pixel type"}return p}},a=function(c,u,f){this.val=c,this.left=u,this.right=f},s={decode:function(c,u){u=u||{};var f=u.noDataValue,d=0,p={};if(p.ptr=u.inputOffset||0,p.pixels={},!!o.readHeaderInfo(c,p)){var g=p.headerInfo,m=g.fileVersion,y=o.getDataTypeArray(g.imageType);o.readMask(c,p),g.numValidPixel!==g.width*g.height&&!p.pixels.resultMask&&(p.pixels.resultMask=u.maskData);var A=g.width*g.height;if(p.pixels.resultPixels=new y(A*g.numDims),p.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0},g.numValidPixel!==0)if(g.zMax===g.zMin)o.constructConstantSurface(p);else if(m>=4&&o.checkMinMaxRanges(c,p))o.constructConstantSurface(p);else{var b=new DataView(c,p.ptr,2),x=b.getUint8(0);if(p.ptr++,x)o.readDataOneSweep(c,p,y);else if(m>1&&g.imageType<=1&&Math.abs(g.maxZError-.5)<1e-5){var T=b.getUint8(1);if(p.ptr++,p.encodeMode=T,T>2||m<4&&T>1)throw"Invalid Huffman flag "+T;T?o.readHuffman(c,p,y):o.readTiles(c,p,y)}else o.readTiles(c,p,y)}p.eofOffset=p.ptr;var C;u.inputOffset?(C=p.headerInfo.blobSize+u.inputOffset-p.ptr,Math.abs(C)>=1&&(p.eofOffset=u.inputOffset+p.headerInfo.blobSize)):(C=p.headerInfo.blobSize-p.ptr,Math.abs(C)>=1&&(p.eofOffset=p.headerInfo.blobSize));var E={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&&o.isValidPixelValue(g.imageType,f)){var w=p.pixels.resultMask;for(d=0;d<A;d++)w[d]||(E.pixelData[d]=f);E.noDataValue=f}return p.noDataValue=f,u.returnFileInfo&&(E.fileInfo=o.formatFileInfo(p)),E}},getBandCount:function(c){var u=0,f=0,d={};for(d.ptr=0,d.pixels={};f<c.byteLength-58;)o.readHeaderInfo(c,d),f+=d.headerInfo.blobSize,u++,d.ptr=f;return u}};return s})(),n=(function(){var r=new ArrayBuffer(4),o=new Uint8Array(r),a=new Uint32Array(r);return a[0]=1,o[0]===1})(),i={decode:function(r,o){if(!n)throw"Big endian system is not supported.";o=o||{};var a=o.inputOffset||0,s=new Uint8Array(r,a,10),c=String.fromCharCode.apply(null,s),u,f;if(c.trim()==="CntZImage")u=e,f=1;else if(c.substring(0,5)==="Lerc2")u=t,f=2;else throw"Unexpected file identifier string: "+c;for(var d=0,p=r.byteLength-10,g,m=[],y,A,b={width:0,height:0,pixels:[],pixelType:o.pixelType,mask:null,statistics:[]};a<p;){var x=u.decode(r,{inputOffset:a,encodedMaskData:g,maskData:A,returnMask:d===0,returnEncodedMask:d===0,returnFileInfo:!0,pixelType:o.pixelType||null,noDataValue:o.noDataValue||null});a=x.fileInfo.eofOffset,d===0&&(g=x.encodedMaskData,A=x.maskData,b.width=x.width,b.height=x.height,b.dimCount=x.dimCount||1,b.pixelType=x.pixelType||x.fileInfo.pixelType,b.mask=x.maskData),f>1&&x.fileInfo.mask&&x.fileInfo.mask.numBytes>0&&m.push(x.maskData),d++,b.pixels.push(x.pixelData),b.statistics.push({minValue:x.minValue,maxValue:x.maxValue,noDataValue:x.noDataValue,dimStats:x.dimStats})}var T,C,E;if(f>1&&m.length>1){for(E=b.width*b.height,b.bandMasks=m,A=new Uint8Array(E),A.set(m[0]),T=1;T<m.length;T++)for(y=m[T],C=0;C<E;C++)A[C]=A[C]&y[C];b.maskData=A}return b}};typeof define=="function"&&define.amd?define([],function(){return i}):typeof k5<"u"&&k5.exports?k5.exports=i:this.Lerc=i})()});var vLe=$d((k3r,CLe)=>{CLe.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 SLe=$d((z3r,ELe)=>{var{webm:yUt,mp4:AUt}=vLe(),Hre=()=>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,Gre=()=>"wakeLock"in navigator,Wre=class{constructor(){if(this.enabled=!1,Gre()){this._wakeLock=null;let t=()=>{this._wakeLock!==null&&document.visibilityState==="visible"&&this.enable()};document.addEventListener("visibilitychange",t),document.addEventListener("fullscreenchange",t)}else Hre()?this.noSleepTimer=null:(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("title","No Sleep"),this.noSleepVideo.setAttribute("playsinline",""),this._addSourceToVideo(this.noSleepVideo,"webm",yUt),this._addSourceToVideo(this.noSleepVideo,"mp4",AUt),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 r=document.createElement("source");r.src=i,r.type=`video/${n}`,t.appendChild(r)}get isEnabled(){return this.enabled}enable(){return Gre()?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}):Hre()?(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(){Gre()?(this._wakeLock&&this._wakeLock.release(),this._wakeLock=null):Hre()?this.noSleepTimer&&(console.warn(`
|
|
NoSleep now disabled for older iOS devices.
|
|
`),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause(),this.enabled=!1}};ELe.exports=Wre});function XLe(e){return e!=null}var l=XLe;function FA(e){this.name="DeveloperError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(FA.prototype=Object.create(Error.prototype),FA.prototype.constructor=FA);FA.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=`
|
|
${this.stack.toString()}`),e};FA.throwInstantiationError=function(){throw new FA("This function defines an interface and should not be called directly.")};var pe=FA;var Ja={};Ja.typeOf={};function KLe(e){return`${e} is required, actual value was undefined`}function ET(e,t,n){return`Expected ${n} to be typeof ${t}, actual typeof was ${e}`}Ja.defined=function(e,t){if(!l(t))throw new pe(KLe(e))};Ja.typeOf.func=function(e,t){if(typeof t!="function")throw new pe(ET(typeof t,"function",e))};Ja.typeOf.string=function(e,t){if(typeof t!="string")throw new pe(ET(typeof t,"string",e))};Ja.typeOf.number=function(e,t){if(typeof t!="number")throw new pe(ET(typeof t,"number",e))};Ja.typeOf.number.lessThan=function(e,t,n){if(Ja.typeOf.number(e,t),t>=n)throw new pe(`Expected ${e} to be less than ${n}, actual value was ${t}`)};Ja.typeOf.number.lessThanOrEquals=function(e,t,n){if(Ja.typeOf.number(e,t),t>n)throw new pe(`Expected ${e} to be less than or equal to ${n}, actual value was ${t}`)};Ja.typeOf.number.greaterThan=function(e,t,n){if(Ja.typeOf.number(e,t),t<=n)throw new pe(`Expected ${e} to be greater than ${n}, actual value was ${t}`)};Ja.typeOf.number.greaterThanOrEquals=function(e,t,n){if(Ja.typeOf.number(e,t),t<n)throw new pe(`Expected ${e} to be greater than or equal to ${n}, actual value was ${t}`)};Ja.typeOf.object=function(e,t){if(typeof t!="object")throw new pe(ET(typeof t,"object",e))};Ja.typeOf.bool=function(e,t){if(typeof t!="boolean")throw new pe(ET(typeof t,"boolean",e))};Ja.typeOf.bigint=function(e,t){if(typeof t!="bigint")throw new pe(ET(typeof t,"bigint",e))};Ja.typeOf.number.equals=function(e,t,n,i){if(Ja.typeOf.number(e,n),Ja.typeOf.number(t,i),n!==i)throw new pe(`${e} must be equal to ${t}, the actual values are ${n} and ${i}`)};var Ur=Ja;var _7=La($O(),1);var ht={};ht.EPSILON1=.1;ht.EPSILON2=.01;ht.EPSILON3=.001;ht.EPSILON4=1e-4;ht.EPSILON5=1e-5;ht.EPSILON6=1e-6;ht.EPSILON7=1e-7;ht.EPSILON8=1e-8;ht.EPSILON9=1e-9;ht.EPSILON10=1e-10;ht.EPSILON11=1e-11;ht.EPSILON12=1e-12;ht.EPSILON13=1e-13;ht.EPSILON14=1e-14;ht.EPSILON15=1e-15;ht.EPSILON16=1e-16;ht.EPSILON17=1e-17;ht.EPSILON18=1e-18;ht.EPSILON19=1e-19;ht.EPSILON20=1e-20;ht.EPSILON21=1e-21;ht.GRAVITATIONALPARAMETER=3986004418e5;ht.SOLAR_RADIUS=6955e5;ht.LUNAR_RADIUS=1737400;ht.SIXTY_FOUR_KILOBYTES=64*1024;ht.FOUR_GIGABYTES=4*1024*1024*1024;ht.sign=Math.sign??function(t){return t=+t,t===0||t!==t?t:t>0?1:-1};ht.signNotZero=function(e){return e<0?-1:1};ht.toSNorm=function(e,t){return t=t??255,Math.round((ht.clamp(e,-1,1)*.5+.5)*t)};ht.fromSNorm=function(e,t){return t=t??255,ht.clamp(e,0,t)/t*2-1};ht.normalize=function(e,t,n){return n=Math.max(n-t,0),n===0?0:ht.clamp((e-t)/n,0,1)};ht.sinh=Math.sinh??function(t){return(Math.exp(t)-Math.exp(-t))/2};ht.cosh=Math.cosh??function(t){return(Math.exp(t)+Math.exp(-t))/2};ht.lerp=function(e,t,n){return(1-n)*e+n*t};ht.smoothDamp=function(e,t,n,i=0,r=Number.POSITIVE_INFINITY,o=1e-4,a={}){o=Math.max(1e-4,o);let s=2/o,c=s*i,u=1/(1+c+.48*c*c+.235*c*c*c),f=r*o,d=e-t;d=ht.clamp(d,-f,f);let p=e-d,g=(n+s*d)*i;return n=(n-s*g)*u,a.value=p+(d+g)*u,a.velocity=n,a};ht.PI=Math.PI;ht.ONE_OVER_PI=1/Math.PI;ht.PI_OVER_TWO=Math.PI/2;ht.PI_OVER_THREE=Math.PI/3;ht.PI_OVER_FOUR=Math.PI/4;ht.PI_OVER_SIX=Math.PI/6;ht.THREE_PI_OVER_TWO=3*Math.PI/2;ht.TWO_PI=2*Math.PI;ht.ONE_OVER_TWO_PI=1/(2*Math.PI);ht.RADIANS_PER_DEGREE=Math.PI/180;ht.DEGREES_PER_RADIAN=180/Math.PI;ht.RADIANS_PER_ARCSECOND=ht.RADIANS_PER_DEGREE/3600;ht.toRadians=function(e){return e*ht.RADIANS_PER_DEGREE};ht.toDegrees=function(e){return e*ht.DEGREES_PER_RADIAN};ht.convertLongitudeRange=function(e){let t=ht.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n};ht.clampToLatitudeRange=function(e){return ht.clamp(e,-1*ht.PI_OVER_TWO,ht.PI_OVER_TWO)};ht.negativePiToPi=function(e){return e>=-ht.PI&&e<=ht.PI?e:ht.zeroToTwoPi(e+ht.PI)-ht.PI};ht.zeroToTwoPi=function(e){if(e>=0&&e<=ht.TWO_PI)return e;let t=ht.mod(e,ht.TWO_PI);return Math.abs(t)<ht.EPSILON14&&Math.abs(e)>ht.EPSILON14?ht.TWO_PI:t};ht.mod=function(e,t){return ht.sign(e)===ht.sign(t)&&Math.abs(e)<Math.abs(t)?e:(e%t+t)%t};ht.equalsEpsilon=function(e,t,n,i){n=n??0,i=i??n;let r=Math.abs(e-t);return r<=i||r<=n*Math.max(Math.abs(e),Math.abs(t))};ht.lessThan=function(e,t,n){return e-t<-n};ht.lessThanOrEquals=function(e,t,n){return e-t<n};ht.greaterThan=function(e,t,n){return e-t>n};ht.greaterThanOrEquals=function(e,t,n){return e-t>-n};var JO=[1];ht.factorial=function(e){let t=JO.length;if(e>=t){let n=JO[t-1];for(let i=t;i<=e;i++){let r=n*i;JO.push(r),n=r}}return JO[e]};ht.incrementWrap=function(e,t,n){return n=n??0,++e,e>t&&(e=n),e};ht.isPowerOfTwo=function(e){return e!==0&&(e&e-1)===0};ht.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e};ht.previousPowerOfTwo=function(e){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};ht.clamp=function(e,t,n){return e<t?t:e>n?n:e};var $re=new _7.default;ht.setRandomNumberSeed=function(e){$re=new _7.default(e)};ht.nextRandomNumber=function(){return $re.random()};ht.randomBetween=function(e,t){return ht.nextRandomNumber()*(t-e)+e};ht.acosClamped=function(e){return Math.acos(ht.clamp(e,-1,1))};ht.asinClamped=function(e){return Math.asin(ht.clamp(e,-1,1))};ht.chordLength=function(e,t){return 2*t*Math.sin(e*.5)};ht.logBase=function(e,t){return Math.log(e)/Math.log(t)};ht.cbrt=Math.cbrt??function(t){let n=Math.pow(Math.abs(t),.3333333333333333);return t<0?-n:n};ht.log2=Math.log2??function(t){return Math.log(t)*Math.LOG2E};ht.fog=function(e,t){let n=e*t;return 1-Math.exp(-(n*n))};ht.fastApproximateAtan=function(e){return e*(-.1784*Math.abs(e)-.0663*e*e+1.0301)};ht.fastApproximateAtan2=function(e,t){let n,i=Math.abs(e);n=Math.abs(t);let r=Math.max(i,n);n=Math.min(i,n);let o=n/r;return i=ht.fastApproximateAtan(o),i=Math.abs(t)>Math.abs(e)?ht.PI_OVER_TWO-i:i,i=e<0?ht.PI-i:i,i=t<0?-i:i,i};var I=ht;var no=class e{constructor(t,n,i){this.x=t??0,this.y=n??0,this.z=i??0}static fromSpherical(t,n){l(n)||(n=new e);let i=t.clock,r=t.cone,o=t.magnitude??1,a=o*Math.sin(r);return n.x=a*Math.cos(i),n.y=a*Math.sin(i),n.z=o*Math.cos(r),n}static fromElements(t,n,i,r){return l(r)?(r.x=t,r.y=n,r.z=i,r):new e(t,n,i)}static clone(t,n){if(l(t))return l(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n):new e(t.x,t.y,t.z)}static pack(t,n,i){return i=i??0,n[i++]=t.x,n[i++]=t.y,n[i]=t.z,n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i.x=t[n++],i.y=t[n++],i.z=t[n],i}static packArray(t,n){let i=t.length,r=i*3;l(n)?!Array.isArray(n)&&n.length!==r||n.length!==r&&(n.length=r):n=new Array(r);for(let o=0;o<i;++o)e.pack(t[o],n,o*3);return n}static unpackArray(t,n){let i=t.length;l(n)?n.length=i/3:n=new Array(i/3);for(let r=0;r<i;r+=3){let o=r/3;n[o]=e.unpack(t,r,n[o])}return n}static maximumComponent(t){return Math.max(t.x,t.y,t.z)}static minimumComponent(t){return Math.min(t.x,t.y,t.z)}static minimumByComponent(t,n,i){return i.x=Math.min(t.x,n.x),i.y=Math.min(t.y,n.y),i.z=Math.min(t.z,n.z),i}static maximumByComponent(t,n,i){return i.x=Math.max(t.x,n.x),i.y=Math.max(t.y,n.y),i.z=Math.max(t.z,n.z),i}static clamp(t,n,i,r){let o=I.clamp(t.x,n.x,i.x),a=I.clamp(t.y,n.y,i.y),s=I.clamp(t.z,n.z,i.z);return r.x=o,r.y=a,r.z=s,r}static magnitudeSquared(t){return t.x*t.x+t.y*t.y+t.z*t.z}static magnitude(t){return Math.sqrt(e.magnitudeSquared(t))}static distance(t,n){return e.subtract(t,n,ZO),e.magnitude(ZO)}static distanceSquared(t,n){return e.subtract(t,n,ZO),e.magnitudeSquared(ZO)}static normalize(t,n){let i=e.magnitude(t);return n.x=t.x/i,n.y=t.y/i,n.z=t.z/i,n}static dot(t,n){return t.x*n.x+t.y*n.y+t.z*n.z}static multiplyComponents(t,n,i){return i.x=t.x*n.x,i.y=t.y*n.y,i.z=t.z*n.z,i}static divideComponents(t,n,i){return i.x=t.x/n.x,i.y=t.y/n.y,i.z=t.z/n.z,i}static add(t,n,i){return i.x=t.x+n.x,i.y=t.y+n.y,i.z=t.z+n.z,i}static subtract(t,n,i){return i.x=t.x-n.x,i.y=t.y-n.y,i.z=t.z-n.z,i}static multiplyByScalar(t,n,i){return i.x=t.x*n,i.y=t.y*n,i.z=t.z*n,i}static divideByScalar(t,n,i){return i.x=t.x/n,i.y=t.y/n,i.z=t.z/n,i}static negate(t,n){return n.x=-t.x,n.y=-t.y,n.z=-t.z,n}static abs(t,n){return n.x=Math.abs(t.x),n.y=Math.abs(t.y),n.z=Math.abs(t.z),n}static lerp(t,n,i,r){return e.multiplyByScalar(n,i,Jre),r=e.multiplyByScalar(t,1-i,r),e.add(Jre,r,r)}static angleBetween(t,n){e.normalize(t,QO),e.normalize(n,y7);let i=e.dot(QO,y7),r=e.magnitude(e.cross(QO,y7,QO));return Math.atan2(r,i)}static mostOrthogonalAxis(t,n){let i=e.normalize(t,$Le);return e.abs(i,i),i.x<=i.y?i.x<=i.z?n=e.clone(e.UNIT_X,n):n=e.clone(e.UNIT_Z,n):i.y<=i.z?n=e.clone(e.UNIT_Y,n):n=e.clone(e.UNIT_Z,n),n}static projectVector(t,n,i){let r=e.dot(t,n)/e.dot(n,n);return e.multiplyByScalar(n,r,i)}static equals(t,n){return t===n||l(t)&&l(n)&&t.x===n.x&&t.y===n.y&&t.z===n.z}static equalsArray(t,n,i){return t.x===n[i]&&t.y===n[i+1]&&t.z===n[i+2]}static equalsEpsilon(t,n,i,r){return t===n||l(t)&&l(n)&&I.equalsEpsilon(t.x,n.x,i,r)&&I.equalsEpsilon(t.y,n.y,i,r)&&I.equalsEpsilon(t.z,n.z,i,r)}static cross(t,n,i){let r=t.x,o=t.y,a=t.z,s=n.x,c=n.y,u=n.z,f=o*u-a*c,d=a*s-r*u,p=r*c-o*s;return i.x=f,i.y=d,i.z=p,i}static midpoint(t,n,i){return i.x=(t.x+n.x)*.5,i.y=(t.y+n.y)*.5,i.z=(t.z+n.z)*.5,i}static fromDegrees(t,n,i,r,o){return t=I.toRadians(t),n=I.toRadians(n),e.fromRadians(t,n,i,r,o)}static fromRadians(t,n,i,r,o){i=i??0;let a=l(r)?r.radiiSquared:e._ellipsoidRadiiSquared,s=Math.cos(n);Bf.x=s*Math.cos(t),Bf.y=s*Math.sin(t),Bf.z=Math.sin(n),Bf=e.normalize(Bf,Bf),e.multiplyComponents(a,Bf,ST);let c=Math.sqrt(e.dot(Bf,ST));return ST=e.divideByScalar(ST,c,ST),Bf=e.multiplyByScalar(Bf,i,Bf),l(o)||(o=new e),e.add(ST,Bf,o)}static fromDegreesArray(t,n,i){let r=t.length;l(i)?i.length=r/2:i=new Array(r/2);for(let o=0;o<r;o+=2){let a=t[o],s=t[o+1],c=o/2;i[c]=e.fromDegrees(a,s,0,n,i[c])}return i}static fromRadiansArray(t,n,i){let r=t.length;l(i)?i.length=r/2:i=new Array(r/2);for(let o=0;o<r;o+=2){let a=t[o],s=t[o+1],c=o/2;i[c]=e.fromRadians(a,s,0,n,i[c])}return i}static fromDegreesArrayHeights(t,n,i){let r=t.length;l(i)?i.length=r/3:i=new Array(r/3);for(let o=0;o<r;o+=3){let a=t[o],s=t[o+1],c=t[o+2],u=o/3;i[u]=e.fromDegrees(a,s,c,n,i[u])}return i}static fromRadiansArrayHeights(t,n,i){let r=t.length;l(i)?i.length=r/3:i=new Array(r/3);for(let o=0;o<r;o+=3){let a=t[o],s=t[o+1],c=t[o+2],u=o/3;i[u]=e.fromRadians(a,s,c,n,i[u])}return i}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}equalsEpsilon(t,n,i){return e.equalsEpsilon(this,t,n,i)}toString(){return`(${this.x}, ${this.y}, ${this.z})`}};no.fromCartesian4=no.clone;no.packedLength=3;no.fromArray=no.unpack;var ZO=new no,Jre=new no,QO=new no,y7=new no,$Le=new no,Bf=new no,ST=new no;no._ellipsoidRadiiSquared=new no(6378137*6378137,6378137*6378137,6356752314245179e-9*6356752314245179e-9);no.ZERO=Object.freeze(new no(0,0,0));no.ONE=Object.freeze(new no(1,1,1));no.UNIT_X=Object.freeze(new no(1,0,0));no.UNIT_Y=Object.freeze(new no(0,1,0));no.UNIT_Z=Object.freeze(new no(0,0,1));var h=no;var JLe=new h,ZLe=new h;function QLe(e,t,n,i,r){let o=e.x,a=e.y,s=e.z,c=t.x,u=t.y,f=t.z,d=o*o*c*c,p=a*a*u*u,g=s*s*f*f,m=d+p+g,y=Math.sqrt(1/m),A=h.multiplyByScalar(e,y,JLe);if(m<i)return isFinite(y)?h.clone(A,r):void 0;let b=n.x,x=n.y,T=n.z,C=ZLe;C.x=A.x*b*2,C.y=A.y*x*2,C.z=A.z*T*2;let E=(1-y)*h.magnitude(e)/(.5*h.magnitude(C)),w=0,D,R,M,N,_,v,S,P,L,F,V;do{E-=w,M=1/(1+E*b),N=1/(1+E*x),_=1/(1+E*T),v=M*M,S=N*N,P=_*_,L=v*M,F=S*N,V=P*_,D=d*v+p*S+g*P-1,R=d*L*b+p*F*x+g*V*T;let z=-2*R;w=D/z}while(Math.abs(D)>I.EPSILON12);return l(r)?(r.x=o*M,r.y=a*N,r.z=s*_,r):new h(o*M,a*N,s*_)}var wT=QLe;var ll=class ll{constructor(t,n,i){this.longitude=t??0,this.latitude=n??0,this.height=i??0}static fromRadians(t,n,i,r){return i=i??0,l(r)?(r.longitude=t,r.latitude=n,r.height=i,r):new ll(t,n,i)}static fromDegrees(t,n,i,r){return t=I.toRadians(t),n=I.toRadians(n),ll.fromRadians(t,n,i,r)}static fromCartesian(t,n,i){let r=l(n)?n.oneOverRadii:ll._ellipsoidOneOverRadii,o=l(n)?n.oneOverRadiiSquared:ll._ellipsoidOneOverRadiiSquared,a=l(n)?n._centerToleranceSquared:ll._ellipsoidCenterToleranceSquared,s=wT(t,r,o,a,tNe);if(!l(s))return;let c=h.multiplyComponents(s,o,eNe);c=h.normalize(c,c);let u=h.subtract(t,s,nNe),f=Math.atan2(c.y,c.x),d=Math.asin(c.z),p=I.sign(h.dot(u,t))*h.magnitude(u);return l(i)?(i.longitude=f,i.latitude=d,i.height=p,i):new ll(f,d,p)}static toCartesian(t,n,i){return h.fromRadians(t.longitude,t.latitude,t.height,n,i)}static clone(t,n){if(l(t))return l(n)?(n.longitude=t.longitude,n.latitude=t.latitude,n.height=t.height,n):new ll(t.longitude,t.latitude,t.height)}static equals(t,n){return t===n||l(t)&&l(n)&&t.longitude===n.longitude&&t.latitude===n.latitude&&t.height===n.height}static equalsEpsilon(t,n,i){return i=i??0,t===n||l(t)&&l(n)&&Math.abs(t.longitude-n.longitude)<=i&&Math.abs(t.latitude-n.latitude)<=i&&Math.abs(t.height-n.height)<=i}clone(t){return ll.clone(this,t)}equals(t){return ll.equals(this,t)}equalsEpsilon(t,n){return ll.equalsEpsilon(this,t,n)}toString(){return`(${this.longitude}, ${this.latitude}, ${this.height})`}};at(ll,"_ellipsoidOneOverRadii",new h(1/6378137,1/6378137,1/6356752314245179e-9)),at(ll,"_ellipsoidOneOverRadiiSquared",new h(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9))),at(ll,"_ellipsoidCenterToleranceSquared",I.EPSILON1);var kw=ll;kw.ZERO=Object.freeze(new kw(0,0,0));var eNe=new h,tNe=new h,nNe=new h,de=kw;var Ko=class e{constructor(t,n){this.x=t??0,this.y=n??0}static fromElements(t,n,i){return l(i)?(i.x=t,i.y=n,i):new e(t,n)}static clone(t,n){if(l(t))return l(n)?(n.x=t.x,n.y=t.y,n):new e(t.x,t.y)}static pack(t,n,i){return i=i??0,n[i++]=t.x,n[i]=t.y,n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i.x=t[n++],i.y=t[n],i}static packArray(t,n){let i=t.length,r=i*2;l(n)?!Array.isArray(n)&&n.length!==r||n.length!==r&&(n.length=r):n=new Array(r);for(let o=0;o<i;++o)e.pack(t[o],n,o*2);return n}static unpackArray(t,n){let i=t.length;l(n)?n.length=i/2:n=new Array(i/2);for(let r=0;r<i;r+=2){let o=r/2;n[o]=e.unpack(t,r,n[o])}return n}static maximumComponent(t){return Math.max(t.x,t.y)}static minimumComponent(t){return Math.min(t.x,t.y)}static minimumByComponent(t,n,i){return i.x=Math.min(t.x,n.x),i.y=Math.min(t.y,n.y),i}static maximumByComponent(t,n,i){return i.x=Math.max(t.x,n.x),i.y=Math.max(t.y,n.y),i}static clamp(t,n,i,r){let o=I.clamp(t.x,n.x,i.x),a=I.clamp(t.y,n.y,i.y);return r.x=o,r.y=a,r}static magnitudeSquared(t){return t.x*t.x+t.y*t.y}static magnitude(t){return Math.sqrt(e.magnitudeSquared(t))}static distance(t,n){return e.subtract(t,n,eM),e.magnitude(eM)}static distanceSquared(t,n){return e.subtract(t,n,eM),e.magnitudeSquared(eM)}static normalize(t,n){let i=e.magnitude(t);return n.x=t.x/i,n.y=t.y/i,n}static dot(t,n){return t.x*n.x+t.y*n.y}static cross(t,n){return t.x*n.y-t.y*n.x}static multiplyComponents(t,n,i){return i.x=t.x*n.x,i.y=t.y*n.y,i}static divideComponents(t,n,i){return i.x=t.x/n.x,i.y=t.y/n.y,i}static add(t,n,i){return i.x=t.x+n.x,i.y=t.y+n.y,i}static subtract(t,n,i){return i.x=t.x-n.x,i.y=t.y-n.y,i}static multiplyByScalar(t,n,i){return i.x=t.x*n,i.y=t.y*n,i}static divideByScalar(t,n,i){return i.x=t.x/n,i.y=t.y/n,i}static negate(t,n){return n.x=-t.x,n.y=-t.y,n}static abs(t,n){return n.x=Math.abs(t.x),n.y=Math.abs(t.y),n}static lerp(t,n,i,r){return e.multiplyByScalar(n,i,Zre),r=e.multiplyByScalar(t,1-i,r),e.add(Zre,r,r)}static angleBetween(t,n){return e.normalize(t,Qre),e.normalize(n,eoe),I.acosClamped(e.dot(Qre,eoe))}static mostOrthogonalAxis(t,n){let i=e.normalize(t,iNe);return e.abs(i,i),i.x<=i.y?n=e.clone(e.UNIT_X,n):n=e.clone(e.UNIT_Y,n),n}static equals(t,n){return t===n||l(t)&&l(n)&&t.x===n.x&&t.y===n.y}static equalsArray(t,n,i){return t.x===n[i]&&t.y===n[i+1]}static equalsEpsilon(t,n,i,r){return t===n||l(t)&&l(n)&&I.equalsEpsilon(t.x,n.x,i,r)&&I.equalsEpsilon(t.y,n.y,i,r)}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}equalsEpsilon(t,n,i){return e.equalsEpsilon(this,t,n,i)}toString(){return`(${this.x}, ${this.y})`}};Ko.fromCartesian3=Ko.clone;Ko.fromCartesian4=Ko.clone;Ko.packedLength=2;Ko.fromArray=Ko.unpack;var eM=new Ko,Zre=new Ko,Qre=new Ko,eoe=new Ko,iNe=new Ko;Ko.ZERO=Object.freeze(new Ko(0,0));Ko.ONE=Object.freeze(new Ko(1,1));Ko.UNIT_X=Object.freeze(new Ko(1,0));Ko.UNIT_Y=Object.freeze(new Ko(0,1));var k=Ko;function toe(e,t,n,i){t=t??0,n=n??0,i=i??0,e._radii=new h(t,n,i),e._radiiSquared=new h(t*t,n*n,i*i),e._radiiToTheFourth=new h(t*t*t*t,n*n*n*n,i*i*i*i),e._oneOverRadii=new h(t===0?0:1/t,n===0?0:1/n,i===0?0:1/i),e._oneOverRadiiSquared=new h(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=I.EPSILON1,e._radiiSquared.z!==0&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}var ul=class e{constructor(t,n,i){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,toe(this,t,n,i)}get radii(){return this._radii}get radiiSquared(){return this._radiiSquared}get radiiToTheFourth(){return this._radiiToTheFourth}get oneOverRadii(){return this._oneOverRadii}get oneOverRadiiSquared(){return this._oneOverRadiiSquared}get minimumRadius(){return this._minimumRadius}get maximumRadius(){return this._maximumRadius}static clone(t,n){if(!l(t))return;let i=t._radii;return l(n)?(h.clone(i,n._radii),h.clone(t._radiiSquared,n._radiiSquared),h.clone(t._radiiToTheFourth,n._radiiToTheFourth),h.clone(t._oneOverRadii,n._oneOverRadii),h.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new e(i.x,i.y,i.z)}static fromCartesian3(t,n){return l(n)||(n=new e),l(t)&&toe(n,t.x,t.y,t.z),n}static get default(){return e._default}static set default(t){e._default=t,h._ellipsoidRadiiSquared=t.radiiSquared,de._ellipsoidOneOverRadii=t.oneOverRadii,de._ellipsoidOneOverRadiiSquared=t.oneOverRadiiSquared,de._ellipsoidCenterToleranceSquared=t._centerToleranceSquared}clone(t){return e.clone(this,t)}static pack(t,n,i){return i=i??0,h.pack(t._radii,n,i),n}static unpack(t,n,i){n=n??0;let r=h.unpack(t,n);return e.fromCartesian3(r,i)}geodeticSurfaceNormalCartographic(t,n){let i=t.longitude,r=t.latitude,o=Math.cos(r),a=o*Math.cos(i),s=o*Math.sin(i),c=Math.sin(r);return l(n)||(n=new h),n.x=a,n.y=s,n.z=c,h.normalize(n,n)}geodeticSurfaceNormal(t,n){if(!h.equalsEpsilon(t,h.ZERO,I.EPSILON14))return l(n)||(n=new h),n=h.multiplyComponents(t,this._oneOverRadiiSquared,n),h.normalize(n,n)}cartographicToCartesian(t,n){let i=rNe,r=oNe;this.geodeticSurfaceNormalCartographic(t,i),h.multiplyComponents(this._radiiSquared,i,r);let o=Math.sqrt(h.dot(i,r));return h.divideByScalar(r,o,r),h.multiplyByScalar(i,t.height,i),l(n)||(n=new h),h.add(r,i,n)}cartographicArrayToCartesianArray(t,n){let i=t.length;l(n)?n.length=i:n=new Array(i);for(let r=0;r<i;r++)n[r]=this.cartographicToCartesian(t[r],n[r]);return n}cartesianToCartographic(t,n){let i=this.scaleToGeodeticSurface(t,sNe);if(!l(i))return;let r=this.geodeticSurfaceNormal(i,aNe),o=h.subtract(t,i,cNe),a=Math.atan2(r.y,r.x),s=Math.asin(r.z),c=I.sign(h.dot(o,t))*h.magnitude(o);return l(n)?(n.longitude=a,n.latitude=s,n.height=c,n):new de(a,s,c)}cartesianArrayToCartographicArray(t,n){let i=t.length;l(n)?n.length=i:n=new Array(i);for(let r=0;r<i;++r)n[r]=this.cartesianToCartographic(t[r],n[r]);return n}scaleToGeodeticSurface(t,n){return wT(t,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,n)}scaleToGeocentricSurface(t,n){l(n)||(n=new h);let i=t.x,r=t.y,o=t.z,a=this._oneOverRadiiSquared,s=1/Math.sqrt(i*i*a.x+r*r*a.y+o*o*a.z);return h.multiplyByScalar(t,s,n)}transformPositionToScaledSpace(t,n){return l(n)||(n=new h),h.multiplyComponents(t,this._oneOverRadii,n)}transformPositionFromScaledSpace(t,n){return l(n)||(n=new h),h.multiplyComponents(t,this._radii,n)}equals(t){return this===t||l(t)&&h.equals(this._radii,t._radii)}toString(){return this._radii.toString()}getSurfaceNormalIntersectionWithZAxis(t,n,i){n=n??0;let r=this._squaredXOverSquaredZ;if(l(i)||(i=new h),i.x=0,i.y=0,i.z=t.z*(1-r),!(Math.abs(i.z)>=this._radii.z-n))return i}getLocalCurvature(t,n){l(n)||(n=new k);let i=this.getSurfaceNormalIntersectionWithZAxis(t,0,lNe),r=h.distance(t,i),o=this.minimumRadius*r/this.maximumRadius**2,a=r*o**2;return k.fromElements(1/r,1/a,n)}surfaceArea(t){let n=t.west,i=t.east,r=t.south,o=t.north;for(;i<n;)i+=I.TWO_PI;let a=this._radiiSquared,s=a.x,c=a.y,u=a.z,f=s*c;return noe(r,o,function(d){let p=Math.cos(d),g=Math.sin(d);return Math.cos(d)*noe(n,i,function(m){let y=Math.cos(m),A=Math.sin(m);return Math.sqrt(f*g*g+u*(c*y*y+s*A*A)*p*p)})})}};ul.WGS84=Object.freeze(new ul(6378137,6378137,6356752314245179e-9));ul.UNIT_SPHERE=Object.freeze(new ul(1,1,1));ul.MOON=Object.freeze(new ul(I.LUNAR_RADIUS,I.LUNAR_RADIUS,I.LUNAR_RADIUS));ul.MARS=Object.freeze(new ul(3396190,3396190,3376200));ul._default=ul.WGS84;ul.packedLength=h.packedLength;ul.prototype.geocentricSurfaceNormal=h.normalize;var rNe=new h,oNe=new h,aNe=new h,sNe=new h,cNe=new h,lNe=new h,uNe=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],fNe=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function noe(e,t,n){let i=.5*(t+e),r=.5*(t-e),o=0;for(let a=0;a<5;a++){let s=r*uNe[a];o+=fNe[a]*(n(i+s)+n(i-s))}return o*=r,o}var te=ul;var A7=class{constructor(t){this._ellipsoid=t??te.default,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}get ellipsoid(){return this._ellipsoid}project(t,n){let i=this._semimajorAxis,r=t.longitude*i,o=t.latitude*i,a=t.height;return l(n)?(n.x=r,n.y=o,n.z=a,n):new h(r,o,a)}unproject(t,n){let i=this._oneOverSemimajorAxis,r=t.x*i,o=t.y*i,a=t.z;return l(n)?(n.longitude=r,n.latitude=o,n.height=a,n):new de(r,o,a)}},ki=A7;var ioe={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};Object.freeze(ioe);var Xt=ioe;function dNe(e,t){this.start=e??0,this.stop=t??0}var $o=dNe;var fr=class e{constructor(t,n,i,r,o,a,s,c,u){this[0]=t??0,this[1]=r??0,this[2]=s??0,this[3]=n??0,this[4]=o??0,this[5]=c??0,this[6]=i??0,this[7]=a??0,this[8]=u??0}static pack(t,n,i){return i=i??0,n[i++]=t[0],n[i++]=t[1],n[i++]=t[2],n[i++]=t[3],n[i++]=t[4],n[i++]=t[5],n[i++]=t[6],n[i++]=t[7],n[i]=t[8],n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i[0]=t[n++],i[1]=t[n++],i[2]=t[n++],i[3]=t[n++],i[4]=t[n++],i[5]=t[n++],i[6]=t[n++],i[7]=t[n++],i[8]=t[n],i}static packArray(t,n){let i=t.length,r=i*9;l(n)?!Array.isArray(n)&&n.length!==r||n.length!==r&&(n.length=r):n=new Array(r);for(let o=0;o<i;++o)e.pack(t[o],n,o*9);return n}static unpackArray(t,n){let i=t.length;l(n)?n.length=i/9:n=new Array(i/9);for(let r=0;r<i;r+=9){let o=r/9;n[o]=e.unpack(t,r,n[o])}return n}static clone(t,n){if(l(t))return l(n)?(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):new e(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8])}static fromColumnMajorArray(t,n){return e.clone(t,n)}static fromRowMajorArray(t,n){return l(n)?(n[0]=t[0],n[1]=t[3],n[2]=t[6],n[3]=t[1],n[4]=t[4],n[5]=t[7],n[6]=t[2],n[7]=t[5],n[8]=t[8],n):new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])}static fromQuaternion(t,n){let i=t.x*t.x,r=t.x*t.y,o=t.x*t.z,a=t.x*t.w,s=t.y*t.y,c=t.y*t.z,u=t.y*t.w,f=t.z*t.z,d=t.z*t.w,p=t.w*t.w,g=i-s-f+p,m=2*(r-d),y=2*(o+u),A=2*(r+d),b=-i+s-f+p,x=2*(c-a),T=2*(o-u),C=2*(c+a),E=-i-s+f+p;return l(n)?(n[0]=g,n[1]=A,n[2]=T,n[3]=m,n[4]=b,n[5]=C,n[6]=y,n[7]=x,n[8]=E,n):new e(g,m,y,A,b,x,T,C,E)}static fromHeadingPitchRoll(t,n){let i=Math.cos(-t.pitch),r=Math.cos(-t.heading),o=Math.cos(t.roll),a=Math.sin(-t.pitch),s=Math.sin(-t.heading),c=Math.sin(t.roll),u=i*r,f=-o*s+c*a*r,d=c*s+o*a*r,p=i*s,g=o*r+c*a*s,m=-c*r+o*a*s,y=-a,A=c*i,b=o*i;return l(n)?(n[0]=u,n[1]=p,n[2]=y,n[3]=f,n[4]=g,n[5]=A,n[6]=d,n[7]=m,n[8]=b,n):new e(u,f,d,p,g,m,y,A,b)}static fromScale(t,n){return l(n)?(n[0]=t.x,n[1]=0,n[2]=0,n[3]=0,n[4]=t.y,n[5]=0,n[6]=0,n[7]=0,n[8]=t.z,n):new e(t.x,0,0,0,t.y,0,0,0,t.z)}static fromUniformScale(t,n){return l(n)?(n[0]=t,n[1]=0,n[2]=0,n[3]=0,n[4]=t,n[5]=0,n[6]=0,n[7]=0,n[8]=t,n):new e(t,0,0,0,t,0,0,0,t)}static fromCrossProduct(t,n){return l(n)?(n[0]=0,n[1]=t.z,n[2]=-t.y,n[3]=-t.z,n[4]=0,n[5]=t.x,n[6]=t.y,n[7]=-t.x,n[8]=0,n):new e(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)}static fromRotationX(t,n){let i=Math.cos(t),r=Math.sin(t);return l(n)?(n[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=i,n[5]=r,n[6]=0,n[7]=-r,n[8]=i,n):new e(1,0,0,0,i,-r,0,r,i)}static fromRotationY(t,n){let i=Math.cos(t),r=Math.sin(t);return l(n)?(n[0]=i,n[1]=0,n[2]=-r,n[3]=0,n[4]=1,n[5]=0,n[6]=r,n[7]=0,n[8]=i,n):new e(i,0,r,0,1,0,-r,0,i)}static fromRotationZ(t,n){let i=Math.cos(t),r=Math.sin(t);return l(n)?(n[0]=i,n[1]=r,n[2]=0,n[3]=-r,n[4]=i,n[5]=0,n[6]=0,n[7]=0,n[8]=1,n):new e(i,-r,0,r,i,0,0,0,1)}static toArray(t,n){return l(n)?(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):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]}static getElementIndex(t,n){return t*3+n}static getColumn(t,n,i){let r=n*3,o=t[r],a=t[r+1],s=t[r+2];return i.x=o,i.y=a,i.z=s,i}static setColumn(t,n,i,r){r=e.clone(t,r);let o=n*3;return r[o]=i.x,r[o+1]=i.y,r[o+2]=i.z,r}static getRow(t,n,i){let r=t[n],o=t[n+3],a=t[n+6];return i.x=r,i.y=o,i.z=a,i}static setRow(t,n,i,r){return r=e.clone(t,r),r[n]=i.x,r[n+3]=i.y,r[n+6]=i.z,r}static setScale(t,n,i){let r=e.getScale(t,hNe),o=n.x/r.x,a=n.y/r.y,s=n.z/r.z;return i[0]=t[0]*o,i[1]=t[1]*o,i[2]=t[2]*o,i[3]=t[3]*a,i[4]=t[4]*a,i[5]=t[5]*a,i[6]=t[6]*s,i[7]=t[7]*s,i[8]=t[8]*s,i}static setUniformScale(t,n,i){let r=e.getScale(t,mNe),o=n/r.x,a=n/r.y,s=n/r.z;return i[0]=t[0]*o,i[1]=t[1]*o,i[2]=t[2]*o,i[3]=t[3]*a,i[4]=t[4]*a,i[5]=t[5]*a,i[6]=t[6]*s,i[7]=t[7]*s,i[8]=t[8]*s,i}static getScale(t,n){return n.x=h.magnitude(h.fromElements(t[0],t[1],t[2],b7)),n.y=h.magnitude(h.fromElements(t[3],t[4],t[5],b7)),n.z=h.magnitude(h.fromElements(t[6],t[7],t[8],b7)),n}static getMaximumScale(t){return e.getScale(t,roe),h.maximumComponent(roe)}static setRotation(t,n,i){let r=e.getScale(t,pNe);return i[0]=n[0]*r.x,i[1]=n[1]*r.x,i[2]=n[2]*r.x,i[3]=n[3]*r.y,i[4]=n[4]*r.y,i[5]=n[5]*r.y,i[6]=n[6]*r.z,i[7]=n[7]*r.z,i[8]=n[8]*r.z,i}static getRotation(t,n){let i=e.getScale(t,gNe);return n[0]=t[0]/i.x,n[1]=t[1]/i.x,n[2]=t[2]/i.x,n[3]=t[3]/i.y,n[4]=t[4]/i.y,n[5]=t[5]/i.y,n[6]=t[6]/i.z,n[7]=t[7]/i.z,n[8]=t[8]/i.z,n}static multiply(t,n,i){let r=t[0]*n[0]+t[3]*n[1]+t[6]*n[2],o=t[1]*n[0]+t[4]*n[1]+t[7]*n[2],a=t[2]*n[0]+t[5]*n[1]+t[8]*n[2],s=t[0]*n[3]+t[3]*n[4]+t[6]*n[5],c=t[1]*n[3]+t[4]*n[4]+t[7]*n[5],u=t[2]*n[3]+t[5]*n[4]+t[8]*n[5],f=t[0]*n[6]+t[3]*n[7]+t[6]*n[8],d=t[1]*n[6]+t[4]*n[7]+t[7]*n[8],p=t[2]*n[6]+t[5]*n[7]+t[8]*n[8];return i[0]=r,i[1]=o,i[2]=a,i[3]=s,i[4]=c,i[5]=u,i[6]=f,i[7]=d,i[8]=p,i}static add(t,n,i){return i[0]=t[0]+n[0],i[1]=t[1]+n[1],i[2]=t[2]+n[2],i[3]=t[3]+n[3],i[4]=t[4]+n[4],i[5]=t[5]+n[5],i[6]=t[6]+n[6],i[7]=t[7]+n[7],i[8]=t[8]+n[8],i}static subtract(t,n,i){return i[0]=t[0]-n[0],i[1]=t[1]-n[1],i[2]=t[2]-n[2],i[3]=t[3]-n[3],i[4]=t[4]-n[4],i[5]=t[5]-n[5],i[6]=t[6]-n[6],i[7]=t[7]-n[7],i[8]=t[8]-n[8],i}static multiplyByVector(t,n,i){let r=n.x,o=n.y,a=n.z,s=t[0]*r+t[3]*o+t[6]*a,c=t[1]*r+t[4]*o+t[7]*a,u=t[2]*r+t[5]*o+t[8]*a;return i.x=s,i.y=c,i.z=u,i}static multiplyByScalar(t,n,i){return i[0]=t[0]*n,i[1]=t[1]*n,i[2]=t[2]*n,i[3]=t[3]*n,i[4]=t[4]*n,i[5]=t[5]*n,i[6]=t[6]*n,i[7]=t[7]*n,i[8]=t[8]*n,i}static multiplyByScale(t,n,i){return i[0]=t[0]*n.x,i[1]=t[1]*n.x,i[2]=t[2]*n.x,i[3]=t[3]*n.y,i[4]=t[4]*n.y,i[5]=t[5]*n.y,i[6]=t[6]*n.z,i[7]=t[7]*n.z,i[8]=t[8]*n.z,i}static multiplyByUniformScale(t,n,i){return i[0]=t[0]*n,i[1]=t[1]*n,i[2]=t[2]*n,i[3]=t[3]*n,i[4]=t[4]*n,i[5]=t[5]*n,i[6]=t[6]*n,i[7]=t[7]*n,i[8]=t[8]*n,i}static negate(t,n){return 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}static transpose(t,n){let i=t[0],r=t[3],o=t[6],a=t[1],s=t[4],c=t[7],u=t[2],f=t[5],d=t[8];return n[0]=i,n[1]=r,n[2]=o,n[3]=a,n[4]=s,n[5]=c,n[6]=u,n[7]=f,n[8]=d,n}static computeEigenDecomposition(t,n){let i=I.EPSILON20,r=10,o=0,a=0;l(n)||(n={});let s=n.unitary=e.clone(e.IDENTITY,n.unitary),c=n.diagonal=e.clone(t,n.diagonal),u=i*yNe(c);for(;a<r&&ANe(c)>u;)bNe(c,tM),e.transpose(tM,ooe),e.multiply(c,tM,c),e.multiply(ooe,c,c),e.multiply(s,tM,s),++o>2&&(++a,o=0);return n}static abs(t,n){return n[0]=Math.abs(t[0]),n[1]=Math.abs(t[1]),n[2]=Math.abs(t[2]),n[3]=Math.abs(t[3]),n[4]=Math.abs(t[4]),n[5]=Math.abs(t[5]),n[6]=Math.abs(t[6]),n[7]=Math.abs(t[7]),n[8]=Math.abs(t[8]),n}static determinant(t){let n=t[0],i=t[3],r=t[6],o=t[1],a=t[4],s=t[7],c=t[2],u=t[5],f=t[8];return n*(a*f-u*s)+o*(u*r-i*f)+c*(i*s-a*r)}static inverse(t,n){let i=t[0],r=t[1],o=t[2],a=t[3],s=t[4],c=t[5],u=t[6],f=t[7],d=t[8],p=e.determinant(t);n[0]=s*d-f*c,n[1]=f*o-r*d,n[2]=r*c-s*o,n[3]=u*c-a*d,n[4]=i*d-u*o,n[5]=a*o-i*c,n[6]=a*f-u*s,n[7]=u*r-i*f,n[8]=i*s-a*r;let g=1/p;return e.multiplyByScalar(n,g,n)}static inverseTranspose(t,n){return e.inverse(e.transpose(t,_Ne),n)}static equals(t,n){return t===n||l(t)&&l(n)&&t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]&&t[4]===n[4]&&t[5]===n[5]&&t[6]===n[6]&&t[7]===n[7]&&t[8]===n[8]}static equalsEpsilon(t,n,i){return i=i??0,t===n||l(t)&&l(n)&&Math.abs(t[0]-n[0])<=i&&Math.abs(t[1]-n[1])<=i&&Math.abs(t[2]-n[2])<=i&&Math.abs(t[3]-n[3])<=i&&Math.abs(t[4]-n[4])<=i&&Math.abs(t[5]-n[5])<=i&&Math.abs(t[6]-n[6])<=i&&Math.abs(t[7]-n[7])<=i&&Math.abs(t[8]-n[8])<=i}get length(){return e.packedLength}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}static equalsArray(t,n,i){return t[0]===n[i]&&t[1]===n[i+1]&&t[2]===n[i+2]&&t[3]===n[i+3]&&t[4]===n[i+4]&&t[5]===n[i+5]&&t[6]===n[i+6]&&t[7]===n[i+7]&&t[8]===n[i+8]}equalsEpsilon(t,n){return e.equalsEpsilon(this,t,n)}toString(){return`(${this[0]}, ${this[3]}, ${this[6]})
|
|
(${this[1]}, ${this[4]}, ${this[7]})
|
|
(${this[2]}, ${this[5]}, ${this[8]})`}};fr.packedLength=9;fr.fromArray=fr.unpack;fr.IDENTITY=Object.freeze(new fr(1,0,0,0,1,0,0,0,1));fr.ZERO=Object.freeze(new fr(0,0,0,0,0,0,0,0,0));fr.COLUMN0ROW0=0;fr.COLUMN0ROW1=1;fr.COLUMN0ROW2=2;fr.COLUMN1ROW0=3;fr.COLUMN1ROW1=4;fr.COLUMN1ROW2=5;fr.COLUMN2ROW0=6;fr.COLUMN2ROW1=7;fr.COLUMN2ROW2=8;var hNe=new h,mNe=new h,b7=new h,roe=new h,pNe=new h,gNe=new h,tM=new fr,ooe=new fr,_Ne=new fr;function yNe(e){let t=0;for(let n=0;n<9;++n){let i=e[n];t+=i*i}return Math.sqrt(t)}var x7=[1,0,0],T7=[2,2,1];function ANe(e){let t=0;for(let n=0;n<3;++n){let i=e[fr.getElementIndex(T7[n],x7[n])];t+=2*i*i}return Math.sqrt(t)}function bNe(e,t){let n=I.EPSILON15,i=0,r=1;for(let u=0;u<3;++u){let f=Math.abs(e[fr.getElementIndex(T7[u],x7[u])]);f>i&&(r=u,i=f)}let o=1,a=0,s=x7[r],c=T7[r];if(Math.abs(e[fr.getElementIndex(c,s)])>n){let u=e[fr.getElementIndex(c,c)],f=e[fr.getElementIndex(s,s)],d=e[fr.getElementIndex(c,s)],p=(u-f)/2/d,g;p<0?g=-1/(-p+Math.sqrt(1+p*p)):g=1/(p+Math.sqrt(1+p*p)),o=1/Math.sqrt(1+g*g),a=g*o}return t=fr.clone(fr.IDENTITY,t),t[fr.getElementIndex(s,s)]=t[fr.getElementIndex(c,c)]=o,t[fr.getElementIndex(c,s)]=a,t[fr.getElementIndex(s,c)]=-a,t}var $=fr;var Na=class e{constructor(t,n,i,r){this.x=t??0,this.y=n??0,this.z=i??0,this.w=r??0}static fromElements(t,n,i,r,o){return l(o)?(o.x=t,o.y=n,o.z=i,o.w=r,o):new e(t,n,i,r)}static fromColor(t,n){return l(n)?(n.x=t.red,n.y=t.green,n.z=t.blue,n.w=t.alpha,n):new e(t.red,t.green,t.blue,t.alpha)}static clone(t,n){if(l(t))return l(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n.w=t.w,n):new e(t.x,t.y,t.z,t.w)}static pack(t,n,i){return i=i??0,n[i++]=t.x,n[i++]=t.y,n[i++]=t.z,n[i]=t.w,n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i.x=t[n++],i.y=t[n++],i.z=t[n++],i.w=t[n],i}static packArray(t,n){let i=t.length,r=i*4;l(n)?!Array.isArray(n)&&n.length!==r||n.length!==r&&(n.length=r):n=new Array(r);for(let o=0;o<i;++o)e.pack(t[o],n,o*4);return n}static unpackArray(t,n){let i=t.length;l(n)?n.length=i/4:n=new Array(i/4);for(let r=0;r<i;r+=4){let o=r/4;n[o]=e.unpack(t,r,n[o])}return n}static maximumComponent(t){return Math.max(t.x,t.y,t.z,t.w)}static minimumComponent(t){return Math.min(t.x,t.y,t.z,t.w)}static minimumByComponent(t,n,i){return i.x=Math.min(t.x,n.x),i.y=Math.min(t.y,n.y),i.z=Math.min(t.z,n.z),i.w=Math.min(t.w,n.w),i}static maximumByComponent(t,n,i){return i.x=Math.max(t.x,n.x),i.y=Math.max(t.y,n.y),i.z=Math.max(t.z,n.z),i.w=Math.max(t.w,n.w),i}static clamp(t,n,i,r){let o=I.clamp(t.x,n.x,i.x),a=I.clamp(t.y,n.y,i.y),s=I.clamp(t.z,n.z,i.z),c=I.clamp(t.w,n.w,i.w);return r.x=o,r.y=a,r.z=s,r.w=c,r}static magnitudeSquared(t){return t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w}static magnitude(t){return Math.sqrt(e.magnitudeSquared(t))}static distance(t,n){return e.subtract(t,n,nM),e.magnitude(nM)}static distanceSquared(t,n){return e.subtract(t,n,nM),e.magnitudeSquared(nM)}static normalize(t,n){let i=e.magnitude(t);return n.x=t.x/i,n.y=t.y/i,n.z=t.z/i,n.w=t.w/i,n}static dot(t,n){return t.x*n.x+t.y*n.y+t.z*n.z+t.w*n.w}static multiplyComponents(t,n,i){return i.x=t.x*n.x,i.y=t.y*n.y,i.z=t.z*n.z,i.w=t.w*n.w,i}static divideComponents(t,n,i){return i.x=t.x/n.x,i.y=t.y/n.y,i.z=t.z/n.z,i.w=t.w/n.w,i}static add(t,n,i){return i.x=t.x+n.x,i.y=t.y+n.y,i.z=t.z+n.z,i.w=t.w+n.w,i}static subtract(t,n,i){return i.x=t.x-n.x,i.y=t.y-n.y,i.z=t.z-n.z,i.w=t.w-n.w,i}static multiplyByScalar(t,n,i){return i.x=t.x*n,i.y=t.y*n,i.z=t.z*n,i.w=t.w*n,i}static divideByScalar(t,n,i){return i.x=t.x/n,i.y=t.y/n,i.z=t.z/n,i.w=t.w/n,i}static negate(t,n){return n.x=-t.x,n.y=-t.y,n.z=-t.z,n.w=-t.w,n}static abs(t,n){return n.x=Math.abs(t.x),n.y=Math.abs(t.y),n.z=Math.abs(t.z),n.w=Math.abs(t.w),n}static lerp(t,n,i,r){return e.multiplyByScalar(n,i,aoe),r=e.multiplyByScalar(t,1-i,r),e.add(aoe,r,r)}static mostOrthogonalAxis(t,n){let i=e.normalize(t,xNe);return e.abs(i,i),i.x<=i.y?i.x<=i.z?i.x<=i.w?n=e.clone(e.UNIT_X,n):n=e.clone(e.UNIT_W,n):i.z<=i.w?n=e.clone(e.UNIT_Z,n):n=e.clone(e.UNIT_W,n):i.y<=i.z?i.y<=i.w?n=e.clone(e.UNIT_Y,n):n=e.clone(e.UNIT_W,n):i.z<=i.w?n=e.clone(e.UNIT_Z,n):n=e.clone(e.UNIT_W,n),n}static equals(t,n){return t===n||l(t)&&l(n)&&t.x===n.x&&t.y===n.y&&t.z===n.z&&t.w===n.w}static equalsArray(t,n,i){return t.x===n[i]&&t.y===n[i+1]&&t.z===n[i+2]&&t.w===n[i+3]}static equalsEpsilon(t,n,i,r){return t===n||l(t)&&l(n)&&I.equalsEpsilon(t.x,n.x,i,r)&&I.equalsEpsilon(t.y,n.y,i,r)&&I.equalsEpsilon(t.z,n.z,i,r)&&I.equalsEpsilon(t.w,n.w,i,r)}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}equalsEpsilon(t,n,i){return e.equalsEpsilon(this,t,n,i)}toString(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`}static packFloat(t,n){return l(n)||(n=new e),C7[0]=t,soe?(n.x=Pc[0],n.y=Pc[1],n.z=Pc[2],n.w=Pc[3]):(n.x=Pc[3],n.y=Pc[2],n.z=Pc[1],n.w=Pc[0]),n}static unpackFloat(t){return soe?(Pc[0]=t.x,Pc[1]=t.y,Pc[2]=t.z,Pc[3]=t.w):(Pc[0]=t.w,Pc[1]=t.z,Pc[2]=t.y,Pc[3]=t.x),C7[0]}};Na.packedLength=4;Na.fromArray=Na.unpack;var nM=new Na,aoe=new Na,xNe=new Na;Na.ZERO=Object.freeze(new Na(0,0,0,0));Na.ONE=Object.freeze(new Na(1,1,1,1));Na.UNIT_X=Object.freeze(new Na(1,0,0,0));Na.UNIT_Y=Object.freeze(new Na(0,1,0,0));Na.UNIT_Z=Object.freeze(new Na(0,0,1,0));Na.UNIT_W=Object.freeze(new Na(0,0,0,1));var C7=new Float32Array(1),Pc=new Uint8Array(C7.buffer),TNe=new Uint32Array([287454020]),CNe=new Uint8Array(TNe.buffer),soe=CNe[0]===68,ae=Na;var v7={};v7.EMPTY_OBJECT=Object.freeze({});v7.EMPTY_ARRAY=Object.freeze([]);var H=v7;function zw(e){this.name="RuntimeError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(zw.prototype=Object.create(Error.prototype),zw.prototype.constructor=zw);zw.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=`
|
|
${this.stack.toString()}`),e};var oe=zw;var io=class e{constructor(t,n,i,r,o,a,s,c,u,f,d,p,g,m,y,A){this[0]=t??0,this[1]=o??0,this[2]=u??0,this[3]=g??0,this[4]=n??0,this[5]=a??0,this[6]=f??0,this[7]=m??0,this[8]=i??0,this[9]=s??0,this[10]=d??0,this[11]=y??0,this[12]=r??0,this[13]=c??0,this[14]=p??0,this[15]=A??0}static pack(t,n,i){return i=i??0,n[i++]=t[0],n[i++]=t[1],n[i++]=t[2],n[i++]=t[3],n[i++]=t[4],n[i++]=t[5],n[i++]=t[6],n[i++]=t[7],n[i++]=t[8],n[i++]=t[9],n[i++]=t[10],n[i++]=t[11],n[i++]=t[12],n[i++]=t[13],n[i++]=t[14],n[i]=t[15],n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i[0]=t[n++],i[1]=t[n++],i[2]=t[n++],i[3]=t[n++],i[4]=t[n++],i[5]=t[n++],i[6]=t[n++],i[7]=t[n++],i[8]=t[n++],i[9]=t[n++],i[10]=t[n++],i[11]=t[n++],i[12]=t[n++],i[13]=t[n++],i[14]=t[n++],i[15]=t[n],i}static packArray(t,n){let i=t.length,r=i*16;l(n)?!Array.isArray(n)&&n.length!==r||n.length!==r&&(n.length=r):n=new Array(r);for(let o=0;o<i;++o)e.pack(t[o],n,o*16);return n}static unpackArray(t,n){let i=t.length;l(n)?n.length=i/16:n=new Array(i/16);for(let r=0;r<i;r+=16){let o=r/16;n[o]=e.unpack(t,r,n[o])}return n}static clone(t,n){if(l(t))return l(n)?(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]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n):new e(t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15])}static fromColumnMajorArray(t,n){return e.clone(t,n)}static fromRowMajorArray(t,n){return l(n)?(n[0]=t[0],n[1]=t[4],n[2]=t[8],n[3]=t[12],n[4]=t[1],n[5]=t[5],n[6]=t[9],n[7]=t[13],n[8]=t[2],n[9]=t[6],n[10]=t[10],n[11]=t[14],n[12]=t[3],n[13]=t[7],n[14]=t[11],n[15]=t[15],n):new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}static fromRotationTranslation(t,n,i){return n=n??h.ZERO,l(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=n.x,i[13]=n.y,i[14]=n.z,i[15]=1,i):new e(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)}static fromTranslationQuaternionRotationScale(t,n,i,r){l(r)||(r=new e);let o=i.x,a=i.y,s=i.z,c=n.x*n.x,u=n.x*n.y,f=n.x*n.z,d=n.x*n.w,p=n.y*n.y,g=n.y*n.z,m=n.y*n.w,y=n.z*n.z,A=n.z*n.w,b=n.w*n.w,x=c-p-y+b,T=2*(u-A),C=2*(f+m),E=2*(u+A),w=-c+p-y+b,D=2*(g-d),R=2*(f-m),M=2*(g+d),N=-c-p+y+b;return r[0]=x*o,r[1]=E*o,r[2]=R*o,r[3]=0,r[4]=T*a,r[5]=w*a,r[6]=M*a,r[7]=0,r[8]=C*s,r[9]=D*s,r[10]=N*s,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,r}static fromTranslationRotationScale(t,n){return e.fromTranslationQuaternionRotationScale(t.translation,t.rotation,t.scale,n)}static fromTranslation(t,n){return e.fromRotationTranslation($.IDENTITY,t,n)}static fromScale(t,n){return l(n)?(n[0]=t.x,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=t.y,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=t.z,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n):new e(t.x,0,0,0,0,t.y,0,0,0,0,t.z,0,0,0,0,1)}static fromUniformScale(t,n){return l(n)?(n[0]=t,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=t,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=t,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n):new e(t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1)}static fromRotation(t,n){return l(n)||(n=new e),n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=0,n[4]=t[3],n[5]=t[4],n[6]=t[5],n[7]=0,n[8]=t[6],n[9]=t[7],n[10]=t[8],n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}static fromCamera(t,n){let i=t.position,r=t.direction,o=t.up;h.normalize(r,IT),h.normalize(h.cross(IT,o,PT),PT),h.normalize(h.cross(PT,IT,Uw),Uw);let a=PT.x,s=PT.y,c=PT.z,u=IT.x,f=IT.y,d=IT.z,p=Uw.x,g=Uw.y,m=Uw.z,y=i.x,A=i.y,b=i.z,x=a*-y+s*-A+c*-b,T=p*-y+g*-A+m*-b,C=u*y+f*A+d*b;return l(n)?(n[0]=a,n[1]=p,n[2]=-u,n[3]=0,n[4]=s,n[5]=g,n[6]=-f,n[7]=0,n[8]=c,n[9]=m,n[10]=-d,n[11]=0,n[12]=x,n[13]=T,n[14]=C,n[15]=1,n):new e(a,s,c,x,p,g,m,T,-u,-f,-d,C,0,0,0,1)}static computePerspectiveFieldOfView(t,n,i,r,o){let s=1/Math.tan(t*.5),c=s/n,u=(r+i)/(i-r),f=2*r*i/(i-r);return o[0]=c,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=u,o[11]=-1,o[12]=0,o[13]=0,o[14]=f,o[15]=0,o}static computeOrthographicOffCenter(t,n,i,r,o,a,s){let c=1/(n-t),u=1/(r-i),f=1/(a-o),d=-(n+t)*c,p=-(r+i)*u,g=-(a+o)*f;return c*=2,u*=2,f*=-2,s[0]=c,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=u,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=f,s[11]=0,s[12]=d,s[13]=p,s[14]=g,s[15]=1,s}static computePerspectiveOffCenter(t,n,i,r,o,a,s){let c=2*o/(n-t),u=2*o/(r-i),f=(n+t)/(n-t),d=(r+i)/(r-i),p=-(a+o)/(a-o),g=-1,m=-2*a*o/(a-o);return s[0]=c,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=u,s[6]=0,s[7]=0,s[8]=f,s[9]=d,s[10]=p,s[11]=g,s[12]=0,s[13]=0,s[14]=m,s[15]=0,s}static computeInfinitePerspectiveOffCenter(t,n,i,r,o,a){let s=2*o/(n-t),c=2*o/(r-i),u=(n+t)/(n-t),f=(r+i)/(r-i),d=-1,p=-1,g=-2*o;return a[0]=s,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=c,a[6]=0,a[7]=0,a[8]=u,a[9]=f,a[10]=d,a[11]=p,a[12]=0,a[13]=0,a[14]=g,a[15]=0,a}static computeViewportTransformation(t,n,i,r){l(r)||(r=new e),t=t??H.EMPTY_OBJECT;let o=t.x??0,a=t.y??0,s=t.width??0,c=t.height??0;n=n??0,i=i??1;let u=s*.5,f=c*.5,d=(i-n)*.5,p=u,g=f,m=d,y=o+u,A=a+f,b=n+d,x=1;return r[0]=p,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=g,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=m,r[11]=0,r[12]=y,r[13]=A,r[14]=b,r[15]=x,r}static computeView(t,n,i,r,o){return o[0]=r.x,o[1]=i.x,o[2]=-n.x,o[3]=0,o[4]=r.y,o[5]=i.y,o[6]=-n.y,o[7]=0,o[8]=r.z,o[9]=i.z,o[10]=-n.z,o[11]=0,o[12]=-h.dot(r,t),o[13]=-h.dot(i,t),o[14]=h.dot(n,t),o[15]=1,o}static toArray(t,n){return l(n)?(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]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]}static getElementIndex(t,n){return t*4+n}static getColumn(t,n,i){let r=n*4,o=t[r],a=t[r+1],s=t[r+2],c=t[r+3];return i.x=o,i.y=a,i.z=s,i.w=c,i}static setColumn(t,n,i,r){r=e.clone(t,r);let o=n*4;return r[o]=i.x,r[o+1]=i.y,r[o+2]=i.z,r[o+3]=i.w,r}static getRow(t,n,i){let r=t[n],o=t[n+4],a=t[n+8],s=t[n+12];return i.x=r,i.y=o,i.z=a,i.w=s,i}static setRow(t,n,i,r){return r=e.clone(t,r),r[n]=i.x,r[n+4]=i.y,r[n+8]=i.z,r[n+12]=i.w,r}static setTranslation(t,n,i){return i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i[4]=t[4],i[5]=t[5],i[6]=t[6],i[7]=t[7],i[8]=t[8],i[9]=t[9],i[10]=t[10],i[11]=t[11],i[12]=n.x,i[13]=n.y,i[14]=n.z,i[15]=t[15],i}static setScale(t,n,i){let r=e.getScale(t,vNe),o=n.x/r.x,a=n.y/r.y,s=n.z/r.z;return i[0]=t[0]*o,i[1]=t[1]*o,i[2]=t[2]*o,i[3]=t[3],i[4]=t[4]*a,i[5]=t[5]*a,i[6]=t[6]*a,i[7]=t[7],i[8]=t[8]*s,i[9]=t[9]*s,i[10]=t[10]*s,i[11]=t[11],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i}static setUniformScale(t,n,i){let r=e.getScale(t,ENe),o=n/r.x,a=n/r.y,s=n/r.z;return i[0]=t[0]*o,i[1]=t[1]*o,i[2]=t[2]*o,i[3]=t[3],i[4]=t[4]*a,i[5]=t[5]*a,i[6]=t[6]*a,i[7]=t[7],i[8]=t[8]*s,i[9]=t[9]*s,i[10]=t[10]*s,i[11]=t[11],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i}static getScale(t,n){return n.x=h.magnitude(h.fromElements(t[0],t[1],t[2],E7)),n.y=h.magnitude(h.fromElements(t[4],t[5],t[6],E7)),n.z=h.magnitude(h.fromElements(t[8],t[9],t[10],E7)),n}static getMaximumScale(t){return e.getScale(t,coe),h.maximumComponent(coe)}static setRotation(t,n,i){let r=e.getScale(t,SNe);return i[0]=n[0]*r.x,i[1]=n[1]*r.x,i[2]=n[2]*r.x,i[3]=t[3],i[4]=n[3]*r.y,i[5]=n[4]*r.y,i[6]=n[5]*r.y,i[7]=t[7],i[8]=n[6]*r.z,i[9]=n[7]*r.z,i[10]=n[8]*r.z,i[11]=t[11],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i}static getRotation(t,n){let i=e.getScale(t,wNe);return n[0]=t[0]/i.x,n[1]=t[1]/i.x,n[2]=t[2]/i.x,n[3]=t[4]/i.y,n[4]=t[5]/i.y,n[5]=t[6]/i.y,n[6]=t[8]/i.z,n[7]=t[9]/i.z,n[8]=t[10]/i.z,n}static multiply(t,n,i){let r=t[0],o=t[1],a=t[2],s=t[3],c=t[4],u=t[5],f=t[6],d=t[7],p=t[8],g=t[9],m=t[10],y=t[11],A=t[12],b=t[13],x=t[14],T=t[15],C=n[0],E=n[1],w=n[2],D=n[3],R=n[4],M=n[5],N=n[6],_=n[7],v=n[8],S=n[9],P=n[10],L=n[11],F=n[12],V=n[13],z=n[14],j=n[15],B=r*C+c*E+p*w+A*D,G=o*C+u*E+g*w+b*D,W=a*C+f*E+m*w+x*D,Q=s*C+d*E+y*w+T*D,q=r*R+c*M+p*N+A*_,J=o*R+u*M+g*N+b*_,Z=a*R+f*M+m*N+x*_,ce=s*R+d*M+y*N+T*_,Ae=r*v+c*S+p*P+A*L,le=o*v+u*S+g*P+b*L,Ce=a*v+f*S+m*P+x*L,ye=s*v+d*S+y*P+T*L,ve=r*F+c*V+p*z+A*j,Ie=o*F+u*V+g*z+b*j,Le=a*F+f*V+m*z+x*j,$e=s*F+d*V+y*z+T*j;return i[0]=B,i[1]=G,i[2]=W,i[3]=Q,i[4]=q,i[5]=J,i[6]=Z,i[7]=ce,i[8]=Ae,i[9]=le,i[10]=Ce,i[11]=ye,i[12]=ve,i[13]=Ie,i[14]=Le,i[15]=$e,i}static add(t,n,i){return i[0]=t[0]+n[0],i[1]=t[1]+n[1],i[2]=t[2]+n[2],i[3]=t[3]+n[3],i[4]=t[4]+n[4],i[5]=t[5]+n[5],i[6]=t[6]+n[6],i[7]=t[7]+n[7],i[8]=t[8]+n[8],i[9]=t[9]+n[9],i[10]=t[10]+n[10],i[11]=t[11]+n[11],i[12]=t[12]+n[12],i[13]=t[13]+n[13],i[14]=t[14]+n[14],i[15]=t[15]+n[15],i}static subtract(t,n,i){return i[0]=t[0]-n[0],i[1]=t[1]-n[1],i[2]=t[2]-n[2],i[3]=t[3]-n[3],i[4]=t[4]-n[4],i[5]=t[5]-n[5],i[6]=t[6]-n[6],i[7]=t[7]-n[7],i[8]=t[8]-n[8],i[9]=t[9]-n[9],i[10]=t[10]-n[10],i[11]=t[11]-n[11],i[12]=t[12]-n[12],i[13]=t[13]-n[13],i[14]=t[14]-n[14],i[15]=t[15]-n[15],i}static multiplyTransformation(t,n,i){let r=t[0],o=t[1],a=t[2],s=t[4],c=t[5],u=t[6],f=t[8],d=t[9],p=t[10],g=t[12],m=t[13],y=t[14],A=n[0],b=n[1],x=n[2],T=n[4],C=n[5],E=n[6],w=n[8],D=n[9],R=n[10],M=n[12],N=n[13],_=n[14],v=r*A+s*b+f*x,S=o*A+c*b+d*x,P=a*A+u*b+p*x,L=r*T+s*C+f*E,F=o*T+c*C+d*E,V=a*T+u*C+p*E,z=r*w+s*D+f*R,j=o*w+c*D+d*R,B=a*w+u*D+p*R,G=r*M+s*N+f*_+g,W=o*M+c*N+d*_+m,Q=a*M+u*N+p*_+y;return i[0]=v,i[1]=S,i[2]=P,i[3]=0,i[4]=L,i[5]=F,i[6]=V,i[7]=0,i[8]=z,i[9]=j,i[10]=B,i[11]=0,i[12]=G,i[13]=W,i[14]=Q,i[15]=1,i}static multiplyByMatrix3(t,n,i){let r=t[0],o=t[1],a=t[2],s=t[4],c=t[5],u=t[6],f=t[8],d=t[9],p=t[10],g=n[0],m=n[1],y=n[2],A=n[3],b=n[4],x=n[5],T=n[6],C=n[7],E=n[8],w=r*g+s*m+f*y,D=o*g+c*m+d*y,R=a*g+u*m+p*y,M=r*A+s*b+f*x,N=o*A+c*b+d*x,_=a*A+u*b+p*x,v=r*T+s*C+f*E,S=o*T+c*C+d*E,P=a*T+u*C+p*E;return i[0]=w,i[1]=D,i[2]=R,i[3]=0,i[4]=M,i[5]=N,i[6]=_,i[7]=0,i[8]=v,i[9]=S,i[10]=P,i[11]=0,i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i}static multiplyByTranslation(t,n,i){let r=n.x,o=n.y,a=n.z,s=r*t[0]+o*t[4]+a*t[8]+t[12],c=r*t[1]+o*t[5]+a*t[9]+t[13],u=r*t[2]+o*t[6]+a*t[10]+t[14];return i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i[4]=t[4],i[5]=t[5],i[6]=t[6],i[7]=t[7],i[8]=t[8],i[9]=t[9],i[10]=t[10],i[11]=t[11],i[12]=s,i[13]=c,i[14]=u,i[15]=t[15],i}static multiplyByScale(t,n,i){let r=n.x,o=n.y,a=n.z;return r===1&&o===1&&a===1?e.clone(t,i):(i[0]=r*t[0],i[1]=r*t[1],i[2]=r*t[2],i[3]=t[3],i[4]=o*t[4],i[5]=o*t[5],i[6]=o*t[6],i[7]=t[7],i[8]=a*t[8],i[9]=a*t[9],i[10]=a*t[10],i[11]=t[11],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i)}static multiplyByUniformScale(t,n,i){return i[0]=t[0]*n,i[1]=t[1]*n,i[2]=t[2]*n,i[3]=t[3],i[4]=t[4]*n,i[5]=t[5]*n,i[6]=t[6]*n,i[7]=t[7],i[8]=t[8]*n,i[9]=t[9]*n,i[10]=t[10]*n,i[11]=t[11],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i}static multiplyByVector(t,n,i){let r=n.x,o=n.y,a=n.z,s=n.w,c=t[0]*r+t[4]*o+t[8]*a+t[12]*s,u=t[1]*r+t[5]*o+t[9]*a+t[13]*s,f=t[2]*r+t[6]*o+t[10]*a+t[14]*s,d=t[3]*r+t[7]*o+t[11]*a+t[15]*s;return i.x=c,i.y=u,i.z=f,i.w=d,i}static multiplyByPointAsVector(t,n,i){let r=n.x,o=n.y,a=n.z,s=t[0]*r+t[4]*o+t[8]*a,c=t[1]*r+t[5]*o+t[9]*a,u=t[2]*r+t[6]*o+t[10]*a;return i.x=s,i.y=c,i.z=u,i}static multiplyByPoint(t,n,i){let r=n.x,o=n.y,a=n.z,s=t[0]*r+t[4]*o+t[8]*a+t[12],c=t[1]*r+t[5]*o+t[9]*a+t[13],u=t[2]*r+t[6]*o+t[10]*a+t[14];return i.x=s,i.y=c,i.z=u,i}static multiplyByScalar(t,n,i){return i[0]=t[0]*n,i[1]=t[1]*n,i[2]=t[2]*n,i[3]=t[3]*n,i[4]=t[4]*n,i[5]=t[5]*n,i[6]=t[6]*n,i[7]=t[7]*n,i[8]=t[8]*n,i[9]=t[9]*n,i[10]=t[10]*n,i[11]=t[11]*n,i[12]=t[12]*n,i[13]=t[13]*n,i[14]=t[14]*n,i[15]=t[15]*n,i}static negate(t,n){return 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]=-t[12],n[13]=-t[13],n[14]=-t[14],n[15]=-t[15],n}static transpose(t,n){let i=t[1],r=t[2],o=t[3],a=t[6],s=t[7],c=t[11];return n[0]=t[0],n[1]=t[4],n[2]=t[8],n[3]=t[12],n[4]=i,n[5]=t[5],n[6]=t[9],n[7]=t[13],n[8]=r,n[9]=a,n[10]=t[10],n[11]=t[14],n[12]=o,n[13]=s,n[14]=c,n[15]=t[15],n}static abs(t,n){return n[0]=Math.abs(t[0]),n[1]=Math.abs(t[1]),n[2]=Math.abs(t[2]),n[3]=Math.abs(t[3]),n[4]=Math.abs(t[4]),n[5]=Math.abs(t[5]),n[6]=Math.abs(t[6]),n[7]=Math.abs(t[7]),n[8]=Math.abs(t[8]),n[9]=Math.abs(t[9]),n[10]=Math.abs(t[10]),n[11]=Math.abs(t[11]),n[12]=Math.abs(t[12]),n[13]=Math.abs(t[13]),n[14]=Math.abs(t[14]),n[15]=Math.abs(t[15]),n}static equals(t,n){return t===n||l(t)&&l(n)&&t[12]===n[12]&&t[13]===n[13]&&t[14]===n[14]&&t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[4]===n[4]&&t[5]===n[5]&&t[6]===n[6]&&t[8]===n[8]&&t[9]===n[9]&&t[10]===n[10]&&t[3]===n[3]&&t[7]===n[7]&&t[11]===n[11]&&t[15]===n[15]}static equalsEpsilon(t,n,i){return i=i??0,t===n||l(t)&&l(n)&&Math.abs(t[0]-n[0])<=i&&Math.abs(t[1]-n[1])<=i&&Math.abs(t[2]-n[2])<=i&&Math.abs(t[3]-n[3])<=i&&Math.abs(t[4]-n[4])<=i&&Math.abs(t[5]-n[5])<=i&&Math.abs(t[6]-n[6])<=i&&Math.abs(t[7]-n[7])<=i&&Math.abs(t[8]-n[8])<=i&&Math.abs(t[9]-n[9])<=i&&Math.abs(t[10]-n[10])<=i&&Math.abs(t[11]-n[11])<=i&&Math.abs(t[12]-n[12])<=i&&Math.abs(t[13]-n[13])<=i&&Math.abs(t[14]-n[14])<=i&&Math.abs(t[15]-n[15])<=i}static getTranslation(t,n){return n.x=t[12],n.y=t[13],n.z=t[14],n}static getMatrix3(t,n){return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[4],n[4]=t[5],n[5]=t[6],n[6]=t[8],n[7]=t[9],n[8]=t[10],n}static inverse(t,n){let i=t[0],r=t[4],o=t[8],a=t[12],s=t[1],c=t[5],u=t[9],f=t[13],d=t[2],p=t[6],g=t[10],m=t[14],y=t[3],A=t[7],b=t[11],x=t[15],T=g*x,C=m*b,E=p*x,w=m*A,D=p*b,R=g*A,M=d*x,N=m*y,_=d*b,v=g*y,S=d*A,P=p*y,L=T*c+w*u+D*f-(C*c+E*u+R*f),F=C*s+M*u+v*f-(T*s+N*u+_*f),V=E*s+N*c+S*f-(w*s+M*c+P*f),z=R*s+_*c+P*u-(D*s+v*c+S*u),j=C*r+E*o+R*a-(T*r+w*o+D*a),B=T*i+N*o+_*a-(C*i+M*o+v*a),G=w*i+M*r+P*a-(E*i+N*r+S*a),W=D*i+v*r+S*o-(R*i+_*r+P*o);T=o*f,C=a*u,E=r*f,w=a*c,D=r*u,R=o*c,M=i*f,N=a*s,_=i*u,v=o*s,S=i*c,P=r*s;let Q=T*A+w*b+D*x-(C*A+E*b+R*x),q=C*y+M*b+v*x-(T*y+N*b+_*x),J=E*y+N*A+S*x-(w*y+M*A+P*x),Z=R*y+_*A+P*b-(D*y+v*A+S*b),ce=E*g+R*m+C*p-(D*m+T*p+w*g),Ae=_*m+T*d+N*g-(M*g+v*m+C*d),le=M*p+P*m+w*d-(S*m+E*d+N*p),Ce=S*g+D*d+v*p-(_*p+P*g+R*d),ye=i*L+r*F+o*V+a*z;if(Math.abs(ye)<I.EPSILON21){if($.equalsEpsilon(e.getMatrix3(t,INe),PNe,I.EPSILON7)&&ae.equals(e.getRow(t,3,DNe),RNe))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-t[12],n[13]=-t[13],n[14]=-t[14],n[15]=1,n;throw new oe("matrix is not invertible because its determinate is zero.")}return ye=1/ye,n[0]=L*ye,n[1]=F*ye,n[2]=V*ye,n[3]=z*ye,n[4]=j*ye,n[5]=B*ye,n[6]=G*ye,n[7]=W*ye,n[8]=Q*ye,n[9]=q*ye,n[10]=J*ye,n[11]=Z*ye,n[12]=ce*ye,n[13]=Ae*ye,n[14]=le*ye,n[15]=Ce*ye,n}static inverseTransformation(t,n){let i=t[0],r=t[1],o=t[2],a=t[4],s=t[5],c=t[6],u=t[8],f=t[9],d=t[10],p=t[12],g=t[13],m=t[14],y=-i*p-r*g-o*m,A=-a*p-s*g-c*m,b=-u*p-f*g-d*m;return n[0]=i,n[1]=a,n[2]=u,n[3]=0,n[4]=r,n[5]=s,n[6]=f,n[7]=0,n[8]=o,n[9]=c,n[10]=d,n[11]=0,n[12]=y,n[13]=A,n[14]=b,n[15]=1,n}static inverseTranspose(t,n){return e.inverse(e.transpose(t,ONe),n)}get length(){return e.packedLength}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}static equalsArray(t,n,i){return t[0]===n[i]&&t[1]===n[i+1]&&t[2]===n[i+2]&&t[3]===n[i+3]&&t[4]===n[i+4]&&t[5]===n[i+5]&&t[6]===n[i+6]&&t[7]===n[i+7]&&t[8]===n[i+8]&&t[9]===n[i+9]&&t[10]===n[i+10]&&t[11]===n[i+11]&&t[12]===n[i+12]&&t[13]===n[i+13]&&t[14]===n[i+14]&&t[15]===n[i+15]}equalsEpsilon(t,n){return e.equalsEpsilon(this,t,n)}toString(){return`(${this[0]}, ${this[4]}, ${this[8]}, ${this[12]})
|
|
(${this[1]}, ${this[5]}, ${this[9]}, ${this[13]})
|
|
(${this[2]}, ${this[6]}, ${this[10]}, ${this[14]})
|
|
(${this[3]}, ${this[7]}, ${this[11]}, ${this[15]})`}};io.packedLength=16;io.fromArray=io.unpack;io.IDENTITY=Object.freeze(new io(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1));io.ZERO=Object.freeze(new io(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0));io.COLUMN0ROW0=0;io.COLUMN0ROW1=1;io.COLUMN0ROW2=2;io.COLUMN0ROW3=3;io.COLUMN1ROW0=4;io.COLUMN1ROW1=5;io.COLUMN1ROW2=6;io.COLUMN1ROW3=7;io.COLUMN2ROW0=8;io.COLUMN2ROW1=9;io.COLUMN2ROW2=10;io.COLUMN2ROW3=11;io.COLUMN3ROW0=12;io.COLUMN3ROW1=13;io.COLUMN3ROW2=14;io.COLUMN3ROW3=15;var IT=new h,PT=new h,Uw=new h,vNe=new h,ENe=new h,E7=new h,coe=new h,SNe=new h,wNe=new h,INe=new $,PNe=new $,DNe=new ae,RNe=new ae(0,0,0,1),ONe=new io,O=io;function MNe(e,t,n){let i=0,r=e.length-1,o,a;for(;i<=r;){if(o=~~((i+r)/2),a=n(e[o],t),a<0){i=o+1;continue}if(a>0){r=o-1;continue}return o}return~(r+1)}var Cr=MNe;function LNe(e,t,n,i,r){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=i,this.ut1MinusUtc=r}var BA=LNe;function NNe(e){return e%4===0&&e%100!==0||e%400===0}var _m=NNe;var loe=[31,28,31,30,31,30,31,31,30,31,30,31];function FNe(e,t,n,i,r,o,a,s){e=e??1,t=t??1,n=n??1,i=i??0,r=r??0,o=o??0,a=a??0,s=s??!1,this.year=e,this.month=t,this.day=n,this.hour=i,this.minute=r,this.second=o,this.millisecond=a,this.isLeapSecond=s;function y(){Ur.typeOf.number.greaterThanOrEquals("Year",e,1),Ur.typeOf.number.lessThanOrEquals("Year",e,9999),Ur.typeOf.number.greaterThanOrEquals("Month",t,1),Ur.typeOf.number.lessThanOrEquals("Month",t,12),Ur.typeOf.number.greaterThanOrEquals("Day",n,1),Ur.typeOf.number.lessThanOrEquals("Day",n,31),Ur.typeOf.number.greaterThanOrEquals("Hour",i,0),Ur.typeOf.number.lessThanOrEquals("Hour",i,23),Ur.typeOf.number.greaterThanOrEquals("Minute",r,0),Ur.typeOf.number.lessThanOrEquals("Minute",r,59),Ur.typeOf.bool("IsLeapSecond",s),Ur.typeOf.number.greaterThanOrEquals("Second",o,0),Ur.typeOf.number.lessThanOrEquals("Second",o,s?60:59),Ur.typeOf.number.greaterThanOrEquals("Millisecond",a,0),Ur.typeOf.number.lessThan("Millisecond",a,1e3)}function A(){let b=t===2&&_m(e)?loe[t-1]+1:loe[t-1];if(n>b)throw new pe("Month and Day represents invalid date")}}var Zg=FNe;function BNe(e,t){this.julianDate=e,this.offset=t}var dr=BNe;var uoe={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};Object.freeze(uoe);var Un=uoe;var foe={UTC:0,TAI:1};Object.freeze(foe);var ai=foe;var doe=new Zg,S7=[31,28,31,30,31,30,31,31,30,31,30,31],w7=29;function P7(e,t){return pi.compare(e.julianDate,t.julianDate)}var DT=new dr;function iM(e){DT.julianDate=e;let t=pi.leapSeconds,n=Cr(t,DT,P7);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let i=t[n].offset;n>0&&pi.secondsDifference(t[n].julianDate,e)>i&&(n--,i=t[n].offset),pi.addSeconds(e,i,e)}function hoe(e,t){DT.julianDate=e;let n=pi.leapSeconds,i=Cr(n,DT,P7);if(i<0&&(i=~i),i===0)return pi.addSeconds(e,-n[0].offset,t);if(i>=n.length)return pi.addSeconds(e,-n[i-1].offset,t);let r=pi.secondsDifference(n[i].julianDate,e);if(r===0)return pi.addSeconds(e,-n[i].offset,t);if(!(r<=1))return pi.addSeconds(e,-n[i-1].offset,t)}function Qg(e,t,n){let i=t/Un.SECONDS_PER_DAY|0;return e+=i,t-=Un.SECONDS_PER_DAY*i,t<0&&(e--,t+=Un.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function I7(e,t,n,i,r,o,a){let s=(t-14)/12|0,c=e+4800+s,u=(1461*c/4|0)+(367*(t-2-12*s)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;i=i-12,i<0&&(i+=24);let f=o+(i*Un.SECONDS_PER_HOUR+r*Un.SECONDS_PER_MINUTE+a*Un.SECONDS_PER_MILLISECOND);return f>=43200&&(u-=1),[u,f]}var kNe=/^(\d{4})$/,zNe=/^(\d{4})-(\d{2})$/,UNe=/^(\d{4})-?(\d{3})$/,VNe=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,jNe=/^(\d{4})-?(\d{2})-?(\d{2})$/,D7=/([Z+\-])?(\d{2})?:?(\d{2})?$/,HNe=/^(\d{2})(\.\d+)?/.source+D7.source,GNe=/^(\d{2}):?(\d{2})(\.\d+)?/.source+D7.source,WNe=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+D7.source;var pi=class e{constructor(t,n,i){this.dayNumber=void 0,this.secondsOfDay=void 0,t=t??0,n=n??0,i=i??ai.UTC;let r=t|0;n=n+(t-r)*Un.SECONDS_PER_DAY,Qg(r,n,this),i===ai.UTC&&iM(this)}static fromGregorianDate(t,n){let i=I7(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond);return l(n)?(Qg(i[0],i[1],n),iM(n),n):new e(i[0],i[1],ai.UTC)}static fromDate(t,n){let i=I7(t.getUTCFullYear(),t.getUTCMonth()+1,t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds());return l(n)?(Qg(i[0],i[1],n),iM(n),n):new e(i[0],i[1],ai.UTC)}static fromIso8601(t,n){t=t.replace(",",".");let i=t.split("T"),r,o=1,a=1,s=0,c=0,u=0,f=0,d=i[0],p=i[1],g,m;if(i=d.match(jNe),i!==null)r=+i[1],o=+i[2],a=+i[3];else if(i=d.match(zNe),i!==null)r=+i[1],o=+i[2];else if(i=d.match(kNe),i!==null)r=+i[1];else{let x;if(i=d.match(UNe),i!==null)r=+i[1],x=+i[2],m=_m(r);else if(i=d.match(VNe),i!==null){r=+i[1];let T=+i[2],C=+i[3]||0,E=new Date(Date.UTC(r,0,4));x=T*7+C-E.getUTCDay()-3}g=new Date(Date.UTC(r,0,1)),g.setUTCDate(x),o=g.getUTCMonth()+1,a=g.getUTCDate()}m=_m(r);let y;if(l(p)){i=p.match(WNe),i!==null?(s=+i[1],c=+i[2],u=+i[3],f=+(i[4]||0)*1e3,y=5):(i=p.match(GNe),i!==null?(s=+i[1],c=+i[2],u=+(i[3]||0)*60,y=4):(i=p.match(HNe),i!==null&&(s=+i[1],c=+(i[2]||0)*60,y=3)));let x=i[y],T=+i[y+1],C=+(i[y+2]||0);switch(x){case"+":s=s-T,c=c-C;break;case"-":s=s+T,c=c+C;break;case"Z":break;default:c=c+new Date(Date.UTC(r,o-1,a,s,c)).getTimezoneOffset();break}}let A=u===60;for(A&&u--;c>=60;)c-=60,s++;for(;s>=24;)s-=24,a++;for(g=m&&o===2?w7:S7[o-1];a>g;)a-=g,o++,o>12&&(o-=12,r++),g=m&&o===2?w7:S7[o-1];for(;c<0;)c+=60,s--;for(;s<0;)s+=24,a--;for(;a<1;)o--,o<1&&(o+=12,r--),g=m&&o===2?w7:S7[o-1],a+=g;let b=I7(r,o,a,s,c,u,f);return l(n)?(Qg(b[0],b[1],n),iM(n)):n=new e(b[0],b[1],ai.UTC),A&&e.addSeconds(n,1,n),n}static now(t){return e.fromDate(new Date,t)}static toGregorianDate(t,n){let i=!1,r=hoe(t,rM);l(r)||(e.addSeconds(t,-1,rM),r=hoe(rM,rM),i=!0);let o=r.dayNumber,a=r.secondsOfDay;a>=43200&&(o+=1);let s=o+68569|0,c=4*s/146097|0;s=s-((146097*c+3)/4|0)|0;let u=4e3*(s+1)/1461001|0;s=s-(1461*u/4|0)+31|0;let f=80*s/2447|0,d=s-(2447*f/80|0)|0;s=f/11|0;let p=f+2-12*s|0,g=100*(c-49)+u+s|0,m=a/Un.SECONDS_PER_HOUR|0,y=a-m*Un.SECONDS_PER_HOUR,A=y/Un.SECONDS_PER_MINUTE|0;y=y-A*Un.SECONDS_PER_MINUTE;let b=y|0,x=(y-b)/Un.SECONDS_PER_MILLISECOND;return m+=12,m>23&&(m-=24),i&&(b+=1),l(n)?(n.year=g,n.month=p,n.day=d,n.hour=m,n.minute=A,n.second=b,n.millisecond=x,n.isLeapSecond=i,n):new Zg(g,p,d,m,A,b,x,i)}static toDate(t){let n=e.toGregorianDate(t,doe),i=n.second;return n.isLeapSecond&&(i-=1),new Date(Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,i,n.millisecond))}static toIso8601(t,n){let i=e.toGregorianDate(t,doe),r=i.year,o=i.month,a=i.day,s=i.hour,c=i.minute,u=i.second,f=i.millisecond;r===1e4&&o===1&&a===1&&s===0&&c===0&&u===0&&f===0&&(r=9999,o=12,a=31,s=24);let d;if(!l(n)&&f!==0){let p=f*.01;return d=p<1e-6?p.toFixed(20).replace(".","").replace(/0+$/,""):p.toString().replace(".",""),`${r.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${a.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}.${d}Z`}return!l(n)||n===0?`${r.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${a.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}Z`:(d=(f*.01).toFixed(n).replace(".","").slice(0,n),`${r.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${a.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}.${d}Z`)}static clone(t,n){if(l(t))return l(n)?(n.dayNumber=t.dayNumber,n.secondsOfDay=t.secondsOfDay,n):new e(t.dayNumber,t.secondsOfDay,ai.TAI)}static compare(t,n){let i=t.dayNumber-n.dayNumber;return i!==0?i:t.secondsOfDay-n.secondsOfDay}static equals(t,n){return t===n||l(t)&&l(n)&&t.dayNumber===n.dayNumber&&t.secondsOfDay===n.secondsOfDay}static equalsEpsilon(t,n,i){return i=i??0,t===n||l(t)&&l(n)&&Math.abs(e.secondsDifference(t,n))<=i}static totalDays(t){return t.dayNumber+t.secondsOfDay/Un.SECONDS_PER_DAY}static secondsDifference(t,n){return(t.dayNumber-n.dayNumber)*Un.SECONDS_PER_DAY+(t.secondsOfDay-n.secondsOfDay)}static daysDifference(t,n){let i=t.dayNumber-n.dayNumber,r=(t.secondsOfDay-n.secondsOfDay)/Un.SECONDS_PER_DAY;return i+r}static computeTaiMinusUtc(t){DT.julianDate=t;let n=e.leapSeconds,i=Cr(n,DT,P7);return i<0&&(i=~i,--i,i<0&&(i=0)),n[i].offset}static addSeconds(t,n,i){return Qg(t.dayNumber,t.secondsOfDay+n,i)}static addMinutes(t,n,i){let r=t.secondsOfDay+n*Un.SECONDS_PER_MINUTE;return Qg(t.dayNumber,r,i)}static addHours(t,n,i){let r=t.secondsOfDay+n*Un.SECONDS_PER_HOUR;return Qg(t.dayNumber,r,i)}static addDays(t,n,i){let r=t.dayNumber+n;return Qg(r,t.secondsOfDay,i)}static lessThan(t,n){return e.compare(t,n)<0}static lessThanOrEquals(t,n){return e.compare(t,n)<=0}static greaterThan(t,n){return e.compare(t,n)>0}static greaterThanOrEquals(t,n){return e.compare(t,n)>=0}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}equalsEpsilon(t,n){return e.equalsEpsilon(this,t,n)}toString(){return e.toIso8601(this)}},rM=new pi(0,0,ai.TAI);pi.leapSeconds=[new dr(new pi(2441317,43210,ai.TAI),10),new dr(new pi(2441499,43211,ai.TAI),11),new dr(new pi(2441683,43212,ai.TAI),12),new dr(new pi(2442048,43213,ai.TAI),13),new dr(new pi(2442413,43214,ai.TAI),14),new dr(new pi(2442778,43215,ai.TAI),15),new dr(new pi(2443144,43216,ai.TAI),16),new dr(new pi(2443509,43217,ai.TAI),17),new dr(new pi(2443874,43218,ai.TAI),18),new dr(new pi(2444239,43219,ai.TAI),19),new dr(new pi(2444786,43220,ai.TAI),20),new dr(new pi(2445151,43221,ai.TAI),21),new dr(new pi(2445516,43222,ai.TAI),22),new dr(new pi(2446247,43223,ai.TAI),23),new dr(new pi(2447161,43224,ai.TAI),24),new dr(new pi(2447892,43225,ai.TAI),25),new dr(new pi(2448257,43226,ai.TAI),26),new dr(new pi(2448804,43227,ai.TAI),27),new dr(new pi(2449169,43228,ai.TAI),28),new dr(new pi(2449534,43229,ai.TAI),29),new dr(new pi(2450083,43230,ai.TAI),30),new dr(new pi(2450630,43231,ai.TAI),31),new dr(new pi(2451179,43232,ai.TAI),32),new dr(new pi(2453736,43233,ai.TAI),33),new dr(new pi(2454832,43234,ai.TAI),34),new dr(new pi(2456109,43235,ai.TAI),35),new dr(new pi(2457204,43236,ai.TAI),36),new dr(new pi(2457754,43237,ai.TAI),37)];var K=pi;var Loe=La(Uu(),1);function qNe(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var cM=qNe;function boe(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 r=e[i];t&&(r=boe(r,t)),n[i]=r}return n}var Xe=boe;function xoe(e,t,n){n=n??!1;let i={},r=l(e),o=l(t),a,s,c;if(r)for(a in e)e.hasOwnProperty(a)&&(s=e[a],o&&n&&typeof s=="object"&&t.hasOwnProperty(a)?(c=t[a],typeof c=="object"?i[a]=xoe(s,c,n):i[a]=s):i[a]=s);if(o)for(a in t)t.hasOwnProperty(a)&&!i.hasOwnProperty(a)&&(c=t[a],i[a]=c);return i}var Ot=xoe;function YNe(){let e,t,n=new Promise(function(i,r){e=i,t=r});return{resolve:e,reject:t,promise:n}}var Vu=YNe;var Toe=La(Uu(),1);function R7(e,t){let n;return typeof document<"u"&&(n=document),R7._implementation(e,t,n)}R7._implementation=function(e,t,n){if(!l(t)){if(typeof n>"u")return e;t=n.baseURI??n.location.href}let i=new Toe.default(e);return i.scheme()!==""?i.toString():i.absoluteTo(t).toString()};var Jd=R7;var Coe=La(Uu(),1);function XNe(e,t){let n="",i=e.lastIndexOf("/");return i!==-1&&(n=e.substring(0,i+1)),t&&(e=new Coe.default(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}var lM=XNe;var voe=La(Uu(),1);function KNe(e){let t=new voe.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 e_=KNe;var Eoe={};function $Ne(e,t,n){l(t)||(t=e.width),l(n)||(n=e.height);let i=Eoe[t];l(i)||(i={},Eoe[t]=i);let r=i[n];if(!l(r)){let o=document.createElement("canvas");o.width=t,o.height=n,r=o.getContext("2d",{willReadFrequently:!0}),r.globalCompositeOperation="copy",i[n]=r}return r.drawImage(e,0,0,t,n),r.getImageData(0,0,t,n).data}var ym=$Ne;var JNe=/^blob:/i;function ZNe(e){return JNe.test(e)}var MT=ZNe;var Am;function QNe(e){l(Am)||(Am=document.createElement("a")),Am.href=window.location.href;let t=Am.host,n=Am.protocol;return Am.href=e,Am.href=Am.href,n!==Am.protocol||t!==Am.host}var kA=QNe;var eFe=/^data:/i;function tFe(e){return eFe.test(e)}var bm=tFe;function nFe(e){let t=document.createElement("script");return t.async=!0,t.src=e,new Promise((n,i)=>{window.crossOriginIsolated&&t.setAttribute("crossorigin","anonymous");let r=document.getElementsByTagName("head")[0];t.onload=function(){t.onload=void 0,r.removeChild(t),n()},t.onerror=function(o){i(o)},r.appendChild(t)})}var LT=nFe;function iFe(e){let t="";for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],r=`${encodeURIComponent(n)}=`;if(Array.isArray(i))for(let o=0,a=i.length;o<a;++o)t+=`${r+encodeURIComponent(i[o])}&`;else t+=`${r+encodeURIComponent(i)}&`}return t=t.slice(0,-1),t}var NT=iFe;function rFe(e){let t={};if(e==="")return t;let n=e.replace(/\+/g,"%20").split(/[&;]/);for(let i=0,r=n.length;i<r;++i){let o=n[i].split("="),a=decodeURIComponent(o[0]),s=o[1];l(s)?s=decodeURIComponent(s):s="";let c=t[a];typeof c=="string"?t[a]=[c,s]:Array.isArray(c)?c.push(s):t[a]=s}return t}var kf=rFe;var Soe={UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5};Object.freeze(Soe);var Ti=Soe;var woe={TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3};Object.freeze(woe);var Za=woe;function uM(e){e=e??H.EMPTY_OBJECT;let t=e.throttleByServer??!1,n=e.throttle??!1;this.url=e.url,this.requestFunction=e.requestFunction,this.cancelFunction=e.cancelFunction,this.priorityFunction=e.priorityFunction,this.priority=e.priority??0,this.throttle=n,this.throttleByServer=t,this.type=e.type??Za.OTHER,this.serverKey=e.serverKey,this.state=Ti.UNISSUED,this.deferred=void 0,this.cancelled=!1}uM.prototype.cancel=function(){this.cancelled=!0};uM.prototype.clone=function(e){return l(e)?(e.url=this.url,e.requestFunction=this.requestFunction,e.cancelFunction=this.cancelFunction,e.priorityFunction=this.priorityFunction,e.priority=this.priority,e.throttle=this.throttle,e.throttleByServer=this.throttleByServer,e.type=this.type,e.serverKey=this.serverKey,e.state=Ti.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new uM(this)};var Eo=uM;function oFe(e){let t={};if(!e)return t;let n=e.split(`\r
|
|
`);for(let i=0;i<n.length;++i){let r=n[i],o=r.indexOf(": ");if(o>0){let a=r.substring(0,o),s=r.substring(o+2);t[a]=s}}return t}var fM=oFe;function Ioe(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=fM(this.responseHeaders))}Ioe.prototype.toString=function(){let e="Request has failed.";return l(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var l0=Ioe;var hM=La(Uu(),1);function Vw(){this._listeners=new Map,this._toRemove=new Map,this._toAdd=new Map,this._invokingListeners=!1,this._listenerCount=0}Object.defineProperties(Vw.prototype,{numberOfListeners:{get:function(){return this._listenerCount}}});Vw.prototype.addEventListener=function(e,t){let n=this,i=n._invokingListeners?n._toAdd:n._listeners;return M7(this,i,e,t)&&n._listenerCount++,function(){n.removeEventListener(e,t)}};function M7(e,t,n,i){t.has(n)||t.set(n,new Set);let r=t.get(n);return r.has(i)?!1:(r.add(i),!0)}Vw.prototype.removeEventListener=function(e,t){let n=O7(this,this._listeners,e,t),i=O7(this,this._toAdd,e,t),r=n||i;return r&&this._listenerCount--,r};function O7(e,t,n,i){let r=t.get(n);if(!r||!r.has(i))return!1;if(e._invokingListeners){if(!M7(e,e._toRemove,n,i))return!1}else r.delete(i),r.size===0&&t.delete(n);return!0}Vw.prototype.raiseEvent=function(){this._invokingListeners=!0;for(let[e,t]of this._listeners.entries())if(l(e))for(let n of t)e.apply(n,arguments);this._invokingListeners=!1;for(let[e,t]of this._toAdd.entries())for(let n of t)M7(this,this._listeners,e,n);this._toAdd.clear();for(let[e,t]of this._toRemove.entries())for(let n of t)O7(this,this._listeners,e,n);this._toRemove.clear()};var be=Vw;function zA(e){this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(zA.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){let t=this._length;if(e<t){let n=this._array;for(let i=e;i<t;++i)n[i]=void 0;this._length=e,n.length=e}this._maximumLength=e}},comparator:{get:function(){return this._comparator}}});function L7(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}zA.prototype.reserve=function(e){e=e??this._length,this._array.length=e};zA.prototype.heapify=function(e){e=e??0;let t=this._length,n=this._comparator,i=this._array,r,o=!0;for(;o;){let a=2*(e+1),s=a-1;s<t&&n(i[s],i[e])<0?r=s:r=e,a<t&&n(i[a],i[r])<0&&(r=a),r!==e?(L7(i,r,e),e=r):o=!1}};zA.prototype.resort=function(){let e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)};zA.prototype.insert=function(e){let t=this._array,n=this._comparator,i=this._maximumLength,r=this._length++;for(r<t.length?t[r]=e:t.push(e);r!==0;){let a=Math.floor((r-1)/2);if(n(t[r],t[a])<0)L7(t,r,a),r=a;else break}let o;return l(i)&&this._length>i&&(o=t[i],this._length=i),o};zA.prototype.pop=function(e){if(e=e??0,this._length===0)return;let t=this._array,n=t[e];return L7(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};var dM=zA;function aFe(e,t){return e.priority-t.priority}var gr={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},FT=20,Dc=new dM({comparator:aFe});Dc.maximumLength=FT;Dc.reserve(FT);var xm=[],u0={},sFe=typeof document<"u"?new hM.default(document.location.href):new hM.default,mM=new be;function mo(){}mo.maximumRequests=50;mo.maximumRequestsPerServer=18;mo.requestsByServer={};mo.throttleRequests=!0;mo.debugShowStatistics=!1;mo.requestCompletedEvent=mM;Object.defineProperties(mo,{statistics:{get:function(){return gr}},priorityHeapLength:{get:function(){return FT},set:function(e){if(e<FT)for(;Dc.length>e;){let t=Dc.pop();UA(t)}FT=e,Dc.maximumLength=e,Dc.reserve(e)}}});function Poe(e){l(e.priorityFunction)&&(e.priority=e.priorityFunction())}mo.serverHasOpenSlots=function(e,t){t=t??1;let n=mo.requestsByServer[e]??mo.maximumRequestsPerServer;return u0[e]+t<=n};mo.heapHasOpenSlots=function(e){return Dc.length+e<=FT};function Doe(e){return e.state===Ti.UNISSUED&&(e.state=Ti.ISSUED,e.deferred=Vu()),e.deferred.promise}function cFe(e){return function(t){if(e.state===Ti.CANCELLED)return;let n=e.deferred;--gr.numberOfActiveRequests,--u0[e.serverKey],mM.raiseEvent(),e.state=Ti.RECEIVED,e.deferred=void 0,n.resolve(t)}}function lFe(e){return function(t){e.state!==Ti.CANCELLED&&(++gr.numberOfFailedRequests,--gr.numberOfActiveRequests,--u0[e.serverKey],mM.raiseEvent(t),e.state=Ti.FAILED,e.deferred.reject(t))}}function Roe(e){let t=Doe(e);return e.state=Ti.ACTIVE,xm.push(e),++gr.numberOfActiveRequests,++gr.numberOfActiveRequestsEver,++u0[e.serverKey],e.requestFunction().then(cFe(e)).catch(lFe(e)),t}function UA(e){let t=e.state===Ti.ACTIVE;if(e.state=Ti.CANCELLED,++gr.numberOfCancelledRequests,l(e.deferred)){let n=e.deferred;n.promise.catch(()=>{}),e.deferred=void 0,n.reject(new oe(`Request cancelled: "${e.url}"`))}t&&(--gr.numberOfActiveRequests,--u0[e.serverKey],++gr.numberOfCancelledActiveRequests),l(e.cancelFunction)&&e.cancelFunction()}mo.update=function(){let e,t,n=0,i=xm.length;for(e=0;e<i;++e){if(t=xm[e],t.cancelled&&UA(t),t.state!==Ti.ACTIVE){++n;continue}n>0&&(xm[e-n]=t)}xm.length-=n;let r=Dc.internalArray,o=Dc.length;for(e=0;e<o;++e)Poe(r[e]);Dc.resort();let a=Math.max(mo.maximumRequests-xm.length,0),s=0;for(;s<a&&Dc.length>0;){if(t=Dc.pop(),t.cancelled){UA(t);continue}if(t.throttleByServer&&!mo.serverHasOpenSlots(t.serverKey)){UA(t);continue}Roe(t),++s}uFe()};mo.getServerKey=function(e){let t=new hM.default(e);t.scheme()===""&&(t=t.absoluteTo(sFe),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);let i=u0[n];return l(i)||(u0[n]=0),n};mo.request=function(e){if(bm(e.url)||MT(e.url))return mM.raiseEvent(),e.state=Ti.RECEIVED,e.requestFunction();if(++gr.numberOfAttemptedRequests,l(e.serverKey)||(e.serverKey=mo.getServerKey(e.url)),mo.throttleRequests&&e.throttleByServer&&!mo.serverHasOpenSlots(e.serverKey))return;if(!mo.throttleRequests||!e.throttle)return Roe(e);if(xm.length>=mo.maximumRequests)return;Poe(e);let t=Dc.insert(e);if(l(t)){if(t===e)return;UA(t)}return Doe(e)};function uFe(){mo.debugShowStatistics&&(gr.numberOfActiveRequests===0&&gr.lastNumberOfActiveRequests>0&&(gr.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${gr.numberOfAttemptedRequests}`),gr.numberOfAttemptedRequests=0),gr.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${gr.numberOfCancelledRequests}`),gr.numberOfCancelledRequests=0),gr.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${gr.numberOfCancelledActiveRequests}`),gr.numberOfCancelledActiveRequests=0),gr.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${gr.numberOfFailedRequests}`),gr.numberOfFailedRequests=0)),gr.lastNumberOfActiveRequests=gr.numberOfActiveRequests)}mo.clearForSpecs=function(){for(;Dc.length>0;){let t=Dc.pop();UA(t)}let e=xm.length;for(let t=0;t<e;++t)UA(xm[t]);xm.length=0,u0={},gr.numberOfAttemptedRequests=0,gr.numberOfActiveRequests=0,gr.numberOfCancelledRequests=0,gr.numberOfCancelledActiveRequests=0,gr.numberOfFailedRequests=0,gr.numberOfActiveRequestsEver=0,gr.lastNumberOfActiveRequests=0};mo.numberOfActiveRequestsByServer=function(e){return u0[e]};mo.requestHeap=Dc;var fl=mo;var Ooe=La(Uu(),1);var jw={},BT={};jw.add=function(e,t){let n=`${e.toLowerCase()}:${t}`;l(BT[n])||(BT[n]=!0)};jw.remove=function(e,t){let n=`${e.toLowerCase()}:${t}`;l(BT[n])&&delete BT[n]};function fFe(e){let t=new Ooe.default(e);t.normalize();let n=t.authority();if(n.length!==0){if(t.authority(n),n.indexOf("@")!==-1&&(n=n.split("@")[1]),n.indexOf(":")===-1){let i=t.scheme();if(i.length===0&&(i=window.location.protocol,i=i.substring(0,i.length-1)),i==="http")n+=":80";else if(i==="https")n+=":443";else return}return n}}jw.contains=function(e){let t=fFe(e);return!!(l(t)&&l(BT[t]))};jw.clear=function(){BT={}};var Hw=jw;var Noe=(function(){try{let e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob",e.responseType==="blob"}catch{return!1}})();function kt(e){e=e??H.EMPTY_OBJECT,typeof e=="string"&&(e={url:e}),this._url=void 0,this._templateValues=Tm(e.templateValues,{}),this._queryParameters=Tm(e.queryParameters,{}),this.headers=Tm(e.headers,{}),this.request=e.request??new Eo,this.proxy=e.proxy,this.retryCallback=e.retryCallback,this.retryAttempts=e.retryAttempts??0,this._retryCount=0,e.parseUrl??!0?this.parseUrl(e.url,!0,!0):this._url=e.url,this._credits=e.credits}function Tm(e,t){return l(e)?Xe(e):t}kt.createIfNeeded=function(e){return e instanceof kt?e.getDerivedResource({request:e.request}):typeof e!="string"?e:new kt({url:e})};var kT;kt.supportsImageBitmapOptions=function(){return l(kT)?kT:typeof createImageBitmap!="function"?(kT=Promise.resolve(!1),kT):(kT=kt.fetchBlob({url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAAE4g3rEiDgAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADElEQVQI12Ng6GAAAAEUAIngE3ZiAAAAAElFTkSuQmCC"}).then(function(t){let n={imageOrientation:"flipY",premultiplyAlpha:"none",colorSpaceConversion:"none"};return Promise.all([createImageBitmap(t,n),createImageBitmap(t)])}).then(function(t){let n=ym(t[0]),i=ym(t[1]);return n[1]!==i[1]}).catch(function(){return!1}),kT)};Object.defineProperties(kt,{isBlobSupported:{get:function(){return Noe}}});Object.defineProperties(kt.prototype,{queryParameters:{get:function(){return this._queryParameters}},templateValues:{get:function(){return this._templateValues}},url:{get:function(){return this.getUrlComponent(!0,!0)},set:function(e){this.parseUrl(e,!1,!1)}},extension:{get:function(){return e_(this._url)}},isDataUri:{get:function(){return bm(this._url)}},isBlobUri:{get:function(){return MT(this._url)}},isCrossOriginUrl:{get:function(){return kA(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}});kt.prototype.toString=function(){return this.getUrlComponent(!0,!0)};kt.prototype.parseUrl=function(e,t,n,i){let r=new Loe.default(e),o=dFe(r.query());this._queryParameters=t?gM(o,this.queryParameters,n):o,r.search(""),r.fragment(""),l(i)&&r.scheme()===""&&(r=r.absoluteTo(Jd(i))),this._url=r.toString()};function dFe(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:kf(e)}function gM(e,t,n){if(!n)return Ot(e,t);let i=Xe(e,!0);for(let r in t)if(t.hasOwnProperty(r)){let o=i[r],a=t[r];l(o)?(Array.isArray(o)||(o=i[r]=[o]),i[r]=o.concat(a)):i[r]=Array.isArray(a)?a.slice():a}return i}kt.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${hFe(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(r,o){let a=i[o];return l(a)?encodeURIComponent(a):r})),t&&l(this.proxy)&&(n=this.proxy.getURL(n)),n};function hFe(e){let t=Object.keys(e);return t.length===0?"":t.length===1&&!l(e[t[0]])?`?${t[0]}`:`?${NT(e)}`}kt.prototype.setQueryParameters=function(e,t){t?this._queryParameters=gM(this._queryParameters,e,!1):this._queryParameters=gM(e,this._queryParameters,!1)};kt.prototype.appendQueryParameters=function(e){this._queryParameters=gM(e,this._queryParameters,!0)};kt.prototype.setTemplateValues=function(e,t){t?this._templateValues=Ot(this._templateValues,e):this._templateValues=Ot(e,this._templateValues)};kt.prototype.getDerivedResource=function(e){let t=this.clone();if(t._retryCount=0,l(e.url)){let n=e.preserveQueryParameters??!1;t.parseUrl(e.url,!0,n,this._url)}return l(e.queryParameters)&&(t._queryParameters=Ot(e.queryParameters,t.queryParameters)),l(e.templateValues)&&(t._templateValues=Ot(e.templateValues,t.templateValues)),l(e.headers)&&(t.headers=Ot(e.headers,t.headers)),l(e.proxy)&&(t.proxy=e.proxy),l(e.request)&&(t.request=e.request),l(e.retryCallback)&&(t.retryCallback=e.retryCallback),l(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t};kt.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})};kt.prototype.clone=function(e){return l(e)?(e._url=this._url,e._queryParameters=Xe(this._queryParameters),e._templateValues=Xe(this._templateValues),e.headers=Xe(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new kt({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:l(this.credits)?this.credits.slice():void 0})};kt.prototype.getBaseUri=function(e){return lM(this.getUrlComponent(e),e)};kt.prototype.appendForwardSlash=function(){this._url=cM(this._url)};kt.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};kt.fetchArrayBuffer=function(e){return new kt(e).fetchArrayBuffer()};kt.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};kt.fetchBlob=function(e){return new kt(e).fetchBlob()};kt.prototype.fetchImage=function(e){e=e??H.EMPTY_OBJECT;let t=e.preferImageBitmap??!1,n=e.preferBlob??!1,i=e.flipY??!1,r=e.skipColorSpaceConversion??!1;if(N7(this.request),!Noe||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return this._fetchImage({resource:this,flipY:i,skipColorSpaceConversion:r,preferImageBitmap:t});let o=this.fetchBlob();if(!l(o))return;let a,s,c,u;return kt.supportsImageBitmapOptions().then(function(f){return a=f,s=a&&t,o}).then(function(f){if(!l(f))return;if(u=f,s)return kt.createImageBitmapFromBlob(f,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:r});let d=window.URL.createObjectURL(f);return c=new kt({url:d}),c._fetchImage({flipY:i,skipColorSpaceConversion:r,preferImageBitmap:!1})}).then(function(f){if(l(f))return f.blob=u,s||window.URL.revokeObjectURL(c.url),f}).catch(function(f){return l(c)&&window.URL.revokeObjectURL(c.url),f.blob=u,Promise.reject(f)})};kt.prototype._fetchImage=function(e){let t=this,n=e.flipY,i=e.skipColorSpaceConversion,r=e.preferImageBitmap,o=t.request;o.url=t.url,o.requestFunction=function(){let s=!1;!t.isDataUri&&!t.isBlobUri&&(s=t.isCrossOriginUrl);let c=Vu();return kt._Implementations.createImage(o,s,c,n,i,r),c.promise};let a=fl.request(o);if(l(a))return a.catch(function(s){return o.state!==Ti.FAILED?Promise.reject(s):t.retryOnError(s).then(function(c){return c?(o.state=Ti.UNISSUED,o.deferred=void 0,t._fetchImage({flipY:n,skipColorSpaceConversion:i,preferImageBitmap:r})):Promise.reject(s)})})};kt.fetchImage=function(e){return new kt(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})};kt.prototype.fetchText=function(){return this.fetch({responseType:"text"})};kt.fetchText=function(e){return new kt(e).fetchText()};kt.prototype.fetchJson=function(){let e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(l(e))return e.then(function(t){if(l(t))return JSON.parse(t)})};kt.fetchJson=function(e){return new kt(e).fetchJson()};kt.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};kt.fetchXML=function(e){return new kt(e).fetchXML()};kt.prototype.fetchJsonp=function(e){e=e??"callback",N7(this.request);let t;do t=`loadJsonp${I.nextRandomNumber().toString().substring(2,8)}`;while(l(window[t]));return Foe(this,e,t)};function Foe(e,t,n){let i={};i[t]=n,e.setQueryParameters(i);let r=e.request,o=e.url;r.url=o,r.requestFunction=function(){let s=Vu();return window[n]=function(c){s.resolve(c);try{delete window[n]}catch{window[n]=void 0}},kt._Implementations.loadAndExecuteScript(o,n,s),s.promise};let a=fl.request(r);if(l(a))return a.catch(function(s){return r.state!==Ti.FAILED?Promise.reject(s):e.retryOnError(s).then(function(c){return c?(r.state=Ti.UNISSUED,r.deferred=void 0,Foe(e,t,n)):Promise.reject(s)})})}kt.fetchJsonp=function(e){return new kt(e).fetchJsonp(e.callbackParameterName)};kt.prototype._makeRequest=function(e){let t=this;N7(t.request);let n=t.request,i=t.url;n.url=i,n.requestFunction=function(){let o=e.responseType,a=Ot(e.headers,t.headers),s=e.overrideMimeType,c=e.method,u=e.data,f=Vu(),d=kt._Implementations.loadWithXhr(i,o,c,u,a,f,s);return l(d)&&l(d.abort)&&(n.cancelFunction=function(){d.abort()}),f.promise};let r=fl.request(n);if(l(r))return r.then(function(o){return n.cancelFunction=void 0,o}).catch(function(o){return n.cancelFunction=void 0,n.state!==Ti.FAILED?Promise.reject(o):t.retryOnError(o).then(function(a){return a?(n.state=Ti.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(o)})})};function N7(e){if(e.state===Ti.ISSUED||e.state===Ti.ACTIVE)throw new oe("The Resource is already being fetched.");e.state=Ti.UNISSUED,e.deferred=void 0}var mFe=/^data:(.*?)(;base64)?,(.*)$/;function pM(e,t){let n=decodeURIComponent(t);return e?atob(n):n}function Moe(e,t){let n=pM(e,t),i=new ArrayBuffer(n.length),r=new Uint8Array(i);for(let o=0;o<n.length;o++)r[o]=n.charCodeAt(o);return i}function pFe(e,t){t=t??"";let n=e[1],i=!!e[2],r=e[3],o,a;switch(t){case"":case"text":return pM(i,r);case"arraybuffer":return Moe(i,r);case"blob":return o=Moe(i,r),new Blob([o],{type:n});case"document":return a=new DOMParser,a.parseFromString(pM(i,r),n);case"json":return JSON.parse(pM(i,r));default:}}kt.prototype.fetch=function(e){return e=Tm(e,{}),e.method="GET",this._makeRequest(e)};kt.fetch=function(e){return new kt(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};kt.prototype.delete=function(e){return e=Tm(e,{}),e.method="DELETE",this._makeRequest(e)};kt.delete=function(e){return new kt(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})};kt.prototype.head=function(e){return e=Tm(e,{}),e.method="HEAD",this._makeRequest(e)};kt.head=function(e){return new kt(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};kt.prototype.options=function(e){return e=Tm(e,{}),e.method="OPTIONS",this._makeRequest(e)};kt.options=function(e){return new kt(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};kt.prototype.post=function(e,t){return Ur.defined("data",e),t=Tm(t,{}),t.method="POST",t.data=e,this._makeRequest(t)};kt.post=function(e){return new kt(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};kt.prototype.put=function(e,t){return Ur.defined("data",e),t=Tm(t,{}),t.method="PUT",t.data=e,this._makeRequest(t)};kt.put=function(e){return new kt(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};kt.prototype.patch=function(e,t){return Ur.defined("data",e),t=Tm(t,{}),t.method="PATCH",t.data=e,this._makeRequest(t)};kt.patch=function(e){return new kt(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};kt._Implementations={};kt._Implementations.loadImageElement=function(e,t,n){let i=new Image;i.onload=function(){i.naturalWidth===0&&i.naturalHeight===0&&i.width===0&&i.height===0&&(i.width=300,i.height=150),n.resolve(i)},i.onerror=function(r){n.reject(r)},t&&(Hw.contains(e)?i.crossOrigin="use-credentials":i.crossOrigin=""),i.src=e};kt._Implementations.createImage=function(e,t,n,i,r,o,a){let s=e.url;kt.supportsImageBitmapOptions().then(function(c){if(!(c&&o)){kt._Implementations.loadImageElement(s,t,n);return}let u="blob",f="GET",d=Vu(),p=kt._Implementations.loadWithXhr(s,u,f,void 0,a,d,void 0,void 0,void 0);return l(p)&&l(p.abort)&&(e.cancelFunction=function(){p.abort()}),d.promise.then(function(g){if(!l(g)){n.reject(new oe(`Successfully retrieved ${s} but it contained no content.`));return}return kt.createImageBitmapFromBlob(g,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:r})}).then(function(g){n.resolve(g)})}).catch(function(c){n.reject(c)})};kt.createImageBitmapFromBlob=function(e,t){return Ur.defined("options",t),Ur.typeOf.bool("options.flipY",t.flipY),Ur.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),Ur.typeOf.bool("options.skipColorSpaceConversion",t.skipColorSpaceConversion),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:t.skipColorSpaceConversion?"none":"default"})};function gFe(e,t,n,i,r,o,a){fetch(e,{method:n,headers:r}).then(async s=>{if(!s.ok){let c={};s.headers.forEach((u,f)=>{c[f]=u}),o.reject(new l0(s.status,s,c));return}switch(t){case"text":o.resolve(s.text());break;case"json":o.resolve(s.json());break;default:o.resolve(new Uint8Array(await s.arrayBuffer()).buffer);break}}).catch(()=>{o.reject(new l0)})}var _Fe=typeof XMLHttpRequest>"u";kt._Implementations.loadWithXhr=function(e,t,n,i,r,o,a){let s=mFe.exec(e);if(s!==null){o.resolve(pFe(s,t));return}if(_Fe){gFe(e,t,n,i,r,o,a);return}let c=new XMLHttpRequest;if(Hw.contains(e)&&(c.withCredentials=!0),c.open(n,e,!0),l(a)&&l(c.overrideMimeType)&&c.overrideMimeType(a),l(r))for(let f in r)r.hasOwnProperty(f)&&c.setRequestHeader(f,r[f]);l(t)&&(c.responseType=t);let u=!1;return typeof e=="string"&&(u=e.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),c.onload=function(){if((c.status<200||c.status>=300)&&!(u&&c.status===0)){o.reject(new l0(c.status,c.response,c.getAllResponseHeaders()));return}let f=c.response,d=c.responseType;if(n==="HEAD"||n==="OPTIONS"){let g=c.getAllResponseHeaders().trim().split(/[\r\n]+/),m={};g.forEach(function(y){let A=y.split(": "),b=A.shift();m[b]=A.join(": ")}),o.resolve(m);return}if(c.status===204)o.resolve(void 0);else if(l(f)&&(!l(t)||d===t))o.resolve(f);else if(t==="json"&&typeof f=="string")try{o.resolve(JSON.parse(f))}catch(p){o.reject(p)}else(d===""||d==="document")&&l(c.responseXML)&&c.responseXML.hasChildNodes()?o.resolve(c.responseXML):(d===""||d==="text")&&l(c.responseText)?o.resolve(c.responseText):o.reject(new oe("Invalid XMLHttpRequest response type."))},c.onerror=function(f){o.reject(new l0)},c.send(i),c};kt._Implementations.loadAndExecuteScript=function(e,t,n){return LT(e,t).catch(function(i){n.reject(i)})};kt._DefaultImplementations={};kt._DefaultImplementations.createImage=kt._Implementations.createImage;kt._DefaultImplementations.loadWithXhr=kt._Implementations.loadWithXhr;kt._DefaultImplementations.loadAndExecuteScript=kt._Implementations.loadAndExecuteScript;kt.DEFAULT=Object.freeze(new kt({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var De=kt;function Ww(e){e=e??H.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,l(e.data)?Boe(this,e.data):Boe(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}Ww.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT;let n=De.createIfNeeded(e),i;try{i=await n.fetchJson()}catch{throw new oe(`An error occurred while retrieving the EOP data from the URL ${n.url}.`)}return new Ww({addNewLeapSeconds:t.addNewLeapSeconds,data:i})};Ww.NONE=Object.freeze({compute:function(e,t){return l(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new BA(0,0,0,0,0),t}});Ww.prototype.compute=function(e,t){if(!l(this._samples))return;if(l(t)||(t=new BA(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,r,o;if(l(i)){let s=n[i],c=n[i+1],u=K.lessThanOrEquals(s,e),f=!l(c),d=f||K.greaterThanOrEquals(c,e);if(u&&d)return r=i,!f&&c.equals(e)&&++r,o=r+1,zoe(this,n,this._samples,e,r,o,t),t}let a=Cr(n,e,K.compare,this._dateColumn);return a>=0?(a<n.length-1&&n[a+1].equals(e)&&++a,r=a,o=a):(o=~a,r=o-1,r<0&&(r=0)),this._lastIndex=r,zoe(this,n,this._samples,e,r,o,t),t};function yFe(e,t){return K.compare(e.julianDate,t)}function Boe(e,t){if(!l(t.columnNames))throw new oe("Error in loaded EOP data: The columnNames property is required.");if(!l(t.samples))throw new oe("Error in loaded EOP data: The samples property is required.");let n=t.columnNames.indexOf("modifiedJulianDateUtc"),i=t.columnNames.indexOf("xPoleWanderRadians"),r=t.columnNames.indexOf("yPoleWanderRadians"),o=t.columnNames.indexOf("ut1MinusUtcSeconds"),a=t.columnNames.indexOf("xCelestialPoleOffsetRadians"),s=t.columnNames.indexOf("yCelestialPoleOffsetRadians"),c=t.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||i<0||r<0||o<0||a<0||s<0||c<0)throw new oe("Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");let u=e._samples=t.samples,f=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=r,e._ut1MinusUtcSecondsColumn=o,e._xCelestialPoleOffsetRadiansColumn=a,e._yCelestialPoleOffsetRadiansColumn=s,e._taiMinusUtcSecondsColumn=c,e._columnCount=t.columnNames.length,e._lastIndex=void 0;let d,p=e._addNewLeapSeconds;for(let g=0,m=u.length;g<m;g+=e._columnCount){let y=u[g+n],A=u[g+c],b=y+Un.MODIFIED_JULIAN_DATE_DIFFERENCE,x=new K(b,A,ai.TAI);if(f.push(x),p){if(A!==d&&l(d)){let T=K.leapSeconds,C=Cr(T,x,yFe);if(C<0){let E=new dr(x,A);T.splice(~C,0,E)}}d=A}}}function koe(e,t,n,i,r){let o=n*i;r.xPoleWander=t[o+e._xPoleWanderRadiansColumn],r.yPoleWander=t[o+e._yPoleWanderRadiansColumn],r.xPoleOffset=t[o+e._xCelestialPoleOffsetRadiansColumn],r.yPoleOffset=t[o+e._yCelestialPoleOffsetRadiansColumn],r.ut1MinusUtc=t[o+e._ut1MinusUtcSecondsColumn]}function Gw(e,t,n){return t+e*(n-t)}function zoe(e,t,n,i,r,o,a){let s=e._columnCount;if(o>t.length-1)return a.xPoleWander=0,a.yPoleWander=0,a.xPoleOffset=0,a.yPoleOffset=0,a.ut1MinusUtc=0,a;let c=t[r],u=t[o];if(c.equals(u)||i.equals(c))return koe(e,n,r,s,a),a;if(i.equals(u))return koe(e,n,o,s,a),a;let f=K.secondsDifference(i,c)/K.secondsDifference(u,c),d=r*s,p=o*s,g=n[d+e._ut1MinusUtcSecondsColumn],m=n[p+e._ut1MinusUtcSecondsColumn],y=m-g;if(y>.5||y<-.5){let A=n[d+e._taiMinusUtcSecondsColumn],b=n[p+e._taiMinusUtcSecondsColumn];A!==b&&(u.equals(i)?g=m:m-=b-A)}return a.xPoleWander=Gw(f,n[d+e._xPoleWanderRadiansColumn],n[p+e._xPoleWanderRadiansColumn]),a.yPoleWander=Gw(f,n[d+e._yPoleWanderRadiansColumn],n[p+e._yPoleWanderRadiansColumn]),a.xPoleOffset=Gw(f,n[d+e._xCelestialPoleOffsetRadiansColumn],n[p+e._xCelestialPoleOffsetRadiansColumn]),a.yPoleOffset=Gw(f,n[d+e._yCelestialPoleOffsetRadiansColumn],n[p+e._yCelestialPoleOffsetRadiansColumn]),a.ut1MinusUtc=Gw(f,g,m),a}var _M=Ww;function Rc(e,t,n){this.heading=e??0,this.pitch=t??0,this.roll=n??0}Rc.fromQuaternion=function(e,t){l(t)||(t=new Rc);let n=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),r=2*(e.w*e.x+e.y*e.z),o=1-2*(e.y*e.y+e.z*e.z),a=2*(e.w*e.z+e.x*e.y);return t.heading=-Math.atan2(a,o),t.roll=Math.atan2(r,i),t.pitch=-I.asinClamped(n),t};Rc.fromDegrees=function(e,t,n,i){return l(i)||(i=new Rc),i.heading=e*I.RADIANS_PER_DEGREE,i.pitch=t*I.RADIANS_PER_DEGREE,i.roll=n*I.RADIANS_PER_DEGREE,i};Rc.clone=function(e,t){if(l(e))return l(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new Rc(e.heading,e.pitch,e.roll)};Rc.equals=function(e,t){return e===t||l(e)&&l(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll};Rc.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&I.equalsEpsilon(e.heading,t.heading,n,i)&&I.equalsEpsilon(e.pitch,t.pitch,n,i)&&I.equalsEpsilon(e.roll,t.roll,n,i)};Rc.prototype.clone=function(e){return Rc.clone(this,e)};Rc.prototype.equals=function(e){return Rc.equals(this,e)};Rc.prototype.equalsEpsilon=function(e,t,n){return Rc.equalsEpsilon(this,e,t,n)};Rc.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var Oc=Rc;var Uoe=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function AFe(){let e=document.getElementsByTagName("script");for(let t=0,n=e.length;t<n;++t){let i=e[t].getAttribute("src"),r=Uoe.exec(i);if(r!==null)return r[1]}}var yM;function Voe(e){return typeof document>"u"?e:(l(yM)||(yM=document.createElement("a")),yM.href=e,yM.href)}var VA;function joe(){if(l(VA))return VA;let e;return typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:l(import.meta?.url)?e=Jd(".",import.meta.url):typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(KO.toUrl)?e=Jd("..",jA("Core/buildModuleUrl.js")):e=AFe(),VA=new De({url:Voe(e)}),VA.appendForwardSlash(),VA}function bFe(e){return Voe(KO.toUrl(`../${e}`))}function Hoe(e){return joe().getDerivedResource({url:e}).url}var AM;function jA(e){return l(AM)||(typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(KO.toUrl)?AM=bFe:AM=Hoe),AM(e)}jA._cesiumScriptRegex=Uoe;jA._buildModuleUrlFromBaseUrl=Hoe;jA._clearBaseResource=function(){VA=void 0};jA.setBaseUrl=function(e){VA=De.DEFAULT.getDerivedResource({url:e})};jA.getCesiumBaseUrl=joe;var $t=jA;function xFe(e,t,n){this.x=e,this.y=t,this.s=n}var zT=xFe;function bM(e){e=e??H.EMPTY_OBJECT,this._xysFileUrlTemplate=De.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=e.interpolationOrder??9,this._sampleZeroJulianEphemerisDate=e.sampleZeroJulianEphemerisDate??24423965e-1,this._sampleZeroDateTT=new K(this._sampleZeroJulianEphemerisDate,0,ai.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),r=Math.pow(this._stepSizeDays,t);for(let o=0;o<=t;++o){n[o]=r,i[o]=o*this._stepSizeDays;for(let a=0;a<=t;++a)a!==o&&(n[o]*=o-a);n[o]=1/n[o]}this._work=new Array(t+1),this._coef=new Array(t+1)}var TFe=new K(0,0,ai.TAI);function F7(e,t,n){let i=TFe;return i.dayNumber=t,i.secondsOfDay=n,K.daysDifference(i,e._sampleZeroDateTT)}bM.prototype.preload=function(e,t,n,i){let r=F7(this,e,t),o=F7(this,n,i),a=r/this._stepSizeDays-this._interpolationOrder/2|0;a<0&&(a=0);let s=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);let c=a/this._samplesPerXysFile|0,u=s/this._samplesPerXysFile|0,f=[];for(let d=c;d<=u;++d)f.push(B7(this,d));return Promise.all(f)};bM.prototype.computeXysRadians=function(e,t,n){let i=F7(this,e,t);if(i<0)return;let r=i/this._stepSizeDays|0;if(r>=this._totalSamples)return;let o=this._interpolationOrder,a=r-(o/2|0);a<0&&(a=0);let s=a+o;s>=this._totalSamples&&(s=this._totalSamples-1,a=s-o,a<0&&(a=0));let c=!1,u=this._samples;if(l(u[a*3])||(B7(this,a/this._samplesPerXysFile|0),c=!0),l(u[s*3])||(B7(this,s/this._samplesPerXysFile|0),c=!0),c)return;l(n)?(n.x=0,n.y=0,n.s=0):n=new zT(0,0,0);let f=i-a*this._stepSizeDays,d=this._work,p=this._denominators,g=this._coef,m=this._xTable,y,A;for(y=0;y<=o;++y)d[y]=f-m[y];for(y=0;y<=o;++y){for(g[y]=1,A=0;A<=o;++A)A!==y&&(g[y]*=d[A]);g[y]*=p[y];let b=(a+y)*3;n.x+=g[y]*u[b++],n.y+=g[y]*u[b++],n.s+=g[y]*u[b]}return n};bM.prototype._updateChunkData=function(e,{samples:t}){this._chunkDownloadsInProgress[e]=void 0;let n=this._samplesPerXysFile,i=e*n*3;for(let r=0;r<t.length;++r)this._samples[i+r]=t[r]};async function CFe(e,t,n){try{let i=await e.fetchJson();n._updateChunkData(t,i)}catch{}}function B7(e,t){if(l(e._chunkDownloadsInProgress[t]))return e._chunkDownloadsInProgress[t];let n,i=e._xysFileUrlTemplate;l(i)?n=i.getDerivedResource({templateValues:{0:t}}):n=new De({url:$t(`Assets/IAU2006_XYS/IAU2006_XYS_${t}.json`)});let r=CFe(n,t,e);return e._chunkDownloadsInProgress[t]=r,r}var xM=bM;var t_,Jo={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},Yl={};Object.defineProperties(Yl,{element:{get:function(){if(Yl.supportsFullscreen())return document[Jo.fullscreenElement]}},changeEventName:{get:function(){if(Yl.supportsFullscreen())return Jo.fullscreenchange}},errorEventName:{get:function(){if(Yl.supportsFullscreen())return Jo.fullscreenerror}},enabled:{get:function(){if(Yl.supportsFullscreen())return document[Jo.fullscreenEnabled]}},fullscreen:{get:function(){if(Yl.supportsFullscreen())return Yl.element!==null}}});Yl.supportsFullscreen=function(){if(l(t_))return t_;t_=!1;let e=document.body;if(typeof e.requestFullscreen=="function")return Jo.requestFullscreen="requestFullscreen",Jo.exitFullscreen="exitFullscreen",Jo.fullscreenEnabled="fullscreenEnabled",Jo.fullscreenElement="fullscreenElement",Jo.fullscreenchange="fullscreenchange",Jo.fullscreenerror="fullscreenerror",t_=!0,t_;let t=["webkit","moz","o","ms","khtml"],n;for(let i=0,r=t.length;i<r;++i){let o=t[i];n=`${o}RequestFullscreen`,typeof e[n]=="function"?(Jo.requestFullscreen=n,t_=!0):(n=`${o}RequestFullScreen`,typeof e[n]=="function"&&(Jo.requestFullscreen=n,t_=!0)),n=`${o}ExitFullscreen`,typeof document[n]=="function"?Jo.exitFullscreen=n:(n=`${o}CancelFullScreen`,typeof document[n]=="function"&&(Jo.exitFullscreen=n)),n=`${o}FullscreenEnabled`,document[n]!==void 0?Jo.fullscreenEnabled=n:(n=`${o}FullScreenEnabled`,document[n]!==void 0&&(Jo.fullscreenEnabled=n)),n=`${o}FullscreenElement`,document[n]!==void 0?Jo.fullscreenElement=n:(n=`${o}FullScreenElement`,document[n]!==void 0&&(Jo.fullscreenElement=n)),n=`${o}fullscreenchange`,document[`on${n}`]!==void 0&&(o==="ms"&&(n="MSFullscreenChange"),Jo.fullscreenchange=n),n=`${o}fullscreenerror`,document[`on${n}`]!==void 0&&(o==="ms"&&(n="MSFullscreenError"),Jo.fullscreenerror=n)}return t_};Yl.requestFullscreen=function(e,t){Yl.supportsFullscreen()&&e[Jo.requestFullscreen]({vrDisplay:t})};Yl.exitFullscreen=function(){Yl.supportsFullscreen()&&document[Jo.exitFullscreen]()};Yl._names=Jo;var Zo=Yl;var zf;typeof navigator<"u"?zf=navigator:zf={};function qw(e){let t=e.split(".");for(let n=0,i=t.length;n<i;++n)t[n]=parseInt(t[n],10);return t}var TM,Goe;function j7(){if(!l(TM)&&(TM=!1,!IM())){let e=/ Chrome\/([\.0-9]+)/.exec(zf.userAgent);e!==null&&(TM=!0,Goe=qw(e[1]))}return TM}function vFe(){return j7()&&Goe}var CM,Woe;function qoe(){if(!l(CM)&&(CM=!1,!j7()&&!IM()&&/ Safari\/[\.0-9]+/.test(zf.userAgent))){let e=/ Version\/([\.0-9]+)/.exec(zf.userAgent);e!==null&&(CM=!0,Woe=qw(e[1]))}return CM}function EFe(){return qoe()&&Woe}var vM,V7;function Yoe(){if(!l(vM)){vM=!1;let e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(zf.userAgent);e!==null&&(vM=!0,V7=qw(e[1]),V7.isNightly=!!e[2])}return vM}function SFe(){return Yoe()&&V7}var EM,Xoe;function IM(){if(!l(EM)){EM=!1;let e=/ Edg\/([\.0-9]+)/.exec(zf.userAgent);e!==null&&(EM=!0,Xoe=qw(e[1]))}return EM}function wFe(){return IM()&&Xoe}var SM,H7;function PM(){if(!l(SM)){SM=!1;let e=/Firefox\/([\.0-9]+)/.exec(zf.userAgent);e!==null&&(SM=!0,H7=qw(e[1]))}return SM}var k7;function IFe(){return l(k7)||(k7=/Windows/i.test(zf.appVersion)),k7}var z7;function PFe(){return l(z7)||(z7=navigator.platform==="iPhone"||navigator.platform==="iPod"||navigator.platform==="iPad"),z7}function DFe(){return PM()&&H7}var U7;function RFe(){return l(U7)||(U7=!PM()&&typeof PointerEvent<"u"&&(!l(zf.pointerEnabled)||zf.pointerEnabled)),U7}var Koe,wM;function $oe(){if(!l(wM)){let e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");let t=e.style.imageRendering;wM=l(t)&&t!=="",wM&&(Koe=t)}return wM}function OFe(){return $oe()?Koe:void 0}function dl(){return dl._result}dl._promise=void 0;dl._result=void 0;dl.initialize=function(){return l(dl._promise)||(dl._promise=new Promise(e=>{let t=new Image;t.onload=function(){dl._result=t.width>0&&t.height>0,e(dl._result)},t.onerror=function(){dl._result=!1,e(dl._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),dl._promise};Object.defineProperties(dl,{initialized:{get:function(){return l(dl._result)}}});var UT=[];typeof ArrayBuffer<"u"&&(UT.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&UT.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&UT.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&UT.push(BigInt64Array),typeof BigUint64Array<"u"&&UT.push(BigUint64Array));var Uf={isChrome:j7,chromeVersion:vFe,isSafari:qoe,safariVersion:EFe,isWebkit:Yoe,webkitVersion:SFe,isEdge:IM,edgeVersion:wFe,isFirefox:PM,firefoxVersion:DFe,isWindows:IFe,isIPadOrIOS:PFe,hardwareConcurrency:zf.hardwareConcurrency??3,supportsPointerEvents:RFe,supportsImageRenderingPixelated:$oe,supportsWebP:dl,imageRenderingValue:OFe,typedArrayTypes:UT};Uf.supportsBasis=function(e){return Uf.supportsWebAssembly()&&e.context.supportsBasis};Uf.supportsFullscreen=function(){return Zo.supportsFullscreen()};Uf.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"};Uf.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"};Uf.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"};Uf.supportsBigInt=function(){return typeof BigInt<"u"};Uf.supportsWebWorkers=function(){return typeof Worker<"u"};Uf.supportsWebAssembly=function(){return typeof WebAssembly<"u"};Uf.supportsWebgl2=function(e){return e.context.webgl2};Uf.supportsEsmWebWorkers=function(){return!PM()||parseInt(H7)>=114};var fn=Uf;function st(e,t,n,i){this.x=e??0,this.y=t??0,this.z=n??0,this.w=i??0}var Yw=new h;st.fromAxisAngle=function(e,t,n){let i=t/2,r=Math.sin(i);Yw=h.normalize(e,Yw);let o=Yw.x*r,a=Yw.y*r,s=Yw.z*r,c=Math.cos(i);return l(n)?(n.x=o,n.y=a,n.z=s,n.w=c,n):new st(o,a,s,c)};var MFe=[1,2,0],LFe=new Array(3);st.fromRotationMatrix=function(e,t){let n,i,r,o,a,s=e[$.COLUMN0ROW0],c=e[$.COLUMN1ROW1],u=e[$.COLUMN2ROW2],f=s+c+u;if(f>0)n=Math.sqrt(f+1),a=.5*n,n=.5/n,i=(e[$.COLUMN1ROW2]-e[$.COLUMN2ROW1])*n,r=(e[$.COLUMN2ROW0]-e[$.COLUMN0ROW2])*n,o=(e[$.COLUMN0ROW1]-e[$.COLUMN1ROW0])*n;else{let d=MFe,p=0;c>s&&(p=1),u>s&&u>c&&(p=2);let g=d[p],m=d[g];n=Math.sqrt(e[$.getElementIndex(p,p)]-e[$.getElementIndex(g,g)]-e[$.getElementIndex(m,m)]+1);let y=LFe;y[p]=.5*n,n=.5/n,a=(e[$.getElementIndex(m,g)]-e[$.getElementIndex(g,m)])*n,y[g]=(e[$.getElementIndex(g,p)]+e[$.getElementIndex(p,g)])*n,y[m]=(e[$.getElementIndex(m,p)]+e[$.getElementIndex(p,m)])*n,i=-y[0],r=-y[1],o=-y[2]}return l(t)?(t.x=i,t.y=r,t.z=o,t.w=a,t):new st(i,r,o,a)};var Joe=new st,Zoe=new st,G7=new st,Qoe=new st;st.fromHeadingPitchRoll=function(e,t){return Qoe=st.fromAxisAngle(h.UNIT_X,e.roll,Joe),G7=st.fromAxisAngle(h.UNIT_Y,-e.pitch,t),t=st.multiply(G7,Qoe,G7),Zoe=st.fromAxisAngle(h.UNIT_Z,-e.heading,Joe),st.multiply(Zoe,t,t)};var DM=new h,W7=new h,Zd=new st,eae=new st,RM=new st;st.packedLength=4;st.pack=function(e,t,n){return n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};st.unpack=function(e,t,n){return t=t??0,l(n)||(n=new st),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n};st.packedInterpolationLength=3;st.convertPackedArrayForInterpolation=function(e,t,n,i){st.unpack(e,n*4,RM),st.conjugate(RM,RM);for(let r=0,o=n-t+1;r<o;r++){let a=r*3;st.unpack(e,(t+r)*4,Zd),st.multiply(Zd,RM,Zd),Zd.w<0&&st.negate(Zd,Zd),st.computeAxis(Zd,DM);let s=st.computeAngle(Zd);l(i)||(i=[]),i[a]=DM.x*s,i[a+1]=DM.y*s,i[a+2]=DM.z*s}};st.unpackInterpolationResult=function(e,t,n,i,r){l(r)||(r=new st),h.fromArray(e,0,W7);let o=h.magnitude(W7);return st.unpack(t,i*4,eae),o===0?st.clone(st.IDENTITY,Zd):st.fromAxisAngle(W7,o,Zd),st.multiply(Zd,eae,r)};st.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new st(e.x,e.y,e.z,e.w)};st.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t};st.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};st.magnitude=function(e){return Math.sqrt(st.magnitudeSquared(e))};st.normalize=function(e,t){let n=1/st.magnitude(e),i=e.x*n,r=e.y*n,o=e.z*n,a=e.w*n;return t.x=i,t.y=r,t.z=o,t.w=a,t};st.inverse=function(e,t){let n=st.magnitudeSquared(e);return t=st.conjugate(e,t),st.multiplyByScalar(t,1/n,t)};st.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};st.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};st.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};st.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};st.multiply=function(e,t,n){let i=e.x,r=e.y,o=e.z,a=e.w,s=t.x,c=t.y,u=t.z,f=t.w,d=a*s+i*f+r*u-o*c,p=a*c-i*u+r*f+o*s,g=a*u+i*c-r*s+o*f,m=a*f-i*s-r*c-o*u;return n.x=d,n.y=p,n.z=g,n.w=m,n};st.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};st.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};st.computeAxis=function(e,t){let n=e.w;if(Math.abs(n-1)<I.EPSILON6||Math.abs(n+1)<I.EPSILON6)return t.x=1,t.y=t.z=0,t;let i=1/Math.sqrt(1-n*n);return t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t};st.computeAngle=function(e){return Math.abs(e.w-1)<I.EPSILON6?0:2*Math.acos(e.w)};var q7=new st;st.lerp=function(e,t,n,i){return q7=st.multiplyByScalar(t,n,q7),i=st.multiplyByScalar(e,1-n,i),st.add(q7,i,i)};var tae=new st,Y7=new st,X7=new st;st.slerp=function(e,t,n,i){let r=st.dot(e,t),o=t;if(r<0&&(r=-r,o=tae=st.negate(t,tae)),1-r<I.EPSILON6)return st.lerp(e,o,n,i);let a=Math.acos(r);return Y7=st.multiplyByScalar(e,Math.sin((1-n)*a),Y7),X7=st.multiplyByScalar(o,Math.sin(n*a),X7),i=st.add(Y7,X7,i),st.multiplyByScalar(i,1/Math.sin(a),i)};st.log=function(e,t){let n=I.acosClamped(e.w),i=0;return n!==0&&(i=n/Math.sin(n)),h.multiplyByScalar(e,i,t)};st.exp=function(e,t){let n=h.magnitude(e),i=0;return n!==0&&(i=Math.sin(n)/n),t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t.w=Math.cos(n),t};var NFe=new h,FFe=new h,Xw=new st,VT=new st;st.computeInnerQuadrangle=function(e,t,n,i){let r=st.conjugate(t,Xw);st.multiply(r,n,VT);let o=st.log(VT,NFe);st.multiply(r,e,VT);let a=st.log(VT,FFe);return h.add(o,a,o),h.multiplyByScalar(o,.25,o),h.negate(o,o),st.exp(o,Xw),st.multiply(t,Xw,i)};st.squad=function(e,t,n,i,r,o){let a=st.slerp(e,t,r,Xw),s=st.slerp(n,i,r,VT);return st.slerp(a,s,2*r*(1-r),o)};var BFe=new st,nae=1.9011074535173003,OM=fn.supportsTypedArrays()?new Float32Array(8):[],MM=fn.supportsTypedArrays()?new Float32Array(8):[],f0=fn.supportsTypedArrays()?new Float32Array(8):[],d0=fn.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){let t=e+1,n=2*t+1;OM[e]=1/(t*n),MM[e]=t/n}OM[7]=nae/136;MM[7]=nae*8/17;st.fastSlerp=function(e,t,n,i){let r=st.dot(e,t),o;r>=0?o=1:(o=-1,r=-r);let a=r-1,s=1-n,c=n*n,u=s*s;for(let g=7;g>=0;--g)f0[g]=(OM[g]*c-MM[g])*a,d0[g]=(OM[g]*u-MM[g])*a;let f=o*n*(1+f0[0]*(1+f0[1]*(1+f0[2]*(1+f0[3]*(1+f0[4]*(1+f0[5]*(1+f0[6]*(1+f0[7])))))))),d=s*(1+d0[0]*(1+d0[1]*(1+d0[2]*(1+d0[3]*(1+d0[4]*(1+d0[5]*(1+d0[6]*(1+d0[7])))))))),p=st.multiplyByScalar(e,d,BFe);return st.multiplyByScalar(t,f,i),st.add(p,i,i)};st.fastSquad=function(e,t,n,i,r,o){let a=st.fastSlerp(e,t,r,Xw),s=st.fastSlerp(n,i,r,VT);return st.fastSlerp(a,s,2*r*(1-r),o)};st.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};st.equalsEpsilon=function(e,t,n){return n=n??0,e===t||l(e)&&l(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};st.ZERO=Object.freeze(new st(0,0,0,0));st.IDENTITY=Object.freeze(new st(0,0,0,1));st.prototype.clone=function(e){return st.clone(this,e)};st.prototype.equals=function(e){return st.equals(this,e)};st.prototype.equalsEpsilon=function(e,t){return st.equalsEpsilon(this,e,t)};st.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var Fe=st;var gi={},K7={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"}},jT={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},$7={},Xl={east:new h,north:new h,up:new h,west:new h,south:new h,down:new h},n_=new h,i_=new h,r_=new h;gi.localFrameToFixedFrameGenerator=function(e,t){if(!K7.hasOwnProperty(e)||!K7[e].hasOwnProperty(t))throw new pe("firstAxis and secondAxis must be east, north, up, west, south or down.");let n=K7[e][t],i,r=e+t;return l($7[r])?i=$7[r]:(i=function(o,a,s){if(l(s)||(s=new O),h.equalsEpsilon(o,h.ZERO,I.EPSILON14))h.unpack(jT[e],0,n_),h.unpack(jT[t],0,i_),h.unpack(jT[n],0,r_);else if(I.equalsEpsilon(o.x,0,I.EPSILON14)&&I.equalsEpsilon(o.y,0,I.EPSILON14)){let c=I.sign(o.z);h.unpack(jT[e],0,n_),e!=="east"&&e!=="west"&&h.multiplyByScalar(n_,c,n_),h.unpack(jT[t],0,i_),t!=="east"&&t!=="west"&&h.multiplyByScalar(i_,c,i_),h.unpack(jT[n],0,r_),n!=="east"&&n!=="west"&&h.multiplyByScalar(r_,c,r_)}else{a=a??te.default,a.geodeticSurfaceNormal(o,Xl.up);let c=Xl.up,u=Xl.east;u.x=-o.y,u.y=o.x,u.z=0,h.normalize(u,Xl.east),h.cross(c,u,Xl.north),h.multiplyByScalar(Xl.up,-1,Xl.down),h.multiplyByScalar(Xl.east,-1,Xl.west),h.multiplyByScalar(Xl.north,-1,Xl.south),n_=Xl[e],i_=Xl[t],r_=Xl[n]}return s[0]=n_.x,s[1]=n_.y,s[2]=n_.z,s[3]=0,s[4]=i_.x,s[5]=i_.y,s[6]=i_.z,s[7]=0,s[8]=r_.x,s[9]=r_.y,s[10]=r_.z,s[11]=0,s[12]=o.x,s[13]=o.y,s[14]=o.z,s[15]=1,s},$7[r]=i),i};gi.eastNorthUpToFixedFrame=gi.localFrameToFixedFrameGenerator("east","north");gi.northEastDownToFixedFrame=gi.localFrameToFixedFrameGenerator("north","east");gi.northUpEastToFixedFrame=gi.localFrameToFixedFrameGenerator("north","up");gi.northWestUpToFixedFrame=gi.localFrameToFixedFrameGenerator("north","west");var kFe=new Fe,zFe=new h(1,1,1),UFe=new O;gi.headingPitchRollToFixedFrame=function(e,t,n,i,r){i=i??gi.eastNorthUpToFixedFrame;let o=Fe.fromHeadingPitchRoll(t,kFe),a=O.fromTranslationQuaternionRotationScale(h.ZERO,o,zFe,UFe);return r=i(e,n,r),O.multiply(r,a,r)};var VFe=new O,jFe=new $;gi.headingPitchRollQuaternion=function(e,t,n,i,r){let o=gi.headingPitchRollToFixedFrame(e,t,n,i,VFe),a=O.getMatrix3(o,jFe);return Fe.fromRotationMatrix(a,r)};var HFe=new h(1,1,1),GFe=new h,iae=new O,WFe=new O,qFe=new $,YFe=new Fe;gi.fixedFrameToHeadingPitchRoll=function(e,t,n,i){t=t??te.default,n=n??gi.eastNorthUpToFixedFrame,l(i)||(i=new Oc);let r=O.getTranslation(e,GFe);if(h.equals(r,h.ZERO))return i.heading=0,i.pitch=0,i.roll=0,i;let o=O.inverseTransformation(n(r,t,iae),iae),a=O.setScale(e,HFe,WFe);a=O.setTranslation(a,h.ZERO,a),o=O.multiply(o,a,o);let s=Fe.fromRotationMatrix(O.getMatrix3(o,qFe),YFe);return s=Fe.normalize(s,s),Oc.fromQuaternion(s,i)};var XFe=6*3600+2460+50.54841,KFe=8640184812866e-6,$Fe=.093104,JFe=-62e-7,ZFe=11772758384668e-32,QFe=72921158553e-15,eBe=I.TWO_PI/86400,LM=new K;gi.computeIcrfToCentralBodyFixedMatrix=function(e,t){let n=gi.computeIcrfToFixedMatrix(e,t);return l(n)||(n=gi.computeTemeToPseudoFixedMatrix(e,t)),n};gi.computeTemeToPseudoFixedMatrix=function(e,t){LM=K.addSeconds(e,-K.computeTaiMinusUtc(e),LM);let n=LM.dayNumber,i=LM.secondsOfDay,r,o=n-2451545;i>=43200?r=(o+.5)/Un.DAYS_PER_JULIAN_CENTURY:r=(o-.5)/Un.DAYS_PER_JULIAN_CENTURY;let s=(XFe+r*(KFe+r*($Fe+r*JFe)))*eBe%I.TWO_PI,c=QFe+ZFe*(n-24515455e-1),u=(i+Un.SECONDS_PER_DAY*.5)%Un.SECONDS_PER_DAY,f=s+c*u,d=Math.cos(f),p=Math.sin(f);return l(t)?(t[0]=d,t[1]=-p,t[2]=0,t[3]=p,t[4]=d,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new $(d,p,0,-p,d,0,0,0,1)};gi.iau2006XysData=new xM;gi.earthOrientationParameters=_M.NONE;var Q7=32.184,tBe=2451545;gi.preloadIcrfFixed=function(e){let t=e.start.dayNumber,n=e.start.secondsOfDay+Q7,i=e.stop.dayNumber,r=e.stop.secondsOfDay+Q7;return gi.iau2006XysData.preload(t,n,i,r)};gi.computeIcrfToFixedMatrix=function(e,t){l(t)||(t=new $);let n=gi.computeFixedToIcrfMatrix(e,t);if(l(n))return $.transpose(n,t)};var nBe=32.184,iBe=2451545,NM=new Oc,rBe=new $,oBe=new K;gi.computeMoonFixedToIcrfMatrix=function(e,t){l(t)||(t=new $);let n=K.addSeconds(e,nBe,oBe),i=K.totalDays(n)-iBe,r=I.toRadians(12.112)-I.toRadians(.052992)*i,o=I.toRadians(24.224)-I.toRadians(.105984)*i,a=I.toRadians(227.645)+I.toRadians(13.012)*i,s=I.toRadians(261.105)+I.toRadians(13.340716)*i,c=I.toRadians(358)+I.toRadians(.9856)*i;return NM.pitch=I.toRadians(180)-I.toRadians(3.878)*Math.sin(r)-I.toRadians(.12)*Math.sin(o)+I.toRadians(.07)*Math.sin(a)-I.toRadians(.017)*Math.sin(s),NM.roll=I.toRadians(66.53-90)+I.toRadians(1.543)*Math.cos(r)+I.toRadians(.24)*Math.cos(o)-I.toRadians(.028)*Math.cos(a)+I.toRadians(.007)*Math.cos(s),NM.heading=I.toRadians(244.375-90)+I.toRadians(13.17635831)*i+I.toRadians(3.558)*Math.sin(r)+I.toRadians(.121)*Math.sin(o)-I.toRadians(.064)*Math.sin(a)+I.toRadians(.016)*Math.sin(s)+I.toRadians(.025)*Math.sin(c),$.fromHeadingPitchRoll(NM,rBe,t)};gi.computeIcrfToMoonFixedMatrix=function(e,t){l(t)||(t=new $);let n=gi.computeMoonFixedToIcrfMatrix(e,t);if(l(n))return $.transpose(n,t)};var aBe=new zT(0,0,0),sBe=new BA(0,0,0,0,0,0),J7=new $,Z7=new $;gi.computeFixedToIcrfMatrix=function(e,t){l(t)||(t=new $);let n=gi.earthOrientationParameters.compute(e,sBe);if(!l(n))return;let i=e.dayNumber,r=e.secondsOfDay+Q7,o=gi.iau2006XysData.computeXysRadians(i,r,aBe);if(!l(o))return;let a=o.x+n.xPoleOffset,s=o.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-a*a-s*s)),u=J7;u[0]=1-c*a*a,u[3]=-c*a*s,u[6]=a,u[1]=-c*a*s,u[4]=1-c*s*s,u[7]=s,u[2]=-a,u[5]=-s,u[8]=1-c*(a*a+s*s);let f=$.fromRotationZ(-o.s,Z7),d=$.multiply(u,f,J7),p=e.dayNumber,g=e.secondsOfDay-K.computeTaiMinusUtc(e)+n.ut1MinusUtc,m=p-2451545,y=g/Un.SECONDS_PER_DAY,A=.779057273264+y+.00273781191135448*(m+y);A=A%1*I.TWO_PI;let b=$.fromRotationZ(A,Z7),x=$.multiply(d,b,J7),T=Math.cos(n.xPoleWander),C=Math.cos(n.yPoleWander),E=Math.sin(n.xPoleWander),w=Math.sin(n.yPoleWander),D=i-tBe+r/Un.SECONDS_PER_DAY;D/=36525;let R=-47e-6*D*I.RADIANS_PER_DEGREE/3600,M=Math.cos(R),N=Math.sin(R),_=Z7;return _[0]=T*M,_[1]=T*N,_[2]=E,_[3]=-C*N+w*E*M,_[4]=C*M+w*E*N,_[5]=-w*T,_[6]=-w*N-C*E*M,_[7]=w*M-C*E*N,_[8]=C*T,$.multiply(x,_,t)};var cBe=new ae;gi.pointToWindowCoordinates=function(e,t,n,i){return i=gi.pointToGLWindowCoordinates(e,t,n,i),i.y=2*t[5]-i.y,i};gi.pointToGLWindowCoordinates=function(e,t,n,i){l(i)||(i=new k);let r=cBe;return O.multiplyByVector(e,ae.fromElements(n.x,n.y,n.z,1,r),r),ae.multiplyByScalar(r,1/r.w,r),O.multiplyByVector(t,r,r),k.fromCartesian4(r,i)};var lBe=new h,uBe=new h,fBe=new h;gi.rotationMatrixFromPositionVelocity=function(e,t,n,i){let r=(n??te.default).geodeticSurfaceNormal(e,lBe),o=h.cross(t,r,uBe);h.equalsEpsilon(o,h.ZERO,I.EPSILON6)&&(o=h.clone(h.UNIT_X,o));let a=h.cross(o,t,fBe);return h.normalize(a,a),h.cross(t,a,o),h.negate(o,o),h.normalize(o,o),l(i)||(i=new $),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=o.x,i[4]=o.y,i[5]=o.z,i[6]=a.x,i[7]=a.y,i[8]=a.z,i};gi.SWIZZLE_3D_TO_2D_MATRIX=Object.freeze(new O(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1));var rae=new de,eW=new h,dBe=new h,hBe=new $,tW=new O,oae=new O;gi.basisTo2D=function(e,t,n){let i=O.getTranslation(t,dBe),r=e.ellipsoid,o;if(h.equals(i,h.ZERO))o=h.clone(h.ZERO,eW);else{let f=r.cartesianToCartographic(i,rae);o=e.project(f,eW),h.fromElements(o.z,o.x,o.y,o)}let a=gi.eastNorthUpToFixedFrame(i,r,tW),s=O.inverseTransformation(a,oae),c=O.getMatrix3(t,hBe),u=O.multiplyByMatrix3(s,c,n);return O.multiply(gi.SWIZZLE_3D_TO_2D_MATRIX,u,n),O.setTranslation(n,o,n),n};gi.ellipsoidTo2DModelMatrix=function(e,t,n){let i=e.ellipsoid,r=gi.eastNorthUpToFixedFrame(t,i,tW),o=O.inverseTransformation(r,oae),a=i.cartesianToCartographic(t,rae),s=e.project(a,eW);h.fromElements(s.z,s.x,s.y,s);let c=O.fromTranslation(s,tW);return O.multiply(gi.SWIZZLE_3D_TO_2D_MATRIX,o,n),O.multiply(c,n,n),n};var mt=gi;var HT=class e{constructor(t,n,i,r){this.west=t??0,this.south=n??0,this.east=i??0,this.north=r??0}get width(){return e.computeWidth(this)}get height(){return e.computeHeight(this)}static pack(t,n,i){return i=i??0,n[i++]=t.west,n[i++]=t.south,n[i++]=t.east,n[i]=t.north,n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i.west=t[n++],i.south=t[n++],i.east=t[n++],i.north=t[n],i}static computeWidth(t){let n=t.east,i=t.west;return n<i&&(n+=I.TWO_PI),n-i}static computeHeight(t){return t.north-t.south}static fromDegrees(t,n,i,r,o){return t=I.toRadians(t??0),n=I.toRadians(n??0),i=I.toRadians(i??0),r=I.toRadians(r??0),l(o)?(o.west=t,o.south=n,o.east=i,o.north=r,o):new e(t,n,i,r)}static fromRadians(t,n,i,r,o){return l(o)?(o.west=t??0,o.south=n??0,o.east=i??0,o.north=r??0,o):new e(t,n,i,r)}static fromCartographicArray(t,n){let i=Number.MAX_VALUE,r=-Number.MAX_VALUE,o=Number.MAX_VALUE,a=-Number.MAX_VALUE,s=Number.MAX_VALUE,c=-Number.MAX_VALUE;for(let u=0,f=t.length;u<f;u++){let d=t[u];i=Math.min(i,d.longitude),r=Math.max(r,d.longitude),s=Math.min(s,d.latitude),c=Math.max(c,d.latitude);let p=d.longitude>=0?d.longitude:d.longitude+I.TWO_PI;o=Math.min(o,p),a=Math.max(a,p)}return r-i>a-o&&(i=o,r=a,r>I.PI&&(r=r-I.TWO_PI),i>I.PI&&(i=i-I.TWO_PI)),l(n)?(n.west=i,n.south=s,n.east=r,n.north=c,n):new e(i,s,r,c)}static fromCartesianArray(t,n,i){n=n??te.default;let r=Number.MAX_VALUE,o=-Number.MAX_VALUE,a=Number.MAX_VALUE,s=-Number.MAX_VALUE,c=Number.MAX_VALUE,u=-Number.MAX_VALUE;for(let f=0,d=t.length;f<d;f++){let p=n.cartesianToCartographic(t[f]);r=Math.min(r,p.longitude),o=Math.max(o,p.longitude),c=Math.min(c,p.latitude),u=Math.max(u,p.latitude);let g=p.longitude>=0?p.longitude:p.longitude+I.TWO_PI;a=Math.min(a,g),s=Math.max(s,g)}return o-r>s-a&&(r=a,o=s,o>I.PI&&(o=o-I.TWO_PI),r>I.PI&&(r=r-I.TWO_PI)),l(i)?(i.west=r,i.south=c,i.east=o,i.north=u,i):new e(r,c,o,u)}static fromBoundingSphere(t,n,i){let r=t.center,o=t.radius;if(l(n)||(n=te.default),l(i)||(i=new e),h.equals(r,h.ZERO))return e.clone(e.MAX_VALUE,i),i;let a=mt.eastNorthUpToFixedFrame(r,n,mBe),s=O.multiplyByPointAsVector(a,h.UNIT_X,pBe);h.normalize(s,s);let c=O.multiplyByPointAsVector(a,h.UNIT_Y,gBe);h.normalize(c,c),h.multiplyByScalar(c,o,c),h.multiplyByScalar(s,o,s);let u=h.negate(c,yBe),f=h.negate(s,_Be),d=nW,p=d[0];return h.add(r,c,p),p=d[1],h.add(r,f,p),p=d[2],h.add(r,u,p),p=d[3],h.add(r,s,p),d[4]=r,e.fromCartesianArray(d,n,i)}static clone(t,n){if(l(t))return l(n)?(n.west=t.west,n.south=t.south,n.east=t.east,n.north=t.north,n):new e(t.west,t.south,t.east,t.north)}static equalsEpsilon(t,n,i){return i=i??0,t===n||l(t)&&l(n)&&Math.abs(t.west-n.west)<=i&&Math.abs(t.south-n.south)<=i&&Math.abs(t.east-n.east)<=i&&Math.abs(t.north-n.north)<=i}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}static equals(t,n){return t===n||l(t)&&l(n)&&t.west===n.west&&t.south===n.south&&t.east===n.east&&t.north===n.north}equalsEpsilon(t,n){return e.equalsEpsilon(this,t,n)}static _validate(t){}static southwest(t,n){return l(n)?(n.longitude=t.west,n.latitude=t.south,n.height=0,n):new de(t.west,t.south)}static northwest(t,n){return l(n)?(n.longitude=t.west,n.latitude=t.north,n.height=0,n):new de(t.west,t.north)}static northeast(t,n){return l(n)?(n.longitude=t.east,n.latitude=t.north,n.height=0,n):new de(t.east,t.north)}static southeast(t,n){return l(n)?(n.longitude=t.east,n.latitude=t.south,n.height=0,n):new de(t.east,t.south)}static center(t,n){let i=t.east,r=t.west;i<r&&(i+=I.TWO_PI);let o=I.negativePiToPi((r+i)*.5),a=(t.south+t.north)*.5;return l(n)?(n.longitude=o,n.latitude=a,n.height=0,n):new de(o,a)}static intersection(t,n,i){let r=t.east,o=t.west,a=n.east,s=n.west;r<o&&a>0?r+=I.TWO_PI:a<s&&r>0&&(a+=I.TWO_PI),r<o&&s<0?s+=I.TWO_PI:a<s&&o<0&&(o+=I.TWO_PI);let c=I.negativePiToPi(Math.max(o,s)),u=I.negativePiToPi(Math.min(r,a));if(c===I.PI&&u<I.PI&&(c=-I.PI),(t.west<t.east||n.west<n.east)&&u<=c)return;let f=Math.max(t.south,n.south),d=Math.min(t.north,n.north);if(!(f>=d))return l(i)?(i.west=c,i.south=f,i.east=u,i.north=d,i):new e(c,f,u,d)}static simpleIntersection(t,n,i){let r=Math.max(t.west,n.west),o=Math.max(t.south,n.south),a=Math.min(t.east,n.east),s=Math.min(t.north,n.north);if(!(o>=s||r>=a))return l(i)?(i.west=r,i.south=o,i.east=a,i.north=s,i):new e(r,o,a,s)}static union(t,n,i){l(i)||(i=new e);let r=t.east,o=t.west,a=n.east,s=n.west;r<o&&a>0?r+=I.TWO_PI:a<s&&r>0&&(a+=I.TWO_PI),r<o&&s<0?s+=I.TWO_PI:a<s&&o<0&&(o+=I.TWO_PI);let c=I.negativePiToPi(Math.min(o,s)),u=I.negativePiToPi(Math.max(r,a));return i.west=c,i.south=Math.min(t.south,n.south),i.east=u,i.north=Math.max(t.north,n.north),i}static expand(t,n,i){return l(i)||(i=new e),i.west=Math.min(t.west,n.longitude),i.south=Math.min(t.south,n.latitude),i.east=Math.max(t.east,n.longitude),i.north=Math.max(t.north,n.latitude),i}static contains(t,n){let i=n.longitude,r=n.latitude,o=t.west,a=t.east;return a<o&&(a+=I.TWO_PI,i<0&&(i+=I.TWO_PI)),(i>o||I.equalsEpsilon(i,o,I.EPSILON14))&&(i<a||I.equalsEpsilon(i,a,I.EPSILON14))&&r>=t.south&&r<=t.north}static subsample(t,n,i,r){n=n??te.default,i=i??0,l(r)||(r=[]);let o=0,a=t.north,s=t.south,c=t.east,u=t.west,f=ABe;f.height=i,f.longitude=u,f.latitude=a,r[o]=n.cartographicToCartesian(f,r[o]),o++,f.longitude=c,r[o]=n.cartographicToCartesian(f,r[o]),o++,f.latitude=s,r[o]=n.cartographicToCartesian(f,r[o]),o++,f.longitude=u,r[o]=n.cartographicToCartesian(f,r[o]),o++,a<0?f.latitude=a:s>0?f.latitude=s:f.latitude=0;for(let d=1;d<8;++d)f.longitude=-Math.PI+d*I.PI_OVER_TWO,e.contains(t,f)&&(r[o]=n.cartographicToCartesian(f,r[o]),o++);return f.latitude===0&&(f.longitude=u,r[o]=n.cartographicToCartesian(f,r[o]),o++,f.longitude=c,r[o]=n.cartographicToCartesian(f,r[o]),o++),r.length=o,r}static subsection(t,n,i,r,o,a){if(l(a)||(a=new e),t.west<=t.east){let c=t.east-t.west;a.west=t.west+n*c,a.east=t.west+r*c}else{let c=I.TWO_PI+t.east-t.west;a.west=I.negativePiToPi(t.west+n*c),a.east=I.negativePiToPi(t.west+r*c)}let s=t.north-t.south;return a.south=t.south+i*s,a.north=t.south+o*s,n===1&&(a.west=t.east),r===1&&(a.east=t.east),i===1&&(a.south=t.north),o===1&&(a.north=t.north),a}};HT.packedLength=4;var mBe=new O,pBe=new h,gBe=new h,_Be=new h,yBe=new h,nW=new Array(5);for(let e=0;e<nW.length;++e)nW[e]=new h;var ABe=new de;HT.MAX_VALUE=Object.freeze(new HT(-Math.PI,-I.PI_OVER_TWO,Math.PI,I.PI_OVER_TWO));var ie=HT;var FM=class e{constructor(t,n){this.center=h.clone(t??h.ZERO),this.radius=n??0}static fromPoints(t,n){if(l(n)||(n=new e),!l(t)||t.length===0)return n.center=h.clone(h.ZERO,n.center),n.radius=0,n;let i=h.clone(t[0],lW),r=h.clone(i,iW),o=h.clone(i,rW),a=h.clone(i,oW),s=h.clone(i,aW),c=h.clone(i,sW),u=h.clone(i,cW),f=t.length,d;for(d=1;d<f;d++){h.clone(t[d],i);let M=i.x,N=i.y,_=i.z;M<r.x&&h.clone(i,r),M>s.x&&h.clone(i,s),N<o.y&&h.clone(i,o),N>c.y&&h.clone(i,c),_<a.z&&h.clone(i,a),_>u.z&&h.clone(i,u)}let p=h.magnitudeSquared(h.subtract(s,r,ks)),g=h.magnitudeSquared(h.subtract(c,o,ks)),m=h.magnitudeSquared(h.subtract(u,a,ks)),y=r,A=s,b=p;g>b&&(b=g,y=o,A=c),m>b&&(y=a,A=u);let x=uW;x.x=(y.x+A.x)*.5,x.y=(y.y+A.y)*.5,x.z=(y.z+A.z)*.5;let T=h.magnitudeSquared(h.subtract(A,x,ks)),C=Math.sqrt(T),E=fW;E.x=r.x,E.y=o.y,E.z=a.z;let w=dW;w.x=s.x,w.y=c.y,w.z=u.z;let D=h.midpoint(E,w,hW),R=0;for(d=0;d<f;d++){h.clone(t[d],i);let M=h.magnitude(h.subtract(i,D,ks));M>R&&(R=M);let N=h.magnitudeSquared(h.subtract(i,x,ks));if(N>T){let _=Math.sqrt(N);C=(C+_)*.5,T=C*C;let v=_-C;x.x=(C*x.x+v*i.x)/_,x.y=(C*x.y+v*i.y)/_,x.z=(C*x.z+v*i.z)/_}}return C<R?(h.clone(x,n.center),n.radius=C):(h.clone(D,n.center),n.radius=R),n}static fromRectangle2D(t,n,i){return e.fromRectangleWithHeights2D(t,n,0,0,i)}static fromRectangleWithHeights2D(t,n,i,r,o){if(l(o)||(o=new e),!l(t))return o.center=h.clone(h.ZERO,o.center),o.radius=0,o;aae._ellipsoid=te.default,n=n??aae,ie.southwest(t,mW),mW.height=i,ie.northeast(t,pW),pW.height=r;let a=n.project(mW,xBe),s=n.project(pW,TBe),c=s.x-a.x,u=s.y-a.y,f=s.z-a.z;o.radius=Math.sqrt(c*c+u*u+f*f)*.5;let d=o.center;return d.x=a.x+c*.5,d.y=a.y+u*.5,d.z=a.z+f*.5,o}static fromRectangle3D(t,n,i,r){if(n=n??te.default,i=i??0,l(r)||(r=new e),!l(t))return r.center=h.clone(h.ZERO,r.center),r.radius=0,r;let o=ie.subsample(t,n,i,CBe);return e.fromPoints(o,r)}static fromVertices(t,n,i,r){if(l(r)||(r=new e),!l(t)||t.length===0)return r.center=h.clone(h.ZERO,r.center),r.radius=0,r;n=n??h.ZERO,i=i??3;let o=lW;o.x=t[0]+n.x,o.y=t[1]+n.y,o.z=t[2]+n.z;let a=h.clone(o,iW),s=h.clone(o,rW),c=h.clone(o,oW),u=h.clone(o,aW),f=h.clone(o,sW),d=h.clone(o,cW),p=t.length,g;for(g=0;g<p;g+=i){let _=t[g]+n.x,v=t[g+1]+n.y,S=t[g+2]+n.z;o.x=_,o.y=v,o.z=S,_<a.x&&h.clone(o,a),_>u.x&&h.clone(o,u),v<s.y&&h.clone(o,s),v>f.y&&h.clone(o,f),S<c.z&&h.clone(o,c),S>d.z&&h.clone(o,d)}let m=h.magnitudeSquared(h.subtract(u,a,ks)),y=h.magnitudeSquared(h.subtract(f,s,ks)),A=h.magnitudeSquared(h.subtract(d,c,ks)),b=a,x=u,T=m;y>T&&(T=y,b=s,x=f),A>T&&(b=c,x=d);let C=uW;C.x=(b.x+x.x)*.5,C.y=(b.y+x.y)*.5,C.z=(b.z+x.z)*.5;let E=h.magnitudeSquared(h.subtract(x,C,ks)),w=Math.sqrt(E),D=fW;D.x=a.x,D.y=s.y,D.z=c.z;let R=dW;R.x=u.x,R.y=f.y,R.z=d.z;let M=h.midpoint(D,R,hW),N=0;for(g=0;g<p;g+=i){o.x=t[g]+n.x,o.y=t[g+1]+n.y,o.z=t[g+2]+n.z;let _=h.magnitude(h.subtract(o,M,ks));_>N&&(N=_);let v=h.magnitudeSquared(h.subtract(o,C,ks));if(v>E){let S=Math.sqrt(v);w=(w+S)*.5,E=w*w;let P=S-w;C.x=(w*C.x+P*o.x)/S,C.y=(w*C.y+P*o.y)/S,C.z=(w*C.z+P*o.z)/S}}return w<N?(h.clone(C,r.center),r.radius=w):(h.clone(M,r.center),r.radius=N),r}static fromEncodedCartesianVertices(t,n,i){if(l(i)||(i=new e),!l(t)||!l(n)||t.length!==n.length||t.length===0)return i.center=h.clone(h.ZERO,i.center),i.radius=0,i;let r=lW;r.x=t[0]+n[0],r.y=t[1]+n[1],r.z=t[2]+n[2];let o=h.clone(r,iW),a=h.clone(r,rW),s=h.clone(r,oW),c=h.clone(r,aW),u=h.clone(r,sW),f=h.clone(r,cW),d=t.length,p;for(p=0;p<d;p+=3){let N=t[p]+n[p],_=t[p+1]+n[p+1],v=t[p+2]+n[p+2];r.x=N,r.y=_,r.z=v,N<o.x&&h.clone(r,o),N>c.x&&h.clone(r,c),_<a.y&&h.clone(r,a),_>u.y&&h.clone(r,u),v<s.z&&h.clone(r,s),v>f.z&&h.clone(r,f)}let g=h.magnitudeSquared(h.subtract(c,o,ks)),m=h.magnitudeSquared(h.subtract(u,a,ks)),y=h.magnitudeSquared(h.subtract(f,s,ks)),A=o,b=c,x=g;m>x&&(x=m,A=a,b=u),y>x&&(A=s,b=f);let T=uW;T.x=(A.x+b.x)*.5,T.y=(A.y+b.y)*.5,T.z=(A.z+b.z)*.5;let C=h.magnitudeSquared(h.subtract(b,T,ks)),E=Math.sqrt(C),w=fW;w.x=o.x,w.y=a.y,w.z=s.z;let D=dW;D.x=c.x,D.y=u.y,D.z=f.z;let R=h.midpoint(w,D,hW),M=0;for(p=0;p<d;p+=3){r.x=t[p]+n[p],r.y=t[p+1]+n[p+1],r.z=t[p+2]+n[p+2];let N=h.magnitude(h.subtract(r,R,ks));N>M&&(M=N);let _=h.magnitudeSquared(h.subtract(r,T,ks));if(_>C){let v=Math.sqrt(_);E=(E+v)*.5,C=E*E;let S=v-E;T.x=(E*T.x+S*r.x)/v,T.y=(E*T.y+S*r.y)/v,T.z=(E*T.z+S*r.z)/v}}return E<M?(h.clone(T,i.center),i.radius=E):(h.clone(R,i.center),i.radius=M),i}static fromCornerPoints(t,n,i){l(i)||(i=new e);let r=h.midpoint(t,n,i.center);return i.radius=h.distance(r,n),i}static fromEllipsoid(t,n){return l(n)||(n=new e),h.clone(h.ZERO,n.center),n.radius=t.maximumRadius,n}static fromBoundingSpheres(t,n){if(l(n)||(n=new e),!l(t)||t.length===0)return n.center=h.clone(h.ZERO,n.center),n.radius=0,n;let i=t.length;if(i===1)return e.clone(t[0],n);if(i===2)return e.union(t[0],t[1],n);let r=[],o;for(o=0;o<i;o++)r.push(t[o].center);n=e.fromPoints(r,n);let a=n.center,s=n.radius;for(o=0;o<i;o++){let c=t[o];s=Math.max(s,h.distance(a,c.center)+c.radius)}return n.radius=s,n}static fromOrientedBoundingBox(t,n){l(n)||(n=new e);let i=t.halfAxes,r=$.getColumn(i,0,vBe),o=$.getColumn(i,1,EBe),a=$.getColumn(i,2,SBe);return h.add(r,o,r),h.add(r,a,r),n.center=h.clone(t.center,n.center),n.radius=h.magnitude(r),n}static fromTransformation(t,n){l(n)||(n=new e);let i=O.getTranslation(t,wBe),r=O.getScale(t,IBe),o=.5*h.magnitude(r);return n.center=h.clone(i,n.center),n.radius=o,n}static clone(t,n){if(l(t))return l(n)?(n.center=h.clone(t.center,n.center),n.radius=t.radius,n):new e(t.center,t.radius)}static pack(t,n,i){i=i??0;let r=t.center;return n[i++]=r.x,n[i++]=r.y,n[i++]=r.z,n[i]=t.radius,n}static unpack(t,n,i){n=n??0,l(i)||(i=new e);let r=i.center;return r.x=t[n++],r.y=t[n++],r.z=t[n++],i.radius=t[n],i}static union(t,n,i){l(i)||(i=new e);let r=t.center,o=t.radius,a=n.center,s=n.radius,c=h.subtract(a,r,PBe),u=h.magnitude(c);if(o>=u+s)return t.clone(i),i;if(s>=u+o)return n.clone(i),i;let f=(o+u+s)*.5,d=h.multiplyByScalar(c,(-o+f)/u,DBe);return h.add(d,r,d),h.clone(d,i.center),i.radius=f,i}static expand(t,n,i){i=e.clone(t,i);let r=h.magnitude(h.subtract(n,i.center,RBe));return r>i.radius&&(i.radius=r),i}static intersectPlane(t,n){let i=t.center,r=t.radius,o=n.normal,a=h.dot(o,i)+n.distance;return a<-r?Xt.OUTSIDE:a<r?Xt.INTERSECTING:Xt.INSIDE}static transform(t,n,i){return l(i)||(i=new e),i.center=O.multiplyByPoint(n,t.center,i.center),i.radius=O.getMaximumScale(n)*t.radius,i}static distanceSquaredTo(t,n){let i=h.subtract(t.center,n,OBe),r=h.magnitude(i)-t.radius;return r<=0?0:r*r}static transformWithoutScale(t,n,i){return l(i)||(i=new e),i.center=O.multiplyByPoint(n,t.center,i.center),i.radius=t.radius,i}static computePlaneDistances(t,n,i,r){l(r)||(r=new $o);let o=h.subtract(t.center,n,MBe),a=h.dot(i,o);return r.start=a-t.radius,r.stop=a+t.radius,r}static projectTo2D(t,n,i){cae._ellipsoid=te.default,n=n??cae;let r=n.ellipsoid,o=t.center,a=t.radius,s;h.equals(o,h.ZERO)?s=h.clone(h.UNIT_X,sae):s=r.geodeticSurfaceNormal(o,sae);let c=h.cross(h.UNIT_Z,s,LBe);h.normalize(c,c);let u=h.cross(s,c,NBe);h.normalize(u,u),h.multiplyByScalar(s,a,s),h.multiplyByScalar(u,a,u),h.multiplyByScalar(c,a,c);let f=h.negate(u,BBe),d=h.negate(c,FBe),p=lae,g=p[0];h.add(s,u,g),h.add(g,c,g),g=p[1],h.add(s,u,g),h.add(g,d,g),g=p[2],h.add(s,f,g),h.add(g,d,g),g=p[3],h.add(s,f,g),h.add(g,c,g),h.negate(s,s),g=p[4],h.add(s,u,g),h.add(g,c,g),g=p[5],h.add(s,u,g),h.add(g,d,g),g=p[6],h.add(s,f,g),h.add(g,d,g),g=p[7],h.add(s,f,g),h.add(g,c,g);let m=p.length;for(let x=0;x<m;++x){let T=p[x];h.add(o,T,T);let C=r.cartesianToCartographic(T,kBe);n.project(C,T)}i=e.fromPoints(p,i),o=i.center;let y=o.x,A=o.y,b=o.z;return o.x=b,o.y=y,o.z=A,i}static isOccluded(t,n){return!n.isBoundingSphereVisible(t)}static equals(t,n){return t===n||l(t)&&l(n)&&h.equals(t.center,n.center)&&t.radius===n.radius}intersectPlane(t){return e.intersectPlane(this,t)}distanceSquaredTo(t){return e.distanceSquaredTo(this,t)}computePlaneDistances(t,n,i){return e.computePlaneDistances(this,t,n,i)}isOccluded(t){return e.isOccluded(this,t)}equals(t){return e.equals(this,t)}clone(t){return e.clone(this,t)}volume(){let t=this.radius;return bBe*t*t*t}};FM.packedLength=4;var iW=new h,rW=new h,oW=new h,aW=new h,sW=new h,cW=new h,lW=new h,ks=new h,uW=new h,fW=new h,dW=new h,hW=new h,bBe=4/3*I.PI,aae=new ki,xBe=new h,TBe=new h,mW=new de,pW=new de,CBe=[],vBe=new h,EBe=new h,SBe=new h,wBe=new h,IBe=new h,PBe=new h,DBe=new h,RBe=new h,OBe=new h,MBe=new h,sae=new h,LBe=new h,NBe=new h,FBe=new h,BBe=new h,kBe=new de,lae=new Array(8);for(let e=0;e<8;++e)lae[e]=new h;var cae=new ki,se=FM;var gW=class{constructor(t){t=t??H.EMPTY_OBJECT,this._ellipsoid=t.ellipsoid??te.default,this._rectangle=t.rectangle??ie.MAX_VALUE,this._projection=new ki(this._ellipsoid),this._numberOfLevelZeroTilesX=t.numberOfLevelZeroTilesX??2,this._numberOfLevelZeroTilesY=t.numberOfLevelZeroTilesY??1}get ellipsoid(){return this._ellipsoid}get rectangle(){return this._rectangle}get projection(){return this._projection}getNumberOfXTilesAtLevel(t){return this._numberOfLevelZeroTilesX<<t}getNumberOfYTilesAtLevel(t){return this._numberOfLevelZeroTilesY<<t}rectangleToNativeRectangle(t,n){let i=I.toDegrees(t.west),r=I.toDegrees(t.south),o=I.toDegrees(t.east),a=I.toDegrees(t.north);return l(n)?(n.west=i,n.south=r,n.east=o,n.north=a,n):new ie(i,r,o,a)}tileXYToNativeRectangle(t,n,i,r){let o=this.tileXYToRectangle(t,n,i,r);return o.west=I.toDegrees(o.west),o.south=I.toDegrees(o.south),o.east=I.toDegrees(o.east),o.north=I.toDegrees(o.north),o}tileXYToRectangle(t,n,i,r){let o=this._rectangle,a=this.getNumberOfXTilesAtLevel(i),s=this.getNumberOfYTilesAtLevel(i),c=o.width/a,u=t*c+o.west,f=(t+1)*c+o.west,d=o.height/s,p=o.north-n*d,g=o.north-(n+1)*d;return l(r)||(r=new ie(u,g,f,p)),r.west=u,r.south=g,r.east=f,r.north=p,r}positionToTileXY(t,n,i){let r=this._rectangle;if(!ie.contains(r,t))return;let o=this.getNumberOfXTilesAtLevel(n),a=this.getNumberOfYTilesAtLevel(n),s=r.width/o,c=r.height/a,u=t.longitude;r.east<r.west&&(u+=I.TWO_PI);let f=(u-r.west)/s|0;f>=o&&(f=o-1);let d=(r.north-t.latitude)/c|0;return d>=a&&(d=a-1),l(i)?(i.x=f,i.y=d,i):new k(f,d)}},$i=gW;var uae=new h,fae=new h,dae=new de,_W=new h,zBe=new h,hae=new se,UBe=new $i,Kw=[new de,new de,new de,new de],$w=new k,ma={};ma.initialize=function(){let e=ma._initPromise;return l(e)||(e=De.fetchJson($t("Assets/approximateTerrainHeights.json")).then(function(t){ma._terrainHeights=t}),ma._initPromise=e),e};ma.getMinimumMaximumHeights=function(e,t){t=t??te.default;let n=mae(e),i=ma._defaultMinTerrainHeight,r=ma._defaultMaxTerrainHeight;if(l(n)){let o=`${n.level}-${n.x}-${n.y}`,a=ma._terrainHeights[o];l(a)&&(i=a[0],r=a[1]),t.cartographicToCartesian(ie.northeast(e,dae),uae),t.cartographicToCartesian(ie.southwest(e,dae),fae),h.midpoint(fae,uae,_W);let s=t.scaleToGeodeticSurface(_W,zBe);if(l(s)){let c=h.distance(_W,s);i=Math.min(i,-c)}else i=ma._defaultMinTerrainHeight}return i=Math.max(ma._defaultMinTerrainHeight,i),{minimumTerrainHeight:i,maximumTerrainHeight:r}};ma.getBoundingSphere=function(e,t){t=t??te.default;let n=mae(e),i=ma._defaultMaxTerrainHeight;if(l(n)){let o=`${n.level}-${n.x}-${n.y}`,a=ma._terrainHeights[o];l(a)&&(i=a[1])}let r=se.fromRectangle3D(e,t,0);return se.fromRectangle3D(e,t,i,hae),se.union(r,hae,r)};function mae(e){de.fromRadians(e.east,e.north,0,Kw[0]),de.fromRadians(e.west,e.north,0,Kw[1]),de.fromRadians(e.east,e.south,0,Kw[2]),de.fromRadians(e.west,e.south,0,Kw[3]);let t=0,n=0,i=0,r=0,o=ma._terrainHeightsMaxLevel,a;for(a=0;a<=o;++a){let s=!1;for(let c=0;c<4;++c){let u=Kw[c];if(UBe.positionToTileXY(u,a,$w),c===0)i=$w.x,r=$w.y;else if(i!==$w.x||r!==$w.y){s=!0;break}}if(s)break;t=i,n=r}if(a!==0)return{x:t,y:n,level:a>o?o:a-1}}ma._terrainHeightsMaxLevel=6;ma._defaultMaxTerrainHeight=9e3;ma._defaultMinTerrainHeight=-1e5;ma._terrainHeights=void 0;ma._initPromise=void 0;Object.defineProperties(ma,{initialized:{get:function(){return l(ma._terrainHeights)}}});var Oi=ma;/*! @license DOMPurify 3.4.13 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.13/LICENSE */function pae(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function VBe(e){if(Array.isArray(e))return e}function jBe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var i,r,o,a,s=[],c=!0,u=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(c=(i=o.call(n)).done)&&(s.push(i.value),s.length!==t);c=!0);}catch(f){u=!0,r=f}finally{try{if(!c&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw r}}return s}}function HBe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function GBe(e,t){return VBe(e)||jBe(e,t)||WBe(e,t)||HBe()}function WBe(e,t){if(e){if(typeof e=="string")return pae(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?pae(e,t):void 0}}var Dae=Object.entries,gae=Object.setPrototypeOf,qBe=Object.isFrozen,YBe=Object.getPrototypeOf,XBe=Object.getOwnPropertyDescriptor,fc=Object.freeze,dc=Object.seal,qT=Object.create,Rae=typeof Reflect<"u"&&Reflect,CW=Rae.apply,vW=Rae.construct;fc||(fc=function(t){return t});dc||(dc=function(t){return t});CW||(CW=function(t,n){for(var i=arguments.length,r=new Array(i>2?i-2:0),o=2;o<i;o++)r[o-2]=arguments[o];return t.apply(n,r)});vW||(vW=function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return new t(...i)});var GT=Qa(Array.prototype.forEach),KBe=Qa(Array.prototype.lastIndexOf),_ae=Qa(Array.prototype.pop),WT=Qa(Array.prototype.push),$Be=Qa(Array.prototype.splice),a_=Array.isArray,Qw=Qa(String.prototype.toLowerCase),yW=Qa(String.prototype.toString),yae=Qa(String.prototype.match),Jw=Qa(String.prototype.replace),Aae=Qa(String.prototype.indexOf),JBe=Qa(String.prototype.trim),ZBe=Qa(Number.prototype.toString),QBe=Qa(Boolean.prototype.toString),bae=typeof BigInt>"u"?null:Qa(BigInt.prototype.toString),xae=typeof Symbol>"u"?null:Qa(Symbol.prototype.toString),Us=Qa(Object.prototype.hasOwnProperty),Zw=Qa(Object.prototype.toString),zs=Qa(RegExp.prototype.test),HA=e2e(TypeError);function Qa(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return CW(e,t,i)}}function e2e(e){return function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return vW(e,n)}}function hr(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Qw;if(gae&&gae(e,null),!a_(t))return e;let i=t.length;for(;i--;){let r=t[i];if(typeof r=="string"){let o=n(r);o!==r&&(qBe(t)||(t[i]=o),r=o)}e[r]=!0}return e}function t2e(e){for(let t=0;t<e.length;t++)Us(e,t)||(e[t]=null);return e}function Mc(e){let t=qT(null);for(let i of Dae(e)){var n=GBe(i,2);let r=n[0],o=n[1];Us(e,r)&&(a_(o)?t[r]=t2e(o):o&&typeof o=="object"&&o.constructor===Object?t[r]=Mc(o):t[r]=o)}return t}function n2e(e){switch(typeof e){case"string":return e;case"number":return ZBe(e);case"boolean":return QBe(e);case"bigint":return bae?bae(e):"0";case"symbol":return xae?xae(e):"Symbol()";case"undefined":return Zw(e);case"function":case"object":{if(e===null)return Zw(e);let t=e,n=Qd(t,"toString");if(typeof n=="function"){let i=n(t);return typeof i=="string"?i:Zw(i)}return Zw(e)}default:return Zw(e)}}function Qd(e,t){for(;e!==null;){let i=XBe(e,t);if(i){if(i.get)return Qa(i.get);if(typeof i.value=="function")return Qa(i.value)}e=YBe(e)}function n(){return null}return n}function i2e(e){try{return zs(e,""),!0}catch{return!1}}var Tae=fc(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),AW=fc(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),bW=fc(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),r2e=fc(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),xW=fc(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),o2e=fc(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Cae=fc(["#text"]),vae=fc(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),TW=fc(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Eae=fc(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),BM=fc(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),a2e=dc(/{{[\w\W]*|^[\w\W]*}}/g),s2e=dc(/<%[\w\W]*|^[\w\W]*%>/g),c2e=dc(/\${[\w\W]*/g),l2e=dc(/^data-[\-\w.\u00B7-\uFFFF]+$/),u2e=dc(/^aria-[\-\w]+$/),Sae=dc(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),f2e=dc(/^(?:\w+script|data):/i),d2e=dc(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),h2e=dc(/^html$/i),m2e=dc(/^[a-z][.\w]*(-[.\w]+)+$/i),wae=dc(/<[/\w!]/g),Iae=dc(/<[/\w]/g),p2e=dc(/<\/no(script|embed|frames)/i),g2e=dc(/\/>/i),ju={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},_2e=function(){return typeof window>"u"?null:window},y2e=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let i=null,r="data-tt-policy-suffix";n&&n.hasAttribute(r)&&(i=n.getAttribute(r));let o="dompurify"+(i?"#"+i:"");try{return t.createPolicy(o,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},Pae=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},o_=function(t,n,i,r){return Us(t,n)&&a_(t[n])?hr(r.base?Mc(r.base):{},t[n],r.transform):i};function Oae(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:_2e(),t=ft=>Oae(ft);if(t.version="3.4.13",t.removed=[],!e||!e.document||e.document.nodeType!==ju.document||!e.Element)return t.isSupported=!1,t;let n=e.document,i=n,r=i.currentScript;e.DocumentFragment;let o=e.HTMLTemplateElement,a=e.Node,s=e.Element,c=e.NodeFilter,u=e.NamedNodeMap;u===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let f=e.DOMParser,d=e.trustedTypes,p=s.prototype,g=Qd(p,"cloneNode"),m=Qd(p,"remove"),y=Qd(p,"nextSibling"),A=Qd(p,"childNodes"),b=Qd(p,"parentNode"),x=Qd(p,"shadowRoot"),T=Qd(p,"attributes"),C=a&&a.prototype?Qd(a.prototype,"nodeType"):null,E=a&&a.prototype?Qd(a.prototype,"nodeName"):null,w=a&&a.prototype?Qd(a.prototype,"ownerDocument"):null;if(typeof o=="function"){let ft=n.createElement("template");ft.content&&ft.content.ownerDocument&&(n=ft.content.ownerDocument)}let D,R="",M,N=!1,_=0,v=function(){if(_>0)throw HA('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},S=function(ge){v(),_++;try{return D.createHTML(ge)}finally{_--}},P=function(ge){v(),_++;try{return D.createScriptURL(ge)}finally{_--}},L=function(){return N||(M=y2e(d,r),N=!0),M},F=n,V=F.implementation,z=F.createNodeIterator,j=F.createDocumentFragment,B=F.getElementsByTagName,G=i.importNode,W=Pae();t.isSupported=typeof Dae=="function"&&typeof b=="function"&&V&&V.createHTMLDocument!==void 0;let Q=a2e,q=s2e,J=c2e,Z=l2e,ce=u2e,Ae=f2e,le=d2e,Ce=m2e,ye=Sae,ve=null,Ie=hr({},[...Tae,...AW,...bW,...xW,...Cae]),Le=null,$e=hr({},[...vae,...TW,...Eae,...BM]),Ye=Object.seal(qT(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}})),yt=null,Ke=null,we=Object.seal(qT(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),We=!0,Ct=!0,ct=!1,dn=!0,Ht=!1,bt=!0,Dt=!1,In=!1,rt=null,dt=null,vi=!1,wn=!1,Mi=!1,lr=!1,Li=!0,Wi=!1,ri="user-content-",ei=!0,vn=!1,ti={},xr=null,fa=hr({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]),Ma=null,Xa=hr({},["audio","video","img","source","image","track"]),Ka=null,Qr=hr({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),mi="http://www.w3.org/1998/Math/MathML",eo="http://www.w3.org/2000/svg",Di="http://www.w3.org/1999/xhtml",Mo=Di,Ri=!1,Tr=null,da=hr({},[mi,eo,Di],yW),Co=fc(["mi","mo","mn","ms","mtext"]),Mf=hr({},Co),Lf=fc(["annotation-xml"]),lc=hr({},Lf),Xg=hr({},["title","style","font","a","script"]),vo=null,ys=["application/xhtml+xml","text/html"],Kg="text/html",oi=null,Fs=null,Bs=n.createElement("form"),$a=function(ge){return ge instanceof RegExp||ge instanceof Function},ha=function(){let ge=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Fs&&Fs===ge)return;(!ge||typeof ge!="object")&&(ge={}),ge=Mc(ge),vo=ys.indexOf(ge.PARSER_MEDIA_TYPE)===-1?Kg:ge.PARSER_MEDIA_TYPE,oi=vo==="application/xhtml+xml"?yW:Qw,ve=o_(ge,"ALLOWED_TAGS",Ie,{transform:oi}),Le=o_(ge,"ALLOWED_ATTR",$e,{transform:oi}),Tr=o_(ge,"ALLOWED_NAMESPACES",da,{transform:yW}),Ka=o_(ge,"ADD_URI_SAFE_ATTR",Qr,{transform:oi,base:Qr}),Ma=o_(ge,"ADD_DATA_URI_TAGS",Xa,{transform:oi,base:Xa}),xr=o_(ge,"FORBID_CONTENTS",fa,{transform:oi}),yt=o_(ge,"FORBID_TAGS",Mc({}),{transform:oi}),Ke=o_(ge,"FORBID_ATTR",Mc({}),{transform:oi}),ti=Us(ge,"USE_PROFILES")?ge.USE_PROFILES&&typeof ge.USE_PROFILES=="object"?Mc(ge.USE_PROFILES):ge.USE_PROFILES:!1,We=ge.ALLOW_ARIA_ATTR!==!1,Ct=ge.ALLOW_DATA_ATTR!==!1,ct=ge.ALLOW_UNKNOWN_PROTOCOLS||!1,dn=ge.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ht=ge.SAFE_FOR_TEMPLATES||!1,bt=ge.SAFE_FOR_XML!==!1,Dt=ge.WHOLE_DOCUMENT||!1,wn=ge.RETURN_DOM||!1,Mi=ge.RETURN_DOM_FRAGMENT||!1,lr=ge.RETURN_TRUSTED_TYPE||!1,vi=ge.FORCE_BODY||!1,Li=ge.SANITIZE_DOM!==!1,Wi=ge.SANITIZE_NAMED_PROPS||!1,ei=ge.KEEP_CONTENT!==!1,vn=ge.IN_PLACE||!1,ye=i2e(ge.ALLOWED_URI_REGEXP)?ge.ALLOWED_URI_REGEXP:Sae,Mo=typeof ge.NAMESPACE=="string"?ge.NAMESPACE:Di,Mf=Us(ge,"MATHML_TEXT_INTEGRATION_POINTS")&&ge.MATHML_TEXT_INTEGRATION_POINTS&&typeof ge.MATHML_TEXT_INTEGRATION_POINTS=="object"?Mc(ge.MATHML_TEXT_INTEGRATION_POINTS):hr({},Co),lc=Us(ge,"HTML_INTEGRATION_POINTS")&&ge.HTML_INTEGRATION_POINTS&&typeof ge.HTML_INTEGRATION_POINTS=="object"?Mc(ge.HTML_INTEGRATION_POINTS):hr({},Lf);let Ne=Us(ge,"CUSTOM_ELEMENT_HANDLING")&&ge.CUSTOM_ELEMENT_HANDLING&&typeof ge.CUSTOM_ELEMENT_HANDLING=="object"?Mc(ge.CUSTOM_ELEMENT_HANDLING):qT(null);if(Ye=qT(null),Us(Ne,"tagNameCheck")&&$a(Ne.tagNameCheck)&&(Ye.tagNameCheck=Ne.tagNameCheck),Us(Ne,"attributeNameCheck")&&$a(Ne.attributeNameCheck)&&(Ye.attributeNameCheck=Ne.attributeNameCheck),Us(Ne,"allowCustomizedBuiltInElements")&&typeof Ne.allowCustomizedBuiltInElements=="boolean"&&(Ye.allowCustomizedBuiltInElements=Ne.allowCustomizedBuiltInElements),dc(Ye),Ht&&(Ct=!1),Mi&&(wn=!0),ti&&(ve=hr({},Cae),Le=qT(null),ti.html===!0&&(hr(ve,Tae),hr(Le,vae)),ti.svg===!0&&(hr(ve,AW),hr(Le,TW),hr(Le,BM)),ti.svgFilters===!0&&(hr(ve,bW),hr(Le,TW),hr(Le,BM)),ti.mathMl===!0&&(hr(ve,xW),hr(Le,Eae),hr(Le,BM))),we.tagCheck=null,we.attributeCheck=null,Us(ge,"ADD_TAGS")&&(typeof ge.ADD_TAGS=="function"?we.tagCheck=ge.ADD_TAGS:a_(ge.ADD_TAGS)&&(ve===Ie&&(ve=Mc(ve)),hr(ve,ge.ADD_TAGS,oi))),Us(ge,"ADD_ATTR")&&(typeof ge.ADD_ATTR=="function"?we.attributeCheck=ge.ADD_ATTR:a_(ge.ADD_ATTR)&&(Le===$e&&(Le=Mc(Le)),hr(Le,ge.ADD_ATTR,oi))),Us(ge,"ADD_URI_SAFE_ATTR")&&a_(ge.ADD_URI_SAFE_ATTR)&&hr(Ka,ge.ADD_URI_SAFE_ATTR,oi),Us(ge,"FORBID_CONTENTS")&&a_(ge.FORBID_CONTENTS)&&(xr===fa&&(xr=Mc(xr)),hr(xr,ge.FORBID_CONTENTS,oi)),Us(ge,"ADD_FORBID_CONTENTS")&&a_(ge.ADD_FORBID_CONTENTS)&&(xr===fa&&(xr=Mc(xr)),hr(xr,ge.ADD_FORBID_CONTENTS,oi)),ei&&(ve["#text"]=!0),Dt&&hr(ve,["html","head","body"]),ve.table&&(hr(ve,["tbody"]),delete yt.tbody),ge.TRUSTED_TYPES_POLICY){if(typeof ge.TRUSTED_TYPES_POLICY.createHTML!="function")throw HA('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof ge.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw HA('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');let lt=D;D=ge.TRUSTED_TYPES_POLICY;try{R=S("")}catch(nn){throw D=lt,nn}}else ge.TRUSTED_TYPES_POLICY===null?(D=void 0,R=""):(D===void 0&&(D=L()),D&&typeof R=="string"&&(R=S("")));fc&&fc(ge),Fs=ge},Nf=hr({},[...AW,...bW,...r2e]),LA=hr({},[...xW,...o2e]),d7=function(ge,Ne,lt){return Ne.namespaceURI===Di?ge==="svg":Ne.namespaceURI===mi?ge==="svg"&&(lt==="annotation-xml"||Mf[lt]):!!Nf[ge]},Lw=function(ge,Ne,lt){return Ne.namespaceURI===Di?ge==="math":Ne.namespaceURI===eo?ge==="math"&&lc[lt]:!!LA[ge]},h7=function(ge,Ne,lt){return Ne.namespaceURI===eo&&!lc[lt]||Ne.namespaceURI===mi&&!Mf[lt]?!1:!LA[ge]&&(Xg[ge]||!Nf[ge])},m7=function(ge){let Ne=b(ge);(!Ne||!Ne.tagName)&&(Ne={namespaceURI:Mo,tagName:"template"});let lt=Qw(ge.tagName),nn=Qw(Ne.tagName);return Tr[ge.namespaceURI]?ge.namespaceURI===eo?d7(lt,Ne,nn):ge.namespaceURI===mi?Lw(lt,Ne,nn):ge.namespaceURI===Di?h7(lt,Ne,nn):!!(vo==="application/xhtml+xml"&&Tr[ge.namespaceURI]):!1},gm=function(ge){WT(t.removed,{element:ge});try{b(ge).removeChild(ge)}catch{if(m(ge),!b(ge))throw HA("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},vT=function(ge){$g(ge);let Ne=A(ge);if(Ne){let nn=[];GT(Ne,En=>{WT(nn,En)}),GT(nn,En=>{try{m(En)}catch{}})}let lt=T(ge);if(lt)for(let nn=lt.length-1;nn>=0;--nn){let En=lt[nn],On=En&&En.name;if(typeof On=="string")try{ge.removeAttribute(On)}catch{}}},o0=function(ge,Ne){try{WT(t.removed,{attribute:Ne.getAttributeNode(ge),from:Ne})}catch{WT(t.removed,{attribute:null,from:Ne})}if(Ne.removeAttribute(ge),ge==="is")if(wn||Mi)try{gm(Ne)}catch{}else try{Ne.setAttribute(ge,"")}catch{}},Nw=function(ge){let Ne=T(ge);if(Ne)for(let lt=Ne.length-1;lt>=0;--lt){let nn=Ne[lt],En=nn&&nn.name;if(!(typeof En!="string"||Le[oi(En)]))try{ge.removeAttribute(En)}catch{}}},$g=function(ge){let Ne=[ge];for(;Ne.length>0;){let lt=Ne.pop();(C?C(lt):lt.nodeType)===ju.element&&Nw(lt);let En=A(lt);if(En)for(let On=En.length-1;On>=0;--On)Ne.push(En[On])}},Fw=function(ge){if(!bt)return;let Ne=[ge];for(;Ne.length>0;){let lt=Ne.pop(),nn=C?C(lt):lt.nodeType;if(nn===ju.processingInstruction||nn===ju.comment&&zs(Iae,lt.data)){try{m(lt)}catch{}continue}if(nn===ju.element){let On=lt,ur=oi(E?E(lt):lt.nodeName);try{On.hasAttribute&&On.hasAttribute("patchsrc")&&On.removeAttribute("patchsrc"),On.hasAttribute&&On.hasAttribute("for")&&ur!=="label"&&ur!=="output"&&On.removeAttribute("for")}catch{}}let En=A(lt);if(En)for(let On=En.length-1;On>=0;--On)Ne.push(En[On])}},XO=function(ge){let Ne=null,lt=null;if(vi)ge="<remove></remove>"+ge;else{let On=yae(ge,/^[\r\n\t ]+/);lt=On&&On[0]}vo==="application/xhtml+xml"&&Mo===Di&&(ge='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+ge+"</body></html>");let nn=D?S(ge):ge;if(Mo===Di)try{Ne=new f().parseFromString(nn,vo)}catch{}if(!Ne||!Ne.documentElement){Ne=V.createDocument(Mo,"template",null);try{Ne.documentElement.innerHTML=Ri?R:nn}catch{}}let En=Ne.body||Ne.documentElement;return ge&<&&En.insertBefore(n.createTextNode(lt),En.childNodes[0]||null),Mo===Di?B.call(Ne,Dt?"html":"body")[0]:Dt?Ne.documentElement:En},Bw=function(ge){let Ne=w?w(ge):ge.ownerDocument;return z.call(Ne||ge,ge,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Jg=function(ge){return ge=Jw(ge,Q," "),ge=Jw(ge,q," "),ge=Jw(ge,J," "),ge},Ff=function(ge){var Ne;ge.normalize();let lt=w?w(ge):ge.ownerDocument,nn=z.call(lt||ge,ge,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),En=nn.nextNode();for(;En;)En.data=Jg(En.data),En=nn.nextNode();let On=(Ne=ge.querySelectorAll)===null||Ne===void 0?void 0:Ne.call(ge,"template");On&>(On,ur=>{s0(ur.content)&&Ff(ur.content)})},a0=function(ge){let Ne=E?E(ge):null;return typeof Ne!="string"||oi(Ne)!=="form"?!1:typeof ge.nodeName!="string"||typeof ge.textContent!="string"||typeof ge.removeChild!="function"||ge.attributes!==T(ge)||typeof ge.removeAttribute!="function"||typeof ge.setAttribute!="function"||typeof ge.namespaceURI!="string"||typeof ge.insertBefore!="function"||typeof ge.hasChildNodes!="function"||ge.nodeType!==C(ge)||ge.childNodes!==A(ge)},s0=function(ge){if(!C||typeof ge!="object"||ge===null)return!1;try{return C(ge)===ju.documentFragment}catch{return!1}},NA=function(ge){if(!C||typeof ge!="object"||ge===null)return!1;try{return typeof C(ge)=="number"}catch{return!1}};function sl(ft,ge,Ne){ft.length!==0&>(ft,lt=>{lt.call(t,ge,Ne,Fs)})}let fe=function(ge,Ne){return!!(bt&&ge.hasChildNodes()&&!NA(ge.firstElementChild)&&zs(wae,ge.textContent)&&zs(wae,ge.innerHTML)||bt&&ge.namespaceURI===Di&&Ne==="style"&&NA(ge.firstElementChild)||ge.nodeType===ju.processingInstruction||bt&&ge.nodeType===ju.comment&&zs(Iae,ge.data))},ne=function(ge,Ne,lt){if(!yt[Ne]&&ut(Ne)&&(Ye.tagNameCheck instanceof RegExp&&zs(Ye.tagNameCheck,Ne)||Ye.tagNameCheck instanceof Function&&Ye.tagNameCheck(Ne)))return!1;if(ei&&!xr[Ne]){let nn=b(ge),En=A(ge);if(En&&nn){let On=En.length;for(let ur=On-1;ur>=0;--ur){let to=ge===lt?g(En[ur],!0):En[ur];nn.insertBefore(to,y(ge))}}}return gm(ge),!0},xe=function(ge,Ne,lt,nn){return ge.length===0?Ne:Ne===lt||Ne===nn?Mc(Ne):Ne},Se=function(ge,Ne){if(sl(W.beforeSanitizeElements,ge,null),ge!==Ne&&b(ge)===null)return vn&&$g(ge),!0;if(a0(ge))return gm(ge),!0;let lt=oi(E?E(ge):ge.nodeName);if(ve=xe(W.uponSanitizeElement,ve,Ie,rt),sl(W.uponSanitizeElement,ge,{tagName:lt,allowedTags:ve}),ge!==Ne&&b(ge)===null)return vn&&$g(ge),!0;if(fe(ge,lt))return gm(ge),!0;if(yt[lt]||!(we.tagCheck instanceof Function&&we.tagCheck(lt))&&!ve[lt]){let En=ne(ge,lt,Ne);return En===!1&&sl(W.afterSanitizeElements,ge,null),En}if((C?C(ge):ge.nodeType)===ju.element&&!m7(ge)||(lt==="noscript"||lt==="noembed"||lt==="noframes")&&zs(p2e,ge.innerHTML))return gm(ge),!0;if(Ht&&ge.nodeType===ju.text){let En=Jg(ge.textContent);ge.textContent!==En&&(WT(t.removed,{element:ge.cloneNode()}),ge.textContent=En)}return sl(W.afterSanitizeElements,ge,null),!1},qe=function(ge,Ne,lt){if(Ke[Ne]||bt&&Ne==="patchsrc"||bt&&Ne==="for"&&ge!=="label"&&ge!=="output"||Li&&(Ne==="id"||Ne==="name")&&(lt in n||lt in Bs))return!1;let nn=Le[Ne]||we.attributeCheck instanceof Function&&we.attributeCheck(Ne,ge);if(!(Ct&&zs(Z,Ne))){if(!(We&&zs(ce,Ne))){if(nn){if(!Ka[Ne]){if(!zs(ye,Jw(lt,le,""))){if(!((Ne==="src"||Ne==="xlink:href"||Ne==="href")&&ge!=="script"&&Aae(lt,"data:")===0&&Ma[ge])){if(!(ct&&!zs(Ae,Jw(lt,le,"")))){if(lt)return!1}}}}}else if(!(ut(ge)&&(Ye.tagNameCheck instanceof RegExp&&zs(Ye.tagNameCheck,ge)||Ye.tagNameCheck instanceof Function&&Ye.tagNameCheck(ge))&&(Ye.attributeNameCheck instanceof RegExp&&zs(Ye.attributeNameCheck,Ne)||Ye.attributeNameCheck instanceof Function&&Ye.attributeNameCheck(Ne,ge))||Ne==="is"&&Ye.allowCustomizedBuiltInElements&&(Ye.tagNameCheck instanceof RegExp&&zs(Ye.tagNameCheck,lt)||Ye.tagNameCheck instanceof Function&&Ye.tagNameCheck(lt))))return!1}}return!0},xt=hr({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),ut=function(ge){return!xt[Qw(ge)]&&zs(Ce,ge)},vt=function(ge,Ne,lt,nn){if(D&&typeof d=="object"&&typeof d.getAttributeType=="function"&&!lt)switch(d.getAttributeType(ge,Ne)){case"TrustedHTML":return S(nn);case"TrustedScriptURL":return P(nn)}return nn},yn=function(ge,Ne,lt,nn){try{lt?ge.setAttributeNS(lt,Ne,nn):ge.setAttribute(Ne,nn),a0(ge)?gm(ge):_ae(t.removed)}catch{o0(Ne,ge)}},Hn=function(ge){sl(W.beforeSanitizeAttributes,ge,null);let Ne=ge.attributes;if(!Ne||a0(ge))return;Le=xe(W.uponSanitizeAttribute,Le,$e,dt);let lt={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Le,forceKeepAttr:void 0},nn=Ne.length,En=oi(ge.nodeName);for(;nn--;){let On=Ne[nn],ur=On.name,to=On.namespaceURI,uc=On.value,ql=oi(ur),p7=uc,cl=ur==="value"?p7:JBe(p7);if(lt.attrName=ql,lt.attrValue=cl,lt.keepAttr=!0,lt.forceKeepAttr=void 0,sl(W.uponSanitizeAttribute,ge,lt),cl=lt.attrValue,Wi&&(ql==="id"||ql==="name")&&Aae(cl,ri)!==0&&(o0(ur,ge),cl=ri+cl),bt&&zs(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,cl)){o0(ur,ge);continue}if(ql==="attributename"&&yae(cl,"href")){o0(ur,ge);continue}if(!lt.forceKeepAttr){if(!lt.keepAttr){o0(ur,ge);continue}if(!dn&&zs(g2e,cl)){o0(ur,ge);continue}if(Ht&&(cl=Jg(cl)),!qe(En,ql,cl)){o0(ur,ge);continue}cl=vt(En,ql,to,cl),cl!==p7&&yn(ge,ur,to,cl)}}sl(W.afterSanitizeAttributes,ge,null)},un=function(ge){let Ne=null,lt=Bw(ge);for(sl(W.beforeSanitizeShadowDOM,ge,null);Ne=lt.nextNode();)if(sl(W.uponSanitizeShadowNode,Ne,null),Se(Ne,ge),Hn(Ne),s0(Ne.content)&&un(Ne.content),(C?C(Ne):Ne.nodeType)===ju.element){let En=x(Ne);s0(En)&&(Gr(En),un(En))}sl(W.afterSanitizeShadowDOM,ge,null)},Gr=function(ge){let Ne=[{node:ge,shadow:null}];for(;Ne.length>0;){let lt=Ne.pop();if(lt.shadow){un(lt.shadow);continue}let nn=lt.node,On=(C?C(nn):nn.nodeType)===ju.element,ur=A(nn);if(ur)for(let to=ur.length-1;to>=0;--to)Ne.push({node:ur[to],shadow:null});if(On){let to=E?E(nn):null;if(typeof to=="string"&&oi(to)==="template"){let uc=nn.content;s0(uc)&&Ne.push({node:uc,shadow:null})}}if(On){let to=x(nn);s0(to)&&Ne.push({node:null,shadow:to},{node:to,shadow:null})}}};return t.sanitize=function(ft){let ge=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Ne=null,lt=null,nn=null,En=null;if(Ri=!ft,Ri&&(ft="<!-->"),typeof ft!="string"&&!NA(ft)&&(ft=n2e(ft),typeof ft!="string"))throw HA("dirty is not a string, aborting");if(!t.isSupported)return ft;In?(ve=rt,Le=dt):ha(ge),(W.uponSanitizeElement.length>0||W.uponSanitizeAttribute.length>0)&&(ve=Mc(ve)),W.uponSanitizeAttribute.length>0&&(Le=Mc(Le)),t.removed=[];let On=vn&&typeof ft!="string"&&NA(ft);if(On){Fw(ft);let uc=E?E(ft):ft.nodeName;if(typeof uc=="string"){let ql=oi(uc);if(!ve[ql]||yt[ql])throw vT(ft),HA("root node is forbidden and cannot be sanitized in-place")}if(a0(ft))throw vT(ft),HA("root node is clobbered and cannot be sanitized in-place");try{Gr(ft)}catch(ql){throw vT(ft),ql}}else if(NA(ft))Ne=XO("<!---->"),lt=Ne.ownerDocument.importNode(ft,!0),lt.nodeType===ju.element&<.nodeName==="BODY"||lt.nodeName==="HTML"?Ne=lt:Ne.appendChild(lt),Gr(lt);else{if(!wn&&!Ht&&!Dt&&ft.indexOf("<")===-1)return D&&lr?S(ft):ft;if(Ne=XO(ft),!Ne)return wn?null:lr?R:""}Ne&&vi&&gm(Ne.firstChild);let ur=On?ft:Ne;try{let uc=Bw(ur);for(;nn=uc.nextNode();)Se(nn,ur),Hn(nn),s0(nn.content)&&un(nn.content)}catch(uc){throw On&&(vT(ft),GT(t.removed,ql=>{ql.element&&$g(ql.element)})),uc}if(On)return GT(t.removed,uc=>{uc.element&&$g(uc.element)}),Ht&&Ff(ft),ft;if(wn){if(Ht&&Ff(Ne),Mi)for(En=j.call(Ne.ownerDocument);Ne.firstChild;)En.appendChild(Ne.firstChild);else En=Ne;return(Le.shadowroot||Le.shadowrootmode)&&(En=G.call(i,En,!0)),En}let to=Dt?Ne.outerHTML:Ne.innerHTML;return Dt&&ve["!doctype"]&&Ne.ownerDocument&&Ne.ownerDocument.doctype&&Ne.ownerDocument.doctype.name&&zs(h2e,Ne.ownerDocument.doctype.name)&&(to="<!DOCTYPE "+Ne.ownerDocument.doctype.name+`>
|
|
`+to),Ht&&(to=Jg(to)),D&&lr?S(to):to},t.setConfig=function(){let ft=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ha(ft),In=!0,rt=ve,dt=Le},t.clearConfig=function(){Fs=null,In=!1,rt=null,dt=null,D=M,R=""},t.isValidAttribute=function(ft,ge,Ne){Fs||ha({});let lt=oi(ft),nn=oi(ge);return qe(lt,nn,Ne)},t.addHook=function(ft,ge){typeof ge=="function"&&Us(W,ft)&&WT(W[ft],ge)},t.removeHook=function(ft,ge){if(Us(W,ft)){if(ge!==void 0){let Ne=KBe(W[ft],ge);return Ne===-1?void 0:$Be(W[ft],Ne,1)[0]}return _ae(W[ft])}},t.removeHooks=function(ft){Us(W,ft)&&(W[ft]=[])},t.removeAllHooks=function(){W=Pae()},t}var Mae=Oae();var A2e=0,EW={},SW=class e{constructor(t,n){let i,r=t;l(EW[r])?i=EW[r]:(i=A2e++,EW[r]=i),n=n??!1,this._id=i,this._html=t,this._showOnScreen=n,this._element=void 0}get html(){return this._html}get id(){return this._id}get showOnScreen(){return this._showOnScreen}set showOnScreen(t){this._showOnScreen=t}get element(){if(!l(this._element)){let t=Mae.sanitize(this._html),n=document.createElement("div");n.className="cesium-credit-wrapper",n._creditId=this._id,n.style.display="inline",n.innerHTML=t;let i=n.querySelectorAll("a");for(let r=0;r<i.length;r++)i[r].setAttribute("target","_blank");this._element=n}return this._element}static equals(t,n){return t===n||l(t)&&l(n)&&t._id===n._id&&t._showOnScreen===n._showOnScreen}equals(t){return e.equals(this,t)}isIon(){return this.html.indexOf("ion-credit.png")!==-1}static getIonCredit(t){let n=l(t.collapsible)&&!t.collapsible;return new e(t.html,n)}static clone(t){if(l(t))return new e(t.html,t.showOnScreen)}},wt=SW;var Lae={NONE:0,LERC:1};Object.freeze(Lae);var eh=Lae;function Vs(e,t,n){this.minimum=h.clone(e??h.ZERO),this.maximum=h.clone(t??h.ZERO),l(n)?n=h.clone(n):n=h.midpoint(this.minimum,this.maximum,new h),this.center=n}Vs.fromCorners=function(e,t,n){return l(n)||(n=new Vs),n.minimum=h.clone(e,n.minimum),n.maximum=h.clone(t,n.maximum),n.center=h.midpoint(e,t,n.center),n};Vs.fromPoints=function(e,t){if(l(t)||(t=new Vs),!l(e)||e.length===0)return t.minimum=h.clone(h.ZERO,t.minimum),t.maximum=h.clone(h.ZERO,t.maximum),t.center=h.clone(h.ZERO,t.center),t;let n=e[0].x,i=e[0].y,r=e[0].z,o=e[0].x,a=e[0].y,s=e[0].z,c=e.length;for(let d=1;d<c;d++){let p=e[d],g=p.x,m=p.y,y=p.z;n=Math.min(g,n),o=Math.max(g,o),i=Math.min(m,i),a=Math.max(m,a),r=Math.min(y,r),s=Math.max(y,s)}let u=t.minimum;u.x=n,u.y=i,u.z=r;let f=t.maximum;return f.x=o,f.y=a,f.z=s,t.center=h.midpoint(u,f,t.center),t};Vs.clone=function(e,t){if(l(e))return l(t)?(t.minimum=h.clone(e.minimum,t.minimum),t.maximum=h.clone(e.maximum,t.maximum),t.center=h.clone(e.center,t.center),t):new Vs(e.minimum,e.maximum,e.center)};Vs.equals=function(e,t){return e===t||l(e)&&l(t)&&h.equals(e.center,t.center)&&h.equals(e.minimum,t.minimum)&&h.equals(e.maximum,t.maximum)};var kM=new h;Vs.intersectPlane=function(e,t){kM=h.subtract(e.maximum,e.minimum,kM);let n=h.multiplyByScalar(kM,.5,kM),i=t.normal,r=n.x*Math.abs(i.x)+n.y*Math.abs(i.y)+n.z*Math.abs(i.z),o=h.dot(e.center,i)+t.distance;return o-r>0?Xt.INSIDE:o+r<0?Xt.OUTSIDE:Xt.INTERSECTING};Vs.intersectAxisAlignedBoundingBox=function(e,t){return e.minimum.x<=t.maximum.x&&e.maximum.x>=t.minimum.x&&e.minimum.y<=t.maximum.y&&e.maximum.y>=t.minimum.y&&e.minimum.z<=t.maximum.z&&e.maximum.z>=t.minimum.z};Vs.prototype.clone=function(e){return Vs.clone(this,e)};Vs.prototype.intersectPlane=function(e){return Vs.intersectPlane(this,e)};Vs.prototype.intersectAxisAlignedBoundingBox=function(e){return Vs.intersectAxisAlignedBoundingBox(this,e)};Vs.prototype.equals=function(e){return Vs.equals(this,e)};var Vf=Vs;function Cm(e,t){this._ellipsoid=e,this._cameraPosition=new h,this._cameraPositionInScaledSpace=new h,this._distanceToLimbInScaledSpaceSquared=0,l(t)&&(this.cameraPosition=t)}Object.defineProperties(Cm.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,this._cameraPositionInScaledSpace),i=h.magnitudeSquared(n)-1;h.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=n,this._distanceToLimbInScaledSpaceSquared=i}}});var Nae=new h;Cm.prototype.isPointVisible=function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,Nae);return IW(n,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};Cm.prototype.isScaledSpacePointVisible=function(e){return IW(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var b2e=new h;Cm.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(e,t){let n=this._ellipsoid,i,r;return l(t)&&t<0&&n.minimumRadius>-t?(r=b2e,r.x=this._cameraPosition.x/(n.radii.x+t),r.y=this._cameraPosition.y/(n.radii.y+t),r.z=this._cameraPosition.z/(n.radii.z+t),i=r.x*r.x+r.y*r.y+r.z*r.z-1):(r=this._cameraPositionInScaledSpace,i=this._distanceToLimbInScaledSpaceSquared),IW(e,r,i)};Cm.prototype.computeHorizonCullingPoint=function(e,t,n){return kae(this._ellipsoid,e,t,n)};var Fae=te.clone(te.UNIT_SPHERE);Cm.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,n,i){let r=Bae(this._ellipsoid,n,Fae);return kae(r,e,t,i)};Cm.prototype.computeHorizonCullingPointFromVertices=function(e,t,n,i,r){return zae(this._ellipsoid,e,t,n,i,r)};Cm.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,n,i,r,o){let a=Bae(this._ellipsoid,r,Fae);return zae(a,e,t,n,i,o)};var x2e=[];Cm.prototype.computeHorizonCullingPointFromRectangle=function(e,t,n){let i=ie.subsample(e,t,0,x2e),r=se.fromPoints(i);if(!(h.magnitude(r.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(r.center,i,n)};var T2e=new h;function Bae(e,t,n){if(l(t)&&t<0&&e.minimumRadius>-t){let i=h.fromElements(e.radii.x+t,e.radii.y+t,e.radii.z+t,T2e);e=te.fromCartesian3(i,n)}return e}function kae(e,t,n,i){l(i)||(i=new h);let r=jae(e,t),o=0;for(let a=0,s=n.length;a<s;++a){let c=n[a],u=Uae(e,c,r);if(u<0)return;o=Math.max(o,u)}return Vae(r,o,i)}var zM=new h;function zae(e,t,n,i,r,o){l(o)||(o=new h),i=i??3,r=r??h.ZERO;let a=jae(e,t),s=0;for(let c=0,u=n.length;c<u;c+=i){zM.x=n[c]+r.x,zM.y=n[c+1]+r.y,zM.z=n[c+2]+r.z;let f=Uae(e,zM,a);if(f<0)return;s=Math.max(s,f)}return Vae(a,s,o)}function IW(e,t,n){let i=t,r=n,o=h.subtract(e,i,Nae),a=-h.dot(o,i);return!(r<0?a>0:a>r&&a*a/h.magnitudeSquared(o)>r)}var C2e=new h,v2e=new h;function Uae(e,t,n){let i=e.transformPositionToScaledSpace(t,C2e),r=h.magnitudeSquared(i),o=Math.sqrt(r),a=h.divideByScalar(i,o,v2e);r=Math.max(1,r),o=Math.max(1,o);let s=h.dot(a,n),c=h.magnitude(h.cross(a,n,a)),u=1/o,f=Math.sqrt(r-1)*u;return 1/(s*u-c*f)}function Vae(e,t,n){if(!(t<=0||t===1/0||t!==t))return h.multiplyByScalar(e,t,n)}var wW=new h;function jae(e,t){return h.equals(t,h.ZERO)?t:(e.transformPositionToScaledSpace(t,wW),h.normalize(wW,wW))}var vm=Cm;var PW={};PW.computeDiscriminant=function(e,t,n){return t*t-4*e*n};function Hae(e,t,n){let i=e+t;return I.sign(e)!==I.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}PW.computeRealRoots=function(e,t,n){let i;if(e===0)return t===0?[]:[-n/t];if(t===0){if(n===0)return[0,0];let c=Math.abs(n),u=Math.abs(e);if(c<u&&c/u<I.EPSILON14)return[0,0];if(c>u&&u/c<I.EPSILON14)return[];if(i=-n/e,i<0)return[];let f=Math.sqrt(i);return[-f,f]}else if(n===0)return i=-t/e,i<0?[i,0]:[0,i];let r=t*t,o=4*e*n,a=Hae(r,-o,I.EPSILON14);if(a<0)return[];let s=-.5*Hae(t,I.sign(t)*Math.sqrt(a),I.EPSILON14);return t>0?[s/e,n/s]:[n/s,s/e]};var Kl=PW;var RW={};RW.computeDiscriminant=function(e,t,n,i){let r=e*e,o=t*t,a=n*n,s=i*i;return 18*e*t*n*i+o*a-27*r*s-4*(e*a*n+o*t*i)};function DW(e,t,n,i){let r=e,o=t/3,a=n/3,s=i,c=r*a,u=o*s,f=o*o,d=a*a,p=r*a-f,g=r*s-o*a,m=o*s-d,y=4*p*m-g*g,A,b;if(y<0){let G,W,Q;f*u>=c*d?(G=r,W=p,Q=-2*o*p+r*g):(G=s,W=m,Q=-s*g+2*a*m);let J=-(Q<0?-1:1)*Math.abs(G)*Math.sqrt(-y);b=-Q+J;let Z=b/2,ce=Z<0?-Math.pow(-Z,1/3):Math.pow(Z,1/3),Ae=b===J?-ce:-W/ce;return A=W<=0?ce+Ae:-Q/(ce*ce+Ae*Ae+W),f*u>=c*d?[(A-o)/r]:[-s/(A+a)]}let x=p,T=-2*o*p+r*g,C=m,E=-s*g+2*a*m,w=Math.sqrt(y),D=Math.sqrt(3)/2,R=Math.abs(Math.atan2(r*w,-T)/3);A=2*Math.sqrt(-x);let M=Math.cos(R);b=A*M;let N=A*(-M/2-D*Math.sin(R)),_=b+N>2*o?b-o:N-o,v=r,S=_/v;R=Math.abs(Math.atan2(s*w,-E)/3),A=2*Math.sqrt(-C),M=Math.cos(R),b=A*M,N=A*(-M/2-D*Math.sin(R));let P=-s,L=b+N<2*a?b+a:N+a,F=P/L,V=v*L,z=-_*L-v*P,j=_*P,B=(a*z-o*j)/(-o*z+a*V);return S<=B?S<=F?B<=F?[S,B,F]:[S,F,B]:[F,S,B]:S<=F?[B,S,F]:B<=F?[B,F,S]:[F,B,S]}RW.computeRealRoots=function(e,t,n,i){let r,o;if(e===0)return Kl.computeRealRoots(t,n,i);if(t===0){if(n===0){if(i===0)return[0,0,0];o=-i/e;let a=o<0?-Math.pow(-o,1/3):Math.pow(o,1/3);return[a,a,a]}else if(i===0)return r=Kl.computeRealRoots(e,0,n),r.Length===0?[0]:[r[0],0,r[1]];return DW(e,0,n,i)}else{if(n===0)return i===0?(o=-t/e,o<0?[o,0,0]:[0,0,o]):DW(e,t,0,i);if(i===0)return r=Kl.computeRealRoots(e,t,n),r.length===0?[0]:r[1]<=0?[r[0],r[1],0]:r[0]>=0?[0,r[0],r[1]]:[r[0],0,r[1]]}return DW(e,t,n,i)};var YT=RW;var OW={};OW.computeDiscriminant=function(e,t,n,i,r){let o=e*e,a=o*e,s=t*t,c=s*t,u=n*n,f=u*n,d=i*i,p=d*i,g=r*r,m=g*r;return s*u*d-4*c*p-4*e*f*d+18*e*t*n*p-27*o*d*d+256*a*m+r*(18*c*n*i-4*s*f+16*e*u*u-80*e*t*u*i-6*e*s*d+144*o*n*d)+g*(144*e*s*n-27*s*s-128*o*u-192*o*t*i)};function th(e,t,n,i){let r=e*e,o=t-3*r/8,a=n-t*e/2+r*e/8,s=i-n*e/4+t*r/16-3*r*r/256,c=YT.computeRealRoots(1,2*o,o*o-4*s,-a*a);if(c.length>0){let u=-e/4,f=c[c.length-1];if(Math.abs(f)<I.EPSILON14){let d=Kl.computeRealRoots(1,o,s);if(d.length===2){let p=d[0],g=d[1],m;if(p>=0&&g>=0){let y=Math.sqrt(p),A=Math.sqrt(g);return[u-A,u-y,u+y,u+A]}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 d=Math.sqrt(f),p=(o+f-a/d)/2,g=(o+f+a/d)/2,m=Kl.computeRealRoots(1,d,p),y=Kl.computeRealRoots(1,-d,g);return m.length!==0?(m[0]+=u,m[1]+=u,y.length!==0?(y[0]+=u,y[1]+=u,m[1]<=y[0]?[m[0],m[1],y[0],y[1]]:y[1]<=m[0]?[y[0],y[1],m[0],m[1]]:m[0]>=y[0]&&m[1]<=y[1]?[y[0],m[0],m[1],y[1]]:y[0]>=m[0]&&y[1]<=m[1]?[m[0],y[0],y[1],m[1]]:m[0]>y[0]&&m[0]<y[1]?[y[0],m[0],y[1],m[1]]:[m[0],y[0],m[1],y[1]]):m):y.length!==0?(y[0]+=u,y[1]+=u,y):[]}}return[]}function eI(e,t,n,i){let r=n*n,o=t*t,a=e*e,s=-2*t,c=n*e+o-4*i,u=a*i-n*t*e+r,f=YT.computeRealRoots(1,s,c,u);if(f.length>0){let d=f[0],p=t-d,g=p*p,m=e/2,y=p/2,A=g-4*i,b=g+4*Math.abs(i),x=a-4*d,T=a+4*Math.abs(d),C,E;if(d<0||A*T<x*b){let v=Math.sqrt(x);C=v/2,E=v===0?0:(e*y-n)/v}else{let v=Math.sqrt(A);C=v===0?0:(e*y-n)/v,E=v/2}let w,D;m===0&&C===0?(w=0,D=0):I.sign(m)===I.sign(C)?(w=m+C,D=d/w):(D=m-C,w=d/D);let R,M;y===0&&E===0?(R=0,M=0):I.sign(y)===I.sign(E)?(R=y+E,M=i/R):(M=y-E,R=i/M);let N=Kl.computeRealRoots(1,w,R),_=Kl.computeRealRoots(1,D,M);if(N.length!==0)return _.length!==0?N[1]<=_[0]?[N[0],N[1],_[0],_[1]]:_[1]<=N[0]?[_[0],_[1],N[0],N[1]]:N[0]>=_[0]&&N[1]<=_[1]?[_[0],N[0],N[1],_[1]]:_[0]>=N[0]&&_[1]<=N[1]?[N[0],_[0],_[1],N[1]]:N[0]>_[0]&&N[0]<_[1]?[_[0],N[0],_[1],N[1]]:[N[0],_[0],N[1],_[1]]:N;if(_.length!==0)return _}return[]}OW.computeRealRoots=function(e,t,n,i,r){if(Math.abs(e)<I.EPSILON15)return YT.computeRealRoots(t,n,i,r);let o=t/e,a=n/e,s=i/e,c=r/e,u=o<0?1:0;switch(u+=a<0?u+1:u,u+=s<0?u+1:u,u+=c<0?u+1:u,u){case 0:return th(o,a,s,c);case 1:return eI(o,a,s,c);case 2:return eI(o,a,s,c);case 3:return th(o,a,s,c);case 4:return th(o,a,s,c);case 5:return eI(o,a,s,c);case 6:return th(o,a,s,c);case 7:return th(o,a,s,c);case 8:return eI(o,a,s,c);case 9:return th(o,a,s,c);case 10:return th(o,a,s,c);case 11:return eI(o,a,s,c);case 12:return th(o,a,s,c);case 13:return th(o,a,s,c);case 14:return th(o,a,s,c);case 15:return th(o,a,s,c);default:return}};var UM=OW;var MW=class e{constructor(t,n){n=h.clone(n??h.ZERO),h.equals(n,h.ZERO)||h.normalize(n,n),this.origin=h.clone(t??h.ZERO),this.direction=n}static clone(t,n){if(l(t))return l(n)?(n.origin=h.clone(t.origin),n.direction=h.clone(t.direction),n):new e(t.origin,t.direction)}static getPoint(t,n,i){return l(i)||(i=new h),i=h.multiplyByScalar(t.direction,n,i),h.add(t.origin,i,i)}},hn=MW;var Wr={};Wr.rayPlane=function(e,t,n){l(n)||(n=new h);let i=e.origin,r=e.direction,o=t.normal,a=h.dot(o,r);if(Math.abs(a)<I.EPSILON15)return;let s=(-t.distance-h.dot(o,i))/a;if(!(s<0))return n=h.multiplyByScalar(r,s,n),h.add(i,n,n)};var E2e=new h,S2e=new h,Jae=new h,Gae=new h,Wae=new h;Wr.rayTriangleParametric=function(e,t,n,i,r){r=r??!1;let o=e.origin,a=e.direction,s=h.subtract(n,t,E2e),c=h.subtract(i,t,S2e),u=h.cross(a,c,Jae),f=h.dot(s,u),d,p,g,m,y;if(r){if(f<I.EPSILON6||(d=h.subtract(o,t,Gae),g=h.dot(d,u),g<0||g>f)||(p=h.cross(d,s,Wae),m=h.dot(a,p),m<0||g+m>f))return;y=h.dot(c,p)/f}else{if(Math.abs(f)<I.EPSILON6)return;let A=1/f;if(d=h.subtract(o,t,Gae),g=h.dot(d,u)*A,g<0||g>1||(p=h.cross(d,s,Wae),m=h.dot(a,p)*A,m<0||g+m>1))return;y=h.dot(c,p)*A}return y};Wr.rayTriangle=function(e,t,n,i,r,o){let a=Wr.rayTriangleParametric(e,t,n,i,r);if(!(!l(a)||a<0))return l(o)||(o=new h),h.multiplyByScalar(e.direction,a,o),h.add(e.origin,o,o)};var w2e=new hn;Wr.lineSegmentTriangle=function(e,t,n,i,r,o,a){let s=w2e;h.clone(e,s.origin),h.subtract(t,e,s.direction),h.normalize(s.direction,s.direction);let c=Wr.rayTriangleParametric(s,n,i,r,o);if(!(!l(c)||c<0||c>h.distance(e,t)))return l(a)||(a=new h),h.multiplyByScalar(s.direction,c,a),h.add(s.origin,a,a)};function I2e(e,t,n,i){let r=t*t-4*e*n;if(r<0)return;if(r>0){let a=1/(2*e),s=Math.sqrt(r),c=(-t+s)*a,u=(-t-s)*a;return c<u?(i.root0=c,i.root1=u):(i.root0=u,i.root1=c),i}let o=-t/(2*e);if(o!==0)return i.root0=i.root1=o,i}var P2e={root0:0,root1:0};function Zae(e,t,n){l(n)||(n=new $o);let i=e.origin,r=e.direction,o=t.center,a=t.radius*t.radius,s=h.subtract(i,o,Jae),c=h.dot(r,r),u=2*h.dot(r,s),f=h.magnitudeSquared(s)-a,d=I2e(c,u,f,P2e);if(l(d))return n.start=d.root0,n.stop=d.root1,n}Wr.raySphere=function(e,t,n){if(n=Zae(e,t,n),!(!l(n)||n.stop<0))return n.start=Math.max(n.start,0),n};var D2e=new hn;Wr.lineSegmentSphere=function(e,t,n,i){let r=D2e;h.clone(e,r.origin);let o=h.subtract(t,e,r.direction),a=h.magnitude(o);if(h.normalize(o,o),i=Zae(r,n,i),!(!l(i)||i.stop<0||i.start>a))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,a),i};var R2e=new h,O2e=new h;Wr.rayEllipsoid=function(e,t){let n=t.oneOverRadii,i=h.multiplyComponents(n,e.origin,R2e),r=h.multiplyComponents(n,e.direction,O2e),o=h.magnitudeSquared(i),a=h.dot(i,r),s,c,u,f,d;if(o>1){if(a>=0)return;let p=a*a;if(s=o-1,c=h.magnitudeSquared(r),u=c*s,p<u)return;if(p>u){f=a*a-u,d=-a+Math.sqrt(f);let m=d/c,y=s/d;return m<y?new $o(m,y):{start:y,stop:m}}let g=Math.sqrt(s/c);return new $o(g,g)}else if(o<1)return s=o-1,c=h.magnitudeSquared(r),u=c*s,f=a*a-u,d=-a+Math.sqrt(f),new $o(0,d/c);if(a<0)return c=h.magnitudeSquared(r),new $o(0,-a/c)};var M2e=new $o,L2e=new $o,N2e=new $o;Wr.rayAxisAlignedBoundingBox=function(e,t,n){l(n)||(n=new $o);let i=LW(e.origin.x,e.direction.x,t.minimum.x,t.maximum.x,M2e),r=LW(e.origin.y,e.direction.y,t.minimum.y,t.maximum.y,L2e),o=LW(e.origin.z,e.direction.z,t.minimum.z,t.maximum.z,N2e);if(n.start=i.start>r.start?i.start:r.start,n.stop=i.stop<r.stop?i.stop:r.stop,!(i.start>r.stop||r.start>i.stop)&&!(n.start>o.stop||o.start>n.stop))return o.start>n.start&&(n.start=o.start),o.stop<n.stop&&(n.stop=o.stop),n};function LW(e,t,n,i,r){if(r.start=(n-e)/t,r.stop=(i-e)/t,r.stop<r.start){let o=r.stop;r.stop=r.start,r.start=o}return r}function GA(e,t,n){let i=e+t;return I.sign(e)!==I.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}Wr.quadraticVectorExpression=function(e,t,n,i,r){let o=i*i,a=r*r,s=(e[$.COLUMN1ROW1]-e[$.COLUMN2ROW2])*a,c=r*(i*GA(e[$.COLUMN1ROW0],e[$.COLUMN0ROW1],I.EPSILON15)+t.y),u=e[$.COLUMN0ROW0]*o+e[$.COLUMN2ROW2]*a+i*t.x+n,f=a*GA(e[$.COLUMN2ROW1],e[$.COLUMN1ROW2],I.EPSILON15),d=r*(i*GA(e[$.COLUMN2ROW0],e[$.COLUMN0ROW2])+t.z),p,g=[];if(d===0&&f===0){if(p=Kl.computeRealRoots(s,c,u),p.length===0)return g;let R=p[0],M=Math.sqrt(Math.max(1-R*R,0));if(g.push(new h(i,r*R,r*-M)),g.push(new h(i,r*R,r*M)),p.length===2){let N=p[1],_=Math.sqrt(Math.max(1-N*N,0));g.push(new h(i,r*N,r*-_)),g.push(new h(i,r*N,r*_))}return g}let m=d*d,y=f*f,A=s*s,b=d*f,x=A+y,T=2*(c*s+b),C=2*u*s+c*c-y+m,E=2*(u*c-b),w=u*u-m;if(x===0&&T===0&&C===0&&E===0)return g;p=UM.computeRealRoots(x,T,C,E,w);let D=p.length;if(D===0)return g;for(let R=0;R<D;++R){let M=p[R],N=M*M,_=Math.max(1-N,0),v=Math.sqrt(_),S;I.sign(s)===I.sign(u)?S=GA(s*N+u,c*M,I.EPSILON12):I.sign(u)===I.sign(c*M)?S=GA(s*N,c*M+u,I.EPSILON12):S=GA(s*N+c*M,u,I.EPSILON12);let P=GA(f*M,d,I.EPSILON15),L=S*P;L<0?g.push(new h(i,r*M,r*v)):L>0?g.push(new h(i,r*M,r*-v)):v!==0?(g.push(new h(i,r*M,r*-v)),g.push(new h(i,r*M,r*v)),++R):g.push(new h(i,r*M,r*v))}return g};var NW=new h,qae=new h,Yae=new h,VM=new h,F2e=new h,B2e=new $,k2e=new $,z2e=new $,U2e=new $,V2e=new $,Xae=new $,Kae=new $,$ae=new h,j2e=new h,H2e=new de;Wr.grazingAltitudeLocation=function(e,t){let n=e.origin,i=e.direction;if(!h.equals(n,h.ZERO)){let w=t.geodeticSurfaceNormal(n,NW);if(h.dot(i,w)>=0)return n}let r=l(this.rayEllipsoid(e,t)),o=t.transformPositionToScaledSpace(i,NW),a=h.normalize(o,o),s=h.mostOrthogonalAxis(o,VM),c=h.normalize(h.cross(s,a,qae),qae),u=h.normalize(h.cross(a,c,Yae),Yae),f=B2e;f[0]=a.x,f[1]=a.y,f[2]=a.z,f[3]=c.x,f[4]=c.y,f[5]=c.z,f[6]=u.x,f[7]=u.y,f[8]=u.z;let d=$.transpose(f,k2e),p=$.fromScale(t.radii,z2e),g=$.fromScale(t.oneOverRadii,U2e),m=V2e;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=$.multiply($.multiply(d,g,Xae),m,Xae),A=$.multiply($.multiply(y,p,Kae),f,Kae),b=$.multiplyByVector(y,n,F2e),x=Wr.quadraticVectorExpression(A,h.negate(b,NW),0,0,1),T,C,E=x.length;if(E>0){let w=h.clone(h.ZERO,j2e),D=Number.NEGATIVE_INFINITY;for(let M=0;M<E;++M){T=$.multiplyByVector(p,$.multiplyByVector(f,x[M],$ae),$ae);let N=h.normalize(h.subtract(T,n,VM),VM),_=h.dot(N,i);_>D&&(D=_,w=h.clone(T,w))}let R=t.cartesianToCartographic(w,H2e);return D=I.clamp(D,0,1),C=h.magnitude(h.subtract(w,n,VM))*Math.sqrt(1-D*D),C=r?-C:C,R.height=C,t.cartographicToCartesian(R,new h)}};var G2e=new h;Wr.lineSegmentPlane=function(e,t,n,i){l(i)||(i=new h);let r=h.subtract(t,e,G2e),o=n.normal,a=h.dot(o,r);if(Math.abs(a)<I.EPSILON6)return;let s=h.dot(o,e),c=-(n.distance+s)/a;if(!(c<0||c>1))return h.multiplyByScalar(r,c,i),h.add(e,i,i),i};Wr.trianglePlaneIntersection=function(e,t,n,i){let r=i.normal,o=i.distance,a=h.dot(r,e)+o<0,s=h.dot(r,t)+o<0,c=h.dot(r,n)+o<0,u=0;u+=a?1:0,u+=s?1:0,u+=c?1:0;let f,d;if((u===1||u===2)&&(f=new h,d=new h),u===1){if(a)return Wr.lineSegmentPlane(e,t,i,f),Wr.lineSegmentPlane(e,n,i,d),{positions:[e,t,n,f,d],indices:[0,3,4,1,2,4,1,4,3]};if(s)return Wr.lineSegmentPlane(t,n,i,f),Wr.lineSegmentPlane(t,e,i,d),{positions:[e,t,n,f,d],indices:[1,3,4,2,0,4,2,4,3]};if(c)return Wr.lineSegmentPlane(n,e,i,f),Wr.lineSegmentPlane(n,t,i,d),{positions:[e,t,n,f,d],indices:[2,3,4,0,1,4,0,4,3]}}else if(u===2)if(a)if(s){if(!c)return Wr.lineSegmentPlane(e,n,i,f),Wr.lineSegmentPlane(t,n,i,d),{positions:[e,t,n,f,d],indices:[0,1,4,0,4,3,2,3,4]}}else return Wr.lineSegmentPlane(n,t,i,f),Wr.lineSegmentPlane(e,t,i,d),{positions:[e,t,n,f,d],indices:[2,0,4,2,4,3,1,3,4]};else return Wr.lineSegmentPlane(t,e,i,f),Wr.lineSegmentPlane(n,e,i,d),{positions:[e,t,n,f,d],indices:[1,2,4,1,4,3,0,3,4]}};var ci=Wr;function As(e,t){this.normal=h.clone(e),this.distance=t}As.fromPointNormal=function(e,t,n){let i=-h.dot(t,e);return l(n)?(h.clone(t,n.normal),n.distance=i,n):new As(t,i)};var W2e=new h;As.fromCartesian4=function(e,t){let n=h.fromCartesian4(e,W2e),i=e.w;return l(t)?(h.clone(n,t.normal),t.distance=i,t):new As(n,i)};As.getPointDistance=function(e,t){return h.dot(e.normal,t)+e.distance};var q2e=new h;As.projectPointOntoPlane=function(e,t,n){l(n)||(n=new h);let i=As.getPointDistance(e,t),r=h.multiplyByScalar(e.normal,i,q2e);return h.subtract(t,r,n)};var Y2e=new O,X2e=new ae,K2e=new h;As.transform=function(e,t,n){let i=e.normal,r=e.distance,o=O.inverseTranspose(t,Y2e),a=ae.fromElements(i.x,i.y,i.z,r,X2e);a=O.multiplyByVector(o,a,a);let s=h.fromCartesian4(a,K2e);return a=ae.divideByScalar(a,h.magnitude(s),a),As.fromCartesian4(a,n)};As.clone=function(e,t){return l(t)?(h.clone(e.normal,t.normal),t.distance=e.distance,t):new As(e.normal,e.distance)};As.equals=function(e,t){return e.distance===t.distance&&h.equals(e.normal,t.normal)};As.ORIGIN_XY_PLANE=Object.freeze(new As(h.UNIT_Z,0));As.ORIGIN_YZ_PLANE=Object.freeze(new As(h.UNIT_X,0));As.ORIGIN_ZX_PLANE=Object.freeze(new As(h.UNIT_Y,0));var tn=As;var FW=new ae;function Em(e,t){t=t??te.default,e=t.scaleToGeodeticSurface(e);let n=mt.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=h.fromCartesian4(O.getColumn(n,0,FW)),this._yAxis=h.fromCartesian4(O.getColumn(n,1,FW));let i=h.fromCartesian4(O.getColumn(n,2,FW));this._plane=tn.fromPointNormal(e,i)}Object.defineProperties(Em.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 $2e=new Vf;Em.fromPoints=function(e,t){let n=Vf.fromPoints(e,$2e);return new Em(n.center,t)};var Qae=new hn,jM=new h;Em.prototype.projectPointOntoPlane=function(e,t){let n=Qae;n.origin=e,h.normalize(e,n.direction);let i=ci.rayPlane(n,this._plane,jM);if(l(i)||(h.negate(n.direction,n.direction),i=ci.rayPlane(n,this._plane,jM)),l(i)){let r=h.subtract(i,this._origin,i),o=h.dot(this._xAxis,r),a=h.dot(this._yAxis,r);return l(t)?(t.x=o,t.y=a,t):new k(o,a)}};Em.prototype.projectPointsOntoPlane=function(e,t){l(t)||(t=[]);let n=0,i=e.length;for(let r=0;r<i;r++){let o=this.projectPointOntoPlane(e[r],t[n]);l(o)&&(t[n]=o,n++)}return t.length=n,t};Em.prototype.projectPointToNearestOnPlane=function(e,t){l(t)||(t=new k);let n=Qae;n.origin=e,h.clone(this._plane.normal,n.direction);let i=ci.rayPlane(n,this._plane,jM);l(i)||(h.negate(n.direction,n.direction),i=ci.rayPlane(n,this._plane,jM));let r=h.subtract(i,this._origin,i),o=h.dot(this._xAxis,r),a=h.dot(this._yAxis,r);return t.x=o,t.y=a,t};Em.prototype.projectPointsToNearestOnPlane=function(e,t){l(t)||(t=[]);let n=e.length;t.length=n;for(let i=0;i<n;i++)t[i]=this.projectPointToNearestOnPlane(e[i],t[i]);return t};var J2e=new h;Em.prototype.projectPointOntoEllipsoid=function(e,t){l(t)||(t=new h);let n=this._ellipsoid,i=this._origin,r=this._xAxis,o=this._yAxis,a=J2e;return h.multiplyByScalar(r,e.x,a),t=h.add(i,a,t),h.multiplyByScalar(o,e.y,a),h.add(t,a,t),n.scaleToGeocentricSurface(t,t),t};Em.prototype.projectPointsOntoEllipsoid=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;++i)t[i]=this.projectPointOntoEllipsoid(e[i],t[i]);return t};var Fa=Em;function Ji(e,t){this.center=h.clone(e??h.ZERO),this.halfAxes=$.clone(t??$.ZERO)}Ji.packedLength=h.packedLength+$.packedLength;Ji.pack=function(e,t,n){return n=n??0,h.pack(e.center,t,n),$.pack(e.halfAxes,t,n+h.packedLength),t};Ji.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Ji),h.unpack(e,t,n.center),$.unpack(e,t+h.packedLength,n.halfAxes),n};var Z2e=new h,Q2e=new h,eke=new h,tke=new h,nke=new h,ike=new h,rke=new $,oke={unitary:new $,diagonal:new $};Ji.fromPoints=function(e,t){if(l(t)||(t=new Ji),!l(e)||e.length===0)return t.halfAxes=$.ZERO,t.center=h.ZERO,t;let n,i=e.length,r=h.clone(e[0],Z2e);for(n=1;n<i;n++)h.add(r,e[n],r);let o=1/i;h.multiplyByScalar(r,o,r);let a=0,s=0,c=0,u=0,f=0,d=0,p;for(n=0;n<i;n++)p=h.subtract(e[n],r,Q2e),a+=p.x*p.x,s+=p.x*p.y,c+=p.x*p.z,u+=p.y*p.y,f+=p.y*p.z,d+=p.z*p.z;a*=o,s*=o,c*=o,u*=o,f*=o,d*=o;let g=rke;g[0]=a,g[1]=s,g[2]=c,g[3]=s,g[4]=u,g[5]=f,g[6]=c,g[7]=f,g[8]=d;let m=$.computeEigenDecomposition(g,oke),y=$.clone(m.unitary,t.halfAxes),A=$.getColumn(y,0,tke),b=$.getColumn(y,1,nke),x=$.getColumn(y,2,ike),T=-Number.MAX_VALUE,C=-Number.MAX_VALUE,E=-Number.MAX_VALUE,w=Number.MAX_VALUE,D=Number.MAX_VALUE,R=Number.MAX_VALUE;for(n=0;n<i;n++)p=e[n],T=Math.max(h.dot(A,p),T),C=Math.max(h.dot(b,p),C),E=Math.max(h.dot(x,p),E),w=Math.min(h.dot(A,p),w),D=Math.min(h.dot(b,p),D),R=Math.min(h.dot(x,p),R);A=h.multiplyByScalar(A,.5*(w+T),A),b=h.multiplyByScalar(b,.5*(D+C),b),x=h.multiplyByScalar(x,.5*(R+E),x);let M=h.add(A,b,t.center);h.add(M,x,M);let N=eke;return N.x=T-w,N.y=C-D,N.z=E-R,h.multiplyByScalar(N,.5,N),$.multiplyByScale(t.halfAxes,N,t.halfAxes),t};var ose=new h,ake=new h;function ese(e,t,n,i,r,o,a,s,c,u,f){l(f)||(f=new Ji);let d=f.halfAxes;$.setColumn(d,0,t,d),$.setColumn(d,1,n,d),$.setColumn(d,2,i,d);let p=ose;p.x=(r+o)/2,p.y=(a+s)/2,p.z=(c+u)/2;let g=ake;g.x=(o-r)/2,g.y=(s-a)/2,g.z=(u-c)/2;let m=f.center;return p=$.multiplyByVector(d,p,p),h.add(e,p,m),$.multiplyByScale(d,g,d),f}var tse=new de,ske=new h,cke=new de,lke=new de,uke=new de,fke=new de,dke=new de,hke=new h,nse=new h,mke=new h,ise=new h,pke=new h,gke=new k,_ke=new k,yke=new k,Ake=new k,bke=new k,xke=new h,Tke=new h,Cke=new h,vke=new h,Eke=new k,Ske=new h,wke=new h,Ike=new h,Pke=new tn(h.UNIT_X,0);Ji.fromRectangle=function(e,t,n,i,r){t=t??0,n=n??0,i=i??te.default;let o,a,s,c,u,f,d;if(e.width<=I.PI){let D=ie.center(e,tse),R=i.cartographicToCartesian(D,ske),M=new Fa(R,i);d=M.plane;let N=D.longitude,_=e.south<0&&e.north>0?0:D.latitude,v=de.fromRadians(N,e.north,n,cke),S=de.fromRadians(e.west,e.north,n,lke),P=de.fromRadians(e.west,_,n,uke),L=de.fromRadians(e.west,e.south,n,fke),F=de.fromRadians(N,e.south,n,dke),V=i.cartographicToCartesian(v,hke),z=i.cartographicToCartesian(S,nse),j=i.cartographicToCartesian(P,mke),B=i.cartographicToCartesian(L,ise),G=i.cartographicToCartesian(F,pke),W=M.projectPointToNearestOnPlane(V,gke),Q=M.projectPointToNearestOnPlane(z,_ke),q=M.projectPointToNearestOnPlane(j,yke),J=M.projectPointToNearestOnPlane(B,Ake),Z=M.projectPointToNearestOnPlane(G,bke);return o=Math.min(Q.x,q.x,J.x),a=-o,c=Math.max(Q.y,W.y),s=Math.min(J.y,Z.y),S.height=L.height=t,z=i.cartographicToCartesian(S,nse),B=i.cartographicToCartesian(L,ise),u=Math.min(tn.getPointDistance(d,z),tn.getPointDistance(d,B)),f=n,ese(M.origin,M.xAxis,M.yAxis,M.zAxis,o,a,s,c,u,f,r)}let p=e.south>0,g=e.north<0,m=p?e.south:g?e.north:0,y=ie.center(e,tse).longitude,A=h.fromRadians(y,m,n,i,xke);A.z=0;let x=Math.abs(A.x)<I.EPSILON10&&Math.abs(A.y)<I.EPSILON10?h.UNIT_X:h.normalize(A,Tke),T=h.UNIT_Z,C=h.cross(x,T,Cke);d=tn.fromPointNormal(A,x,Pke);let E=h.fromRadians(y+I.PI_OVER_TWO,m,n,i,vke);a=h.dot(tn.projectPointOntoPlane(d,E,Eke),C),o=-a,c=h.fromRadians(0,e.north,g?t:n,i,Ske).z,s=h.fromRadians(0,e.south,p?t:n,i,wke).z;let w=h.fromRadians(e.east,m,n,i,Ike);return u=tn.getPointDistance(d,w),f=0,ese(A,C,T,x,o,a,s,c,u,f,r)};Ji.fromTransformation=function(e,t){return l(t)||(t=new Ji),t.center=O.getTranslation(e,t.center),t.halfAxes=O.getMatrix3(e,t.halfAxes),t.halfAxes=$.multiplyByScalar(t.halfAxes,.5,t.halfAxes),t};Ji.clone=function(e,t){if(l(e))return l(t)?(h.clone(e.center,t.center),$.clone(e.halfAxes,t.halfAxes),t):new Ji(e.center,e.halfAxes)};Ji.intersectPlane=function(e,t){let n=e.center,i=t.normal,r=e.halfAxes,o=i.x,a=i.y,s=i.z,c=Math.abs(o*r[$.COLUMN0ROW0]+a*r[$.COLUMN0ROW1]+s*r[$.COLUMN0ROW2])+Math.abs(o*r[$.COLUMN1ROW0]+a*r[$.COLUMN1ROW1]+s*r[$.COLUMN1ROW2])+Math.abs(o*r[$.COLUMN2ROW0]+a*r[$.COLUMN2ROW1]+s*r[$.COLUMN2ROW2]),u=h.dot(i,n)+t.distance;return u<=-c?Xt.OUTSIDE:u>=c?Xt.INSIDE:Xt.INTERSECTING};var ase=new h,sse=new h,cse=new h,Dke=new h,rse=new h,Rke=new h;Ji.distanceSquaredTo=function(e,t){let n=h.subtract(t,e.center,ose),i=e.halfAxes,r=$.getColumn(i,0,ase),o=$.getColumn(i,1,sse),a=$.getColumn(i,2,cse),s=h.magnitude(r),c=h.magnitude(o),u=h.magnitude(a),f=!0,d=!0,p=!0;s>0?h.divideByScalar(r,s,r):f=!1,c>0?h.divideByScalar(o,c,o):d=!1,u>0?h.divideByScalar(a,u,a):p=!1;let g=!f+!d+!p,m,y,A;if(g===1){let C=r;m=o,y=a,d?p||(C=a,y=r):(C=o,m=r),A=h.cross(m,y,rse),C===r?r=A:C===o?o=A:C===a&&(a=A)}else if(g===2){m=r,d?m=o:p&&(m=a);let C=h.UNIT_Y;C.equalsEpsilon(m,I.EPSILON3)&&(C=h.UNIT_X),y=h.cross(m,C,Dke),h.normalize(y,y),A=h.cross(m,y,rse),h.normalize(A,A),m===r?(o=y,a=A):m===o?(a=y,r=A):m===a&&(r=y,o=A)}else g===3&&(r=h.UNIT_X,o=h.UNIT_Y,a=h.UNIT_Z);let b=Rke;b.x=h.dot(n,r),b.y=h.dot(n,o),b.z=h.dot(n,a);let x=0,T;return b.x<-s?(T=b.x+s,x+=T*T):b.x>s&&(T=b.x-s,x+=T*T),b.y<-c?(T=b.y+c,x+=T*T):b.y>c&&(T=b.y-c,x+=T*T),b.z<-u?(T=b.z+u,x+=T*T):b.z>u&&(T=b.z-u,x+=T*T),x};var Oke=new h,Mke=new h;Ji.computePlaneDistances=function(e,t,n,i){l(i)||(i=new $o);let r=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,a=e.center,s=e.halfAxes,c=$.getColumn(s,0,ase),u=$.getColumn(s,1,sse),f=$.getColumn(s,2,cse),d=h.add(c,u,Oke);h.add(d,f,d),h.add(d,a,d);let p=h.subtract(d,t,Mke),g=h.dot(n,p);return r=Math.min(g,r),o=Math.max(g,o),h.add(a,c,d),h.add(d,u,d),h.subtract(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),h.add(a,c,d),h.subtract(d,u,d),h.add(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),h.add(a,c,d),h.subtract(d,u,d),h.subtract(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),h.subtract(a,c,d),h.add(d,u,d),h.add(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),h.subtract(a,c,d),h.add(d,u,d),h.subtract(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),h.subtract(a,c,d),h.subtract(d,u,d),h.add(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),h.subtract(a,c,d),h.subtract(d,u,d),h.subtract(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),i.start=r,i.stop=o,i};var Lke=new h,Nke=new h,Fke=new h;Ji.computeCorners=function(e,t){l(t)||(t=[new h,new h,new h,new h,new h,new h,new h,new h]);let n=e.center,i=e.halfAxes,r=$.getColumn(i,0,Lke),o=$.getColumn(i,1,Nke),a=$.getColumn(i,2,Fke);return h.clone(n,t[0]),h.subtract(t[0],r,t[0]),h.subtract(t[0],o,t[0]),h.subtract(t[0],a,t[0]),h.clone(n,t[1]),h.subtract(t[1],r,t[1]),h.subtract(t[1],o,t[1]),h.add(t[1],a,t[1]),h.clone(n,t[2]),h.subtract(t[2],r,t[2]),h.add(t[2],o,t[2]),h.subtract(t[2],a,t[2]),h.clone(n,t[3]),h.subtract(t[3],r,t[3]),h.add(t[3],o,t[3]),h.add(t[3],a,t[3]),h.clone(n,t[4]),h.add(t[4],r,t[4]),h.subtract(t[4],o,t[4]),h.subtract(t[4],a,t[4]),h.clone(n,t[5]),h.add(t[5],r,t[5]),h.subtract(t[5],o,t[5]),h.add(t[5],a,t[5]),h.clone(n,t[6]),h.add(t[6],r,t[6]),h.add(t[6],o,t[6]),h.subtract(t[6],a,t[6]),h.clone(n,t[7]),h.add(t[7],r,t[7]),h.add(t[7],o,t[7]),h.add(t[7],a,t[7]),t};var Bke=new $;Ji.computeTransformation=function(e,t){l(t)||(t=new O);let n=e.center,i=$.multiplyByUniformScale(e.halfAxes,2,Bke);return O.fromRotationTranslation(i,n,t)};var kke=new se;Ji.isOccluded=function(e,t){let n=se.fromOrientedBoundingBox(e,kke);return!t.isBoundingSphereVisible(n)};Ji.prototype.intersectPlane=function(e){return Ji.intersectPlane(this,e)};Ji.prototype.distanceSquaredTo=function(e){return Ji.distanceSquaredTo(this,e)};Ji.prototype.computePlaneDistances=function(e,t,n){return Ji.computePlaneDistances(this,e,t,n)};Ji.prototype.computeCorners=function(e){return Ji.computeCorners(this,e)};Ji.prototype.computeTransformation=function(e){return Ji.computeTransformation(this,e)};Ji.prototype.isOccluded=function(e){return Ji.isOccluded(this,e)};Ji.equals=function(e,t){return e===t||l(e)&&l(t)&&h.equals(e.center,t.center)&&$.equals(e.halfAxes,t.halfAxes)};Ji.prototype.clone=function(e){return Ji.clone(this,e)};Ji.prototype.equals=function(e){return Ji.equals(this,e)};var Jt=Ji;var lse={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGBA_ASTC_4x4_WEBGL:37808,COMPRESSED_RGB_ETC1_WEBGL:36196,COMPRESSED_RGBA_BPTC_UNORM:36492,HALF_FLOAT_OES:36193,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047};Object.freeze(lse);var ee=lse;var gn={BYTE:ee.BYTE,UNSIGNED_BYTE:ee.UNSIGNED_BYTE,SHORT:ee.SHORT,UNSIGNED_SHORT:ee.UNSIGNED_SHORT,INT:ee.INT,UNSIGNED_INT:ee.UNSIGNED_INT,FLOAT:ee.FLOAT,DOUBLE:ee.DOUBLE};gn.getSizeInBytes=function(e){switch(e){case gn.BYTE:return Int8Array.BYTES_PER_ELEMENT;case gn.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case gn.SHORT:return Int16Array.BYTES_PER_ELEMENT;case gn.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case gn.INT:return Int32Array.BYTES_PER_ELEMENT;case gn.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case gn.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case gn.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}};gn.fromTypedArray=function(e){if(e instanceof Int8Array)return gn.BYTE;if(e instanceof Uint8Array)return gn.UNSIGNED_BYTE;if(e instanceof Int16Array)return gn.SHORT;if(e instanceof Uint16Array)return gn.UNSIGNED_SHORT;if(e instanceof Int32Array)return gn.INT;if(e instanceof Uint32Array)return gn.UNSIGNED_INT;if(e instanceof Float32Array)return gn.FLOAT;if(e instanceof Float64Array)return gn.DOUBLE};gn.validate=function(e){return l(e)&&(e===gn.BYTE||e===gn.UNSIGNED_BYTE||e===gn.SHORT||e===gn.UNSIGNED_SHORT||e===gn.INT||e===gn.UNSIGNED_INT||e===gn.FLOAT||e===gn.DOUBLE)};gn.createTypedArray=function(e,t){switch(e){case gn.BYTE:return new Int8Array(t);case gn.UNSIGNED_BYTE:return new Uint8Array(t);case gn.SHORT:return new Int16Array(t);case gn.UNSIGNED_SHORT:return new Uint16Array(t);case gn.INT:return new Int32Array(t);case gn.UNSIGNED_INT:return new Uint32Array(t);case gn.FLOAT:return new Float32Array(t);case gn.DOUBLE:return new Float64Array(t)}};gn.createArrayBufferView=function(e,t,n,i){switch(n=n??0,i=i??(t.byteLength-n)/gn.getSizeInBytes(e),e){case gn.BYTE:return new Int8Array(t,n,i);case gn.UNSIGNED_BYTE:return new Uint8Array(t,n,i);case gn.SHORT:return new Int16Array(t,n,i);case gn.UNSIGNED_SHORT:return new Uint16Array(t,n,i);case gn.INT:return new Int32Array(t,n,i);case gn.UNSIGNED_INT:return new Uint32Array(t,n,i);case gn.FLOAT:return new Float32Array(t,n,i);case gn.DOUBLE:return new Float64Array(t,n,i)}};gn.fromName=function(e){switch(e){case"BYTE":return gn.BYTE;case"UNSIGNED_BYTE":return gn.UNSIGNED_BYTE;case"SHORT":return gn.SHORT;case"UNSIGNED_SHORT":return gn.UNSIGNED_SHORT;case"INT":return gn.INT;case"UNSIGNED_INT":return gn.UNSIGNED_INT;case"FLOAT":return gn.FLOAT;case"DOUBLE":return gn.DOUBLE}};gn.dequantize=function(e,t){switch(t){case gn.BYTE:return Math.max(e/127,-1);case gn.UNSIGNED_BYTE:return e/255;case gn.SHORT:return Math.max(e/32767,-1);case gn.UNSIGNED_SHORT:return e/65535;case gn.INT:return Math.max(e/2147483647,-1);case gn.UNSIGNED_INT:return e/4294967295}};Object.freeze(gn);var Y=gn;var $l=class e{constructor(t,n,i,r){this[0]=t??0,this[1]=i??0,this[2]=n??0,this[3]=r??0}static pack(t,n,i){return i=i??0,n[i++]=t[0],n[i++]=t[1],n[i++]=t[2],n[i]=t[3],n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i[0]=t[n++],i[1]=t[n++],i[2]=t[n++],i[3]=t[n],i}static packArray(t,n){let i=t.length,r=i*4;l(n)?!Array.isArray(n)&&n.length!==r||n.length!==r&&(n.length=r):n=new Array(r);for(let o=0;o<i;++o)e.pack(t[o],n,o*4);return n}static unpackArray(t,n){let i=t.length;l(n)?n.length=i/4:n=new Array(i/4);for(let r=0;r<i;r+=4){let o=r/4;n[o]=e.unpack(t,r,n[o])}return n}static clone(t,n){if(l(t))return l(n)?(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n):new e(t[0],t[2],t[1],t[3])}static fromColumnMajorArray(t,n){return e.clone(t,n)}static fromRowMajorArray(t,n){return l(n)?(n[0]=t[0],n[1]=t[2],n[2]=t[1],n[3]=t[3],n):new e(t[0],t[1],t[2],t[3])}static fromScale(t,n){return l(n)?(n[0]=t.x,n[1]=0,n[2]=0,n[3]=t.y,n):new e(t.x,0,0,t.y)}static fromUniformScale(t,n){return l(n)?(n[0]=t,n[1]=0,n[2]=0,n[3]=t,n):new e(t,0,0,t)}static fromRotation(t,n){let i=Math.cos(t),r=Math.sin(t);return l(n)?(n[0]=i,n[1]=r,n[2]=-r,n[3]=i,n):new e(i,-r,r,i)}static toArray(t,n){return l(n)?(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n):[t[0],t[1],t[2],t[3]]}static getElementIndex(t,n){return t*2+n}static getColumn(t,n,i){let r=n*2,o=t[r],a=t[r+1];return i.x=o,i.y=a,i}static setColumn(t,n,i,r){r=e.clone(t,r);let o=n*2;return r[o]=i.x,r[o+1]=i.y,r}static getRow(t,n,i){let r=t[n],o=t[n+2];return i.x=r,i.y=o,i}static setRow(t,n,i,r){return r=e.clone(t,r),r[n]=i.x,r[n+2]=i.y,r}static setScale(t,n,i){let r=e.getScale(t,zke),o=n.x/r.x,a=n.y/r.y;return i[0]=t[0]*o,i[1]=t[1]*o,i[2]=t[2]*a,i[3]=t[3]*a,i}static setUniformScale(t,n,i){let r=e.getScale(t,Uke),o=n/r.x,a=n/r.y;return i[0]=t[0]*o,i[1]=t[1]*o,i[2]=t[2]*a,i[3]=t[3]*a,i}static getScale(t,n){return n.x=k.magnitude(k.fromElements(t[0],t[1],use)),n.y=k.magnitude(k.fromElements(t[2],t[3],use)),n}static getMaximumScale(t){return e.getScale(t,fse),k.maximumComponent(fse)}static setRotation(t,n,i){let r=e.getScale(t,Vke);return i[0]=n[0]*r.x,i[1]=n[1]*r.x,i[2]=n[2]*r.y,i[3]=n[3]*r.y,i}static getRotation(t,n){let i=e.getScale(t,jke);return n[0]=t[0]/i.x,n[1]=t[1]/i.x,n[2]=t[2]/i.y,n[3]=t[3]/i.y,n}static multiply(t,n,i){let r=t[0]*n[0]+t[2]*n[1],o=t[0]*n[2]+t[2]*n[3],a=t[1]*n[0]+t[3]*n[1],s=t[1]*n[2]+t[3]*n[3];return i[0]=r,i[1]=a,i[2]=o,i[3]=s,i}static add(t,n,i){return i[0]=t[0]+n[0],i[1]=t[1]+n[1],i[2]=t[2]+n[2],i[3]=t[3]+n[3],i}static subtract(t,n,i){return i[0]=t[0]-n[0],i[1]=t[1]-n[1],i[2]=t[2]-n[2],i[3]=t[3]-n[3],i}static multiplyByVector(t,n,i){let r=t[0]*n.x+t[2]*n.y,o=t[1]*n.x+t[3]*n.y;return i.x=r,i.y=o,i}static multiplyByScalar(t,n,i){return i[0]=t[0]*n,i[1]=t[1]*n,i[2]=t[2]*n,i[3]=t[3]*n,i}static multiplyByScale(t,n,i){return i[0]=t[0]*n.x,i[1]=t[1]*n.x,i[2]=t[2]*n.y,i[3]=t[3]*n.y,i}static multiplyByUniformScale(t,n,i){return i[0]=t[0]*n,i[1]=t[1]*n,i[2]=t[2]*n,i[3]=t[3]*n,i}static negate(t,n){return n[0]=-t[0],n[1]=-t[1],n[2]=-t[2],n[3]=-t[3],n}static transpose(t,n){let i=t[0],r=t[2],o=t[1],a=t[3];return n[0]=i,n[1]=r,n[2]=o,n[3]=a,n}static abs(t,n){return n[0]=Math.abs(t[0]),n[1]=Math.abs(t[1]),n[2]=Math.abs(t[2]),n[3]=Math.abs(t[3]),n}static equals(t,n){return t===n||l(t)&&l(n)&&t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]}static equalsArray(t,n,i){return t[0]===n[i]&&t[1]===n[i+1]&&t[2]===n[i+2]&&t[3]===n[i+3]}static equalsEpsilon(t,n,i){return i=i??0,t===n||l(t)&&l(n)&&Math.abs(t[0]-n[0])<=i&&Math.abs(t[1]-n[1])<=i&&Math.abs(t[2]-n[2])<=i&&Math.abs(t[3]-n[3])<=i}get length(){return e.packedLength}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}equalsEpsilon(t,n){return e.equalsEpsilon(this,t,n)}toString(){return`(${this[0]}, ${this[2]})
|
|
(${this[1]}, ${this[3]})`}};$l.packedLength=4;$l.fromArray=$l.unpack;$l.IDENTITY=Object.freeze(new $l(1,0,0,1));$l.ZERO=Object.freeze(new $l(0,0,0,0));$l.COLUMN0ROW0=0;$l.COLUMN0ROW1=1;$l.COLUMN1ROW0=2;$l.COLUMN1ROW1=3;var zke=new k,Uke=new k,use=new k,fse=new k,Vke=new k,jke=new k,Zi=$l;var mr={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};mr.getMathType=function(e){switch(e){case mr.SCALAR:return Number;case mr.VEC2:return k;case mr.VEC3:return h;case mr.VEC4:return ae;case mr.MAT2:return Zi;case mr.MAT3:return $;case mr.MAT4:return O}};mr.getNumberOfComponents=function(e){switch(e){case mr.SCALAR:return 1;case mr.VEC2:return 2;case mr.VEC3:return 3;case mr.VEC4:case mr.MAT2:return 4;case mr.MAT3:return 9;case mr.MAT4:return 16}};mr.getAttributeLocationCount=function(e){switch(e){case mr.SCALAR:case mr.VEC2:case mr.VEC3:case mr.VEC4:return 1;case mr.MAT2:return 2;case mr.MAT3:return 3;case mr.MAT4:return 4}};mr.getGlslType=function(e){switch(e){case mr.SCALAR:return"float";case mr.VEC2:return"vec2";case mr.VEC3:return"vec3";case mr.VEC4:return"vec4";case mr.MAT2:return"mat2";case mr.MAT3:return"mat3";case mr.MAT4:return"mat4"}};Object.freeze(mr);var Vt=mr;var dse=1/256,Hke=65536,kW=256,vr={};vr.octEncodeInRange=function(e,t,n){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 i=n.x,r=n.y;n.x=(1-Math.abs(r))*I.signNotZero(i),n.y=(1-Math.abs(i))*I.signNotZero(r)}return n.x=I.toSNorm(n.x,t),n.y=I.toSNorm(n.y,t),n};vr.octEncode=function(e,t){return vr.octEncodeInRange(e,255,t)};var tI=new k,hse=new Uint8Array(1);function HM(e){return hse[0]=e,hse[0]}vr.octEncodeToCartesian4=function(e,t){return vr.octEncodeInRange(e,65535,tI),t.x=HM(tI.x*dse),t.y=HM(tI.x),t.z=HM(tI.y*dse),t.w=HM(tI.y),t};vr.octDecodeInRange=function(e,t,n,i){if(i.x=I.fromSNorm(e,n),i.y=I.fromSNorm(t,n),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){let r=i.x;i.x=(1-Math.abs(i.y))*I.signNotZero(r),i.y=(1-Math.abs(r))*I.signNotZero(i.y)}return h.normalize(i,i)};vr.octDecode=function(e,t,n){return vr.octDecodeInRange(e,t,255,n)};vr.octDecodeFromCartesian4=function(e,t){let n=e.x,i=e.y,r=e.z,o=e.w,a=n*kW+i,s=r*kW+o;return vr.octDecodeInRange(a,s,65535,t)};vr.octPackFloat=function(e){return 256*e.x+e.y};var zW=new k;vr.octEncodeFloat=function(e){return vr.octEncode(e,zW),vr.octPackFloat(zW)};vr.octDecodeFloat=function(e,t){let n=e/256,i=Math.floor(n),r=(n-i)*256;return vr.octDecode(i,r,t)};vr.octPack=function(e,t,n,i){let r=vr.octEncodeFloat(e),o=vr.octEncodeFloat(t),a=vr.octEncode(n,zW);return i.x=65536*a.x+r,i.y=65536*a.y+o,i};vr.octUnpack=function(e,t,n,i){let r=e.x/65536,o=Math.floor(r),a=(r-o)*65536;r=e.y/65536;let s=Math.floor(r),c=(r-s)*65536;vr.octDecodeFloat(a,t),vr.octDecodeFloat(c,n),vr.octDecode(o,s,i)};vr.compressTextureCoordinates=function(e){let t=e.x*4095|0,n=e.y*4095|0;return 4096*t+n};vr.decompressTextureCoordinates=function(e,t){let n=e/4096,i=Math.floor(n);return t.x=i/4095,t.y=(e-i*4096)/4095,t};function BW(e){return e>>1^-(e&1)}vr.zigZagDeltaDecode=function(e,t,n){let i=e.length,r=0,o=0,a=0;for(let s=0;s<i;++s)r+=BW(e[s]),o+=BW(t[s]),e[s]=r,t[s]=o,l(n)&&(a+=BW(n[s]),n[s]=a)};vr.dequantize=function(e,t,n,i){let r=Vt.getNumberOfComponents(n),o;switch(t){case Y.BYTE:o=127;break;case Y.UNSIGNED_BYTE:o=255;break;case Y.SHORT:o=32767;break;case Y.UNSIGNED_SHORT:o=65535;break;case Y.INT:o=2147483647;break;case Y.UNSIGNED_INT:o=4294967295;break}let a=new Float32Array(i*r);for(let s=0;s<i;s++)for(let c=0;c<r;c++){let u=s*r+c;a[u]=Math.max(e[u]/o,-1)}return a};vr.encodeRGB8=function(e){return Math.round(I.clamp(e.red*255,0,255))*Hke+Math.round(I.clamp(e.green*255,0,255))*kW+Math.round(I.clamp(e.blue*255,0,255))};vr.decodeRGB8=function(e,t){return e=Math.floor(e),t.red=(e>>16&255)/255,t.green=(e>>8&255)/255,t.blue=(e&255)/255,t};vr.decodeRGB565=function(e,t){let n=e.length;l(t)||(t=new Float32Array(n*3));let i=31,r=63,o=1/31,a=1/63;for(let s=0;s<n;s++){let c=e[s],u=c>>11,f=c>>5&r,d=c&i,p=3*s;t[p]=u*o,t[p+1]=f*a,t[p+2]=d*o}return t};var an=vr;var GM={};GM.getHeight=function(e,t,n){return(e-n)*t+n};var Gke=new de;GM.getPosition=function(e,t,n,i,r){let o=t.cartesianToCartographic(e,Gke);if(!l(o))return h.clone(e,r);let a=GM.getHeight(o.height,n,i);return h.fromRadians(o.longitude,o.latitude,a,t,r)};var pr=GM;var mse={NONE:0,BITS12:1};Object.freeze(mse);var js=mse;var nI=new h,Wke=new h,jf=new k,qke=new O,Yke=new O,Xke=Math.pow(2,12);function hc(e,t,n,i,r,o,a,s,c,u){let f=js.NONE,d,p;if(l(t)&&l(n)&&l(i)&&l(r)){let g=t.minimum,m=t.maximum,y=h.subtract(m,g,Wke),A=i-n;Math.max(h.maximumComponent(y),A)<Xke-1?f=js.BITS12:f=js.NONE;let x=O.fromScale(y,qke);x=O.setTranslation(x,g,x);let T=O.fromScale(h.fromElements(1/y.x,1/y.y,1/y.z,nI),Yke);T=O.multiplyByTranslation(T,h.negate(g,nI),T),p=O.clone(r,new O);let C=O.getTranslation(r,nI);C=h.subtract(C,e,nI),p=O.setTranslation(p,C,p),p=O.multiply(p,x,p),d=O.inverseTransformation(r,new O),d=O.multiply(T,d,d),r=O.multiply(r,x,new O)}this.quantization=f,this.minimumHeight=n,this.maximumHeight=i,this.center=h.clone(e),this.toScaledENU=d,this.fromScaledENU=r,this.matrix=p,this.hasVertexNormals=o??!1,this.hasWebMercatorT=a??!1,this.hasGeodeticSurfaceNormals=s??!1,this.exaggeration=c??1,this.exaggerationRelativeHeight=u??0,this.stride=0,this._offsetGeodeticSurfaceNormal=0,this._offsetVertexNormal=0,this._calculateStrideAndOffsets()}hc.prototype.encode=function(e,t,n,i,r,o,a,s){let c=i.x,u=i.y;if(this.quantization===js.BITS12){n=O.multiplyByPoint(this.toScaledENU,n,nI),n.x=I.clamp(n.x,0,1),n.y=I.clamp(n.y,0,1),n.z=I.clamp(n.z,0,1);let f=this.maximumHeight-this.minimumHeight,d=I.clamp((r-this.minimumHeight)/f,0,1);k.fromElements(n.x,n.y,jf);let p=an.compressTextureCoordinates(jf);k.fromElements(n.z,d,jf);let g=an.compressTextureCoordinates(jf);k.fromElements(c,u,jf);let m=an.compressTextureCoordinates(jf);if(e[t++]=p,e[t++]=g,e[t++]=m,this.hasWebMercatorT){k.fromElements(a,0,jf);let y=an.compressTextureCoordinates(jf);e[t++]=y}}else e[t++]=n.x-this.center.x,e[t++]=n.y-this.center.y,e[t++]=n.z-this.center.z,e[t++]=r,e[t++]=c,e[t++]=u,this.hasWebMercatorT&&(e[t++]=a);return this.hasVertexNormals&&(e[t++]=an.octPackFloat(o)),this.hasGeodeticSurfaceNormals&&(e[t++]=s.x,e[t++]=s.y,e[t++]=s.z),t};var Kke=new h,pse=new h;hc.prototype.addGeodeticSurfaceNormals=function(e,t,n){if(this.hasGeodeticSurfaceNormals)return;let i=this.stride,r=e.length/i;this.hasGeodeticSurfaceNormals=!0,this._calculateStrideAndOffsets();let o=this.stride;for(let a=0;a<r;a++){for(let f=0;f<i;f++){let d=a*i+f,p=a*o+f;t[p]=e[d]}let s=this.decodePosition(t,a,Kke),c=n.geodeticSurfaceNormal(s,pse),u=a*o+this._offsetGeodeticSurfaceNormal;t[u]=c.x,t[u+1]=c.y,t[u+2]=c.z}};hc.prototype.removeGeodeticSurfaceNormals=function(e,t){if(!this.hasGeodeticSurfaceNormals)return;let n=this.stride,i=e.length/n;this.hasGeodeticSurfaceNormals=!1,this._calculateStrideAndOffsets();let r=this.stride;for(let o=0;o<i;o++)for(let a=0;a<r;a++){let s=o*n+a,c=o*r+a;t[c]=e[s]}};hc.prototype.decodePosition=function(e,t,n){if(l(n)||(n=new h),t*=this.stride,this.quantization===js.BITS12){let i=an.decompressTextureCoordinates(e[t],jf);n.x=i.x,n.y=i.y;let r=an.decompressTextureCoordinates(e[t+1],jf);return n.z=r.x,O.multiplyByPoint(this.fromScaledENU,n,n)}return n.x=e[t],n.y=e[t+1],n.z=e[t+2],h.add(n,this.center,n)};hc.prototype.getExaggeratedPosition=function(e,t,n){n=this.decodePosition(e,t,n);let i=this.exaggeration,r=this.exaggerationRelativeHeight;if(i!==1&&this.hasGeodeticSurfaceNormals){let a=this.decodeGeodeticSurfaceNormal(e,t,pse),s=this.decodeHeight(e,t),c=pr.getHeight(s,i,r)-s;n.x+=a.x*c,n.y+=a.y*c,n.z+=a.z*c}return n};hc.prototype.decodeTextureCoordinates=function(e,t,n){return l(n)||(n=new k),t*=this.stride,this.quantization===js.BITS12?an.decompressTextureCoordinates(e[t+2],n):k.fromElements(e[t+4],e[t+5],n)};hc.prototype.decodeHeight=function(e,t){return t*=this.stride,this.quantization===js.BITS12?an.decompressTextureCoordinates(e[t+1],jf).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight:e[t+3]};hc.prototype.decodeWebMercatorT=function(e,t){return t*=this.stride,this.quantization===js.BITS12?an.decompressTextureCoordinates(e[t+3],jf).x:e[t+6]};hc.prototype.getOctEncodedNormal=function(e,t,n){t=t*this.stride+this._offsetVertexNormal;let i=e[t]/256,r=Math.floor(i),o=(i-r)*256;return k.fromElements(r,o,n)};hc.prototype.decodeNormal=function(e,t,n){let i=t*this.stride+this._offsetVertexNormal;return an.octDecodeFloat(e[i],n)};hc.prototype.decodeGeodeticSurfaceNormal=function(e,t,n){return t=t*this.stride+this._offsetGeodeticSurfaceNormal,n.x=e[t],n.y=e[t+1],n.z=e[t+2],n};hc.prototype._calculateStrideAndOffsets=function(){let e=0;this.quantization===js.BITS12?e+=3:e+=6,this.hasWebMercatorT&&(e+=1),this.hasVertexNormals&&(this._offsetVertexNormal=e,e+=1),this.hasGeodeticSurfaceNormals&&(this._offsetGeodeticSurfaceNormal=e,e+=3),this.stride=e};var WM={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},qM={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};hc.prototype.getAttributes=function(e){let t=Y.FLOAT,n=Y.getSizeInBytes(t),i=this.stride*n,r=0,o=[];function a(s,c){o.push({index:s,vertexBuffer:e,componentDatatype:t,componentsPerAttribute:c,offsetInBytes:r,strideInBytes:i}),r+=c*n}if(this.quantization===js.NONE){a(WM.position3DAndHeight,4);let s=2;s+=this.hasWebMercatorT?1:0,s+=this.hasVertexNormals?1:0,a(WM.textureCoordAndEncodedNormals,s),this.hasGeodeticSurfaceNormals&&a(WM.geodeticSurfaceNormal,3)}else{let s=this.hasWebMercatorT||this.hasVertexNormals,c=this.hasWebMercatorT&&this.hasVertexNormals;a(qM.compressed0,s?4:3),c&&a(qM.compressed1,1),this.hasGeodeticSurfaceNormals&&a(qM.geodeticSurfaceNormal,3)}return o};hc.prototype.getAttributeLocations=function(){return this.quantization===js.NONE?WM:qM};hc.clone=function(e,t){if(l(e))return l(t)||(t=new hc),t.quantization=e.quantization,t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.center=h.clone(e.center),t.toScaledENU=O.clone(e.toScaledENU),t.fromScaledENU=O.clone(e.fromScaledENU),t.matrix=O.clone(e.matrix),t.hasVertexNormals=e.hasVertexNormals,t.hasWebMercatorT=e.hasWebMercatorT,t.hasGeodeticSurfaceNormals=e.hasGeodeticSurfaceNormals,t.exaggeration=e.exaggeration,t.exaggerationRelativeHeight=e.exaggerationRelativeHeight,t._calculateStrideAndOffsets(),t};var po=hc;var iI=class e{constructor(t){this._ellipsoid=t??te.WGS84,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}get ellipsoid(){return this._ellipsoid}static mercatorAngleToGeodeticLatitude(t){return I.PI_OVER_TWO-2*Math.atan(Math.exp(-t))}static geodeticLatitudeToMercatorAngle(t){t>e.MaximumLatitude?t=e.MaximumLatitude:t<-e.MaximumLatitude&&(t=-e.MaximumLatitude);let n=Math.sin(t);return .5*Math.log((1+n)/(1-n))}project(t,n){let i=this._semimajorAxis,r=t.longitude*i,o=e.geodeticLatitudeToMercatorAngle(t.latitude)*i,a=t.height;return l(n)?(n.x=r,n.y=o,n.z=a,n):new h(r,o,a)}unproject(t,n){let i=this._oneOverSemimajorAxis,r=t.x*i,o=e.mercatorAngleToGeodeticLatitude(t.y*i),a=t.z;return l(n)?(n.longitude=r,n.latitude=o,n.height=a,n):new de(r,o,a)}};iI.MaximumLatitude=iI.mercatorAngleToGeodeticLatitude(Math.PI);var _i=iI;var Sm={};Sm.DEFAULT_STRUCTURE=Object.freeze({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var UW=new h,$ke=new O,Jke=new h,Zke=new h;Sm.computeVertices=function(e){let t=Math.cos,n=Math.sin,i=Math.sqrt,r=Math.atan,o=Math.exp,a=I.PI_OVER_TWO,s=I.toRadians,c=e.heightmap,u=e.width,f=e.height,d=e.skirtHeight,p=d>0,g=e.isGeographic??!0,m=e.ellipsoid??te.default,y=1/m.maximumRadius,A=ie.clone(e.nativeRectangle),b=ie.clone(e.rectangle),x,T,C,E;l(b)?(x=b.west,T=b.south,C=b.east,E=b.north):g?(x=s(A.west),T=s(A.south),C=s(A.east),E=s(A.north)):(x=A.west*y,T=a-2*r(o(-A.south*y)),C=A.east*y,E=a-2*r(o(-A.north*y)));let w=e.relativeToCenter,D=l(w);w=D?w:h.ZERO;let R=e.includeWebMercatorT??!1,M=e.exaggeration??1,N=e.exaggerationRelativeHeight??0,v=M!==1,S=e.structure??Sm.DEFAULT_STRUCTURE,P=S.heightScale??Sm.DEFAULT_STRUCTURE.heightScale,L=S.heightOffset??Sm.DEFAULT_STRUCTURE.heightOffset,F=S.elementsPerHeight??Sm.DEFAULT_STRUCTURE.elementsPerHeight,V=S.stride??Sm.DEFAULT_STRUCTURE.stride,z=S.elementMultiplier??Sm.DEFAULT_STRUCTURE.elementMultiplier,j=S.isBigEndian??Sm.DEFAULT_STRUCTURE.isBigEndian,B=ie.computeWidth(A),G=ie.computeHeight(A),W=B/(u-1),Q=G/(f-1);g||(B*=y,G*=y);let q=m.radiiSquared,J=q.x,Z=q.y,ce=q.z,Ae=65536,le=-65536,Ce=mt.eastNorthUpToFixedFrame(w,m),ye=O.inverseTransformation(Ce,$ke),ve,Ie;R&&(ve=_i.geodeticLatitudeToMercatorAngle(T),Ie=1/(_i.geodeticLatitudeToMercatorAngle(E)-ve));let Le=Jke;Le.x=Number.POSITIVE_INFINITY,Le.y=Number.POSITIVE_INFINITY,Le.z=Number.POSITIVE_INFINITY;let $e=Zke;$e.x=Number.NEGATIVE_INFINITY,$e.y=Number.NEGATIVE_INFINITY,$e.z=Number.NEGATIVE_INFINITY;let Ye=Number.POSITIVE_INFINITY,yt=u*f,Ke=d>0?u*2+f*2:0,we=yt+Ke,We=new Array(we),Ct=new Array(we),ct=new Array(we),dn=R?new Array(we):[],Ht=v?new Array(we):[],bt=0,Dt=f,In=0,rt=u;p&&(--bt,++Dt,--In,++rt);let dt=1e-5;for(let ei=bt;ei<Dt;++ei){let vn=ei;vn<0&&(vn=0),vn>=f&&(vn=f-1);let ti=A.north-Q*vn;g?ti=s(ti):ti=a-2*r(o(-ti*y));let xr=(ti-T)/(E-T);xr=I.clamp(xr,0,1);let fa=ei===bt,Ma=ei===Dt-1;d>0&&(fa?ti+=dt*G:Ma&&(ti-=dt*G));let Xa=t(ti),Ka=n(ti),Qr=ce*Ka,mi;R&&(mi=(_i.geodeticLatitudeToMercatorAngle(ti)-ve)*Ie);for(let eo=In;eo<rt;++eo){let Di=eo;Di<0&&(Di=0),Di>=u&&(Di=u-1);let Mo=vn*(u*V)+Di*V,Ri;if(F===1)Ri=c[Mo];else{Ri=0;let $a;if(j)for($a=0;$a<F;++$a)Ri=Ri*z+c[Mo+$a];else for($a=F-1;$a>=0;--$a)Ri=Ri*z+c[Mo+$a]}Ri=Ri*P+L,le=Math.max(le,Ri),Ae=Math.min(Ae,Ri);let Tr=A.west+W*Di;g?Tr=s(Tr):Tr=Tr*y;let da=(Tr-x)/(C-x);da=I.clamp(da,0,1);let Co=vn*u+Di;if(d>0){let $a=eo===In,ha=eo===rt-1,Nf=fa||Ma||$a||ha;if((fa||Ma)&&($a||ha))continue;Nf&&(Ri-=d,$a?(Co=yt+(f-vn-1),Tr-=dt*B):Ma?Co=yt+f+(u-Di-1):ha?(Co=yt+f+u+vn,Tr+=dt*B):fa&&(Co=yt+f+u+f+Di))}let Mf=Xa*t(Tr),Lf=Xa*n(Tr),lc=J*Mf,Xg=Z*Lf,ys=1/i(lc*Mf+Xg*Lf+Qr*Ka),Kg=lc*ys,oi=Xg*ys,Fs=Qr*ys,Bs=new h;Bs.x=Kg+Mf*Ri,Bs.y=oi+Lf*Ri,Bs.z=Fs+Ka*Ri,O.multiplyByPoint(ye,Bs,UW),h.minimumByComponent(UW,Le,Le),h.maximumByComponent(UW,$e,$e),Ye=Math.min(Ye,Ri),We[Co]=Bs,ct[Co]=new k(da,xr),Ct[Co]=Ri,R&&(dn[Co]=mi),v&&(Ht[Co]=m.geodeticSurfaceNormal(Bs))}}let vi=se.fromPoints(We),wn;l(b)&&(wn=Jt.fromRectangle(b,Ae,le,m));let Mi;D&&(Mi=new vm(m).computeHorizonCullingPointPossiblyUnderEllipsoid(w,We,Ae));let lr=new Vf(Le,$e,w),Li=new po(w,lr,Ye,le,Ce,!1,R,v,M,N),Wi=new Float32Array(we*Li.stride),ri=0;for(let ei=0;ei<we;++ei)ri=Li.encode(Wi,ri,We[ei],ct[ei],Ct[ei],void 0,dn[ei],Ht[ei]);return{vertices:Wi,maximumHeight:le,minimumHeight:Ae,encoding:Li,boundingSphere3D:vi,orientedBoundingBox:wn,occludeePointInScaledSpace:Mi}};var rI=Sm;var gse=La(Uu(),1);function Qke(){return!0}function e3e(e,t){t=t??"This object was destroyed, i.e., destroy() was called.";function n(){}for(let i in e)typeof e[i]=="function"&&(e[i]=n);e.isDestroyed=Qke}var ue=e3e;function _se(){if(!l(Hs._canTransferArrayBuffer)){let e=HW("transferTypedArrayTest");e.postMessage=e.webkitPostMessage??e.postMessage;let t=99,n=new Int8Array([t]);try{e.postMessage({array:n},[n.buffer])}catch{return Hs._canTransferArrayBuffer=!1,Hs._canTransferArrayBuffer}Hs._canTransferArrayBuffer=new Promise(i=>{e.onmessage=function(r){let o=r.data.array,a=l(o)&&o[0]===t;i(a),e.terminate(),Hs._canTransferArrayBuffer=a}})}return Hs._canTransferArrayBuffer}var jW=new be;function VW(e){let t;try{t=new Blob([e],{type:"application/javascript"})}catch{let r=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,o=new r;o.append(e),t=o.getBlob("application/javascript")}return(window.URL||window.webkitURL).createObjectURL(t)}function HW(e){let t=new gse.default(e),n=t.scheme().length!==0&&t.fragment().length===0,i=e.replace(/\.js$/,""),r={},o,a;if(kA(e))a=e;else if(!n){let s=$t(`${Hs._workerModulePrefix}/${i}.js`);kA(s)&&(a=s)}if(a){let s=`import "${a}";`;return o=VW(s),r.type="module",new Worker(o,r)}if(!n&&typeof CESIUM_WORKERS<"u"){let s=`
|
|
importScripts("${VW(CESIUM_WORKERS)}");
|
|
CesiumWorkers["${i}"]();
|
|
`;return o=VW(s),new Worker(o,r)}if(o=e,n||(o=$t(`${Hs._workerModulePrefix+i}.js`)),!fn.supportsEsmWebWorkers())throw new oe("This browser is not supported. Please update your browser to continue.");return r.type="module",new Worker(o,r)}async function t3e(e,t){let n={modulePath:void 0,wasmBinaryFile:void 0,wasmBinary:void 0};if(!fn.supportsWebAssembly()){if(!l(t.fallbackModulePath))throw new oe(`This browser does not support Web Assembly, and no backup module was provided for ${e._workerPath}`);return n.modulePath=$t(t.fallbackModulePath),n}n.wasmBinaryFile=$t(t.wasmBinaryFile);let i=await De.fetchArrayBuffer({url:n.wasmBinaryFile});return n.wasmBinary=i,n}function Hs(e,t){this._workerPath=e,this._maximumActiveTasks=t??Number.POSITIVE_INFINITY,this._activeTasks=0,this._nextID=0,this._webAssemblyPromise=void 0}var n3e=(e,t,n,i)=>{let r=({data:o})=>{if(o.id===t){if(l(o.error)){let a=o.error;a.name==="RuntimeError"?(a=new oe(o.error.message),a.stack=o.error.stack):a.name==="DeveloperError"?(a=new pe(o.error.message),a.stack=o.error.stack):a.name==="Error"&&(a=new Error(o.error.message),a.stack=o.error.stack),jW.raiseEvent(a),i(a)}else jW.raiseEvent(),n(o.result);e.removeEventListener("message",r)}};return r},i3e=[];async function r3e(e,t,n){let i=await Promise.resolve(_se());l(n)?i||(n.length=0):n=i3e;let r=e._nextID++,o=new Promise((a,s)=>{e._worker.addEventListener("message",n3e(e._worker,r,a,s))});return e._worker.postMessage({id:r,baseUrl:$t.getCesiumBaseUrl().url,parameters:t,canTransferArrayBuffer:i},n),o}async function o3e(e,t,n){++e._activeTasks;try{let i=await r3e(e,t,n);return--e._activeTasks,i}catch(i){throw--e._activeTasks,i}}Hs.prototype.scheduleTask=function(e,t){if(l(this._worker)||(this._worker=HW(this._workerPath)),!(this._activeTasks>=this._maximumActiveTasks))return o3e(this,e,t)};Hs.prototype.initWebAssemblyModule=async function(e){if(l(this._webAssemblyPromise))return this._webAssemblyPromise;let t=async()=>{let n=this._worker=HW(this._workerPath),i=await t3e(this,e),r=await Promise.resolve(_se()),o,a=i.wasmBinary;l(a)&&r&&(o=[a]);let s=new Promise((c,u)=>{n.onmessage=function({data:f}){l(f)?c(f.result):u(new oe("Could not configure wasm module"))}});return n.postMessage({canTransferArrayBuffer:r,parameters:{webAssemblyConfig:i}},o),s};return this._webAssemblyPromise=t(),this._webAssemblyPromise};Hs.prototype.isDestroyed=function(){return!1};Hs.prototype.destroy=function(){return l(this._worker)&&this._worker.terminate(),ue(this)};Hs.taskCompletedEvent=jW;Hs._defaultWorkerModulePrefix="Workers/";Hs._workerModulePrefix=Hs._defaultWorkerModulePrefix;Hs._canTransferArrayBuffer=void 0;var Yn=Hs;function s_(){pe.throwInstantiationError()}Object.defineProperties(s_.prototype,{credits:{get:pe.throwInstantiationError},waterMask:{get:pe.throwInstantiationError}});s_.prototype.interpolateHeight=pe.throwInstantiationError;s_.prototype.isChildAvailable=pe.throwInstantiationError;s_.prototype.createMesh=pe.throwInstantiationError;s_.prototype.upsample=pe.throwInstantiationError;s_.prototype.wasCreatedByUpsampling=pe.throwInstantiationError;s_.maximumAsynchronousTasks=5;var Hu=s_;var oI={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};oI.getMorphTime=function(e){return e===oI.SCENE3D?1:e===oI.MORPHING?void 0:0};Object.freeze(oI);var re=oI;var a3e=3,WW=class{constructor(t,n,i){this._vertices=t,this._indices=n,this._encoding=i,this._inverseTransform=new O,this._needsRebuild=!0,this._rootNode=new qW}get needsRebuild(){return this._needsRebuild}set needsRebuild(t){this._needsRebuild=t}rayIntersect(t,n,i,r,o){this._needsRebuild&&l3e(this,n);let a=this._inverseTransform,s=c3e;s.origin=O.multiplyByPoint(a,t.origin,s.origin),s.direction=O.multiplyByPointAsVector(a,t.direction,s.direction);let c=[];return Ase(this._rootNode,s,c),m3e(this,c,t,i,r,o)}},s3e=new Yn("incrementallyBuildTerrainPicker"),qW=class e{constructor(){this.x=0,this.y=0,this.level=0,this.aabb=yse(this.x,this.y,this.level),this.intersectingTriangles=new Uint32Array(0),this.children=[],this.buildingChildren=!1}addChild(t){let n=new e;n.x=this.x*2+(t&1),n.y=this.y*2+(t>>1&1),n.level=this.level+1,n.aabb=yse(n.x,n.y,n.level),this.children[t]=n}},c3e=new hn,YM=[new h,new h,new h];function l3e(e,t){O.inverse(t,e._inverseTransform),e._needsRebuild=!1;let n=e._indices.length/3,i=new Uint32Array(n);for(let r=0;r<n;++r)i[r]=r;e._rootNode.intersectingTriangles=i,e._rootNode.children.length=0}var u3e=new h,f3e=new h;function yse(e,t,n){let i=1/Math.pow(2,n),r=h.fromElements(e*i-.5,t*i-.5,-.5,u3e),o=h.fromElements((e+1)*i-.5,(t+1)*i-.5,.5,f3e);return Vf.fromCorners(r,o)}function d3e(e,t,n,i,r){h.pack(n[0],e,9*r),h.pack(n[1],e,9*r+3),h.pack(n[2],e,9*r+6),t[r]=i}var h3e=new $o;function Ase(e,t,n){let i=ci.rayAxisAlignedBoundingBox(t,e.aabb,h3e);if(!l(i))return;if(!e.children.length||e.buildingChildren){n.push({node:e,interval:new $o(i.start,i.stop)});return}for(let o=0;o<e.children.length;o++)Ase(e.children[o],t,n)}function m3e(e,t,n,i,r,o){let a=t.sort(function(c,u){return c.interval.start-u.interval.start}),s=Number.MAX_VALUE;for(let c=0;c<a.length;c++){let u=a[c],f=p3e(e,n,u.node,i,r,o);if(s=Math.min(f,s),s!==Number.MAX_VALUE)break}if(s!==Number.MAX_VALUE)return hn.getPoint(n,s)}function p3e(e,t,n,i,r,o){let a=Number.MAX_VALUE,s=e._encoding,c=e._indices,u=e._vertices,f=n.intersectingTriangles.length,p=!(n.level>=a3e)&&!n.buildingChildren,g,m;p&&(g=new Float64Array(f*9),m=new Uint32Array(f));for(let y=0;y<f;y++){let A=n.intersectingTriangles[y],b=GW(s,r,o,t,u,c[3*A],YM[0]),x=GW(s,r,o,t,u,c[3*A+1],YM[1]),T=GW(s,r,o,t,u,c[3*A+2],YM[2]),C=ci.rayTriangleParametric(t,b,x,T,i);l(C)&&C<a&&C>=0&&(a=C),p&&d3e(g,m,YM,A,y)}if(p){for(let y=0;y<4;y++)n.addChild(y);_3e(e._inverseTransform,n,m,g)}return a}var g3e=new de;function GW(e,t,n,i,r,o,a){let s=e.getExaggeratedPosition(r,o,a);if(t===re.SCENE3D)return s;let u=n.ellipsoid.cartesianToCartographic(s,g3e);s=n.project(u,a),s=h.fromElements(s.z,s.x,s.y,a);let f=I.TWO_PI*n.ellipsoid.maximumRadius,d=Math.round((i.origin.y-s.y)/f);return s.y+=d*f,s}async function _3e(e,t,n,i){t.buildingChildren=!0;let r=new Float64Array(16);O.pack(e,r,0);let o=new Float64Array(24);for(let f=0;f<4;f++)h.pack(t.children[f].aabb.minimum,o,f*6),h.pack(t.children[f].aabb.maximum,o,f*6+3);let a={aabbs:o,inverseTransform:r,triangleIndices:n,trianglePositions:i},s=[o.buffer,r.buffer,n.buffer,i.buffer],c=s3e.scheduleTask(a,s);if(!l(c)){t.buildingChildren=!1;return}(await c).intersectingTrianglesArrays.forEach((f,d)=>{l(t.children[d])&&(t.children[d].intersectingTriangles=new Uint32Array(f))}),t.intersectingTriangles=new Uint32Array(0),t.buildingChildren=!1}var XM=WW;function aI(e,t,n,i,r,o,a,s,c,u,f,d,p,g,m,y,A){this.center=e,this.vertices=t,this.stride=f??6,this.indices=n,this.indexCountWithoutSkirts=i,this.vertexCountWithoutSkirts=r,this.minimumHeight=o,this.maximumHeight=a,this.rectangle=s,this.boundingSphere3D=c,this.occludeePointInScaledSpace=u,this.orientedBoundingBox=d,this.encoding=p,this.westIndicesSouthToNorth=g,this.southIndicesEastToWest=m,this.eastIndicesNorthToSouth=y,this.northIndicesWestToEast=A,this._transform=new O,this._lastPickSceneMode=void 0,this._terrainPicker=new XM(t,n,p)}aI.prototype.getTransform=function(e,t){return this._lastPickSceneMode===e?this._transform:(this._terrainPicker.needsRebuild=!0,!l(e)||e===re.SCENE3D?y3e(this,this._transform):E3e(this,t,this._transform))};function y3e(e,t){let n=e.encoding.exaggeration,i=e.encoding.exaggerationRelativeHeight,r=pr.getHeight(e.minimumHeight,n,i),o=pr.getHeight(e.maximumHeight,n,i),a=Jt.fromRectangle(e.rectangle,r,o,te.default,e.orientedBoundingBox);return Jt.computeTransformation(a,t),O.getScale(t,YW).z<=I.EPSILON16&&(YW.z=1,O.setScale(t,YW,t)),t}var A3e=new h,b3e=new h,x3e=new de,T3e=new de,C3e=new h,v3e=new h,YW=new h;function E3e(e,t,n){let i=e.encoding.exaggeration,r=e.encoding.exaggerationRelativeHeight,o=pr.getHeight(e.minimumHeight,i,r),a=pr.getHeight(e.maximumHeight,i,r),s=t.project(de.fromRadians(e.rectangle.west,e.rectangle.south,0,x3e),A3e),c=t.project(de.fromRadians(e.rectangle.east,e.rectangle.north,0,T3e),b3e),u=a-o,f=h.fromElements(c.x-s.x,c.y-s.y,u>0?u:1,C3e),d=h.fromElements(s.x+f.x*.5,s.y+f.y*.5,o+f.z*.5,v3e);return O.fromTranslation(d,n),O.setScale(n,f,n),O.multiply(mt.SWIZZLE_3D_TO_2D_MATRIX,n,n),n}aI.prototype.pick=function(e,t,n,i){let r=this._terrainPicker.rayIntersect(e,this.getTransform(n,i),t,n,i);return this._lastPickSceneMode=n,r};aI.prototype.updateExaggeration=function(e,t){this._terrainPicker._vertices=this.vertices,this._terrainPicker.needsRebuild=!0,this._lastPickSceneMode=void 0};aI.prototype.updateSceneMode=function(e){this._terrainPicker.needsRebuild=!0,this._lastPickSceneMode=void 0};var mc=aI;var es={UNSIGNED_BYTE:ee.UNSIGNED_BYTE,UNSIGNED_SHORT:ee.UNSIGNED_SHORT,UNSIGNED_INT:ee.UNSIGNED_INT};es.getSizeInBytes=function(e){switch(e){case es.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case es.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case es.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}};es.fromSizeInBytes=function(e){switch(e){case 2:return es.UNSIGNED_SHORT;case 4:return es.UNSIGNED_INT;case 1:return es.UNSIGNED_BYTE}};es.validate=function(e){return l(e)&&(e===es.UNSIGNED_BYTE||e===es.UNSIGNED_SHORT||e===es.UNSIGNED_INT)};es.createTypedArray=function(e,t){return e>=I.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)};es.createTypedArrayFromArrayBuffer=function(e,t,n,i){return e>=I.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)};es.fromTypedArray=function(e){if(e instanceof Uint8Array)return es.UNSIGNED_BYTE;if(e instanceof Uint16Array)return es.UNSIGNED_SHORT;if(e instanceof Uint32Array)return es.UNSIGNED_INT};Object.freeze(es);var Ve=es;function pa(){pe.throwInstantiationError()}Object.defineProperties(pa.prototype,{errorEvent:{get:pe.throwInstantiationError},credit:{get:pe.throwInstantiationError},tilingScheme:{get:pe.throwInstantiationError},hasWaterMask:{get:pe.throwInstantiationError},hasVertexNormals:{get:pe.throwInstantiationError},availability:{get:pe.throwInstantiationError}});var bse=[];pa.getRegularGridIndices=function(e,t){let n=bse[e];l(n)||(bse[e]=n=[]);let i=n[t];return l(i)||(e*t<I.SIXTY_FOUR_KILOBYTES?i=n[t]=new Uint16Array((e-1)*(t-1)*6):i=n[t]=new Uint32Array((e-1)*(t-1)*6),vse(e,t,i,0)),i};var xse=[];pa.getRegularGridIndicesAndEdgeIndices=function(e,t){let n=xse[e];l(n)||(xse[e]=n=[]);let i=n[t];if(!l(i)){let r=pa.getRegularGridIndices(e,t),o=Cse(e,t),a=o.westIndicesSouthToNorth,s=o.southIndicesEastToWest,c=o.eastIndicesNorthToSouth,u=o.northIndicesWestToEast;i=n[t]={indices:r,westIndicesSouthToNorth:a,southIndicesEastToWest:s,eastIndicesNorthToSouth:c,northIndicesWestToEast:u}}return i};var Tse=[];pa.getRegularGridAndSkirtIndicesAndEdgeIndices=function(e,t){let n=Tse[e];l(n)||(Tse[e]=n=[]);let i=n[t];if(!l(i)){let r=e*t,o=(e-1)*(t-1)*6,a=e*2+t*2,s=Math.max(0,a-4)*6,c=r+a,u=o+s,f=Cse(e,t),d=f.westIndicesSouthToNorth,p=f.southIndicesEastToWest,g=f.eastIndicesNorthToSouth,m=f.northIndicesWestToEast,y=Ve.createTypedArray(c,u);vse(e,t,y,0),pa.addSkirtIndices(d,p,g,m,r,y,o),i=n[t]={indices:y,westIndicesSouthToNorth:d,southIndicesEastToWest:p,eastIndicesNorthToSouth:g,northIndicesWestToEast:m,indexCountWithoutSkirts:o}}return i};pa.getSkirtVertexCount=function(e,t,n,i){return e.length+t.length+n.length+i.length};pa.getSkirtIndexCount=function(e){return(e-4)*2*3};pa.getSkirtIndexCountWithFilledCorners=function(e){return((e-4)*2+4)*3};pa.addSkirtIndices=function(e,t,n,i,r,o,a){let s=r;a=KM(e,s,o,a),s+=e.length,a=KM(t,s,o,a),s+=t.length,a=KM(n,s,o,a),s+=n.length,KM(i,s,o,a)};pa.addSkirtIndicesWithFilledCorners=function(e,t,n,i,r,o,a){pa.addSkirtIndices(e,t,n,i,r,o,a);let s=pa.getSkirtVertexCount(e,t,n,i),c=pa.getSkirtIndexCount(s),u=a+c,f=e[0],d=i[0],p=n[0],g=t[0],m=r,y=m+e.length-1,A=y+1,b=A+t.length-1,x=b+1,T=x+n.length-1,C=T+1,E=C+i.length-1;o[u+0]=f,o[u+1]=m,o[u+2]=b,o[u+3]=g,o[u+4]=A,o[u+5]=T,o[u+6]=p,o[u+7]=x,o[u+8]=E,o[u+9]=d,o[u+10]=C,o[u+11]=y};function Cse(e,t){let n=new Array(t),i=new Array(e),r=new Array(t),o=new Array(e),a;for(a=0;a<e;++a)o[a]=a,i[a]=e*t-1-a;for(a=0;a<t;++a)r[a]=(a+1)*e-1,n[a]=(t-a-1)*e;return{westIndicesSouthToNorth:n,southIndicesEastToWest:i,eastIndicesNorthToSouth:r,northIndicesWestToEast:o}}function vse(e,t,n,i){let r=0;for(let o=0;o<t-1;++o){for(let a=0;a<e-1;++a){let s=r,c=s+e,u=c+1,f=s+1;n[i++]=s,n[i++]=c,n[i++]=f,n[i++]=f,n[i++]=c,n[i++]=u,++r}++r}}function KM(e,t,n,i){let r=e[0],o=e.length;for(let a=1;a<o;++a){let s=e[a];n[i++]=r,n[i++]=s,n[i++]=t,n[i++]=t,n[i++]=s,n[i++]=t+1,r=s,++t}return i}pa.heightmapTerrainQuality=.25;pa.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,n){return e.maximumRadius*2*Math.PI*pa.heightmapTerrainQuality/(t*n)};pa.prototype.requestTileGeometry=pe.throwInstantiationError;pa.prototype.getLevelMaximumGeometricError=pe.throwInstantiationError;pa.prototype.getTileDataAvailable=pe.throwInstantiationError;pa.prototype.loadTileDataAvailability=pe.throwInstantiationError;var Vr=pa;function h0(e){e=e??H.EMPTY_OBJECT,this._buffer=e.buffer,this._width=e.width,this._height=e.height,this._childTileMask=e.childTileMask??15,this._encoding=e.encoding??eh.NONE;let t=rI.DEFAULT_STRUCTURE,n=e.structure;l(n)?n!==t&&(n.heightScale=n.heightScale??t.heightScale,n.heightOffset=n.heightOffset??t.heightOffset,n.elementsPerHeight=n.elementsPerHeight??t.elementsPerHeight,n.stride=n.stride??t.stride,n.elementMultiplier=n.elementMultiplier??t.elementMultiplier,n.isBigEndian=n.isBigEndian??t.isBigEndian):n=t,this._structure=n,this._createdByUpsampling=e.createdByUpsampling??!1,this._waterMask=e.waterMask,this._skirtHeight=void 0,this._bufferType=this._encoding===eh.LERC?Float32Array:this._buffer.constructor,this._mesh=void 0}Object.defineProperties(h0.prototype,{credits:{get:function(){}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}}});var Ese="createVerticesFromHeightmap",S3e=new Yn(Ese),w3e=new Yn(Ese,Hu.maximumAsynchronousTasks);h0.prototype.createMesh=function(e){e=e??H.EMPTY_OBJECT;let t=e.tilingScheme,n=e.x,i=e.y,r=e.level,o=e.exaggeration??1,a=e.exaggerationRelativeHeight??0,s=e.throttle??!0,c=t.ellipsoid,u=t.tileXYToNativeRectangle(n,i,r),f=t.tileXYToRectangle(n,i,r),d=c.cartographicToCartesian(ie.center(f)),p=this._structure,m=Vr.getEstimatedLevelZeroGeometricErrorForAHeightmap(c,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<r);this._skirtHeight=Math.min(m*4,1e3);let A=(s?w3e:S3e).scheduleTask({heightmap:this._buffer,structure:p,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:u,rectangle:f,relativeToCenter:d,ellipsoid:c,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof ki,exaggeration:o,exaggerationRelativeHeight:a,encoding:this._encoding});if(!l(A))return;let b=this;return Promise.resolve(A).then(function(x){let T;b._skirtHeight>0?T=Vr.getRegularGridAndSkirtIndicesAndEdgeIndices(x.gridWidth,x.gridHeight):T=Vr.getRegularGridIndicesAndEdgeIndices(x.gridWidth,x.gridHeight);let C=x.gridWidth*x.gridHeight;return b._mesh=new mc(d,new Float32Array(x.vertices),T.indices,T.indexCountWithoutSkirts,C,x.minimumHeight,x.maximumHeight,f,se.clone(x.boundingSphere3D),h.clone(x.occludeePointInScaledSpace),x.numberOfAttributes,Jt.clone(x.orientedBoundingBox),po.clone(x.encoding),T.westIndicesSouthToNorth,T.southIndicesEastToWest,T.eastIndicesNorthToSouth,T.northIndicesWestToEast),b._buffer=void 0,b._mesh})};h0.prototype._createMeshSync=function(e){let t=e.tilingScheme,n=e.x,i=e.y,r=e.level,o=e.exaggeration??1,a=e.exaggerationRelativeHeight??0,s=t.ellipsoid,c=t.tileXYToNativeRectangle(n,i,r),u=t.tileXYToRectangle(n,i,r),f=s.cartographicToCartesian(ie.center(u)),d=this._structure,g=Vr.getEstimatedLevelZeroGeometricErrorForAHeightmap(s,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<r);this._skirtHeight=Math.min(g*4,1e3);let m=rI.computeVertices({heightmap:this._buffer,structure:d,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:c,rectangle:u,relativeToCenter:f,ellipsoid:s,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof ki,exaggeration:o,exaggerationRelativeHeight:a});this._buffer=void 0;let y;this._skirtHeight>0?y=Vr.getRegularGridAndSkirtIndicesAndEdgeIndices(this._width,this._height):y=Vr.getRegularGridIndicesAndEdgeIndices(this._width,this._height);let A=m.gridWidth*m.gridHeight;return this._mesh=new mc(f,m.vertices,y.indices,y.indexCountWithoutSkirts,A,m.minimumHeight,m.maximumHeight,u,m.boundingSphere3D,m.occludeePointInScaledSpace,m.encoding.stride,m.orientedBoundingBox,m.encoding,y.westIndicesSouthToNorth,y.southIndicesEastToWest,y.eastIndicesNorthToSouth,y.northIndicesWestToEast),this._mesh};h0.prototype.interpolateHeight=function(e,t,n){let i=this._width,r=this._height,o=this._structure,a=o.stride,s=o.elementsPerHeight,c=o.elementMultiplier,u=o.isBigEndian,f=o.heightOffset,d=o.heightScale,p=l(this._mesh),g=this._encoding===eh.LERC;if(!p&&g)return;let y;if(p){let A=this._mesh.vertices,b=this._mesh.encoding;y=Sse(A,b,f,d,e,i,r,t,n)}else y=I3e(this._buffer,s,c,a,u,e,i,r,t,n),y=y*d+f;return y};h0.prototype.upsample=function(e,t,n,i,r,o,a){let s=this._mesh;if(!l(s))return;let c=this._width,u=this._height,f=this._structure,d=f.stride,p=new this._bufferType(c*u*d),g=s.vertices,m=s.encoding,y=e.tileXYToRectangle(t,n,i),A=e.tileXYToRectangle(r,o,a),b=f.heightOffset,x=f.heightScale,T=f.elementsPerHeight,C=f.elementMultiplier,E=f.isBigEndian,w=Math.pow(C,T-1);for(let D=0;D<u;++D){let R=I.lerp(A.north,A.south,D/(u-1));for(let M=0;M<c;++M){let N=I.lerp(A.west,A.east,M/(c-1)),_=Sse(g,m,b,x,y,c,u,N,R);_=_<f.lowestEncodedHeight?f.lowestEncodedHeight:_,_=_>f.highestEncodedHeight?f.highestEncodedHeight:_,P3e(p,T,C,w,d,E,D*c+M,_)}}return Promise.resolve(new h0({buffer:p,width:c,height:u,childTileMask:0,structure:this._structure,createdByUpsampling:!0}))};h0.prototype.isChildAvailable=function(e,t,n,i){let r=2;return n!==e*2&&++r,i!==t*2&&(r-=2),(this._childTileMask&1<<r)!==0};h0.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};function I3e(e,t,n,i,r,o,a,s,c,u){let f=(c-o.west)*(a-1)/(o.east-o.west),d=(u-o.south)*(s-1)/(o.north-o.south),p=f|0,g=p+1;g>=a&&(g=a-1,p=a-2);let m=d|0,y=m+1;y>=s&&(y=s-1,m=s-2);let A=f-p,b=d-m;m=s-1-m,y=s-1-y;let x=$M(e,t,n,i,r,m*a+p),T=$M(e,t,n,i,r,m*a+g),C=$M(e,t,n,i,r,y*a+p),E=$M(e,t,n,i,r,y*a+g);return wse(A,b,x,T,C,E)}function Sse(e,t,n,i,r,o,a,s,c){let u=(s-r.west)*(o-1)/(r.east-r.west),f=(c-r.south)*(a-1)/(r.north-r.south),d=u|0,p=d+1;p>=o&&(p=o-1,d=o-2);let g=f|0,m=g+1;m>=a&&(m=a-1,g=a-2);let y=u-d,A=f-g;g=a-1-g,m=a-1-m;let b=(t.decodeHeight(e,g*o+d)-n)/i,x=(t.decodeHeight(e,g*o+p)-n)/i,T=(t.decodeHeight(e,m*o+d)-n)/i,C=(t.decodeHeight(e,m*o+p)-n)/i;return wse(y,A,b,x,T,C)}function wse(e,t,n,i,r,o){return t<e?n+e*(i-n)+t*(o-i):n+e*(o-r)+t*(r-n)}function $M(e,t,n,i,r,o){o*=i;let a=0,s;if(r)for(s=0;s<t;++s)a=a*n+e[o+s];else for(s=t-1;s>=0;--s)a=a*n+e[o+s];return a}function P3e(e,t,n,i,r,o,a,s){a*=r;let c;if(o)for(c=0;c<t-1;++c)e[a+c]=s/i|0,s-=e[a+c]*i,i/=n;else for(c=t-1;c>0;--c)e[a+c]=s/i|0,s-=e[a+c]*i,i/=n;e[a+c]=s}var Lc=h0;function $T(e,t){this._tilingScheme=e,this._maximumLevel=t,this._rootNodes=[]}var WA=new ie;function D3e(e,t,n,i){let r=i.length;for(let o=0;o<r;++o){let a=i[o];if(a.x===t&&a.y===n&&a.level===e)return!0}return!1}$T.prototype.addAvailableTileRange=function(e,t,n,i,r){let o=this._tilingScheme,a=this._rootNodes;if(e===0)for(let p=n;p<=r;++p)for(let g=t;g<=i;++g)D3e(e,g,p,a)||a.push(new XT(o,void 0,0,g,p));o.tileXYToRectangle(t,n,e,WA);let s=WA.west,c=WA.north;o.tileXYToRectangle(i,r,e,WA);let u=WA.east,f=WA.south,d=new N3e(e,s,f,u,c);for(let p=0;p<a.length;++p){let g=a[p];XW(g.extent,d)&&F3e(this._maximumLevel,g,d)}};$T.prototype.computeMaximumLevelAtPosition=function(e){let t;for(let n=0;n<this._rootNodes.length;++n){let i=this._rootNodes[n];if(KT(i.extent,e)){t=i;break}}return l(t)?sI(void 0,t,e):-1};var R3e=[],O3e=[],M3e=new ie,L3e=new ie;$T.prototype.computeBestAvailableLevelOverRectangle=function(e){let t=R3e;t.length=0,e.east<e.west?(t.push(ie.fromRadians(-Math.PI,e.south,e.east,e.north,M3e)),t.push(ie.fromRadians(e.west,e.south,Math.PI,e.north,L3e))):t.push(e);let n=O3e;n.length=0;let i;for(i=0;i<this._rootNodes.length;++i)cI(n,this._rootNodes[i],t);for(i=n.length-1;i>=0;--i)if(l(n[i])&&n[i].length===0)return i;return 0};var Ise=new de;$T.prototype.isTileAvailable=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(t,n,e,WA);return ie.center(i,Ise),this.computeMaximumLevelAtPosition(Ise)>=e};$T.prototype.computeChildMaskForTile=function(e,t,n){let i=e+1;if(i>=this._maximumLevel)return 0;let r=0;return r|=this.isTileAvailable(i,2*t,2*n+1)?1:0,r|=this.isTileAvailable(i,2*t+1,2*n+1)?2:0,r|=this.isTileAvailable(i,2*t,2*n)?4:0,r|=this.isTileAvailable(i,2*t+1,2*n)?8:0,r};function XT(e,t,n,i,r){this.tilingScheme=e,this.parent=t,this.level=n,this.x=i,this.y=r,this.extent=e.tileXYToRectangle(i,r,n),this.rectangles=[],this._sw=void 0,this._se=void 0,this._nw=void 0,this._ne=void 0}Object.defineProperties(XT.prototype,{nw:{get:function(){return this._nw||(this._nw=new XT(this.tilingScheme,this,this.level+1,this.x*2,this.y*2)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new XT(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new XT(this.tilingScheme,this,this.level+1,this.x*2,this.y*2+1)),this._sw}},se:{get:function(){return this._se||(this._se=new XT(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2+1)),this._se}}});function N3e(e,t,n,i,r){this.level=e,this.west=t,this.south=n,this.east=i,this.north=r}function XW(e,t){let n=Math.max(e.west,t.west),i=Math.max(e.south,t.south),r=Math.min(e.east,t.east),o=Math.min(e.north,t.north);return i<o&&n<r}function F3e(e,t,n){for(;t.level<e;)if(JM(t.nw.extent,n))t=t.nw;else if(JM(t.ne.extent,n))t=t.ne;else if(JM(t.sw.extent,n))t=t.sw;else if(JM(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=Cr(t.rectangles,n.level,B3e);i<0&&(i=~i),t.rectangles.splice(i,0,n)}}function B3e(e,t){return e.level-t}function JM(e,t){return t.west>=e.west&&t.east<=e.east&&t.south>=e.south&&t.north<=e.north}function KT(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north}function sI(e,t,n){let i=0,r=!1;for(;!r;){let o=t._nw&&KT(t._nw.extent,n),a=t._ne&&KT(t._ne.extent,n),s=t._sw&&KT(t._sw.extent,n),c=t._se&&KT(t._se.extent,n);if(o+a+s+c>1){o&&(i=Math.max(i,sI(t,t._nw,n))),a&&(i=Math.max(i,sI(t,t._ne,n))),s&&(i=Math.max(i,sI(t,t._sw,n))),c&&(i=Math.max(i,sI(t,t._se,n)));break}else o?t=t._nw:a?t=t._ne:s?t=t._sw:c?t=t._se:r=!0}for(;t!==e;){let o=t.rectangles;for(let a=o.length-1;a>=0&&o[a].level>i;--a){let s=o[a];KT(s,n)&&(i=s.level)}t=t.parent}return i}function cI(e,t,n){if(!t)return;let i,r=!1;for(i=0;i<n.length;++i)r=r||XW(t.extent,n[i]);if(!r)return;let o=t.rectangles;for(i=0;i<o.length;++i){let a=o[i];e[a.level]||(e[a.level]=n),e[a.level]=k3e(e[a.level],a)}cI(e,t._nw,n),cI(e,t._ne,n),cI(e,t._sw,n),cI(e,t._se,n)}function k3e(e,t){let n=[];for(let i=0;i<e.length;++i){let r=e[i];XW(r,t)?(r.west<t.west&&n.push(new ie(r.west,r.south,t.west,r.north)),r.east>t.east&&n.push(new ie(t.east,r.south,r.east,r.north)),r.south<t.south&&n.push(new ie(Math.max(t.west,r.west),r.south,Math.min(t.east,r.east),t.south)),r.north>t.north&&n.push(new ie(Math.max(t.west,r.west),t.north,Math.min(t.east,r.east),r.north))):n.push(r)}return n}var wm=$T;function z3e(e){let t,n=e.name,i=e.message;l(n)&&l(i)?t=`${n}: ${i}`:t=e.toString();let r=e.stack;return l(r)&&(t+=`
|
|
${r}`),t}var m0=z3e;function ZM(e,t,n,i,r,o,a){this.provider=e,this.message=t,this.x=n,this.y=i,this.level=r,this.timesRetried=o??0,this.retry=!1,this.error=a}ZM.reportError=function(e,t,n,i,r,o,a,s){let c=e;return l(e)?(c.provider=t,c.message=i,c.x=r,c.y=o,c.level=a,c.retry=!1,c.error=s,++c.timesRetried):c=new ZM(t,i,r,o,a,0,s),l(n)&&n.numberOfListeners>0?n.raiseEvent(c):l(t)&&console.log(`An error occurred in "${t.constructor.name}": ${m0(i)}`),c};ZM.reportSuccess=function(e){l(e)&&(e.timesRetried=-1)};var qr=ZM;var KW=new de,$W=new de,Pse=new h,Dse=new h,JW=class{constructor(t){at(this,"_rectangleSouthwestInMeters");at(this,"_rectangleNortheastInMeters");if(t=t??H.EMPTY_OBJECT,this._ellipsoid=t.ellipsoid??te.default,this._numberOfLevelZeroTilesX=t.numberOfLevelZeroTilesX??1,this._numberOfLevelZeroTilesY=t.numberOfLevelZeroTilesY??1,this._projection=new _i(this._ellipsoid),l(t.rectangleSouthwestInMeters)&&l(t.rectangleNortheastInMeters))this._rectangleSouthwestInMeters=t.rectangleSouthwestInMeters,this._rectangleNortheastInMeters=t.rectangleNortheastInMeters;else{let r=this._ellipsoid.maximumRadius*Math.PI;this._rectangleSouthwestInMeters=new k(-r,-r),this._rectangleNortheastInMeters=new k(r,r)}let{x:n,y:i}=this._rectangleSouthwestInMeters;h.fromElements(n,i,0,Pse),this._projection.unproject(Pse,KW),{x:n,y:i}=this._rectangleNortheastInMeters,h.fromElements(n,i,0,Dse),this._projection.unproject(Dse,$W),this._rectangle=new ie(KW.longitude,KW.latitude,$W.longitude,$W.latitude)}get ellipsoid(){return this._ellipsoid}get rectangle(){return this._rectangle}get projection(){return this._projection}getNumberOfXTilesAtLevel(t){return this._numberOfLevelZeroTilesX<<t}getNumberOfYTilesAtLevel(t){return this._numberOfLevelZeroTilesY<<t}rectangleToNativeRectangle(t,n){let i=this._projection,r=i.project(ie.southwest(t)),o=i.project(ie.northeast(t));return l(n)?(n.west=r.x,n.south=r.y,n.east=o.x,n.north=o.y,n):new ie(r.x,r.y,o.x,o.y)}tileXYToNativeRectangle(t,n,i,r){let o=this.getNumberOfXTilesAtLevel(i),a=this.getNumberOfYTilesAtLevel(i),s=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/o,c=this._rectangleSouthwestInMeters.x+t*s,u=this._rectangleSouthwestInMeters.x+(t+1)*s,f=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/a,d=this._rectangleNortheastInMeters.y-n*f,p=this._rectangleNortheastInMeters.y-(n+1)*f;return l(r)?(r.west=c,r.south=p,r.east=u,r.north=d,r):new ie(c,p,u,d)}tileXYToRectangle(t,n,i,r){let o=this.tileXYToNativeRectangle(t,n,i,r),a=this._projection,s=a.unproject(new h(o.west,o.south)),c=a.unproject(new h(o.east,o.north));return o.west=s.longitude,o.south=s.latitude,o.east=c.longitude,o.north=c.latitude,o}positionToTileXY(t,n,i){let r=this._rectangle;if(!ie.contains(r,t))return;let o=this.getNumberOfXTilesAtLevel(n),a=this.getNumberOfYTilesAtLevel(n),c=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/o,f=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/a,p=this._projection.project(t),g=p.x-this._rectangleSouthwestInMeters.x,m=this._rectangleNortheastInMeters.y-p.y,y=g/c|0;y>=o&&(y=o-1);let A=m/f|0;return A>=a&&(A=a-1),l(i)?(i.x=y,i.y=A,i):new k(y,A)}},So=JW;var U3e=15;function Rse(e){this.ellipsoid=e.ellipsoid??te.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}Rse.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 V3e(e,t){let n=t.copyrightText;l(n)&&(e.credit=new wt(n));let i=t.spatialReference,r=i.latestWkid??i.wkid,o=t.extent,a={ellipsoid:e.ellipsoid};if(r===4326)a.rectangle=ie.fromDegrees(o.xmin,o.ymin,o.xmax,o.ymax),e.tilingScheme=new $i(a);else if(r===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),a.rectangleSouthwestInMeters=new k(o.xmin,o.ymin),a.rectangleNortheastInMeters=new k(o.xmax,o.ymax),e.tilingScheme=new So(a)}else throw new oe("Invalid spatial reference");let s=t.tileInfo;if(!l(s))throw new oe("tileInfo is required");e.width=s.rows+1,e.height=s.cols+1,e.encoding=s.format==="LERC"?eh.LERC:eh.NONE,e.lodCount=s.lods.length-1,(e.hasAvailability=t.capabilities.indexOf("Tilemap")!==-1)&&(e.tilesAvailable=new wm(e.tilingScheme,e.lodCount),e.tilesAvailable.addAvailableTileRange(0,0,0,e.tilingScheme.getNumberOfXTilesAtLevel(0),e.tilingScheme.getNumberOfYTilesAtLevel(0)),e.tilesAvailabilityLoaded=new wm(e.tilingScheme,e.lodCount)),e.levelZeroMaximumGeometricError=Vr.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."),l(t.minValues)&&l(t.maxValues)?e.terrainDataStructure={elementMultiplier:1,lowestEncodedHeight:t.minValues[0],highestEncodedHeight:t.maxValues[0]}:e.terrainDataStructure={elementMultiplier:1}}async function j3e(e,t,n){try{let i=await t.fetchJson();V3e(e,i)}catch(i){let r=`An error occurred while accessing ${t}.`;throw qr.reportError(void 0,n,l(n)?n._errorEvent:void 0,r),i}}function c_(){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 be}Object.defineProperties(c_.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}}});c_.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT,e=await Promise.resolve(e);let n=De.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&(n=n.getDerivedResource({queryParameters:{token:t.token}}));let i=n.getDerivedResource({queryParameters:{f:"pjson"}}),r=new Rse(t);await j3e(r,i);let o=new c_(t);return r.build(o),o._resource=n,o};c_.prototype.requestTileGeometry=function(e,t,n,i){let r=this._resource.getDerivedResource({url:`tile/${n}/${t}/${e}`,request:i}),o=this._hasAvailability,a=Promise.resolve(!0),s;if(o&&!l(ZW(this,n+1,e*2,t*2))){let d=Ose(this,n+1,e*2,t*2);a=d.promise,s=d.request}let c=r.fetchArrayBuffer();if(!l(c)||!l(a))return;let u=this,f=this._tilesAvailable;return Promise.all([c,a]).then(function(d){return new Lc({buffer:d[0],width:u._width,height:u._height,childTileMask:o?f.computeChildMaskForTile(n,e,t):U3e,structure:u._terrainDataStructure,encoding:u._encoding})}).catch(async function(d){if(l(s)&&s.state===Ti.CANCELLED){i.cancel();try{await i.deferred?.promise}catch{}return i.state=Ti.CANCELLED,Promise.reject(d)}return Promise.reject(d)})};function ZW(e,t,n,i){if(!e._hasAvailability)return;let r=e._tilesAvailabilityLoaded,o=e._tilesAvailable;if(t>e._lodCount)return!1;if(o.isTileAvailable(t,n,i))return!0;if(r.isTileAvailable(t,n,i))return!1}c_.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};c_.prototype.getTileDataAvailable=function(e,t,n){if(!this._hasAvailability)return;let i=ZW(this,n,e,t);if(l(i))return i;Ose(this,n,e,t)};c_.prototype.loadTileDataAvailability=function(e,t,n){};function H3e(e,t,n,i){let r=t-1,o=n-1,a=i[e.y*t+e.x],s=[],c={startX:e.x,startY:e.y,endX:0,endY:0},u=new k(e.x+1,e.y+1),f=!1,d=!1;for(;!(f&&d);){let p=u.x,g=d?u.y+1:u.y;if(!f){for(let m=e.y;m<g;++m)if(i[m*t+u.x]!==a){f=!0;break}f?(s.push(new k(u.x,e.y)),--u.x,--p,c.endX=u.x):u.x===r?(c.endX=u.x,f=!0):++u.x}if(!d){let m=u.y*t;for(let y=e.x;y<=p;++y)if(i[m+y]!==a){d=!0;break}d?(s.push(new k(e.x,u.y)),--u.y,c.endY=u.y):u.y===o?(c.endY=u.y,d=!0):++u.y}}return{endingIndices:s,range:c,value:a}}function G3e(e,t,n,i,r){let o=[];if(r.every(function(c){return c===r[0]}))return r[0]===1&&o.push({startX:e,startY:t,endX:e+n-1,endY:t+i-1}),o;let s=[new k(0,0)];for(;s.length>0;){let c=s.pop(),u=H3e(c,n,i,r);if(u.value===1){let d=u.range;d.startX+=e,d.endX+=e,d.startY+=t,d.endY+=t,o.push(d)}let f=u.endingIndices;f.length>0&&(s=s.concat(f))}return o}function Ose(e,t,n,i){if(!e._hasAvailability)return{};let r=Math.floor(n/128)*128,o=Math.floor(i/128)*128,a=Math.min(1<<t,128),s=`tilemap/${t}/${o}/${r}/${a}/${a}`,c=e._availableCache;if(l(c[s]))return c[s];let u=new Eo({throttle:!1,throttleByServer:!0,type:Za.TERRAIN}),d=e._resource.getDerivedResource({url:s,request:u}).fetchJson();return l(d)?(d=d.then(function(p){let g=G3e(r,o,a,a,p.data);e._tilesAvailabilityLoaded.addAvailableTileRange(t,r,o,r+a,o+a);let m=e._tilesAvailable;for(let y=0;y<g.length;++y){let A=g[y];m.addAvailableTileRange(t,A.startX,A.startY,A.endX,A.endY)}return ZW(e,t,n,i)}),c[s]={promise:d,request:u},d=d.finally(function(p){return delete c[s],p}),{promise:d,request:u}):{}}var Mse=c_;var Lse={NONE:0,GEODESIC:1,RHUMB:2};Object.freeze(Lse);var sn=Lse;var Nse={XTRANSLATE:"xTranslate",YTRANSLATE:"yTranslate",ZTRANSLATE:"zTranslate",XROTATE:"xRotate",YROTATE:"yRotate",ZROTATE:"zRotate",XSCALE:"xScale",YSCALE:"yScale",ZSCALE:"zScale",UNIFORMSCALE:"uniformScale"};Object.freeze(Nse);var hl=Nse;var QW=class{constructor(){this._array=[],this._hash={}}get length(){return this._array.length}get values(){return this._array}contains(t){return l(this._hash[t])}set(t,n){let i=this._hash[t];n!==i&&(this.remove(t),this._hash[t]=n,this._array.push(n))}get(t){return this._hash[t]}remove(t){let n=this._hash[t],i=l(n);if(i){let r=this._array;r.splice(r.indexOf(n),1),delete this._hash[t]}return i}removeAll(){let t=this._array;t.length>0&&(this._hash={},t.length=0)}},zt=QW;var Fse="https://dev.virtualearth.net/REST/v1/Locations";function eq(e){e=e??H.EMPTY_OBJECT;let t=e.key;this._key=t;let n={key:t};l(e.culture)&&(n.culture=e.culture),this._resource=new De({url:Fse,queryParameters:n}),this._credit=new wt('<img src="http://dev.virtualearth.net/Branding/logo_powered_by.png"/>',!1)}Object.defineProperties(eq.prototype,{url:{get:function(){return Fse}},key:{get:function(){return this._key}},credit:{get:function(){return this._credit}}});eq.prototype.geocode=async function(e){return this._resource.getDerivedResource({queryParameters:{query:e}}).fetchJsonp("jsonp").then(function(n){return n.resourceSets.length===0?[]:n.resourceSets[0].resources.map(function(r){let o=r.bbox,a=o[0],s=o[1],c=o[2],u=o[3];return{displayName:r.name,destination:ie.fromDegrees(s,a,u,c)}})})};var Bse=eq;function Qo(e,t,n,i){this.x=e??0,this.y=t??0,this.width=n??0,this.height=i??0}Qo.packedLength=4;Qo.pack=function(e,t,n){return n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.width,t[n]=e.height,t};Qo.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Qo),n.x=e[t++],n.y=e[t++],n.width=e[t++],n.height=e[t],n};Qo.fromPoints=function(e,t){if(l(t)||(t=new Qo),!l(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,r=e[0].y,o=e[0].x,a=e[0].y;for(let s=1;s<n;s++){let c=e[s],u=c.x,f=c.y;i=Math.min(u,i),o=Math.max(u,o),r=Math.min(f,r),a=Math.max(f,a)}return t.x=i,t.y=r,t.width=o-i,t.height=a-r,t};var kse=new ki,W3e=new de,q3e=new de;Qo.fromRectangle=function(e,t,n){if(l(n)||(n=new Qo),!l(e))return n.x=0,n.y=0,n.width=0,n.height=0,n;kse._ellipsoid=te.default,t=t??kse;let i=t.project(ie.southwest(e,W3e)),r=t.project(ie.northeast(e,q3e));return k.subtract(r,i,r),n.x=i.x,n.y=i.y,n.width=r.x,n.height=r.y,n};Qo.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t):new Qo(e.x,e.y,e.width,e.height)};Qo.union=function(e,t,n){l(n)||(n=new Qo);let i=Math.min(e.x,t.x),r=Math.min(e.y,t.y),o=Math.max(e.x+e.width,t.x+t.width),a=Math.max(e.y+e.height,t.y+t.height);return n.x=i,n.y=r,n.width=o-i,n.height=a-r,n};Qo.expand=function(e,t,n){n=Qo.clone(e,n);let i=t.x-n.x,r=t.y-n.y;return i>n.width?n.width=i:i<0&&(n.width-=i,n.x=t.x),r>n.height?n.height=r:r<0&&(n.height-=r,n.y=t.y),n};Qo.intersect=function(e,t){let n=e.x,i=e.y,r=t.x,o=t.y;return n>r+t.width||n+e.width<r||i+e.height<o||i>o+t.height?Xt.OUTSIDE:Xt.INTERSECTING};Qo.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height};Qo.prototype.clone=function(e){return Qo.clone(this,e)};Qo.prototype.intersect=function(e){return Qo.intersect(this,e)};Qo.prototype.equals=function(e){return Qo.equals(this,e)};var Je=Qo;var zse={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};Object.freeze(zse);var nh=zse;var Gs={POINTS:ee.POINTS,LINES:ee.LINES,LINE_LOOP:ee.LINE_LOOP,LINE_STRIP:ee.LINE_STRIP,TRIANGLES:ee.TRIANGLES,TRIANGLE_STRIP:ee.TRIANGLE_STRIP,TRIANGLE_FAN:ee.TRIANGLE_FAN};Gs.isLines=function(e){return e===Gs.LINES||e===Gs.LINE_LOOP||e===Gs.LINE_STRIP};Gs.isTriangles=function(e){return e===Gs.TRIANGLES||e===Gs.TRIANGLE_STRIP||e===Gs.TRIANGLE_FAN};Gs.validate=function(e){return e===Gs.POINTS||e===Gs.LINES||e===Gs.LINE_LOOP||e===Gs.LINE_STRIP||e===Gs.TRIANGLES||e===Gs.TRIANGLE_STRIP||e===Gs.TRIANGLE_FAN};Object.freeze(Gs);var Re=Gs;function tq(e){e=e??H.EMPTY_OBJECT,this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=e.primitiveType??Re.TRIANGLES,this.boundingSphere=e.boundingSphere,this.geometryType=e.geometryType??nh.NONE,this.boundingSphereCV=e.boundingSphereCV,this.offsetAttribute=e.offsetAttribute}tq.computeNumberOfVertices=function(e){let t=-1;for(let n in e.attributes)if(e.attributes.hasOwnProperty(n)&&l(e.attributes[n])&&l(e.attributes[n].values)){let i=e.attributes[n];t=i.values.length/i.componentsPerAttribute}return t};var Y3e=new de,X3e=new h,Use=new O,K3e=[new de,new de,new de],$3e=[new k,new k,new k],J3e=[new k,new k,new k],Z3e=new h,Q3e=new Fe,eze=new O,tze=new Zi;tq._textureCoordinateRotationPoints=function(e,t,n,i){let r,o=ie.center(i,Y3e),a=de.toCartesian(o,n,X3e),s=mt.eastNorthUpToFixedFrame(a,n,Use),c=O.inverse(s,Use),u=$3e,f=K3e;f[0].longitude=i.west,f[0].latitude=i.south,f[1].longitude=i.west,f[1].latitude=i.north,f[2].longitude=i.east,f[2].latitude=i.south;let d=Z3e;for(r=0;r<3;r++)de.toCartesian(f[r],n,d),d=O.multiplyByPointAsVector(c,d,d),u[r].x=d.x,u[r].y=d.y;let p=Fe.fromAxisAngle(h.UNIT_Z,-t,Q3e),g=$.fromQuaternion(p,eze),m=e.length,y=Number.POSITIVE_INFINITY,A=Number.POSITIVE_INFINITY,b=Number.NEGATIVE_INFINITY,x=Number.NEGATIVE_INFINITY;for(r=0;r<m;r++)d=O.multiplyByPointAsVector(c,e[r],d),d=$.multiplyByVector(g,d,d),y=Math.min(y,d.x),A=Math.min(A,d.y),b=Math.max(b,d.x),x=Math.max(x,d.y);let T=Zi.fromRotation(t,tze),C=J3e;C[0].x=y,C[0].y=A,C[1].x=y,C[1].y=x,C[2].x=b,C[2].y=A;let E=u[0],w=u[2].x-E.x,D=u[1].y-E.y;for(r=0;r<3;r++){let v=C[r];Zi.multiplyByVector(T,v,v),v.x=(v.x-E.x)/w,v.y=(v.y-E.y)/D}let R=C[0],M=C[1],N=C[2],_=new Array(6);return k.pack(R,_),k.pack(M,_,2),k.pack(N,_,4),_};var Tt=tq;function nze(e){e=e??H.EMPTY_OBJECT,this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=e.normalize??!1,this.values=e.values}var Me=nze;function ize(e){e=e??H.EMPTY_OBJECT,this.position=e.position,this.normal=e.normal,this.st=e.st,this.bitangent=e.bitangent,this.tangent=e.tangent,this.color=e.color}var xn=ize;var Vse={NONE:0,TOP:1,ALL:2};Object.freeze(Vse);var mn=Vse;function Ba(e){e=e??H.EMPTY_OBJECT,this.position=e.position??!1,this.normal=e.normal??!1,this.st=e.st??!1,this.bitangent=e.bitangent??!1,this.tangent=e.tangent??!1,this.color=e.color??!1}Ba.POSITION_ONLY=Object.freeze(new Ba({position:!0}));Ba.POSITION_AND_NORMAL=Object.freeze(new Ba({position:!0,normal:!0}));Ba.POSITION_NORMAL_AND_ST=Object.freeze(new Ba({position:!0,normal:!0,st:!0}));Ba.POSITION_AND_ST=Object.freeze(new Ba({position:!0,st:!0}));Ba.POSITION_AND_COLOR=Object.freeze(new Ba({position:!0,color:!0}));Ba.ALL=Object.freeze(new Ba({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0}));Ba.DEFAULT=Ba.POSITION_NORMAL_AND_ST;Ba.packedLength=6;Ba.pack=function(e,t,n){return n=n??0,t[n++]=e.position?1:0,t[n++]=e.normal?1:0,t[n++]=e.st?1:0,t[n++]=e.tangent?1:0,t[n++]=e.bitangent?1:0,t[n]=e.color?1:0,t};Ba.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Ba),n.position=e[t++]===1,n.normal=e[t++]===1,n.st=e[t++]===1,n.tangent=e[t++]===1,n.bitangent=e[t++]===1,n.color=e[t]===1,n};Ba.clone=function(e,t){if(l(e))return l(t)||(t=new Ba),t.position=e.position,t.normal=e.normal,t.st=e.st,t.tangent=e.tangent,t.bitangent=e.bitangent,t.color=e.color,t};var Be=Ba;var rze=new h;function Gu(e){e=e??H.EMPTY_OBJECT;let t=e.minimum,n=e.maximum,i=e.vertexFormat??Be.DEFAULT;this._minimum=h.clone(t),this._maximum=h.clone(n),this._vertexFormat=i,this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxGeometry"}Gu.fromDimensions=function(e){e=e??H.EMPTY_OBJECT;let t=e.dimensions,n=h.multiplyByScalar(t,.5,new h);return new Gu({minimum:h.negate(n,new h),maximum:n,vertexFormat:e.vertexFormat,offsetAttribute:e.offsetAttribute})};Gu.fromAxisAlignedBoundingBox=function(e){return new Gu({minimum:e.minimum,maximum:e.maximum})};Gu.packedLength=2*h.packedLength+Be.packedLength+1;Gu.pack=function(e,t,n){return n=n??0,h.pack(e._minimum,t,n),h.pack(e._maximum,t,n+h.packedLength),Be.pack(e._vertexFormat,t,n+2*h.packedLength),t[n+2*h.packedLength+Be.packedLength]=e._offsetAttribute??-1,t};var Hse=new h,Gse=new h,Wse=new Be,jse={minimum:Hse,maximum:Gse,vertexFormat:Wse,offsetAttribute:void 0};Gu.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,Hse),r=h.unpack(e,t+h.packedLength,Gse),o=Be.unpack(e,t+2*h.packedLength,Wse),a=e[t+2*h.packedLength+Be.packedLength];return l(n)?(n._minimum=h.clone(i,n._minimum),n._maximum=h.clone(r,n._maximum),n._vertexFormat=Be.clone(o,n._vertexFormat),n._offsetAttribute=a===-1?void 0:a,n):(jse.offsetAttribute=a===-1?void 0:a,new Gu(jse))};Gu.createGeometry=function(e){let t=e._minimum,n=e._maximum,i=e._vertexFormat;if(h.equals(t,n))return;let r=new xn,o,a;if(i.position&&(i.st||i.normal||i.tangent||i.bitangent)){if(i.position&&(a=new Float64Array(72),a[0]=t.x,a[1]=t.y,a[2]=n.z,a[3]=n.x,a[4]=t.y,a[5]=n.z,a[6]=n.x,a[7]=n.y,a[8]=n.z,a[9]=t.x,a[10]=n.y,a[11]=n.z,a[12]=t.x,a[13]=t.y,a[14]=t.z,a[15]=n.x,a[16]=t.y,a[17]=t.z,a[18]=n.x,a[19]=n.y,a[20]=t.z,a[21]=t.x,a[22]=n.y,a[23]=t.z,a[24]=n.x,a[25]=t.y,a[26]=t.z,a[27]=n.x,a[28]=n.y,a[29]=t.z,a[30]=n.x,a[31]=n.y,a[32]=n.z,a[33]=n.x,a[34]=t.y,a[35]=n.z,a[36]=t.x,a[37]=t.y,a[38]=t.z,a[39]=t.x,a[40]=n.y,a[41]=t.z,a[42]=t.x,a[43]=n.y,a[44]=n.z,a[45]=t.x,a[46]=t.y,a[47]=n.z,a[48]=t.x,a[49]=n.y,a[50]=t.z,a[51]=n.x,a[52]=n.y,a[53]=t.z,a[54]=n.x,a[55]=n.y,a[56]=n.z,a[57]=t.x,a[58]=n.y,a[59]=n.z,a[60]=t.x,a[61]=t.y,a[62]=t.z,a[63]=n.x,a[64]=t.y,a[65]=t.z,a[66]=n.x,a[67]=t.y,a[68]=n.z,a[69]=t.x,a[70]=t.y,a[71]=n.z,r.position=new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:a})),i.normal){let u=new Float32Array(72);u[0]=0,u[1]=0,u[2]=1,u[3]=0,u[4]=0,u[5]=1,u[6]=0,u[7]=0,u[8]=1,u[9]=0,u[10]=0,u[11]=1,u[12]=0,u[13]=0,u[14]=-1,u[15]=0,u[16]=0,u[17]=-1,u[18]=0,u[19]=0,u[20]=-1,u[21]=0,u[22]=0,u[23]=-1,u[24]=1,u[25]=0,u[26]=0,u[27]=1,u[28]=0,u[29]=0,u[30]=1,u[31]=0,u[32]=0,u[33]=1,u[34]=0,u[35]=0,u[36]=-1,u[37]=0,u[38]=0,u[39]=-1,u[40]=0,u[41]=0,u[42]=-1,u[43]=0,u[44]=0,u[45]=-1,u[46]=0,u[47]=0,u[48]=0,u[49]=1,u[50]=0,u[51]=0,u[52]=1,u[53]=0,u[54]=0,u[55]=1,u[56]=0,u[57]=0,u[58]=1,u[59]=0,u[60]=0,u[61]=-1,u[62]=0,u[63]=0,u[64]=-1,u[65]=0,u[66]=0,u[67]=-1,u[68]=0,u[69]=0,u[70]=-1,u[71]=0,r.normal=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:u})}if(i.st){let u=new Float32Array(48);u[0]=0,u[1]=0,u[2]=1,u[3]=0,u[4]=1,u[5]=1,u[6]=0,u[7]=1,u[8]=1,u[9]=0,u[10]=0,u[11]=0,u[12]=0,u[13]=1,u[14]=1,u[15]=1,u[16]=0,u[17]=0,u[18]=1,u[19]=0,u[20]=1,u[21]=1,u[22]=0,u[23]=1,u[24]=1,u[25]=0,u[26]=0,u[27]=0,u[28]=0,u[29]=1,u[30]=1,u[31]=1,u[32]=1,u[33]=0,u[34]=0,u[35]=0,u[36]=0,u[37]=1,u[38]=1,u[39]=1,u[40]=0,u[41]=0,u[42]=1,u[43]=0,u[44]=1,u[45]=1,u[46]=0,u[47]=1,r.st=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:u})}if(i.tangent){let u=new Float32Array(72);u[0]=1,u[1]=0,u[2]=0,u[3]=1,u[4]=0,u[5]=0,u[6]=1,u[7]=0,u[8]=0,u[9]=1,u[10]=0,u[11]=0,u[12]=-1,u[13]=0,u[14]=0,u[15]=-1,u[16]=0,u[17]=0,u[18]=-1,u[19]=0,u[20]=0,u[21]=-1,u[22]=0,u[23]=0,u[24]=0,u[25]=1,u[26]=0,u[27]=0,u[28]=1,u[29]=0,u[30]=0,u[31]=1,u[32]=0,u[33]=0,u[34]=1,u[35]=0,u[36]=0,u[37]=-1,u[38]=0,u[39]=0,u[40]=-1,u[41]=0,u[42]=0,u[43]=-1,u[44]=0,u[45]=0,u[46]=-1,u[47]=0,u[48]=-1,u[49]=0,u[50]=0,u[51]=-1,u[52]=0,u[53]=0,u[54]=-1,u[55]=0,u[56]=0,u[57]=-1,u[58]=0,u[59]=0,u[60]=1,u[61]=0,u[62]=0,u[63]=1,u[64]=0,u[65]=0,u[66]=1,u[67]=0,u[68]=0,u[69]=1,u[70]=0,u[71]=0,r.tangent=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:u})}if(i.bitangent){let u=new Float32Array(72);u[0]=0,u[1]=1,u[2]=0,u[3]=0,u[4]=1,u[5]=0,u[6]=0,u[7]=1,u[8]=0,u[9]=0,u[10]=1,u[11]=0,u[12]=0,u[13]=1,u[14]=0,u[15]=0,u[16]=1,u[17]=0,u[18]=0,u[19]=1,u[20]=0,u[21]=0,u[22]=1,u[23]=0,u[24]=0,u[25]=0,u[26]=1,u[27]=0,u[28]=0,u[29]=1,u[30]=0,u[31]=0,u[32]=1,u[33]=0,u[34]=0,u[35]=1,u[36]=0,u[37]=0,u[38]=1,u[39]=0,u[40]=0,u[41]=1,u[42]=0,u[43]=0,u[44]=1,u[45]=0,u[46]=0,u[47]=1,u[48]=0,u[49]=0,u[50]=1,u[51]=0,u[52]=0,u[53]=1,u[54]=0,u[55]=0,u[56]=1,u[57]=0,u[58]=0,u[59]=1,u[60]=0,u[61]=0,u[62]=1,u[63]=0,u[64]=0,u[65]=1,u[66]=0,u[67]=0,u[68]=1,u[69]=0,u[70]=0,u[71]=1,r.bitangent=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:u})}o=new Uint16Array(36),o[0]=0,o[1]=1,o[2]=2,o[3]=0,o[4]=2,o[5]=3,o[6]=6,o[7]=5,o[8]=4,o[9]=7,o[10]=6,o[11]=4,o[12]=8,o[13]=9,o[14]=10,o[15]=8,o[16]=10,o[17]=11,o[18]=14,o[19]=13,o[20]=12,o[21]=15,o[22]=14,o[23]=12,o[24]=18,o[25]=17,o[26]=16,o[27]=19,o[28]=18,o[29]=16,o[30]=20,o[31]=21,o[32]=22,o[33]=20,o[34]=22,o[35]=23}else a=new Float64Array(24),a[0]=t.x,a[1]=t.y,a[2]=t.z,a[3]=n.x,a[4]=t.y,a[5]=t.z,a[6]=n.x,a[7]=n.y,a[8]=t.z,a[9]=t.x,a[10]=n.y,a[11]=t.z,a[12]=t.x,a[13]=t.y,a[14]=n.z,a[15]=n.x,a[16]=t.y,a[17]=n.z,a[18]=n.x,a[19]=n.y,a[20]=n.z,a[21]=t.x,a[22]=n.y,a[23]=n.z,r.position=new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:a}),o=new Uint16Array(36),o[0]=4,o[1]=5,o[2]=6,o[3]=4,o[4]=6,o[5]=7,o[6]=1,o[7]=0,o[8]=3,o[9]=1,o[10]=3,o[11]=2,o[12]=1,o[13]=6,o[14]=5,o[15]=1,o[16]=2,o[17]=6,o[18]=2,o[19]=3,o[20]=7,o[21]=2,o[22]=7,o[23]=6,o[24]=3,o[25]=0,o[26]=4,o[27]=3,o[28]=4,o[29]=7,o[30]=0,o[31]=1,o[32]=5,o[33]=0,o[34]=5,o[35]=4;let s=h.subtract(n,t,rze),c=h.magnitude(s)*.5;if(l(e._offsetAttribute)){let u=a.length,f=e._offsetAttribute===mn.NONE?0:1,d=new Uint8Array(u/3).fill(f);r.applyOffset=new Me({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}return new Tt({attributes:r,indices:o,primitiveType:Re.TRIANGLES,boundingSphere:new se(h.ZERO,c),offsetAttribute:e._offsetAttribute})};var nq;Gu.getUnitBox=function(){return l(nq)||(nq=Gu.createGeometry(Gu.fromDimensions({dimensions:new h(1,1,1),vertexFormat:Be.POSITION_ONLY}))),nq};var Nc=Gu;var oze=new h;function Im(e){e=e??H.EMPTY_OBJECT;let t=e.minimum,n=e.maximum;this._min=h.clone(t),this._max=h.clone(n),this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxOutlineGeometry"}Im.fromDimensions=function(e){e=e??H.EMPTY_OBJECT;let t=e.dimensions,n=h.multiplyByScalar(t,.5,new h);return new Im({minimum:h.negate(n,new h),maximum:n,offsetAttribute:e.offsetAttribute})};Im.fromAxisAlignedBoundingBox=function(e){return new Im({minimum:e.minimum,maximum:e.maximum})};Im.packedLength=2*h.packedLength+1;Im.pack=function(e,t,n){return n=n??0,h.pack(e._min,t,n),h.pack(e._max,t,n+h.packedLength),t[n+h.packedLength*2]=e._offsetAttribute??-1,t};var Yse=new h,Xse=new h,qse={minimum:Yse,maximum:Xse,offsetAttribute:void 0};Im.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,Yse),r=h.unpack(e,t+h.packedLength,Xse),o=e[t+h.packedLength*2];return l(n)?(n._min=h.clone(i,n._min),n._max=h.clone(r,n._max),n._offsetAttribute=o===-1?void 0:o,n):(qse.offsetAttribute=o===-1?void 0:o,new Im(qse))};Im.createGeometry=function(e){let t=e._min,n=e._max;if(h.equals(t,n))return;let i=new xn,r=new Uint16Array(24),o=new Float64Array(24);o[0]=t.x,o[1]=t.y,o[2]=t.z,o[3]=n.x,o[4]=t.y,o[5]=t.z,o[6]=n.x,o[7]=n.y,o[8]=t.z,o[9]=t.x,o[10]=n.y,o[11]=t.z,o[12]=t.x,o[13]=t.y,o[14]=n.z,o[15]=n.x,o[16]=t.y,o[17]=n.z,o[18]=n.x,o[19]=n.y,o[20]=n.z,o[21]=t.x,o[22]=n.y,o[23]=n.z,i.position=new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:o}),r[0]=4,r[1]=5,r[2]=5,r[3]=6,r[4]=6,r[5]=7,r[6]=7,r[7]=4,r[8]=0,r[9]=1,r[10]=1,r[11]=2,r[12]=2,r[13]=3,r[14]=3,r[15]=0,r[16]=0,r[17]=4,r[18]=1,r[19]=5,r[20]=2,r[21]=6,r[22]=3,r[23]=7;let a=h.subtract(n,t,oze),s=h.magnitude(a)*.5;if(l(e._offsetAttribute)){let c=o.length,u=e._offsetAttribute===mn.NONE?0:1,f=new Uint8Array(c/3).fill(u);i.applyOffset=new Me({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}return new Tt({attributes:i,indices:r,primitiveType:Re.LINES,boundingSphere:new se(h.ZERO,s),offsetAttribute:e._offsetAttribute})};var Pm=Im;function iq(){}Object.defineProperties(iq.prototype,{credit:{get:function(){}}});iq.prototype.geocode=function(e){let t=e.match(/[^\s,\n]+/g);if(t.length===2||t.length===3){let n=+t[0],i=+t[1],r=t.length===3?+t[2]:300;if(isNaN(n)&&isNaN(i)){let o=/^(\d+.?\d*)([nsew])/i;for(let a=0;a<t.length;++a){let s=t[a].match(o);o.test(t[a])&&s.length===3&&(/^[ns]/i.test(s[2])?i=/^[n]/i.test(s[2])?+s[1]:-s[1]:/^[ew]/i.test(s[2])&&(n=/^[e]/i.test(s[2])?+s[1]:-s[1]))}}if(!isNaN(n)&&!isNaN(i)&&!isNaN(r)){let o={displayName:e,destination:h.fromDegrees(n,i,r)};return Promise.resolve([o])}}return Promise.resolve([])};var Kse=iq;function JT(){this.times=void 0,this.points=void 0,pe.throwInstantiationError()}JT.getPointType=function(e){if(typeof e=="number")return Number;if(e instanceof h)return h;if(e instanceof Fe)return Fe};JT.prototype.evaluate=pe.throwInstantiationError;JT.prototype.findTimeInterval=function(e,t){let n=this.times,i=n.length;if(t=t??0,e>=n[t]){if(t+1<i&&e<n[t+1])return t;if(t+2<i&&e<n[t+2])return t+1}else if(t-1>=0&&e>=n[t-1])return t-1;let r;if(e>n[t])for(r=t;r<i-1&&!(e>=n[r]&&e<n[r+1]);++r);else for(r=t-1;r>=0&&!(e>=n[r]&&e<n[r+1]);--r);return r===i-1&&(r=i-2),r};JT.prototype.wrapTime=function(e){let t=this.times,n=t[t.length-1],i=t[0],r=n-i,o;return e<i&&(o=Math.floor((i-e)/r)+1,e+=o*r),e>n&&(o=Math.floor((e-n)/r)+1,e-=o*r),e};JT.prototype.clampTime=function(e){let t=this.times;return I.clamp(e,t[0],t[t.length-1])};var Er=JT;function ZT(e){e=e??H.EMPTY_OBJECT;let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=Er.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(ZT.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});ZT.prototype.findTimeInterval=Er.prototype.findTimeInterval;ZT.prototype.wrapTime=Er.prototype.wrapTime;ZT.prototype.clampTime=Er.prototype.clampTime;ZT.prototype.evaluate=function(e,t){let n=this.points,i=this.times,r=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),o=(e-i[r])/(i[r+1]-i[r]);return this._pointType===Number?(1-o)*n[r]+o*n[r+1]:(l(t)||(t=new h),h.lerp(n[r],n[r+1],o,t))};var qA=ZT;var $se={};$se.solve=function(e,t,n,i){let r=new Array(n.length),o=new Array(i.length),a=new Array(i.length),s;for(s=0;s<o.length;s++)o[s]=new h,a[s]=new h;r[0]=n[0]/t[0],o[0]=h.multiplyByScalar(i[0],1/t[0],o[0]);let c;for(s=1;s<r.length;++s)c=1/(t[s]-r[s-1]*e[s-1]),r[s]=n[s]*c,o[s]=h.subtract(i[s],h.multiplyByScalar(o[s-1],e[s-1],o[s]),o[s]),o[s]=h.multiplyByScalar(o[s],c,o[s]);for(c=1/(t[s]-r[s-1]*e[s-1]),o[s]=h.subtract(i[s],h.multiplyByScalar(o[s-1],e[s-1],o[s]),o[s]),o[s]=h.multiplyByScalar(o[s],c,o[s]),a[a.length-1]=o[o.length-1],s=a.length-2;s>=0;--s)a[s]=h.subtract(o[s],h.multiplyByScalar(a[s+1],r[s],a[s]),a[s]);return a};var lI=$se;var Jse=[],Zse=[],Qse=[],ece=[];function aze(e,t,n){let i=Jse,r=Qse,o=Zse,a=ece;i.length=r.length=e.length-1,o.length=a.length=e.length;let s;i[0]=o[0]=1,r[0]=0;let c=a[0];for(l(c)||(c=a[0]=new h),h.clone(t,c),s=1;s<i.length-1;++s)i[s]=r[s]=1,o[s]=4,c=a[s],l(c)||(c=a[s]=new h),h.subtract(e[s+1],e[s-1],c),h.multiplyByScalar(c,3,c);return i[s]=0,r[s]=1,o[s]=4,c=a[s],l(c)||(c=a[s]=new h),h.subtract(e[s+1],e[s-1],c),h.multiplyByScalar(c,3,c),o[s+1]=1,c=a[s+1],l(c)||(c=a[s+1]=new h),h.clone(n,c),lI.solve(i,o,r,a)}function sze(e){let t=Jse,n=Qse,i=Zse,r=ece;t.length=n.length=e.length-1,i.length=r.length=e.length;let o;t[0]=n[0]=1,i[0]=2;let a=r[0];for(l(a)||(a=r[0]=new h),h.subtract(e[1],e[0],a),h.multiplyByScalar(a,3,a),o=1;o<t.length;++o)t[o]=n[o]=1,i[o]=4,a=r[o],l(a)||(a=r[o]=new h),h.subtract(e[o+1],e[o-1],a),h.multiplyByScalar(a,3,a);return i[o]=2,a=r[o],l(a)||(a=r[o]=new h),h.subtract(e[o],e[o-1],a),h.multiplyByScalar(a,3,a),lI.solve(t,i,n,r)}function Jl(e){e=e??H.EMPTY_OBJECT;let t=e.points,n=e.times,i=e.inTangents,r=e.outTangents;this._times=n,this._points=t,this._pointType=Er.getPointType(t[0]),this._inTangents=i,this._outTangents=r,this._lastTimeIndex=0}Object.defineProperties(Jl.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},inTangents:{get:function(){return this._inTangents}},outTangents:{get:function(){return this._outTangents}}});Jl.createC1=function(e){e=e??H.EMPTY_OBJECT;let t=e.times,n=e.points,i=e.tangents,r=i.slice(0,i.length-1),o=i.slice(1,i.length);return new Jl({times:t,points:n,inTangents:o,outTangents:r})};Jl.createNaturalCubic=function(e){e=e??H.EMPTY_OBJECT;let t=e.times,n=e.points;if(n.length<3)return new qA({points:n,times:t});let i=sze(n),r=i.slice(0,i.length-1),o=i.slice(1,i.length);return new Jl({times:t,points:n,inTangents:o,outTangents:r})};Jl.createClampedCubic=function(e){e=e??H.EMPTY_OBJECT;let t=e.times,n=e.points,i=e.firstTangent,r=e.lastTangent,o=Er.getPointType(n[0]);if(n.length<3)return new qA({points:n,times:t});let a=aze(n,i,r),s=a.slice(0,a.length-1),c=a.slice(1,a.length);return new Jl({times:t,points:n,inTangents:c,outTangents:s})};Jl.hermiteCoefficientMatrix=new O(2,-3,0,1,-2,3,0,0,1,-2,1,0,1,-1,0,0);Jl.prototype.findTimeInterval=Er.prototype.findTimeInterval;var cze=new ae,QT=new h;Jl.prototype.wrapTime=Er.prototype.wrapTime;Jl.prototype.clampTime=Er.prototype.clampTime;Jl.prototype.evaluate=function(e,t){let n=this.points,i=this.times,r=this.inTangents,o=this.outTangents;this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex);let a=this._lastTimeIndex,s=i[a+1]-i[a],c=(e-i[a])/s,u=cze;u.z=c,u.y=c*c,u.x=u.y*c,u.w=1;let f=O.multiplyByVector(Jl.hermiteCoefficientMatrix,u,u);f.z*=s,f.w*=s;let d=this._pointType;return d===Number?n[a]*f.x+n[a+1]*f.y+o[a]*f.z+r[a]*f.w:(l(t)||(t=new d),t=d.multiplyByScalar(n[a],f.x,t),d.multiplyByScalar(n[a+1],f.y,QT),d.add(t,QT,t),d.multiplyByScalar(o[a],f.z,QT),d.add(t,QT,t),d.multiplyByScalar(r[a],f.w,QT),d.add(t,QT,t))};var YA=Jl;var lze=new ae,tce=new h,eC=new h;function uze(e){let t=e.points,n=e.times;if(t.length<3){let i=n[0],r=1/(n[1]-i),o=t[0],a=t[1];return function(s,c){l(c)||(c=new h);let u=(s-i)*r;return h.lerp(o,a,u,c)}}return function(i,r){l(r)||(r=new h);let o=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),a=(i-n[o])/(n[o+1]-n[o]),s=lze;s.z=a,s.y=a*a,s.x=s.y*a,s.w=1;let c,u,f,d,p;return o===0?(c=t[0],u=t[1],f=e.firstTangent,d=h.subtract(t[2],c,tce),h.multiplyByScalar(d,.5,d),p=O.multiplyByVector(YA.hermiteCoefficientMatrix,s,s)):o===t.length-2?(c=t[o],u=t[o+1],d=e.lastTangent,f=h.subtract(u,t[o-1],tce),h.multiplyByScalar(f,.5,f),p=O.multiplyByVector(YA.hermiteCoefficientMatrix,s,s)):(c=t[o-1],u=t[o],f=t[o+1],d=t[o+2],p=O.multiplyByVector(l_.catmullRomCoefficientMatrix,s,s)),r=h.multiplyByScalar(c,p.x,r),h.multiplyByScalar(u,p.y,eC),h.add(r,eC,r),h.multiplyByScalar(f,p.z,eC),h.add(r,eC,r),h.multiplyByScalar(d,p.w,eC),h.add(r,eC,r)}}var fze=new h,dze=new h;function l_(e){e=e??H.EMPTY_OBJECT;let t=e.points,n=e.times,i=e.firstTangent,r=e.lastTangent;if(t.length>2&&(l(i)||(i=fze,h.multiplyByScalar(t[1],2,i),h.subtract(i,t[2],i),h.subtract(i,t[0],i),h.multiplyByScalar(i,.5,i)),!l(r))){let o=t.length-1;r=dze,h.multiplyByScalar(t[o-1],2,r),h.subtract(t[o],r,r),h.add(r,t[o-2],r),h.multiplyByScalar(r,.5,r)}this._times=n,this._points=t,this._firstTangent=h.clone(i),this._lastTangent=h.clone(r),this._evaluateFunction=uze(this),this._lastTimeIndex=0}Object.defineProperties(l_.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}}});l_.catmullRomCoefficientMatrix=new O(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0);l_.prototype.findTimeInterval=Er.prototype.findTimeInterval;l_.prototype.wrapTime=Er.prototype.wrapTime;l_.prototype.clampTime=Er.prototype.clampTime;l_.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var nce=l_;var pWt=(function(){var e="b9H79Tebbbe9ok9Geueu9Geub9Gbb9Gruuuuuuueu9Gvuuuuueu9Gduueu9Gluuuueu9Gvuuuuub9Gouuuuuub9Gluuuub9GiuuueuiE8AdilveoveovrrwrrrDDoDrbqqbelve9Weiiviebeoweuecj:Gdkr:PlCo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8F9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWV9mW4W2be8A9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWVbd8F9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWV9c9V919U9KbiE9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949wWV79P9V9UblY9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWVbv8E9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWV9c9V919U9Kbo8A9TW79O9V9Wt9FW9U9J9V9KW69U9KW949wWV79P9V9UbrE9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JWbwa9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JW9c9V919U9KbDL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9p9JtbqK9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9r919HtbkL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWVT949WbxY9TW79O9V9Wt9FW9U9J9V9KWS9P2tWVJ9V29VVbmE9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OWbza9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OW9ttV9P9WbHa9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9WbOK9TW79O9V9Wt9F79W9Ht9P9H29t9VVt9sW9T9H9WbAl79IV9RbXDwebcekdKYq:zf8Adbk;wadhud9:8Jjjjjbc;qw9Rgr8KjjjjbcbhwdnaeTmbabcbyd;i:I:cjbaoaocb9iEgDc:GeV86bbarc;adfcbcjdz:xjjjb8AdnaiTmbarc;adfadalz:wjjjb8Akarc;abfalfcbcbcjdal9RalcFe0Ez:xjjjb8Aarc;abfarc;adfalz:wjjjb8Aar9cb83iUar9cb83i8War9cb83iyar9cb83iaar9cb83iKar9cb83izar9cb83iwar9cb83ibcj;abal9Uc;WFbGcjdalca0Ehqdnaicd6mbavcd9imbaDTmbadcefhkaqci2gxal2hmarc;alfclfhParc;qlfceVhsarc;qofclVhzcbhHincdhOcbhAdnavci6mbar9cb83i;Ooar9cb83i;Goar9cb83i;yoar9cb83i;qoadaHfgoybbhCcbhXincbhwcbhQdninaoalfhLaoybbgKaC7aQVhQawcP0meaLhoaKhCawcefgwaXfai6mbkkcbhCarc;qofhwincwhYcwh8AdnaQaC93gocFeGgEcs0mbclh8AaEci0mbcdcbaEEh8Akdnaocw4cFeGgEcs0mbclhYaEci0mbcdcbaEEhYkaYa8AfhEawydbh3cwhYcwh8Adnaocz4cFeGg5cs0mbclh8Aa5ci0mbcdcba5Eh8AkaEa3fhEdnaocFFFFb0mbclhYaocFFF8F0mbcbcdaocjjjw6EhYkawaEa8AfaYfBdbawclfhwaCcefgCcw9hmbkaLhoaKhCaXczfgXai6mbkcbhocehwazhQinawaoaQydbarc;qofaocdtfydb6EhoaQclfhQawcefgwcw9hmbkaoclthAcihOkcbhEarc;qlfcbcjdz:xjjjb8AarcbBd;ilar9cb83i;aladh8Eaqh8Fakh3inarc;qlfadaEaEcb9h9Ral2falz:wjjjb8Aaia8Faia8F6EhadnaqaiaE9RaEaqfai6EgKcsfc9WGgoaK9nmbarc;qofaKfcbaoaK9Rz:xjjjb8AkadaEal2fhhcbhginagaAVcl4hXarc;alfagcdtfh8JaHh8Kcbh8Lina8LaHfhwdndndndndndndnagPlbedibkaKTmvahawfhoarc;qlfawfRbbhQarc;qofhwaahCinawaoRbbgYaQ9RgQcetaQcKtc8F91786bbawcefhwaoalfhoaYhQaEaCcufgC9hmbxvkkaKTmla8Kc9:Ghoa8LcitcwGh8Aarc;qlfawceVfRbbcwtarc;qlfawc9:GfRbbVhQarc;qofhwaahCinawa3aofRbbcwta8EaofRbbVgYaQ9RgQcetaQcztc8F917cFFiGa8A486bbaoalfhoawcefhwaYhQaEaCcufgC9hmbxlkkasa8Kc98GgQfhoa3aQfhYarc;qlfawc98GgQfRbbhCcwhwinaoRbbawtaCVhCaocefhoawcwfgwca9hmbxdkkaKTmdxekaKTmea8Lcith5ahaQfh8AcbhLina8ARbbhQcwhoaYhwinawRbbaotaQVhQawcefhwaocwfgoca9hmbkarc;qofaLfaQaC7aX93a5486bbaYalfhYa8Aalfh8AaQhCaLcefgLaK9hmbkka8Jydbh8AcbhLarc;qofhoincdhQcbhwinaQaoawfRbbcb9hfhQawcefgwcz9hmbkclhCcbhwinaCaoawfRbbcd0fhCawcefgwcz9hmbkcwhYcbhwinaYaoawfRbbcP0fhYawcefgwcz9hmbkaQaCaQaC6EgwaYawaY6Egwczawcz6Ea8Afh8AaoczfhoaLczfgLaK6mbka8Ja8ABdbka8Kcefh8Ka8Lcefg8Lcl9hmbkagcefggaO9hmbka8Eamfh8Ea8Faxfh8Fa3amfh3aEaxfgEai6mbkcbhocehwaPhQinawaoaQydbarc;alfaocdtfydb6EhoaQclfhQaOawcefgw9hmbkaraHcd4faAcdVaoaocdSE86bbaHclfgHal6mbkkabaefhgabcefhoalcd4g8McbaDEhkadcefh8Narc;abfceVhecbhmdndninaiam9nmearc;qofcbcjdz:xjjjb8Aagao9Rak6mdadamal2gwfhxcbhHa8Nawfhzaocbakz:xjjjbg8Fakfh3aqaiam9Ramaqfai6Egscsfgocl4cifcd4hOaoc9WGg8JThPindndndndndndndndndndnaDTmbaraHcd4fRbbgQciGPlbedlbkasTmdaxaHfhoarc;abfaHfRbbhQarc;qofhwashCinawaoRbbgYaQ9RgQcetaQcKtc8F91786bbawcefhwaoalfhoaYhQaCcufgCmbxikkasTmiaHcitcwGh8Aarc;abfaHceVfRbbcwtarc;abfaHc9:GgofRbbVhQaxaofhoarc;qofhwashCinawao8VbbgYaQ9RgQcetaQcztc8F917cFFiGa8A486bbawcefhwaoalfhoaYhQaCcufgCmbxikkaeaHc98Gg8Afhoaza8AfhYarc;abfa8AfRbbhCcwhwinaoRbbawtaCVhCaocefhoawcwfgwca9hmbkasTmdaQcl4hKaHcitcKGhEaxa8Afh8AcbhLina8ARbbhQcwhoaYhwinawRbbaotaQVhQawcefhwaocwfgoca9hmbkarc;qofaLfaQaC7aK93aE486bbaYalfhYa8Aalfh8AaQhCaLcefgLas9hmbkkaDmbcbhoxlka8JTmbcbhodninarc;qofaofgwcwf8Pibaw8Pib:e9qTmeaoczfgoa8J9pmdxbkkdnavmbcehoxikcbh8AaOhLaOhKinarc;qofa8Afgocwf8Pibhyao8Pibh8PcdhQcbhwinaQaoawfRbbcb9hfhQawcefgwcz9hmbkclhCcbhwinaCaoawfRbbcd0fhCawcefgwcz9hmbkcwhYcbhwinaYaoawfRbbcP0fhYawcefgwcz9hmbkaQaCaQaC6EgoaYaoaY6Egoczaocz6EaKfhKaocucbaya8P:e9cb9sEgwaoaw6EaLfhLa8Aczfg8Aa8J9pmdxbkka8FaHcd4fgoaoRbbcdaHcetcoGtV86bbxikdnaLas6mbaKas6mba8FaHcd4fgoaoRbbciaHcetcoGtV86bbaga39Ras6mra3arc;qofasz:wjjjbasfh3xikaLaK9phoka8FaHcd4fgwawRbbaoaHcetcoGtV86bbkaga39RaO6mla3cbaOz:xjjjbgaaOfhKdndna8JmbaPhoxekdnagaK9RcK9pmbaPhoxekaocdtc:q:G:cjbfcj:G:cjbaDEg3ydxghcetc;:FFFeGhAcuhEcuahtcu7cFeGh8Ecbh8Karc;qofhQinarc;qofa8KfhXczh8AdndndnahPDbeeeeeeedekcucbaXcwf8PibaX8Pib:e9cb9sEh8AxekcbhoaAh8Aina8Aa8EaQaofRbb9nfh8Aaocefgocz9hmbkkcih5cbhYinczhwdndndna3aYcdtfydbgLPDbeeeeeeedekcucbaXcwf8PibaX8Pib:e9cb9sEhwxekaLcetc;:FFFeGhwcuaLtcu7cFeGhCcbhoinawaCaQaofRbb9nfhwaocefgocz9hmbkkdndnawa8A6mbaLaE9hmeawa8A9hmea3a5cdtfydbcwSmekaYh5awh8AkaYcefgYci9hmbkaaa8Kco4fgoaoRbba5a8Kci4coGtV86bbdndndna3a5cdtfydbgEPDdbbbbbbbebkdncwaE9Tg5TmbcuaEtcu7hwdndnaEceSmbcbh8LaQhXinaXhoa5hYcbhCinaoRbbg8AawcFeGgLa8AaL6EaCaEtVhCaocefhoaYcufgYmbkaKaC86bbaXa5fhXaKcefhKa8La5fg8Lcz6mbxdkkcbh8LaQhXinaXhoa5hYcbhCinaoRbbg8AawcFeGgLa8AaL6EaCcetVhCaocefhoaYcufgYmbkaKaC:T9cFe:d9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:9ca188bbaXa5fhXaKcefhKa8La5fg8Lcz6mbkkcbhoinaKaQaofRbbgC86bbaKaCawcFeG9pfhKaocefgocz9hmbxikkdnaEceSmbinaKcb86bbaKcefhKxbkkinaKcb86bbaKcefhKxbkkaKaX8Pbw83bwaKaX8Pbb83bbaKczfhKka8Kczfg8Ka8J9pgomeaQczfhQagaK9RcK9pmbkkaoTmlaKh3aKTmlkaHcefgHal9hmbkarc;abfaxascufal2falz:wjjjb8Aasamfhma3hoa3mbkcbhwxdkdnagao9RakalfgwcKcaaDEgQawaQ0EgC9pmbcbhwxdkdnawaQ9pmbaocbaCaw9Rgwz:xjjjbawfhokaoarc;adfalz:wjjjbalfhodnaDTmbaoara8Mz:wjjjba8Mfhokaoab9Rhwxekcbhwkarc;qwf8Kjjjjbawk5babaeadaialcdcbyd;i:I:cjbz:bjjjbk9reduaecd4gdaefgicaaica0Eabcj;abae9Uc;WFbGcjdaeca0Egifcufai9Uae2aiadfaicl4cifcd4f2fcefkmbcbabBd;i:I:cjbk;HPeLu8Jjjjjbc;ae9Rgl8Kjjjjbcbhvdnaeaici9UgocHf6mbabcbyd;m:I:cjbgrc;GeV86bbalc;abfcFecjez:xjjjb8Aal9cu83iUal9cu83i8Wal9cu83iyal9cu83iaal9cu83iKal9cu83izal9cu83iwal9cu83ibabaefc9WfhwabcefgDaofhednaiTmbcmcsarcb9kgqEhkcbhxcbhmcbhPcbhscbhzindnaeaw9nmbcbhvxikazcufhvadaPcdtfgHydbhOaHcwfydbhAaHclfydbhCcbhXdndndninalc;abfavcsGcitfgoydlhQdndndnaoydbgoaO9hmbaQaCSmekdnaoaC9hmbaQaA9hmbaXcefhXxekaoaA9hmeaQaO9hmeaXcdfhXkaXc870mdascufhvaHaXcdtgAcxGgoyd:4:G:cjbcdtfydbhQaHaoyd:0:G:cjbcdtfydbhCaHaoyd:W:G:cjbcdtfydbhOcbhodnindnalavcsGcdtfydbaQ9hmbaohXxdkcuhXavcufhvaocefgocz9hmbkkaxaQaxSgvaXce9iaXak9oVgoGfhxdndndncbcsavEaXaoEgvcs9hmbarce9imbaQaQamaQcefamSgvEgmcefSmecmcsavEhvkaDavaAc;WeGV86bbavcs9hmeaQam9Rgvcetavc8F917hvinaecbcjeavcje6EavcFbGV86bbaecefheavcr4gvmbkaQhmxvkcPhvaDaAcPV86bbaQhmkavTmiavak9omicdhocehXazhAxlkavcufhvaXclfgXc;ab9hmbkkdnaHcecdcbaAaxSEaCaxSEcdtgvyd:W:G:cjbcdtfydbgOTaHavyd:0:G:cjbcdtfydbgCceSGaHavyd:4:G:cjbcdtfydbgQcdSGaxcb9hGaqGgLce9hmbal9cu83iUal9cu83i8Wal9cu83iyal9cu83iaal9cu83iKal9cu83izal9cu83iwal9cu83ibcbhxkcbhXascufgvhodnindnalaocsGcdtfydbaC9hmbaXhAxdkcuhAaocufhoaXcefgXcz9hmbkkcbhodnindnalavcsGcdtfydbaQ9hmbaohXxdkcuhXavcufhvaocefgocz9hmbkkaxaOaxSgKfhHdndnaAcm0mbaAcefhAxekcbcsaCaHSgvEhAaHavfhHkdndnaXcm0mbaXcefhXxekcbcsaQaHSgvEhXaHavfhHkc9:cuaKEhYcbhvaXaAcltVg8AcFeGhodndndninavc;q:G:cjbfRbbaoSmeavcefgvcz9hmbxdkkaLaOax9havcm0VVmbaDavc;WeV86bbxekaDaY86bbaea8A86bbaecefhekdnaKmbaOam9Rgvcetavc8F917hvinaecbcjeavcje6EavcFbGV86bbaecefheavcr4gvmbkaOhmkdnaAcs9hmbaCam9Rgvcetavc8F917hvinaecbcjeavcje6EavcFbGV86bbaecefheavcr4gvmbkaChmkdnaXcs9hmbaQam9Rgvcetavc8F917hvinaecbcjeavcje6EavcFbGV86bbaecefheavcr4gvmbkaQhmkalascdtfaOBdbascefcsGhvdndnaAPzbeeeeeeeeeeeeeebekalavcdtfaCBdbascdfcsGhvkdndnaXPzbeeeeeeeeeeeeeebekalavcdtfaQBdbavcefcsGhvkcihoalc;abfazcitfgXaOBdlaXaCBdbazcefcsGhAcdhXavhsaHhxxekcdhoalascdtfaQBdbcehXascefcsGhsazhAkalc;abfaAcitfgvaCBdlavaQBdbalc;abfazaXfcsGcitfgvaQBdlavaOBdbaDcefhDazaofcsGhzaPcifgPai6mbkkdnaeaw9nmbcbhvxekcbhvinaeavfavc;q:G:cjbfRbb86bbavcefgvcz9hmbkaeab9Ravfhvkalc;aef8KjjjjbavkZeeucbhddninadcefgdc8F0meaeceadt0mbkkadcrfcFeGcr9Uci2cdfabci9U2cHfkmbcbabBd;m:I:cjbk:zderu8Jjjjjbcz9Rhlcbhvdnaeaicvf6mbabcbRb;m:I:cjbc;qeV86bbal9cb83iwabcefhvabaefc98fhodnaiTmbcbhecbhrcbhwindnavao6mbcbskadawcdtfydbgDalcwfaraDae9Rgeaec8F91ge7ae9Rc507grcdtfgqydb9Rgec8E91c9:Gaecdt7arVheinavcbcjeaecje6EaecFbGV86bbavcefhvaecr4gembkaqaDBdbaDheawcefgwai9hmbkkdnavao9nmbcbskavcbBbbavab9RclfhvkavkBeeucbhddninadcefgdc8F0meaeceadt0mbkkabadcwfcFeGcr9U2cvfk:dvli99dui99ludnaeTmbcuadcetcuftcu7:Zhvdndncuaicuftcu7:ZgoJbbbZMgr:lJbbb9p9DTmbar:Ohwxekcjjjj94hwkcbhicbhDinalclfIdbgrJbbbbJbbjZalIdbgq:lar:lMalcwfIdbgk:lMgr:varJbbbb9BEgrNhxaqarNhralcxfIdbhqdndnakJbbbb9GTmbaxhkxekJbbjZar:l:tgkak:maxJbbbb9GEhkJbbjZax:l:tgxax:marJbbbb9GEhrkdndnaqJbbj:;aqJbbj:;9GEgxJbbjZaxJbbjZ9FEavNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohmxekcjjjj94hmkdndnakJbbj:;akJbbj:;9GEgqJbbjZaqJbbjZ9FEaoNJbbbZJbbb:;akJbbbb9GEMgq:lJbbb9p9DTmbaq:OhPxekcjjjj94hPkdndnarJbbj:;arJbbj:;9GEgqJbbjZaqJbbjZ9FEaoNJbbbZJbbb:;arJbbbb9GEMgr:lJbbb9p9DTmbar:Ohsxekcjjjj94hskdndnadcl9hmbabaDfgzas86bbazcifam86bbazcdfaw86bbazcefaP86bbxekabaifgzas87ebazcofam87ebazclfaw87ebazcdfaP87ebkaicwfhiaDclfhDalczfhlaecufgembkkk;hlld99eud99eudnaeTmbdndncuaicuftcu7:ZgvJbbbZMgo:lJbbb9p9DTmbao:Ohixekcjjjj94hikaic;8FiGhrinabcofcicdalclfIdb:lalIdb:l9EgialcwfIdb:lalaicdtfIdb:l9EEgialcxfIdb:lalaicdtfIdb:l9EEgiarV87ebdndnJbbj:;JbbjZalaicdtfIdbJbbbb9DEgoalaicd7cdtfIdbJ;Zl:1ZNNgwJbbj:;awJbbj:;9GEgDJbbjZaDJbbjZ9FEavNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohqxekcjjjj94hqkabcdfaq87ebdndnalaicefciGcdtfIdbJ;Zl:1ZNaoNgwJbbj:;awJbbj:;9GEgDJbbjZaDJbbjZ9FEavNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohqxekcjjjj94hqkabaq87ebdndnaoalaicufciGcdtfIdbJ;Zl:1ZNNgoJbbj:;aoJbbj:;9GEgwJbbjZawJbbjZ9FEavNJbbbZJbbb:;aoJbbbb9GEMgo:lJbbb9p9DTmbao:Ohixekcjjjj94hikabclfai87ebabcwfhbalczfhlaecufgembkkk;gvdDue998Jjjjjbcjd9Rgo8Kjjjjbdndndnadcd4grTmbc:CucbavEhwaohdarhDinadawBdbadclfhdaDcufgDmbkavcd9hmbaeTmbarcdthqcbhkalhxinaohdaxhDarhwinadadydbgmaDydbcL4cFeGc:cufgPamaP9kEBdbaDclfhDadclfhdawcufgwmbkaxaqfhxakcefgkae9hmbxdkkaeTmekarcdthxavce9hhqcbhkindndndnaqmbarTmdc:CuhDalhdarhwinaDadydbcL4cFeGc:cufgmaDam9kEhDadclfhdawcufgwmbxdkkdndndndnavPleddbdkarTmlaohdalhDarhwinadcbaDydbcL4cFeGgmc:cufgPaPam0EBdbadclfhdaDclfhDawcufgwmbxikkarTmicbhdarhDindnaladfIdbgsJbbbb9Bmbaoadfas:8cL4cFeGgwc8Aawc8A0Ec:cufBdbkadclfhdaDcufgDmbxdkkarTmdkc:CuhDkcbhdarhminaDhwdnavceSmbaoadfydbhwkdndnaladfIdbgscjjj;8iawai9RcefgwcLt9R::NJbbbZJbbb:;asJbbbb9GEMgs:lJbbb9p9DTmbas:OhPxekcjjjj94hPkabadfaPcFFFrGawcKtVBdbadclfhdamcufgmmbkkabaxfhbalaxfhlakcefgkae9hmbkkaocjdf8Kjjjjbk:Olveue99iue99iudnaeTmbceaicufthvcuaitcu7:Zhocbhradcl9hhwcbhDindndnalcwfIdbgqJbbbbaqJbbbb9GEgqJbbjZaqJbbjZ9FEaoNJbbbZMgq:lJbbb9p9DTmbaq:Ohixekcjjjj94hikdndnalIdbgqJbbbbaqJbbbb9GEgqJbbjZaqJbbjZ9FEaoNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkadai9Rcd9TgkaifhidndnalclfIdbgqJbbbbaqJbbbb9GEgqJbbjZaqJbbjZ9FEaoNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkadai9Rcd9ThddndnalcxfIdbgqJbbbbaqJbbbb9GEgqJbbjZaqJbbjZ9FEaoNJbbbZMgq:lJbbb9p9DTmbaq:Ohxxekcjjjj94hxkadaifhiaxce91avVhxdndnawmbabaDfgmai86bbamcifax86bbamcdfad86bbamcefak86bbxekabarfgmai87ebamcofax87ebamclfad87ebamcdfak87ebkarcwfhraDclfhDalczfhlaecufgembkkk;mqdQui998Jjjjjbc:qd9Rgv8Kjjjjbavc:Sefcbc;Kbz:xjjjb8AdnadTmbaiTmbdndnabaeSmbaehoxekavcuadcdtgradcFFFFi0Ecbyd;q:I:cjbHjjjjbbgoBd:SeavceBd:mdaoaearz:wjjjb8AkavcbBd:Oeav9cb83i:Geavc:Gefaoadaiavc:Sefz:pjjjbavyd:Gehwadci9UgDcbyd;q:I:cjbHjjjjbbheavc:Sefavyd:mdgqcdtfaeBdbavaqcefgrBd:mdaecbaDz:xjjjbhkavc:SefarcdtfcuaicdtaicFFFFi0Ecbyd;q:I:cjbHjjjjbbgxBdbavaqcdfgmBd:mdalc;ebfhPawheaxhrinaralIdbaPaeydbgscwascw6EcdtfIdbMUdbaeclfhearclfhraicufgimbkavc:SefamcdtfcuaDcdtadcFFFF970Ecbyd;q:I:cjbHjjjjbbgmBdbdnadci6mbaoheamhraDhiinaraxaeydbcdtfIdbaxaeclfydbcdtfIdbMaxaecwfydbcdtfIdbMUdbaecxfhearclfhraicufgimbkkaqcifhzalc;ebfhHavc;qbfhOavheavyd:KehAavyd:OehCcbhscbhrcbhXcehQinaehLaoarcx2fgKydbhPaKclfydbhdabaXcx2fgecwfaKcwfydbgYBdbaeclfadBdbaeaPBdbakarfce86bbaOaYBdwaOadBdlaOaPBdbamarcdtfcbBdbcih8AdnasTmbaLhiinaOa8AcdtfaiydbgeBdba8AaeaY9haeaP9haead9hGGfh8AaiclfhiascufgsmbkkaXcefhXcbhsinaCaAaKascdtfydbcdtgifydbcdtfgYheawaifgdydbgPhidnaPTmbdninaeydbarSmeaeclfheaicufgiTmdxbkkaeaYaPcdtfc98fydbBdbadadydbcufBdbkascefgsci9hmbkdndndna8ATmbcuhrJbbbbhEcbhdavyd:KehYavyd:OehKindnawaOadcdtfydbcdtgsfydbgeTmbaxasfgiIdbh3aialcuadadcs0EcdtfclfIdbaHaecwaecw6EcdtfIdbMg5Udba5a3:th5aecdthiaKaYasfydbcdtfheinamaeydbgscdtfgPa5aPIdbMg3Udba3aEaEa39DgPEhEasaraPEhraeclfheaic98fgimbkkadcefgda8A9hmbkarcu9hmekaQaD9pmeindnakaQfRbbmbaQhrxdkaDaQcefgQ9hmbxdkka8Acza8Acz6EhsaOheaLhOarcu9hmekkazTmbaqcdtavc:Seffcwfheinaeydbcbyd;u:I:cjbH:bjjjbbaec98fheazcufgzmbkkavc:qdf8Kjjjjbk:0leoucuaicdtgvaicFFFFi0Egocbyd;q:I:cjbHjjjjbbhralalyd9GgwcdtfarBdbalawcefBd9GabarBdbaocbyd;q:I:cjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdlcuadcdtadcFFFFi0Ecbyd;q:I:cjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdwabydbcbavz:xjjjb8AabydbhraehladhvinaralydbcdtfgoaoydbcefBdbalclfhlavcufgvmbkcbhvabydlglhoarhwaihDinaoavBdbaoclfhoawydbavfhvawclfhwaDcufgDmbkadci9Uhqdnadcd9nmbabydwhocbhvinaecwfydbhwaeclfydbhDalaeydbcdtfgbabydbgbcefBdbaoabcdtfavBdbalaDcdtfgDaDydbgDcefBdbaoaDcdtfavBdbalawcdtfgwawydbgwcefBdbaoawcdtfavBdbaecxfheaqavcefgv9hmbkkinalalydbarydb9RBdbarclfhralclfhlaicufgimbkkQbabaeadaic;G:G:cjbz:ojjjbkQbabaeadaic;i:H:cjbz:ojjjbk9DeeuabcFeaicdtz:xjjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk:3vioud9:du8Jjjjjbc;Wa9Rgl8Kjjjjbcbhvalcxfcbc;Kbz:xjjjb8AalcuadcitgoadcFFFFe0Ecbyd;q:I:cjbHjjjjbbgrBdxalceBd2araeadaicezNjjjbalcuaoadcjjjjoGEcbyd;q:I:cjbHjjjjbbgwBdzadcdthednadTmbabhiinaiavBdbaiclfhiadavcefgv9hmbkkawaefhDalabBdwalawBdl9cbhqindnadTmbaq9cq9:hkarhvaDhiadheinaiav8Pibak1:NcFrG87ebavcwfhvaicdfhiaecufgembkkalclfaq:NceGcdtfydbhxalclfaq9ce98gq:NceGcdtfydbhmalc;Wbfcbcjaz:xjjjb8AaDhvadhidnadTmbinalc;Wbfav8VebcdtfgeaeydbcefBdbavcdfhvaicufgimbkkcbhvcbhiinalc;WbfavfgeydbhoaeaiBdbaoaifhiavclfgvcja9hmbkadhvdndnadTmbinalc;WbfaDamydbgicetf8VebcdtfgeaeydbgecefBdbaxaecdtfaiBdbamclfhmavcufgvmbkaq9cv9smdcbhvinabawydbcdtfavBdbawclfhwadavcefgv9hmbxdkkaq9cv9smekkcwhvcbhiinalcxfavfc98fydbcbyd;u:I:cjbH:bjjjbbaiceGheclhvcehiaeTmbkalc;Waf8Kjjjjbk:Awliuo99iud9:cbhv8Jjjjjbca9Rgocbyd:4:I:cjbBdKaocb8Pd:W:I:cjb83izaocbyd;e:I:cjbBdwaocb8Pd:8:I:cjb83ibaicd4hrdndnadmbJFFuFhwJFFuuhDJFFuuhqJFFuFhkJFFuuhxJFFuFhmxekarcdthPaehsincbhiinaoczfaifgzasaifIdbgwazIdbgDaDaw9EEUdbaoaifgzawazIdbgDaDaw9DEUdbaiclfgicx9hmbkasaPfhsavcefgvad9hmbkaoIdKhDaoIdwhwaoIdChqaoIdlhkaoIdzhxaoIdbhmkdnadTmbJbbbbJbFu9hJbbbbamax:tgmamJbbbb9DEgmakaq:tgkakam9DEgkawaD:tgwawak9DEgw:vawJbbbb9BEhwdnalmbarcdthoindndnaeclfIdbaq:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikai:S9cC:ghHdndnaeIdbax:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikaHai:S:ehHdndnaecwfIdbaD:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabaHai:T9cy:g:e83ibaeaofheabcwfhbadcufgdmbxdkkarcdthoindndnaeIdbax:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikai:SgH9ca:gaH9cz:g9cjjj;4s:d:eaH9cFe:d:e9cF:bj;4:pj;ar:d9c:bd9:9c:p;G:d;4j:E;ar:d9cH9:9c;d;H:W:y:m:g;d;Hb:d9cv9:9c;j:KM;j:KM;j:Kd:dhOdndnaeclfIdbaq:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikai:SgH9ca:gaH9cz:g9cjjj;4s:d:eaH9cFe:d:e9cF:bj;4:pj;ar:d9c:bd9:9c:p;G:d;4j:E;ar:d9cH9:9c;d;H:W:y:m:g;d;Hb:d9cq9:9cM;j:KM;j:KM;jl:daO:ehOdndnaecwfIdbaD:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabaOai:SgH9ca:gaH9cz:g9cjjj;4s:d:eaH9cFe:d:e9cF:bj;4:pj;ar:d9c:bd9:9c:p;G:d;4j:E;ar:d9cH9:9c;d;H:W:y:m:g;d;Hb:d9cC9:9c:KM;j:KM;j:KMD:d:e83ibaeaofheabcwfhbadcufgdmbkkk9teiucbcbyd;y:I:cjbgeabcifc98GfgbBd;y:I:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd;y:I:cjbgeabcrfc94GfgbBd;y:I:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikTeeucbabcbyd;y:I:cjbge9Rcifc98GaefgbBd;y:I:cjbdnabZbcztge9nmbabae9RcFFifcz4nb8Akkk;Sddbcj:Gdk;idbbbbdbbblbbbwbbbbbbbebbbdbbblbbbwbbbbbbbbbbbbbbbbbbbebbbdbbbbbbbebbbbbbbbbbbbbbbb4:h9w9N94:P:gW:j9O:ye9Pbbbbbb:l29hZ;69:9kZ;N;76Z;rg97Z;z;o9xZ8J;B85Z;:;u9yZ;b;k9HZ:2;Z9DZ9e:l9mZ59A8KZ:r;T3Z:A:zYZ79OHZ;j4::8::Y:D9V8:bbbb9s:49:Z8R:hBZ9M9M;M8:L;z;o8:;8:PG89q;x:J878R:hQ8::M:B;e87bbbbbbjZbbjZbbjZ:E;V;N8::Y:DsZ9i;H;68:xd;R8:;h0838:;W:NoZbbbb:WV9O8:uf888:9i;H;68:9c9G;L89;n;m9m89;D8Ko8:bbbbf:8tZ9m836ZS:2AZL;zPZZ818EZ9e:lxZ;U98F8:819E;68:FFuuFFuuFFuuFFuFFFuFFFuFbc;i:IdkCebbbebbbebbbdbbb9G:rbb",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(r(e),{}).then(function(g){n=g.instance,n.exports.__wasm_call_ctors(),n.exports.meshopt_encodeVertexVersion(1),n.exports.meshopt_encodeIndexVersion(1)});function r(g){for(var m=new Uint8Array(g.length),y=0;y<g.length;++y){var A=g.charCodeAt(y);m[y]=A>96?A-97:A>64?A-39:A+4}for(var b=0,y=0;y<g.length;++y)m[b++]=m[y]<60?t[m[y]]:(m[y]-60)*64+m[++y];return m.buffer.slice(0,b)}function o(g){if(!g)throw new Error("Assertion failed")}function a(g){return new Uint8Array(g.buffer,g.byteOffset,g.byteLength)}function s(g,m,y,A){var b=n.exports.sbrk,x=b(m.length*4),T=b(y*4),C=new Uint8Array(n.exports.memory.buffer),E=a(m);C.set(E,x),A&&A(x,x,m.length,y);var w=g(T,x,m.length,y);C=new Uint8Array(n.exports.memory.buffer);var D=new Uint32Array(y);new Uint8Array(D.buffer).set(C.subarray(T,T+y*4)),E.set(C.subarray(x,x+m.length*4)),b(x-b(0));for(var R=0;R<m.length;++R)m[R]=D[m[R]];return[D,w]}function c(g,m,y,A){var b=n.exports.sbrk,x=b(y*4),T=b(y*A),C=new Uint8Array(n.exports.memory.buffer);C.set(a(m),T),g(x,T,y,A),C=new Uint8Array(n.exports.memory.buffer);var E=new Uint32Array(y);return new Uint8Array(E.buffer).set(C.subarray(x,x+y*4)),b(x-b(0)),E}function u(g,m,y,A,b,x,T){var C=n.exports.sbrk,E=C(m),w=C(A*b),D=new Uint8Array(n.exports.memory.buffer);D.set(a(y),w);var R=g(E,m,w,A,b,x,T),M=new Uint8Array(R);return M.set(D.subarray(E,E+R)),C(E-C(0)),M}function f(g){for(var m=0,y=0;y<g.length;++y){var A=g[y];m=m<A?A:m}return m}function d(g,m){if(o(m==2||m==4),m==4)return new Uint32Array(g.buffer,g.byteOffset,g.byteLength/4);var y=new Uint16Array(g.buffer,g.byteOffset,g.byteLength/2);return new Uint32Array(y)}function p(g,m,y,A,b,x,T){var C=n.exports.sbrk,E=C(y*A),w=C(y*x),D=new Uint8Array(n.exports.memory.buffer);D.set(a(m),w),g(E,y,A,b,w,T);var R=new Uint8Array(y*A);return R.set(D.subarray(E,E+y*A)),C(E-C(0)),R}return{ready:i,supported:!0,reorderMesh:function(g,m,y){o(g instanceof Uint32Array||g instanceof Int32Array),o(!m||g.length%3==0);var A=m?y?n.exports.meshopt_optimizeVertexCacheStrip:n.exports.meshopt_optimizeVertexCache:void 0;return s(n.exports.meshopt_optimizeVertexFetchRemap,g,f(g)+1,A)},reorderPoints:function(g,m){return o(g instanceof Float32Array),o(g.length%m==0),o(m>=3),c(n.exports.meshopt_spatialSortRemap,g,g.length/m,m*4)},encodeVertexBuffer:function(g,m,y){o(y>0&&y<=256),o(y%4==0);var A=n.exports.meshopt_encodeVertexBufferBound(m,y);return u(n.exports.meshopt_encodeVertexBuffer,A,g,m,y)},encodeVertexBufferLevel:function(g,m,y,A,b){o(y>0&&y<=256),o(y%4==0),o(A>=0&&A<=3),o(b===void 0||b==0||b==1);var x=n.exports.meshopt_encodeVertexBufferBound(m,y);return u(n.exports.meshopt_encodeVertexBufferLevel,x,g,m,y,A,b===void 0?-1:b)},encodeIndexBuffer:function(g,m,y){o(y==2||y==4),o(m%3==0);var A=d(g,y),b=n.exports.meshopt_encodeIndexBufferBound(m,f(A)+1);return u(n.exports.meshopt_encodeIndexBuffer,b,A,m,4)},encodeIndexSequence:function(g,m,y){o(y==2||y==4);var A=d(g,y),b=n.exports.meshopt_encodeIndexSequenceBound(m,f(A)+1);return u(n.exports.meshopt_encodeIndexSequence,b,A,m,4)},encodeGltfBuffer:function(g,m,y,A,b){var x={ATTRIBUTES:this.encodeVertexBufferLevel,TRIANGLES:this.encodeIndexBuffer,INDICES:this.encodeIndexSequence};return o(x[A]),x[A](g,m,y,2,b===void 0?0:b)},encodeFilterOct:function(g,m,y,A){return o(y==4||y==8),o(A>=2&&A<=16),p(n.exports.meshopt_encodeFilterOct,g,m,y,A,16)},encodeFilterQuat:function(g,m,y,A){return o(y==8),o(A>=4&&A<=16),p(n.exports.meshopt_encodeFilterQuat,g,m,y,A,16)},encodeFilterExp:function(g,m,y,A,b){o(y>0&&y%4==0),o(A>=1&&A<=24);var x={Separate:0,SharedVector:1,SharedComponent:2,Clamped:3};return o(!b||b in x),p(n.exports.meshopt_encodeFilterExp,g,m,y,A,y,b?x[b]:1)},encodeFilterColor:function(g,m,y,A){return o(y==4||y==8),o(A>=2&&A<=16),p(n.exports.meshopt_encodeFilterColor,g,m,y,A,16)}}})();var u_=(function(){var e="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuixkbeeeddddillviebeoweuecj:Gdkr;Neqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949WboY9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVJ9V29VVbrl79IV9Rbwq1Zkdbk:kYi5ud9:du8Jjjjjbcjq9Rgv8Kjjjjbc9:hodnalTmbcuhoaiRbbgrc;WeGc:Ge9hmbarcsGgwce0mbc9:hoalcufadcd4cbawEgDadfgrcKcaawEgqaraq0Egk6mbaicefhxcj;abad9Uc;WFbGcjdadca0EhmaialfgPar9Rgoadfhsavaoadz:jjjjbgzceVhHcbhOdndninaeaO9nmeaPax9RaD6mdamaeaO9RaOamfgoae6EgAcsfglc9WGhCaAcethXaxaDfhiaOaeaoaeao6E9RhQalcl4cifcd4hLazcjdfaAfhKcbhYabaOad2fg8AhEaHh3incbh5dnawTmbaxaYcd4fRbbh5kcbh8Eazcjdfhqinaih8Fdndndndna5a8Ecet4ciGgoc9:fPdebdkaPa8F9RaA6mrazcjdfa8EaA2fa8FaAz:jjjjb8Aa8FaAfhixdkazcjdfa8EaA2fcbaAz:kjjjb8Aa8FhixekaPa8F9RaL6mva8FaLfhidnaCTmbaPai9RcK6mbaocdtc:q:G:cjbfcj:G:cjbawEhaczhrcbhlinargoc9Wfghaqfhrdndndndndndnaaa8Fahco4fRbbalcoG4ciGcdtfydbPDbedvivvvlvkar9cb83bwar9cb83bbxlkarcbaiRbdai8Xbb9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:gg9cjjjjjz:dg8J9qE86bbaqaofgrcGfcbaicdfa8J9c8N1:NfghRbbag9cjjjjjw:dg8J9qE86bbarcVfcbaha8J9c8M1:NfghRbbag9cjjjjjl:dg8J9qE86bbarc7fcbaha8J9c8L1:NfghRbbag9cjjjjjd:dg8J9qE86bbarctfcbaha8J9c8K1:NfghRbbag9cjjjjje:dg8J9qE86bbarc91fcbaha8J9c8J1:NfghRbbag9cjjjj;ab:dg8J9qE86bbarc4fcbaha8J9cg1:NfghRbbag9cjjjja:dg8J9qE86bbarc93fcbaha8J9ch1:NfghRbbag9cjjjjz:dgg9qE86bbarc94fcbahag9ca1:NfghRbbai8Xbe9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:gg9cjjjjjz:dg8J9qE86bbarc95fcbaha8J9c8N1:NfgiRbbag9cjjjjjw:dg8J9qE86bbarc96fcbaia8J9c8M1:NfgiRbbag9cjjjjjl:dg8J9qE86bbarc97fcbaia8J9c8L1:NfgiRbbag9cjjjjjd:dg8J9qE86bbarc98fcbaia8J9c8K1:NfgiRbbag9cjjjjje:dg8J9qE86bbarc99fcbaia8J9c8J1:NfgiRbbag9cjjjj;ab:dg8J9qE86bbarc9:fcbaia8J9cg1:NfgiRbbag9cjjjja:dg8J9qE86bbarcufcbaia8J9ch1:NfgiRbbag9cjjjjz:dgg9qE86bbaiag9ca1:NfhixikaraiRblaiRbbghco4g8Ka8KciSg8KE86bbaqaofgrcGfaiclfa8Kfg8KRbbahcl4ciGg8La8LciSg8LE86bbarcVfa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc7fa8Ka8Lfg8KRbbahciGghahciSghE86bbarctfa8Kahfg8KRbbaiRbeghco4g8La8LciSg8LE86bbarc91fa8Ka8Lfg8KRbbahcl4ciGg8La8LciSg8LE86bbarc4fa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc93fa8Ka8Lfg8KRbbahciGghahciSghE86bbarc94fa8Kahfg8KRbbaiRbdghco4g8La8LciSg8LE86bbarc95fa8Ka8Lfg8KRbbahcl4ciGg8La8LciSg8LE86bbarc96fa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc97fa8Ka8Lfg8KRbbahciGghahciSghE86bbarc98fa8KahfghRbbaiRbigico4g8Ka8KciSg8KE86bbarc99faha8KfghRbbaicl4ciGg8Ka8KciSg8KE86bbarc9:faha8KfghRbbaicd4ciGg8Ka8KciSg8KE86bbarcufaha8KfgrRbbaiciGgiaiciSgiE86bbaraifhixdkaraiRbwaiRbbghcl4g8Ka8KcsSg8KE86bbaqaofgrcGfaicwfa8Kfg8KRbbahcsGghahcsSghE86bbarcVfa8KahfghRbbaiRbeg8Kcl4g8La8LcsSg8LE86bbarc7faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarctfaha8KfghRbbaiRbdg8Kcl4g8La8LcsSg8LE86bbarc91faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc4faha8KfghRbbaiRbig8Kcl4g8La8LcsSg8LE86bbarc93faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc94faha8KfghRbbaiRblg8Kcl4g8La8LcsSg8LE86bbarc95faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc96faha8KfghRbbaiRbvg8Kcl4g8La8LcsSg8LE86bbarc97faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc98faha8KfghRbbaiRbog8Kcl4g8La8LcsSg8LE86bbarc99faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc9:faha8KfghRbbaiRbrgicl4g8Ka8KcsSg8KE86bbarcufaha8KfgrRbbaicsGgiaicsSgiE86bbaraifhixekarai8Pbw83bwarai8Pbb83bbaiczfhikdnaoaC9pmbalcdfhlaoczfhraPai9RcL0mekkaoaC6moaimexokaCmva8FTmvkaqaAfhqa8Ecefg8Ecl9hmbkdndndndnawTmbasaYcd4fRbbgociGPlbedrbkaATmdazaYfh8Fazcjdfhhcbh8EaEhaina8FRbbhraahocbhlinaoahalfRbbgqce4cbaqceG9R7arfgr86bbaoadfhoaAalcefgl9hmbkaacefhaa8Fcefh8FahaAfhha8Ecefg8Ecl9hmbxikkaATmeazaYfhaazcjdfhhcbhoceh8EaKh8FinaEaofhlaa8Vbbhrcbhoinala8FaofRbbcwtahaofRbbgqVc;:FiGce4cbaqceG9R7arfgr87bbaladfhlaQaocefgofmbka8FaXfh8FcdhoaacdfhaahaXfhha8EceGhlcbh8EalmbxdkkaATmbaocl4h8EazaYfRbbhqcwhoa3hlinalRbbaotaqVhqalcefhlaocwfgoca9hmbkcbhhaEh8FaKhainazcjdfahfRbbhrcwhoaahlinalRbbaotarVhralaAfhlaocwfgoca9hmbkara8E94aq7hqcbhoa8Fhlinalaqao486bbalcefhlaocwfgoca9hmbka8Fadfh8FaacefhaahcefghaA9hmbkkaEclfhEa3clfh3aYclfgYad6mbkaza8AaAcufad2fadz:jjjjb8AaAaOfhOaihxaimbkc9:hoxdkcbc99aPax9RakSEhoxekc9:hokavcjqf8Kjjjjbaok:ysezu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnalaeci9UgrcHf6mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecjez:kjjjb8Aav9cu83iUav9cu83i8Wav9cu83iyav9cu83iaav9cu83iKav9cu83izav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhldnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhoindnalaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfaoaDcu7gPcl4fcsGcitfgsydlhzasydbhHdndnaDcsGgsak9pmbavaiaPfcsGcdtfydbaxasEhDaxasTgOfhxxekdndnascsSmbcehOasc987asamffcefhDxekalcefhDal8SbbgscFeGhPdndnascu9mmbaDhlxekalcvfhlaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhlkcehOaPce4cbaPceG9R7amfhDkaDhmkavc;abfaocitfgsaDBdbasazBdlavaicdtfaDBdbavc;abfaocefcsGcitfgsaHBdbasaDBdlaocdfhoaOaifhidnadcd9hmbabarcetfgsaH87ebasclfaD87ebascdfaz87ebxdkabarcdtfgsaHBdbascwfaDBdbasclfazBdbxekdnaDcpe0mbavaiaqaDcsGfRbbgscl4gP9RcsGcdtfydbaxcefgOaPEhDavaias9RcsGcdtfydbaOaPTgzfgOascsGgPEhsaPThPdndnadcd9hmbabarcetfgHax87ebaHclfas87ebaHcdfaD87ebxekabarcdtfgHaxBdbaHcwfasBdbaHclfaDBdbkavaicdtfaxBdbavc;abfaocitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfaocefcsGcitfgHasBdbaHaDBdlavaiazfgicsGcdtfasBdbavc;abfaocdfcsGcitfgDaxBdbaDasBdlaocifhoaiaPfhiaOaPfhxxekaxcbalRbbgsEgHaDc;:eSgDfhOascsGhAdndnascl4gCmbaOcefhzxekaOhzavaiaC9RcsGcdtfydbhOkdndnaAmbazcefhxxekazhxavaias9RcsGcdtfydbhzkdndnaDTmbalcefhDxekalcdfhDal8SbegPcFeGhsdnaPcu9kmbalcofhHascFbGhscrhldninaD8SbbgPcFbGaltasVhsaPcu9kmeaDcefhDalcrfglc8J9hmbkaHhDxekaDcefhDkasce4cbasceG9R7amfgmhHkdndnaCcsSmbaDhsxekaDcefhsaD8SbbglcFeGhPdnalcu9kmbaDcvfhOaPcFbGhPcrhldninas8SbbgDcFbGaltaPVhPaDcu9kmeascefhsalcrfglc8J9hmbkaOhsxekascefhskaPce4cbaPceG9R7amfgmhOkdndnaAcsSmbashlxekascefhlas8SbbgDcFeGhPdnaDcu9kmbascvfhzaPcFbGhPcrhDdninal8SbbgscFbGaDtaPVhPascu9kmealcefhlaDcrfgDc8J9hmbkazhlxekalcefhlkaPce4cbaPceG9R7amfgmhzkdndnadcd9hmbabarcetfgDaH87ebaDclfaz87ebaDcdfaO87ebxekabarcdtfgDaHBdbaDcwfazBdbaDclfaOBdbkavc;abfaocitfgDaOBdbaDaHBdlavaicdtfaHBdbavc;abfaocefcsGcitfgDazBdbaDaOBdlavaicefgicsGcdtfaOBdbavc;abfaocdfcsGcitfgDaHBdbaDazBdlavaiaCTaCcsSVfgicsGcdtfazBdbaiaATaAcsSVfhiaocifhokawcefhwaocsGhoaicsGhiarcifgrae6mbkkcbc99alaqSEhokavc;aef8Kjjjjbaok:clevu8Jjjjjbcz9Rhvdnalaecvf9pmbc9:skdnaiRbbc;:eGc;qeSmbcuskav9cb83iwaicefhoaialfc98fhrdnaeTmbdnadcdSmbcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcdtfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgiBdbalaiBdbawcefgwae9hmbxdkkcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcetfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgi87ebalaiBdbawcefgwae9hmbkkcbc99aoarSEk: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:4ioiue99dud99dud99dnaeTmbcbhiabhlindndnal8Uebgv:YgoJ:ji:1Salcof8UebgrciVgw:Y:vgDNJbbbZJbbb:;avcu9kEMgq:lJbbb9p9DTmbaq:Ohkxekcjjjj94hkkalclf8Uebhvalcdf8UebhxalarcefciGcetfak87ebdndnax:YgqaDNJbbbZJbbb:;axcu9kEMgm:lJbbb9p9DTmbam:Ohxxekcjjjj94hxkabaiarciGgkfcd7cetfax87ebdndnav:YgmaDNJbbbZJbbb:;avcu9kEMgP:lJbbb9p9DTmbaP:Ohvxekcjjjj94hvkalarcufciGcetfav87ebdndnawaw2:ZgPaPMaoaoN:taqaqN:tamamN:tgoJbbbbaoJbbbb9GE:raDNJbbbZMgD:lJbbb9p9DTmbaD:Ohrxekcjjjj94hrkalakcetfar87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj98Gcjjj;8if::NUdbabclfhbadcufgdmbkkk:Tvirud99eudndnadcl9hmbaeTmeindndnabRbbgiabcefgl8Sbbgvabcdfgo8Sbbgrf9R:YJbbuJabcifgwRbbgdce4adVgDcd4aDVgDcl4aDVgD:Z:vgqNJbbbZMgk:lJbbb9p9DTmbak:Ohxxekcjjjj94hxkaoax86bbdndnaraif:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohoxekcjjjj94hokalao86bbdndnavaifar9R:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabai86bbdndnaDadcetGadceGV:ZaqNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkawad86bbabclfhbaecufgembxdkkaeTmbindndnab8Vebgiabcdfgl8Uebgvabclfgo8Uebgrf9R:YJbFu9habcofgw8Vebgdce4adVgDcd4aDVgDcl4aDVgDcw4aDVgD:Z:vgqNJbbbZMgk:lJbbb9p9DTmbak:Ohxxekcjjjj94hxkaoax87ebdndnaraif:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohoxekcjjjj94hokalao87ebdndnavaifar9R:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabai87ebdndnaDadcetGadceGV:ZaqNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkawad87ebabcwfhbaecufgembkkk9teiucbcbyd:K:G:cjbgeabcifc98GfgbBd:K:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkk83dbcj:Gdk8Kbbbbdbbblbbbwbbbbbbbebbbdbbblbbbwbbbbc:K:Gdkl8W:qbb",t="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuixkbbebeeddddilve9Weeeviebeoweuecj:Gdkr;Neqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949WbwY9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVJ9V29VVbDl79IV9Rbqq:59Dklbzik94evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaeai86b:q:W:cjbaecitab8Piw83i:q:G:cjbaecefgecjd9hmbkk:SBlEud97dur978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnalTmbcuhoaiRbbgrc;WeGc:Ge9hmbarcsGgwce0mbc9:hoalcufadcd4cbawEgDadfgrcKcaawEgqaraq0Egk6mbaialfgxar9RhodnadTgmmbavaoad;8qbbkaicefhPcj;abad9Uc;WFbGcjdadca0EhsdndndnadTmbaoadfhzcbhHinaeaH9nmdaxaP9RaD6miabaHad2fgOavcjdfasaeaH9RaHasfae6EgAaAcsfgoc9WGgCSEhXaPaDfhQaocl4cifcd4hLavcj;cbfaCcetfhKavcj;cbfaCci2fhYavcj;cbfaCfh8AcbhEaoc;ab6h3incbh5dnawTmbaPaEcd4fRbbh5kcbh8Eavcj;cbfh8Findndndndna5a8Ecet4ciGgoc9:fPdebdkaxaQ9RaC6mwdnaCTmbavcj;cbfa8EaC2faQaC;8qbbkaQaAfhQxdkaCTmeavcj;cbfa8EaC2fcbaC;8kbxekaxaQ9RaL6moaoclVcbawEhraQaLfhocbhidna3mbaxao9Rc;Gb6mbcbhlina8FalfhidndndndndndnaQalco4fRbbgqciGarfPDbedibledibkaipxbbbbbbbbbbbbbbbbpklbxlkaiaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaoclffa8JRb:q:W:cjbfhoxikaiaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaocwffa8JRb:q:W:cjbfhoxdkaiaopbbbpklbaoczfhoxekaiaopbbdaoRbbggcitpbi:q:G:cjbagRb:q:W:cjbggpsaoRbeg8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbagaocdffa8JRb:q:W:cjbfhokdndndndndndnaqcd4ciGarfPDbedibledibkaiczfpxbbbbbbbbbbbbbbbbpklbxlkaiczfaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaoclffa8JRb:q:W:cjbfhoxikaiczfaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaocwffa8JRb:q:W:cjbfhoxdkaiczfaopbbbpklbaoczfhoxekaiczfaopbbdaoRbbggcitpbi:q:G:cjbagRb:q:W:cjbggpsaoRbeg8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbagaocdffa8JRb:q:W:cjbfhokdndndndndndnaqcl4ciGarfPDbedibledibkaicafpxbbbbbbbbbbbbbbbbpklbxlkaicafaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaoclffa8JRb:q:W:cjbfhoxikaicafaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaocwffa8JRb:q:W:cjbfhoxdkaicafaopbbbpklbaoczfhoxekaicafaopbbdaoRbbggcitpbi:q:G:cjbagRb:q:W:cjbggpsaoRbeg8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbagaocdffa8JRb:q:W:cjbfhokdndndndndndnaqco4arfPDbedibledibkaic8Wfpxbbbbbbbbbbbbbbbbpklbxlkaic8Wfaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Ngicitpbi:q:G:cjbaiRb:q:W:cjbgipsaap5e9cjF;8;4;W;G;ab9:9cU1:Ngqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbaiaoclffaqRb:q:W:cjbfhoxikaic8Wfaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Ngicitpbi:q:G:cjbaiRb:q:W:cjbgipsaap5e9cjF;8;4;W;G;ab9:9cU1:Ngqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbaiaocwffaqRb:q:W:cjbfhoxdkaic8Wfaopbbbpklbaoczfhoxekaic8WfaopbbdaoRbbgicitpbi:q:G:cjbaiRb:q:W:cjbgipsaoRbegqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbaiaocdffaqRb:q:W:cjbfhokalc;abfhialcjefaC0meaihlaxao9Rc;Fb0mbkkdnaiaC9pmbaici4hlinaxao9RcK6mwa8FaifhqdndndndndndnaQaico4fRbbalcoG4ciGarfPDbedibledibkaqpxbbbbbbbbbbbbbbbbpkbbxlkaqaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spkbbagaoclffa8JRb:q:W:cjbfhoxikaqaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spkbbagaocwffa8JRb:q:W:cjbfhoxdkaqaopbbbpkbbaoczfhoxekaqaopbbdaoRbbggcitpbi:q:G:cjbagRb:q:W:cjbggpsaoRbeg8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpkbbagaocdffa8JRb:q:W:cjbfhokalcdfhlaiczfgiaC6mbkkaohQaoTmoka8FaCfh8Fa8Ecefg8Ecl9hmbkdndndndnawTmbazaEcd4fRbbglciGPlbedwbkaCTmdaXaEfhlavaEfpbdbh8Kcbhoinalavcj;cbfaofpblbg8La8Aaofpblbg8MpmbzeHdOiAlCvXoQrLg8NaKaofpblbgyaYaofpblbg8PpmbzeHdOiAlCvXoQrLgIpmbezHdiOAlvCXorQLgacep9Taapxeeeeeeeeeeeeeeeeghp9op9Hp9rgaa8Kp9Ug8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp9Ug8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp9Ug8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp9Ug8Kp9Abbbaladfgla8Ka8NaIpmwDKYqk8AExm35Ps8E8Fgacep9Taaahp9op9Hp9rgap9Ug8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp9Ug8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp9Ug8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp9Ug8Kp9Abbbaladfgla8Ka8La8MpmwKDYq8AkEx3m5P8Es8Fg8Laya8PpmwKDYq8AkEx3m5P8Es8Fg8MpmbezHdiOAlvCXorQLgacep9Taaahp9op9Hp9rgap9Ug8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp9Ug8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp9Ug8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp9Ug8Kp9Abbbaladfgla8Ka8La8MpmwDKYqk8AExm35Ps8E8Fgacep9Taaahp9op9Hp9rgap9Ughp9Abbbaladfglahaaaapmlvorlvorlvorlvorp9Ughp9AbbbaladfglahaaaapmwDqkwDqkwDqkwDqkp9Ughp9AbbbaladfglahaaaapmxmPsxmPsxmPsxmPsp9Ug8Kp9AbbbaladfhlaoczfgoaC6mbxikkaCTmeaXaEfhlavaEfpbdbh8Kcbhoinalavcj;cbfaofpblbg8La8Aaofpblbg8MpmbzeHdOiAlCvXoQrLg8NaKaofpblbgyaYaofpblbg8PpmbzeHdOiAlCvXoQrLgIpmbezHdiOAlvCXorQLgacep:neaapxebebebebebebebebghp9op:bep9rgaa8Kp:oeg8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp:oeg8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp:oeg8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9Abbbaladfgla8Ka8NaIpmwDKYqk8AExm35Ps8E8Fgacep:neaaahp9op:bep9rgap:oeg8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp:oeg8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp:oeg8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9Abbbaladfgla8Ka8La8MpmwKDYq8AkEx3m5P8Es8Fg8Laya8PpmwKDYq8AkEx3m5P8Es8Fg8MpmbezHdiOAlvCXorQLgacep:neaaahp9op:bep9rgap:oeg8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp:oeg8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp:oeg8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9Abbbaladfgla8Ka8La8MpmwDKYqk8AExm35Ps8E8Fgacep:neaaahp9op:bep9rgap:oeghp9Abbbaladfglahaaaapmlvorlvorlvorlvorp:oeghp9AbbbaladfglahaaaapmwDqkwDqkwDqkwDqkp:oeghp9AbbbaladfglahaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9AbbbaladfhlaoczfgoaC6mbxdkkaCTmbaXaEfhrcbhocbalcl4gl9Rc8FGhiavaEfpbdbhhinaravcj;cbfaofpblbg8Ka8Aaofpblbg8LpmbzeHdOiAlCvXoQrLg8MaKaofpblbg8NaYaofpblbgypmbzeHdOiAlCvXoQrLg8PpmbezHdiOAlvCXorQLgaaip:Reaaalp:Tep9qgaahp9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9Abbbaradfgraha8Ma8PpmwDKYqk8AExm35Ps8E8Fgaaip:Reaaalp:Tep9qgap9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9Abbbaradfgraha8Ka8LpmwKDYq8AkEx3m5P8Es8Fg8Ka8NaypmwKDYq8AkEx3m5P8Es8Fg8LpmbezHdiOAlvCXorQLgaaip:Reaaalp:Tep9qgap9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9Abbbaradfgraha8Ka8LpmwDKYqk8AExm35Ps8E8Fgaaip:Reaaalp:Tep9qgap9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9AbbbaradfhraoczfgoaC6mbkkaEclfgEad6mbkdnaXavcjdf9hmbaAad2goTmbaOavcjdfao;8qbbkdnammbavaXaAcufad2fad;8qbbkaAaHfhHc9:hoaQhPaQmbxlkkaeTmbaDalfhrcbhocuhlinaralaD9RglfaD6mdasaeao9Raoasfae6Eaofgoae6mbkaial9RhPkcbc99axaP9RakSEhoxekc9:hokavcj;kbf8Kjjjjbaokwbz:bjjjbkNsezu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnalaeci9UgrcHf6mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecje;8kbav9cu83iUav9cu83i8Wav9cu83iyav9cu83iaav9cu83iKav9cu83izav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhldnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhoindnalaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfaoaDcu7gPcl4fcsGcitfgsydlhzasydbhHdndnaDcsGgsak9pmbavaiaPfcsGcdtfydbaxasEhDaxasTgOfhxxekdndnascsSmbcehOasc987asamffcefhDxekalcefhDal8SbbgscFeGhPdndnascu9mmbaDhlxekalcvfhlaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhlkcehOaPce4cbaPceG9R7amfhDkaDhmkavc;abfaocitfgsaDBdbasazBdlavaicdtfaDBdbavc;abfaocefcsGcitfgsaHBdbasaDBdlaocdfhoaOaifhidnadcd9hmbabarcetfgsaH87ebasclfaD87ebascdfaz87ebxdkabarcdtfgsaHBdbascwfaDBdbasclfazBdbxekdnaDcpe0mbavaiaqaDcsGfRbbgscl4gP9RcsGcdtfydbaxcefgOaPEhDavaias9RcsGcdtfydbaOaPTgzfgOascsGgPEhsaPThPdndnadcd9hmbabarcetfgHax87ebaHclfas87ebaHcdfaD87ebxekabarcdtfgHaxBdbaHcwfasBdbaHclfaDBdbkavaicdtfaxBdbavc;abfaocitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfaocefcsGcitfgHasBdbaHaDBdlavaiazfgicsGcdtfasBdbavc;abfaocdfcsGcitfgDaxBdbaDasBdlaocifhoaiaPfhiaOaPfhxxekaxcbalRbbgsEgHaDc;:eSgDfhOascsGhAdndnascl4gCmbaOcefhzxekaOhzavaiaC9RcsGcdtfydbhOkdndnaAmbazcefhxxekazhxavaias9RcsGcdtfydbhzkdndnaDTmbalcefhDxekalcdfhDal8SbegPcFeGhsdnaPcu9kmbalcofhHascFbGhscrhldninaD8SbbgPcFbGaltasVhsaPcu9kmeaDcefhDalcrfglc8J9hmbkaHhDxekaDcefhDkasce4cbasceG9R7amfgmhHkdndnaCcsSmbaDhsxekaDcefhsaD8SbbglcFeGhPdnalcu9kmbaDcvfhOaPcFbGhPcrhldninas8SbbgDcFbGaltaPVhPaDcu9kmeascefhsalcrfglc8J9hmbkaOhsxekascefhskaPce4cbaPceG9R7amfgmhOkdndnaAcsSmbashlxekascefhlas8SbbgDcFeGhPdnaDcu9kmbascvfhzaPcFbGhPcrhDdninal8SbbgscFbGaDtaPVhPascu9kmealcefhlaDcrfgDc8J9hmbkazhlxekalcefhlkaPce4cbaPceG9R7amfgmhzkdndnadcd9hmbabarcetfgDaH87ebaDclfaz87ebaDcdfaO87ebxekabarcdtfgDaHBdbaDcwfazBdbaDclfaOBdbkavc;abfaocitfgDaOBdbaDaHBdlavaicdtfaHBdbavc;abfaocefcsGcitfgDazBdbaDaOBdlavaicefgicsGcdtfaOBdbavc;abfaocdfcsGcitfgDaHBdbaDazBdlavaiaCTaCcsSVfgicsGcdtfazBdbaiaATaAcsSVfhiaocifhokawcefhwaocsGhoaicsGhiarcifgrae6mbkkcbc99alaqSEhokavc;aef8Kjjjjbaok:clevu8Jjjjjbcz9Rhvdnalaecvf9pmbc9:skdnaiRbbc;:eGc;qeSmbcuskav9cb83iwaicefhoaialfc98fhrdnaeTmbdnadcdSmbcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcdtfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgiBdbalaiBdbawcefgwae9hmbxdkkcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcetfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgi87ebalaiBdbawcefgwae9hmbkkcbc99aoarSEk;Toio97eue97aec98Ghedndnadcl9hmbaeTmecbhdinababpbbbgicKp:RecKp:Sep;6eglaicwp:RecKp:Sep;6ealp;Geaiczp:RecKp:Sep;6egvp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egralpxbbbjbbbjbbbjbbbjgwp9op9rp;Keglpxbb;:9cbb;:9cbb;:9cbb;:9calalp;Meaoaop;Meavaravawp9op9rp;Keglalp;Mep;Kep;Kep;Jep;Negvp;Mepxbbn0bbn0bbn0bbn0grp;KepxFbbbFbbbFbbbFbbbp9oaipxbbbFbbbFbbbFbbbFp9op9qalavp;Mearp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaoavp;Mearp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbabczfhbadclfgdae6mbxdkkaeTmbcbhdinabczfgDaDpbbbgipxbbbbbbFFbbbbbbFFgwp9oabpbbbgoaipmbediwDqkzHOAKY8AEgvczp:Reczp:Sep;6eglaoaipmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eavczp:Sep;6egvp;Gealp;Gep;Kep;Legipxbbbbbbbbbbbbbbbbp:2egralpxbbbjbbbjbbbjbbbjgqp9op9rp;Keglpxb;:FSb;:FSb;:FSb;:FSalalp;Meaiaip;Meavaravaqp9op9rp;Keglalp;Mep;Kep;Kep;Jep;Negvp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbp9oaiavp;Mearp;Keczp:Rep9qgialavp;Mearp;KepxFFbbFFbbFFbbFFbbp9oglpmwDKYqk8AExm35Ps8E8Fp9qpkbbabaoawp9oaialpmbezHdiOAlvCXorQLp9qpkbbabcafhbadclfgdae6mbkkk;2ileue97euo97dnaec98GgiTmbcbheinabcKfpx:ji:1S:ji:1S:ji:1S:ji:1SabpbbbglabczfgvpbbbgopmlvorxmPsCXQL358E8Fgrczp:Segwpxibbbibbbibbbibbbp9qp;6egDp;NegqaDaDp;MegDaDp;KealaopmbediwDqkzHOAKY8AEgDczp:Reczp:Sep;6eglalp;MeaDczp:Sep;6egoaop;Mearczp:Reczp:Sep;6egrarp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jep;Mepxbbn0bbn0bbn0bbn0gDp;KepxFFbbFFbbFFbbFFbbgkp9oaqaop;MeaDp;Keczp:Rep9qgoaqalp;MeaDp;Keakp9oaqarp;MeaDp;Keczp:Rep9qgDpmwDKYqk8AExm35Ps8E8Fglp5eawclp:RegqpEi:T:j83ibavalp5baqpEd:T:j83ibabcwfaoaDpmbezHdiOAlvCXorQLgDp5eaqpEe:T:j83ibabaDp5baqpEb:T:j83ibabcafhbaeclfgeai6mbkkkuee97dnadcd4ae2c98GgeTmbcbhdinababpbbbgicwp:Recwp:Sep;6eaicep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepkbbabczfhbadclfgdae6mbkkk:Sodw97euaec98Ghedndnadcl9hmbaeTmecbhdinabpxbbuJbbuJbbuJbbuJabpbbbgicKp:TeglaicYp:Tep9qgvcdp:Teavp9qgvclp:Teavp9qgop;6ep;Negvaicwp:RecKp:SegraipxFbbbFbbbFbbbFbbbgwp9ogDp:Uep;6ep;Mepxbbn0bbn0bbn0bbn0gqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9oavaDarp:Xeaiczp:RecKp:Segip:Uep;6ep;Meaqp;Keawp9op9qavaDaraip:Uep:Xep;6ep;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qavaoalcep:Rep9oalpxebbbebbbebbbebbbp9op9qp;6ep;Meaqp;KecKp:Rep9qpkbbabczfhbadclfgdae6mbxdkkaeTmbcbhdinabczfgkpxbFu9hbFu9hbFu9hbFu9habpbbbglakpbbbgrpmlvorxmPsCXQL358E8Fgvczp:TegqavcHp:Tep9qgicdp:Teaip9qgiclp:Teaip9qgicwp:Teaip9qgop;6ep;NegialarpmbediwDqkzHOAKY8AEgDpxFFbbFFbbFFbbFFbbglp9ograDczp:Segwp:Ueavczp:Reczp:SegDp:Xep;6ep;Mepxbbn0bbn0bbn0bbn0gvp;Kealp9oaiarawaDp:Uep:Xep;6ep;Meavp;Keczp:Rep9qgwaiaoaqcep:Rep9oaqpxebbbebbbebbbebbbp9op9qp;6ep;Meavp;Keczp:ReaiaDarp:Uep;6ep;Meavp;Kealp9op9qgipmwDKYqk8AExm35Ps8E8FpkbbabawaipmbezHdiOAlvCXorQLpkbbabcafhbadclfgdae6mbkkk9teiucbcbydj:G:cjbgeabcifc98GfgbBdj:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkxebcj:Gdklz:zbb",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 r=WebAssembly.validate(n)?s(t):s(e),o,a=WebAssembly.instantiate(r,{}).then(function(b){o=b.instance,o.exports.__wasm_call_ctors()});function s(b){for(var x=new Uint8Array(b.length),T=0;T<b.length;++T){var C=b.charCodeAt(T);x[T]=C>96?C-97:C>64?C-39:C+4}for(var E=0,T=0;T<b.length;++T)x[E++]=x[T]<60?i[x[T]]:(x[T]-60)*64+x[++T];return x.buffer.slice(0,E)}function c(b,x,T,C,E,w,D){var R=b.exports.sbrk,M=C+3&-4,N=R(M*E),_=R(w.length),v=new Uint8Array(b.exports.memory.buffer);v.set(w,_);var S=x(N,C,E,_,w.length);if(S==0&&D&&D(N,M,E),T.set(v.subarray(N,N+C*E)),R(N-R(0)),S!=0)throw new Error("Malformed buffer data: "+S)}var u={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp",COLOR:"meshopt_decodeFilterColor"},f={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},d=[],p=0;function g(b){var x={object:new Worker(b),pending:0,requests:{}};return x.object.onmessage=function(T){var C=T.data;x.pending-=C.count,x.requests[C.id][C.action](C.value),delete x.requests[C.id]},x}function m(b){for(var x="self.ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(r)+"]), {}).then(function(result) { result.instance.exports.__wasm_call_ctors(); return result.instance; });self.onmessage = "+A.name+";"+c.toString()+A.toString(),T=new Blob([x],{type:"text/javascript"}),C=URL.createObjectURL(T),E=d.length;E<b;++E)d[E]=g(C);for(var E=b;E<d.length;++E)d[E].object.postMessage({});d.length=b,URL.revokeObjectURL(C)}function y(b,x,T,C,E){for(var w=d[0],D=1;D<d.length;++D)d[D].pending<w.pending&&(w=d[D]);return new Promise(function(R,M){var N=new Uint8Array(T),_=++p;w.pending+=b,w.requests[_]={resolve:R,reject:M},w.object.postMessage({id:_,count:b,size:x,source:N,mode:C,filter:E},[N.buffer])})}function A(b){var x=b.data;self.ready.then(function(T){if(!x.id)return self.close();try{var C=new Uint8Array(x.count*x.size);c(T,T.exports[x.mode],C,x.count,x.size,x.source,T.exports[x.filter]),self.postMessage({id:x.id,count:x.count,action:"resolve",value:C},[C.buffer])}catch(E){self.postMessage({id:x.id,count:x.count,action:"reject",value:E})}})}return{ready:a,supported:!0,useWorkers:function(b){m(b)},decodeVertexBuffer:function(b,x,T,C,E){c(o,o.exports.meshopt_decodeVertexBuffer,b,x,T,C,o.exports[u[E]])},decodeIndexBuffer:function(b,x,T,C){c(o,o.exports.meshopt_decodeIndexBuffer,b,x,T,C)},decodeIndexSequence:function(b,x,T,C){c(o,o.exports.meshopt_decodeIndexSequence,b,x,T,C)},decodeGltfBuffer:function(b,x,T,C,E,w){c(o,o.exports[f[E]],b,x,T,C,o.exports[u[w]])},decodeGltfBufferAsync:function(b,x,T,C,E){return d.length>0?y(b,x,T,f[C],u[E]):a.then(function(){var w=new Uint8Array(b*x);return c(o,o.exports[f[C]],w,b,x,T,o.exports[u[E]]),w})}}})();var yWt=(function(){var e="b9H79Tebbbe:6eO9Geueu9Geub9Gbb9Gsuuuuuuuuuuuu99uueu9Gvuuuuub9Gruuuuuuub9Gouuuuuue999Gvuuuuueu9Gzuuuuuuuuuuu99uuuub9Gquuuuuuu99uueu9GPuuuuuuuuuuu99uueu9Gquuuuuuuu99ueu9Gruuuuuu99eu9Gwuuuuuu99ueu9Giuuue999Gluuuueu9Gluuuub9GiuuueuiLQdilvorlwDiqkxmPszbHHbelve9Weiiviebeoweuecj:Gdkr:Bdxo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bbz9TW79O9V9Wt9F79P9T9W29P9M95bw8E9TW79O9V9Wt9F79P9T9W29P9M959x9Pt9OcttV9P9I91tW7bD8A9TW79O9V9Wt9F79P9T9W29P9M959x9Pt9O9v9W9K9HtWbqQ9TW79O9V9Wt9F79P9T9W29P9M959t29V9W9W95bkX9TW79O9V9Wt9F79P9T9W29P9M959qV919UWbxQ9TW79O9V9Wt9F79P9T9W29P9M959q9V9P9Ut7bmX9TW79O9V9Wt9F79P9T9W29P9M959t9J9H2WbPa9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9Wbs59TW79O9V9Wt9F9NW9UWV9HtW9q9V79Pt9P9V9U9sW9T9H9Wbzl79IV9RbHDwebcekdCXq;y;WeQdbk;r:herYue99iuY99Xue9:D998Jjjjjbcj;sb9Rgs8Kjjjjbcbhzasc:Cefcbc;Kbz:tjjjb8AdnabaeSmbabaeadcdtzMjjjb8AkdnamcdGTmbalcrfci4cbyd1:H:cjbHjjjjbbhHasc:Cefasyd;8egecdtfaHBdbasaecefBd;8ecbhlcbhednadTmbabheadhOinaHaeydbci4fcb86bbaeclfheaOcufgOmbkcbhlabheadhOinaHaeydbgAci4fgCaCRbbgCceaAcrGgAtV86bbaCcu7aA4ceGalfhlaeclfheaOcufgOmbkcualcdtalcFFFFi0Ehekaecbyd1:H:cjbHjjjjbbhzasc:Cefasyd;8egecdtfazBdbasaecefBd;8ealcd4alfhOcehHinaHgecethHaeaO6mbkcbhXcuaecdtgOaecFFFFi0Ecbyd1:H:cjbHjjjjbbhHasc:Cefasyd;8egAcdtfaHBdbasaAcefBd;8eaHcFeaOz:tjjjbhQdnadTmbaecufhLcbhKindndnaQabaKcdtfgYydbgAc:v;t;h;Ev2aLGgOcdtfgCydbgHcuSmbceheinazaHcdtfydbaASmdaOaefhHaecefheaQaHaLGgOcdtfgCydbgHcu9hmbkkazaXcdtfaABdbaCaXBdbaXhHaXcefhXkaYaHBdbaKcefgKad9hmbkkaQcbyd:m:H:cjbH:bjjjbbasasyd;8ecufBd;8ekcbh8AcualcefgecdtaecFFFFi0Ecbyd1:H:cjbHjjjjbbhLasc:Cefasyd;8egecdtfaLBdbasaLBdNeasaecefBd;8ecuadcitadcFFFFe0Ecbyd1:H:cjbHjjjjbbhEasc:Cefasyd;8egecdtfaEBdbasaEBd:yeasaecefBd;8eascNefabadalcbz:cjjjbcualcdtgealcFFFFi0Eg3cbyd1:H:cjbHjjjjbbhOasc:Cefasyd;8egHcdtfaOBdbasaHcefBd;8ea3cbyd1:H:cjbHjjjjbbhQasc:Cefasyd;8egHcdtfaQBdbasaHcefBd;8eaOaQaialavazasc:Cefz:djjjbalcbyd1:H:cjbHjjjjbbhYasc:Cefasyd;8egHcdtfaYBdbasaHcefBd;8ea3cbyd1:H:cjbHjjjjbbhHasc:Cefasyd;8egAcdtfaHBdbasaAcefBd;8ea3cbyd1:H:cjbHjjjjbbhAasc:Cefasyd;8egCcdtfaABdbasaCcefBd;8eaHcFeaez:tjjjbh5aAcFeaez:tjjjbh8EdnalTmbindnaLa8AgAcefg8AcdtfydbgCaLaAcdtgefydbgHSmbaCaH9Rh8FaEaHcitfhaa8Eaefhha5aefhKcbhCindndnaaaCcitfydbgXaA9hmbaKaABdbahaABdbxekdnaLaXcdtggfgeclfydbgHaeydbgeSmbaHae9RhHaEaecitfheinaeydbaASmdaecwfheaHcufgHmbkka8EagfgeaAaXaeydbcuSEBdbaKaXaAaKydbcuSEBdbkaCcefgCa8F9hmbkka8Aal9hmbkaOhHaQhAa5hXa8EhCcbheindndnaeaHydbgK9hmbdnaeaAydbgK9hmbaXydbhKdnaCydbg8Fcu9hmbaKcu9hmbaYaefcb86bbxikdna8FcuSmbaKcuSmbaea8FSmbaOa8FcdtfydbaOaKcdtfydb9hmbaYaefcd86bbxikaYaefhadnaea8FSmbaeaKSmbaace86bbxikaacl86bbxdkdnaeaQaKcdtg8Ffydb9hmbdnaCydbgacuSmbaeaaSmbaXydbggcuSmbaeagSmba8Ea8FfydbghcuSmbahaKSmba5a8Ffydbg8FcuSmba8FaKSmbdnaOaacdtfydbgKaOa8Fcdtfydb9hmbaKaOagcdtfydbg8FSmba8FaOahcdtfydb9hmbaYaefcd86bbxlkaYaefcl86bbxikaYaefcl86bbxdkaYaefcl86bbxekaYaefaYaKfRbb86bbkaHclfhHaAclfhAaXclfhXaCclfhCalaecefge9hmbkdnamcaGTmbcbh8JindndnaYa8Jfg8KRbbg8Lc9:fPibebekdndndnaOa8Jcdtfydbgea8J9hmbdnaqmbcbh8FxdkdnazTmbcbh8Fa8JheinaqazaecdtgefydbfRbbce4a8FVceGh8FaQaefydbgea8J9hmbxikkcbh8Fa8JheinaqaefRbbce4a8FVceGh8FaQaecdtfydbgea8J9hmbxdkkaYaefRbbhexeka8JheindnaLaecdtg8AfgeclfydbgHaeydbgeSmbaHae9RhgaEaecitfhhaOa8AfhacbhKinahaKcitfydbgXhednindnaLaecdtgCfgeclfydbgHaeydbgeSmbaHae9RhHaEaecitfheaaydbhAdninaOaeydbcdtfydbaASmeaecwfheaHcufgHTmdxbkkcbhexdkaQaCfydbgeaX9hmbkceheka8FaeVh8FaKcefgKag9hmbkkaQa8Afydbgea8J9hmbka8Lcia8FceGEheka8Kae86bbka8Jcefg8Jal9hmbkkdnaqTmbdndnazTmbazheaOhHalhAindnaqaeydbfRbbceGTmbaYaHydbfcl86bbkaeclfheaHclfhHaAcufgAmbxdkkaqheaOhHalhAindnaeRbbceGTmbaYaHydbfcl86bbkaecefheaHclfhHaAcufgAmbkkaOhealhAaYhHindnaYaeydbfRbbcl9hmbaHcl86bbkaeclfheaHcefhHaAcufgAmbkkamceGTmbaYhealhHindnaeRbbce9hmbaecl86bbkaecefheaHcufgHmbkkcbh8Mcualcx2alc;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbh8Nasc:Cefasyd;8egecdtfa8NBdbasaecefBd;8eascbBd:qeas9cb83i1ea8Naialavazasc1efz:ejjjbhydndnaDmbcbh8PcbhCxekcbhCawhecbhHindnaeIdbJbbbb9ETmbasaCcdtfaHBdbaCcefhCkaeclfheaDaHcefgH9hmbkcuaCal2gecdtaecFFFFi0Ecbyd1:H:cjbHjjjjbbh8Pasc:Cefasyd;8egecdtfa8PBdbasaecefBd;8ealTmbdnaCmbcbhCxekarcd4hgdnazTmbaCcdthhcbh8Fa8Phainaoaza8Fcdtfydbag2cdtfhKasheaahHaChAinaHaKaeydbcdtgXfIdbawaXfIdbNUdbaeclfheaHclfhHaAcufgAmbkaaahfhaa8Fcefg8Fal9hmbxdkkaCcdthhcbh8Fa8Phainaoa8Fag2cdtfhKasheaahHaChAinaHaKaeydbcdtgXfIdbawaXfIdbNUdbaeclfheaHclfhHaAcufgAmbkaaahfhaa8Fcefg8Fal9hmbkkcualc8S2gHalc;D;O;f8U0EgXcbyd1:H:cjbHjjjjbbheasc:Cefasyd;8egAcdtfaeBdbasaAcefBd;8eaecbaHz:tjjjbhIcbh8RcbhgdnaCTmbcbh8MaXcbyd1:H:cjbHjjjjbbhgasc:Cefasyd;8egecdtfagBdbasaecefBd;8eagcbaHz:tjjjb8AcuaCal2gecltgHaecFFFFb0Ecbyd1:H:cjbHjjjjbbh8Rasc:Cefasyd;8egecdtfa8RBdbasaecefBd;8ea8RcbaHz:tjjjb8AamcjjjjdGTmbcualcltgealcFFFFb0Ecbyd1:H:cjbHjjjjbbh8Masc:Cefasyd;8egHcdtfa8MBdbasaHcefBd;8ea8Mcbaez:tjjjb8AkdnadTmbcbhKabhHina8NaHclfydbg8Fcx2fgeIdba8NaHydbgacx2fgAIdbg8S:tgRa8NaHcwfydbghcx2fgXIdlaAIdlg8U:tg8VNaeIdla8U:tg8WaXIdba8S:tg8XN:tg8Ya8YNa8WaXIdwaAIdwg8Z:tg80NaeIdwa8Z:tg8Wa8VN:tg81a81Na8Wa8XNaRa80N:tg80a80NMMg8V:rhBa8Yh8Xa80h8Wa81hRdna8VJbbbb9EgATmba8YaB:vh8Xa80aB:vh8Wa81aB:vhRkaIaOaacdtfydbgXc8S2fgeaRaB:rg8VaRNNg83aeIdbMUdbaea8Wa8Va8WNgUNg85aeIdlMUdlaea8Xa8Va8XNg86Ng87aeIdwMUdwaeaRaUNgUaeIdxMUdxaea86aRNg88aeIdzMUdzaea8Wa86Ng89aeIdCMUdCaeaRa8Va8Xa8ZNaRa8SNa8Ua8WNMM:mg8:Ng86NgRaeIdKMUdKaea8Wa86Ng8WaeId3MUd3aea8Xa86Ng8XaeIdaMUdaaea86a8:Ng86aeId8KMUd8Kaea8VaeIdyMUdyaIaOa8Fcdtfydbg8Fc8S2fgea83aeIdbMUdbaea85aeIdlMUdlaea87aeIdwMUdwaeaUaeIdxMUdxaea88aeIdzMUdzaea89aeIdCMUdCaeaRaeIdKMUdKaea8WaeId3MUd3aea8XaeIdaMUdaaea86aeId8KMUd8Kaea8VaeIdyMUdyaIaOahcdtfydbgac8S2fgea83aeIdbMUdbaea85aeIdlMUdlaea87aeIdwMUdwaeaUaeIdxMUdxaea88aeIdzMUdzaea89aeIdCMUdCaeaRaeIdKMUdKaea8WaeId3MUd3aea8XaeIdaMUdaaea86aeId8KMUd8Kaea8VaeIdyMUdydna8MTmbdnaATmba8YaB:vh8Ya80aB:vh80a81aB:vh81ka8MaXcltfgeaBJbbbZNgRa80Ng8VaeIdlMUdlaeaRa8YNg8WaeIdwMUdwaeaRa81Ng8XaeIdbMUdbaeaRa8S:ma81Na8Ua80N:ta8Za8YN:tNgRaeIdxMUdxa8Ma8Fcltfgea8VaeIdlMUdlaea8WaeIdwMUdwaea8XaeIdbMUdbaeaRaeIdxMUdxa8Maacltfgea8VaeIdlMUdlaea8WaeIdwMUdwaea8XaeIdbMUdbaeaRaeIdxMUdxkaHcxfhHaKcifgKad6mbkkdnalTmbJq;x8J88J;n;m;m89J:v:;;w8ZamczGEamc;abGEh80cbhHaOhXazhKaIhea8NhAindnaHaXydb9hmbaHh8FdnazTmbaKydbh8Fka80hRdnaqTmbJbbjZa80aqa8FfRbbclGEhRkaecxfg8Fa8FIdbJbbbbMUdbaeczfg8Fa8FIdbJbbbbMUdbaecCfg8Fa8FIdbJbbbbMUdbaeaRaecyfg8FIdbg8YNgRaeIdbMUdbaeclfgaaRaaIdbMUdbaecwfgaaRaaIdbMUdbaecKfgaaaIdbaAIdbg8WaRN:tUdbaAcwfIdbh8Vaec3fgaaaIdbaRaAclfIdbg8XN:tUdbaecafgaaaIdbaRa8VN:tUdbaec8KfgaIdbh81a8Fa8YaRMUdbaaa81aRa8Va8VNa8Wa8WNa8Xa8XNMMNMUdbkaXclfhXaKclfhKaec8SfheaAcxfhAalaHcefgH9hmbkkdnadTmbcbh8Aabhainaba8Acdtfh8FcbhHinaYa8FaHc:G:G:cjbfydbcdtfydbgAfRbbhedndnaYaaaHfydbgXfRbbgKc99fcFeGcpe0mbaec99fcFeGc;:e6mekdnaKcufcFeGce0mba5aXcdtfydbaA9hmekdnaecufcFeGce0mba8EaAcdtfydbaX9hmekJbbacJbbacJbbbZaecFeGceSEaKcFeGceSEhUdna8Na8FaHc:K:G:cjbfydbcdtfydbcx2fgeIdwa8NaXcx2fgKIdwg86:tg8Sa8NaAcx2fghIdwa86:tg8Xa8XNahIdbaKIdbg8U:tg80a80NahIdlaKIdlg8Z:tg8Va8VNMMg81Na8Xa8Sa8XNaeIdba8U:tg83a80Na8VaeIdla8Z:tg85NMMg8WN:tg8Ya8YNa83a81Na80a8WN:tgRaRNa85a81Na8Va8WN:tg8Wa8WNMMgBJbbbb9ETmba8YaB:rgB:vh8Ya8WaB:vh8WaRaB:vhRkaUa81:rNgBa8Ya86NaRa8UNa8Za8WNMM:mg81Ng87a81Nh88a80a85Na8Va83N:tg81a81Na8Va8SNa8Xa85N:tg8Va8VNa8Xa83Na80a8SN:tg8Xa8XNMMg83:rh80a8Ya87Nh85a8Wa87Nh89aRa87Nh87a8WaBa8YNg8SNh8:a8SaRNhZaRaBa8WNgnNhca8Ya8SNh8Ya8WanNh8WaRaBaRNNh8Sdna83Jbbbb9ETmba81a80:vh81a8Xa80:vh8Xa8Va80:vh8VkaIaOaXcdtfydbc8S2fgeaeIdba8Sa8VaUa80:rNgRa8VNNMg80MUdbaea8Wa8XaRa8XNg8SNMg83aeIdlMUdlaea8Ya81aRa81Ng8WNMg8YaeIdwMUdwaeaca8Va8SNMg8SaeIdxMUdxaeaZa8Wa8VNMgUaeIdzMUdzaea8:a8Xa8WNMg8WaeIdCMUdCaea87a8VaRa81a86Na8Va8UNa8Za8XNMMg86:mNgRNMg8VaeIdKMUdKaea89a8XaRNMg8XaeId3MUd3aea85a81aRNMg81aeIdaMUdaaea88a86aRN:tgRaeId8KMUd8KaeaBaeIdyMUdyaIaOaAcdtfydbc8S2fgea80aeIdbMUdbaea83aeIdlMUdlaea8YaeIdwMUdwaea8SaeIdxMUdxaeaUaeIdzMUdzaea8WaeIdCMUdCaea8VaeIdKMUdKaea8XaeId3MUd3aea81aeIdaMUdaaeaRaeId8KMUd8KaeaBaeIdyMUdykaHclfgHcx9hmbkaacxfhaa8Acifg8Aad6mbkaCTmbcbhainJbbbbh80a8Nabaacdtfgeclfydbg8Fcx2fgHIdwa8Naeydbghcx2fgAIdwg8Z:tg8Va8VNaHIdbaAIdbg83:tg8Wa8WNaHIdlaAIdlg85:tg8Xa8XNMMg8Sa8Naecwfydbg8Acx2fgeIdwa8Z:tg8YNa8Va8YNa8WaeIdba83:tg81Na8XaeIdla85:tgBNMMgRa8VN:tJbbbbJbbjZa8Sa8Ya8YNa81a81NaBaBNMMg8UNaRaRN:tg86:va86Jbbbb9BEg86Nh88a8Ua8VNaRa8YN:ta86Nh89a8SaBNaRa8XN:ta86Nh8:a8Ua8XNaRaBN:ta86NhZa8Sa81NaRa8WN:ta86Nhna8Ua8WNaRa81N:ta86Nhca8WaBNa8Xa81N:tgRaRNa8Xa8YNa8VaBN:tgRaRNa8Va81Na8Wa8YN:tgRaRNMM:rJbbbZNhRa8PahaC2g8JcdtfhHa8Pa8AaC2gDcdtfhAa8Pa8FaC2g8KcdtfhXa8Z:mh9ca85:mhJa83:mh9eascjdfheaChKJbbbbhBJbbbbh86Jbbbbh8SJbbbbh8UJbbbbh8ZJbbbbh83Jbbbbh85Jbbbbh87JbbbbhUinaecwfaRa89aXIdbaHIdbg8Y:tg8XNa88aAIdba8Y:tg81NMg8VNUdbaeclfaRaZa8XNa8:a81NMg8WNUdbaeaRaca8XNana81NMg8XNUdbaecxfaRa9ca8VNaJa8WNa8Ya9ea8XNMMMg8YNUdbaRa8Va8WNNa8ZMh8ZaRa8Va8XNNa8UMh8UaRa8Wa8XNNa8SMh8SaRa8Ya8YNNaUMhUaRa8Va8YNNa87Mh87aRa8Wa8YNNa85Mh85aRa8Xa8YNNa83Mh83aRa8Va8VNNa86Mh86aRa8Wa8WNNaBMhBaRa8Xa8XNNa80Mh80aHclfhHaXclfhXaAclfhAaeczfheaKcufgKmbkagahc8S2fgea80aeIdbMUdbaeaBaeIdlMUdlaea86aeIdwMUdwaea8SaeIdxMUdxaea8UaeIdzMUdzaea8ZaeIdCMUdCaea83aeIdKMUdKaea85aeId3MUd3aea87aeIdaMUdaaeaUaeId8KMUd8KaeaRaeIdyMUdyaga8Fc8S2fgea80aeIdbMUdbaeaBaeIdlMUdlaea86aeIdwMUdwaea8SaeIdxMUdxaea8UaeIdzMUdzaea8ZaeIdCMUdCaea83aeIdKMUdKaea85aeId3MUd3aea87aeIdaMUdaaeaUaeId8KMUd8KaeaRaeIdyMUdyaga8Ac8S2fgea80aeIdbMUdbaeaBaeIdlMUdlaea86aeIdwMUdwaea8SaeIdxMUdxaea8UaeIdzMUdzaea8ZaeIdCMUdCaea83aeIdKMUdKaea85aeId3MUd3aea87aeIdaMUdaaeaUaeId8KMUd8KaeaRaeIdyMUdya8Ra8Jcltfh8FcbhHaChXina8FaHfgeascjdfaHfgAIdbaeIdbMUdbaeclfgKaAclfIdbaKIdbMUdbaecwfgKaAcwfIdbaKIdbMUdbaecxfgeaAcxfIdbaeIdbMUdbaHczfhHaXcufgXmbka8Ra8Kcltfh8FcbhHaChXina8FaHfgeascjdfaHfgAIdbaeIdbMUdbaeclfgKaAclfIdbaKIdbMUdbaecwfgKaAcwfIdbaKIdbMUdbaecxfgeaAcxfIdbaeIdbMUdbaHczfhHaXcufgXmbka8RaDcltfh8FcbhHaChXina8FaHfgeascjdfaHfgAIdbaeIdbMUdbaeclfgKaAclfIdbaKIdbMUdbaecwfgKaAcwfIdbaKIdbMUdbaecxfgeaAcxfIdbaeIdbMUdbaHczfhHaXcufgXmbkaacifgaad6mbkkcbhAdndnamcwGgTmbJbbbbh8ScbhScbh9hcbh9ixekcbhSa3cbyd1:H:cjbHjjjjbbh9iasc:Cefasyd;8egecdtfa9iBdbasaecefBd;8ecua9ialabadaOz:fjjjbgXcltaXcjjjjiGEcbyd1:H:cjbHjjjjbbh9hasc:Cefasyd;8egecdtfa9hBdbasaecefBd;8ea9haXa9ia8Nalz:gjjjbJFFuuh8SaXTmba9hheaXhHinaeIdbgRa8Sa8SaR9EEh8SaeclfheaHcufgHmbkaXhSkdnalTmbaLclfheaLydbhXaYhHalhKcbhAincbaeydbg8FaX9RaHRbbcpeGEaAfhAaHcefhHaeclfhea8FhXaKcufgKmbkaAce4hAkcuadaA9Rcifg6cx2a6c;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbh9kasc:Cefasyd;8egecdtfa9kBdbasaecefBd;8ecua6cdta6cFFFFi0Ecbyd1:H:cjbHjjjjbbh0asc:Cefasyd;8egecdtfa0BdbasaecefBd;8ea3cbyd1:H:cjbHjjjjbbh9masc:Cefasyd;8egecdtfa9mBdbasaecefBd;8ealcbyd1:H:cjbHjjjjbbh9nasc:Cefasyd;8egecdtfa9nBdbasaecefBd;8eaxaxNayJbbjZamclGEgZaZN:vh87JbbbbhUdnadak9nmbdna6ci6mbaCclth9oa9kcwfh9pJbbbbh85JbbbbhUinascNefabadalaOz:cjjjbabh8Acbh9qcbh9rinaba9rcdtfhDcbheindnaOa8AaefydbgAcdtghfydbgXaOaDaec:W:G:cjbfydbcdtfydbgHcdtg8JfydbgKSmbaYaHfRbbgacv2aYaAfRbbg8FfRb;a:G:cjbg8La8Fcv2aafg8KRb;a:G:cjbg3VcFeGTmbdnaKaX9nmba8KRb;G:G:cjbcFeGmekdna8FcufcFeGce0mbaaTmba5ahfydbaH9hmekdna8FTmbaacufcFeGce0mba8Ea8JfydbaA9hmeka9ka9qcx2fgXaHaAa3cFeGgKEBdlaXaAaHaKEBdbaXaKa8LGcb9hBdwa9qcefh9qkaeclfgecx9hmbkdna9rcifg9rad9pmba8Acxfh8Aa9qcifa69nmekka9qTmdcbh8KinaIaOa9ka8Kcx2fghydbgKcdtgXfydbg8Ac8S2fgeIdwa8Nahydlg8Fcx2fgHIdwg8WNaeIdzaHIdbg8XNaeIdaMgRaRMMa8WNaeIdlaHIdlg8YNaeIdCa8WNaeId3MgRaRMMa8YNaeIdba8XNaeIdxa8YNaeIdKMgRaRMMa8XNaeId8KMMM:lhRJbbbbJbbjZaeIdyg8V:va8VJbbbb9BEh8VdndnahydwgDmbJFFuuh86xekJbbbbJbbjZaIaOa8Fcdtfydbc8S2fgeIdyg81:va81Jbbbb9BEaeIdwa8NaKcx2fgHIdwg81NaeIdzaHIdbg80NaeIdaMgBaBMMa81NaeIdlaHIdlgBNaeIdCa81NaeId3Mg81a81MMaBNaeIdba80NaeIdxaBNaeIdKMg81a81MMa80NaeId8KMMM:lNh86ka8VaRNhBdnaCTmbagaKc8S2fgAIdwa8WNaAIdza8XNaAIdaMgRaRMMa8WNaAIdla8YNaAIdCa8WNaAId3MgRaRMMa8YNaAIdba8XNaAIdxa8YNaAIdKMgRaRMMa8XNaAId8KMMMhRa8Pa8FaC2gacdtfhHa8RaKaC2g8JcltfheaAIdyh81aChAinaHIdbg8Va8Va81NaecxfIdba8WaecwfIdbNa8XaeIdbNa8YaeclfIdbNMMMg8Va8VM:tNaRMhRaHclfhHaeczfheaAcufgAmbkdndnaDmbJbbbbh8Vxekaga8Fc8S2fgAIdwa8NaKcx2fgeIdwg8XNaAIdzaeIdbg8YNaAIdaMg8Va8VMMa8XNaAIdlaeIdlg81NaAIdCa8XNaAId3Mg8Va8VMMa81NaAIdba8YNaAIdxa81NaAIdKMg8Va8VMMa8YNaAId8KMMMh8Va8Pa8JcdtfhHa8RaacltfheaAIdyh80aChAinaHIdbg8Wa8Wa80NaecxfIdba8XaecwfIdbNa8YaeIdbNa81aeclfIdbNMMMg8Wa8WM:tNa8VMh8VaHclfhHaeczfheaAcufgAmbka8V:lh8VkaBaR:lMhBa86a8VMh86dndndnaYaKfRbbc9:fPddbekaQaXfydbgXaKSmbaOa8Fcdtfydbh8Jindndna5aXcdtgafydbgecuSmbaOaecdtfydba8JSmekdna8EaafydbgecuSmbaOaecdtfydba8JSmeka8FhekagaXc8S2fgAIdwa8Naecx2fgHIdwg8WNaAIdzaHIdbg8XNaAIdaMgRaRMMa8WNaAIdlaHIdlg8YNaAIdCa8WNaAId3MgRaRMMa8YNaAIdba8XNaAIdxa8YNaAIdKMgRaRMMa8XNaAId8KMMMhRa8PaeaC2cdtfhHa8RaXaC2cltfheaAIdyh81aChAinaHIdbg8Va8Va81NaecxfIdba8WaecwfIdbNa8XaeIdbNa8YaeclfIdbNMMMg8Va8VM:tNaRMhRaHclfhHaeczfheaAcufgAmbkaBaR:lMhBaQaafydbgXaK9hmbkkaYa8FfRbbci9hmeaDTmeaQa8FcdtfydbgXa8FSmeindndna5aXcdtgafydbgecuSmbaOaecdtfydba8ASmekdna8EaafydbgecuSmbaOaecdtfydba8ASmekaKhekagaXc8S2fgAIdwa8Naecx2fgHIdwg8WNaAIdzaHIdbg8XNaAIdaMgRaRMMa8WNaAIdlaHIdlg8YNaAIdCa8WNaAId3MgRaRMMa8YNaAIdba8XNaAIdxa8YNaAIdKMgRaRMMa8XNaAId8KMMMhRa8PaeaC2cdtfhHa8RaXaC2cltfheaAIdyh81aChAinaHIdbg8Va8Va81NaecxfIdba8WaecwfIdbNa8XaeIdbNa8YaeclfIdbNMMMg8Va8VM:tNaRMhRaHclfhHaeczfheaAcufgAmbka86aR:lMh86aQaafydbgXa8F9hmbxdkkdna8Ea5a5aXfydba8FSEaQaXfydbgacdtfydbgXcu9hmbaQa8FcdtfydbhXkagaac8S2fgAIdwa8NaXcx2fgeIdwg8WNaAIdzaeIdbg8XNaAIdaMgRaRMMa8WNaAIdlaeIdlg8YNaAIdCa8WNaAId3MgRaRMMa8YNaAIdba8XNaAIdxa8YNaAIdKMgRaRMMa8XNaAId8KMMMhRa8PaXaC2g8AcdtfhHa8RaaaC2g8JcltfheaAIdyh81aChAinaHIdbg8Va8Va81NaecxfIdba8WaecwfIdbNa8XaeIdbNa8YaeclfIdbNMMMg8Va8VM:tNaRMhRaHclfhHaeczfheaAcufgAmbkdndnaDmbJbbbbh8VxekagaXc8S2fgAIdwa8Naacx2fgeIdwg8XNaAIdzaeIdbg8YNaAIdaMg8Va8VMMa8XNaAIdlaeIdlg81NaAIdCa8XNaAId3Mg8Va8VMMa81NaAIdba8YNaAIdxa81NaAIdKMg8Va8VMMa8YNaAId8KMMMh8Va8Pa8JcdtfhHa8Ra8AcltfheaAIdyh80aChAinaHIdbg8Wa8Wa80NaecxfIdba8XaecwfIdbNa8YaeIdbNa81aeclfIdbNMMMg8Wa8WM:tNa8VMh8VaHclfhHaeczfheaAcufgAmbka8V:lh8VkaBaR:lMhBa86a8VMh86kaha86aBa86aB9DgeEUdwahaKa8FaeaDcb9hGgeEBdlaha8FaKaeEBdba8Kcefg8Ka9q9hmbkascjdfcbcj;qbz:tjjjb8Aa9phea9qhHinascjdfaeydbcA4cF8FGgAcFAaAcFA6EcdtfgAaAydbcefBdbaecxfheaHcufgHmbkcbhecbhHinascjdfaefgAydbhXaAaHBdbaXaHfhHaeclfgecj;qb9hmbkcbhea9phHinascjdfaHydbcA4cF8FGgAcFAaAcFA6EcdtfgAaAydbgAcefBdba0aAcdtfaeBdbaHcxfhHa9qaecefge9hmbkadak9RgAci9Uh9sdnalTmbcbhea9mhHinaHaeBdbaHclfhHalaecefge9hmbkkcbh9ta9ncbalz:tjjjbh3aAcO9Uh9ua9sce4h9rcbh8Lcbh8Kdnina9ka0a8Kcdtfydbcx2fg8JIdwgRa879Emea8La9s9pmeJFFuuh8Vdna9ra9q9pmba9ka0a9rcdtfydbcx2fIdwJbb;aZNh8VkdnaRa8V9ETmbaRaU9ETmba8La9u0mdkdna3aOa8JydlgDcdtg9vfg8AydbgAfg9wRbba3aOa8Jydbghcdtg9xfydbgefg9yRbbVmbaYahfRbbh9zdndnaLaecdtfgHclfydbgXaHydbgHSmbaXaH9RhXa8NaAcx2fh8Fa8Naecx2fhaaEaHcitfheindna9maeydbcdtfydbgHaASmba9maeclfydbcdtfydbgKaASmbaHaKSmba8NaKcx2fgKIdba8NaHcx2fgHIdbg8W:tgRaaIdlaHIdlg8X:tg80NaKIdla8X:tg8VaaIdba8W:tgBN:tg8YaRa8FIdla8X:tg86Na8Va8FIdba8W:tg8UN:tg8XNa8VaaIdwaHIdwg81:tg8ZNaKIdwa81:tg8Wa80N:tg80a8Va8FIdwa81:tg83Na8Wa86N:tg8VNa8WaBNaRa8ZN:tg81a8Wa8UNaRa83N:tgRNMMa8Ya8YNa80a80Na81a81NMMa8Xa8XNa8Va8VNaRaRNMMN:rJbbj8:N9FmikaecwfheaXcufgXmbkkdndndndna9zc9:fPdebdkahheina8AydbhAdndna5aecdtgHfydbgecuSmbaOaecdtfydbaASmekdna8EaHfydbgecuSmbaOaecdtfydbaASmekaDheka9maHfaeBdbaQaHfydbgeah9hmbxikkdna8Ea5a5a9xfydbaDSEaQa9xfydbghcdtfydbgecu9hmbaQa9vfydbheka9ma9xfaDBdbaehDka9mahcdtfaDBdbka9yce86bba9wce86bba8JIdwgRaUaUaR9DEhUa9tcefh9tcecda9zceSEa8Lfh8Lxeka9rcefh9rka8Kcefg8Ka9q9hmbkka9tTmddnalTmbcbh8Fcbhhindna9mahcdtgefydbgAahSmbaOaAcdtfydbh8AdnahaOaefydb9hg8JmbaIa8Ac8S2fgeaIahc8S2fgHIdbaeIdbMUdbaeaHIdlaeIdlMUdlaeaHIdwaeIdwMUdwaeaHIdxaeIdxMUdxaeaHIdzaeIdzMUdzaeaHIdCaeIdCMUdCaeaHIdKaeIdKMUdKaeaHId3aeId3MUd3aeaHIdaaeIdaMUdaaeaHId8KaeId8KMUd8KaeaHIdyaeIdyMUdya8MTmba8Ma8Acltfgea8MahcltfgHIdbaeIdbMUdbaeaHIdlaeIdlMUdlaeaHIdwaeIdwMUdwaeaHIdxaeIdxMUdxkaCTmbagaAc8S2fgeagahc8S2gDfgHIdbaeIdbMUdbaeaHIdlaeIdlMUdlaeaHIdwaeIdwMUdwaeaHIdxaeIdxMUdxaeaHIdzaeIdzMUdzaeaHIdCaeIdCMUdCaeaHIdKaeIdKMUdKaeaHId3aeId3MUd3aeaHIdaaeIdaMUdaaeaHId8KaeId8KMUd8KaeaHIdyaeIdyMUdya9oaA2haa8RhHaChXinaHaafgeaHa8FfgAIdbaeIdbMUdbaeclfgKaAclfIdbaKIdbMUdbaecwfgKaAcwfIdbaKIdbMUdbaecxfgeaAcxfIdbaeIdbMUdbaHczfhHaXcufgXmbka8JmbJbbbbJbbjZaIaDfgeIdygR:vaRJbbbb9BEaeIdwa8Na8Acx2fgHIdwgRNaeIdzaHIdbg8VNaeIdaMg8Wa8WMMaRNaeIdlaHIdlg8WNaeIdCaRNaeId3MgRaRMMa8WNaeIdba8VNaeIdxa8WNaeIdKMgRaRMMa8VNaeId8KMMM:lNgRa85a85aR9DEh85ka8Fa9ofh8Fahcefghal9hmbkcbhHa5heindnaeydbgAcuSmbdnaHa9maAcdtgXfydbgA9hmbcuhAa5aXfydbgXcuSmba9maXcdtfydbhAkaeaABdbkaeclfhealaHcefgH9hmbkcbhHa8EheindnaeydbgAcuSmbdnaHa9maAcdtgXfydbgA9hmbcuhAa8EaXfydbgXcuSmba9maXcdtfydbhAkaeaABdbkaeclfhealaHcefgH9hmbkka85aUaCEh85cbhHabhecbhAindnaOa9maeydbcdtfydbg8FcdtfydbgXaOa9maeclfydbcdtfydbgacdtfydbgKSmbaXaOa9maecwfydbcdtfydbg8AcdtfydbghSmbaKahSmbabaHcdtfgXa8FBdbaXcwfa8ABdbaXclfaaBdbaHcifhHkaecxfheaAcifgAad6mbkdndnaTmbaHhdxekdnaHak0mbaHhdxekdna8Sa859FmbaHhdxekJFFuuh8ScbhdabhecbhAindna9ha9iaeydbgXcdtfydbcdtfIdbgRa859ETmbaeclf8Pdbh9AabadcdtfgKaXBdbaKclfa9A83dbaRa8Sa8SaR9EEh8SadcifhdkaecxfheaAcifgAaH6mbkkadak0mbxdkkascNefabadalaOz:cjjjbkdndnadak0mbadhaxekdnaTmbadhaxekdna8Sa879FmbadhaxekcehKina8SJbb;aZNgRa87aRa879DEh8WJbbbbhRdnaSTmba9hheaShHinaeIdbg8VaRa8Va8W9FEaRa8VaR9EEhRaeclfheaHcufgHmbkkJFFuuh8ScbhaabhecbhHindna9ha9iaeydbgAcdtfydbcdtfIdbg8Va8W9ETmbaeclf8Pdbh9AabaacdtfgXaABdbaXclfa9A83dba8Va8Sa8Sa8V9EEh8SaacifhakaecxfheaHcifgHad6mbkdnaKaaad9hVceGmbadhaxdkaRaUaUaR9DEhUaaak9nmecbhKaahda8Sa879FmbkkdnamcjjjjdGTmba9ncbalz:tjjjbh8AdnaaTmbabheaahHina8AaeydbgAfce86bba8AaOaAcdtfydbfce86bbaeclfheaHcufgHmbkkascNefabaaalaOz:cjjjbdndnalTmbcbhXindna8AaXfRbbTmbdnaYaXfRbbgecl0mbceaetcQGmekdnaOaXcdtg8FfydbgeaXSmba8NaXcx2fgHa8Naecx2fgeydwBdwaHae8Pdb83dbxekaIaXc8S2fgKIdygcacJL:3;rUNgRMh87aKIdwg9BaRMh8SaKIdlg9CaRMh8UaKIdbg9DaRMh81aKIdag9EaRa8NaXcx2fg8JIdwg88N:th8ZaKId3g9FaRa8JIdlg89N:th83aKIdKg9Ga8JIdbg8:aRN:th80JbbbbhnaKIdCg9HJbbbbMh85aKIdzg9IJbbbbMhBaKIdxg9JJbbbbMh86dndnaCTmbaXhAinJbbbba87agaAc8S2fgHIdygR:vaRJbbbb9BEhRa8RaAaC2cltfheaHIdaa87Na8ZMh8ZaHId3a87Na83Mh83aHIdKa87Na80Mh80aHIdCa87Na85Mh85aHIdza87NaBMhBaHIdxa87Na86Mh86aHIdwa87Na8SMh8SaHIdla87Na8UMh8UaHIdba87Na81Mh81aChHina8ZaecwfIdbg8VaecxfIdbg8YNaRN:th8Za83aeclfIdbg8Wa8YNaRN:th83a85a8Wa8VNaRN:th85a81aeIdbg8Xa8XNaRN:th81a80a8Xa8YNaRN:th80aBa8Xa8VNaRN:thBa86a8Xa8WNaRN:th86a8Sa8Va8VNaRN:th8Sa8Ua8Wa8WNaRN:th8UaeczfheaHcufgHmbkaQaAcdtfydbgAaX9hmbka8MTmba8MaXcltfgeIdxhxaeIdwh9caeIdlhJaeIdbhRxekJbbbbhxJbbbbh9cJbbbbhJJbbbbhRkaBa81:vg8Wa80Na8Z:ta85aBa86a81:vg8VN:tg8Za8Ua86a8VN:tg8Y:vg8Xa8Va80Na83:tg8UN:th83a9caRa8WN:taJaRa8VN:tg86a8XN:tg85a8SaBa8WN:ta8Za8XN:tgB:vg8S:mh8Za86a8Y:vg9c:mhJdnJbbbbaRaRa81:vg9eN:ta86a9cN:ta85a8SN:tg86:la87J:983:g81NgR9ETmba8Za83NaJa8UNa9ea80Nax:tMMa86:vhnka81:laR9ETmba8Y:laR9ETmbaB:laR9ETmba9e:manNa8W:ma8ZanNa83aB:vMgBNa8V:maJanNa8X:maBNa8Ua8Y:vMMg85Na80:ma81:vMMMh87aLa8FfgeclfydbgHaeydbge9RhhaEaecitfh8FJbbbbhRdnaHaeSgDmbJbbbbhRa8FheahhAina8Naeclfydbcx2fgHIdwa88:tg8Va8VNaHIdba8::tg8Va8VNaHIdla89:tg8Va8VNMMg8Va8Naeydbcx2fgHIdwa88:tg8Wa8WNaHIdba8::tg8Wa8WNaHIdla89:tg8Wa8WNMMg8WaRaRa8W9DEgRaRa8V9DEhRaecwfheaAcufgAmbkaR:rgRaRNhRkaBa88:tg8Va8VNa87a8::tg8Va8VNa85a89:tg8Va8VNMMaR9EmbaKId8KhndnaDmbina8Na8Fclfydbcx2fgeIdba8Na8Fydbcx2fgHIdbg8W:tgRa89aHIdlg8X:tg80NaeIdla8X:tg8Va8:a8W:tg86N:tg8YaRa85a8X:tg8SNa8Va87a8W:tg8UN:tg8XNa8Va88aHIdwg81:tg8ZNaeIdwa81:tg8Wa80N:tg80a8VaBa81:tg83Na8Wa8SN:tg8VNa8Wa86NaRa8ZN:tg81a8Wa8UNaRa83N:tgRNMMa8Ya8YNa80a80Na81a81NMMa8Xa8XNa8Va8VNaRaRNMMN:rJbbj8:N9Fmda8Fcwfh8FahcufghmbkkJbbbbJbbjZac:vacJbbbb9BEgRa9BaBNa9Ia87Na9EMg8Va8VMMaBNa9Ca85Na9HaBNa9FMg8Va8VMMa85Na9Da87Na9Ja85Na9GMg8Va8VMMa87NanMMM:lNaRa9Ba88Na9Ia8:Na9EMg8Va8VMMa88Na9Ca89Na9Ha88Na9FMg8Va8VMMa89Na9Da8:Na9Ja89Na9GMg8Va8VMMa8:NanMMM:lNJbb;aZNJ:983:g81M9Emba8JaBUdwa8Ja85Udla8Ja87UdbkaXcefgXal9hmbkdnaCmbcbhCxdkcbhXindna8AaXfRbbTmbaOaXcdtgefydbaX9hmbaYaXfhhaQaefh8Ja8NaXcx2fhAa8PaXaC2cdtfhDcbhEincuhLdnahRbbci9hmbaXhLa8JydbgeaXSmba8PaEcdtgHfhKaDaHfIdbhRaXhLinaLhHcuhLdnaKaeaC2cdtfIdbaR9CmbaHcuSmbaHhLagaec8S2fIdyagaHc8S2fIdy9ETmbaehLkaQaecdtfydbgeaX9hmbkka8PaEcdtfhKa8RaEcltfh8FaXheinaKaeaC2cdtfJbbbbJbbjZagaeaLaLcuSEgHc8S2fIdygR:vaRJbbbb9BEa8FaHaC2cltfgHIdwaAIdwNaHIdbaAIdbNaHIdlaAIdlNMMaHIdxMNUdbaQaecdtfydbgeaX9hmbkaEcefgEaC9hmbkkaXcefgXal9hmbxdkkaCmbcbhCkaiavaoarawaCala8Na8Pazasayasc1efaYa8Aaqz:hjjjbkdnamcjjjjlGTmbazmbaaTmbabhecbhLinaYaeydbgAfRbbc3thQaecwfgXydbhHcjjjj94hCdna5aAcdtgEfydbaeclfgKydbgOSmbcjjjj94cba8EaOcdtfydbaASEhCkaeaQaCVaAVBdbaYaOfRbbc3th8Fcjjjj94hCcjjjj94hQdna5aOcdtfydbaHSmbcjjjj94cba8EaHcdtfydbaOSEhQkaKa8FaQVaOVBdbaYaHfRbbc3thOdna5aHcdtfydbaASmbcjjjj94cba8EaEfydbaHSEhCkaXaOaCVaHVBdbaecxfheaLcifgLaa6mbkkdnazTmbaaTmbaaheinabazabydbcdtfydbBdbabclfhbaecufgembkkdnaPTmbaPaZaU:rNUdbkdnasyd;8egHTmbaHcdtasc:Ceffc98fheinaeydbcbyd:m:H:cjbH:bjjjbbaec98fheaHcufgHmbkkascj;sbf8Kjjjjbaak;Yieouabydlhvabydbclfcbaicdtz:tjjjbhoadci9UhrdnadTmbdnalTmbaehwadhDinaoalawydbcdtfydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbxdkkaehwadhDinaoawydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbkkdnaiTmbcbhDaohwinawydbhqawaDBdbawclfhwaqaDfhDaicufgimbkkdnadci6mbinaecwfydbhwaeclfydbhDaeydbhidnalTmbalawcdtfydbhwalaDcdtfydbhDalaicdtfydbhikavaoaicdtfgqydbcitfaDBdbavaqydbcitfawBdlaqaqydbcefBdbavaoaDcdtfgqydbcitfawBdbavaqydbcitfaiBdlaqaqydbcefBdbavaoawcdtfgwydbcitfaiBdbavawydbcitfaDBdlawawydbcefBdbaecxfhearcufgrmbkkabydbcbBdbk:todDue99aicd4aifhrcehwinawgDcethwaDar6mbkcuaDcdtgraDcFFFFi0Ecbyd1:H:cjbHjjjjbbhwaoaoyd9GgqcefBd9GaoaqcdtfawBdbawcFearz:tjjjbhkdnaiTmbalcd4hlaDcufhxcbhminamhDdnavTmbavamcdtfydbhDkcbadaDal2cdtfgDydlgwawcjjjj94SEgwcH4aw7c:F:b:DD2cbaDydbgwawcjjjj94SEgwcH4aw7c;D;O:B8J27cbaDydwgDaDcjjjj94SEgDcH4aD7c:3F;N8N27axGhwamcdthPdndndnavTmbakawcdtfgrydbgDcuSmeadavaPfydbal2cdtfgsIdbhzcehqinaqhrdnadavaDcdtfydbal2cdtfgqIdbaz9CmbaqIdlasIdl9CmbaqIdwasIdw9BmlkarcefhqakawarfaxGgwcdtfgrydbgDcu9hmbxdkkakawcdtfgrydbgDcuSmbadamal2cdtfgsIdbhzcehqinaqhrdnadaDal2cdtfgqIdbaz9CmbaqIdlasIdl9CmbaqIdwasIdw9BmikarcefhqakawarfaxGgwcdtfgrydbgDcu9hmbkkaramBdbamhDkabaPfaDBdbamcefgmai9hmbkkakcbyd:m:H:cjbH:bjjjbbaoaoyd9GcufBd9GdnaeTmbaiTmbcbhDaehwinawaDBdbawclfhwaiaDcefgD9hmbkcbhDaehwindnaDabydbgrSmbawaearcdtfgrydbBdbaraDBdbkabclfhbawclfhwaiaDcefgD9hmbkkk;:odvuv998Jjjjjbca9Rgocbyd1:G:cjbBdKaocb8Pdj:G:cjb83izaocbydN:G:cjbBdwaocb8Pd:m:G:cjb83ibdnadTmbaicd4hrdnabmbdnalTmbcbhwinaealawcdtfydbar2cdtfhDcbhiinaoczfaifgqaDaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkawcefgwad9hmbxikkarcdthwcbhDincbhiinaoczfaifgqaeaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkaeawfheaDcefgDad9hmbxdkkdnalTmbcbhwinabawcx2fgiaealawcdtfydbar2cdtfgDIdbUdbaiaDIdlUdlaiaDIdwUdwcbhiinaoczfaifgqaDaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkawcefgwad9hmbxdkkarcdthlcbhwaehDinabawcx2fgiaeawar2cdtfgqIdbUdbaiaqIdlUdlaiaqIdwUdwcbhiinaoczfaifgqaDaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkaDalfhDawcefgwad9hmbkkJbbbbaoIdbaoIdzgx:tgkakJbbbb9DEgkaoIdlaoIdCgm:tgPaPak9DEgkaoIdwaoIdKgP:tgsasak9DEhsdnabTmbadTmbJbbbbJbbjZas:vasJbbbb9BEhkinabakabIdbax:tNUdbabclfgoakaoIdbam:tNUdbabcwfgoakaoIdbaP:tNUdbabcxfhbadcufgdmbkkdnavTmbavaPUdwavamUdlavaxUdbkask:WlewudnaeTmbcbhvabhoinaoavBdbaoclfhoaeavcefgv9hmbkkdnaiTmbcbhrinadarcdtfhwcbhDinalawaDcdtgvyd:G:G:cjbcdtfydbcdtfydbhodnalawavfydbcdtfydbgqabaqcdtfgkydbgvSmbinakabavgqcdtfgxydbgvBdbaxhkaqav9hmbkkdnaoabaocdtfgkydbgvSmbinakabavgocdtfgxydbgvBdbaxhkaoav9hmbkkdnaqaoSmbabaqaoaqao0Ecdtfaqaoaqao6EBdbkaDcefgDci9hmbkarcifgrai6mbkkdnaembcbskcbhxindnalaxcdtgvfydbax9hmbaxhodnaxabavfgDydbgvSmbaDhqinaqabavgocdtfgkydbgvBdbakhqaoav9hmbkkaDaoBdbkaxcefgxae9hmbkcbhkabhvcbhoindndnaoalydbgq9hmbdnaoavydbgq9hmbavakBdbakcefhkxdkavabaqcdtfydbBdbxekavabaqcdtfydbBdbkalclfhlavclfhvaeaocefgo9hmbkakk;jiilud99euabcbaecltz:tjjjbhvdnalTmbadhoaihralhwinarcwfIdbhDarclfIdbhqavaoydbcltfgkarIdbakIdbMUdbakaqakIdlMUdlakaDakIdwMUdwakakIdxJbbjZMUdxaoclfhoarcxfhrawcufgwmbkkdnaeTmbavhkaehrinakcxfgoIdbhDaocbBdbakakIdbJbbbbJbbjZaD:vaDJbbbb9BEgDNUdbakclfgoaDaoIdbNUdbakcwfgoaDaoIdbNUdbakczfhkarcufgrmbkkdnalTmbinavadydbcltfgkaicwfIdbakIdw:tgDaDNaiIdbakIdb:tgDaDNaiclfIdbakIdl:tgDaDNMMgDakIdxgqaqaD9DEUdxadclfhdaicxfhialcufglmbkkdnaeTmbavcxfhkinabakIdbUdbakczfhkabclfhbaecufgembkkk:moerudnaoTmbaecd4hzdnavTmbaicd4hHavcdthOcbhAindnaPaAfRbbTmbaAhednaDTmbaDaAcdtfydbhekdnasTmbasaefRbbceGmekdnamaAfRbbclSmbabaeaz2cdtfgiaraAcx2fgCIdbakNaxIdbMUdbaiaCIdlakNaxIdlMUdlaiaCIdwakNaxIdwMUdwkadaeaH2cdtfhXaqheawhiavhCinaXaeydbcdtgQfaiIdbalaQfIdb:vUdbaeclfheaiclfhiaCcufgCmbkkawaOfhwaAcefgAao9hmbxdkkdnasmbcbheaDhiindnaPaefRbbTmbaehCdnaDTmbaiydbhCkamaefRbbclSmbabaCaz2cdtfgCarIdbakNaxIdbMUdbaCarclfIdbakNaxIdlMUdlaCarcwfIdbakNaxIdwMUdwkaiclfhiarcxfhraoaecefge9hmbxdkkdnaDTmbindnaPRbbTmbasaDydbgefRbbceGmbamRbbclSmbabaeaz2cdtfgearIdbakNaxIdbMUdbaearclfIdbakNaxIdlMUdlaearcwfIdbakNaxIdwMUdwkaPcefhPaDclfhDamcefhmarcxfhraocufgombxdkkazcdthicbheindnaPaefRbbTmbasaefRbbceGmbamaefRbbclSmbabarIdbakNaxIdbMUdbabclfarclfIdbakNaxIdlMUdbabcwfarcwfIdbakNaxIdwMUdbkarcxfhrabaifhbaoaecefge9hmbkkk8MbabaeadaialavcbcbcbcbcbaoarawaDz:bjjjbk8MbabaeadaialavaoarawaDaqakaxamaPz:bjjjbkRbababaeadaialavaoarawaDaqakaxcjjjjdVamz:bjjjbk:g8Koque99due99duq998Jjjjjbc;Wb9Rgq8Kjjjjbcbhkaqcxfcbc;Kbz:tjjjb8Aaqcualcx2alc;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbgxBdxaqceBd2axaialavcbcbz:ejjjb8AaqcualcdtalcFFFFi0Egmcbyd1:H:cjbHjjjjbbgiBdzaqcdBd2dndnJFF959eJbbjZawJbbjZawJbbjZ9DE:vawJ9VO:d869DEgw:lJbbb9p9DTmbaw:OhPxekcjjjj94hPkadci9Uhsarco9UhzdndnaombaPcd9imekdnalTmbaPcuf:YhwdnaoTmbcbhvaihHaxhOindndnaoavfRbbceGTmbavcjjjjlVhAxekdndnaOclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaAcqthAdndnaOcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaAaXVhAdndnaOIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaAaXcCtVhAkaHaABdbaHclfhHaOcxfhOalavcefgv9hmbxdkkaxhvaihOalhHindndnavIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaAcCthAdndnavclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaXcqtaAVhAdndnavcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaOaAaXVBdbavcxfhvaOclfhOaHcufgHmbkkadTmbcbhkaehvcbhOinakaiavclfydbcdtfydbgHaiavcwfydbcdtfydbgA9haiavydbcdtfydbgXaH9haXaA9hGGfhkavcxfhvaOcifgOad6mbkkarci9UhQdndnaz:Z:rJbbbZMgw:lJbbb9p9DTmbaw:Ohvxekcjjjj94hvkaQ:ZhLcbhKc:bwhzdninakaQ9pmeazaP9Rcd9imeavazcufgOavaO9iEaPcefavaP9kEhYdnalTmbaYcuf:YhwdnaoTmbcbhOaihHaxhvindndnaoaOfRbbceGTmbaOcjjjjlVhAxekdndnavclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaAcqthAdndnavcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaAaXVhAdndnavIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaAaXcCtVhAkaHaABdbaHclfhHavcxfhvalaOcefgO9hmbxdkkaxhvaihOalhHindndnavIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaAcCthAdndnavclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaXcqtaAVhAdndnavcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaOaAaXVBdbavcxfhvaOclfhOaHcufgHmbkkcbhOdnadTmbaehvcbhHinaOaiavclfydbcdtfydbgAaiavcwfydbcdtfydbgX9haiavydbcdtfydbgraA9haraX9hGGfhOavcxfhvaHcifgHad6mbkkdnas:ZgCaL:taY:Ygwaz:Y:tg8ANak:ZgEaO:Zg3:tNaEaL:tawaP:Y:tg5Na3aC:tNMg8EJbbbb9BmbaCaE:ta5a8Aa3aL:tNNNa8E:vawMhwkdndnaOaQ0mbaOhkaYhPxekaOhsaYhzkdndnaKcl0mbdnawJbbbZMgw:lJbbb9p9DTmbaw:Ohvxdkcjjjj94hvxekaPazfcd9ThvkaKcefgKcs9hmbkkdndndnakmbJbbjZhwcbhOcdhvaDmexdkalcd4alfhHcehOinaOgvcethOavaH6mbkcbhOaqcuavcdtgYavcFFFFi0Ecbyd1:H:cjbHjjjjbbgKBdCaqciBd2aqamcbyd1:H:cjbHjjjjbbgzBdKaqclBd2dndndndnalTmbaPcuf:YhwaoTmecbhOaihAaxhHindndnaoaOfRbbceGTmbaOcjjjjlVhXxekdndnaHclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaXcqthXdndnaHcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:Ohrxekcjjjj94hrkaXarVhXdndnaHIdbawNJbbbZMgC:lJbbb9p9DTmbaC:Ohrxekcjjjj94hrkaXarcCtVhXkaAaXBdbaAclfhAaHcxfhHalaOcefgO9hmbxikkaKcFeaYz:tjjjb8AcbhPcbhvxdkaxhOaihHalhAindndnaOIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaXcCthXdndnaOclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:Ohrxekcjjjj94hrkarcqtaXVhXdndnaOcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:Ohrxekcjjjj94hrkaHaXarVBdbaOcxfhOaHclfhHaAcufgAmbkkaKcFeaYz:tjjjbhravcufhocbhPcbhYindndndnaraiaYcdtgKfydbgAcm4aA7c:v;t;h;Ev2gvcs4av7aoGgHcdtfgXydbgOcuSmbcehvinaiaOcdtgOfydbaASmdaHavfhOavcefhvaraOaoGgHcdtfgXydbgOcu9hmbkkaXaYBdbaPhvaPcefhPxekazaOfydbhvkazaKfavBdbaYcefgYal9hmbkcuaPc8S2gOaPc;D;O;f8U0EhvkcbhXaqavcbyd1:H:cjbHjjjjbbgvBd3aqcvBd2avcbaOz:tjjjbhOdnadTmbaehiinaxaiclfydbgrcx2fgvIdbaxaiydbgocx2fgHIdbg3:tgCaxaicwfydbgYcx2fgAIdlaHIdlg8A:tgwNavIdla8A:tgEaAIdba3:tg8EN:tgLaLNaEaAIdwaHIdwg5:tg8FNavIdwa5:tgEawN:tgwawNaEa8ENaCa8FN:tgCaCNMMg8E:rhEJbbnnJbbjZazaocdtfydbgvazarcdtfydbgASavazaYcdtfydbgrSGgHEh8Fdna8EJbbbb9ETmbaLaE:vhLaCaE:vhCawaE:vhwkaOavc8S2fgvavIdbawa8FaE:rNgEawNNg8FMUdbavaCaEaCNgaNghavIdlMUdlavaLaEaLNg8ENggavIdwMUdwavawaaNgaavIdxMUdxava8EawNg8JavIdzMUdzavaCa8ENg8EavIdCMUdCavawaEaLa5Nawa3Na8AaCNMM:mg8ANg3NgwavIdKMUdKavaCa3NgCavId3MUd3avaLa3NgLavIdaMUdaava3a8ANg3avId8KMUd8KavaEavIdyMUdydnaHmbaOaAc8S2fgva8FavIdbMUdbavahavIdlMUdlavagavIdwMUdwavaaavIdxMUdxava8JavIdzMUdzava8EavIdCMUdCavawavIdKMUdKavaCavId3MUd3avaLavIdaMUdaava3avId8KMUd8KavaEavIdyMUdyaOarc8S2fgva8FavIdbMUdbavahavIdlMUdlavagavIdwMUdwavaaavIdxMUdxava8JavIdzMUdzava8EavIdCMUdCavawavIdKMUdKavaCavId3MUd3avaLavIdaMUdaava3avId8KMUd8KavaEavIdyMUdykaicxfhiaXcifgXad6mbkkcbhAaqcuaPcdtgvaPcFFFFi0Egicbyd1:H:cjbHjjjjbbgHBdaaqcoBd2aqaicbyd1:H:cjbHjjjjbbgiBd8KaqcrBd2aHcFeavz:tjjjbhYdnalTmbazhHinJbbbbJbbjZaOaHydbgXc8S2fgvIdygw:vawJbbbb9BEavIdwaxcwfIdbgwNavIdzaxIdbgCNavIdaMgLaLMMawNavIdlaxclfIdbgLNavIdCawNavId3MgwawMMaLNavIdbaCNavIdxaLNavIdKMgwawMMaCNavId8KMMM:lNhwdndnaYaXcdtgvfgXydbcuSmbaiavfIdbaw9ETmekaXaABdbaiavfawUdbkaHclfhHaxcxfhxalaAcefgA9hmbkkdndnaPmbJbbbbhwxekJbbbbhwinaiIdbgCawawaC9DEhwaiclfhiaPcufgPmbkaw:rhwkakcd4akfhOcehiinaigvcethiavaO6mbkcbhOaqcuavcdtgiavcFFFFi0Ecbyd1:H:cjbHjjjjbbgHBdyaHcFeaiz:tjjjbhXdnadTmbavcufhrcbhPcbhxindnazaeaxcdtfgvydbcdtfydbgiazavclfydbcdtfydbgOSmbaiazavcwfydbcdtfydbgvSmbaOavSmbaYavcdtfydbhAdndnaYaOcdtfydbgvaYaicdtfydbgi9pmbavaA9pmbaAhlaihoavhAxekdnaAai9pmbaAav9pmbaihlavhoxekavhlaAhoaihAkabaPcx2fgvaABdbavcwfaoBdbavclfalBdbdnaXaoc:3F;N8N2alc:F:b:DD27aAc;D;O:B8J27arGgOcdtfgvydbgicuSmbcehHinaHhvdnabaicx2fgiydbaA9hmbaiydlal9hmbaiydwaoSmikavcefhHaXaOavfarGgOcdtfgvydbgicu9hmbkkavaPBdbaPcefhPkaxcifgxad6mbkaPci2hOkcwhvaDTmekaDawUdbkavcdthvaqcxfc98fhiinaiavfydbcbyd:m:H:cjbH:bjjjbbavc98fgvmbkaqc;Wbf8KjjjjbaOk:3ldrue9:8Jjjjjbc;Wb9Rgr8Kjjjjbcbhwarcxfcbc;Kbz:tjjjb8AdnabaeSmbabaeadcdtzMjjjb8AkarcualcdtalcFFFFi0EgDcbyd1:H:cjbHjjjjbbgqBdxarceBd2aqcbaialavcbarcxfz:djjjbcualcx2alc;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbhkarcxfaryd2gxcdtfakBdbaraxcefgmBd2akaialavcbcbz:ejjjb8AarcxfamcdtfaDcbyd1:H:cjbHjjjjbbgiBdbaraxcdfgvBd2arcxfavcdtfcuaialaeadaqz:fjjjbgecltaecjjjjiGEcbyd1:H:cjbHjjjjbbgqBdbaqaeaiakalz:gjjjbaxcifhkdnadTmbaoaoNhocbhwabhlcbheindnaqaialydbgvcdtfydbcdtfIdbao9ETmbalclf8PdbhPabawcdtfgDavBdbaDclfaP83dbawcifhwkalcxfhlaecifgead6mbkkdnakTmbaxcdtarcxffcwfhlinalydbcbyd:m:H:cjbH:bjjjbbalc98fhlakcufgkmbkkarc;Wbf8Kjjjjbawk:WCoDud99vue99vuv998Jjjjjbc;Wb9Rgw8KjjjjbdndnarmbcbhDxekawcxfcbc;Kbz:tjjjb8Aawcuadcx2adc;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbgqBdxawceBd2aqaeadaicbcbz:ejjjb8AawcuadcdtadcFFFFi0Egkcbyd1:H:cjbHjjjjbbgxBdzawcdBd2adcd4adfhmceheinaegicetheaiam6mbkcbhPawcuaicdtgsaicFFFFi0Ecbyd1:H:cjbHjjjjbbgzBdCawciBd2dndnar:ZgH:rJbbbZMgO:lJbbb9p9DTmbaO:Ohexekcjjjj94hekaicufhAc:bwhCcbhXadhQcbhLinaeaCcufgiaeai9iEaPcefaeaP9kEhDdndnadTmbaDcuf:YhOaqhiaxheadhmindndnaiIdbaONJbbbZMgK:lJbbb9p9DTmbaK:OhYxekcjjjj94hYkaYcCthYdndnaiclfIdbaONJbbbZMgK:lJbbb9p9DTmbaK:Oh8Axekcjjjj94h8Aka8AcqtaYVhYdndnaicwfIdbaONJbbbZMgK:lJbbb9p9DTmbaK:Oh8Axekcjjjj94h8AkaeaYa8AVBdbaicxfhiaeclfheamcufgmmbkazcFeasz:tjjjbhEcbh3cbh5indnaEaxa5cdtfydbgYcm4aY7c:v;t;h;Ev2gics4ai7aAGgmcdtfg8AydbgecuSmbaeaYSmbcehiinaEamaifaAGgmcdtfg8AydbgecuSmeaicefhiaeaY9hmbkka8AaYBdba3aecuSfh3a5cefg5ad9hmbxdkkazcFeasz:tjjjb8Acbh3kdnaQ:ZgKaH:taD:YgOaC:Y:tg8ENaX:Zg8Fa3:Zga:tNa8FaH:taOaP:Y:tghNaaaK:tNMggJbbbb9BmbaKa8F:taha8EaaaH:tNNNag:vaOMhOkaPaDa3ar0giEhPaXa3aiEhXdna3arSmbaDaCaiEgCaP9Rcd9imbdndnaLcl0mbdnaOJbbbZMgO:lJbbb9p9DTmbaO:Ohexdkcjjjj94hexekaPaCfcd9Theka3aQaiEhQaLcefgLcs9hmekkdndnaXmbcihicbhDxekcbhiawakcbyd1:H:cjbHjjjjbbg5BdKawclBd2aPcuf:YhKdndnadTmbaqhiaxheadhmindndnaiIdbaKNJbbbZMgO:lJbbb9p9DTmbaO:OhYxekcjjjj94hYkaYcCthYdndnaiclfIdbaKNJbbbZMgO:lJbbb9p9DTmbaO:Oh8Axekcjjjj94h8Aka8AcqtaYVhYdndnaicwfIdbaKNJbbbZMgO:lJbbb9p9DTmbaO:Oh8Axekcjjjj94h8AkaeaYa8AVBdbaicxfhiaeclfheamcufgmmbkazcFeasz:tjjjbhEcbhDcbh3indndndnaEaxa3cdtgCfydbgYcm4aY7c:v;t;h;Ev2gics4ai7aAGgmcdtfg8AydbgecuSmbcehiinaxaecdtgefydbaYSmdamaifheaicefhiaEaeaAGgmcdtfg8Aydbgecu9hmbkka8Aa3BdbaDhiaDcefhDxeka5aefydbhika5aCfaiBdba3cefg3ad9hmbkcuaDc32giaDc;j:KM;jb0EhexekazcFeasz:tjjjb8AcbhDcbhekawaecbyd1:H:cjbHjjjjbbgeBd3awcvBd2aecbaiz:tjjjbh8Aavcd4hxdnadTmbdnalTmbaxcdthEa5hYaqhealhmadhAina8AaYydbc32fgiaeIdbaiIdbMUdbaiaeclfIdbaiIdlMUdlaiaecwfIdbaiIdwMUdwaiamIdbaiIdxMUdxaiamclfIdbaiIdzMUdzaiamcwfIdbaiIdCMUdCaiaiIdKJbbjZMUdKaYclfhYaecxfheamaEfhmaAcufgAmbxdkka5hmaqheadhYina8Aamydbc32fgiaeIdbaiIdbMUdbaiaeclfIdbaiIdlMUdlaiaecwfIdbaiIdwMUdwaiaiIdxJbbbbMUdxaiaiIdzJbbbbMUdzaiaiIdCJbbbbMUdCaiaiIdKJbbjZMUdKamclfhmaecxfheaYcufgYmbkkdnaDTmba8AhiaDheinaiaiIdbJbbbbJbbjZaicKfIdbgO:vaOJbbbb9BEgONUdbaiclfgmaOamIdbNUdbaicwfgmaOamIdbNUdbaicxfgmaOamIdbNUdbaiczfgmaOamIdbNUdbaicCfgmaOamIdbNUdbaic3fhiaecufgembkkcbhYawcuaDcdtgCaDcFFFFi0Egicbyd1:H:cjbHjjjjbbgeBdaawcoBd2awaicbyd1:H:cjbHjjjjbbgEBd8KaecFeaCz:tjjjbh3dnadTmbaoJbbjZJbbjZaK:vaPceSENgOaONhKaxcdthxalheinaKaec;8:G:cjbalEgmIdwa8Aa5ydbgAc32fgiIdC:tgOaONamIdbaiIdx:tgOaONamIdlaiIdz:tgOaONMMNaqcwfIdbaiIdw:tgOaONaqIdbaiIdb:tgOaONaqclfIdbaiIdl:tgOaONMMMhOdndna3aAcdtgifgmydbcuSmbaEaifIdbaO9ETmekamaYBdbaEaifaOUdbka5clfh5aqcxfhqaeaxfheadaYcefgY9hmbkkaba3aCzMjjjb8Acrhikaicdthiawcxfc98fheinaeaifydbcbyd:m:H:cjbH:bjjjbbaic98fgimbkkawc;Wbf8KjjjjbaDk:Pdidui99ducbhi8Jjjjjbca9Rglcbyd1:G:cjbBdKalcb8Pdj:G:cjb83izalcbydN:G:cjbBdwalcb8Pd:m:G:cjb83ibdndnaembJbbjFhvJbbjFhoJbbjFhrxekadcd4cdthwincbhdinalczfadfgDabadfIdbgvaDIdbgoaoav9EEUdbaladfgDavaDIdbgoaoav9DEUdbadclfgdcx9hmbkabawfhbaicefgiae9hmbkalIdwalIdK:thralIdlalIdC:thoalIdbalIdz:thvkJbbbbavavJbbbb9DEgvaoaoav9DEgvararav9DEk9DeeuabcFeaicdtz:tjjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk;Bidqui998Jjjjjbc;Wb9Rgl8Kjjjjbalcxfcbc;Kbz:tjjjb8Aadcd4adfhvcehoinaogrcethoarav6mbkalcuarcdtgoarcFFFFi0Ecbyd1:H:cjbHjjjjbbgvBdxavcFeaoz:tjjjbhwdnadTmbaicd4hDarcufhqcbhkindndnawcbaeakaD2cdtfgrydlgiaicjjjj94SEgocH4ao7c:F:b:DD2cbarydbgxaxcjjjj94SEgocH4ao7c;D;O:B8J27cbarydwgmamcjjjj94SEgrcH4ar7c:3F;N8N27aqGgvcdtfgrydbgocuSmbam::hPai::hsax::hzcehiinaihrdnaeaoaD2cdtfgiIdbaz9CmbaiIdlas9CmbaiIdwaP9BmikarcefhiawavarfaqGgvcdtfgrydbgocu9hmbkkarakBdbakhokabakcdtfaoBdbakcefgkad9hmbkkalydxcbyd:m:H:cjbH:bjjjbbalc;Wbf8Kjjjjbk9teiucbcbyd:q:H:cjbgeabcifc98GfgbBd:q:H:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd:q:H:cjbgeabcrfc94GfgbBd:q:H:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikTeeucbabcbyd:q:H:cjbge9Rcifc98GaefgbBd:q:H:cjbdnabZbcztge9nmbabae9RcFFifcz4nb8Akkk:Kedbcj:Gdk1eFFuuFFuuFFuuFFuFFFuFFFuFbbbbbbbbebbbdbbbbbbbebbbebbbdbbbbbbbbbbbeeeeebebbebbebebbbeebbbbbbbbbbbbeeeeeebebbeeebeebbbbebebbbbbbbbbbbbbbbbbbc1:Hdkxebbbdbbb:G:qbb",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(r(e),{}).then(function(x){n=x.instance,n.exports.__wasm_call_ctors()});function r(x){for(var T=new Uint8Array(x.length),C=0;C<x.length;++C){var E=x.charCodeAt(C);T[C]=E>96?E-97:E>64?E-39:E+4}for(var w=0,C=0;C<x.length;++C)T[w++]=T[C]<60?t[T[C]]:(T[C]-60)*64+T[++C];return T.buffer.slice(0,w)}function o(x){if(!x)throw new Error("Assertion failed")}function a(x){return new Uint8Array(x.buffer,x.byteOffset,x.byteLength)}function s(x,T,C,E){var w=n.exports.sbrk,D=w(C*4),R=w(C*E*4),M=new Uint8Array(n.exports.memory.buffer);M.set(a(T),R),x(D,R,C,E*4),M=new Uint8Array(n.exports.memory.buffer);var N=new Uint32Array(C);return new Uint8Array(N.buffer).set(M.subarray(D,D+C*4)),w(D-w(0)),N}function c(x,T,C){var E=n.exports.sbrk,w=E(T.length*4),D=E(C*4),R=new Uint8Array(n.exports.memory.buffer),M=a(T);R.set(M,w);var N=x(D,w,T.length,C);R=new Uint8Array(n.exports.memory.buffer);var _=new Uint32Array(C);new Uint8Array(_.buffer).set(R.subarray(D,D+C*4)),E(w-E(0));for(var v=0;v<T.length;++v)T[v]=_[T[v]];return[_,N]}function u(x){for(var T=0,C=0;C<x.length;++C){var E=x[C];T=T<E?E:T}return T}function f(x,T,C,E,w,D,R,M,N){var _=n.exports.sbrk,v=_(4),S=_(C*4),P=_(w*D),L=_(C*4),F=new Uint8Array(n.exports.memory.buffer);F.set(a(E),P),F.set(a(T),L);var V=x(S,L,C,P,w,D,R,M,N,v);F=new Uint8Array(n.exports.memory.buffer);var z=new Uint32Array(V);a(z).set(F.subarray(S,S+V*4));var j=new Float32Array(1);return a(j).set(F.subarray(v,v+4)),_(v-_(0)),[z,j[0]]}function d(x,T,C,E,w,D,R,M,N,_,v,S,P){var L=n.exports.sbrk,F=L(4),V=L(C*4),z=L(w*D),j=L(w*M),B=L(N.length*4),G=L(C*4),W=_?L(w):0,Q=new Uint8Array(n.exports.memory.buffer);Q.set(a(E),z),Q.set(a(R),j),Q.set(a(N),B),Q.set(a(T),G),_&&Q.set(a(_),W);var q=x(V,G,C,z,w,D,j,M,B,N.length,W,v,S,P,F);Q=new Uint8Array(n.exports.memory.buffer);var J=new Uint32Array(q);a(J).set(Q.subarray(V,V+q*4));var Z=new Float32Array(1);return a(Z).set(Q.subarray(F,F+4)),L(F-L(0)),[J,Z[0]]}function p(x,T,C,E,w,D,R,M,N,_,v,S,P){var L=n.exports.sbrk,F=L(4),V=L(w*D),z=L(w*M),j=L(N.length*4),B=L(C*4),G=_?L(w):0,W=new Uint8Array(n.exports.memory.buffer);W.set(a(E),V),W.set(a(R),z),W.set(a(N),j),W.set(a(T),B),_&&W.set(a(_),G);var Q=x(B,C,V,w,D,z,M,j,N.length,G,v,S,P,F);W=new Uint8Array(n.exports.memory.buffer),a(T).set(W.subarray(B,B+Q*4)),a(E).set(W.subarray(V,V+w*D)),a(R).set(W.subarray(z,z+w*M));var q=new Float32Array(1);return a(q).set(W.subarray(F,F+4)),L(F-L(0)),[Q,q[0]]}function g(x,T,C,E){var w=n.exports.sbrk,D=w(C*E),R=new Uint8Array(n.exports.memory.buffer);R.set(a(T),D);var M=x(D,C,E);return w(D-w(0)),M}function m(x,T,C,E,w,D,R,M){var N=n.exports.sbrk,_=N(M*4),v=N(C*E),S=w?N(C*D):0,P=new Uint8Array(n.exports.memory.buffer);P.set(a(T),v),w&&P.set(a(w),S);var L=x(_,v,C,E,S,D,R,M);P=new Uint8Array(n.exports.memory.buffer);var F=new Uint32Array(L);return a(F).set(P.subarray(_,_+L*4)),N(_-N(0)),F}function y(x,T,C,E,w,D,R,M,N){var _=n.exports.sbrk,v=_(4),S=_(C*4),P=_(w*D),L=_(C*4),F=R?_(w):0,V=new Uint8Array(n.exports.memory.buffer);V.set(a(E),P),V.set(a(T),L),R&&V.set(a(R),F);var z=x(S,L,C,P,w,D,F,M,N,v);V=new Uint8Array(n.exports.memory.buffer);var j=new Uint32Array(z);a(j).set(V.subarray(S,S+z*4));var B=new Float32Array(1);return a(B).set(V.subarray(v,v+4)),_(v-_(0)),[j,B[0]]}function A(x,T,C,E,w,D,R){var M=n.exports.sbrk,N=M(C*4),_=M(w*D),v=M(C*4),S=new Uint8Array(n.exports.memory.buffer);S.set(a(E),_),S.set(a(T),v);var P=x(N,v,C,_,w,D,R);S=new Uint8Array(n.exports.memory.buffer);var L=new Uint32Array(P);return a(L).set(S.subarray(N,N+P*4)),M(N-M(0)),L}var b={LockBorder:1,Sparse:2,ErrorAbsolute:4,Prune:8,Regularize:16,Permissive:32,RegularizeLight:64,_InternalDebug:1<<30};return{ready:i,supported:!0,compactMesh:function(x){o(x instanceof Uint32Array||x instanceof Int32Array||x instanceof Uint16Array||x instanceof Int16Array),o(x.length%3==0);var T=x.BYTES_PER_ELEMENT==4?x:new Uint32Array(x),C=c(n.exports.meshopt_optimizeVertexFetchRemap,T,u(x)+1);if(x!==T)for(var E=0;E<T.length;++E)x[E]=T[E];return C},generatePositionRemap:function(x,T){return o(x instanceof Float32Array),o(x.length%T==0),o(T>=3),s(n.exports.meshopt_generatePositionRemap,x,x.length/T,T)},simplify:function(x,T,C,E,w,D){o(x instanceof Uint32Array||x instanceof Int32Array||x instanceof Uint16Array||x instanceof Int16Array),o(x.length%3==0),o(T instanceof Float32Array),o(T.length%C==0),o(C>=3),o(E>=0&&E<=x.length),o(E%3==0),o(w>=0);for(var R=0,M=0;M<(D?D.length:0);++M)o(D[M]in b),R|=b[D[M]];var N=x.BYTES_PER_ELEMENT==4?x:new Uint32Array(x),_=f(n.exports.meshopt_simplify,N,x.length,T,T.length/C,C*4,E,w,R);return _[0]=x instanceof Uint32Array?_[0]:new x.constructor(_[0]),_},simplifyWithAttributes:function(x,T,C,E,w,D,R,M,N,_){o(x instanceof Uint32Array||x instanceof Int32Array||x instanceof Uint16Array||x instanceof Int16Array),o(x.length%3==0),o(T instanceof Float32Array),o(T.length%C==0),o(C>=3),o(E instanceof Float32Array),o(E.length==w*(T.length/C)),o(w>=0),o(R==null||R instanceof Uint8Array),o(R==null||R.length==T.length/C),o(M>=0&&M<=x.length),o(M%3==0),o(N>=0),o(Array.isArray(D)),o(w>=D.length),o(D.length<=32);for(var v=0;v<D.length;++v)o(D[v]>=0);for(var S=0,v=0;v<(_?_.length:0);++v)o(_[v]in b),S|=b[_[v]];var P=x.BYTES_PER_ELEMENT==4?x:new Uint32Array(x),L=d(n.exports.meshopt_simplifyWithAttributes,P,x.length,T,T.length/C,C*4,E,w*4,new Float32Array(D),R,M,N,S);return L[0]=x instanceof Uint32Array?L[0]:new x.constructor(L[0]),L},simplifyWithUpdate:function(x,T,C,E,w,D,R,M,N,_){o(x instanceof Uint32Array||x instanceof Int32Array||x instanceof Uint16Array||x instanceof Int16Array),o(x.length%3==0),o(T instanceof Float32Array),o(T.length%C==0),o(C>=3),o(E instanceof Float32Array),o(E.length==w*(T.length/C)),o(w>=0),o(R==null||R instanceof Uint8Array),o(R==null||R.length==T.length/C),o(M>=0&&M<=x.length),o(M%3==0),o(N>=0),o(Array.isArray(D)),o(w>=D.length),o(D.length<=32);for(var v=0;v<D.length;++v)o(D[v]>=0);for(var S=0,v=0;v<(_?_.length:0);++v)o(_[v]in b),S|=b[_[v]];var P=x.BYTES_PER_ELEMENT==4?x:new Uint32Array(x),L=p(n.exports.meshopt_simplifyWithUpdate,P,x.length,T,T.length/C,C*4,E,w*4,new Float32Array(D),R,M,N,S);if(x!==P)for(var v=0;v<L[0];++v)x[v]=P[v];return L},getScale:function(x,T){return o(x instanceof Float32Array),o(x.length%T==0),o(T>=3),g(n.exports.meshopt_simplifyScale,x,x.length/T,T*4)},simplifyPoints:function(x,T,C,E,w,D){return o(x instanceof Float32Array),o(x.length%T==0),o(T>=3),o(C>=0&&C<=x.length/T),E?(o(E instanceof Float32Array),o(E.length%w==0),o(w>=3),o(x.length/T==E.length/w),m(n.exports.meshopt_simplifyPoints,x,x.length/T,T*4,E,w*4,D||0,C)):m(n.exports.meshopt_simplifyPoints,x,x.length/T,T*4,void 0,0,0,C)},simplifySloppy:function(x,T,C,E,w,D){o(x instanceof Uint32Array||x instanceof Int32Array||x instanceof Uint16Array||x instanceof Int16Array),o(x.length%3==0),o(T instanceof Float32Array),o(T.length%C==0),o(C>=3),o(E==null||E instanceof Uint8Array),o(E==null||E.length==T.length/C),o(w>=0&&w<=x.length),o(w%3==0),o(D>=0);var R=x.BYTES_PER_ELEMENT==4?x:new Uint32Array(x),M=y(n.exports.meshopt_simplifySloppy,R,x.length,T,T.length/C,C*4,E,w,D);return M[0]=x instanceof Uint32Array?M[0]:new x.constructor(M[0]),M},simplifyPrune:function(x,T,C,E){o(x instanceof Uint32Array||x instanceof Int32Array||x instanceof Uint16Array||x instanceof Int16Array),o(x.length%3==0),o(T instanceof Float32Array),o(T.length%C==0),o(C>=3),o(E>=0);var w=x.BYTES_PER_ELEMENT==4?x:new Uint32Array(x),D=A(n.exports.meshopt_simplifyPrune,w,x.length,T,T.length/C,C*4,E);return D=x instanceof Uint32Array?D:new x.constructor(D),D}}})();var bWt=(function(){var e="b9H79Tebbbe:neP9Geueu9Geub9Gbb9Giuuueu9Gmuuuuuuuuuuu9999eu9Gouuuuuueu9Gruuuuuuub9Gxuuuuuuuuuuuueu9Gxuuuuuuuuuuu99eu9GPuuuuuuuuuuuuu99b9Gouuuuuub9Gwuuuuuuuub9Gvuuuuub9GluuuubiQXdilvorwDqokoqxmbiibeilve9Weiiviebeoweuecj:Gdkr;Zeqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9I919P29K9nW79O2Wt79c9V919U9KbeY9TW79O9V9Wt9F9I919P29K9nW79O2Wt7S2W94bd39TW79O9V9Wt9F9I919P29K9nW79O2Wt79t9W9Ht9P9H2bo39TW79O9V9Wt9F9J9V9T9W91tWJ2917tWV9c9V919U9K7bw39TW79O9V9Wt9F9J9V9T9W91tW9nW79O2Wt9c9V919U9K7bkE9TW79O9V9Wt9F9J9V9T9W91tW9t9W9OWVW9c9V919U9K7bxL9TW79O9V9Wt9F9V9Wt9P9T9P96W9nW79O2WtbPl79IV9RbsDwebcekdOAq;W:leXdbkIbabaec9:fgefcufae9Ugeabci9Uadfcufad9Ugbaeab0Ek:88JDPue99eux99due99euo99iu8Jjjjjbc:WD9Rgm8KjjjjbdndnalmbcbhPxekamc:Cwfcbc;Kbz:rjjjb8AcuaocdtgsaocFFFFi0Ehzcbyd;0:G:cjbhHdndnalcb9imbaoal9nmbamazaHHjjjjbbgHBd:CwamceBd;8wamazcbyd;0:G:cjbHjjjjbbgOBd:GwamcdBd;8wamcualcdtalcFFFFi0Ecbyd;0:G:cjbHjjjjbbgABd:KwamciBd;8waihzalhsinaHazydbcdtfcbBdbazclfhzascufgsmbkaihzalhsinaHazydbcdtfgCaCydbcefBdbazclfhzascufgsmbkaihzalhCcbhXindnaHazydbcdtgQfgsydbcb9imbaOaQfaXBdbasasydbgQcjjjj94VBdbaQaXfhXkazclfhzaCcufgCmbkalci9UhLdnalci6mbcbhzaihsinascwfydbhCasclfydbhXaOasydbcdtfgQaQydbgQcefBdbaAaQcdtfazBdbaOaXcdtfgXaXydbgXcefBdbaAaXcdtfazBdbaOaCcdtfgCaCydbgCcefBdbaAaCcdtfazBdbascxfhsaLazcefgz9hmbkkaihzalhsindnaHazydbcdtgCfgXydbgQcu9kmbaXaQcFFFFrGgQBdbaOaCfgCaCydbaQ9RBdbkazclfhzascufgsmbxdkkamazaHHjjjjbbgHBd:CwamceBd;8wamazcbyd;0:G:cjbHjjjjbbgOBd:GwamcdBd;8wamcualcdtalcFFFFi0Ecbyd;0:G:cjbHjjjjbbgABd:KwamciBd;8waHcbasz:rjjjbhXaihzalhsinaXazydbcdtfgCaCydbcefBdbazclfhzascufgsmbkalci9UhLdnaoTmbcbhzaOhsaXhCaohQinasazBdbasclfhsaCydbazfhzaCclfhCaQcufgQmbkkdnalci6mbcbhzaihsinascwfydbhCasclfydbhQaOasydbcdtfgKaKydbgKcefBdbaAaKcdtfazBdbaOaQcdtfgQaQydbgQcefBdbaAaQcdtfazBdbaOaCcdtfgCaCydbgCcefBdbaAaCcdtfazBdbascxfhsaLazcefgz9hmbkkaoTmbcbhzaohsinaOazfgCaCydbaXazfydb9RBdbazclfhzascufgsmbkkamaLcbyd;0:G:cjbHjjjjbbgzBd:OwamclBd;8wazcbaLz:rjjjbhYamcuaLcK2alcjjjjd0Ecbyd;0:G:cjbHjjjjbbg8ABd:SwamcvBd;8wJbbbbhEdnalci6g3mbarcd4hKaihsa8AhzaLhrJbbbbh5inavasclfydbaK2cdtfgCIdlh8EavasydbaK2cdtfgXIdlhEavascwfydbaK2cdtfgQIdlh8FaCIdwhaaXIdwhhaQIdwhgazaCIdbg8JaXIdbg8KMaQIdbg8LMJbbnn:vUdbazclfaXIdlaCIdlMaQIdlMJbbnn:vUdbaQIdwh8MaCIdwh8NaXIdwhyazcxfa8EaE:tg8Eagah:tggNaaah:tgaa8FaE:tghN:tgEJbbbbJbbjZa8Ja8K:tg8FahNa8Ea8La8K:tg8KN:tghahNaEaENaaa8KNa8FagN:tgEaENMMg8K:rg8E:va8KJbbbb9BEg8KNUdbazczfaEa8KNUdbazcCfaha8KNUdbazcwfa8Maya8NMMJbbnn:vUdba5a8EMh5ascxfhsazcKfhzarcufgrmbka5aL:Z:vJbbbZNhEkamcuaLcdtalcFFFF970Ecbyd;0:G:cjbHjjjjbbgCBd:WwamcoBd;8waq:Zhhdna3mbcbhzaChsinasazBdbasclfhsaLazcefgz9hmbkkaEahNhhamcuaLcltalcFFFFd0Ecbyd;0:G:cjbHjjjjbbg8PBd:0wamcrBd;8wcba8Pa8AaCaLcbz:djjjb8AJFFuuh8MJFFuuh8NJFFuuhydnalci6mbJFFuuhya8AhzaLhsJFFuuh8NJFFuuh8MinazcwfIdbgEa8Ma8MaE9EEh8MazclfIdbgEa8Na8NaE9EEh8NazIdbgEayayaE9EEhyazcKfhzascufgsmbkkah:rhEamaocetgzcuaocu9kEcbyd;0:G:cjbHjjjjbbgCBd:4wdndnaoal9nmbaihzalhsinaCazydbcetfcFFi87ebazclfhzascufgsmbxdkkaCcFeazz:rjjjb8AkaEJbbbZNh8JcuhIdnalci6mbcbhsJFFuuhEa8AhzcuhIinazcwfIdba8M:tghahNazIdbay:tghahNazclfIdba8N:tghahNMM:rghaEaIcuSahaE9DVgXEhEasaIaXEhIazcKfhzaLascefgs9hmbkkamczfcbcjwz:rjjjb8Aam9cb83iwam9cb83ibaxa8JNh8RJbbjZak:th8Lcbh8SJbbbbhRJbbbbh8UJbbbbh8VJbbbbh8WJbbbbh8XJbbbbh8Ycbh8ZcbhPinJbbbbhEdna8STmbJbbjZa8S:Z:vhEkJbbbbhhdna8Ya8YNa8Wa8WNa8Xa8XNMMg8KJbbbb9BmbJbbjZa8K:r:vhhka8VaENh8Ka8UaENh5aRaENh8EaIhLdndndndndna8SaPVTmbamydwg80Tmea8YahNh8Fa8XahNhaa8WahNhgaeamydbcdtfh81cbh3JFFuuhEcvhQcuhLindnaHa81a3cdtfydbcdtgzfydbgvTmbaAaOazfydbcdtfhsindndnaCaiasydbgKcx2fgzclfydbgrcetf8Vebcs4aCazydbgXcetf8Vebcs4faCazcwfydbglcetf8Vebcs4fgombcbhzxekcehzaHaXcdtfydbgXceSmbcehzaHarcdtfydbgrceSmbcehzaHalcdtfydbglceSmbdnarcdSaXcdSfalcdSfcd6mbaocefhzxekaocdfhzkdnazaQ9kmba8AaKcK2fgXIdwa8K:tghahNaXIdba8E:tghahNaXIdla5:tghahNMM:ra8J:va8LNJbbjZMJ9VO:d86JbbjZaXIdCa8FNaXIdxagNaaaXIdzNMMakN:tghahJ9VO:d869DENghaEazaQ6ahaE9DVgXEhEaKaLaXEhLazaQaXEhQkasclfhsavcufgvmbkka3cefg3a809hmbkkaLcu9hmekama8KUd:ODama5Ud:KDama8EUd:GDamcuBd:qDamcFFF;7rBdjDa8Pcba8AaYamc:GDfamc:qDfamcjDfz:ejjjbamyd:qDhLdndnaxJbbbb9ETmba8SaD6mbaLcuSmeceh3amIdjDa8R9EmixdkaLcu9hmekdna8STmbabaPcltfgHam8Piw83dwaHam8Pib83dbaPcefhPkc3hHinamc:CwfaHfydbcbyd;4:G:cjbH:bjjjbbaHc98fgHc989hmbxvkkcbh3a8Saq9pmbamydwaCaiaLcx2fgzydbcetf8Vebcs4aCazcwfydbcetf8Vebcs4faCazclfydbcetf8Vebcs4ffaw9nmekcbhzcbhsdna8ZTmbcbhsamczfhXinamczfascdtfaXydbgQBdbaXclfhXasaYaQfRbbTfhsa8Zcufg8ZmbkkamydwhlamydbhXam9cu83i:GDam9cu83i:ODam9cu83i:qDam9cu83i:yDinamcjDfazfcFFF;7rBdbazclfgzcz9hmbkasc;8easclfc:bd6Eg8Zcdth80dnalTmbaeaXcdtfhocbhrindnaHaoarcdtfydbcdtgzfydbgvTmbaAaOazfydbcdtfhscuhQcuhzinaHaiasydbgKcx2fgXclfydbcdtfydbaHaXydbcdtfydbfaHaXcwfydbcdtfydbfgXazaXaz6gXEhzaKaQaXEhQasclfhsavcufgvmbkaQcuSmba8AaQcK2fgsIdwa8M:tgEaENasIdbay:tgEaENasIdla8N:tgEaENMM:rhEcbhsindndnazamc:qDfasfgvydbgX6mbazaX9hmeaEamcjDfasfIdb9FTmekavazBdbamc:GDfasfaQBdbamcjDfasfaEUdbxdkasclfgscz9hmbkkarcefgral9hmbkkamczfa80fhQcbhzcbhsindnamc:GDfazfydbgXcuSmbaQascdtfaXBdbascefhskazclfgzcz9hmbkasa8Zfg8ZTmbJFFuuhhcuhKamczfhza8ZhvcuhQina8AazydbgXcK2fgsIdwa8M:tgEaENasIdbay:tgEaENasIdla8N:tgEaENMM:rhEdndnaHaiaXcx2fgsclfydbcdtfydbaHasydbcdtfydbfaHascwfydbcdtfydbfgsaQ6mbasaQ9hmeaEah9DTmekaEhhashQaXhKkazclfhzavcufgvmbkaKcuSmbaKhLkdnamaiaLcx2fgrydbarclfydbarcwfydbaCabaeadaPawaqa3z:fjjjbTmbaPcefhPJbbbbhRJbbbbh8UJbbbbh8VJbbbbh8WJbbbbh8XJbbbbh8YkcbhXinaAaOaraXcdtfydbcdtgsfydbcdtfgKhzaHasfgvydbgQhsdnaQTmbdninazydbaLSmeazclfhzascufgsTmdxbkkazaKaQcdtfc98fydbBdbavavydbcufBdbkaXcefgXci9hmbka8AaLcK2fgzIdbhEazIdlhhazIdwh8KazIdxh5azIdzh8EazIdCh8FaYaLfce86bba8Ya8FMh8Ya8Xa8EMh8Xa8Wa5Mh8Wa8Va8KMh8Va8UahMh8UaRaEMhRamydxh8Sxbkkamc:WDf8KjjjjbaPkjoivuv99lu8Jjjjjbca9Rgo8Kjjjjbdndnalcw0mbaiydbhraeabcitfgwalcdtciVBdlawarBdbdnalcd6mbaiclfhralcufhDawcxfhwinarydbhqawcuBdbawc98faqBdbawcwfhwarclfhraDcufgDmbkkalabfhwxekcbhqaocbBdKao9cb83izaocbBdwao9cb83ibJbbjZhkJbbjZhxinadaiaqcdtfydbcK2fhDcbhwinaoczfawfgraDawfIdbgmarIdbgP:tgsaxNaPMgPUdbaoawfgrasamaP:tNarIdbMUdbawclfgwcx9hmbkJbbjZakJbbjZMgk:vhxaqcefgqal9hmbkcbhradcbcecdaoIdlgmaoIdwgP9GEgwaoIdbgsaP9GEawasam9GEgzcdtgwfhHaoczfawfIdbhmaihwalhDinaiarcdtfgqydbhOaqawydbgABdbawaOBdbawclfhwaraHaAcK2fIdbam9DfhraDcufgDmbkdndnarcv6mbavc8X9kmbaralc98f6mekaiydbhraeabcitfgwalcdtciVBdlawarBdbaiclfhralcufhDawcxfhwinarydbhqawcuBdbawc98faqBdbawcwfhwarclfhraDcufgDmbkalabfhwxekaeabcitfgwamUdbawawydlc98GazVBdlabcefaeadaiaravcefgqz:djjjbhDawawydlciGaDabcu7fcdtVBdlaDaeadaiarcdtfalar9Raqz:djjjbhwkaocaf8Kjjjjbawk;Oddvue99dninabaecitfgrydlgwcd4gDTmednawciGgqci9hmbcihqdnawcl6mbabaecitfhbcbheawhqcehkindnaiabydbgDfRbbmbcbhkadaDcK2fgwIdwalIdw:tgxaxNawIdbalIdb:tgxaxNawIdlalIdl:tgxaxNMM:rgxaoIdb9DTmbaoaxUdbavaDBdbarydlhqkabcwfhbaecefgeaqcd46mbkakceGTmikaraqciGBdlskdnabcbaDalaqcdtfIdbarIdb:tgxJbbbb9FEgwaD7aecefgDfgecitfydlabawaDfgDcitfydlVci0mbaraqBdlkabaDadaialavaoz:ejjjbax:laoIdb9Fmbkkkjlevudndnabydwgxaladcetfgm8Vebcs4alaecetfgP8Vebgscs4falaicetfgz8Vebcs4ffaD0mbakmbcbhDabydxaq6mekavawcltfgxab8Pdw83dwaxab8Pdb83dbabydbhDdnabydwgwTmbaoaDcdtfhxawhsinalaxydbcetfcFFi87ebaxclfhxascufgsmbkkabaDawfBdbabydxhxab9cb83dwababydlaxci2fBdlaP8VebhscehDcbhxkdnascztcz91cu9kmbabaxcefBdwaPax87ebaoabydbcdtfaxcdtfaeBdbkdnam8Uebcu9kmbababydwgxcefBdwamax87ebaoabydbcdtfaxcdtfadBdbkdnaz8Uebcu9kmbababydwgxcefBdwazax87ebaoabydbcdtfaxcdtfaiBdbkarabydlfabydxci2faPRbb86bbarabydlfabydxci2fcefamRbb86bbarabydlfabydxci2fcdfazRbb86bbababydxcefBdxaDk:mPrHue99eue99eue99iu8Jjjjjbc;W;Gb9Rgx8KjjjjbdndnalmbcbhmxekcbhPaxc:m;Gbfcbc;Kbz:rjjjb8Aaxcualci9UgscltascjjjjiGEcbyd;0:G:cjbHjjjjbbgzBd:m9GaxceBd;S9GaxcuascK2gHcKfalcpFFFe0Ecbyd;0:G:cjbHjjjjbbgOBd:q9GaxcdBd;S9Gdnalci6gAmbarcd4hCascdthXaOhQazhLinavaiaPcx2fgrydwaC2cdtfhKavarydlaC2cdtfhYavarydbaC2cdtfh8AcbhraLhEinaQarfgma8Aarfg3Idbg5aYarfg8EIdbg8Fa5a8F9DEg5UdbamaKarfgaIdbg8Fa5a8Fa59DEg8FUdbamcxfgma3Idbg5a8EIdbgha5ah9EEg5UdbamaaIdbgha5aha59EEg5UdbaEa8Fa5MJbbbZNUdbaEaXfhEarclfgrcx9hmbkaQcKfhQaLclfhLaPcefgPas9hmbkkaOaHfgr9cb83dbar9cb83dzar9cb83dwaxcuascx2gralc:bjjjl0Ecbyd;0:G:cjbHjjjjbbgHBdN9GaxciBd;S9GascdthgazarfhvaxcwVhPaxclVhCaHh8Jazh8KcbhLinaxcbcj;Gbz:rjjjbhEaLas2cdthadnaAmba8Khrash3inaEarydbgmc8F91cjjjj94Vam7gmcQ4cx2fg8Ea8EydwcefBdwaEamcd4cFrGcx2fg8Ea8EydbcefBdbaEamcx4cFrGcx2fgmamydlcefBdlarclfhra3cufg3mbkkazaafh8AaHaafhXcbhmcbh3cbh8EcbhainaEamfgrydbhQara3BdbarcwfgKydbhYaKaaBdbarclfgrydbhKara8EBdbaQa3fh3aYaafhaaKa8Efh8Eamcxfgmcj;Gb9hmbkdnaAmbcbhravhminamarBdbamclfhmasarcefgr9hmbkavhrashminaEa8Aarydbg3cdtfydbg8Ec8F91a8E7cd4cFrGcx2fg8Ea8Eydbg8EcefBdbaXa8Ecdtfa3Bdbarclfhramcufgmmbka8JhrashminaCa8Aarydbg3cdtfydbg8Ec8F91a8E7cx4cFrGcx2fg8Ea8Eydbg8EcefBdbava8Ecdtfa3BdbarclfhramcufgmmbkavhrashminaPa8Aarydbg3cdtfydbg8Ec8F91cjjjj94Va8E7cQ4cx2fg8Ea8Eydbg8EcefBdbaXa8Ecdtfa3Bdbarclfhramcufgmmbkka8Jagfh8Ja8Kagfh8KaLcefgLci9hmbkaEaocetgrcuaocu9kEcbyd;0:G:cjbHjjjjbbgKBd:y9GaEclBd;S9Gdndnaoal9nmbaihralhminaKarydbcetfcFFi87ebarclfhramcufgmmbxdkkaKcFearz:rjjjb8Akcbh8EaEascbyd;0:G:cjbHjjjjbbg8ABd:C9GaOaHaHascdtfaHascitfa8AascbazaKaiawaDaqakz:hjjjbdndnalci6mba8Ahrashmina8EarRbbfh8EarcefhramcufgmmbkaE9cb83iwaE9cb83ibalawc9:fgrfcufar9UgrasaDfcufaD9Ugmaram0EhYcbhmcbhra8Ehaincbh3dnarTmba8AarfRbbceSh3kamaEaiaHydbcx2fgQydbaQclfydbaQcwfydbaKabaeadamawaqa3a3ce7a8EaY9nVaaamfaY6VGz:fjjjbfhmaHclfhHaaa8AarfRbb9Rhaasarcefgr9hmbkaEydxTmeabamcltfgraE8Piw83dwaraE8Pib83dbamcefhmxekaE9cb83iwaE9cb83ibcbhmkczhrinaEc:m;Gbfarfydbcbyd;4:G:cjbH:bjjjbbarc98fgrc989hmbkkaxc;W;Gbf8Kjjjjbamk:wKDQue99iue99iul9:euw99iu8Jjjjjbc;qb9RgP8Kjjjjbaxhsaxhzdndnavax0gHmbdnavTmbcbhOaehzavhAinawaDazydbcx2fgCcwfydbcetfgX8VebhQawaCclfydbcetfgL8VebhKawaCydbcetfgC8VebhYaXce87ebaLce87ebaCce87ebaOaKcs4aYcs4faQcs4ffhOazclfhzaAcufgAmbkaehzavhAinawaDazydbcx2fgCcwfydbcetfcFFi87ebawaCclfydbcetfcFFi87ebawaCydbcetfcFFi87ebazclfhzaAcufgAmbkcehzaqhsaOaq0mekalce86bbalcefcbavcufz:rjjjb8AxekaPaiBdxaPadBdwaPaeBdlavakaqci9Ug8Aaka8Aak6EaHEgK9RhEaxaK9Rh3aKcufh5aKceth8EaKcdtgCc98fh8FavcitgOaC9Rarfc98fhaascufhhavcufhgaraOfh8JJbbjZas:Y:vh8KcbazceakaxSEg8Lcdtg8M9Rh8NJFFuuhycuh8PcbhIcbh8RinaPclfa8RcdtfydbhQaPcb8Pd:y:G:cjbg8S83i9iaPcb8Pd:q:G:cjbgR83inaPcb8Pd1:G:cjbg8U83iUaPcb8Pdj:G:cjbg8V83i8WaPa8S83iyaPaR83iaaPa8U83iKaPa8V83izaQavcdtgYfh8WcbhXinabaQaXcdtgLfydbcK2fhAcbhzinaPc8WfazfgCaAazfgOIdbg8XaCIdbg8Ya8Xa8Y9DEUdbaCczfgCaOcxfIdbg8XaCIdbg8Ya8Xa8Y9EEUdbazclfgzcx9hmbkaba8WaXcu7cdtfydbcK2fhAcbhzaPIdUh8ZaPId9ih80aPId80h81aPId9ehBaPId8Wh83aPIdnhUinaPczfazfgCaAazfgOIdbg8XaCIdbg8Ya8Xa8Y9DEUdbaCczfgCaOcxfIdbg8XaCIdbg8Ya8Xa8Y9EEUdbazclfgzcx9hmbkaraLfgza80a8Z:tg8XaUa83:tg8YNa8YaBa81:tg8ZNa8Za8XNMMUdbazaYfaPIdyaPIdK:tg8XaPIdaaPIdz:tg8YNa8YaPId8KaPIdC:tg8ZNa8Za8XNMMUdbaXcefgXav9hmbkcbh85dnaHmbcbhAaQhza8JhCavhXinawaDazydbcx2fgOcwfydbcetfgL8Vebh8WawaOclfydbcetfg858Vebh86awaOydbcetfgO8Vebh87aLce87eba85ce87ebaOce87ebaCaAa86cs4a87cs4fa8Wcs4ffgABdbazclfhzaCclfhCaXcufgXmbkavhCinawaDaQydbcx2fgzcwfydbcetfcFFi87ebawazclfydbcetfcFFi87ebawazydbcetfcFFi87ebaQclfhQaCcufgCmbka8Jh85kdndndndndndndndndndndnava8E6mba8Eax9nmeavavaK9UgzaK29Raza320mda5aE9pmqa85Th87ceh8WaEhQxwka5ag9pmDa8Eax9nmixokavaK6mea5aE9pmwcehQaEhXa85Tmixlka5ag6mlxrka5ag9pmokcbhQaghXa85mekJFFuuh8XcbhLa5hzindnazcefgCaK6mbaQavaC9RgOaK6GmbarazcdtfIdbg8YaC:YNaravaz9RcdtfaYfc94fIdbg8ZaO:YNMg80a8X9Embdndna8KaOahf:YNg81:lJbbb9p9DTmba81:OhAxekcjjjj94hAka8ZasaA2aO9R:YNh8Zdndna8Kazasf:YNg81:lJbbb9p9DTmba81:OhOxekcjjjj94hOkamasaO2aC9R:Ya8YNa8ZMNa80Mg8Ya8Xa8Ya8X9DgOEh8XaCaLaOEhLkaza8LfgzaX6mbxlkkJFFuuh8XcbhLaEhCaahAa8FhOaKhzindnazaK6mbaQaCaK6GmbaraOfIdbg8Yaz:YNaAIdbg8ZaC:YNMg80a8X9Embdndna8Ka85aOfydbgYahf:YNg81:lJbbb9p9DTmba81:Oh8Wxekcjjjj94h8Wkamasa8W2aY9R:Yg81a8YNa8Za81NMNa80Mg8Ya8Xa8Ya8X9DgYEh8XazaLaYEhLkaCa8L9RhCaAa8NfhAaOa8MfhOaza8LfgzcufaX6mbxikka85Th87cbh8WaghQkJFFuuh8XcbhLaEhCaahAa8FhOaKhzindnazazaK9UgXaK29RaXa320mbdna8WTmbaCaCaK9UgXaK29RaXa320mekaraOfIdbg8Yaz:YNaAIdbg8ZaC:YNMg80a8X9EmbazhXaChYdna87mba85aOfydbgXhYkdndna8KaYahf:YNg81:lJbbb9p9DTmba81:Oh86xekcjjjj94h86ka8Zasa862aY9R:YNh8Zdndna8KaXahf:YNg81:lJbbb9p9DTmba81:OhYxekcjjjj94hYkamasaY2aX9R:Ya8YNa8ZMNa80Mg8Ya8Xa8Ya8X9DgXEh8XazaLaXEhLkaCa8L9RhCaAa8NfhAaOa8MfhOaza8LfgzcufaQ6mbkkaLTmba8Xay9DTmba8XhyaLhIa8Rh8Pka8Rcefg8Rci9hmbkdndnaoc8X9kmba8Pcb9omeka8Acufh85cbhYindndndnavaY9RaxaYaxfav0Eg8WTmbcbhAaeaYcdtfgzhCa8WhXinawaDaCydbcx2fgOcwfydbcetfgQ8VebhbawaOclfydbcetfgL8VebhrawaOydbcetfgO8VebhKaQce87ebaLce87ebaOce87ebaAarcs4aKcs4fabcs4ffhAaCclfhCaXcufgXmbka8WhOinawaDazydbcx2fgCcwfydbcetfcFFi87ebawaCclfydbcetfcFFi87ebawaCydbcetfcFFi87ebazclfhzaOcufgOmbkaAaq0mekalaYfgzce86bbazcefcba8Wcufz:rjjjb8AxekalaYfgzce86bbazcefcba85z:rjjjb8Aa8Ah8Wka8WaYfgYav9pmdxbkkaravcdtg8WfhLdnaITmbaPclfa8PcdtfydbhzaIhCinaLazydbfcb86bbazclfhzaCcufgCmbkkdnavaI9nmbaPclfa8PcdtfydbaIcdtfhzavaI9RhCinaLazydbfce86bbazclfhzaCcufgCmbkkcbhYindnaYa8PSmbcbhzaraPclfaYcdtfydbgKa8Wz:qjjjbhCavhXaIhOinaKaOazaLaCydbgQfRbbgAEcdtfaQBdbaCclfhCaOaAfhOazaA9RcefhzaXcufgXmbkkaYcefgYci9hmbkabaeadaialaIaocefgCarawaDaqakaxamz:hjjjbabaeaIcdtgzfadazfaiazfalaIfavaI9RaCarawaDaqakaxamz:hjjjbkaPc;qbf8Kjjjjbk:Seeru8Jjjjjbc:q;ab9Rgo8Kjjjjbaoc:q8WfcFecjzz:rjjjb8AcbhrdnadTmbaehwadhDinaoarcdtfawydbgqBdbaoc:q8WfaqcFiGcdtfgkydbhxakaqBdbawclfhwaraxaq9hfhraDcufgDmbkkabaeadaoaraiavz:jjjjbaoc:q;abf8Kjjjjbk;Sqloud99euD998Jjjjjbc:W;ab9Rgr8KjjjjbdndnadTmbaocd4hwcbhDcbhqindnavaeclfydbaw2cdtfgkIdbavaeydbaw2cdtfgxIdbgm:tgPavaecwfydbaw2cdtfgsIdlaxIdlgz:tgHNakIdlaz:tgOasIdbam:tgAN:tgCaCNaOasIdwaxIdwgX:tgQNakIdwaX:tgOaHN:tgHaHNaOaANaPaQN:tgPaPNMMgOJbbbb9Bmbarc8WfaDcltfgkaCaO:rgO:vgCUdwakaPaO:vgPUdlakaHaO:vgHUdbakaCaXNaHamNazaPNMM:mUdxaDcefhDkaecxfheaqcifgqad6mbkab9cb83dyab9cb83daab9cb83dKab9cb83dzab9cb83dwab9cb83dbaDTmearcbBd8Sar9cb83iKar9cb83izarczfavalaoarc8Sfcbcraiz:kjjjbarIdKhQarIdChLarIdzhKar9cb83iwar9cb83ibararc8WfaDczarc8Sfcbcicbz:kjjjbJbbbbhmdnarIdwgzazNarIdbgHaHNarIdlgXaXNMMgCJbbbb9BmbJbbjZaC:r:vhmkazamNhCaXamNhXaHamNhHJbbjZhmarc8WfheaDhvinaecwfIdbaCNaeIdbaHNaXaeclfIdbNMMgzamazam9DEhmaeczfheavcufgvmbkabaQUdwabaLUdlabaKUdbabarId3UdxdndnamJ;n;m;m899FmbJbbbbhzarc8WfheinaecxfIdbaQaecwfIdbgPNaKaeIdbgONaLaeclfIdbgANMMMaCaPNaHaONaXaANMM:vgPazaPaz9EEhzaeczfheaDcufgDmbkabaCUd8KabaXUdaabaHUd3abaQaCazN:tUdKabaLaXazN:tUdCabaKaHazN:tUdzabJbbjZamamN:t:rgmUdydndnaCJbbj:;aCJbbj:;9GEgzJbbjZazJbbjZ9FEJbb;:9cNJbbbZJbbb:;aCJbbbb9GEMgz:lJbbb9p9DTmbaz:Ohexekcjjjj94hekabae86b8UdndnaXJbbj:;aXJbbj:;9GEgzJbbjZazJbbjZ9FEJbb;:9cNJbbbZJbbb:;aXJbbbb9GEMgz:lJbbb9p9DTmbaz:Ohvxekcjjjj94hvkabav86bRdndnaHJbbj:;aHJbbj:;9GEgzJbbjZazJbbjZ9FEJbb;:9cNJbbbZJbbb:;aHJbbbb9GEMgz:lJbbb9p9DTmbaz:Ohwxekcjjjj94hwkabaw86b8SdndnaecKtcK91:YJbb;:9c:vaC:t:lavcKtcK91:YJbb;:9c:vaX:t:lawcKtcK91:YJbb;:9c:vaH:t:lamMMMJbb;:9cNJbbjZMgm:lJbbb9p9DTmbam:Ohexekcjjjj94hekaecFbaecFb9iEhexekabcjjj;8iBdycFbhekabae86b8Vxekab9cb83dyab9cb83daab9cb83dKab9cb83dzab9cb83dwab9cb83dbkarc:W;abf8Kjjjjbk;7woDuo99eue99euv998Jjjjjbcje9Rgw8Kjjjjbawc;abfcbaocdtgDz:rjjjb8Aawc;GbfcbaDz:rjjjb8AawcafhDawhqaohkinaqcFFF97BdbaDcFFF;7rBdbaqclfhqaDclfhDakcufgkmbkavcd4hxaicd4hmdnadTmbaocx2hPcbhsinashzdnarTmbarascdtfydbhzkaeazam2cdtfgDIdwhHaDIdlhOaDIdbhAalazax2cdtfIdbhCcbhDawcafhqawc;Gbfhvawhkawc;abfhiinaCaDc:O:G:cjbfIdbaHNaDc:G:G:cjbfIdbaANaDc:K:G:cjbfIdbaONMMgXMhQazhLdnaXaC:tgXaqIdbgK9DgYmbavydbhLkavaLBdbazhLdnaQakIdbg8A9EmbaiydbhLa8AhQkaiaLBdbakaQUdbaqaXaKaYEUdbaiclfhiakclfhkavclfhvaqclfhqaPaDcxfgD9hmbkascefgsad9hmbkkJbbbbhQcbhLawc;GbfhDawc;abfhqcbhkinalaqydbgvax2cdtfIdbalaDydbgiax2cdtfIdbaeavam2cdtfgvIdwaeaiam2cdtfgiIdw:tgCaCNavIdbaiIdb:tgCaCNavIdlaiIdl:tgCaCNMM:rMMgCaQaCaQ9EgvEhQakaLavEhLaqclfhqaDclfhDaoakcefgk9hmbkJbbbbhCdnaeawc;abfaLcdtgqfydbgkam2cdtfgDIdwaeawc;Gbfaqfydbgvam2cdtfgqIdwgH:tgXaXNaDIdbaqIdbgA:tg8Aa8ANaDIdlaqIdlgE:tgOaONMMgKJbbbb9ETmbaK:rgCalakax2cdtfIdbMalavax2cdtfIdb:taCaCM:vhCkaQJbbbZNhKaXaCNaHMhHaOaCNaEMhOa8AaCNaAMhAdnadTmbcbhqarhkinaqhDdnarTmbakydbhDkdnalaDax2cdtfIdbg3aeaDam2cdtfgDIdwaH:tgQaQNaDIdbaA:tgCaCNaDIdlaO:tgXaXNMMg5:rgEMg8EaK9ETmbJbbbbh8Adna5Jbbbb9ETmba8EaK:taEaEM:vh8Aka8AaQNaHMhHa8AaXNaOMhOa8AaCNaAMhAa3aKaEMMJbbbZNhKkakclfhkadaqcefgq9hmbkkabaKUdxabaHUdwabaOUdlabaAUdbawcjef8Kjjjjbk:reevu8Jjjjjbcj8W9Rgr8Kjjjjbaici2hwcbhDdnaiTmbarhiawhqinaiaeadRbbgkcdtfydbBdbaDakcefgkaDak0EhDaiclfhiadcefhdaqcufgqmbkkabarawaeaDalaoz:jjjjbarcj8Wf8Kjjjjbk:Eeeeu8Jjjjjbca9Rgo8Kjjjjbab9cb83dyab9cb83daab9cb83dKab9cb83dzab9cb83dwab9cb83dbdnadTmbaocbBd3ao9cb83iwao9cb83ibaoaeadaialaoc3falEavcbalEcrcbz:kjjjbabao8Pib83dbabao8Piw83dwkaocaf8Kjjjjbk::meQu8Jjjjjbcjz9Rgv8KjjjjbcbhoavcjPfcbaez:rjjjb8Aavcjxfcbaez:rjjjb8AdnaiTmbadhoaihrinavcjxfaoRbbfgwawRbbcef86bbavcjxfaocefRbbfgwawRbbcef86bbavcjxfaocdfRbbfgwawRbbcef86bbaocifhoarcufgrmbkcbhDcjehoadhqcehkindndnalTmbcbhxcuhmaqhrakhwcuhPinawcufamaoavcjPfarcefRbbgsfRbb9RcFeGgzci6aoavcjPfarRbbgHfRbb9RcFeGgOci6faoavcjPfarcdfRbbgAfRbb9RcFeGgCci6fgXcOtaOcFr7azaCf9RcwtVavcjxfaAfRbbgzavcjxfaHfRbbgHavcjxfasfRbbgsaHas6Egsazas6EcFe7VgsaP9kgzEhmaXcd6gHaxcefgOal9iVce9hmdasaPazEhPaxaOaHEhxarcifhrawai6hsawcefhwasmbxdkkcuhmaqhrakhwcuhxinawcufamaoavcjPfarcefRbbfRbb9RcFeGci6aoavcjPfarRbbfRbb9RcFeGci6faoavcjPfarcdfRbbfRbb9RcFeGci6fgPax9kgsEhmaPce0meaPaxasEhxarcifhrawai6hPawcefhwaPmbkkadamci2fgrcdfRbbhwarcefRbbhxarRbbhPadaDci2fgrcifaramaD9Rci2zNjjjb8AaPavcjPffaocefgo86bbaPavcjxffgmamRbbcuf86bbaxavcjPffao86bbaxavcjxffgmamRbbcuf86bbarcdfaw86bbarcefax86bbaraP86bbawavcjPffao86bbawavcjxffgrarRbbcuf86bbaqcifhqakcefhkaDcefgDai9hmbkcbhzdnalcb9mmbcbhsavcjPfcbaez:rjjjb8Aadcvfhlinadasci2fgxcefgDRbbhoaxcdfgqRbbhrdndnavcjPfaxRbbgmfRbbmbavcjPfarfRbbhwdndndnavcjPfaofRbbTmbawcFeGTmexikawcFeGmdascefgAai9pmdasc980mdascifhQcbhLarcFeGhCamcFeGhXalhwcbhKcbhYinawcufRbbhPawRbbhOcehkdndnawc9:fRbbgHao9hmbaPcFeGamSmekdnaPcFeGao9hmbaOcFeGamSmekaHamSaOcFeGaoSGhkkceh8AaYceGhYdndnaHar9hmbaPcFeGaoSmekdnaPcFeGar9hmbaOcFeGaoSmekaHaoSaOcFeGarSGh8AkakaYVhYaLaHcFeGgHaXSaPcFeGgPaCSGaPaXSaOcFeGgPaCSGVaHaCSaPaXSGVVhLa8AaKceGVhKdnaAcefgPai9pmbawcifhwaAaQ6hHaPhAaHmekkaYTmeaKmekarhwaohPaohHarhOamhrxdkdnaYTaLVceGTmbaYaKTVaLVceGmekamhwarhParhHamhOaohrxekaohwamhPamhHaohOkavcjPfarfce86bbavcjPfawfce86bbaxaH86bbaqar86bbaDaO86bbavcjPfaPfce86bbalcifhlascefgsai9hmbkkavcFeaecetz:rjjjbhwaici2hrindnawadRbbgmcetfgx8Uebgocu9kmbaxaz87ebawcjlfazcdtfabamcdtfydbBdbazhoazcefhzkadao86bbadcefhdarcufgrmbkazcdthokabavcjlfaoz:qjjjb8Aavcjzf8KjjjjbkObabaiaeadcbz:njjjbk9teiucbcbyd;8:G:cjbgeabcifc98GfgbBd;8:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd;8:G:cjbgeabcrfc94GfgbBd;8:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikTeeucbabcbyd;8:G:cjbge9Rcifc98GaefgbBd;8:G:cjbdnabZbcztge9nmbabae9RcFFifcz4nb8Akk:3qeludndnadch6mbadTmeabaead;8qbbabskabaeSmbdnaeadabfgi9Rcbadcet9R0mbadTmeabaead;8qbbabskaeab7ciGhldndndnabae9pmbdnalTmbadhvabhixikdnabciGmbadhvabhixdkadTmiabaeRbb86bbadcufhvdnabcefgiciGmbaecefhexdkavTmiabaeRbe86beadc9:fhvdnabcdfgiciGmbaecdfhexdkavTmiabaeRbd86bdadc99fhvdnabcifgiciGmbaecifhexdkavTmiabaeRbi86biabclfhiaeclfheadc98fhvxekdnalmbdnaiciGTmbadTmlabadcufgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc9:fgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc99fgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc98fgdfaeadfRbb86bbkadcl6mbdnadc98fgocxGcxSmbaocd4cefciGhiaec98fhlabc98fhvinavadfaladfydbBdbadc98fhdaicufgimbkkaocx6mbaec9Wfhvabc9WfhoinaoadfgicxfavadfglcxfydbBdbaicwfalcwfydbBdbaiclfalclfydbBdbaialydbBdbadc9Wfgdci0mbkkadTmdadhidnadciGglTmbaecufhvabcufhoadhiinaoaifavaifRbb86bbaicufhialcufglmbkkadcl6mdaec98fhlabc98fhvinavaifgecifalaifgdcifRbb86bbaecdfadcdfRbb86bbaecefadcefRbb86bbaeadRbb86bbaic98fgimbxikkavcl6mbdnavc98fglc3Gc3Smbavalcd4cefcrGgdcdt9RhvinaiaeydbBdbaeclfheaiclfhiadcufgdmbkkalc36mbinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaiczfaeczfydbBdbaicCfaecCfydbBdbaicKfaecKfydbBdbaic3faec3fydbBdbaecafheaicafhiavc9Gfgvci0mbkkavTmbdndnavcrGgdmbavhlxekavc94GhlinaiaeRbb86bbaicefhiaecefheadcufgdmbkkavcw6mbinaiaeRbb86bbaicefaecefRbb86bbaicdfaecdfRbb86bbaicifaecifRbb86bbaiclfaeclfRbb86bbaicvfaecvfRbb86bbaicofaecofRbb86bbaicrfaecrfRbb86bbaicwfhiaecwfhealc94fglmbkkabkk:pedbcj:GdktFFuuFFuuFFuubbbbFFuFFFuFFFuFbbbbbbjZbbbbbbbbbbbbbbjZbbbbbbbbbbbbbbjZ86;nAZ86;nAZ86;nAZ86;nA:;86;nAZ86;nAZ86;nAZ86;nA:;86;nAZ86;nAZ86;nAZ86;nA:;bc;0:Gdkxebbbdbbbj:qbb",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(r(e),{}).then(function(y){n=y.instance,n.exports.__wasm_call_ctors()});function r(y){for(var A=new Uint8Array(y.length),b=0;b<y.length;++b){var x=y.charCodeAt(b);A[b]=x>96?x-97:x>64?x-39:x+4}for(var T=0,b=0;b<y.length;++b)A[T++]=A[b]<60?t[A[b]]:(A[b]-60)*64+A[++b];return A.buffer.slice(0,T)}function o(y){if(!y)throw new Error("Assertion failed")}function a(y){return new Uint8Array(y.buffer,y.byteOffset,y.byteLength)}var s=48,c=16;function u(y,A){var b=y.meshlets[A*4+0],x=y.meshlets[A*4+1],T=y.meshlets[A*4+2],C=y.meshlets[A*4+3];return{vertices:y.vertices.subarray(b,b+T),triangles:y.triangles.subarray(x,x+C*3)}}function f(y,A,b,x,T,C,E,w,D,R){var M=n.exports.sbrk,N=n.exports.meshopt_buildMeshletsBound(A.length,C,E),_=M(N*c),v=M(A.length*4),S=M(A.length),P=M(A.byteLength),L=M(b.byteLength),F=new Uint8Array(n.exports.memory.buffer);F.set(a(A),P),F.set(a(b),L);var V=y(_,v,S,P,A.length,L,x,T,C,E,w,D,R);F=new Uint8Array(n.exports.memory.buffer);for(var z=F.subarray(_,_+V*c),j=new Uint32Array(z.buffer,z.byteOffset,z.byteLength/4).slice(),B=0;B<V;++B){var G=j[B*4+0],W=j[B*4+1],x=j[B*4+2],Q=j[B*4+3];n.exports.meshopt_optimizeMeshlet(v+G*4,S+W,Q,x)}var q=V?j[(V-1)*4+0]+j[(V-1)*4+2]:0,J=V?j[(V-1)*4+1]+j[(V-1)*4+3]*3:0,Z={meshlets:j,vertices:new Uint32Array(F.buffer,v,q).slice(),triangles:new Uint8Array(F.buffer,S,J).slice(),meshletCount:V};return M(_-M(0)),Z}function d(y){var A=new Float32Array(n.exports.memory.buffer,y,s/4);return{centerX:A[0],centerY:A[1],centerZ:A[2],radius:A[3],coneApexX:A[4],coneApexY:A[5],coneApexZ:A[6],coneAxisX:A[7],coneAxisY:A[8],coneAxisZ:A[9],coneCutoff:A[10]}}function p(y,A,b,x){var T=n.exports.sbrk,C=[],E=T(A.byteLength),w=T(y.vertices.byteLength),D=T(y.triangles.byteLength),R=T(s),M=new Uint8Array(n.exports.memory.buffer);M.set(a(A),E),M.set(a(y.vertices),w),M.set(a(y.triangles),D);for(var N=0;N<y.meshletCount;++N){var _=y.meshlets[N*4+0],v=y.meshlets[N*4+1],S=y.meshlets[N*4+3];n.exports.meshopt_computeMeshletBounds(R,w+_*4,D+v,S,E,b,x),C.push(d(R))}return T(E-T(0)),C}function g(y,A,b,x){var T=n.exports.sbrk,C=T(s),E=T(y.byteLength),w=T(A.byteLength),D=new Uint8Array(n.exports.memory.buffer);D.set(a(y),E),D.set(a(A),w),n.exports.meshopt_computeClusterBounds(C,E,y.length,w,b,x);var R=d(C);return T(C-T(0)),R}function m(y,A,b,x,T){var C=n.exports.sbrk,E=C(s),w=C(y.byteLength),D=x?C(x.byteLength):0,R=new Uint8Array(n.exports.memory.buffer);R.set(a(y),w),x&&R.set(a(x),D),n.exports.meshopt_computeSphereBounds(E,w,A,b,D,x?T:0);var M=d(E);return C(E-C(0)),M}return{ready:i,supported:!0,buildMeshlets:function(y,A,b,x,T,C){o(y.length%3==0),o(A instanceof Float32Array),o(A.length%b==0),o(b>=3),o(x>=3&&x<=256),o(T>=1&&T<=512),C=C||0;var E=y.BYTES_PER_ELEMENT==4?y:new Uint32Array(y);return f(n.exports.meshopt_buildMeshletsFlex,E,A,A.length/b,b*4,x,T,T,C,0)},buildMeshletsFlex:function(y,A,b,x,T,C,E,w){o(y.length%3==0),o(A instanceof Float32Array),o(A.length%b==0),o(b>=3),o(x>=3&&x<=256),o(T>=1&&C<=512),o(T<=C),E=E||0,w=w||0;var D=y.BYTES_PER_ELEMENT==4?y:new Uint32Array(y);return f(n.exports.meshopt_buildMeshletsFlex,D,A,A.length/b,b*4,x,T,C,E,w)},buildMeshletsSpatial:function(y,A,b,x,T,C,E){o(y.length%3==0),o(A instanceof Float32Array),o(A.length%b==0),o(b>=3),o(x>=3&&x<=256),o(T>=1&&C<=512),o(T<=C),E=E||0;var w=y.BYTES_PER_ELEMENT==4?y:new Uint32Array(y);return f(n.exports.meshopt_buildMeshletsSpatial,w,A,A.length/b,b*4,x,T,C,E)},extractMeshlet:function(y,A){return o(A>=0&&A<y.meshletCount),u(y,A)},computeClusterBounds:function(y,A,b){o(y.length%3==0),o(y.length/3<=512),o(A instanceof Float32Array),o(A.length%b==0),o(b>=3);var x=y.BYTES_PER_ELEMENT==4?y:new Uint32Array(y);return g(x,A,A.length/b,b*4)},computeMeshletBounds:function(y,A,b){return o(A instanceof Float32Array),o(A.length%b==0),o(b>=3),p(y,A,A.length/b,b*4)},computeSphereBounds:function(y,A,b,x){return o(y instanceof Float32Array),o(y.length%A==0),o(A>=3),o(!b||b instanceof Float32Array),o(!b||b.length%x==0),o(!b||x>=1),o(!b||y.length/A==b.length/x),x=x||0,m(y,y.length/A,A*4,b,x*4)}}})();var TWt=(function(){var e="b9H79Tebbbegv9Geueu9Geub9Gbb9Gkuuuuuuuuuuub9Giuuueuirodiblbelve9Weiiviebeoweuecj:Gdkrnlo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bbK9TW79O9V9Wt9F9NW9UWV9HtW9u9H9U9NW9Ut7bel79IV9RbdDwebcekdlvq;m8Lodbk:wgvOuw99iuv99vu8Jjjjjbc;Wb9Rgk8Kjjjjbakcxfcbc;Kbz:djjjb8AakcualcdtgxalcFFFFi0Ecbyd:q:G:cjbHjjjjbbgmBdxakceBd2adci9UhPalcd4alfhscehzinazgHcethzaHas6mbkakcuaHcdtgzaHcFFFFi0Ecbyd:q:G:cjbHjjjjbbgsBdzakcdBd2ascFeazz:djjjbhOaDcd4hAarcd4hCavcd4hXdnalTmbaHcufhrcbhvindndnaOcbaiavaX2cdtfgHydlgDaDcjjjj94SEgscH4cbaoavaC2cdtfgzydlgQcs4aQcjjjj94SE7as7c:F:b:DD2cbaHydbgLaLcjjjj94SEgscH4cbazydbgKcs4aKcjjjj94SE7as7c;D;O:B8J27cbaHydwgYaYcjjjj94SEgHcH4cbazydwg8Acs4a8Acjjjj94SE7aH7c:3F;N8N27awavaA2cdtfgHydlgEaHydbg37cFFFFrGgHcm4aH7c:fjjK27arGgscdtfgHydbgzcuSmbaE::h5a3::h8Ea8A::h8FaQ::haaK::hhaY::hgaD::h8JaL::h8KcehDinaDhHdnaiazaX2cdtfgDIdba8K9CmbaDIdla8J9CmbaDIdwag9CmbaoazaC2cdtfgDIdbah9CmbaDIdlaa9CmbaDIdwa8F9CmbawazaA2cdtfgDIdba8E9CmbaDIdla59BmikaHcefhDaOasaHfarGgscdtfgHydbgzcu9hmbkkaHavBdbavhzkamavcdtfazBdbavcefgval9hmbkkaOcbydN:G:cjbH:bjjjbbakceBd2akcualcefgHcdtaHcFFFFi0Ecbyd:q:G:cjbHjjjjbbg8LBdzakcdBd2akcuadcdtadcFFFFi0EgYcbyd:q:G:cjbHjjjjbbg8MBdCakciBd2a8Lclfcbaxz:djjjbhzdnadTmbdnaeTmbaehHadhsinazamaHydbcdtfydbcdtfgDaDydbcefBdbaHclfhHascufgsmbxdkkamhHadhsinazaHydbcdtfgDaDydbcefBdbaHclfhHascufgsmbkkdnalTmbcbhsazhHalhDinaHydbhOaHasBdbaHclfhHaOasfhsaDcufgDmbkkdnadci6gQmbcbhscdhHaPhOindndnaeTmbamaeasfgvydbcdtfhDamavcwfydbcdtfhramavclfydbcdtfhvxekamasfgDcwfhraDclfhvkarydbhravydbhvazaDydbcdtfgDaDydbgDcefBdba8MaDcdtfaHc9:fBdbazavcdtfgDaDydbgDcefBdba8MaDcdtfaHcufBdbazarcdtfgDaDydbgDcefBdba8MaDcdtfaHBdbascxfhsaHclfhHaOcufgOmbkkcbhsa8LcbBdbakcuaPcltadcFFFFd0Ecbyd:q:G:cjbHjjjjbbg8NBdKakclBd2dnaQmbaehza8NhHaPhvindndnaeTmbazcwfydbhDazclfydbhOazydbhrxekascdfhDascefhOashrkJbbbbh8KJbbbbJbbbbJbbbbJbbbbJbbjZJbbj:;awaOaA2cdtfgQIdbawaraA2cdtfgLIdbgh:tawaDaA2cdtfgKIdlaLIdlgg:tg8JNaQIdlag:tggaKIdbah:tN:tghJbbbb9EEahJbbbb9BEg8EaiaraX2cdtfgrIdwghaiaOaX2cdtfgOIdwg59BEa8EarIdlgaaOIdlgy9BEa8EarIdbg8FaOIdbg8P9BEg8EahaiaDaX2cdtfgDIdwgI9BEa8EaaaDIdlg8R9BEa8Ea8FaDIdbg8S9BEg8Ea5aI9BEa8Eaya8R9BEa8Ea8Pa8S9BEh8Edna8Ja5ah:tNagaIah:tN:tghahNa8Ja8Pa8F:tNaga8Sa8F:tN:tg8Fa8FNa8Jayaa:tNaga8Raa:tN:tg8Ja8JNMMggJbbbb9Bmba8Eag:r:vh8KkaHcxfa8EUdbaHcwfaha8KNUdbaHclfa8Ja8KNUdbaHa8Fa8KNUdbazcxfhzaHczfhHascifhsavcufgvmbkkcbhHakaYcbyd:q:G:cjbHjjjjbbgDBd3akcvBd2dnadTmbaDhzinazaHBdbazclfhzadaHcefgH9hmbkkakcuaPcdtadcFFFF970Ecbyd:q:G:cjbHjjjjbbgvBdaakcoBd2akaPcbyd:q:G:cjbHjjjjbbg8ABd8KakcrBd2dnadci6mba8NcxfhzavhscbhHinasaHBdba8AaHfcdcbazIdbg8KJbbbb9DEa8KJbbbb9EV86bbasclfhsazczfhzaPaHcefgH9hmbkkdnalTmbcbhRinaRcdthHdna8LaRcefgRcdtfydbgza8LaHfydbgHSmbazaH9RhLa8MaHcdtfhKcbh8UinaKa8Ucdtfg8VydbgHcd4g8Wci2gxaHciGcdtgzyd:e:G:cjbfhHaxazydj:G:cjbfhzdnaeTmbaeaHcdtfydbhHaeazcdtfydbhzkdna8Ucefg8UaL9pmbamaHcdtfydbhYamazcdtfydbh3a8Aa8WfhEava8Wcdtfh8Xa8UhwinaKawcdtfgQydbgHcd4gzci2gAaHciGcdtgHyd:e:G:cjbfhsaAaHydj:G:cjbfhHdnaeTmbaeascdtfydbhsaeaHcdtfydbhHkdndnamaHcdtfydbaYSmbamascdtfydba39hmeka8AazfRbbgHaERbbgsVciSmbdnaHasGmba8Whsdna8Wa8XydbgHSmba8XhOinaOavaHgscdtfgrydbgHBdbarhOasaH9hmbkkdnazavazcdtfgOydbgHSmbinaOavaHgzcdtfgrydbgHBdbarhOazaH9hmbkkasazSmba8AazfgORbba8AasfgHRbbVciSmeavazcdtfasBdbaHaHRbbaORbbV86bbkdna8VydbciGaxfgzaDazcdtfgsydbgHSmbinasaDaHgzcdtfgOydbgHBdbaOhsazaH9hmbkkdnaQydbciGaAfgsaDascdtfgOydbgHSmbinaOaDaHgscdtfgrydbgHBdbarhOasaH9hmbkkazasSmbaDascdtfazBdbkawcefgwaL9hmbkka8UaL9hmbkkaRal9hmbkkdnadTmbcbhrinarhzdnaraDarcdtfgwydbgHSmbawhsinasaDaHgzcdtfgOydbgHBdbaOhsazaH9hmbkkawazBdbarcefgrad9hmbkcbh8Vabcbadcltz:djjjbhKdnadci6mbaqceGhEaDhYaeh3cbh8Windna8Na8WcltfgsIdxJbbbb9Bmbama8Wcx2gHfhxaeaHfhLcbhza8VhwinaKaYazfydbcltfhHdndnaeTmbamaLazc:e:G:cjbfydbcdtfydbcdtfhAamaLazcj:G:cjbfydbcdtfydbcdtfhra3azfydbhOxekaxazc:e:G:cjbfydbcdtfhAaxazcj:G:cjbfydbcdtfhrawhOkaHasIdbggaoamaOcdtfydbgQaC2cdtfgOIdbg8KasIdwg8FaOIdwg8JNaga8KNasIdlg8EaOIdlggNMMghN:tgaJbbbbJbbjZa8Fa8JahN:tg8Fa8FNaaaaNa8EagahN:tghahNMMga:r:vaaJbbbb9BEJ;As6nJbbjZaiarydbaX2cdtfgOIdwaiaQaX2cdtfgrIdwg5:tgaa8Jaaa8JNaOIdbarIdbgy:tg8Pa8KNagaOIdlarIdlgI:tg8RNMMgaN:tg8EaiaAydbaX2cdtfgOIdwa5:tg5a8Ja5a8JNaOIdbay:tg8Sa8KNagaOIdlaI:tgINMMg5N:tg8JNa8Pa8KaaN:tgya8Sa8Ka5N:tg8KNa8RagaaN:tgaaIaga5N:tggNMMJbbbbJbbjZa8Ea8ENayayNaaaaNMMa8Ja8JNa8Ka8KNagagNMMNg8K:rg8J:va8KJbbbb9BENgg:lg8Ka8KJbbjZ9EEg8Ka8KJ7;A9s89NJ:L9t9s::MNJ;ob;jZMJbbjZa8K:t:rNg8K:ta8KagJbbbb9DENg8Ka8Ja8KNaEEg8KNaHIdbMUdbaHaha8KNaHIdlMUdlaHa8Fa8KNaHIdwMUdwawcefhwazclfgzcx9hmbkkaYcxfhYa3cxfh3a8Vcifh8Va8Wcefg8WaP9hmbkcbhrinarhzdnaravarcdtfgsydbgHSmbinasavaHgzcdtfgOydbgHBdbaOhsazaH9hmbkkaKarc8W2fgHc3fJbbjZJbbj:;a8AazfRbbceGEg8KUdbaHc8Sfa8KUdbaHa8KUdxarcefgraP9hmbkkaqcdGhvcbhzaDhsaKhHindnazasydb9hmbJbbbbh8KdnaHcwfgOIdbg8Ja8JNaHIdbggagNaHclfgrIdbghahNMMgaJbbbb9BmbJbbjZaa:r:vh8KkaOa8Ja8KNUdbaraha8KNUdbaHaga8KNg8JUdbavmbaHJbbjZa8Ja8KJbbbb9BEUdbkasclfhsaHczfhHadazcefgz9hmbkcbhHaKhzindnaHaDydbgsSmbazaKascltfgsydwBdwazas8Pdb83dbkaDclfhDazczfhzadaHcefgH9hmbkkdnakyd2gzTmbazcdtakcxffc98fhHinaHydbcbydN:G:cjbH:bjjjbbaHc98fhHazcufgzmbkkakc;Wbf8Kjjjjbk9teiucbcbyd:y:G:cjbgeabcifc98GfgbBd:y:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd:y:G:cjbgeabcrfc94GfgbBd:y:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikTeeucbabcbyd:y:G:cjbge9Rcifc98GaefgbBd:y:G:cjbdnabZbcztge9nmbabae9RcFFifcz4nb8Akkk8Rdbcj:Gdkzebbbdbbbbbbbebbbbc:q:Gdkxebbbdbbba:qbb",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(r(e),{}).then(function(u){n=u.instance,n.exports.__wasm_call_ctors()});function r(u){for(var f=new Uint8Array(u.length),d=0;d<u.length;++d){var p=u.charCodeAt(d);f[d]=p>96?p-97:p>64?p-39:p+4}for(var g=0,d=0;d<u.length;++d)f[g++]=f[d]<60?t[f[d]]:(f[d]-60)*64+f[++d];return f.buffer.slice(0,g)}function o(u){if(!u)throw new Error("Assertion failed")}function a(u){return new Uint8Array(u.buffer,u.byteOffset,u.byteLength)}function s(u,f,d,p,g,m,y,A,b,x){var T=n.exports.sbrk,C=T(f*16),E=u?T(u.byteLength):0,w=T(d.byteLength),D=T(m.byteLength),R=T(A.byteLength),M=new Uint8Array(n.exports.memory.buffer);u&&M.set(a(u),E),M.set(a(d),w),M.set(a(m),D),M.set(a(A),R),n.exports.meshopt_generateTangents(C,E,f,w,p,g*4,D,y*4,R,b*4,x),M=new Uint8Array(n.exports.memory.buffer);var N=new Float32Array(M.buffer,C,f*4).slice();return T(C-T(0)),N}var c={Compatible:1,ZeroFallback:2};return{ready:i,supported:!0,generateTangents:function(u,f,d,p,g,m,y,A){o(u===null||u instanceof Uint32Array||u instanceof Int32Array||u instanceof Uint16Array||u instanceof Int16Array),o(u===null||u.length%3==0),o(f instanceof Float32Array),o(f.length%d==0),o(d>=3),o(p instanceof Float32Array),o(p.length%g==0),o(g>=3),o(m instanceof Float32Array),o(m.length%y==0),o(y>=2),o(f.length/d==p.length/g),o(f.length/d==m.length/y),o(u!==null||f.length/d%3==0);for(var b=0,x=0;x<(A?A.length:0);++x)o(A[x]in c),b|=c[A[x]];var T=f.length/d,C=u?u.length:T,E=u===null||u.BYTES_PER_ELEMENT==4?u:new Uint32Array(u);return s(E,C,f,T,d,p,g,m,y,b)}}})();var Dm={X:0,Y:1,Z:2};Dm.Y_UP_TO_Z_UP=O.fromRotationTranslation($.fromArray([1,0,0,0,0,1,0,-1,0]));Dm.Z_UP_TO_Y_UP=O.fromRotationTranslation($.fromArray([1,0,0,0,0,-1,0,1,0]));Dm.X_UP_TO_Z_UP=O.fromRotationTranslation($.fromArray([0,0,1,0,1,0,-1,0,0]));Dm.Z_UP_TO_X_UP=O.fromRotationTranslation($.fromArray([0,0,-1,0,1,0,1,0,0]));Dm.X_UP_TO_Y_UP=O.fromRotationTranslation($.fromArray([0,1,0,-1,0,0,0,0,1]));Dm.Y_UP_TO_X_UP=O.fromRotationTranslation($.fromArray([0,-1,0,1,0,0,0,0,1]));Dm.fromName=function(e){return Dm[e]};Object.freeze(Dm);var zi=Dm;var rq={},hze={positions:void 0,normals:void 0,indices:void 0,edgeIndicesWest:void 0,edgeIndicesSouth:void 0,edgeIndicesEast:void 0,edgeIndicesNorth:void 0},mze=new de,pze=new h,gze=new O,_ze=new O,yze=new O,Aze=new h,bze=new h,xze=new h,Tze=new h,Cze=new de,vze=new k,uI=new h,Eze=new k,Sze=new h,wze=new h,QM=function(e,t){return e-t};rq.createMesh=async function(e){e=e??H.EMPTY_OBJECT;let{exaggeration:t=1,exaggerationRelativeHeight:n=0,hasVertexNormals:i,hasWebMercatorT:r,gltf:o,minimumHeight:a,maximumHeight:s,skirtHeight:c}=e,f=t!==1,d=se.clone(e.boundingSphere,new se),p=Jt.clone(e.orientedBoundingBox,new Jt),g=h.clone(e.horizonOcclusionPoint,new h),m=te.clone(e.ellipsoid,new te),y=ie.clone(e.rectangle,new ie);await(o.extensionsRequired!==void 0&&o.extensionsRequired.indexOf("EXT_meshopt_compression")!==-1?u_.ready:Promise.resolve(void 0));let x=y.west,T=y.south,C=y.north,E=y.width,w=y.height,D=ie.center(y,mze);D.height=.5*(a+s);let R=de.toCartesian(D,m,pze),M=mt.eastNorthUpToFixedFrame(R,m,gze),N=O.inverseTransformation(M,_ze),_=O.unpack(o.nodes[0].matrix,0,yze);_=O.multiply(zi.Y_UP_TO_Z_UP,_,_);let v=aUe(o,i,hze),S=Vr.getSkirtVertexCount(v.edgeIndicesWest,v.edgeIndicesSouth,v.edgeIndicesEast,v.edgeIndicesNorth),P=v.positions,L=v.normals,F=v.indices,V=P.length/3,z=V+S,j=F.length,B=Vr.getSkirtIndexCountWithFilledCorners(S),G=z<=65535?Uint16Array:Uint32Array,W=new G(j+B);W.set(F);let Q=new G(v.edgeIndicesWest),q=new G(v.edgeIndicesSouth),J=new G(v.edgeIndicesEast),Z=new G(v.edgeIndicesNorth),ce=new G(Q).sort(),Ae=new G(q).sort(),le=new G(J).sort(),Ce=new G(Z).sort(),ye=_i.geodeticLatitudeToMercatorAngle(T),Ie=1/(_i.geodeticLatitudeToMercatorAngle(C)-ye),Le=h.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Aze),$e=h.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,bze),Ye=new po(d.center,void 0,void 0,void 0,void 0,i,r,f,t,n),yt=Ye.stride,Ke=new Float32Array(z*yt),we=0;for(let Ct=0;Ct<V;Ct++){let ct=h.unpack(P,Ct*3,xze),dn=O.multiplyByPoint(_,ct,Tze),Ht=de.fromCartesian(dn,m,Cze),{longitude:bt,latitude:Dt,height:In}=Ht,rt=(bt-x)/E,dt=(Dt-T)/w;rt=I.clamp(rt,0,1),dt=I.clamp(dt,0,1),Cr(ce,Ct,QM)>=0?rt=0:Cr(le,Ct,QM)>=0&&(rt=1),Cr(Ae,Ct,QM)>=0?dt=0:Cr(Ce,Ct,QM)>=0&&(dt=1);let vi=k.fromElements(rt,dt,vze),wn;if(i){let Wi=h.unpack(L,Ct*3,uI);Wi=O.multiplyByPointAsVector(_,Wi,uI),Wi=h.normalize(Wi,uI),wn=an.octEncode(Wi,Eze)}let Mi;r&&(Mi=(_i.geodeticLatitudeToMercatorAngle(Dt)-ye)*Ie);let lr;f&&(lr=m.geodeticSurfaceNormal(dn,Sze)),we=Ye.encode(Ke,we,dn,vi,In,wn,Mi,lr);let Li=O.multiplyByPoint(N,dn,wze);Le=h.minimumByComponent(Li,Le,Le),$e=h.maximumByComponent(Li,$e,$e)}let We=new mc(h.clone(Ye.center,new h),Ke,W,j,V,a,s,y,se.clone(d,new se),h.clone(g,new h),yt,Jt.clone(p,new Jt),Ye,Q,q,J,Z);return lce(We,y,m,Le,$e,M,N,c),Promise.resolve(We)};var Ize=new k,Pze=new k,Dze=new Array(6),Rze=new k,Oze=new k,Mze=new k,Lze=new h,Nze=new h,Fze=new h,Bze=new de,kze=new h,zze=new de,Uze=new de,ice=new h,Vze=new h,jze=new h,Hze=new h,Gze=new h,Wze=new h,qze=new h,Yze=new h,Xze=new O,Kze=new O,rce=new k,$ze=new k,Jze=new h,Zze=new se,Qze=new Jt,eUe=new Vf,oce=new h,ace=new k,tUe=new k,sce=new h,nUe=new h;function iUe(e){let t=e.meshes[0].primitives[0],n=e.accessors[t.attributes.POSITION],i=e.bufferViews[n.bufferView],r=n.count,o=i.extensions?i.extensions.EXT_meshopt_compression:void 0;if(o===void 0){let g=e.buffers[i.buffer].extras._pipeline.source;return new Float32Array(g.buffer,g.byteOffset+(i.byteOffset??0)+(n.byteOffset??0),r*3)}let a=e.buffers[o.buffer].extras._pipeline.source,s=new Uint8Array(a.buffer,a.byteOffset+(o.byteOffset??0)+(n.byteOffset??0),o.byteLength),c=o.byteStride,u=c===4?Uint8Array:Uint16Array,f=new u(r*4);u_.decodeVertexBuffer(new Uint8Array(f.buffer),r,c,s);let d=(1<<f.BYTES_PER_ELEMENT*8)-1,p=new Float32Array(r*3);for(let g=0;g<r;g++)p[g*3+0]=f[g*4+0]/d,p[g*3+1]=f[g*4+1]/d,p[g*3+2]=f[g*4+2]/d;return p}function rUe(e){let t=e.meshes[0].primitives[0],n=e.accessors[t.attributes.NORMAL],i=e.bufferViews[n.bufferView],r=n.count,o=i.extensions?i.extensions.EXT_meshopt_compression:void 0;if(o===void 0){let d=e.buffers[i.buffer].extras._pipeline.source;return new Float32Array(d.buffer,d.byteOffset+(i.byteOffset??0)+(n.byteOffset??0),r*3)}let a=e.buffers[o.buffer].extras._pipeline.source,s=new Uint8Array(a.buffer,a.byteOffset+(o.byteOffset??0)+(n.byteOffset??0),o.byteLength),c=o.byteStride,u=new Int8Array(r*c);u_.decodeVertexBuffer(new Uint8Array(u.buffer),r,c,s);let f=new Float32Array(r*3);for(let d=0;d<r;d++){let p=Math.max(u[d*4+0]/127,-1),g=Math.max(u[d*4+1]/127,-1),m=1-(Math.abs(p)+Math.abs(g));if(m<0){let A=p,b=g;p=(1-Math.abs(b))*I.signNotZero(A),g=(1-Math.abs(A))*I.signNotZero(b)}let y=uI;y.x=p,y.y=g,y.z=m,y=h.normalize(y,uI),f[d*3+0]=y.x,f[d*3+1]=y.y,f[d*3+2]=y.z}return f}function oUe(e){let t=e.meshes[0].primitives[0],n=e.accessors[t.indices],i=e.bufferViews[n.bufferView],r=n.count,o=n.componentType===Y.UNSIGNED_SHORT?Uint16Array:Uint32Array,a=i.extensions?i.extensions.EXT_meshopt_compression:void 0;if(a===void 0){let f=e.buffers[i.buffer].extras._pipeline.source;return new o(f.buffer,f.byteOffset+(i.byteOffset??0)+(n.byteOffset??0),r)}let s=e.buffers[a.buffer].extras._pipeline.source,c=new Uint8Array(s.buffer,s.byteOffset+(a.byteOffset??0)+(n.byteOffset??0),a.byteLength),u=new o(r);return u_.decodeIndexBuffer(new Uint8Array(u.buffer),r,a.byteStride,c),u}function eL(e,t){let n=e.meshes[0].primitives[0],i=e.accessors[n.extensions.CESIUM_tile_edges[t]],r=e.bufferViews[i.bufferView],o=i.count,a=i.componentType===Y.UNSIGNED_SHORT?Uint16Array:Uint32Array,s=r.extensions?r.extensions.EXT_meshopt_compression:void 0;if(s===void 0){let p=e.buffers[r.buffer].extras._pipeline.source;return new a(p.buffer,p.byteOffset+(r.byteOffset??0)+(i.byteOffset??0),o)}let c=e.buffers[s.buffer].extras._pipeline.source,u=new Uint8Array(c.buffer,c.byteOffset+(s.byteOffset??0)+(i.byteOffset??0),s.byteLength),f=new a(o),d=s.byteStride;return u_.decodeIndexSequence(new Uint8Array(f.buffer),o,d,u),f}function aUe(e,t,n){return n.positions=iUe(e),n.normals=t?rUe(e):void 0,n.indices=oUe(e),n.edgeIndicesWest=eL(e,"left"),n.edgeIndicesSouth=eL(e,"bottom"),n.edgeIndicesEast=eL(e,"right"),n.edgeIndicesNorth=eL(e,"top"),n}rq.upsampleMesh=function(e){e=e??H.EMPTY_OBJECT;let{isEastChild:t,isNorthChild:n,parentMinimumHeight:i,parentMaximumHeight:r,skirtHeight:o}=e,a=e.parentIndexCountWithoutSkirts,s=e.parentIndices,c=e.parentVertexCountWithoutSkirts,u=e.parentVertices,f=po.clone(e.parentEncoding,new po),d=f.hasVertexNormals,p=f.hasWebMercatorT,g=f.exaggeration,m=f.exaggerationRelativeHeight,A=g!==1,b=ie.clone(e.rectangle,new ie),x=te.clone(e.ellipsoid),T=[],C=[],E=[],w=[],D=[],R=[],M=[],N=[];AUe(t,n,a,s,c,u,f,w,D,R,M,N,T,E,C);let _=ie.center(b,Bze);_.height=.5*(i+r);let v=de.toCartesian(_,x,kze),S=T.length,P=new po(v,void 0,void 0,void 0,void 0,d,p,A,g,m),L=P.stride,F=Vr.getSkirtVertexCount(D,R,M,N),V=S+F,z=w.length,j=Vr.getSkirtIndexCountWithFilledCorners(F),B=z+j,G=V<=65535?Uint16Array:Uint32Array,W=new G(B);W.set(w);let Q=new G(D),q=new G(R),J=new G(M),Z=new G(N),ce=new Float32Array(V*L),Ae=0,le=mt.eastNorthUpToFixedFrame(v,x,Xze),Ce=O.inverseTransformation(le,Kze),ye=b.west,ve=b.east,Ie=b.south,Le=b.north,$e=_i.geodeticLatitudeToMercatorAngle(Ie),yt=1/(_i.geodeticLatitudeToMercatorAngle(Le)-$e),Ke=Number.POSITIVE_INFINITY,we=Number.NEGATIVE_INFINITY,We=h.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,qze),Ct=h.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Yze);for(let In=0;In<S;In++){let rt=T[In],dt=s[rt*3+0],vi=s[rt*3+1],wn=s[rt*3+2],Mi=$ze;Mi.x=C[In*2+0],Mi.y=C[In*2+1];let lr=Mi.x,Li=Mi.y,Wi=E[In*2+0],ri=E[In*2+1],ei=1-Wi-ri,vn=f.decodeHeight(u,dt),ti=f.decodeHeight(u,vi),xr=f.decodeHeight(u,wn),fa=vn*Wi+ti*ri+xr*ei;Ke=Math.min(fa,Ke),we=Math.max(fa,we);let Ma=I.lerp(ye,ve,lr),Xa=I.lerp(Ie,Le,Li),Ka=de.fromRadians(Ma,Xa,fa,Uze),Qr=de.toCartesian(Ka,x,Vze),mi=O.multiplyByPoint(Ce,Qr,Hze);We=h.minimumByComponent(mi,We,We),Ct=h.maximumByComponent(mi,Ct,Ct);let eo;if(d){let Ri=f.decodeNormal(u,dt,Lze),Tr=f.decodeNormal(u,vi,Nze),da=f.decodeNormal(u,wn,Fze),Co=h.fromElements(Ri.x*Wi+Tr.x*ri+da.x*ei,Ri.y*Wi+Tr.y*ri+da.y*ei,Ri.z*Wi+Tr.z*ri+da.z*ei,oce);Co=h.normalize(Co,oce),eo=an.octEncode(Co,tUe)}let Di;p&&(Di=(_i.geodeticLatitudeToMercatorAngle(Xa)-$e)*yt);let Mo;A&&(Mo=x.geodeticSurfaceNormal(Qr,nUe)),Ae=P.encode(ce,Ae,Qr,Mi,fa,eo,Di,Mo)}let ct=Jt.fromRectangle(b,Ke,we,x,Qze),dn=se.fromVertices(ce,P.center,L,Zze),bt=new vm(x).computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid(P.center,ce,L,P.center,Ke,Jze),Dt=new mc(h.clone(P.center,new h),ce,W,z,S,Ke,we,b,se.clone(dn),h.clone(bt),L,Jt.clone(ct),P,Q,q,J,Z);return lce(Dt,b,x,We,Ct,le,Ce,o),Dt};function lce(e,t,n,i,r,o,a,s){let{encoding:c}=e,u=c.stride,f=e.vertices,{hasVertexNormals:d,hasWebMercatorT:p,exaggeration:g,exaggerationRelativeHeight:m}=c,A=g!==1,b=e.vertexCountWithoutSkirts,x=b*u,T=f.length/u,C=T-b,E=e.indices,w=e.indexCountWithoutSkirts,D=e.westIndicesSouthToNorth,R=e.southIndicesEastToWest,M=e.eastIndicesNorthToSouth,N=e.northIndicesWestToEast;Vr.addSkirtIndicesWithFilledCorners(D,R,M,N,b,E,w);let _=0,v=_+D.length,S=v+R.length,P=S+M.length,L=[D,R,M,N],F=[_,v,S,P],V=[-1,0,1,0],z=[0,-1,0,1],j=h.clone(i,Gze),B=h.clone(r,Wze),G=e.maximumHeight,W=e.minimumHeight-s;for(let J=0;J<C;J++){let Z;for(Z=0;Z<3&&!(J<F[Z+1]);Z++);let ce=L[Z][J-F[Z]],Ae=c.decodeTextureCoordinates(f,ce,rce),le=1e-4,Ce=Ae.x+V[Z]*le,ye=Ae.y+z[Z]*le,ve=I.lerp(t.west,t.east,Ce),Ie=I.clamp(I.lerp(t.south,t.north,ye),-I.PI_OVER_TWO,+I.PI_OVER_TWO),$e=c.decodeHeight(f,ce)-s,Ye=de.fromRadians(ve,Ie,$e,zze),yt=de.toCartesian(Ye,n,ice),Ke;d&&(Ke=c.getOctEncodedNormal(f,ce,ace));let we;p&&(we=c.decodeWebMercatorT(f,ce));let We;A&&(We=n.geodeticSurfaceNormal(yt,sce)),x=c.encode(f,x,yt,Ae,$e,Ke,we,We);let Ct=O.multiplyByPoint(a,yt,jze);h.minimumByComponent(Ct,j,j),h.maximumByComponent(Ct,B,B)}let Q=Vf.fromCorners(j,B,eUe),q=new po(c.center,Q,W,G,o,c.hasVertexNormals,c.hasWebMercatorT,A,g,m);if(c.quantization!==q.quantization){let J=q,Z=J.stride,ce=new Float32Array(T*Z),Ae=0;for(let le=0;le<T;le++)Ae=J.encode(ce,Ae,c.decodePosition(f,le,ice),c.decodeTextureCoordinates(f,le,rce),c.decodeHeight(f,le),c.hasVertexNormals?c.getOctEncodedNormal(f,le,ace):void 0,c.hasWebMercatorT?c.decodeWebMercatorT(f,le):void 0,c.hasGeodeticSurfaceNormals?c.decodeGeodeticSurfaceNormal(f,le,sce):void 0);e.vertices=ce,e.stride=Z,e.encoding=J}return e}var oq=0,sUe=1,aq=2,sq=3,cUe=4,lUe=new h,uUe=[new h,new h,new h,new h,new h,new h],fUe=[new k,new k,new k,new k,new k,new k],dUe=[new h,new h,new h,new h,new h,new h],hUe=[new k,new k,new k,new k,new k,new k];function cce(e,t,n,i){switch(n){case oq:return I.sign(i.x-e.x);case aq:return I.sign(t.x-i.x);case sq:return I.sign(i.y-e.y);default:return I.sign(t.y-i.y)}}function mUe(e,t,n,i,r,o){let a,s,c;switch(n){case oq:a=(e.x-i.x)/(r.x-i.x),s=e.x,c=i.y+(r.y-i.y)*a;break;case aq:a=(t.x-i.x)/(r.x-i.x),s=t.x,c=i.y+(r.y-i.y)*a;break;case sq:a=(e.y-i.y)/(r.y-i.y),s=i.x+(r.x-i.x)*a,c=e.y;break;default:a=(t.y-i.y)/(r.y-i.y),s=i.x+(r.x-i.x)*a,c=t.y;break}return h.fromElements(s,c,a,o)}var pUe={length:0,coordinates:[new k,new k,new k,new k,new k,new k],barycentricCoordinates:[new h,new h,new h,new h,new h,new h]};function gUe(e,t,n,i,r,o,a,s){let c,u=fUe,f=uUe,d=3,p=hUe;k.clone(r,p[0]),k.clone(o,p[1]),k.clone(a,p[2]);let g=dUe;h.fromElements(1,0,0,g[0]),h.fromElements(0,1,0,g[1]),h.fromElements(0,0,1,g[2]);for(let m=0;m<t;m++){let y=(e+m)%cUe,A=u,b=f;u=p,f=g,c=d,p=A,g=b,d=0;let x=c-1,T=u[x],C=f[x],E=cce(n,i,y,T);for(let w=0;w<c;w++){let D=u[w],R=f[w],M=cce(n,i,y,D);if(E*M===-1){let N=mUe(n,i,y,T,D,lUe),{x:_,y:v,z:S}=N,P=1-S,L=C.x*P+R.x*S,F=C.y*P+R.y*S,V=C.z*P+R.z*S;k.fromElements(_,v,p[d]),h.fromElements(L,F,V,g[d]),d++}M>=0&&(k.clone(D,p[d]),h.clone(R,g[d]),d++),T=D,C=R,E=M}if(d===0)break}s.length=d;for(let m=0;m<d;m++)k.clone(p[m],s.coordinates[m]),h.clone(g[m],s.barycentricCoordinates[m]);return s}function _Ue(e,t,n,i,r,o,a,s){return gUe(e?t?sq:oq:t?aq:sUe,2,n,i,r,o,a,s)}var yUe=[[],[0],[1],[0,1],[2],[0,2],[1,2],[0,1,2]];function AUe(e,t,n,i,r,o,a,s,c,u,f,d,p,g,m){let y={},A=e?.5:0,b=e?1:.5,x=t?.5:0,T=t?1:.5,C=Ize;C.x=A,C.y=x;let E=Pze;E.x=b,E.y=T;let w=0;for(let D=0;D<n;D+=3){let R=i[D+0],M=i[D+1],N=i[D+2],_=a.decodeTextureCoordinates(o,R,Rze),v=a.decodeTextureCoordinates(o,M,Oze),S=a.decodeTextureCoordinates(o,N,Mze),P=_Ue(e,t,C,E,_,v,S,pUe),L=P.length;if(L<3)continue;let F=Dze;for(let B=0;B<L;B++){let G=P.barycentricCoordinates[B],W=G.x,Q=G.y,q=G.z,J=Math.ceil(W)|Math.ceil(Q)<<1|Math.ceil(q)<<2,Z=yUe[J],ce,Ae=!1;if(Z.length===1){let le=Z[0],ye=i[D+le];ce=y[ye],ce===void 0&&(Ae=!0,ce=w++,y[ye]=ce)}else if(Z.length===2){let le=Z[0],Ce=Z[1],ye=i[D+le],ve=i[D+Ce],Ie=P.barycentricCoordinates[(B+L-1)%L],Le=Math.ceil(Ie.x)|Math.ceil(Ie.y)<<1|Math.ceil(Ie.z)<<2,$e=J===Le,Ye=Math.min(ye,ve),yt=Math.max(ye,ve),Ke=r+2*(Ye*r+yt),we=Ke+0,We=Ke+1,Ct=y[we],ct=y[We],dn=!$e==(Ct===void 0||ct===void 0);if(ce=dn?Ct:ct,ce===void 0){Ae=!0,ce=w++;let Ht=dn?we:We;y[Ht]=ce}}else Ae=!0,ce=w++;if(F[B]=ce,Ae){let le=D/3;p.push(le);let Ce=P.coordinates[B],ye=(Ce.x-A)/(b-A),ve=(Ce.y-x)/(T-x);m.push(ye,ve),g.push(W,Q),ye===0?c.push(ce):ye===1&&f.push(ce),ve===0?u.push(ce):ve===1&&d.push(ce)}}let V=F[0],z=F[1],j=F[2];s.push(V,z,j);for(let B=3;B<L;B++)z=j,j=F[B],s.push(V,z,j)}c.sort(function(D,R){return m[D*2+1]-m[R*2+1]}),u.sort(function(D,R){return m[R*2+0]-m[D*2+0]}),f.sort(function(D,R){return m[R*2+1]-m[D*2+1]}),d.sort(function(D,R){return m[D*2+0]-m[R*2+0]})}var fI=rq;var tL={};tL.clipTriangleAtAxisAlignedThreshold=function(e,t,n,i,r,o){l(o)?o.length=0:o=[];let a,s,c;t?(a=n<e,s=i<e,c=r<e):(a=n>e,s=i>e,c=r>e);let u=a+s+c,f,d,p,g,m,y;return u===1?a?(f=(e-n)/(i-n),d=(e-n)/(r-n),o.push(1),o.push(2),d!==1&&(o.push(-1),o.push(0),o.push(2),o.push(d)),f!==1&&(o.push(-1),o.push(0),o.push(1),o.push(f))):s?(p=(e-i)/(r-i),g=(e-i)/(n-i),o.push(2),o.push(0),g!==1&&(o.push(-1),o.push(1),o.push(0),o.push(g)),p!==1&&(o.push(-1),o.push(1),o.push(2),o.push(p))):c&&(m=(e-r)/(n-r),y=(e-r)/(i-r),o.push(0),o.push(1),y!==1&&(o.push(-1),o.push(2),o.push(1),o.push(y)),m!==1&&(o.push(-1),o.push(2),o.push(0),o.push(m))):u===2?!a&&n!==e?(g=(e-i)/(n-i),m=(e-r)/(n-r),o.push(0),o.push(-1),o.push(1),o.push(0),o.push(g),o.push(-1),o.push(2),o.push(0),o.push(m)):!s&&i!==e?(y=(e-r)/(i-r),f=(e-n)/(i-n),o.push(1),o.push(-1),o.push(2),o.push(1),o.push(y),o.push(-1),o.push(0),o.push(1),o.push(f)):!c&&r!==e&&(d=(e-n)/(r-n),p=(e-i)/(r-i),o.push(2),o.push(-1),o.push(0),o.push(2),o.push(d),o.push(-1),o.push(1),o.push(2),o.push(p)):u!==3&&(o.push(0),o.push(1),o.push(2)),o};tL.computeBarycentricCoordinates=function(e,t,n,i,r,o,a,s,c){let u=n-a,f=a-r,d=o-s,p=i-s,g=1/(d*u+f*p),m=t-s,y=e-a,A=(d*y+f*m)*g,b=(-p*y+u*m)*g,x=1-A-b;return l(c)?(c.x=A,c.y=b,c.z=x,c):new h(A,b,x)};tL.computeLineSegmentLineSegmentIntersection=function(e,t,n,i,r,o,a,s,c){let u=(a-r)*(t-o)-(s-o)*(e-r),f=(n-e)*(t-o)-(i-t)*(e-r),d=(s-o)*(n-e)-(a-r)*(i-t);if(d===0)return;let p=u/d,g=f/d;if(p>=0&&p<=1&&g>=0&&g<=1)return l(c)||(c=new k),c.x=e+p*(n-e),c.y=t+p*(i-t),c};var Rm=tL;function g0(e){e=e??H.EMPTY_OBJECT,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._skirtHeight=e.skirtHeight,this._boundingSphere=se.clone(e.boundingSphere,new se),this._orientedBoundingBox=Jt.clone(e.orientedBoundingBox,new Jt),this._horizonOcclusionPoint=h.clone(e.horizonOcclusionPoint,new h),this._hasVertexNormals=e.requestVertexNormals??!1,this._hasWaterMask=e.requestWaterMask??!1,this._hasWebMercatorT=!0,this._credits=e.credits,this._childTileMask=e.childTileMask??15,this._gltf=e.gltf,this._mesh=void 0,this._waterMask=e.waterMask}Object.defineProperties(g0.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){return this._waterMask}}});g0.prototype.interpolateHeight=function(e,t,n){let i=this._mesh;return i===void 0?void 0:fce(i,e,t,n)};g0.prototype.isChildAvailable=function(e,t,n,i){let r=2;return n!==e*2&&++r,i!==t*2&&(r-=2),(this._childTileMask&1<<r)!==0};var uce="createVerticesFromCesium3DTilesTerrain",bUe=new Yn(uce),xUe=new Yn(uce,Hu.maximumAsynchronousTasks);g0.prototype.createMesh=function(e){e=e??H.EMPTY_OBJECT;let n=e.throttle??!0?xUe:bUe,i=e.tilingScheme,r=i.ellipsoid,o=e.x,a=e.y,s=e.level,c=i.tileXYToRectangle(o,a,s,new ie),u=this._gltf,f=n.scheduleTask({ellipsoid:r,rectangle:c,hasVertexNormals:this._hasVertexNormals,hasWaterMask:this._hasWaterMask,hasWebMercatorT:this._hasWebMercatorT,gltf:u,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,boundingSphere:this._boundingSphere,orientedBoundingBox:this._orientedBoundingBox,horizonOcclusionPoint:this._horizonOcclusionPoint,skirtHeight:this._skirtHeight,exaggeration:e.exaggeration,exaggerationRelativeHeight:e.exaggerationRelativeHeight});if(!l(f))return;let d=this;return Promise.resolve(f).then(function(p){let g=p,m=po.clone(g.encoding,new po),y=new Float32Array(g.verticesBuffer),A=y.length/m.stride,b=g.vertexCountWithoutSkirts,x=A<=65535?Uint16Array:Uint32Array,T=new x(g.indicesBuffer),C=new x(g.westIndicesBuffer),E=new x(g.eastIndicesBuffer),w=new x(g.southIndicesBuffer),D=new x(g.northIndicesBuffer),R=g.indexCountWithoutSkirts,M=d._minimumHeight,N=d._maximumHeight,_=h.clone(m.center,new h),v=se.clone(d._boundingSphere,new se),S=h.clone(d._horizonOcclusionPoint,new h),P=Jt.clone(d._orientedBoundingBox,new Jt),L=new mc(_,y,T,R,b,M,N,c,v,S,m.stride,P,m,C,w,E,D);return d._mesh=L,Promise.resolve(L)})};g0.prototype._createMeshSync=function(e){e=e??H.EMPTY_OBJECT;let t=e.tilingScheme,n=t.ellipsoid,i=e.x,r=e.y,o=e.level,a=t.tileXYToRectangle(i,r,o,new ie),s=fI.createMesh({ellipsoid:n,rectangle:a,hasVertexNormals:this._hasVertexNormals,hasWebMercatorT:this._hasWebMercatorT,gltf:this._gltf,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,boundingSphere:this._boundingSphere,orientedBoundingBox:this._orientedBoundingBox,horizonOcclusionPoint:this._horizonOcclusionPoint,skirtHeight:this._skirtHeight,exaggeration:e.exaggeration,exaggerationRelativeHeight:e.exaggerationRelativeHeight}),c=this;return Promise.resolve(s).then(function(u){return c._mesh=u,Promise.resolve(u)})};g0.prototype.upsample=function(e,t,n,i,r,o,a){let s=this._mesh;return s===void 0?void 0:nL(!1,s,this._skirtHeight,this._credits,e,t,n,i,r,o,a)};g0.prototype._upsampleSync=function(e,t,n,i,r,o,a){let s=this._mesh;return s===void 0?void 0:nL(!0,s,this._skirtHeight,this._credits,e,t,n,i,r,o,a)};g0.prototype.wasCreatedByUpsampling=function(){return!1};function p0(e){e=e??H.EMPTY_OBJECT,this._mesh=e.terrainMesh,this._skirtHeight=e.skirtHeight,this._credits=e.credits}p0.prototype.createMesh=function(e){return e=e??H.EMPTY_OBJECT,Promise.resolve(this._mesh)};p0.prototype.upsample=function(e,t,n,i,r,o,a){return nL(!1,this._mesh,this._skirtHeight,this._credits,e,t,n,i,r,o,a)};p0.prototype._upsampleSync=function(e,t,n,i,r,o,a){return nL(!0,this._mesh,this._skirtHeight,this._credits,e,t,n,i,r,o,a)};p0.prototype.interpolateHeight=function(e,t,n){let i=this._mesh;return fce(i,e,t,n)};p0.prototype.wasCreatedByUpsampling=function(){return!0};p0.prototype.isChildAvailable=function(e,t,n,i){return!1};Object.defineProperties(p0.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var TUe=new Yn("upsampleVerticesFromCesium3DTilesTerrain",Hu.maximumAsynchronousTasks);function nL(e,t,n,i,r,o,a,s,c,u,f){if(f-s>1)throw new pe("Upsampling through more than one level at a time is not currently supported.");let p=n*.5,g=o*2!==c,m=a*2===u,y=r.tileXYToRectangle(c,u,f,new ie),A=r.ellipsoid,b={isEastChild:g,isNorthChild:m,rectangle:y,ellipsoid:A,skirtHeight:p,parentVertices:t.vertices,parentIndices:t.indices,parentVertexCountWithoutSkirts:t.vertexCountWithoutSkirts,parentIndexCountWithoutSkirts:t.indexCountWithoutSkirts,parentMinimumHeight:t.minimumHeight,parentMaximumHeight:t.maximumHeight,parentEncoding:t.encoding};if(e){let T=fI.upsampleMesh(b),C=new p0({terrainMesh:T,skirtHeight:p,credits:i});return Promise.resolve(C)}let x=TUe.scheduleTask(b);if(x!==void 0)return x.then(function(T){let C=po.clone(T.encoding,new po),E=C.stride,w=new Float32Array(T.verticesBuffer),D=w.length/E,R=T.vertexCountWithoutSkirts,M=D<=65535?Uint16Array:Uint32Array,N=new M(T.indicesBuffer),_=new M(T.westIndicesBuffer),v=new M(T.eastIndicesBuffer),S=new M(T.southIndicesBuffer),P=new M(T.northIndicesBuffer),L=T.indexCountWithoutSkirts,F=T.minimumHeight,V=T.maximumHeight,z=h.clone(C.center,new h),j=se.clone(T.boundingSphere,new se),B=h.clone(T.horizonOcclusionPoint,new h),G=Jt.clone(T.orientedBoundingBox,new Jt),W=new mc(z,w,N,L,R,F,V,y,j,B,E,G,C,_,S,v,P),Q=new p0({terrainMesh:W,skirtHeight:p,credits:i});return Promise.resolve(Q)})}var CUe=new k,vUe=new k,EUe=new k,SUe=new h;function fce(e,t,n,i){let r=I.clamp((n-t.west)/t.width,0,1),o=I.clamp((i-t.south)/t.height,0,1),{vertices:a,encoding:s,indices:c}=e;for(let u=0;u<e.indexCountWithoutSkirts;u+=3){let f=c[u],d=c[u+1],p=c[u+2],g=s.decodeTextureCoordinates(a,f,CUe),m=s.decodeTextureCoordinates(a,d,vUe),y=s.decodeTextureCoordinates(a,p,EUe),A=Math.min(g.x,m.x,y.x),b=Math.max(g.x,m.x,y.x),x=Math.min(g.y,m.y,y.y),T=Math.max(g.y,m.y,y.y);if(r>=A&&r<=b&&o>=x&&o<=T){let C=Rm.computeBarycentricCoordinates(r,o,g.x,g.y,m.x,m.y,y.x,y.y,SUe);if(C.x>=0&&C.y>=0&&C.z>=0){let E=s.decodeHeight(a,f),w=s.decodeHeight(a,d),D=s.decodeHeight(a,p);return C.x*E+C.y*w+C.z*D}}}return 0}var iL=g0;function ih(e){this._comparator=e.comparator,this._maximumLength=e.maximumLength,this._array=l(e.maximumLength)?new Array(e.maximumLength):[],this._length=0}Object.defineProperties(ih.prototype,{length:{get:function(){return this._length}},maximumLength:{get:function(){return this._maximumLength},set:function(e){if(l(e)){for(;this._length>e;)this.removeMinimum();this._array.length=e}this._maximumLength=e}},internalArray:{get:function(){return this._array}},comparator:{get:function(){return this._comparator}}});ih.prototype.clone=function(){let e=this._maximumLength,t=this._comparator,n=this._array,i=this._length,r=new ih({comparator:t,maximumLength:e});r._length=i;for(let o=0;o<i;o++)r._array[o]=n[o];return r};ih.prototype.reset=function(){this._length=0;let e=this._maximumLength;if(l(e))for(let t=0;t<e;t++)this._array[t]=void 0;else this._array.length=0};ih.prototype.resort=function(){let e=this._length;for(let t=0;t<e;t++)dce(this,t)};ih.prototype.insert=function(e){let t,n=this._maximumLength;if(l(n)){if(n===0)return;if(this._length===n){let r=this._array[0];if(this._comparator(e,r)<=0)return e;t=this.removeMinimum()}}let i=this._length;return this._array[i]=e,this._length++,dce(this,i),t};ih.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],hce(this,0)),this._array[e-1]=void 0,t};ih.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=cq(this,1,2)?1:2;t=this._array[n],this._array[n]=this._array[e-1],e>=4&&hce(this,n)}return this._array[e-1]=void 0,t};ih.prototype.getMinimum=function(){if(this._length!==0)return this._array[0]};ih.prototype.getMaximum=function(){let e=this._length;if(e!==0)return e<=2?this._array[e-1]:this._array[cq(this,1,2)?1:2]};function rL(e,t,n){let i=e._array,r=i[t];i[t]=i[n],i[n]=r}function dI(e,t,n){return e._comparator(e._array[t],e._array[n])<0}function cq(e,t,n){return e._comparator(e._array[t],e._array[n])>0}function dce(e,t){if(t===0)return;let n=Math.floor(I.log2(t+1))%2===0,i=Math.floor((t-1)/2),r=dI(e,t,i);for(r!==n&&(rL(e,t,i),t=i);t>=3;){let o=Math.floor((t-3)/4);if(dI(e,t,o)!==r)break;rL(e,t,o),t=o}}function hce(e,t){let n=e._length,i=Math.floor(I.log2(t+1))%2===0,r;for(;(r=2*t+1)<n;){let o=r,a=r+1;if(a<n){dI(e,a,o)===i&&(o=a);let s=2*r+1,c=Math.max(Math.min(n-s,4),0);for(let u=0;u<c;u++){let f=s+u;dI(e,f,o)===i&&(o=f)}}if(dI(e,o,t)===i&&(rL(e,o,t),o!==r&&o!==a)){let s=Math.floor((o-1)/2);cq(e,o,s)===i&&rL(e,o,s)}t=o}}var f_=ih;function d_(e,t,n){return t=t??0,n=n??e.byteLength-t,e=e.subarray(t,t+n),d_.decode(e)}d_.decodeWithTextDecoder=function(e){return new TextDecoder("utf-8").decode(e)};d_.decodeWithFromCharCode=function(e){let t="",n=wUe(e),i=n.length;for(let r=0;r<i;++r){let o=n[r];o<=65535?t+=String.fromCharCode(o):(o-=65536,t+=String.fromCharCode((o>>10)+55296,(o&1023)+56320))}return t};function hI(e,t,n){return t<=e&&e<=n}function wUe(e){let t=0,n=0,i=0,r=128,o=191,a=[],s=e.length;for(let c=0;c<s;++c){let u=e[c];if(i===0){if(hI(u,0,127)){a.push(u);continue}if(hI(u,194,223)){i=1,t=u&31;continue}if(hI(u,224,239)){u===224&&(r=160),u===237&&(o=159),i=2,t=u&15;continue}if(hI(u,240,244)){u===240&&(r=144),u===244&&(o=143),i=3,t=u&7;continue}throw new oe("String decoding failed.")}if(!hI(u,r,o)){t=i=n=0,r=128,o=191,--c;continue}r=128,o=191,t=t<<6|u&63,++n,n===i&&(a.push(t),t=i=n=0)}return a}typeof TextDecoder<"u"?d_.decode=d_.decodeWithTextDecoder:d_.decode=d_.decodeWithFromCharCode;var Wu=d_;function IUe(e,t,n){return JSON.parse(Wu(e,t,n))}var wo=IUe;function PUe(e,t){return l(e)&&l(e.extensions)&&l(e.extensions[t])}var Qi=PUe;function lq(e){let t=e.lengthBits,n=e.availableCount,i=e.constant,r=e.bitstream;if(l(i))n=t;else{let o=Math.ceil(t/8);if(r.length!==o)throw new oe(`Availability bitstream must be exactly ${o} bytes long to store ${t} bits. Actual bitstream was ${r.length} bytes long.`);let a=e.computeAvailableCountEnabled??!1;!l(n)&&a&&(n=DUe(r,t))}this._lengthBits=t,this._availableCount=n,this._constant=i,this._bitstream=r}function DUe(e,t){let n=0;for(let i=0;i<t;i++){let r=i>>3,o=i%8;n+=e[r]>>o&1}return n}Object.defineProperties(lq.prototype,{lengthBits:{get:function(){return this._lengthBits}},availableCount:{get:function(){return this._availableCount}}});lq.prototype.getBit=function(e){if(l(this._constant))return this._constant;let t=e>>3,n=e%8;return(this._bitstream[t]>>n&1)===1};var mI=lq;function _0(e){e=e??H.EMPTY_OBJECT;let t=e.metadataTable,n=e.class,i=e.entityId,r=e.propertyTableJson;this._class=n,this._metadataTable=t,this._entityId=i,this._extensions=r.extensions,this._extras=r.extras}Object.defineProperties(_0.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});_0.prototype.hasProperty=function(e){return this._metadataTable.hasProperty(e)};_0.prototype.hasPropertyBySemantic=function(e){return this._metadataTable.hasPropertyBySemantic(e)};_0.prototype.getPropertyIds=function(e){return this._metadataTable.getPropertyIds(e)};_0.prototype.getProperty=function(e){return this._metadataTable.getProperty(this._entityId,e)};_0.prototype.setProperty=function(e,t){return this._metadataTable.setProperty(this._entityId,e,t)};_0.prototype.getPropertyBySemantic=function(e){return this._metadataTable.getPropertyBySemantic(this._entityId,e)};_0.prototype.setPropertyBySemantic=function(e,t){return this._metadataTable.setPropertyBySemantic(this._entityId,e,t)};var pI=_0;var gI={QUADTREE:"QUADTREE",OCTREE:"OCTREE"};gI.getBranchingFactor=function(e){switch(e){case gI.OCTREE:return 8;case gI.QUADTREE:return 4}};Object.freeze(gI);var ka=gI;function Ws(){}Object.defineProperties(Ws.prototype,{class:{get:function(){pe.throwInstantiationError()}}});Ws.prototype.hasProperty=function(e){pe.throwInstantiationError()};Ws.prototype.hasPropertyBySemantic=function(e){pe.throwInstantiationError()};Ws.prototype.getPropertyIds=function(e){pe.throwInstantiationError()};Ws.prototype.getProperty=function(e){pe.throwInstantiationError()};Ws.prototype.setProperty=function(e,t){pe.throwInstantiationError()};Ws.prototype.getPropertyBySemantic=function(e){pe.throwInstantiationError()};Ws.prototype.setPropertyBySemantic=function(e,t){pe.throwInstantiationError()};Ws.hasProperty=function(e,t,n){if(l(t[e]))return!0;let i=n.properties;if(!l(i))return!1;let r=i[e];return!!(l(r)&&l(r.default))};Ws.hasPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return!1;let r=i[e];return l(r)};Ws.getPropertyIds=function(e,t,n){n=l(n)?n:[],n.length=0;for(let r in e)e.hasOwnProperty(r)&&l(e[r])&&n.push(r);let i=t.properties;if(l(i))for(let r in i)i.hasOwnProperty(r)&&!l(e[r])&&l(i[r].default)&&n.push(r);return n};Ws.getProperty=function(e,t,n){let i=n.properties[e],r=t[e];Array.isArray(r)&&(r=r.slice());let o=!0;if(r=i.handleNoData(r),!l(r)&&l(i.default))return r=Xe(i.default,!0),i.unpackVectorAndMatrixTypes(r,o);if(l(r))return r=i.normalize(r),r=i.applyValueTransform(r),i.unpackVectorAndMatrixTypes(r,o)};Ws.setProperty=function(e,t,n,i){if(!l(n[e]))return!1;Array.isArray(t)&&(t=t.slice());let r,o=i.properties;return l(o)&&(r=o[e]),l(r)&&(t=r.packVectorAndMatrixTypes(t,!0),t=r.unapplyValueTransform(t),t=r.unnormalize(t)),n[e]=t,!0};Ws.getPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return;let r=i[e];if(l(r))return Ws.getProperty(r.id,t,n)};Ws.setPropertyBySemantic=function(e,t,n,i){let r=i.propertiesBySemantic;if(!l(r))return!1;let o=i.propertiesBySemantic[e];return l(o)?Ws.setProperty(o.id,t,n,i):!1};var qn=Ws;function y0(e){e=e??H.EMPTY_OBJECT;let t=e.subtreeMetadata,n=e.class,i=l(t.properties)?t.properties:{};this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(y0.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});y0.prototype.hasProperty=function(e){return qn.hasProperty(e,this._properties,this._class)};y0.prototype.hasPropertyBySemantic=function(e){return qn.hasPropertyBySemantic(e,this._properties,this._class)};y0.prototype.getPropertyIds=function(e){return qn.getPropertyIds(this._properties,this._class,e)};y0.prototype.getProperty=function(e){return qn.getProperty(e,this._properties,this._class)};y0.prototype.setProperty=function(e,t){return qn.setProperty(e,t,this._properties,this._class)};y0.prototype.getPropertyBySemantic=function(e){return qn.getPropertyBySemantic(e,this._properties,this._class)};y0.prototype.setPropertyBySemantic=function(e,t){return qn.setPropertyBySemantic(e,t,this._properties,this._class)};var oL=y0;var mce={};function _I(e,t){l(mce[e])||(mce[e]=!0,console.warn(t??e))}_I.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.";_I.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored";_I.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored";_I.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";var pt=_I;var cn={INT8:"INT8",UINT8:"UINT8",INT16:"INT16",UINT16:"UINT16",INT32:"INT32",UINT32:"UINT32",INT64:"INT64",UINT64:"UINT64",FLOAT32:"FLOAT32",FLOAT64:"FLOAT64"},Fc={INTEGER:"int",UNSIGNED_INTEGER:"uint",FLOAT:"float"};cn.typeInfo={INT8:{vectorCompatible:!0,size:1,maximumValue:127,minimumValue:-128,category:Fc.INTEGER},UINT8:{vectorCompatible:!0,size:1,maximumValue:255,minimumValue:0,category:Fc.UNSIGNED_INTEGER},INT16:{vectorCompatible:!0,size:2,maximumValue:32767,minimumValue:-32768,category:Fc.INTEGER},UINT16:{vectorCompatible:!0,size:2,maximumValue:65535,minimumValue:0,category:Fc.UNSIGNED_INTEGER},INT32:{vectorCompatible:!0,size:4,maximumValue:2147483647,minimumValue:-2147483648,category:Fc.INTEGER},UINT32:{vectorCompatible:!0,size:4,maximumValue:4294967295,minimumValue:0,category:Fc.UNSIGNED_INTEGER},INT64:{vectorCompatible:!1,size:8,maximumValue:BigInt("9223372036854775807"),minimumValue:BigInt("-9223372036854775808"),category:Fc.INTEGER,downcastFunction:e=>cn.clampToLimits(e,cn.INT32)},UINT64:{vectorCompatible:!1,size:8,maximumValue:BigInt("18446744073709551615"),minimumValue:BigInt(0),category:Fc.UNSIGNED_INTEGER,downcastFunction:e=>cn.clampToLimits(e,cn.UINT32)},FLOAT32:{vectorCompatible:!0,size:4,maximumValue:34028234663852886e22,minimumValue:-34028234663852886e22,category:Fc.FLOAT},FLOAT64:{vectorCompatible:!0,size:8,maximumValue:Number.MAX_VALUE,minimumValue:-Number.MAX_VALUE,category:Fc.FLOAT,downcastFunction:e=>Math.fround(e)}};cn.getMinimum=function(e){return cn.typeInfo[e].minimumValue};cn.getMaximum=function(e){return cn.typeInfo[e].maximumValue};cn.isIntegerType=function(e){return cn.typeInfo[e].category!==Fc.FLOAT};cn.isUnsignedIntegerType=function(e){return cn.typeInfo[e].category===Fc.UNSIGNED_INTEGER};cn.isVectorCompatible=function(e){return cn.typeInfo[e].vectorCompatible};cn.category=function(e){return cn.typeInfo[e].category};cn.gpuComponentType=function(e){switch(e){case cn.INT64:return"INT32";case cn.UINT64:return"UINT32";case cn.FLOAT64:return"FLOAT32";default:return e}};cn.normalize=function(e,t){return Math.max(Number(e)/Number(cn.getMaximum(t)),-1)};cn.unnormalize=function(e,t){let n=cn.getMaximum(t),i=cn.isUnsignedIntegerType(t)?0:-n;return e=I.sign(e)*Math.round(Math.abs(e)*Number(n)),(t===cn.INT64||t===cn.UINT64)&&fn.supportsBigInt()&&(e=BigInt(e)),e>n?n:e<i?i:e};cn.applyValueTransform=function(e,t,n){return n*e+t};cn.unapplyValueTransform=function(e,t,n){return n===0?0:(e-t)/n};cn.getSizeInBytes=function(e){return cn.typeInfo[e].size};cn.clampToLimits=function(e,t){let n=cn.getMinimum(t),i=cn.getMaximum(t);if(typeof e=="bigint"){let r=BigInt(n),o=BigInt(i);return e<r?n:e>o?i:Number(e)}return Math.max(n,Math.min(i,e))};cn.downcastFunction=function(e){let n=cn.typeInfo[e].downcastFunction;return l(n)?n:i=>i};cn.fromComponentDatatype=function(e){switch(e){case Y.BYTE:return cn.INT8;case Y.UNSIGNED_BYTE:return cn.UINT8;case Y.SHORT:return cn.INT16;case Y.UNSIGNED_SHORT:return cn.UINT16;case Y.INT:return cn.INT32;case Y.UNSIGNED_INT:return cn.UINT32;case Y.FLOAT:return cn.FLOAT32;case Y.DOUBLE:return cn.FLOAT64}};cn.toComponentDatatype=function(e){switch(e){case cn.INT8:return Y.BYTE;case cn.UINT8:return Y.UNSIGNED_BYTE;case cn.INT16:return Y.SHORT;case cn.UINT16:return Y.UNSIGNED_SHORT;case cn.INT32:return Y.INT;case cn.UINT32:return Y.UNSIGNED_INT;case cn.FLOAT32:return Y.FLOAT;case cn.FLOAT64:return Y.DOUBLE}};cn.getDataViewAccessors=function(e,t){return{[cn.UINT8]:{get:e.getUint8.bind(e),set:e.setUint8.bind(e)},[cn.INT8]:{get:e.getInt8.bind(e),set:e.setInt8.bind(e)},[cn.UINT16]:{get:i=>e.getUint16(i,!0),set:(i,r)=>e.setUint16(i,r,!0)},[cn.INT16]:{get:i=>e.getInt16(i,!0),set:(i,r)=>e.setInt16(i,r,!0)},[cn.UINT32]:{get:i=>e.getUint32(i,!0),set:(i,r)=>e.setUint32(i,r,!0)},[cn.INT32]:{get:i=>e.getInt32(i,!0),set:(i,r)=>e.setInt32(i,r,!0)},[cn.FLOAT32]:{get:i=>e.getFloat32(i,!0),set:(i,r)=>e.setFloat32(i,r,!0)},[cn.FLOAT64]:{get:i=>e.getFloat64(i,!0),set:(i,r)=>e.setFloat64(i,r,!0)},[cn.UINT64]:{get:i=>e.getBigUint64(i,!0),set:(i,r)=>e.setBigUint64(i,BigInt(r),!0)},[cn.INT64]:{get:i=>e.getBigInt64(i,!0),set:(i,r)=>e.setBigInt64(i,BigInt(r),!0)}}[t]};Object.freeze(cn);var Mt=cn;var Yr={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4",BOOLEAN:"BOOLEAN",STRING:"STRING",ENUM:"ENUM"};Yr.isVectorType=function(e){switch(e){case Yr.VEC2:case Yr.VEC3:case Yr.VEC4:return!0;default:return!1}};Yr.isMatrixType=function(e){switch(e){case Yr.MAT2:case Yr.MAT3:case Yr.MAT4:return!0;default:return!1}};Yr.getComponentCount=function(e){switch(e){case Yr.SCALAR:case Yr.STRING:case Yr.ENUM:case Yr.BOOLEAN:return 1;case Yr.VEC2:return 2;case Yr.VEC3:return 3;case Yr.VEC4:return 4;case Yr.MAT2:return 4;case Yr.MAT3:return 9;case Yr.MAT4:return 16}};Yr.getMathType=function(e){switch(e){case Yr.VEC2:return k;case Yr.VEC3:return h;case Yr.VEC4:return ae;case Yr.MAT2:return Zi;case Yr.MAT3:return $;case Yr.MAT4:return O;default:return}};Object.freeze(Yr);var gt=Yr;function Lo(e){e=e??H.EMPTY_OBJECT;let t=e.id,n=e.type,i=e.componentType,r=e.enumType,o=l(i)&&(e.normalized??!1)&&Mt.isIntegerType(i);this._id=t,this._name=e.name,this._description=e.description,this._semantic=e.semantic,this._isLegacyExtension=e.isLegacyExtension,this._type=n,this._componentType=i,this._enumType=r,this._valueType=l(r)?r.valueType:i,this._isArray=e.isArray??!1,this._isVariableLengthArray=e.isVariableLengthArray??!1,this._arrayLength=e.arrayLength,this._min=Xe(e.min,!0),this._max=Xe(e.max,!0),this._normalized=o;let a=Xe(e.offset,!0),s=Xe(e.scale,!0),c=l(a)||l(s),u=!0;l(a)||(a=this.expandConstant(0,u)),l(s)||(s=this.expandConstant(1,u)),this._offset=a,this._scale=s,this._hasValueTransform=c,this._noData=Xe(e.noData,!0),this._default=Xe(e.default,!0),this._required=e.required??!0,this._extras=Xe(e.extras,!0),this._extensions=Xe(e.extensions,!0)}Lo.fromJson=function(e){e=e??H.EMPTY_OBJECT;let t=e.id,n=e.property,i=RUe(n),r=OUe(n,e.enums),o;return l(i)?i?o=l(n.optional)?!n.optional:!0:o=n.required??!1:o=!1,new Lo({id:t,type:r.type,componentType:r.componentType,enumType:r.enumType,isArray:r.isArray,isVariableLengthArray:r.isVariableLengthArray,arrayLength:r.arrayLength,normalized:n.normalized,min:n.min,max:n.max,offset:n.offset,scale:n.scale,noData:n.noData,default:n.default,required:o,name:n.name,description:n.description,semantic:n.semantic,extras:n.extras,extensions:n.extensions,isLegacyExtension:i})};Object.defineProperties(Lo.prototype,{id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},type:{get:function(){return this._type}},enumType:{get:function(){return this._enumType}},componentType:{get:function(){return this._componentType}},valueType:{get:function(){return this._valueType}},isArray:{get:function(){return this._isArray}},isVariableLengthArray:{get:function(){return this._isVariableLengthArray}},arrayLength:{get:function(){return this._arrayLength}},normalized:{get:function(){return this._normalized}},max:{get:function(){return this._max}},min:{get:function(){return this._min}},noData:{get:function(){return this._noData}},default:{get:function(){return this._default}},required:{get:function(){return this._required}},semantic:{get:function(){return this._semantic}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});function RUe(e){if(e.type==="ARRAY")return!0;let t=e.type;if(t===gt.SCALAR||gt.isMatrixType(t)||gt.isVectorType(t))return!1;if(l(Mt[t]))return!0;if(l(e.noData)||l(e.scale)||l(e.offset)||l(e.required)||l(e.count)||l(e.array)||l(e.optional))return!1}function OUe(e,t){let n=e.type,i=e.componentType,r=n==="ARRAY",o,a,s;r?(o=!0,a=e.componentCount,s=!l(a)):e.array?(o=!0,a=e.count,s=!l(e.count)):(o=!1,a=void 0,s=!1);let c;if(l(e.enumType)&&(c=t[e.enumType]),n===gt.ENUM)return{type:n,componentType:void 0,enumType:c,valueType:c.valueType,isArray:o,isVariableLengthArray:s,arrayLength:a};if(r&&i===gt.ENUM)return{type:i,componentType:void 0,enumType:c,valueType:c.valueType,isArray:o,isVariableLengthArray:s,arrayLength:a};if(n===gt.SCALAR||gt.isMatrixType(n)||gt.isVectorType(n))return{type:n,componentType:i,enumType:void 0,valueType:i,isArray:o,isVariableLengthArray:s,arrayLength:a};if(n===gt.BOOLEAN||n===gt.STRING)return{type:n,componentType:void 0,enumType:void 0,valueType:void 0,isArray:o,isVariableLengthArray:s,arrayLength:a};if(r&&(i===gt.BOOLEAN||i===gt.STRING))return{type:i,componentType:void 0,enumType:void 0,valueType:void 0,isArray:o,isVariableLengthArray:s,arrayLength:a};if(l(i)&&l(Mt[i]))return{type:gt.SCALAR,componentType:i,enumType:void 0,valueType:i,isArray:o,isVariableLengthArray:s,arrayLength:a};if(l(Mt[n]))return{type:gt.SCALAR,componentType:n,enumType:void 0,valueType:n,isArray:o,isVariableLengthArray:s,arrayLength:a}}Lo.prototype.normalize=function(e){return this._normalized?uq(e,this._valueType,Mt.normalize):e};Lo.prototype.unnormalize=function(e){return this._normalized?uq(e,this._valueType,Mt.unnormalize):e};Lo.prototype.applyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:Lo.valueTransformInPlace(e,this._offset,this._scale,Mt.applyValueTransform)};Lo.prototype.unapplyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:Lo.valueTransformInPlace(e,this._offset,this._scale,Mt.unapplyValueTransform)};Lo.prototype.expandConstant=function(e,t){t=t??!1;let n=this._isArray,i=this._arrayLength,r=gt.getComponentCount(this._type),o=n&&r>1;if(!n&&r===1)return e;if(!n)return new Array(r).fill(e);if(!o)return new Array(i).fill(e);if(!t)return new Array(this._arrayLength*r).fill(e);let a=new Array(r).fill(e);return new Array(this._arrayLength).fill(a)};Lo.prototype.handleNoData=function(e){let t=this._noData;if(!l(t))return e;if(!yce(e,t))return e};function yce(e,t){if(!Array.isArray(e))return e===t;if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!yce(e[n],t[n]))return!1;return!0}Lo.prototype.unpackVectorAndMatrixTypes=function(e,t){t=t??!1;let n=gt.getMathType(this._type),i=this._isArray,r=gt.getComponentCount(this._type),o=i&&r>1;return l(n)?t&&o?e.map(function(a){return n.unpack(a)}):i?n.unpackArray(e):n.unpack(e):e};Lo.prototype.packVectorAndMatrixTypes=function(e,t){t=t??!1;let n=gt.getMathType(this._type),i=this._isArray,r=gt.getComponentCount(this._type),o=i&&r>1;return l(n)?t&&o?e.map(function(a){return n.pack(a,[])}):i?n.packArray(e,[]):n.pack(e,[]):e};Lo.prototype.validate=function(e){if(!(!l(e)&&l(this._default)))return this._required&&!l(e)?"required property must have a value":this._isArray?MUe(this,e):Ace(this,e)};function MUe(e,t){if(!Array.isArray(t))return`value ${t} must be an array`;let n=t.length;if(!e._isVariableLengthArray&&n!==e._arrayLength)return"Array length does not match property.arrayLength";for(let i=0;i<n;i++){let r=Ace(e,t[i]);if(l(r))return r}}function Ace(e,t){let n=e._type,i=e._componentType,r=e._enumType,o=e._normalized;return gt.isVectorType(n)?LUe(t,n,i):gt.isMatrixType(n)?NUe(t,n,i):n===gt.STRING?FUe(t):n===gt.BOOLEAN?BUe(t):n===gt.ENUM?kUe(t,r):zUe(t,i,o)}function LUe(e,t,n){if(!Mt.isVectorCompatible(n))return`componentType ${n} is incompatible with vector type ${t}`;if(t===gt.VEC2&&!(e instanceof k))return`vector value ${e} must be a Cartesian2`;if(t===gt.VEC3&&!(e instanceof h))return`vector value ${e} must be a Cartesian3`;if(t===gt.VEC4&&!(e instanceof ae))return`vector value ${e} must be a Cartesian4`}function NUe(e,t,n){if(!Mt.isVectorCompatible(n))return`componentType ${n} is incompatible with matrix type ${t}`;if(t===gt.MAT2&&!(e instanceof Zi))return`matrix value ${e} must be a Matrix2`;if(t===gt.MAT3&&!(e instanceof $))return`matrix value ${e} must be a Matrix3`;if(t===gt.MAT4&&!(e instanceof O))return`matrix value ${e} must be a Matrix4`}function FUe(e){if(typeof e!="string")return aL(e,gt.STRING)}function BUe(e){if(typeof e!="boolean")return aL(e,gt.BOOLEAN)}function kUe(e,t){let n=typeof e;if(l(t))return n!=="string"||!l(t.valuesByName[e])?`value ${e} is not a valid enum name for ${t.id}`:void 0}function zUe(e,t,n){let i=typeof e;switch(t){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 i!=="number"?aL(e,t):isFinite(e)?gce(e,t,n):_ce(e,t);case Mt.INT64:case Mt.UINT64:return i!=="number"&&i!=="bigint"?aL(e,t):i==="number"&&!isFinite(e)?_ce(e,t):gce(e,t,n)}}function aL(e,t){return`value ${e} does not match type ${t}`}function pce(e,t,n){let i=`value ${e} is out of range for type ${t}`;return n&&(i+=" (normalized)"),i}function gce(e,t,n){if(n){let i=Mt.isUnsignedIntegerType(t)?0:-1;return e<i||e>1?pce(e,t,n):void 0}if(e<Mt.getMinimum(t)||e>Mt.getMaximum(t))return pce(e,t,n)}function _ce(e,t){return`value ${e} of type ${t} must be finite`}function uq(e,t,n){if(!Array.isArray(e))return n(e,t);for(let i=0;i<e.length;i++)e[i]=uq(e[i],t,n);return e}Lo.valueTransformInPlace=function(e,t,n,i){if(!Array.isArray(e))return i(e,t,n);for(let r=0;r<e.length;r++)e[r]=Lo.valueTransformInPlace(e[r],t[r],n[r],i);return e};Lo.prototype.cpuBytesPerElement=function(){return bce(this,this.valueType)};Lo.prototype.gpuBytesPerElement=function(){let e=Mt.gpuComponentType(this.valueType);return bce(this,e)};function bce(e,t){let n=e.type,i=gt.getComponentCount(n),r=e.isArray?e.arrayLength:1,o=Mt.getSizeInBytes(t);return i*r*o}Lo.prototype.isGpuCompatible=function(e){let t=this.type;return!(this.isVariableLengthArray||t===gt.STRING||t===gt.BOOLEAN||this.gpuBytesPerElement()>e)};var fq=[void 0,"float","vec2","vec3","vec4"],xce=[void 0,"int","ivec2","ivec3","ivec4"],UUe=[void 0,"uint","uvec2","uvec3","uvec4"],VUe={[Fc.FLOAT]:"uintBitsToFloat",[Fc.INTEGER]:"int",[Fc.UNSIGNED_INTEGER]:""};Lo.prototype.getGlslTypeWebGL1=function(){let e=gt.getComponentCount(this.type);return this.isArray&&(e=this.arrayLength),this.normalized?fq[e]:xce[e]};Lo.prototype.getGlslType=function(){let e=this.valueType,t=gt.getComponentCount(this.type),n=this.isArray?this.arrayLength:1;return t*=n,!Mt.isIntegerType(e)||this.normalized?fq[t]:Mt.isUnsignedIntegerType(e)?UUe[t]:xce[t]};Lo.prototype.unpackTextureInShader=function(e,t,n,i){let r=this.getGlslType(),o=Mt.gpuComponentType(this.valueType),a=t.length,s=this.type,c=gt.getComponentCount(s)*(this.isArray?this.arrayLength:1),u=Math.floor(a/c),f=`${n}_rawChannels`,d=`${n}_rawBits`,p=`${n}_unpackedValue`,g=`${r} ${p};`,m=`uint ${d};`;i.push(g),i.push(m);let y=`${fq[a]} ${f} = ${e};`;i.push(y);let A=VUe[Mt.category(o)],b=c>1;for(let x=0;x<c;x++){let T="rgba".slice(x*u,(x+1)*u),C=a>1?`.${T}`:"",E=`${d} = czm_unpackTexture(${f}${C});`,w="";b&&(w=`[${x}]`);let D="",R="";if(this.normalized){let N=Mt.getMaximum(o);D=` * ${1/Number(N)}`,R="float"}let M=`${p}${w} = ${R}(${A}(${d}))${D};`;i.push(E),i.push(M)}return p};Lo.prototype.unpackTextureInShaderWebGL1=function(e){return this.normalized?e:`${this.getGlslTypeWebGL1()}(255.0 * ${e})`};var A0=Lo;function jUe(e,t){if(!l(t))return;let n=t.length;if(n===0)return;let i=e.length;e.length+=n;for(let r=0;r<n;r++)e[i+r]=t[r]}var Xn=jUe;function yI(e){e=e??H.EMPTY_OBJECT;let t=e.count,n=e.property,i=e.classProperty,r=e.bufferViews,o=i.type,a=i.isArray,s=i.isVariableLengthArray,c=i.valueType,u=i.enumType,f=o===gt.STRING,d=o===gt.BOOLEAN,p=0,g;if(s){let _=n.arrayOffsetType??n.offsetType;_=Mt[_]??Mt.UINT32;let v=n.arrayOffsets??n.arrayOffsetBufferView;g=new dq(r[v],_,t+1),p+=g.typedArray.byteLength}let m=gt.getComponentCount(o),y;s?y=g.get(t)-g.get(0):a?y=t*i.arrayLength:y=t;let A=m*y,b;if(f){let _=n.stringOffsetType??n.offsetType;_=Mt[_]??Mt.UINT32;let v=n.stringOffsets??n.stringOffsetBufferView;b=new dq(r[v],_,A+1),p+=b.typedArray.byteLength}(f||d)&&(c=Mt.UINT8);let x;f?x=b.get(A)-b.get(0):d?x=Math.ceil(A/8):x=A;let T=n.values??n.bufferView,C=new dq(r[T],c,x);p+=C.typedArray.byteLength;let E=n.offset,w=n.scale,D=i.hasValueTransform||l(E)||l(w);E=E??i.offset,w=w??i.scale,E=Tce(E),w=Tce(w);let R,M,N=this;f?R=function(_){return WUe(_,N._values,N._stringOffsets)}:d?(R=function(_){return qUe(_,N._values)},M=function(_,v){YUe(_,N._values,v)}):l(u)?(R=function(_){let v=N._values.get(_);return u.namesByValue[v]},M=function(_,v){let S=u.valuesByName[v];N._values.set(_,S)}):(R=function(_){return N._values.get(_)},M=function(_,v){N._values.set(_,v)}),this._arrayOffsets=g,this._stringOffsets=b,this._values=C,this._classProperty=i,this._count=t,this._vectorComponentCount=m,this._min=n.min,this._max=n.max,this._offset=E,this._scale=w,this._hasValueTransform=D,this._getValue=R,this._setValue=M,this._unpackedValues=void 0,this._extras=n.extras,this._extensions=n.extensions,this._byteLength=p}Object.defineProperties(yI.prototype,{hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},byteLength:{get:function(){return this._byteLength}},classProperty:{get:function(){return this._classProperty}}});yI.prototype.get=function(e){let t=HUe(this,e);return t=this._classProperty.handleNoData(t),l(t)?(t=this._classProperty.normalize(t),t=tVe(this,t),this._classProperty.unpackVectorAndMatrixTypes(t)):(t=this._classProperty.default,this._classProperty.unpackVectorAndMatrixTypes(t))};yI.prototype.set=function(e,t){let n=this._classProperty;t=n.packVectorAndMatrixTypes(t),t=nVe(this,t),t=n.unnormalize(t),GUe(this,e,t)};yI.prototype.getTypedArray=function(){if(l(this._values))return this._values.typedArray};function Tce(e){if(!Array.isArray(e))return e;let t=[];for(let n=0;n<e.length;n++){let i=e[n];Array.isArray(i)?Xn(t,i):t.push(i)}return t}function HUe(e,t){vce(e)&&Ece(e);let n=e._classProperty,i=n.isArray,r=n.type,o=gt.getComponentCount(r);if(l(e._unpackedValues)){let a=e._unpackedValues[t];return i?Xe(a,!0):a}return!i&&o===1?e._getValue(t):Cce(e,n,t)}function Cce(e,t,n){let i,r;if(t.isVariableLengthArray){i=e._arrayOffsets.get(n),r=e._arrayOffsets.get(n+1)-i;let a=gt.getComponentCount(t.type);i*=a,r*=a}else{let s=(t.arrayLength??1)*e._vectorComponentCount;i=n*s,r=s}let o=new Array(r);for(let a=0;a<r;a++)o[a]=e._getValue(i+a);return o}function GUe(e,t,n){QUe(e,t,n)&&Ece(e);let i=e._classProperty,r=i.isArray,o=i.type,a=gt.getComponentCount(o);if(l(e._unpackedValues)){i.isArray&&(n=Xe(n,!0)),e._unpackedValues[t]=n;return}if(!r&&a===1){e._setValue(t,n);return}let s,c;if(i.isVariableLengthArray)s=e._arrayOffsets.get(t),c=e._arrayOffsets.get(t+1)-s;else{let f=(i.arrayLength??1)*e._vectorComponentCount;s=t*f,c=f}for(let u=0;u<c;++u)e._setValue(s+u,n[u])}function WUe(e,t,n){let i=n.get(e),r=n.get(e+1)-i;return Wu(t.typedArray,i,r)}function qUe(e,t){let n=e>>3,i=e%8;return(t.typedArray[n]>>i&1)===1}function YUe(e,t,n){let i=e>>3,r=e%8;n?t.typedArray[i]|=1<<r:t.typedArray[i]&=~(1<<r)}function XUe(e,t){let n=t.dataView,i=e*8,r=0,o=(n.getUint8(i+7)&128)>0,a=!0;for(let s=0;s<8;++s){let c=n.getUint8(i+s);o&&(a?c!==0&&(c=~(c-1)&255,a=!1):c=~c&255),r+=c*Math.pow(256,s)}return o&&(r=-r),r}function KUe(e,t){let n=t.dataView,i=e*8,r=BigInt(0),o=(n.getUint8(i+7)&128)>0,a=!0;for(let s=0;s<8;++s){let c=n.getUint8(i+s);o&&(a?c!==0&&(c=~(c-1)&255,a=!1):c=~c&255),r+=BigInt(c)*(BigInt(1)<<BigInt(s*8))}return o&&(r=-r),r}function $Ue(e,t){let n=t.dataView,i=e*8,r=n.getUint32(i,!0),o=n.getUint32(i+4,!0);return r+4294967296*o}function JUe(e,t){let n=t.dataView,i=e*8,r=BigInt(n.getUint32(i,!0)),o=BigInt(n.getUint32(i+4,!0));return r+BigInt(4294967296)*o}function ZUe(e){switch(e){case Mt.INT8:return Y.BYTE;case Mt.UINT8:return Y.UNSIGNED_BYTE;case Mt.INT16:return Y.SHORT;case Mt.UINT16:return Y.UNSIGNED_SHORT;case Mt.INT32:return Y.INT;case Mt.UINT32:return Y.UNSIGNED_INT;case Mt.FLOAT32:return Y.FLOAT;case Mt.FLOAT64:return Y.DOUBLE}}function vce(e){if(l(e._unpackedValues))return!1;let t=e._classProperty,n=t.type,i=t.valueType;return n===gt.STRING||i===Mt.INT64&&!fn.supportsBigInt64Array()||i===Mt.UINT64&&!fn.supportsBigUint64Array()}function QUe(e,t,n){if(vce(e))return!0;let i=e._arrayOffsets;if(l(i)){let r=i.get(t+1)-i.get(t),o=n.length;if(r!==o)return!0}return!1}function Ece(e){e._unpackedValues=eVe(e),e._arrayOffsets=void 0,e._stringOffsets=void 0,e._values=void 0}function eVe(e){let t=e._count,n=new Array(t),i=e._classProperty,r=i.isArray,o=i.type,a=gt.getComponentCount(o);if(!r&&a===1){for(let s=0;s<t;++s)n[s]=e._getValue(s);return n}for(let s=0;s<t;s++)n[s]=Cce(e,i,s);return n}function tVe(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:A0.valueTransformInPlace(t,e._offset,e._scale,Mt.applyValueTransform)}function nVe(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:A0.valueTransformInPlace(t,e._offset,e._scale,Mt.unapplyValueTransform)}function dq(e,t,n){let i=this,r,o,a;if(t===Mt.INT64)fn.supportsBigInt()?fn.supportsBigInt64Array()?(r=new BigInt64Array(e.buffer,e.byteOffset,n),a=function(s,c){i.typedArray[s]=BigInt(c)}):(r=new Uint8Array(e.buffer,e.byteOffset,n*8),o=function(s){return KUe(s,i)}):(pt("INT64 type is not fully supported on this platform. Values greater than 2^53 - 1 or less than -(2^53 - 1) may lose precision when read."),r=new Uint8Array(e.buffer,e.byteOffset,n*8),o=function(s){return XUe(s,i)});else if(t===Mt.UINT64)fn.supportsBigInt()?fn.supportsBigUint64Array()?(r=new BigUint64Array(e.buffer,e.byteOffset,n),a=function(s,c){i.typedArray[s]=BigInt(c)}):(r=new Uint8Array(e.buffer,e.byteOffset,n*8),o=function(s){return JUe(s,i)}):(pt("UINT64 type is not fully supported on this platform. Values greater than 2^53 - 1 may lose precision when read."),r=new Uint8Array(e.buffer,e.byteOffset,n*8),o=function(s){return $Ue(s,i)});else{let s=ZUe(t);r=Y.createArrayBufferView(s,e.buffer,e.byteOffset,n),a=function(c,u){i.typedArray[c]=u}}l(o)||(o=function(s){return i.typedArray[s]}),this.typedArray=r,this.dataView=new DataView(r.buffer,r.byteOffset),this.get=o,this.set=a,this._componentType=t}var sL=yI;function rh(e){e=e??H.EMPTY_OBJECT;let t=e.count,n=e.class,i=0,r={};if(l(e.properties)){for(let o in e.properties)if(e.properties.hasOwnProperty(o)){let a=new sL({count:t,property:e.properties[o],classProperty:n.properties[o],bufferViews:e.bufferViews});r[o]=a,i+=a.byteLength}}this._count=t,this._class=n,this._properties=r,this._byteLength=i}Object.defineProperties(rh.prototype,{count:{get:function(){return this._count}},class:{get:function(){return this._class}},byteLength:{get:function(){return this._byteLength}},properties:{get:function(){return this._properties}}});rh.prototype.hasProperty=function(e){return qn.hasProperty(e,this._properties,this._class)};rh.prototype.hasPropertyBySemantic=function(e){return qn.hasPropertyBySemantic(e,this._properties,this._class)};rh.prototype.getPropertyIds=function(e){return qn.getPropertyIds(this._properties,this._class,e)};rh.prototype.getProperty=function(e,t){let n=this._properties[t],i;return l(n)?i=n.get(e):i=iVe(this._class,t),i};rh.prototype.setProperty=function(e,t,n){let i=this._properties[t];return l(i)?(i.set(e,n),!0):!1};rh.prototype.getPropertyBySemantic=function(e,t){let n,i=this._class.propertiesBySemantic;if(l(i)&&(n=i[t]),l(n))return this.getProperty(e,n.id)};rh.prototype.setPropertyBySemantic=function(e,t,n){let i,r=this._class.propertiesBySemantic;return l(r)&&(i=r[t]),l(i)?this.setProperty(e,i.id,n):!1};rh.prototype.getPropertyTypedArray=function(e){let t=this._properties[e];if(l(t))return t.getTypedArray()};rh.prototype.getPropertyTypedArrayBySemantic=function(e){let t,n=this._class.propertiesBySemantic;if(l(n)&&(t=n[e]),l(t))return this.getPropertyTypedArray(t.id)};function iVe(e,t){let n=e.properties;if(!l(n))return;let i=n[t];if(l(i)&&l(i.default)){let r=i.default;return i.isArray&&(r=Xe(r,!0)),r=i.normalize(r),i.unpackVectorAndMatrixTypes(r)}}var oh=rh;var hq=class{get cacheKey(){pe.throwInstantiationError()}load(){pe.throwInstantiationError()}unload(){}process(t){return!1}getError(t,n){l(n)&&l(n.message)&&(t+=`
|
|
${n.message}`);let i=new oe(t);return l(n)&&(i.stack=`Original stack:
|
|
${n.stack}
|
|
Handler stack:
|
|
${i.stack}`),i}isDestroyed(){return!1}destroy(){return this.unload(),ue(this)}},er=hq;var Sce={UNLOADED:0,LOADING:1,LOADED:2,PROCESSING:3,READY:4,FAILED:5};Object.freeze(Sce);var At=Sce;var cL=class extends er{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.typedArray,i=t.resource,r=t.cacheKey;this._typedArray=n,this._resource=i,this._cacheKey=r,this._state=At.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get typedArray(){return this._typedArray}async load(){return l(this._promise)?this._promise:l(this._typedArray)?(this._promise=Promise.resolve(this),this._promise):(this._promise=rVe(this),this._promise)}static _fetchArrayBuffer(t){return t.fetchArrayBuffer()}unload(){this._typedArray=void 0}};async function rVe(e){let t=e._resource;e._state=At.LOADING;try{let n=await cL._fetchArrayBuffer(t);return e.isDestroyed()?void 0:(e._typedArray=new Uint8Array(n),e._state=At.READY,e)}catch(n){if(e.isDestroyed())return;e._state=At.FAILED;let i=`Failed to load external buffer: ${t.url}`;throw e.getError(i,n)}}var tC=cL;function oVe(e){let t=e?.extensions;if(l(t))return t.KHR_meshopt_compression??t.EXT_meshopt_compression}var XA=oVe;var mq=class extends er{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,r=t.bufferViewId,o=t.gltfResource,a=t.baseResource,s=t.cacheKey,c=i.bufferViews[r],u=c.buffer,f=c.byteOffset,d=c.byteLength,p=!1,g,m,y,A,b=XA(c);l(b)&&(u=b.buffer,f=b.byteOffset??0,d=b.byteLength,p=!0,g=b.byteStride,m=b.count,y=b.mode,A=b.filter??"NONE");let x=i.buffers[u];this._hasMeshopt=p,this._meshoptByteStride=g,this._meshoptCount=m,this._meshoptMode=y,this._meshoptFilter=A,this._resourceCache=n,this._gltfResource=o,this._baseResource=a,this._buffer=x,this._bufferId=u,this._byteOffset=f,this._byteLength=d,this._cacheKey=s,this._bufferLoader=void 0,this._typedArray=void 0,this._state=At.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get typedArray(){return this._typedArray}async load(){return l(this._promise)?this._promise:(this._state=At.LOADING,this._promise=aVe(this),this._promise)}unload(){l(this._bufferLoader)&&!this._bufferLoader.isDestroyed()&&this._resourceCache.unload(this._bufferLoader),this._bufferLoader=void 0,this._typedArray=void 0}};async function aVe(e){try{let t=sVe(e);if(e._bufferLoader=t,await t.load(),e.isDestroyed())return;let n=t.typedArray,i=new Uint8Array(n.buffer,n.byteOffset+e._byteOffset,e._byteLength);if(e.unload(),e._typedArray=i,e._hasMeshopt){let r=e._meshoptCount,o=e._meshoptByteStride,a=new Uint8Array(r*o);u_.decodeGltfBuffer(a,r,o,e._typedArray,e._meshoptMode,e._meshoptFilter),e._typedArray=a}return e._state=At.READY,e}catch(t){if(e.isDestroyed())return;throw e.unload(),e._state=At.FAILED,e.getError("Failed to load buffer view",t)}}function sVe(e){let t=e._resourceCache,n=e._buffer;if(l(n.uri)){let o=e._baseResource.getDerivedResource({url:n.uri});return t.getExternalBufferLoader({resource:o})}let i=n.extras?._pipeline?.source;return t.getEmbeddedBufferLoader({parentResource:e._gltfResource,bufferId:e._bufferId,typedArray:i})}var AI=mq;var KA=class e{static _getDecoderTaskProcessor(){if(!l(e._decoderTaskProcessor)){let t=new Yn("decodeDraco",e._maxDecodingConcurrency);t.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}).then(function(n){n?e._taskProcessorReady=!0:e._error=new oe("Draco decoder could not be initialized.")}).catch(n=>{e._error=n}),e._decoderTaskProcessor=t}return e._decoderTaskProcessor}static decodePointCloud(t){let n=e._getDecoderTaskProcessor();if(l(e._error))throw e._error;if(e._taskProcessorReady)return n.scheduleTask(t,[t.buffer.buffer])}static decodeBufferView(t){let n=e._getDecoderTaskProcessor();if(l(e._error))throw e._error;if(e._taskProcessorReady)return n.scheduleTask(t,[t.array.buffer])}};KA._maxDecodingConcurrency=Math.max(fn.hardwareConcurrency-1,1);KA._decoderTaskProcessor=void 0;KA._taskProcessorReady=!1;KA._error=void 0;var h_=KA;var Mn={POSITION:"POSITION",NORMAL:"NORMAL",TANGENT:"TANGENT",TEXCOORD:"TEXCOORD",COLOR:"COLOR",JOINTS:"JOINTS",WEIGHTS:"WEIGHTS",FEATURE_ID:"_FEATURE_ID",SCALE:"KHR_gaussian_splatting:SCALE",ROTATION:"KHR_gaussian_splatting:ROTATION",CUMULATIVE_DISTANCE:"BENTLEY_materials_line_style:CUMULATIVE_DISTANCE"};function cVe(e){switch(e){case Mn.POSITION:return"positionMC";case Mn.NORMAL:return"normalMC";case Mn.TANGENT:return"tangentMC";case Mn.TEXCOORD:return"texCoord";case Mn.COLOR:return"color";case Mn.JOINTS:return"joints";case Mn.WEIGHTS:return"weights";case Mn.FEATURE_ID:return"featureId";case Mn.SCALE:return"scale";case Mn.ROTATION:return"rotation";case Mn.CUMULATIVE_DISTANCE:return"cumulativeDistance"}}Mn.hasSetIndex=function(e){switch(e){case Mn.POSITION:case Mn.NORMAL:case Mn.TANGENT:case Mn.CUMULATIVE_DISTANCE:return!1;case Mn.TEXCOORD:case Mn.COLOR:case Mn.JOINTS:case Mn.WEIGHTS:case Mn.FEATURE_ID:case Mn.SCALE:case Mn.ROTATION:return!0}};Mn.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"POSITION":return Mn.POSITION;case"NORMAL":return Mn.NORMAL;case"TANGENT":return Mn.TANGENT;case"TEXCOORD":return Mn.TEXCOORD;case"COLOR":return Mn.COLOR;case"JOINTS":return Mn.JOINTS;case"WEIGHTS":return Mn.WEIGHTS;case"_FEATURE_ID":return Mn.FEATURE_ID;case"KHR_gaussian_splatting:SCALE":case"_SCALE":return Mn.SCALE;case"KHR_gaussian_splatting:ROTATION":case"_ROTATION":return Mn.ROTATION;case"BENTLEY_materials_line_style:CUMULATIVE_DISTANCE":return Mn.CUMULATIVE_DISTANCE}};Mn.fromPntsSemantic=function(e){switch(e){case"POSITION":case"POSITION_QUANTIZED":return Mn.POSITION;case"RGBA":case"RGB":case"RGB565":return Mn.COLOR;case"NORMAL":case"NORMAL_OCT16P":return Mn.NORMAL;case"BATCH_ID":return Mn.FEATURE_ID}};Mn.getGlslType=function(e){switch(e){case Mn.POSITION:case Mn.NORMAL:case Mn.TANGENT:return"vec3";case Mn.TEXCOORD:return"vec2";case Mn.COLOR:return"vec4";case Mn.JOINTS:return"ivec4";case Mn.WEIGHTS:return"vec4";case Mn.FEATURE_ID:return"int";case Mn.SCALE:return"vec3";case Mn.ROTATION:return"vec4";case Mn.CUMULATIVE_DISTANCE:return"float";case Mn.OPACITY:return"float"}};Mn.getVariableName=function(e,t){let n=cVe(e);return l(t)&&(n+=`_${t}`),n};Object.freeze(Mn);var ot=Mn;var pq=class extends er{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,r=t.primitive,o=t.draco,a=t.gltfResource,s=t.baseResource,c=t.cacheKey;this._resourceCache=n,this._gltfResource=a,this._baseResource=s,this._gltf=i,this._primitive=r,this._draco=o,this._cacheKey=c,this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodePromise=void 0,this._decodedData=void 0,this._state=At.UNLOADED,this._promise=void 0,this._dracoError=void 0}get cacheKey(){return this._cacheKey}get decodedData(){return this._decodedData}async load(){return l(this._promise)?this._promise:(this._state=At.LOADING,this._promise=lVe(this),this._promise)}process(t){if(this._state===At.READY)return!0;if(this._state!==At.PROCESSING||(l(this._dracoError)&&wce(this,this._dracoError),!l(this._bufferViewTypedArray))||l(this._decodePromise))return!1;let n=this._draco,i=this._primitive,r=this._gltf,o=r.bufferViews,a=n.bufferView,s=o[a],c=n.attributes,u=[];for(let p in i.attributes)if(i.attributes.hasOwnProperty(p)){let g=fVe(p);l(g)&&r.accessors[i.attributes[p]].componentType===Y.FLOAT&&(u.includes(g)||u.push(g))}let f={array:new Uint8Array(this._bufferViewTypedArray),bufferView:s,compressedAttributes:c,dequantizeInShader:!0,attributesToSkipTransform:u},d=h_.decodeBufferView(f);if(!l(d))return!1;this._decodePromise=uVe(this,d)}unload(){l(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}};async function lVe(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=At.PROCESSING,e)}catch(n){if(e.isDestroyed())return;wce(e,n)}}function wce(e,t){throw e.unload(),e._state=At.FAILED,e.getError("Failed to load Draco",t)}async function uVe(e,t){try{let n=await t;return e.isDestroyed()?void 0:(e.unload(),e._decodedData={indices:n.indexArray,vertexAttributes:n.attributeData},e._state=At.READY,e._baseResource)}catch(n){if(e.isDestroyed())return;e._dracoError=n}}var $A={};$A[ot.POSITION]="POSITION";$A[ot.NORMAL]="NORMAL";$A[ot.COLOR]="COLOR";$A[ot.TEXCOORD]="TEX_COORD";function fVe(e){for(let t in $A)if($A.hasOwnProperty(t)&&e.startsWith(t))return $A[t]}var bI=pq;function dVe(e){let{uint8Array:t,format:n,request:i}=e,r=e.flipY??!1,o=e.skipColorSpaceConversion??!1,a=new Blob([t],{type:n}),s;return De.supportsImageBitmapOptions().then(function(c){return c?Promise.resolve(De.createImageBitmapFromBlob(a,{flipY:r,premultiplyAlpha:!1,skipColorSpaceConversion:o})):(s=window.URL.createObjectURL(a),new De({url:s,request:i}).fetchImage({flipY:r,skipColorSpaceConversion:o}))}).then(function(c){return l(s)&&window.URL.revokeObjectURL(s),c}).catch(function(c){return l(s)&&window.URL.revokeObjectURL(s),Promise.reject(c)})}var m_=dVe;function nC(e,t,n,i,r){this._format=e,this._datatype=t,this._width=n,this._height=i,this._buffer=r}Object.defineProperties(nC.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}}});nC.clone=function(e){if(l(e))return new nC(e._format,e._datatype,e._width,e._height,e._buffer)};nC.prototype.clone=function(){return nC.clone(this)};var lL=nC;function b0(){}b0._transcodeTaskProcessor=new Yn("transcodeKTX2",Number.POSITIVE_INFINITY);b0._readyPromise=void 0;function hVe(){let e=b0._transcodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then(function(t){if(t)return b0._transcodeTaskProcessor;throw new oe("KTX2 transcoder could not be initialized.")});b0._readyPromise=e}b0.transcode=function(e,t){return l(b0._readyPromise)||hVe(),b0._readyPromise.then(function(n){let i=e;e instanceof ArrayBuffer&&(i=new Uint8Array(e));let r={supportedTargetFormats:t,ktx2Buffer:i};return n.scheduleTask(r,[i.buffer])}).then(function(n){let i=n.length,r=Object.keys(n[0]);for(let o=0;o<i;o++){let a=n[o];for(let s=0;s<r.length;s++){let c=a[r[s]];a[r[s]]=new lL(c.internalFormat,c.datatype,c.width,c.height,c.levelBuffer)}}if(r.length===1){for(let o=0;o<i;++o)n[o]=n[o][r[0]];i===1&&(n=n[0])}return n}).catch(function(n){throw n})};var uL=b0;var Ice;Pce.setKTX2SupportedFormats=function(e,t,n,i,r,o){Ice={s3tc:e,pvrtc:t,astc:n,etc:i,etc1:r,bc7:o}};function Pce(e){let t;return e instanceof ArrayBuffer||ArrayBuffer.isView(e)?t=Promise.resolve(e):t=De.createIfNeeded(e).fetchArrayBuffer(),t.then(function(n){return uL.transcode(n,Ice)})}var qu=Pce;var xI=class extends er{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,r=t.imageId,o=t.gltfResource,a=t.baseResource,s=t.cacheKey,c=i.images[r],u=c.bufferView,f=c.uri;this._resourceCache=n,this._gltfResource=o,this._baseResource=a,this._gltf=i,this._bufferViewId=u,this._uri=f,this._cacheKey=s,this._bufferViewLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._state=At.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get image(){return this._image}get mipLevels(){return this._mipLevels}load(){return l(this._promise)?this._promise:l(this._bufferViewId)?(this._promise=mVe(this),this._promise):(this._promise=pVe(this),this._promise)}unload(){l(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}};function Dce(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 mVe(e){e._state=At.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,r=await _Ve(i);if(e.isDestroyed())return;let o=Dce(r);return e.unload(),e._image=o.image,e._mipLevels=o.mipLevels,e._state=At.READY,e}catch(n){return e.isDestroyed()?void 0:Rce(e,n,"Failed to load embedded image")}}async function pVe(e){e._state=At.LOADING;let t=e._baseResource,n=e._uri,i=t.getDerivedResource({url:n});try{let r=await AVe(i);if(e.isDestroyed())return;let o=Dce(r);return e.unload(),e._image=o.image,e._mipLevels=o.mipLevels,e._state=At.READY,e}catch(r){return e.isDestroyed()?void 0:Rce(e,r,`Failed to load image: ${n}`)}}function Rce(e,t,n){return e.unload(),e._state=At.FAILED,Promise.reject(e.getError(n,t))}function gVe(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 oe("Image format is not recognized")}async function _Ve(e){let t=gVe(e);if(t==="image/ktx2"){let n=new Uint8Array(e);return qu(n)}return xI._loadImageFromTypedArray({uint8Array:e,format:t,flipY:!1,skipColorSpaceConversion:!0})}var yVe=/(^data:image\/ktx2)|(\.ktx2$)/i;function AVe(e){let t=e.getUrlComponent(!1,!0);return yVe.test(t)?qu(e):e.fetchImage({skipColorSpaceConversion:!0,preferImageBitmap:!0})}xI._loadImageFromTypedArray=m_;var TI=xI;function bVe(e,t){pt(e,t)}var qs=bVe;function xVe(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}var Kn=xVe;var JA={STREAM_DRAW:ee.STREAM_DRAW,STATIC_DRAW:ee.STATIC_DRAW,DYNAMIC_DRAW:ee.DYNAMIC_DRAW,DYNAMIC_READ:ee.DYNAMIC_READ};JA.validate=function(e){return e===JA.STREAM_DRAW||e===JA.STATIC_DRAW||e===JA.DYNAMIC_DRAW||e===JA.DYNAMIC_READ};Object.freeze(JA);var Oe=JA;function Bc(e){e=e??H.EMPTY_OBJECT;let t=e.context._gl,n=e.bufferTarget,i=e.typedArray,r=e.sizeInBytes,o=e.usage,a=l(i);a&&(r=i.byteLength);let s=t.createBuffer();t.bindBuffer(n,s),t.bufferData(n,a?i:r,o),t.bindBuffer(n,null),this._id=Kn(),this._gl=t,this._webgl2=e.context._webgl2,this._bufferTarget=n,this._sizeInBytes=r,this._usage=o,this._buffer=s,this.vertexArrayDestroyable=!0}Bc.createPixelBuffer=function(e){if(!e.context._webgl2)throw new pe("A WebGL 2 context is required to create PixelBuffers.");return new Bc({context:e.context,bufferTarget:ee.PIXEL_PACK_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};Bc.createVertexBuffer=function(e){return new Bc({context:e.context,bufferTarget:ee.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};Bc.createIndexBuffer=function(e){let t=e.context,n=e.indexDatatype,i=Ve.getSizeInBytes(n),r=new Bc({context:t,bufferTarget:ee.ELEMENT_ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage}),o=r.sizeInBytes/i;return Object.defineProperties(r,{indexDatatype:{get:function(){return n}},bytesPerIndex:{get:function(){return i}},numberOfIndices:{get:function(){return o}}}),r};Object.defineProperties(Bc.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}});Bc.prototype._getBuffer=function(){return this._buffer};Bc.prototype._bind=function(){let e=this._gl,t=this._bufferTarget;e.bindBuffer(t,this._buffer)};Bc.prototype._unBind=function(){let e=this._gl,t=this._bufferTarget;e.bindBuffer(t,null)};Bc.prototype.copyFromArrayView=function(e,t){t=t??0;let n=this._gl,i=this._bufferTarget;n.bindBuffer(i,this._buffer),n.bufferSubData(i,t,e),n.bindBuffer(i,null)};Bc.prototype.copyFromBuffer=function(e,t,n,i){let r=ee.COPY_READ_BUFFER,o=ee.COPY_WRITE_BUFFER,a=this._gl;a.bindBuffer(o,this._buffer),a.bindBuffer(r,e._buffer),a.copyBufferSubData(r,o,t,n,i),a.bindBuffer(o,null),a.bindBuffer(r,null)};Bc.prototype.getBufferData=function(e,t,n,i){t=t??0,n=n??0;let r=this._gl,o=ee.COPY_READ_BUFFER;r.bindBuffer(o,this._buffer),r.getBufferSubData(o,t,e,n,i),r.bindBuffer(o,null)};Bc.prototype.isDestroyed=function(){return!1};Bc.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),ue(this)};var Ze=Bc;var Oce={TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3};Object.freeze(Oce);var kc=Oce;var gq=class extends er{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,r=t.accessorId,o=t.gltfResource,a=t.baseResource,s=t.primitive,c=t.draco,u=t.cacheKey,f=t.asynchronous??!0,d=t.loadBuffer??!1,p=t.loadTypedArray??!1,g=i.accessors[r].componentType;this._resourceCache=n,this._gltfResource=o,this._baseResource=a,this._gltf=i,this._accessorId=r,this._indexDatatype=g,this._primitive=s,this._draco=c,this._cacheKey=u,this._asynchronous=f,this._loadBuffer=d,this._loadTypedArray=p,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=At.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get buffer(){return this._buffer}get typedArray(){return this._typedArray}get indexDatatype(){return this._indexDatatype}async load(){return l(this._promise)?this._promise:l(this._draco)?(this._promise=CVe(this),this._promise):(this._promise=vVe(this),this._promise)}process(t){if(this._state===At.READY)return!0;if(this._state!==At.LOADED&&this._state!==At.PROCESSING)return!1;let n=this._typedArray,i=this._indexDatatype;if(l(this._dracoLoader))try{this._dracoLoader.process(t)&&(n=this._dracoLoader.decodedData.indices.typedArray,this._typedArray=n,i=Y.fromTypedArray(n),this._indexDatatype=i)}catch(o){yq(this,o)}if(!l(n))return!1;let r;if(this._loadBuffer&&this._asynchronous){let o=TVe;if(o.set(n,i,t.context),!t.jobScheduler.execute(o,kc.BUFFER))return!1;r=o.buffer}else this._loadBuffer&&(r=Mce(n,i,t.context));return this.unload(),this._buffer=r,this._typedArray=this._loadTypedArray?n:void 0,this._state=At.READY,this._resourceCache.statistics.addGeometryLoader(this),!0}unload(){l(this._buffer)&&this._buffer.destroy();let t=this._resourceCache;l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&t.unload(this._bufferViewLoader),l(this._dracoLoader)&&t.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}},_q=class{constructor(){this.typedArray=void 0,this.indexDatatype=void 0,this.context=void 0,this.buffer=void 0}set(t,n,i){this.typedArray=t,this.indexDatatype=n,this.context=i}execute(){this.buffer=Mce(this.typedArray,this.indexDatatype,this.context)}};function Mce(e,t,n){let i=Ze.createIndexBuffer({typedArray:e,context:n,usage:Oe.STATIC_DRAW,indexDatatype:t});return i.vertexArrayDestroyable=!1,i}var TVe=new _q;async function CVe(e){e._state=At.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=At.LOADED,e)}catch(n){if(e.isDestroyed())return;yq(e,n)}}async function vVe(e){let t=e._gltf,n=e._accessorId,r=t.accessors[n].bufferView;e._state=At.LOADING;let o=e._resourceCache;try{let a=o.getBufferViewLoader({gltf:t,bufferViewId:r,gltfResource:e._gltfResource,baseResource:e._baseResource});if(e._bufferViewLoader=a,await a.load(),e.isDestroyed())return;let s=a.typedArray;return e._typedArray=EVe(e,s),e._state=At.PROCESSING,e}catch(a){if(e.isDestroyed())return;yq(e,a)}}function EVe(e,t){let n=e._gltf,i=e._accessorId,r=n.accessors[i],o=r.count,a=r.componentType,s=Ve.getSizeInBytes(a),c=t.buffer,u=t.byteOffset+r.byteOffset;if(u%s!==0){let d=o*s,p=new Uint8Array(c,u,d);c=new Uint8Array(p).buffer,u=0,qs("index-buffer-unaligned",`The index array is not aligned to a ${s}-byte boundary.`)}let f;return a===Ve.UNSIGNED_BYTE?f=new Uint8Array(c,u,o):a===Ve.UNSIGNED_SHORT?f=new Uint16Array(c,u,o):a===Ve.UNSIGNED_INT&&(f=new Uint32Array(c,u,o)),f}function yq(e,t){throw e.unload(),e._state=At.FAILED,e.getError("Failed to load index buffer",t)}var CI=gq;function SVe(e,t){return t=t??0,Wu(e,t,Math.min(4,e.length))}var Om=SVe;function wVe(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=wVe;function IVe(e,t){return l(e.extensionsUsed)&&e.extensionsUsed.indexOf(t)>=0}var No=IVe;function Qt(){}Qt.objectLegacy=function(e,t){if(l(e)){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let i=e[n],r=t(i,n);if(l(r))return r}}};Qt.object=function(e,t){if(l(e)){let n=e.length;for(let i=0;i<n;i++){let r=e[i],o=t(r,i);if(l(o))return o}}};Qt.topLevel=function(e,t,n){let i=e[t];return l(i)&&!Array.isArray(i)?Qt.objectLegacy(i,n):Qt.object(i,n)};Qt.accessor=function(e,t){return Qt.topLevel(e,"accessors",t)};Qt.accessorWithSemantic=function(e,t,n){let i={};return Qt.mesh(e,function(r){return Qt.meshPrimitive(r,function(o){let a=Qt.meshPrimitiveAttribute(o,function(s,c){if(c.indexOf(t)===0&&!l(i[s])){i[s]=!0;let u=n(s);if(l(u))return u}});return l(a)?a:Qt.meshPrimitiveTarget(o,function(s){return Qt.meshPrimitiveTargetAttribute(s,function(c,u){if(u.indexOf(t)===0&&!l(i[c])){i[c]=!0;let f=n(c);if(l(f))return f}})})})})};Qt.accessorContainingVertexAttributeData=function(e,t){let n={};return Qt.mesh(e,function(i){return Qt.meshPrimitive(i,function(r){let o=Qt.meshPrimitiveAttribute(r,function(a){if(!l(n[a])){n[a]=!0;let s=t(a);if(l(s))return s}});return l(o)?o:Qt.meshPrimitiveTarget(r,function(a){return Qt.meshPrimitiveTargetAttribute(a,function(s){if(!l(n[s])){n[s]=!0;let c=t(s);if(l(c))return c}})})})})};Qt.accessorContainingIndexData=function(e,t){let n={};return Qt.mesh(e,function(i){return Qt.meshPrimitive(i,function(r){let o=r.indices;if(l(o)&&!l(n[o])){n[o]=!0;let a=t(o);if(l(a))return a}})})};Qt.animation=function(e,t){return Qt.topLevel(e,"animations",t)};Qt.animationChannel=function(e,t){let n=e.channels;return Qt.object(n,t)};Qt.animationSampler=function(e,t){let n=e.samplers;return Qt.object(n,t)};Qt.buffer=function(e,t){return Qt.topLevel(e,"buffers",t)};Qt.bufferView=function(e,t){return Qt.topLevel(e,"bufferViews",t)};Qt.camera=function(e,t){return Qt.topLevel(e,"cameras",t)};Qt.image=function(e,t){return Qt.topLevel(e,"images",t)};Qt.material=function(e,t){return Qt.topLevel(e,"materials",t)};Qt.materialValue=function(e,t){let n=e.values;l(e.extensions)&&l(e.extensions.KHR_techniques_webgl)&&(n=e.extensions.KHR_techniques_webgl.values);for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let r=t(n[i],i);if(l(r))return r}};Qt.mesh=function(e,t){return Qt.topLevel(e,"meshes",t)};Qt.meshPrimitive=function(e,t){let n=e.primitives;if(l(n)){let i=n.length;for(let r=0;r<i;r++){let o=n[r],a=t(o,r);if(l(a))return a}}};Qt.meshPrimitiveAttribute=function(e,t){let n=e.attributes;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let r=t(n[i],i);if(l(r))return r}};Qt.meshPrimitiveTarget=function(e,t){let n=e.targets;if(l(n)){let i=n.length;for(let r=0;r<i;++r){let o=t(n[r],r);if(l(o))return o}}};Qt.meshPrimitiveTargetAttribute=function(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let i=e[n],r=t(i,n);if(l(r))return r}};Qt.node=function(e,t){return Qt.topLevel(e,"nodes",t)};Qt.nodeInTree=function(e,t,n){let i=e.nodes;if(l(i)){let r=t.length;for(let o=0;o<r;o++){let a=t[o],s=i[a];if(l(s)){let c=n(s,a);if(l(c))return c;let u=s.children;if(l(u)&&(c=Qt.nodeInTree(e,u,n),l(c)))return c}}}};Qt.nodeInScene=function(e,t,n){let i=t.nodes;if(l(i))return Qt.nodeInTree(e,i,n)};Qt.program=function(e,t){return No(e,"KHR_techniques_webgl")?Qt.object(e.extensions.KHR_techniques_webgl.programs,t):Qt.topLevel(e,"programs",t)};Qt.sampler=function(e,t){return Qt.topLevel(e,"samplers",t)};Qt.scene=function(e,t){return Qt.topLevel(e,"scenes",t)};Qt.shader=function(e,t){return No(e,"KHR_techniques_webgl")?Qt.object(e.extensions.KHR_techniques_webgl.shaders,t):Qt.topLevel(e,"shaders",t)};Qt.skin=function(e,t){return Qt.topLevel(e,"skins",t)};Qt.skinJoint=function(e,t){let n=e.joints;if(l(n)){let i=n.length;for(let r=0;r<i;r++){let o=n[r],a=t(o);if(l(a))return a}}};Qt.techniqueAttribute=function(e,t){let n=e.attributes;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let r=t(n[i],i);if(l(r))return r}};Qt.techniqueUniform=function(e,t){let n=e.uniforms;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let r=t(n[i],i);if(l(r))return r}};Qt.techniqueParameter=function(e,t){let n=e.parameters;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let r=t(n[i],i);if(l(r))return r}};Qt.technique=function(e,t){return No(e,"KHR_techniques_webgl")?Qt.object(e.extensions.KHR_techniques_webgl.techniques,t):Qt.topLevel(e,"techniques",t)};Qt.texture=function(e,t){return Qt.topLevel(e,"textures",t)};var ze=Qt;function PVe(e){switch(e){case"SCALAR":return 1;case"VEC2":return 2;case"VEC3":return 3;case"VEC4":case"MAT2":return 4;case"MAT3":return 9;case"MAT4":return 16}}var Hf=PVe;function DVe(e,t){let n=t.bufferView;if(l(n)){let i=e.bufferViews[n];if(l(i.byteStride)&&i.byteStride>0)return i.byteStride}return Y.getSizeInBytes(t.componentType)*Hf(t.type)}var Yu=DVe;function RVe(e){ze.accessor(e,function(n){l(n.bufferView)&&(n.byteOffset=n.byteOffset??0)}),ze.bufferView(e,function(n){l(n.buffer)&&(n.byteOffset=n.byteOffset??0)}),ze.mesh(e,function(n){ze.meshPrimitive(n,function(i){if(i.mode=i.mode??ee.TRIANGLES,!l(i.material)){l(e.materials)||(e.materials=[]);let r={name:"default"};i.material=bs(e.materials,r)}})}),ze.accessorContainingVertexAttributeData(e,function(n){let i=e.accessors[n],r=i.bufferView;if(i.normalized=i.normalized??!1,l(r)){let o=e.bufferViews[r];o.byteStride=Yu(e,i),o.target=ee.ARRAY_BUFFER}}),ze.accessorContainingIndexData(e,function(n){let r=e.accessors[n].bufferView;if(l(r)){let o=e.bufferViews[r];o.target=ee.ELEMENT_ARRAY_BUFFER}}),ze.material(e,function(n){let i=n.extensions??{},r=i.KHR_materials_common;if(l(r)){let c=r.technique,u=l(r.values)?r.values:{};r.values=u,u.ambient=l(u.ambient)?u.ambient:[0,0,0,1],u.emission=l(u.emission)?u.emission:[0,0,0,1],u.transparency=u.transparency??1,c!=="CONSTANT"&&(u.diffuse=l(u.diffuse)?u.diffuse:[0,0,0,1],c!=="LAMBERT"&&(u.specular=l(u.specular)?u.specular:[0,0,0,1],u.shininess=u.shininess??0)),r.transparent=r.transparent??!1,r.doubleSided=r.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 o=i.KHR_techniques_webgl;l(o)&&ze.materialValue(n,function(c){l(c.index)&&ZA(c)}),ZA(n.emissiveTexture),ZA(n.normalTexture),ZA(n.occlusionTexture);let a=n.pbrMetallicRoughness;l(a)&&(a.baseColorFactor=a.baseColorFactor??[1,1,1,1],a.metallicFactor=a.metallicFactor??1,a.roughnessFactor=a.roughnessFactor??1,ZA(a.baseColorTexture),ZA(a.metallicRoughnessTexture));let s=i.KHR_materials_pbrSpecularGlossiness;l(s)&&(s.diffuseFactor=s.diffuseFactor??[1,1,1,1],s.specularFactor=s.specularFactor??[1,1,1],s.glossinessFactor=s.glossinessFactor??1,ZA(s.specularGlossinessTexture))}),ze.animation(e,function(n){ze.animationSampler(n,function(i){i.interpolation=i.interpolation??"LINEAR"})});let t=OVe(e);return ze.node(e,function(n,i){l(t[i])||l(n.translation)||l(n.rotation)||l(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]}),ze.sampler(e,function(n){n.wrapS=n.wrapS??ee.REPEAT,n.wrapT=n.wrapT??ee.REPEAT}),l(e.scenes)&&!l(e.scene)&&(e.scene=0),e}function OVe(e){let t={};return ze.animation(e,function(n){ze.animationChannel(n,function(i){let r=i.target,o=r.node,a=r.path;(a==="translation"||a==="rotation"||a==="scale")&&(t[o]=!0)})}),t}function ZA(e){l(e)&&(e.texCoord=e.texCoord??0)}var fL=RVe;function MVe(e){return ze.shader(e,function(t){dL(t)}),ze.buffer(e,function(t){dL(t)}),ze.image(e,function(t){dL(t)}),dL(e),e}function dL(e){e.extras=l(e.extras)?e.extras:{},e.extras._pipeline=l(e.extras._pipeline)?e.extras._pipeline:{}}var QA=MVe;function LVe(e,t){let n=e.extensionsRequired;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),n.length===0&&delete e.extensionsRequired}}var hL=LVe;function NVe(e,t){let n=e.extensionsUsed;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),hL(e,t),n.length===0&&delete e.extensionsUsed}}var iC=NVe;var FVe=4;function BVe(e){if(Om(e)!=="glTF")throw new oe("File is not valid binary glTF");let n=Lce(e,0,5),i=n[1];if(i!==1&&i!==2)throw new oe("Binary glTF version is not 1 or 2");return i===1?kVe(e,n):zVe(e,n)}function Lce(e,t,n){let i=new DataView(e.buffer),r=new Array(n);for(let o=0;o<n;++o)r[o]=i.getUint32(e.byteOffset+t+o*FVe,!0);return r}function kVe(e,t){let n=t[2],i=t[3];if(t[4]!==0)throw new oe("Binary glTF scene format is not JSON");let o=20,a=o+i,s=Wu(e,o,i),c=JSON.parse(s);QA(c);let u=e.subarray(a,n),f=c.buffers;if(l(f)&&Object.keys(f).length>0){let d=f.binary_glTF??f.KHR_binary_glTF;l(d)&&(d.extras._pipeline.source=u,delete d.uri)}return iC(c,"KHR_binary_glTF"),c}function zVe(e,t){let n=t[2],i=12,r,o;for(;i<n;){let a=Lce(e,i,2),s=a[0],c=a[1];i+=8;let u=e.subarray(i,i+s);if(i+=s,c===1313821514){let f=Wu(u);r=JSON.parse(f),QA(r)}else c===5130562&&(o=u)}if(l(r)&&l(o)){let a=r.buffers;if(l(a)&&a.length>0){let s=a[0];s.extras._pipeline.source=o}}return r}var rC=BVe;function UVe(e){return ze.shader(e,function(t){mL(t)}),ze.buffer(e,function(t){mL(t)}),ze.image(e,function(t){mL(t)}),mL(e),e}function mL(e){l(e.extras)&&(l(e.extras._pipeline)&&delete e.extras._pipeline,Object.keys(e.extras).length===0&&delete e.extras)}var pL=UVe;function VVe(e,t){let n=e.extensionsUsed;l(n)||(n=[],e.extensionsUsed=n),bs(n,t,!0)}var ah=VVe;function jVe(e){switch(e){case Y.BYTE:return function(t,n,i,r,o){for(let a=0;a<i;++a)o[a]=t.getInt8(n+a*r)};case Y.UNSIGNED_BYTE:return function(t,n,i,r,o){for(let a=0;a<i;++a)o[a]=t.getUint8(n+a*r)};case Y.SHORT:return function(t,n,i,r,o){for(let a=0;a<i;++a)o[a]=t.getInt16(n+a*r,!0)};case Y.UNSIGNED_SHORT:return function(t,n,i,r,o){for(let a=0;a<i;++a)o[a]=t.getUint16(n+a*r,!0)};case Y.INT:return function(t,n,i,r,o){for(let a=0;a<i;++a)o[a]=t.getInt32(n+a*r,!0)};case Y.UNSIGNED_INT:return function(t,n,i,r,o){for(let a=0;a<i;++a)o[a]=t.getUint32(n+a*r,!0)};case Y.FLOAT:return function(t,n,i,r,o){for(let a=0;a<i;++a)o[a]=t.getFloat32(n+a*r,!0)};case Y.DOUBLE:return function(t,n,i,r,o){for(let a=0;a<i;++a)o[a]=t.getFloat64(n+a*r,!0)}}}var p_=jVe;function HVe(e,t){let n=e.bufferViews,i=e.buffers,r=t.bufferView,o=Hf(t.type);if(!l(t.bufferView))return{min:new Array(o).fill(0),max:new Array(o).fill(0)};let a=new Array(o).fill(Number.POSITIVE_INFINITY),s=new Array(o).fill(Number.NEGATIVE_INFINITY),c=n[r],u=c.buffer,d=i[u].extras._pipeline.source,p=t.count,g=Yu(e,t),m=t.byteOffset+c.byteOffset+d.byteOffset,y=t.componentType,A=Y.getSizeInBytes(y),b=new DataView(d.buffer),x=new Array(o),T=p_(y);for(let C=0;C<p;C++){T(b,m,o,A,x);for(let E=0;E<o;E++){let w=x[E];a[E]=Math.min(a[E],w),s[E]=Math.max(s[E],w)}m+=g}return{min:a,max:s}}var oC=HVe;var GVe=[ee.FUNC_ADD,ee.FUNC_ADD],WVe=[ee.ONE,ee.ZERO,ee.ONE,ee.ZERO];function Nce(e,t){let n=e.enable;return l(n)?n.indexOf(t)>-1:!1}var qVe=[ee.ZERO,ee.ONE,ee.SRC_COLOR,ee.ONE_MINUS_SRC_COLOR,ee.SRC_ALPHA,ee.ONE_MINUS_SRC_ALPHA,ee.DST_ALPHA,ee.ONE_MINUS_DST_ALPHA,ee.DST_COLOR,ee.ONE_MINUS_DST_COLOR];function YVe(e,t){if(!l(e))return t;for(let n=0;n<4;n++)if(qVe.indexOf(e[n])===-1)return t;return e}function XVe(e){let t={},n={},i=e.techniques;return l(i)&&(ze.technique(e,function(r,o){let a=r.states;if(l(a)){let s=n[o]={};if(Nce(a,ee.BLEND)){s.alphaMode="BLEND";let c=a.functions;l(c)&&(l(c.blendEquationSeparate)||l(c.blendFuncSeparate))&&(t[o]={blendEquation:c.blendEquationSeparate??GVe,blendFactors:YVe(c.blendFuncSeparate,WVe)})}Nce(a,ee.CULL_FACE)||(s.doubleSided=!0),delete r.states}}),Object.keys(t).length>0&&(l(e.extensions)||(e.extensions={}),ah(e,"KHR_blend")),ze.material(e,function(r){if(l(r.technique)){let o=n[r.technique];ze.objectLegacy(o,function(s,c){r[c]=s});let a=t[r.technique];l(a)&&(l(r.extensions)||(r.extensions={}),r.extensions.KHR_blend=a)}})),e}var gL=XVe;function KVe(e,t){let n=e.extensionsRequired;l(n)||(n=[],e.extensionsRequired=n),bs(n,t,!0),ah(e,t)}var _L=KVe;function $Ve(e){let t=e.techniques,n={},i={},r={};if(l(t)){let o={programs:[],shaders:[],techniques:[]},a=e.glExtensionsUsed;delete e.glExtensionsUsed,ze.technique(e,function(s,c){let u={name:s.name,program:void 0,attributes:{},uniforms:{}},f;if(ze.techniqueAttribute(s,function(d,p){f=s.parameters[d],u.attributes[p]={semantic:f.semantic}}),ze.techniqueUniform(s,function(d,p){f=s.parameters[d],u.uniforms[p]={count:f.count,node:f.node,type:f.type,semantic:f.semantic,value:f.value},l(n[c])||(n[c]={}),n[c][d]=p}),l(r[s.program]))u.program=r[s.program];else{let d=e.programs[s.program],p={name:d.name,fragmentShader:void 0,vertexShader:void 0,glExtensions:a},g=e.shaders[d.fragmentShader];p.fragmentShader=bs(o.shaders,g,!0);let m=e.shaders[d.vertexShader];p.vertexShader=bs(o.shaders,m,!0),u.program=bs(o.programs,p),r[s.program]=u.program}i[c]=bs(o.techniques,u)}),o.techniques.length>0&&(l(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl=o,ah(e,"KHR_techniques_webgl"),_L(e,"KHR_techniques_webgl"))}return ze.material(e,function(o){if(l(o.technique)){let a={technique:i[o.technique]};ze.objectLegacy(o.values,function(s,c){l(a.values)||(a.values={});let u=n[o.technique][c];l(u)&&(a.values[u]=s)}),l(o.extensions)||(o.extensions={}),o.extensions.KHR_techniques_webgl=a}delete o.technique,delete o.values}),delete e.techniques,delete e.programs,delete e.shaders,e}var yL=$Ve;function JVe(e,t){Ur.typeOf.object("material",e),Ur.defined("handler",t);let n=e.pbrMetallicRoughness;if(l(n)){if(l(n.baseColorTexture)){let o=n.baseColorTexture,a=t(o.index,o);if(l(a))return a}if(l(n.metallicRoughnessTexture)){let o=n.metallicRoughnessTexture,a=t(o.index,o);if(l(a))return a}}let{extensions:i}=e;if(l(i)){let o=i.KHR_materials_pbrSpecularGlossiness;if(l(o)){if(l(o.diffuseTexture)){let u=o.diffuseTexture,f=t(u.index,u);if(l(f))return f}if(l(o.specularGlossinessTexture)){let u=o.specularGlossinessTexture,f=t(u.index,u);if(l(f))return f}}let a=i.KHR_materials_specular;if(l(a)){let{specularTexture:u,specularColorTexture:f}=a;if(l(u)){let d=t(u.index,u);if(l(d))return d}if(l(f)){let d=t(f.index,f);if(l(d))return d}}let s=i.KHR_materials_transmission;if(l(s)&&l(s.transmissionTexture)){let u=s.transmissionTexture,f=t(u.index,u);if(l(f))return f}let c=i.KHR_materials_common;if(l(c)&&l(c.values)){let{diffuse:u,ambient:f,emission:d,specular:p}=c.values;if(l(u)&&l(u.index)){let g=t(u.index,u);if(l(g))return g}if(l(f)&&l(f.index)){let g=t(f.index,f);if(l(g))return g}if(l(d)&&l(d.index)){let g=t(d.index,d);if(l(g))return g}if(l(p)&&l(p.index)){let g=t(p.index,p);if(l(g))return g}}}let r=ze.materialValue(e,function(o){if(l(o.index)){let a=t(o.index,o);if(l(a))return a}});if(l(r))return r;if(l(e.emissiveTexture)){let o=e.emissiveTexture,a=t(o.index,o);if(l(a))return a}if(l(e.normalTexture)){let o=e.normalTexture,a=t(o.index,o);if(l(a))return a}if(l(e.occlusionTexture)){let o=e.occlusionTexture,a=t(o.index,o);if(l(a))return a}}var vI=JVe;var Fce=["mesh","node","material","accessor","bufferView","buffer","texture","sampler","image"];function ZVe(e,t){return t=t??Fce,Fce.forEach(function(n){t.indexOf(n)>-1&&e4e(e,n)}),e}var QVe={accessor:"accessors",buffer:"buffers",bufferView:"bufferViews",image:"images",node:"nodes",material:"materials",mesh:"meshes",sampler:"samplers",texture:"textures"};function e4e(e,t){let n=QVe[t],i=e[n];if(l(i)){let r=0,o=Lm[t](e),a=i.length;for(let s=0;s<a;++s)o[s]||(Mm[t](e,s-r),r++)}}function Mm(){}Mm.accessor=function(e,t){e.accessors.splice(t,1),ze.mesh(e,function(i){ze.meshPrimitive(i,function(r){ze.meshPrimitiveAttribute(r,function(s,c){s>t&&r.attributes[c]--}),ze.meshPrimitiveTarget(r,function(s){ze.meshPrimitiveTargetAttribute(s,function(c,u){c>t&&s[u]--})});let o=r.indices;l(o)&&o>t&&r.indices--;let a=r.extensions;l(a)&&l(a.CESIUM_primitive_outline)&&a.CESIUM_primitive_outline.indices>t&&--a.CESIUM_primitive_outline.indices})}),ze.skin(e,function(i){l(i.inverseBindMatrices)&&i.inverseBindMatrices>t&&i.inverseBindMatrices--}),ze.animation(e,function(i){ze.animationSampler(i,function(r){l(r.input)&&r.input>t&&r.input--,l(r.output)&&r.output>t&&r.output--})})};Mm.buffer=function(e,t){e.buffers.splice(t,1),ze.bufferView(e,function(i){l(i.buffer)&&i.buffer>t&&i.buffer--;let r=i.extensions;if(l(r)){let o=r.EXT_meshopt_compression;l(o)&&o.buffer>t&&o.buffer--;let a=r.KHR_meshopt_compression;l(a)&&a.buffer>t&&a.buffer--}})};Mm.bufferView=function(e,t){if(e.bufferViews.splice(t,1),ze.accessor(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),ze.shader(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),ze.image(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),No(e,"KHR_draco_mesh_compression")&&ze.mesh(e,function(i){ze.meshPrimitive(i,function(r){l(r.extensions)&&l(r.extensions.KHR_draco_mesh_compression)&&r.extensions.KHR_draco_mesh_compression.bufferView>t&&r.extensions.KHR_draco_mesh_compression.bufferView--})}),No(e,"EXT_feature_metadata")){let r=e.extensions.EXT_feature_metadata.featureTables;for(let o in r)if(r.hasOwnProperty(o)){let s=r[o].properties;if(l(s)){for(let c in s)if(s.hasOwnProperty(c)){let u=s[c];l(u.bufferView)&&u.bufferView>t&&u.bufferView--,l(u.arrayOffsetBufferView)&&u.arrayOffsetBufferView>t&&u.arrayOffsetBufferView--,l(u.stringOffsetBufferView)&&u.stringOffsetBufferView>t&&u.stringOffsetBufferView--}}}}if(No(e,"EXT_structural_metadata")){let r=e.extensions.EXT_structural_metadata.propertyTables;if(l(r)){let o=r.length;for(let a=0;a<o;++a){let c=r[a].properties;for(let u in c)if(c.hasOwnProperty(u)){let f=c[u];l(f.values)&&f.values>t&&f.values--,l(f.arrayOffsets)&&f.arrayOffsets>t&&f.arrayOffsets--,l(f.stringOffsets)&&f.stringOffsets>t&&f.stringOffsets--}}}}};Mm.image=function(e,t){e.images.splice(t,1),ze.texture(e,function(i){l(i.source)&&i.source>t&&--i.source;let r=i.extensions;l(r)&&l(r.EXT_texture_webp)&&r.EXT_texture_webp.source>t?--i.extensions.EXT_texture_webp.source:l(r)&&l(r.KHR_texture_basisu)&&r.KHR_texture_basisu.source>t&&--i.extensions.KHR_texture_basisu.source})};Mm.mesh=function(e,t){e.meshes.splice(t,1),ze.node(e,function(i){l(i.mesh)&&(i.mesh>t?i.mesh--:i.mesh===t&&delete i.mesh)})};Mm.node=function(e,t){e.nodes.splice(t,1),ze.skin(e,function(i){l(i.skeleton)&&i.skeleton>t&&i.skeleton--,i.joints=i.joints.map(function(r){return r>t?r-1:r})}),ze.animation(e,function(i){ze.animationChannel(i,function(r){l(r.target)&&l(r.target.node)&&r.target.node>t&&r.target.node--})}),ze.technique(e,function(i){ze.techniqueUniform(i,function(r){l(r.node)&&r.node>t&&r.node--})}),ze.node(e,function(i){l(i.children)&&(i.children=i.children.filter(function(r){return r!==t}).map(function(r){return r>t?r-1:r}))}),ze.scene(e,function(i){i.nodes=i.nodes.filter(function(r){return r!==t}).map(function(r){return r>t?r-1:r})})};Mm.material=function(e,t){e.materials.splice(t,1),ze.mesh(e,function(i){ze.meshPrimitive(i,function(r){l(r.material)&&r.material>t&&r.material--})})};Mm.sampler=function(e,t){e.samplers.splice(t,1),ze.texture(e,function(i){l(i.sampler)&&i.sampler>t&&--i.sampler})};Mm.texture=function(e,t){if(e.textures.splice(t,1),ze.material(e,function(i){vI(i,function(r,o){o.index>t&&--o.index})}),No(e,"EXT_feature_metadata")){ze.mesh(e,function(o){ze.meshPrimitive(o,function(a){let s=a.extensions;if(l(s)&&l(s.EXT_feature_metadata)){let u=s.EXT_feature_metadata.featureIdTextures;if(l(u)){let f=u.length;for(let d=0;d<f;++d){let g=u[d].featureIds.texture;g.index>t&&--g.index}}}})});let r=e.extensions.EXT_feature_metadata.featureTextures;for(let o in r)if(r.hasOwnProperty(o)){let s=r[o].properties;if(l(s)){for(let c in s)if(s.hasOwnProperty(c)){let f=s[c].texture;f.index>t&&--f.index}}}}if(No(e,"EXT_mesh_features")&&ze.mesh(e,function(i){ze.meshPrimitive(i,function(r){let o=r.extensions;if(l(o)&&l(o.EXT_mesh_features)){let s=o.EXT_mesh_features.featureIds;if(l(s)){let c=s.length;for(let u=0;u<c;++u){let f=s[u];l(f.texture)&&f.texture.index>t&&--f.texture.index}}}})}),No(e,"EXT_structural_metadata")){let r=e.extensions.EXT_structural_metadata.propertyTextures;if(l(r)){let o=r.length;for(let a=0;a<o;++a){let c=r[a].properties;for(let u in c)if(c.hasOwnProperty(u)){let f=c[u];f.index>t&&--f.index}}}}};function Lm(){}Lm.accessor=function(e){let t={};return ze.mesh(e,function(n){ze.meshPrimitive(n,function(i){ze.meshPrimitiveAttribute(i,function(o){t[o]=!0}),ze.meshPrimitiveTarget(i,function(o){ze.meshPrimitiveTargetAttribute(o,function(a){t[a]=!0})});let r=i.indices;l(r)&&(t[r]=!0)})}),ze.skin(e,function(n){l(n.inverseBindMatrices)&&(t[n.inverseBindMatrices]=!0)}),ze.animation(e,function(n){ze.animationSampler(n,function(i){l(i.input)&&(t[i.input]=!0),l(i.output)&&(t[i.output]=!0)})}),No(e,"EXT_mesh_gpu_instancing")&&ze.node(e,function(n){l(n.extensions)&&l(n.extensions.EXT_mesh_gpu_instancing)&&Object.keys(n.extensions.EXT_mesh_gpu_instancing.attributes).forEach(function(i){let r=n.extensions.EXT_mesh_gpu_instancing.attributes[i];t[r]=!0})}),No(e,"CESIUM_primitive_outline")&&ze.mesh(e,function(n){ze.meshPrimitive(n,function(i){let r=i.extensions;if(l(r)&&l(r.CESIUM_primitive_outline)){let a=r.CESIUM_primitive_outline.indices;l(a)&&(t[a]=!0)}})}),t};Lm.buffer=function(e){let t={};return ze.bufferView(e,function(n){l(n.buffer)&&(t[n.buffer]=!0);let i=n.extensions;if(l(i)){let r=i.EXT_meshopt_compression;l(r)&&(t[r.buffer]=!0);let o=i.KHR_meshopt_compression;l(o)&&(t[o.buffer]=!0)}}),t};Lm.bufferView=function(e){let t={};if(ze.accessor(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),ze.shader(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),ze.image(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),No(e,"KHR_draco_mesh_compression")&&ze.mesh(e,function(n){ze.meshPrimitive(n,function(i){l(i.extensions)&&l(i.extensions.KHR_draco_mesh_compression)&&(t[i.extensions.KHR_draco_mesh_compression.bufferView]=!0)})}),No(e,"EXT_feature_metadata")){let i=e.extensions.EXT_feature_metadata.featureTables;for(let r in i)if(i.hasOwnProperty(r)){let a=i[r].properties;if(l(a)){for(let s in a)if(a.hasOwnProperty(s)){let c=a[s];l(c.bufferView)&&(t[c.bufferView]=!0),l(c.arrayOffsetBufferView)&&(t[c.arrayOffsetBufferView]=!0),l(c.stringOffsetBufferView)&&(t[c.stringOffsetBufferView]=!0)}}}}if(No(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTables;if(l(i)){let r=i.length;for(let o=0;o<r;++o){let s=i[o].properties;for(let c in s)if(s.hasOwnProperty(c)){let u=s[c];l(u.values)&&(t[u.values]=!0),l(u.arrayOffsets)&&(t[u.arrayOffsets]=!0),l(u.stringOffsets)&&(t[u.stringOffsets]=!0)}}}}return t};Lm.image=function(e){let t={};return ze.texture(e,function(n){l(n.source)&&(t[n.source]=!0),l(n.extensions)&&l(n.extensions.EXT_texture_webp)?t[n.extensions.EXT_texture_webp.source]=!0:l(n.extensions)&&l(n.extensions.KHR_texture_basisu)&&(t[n.extensions.KHR_texture_basisu.source]=!0)}),t};Lm.mesh=function(e){let t={};return ze.node(e,function(n){if(l(n.mesh&&l(e.meshes))){let i=e.meshes[n.mesh];l(i)&&l(i.primitives)&&i.primitives.length>0&&(t[n.mesh]=!0)}}),t};function Bce(e,t,n){let i=e.nodes[t];return l(i.mesh)||l(i.camera)||l(i.skin)||l(i.weights)||l(i.extras)||l(i.extensions)&&Object.keys(i.extensions).length!==0||l(n[t])?!1:!l(i.children)||i.children.filter(function(r){return!Bce(e,r,n)}).length===0}Lm.node=function(e){let t={};return ze.skin(e,function(n){l(n.skeleton)&&(t[n.skeleton]=!0),ze.skinJoint(n,function(i){t[i]=!0})}),ze.animation(e,function(n){ze.animationChannel(n,function(i){l(i.target)&&l(i.target.node)&&(t[i.target.node]=!0)})}),ze.technique(e,function(n){ze.techniqueUniform(n,function(i){l(i.node)&&(t[i.node]=!0)})}),ze.node(e,function(n,i){Bce(e,i,t)||(t[i]=!0)}),t};Lm.material=function(e){let t={};return ze.mesh(e,function(n){ze.meshPrimitive(n,function(i){l(i.material)&&(t[i.material]=!0)})}),t};Lm.texture=function(e){let t={};if(ze.material(e,function(n){vI(n,function(i){t[i]=!0})}),No(e,"EXT_feature_metadata")){ze.mesh(e,function(r){ze.meshPrimitive(r,function(o){let a=o.extensions;if(l(a)&&l(a.EXT_feature_metadata)){let c=a.EXT_feature_metadata.featureIdTextures;if(l(c)){let u=c.length;for(let f=0;f<u;++f){let p=c[f].featureIds.texture;t[p.index]=!0}}}})});let i=e.extensions.EXT_feature_metadata.featureTextures;for(let r in i)if(i.hasOwnProperty(r)){let a=i[r].properties;if(l(a)){for(let s in a)if(a.hasOwnProperty(s)){let u=a[s].texture;t[u.index]=!0}}}}if(No(e,"EXT_mesh_features")&&ze.mesh(e,function(n){ze.meshPrimitive(n,function(i){let r=i.extensions;if(l(r)&&l(r.EXT_mesh_features)){let a=r.EXT_mesh_features.featureIds;if(l(a)){let s=a.length;for(let c=0;c<s;++c){let u=a[c];l(u.texture)&&(t[u.texture.index]=!0)}}}})}),No(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTextures;if(l(i)){let r=i.length;for(let o=0;o<r;++o){let s=i[o].properties;for(let c in s)if(s.hasOwnProperty(c)){let u=s[c];t[u.index]=!0}}}}return t};Lm.sampler=function(e){let t={};return ze.texture(e,function(n){l(n.sampler)&&(t[n.sampler]=!0)}),t};var AL=ZVe;function t4e(e,t){let n={byteLength:t.length,extras:{_pipeline:{source:t}}},r={buffer:bs(e.buffers,n),byteOffset:0,byteLength:t.length};return bs(e.bufferViews,r)}var bL=t4e;function n4e(e,t){let n=Yu(e,t),i=Y.getSizeInBytes(t.componentType),r=Hf(t.type),o=t.count,a=new Array(r*o);if(!l(t.bufferView))return a.fill(0);let s=e.bufferViews[t.bufferView],c=e.buffers[s.buffer].extras._pipeline.source,u=t.byteOffset+s.byteOffset+c.byteOffset,f=new DataView(c.buffer),d=new Array(r),p=p_(t.componentType);for(let g=0;g<o;++g){p(f,u,r,i,d);for(let m=0;m<r;++m)a[g*r+m]=d[m];u+=n}return a}var xL=n4e;function i4e(e){let t;return ze.accessorWithSemantic(e,"JOINTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===ee.BYTE?TL(e,i,Y.UNSIGNED_BYTE):t!==ee.UNSIGNED_BYTE&&t!==ee.UNSIGNED_SHORT&&TL(e,i,Y.UNSIGNED_SHORT)}),ze.accessorWithSemantic(e,"WEIGHTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===ee.BYTE?TL(e,i,Y.UNSIGNED_BYTE):t===ee.SHORT&&TL(e,i,Y.UNSIGNED_SHORT)}),e}function TL(e,t,n){let i=Y.createTypedArray(n,xL(e,t)),r=new Uint8Array(i.buffer);t.bufferView=bL(e,r),t.componentType=n,t.byteOffset=0}var CL=i4e;function r4e(e,t){return iC(e,t),t==="CESIUM_RTC"&&o4e(e),Aq(e,t)}function o4e(e){ze.technique(e,function(t){ze.techniqueUniform(t,function(n){n.semantic==="CESIUM_RTC_MODELVIEW"&&(n.semantic="MODELVIEW")})})}function Aq(e,t){if(Array.isArray(e)){let n=e.length;for(let i=0;i<n;++i)Aq(e[i],t)}else if(e!==null&&typeof e=="object"&&e.constructor===Object){let n=e.extensions,i;l(n)&&(i=n[t],l(i)&&(delete n[t],Object.keys(n).length===0&&delete e.extensions));for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&Aq(e[r],t);return i}}var aC=r4e;var vL={.8:f4e,"1.0":O4e,"2.0":void 0};function a4e(e,t){t=t??{};let n=t.targetVersion,i=e.version;e.asset=e.asset??{version:"1.0"},e.asset.version=e.asset.version??"1.0",i=(i??e.asset.version).toString(),Object.prototype.hasOwnProperty.call(vL,i)||(l(i)&&(i=i.substring(0,3)),Object.prototype.hasOwnProperty.call(vL,i)||(i="1.0"));let r=vL[i];for(;l(r)&&i!==n;)r(e,t),i=e.asset.version,r=vL[i];return t.keepLegacyExtensions||(N4e(e,t),F4e(e)),e}function Uce(e){let t=e.materials;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],r=i.instanceTechnique;l(r)&&(i.technique=r.technique,i.values=r.values,delete i.instanceTechnique)}}function s4e(e){let t=e.meshes;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let r=t[n].primitives;if(l(r)){let o=r.length;for(let a=0;a<o;++a){let s=r[a],c=s.primitive??ee.TRIANGLES;s.mode=s.mode??c,delete s.primitive}}}}function c4e(e){let t=e.nodes,n=new h,i=new Fe;for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)){let o=t[r];if(l(o.rotation)){let s=o.rotation;h.fromArray(s,0,n),Fe.fromAxisAngle(n,s[3],i),o.rotation=[i.x,i.y,i.z,i.w]}let a=o.instanceSkin;l(a)&&(o.skeletons=a.skeletons,o.skin=a.skin,o.meshes=a.meshes,delete o.instanceSkin)}}function l4e(e){let t=e.animations,n=e.accessors,i=e.bufferViews,r=e.buffers,o={},a=new h,s=new Fe;for(let c in t)if(Object.prototype.hasOwnProperty.call(t,c)){let u=t[c],f=u.channels,d=u.parameters,p=u.samplers;if(l(f)){let g=f.length;for(let m=0;m<g;++m){let y=f[m];if(y.target.path==="rotation"){let A=d[p[y.sampler].output];if(l(o[A]))continue;o[A]=!0;let b=n[A],x=i[b.bufferView],C=r[x.buffer].extras._pipeline.source,E=C.byteOffset+x.byteOffset+b.byteOffset,w=b.componentType,D=b.count,R=Hf(b.type),M=b.count*R,N=Y.createArrayBufferView(w,C.buffer,E,M);for(let _=0;_<D;_++){let v=_*R;h.unpack(N,v,a);let S=N[v+3];Fe.fromAxisAngle(a,S,s),Fe.pack(s,N,v)}}}}}}function u4e(e){let t=e.techniques;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],r=i.passes;if(l(r)){let o=i.pass??"defaultPass";if(Object.prototype.hasOwnProperty.call(r,o)){let a=r[o],s=a.instanceProgram;i.attributes=i.attributes??s.attributes,i.program=i.program??s.program,i.uniforms=i.uniforms??s.uniforms,i.states=i.states??a.states}delete i.passes,delete i.pass}}}function f4e(e){l(e.asset)||(e.asset={});let t=e.asset;if(t.version="1.0",typeof t.profile=="string"){let n=t.profile.split(" ");t.profile={api:n[0],version:n[1]}}else t.profile={};if(l(e.version)&&delete e.version,Uce(e),s4e(e),c4e(e),l4e(e),u4e(e),l(e.allExtensions)&&(e.extensionsUsed=e.allExtensions,delete e.allExtensions),l(e.lights)){let n=e.extensions??{};e.extensions=n;let i=n.KHR_materials_common??{};n.KHR_materials_common=i,i.lights=e.lights,delete e.lights,ah(e,"KHR_materials_common")}}function d4e(e){let t=e.animations;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],r=i.parameters;if(l(r)){let o=i.samplers;for(let a in o)if(Object.prototype.hasOwnProperty.call(o,a)){let s=o[a];s.input=r[s.input],s.output=r[s.output]}delete i.parameters}}}function kce(e,t){let n=[];for(let i in e)if(Object.prototype.hasOwnProperty.call(e,i)){let r=e[i];t[i]=n.length,n.push(r),l(r.name)||(r.name=i)}return n}function h4e(e){let t,n={accessors:{},animations:{},buffers:{},bufferViews:{},cameras:{},images:{},materials:{},meshes:{},nodes:{},programs:{},samplers:{},scenes:{},shaders:{},skins:{},textures:{},techniques:{}},i,r={},o=e.nodes;for(let a in o)Object.prototype.hasOwnProperty.call(o,a)&&(i=o[a].jointName,l(i)&&(r[i]=a));for(let a in e)if(Object.prototype.hasOwnProperty.call(e,a)&&l(n[a])){let s={},c=e[a];e[a]=kce(c,s),n[a]=s}for(i in r)Object.prototype.hasOwnProperty.call(r,i)&&(r[i]=n.nodes[r[i]]);l(e.scene)&&(e.scene=n.scenes[e.scene]),ze.bufferView(e,function(a){l(a.buffer)&&(a.buffer=n.buffers[a.buffer])}),ze.accessor(e,function(a){l(a.bufferView)&&(a.bufferView=n.bufferViews[a.bufferView])}),ze.shader(e,function(a){let s=a.extensions;if(l(s)){let c=s.KHR_binary_glTF;l(c)&&(a.bufferView=n.bufferViews[c.bufferView],delete s.KHR_binary_glTF),Object.keys(s).length===0&&delete a.extensions}}),ze.program(e,function(a){l(a.vertexShader)&&(a.vertexShader=n.shaders[a.vertexShader]),l(a.fragmentShader)&&(a.fragmentShader=n.shaders[a.fragmentShader])}),ze.technique(e,function(a){l(a.program)&&(a.program=n.programs[a.program]),ze.techniqueParameter(a,function(s){l(s.node)&&(s.node=n.nodes[s.node]);let c=s.value;typeof c=="string"&&(s.value={index:n.textures[c]})})}),ze.mesh(e,function(a){ze.meshPrimitive(a,function(s){l(s.indices)&&(s.indices=n.accessors[s.indices]),ze.meshPrimitiveAttribute(s,function(c,u){s.attributes[u]=n.accessors[c]}),l(s.material)&&(s.material=n.materials[s.material])})}),ze.node(e,function(a){let s=a.children;if(l(s)){let c=s.length;for(t=0;t<c;++t)s[t]=n.nodes[s[t]]}if(l(a.meshes)){let c=a.meshes,u=c.length;if(u>0)for(a.mesh=n.meshes[c[0]],t=1;t<u;++t){let f={mesh:n.meshes[c[t]]},d=bs(e.nodes,f);l(s)||(s=[],a.children=s),s.push(d)}delete a.meshes}if(l(a.camera)&&(a.camera=n.cameras[a.camera]),l(a.skin)&&(a.skin=n.skins[a.skin]),l(a.skeletons)){let c=a.skeletons;if(c.length>0&&l(a.skin)){let f=e.skins[a.skin];f.skeleton=n.nodes[c[0]]}delete a.skeletons}l(a.jointName)&&delete a.jointName}),ze.skin(e,function(a){l(a.inverseBindMatrices)&&(a.inverseBindMatrices=n.accessors[a.inverseBindMatrices]);let s=a.jointNames;if(l(s)){let c=[],u=s.length;for(t=0;t<u;++t)c[t]=r[s[t]];a.joints=c,delete a.jointNames}}),ze.scene(e,function(a){let s=a.nodes;if(l(s)){let c=s.length;for(t=0;t<c;++t)s[t]=n.nodes[s[t]]}}),ze.animation(e,function(a){let s={};a.samplers=kce(a.samplers,s),ze.animationSampler(a,function(c){c.input=n.accessors[c.input],c.output=n.accessors[c.output]}),ze.animationChannel(a,function(c){c.sampler=s[c.sampler];let u=c.target;l(u)&&(u.node=n.nodes[u.id],delete u.id)})}),ze.material(e,function(a){l(a.technique)&&(a.technique=n.techniques[a.technique]),ze.materialValue(a,function(c,u){typeof c=="string"&&(a.values[u]={index:n.textures[c]})});let s=a.extensions;if(l(s)){let c=s.KHR_materials_common;l(c)&&l(c.values)&&ze.materialValue(c,function(u,f){typeof u=="string"&&(c.values[f]={index:n.textures[u]})})}}),ze.image(e,function(a){let s=a.extensions;if(l(s)){let c=s.KHR_binary_glTF;l(c)&&(a.bufferView=n.bufferViews[c.bufferView],a.mimeType=c.mimeType,delete s.KHR_binary_glTF),Object.keys(s).length===0&&delete a.extensions}}),ze.texture(e,function(a){l(a.sampler)&&(a.sampler=n.samplers[a.sampler]),l(a.source)&&(a.source=n.images[a.source])})}function m4e(e){ze.animation(e,function(t){ze.animationSampler(t,function(n){delete n.name})})}function p4e(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let n=e[t];Array.isArray(n)&&n.length===0&&delete e[t]}ze.node(e,function(t){l(t.children)&&t.children.length===0&&delete t.children})}function g4e(e){let t=e.asset;delete t.profile,delete t.premultipliedAlpha}var _4e={CESIUM_RTC:!0,KHR_materials_common:!0,WEB3D_quantized_attributes:!0};function y4e(e){let t=e.extensionsUsed;if(e.extensionsRequired=e.extensionsRequired??[],l(t)){let n=t.length;for(let i=0;i<n;++i){let r=t[i];l(_4e[r])&&e.extensionsRequired.push(r)}}}function A4e(e){ze.buffer(e,function(t){delete t.type})}function b4e(e){ze.texture(e,function(t){delete t.format,delete t.internalFormat,delete t.target,delete t.type})}function x4e(e){ze.mesh(e,function(t){ze.meshPrimitive(t,function(n){ze.meshPrimitiveAttribute(n,function(i,r){r==="TEXCOORD"?n.attributes.TEXCOORD_0=i:r==="COLOR"&&(n.attributes.COLOR_0=i)}),delete n.attributes.TEXCOORD,delete n.attributes.COLOR})}),ze.technique(e,function(t){ze.techniqueParameter(t,function(n){let i=n.semantic;l(i)&&(i==="TEXCOORD"?n.semantic="TEXCOORD_0":i==="COLOR"&&(n.semantic="COLOR_0"))})})}var T4e={POSITION:!0,NORMAL:!0,TANGENT:!0},C4e={COLOR:"COLOR",JOINT:"JOINTS",JOINTS:"JOINTS",TEXCOORD:"TEXCOORD",WEIGHT:"WEIGHTS",WEIGHTS:"WEIGHTS"};function v4e(e){let t={};ze.mesh(e,function(n){ze.meshPrimitive(n,function(i){ze.meshPrimitiveAttribute(i,function(r,o){if(o.charAt(0)!=="_"){let a=o.search(/_[0-9]+/g),s=o,c="_0";a>=0&&(s=o.substring(0,a),c=o.substring(a));let u,f=C4e[s];l(f)?(u=f+c,t[o]=u):l(T4e[s])||(u=`_${o}`,t[o]=u)}});for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)){let o=t[r],a=i.attributes[r];l(a)&&(delete i.attributes[r],i.attributes[o]=a)}})}),ze.technique(e,function(n){ze.techniqueParameter(n,function(i){let r=t[i.semantic];l(r)&&(i.semantic=r)})})}function E4e(e){ze.camera(e,function(t){let n=t.perspective;if(l(n)){let i=n.aspectRatio;l(i)&&i===0&&delete n.aspectRatio;let r=n.yfov;l(r)&&r===0&&(n.yfov=1)}})}function xq(e,t){return l(t.byteStride)&&t.byteStride!==0?t.byteStride:Yu(e,t)}function S4e(e){ze.buffer(e,function(t){l(t.byteLength)||(t.byteLength=t.extras._pipeline.source.length)}),ze.accessor(e,function(t){let n=t.bufferView;if(l(n)){let i=e.bufferViews[n],r=xq(e,t),o=t.byteOffset+t.count*r;i.byteLength=Math.max(i.byteLength??0,o)}})}function w4e(e){let t,n,i,r=e.bufferViews,o={};ze.accessorContainingVertexAttributeData(e,function(s){let c=e.accessors[s];l(c.bufferView)&&(o[c.bufferView]=!0)});let a={};ze.accessor(e,function(s){l(s.bufferView)&&(a[s.bufferView]=a[s.bufferView]??[],a[s.bufferView].push(s))});for(let s in a)if(Object.prototype.hasOwnProperty.call(a,s)){i=r[s];let c=a[s];c.sort(function(p,g){return p.byteOffset-g.byteOffset});let u=0,f=0,d=c.length;for(t=0;t<d;++t){let p=c[t],g=xq(e,p),m=p.byteOffset,y=p.count*g;delete p.byteStride;let A=t<d-1,b=A?xq(e,c[t+1]):void 0;if(g!==b){let x=Xe(i,!0);o[s]&&(x.byteStride=g),x.byteOffset+=u,x.byteLength=m+y-u;let T=bs(r,x);for(n=f;n<=t;++n)p=c[n],p.bufferView=T,p.byteOffset=p.byteOffset-u;u=A?c[t+1].byteOffset:void 0,f=t+1}}}AL(e,["accessor","bufferView","buffer"])}function I4e(e){ze.accessorWithSemantic(e,"POSITION",function(t){let n=e.accessors[t];if(!l(n.min)||!l(n.max)){let i=oC(e,n);n.min=i.min,n.max=i.max}})}function Vce(e){return(!l(e.children)||e.children.length===0)&&(!l(e.meshes)||e.meshes.length===0)&&!l(e.camera)&&!l(e.skin)&&!l(e.skeletons)&&!l(e.jointName)&&(!l(e.translation)||h.fromArray(e.translation).equals(h.ZERO))&&(!l(e.scale)||h.fromArray(e.scale).equals(new h(1,1,1)))&&(!l(e.rotation)||ae.fromArray(e.rotation).equals(new ae(0,0,0,1)))&&(!l(e.matrix)||O.fromColumnMajorArray(e.matrix).equals(O.IDENTITY))&&!l(e.extensions)&&!l(e.extras)}function jce(e,t){ze.scene(e,function(n){let i=n.nodes;if(l(i)){let r=i.length;for(let o=r;o>=0;--o)if(i[o]===t){i.splice(o,1);return}}}),ze.node(e,function(n,i){if(l(n.children)){let r=n.children.indexOf(t);r>-1&&(n.children.splice(r,1),Vce(n)&&jce(e,i))}}),delete e.nodes[t]}function P4e(e){return ze.node(e,function(t,n){Vce(t)&&jce(e,n)}),e}function D4e(e){ze.animation(e,function(t){ze.animationSampler(t,function(n){let i=e.accessors[n.input];if(!l(i.min)||!l(i.max)){let r=oC(e,i);i.min=r.min,i.max=r.max}})})}function R4e(e){ze.accessor(e,function(t){if(l(t.min)||l(t.max)){let n=oC(e,t);l(t.min)&&(t.min=n.min),l(t.max)&&(t.max=n.max)}})}function O4e(e){e.asset=e.asset??{},e.asset.version="2.0",Uce(e),d4e(e),P4e(e),h4e(e),m4e(e),g4e(e),y4e(e),S4e(e),w4e(e),I4e(e),D4e(e),R4e(e),A4e(e),b4e(e),x4e(e),v4e(e),CL(e),E4e(e),gL(e),yL(e),p4e(e)}var M4e=["u_tex","u_diffuse","u_emission","u_diffuse_tex"],L4e=["u_diffuse","u_diffuse_mat"];function Tq(e){e.pbrMetallicRoughness=l(e.pbrMetallicRoughness)?e.pbrMetallicRoughness:{},e.pbrMetallicRoughness.roughnessFactor=1,e.pbrMetallicRoughness.metallicFactor=0}function Cq(e){return l(e.index)}function vq(e){return Array.isArray(e)&&e.length===4}function Hce(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 N4e(e,t){t=t??{};let n=t.baseColorTextureNames??M4e,i=t.baseColorFactorNames??L4e;ze.material(e,function(r){ze.materialValue(r,function(o,a){n.indexOf(a)!==-1&&Cq(o)?(Tq(r),r.pbrMetallicRoughness.baseColorTexture=o):i.indexOf(a)!==-1&&vq(o)&&(Tq(r),r.pbrMetallicRoughness.baseColorFactor=Hce(o))})}),aC(e,"KHR_techniques_webgl"),aC(e,"KHR_blend")}function bq(e,t){l(t)&&(vq(t)?e.pbrMetallicRoughness.baseColorFactor=Hce(t):Cq(t)&&(e.pbrMetallicRoughness.baseColorTexture=t))}function zce(e,t){l(t)&&(vq(t)?e.emissiveFactor=t.slice(0,3):Cq(t)&&(e.emissiveTexture=t))}function F4e(e){ze.material(e,function(t){let n=(t.extensions??{}).KHR_materials_common;if(!l(n))return;let i=n.values??{},r=i.ambient,o=i.diffuse,a=i.emission,s=i.transparency,c=n.doubleSided,u=n.transparent;Tq(t),n.technique==="CONSTANT"?(ah(e,"KHR_materials_unlit"),t.extensions=l(t.extensions)?t.extensions:{},t.extensions.KHR_materials_unlit={},bq(t,a),bq(t,r)):(bq(t,o),zce(t,r),zce(t,a)),l(c)&&(t.doubleSided=c),l(s)&&(l(t.pbrMetallicRoughness.baseColorFactor)?t.pbrMetallicRoughness.baseColorFactor[3]*=s:t.pbrMetallicRoughness.baseColorFactor=[1,1,1,s]),l(u)&&(t.alphaMode=u?"BLEND":"OPAQUE")}),aC(e,"KHR_materials_common")}var EL=a4e;var Gce={FRONT:ee.FRONT,BACK:ee.BACK,FRONT_AND_BACK:ee.FRONT_AND_BACK};Object.freeze(Gce);var Ui=Gce;function zc(){}zc.getError=function(e,t,n){let i=`Failed to load ${e}: ${t}`;l(n)&&l(n.message)&&(i+=`
|
|
${n.message}`);let r=new oe(i);return l(n)&&(r.stack=`Original stack:
|
|
${n.stack}
|
|
Handler stack:
|
|
${r.stack}`),r};zc.getNodeTransform=function(e){return l(e.matrix)?e.matrix:O.fromTranslationQuaternionRotationScale(l(e.translation)?e.translation:h.ZERO,l(e.rotation)?e.rotation:Fe.IDENTITY,l(e.scale)?e.scale:h.ONE)};zc.getAttributeBySemantic=function(e,t,n){let i=e.attributes,r=i.length;for(let o=0;o<r;++o){let a=i[o],s=l(n)?a.setIndex===n:!0;if(a.semantic===t&&s)return a}};zc.getAttributeByName=function(e,t){let n=e.attributes,i=n.length;for(let r=0;r<i;++r){let o=n[r];if(o.name===t)return o}};zc.getFeatureIdsByLabel=function(e,t){for(let n=0;n<e.length;n++){let i=e[n];if(i.positionalLabel===t||i.label===t)return i}};zc.hasQuantizedAttributes=function(e){if(!l(e))return!1;for(let t=0;t<e.length;t++){let n=e[t];if(l(n.quantization))return!0}return!1};zc.getAttributeInfo=function(e){let t=e.semantic,n=e.setIndex,i,r=!1;l(t)?(i=ot.getVariableName(t,n),r=!0):(i=e.name,i=i.replace(/^_/,""),i=i.toLowerCase());let o=/^color_\d+$/.test(i),a=e.type,s=Vt.getGlslType(a);o&&(s="vec4");let c=l(e.quantization),u;return c&&(u=o?"vec4":Vt.getGlslType(e.quantization.type)),{attribute:e,isQuantized:c,variableName:i,hasSemantic:r,glslType:s,quantizedGlslType:u}};var B4e=new h,k4e=new h;zc.getPositionMinMax=function(e,t,n){let i=zc.getAttributeBySemantic(e,"POSITION"),r=i.max,o=i.min;return l(n)&&l(t)&&(o=h.add(o,t,k4e),r=h.add(r,n,B4e)),{min:o,max:r}};zc.getAxisCorrectionMatrix=function(e,t,n){return n=O.clone(O.IDENTITY,n),e===zi.Y?n=O.clone(zi.Y_UP_TO_Z_UP,n):e===zi.X&&(n=O.clone(zi.X_UP_TO_Z_UP,n)),t===zi.Z&&(n=O.multiplyTransformation(n,zi.Z_UP_TO_X_UP,n)),n};var z4e=new $;zc.getCullFace=function(e,t){if(!Re.isTriangles(t))return Ui.BACK;let n=O.getMatrix3(e,z4e);return $.determinant(n)<0?Ui.FRONT:Ui.BACK};zc.sanitizeGlslIdentifier=function(e){let t=e.replaceAll(/[^A-Za-z0-9]+/g,"_");return t=t.replace(/^gl_/,""),/^\d/.test(t)&&(t=`_${t}`),t};zc.supportedExtensions={AGI_articulations:!0,CESIUM_mesh_vector:!0,CESIUM_primitive_outline:!0,CESIUM_RTC:!0,EXT_feature_metadata:!0,EXT_implicit_cylinder_region:!0,EXT_implicit_ellipsoid_region:!0,EXT_instance_features:!0,EXT_mesh_features:!0,EXT_mesh_gpu_instancing:!0,EXT_mesh_polygon:!0,EXT_mesh_primitive_edge_visibility:!0,EXT_meshopt_compression:!0,EXT_primitive_voxels:!0,EXT_structural_metadata:!0,EXT_texture_webp:!0,KHR_blend:!0,KHR_draco_mesh_compression:!0,KHR_implicit_shapes:!0,KHR_materials_common:!0,KHR_materials_pbrSpecularGlossiness:!0,KHR_materials_specular:!0,KHR_materials_anisotropy:!0,KHR_materials_clearcoat:!0,KHR_materials_unlit:!0,KHR_mesh_quantization:!0,KHR_mesh_primitive_restart:!0,KHR_meshopt_compression:!0,KHR_techniques_webgl:!0,KHR_texture_basisu:!0,KHR_texture_transform:!0,KHR_gaussian_splatting:!0,KHR_gaussian_splatting_compression_spz_2:!0,WEB3D_quantized_attributes:!0};zc.checkSupportedExtensions=function(e){let t=e.length;for(let n=0;n<t;n++){let i=e[n];if(!zc.supportedExtensions[i])throw new oe(`Unsupported glTF Extension: ${i}`)}};var _t=zc;var Eq=class extends er{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltfResource,r=t.baseResource,o=t.typedArray,a=t.gltfJson,s=t.cacheKey;this._resourceCache=n,this._gltfResource=i,this._baseResource=r,this._typedArray=o,this._gltfJson=a,this._cacheKey=s,this._gltf=void 0,this._bufferLoaders=[],this._state=At.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get gltf(){return this._gltf}async load(){return l(this._promise)?this._promise:(this._state=At.LOADING,l(this._gltfJson)?(this._promise=Wce(this,this._gltfJson),this._promise):l(this._typedArray)?(this._promise=qce(this,this._typedArray),this._promise):(this._promise=U4e(this),this._promise))}unload(){let t=this._bufferLoaders,n=t.length;for(let i=0;i<n;++i)t[i]=!t[i].isDestroyed()&&this._resourceCache.unload(t[i]);this._bufferLoaders.length=0,this._gltf=void 0}_fetchGltf(){return this._gltfResource.fetchArrayBuffer()}};async function U4e(e){let t;try{let n=await e._fetchGltf();if(e.isDestroyed())return;t=new Uint8Array(n)}catch(n){if(e.isDestroyed())return;Sq(e,n)}return qce(e,t)}function Sq(e,t){e.unload(),e._state=At.FAILED;let n=`Failed to load glTF: ${e._gltfResource.url}`;throw e.getError(n,t)}async function V4e(e,t){if(l(t.asset)&&t.asset.version==="2.0"&&!No(t,"KHR_techniques_webgl")&&!No(t,"KHR_materials_common"))return Promise.resolve();let n=[];ze.buffer(t,function(i){if(!l(i.extras._pipeline.source)&&l(i.uri)){let r=e._baseResource.getDerivedResource({url:i.uri}),a=e._resourceCache.getExternalBufferLoader({resource:r});e._bufferLoaders.push(a),n.push(a.load().then(function(){a.isDestroyed()||(i.extras._pipeline.source=a.typedArray)}))}}),await Promise.all(n),EL(t)}function j4e(e){let t=[];return ze.buffer(e,function(n){let i=n.uri;!l(n.extras._pipeline.source)&&l(i)&&bm(i)&&(delete n.uri,t.push(De.fetchArrayBuffer(i).then(function(r){n.extras._pipeline.source=new Uint8Array(r)})))}),Promise.all(t)}function H4e(e,t){let n=[];return ze.buffer(t,function(i,r){let o=i.extras._pipeline.source;if(l(o)&&!l(i.uri)){let s=e._resourceCache.getEmbeddedBufferLoader({parentResource:e._gltfResource,bufferId:r,typedArray:o});e._bufferLoaders.push(s),n.push(s.load())}}),Promise.all(n)}async function Wce(e,t){try{QA(t),await j4e(t),await V4e(e,t),fL(t),await H4e(e,t),pL(t);let n=t.asset.version;if(n!=="1.0"&&n!=="2.0")throw new oe(`Unsupported glTF version: ${n}`);let i=t.extensionsRequired;return l(i)&&_t.checkSupportedExtensions(i),e._gltf=t,e._state=At.READY,e}catch(n){if(e.isDestroyed())return;Sq(e,n)}}async function qce(e,t){let n;try{Om(t)==="glTF"?n=rC(t):n=wo(t)}catch(i){if(e.isDestroyed())return;Sq(e,i)}return Wce(e,n)}var EI=Eq;var Ei={UNSIGNED_BYTE:ee.UNSIGNED_BYTE,UNSIGNED_SHORT:ee.UNSIGNED_SHORT,UNSIGNED_INT:ee.UNSIGNED_INT,FLOAT:ee.FLOAT,HALF_FLOAT:ee.HALF_FLOAT_OES,UNSIGNED_INT_24_8:ee.UNSIGNED_INT_24_8,UNSIGNED_SHORT_4_4_4_4:ee.UNSIGNED_SHORT_4_4_4_4,UNSIGNED_SHORT_5_5_5_1:ee.UNSIGNED_SHORT_5_5_5_1,UNSIGNED_SHORT_5_6_5:ee.UNSIGNED_SHORT_5_6_5};Ei.toWebGLConstant=function(e,t){switch(e){case Ei.UNSIGNED_BYTE:return ee.UNSIGNED_BYTE;case Ei.UNSIGNED_SHORT:return ee.UNSIGNED_SHORT;case Ei.UNSIGNED_INT:return ee.UNSIGNED_INT;case Ei.FLOAT:return ee.FLOAT;case Ei.HALF_FLOAT:return t.webgl2?ee.HALF_FLOAT:ee.HALF_FLOAT_OES;case Ei.UNSIGNED_INT_24_8:return ee.UNSIGNED_INT_24_8;case Ei.UNSIGNED_SHORT_4_4_4_4:return ee.UNSIGNED_SHORT_4_4_4_4;case Ei.UNSIGNED_SHORT_5_5_5_1:return ee.UNSIGNED_SHORT_5_5_5_1;case Ei.UNSIGNED_SHORT_5_6_5:return Ei.UNSIGNED_SHORT_5_6_5}};Ei.isPacked=function(e){return e===Ei.UNSIGNED_INT_24_8||e===Ei.UNSIGNED_SHORT_4_4_4_4||e===Ei.UNSIGNED_SHORT_5_5_5_1||e===Ei.UNSIGNED_SHORT_5_6_5};Ei.sizeInBytes=function(e){switch(e){case Ei.UNSIGNED_BYTE:return 1;case Ei.UNSIGNED_SHORT:case Ei.UNSIGNED_SHORT_4_4_4_4:case Ei.UNSIGNED_SHORT_5_5_5_1:case Ei.UNSIGNED_SHORT_5_6_5:case Ei.HALF_FLOAT:return 2;case Ei.UNSIGNED_INT:case Ei.FLOAT:case Ei.UNSIGNED_INT_24_8:return 4}};Ei.validate=function(e){return e===Ei.UNSIGNED_BYTE||e===Ei.UNSIGNED_SHORT||e===Ei.UNSIGNED_INT||e===Ei.FLOAT||e===Ei.HALF_FLOAT||e===Ei.UNSIGNED_INT_24_8||e===Ei.UNSIGNED_SHORT_4_4_4_4||e===Ei.UNSIGNED_SHORT_5_5_5_1||e===Ei.UNSIGNED_SHORT_5_6_5};Ei.getTypedArrayConstructor=function(e){let t=Ei.sizeInBytes(e);return t===Uint8Array.BYTES_PER_ELEMENT?Uint8Array:t===Uint16Array.BYTES_PER_ELEMENT?Uint16Array:t===Float32Array.BYTES_PER_ELEMENT&&e===Ei.FLOAT?Float32Array:Uint32Array};Object.freeze(Ei);var ke=Ei;var tt={DEPTH_COMPONENT:ee.DEPTH_COMPONENT,DEPTH_STENCIL:ee.DEPTH_STENCIL,ALPHA:ee.ALPHA,RED:ee.RED,RG:ee.RG,RGB:ee.RGB,RGBA:ee.RGBA,RED_INTEGER:ee.RED_INTEGER,RG_INTEGER:ee.RG_INTEGER,RGB_INTEGER:ee.RGB_INTEGER,RGBA_INTEGER:ee.RGBA_INTEGER,LUMINANCE:ee.LUMINANCE,LUMINANCE_ALPHA:ee.LUMINANCE_ALPHA,RGB_DXT1:ee.COMPRESSED_RGB_S3TC_DXT1_EXT,RGBA_DXT1:ee.COMPRESSED_RGBA_S3TC_DXT1_EXT,RGBA_DXT3:ee.COMPRESSED_RGBA_S3TC_DXT3_EXT,RGBA_DXT5:ee.COMPRESSED_RGBA_S3TC_DXT5_EXT,RGB_PVRTC_4BPPV1:ee.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,RGB_PVRTC_2BPPV1:ee.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,RGBA_PVRTC_4BPPV1:ee.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,RGBA_PVRTC_2BPPV1:ee.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,RGBA_ASTC:ee.COMPRESSED_RGBA_ASTC_4x4_WEBGL,RGB_ETC1:ee.COMPRESSED_RGB_ETC1_WEBGL,RGB8_ETC2:ee.COMPRESSED_RGB8_ETC2,RGBA8_ETC2_EAC:ee.COMPRESSED_RGBA8_ETC2_EAC,RGBA_BC7:ee.COMPRESSED_RGBA_BPTC_UNORM};tt.componentsLength=function(e){switch(e){case tt.RGB:case tt.RGB_INTEGER:return 3;case tt.RGBA:case tt.RGBA_INTEGER:return 4;case tt.LUMINANCE_ALPHA:case tt.RG:case tt.RG_INTEGER:return 2;case tt.ALPHA:case tt.RED:case tt.RED_INTEGER:case tt.LUMINANCE:return 1;default:return 1}};tt.validate=function(e){return e===tt.DEPTH_COMPONENT||e===tt.DEPTH_STENCIL||e===tt.ALPHA||e===tt.RED||e===tt.RG||e===tt.RGB||e===tt.RGBA||e===tt.RED_INTEGER||e===tt.RG_INTEGER||e===tt.RGB_INTEGER||e===tt.RGBA_INTEGER||e===tt.LUMINANCE||e===tt.LUMINANCE_ALPHA||e===tt.RGB_DXT1||e===tt.RGBA_DXT1||e===tt.RGBA_DXT3||e===tt.RGBA_DXT5||e===tt.RGB_PVRTC_4BPPV1||e===tt.RGB_PVRTC_2BPPV1||e===tt.RGBA_PVRTC_4BPPV1||e===tt.RGBA_PVRTC_2BPPV1||e===tt.RGBA_ASTC||e===tt.RGB_ETC1||e===tt.RGB8_ETC2||e===tt.RGBA8_ETC2_EAC||e===tt.RGBA_BC7};tt.isColorFormat=function(e){return e===tt.RED||e===tt.ALPHA||e===tt.RGB||e===tt.RGBA||e===tt.LUMINANCE||e===tt.LUMINANCE_ALPHA};tt.isDepthFormat=function(e){return e===tt.DEPTH_COMPONENT||e===tt.DEPTH_STENCIL};tt.isCompressedFormat=function(e){return e===tt.RGB_DXT1||e===tt.RGBA_DXT1||e===tt.RGBA_DXT3||e===tt.RGBA_DXT5||e===tt.RGB_PVRTC_4BPPV1||e===tt.RGB_PVRTC_2BPPV1||e===tt.RGBA_PVRTC_4BPPV1||e===tt.RGBA_PVRTC_2BPPV1||e===tt.RGBA_ASTC||e===tt.RGB_ETC1||e===tt.RGB8_ETC2||e===tt.RGBA8_ETC2_EAC||e===tt.RGBA_BC7};tt.isDXTFormat=function(e){return e===tt.RGB_DXT1||e===tt.RGBA_DXT1||e===tt.RGBA_DXT3||e===tt.RGBA_DXT5};tt.isPVRTCFormat=function(e){return e===tt.RGB_PVRTC_4BPPV1||e===tt.RGB_PVRTC_2BPPV1||e===tt.RGBA_PVRTC_4BPPV1||e===tt.RGBA_PVRTC_2BPPV1};tt.isASTCFormat=function(e){return e===tt.RGBA_ASTC};tt.isETC1Format=function(e){return e===tt.RGB_ETC1};tt.isETC2Format=function(e){return e===tt.RGB8_ETC2||e===tt.RGBA8_ETC2_EAC};tt.isBC7Format=function(e){return e===tt.RGBA_BC7};tt.compressedTextureSizeInBytes=function(e,t,n){switch(e){case tt.RGB_DXT1:case tt.RGBA_DXT1:case tt.RGB_ETC1:case tt.RGB8_ETC2:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*8;case tt.RGBA_DXT3:case tt.RGBA_DXT5:case tt.RGBA_ASTC:case tt.RGBA8_ETC2_EAC:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*16;case tt.RGB_PVRTC_4BPPV1:case tt.RGBA_PVRTC_4BPPV1:return Math.floor((Math.max(t,8)*Math.max(n,8)*4+7)/8);case tt.RGB_PVRTC_2BPPV1:case tt.RGBA_PVRTC_2BPPV1:return Math.floor((Math.max(t,16)*Math.max(n,8)*2+7)/8);case tt.RGBA_BC7:return Math.ceil(t/4)*Math.ceil(n/4)*16;default:return 0}};tt.textureSizeInBytes=function(e,t,n,i){let r=tt.componentsLength(e);return ke.isPacked(t)&&(r=1),r*ke.sizeInBytes(t)*n*i};tt.texture3DSizeInBytes=function(e,t,n,i,r){let o=tt.componentsLength(e);return ke.isPacked(t)&&(o=1),o*ke.sizeInBytes(t)*n*i*r};tt.alignmentInBytes=function(e,t,n){let i=tt.textureSizeInBytes(e,t,n,1)%4;return i===0?4:i===2?2:1};tt.createTypedArray=function(e,t,n,i){let r=ke.getTypedArrayConstructor(t),o=tt.componentsLength(e)*n*i;return new r(o)};tt.flipY=function(e,t,n,i,r){if(r===1)return e;let o=tt.createTypedArray(t,n,i,r),a=tt.componentsLength(t),s=i*a;for(let c=0;c<r;++c){let u=c*i*a,f=(r-c-1)*i*a;for(let d=0;d<s;++d)o[f+d]=e[u+d]}return o};tt.toInternalFormat=function(e,t,n){if(!n.webgl2)return e;if(e===tt.DEPTH_STENCIL)return ee.DEPTH24_STENCIL8;if(e===tt.DEPTH_COMPONENT){if(t===ke.UNSIGNED_SHORT)return ee.DEPTH_COMPONENT16;if(t===ke.UNSIGNED_INT)return ee.DEPTH_COMPONENT24}if(t===ke.FLOAT)switch(e){case tt.RGBA:return ee.RGBA32F;case tt.RGB:return ee.RGB32F;case tt.RG:return ee.RG32F;case tt.RED:return ee.R32F}if(t===ke.HALF_FLOAT)switch(e){case tt.RGBA:return ee.RGBA16F;case tt.RGB:return ee.RGB16F;case tt.RG:return ee.RG16F;case tt.RED:return ee.R16F}if(t===ke.UNSIGNED_BYTE)switch(e){case tt.RGBA:return ee.RGBA8;case tt.RGB:return ee.RGB8;case tt.RG:return ee.RG8;case tt.RED:return ee.R8}if(t===ke.INT)switch(e){case tt.RGBA_INTEGER:return ee.RGBA32I;case tt.RGB_INTEGER:return ee.RGB32I;case tt.RG_INTEGER:return ee.RG32I;case tt.RED_INTEGER:return ee.R32I}if(t===ke.UNSIGNED_INT)switch(e){case tt.RGBA_INTEGER:return ee.RGBA32UI;case tt.RGB_INTEGER:return ee.RGB32UI;case tt.RG_INTEGER:return ee.RG32UI;case tt.RED_INTEGER:return ee.R32UI}return e};Object.freeze(tt);var He=tt;function wq(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}var _e=class e{constructor(t,n,i,r){this.red=t??1,this.green=n??1,this.blue=i??1,this.alpha=r??1}static fromCartesian4(t,n){return l(n)?(n.red=t.x,n.green=t.y,n.blue=t.z,n.alpha=t.w,n):new e(t.x,t.y,t.z,t.w)}static fromBytes(t,n,i,r,o){return t=e.byteToFloat(t??255),n=e.byteToFloat(n??255),i=e.byteToFloat(i??255),r=e.byteToFloat(r??255),l(o)?(o.red=t,o.green=n,o.blue=i,o.alpha=r,o):new e(t,n,i,r)}static fromAlpha(t,n,i){return l(i)?(i.red=t.red,i.green=t.green,i.blue=t.blue,i.alpha=n,i):new e(t.red,t.green,t.blue,n)}static fromRgba(t,n){return Pq[0]=t,e.fromBytes(x0[0],x0[1],x0[2],x0[3],n)}static fromHsl(t,n,i,r,o){t=(t??0)%1,n=n??0,i=i??0,r=r??1;let a=i,s=i,c=i;if(n!==0){let u;i<.5?u=i*(1+n):u=i+n-i*n;let f=2*i-u;a=wq(f,u,t+1/3),s=wq(f,u,t),c=wq(f,u,t-1/3)}return l(o)?(o.red=a,o.green=s,o.blue=c,o.alpha=r,o):new e(a,s,c,r)}static fromRandom(t,n){t=t??H.EMPTY_OBJECT;let i=t.red;if(!l(i)){let s=t.minimumRed??0,c=t.maximumRed??1;i=s+I.nextRandomNumber()*(c-s)}let r=t.green;if(!l(r)){let s=t.minimumGreen??0,c=t.maximumGreen??1;r=s+I.nextRandomNumber()*(c-s)}let o=t.blue;if(!l(o)){let s=t.minimumBlue??0,c=t.maximumBlue??1;o=s+I.nextRandomNumber()*(c-s)}let a=t.alpha;if(!l(a)){let s=t.minimumAlpha??0,c=t.maximumAlpha??1;a=s+I.nextRandomNumber()*(c-s)}return l(n)?(n.red=i,n.green=r,n.blue=o,n.alpha=a,n):new e(i,r,o,a)}static fromCssColorString(t,n){l(n)||(n=new e),t=t.trim();let i=e[t.toUpperCase()];if(l(i))return e.clone(i,n),n;let r=G4e.exec(t);return r!==null?(n.red=parseInt(r[1],16)/15,n.green=parseInt(r[2],16)/15,n.blue=parseInt(r[3],16)/15,n.alpha=parseInt(r[4]??"f",16)/15,n):(r=W4e.exec(t),r!==null?(n.red=parseInt(r[1],16)/255,n.green=parseInt(r[2],16)/255,n.blue=parseInt(r[3],16)/255,n.alpha=parseInt(r[4]??"ff",16)/255,n):(r=q4e.exec(t),r!==null?(n.red=parseFloat(r[1])/(r[1].substr(-1)==="%"?100:255),n.green=parseFloat(r[2])/(r[2].substr(-1)==="%"?100:255),n.blue=parseFloat(r[3])/(r[3].substr(-1)==="%"?100:255),n.alpha=parseFloat(r[4]??"1.0"),n):(r=Y4e.exec(t),r!==null?e.fromHsl(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,parseFloat(r[4]??"1.0"),n):(n=void 0,n))))}static pack(t,n,i){return i=i??0,n[i++]=t.red,n[i++]=t.green,n[i++]=t.blue,n[i]=t.alpha,n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i.red=t[n++],i.green=t[n++],i.blue=t[n++],i.alpha=t[n],i}static byteToFloat(t){return t/255}static floatToByte(t){return t===1?255:t*256|0}static clone(t,n){if(l(t))return l(n)?(n.red=t.red,n.green=t.green,n.blue=t.blue,n.alpha=t.alpha,n):new e(t.red,t.green,t.blue,t.alpha)}static equals(t,n){return t===n||l(t)&&l(n)&&t.red===n.red&&t.green===n.green&&t.blue===n.blue&&t.alpha===n.alpha}static equalsArray(t,n,i){return t.red===n[i]&&t.green===n[i+1]&&t.blue===n[i+2]&&t.alpha===n[i+3]}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}equalsEpsilon(t,n){return this===t||l(t)&&Math.abs(this.red-t.red)<=n&&Math.abs(this.green-t.green)<=n&&Math.abs(this.blue-t.blue)<=n&&Math.abs(this.alpha-t.alpha)<=n}toString(){return`(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`}toCssColorString(){let t=e.floatToByte(this.red),n=e.floatToByte(this.green),i=e.floatToByte(this.blue);return this.alpha===1?`rgb(${t},${n},${i})`:`rgba(${t},${n},${i},${this.alpha})`}toCssHexString(){let t=e.floatToByte(this.red).toString(16);t.length<2&&(t=`0${t}`);let n=e.floatToByte(this.green).toString(16);n.length<2&&(n=`0${n}`);let i=e.floatToByte(this.blue).toString(16);if(i.length<2&&(i=`0${i}`),this.alpha<1){let r=e.floatToByte(this.alpha).toString(16);return r.length<2&&(r=`0${r}`),`#${t}${n}${i}${r}`}return`#${t}${n}${i}`}toBytes(t){let n=e.floatToByte(this.red),i=e.floatToByte(this.green),r=e.floatToByte(this.blue),o=e.floatToByte(this.alpha);return l(t)?(t[0]=n,t[1]=i,t[2]=r,t[3]=o,t):[n,i,r,o]}static bytesToRgba(t,n,i,r){return x0[0]=t,x0[1]=n,x0[2]=i,x0[3]=r,Pq[0]}toRgba(){return e.bytesToRgba(e.floatToByte(this.red),e.floatToByte(this.green),e.floatToByte(this.blue),e.floatToByte(this.alpha))}brighten(t,n){return t=1-t,n.red=1-(1-this.red)*t,n.green=1-(1-this.green)*t,n.blue=1-(1-this.blue)*t,n.alpha=this.alpha,n}darken(t,n){return t=1-t,n.red=this.red*t,n.green=this.green*t,n.blue=this.blue*t,n.alpha=this.alpha,n}withAlpha(t,n){return e.fromAlpha(this,t,n)}static add(t,n,i){return i.red=t.red+n.red,i.green=t.green+n.green,i.blue=t.blue+n.blue,i.alpha=t.alpha+n.alpha,i}static subtract(t,n,i){return i.red=t.red-n.red,i.green=t.green-n.green,i.blue=t.blue-n.blue,i.alpha=t.alpha-n.alpha,i}static multiply(t,n,i){return i.red=t.red*n.red,i.green=t.green*n.green,i.blue=t.blue*n.blue,i.alpha=t.alpha*n.alpha,i}static divide(t,n,i){return i.red=t.red/n.red,i.green=t.green/n.green,i.blue=t.blue/n.blue,i.alpha=t.alpha/n.alpha,i}static mod(t,n,i){return i.red=t.red%n.red,i.green=t.green%n.green,i.blue=t.blue%n.blue,i.alpha=t.alpha%n.alpha,i}static lerp(t,n,i,r){return r.red=I.lerp(t.red,n.red,i),r.green=I.lerp(t.green,n.green,i),r.blue=I.lerp(t.blue,n.blue,i),r.alpha=I.lerp(t.alpha,n.alpha,i),r}static multiplyByScalar(t,n,i){return i.red=t.red*n,i.green=t.green*n,i.blue=t.blue*n,i.alpha=t.alpha*n,i}static divideByScalar(t,n,i){return i.red=t.red/n,i.green=t.green/n,i.blue=t.blue/n,i.alpha=t.alpha/n,i}},Iq,Pq,x0;fn.supportsTypedArrays()&&(Iq=new ArrayBuffer(4),Pq=new Uint32Array(Iq),x0=new Uint8Array(Iq));var G4e=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,W4e=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,q4e=/^rgba?\s*\(\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i,Y4e=/^hsla?\s*\(\s*([0-9.]+)\s*[,\s]+\s*([0-9.]+%)\s*[,\s]+\s*([0-9.]+%)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i;_e.packedLength=4;_e.ALICEBLUE=Object.freeze(_e.fromCssColorString("#F0F8FF"));_e.ANTIQUEWHITE=Object.freeze(_e.fromCssColorString("#FAEBD7"));_e.AQUA=Object.freeze(_e.fromCssColorString("#00FFFF"));_e.AQUAMARINE=Object.freeze(_e.fromCssColorString("#7FFFD4"));_e.AZURE=Object.freeze(_e.fromCssColorString("#F0FFFF"));_e.BEIGE=Object.freeze(_e.fromCssColorString("#F5F5DC"));_e.BISQUE=Object.freeze(_e.fromCssColorString("#FFE4C4"));_e.BLACK=Object.freeze(_e.fromCssColorString("#000000"));_e.BLANCHEDALMOND=Object.freeze(_e.fromCssColorString("#FFEBCD"));_e.BLUE=Object.freeze(_e.fromCssColorString("#0000FF"));_e.BLUEVIOLET=Object.freeze(_e.fromCssColorString("#8A2BE2"));_e.BROWN=Object.freeze(_e.fromCssColorString("#A52A2A"));_e.BURLYWOOD=Object.freeze(_e.fromCssColorString("#DEB887"));_e.CADETBLUE=Object.freeze(_e.fromCssColorString("#5F9EA0"));_e.CHARTREUSE=Object.freeze(_e.fromCssColorString("#7FFF00"));_e.CHOCOLATE=Object.freeze(_e.fromCssColorString("#D2691E"));_e.CORAL=Object.freeze(_e.fromCssColorString("#FF7F50"));_e.CORNFLOWERBLUE=Object.freeze(_e.fromCssColorString("#6495ED"));_e.CORNSILK=Object.freeze(_e.fromCssColorString("#FFF8DC"));_e.CRIMSON=Object.freeze(_e.fromCssColorString("#DC143C"));_e.CYAN=Object.freeze(_e.fromCssColorString("#00FFFF"));_e.DARKBLUE=Object.freeze(_e.fromCssColorString("#00008B"));_e.DARKCYAN=Object.freeze(_e.fromCssColorString("#008B8B"));_e.DARKGOLDENROD=Object.freeze(_e.fromCssColorString("#B8860B"));_e.DARKGRAY=Object.freeze(_e.fromCssColorString("#A9A9A9"));_e.DARKGREEN=Object.freeze(_e.fromCssColorString("#006400"));_e.DARKGREY=_e.DARKGRAY;_e.DARKKHAKI=Object.freeze(_e.fromCssColorString("#BDB76B"));_e.DARKMAGENTA=Object.freeze(_e.fromCssColorString("#8B008B"));_e.DARKOLIVEGREEN=Object.freeze(_e.fromCssColorString("#556B2F"));_e.DARKORANGE=Object.freeze(_e.fromCssColorString("#FF8C00"));_e.DARKORCHID=Object.freeze(_e.fromCssColorString("#9932CC"));_e.DARKRED=Object.freeze(_e.fromCssColorString("#8B0000"));_e.DARKSALMON=Object.freeze(_e.fromCssColorString("#E9967A"));_e.DARKSEAGREEN=Object.freeze(_e.fromCssColorString("#8FBC8F"));_e.DARKSLATEBLUE=Object.freeze(_e.fromCssColorString("#483D8B"));_e.DARKSLATEGRAY=Object.freeze(_e.fromCssColorString("#2F4F4F"));_e.DARKSLATEGREY=_e.DARKSLATEGRAY;_e.DARKTURQUOISE=Object.freeze(_e.fromCssColorString("#00CED1"));_e.DARKVIOLET=Object.freeze(_e.fromCssColorString("#9400D3"));_e.DEEPPINK=Object.freeze(_e.fromCssColorString("#FF1493"));_e.DEEPSKYBLUE=Object.freeze(_e.fromCssColorString("#00BFFF"));_e.DIMGRAY=Object.freeze(_e.fromCssColorString("#696969"));_e.DIMGREY=_e.DIMGRAY;_e.DODGERBLUE=Object.freeze(_e.fromCssColorString("#1E90FF"));_e.FIREBRICK=Object.freeze(_e.fromCssColorString("#B22222"));_e.FLORALWHITE=Object.freeze(_e.fromCssColorString("#FFFAF0"));_e.FORESTGREEN=Object.freeze(_e.fromCssColorString("#228B22"));_e.FUCHSIA=Object.freeze(_e.fromCssColorString("#FF00FF"));_e.GAINSBORO=Object.freeze(_e.fromCssColorString("#DCDCDC"));_e.GHOSTWHITE=Object.freeze(_e.fromCssColorString("#F8F8FF"));_e.GOLD=Object.freeze(_e.fromCssColorString("#FFD700"));_e.GOLDENROD=Object.freeze(_e.fromCssColorString("#DAA520"));_e.GRAY=Object.freeze(_e.fromCssColorString("#808080"));_e.GREEN=Object.freeze(_e.fromCssColorString("#008000"));_e.GREENYELLOW=Object.freeze(_e.fromCssColorString("#ADFF2F"));_e.GREY=_e.GRAY;_e.HONEYDEW=Object.freeze(_e.fromCssColorString("#F0FFF0"));_e.HOTPINK=Object.freeze(_e.fromCssColorString("#FF69B4"));_e.INDIANRED=Object.freeze(_e.fromCssColorString("#CD5C5C"));_e.INDIGO=Object.freeze(_e.fromCssColorString("#4B0082"));_e.IVORY=Object.freeze(_e.fromCssColorString("#FFFFF0"));_e.KHAKI=Object.freeze(_e.fromCssColorString("#F0E68C"));_e.LAVENDER=Object.freeze(_e.fromCssColorString("#E6E6FA"));_e.LAVENDAR_BLUSH=Object.freeze(_e.fromCssColorString("#FFF0F5"));_e.LAWNGREEN=Object.freeze(_e.fromCssColorString("#7CFC00"));_e.LEMONCHIFFON=Object.freeze(_e.fromCssColorString("#FFFACD"));_e.LIGHTBLUE=Object.freeze(_e.fromCssColorString("#ADD8E6"));_e.LIGHTCORAL=Object.freeze(_e.fromCssColorString("#F08080"));_e.LIGHTCYAN=Object.freeze(_e.fromCssColorString("#E0FFFF"));_e.LIGHTGOLDENRODYELLOW=Object.freeze(_e.fromCssColorString("#FAFAD2"));_e.LIGHTGRAY=Object.freeze(_e.fromCssColorString("#D3D3D3"));_e.LIGHTGREEN=Object.freeze(_e.fromCssColorString("#90EE90"));_e.LIGHTGREY=_e.LIGHTGRAY;_e.LIGHTPINK=Object.freeze(_e.fromCssColorString("#FFB6C1"));_e.LIGHTSEAGREEN=Object.freeze(_e.fromCssColorString("#20B2AA"));_e.LIGHTSKYBLUE=Object.freeze(_e.fromCssColorString("#87CEFA"));_e.LIGHTSLATEGRAY=Object.freeze(_e.fromCssColorString("#778899"));_e.LIGHTSLATEGREY=_e.LIGHTSLATEGRAY;_e.LIGHTSTEELBLUE=Object.freeze(_e.fromCssColorString("#B0C4DE"));_e.LIGHTYELLOW=Object.freeze(_e.fromCssColorString("#FFFFE0"));_e.LIME=Object.freeze(_e.fromCssColorString("#00FF00"));_e.LIMEGREEN=Object.freeze(_e.fromCssColorString("#32CD32"));_e.LINEN=Object.freeze(_e.fromCssColorString("#FAF0E6"));_e.MAGENTA=Object.freeze(_e.fromCssColorString("#FF00FF"));_e.MAROON=Object.freeze(_e.fromCssColorString("#800000"));_e.MEDIUMAQUAMARINE=Object.freeze(_e.fromCssColorString("#66CDAA"));_e.MEDIUMBLUE=Object.freeze(_e.fromCssColorString("#0000CD"));_e.MEDIUMORCHID=Object.freeze(_e.fromCssColorString("#BA55D3"));_e.MEDIUMPURPLE=Object.freeze(_e.fromCssColorString("#9370DB"));_e.MEDIUMSEAGREEN=Object.freeze(_e.fromCssColorString("#3CB371"));_e.MEDIUMSLATEBLUE=Object.freeze(_e.fromCssColorString("#7B68EE"));_e.MEDIUMSPRINGGREEN=Object.freeze(_e.fromCssColorString("#00FA9A"));_e.MEDIUMTURQUOISE=Object.freeze(_e.fromCssColorString("#48D1CC"));_e.MEDIUMVIOLETRED=Object.freeze(_e.fromCssColorString("#C71585"));_e.MIDNIGHTBLUE=Object.freeze(_e.fromCssColorString("#191970"));_e.MINTCREAM=Object.freeze(_e.fromCssColorString("#F5FFFA"));_e.MISTYROSE=Object.freeze(_e.fromCssColorString("#FFE4E1"));_e.MOCCASIN=Object.freeze(_e.fromCssColorString("#FFE4B5"));_e.NAVAJOWHITE=Object.freeze(_e.fromCssColorString("#FFDEAD"));_e.NAVY=Object.freeze(_e.fromCssColorString("#000080"));_e.OLDLACE=Object.freeze(_e.fromCssColorString("#FDF5E6"));_e.OLIVE=Object.freeze(_e.fromCssColorString("#808000"));_e.OLIVEDRAB=Object.freeze(_e.fromCssColorString("#6B8E23"));_e.ORANGE=Object.freeze(_e.fromCssColorString("#FFA500"));_e.ORANGERED=Object.freeze(_e.fromCssColorString("#FF4500"));_e.ORCHID=Object.freeze(_e.fromCssColorString("#DA70D6"));_e.PALEGOLDENROD=Object.freeze(_e.fromCssColorString("#EEE8AA"));_e.PALEGREEN=Object.freeze(_e.fromCssColorString("#98FB98"));_e.PALETURQUOISE=Object.freeze(_e.fromCssColorString("#AFEEEE"));_e.PALEVIOLETRED=Object.freeze(_e.fromCssColorString("#DB7093"));_e.PAPAYAWHIP=Object.freeze(_e.fromCssColorString("#FFEFD5"));_e.PEACHPUFF=Object.freeze(_e.fromCssColorString("#FFDAB9"));_e.PERU=Object.freeze(_e.fromCssColorString("#CD853F"));_e.PINK=Object.freeze(_e.fromCssColorString("#FFC0CB"));_e.PLUM=Object.freeze(_e.fromCssColorString("#DDA0DD"));_e.POWDERBLUE=Object.freeze(_e.fromCssColorString("#B0E0E6"));_e.PURPLE=Object.freeze(_e.fromCssColorString("#800080"));_e.RED=Object.freeze(_e.fromCssColorString("#FF0000"));_e.ROSYBROWN=Object.freeze(_e.fromCssColorString("#BC8F8F"));_e.ROYALBLUE=Object.freeze(_e.fromCssColorString("#4169E1"));_e.SADDLEBROWN=Object.freeze(_e.fromCssColorString("#8B4513"));_e.SALMON=Object.freeze(_e.fromCssColorString("#FA8072"));_e.SANDYBROWN=Object.freeze(_e.fromCssColorString("#F4A460"));_e.SEAGREEN=Object.freeze(_e.fromCssColorString("#2E8B57"));_e.SEASHELL=Object.freeze(_e.fromCssColorString("#FFF5EE"));_e.SIENNA=Object.freeze(_e.fromCssColorString("#A0522D"));_e.SILVER=Object.freeze(_e.fromCssColorString("#C0C0C0"));_e.SKYBLUE=Object.freeze(_e.fromCssColorString("#87CEEB"));_e.SLATEBLUE=Object.freeze(_e.fromCssColorString("#6A5ACD"));_e.SLATEGRAY=Object.freeze(_e.fromCssColorString("#708090"));_e.SLATEGREY=_e.SLATEGRAY;_e.SNOW=Object.freeze(_e.fromCssColorString("#FFFAFA"));_e.SPRINGGREEN=Object.freeze(_e.fromCssColorString("#00FF7F"));_e.STEELBLUE=Object.freeze(_e.fromCssColorString("#4682B4"));_e.TAN=Object.freeze(_e.fromCssColorString("#D2B48C"));_e.TEAL=Object.freeze(_e.fromCssColorString("#008080"));_e.THISTLE=Object.freeze(_e.fromCssColorString("#D8BFD8"));_e.TOMATO=Object.freeze(_e.fromCssColorString("#FF6347"));_e.TURQUOISE=Object.freeze(_e.fromCssColorString("#40E0D0"));_e.VIOLET=Object.freeze(_e.fromCssColorString("#EE82EE"));_e.WHEAT=Object.freeze(_e.fromCssColorString("#F5DEB3"));_e.WHITE=Object.freeze(_e.fromCssColorString("#FFFFFF"));_e.WHITESMOKE=Object.freeze(_e.fromCssColorString("#F5F5F5"));_e.YELLOW=Object.freeze(_e.fromCssColorString("#FFFF00"));_e.YELLOWGREEN=Object.freeze(_e.fromCssColorString("#9ACD32"));_e.TRANSPARENT=Object.freeze(new _e(0,0,0,0));var U=_e;var Io={_maximumCombinedTextureImageUnits:0,_maximumCubeMapSize:0,_maximumFragmentUniformVectors:0,_maximumTextureImageUnits:0,_maximumRenderbufferSize:0,_maximumTextureSize:0,_maximum3DTextureSize:0,_maximumVaryingVectors:0,_maximumVertexAttributes:0,_maximumVertexTextureImageUnits:0,_maximumVertexUniformVectors:0,_minimumAliasedLineWidth:0,_maximumAliasedLineWidth:0,_minimumAliasedPointSize:0,_maximumAliasedPointSize:0,_maximumViewportWidth:0,_maximumViewportHeight:0,_maximumTextureFilterAnisotropy:0,_maximumDrawBuffers:0,_maximumColorAttachments:0,_maximumSamples:0,_highpFloatSupported:!1,_highpIntSupported:!1};Object.defineProperties(Io,{maximumCombinedTextureImageUnits:{get:function(){return Io._maximumCombinedTextureImageUnits}},maximumCubeMapSize:{get:function(){return Io._maximumCubeMapSize}},maximumFragmentUniformVectors:{get:function(){return Io._maximumFragmentUniformVectors}},maximumTextureImageUnits:{get:function(){return Io._maximumTextureImageUnits}},maximumRenderbufferSize:{get:function(){return Io._maximumRenderbufferSize}},maximumTextureSize:{get:function(){return Io._maximumTextureSize}},maximum3DTextureSize:{get:function(){return Io._maximum3DTextureSize}},maximumVaryingVectors:{get:function(){return Io._maximumVaryingVectors}},maximumVertexAttributes:{get:function(){return Io._maximumVertexAttributes}},maximumVertexTextureImageUnits:{get:function(){return Io._maximumVertexTextureImageUnits}},maximumVertexUniformVectors:{get:function(){return Io._maximumVertexUniformVectors}},minimumAliasedLineWidth:{get:function(){return Io._minimumAliasedLineWidth}},maximumAliasedLineWidth:{get:function(){return Io._maximumAliasedLineWidth}},minimumAliasedPointSize:{get:function(){return Io._minimumAliasedPointSize}},maximumAliasedPointSize:{get:function(){return Io._maximumAliasedPointSize}},maximumViewportWidth:{get:function(){return Io._maximumViewportWidth}},maximumViewportHeight:{get:function(){return Io._maximumViewportHeight}},maximumTextureFilterAnisotropy:{get:function(){return Io._maximumTextureFilterAnisotropy}},maximumDrawBuffers:{get:function(){return Io._maximumDrawBuffers}},maximumColorAttachments:{get:function(){return Io._maximumColorAttachments}},maximumSamples:{get:function(){return Io._maximumSamples}},highpFloatSupported:{get:function(){return Io._highpFloatSupported}},highpIntSupported:{get:function(){return Io._highpIntSupported}}});var Ft=Io;var SI={DONT_CARE:ee.DONT_CARE,FASTEST:ee.FASTEST,NICEST:ee.NICEST,validate:function(e){return e===SI.DONT_CARE||e===SI.FASTEST||e===SI.NICEST}};Object.freeze(SI);var sh=SI;var wI={NEAREST:ee.NEAREST,LINEAR:ee.LINEAR};wI.validate=function(e){return e===wI.NEAREST||e===wI.LINEAR};Object.freeze(wI);var ni=wI;var T0={NEAREST:ee.NEAREST,LINEAR:ee.LINEAR,NEAREST_MIPMAP_NEAREST:ee.NEAREST_MIPMAP_NEAREST,LINEAR_MIPMAP_NEAREST:ee.LINEAR_MIPMAP_NEAREST,NEAREST_MIPMAP_LINEAR:ee.NEAREST_MIPMAP_LINEAR,LINEAR_MIPMAP_LINEAR:ee.LINEAR_MIPMAP_LINEAR};T0.validate=function(e){return e===T0.NEAREST||e===T0.LINEAR||e===T0.NEAREST_MIPMAP_NEAREST||e===T0.LINEAR_MIPMAP_NEAREST||e===T0.NEAREST_MIPMAP_LINEAR||e===T0.LINEAR_MIPMAP_LINEAR};Object.freeze(T0);var Gt=T0;var II={CLAMP_TO_EDGE:ee.CLAMP_TO_EDGE,REPEAT:ee.REPEAT,MIRRORED_REPEAT:ee.MIRRORED_REPEAT,validate:function(e){return e===II.CLAMP_TO_EDGE||e===II.REPEAT||e===II.MIRRORED_REPEAT}};Object.freeze(II);var on=II;function PI(e){e=e??H.EMPTY_OBJECT;let{wrapR:t=on.CLAMP_TO_EDGE,wrapS:n=on.CLAMP_TO_EDGE,wrapT:i=on.CLAMP_TO_EDGE,minificationFilter:r=Gt.LINEAR,magnificationFilter:o=ni.LINEAR,maximumAnisotropy:a=1}=e;this._wrapR=t,this._wrapS=n,this._wrapT=i,this._minificationFilter=r,this._magnificationFilter=o,this._maximumAnisotropy=a}Object.defineProperties(PI.prototype,{wrapR:{get:function(){return this._wrapR}},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}}});PI.equals=function(e,t){return e===t||l(e)&&l(t)&&e._wrapR===t._wrapR&&e._wrapS===t._wrapS&&e._wrapT===t._wrapT&&e._minificationFilter===t._minificationFilter&&e._magnificationFilter===t._magnificationFilter&&e._maximumAnisotropy===t._maximumAnisotropy};PI.NEAREST=Object.freeze(new PI({wrapR:on.CLAMP_TO_EDGE,wrapS:on.CLAMP_TO_EDGE,wrapT:on.CLAMP_TO_EDGE,minificationFilter:Gt.NEAREST,magnificationFilter:ni.NEAREST}));var Ut=PI;function Gf(e){e=e??H.EMPTY_OBJECT;let{context:t,source:n,pixelFormat:i=He.RGBA,pixelDatatype:r=ke.UNSIGNED_BYTE,flipY:o=!0,skipColorSpaceConversion:a=!1,sampler:s=new Ut}=e,{width:c,height:u}=e;l(n)&&(l(c)||(c=n.videoWidth??n.naturalWidth??n.width),l(u)||(u=n.videoHeight??n.naturalHeight??n.height));let f=e.preMultiplyAlpha||i===He.RGB||i===He.LUMINANCE,d=He.toInternalFormat(i,r,t),p=He.isCompressedFormat(d),g=t._gl,m=p?He.compressedTextureSizeInBytes(i,c,u):He.textureSizeInBytes(i,r,c,u);this._id=e.id??Kn(),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=g.TEXTURE_2D,this._texture=g.createTexture(),this._internalFormat=d,this._pixelFormat=i,this._pixelDatatype=r,this._width=c,this._height=u,this._dimensions=new k(c,u),this._hasMipmap=!1,this._sizeInBytes=m,this._preMultiplyAlpha=f,this._flipY=o,this._initialized=!1,this._sampler=void 0,this._sampler=s,$ce(this,s),g.activeTexture(g.TEXTURE0),g.bindTexture(this._textureTarget,this._texture),l(n)?(a?g.pixelStorei(g.UNPACK_COLORSPACE_CONVERSION_WEBGL,g.NONE):g.pixelStorei(g.UNPACK_COLORSPACE_CONVERSION_WEBGL,g.BROWSER_DEFAULT_WEBGL),l(n.arrayBufferView)?He.isCompressedFormat(d)?X4e(this,n):Yce(this,n):l(n.framebuffer)?$4e(this,n):Xce(this,n),this._initialized=!0):Kce(this),g.bindTexture(this._textureTarget,null)}function X4e(e,t){let i=e._context._gl,r=e._textureTarget,o=e._internalFormat,{width:a,height:s}=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(r,0,o,a,s,0,t.arrayBufferView),l(t.mipLevels)){let c=a,u=s;for(let f=0;f<t.mipLevels.length;++f)c=SL(c),u=SL(u),i.compressedTexImage2D(r,f+1,o,c,u,0,t.mipLevels[f])}}function Yce(e,t){let n=e._context,i=n._gl,r=e._textureTarget,o=e._internalFormat,{width:a,height:s,pixelFormat:c,pixelDatatype:u,flipY:f}=e,d=He.alignmentInBytes(c,u,a);i.pixelStorei(i.UNPACK_ALIGNMENT,d),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1);let{arrayBufferView:p}=t;if(f&&(p=He.flipY(p,c,u,a,s)),i.texImage2D(r,0,o,a,s,0,c,ke.toWebGLConstant(u,n),p),l(t.mipLevels)){let g=a,m=s;for(let y=0;y<t.mipLevels.length;++y)g=SL(g),m=SL(m),i.texImage2D(r,y+1,o,g,m,0,c,ke.toWebGLConstant(u,n),t.mipLevels[y])}}function K4e(e,t,n,i,r,o){let a=e._context,s=a._gl,{pixelFormat:c,pixelDatatype:u}=e,f=He.alignmentInBytes(c,u,r);s.pixelStorei(s.UNPACK_ALIGNMENT,f),s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!1),e.flipY&&(t=He.flipY(t,c,u,r,o)),s.texSubImage2D(e._textureTarget,0,n,i,r,o,c,ke.toWebGLConstant(u,a),t)}function $4e(e,t){let n=e._context,i=n._gl;i.pixelStorei(i.UNPACK_ALIGNMENT,4),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1),t.framebuffer!==n.defaultFramebuffer&&t.framebuffer._bind(),i.copyTexImage2D(e._textureTarget,0,e._internalFormat,t.xOffset,t.yOffset,e.width,e.height,0),t.framebuffer!==n.defaultFramebuffer&&t.framebuffer._unBind()}function Xce(e,t){let n=e._context,i=n._gl;i.pixelStorei(i.UNPACK_ALIGNMENT,4),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.preMultiplyAlpha),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,e.flipY),i.texImage2D(e._textureTarget,0,e._internalFormat,e.pixelFormat,ke.toWebGLConstant(e.pixelDatatype,n),t)}function J4e(e,t,n,i){let r=e._context,o=r._gl;o.pixelStorei(o.UNPACK_ALIGNMENT,4),o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.preMultiplyAlpha),o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,e.flipY),o.texSubImage2D(e._textureTarget,0,n,i,e.pixelFormat,ke.toWebGLConstant(e.pixelDatatype,r),t)}function SL(e){let t=Math.floor(e/2)|0;return Math.max(t,1)}function Kce(e){let t=e._context;t._gl.texImage2D(e._textureTarget,0,e._internalFormat,e._width,e._height,0,e._pixelFormat,ke.toWebGLConstant(e._pixelDatatype,t),null)}Gf.create=function(e){return new Gf(e)};Gf.fromFramebuffer=function(e){e=e??H.EMPTY_OBJECT;let t=e.context,{pixelFormat:n=He.RGB,framebufferXOffset:i=0,framebufferYOffset:r=0,width:o=t.drawingBufferWidth,height:a=t.drawingBufferHeight,framebuffer:s}=e;return new Gf({context:t,width:o,height:a,pixelFormat:n,source:{framebuffer:l(s)?s:t.defaultFramebuffer,xOffset:i,yOffset:r,width:o,height:a}})};Object.defineProperties(Gf.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){$ce(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 $ce(e,t){let{minificationFilter:n,magnificationFilter:i}=t,r=[Gt.NEAREST_MIPMAP_NEAREST,Gt.NEAREST_MIPMAP_LINEAR,Gt.LINEAR_MIPMAP_NEAREST,Gt.LINEAR_MIPMAP_LINEAR].includes(n),o=e._context,a=e._pixelFormat,s=e._pixelDatatype;(s===ke.FLOAT&&!o.textureFloatLinear||s===ke.HALF_FLOAT&&!o.textureHalfFloatLinear)&&(n=r?Gt.NEAREST_MIPMAP_NEAREST:Gt.NEAREST,i=ni.NEAREST),o.webgl2&&He.isDepthFormat(a)&&(n=Gt.NEAREST,i=ni.NEAREST);let c=o._gl,u=e._textureTarget;c.activeTexture(c.TEXTURE0),c.bindTexture(u,e._texture),c.texParameteri(u,c.TEXTURE_MIN_FILTER,n),c.texParameteri(u,c.TEXTURE_MAG_FILTER,i),c.texParameteri(u,c.TEXTURE_WRAP_S,t.wrapS),c.texParameteri(u,c.TEXTURE_WRAP_T,t.wrapT),l(e._textureFilterAnisotropic)&&c.texParameteri(u,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),c.bindTexture(u,null)}Gf.prototype.copyFrom=function(e){let{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:r=!1}=e,a=this._context._gl,s=this._textureTarget;a.activeTexture(a.TEXTURE0),a.bindTexture(s,this._texture);let{width:c,height:u}=i;l(i.videoWidth)&&l(i.videoHeight)?(c=i.videoWidth,u=i.videoHeight):l(i.naturalWidth)&&l(i.naturalHeight)&&(c=i.naturalWidth,u=i.naturalHeight),r?a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.NONE):a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.BROWSER_DEFAULT_WEBGL);let f=!1;this._initialized||(t===0&&n===0&&c===this._width&&u===this._height?(l(i.arrayBufferView)?Yce(this,i):Xce(this,i),f=!0):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),Kce(this)),this._initialized=!0),f||(l(i.arrayBufferView)?K4e(this,i.arrayBufferView,t,n,c,u):J4e(this,i,t,n)),a.bindTexture(s,null)};Gf.prototype.copyFromFramebuffer=function(e,t,n,i,r,o){e=e??0,t=t??0,n=n??0,i=i??0,r=r??this._width,o=o??this._height;let a=this._context._gl,s=this._textureTarget;a.activeTexture(a.TEXTURE0),a.bindTexture(s,this._texture),a.copyTexSubImage2D(s,0,e,t,n,i,r,o),a.bindTexture(s,null),this._initialized=!0};Gf.prototype.generateMipmap=function(e){e=e??sh.DONT_CARE,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)};Gf.prototype.isDestroyed=function(){return!1};Gf.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),ue(this)};Gf.defaultColor=U.WHITE;var Et=Gf;var Jce={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};Object.freeze(Jce);var C0=Jce;var _r={},Dq=class{constructor(){this.octEncoded=!1,this.octEncodedZXY=!1,this.normalizationRange=void 0,this.quantizedVolumeOffset=void 0,this.quantizedVolumeDimensions=void 0,this.quantizedVolumeStepSize=void 0,this.componentDatatype=void 0,this.type=void 0}},Rq=class{constructor(){this.name=void 0,this.semantic=void 0,this.setIndex=void 0,this.componentDatatype=void 0,this.type=void 0,this.normalized=!1,this.count=void 0,this.min=void 0,this.max=void 0,this.constant=void 0,this.quantization=void 0,this.typedArray=void 0,this.buffer=void 0,this.byteOffset=0,this.byteStride=void 0}},Oq=class{constructor(){this.indexDatatype=void 0,this.count=void 0,this.buffer=void 0,this.typedArray=void 0}},Mq=class{constructor(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.setIndex=void 0,this.label=void 0,this.positionalLabel=void 0}},Lq=class{constructor(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.offset=0,this.repeat=void 0,this.label=void 0,this.positionalLabel=void 0}},Nq=class{constructor(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.textureReader=void 0,this.label=void 0,this.positionalLabel=void 0}},Fq=class{constructor(){this.attributes=[]}},Bq=class{constructor(){this.attributes=[],this.morphTargets=[],this.indices=void 0,this.material=void 0,this.primitiveType=void 0,this.polygon=void 0,this.vector=void 0,this.featureIds=[],this.propertyTextureIds=[],this.propertyAttributeIds=[],this.outlineCoordinates=void 0,this.modelPrimitiveImagery=void 0,this.edgeVisibility=void 0}},kq=class{constructor(){this.attributes=[],this.featureIds=[],this.transformInWorldSpace=!1}},zq=class{constructor(){this.index=void 0,this.joints=[],this.inverseBindMatrices=[]}},Uq=class{constructor(){this.name=void 0,this.index=void 0,this.children=[],this.primitives=[],this.instances=void 0,this.skin=void 0,this.matrix=void 0,this.translation=void 0,this.rotation=void 0,this.scale=void 0,this.morphWeights=[],this.articulationName=void 0,this.meshVector=void 0}},Vq=class{constructor(){this.nodes=[]}},Z4e={TRANSLATION:"translation",ROTATION:"rotation",SCALE:"scale",WEIGHTS:"weights"},jq=class{constructor(){this.input=[],this.interpolation=void 0,this.output=[]}},Hq=class{constructor(){this.node=void 0,this.path=void 0}},Gq=class{constructor(){this.sampler=void 0,this.target=void 0}},Wq=class{constructor(){this.name=void 0,this.samplers=[],this.channels=[]}},qq=class{constructor(){this.name=void 0,this.type=void 0,this.minimumValue=void 0,this.maximumValue=void 0,this.initialValue=void 0}},Yq=class{constructor(){this.name=void 0,this.stages=[]}},wL=class{constructor(){this.credits=[]}},Xq=class{constructor(){this.asset=new wL,this.scene=void 0,this.nodes=[],this.skins=[],this.animations=[],this.articulations=[],this.structuralMetadata=void 0,this.upAxis=void 0,this.forwardAxis=void 0,this.transform=O.clone(O.IDENTITY),this.extensions={}}},Kq=class{constructor(){this.texture=void 0,this.index=void 0,this.texCoord=0,this.transform=$.clone($.IDENTITY),this.scale=1,this.channels=void 0,this.constantLod=void 0}},g_=class g_{constructor(){this.baseColorTexture=void 0,this.metallicRoughnessTexture=void 0,this.baseColorFactor=ae.clone(g_.DEFAULT_BASE_COLOR_FACTOR),this.metallicFactor=g_.DEFAULT_METALLIC_FACTOR,this.roughnessFactor=g_.DEFAULT_ROUGHNESS_FACTOR}};at(g_,"DEFAULT_BASE_COLOR_FACTOR",ae.ONE),at(g_,"DEFAULT_METALLIC_FACTOR",1),at(g_,"DEFAULT_ROUGHNESS_FACTOR",1);var IL=g_,__=class __{constructor(){this.diffuseTexture=void 0,this.specularGlossinessTexture=void 0,this.diffuseFactor=ae.clone(__.DEFAULT_DIFFUSE_FACTOR),this.specularFactor=h.clone(__.DEFAULT_SPECULAR_FACTOR),this.glossinessFactor=__.DEFAULT_GLOSSINESS_FACTOR}};at(__,"DEFAULT_DIFFUSE_FACTOR",ae.ONE),at(__,"DEFAULT_SPECULAR_FACTOR",h.ONE),at(__,"DEFAULT_GLOSSINESS_FACTOR",1);var $q=__,sC=class sC{constructor(){this.specularFactor=sC.DEFAULT_SPECULAR_FACTOR,this.specularTexture=void 0,this.specularColorFactor=h.clone(sC.DEFAULT_SPECULAR_COLOR_FACTOR),this.specularColorTexture=void 0}};at(sC,"DEFAULT_SPECULAR_FACTOR",1),at(sC,"DEFAULT_SPECULAR_COLOR_FACTOR",h.ONE);var Jq=sC,cC=class cC{constructor(){this.anisotropyStrength=cC.DEFAULT_ANISOTROPY_STRENGTH,this.anisotropyRotation=cC.DEFAULT_ANISOTROPY_ROTATION,this.anisotropyTexture=void 0}};at(cC,"DEFAULT_ANISOTROPY_STRENGTH",0),at(cC,"DEFAULT_ANISOTROPY_ROTATION",0);var Zq=cC,lC=class lC{constructor(){this.clearcoatFactor=lC.DEFAULT_CLEARCOAT_FACTOR,this.clearcoatTexture=void 0,this.clearcoatRoughnessFactor=lC.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,this.clearcoatRoughnessTexture=void 0,this.clearcoatNormalTexture=void 0}};at(lC,"DEFAULT_CLEARCOAT_FACTOR",0),at(lC,"DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR",0);var Qq=lC,eY=class{constructor(){at(this,"width");at(this,"pattern")}},PL=class PL{constructor(t={}){let{wireframeFill:n=PL.DEFAULT_WIREFRAME_FILL,backgroundFill:i=!1,behind:r=!1}=t;this.wireframeFill=n,this.backgroundFill=i,this.behind=r}};at(PL,"DEFAULT_WIREFRAME_FILL",0);var tY=PL,DL=class DL{constructor(){this.metallicRoughness=new IL,this.specularGlossiness=void 0,this.specular=void 0,this.anisotropy=void 0,this.clearcoat=void 0,this.emissiveTexture=void 0,this.normalTexture=void 0,this.occlusionTexture=void 0,this.emissiveFactor=h.clone(DL.DEFAULT_EMISSIVE_FACTOR),this.alphaMode=C0.OPAQUE,this.alphaCutoff=.5,this.doubleSided=!1,this.unlit=!1,this.pointDiameter=void 0,this.planarFill=void 0,this.lineStyle=void 0}};at(DL,"DEFAULT_EMISSIVE_FACTOR",h.ZERO);var nY=DL,iY=class{constructor(){at(this,"count",0);at(this,"triangleIndices");at(this,"triangleIndicesOffsets");at(this,"loopIndices");at(this,"loopIndicesOffsets")}},rY=class{constructor(){at(this,"vector",!0);at(this,"count",0);at(this,"polygonAttributeOffsets");at(this,"polygonHoleCounts");at(this,"polygonHoleOffsets");at(this,"polygonIndicesOffsets")}};_r.Quantization=Dq;_r.Attribute=Rq;_r.Indices=Oq;_r.FeatureIdAttribute=Mq;_r.FeatureIdTexture=Nq;_r.FeatureIdImplicitRange=Lq;_r.MorphTarget=Fq;_r.Primitive=Bq;_r.Instances=kq;_r.Skin=zq;_r.Node=Uq;_r.Scene=Vq;_r.AnimatedPropertyType=Object.freeze(Z4e);_r.AnimationSampler=jq;_r.AnimationTarget=Hq;_r.AnimationChannel=Gq;_r.Animation=Wq;_r.ArticulationStage=qq;_r.Articulation=Yq;_r.Asset=wL;_r.Components=Xq;_r.TextureReader=Kq;_r.MetallicRoughness=IL;_r.SpecularGlossiness=$q;_r.Specular=Jq;_r.Anisotropy=Zq;_r.Clearcoat=Qq;_r.PlanarFill=tY;_r.LineStyle=eY;_r.Material=nY;_r.Vector=rY;_r.Polygon=iY;var Tn=_r;var RL={};RL.getImageIdFromTexture=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,textureId:n,supportedImageFormats:i}=e,r=t.textures[n],o=r.extensions;if(l(o)){if(i.webp&&l(o.EXT_texture_webp))return o.EXT_texture_webp.source;if(i.basis&&l(o.KHR_texture_basisu))return o.KHR_texture_basisu.source}return r.source};RL.createSampler=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,textureInfo:n,compressedTextureNoMipmap:i=!1}=e,r=on.REPEAT,o=on.REPEAT,a=Gt.LINEAR,s=ni.LINEAR,c=n.index,f=t.textures[c].sampler;if(l(f)){let d=t.samplers[f];r=d.wrapS??r,o=d.wrapT??o,a=d.minFilter??a,s=d.magFilter??s}return i&&a!==Gt.LINEAR&&a!==Gt.NEAREST&&(a===Gt.NEAREST_MIPMAP_NEAREST||a===Gt.NEAREST_MIPMAP_LINEAR?a=Gt.NEAREST:a=Gt.LINEAR),on.validate(r)||(r=on.REPEAT),on.validate(o)||(o=on.REPEAT),Gt.validate(a)||(a=Gt.LINEAR),ni.validate(s)||(s=ni.LINEAR),new Ut({wrapS:r,wrapT:o,minificationFilter:a,magnificationFilter:s})};var Q4e=new k(1,1);RL.createModelTextureReader=function(e){e=e??H.EMPTY_OBJECT;let{textureInfo:t,channels:n,texture:i}=e,r=t.texCoord??0,o,a=t.extensions?.KHR_texture_transform;if(l(a)){r=a.texCoord??r;let u=l(a.offset)?k.unpack(a.offset):k.ZERO,f=a.rotation??0,d=l(a.scale)?k.unpack(a.scale):Q4e;f=-f,o=new $(Math.cos(f)*d.x,-Math.sin(f)*d.y,u.x,Math.sin(f)*d.x,Math.cos(f)*d.y,u.y,0,0,1)}let s=new Tn.TextureReader;s.index=t.index,s.texture=i,s.texCoord=r,s.scale=t.scale,s.transform=o,s.channels=n;let c=t.extensions?.EXT_textureInfo_constant_lod;return l(c)&&(s.constantLod={repetitions:c.repetitions??1,offset:l(c.offset)?k.unpack(c.offset):k.ZERO,minClampDistance:c.minClampDistance??1,maxClampDistance:c.maxClampDistance??4294967296}),s};var Xu=RL;function e8e(e){let t=document.createElement("canvas");return t.width=I.nextPowerOfTwo(e.width),t.height=I.nextPowerOfTwo(e.height),t.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,t.width,t.height),t}var eb=e8e;var oY=class extends er{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,r=t.textureInfo,o=t.gltfResource,a=t.baseResource,s=t.supportedImageFormats,c=t.cacheKey,u=t.asynchronous??!0,f=r.index,d=Xu.getImageIdFromTexture({gltf:i,textureId:f,supportedImageFormats:s});this._resourceCache=n,this._gltf=i,this._textureInfo=r,this._imageId=d,this._gltfResource=o,this._baseResource=a,this._cacheKey=c,this._asynchronous=u,this._imageLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._texture=void 0,this._state=At.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get texture(){return this._texture}async load(){return l(this._promise)?this._promise:(this._state=At.LOADING,this._promise=n8e(this),this._promise)}process(t){if(this._state===At.READY)return!0;if(this._state!==At.LOADED&&this._state!==At.PROCESSING||l(this._texture)||!l(this._image))return!1;this._state=At.PROCESSING;let n;if(this._asynchronous){let i=t8e;if(i.set(this._gltf,this._textureInfo,this._cacheKey,this._image,this._mipLevels,t.context),!t.jobScheduler.execute(i,kc.TEXTURE))return!1;n=i.texture}else n=Zce(this._gltf,this._textureInfo,this._cacheKey,this._image,this._mipLevels,t.context);return this.unload(),this._texture=n,this._state=At.READY,this._resourceCache.statistics.addTextureLoader(this),!0}unload(){l(this._texture)&&this._texture.destroy(),l(this._imageLoader)&&!this._imageLoader.isDestroyed()&&this._resourceCache.unload(this._imageLoader),this._imageLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._texture=void 0,this._gltf=void 0}},aY=class{constructor(){this.gltf=void 0,this.textureInfo=void 0,this.textureId=void 0,this.image=void 0,this.context=void 0,this.texture=void 0}set(t,n,i,r,o,a){this.gltf=t,this.textureInfo=n,this.textureId=i,this.image=r,this.mipLevels=o,this.context=a}execute(){this.texture=Zce(this.gltf,this.textureInfo,this.textureId,this.image,this.mipLevels,this.context)}};function Zce(e,t,n,i,r,o){let a=i.internalFormat,s=!1;He.isCompressedFormat(a)&&!l(r)&&(s=!0);let c=Xu.createSampler({gltf:e,textureInfo:t,compressedTextureNoMipmap:s}),u=c.minificationFilter,f=c.wrapS,d=c.wrapT,p=u===Gt.NEAREST_MIPMAP_NEAREST||u===Gt.NEAREST_MIPMAP_LINEAR||u===Gt.LINEAR_MIPMAP_NEAREST||u===Gt.LINEAR_MIPMAP_LINEAR,g=!l(a)&&p,m=g||f===on.REPEAT||f===on.MIRRORED_REPEAT||d===on.REPEAT||d===on.MIRRORED_REPEAT,y=!I.isPowerOfTwo(i.width)||!I.isPowerOfTwo(i.height),A=m&&y,b;return l(a)?(!o.webgl2&&He.isCompressedFormat(a)&&y&&m&&console.warn("Compressed texture uses REPEAT or MIRRORED_REPEAT texture wrap mode and dimensions are not powers of two. The texture may be rendered incorrectly."),b=Et.create({id:n,context:o,source:{arrayBufferView:i.bufferView,mipLevels:r},width:i.width,height:i.height,pixelFormat:i.internalFormat,sampler:c})):(A&&(i=eb(i)),b=Et.create({id:n,context:o,source:i,sampler:c,flipY:!1,skipColorSpaceConversion:!0})),g&&b.generateMipmap(),b}var t8e=new aY;async function n8e(e){let t=e._resourceCache;try{let n=t.getImageLoader({gltf:e._gltf,imageId:e._imageId,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._imageLoader=n,await n.load(),e.isDestroyed()?void 0:(e._image=n.image,e._mipLevels=n.mipLevels,e._state=At.LOADED,e)}catch(n){if(e.isDestroyed())return;throw e.unload(),e._state=At.FAILED,e.getError("Failed to load texture",n)}}var DI=oY;var sY=class extends er{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,r=t.gltfResource,o=t.baseResource,a=t.bufferViewId,s=t.primitive,c=t.draco,u=t.attributeSemantic,f=t.accessorId,d=t.cacheKey,p=t.spz,g=t.asynchronous??!0,m=t.loadBuffer??!1,y=t.loadTypedArray??!1;this._resourceCache=n,this._gltfResource=r,this._baseResource=o,this._gltf=i,this._bufferViewId=a,this._primitive=s,this._draco=c,this._spz=p,this._attributeSemantic=u,this._accessorId=f,this._cacheKey=d,this._asynchronous=g,this._loadBuffer=m,this._loadTypedArray=y,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._quantization=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=At.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get buffer(){return this._buffer}get typedArray(){return this._typedArray}get quantization(){return this._quantization}async load(){return l(this._promise)?this._promise:l(this._spz)?(this._promise=o8e(this),this._promise):i8e(this._draco,this._attributeSemantic)?(this._promise=l8e(this),this._promise):(this._promise=f8e(this),this._promise)}process(t){if(this._state===At.READY)return!0;if(this._state!==At.LOADED&&this._state!==At.PROCESSING)return!1;if(l(this._dracoLoader)){try{if(!this._dracoLoader.process(t))return!1}catch(r){OL(this,r)}u8e(this)}if(l(this._spzLoader)){try{if(!this._spzLoader.process(t))return!1}catch(r){OL(this,r)}c8e(this)}let n,i=this._typedArray;if(this._loadBuffer&&this._asynchronous){let r=d8e;if(r.set(i,t.context),!t.jobScheduler.execute(r,kc.BUFFER))return!1;n=r.buffer}else this._loadBuffer&&(n=Qce(i,t.context));return this.unload(),this._buffer=n,this._typedArray=this._loadTypedArray?i:void 0,this._state=At.READY,this._resourceCache.statistics.addGeometryLoader(this),!0}unload(){l(this._buffer)&&this._buffer.destroy();let t=this._resourceCache;l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&t.unload(this._bufferViewLoader),l(this._dracoLoader)&&t.unload(this._dracoLoader),l(this._spzLoader)&&t.unload(this._spzLoader),this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._spzLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._gltf=void 0,this._primitive=void 0}};function i8e(e,t){return l(e)&&l(e.attributes)&&l(e.attributes[t])}function r8e(e,t,n,i){let o=(1<<e.quantizationBits)-1,a=1/o,s=new Tn.Quantization;if(s.componentDatatype=t,s.octEncoded=e.octEncoded,s.octEncodedZXY=!0,s.type=i,s.octEncoded)s.type=Vt.VEC2,s.normalizationRange=o;else{let c=Vt.getMathType(i);if(c===Number){let u=e.range;s.quantizedVolumeOffset=e.minValues[0],s.quantizedVolumeDimensions=u,s.normalizationRange=o,s.quantizedVolumeStepSize=u*a}else{s.quantizedVolumeOffset=c.unpack(e.minValues),s.normalizationRange=c.unpack(new Array(n).fill(o));let u=new Array(n).fill(e.range);s.quantizedVolumeDimensions=c.unpack(u);let f=u.map(function(d){return d*a});s.quantizedVolumeStepSize=c.unpack(f)}}return s}async function o8e(e){e._state=At.LOADING;let t=e._resourceCache;try{let n=t.getSpzLoader({gltf:e._gltf,primitive:e._primitive,spz:e._spz,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._spzLoader=n,await n.load(),e.isDestroyed()?void 0:(e._state=At.LOADED,e)}catch{if(e.isDestroyed())return}}function a8e(e){return`${e.startsWith("KHR_gaussian_splatting:")?"KHR_gaussian_splatting:":"_"}SH_DEGREE_`}function s8e(e){let t=a8e(e),n="_COEF_",i=t.length,r=e.indexOf(n,i),o=parseInt(e.slice(i,r),10),a=parseInt(e.slice(r+n.length),10);return{l:o,n:a}}function c8e(e){e._state=At.PROCESSING;let n=e._spzLoader.decodedData.gcloud;if(e._attributeSemantic==="POSITION")e._typedArray=n.positions;else if(e._attributeSemantic==="KHR_gaussian_splatting:SCALE"||e._attributeSemantic==="_SCALE")e._typedArray=n.scales;else if(e._attributeSemantic==="KHR_gaussian_splatting:ROTATION"||e._attributeSemantic==="_ROTATION")e._typedArray=n.rotations;else if(e._attributeSemantic==="COLOR_0"){let i=n.colors,r=n.alphas;e._typedArray=new Uint8Array(i.length/3*4);for(let o=0;o<i.length/3;o++)e._typedArray[o*4]=I.clamp(i[o*3]*255,0,255),e._typedArray[o*4+1]=I.clamp(i[o*3+1]*255,0,255),e._typedArray[o*4+2]=I.clamp(i[o*3+2]*255,0,255),e._typedArray[o*4+3]=I.clamp(r[o]*255,0,255)}else if(e._attributeSemantic.includes("SH_DEGREE_")){let{l:i,n:r}=s8e(e._attributeSemantic),o=n.shDegree,a=0,s=[0,9,24];switch(o){case 1:a=9;break;case 2:a=24;break;case 3:a=45;break}let c=n.numPoints,u=n.sh;e._typedArray=new Float32Array(c*3);for(let f=0;f<c;f++){let d=f*a+s[i-1]+r*3;e._typedArray[f*3]=u[d],e._typedArray[f*3+1]=u[d+1],e._typedArray[f*3+2]=u[d+2]}}}async function l8e(e){e._state=At.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=At.LOADED,e)}catch{if(e.isDestroyed())return;OL(e)}}function u8e(e){e._state=At.PROCESSING;let n=e._dracoLoader.decodedData.vertexAttributes,i=e._attributeSemantic,r=n[i],o=e._accessorId,s=e._gltf.accessors[o].type,c=r.array,u=r.data.quantization;l(u)&&(e._quantization=r8e(u,r.data.componentDatatype,r.data.componentsPerAttribute,s)),e._typedArray=new Uint8Array(c.buffer,c.byteOffset,c.byteLength)}async function f8e(e){e._state=At.LOADING;let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._bufferViewId,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoader=n,await n.load(),e.isDestroyed()?void 0:(e._typedArray=n.typedArray,e._state=At.PROCESSING,e)}catch(n){if(e.isDestroyed())return;OL(e,n)}}function OL(e,t){throw e.unload(),e._state=At.FAILED,e.getError("Failed to load vertex buffer",t)}var cY=class{constructor(){this.typedArray=void 0,this.context=void 0,this.buffer=void 0}set(t,n){this.typedArray=t,this.context=n}execute(){this.buffer=Qce(this.typedArray,this.context)}};function Qce(e,t){let n=Ze.createVertexBuffer({typedArray:e,context:t,usage:Oe.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}var d8e=new cY,RI=sY;async function h8e(e={}){var t,n,i,r,o=e,a=!!globalThis.window,s=!!globalThis.WorkerGlobalScope,c=((n=(t=globalThis.process)==null?void 0:t.versions)==null?void 0:n.node)&&((i=globalThis.process)==null?void 0:i.type)!="renderer";if(c){let{createRequire:fe}=await Promise.resolve().then(()=>y8e);var u=fe(import.meta.url)}var f="./this.program",d=import.meta.url;if(c)u("node:fs"),d.startsWith("file:")&&u("node:path").dirname(u("node:url").fileURLToPath(d)),1<process.argv.length&&(f=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2);else if(a||s)try{new URL(".",d)}catch{}var p=console.log.bind(console),g=console.error.bind(console),m=!1;function y(fe){for(var ne=0,xe=fe.length,Se=new Uint8Array(xe),qe;ne<xe;++ne)qe=fe.charCodeAt(ne),Se[ne]=~qe>>8&qe;return Se}var A,b,x,T,C,E,w,D,R,M,N,_,v=!1;function S(){var fe=a0.buffer;x=new Int8Array(fe),C=new Int16Array(fe),o.HEAPU8=T=new Uint8Array(fe),E=new Uint16Array(fe),w=new Int32Array(fe),D=new Uint32Array(fe),o.HEAPF32=R=new Float32Array(fe),M=new Float64Array(fe),N=new BigInt64Array(fe),_=new BigUint64Array(fe)}function P(fe){var ne;throw(ne=o.onAbort)==null||ne.call(o,fe),fe="Aborted("+fe+")",g(fe),m=!0,fe=new WebAssembly.RuntimeError(fe+". Build with -sASSERTIONS for more info."),b?.(fe),fe}var L;async function F(fe){return fe}async function V(fe){var ne=L;try{var xe=await F(ne);return await WebAssembly.instantiate(xe,fe)}catch(Se){g(`failed to asynchronously prepare wasm: ${Se}`),P(Se)}}async function z(fe){return V(fe)}var j=fe=>{for(;0<fe.length;)fe.shift()(o)},B=[],G=[],W=()=>{var fe=o.preRun.shift();G.push(fe)},Q={},q=fe=>{for(;fe.length;){var ne=fe.pop();fe.pop()(ne)}};function J(fe){return this.O(D[fe>>2])}var Z={},ce={},Ae={},le=class extends Error{constructor(fe){super(fe),this.name="InternalError"}},Ce=(fe,ne,xe)=>{function Se(vt){if(vt=xe(vt),vt.length!==fe.length)throw new le("Mismatched type converter count");for(var yn=0;yn<fe.length;++yn)$e(fe[yn],vt[yn])}fe.forEach(vt=>Ae[vt]=ne);var qe=Array(ne.length),xt=[],ut=0;for(let[vt,yn]of ne.entries())ce.hasOwnProperty(yn)?qe[vt]=ce[yn]:(xt.push(yn),Z.hasOwnProperty(yn)||(Z[yn]=[]),Z[yn].push(()=>{qe[vt]=ce[yn],++ut,ut===xt.length&&Se(qe)}));xt.length===0&&Se(qe)},ye=fe=>{for(var ne="";;){var xe=T[fe++];if(!xe)return ne;ne+=String.fromCharCode(xe)}},ve=class extends Error{constructor(fe){super(fe),this.name="BindingError"}},Ie=fe=>{throw new ve(fe)};function Le(fe,ne,xe={}){var Se=ne.name;if(!fe)throw new ve(`type "${Se}" must have a positive integer typeid pointer`);if(ce.hasOwnProperty(fe)){if(xe.Aa)return;throw new ve(`Cannot register type '${Se}' twice`)}ce[fe]=ne,delete Ae[fe],Z.hasOwnProperty(fe)&&(ne=Z[fe],delete Z[fe],ne.forEach(qe=>qe()))}function $e(fe,ne,xe={}){return Le(fe,ne,xe)}var Ye=(fe,ne,xe)=>{switch(ne){case 1:return xe?Se=>x[Se]:Se=>T[Se];case 2:return xe?Se=>C[Se>>1]:Se=>E[Se>>1];case 4:return xe?Se=>w[Se>>2]:Se=>D[Se>>2];case 8:return xe?Se=>N[Se>>3]:Se=>_[Se>>3];default:throw new TypeError(`invalid integer width (${ne}): ${fe}`)}},yt=fe=>{throw new ve(fe.M.R.N.name+" instance already deleted")},Ke=!1,we=()=>{},We=fe=>globalThis.FinalizationRegistry?(Ke=new FinalizationRegistry(ne=>{ne=ne.M,--ne.count.value,ne.count.value===0&&(ne.V?ne.Y.Z(ne.V):ne.R.N.Z(ne.P))}),We=ne=>{var xe=ne.M;return xe.V&&Ke.register(ne,{M:xe},ne),ne},we=ne=>{Ke.unregister(ne)},We(fe)):(We=ne=>ne,fe);function Ct(){}var ct=(fe,ne)=>Object.defineProperty(ne,"name",{value:fe}),dn={},Ht=(fe,ne,xe)=>{if(fe[ne].U===void 0){var Se=fe[ne];fe[ne]=function(...qe){if(!fe[ne].U.hasOwnProperty(qe.length))throw new ve(`Function '${xe}' called with an invalid number of arguments (${qe.length}) - expects one of (${fe[ne].U})!`);return fe[ne].U[qe.length].apply(this,qe)},fe[ne].U=[],fe[ne].U[Se.$]=Se}},bt=(fe,ne,xe)=>{if(o.hasOwnProperty(fe)){if(xe===void 0||o[fe].U!==void 0&&o[fe].U[xe]!==void 0)throw new ve(`Cannot register public name '${fe}' twice`);if(Ht(o,fe,fe),o[fe].U.hasOwnProperty(xe))throw new ve(`Cannot register multiple overloads of a function with the same number of arguments (${xe})!`);o[fe].U[xe]=ne}else o[fe]=ne,o[fe].$=xe},Dt=fe=>{fe=fe.replace(/[^a-zA-Z0-9_]/g,"$");var ne=fe.charCodeAt(0);return 48<=ne&&57>=ne?`_${fe}`:fe};function In(fe,ne,xe,Se,qe,xt,ut,vt){this.name=fe,this.constructor=ne,this.ba=xe,this.Z=Se,this.W=qe,this.va=xt,this.fa=ut,this.ta=vt,this.Ca=[]}var rt=(fe,ne,xe)=>{for(;ne!==xe;){if(!ne.fa)throw new ve(`Expected null or instance of ${xe.name}, got an instance of ${ne.name}`);fe=ne.fa(fe),ne=ne.W}return fe},dt=fe=>{if(fe===null)return"null";var ne=typeof fe;return ne==="object"||ne==="array"||ne==="function"?fe.toString():""+fe};function vi(fe,ne){if(ne===null){if(this.ia)throw new ve(`null is not a valid ${this.name}`);return 0}if(!ne.M)throw new ve(`Cannot pass "${dt(ne)}" as a ${this.name}`);if(!ne.M.P)throw new ve(`Cannot pass deleted object as a pointer of type ${this.name}`);return rt(ne.M.P,ne.M.R.N,this.N)}function wn(fe,ne){if(ne===null){if(this.ia)throw new ve(`null is not a valid ${this.name}`);if(this.ha){var xe=this.ka();return fe!==null&&fe.push(this.Z,xe),xe}return 0}if(!ne||!ne.M)throw new ve(`Cannot pass "${dt(ne)}" as a ${this.name}`);if(!ne.M.P)throw new ve(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.ga&&ne.M.R.ga)throw new ve(`Cannot convert argument of type ${ne.M.Y?ne.M.Y.name:ne.M.R.name} to parameter type ${this.name}`);if(xe=rt(ne.M.P,ne.M.R.N,this.N),this.ha){if(ne.M.V===void 0)throw new ve("Passing raw pointer to smart pointer is illegal");switch(this.Ha){case 0:if(ne.M.Y===this)xe=ne.M.V;else throw new ve(`Cannot convert argument of type ${ne.M.Y?ne.M.Y.name:ne.M.R.name} to parameter type ${this.name}`);break;case 1:xe=ne.M.V;break;case 2:if(ne.M.Y===this)xe=ne.M.V;else{var Se=ne.clone();xe=this.Da(xe,Tr(()=>Se.delete())),fe!==null&&fe.push(this.Z,xe)}break;default:throw new ve("Unsupported sharing policy")}}return xe}function Mi(fe,ne){if(ne===null){if(this.ia)throw new ve(`null is not a valid ${this.name}`);return 0}if(!ne.M)throw new ve(`Cannot pass "${dt(ne)}" as a ${this.name}`);if(!ne.M.P)throw new ve(`Cannot pass deleted object as a pointer of type ${this.name}`);if(ne.M.R.ga)throw new ve(`Cannot convert argument of type ${ne.M.R.name} to parameter type ${this.name}`);return rt(ne.M.P,ne.M.R.N,this.N)}var lr=(fe,ne,xe)=>ne===xe?fe:xe.W===void 0?null:(fe=lr(fe,ne,xe.W),fe===null?null:xe.ta(fe)),Li={},Wi=(fe,ne)=>{if(ne===void 0)throw new ve("ptr should not be undefined");for(;fe.W;)ne=fe.fa(ne),fe=fe.W;return Li[ne]},ri=(fe,ne)=>{if(!ne.R||!ne.P)throw new le("makeClassHandle requires ptr and ptrType");if(!!ne.Y!=!!ne.V)throw new le("Both smartPtrType and smartPtr must be specified");return ne.count={value:1},We(Object.create(fe,{M:{value:ne,writable:!0}}))};function ei(fe,ne,xe,Se,qe,xt,ut,vt,yn,Hn,un){this.name=fe,this.N=ne,this.ia=xe,this.ga=Se,this.ha=qe,this.Ba=xt,this.Ha=ut,this.pa=vt,this.ka=yn,this.Da=Hn,this.Z=un,qe||ne.W!==void 0?this.S=wn:(this.S=Se?vi:Mi,this.T=null)}var vn=(fe,ne,xe)=>{if(!o.hasOwnProperty(fe))throw new le("Replacing nonexistent public symbol");o[fe].U!==void 0&&xe!==void 0?o[fe].U[xe]=ne:(o[fe]=ne,o[fe].$=xe)},ti=(fe,ne)=>{fe=ye(fe);var xe=s0.get(ne);if(typeof xe!="function")throw new ve(`unknown function pointer with signature ${fe}: ${ne}`);return xe};class xr extends Error{}var fa=fe=>{fe=Bw(fe);var ne=ye(fe);return Ff(fe),ne},Ma=(fe,ne)=>{function xe(xt){qe[xt]||ce[xt]||(Ae[xt]?Ae[xt].forEach(xe):(Se.push(xt),qe[xt]=!0))}var Se=[],qe={};throw ne.forEach(xe),new xr(`${fe}: `+Se.map(fa).join([", "]))},Xa=(fe,ne)=>{for(var xe=[],Se=0;Se<fe;Se++)xe.push(D[ne+4*Se>>2]);return xe};function Ka(fe){for(var ne=1;ne<fe.length;++ne)if(fe[ne]!==null&&fe[ne].T===void 0)return!0;return!1}function Qr(fe,ne,xe,Se,qe,xt){var ut=ne.length;if(2>ut)throw new ve("argTypes array size mismatch! Must at least get return value and 'this' types!");var vt=ne[1]!==null&&xe!==null,yn=Ka(ne);xe=!ne[0].oa;var Hn=ne[0],un=ne[1];for(Se=[fe,Ie,Se,qe,q,Hn.O.bind(Hn),un?.S.bind(un)],qe=2;qe<ut;++qe)Hn=ne[qe],Se.push(Hn.S.bind(Hn));if(!yn)for(qe=vt?1:2;qe<ne.length;++qe)ne[qe].T!==null&&Se.push(ne[qe].T);for(yn=Ka(ne),qe=ne.length-2,un=[],Hn=["fn"],vt&&Hn.push("thisWired"),ut=0;ut<qe;++ut)un.push(`arg${ut}`),Hn.push(`arg${ut}Wired`);un=un.join(","),Hn=Hn.join(","),un=`return function (${un}) {
|
|
`,yn&&(un+=`var destructors = [];
|
|
`);var Gr=yn?"destructors":"null",ft="humanName throwBindingError invoker fn runDestructors fromRetWire toClassParamWire".split(" ");for(vt&&(un+=`var thisWired = toClassParamWire(${Gr}, this);
|
|
`),ut=0;ut<qe;++ut){var ge=`toArg${ut}Wire`;un+=`var arg${ut}Wired = ${ge}(${Gr}, arg${ut});
|
|
`,ft.push(ge)}if(un+=(xe||xt?"var rv = ":"")+`invoker(${Hn});
|
|
`,yn)un+=`runDestructors(destructors);
|
|
`;else for(ut=vt?1:2;ut<ne.length;++ut)xt=ut===1?"thisWired":"arg"+(ut-2)+"Wired",ne[ut].T!==null&&(un+=`${xt}_dtor(${xt});
|
|
`,ft.push(`${xt}_dtor`));return xe&&(un+=`var ret = fromRetWire(rv);
|
|
return ret;
|
|
`),ne=new Function(ft,un+`}
|
|
`)(...Se),ct(fe,ne)}var mi=fe=>{fe=fe.trim();let ne=fe.indexOf("(");return ne===-1?fe:fe.slice(0,ne)},eo=[],Di=[0,1,,1,null,1,!0,1,!1,1],Mo=fe=>{9<fe&&--Di[fe+1]===0&&(Di[fe]=void 0,eo.push(fe))},Ri=fe=>{if(!fe)throw new ve(`Cannot use deleted val. handle = ${fe}`);return Di[fe]},Tr=fe=>{switch(fe){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:let ne=eo.pop()||Di.length;return Di[ne]=fe,Di[ne+1]=1,ne}},da={name:"emscripten::val",O:fe=>{var ne=Ri(fe);return Mo(fe),ne},S:(fe,ne)=>Tr(ne),X:J,T:null},Co=(fe,ne,xe)=>{switch(ne){case 1:return xe?function(Se){return this.O(x[Se])}:function(Se){return this.O(T[Se])};case 2:return xe?function(Se){return this.O(C[Se>>1])}:function(Se){return this.O(E[Se>>1])};case 4:return xe?function(Se){return this.O(w[Se>>2])}:function(Se){return this.O(D[Se>>2])};default:throw new TypeError(`invalid integer width (${ne}): ${fe}`)}},Mf=(fe,ne)=>{var xe=ce[fe];if(xe===void 0)throw fe=`${ne} has unknown type ${fa(fe)}`,new ve(fe);return xe},Lf=(fe,ne)=>{switch(ne){case 4:return function(xe){return this.O(R[xe>>2])};case 8:return function(xe){return this.O(M[xe>>3])};default:throw new TypeError(`invalid float width (${ne}): ${fe}`)}},lc=(fe,ne,xe)=>{let Se=(qe,xt)=>{let ut=0;return{next(){if(ut>=qe)return{done:!0};let vt=ut;return ut++,{value:xt(vt),done:!1}},[Symbol.iterator](){return this}}};fe[Symbol.iterator]||(fe[Symbol.iterator]=function(){let qe=this[ne]();return Se(qe,xt=>this[xe](xt))})},Xg=Object.assign({optional:!0},da),vo=(fe,ne,xe)=>{var Se=T;if(!(0<xe))return 0;var qe=ne;xe=ne+xe-1;for(var xt=0;xt<fe.length;++xt){var ut=fe.codePointAt(xt);if(127>=ut){if(ne>=xe)break;Se[ne++]=ut}else if(2047>=ut){if(ne+1>=xe)break;Se[ne++]=192|ut>>6,Se[ne++]=128|ut&63}else if(65535>=ut){if(ne+2>=xe)break;Se[ne++]=224|ut>>12,Se[ne++]=128|ut>>6&63,Se[ne++]=128|ut&63}else{if(ne+3>=xe)break;Se[ne++]=240|ut>>18,Se[ne++]=128|ut>>12&63,Se[ne++]=128|ut>>6&63,Se[ne++]=128|ut&63,xt++}}return Se[ne]=0,ne-qe},ys=fe=>{for(var ne=0,xe=0;xe<fe.length;++xe){var Se=fe.charCodeAt(xe);127>=Se?ne++:2047>=Se?ne+=2:55296<=Se&&57343>=Se?(ne+=4,++xe):ne+=3}return ne},Kg=new TextDecoder,oi=(fe,ne,xe,Se)=>{if(xe=ne+xe,Se)return xe;for(;fe[ne]&&!(ne>=xe);)++ne;return ne},Fs=new TextDecoder("utf-16le"),Bs=(fe,ne,xe)=>(fe>>=1,Fs.decode(E.subarray(fe,oi(E,fe,ne/2,xe)))),$a=(fe,ne,xe)=>{if(xe??(xe=2147483647),2>xe)return 0;xe-=2;var Se=ne;xe=xe<2*fe.length?xe/2:fe.length;for(var qe=0;qe<xe;++qe)C[ne>>1]=fe.charCodeAt(qe),ne+=2;return C[ne>>1]=0,ne-Se},ha=fe=>2*fe.length,Nf=(fe,ne,xe)=>{var Se="";fe>>=2;for(var qe=0;!(qe>=ne/4);qe++){var xt=D[fe+qe];if(!xt&&!xe)break;Se+=String.fromCodePoint(xt)}return Se},LA=(fe,ne,xe)=>{if(xe??(xe=2147483647),4>xe)return 0;var Se=ne;xe=Se+xe-4;for(var qe=0;qe<fe.length;++qe){var xt=fe.codePointAt(qe);if(65535<xt&&qe++,w[ne>>2]=xt,ne+=4,ne+4>xe)break}return w[ne>>2]=0,ne-Se},d7=fe=>{for(var ne=0,xe=0;xe<fe.length;++xe)65535<fe.codePointAt(xe)&&xe++,ne+=4;return ne},Lw=[],h7=fe=>{var ne=Lw.length;return Lw.push(fe),ne},m7=(fe,ne)=>{for(var xe=Array(fe),Se=0;Se<fe;++Se)xe[Se]=Mf(D[ne+4*Se>>2],`parameter ${Se}`);return xe},gm=(fe,ne,xe)=>{var Se=[];return fe=fe(Se,xe),Se.length&&(D[ne>>2]=Tr(Se)),fe},vT={},o0=fe=>{var ne=vT[fe];return ne===void 0?ye(fe):ne},Nw={},$g=()=>{var fe;if(!Fw){var ne={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(((fe=globalThis.navigator)==null?void 0:fe.language)??"C").replace("-","_")+".UTF-8",_:f||"./this.program"},xe;for(xe in Nw)Nw[xe]===void 0?delete ne[xe]:ne[xe]=Nw[xe];var Se=[];for(xe in ne)Se.push(`${xe}=${ne[xe]}`);Fw=Se}return Fw},Fw,XO=[null,[],[]];if((()=>{let fe=Ct.prototype;Object.assign(fe,{isAliasOf:function(xe){if(!(this instanceof Ct&&xe instanceof Ct))return!1;var Se=this.M.R.N,qe=this.M.P;xe.M=xe.M;var xt=xe.M.R.N;for(xe=xe.M.P;Se.W;)qe=Se.fa(qe),Se=Se.W;for(;xt.W;)xe=xt.fa(xe),xt=xt.W;return Se===xt&&qe===xe},clone:function(){if(this.M.P||yt(this),this.M.ea)return this.M.count.value+=1,this;var xe=We,Se=Object,qe=Se.create,xt=Object.getPrototypeOf(this),ut=this.M;return xe=xe(qe.call(Se,xt,{M:{value:{count:ut.count,da:ut.da,ea:ut.ea,P:ut.P,R:ut.R,V:ut.V,Y:ut.Y}}})),xe.M.count.value+=1,xe.M.da=!1,xe},delete(){if(this.M.P||yt(this),this.M.da&&!this.M.ea)throw new ve("Object already scheduled for deletion");we(this);var xe=this.M;--xe.count.value,xe.count.value===0&&(xe.V?xe.Y.Z(xe.V):xe.R.N.Z(xe.P)),this.M.ea||(this.M.V=void 0,this.M.P=void 0)},isDeleted:function(){return!this.M.P},deleteLater:function(){if(this.M.P||yt(this),this.M.da&&!this.M.ea)throw new ve("Object already scheduled for deletion");return this.M.da=!0,this}});let ne=Symbol.dispose;ne&&(fe[ne]=fe.delete)})(),Object.assign(ei.prototype,{wa(fe){return this.pa&&(fe=this.pa(fe)),fe},ma(fe){var ne;(ne=this.Z)==null||ne.call(this,fe)},X:J,O:function(fe){function ne(){return this.ha?ri(this.N.ba,{R:this.Ba,P:xe,Y:this,V:fe}):ri(this.N.ba,{R:this,P:fe})}var xe=this.wa(fe);if(!xe)return this.ma(fe),null;var Se=Wi(this.N,xe);if(Se!==void 0)return Se.M.count.value===0?(Se.M.P=xe,Se.M.V=fe,Se.clone()):(Se=Se.clone(),this.ma(fe),Se);if(Se=this.N.va(xe),Se=dn[Se],!Se)return ne.call(this);Se=this.ga?Se.sa:Se.pointerType;var qe=lr(xe,this.N,Se.N);return qe===null?ne.call(this):this.ha?ri(Se.N.ba,{R:Se,P:qe,Y:this,V:fe}):ri(Se.N.ba,{R:Se,P:qe})}}),o.print&&(p=o.print),o.printErr&&(g=o.printErr),o.thisProgram&&(f=o.thisProgram),o.preInit)for(typeof o.preInit=="function"&&(o.preInit=[o.preInit]);0<o.preInit.length;)o.preInit.shift()();var Bw,Jg,Ff,a0,s0,NA={y:()=>P(""),r:fe=>{var ne=Q[fe];delete Q[fe];var xe=ne.ka,Se=ne.Z,qe=ne.na,xt=qe.map(ut=>ut.za).concat(qe.map(ut=>ut.Fa));Ce([fe],xt,ut=>{var vt={},yn,Hn;for([yn,Hn]of qe.entries()){let un=ut[yn],Gr=Hn.xa,ft=Hn.ya,ge=ut[yn+qe.length],Ne=Hn.Ea,lt=Hn.Ga;vt[Hn.ua]={read:nn=>un.O(Gr(ft,nn)),write:(nn,En)=>{var On=[];Ne(lt,nn,ge.S(On,En)),q(On)},optional:un.optional}}return[{name:ne.name,O:un=>{var Gr={},ft;for(ft in vt)Gr[ft]=vt[ft].read(un);return Se(un),Gr},S:(un,Gr)=>{for(var ft in vt)if(!(ft in Gr||vt[ft].optional))throw new TypeError(`Missing field: "${ft}"`);var ge=xe();for(ft in vt)vt[ft].write(ge,Gr[ft]);return un!==null&&un.push(Se,ge),ge},X:J,T:Se}]})},o:(fe,ne,xe,Se,qe)=>{ne=ye(ne),Se=Se===0n;let xt=ut=>ut;if(Se){let ut=8*xe;xt=vt=>BigInt.asUintN(ut,vt),qe=xt(qe)}$e(fe,{name:ne,O:xt,S:(ut,vt)=>(typeof vt=="number"&&(vt=BigInt(vt)),vt),X:Ye(ne,xe,!Se),T:null})},C:(fe,ne,xe,Se)=>{ne=ye(ne),$e(fe,{name:ne,O:function(qe){return!!qe},S:function(qe,xt){return xt?xe:Se},X:function(qe){return this.O(T[qe])},T:null})},k:(fe,ne,xe,Se,qe,xt,ut,vt,yn,Hn,un,Gr,ft)=>{un=ye(un),xt=ti(qe,xt),vt&&(vt=ti(ut,vt)),Hn&&(Hn=ti(yn,Hn)),ft=ti(Gr,ft);var ge=Dt(un);bt(ge,function(){Ma(`Cannot construct ${un} due to unbound types`,[Se])}),Ce([fe,ne,xe],Se?[Se]:[],Ne=>{if(Ne=Ne[0],Se)var lt=Ne.N,nn=lt.ba;else nn=Ct.prototype;Ne=ct(un,function(...to){if(Object.getPrototypeOf(this)!==En)throw new ve(`Use 'new' to construct ${un}`);if(On.aa===void 0)throw new ve(`${un} has no accessible constructor`);var uc=On.aa[to.length];if(uc===void 0)throw new ve(`Tried to invoke ctor of ${un} with invalid number of parameters (${to.length}) - expected (${Object.keys(On.aa).toString()}) parameters instead!`);return uc.apply(this,to)});var En=Object.create(nn,{constructor:{value:Ne}});Ne.prototype=En;var On=new In(un,Ne,En,ft,lt,xt,vt,Hn);if(On.W){var ur;(ur=On.W).la??(ur.la=[]),On.W.la.push(On)}return lt=new ei(un,On,!0,!1,!1),ur=new ei(un+"*",On,!1,!1,!1),nn=new ei(un+" const*",On,!1,!0,!1),dn[fe]={pointerType:ur,sa:nn},vn(ge,Ne),[lt,ur,nn]})},g:(fe,ne,xe,Se,qe,xt)=>{var ut=Xa(ne,xe);qe=ti(Se,qe),Ce([],[fe],vt=>{vt=vt[0];var yn=`constructor ${vt.name}`;if(vt.N.aa===void 0&&(vt.N.aa=[]),vt.N.aa[ne-1]!==void 0)throw new ve(`Cannot register multiple constructors with identical number of parameters (${ne-1}) for class '${vt.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return vt.N.aa[ne-1]=()=>{Ma(`Cannot construct ${vt.name} due to unbound types`,ut)},Ce([],ut,Hn=>(Hn.splice(1,0,null),vt.N.aa[ne-1]=Qr(yn,Hn,null,qe,xt),[])),[]})},b:(fe,ne,xe,Se,qe,xt,ut,vt,yn)=>{var Hn=Xa(xe,Se);ne=ye(ne),ne=mi(ne),xt=ti(qe,xt),Ce([],[fe],un=>{function Gr(){Ma(`Cannot call ${ft} due to unbound types`,Hn)}un=un[0];var ft=`${un.name}.${ne}`;ne.startsWith("@@")&&(ne=Symbol[ne.substring(2)]),vt&&un.N.Ca.push(ne);var ge=un.N.ba,Ne=ge[ne];return Ne===void 0||Ne.U===void 0&&Ne.className!==un.name&&Ne.$===xe-2?(Gr.$=xe-2,Gr.className=un.name,ge[ne]=Gr):(Ht(ge,ne,ft),ge[ne].U[xe-2]=Gr),Ce([],Hn,lt=>(lt=Qr(ft,lt,un,xt,ut,yn),ge[ne].U===void 0?(lt.$=xe-2,ge[ne]=lt):ge[ne].U[xe-2]=lt,[])),[]})},A:fe=>$e(fe,da),s:(fe,ne,xe,Se,qe)=>{switch(ne=ye(ne),qe=qe===0?"object":qe===1?"number":"string",qe){case"object":let ut=function(){};ut.values={},$e(fe,{name:ne,constructor:ut,valueType:qe,O:function(vt){return this.constructor.values[vt]},S:(vt,yn)=>yn.value,X:Co(ne,xe,Se),T:null}),bt(ne,ut);break;case"number":var xt={};$e(fe,{name:ne,ja:xt,valueType:qe,O:vt=>vt,S:(vt,yn)=>yn,X:Co(ne,xe,Se),T:null}),bt(ne,xt),delete o[ne].$;break;case"string":xt={},$e(fe,{name:ne,ra:{},qa:{},ja:xt,valueType:qe,O:function(vt){return this.qa[vt]},S:function(vt,yn){return this.ra[yn]},X:Co(ne,xe,Se),T:null}),bt(ne,xt),delete o[ne].$}},d:(fe,ne,xe)=>{var Se=Mf(fe,"enum");switch(ne=ye(ne),Se.valueType){case"object":fe=Se.constructor,Se=Object.create(Se.constructor.prototype,{value:{value:xe},constructor:{value:ct(`${Se.name}_${ne}`,function(){})}}),fe.values[xe]=Se,fe[ne]=Se;break;case"number":Se.ja[ne]=xe;break;case"string":Se.ra[ne]=xe,Se.qa[xe]=ne,Se.ja[ne]=ne}},n:(fe,ne,xe)=>{ne=ye(ne),$e(fe,{name:ne,O:Se=>Se,S:(Se,qe)=>qe,X:Lf(ne,xe),T:null})},m:(fe,ne,xe,Se,qe,xt,ut)=>{var vt=Xa(ne,xe);fe=ye(fe),fe=mi(fe),qe=ti(Se,qe),bt(fe,function(){Ma(`Cannot call ${fe} due to unbound types`,vt)},ne-1),Ce([],vt,yn=>(yn=[yn[0],null].concat(yn.slice(1)),vn(fe,Qr(fe,yn,null,qe,xt,ut),ne-1),[]))},c:(fe,ne,xe,Se,qe)=>{ne=ye(ne);let xt=vt=>vt;if(Se===0){var ut=32-8*xe;xt=vt=>vt<<ut>>>ut,qe=xt(qe)}$e(fe,{name:ne,O:xt,S:(vt,yn)=>yn,X:Ye(ne,xe,Se!==0),T:null})},j:(fe,ne,xe,Se)=>{xe=ye(xe),Se=ye(Se),Ce([],[fe,ne],qe=>(lc(qe[0].N.ba,xe,Se),[]))},a:(fe,ne,xe)=>{function Se(xt){return new qe(x.buffer,D[xt+4>>2],D[xt>>2])}var qe=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][ne];xe=ye(xe),$e(fe,{name:xe,O:Se,X:Se},{Aa:!0})},h:fe=>{$e(fe,Xg)},B:(fe,ne)=>{ne=ye(ne),$e(fe,{name:ne,O(xe){var Se=(Se=xe+4)?Kg.decode(T.subarray(Se,oi(T,Se,D[xe>>2],!0))):"";return Ff(xe),Se},S(xe,Se){Se instanceof ArrayBuffer&&(Se=new Uint8Array(Se));var qe=typeof Se=="string";if(!(qe||ArrayBuffer.isView(Se)&&Se.BYTES_PER_ELEMENT==1))throw new ve("Cannot pass non-string to std::string");var xt=qe?ys(Se):Se.length,ut=Jg(4+xt+1),vt=ut+4;return D[ut>>2]=xt,qe?vo(Se,vt,xt+1):T.set(Se,vt),xe!==null&&xe.push(Ff,ut),ut},X:J,T(xe){Ff(xe)}})},f:(fe,ne,xe)=>{if(xe=ye(xe),ne===2)var Se=Bs,qe=$a,xt=ha;else Se=Nf,qe=LA,xt=d7;$e(fe,{name:xe,O:ut=>{var vt=Se(ut+4,D[ut>>2]*ne,!0);return Ff(ut),vt},S:(ut,vt)=>{if(typeof vt!="string")throw new ve(`Cannot pass non-string to C++ string type ${xe}`);var yn=xt(vt),Hn=Jg(4+yn+ne);return D[Hn>>2]=yn/ne,qe(vt,Hn+4,yn+ne),ut!==null&&ut.push(Ff,Hn),Hn},X:J,T(ut){Ff(ut)}})},i:(fe,ne,xe,Se,qe,xt)=>{Q[fe]={name:ye(ne),ka:ti(xe,Se),Z:ti(qe,xt),na:[]}},e:(fe,ne,xe,Se,qe,xt,ut,vt,yn,Hn)=>{Q[fe].na.push({ua:ye(ne),za:xe,xa:ti(Se,qe),ya:xt,Fa:ut,Ea:ti(vt,yn),Ga:Hn})},D:(fe,ne)=>{ne=ye(ne),$e(fe,{oa:!0,name:ne,O:()=>{},S:()=>{}})},q:(fe,ne,xe)=>{var[Se,...qe]=m7(fe,ne);ne=Se.S.bind(Se);var xt=qe.map(yn=>yn.X.bind(yn));fe--;var ut={toValue:Ri};switch(fe=xt.map((yn,Hn)=>{var un=`argFromPtr${Hn}`;return ut[un]=yn,`${un}(args${Hn?"+"+8*Hn:""})`}),xe){case 0:var vt="toValue(handle)";break;case 2:vt="new (toValue(handle))";break;case 3:vt="";break;case 1:ut.getStringOrSymbol=o0,vt="toValue(handle)[getStringOrSymbol(methodName)]"}return vt+=`(${fe})`,Se.oa||(ut.toReturnWire=ne,ut.emval_returnValue=gm,vt=`return emval_returnValue(toReturnWire, destructorsRef, ${vt})`),vt=`return function (handle, methodName, destructorsRef, args) {
|
|
${vt}
|
|
}`,xe=new Function(Object.keys(ut),vt)(...Object.values(ut)),vt=`methodCaller<(${qe.map(yn=>yn.name)}) => ${Se.name}>`,h7(ct(vt,xe))},F:Mo,p:(fe,ne,xe,Se,qe)=>Lw[fe](ne,xe,Se,qe),E:fe=>{var ne=Ri(fe);q(ne),Mo(fe)},t:(fe,ne,xe,Se)=>{var qe=new Date().getFullYear(),xt=new Date(qe,0,1).getTimezoneOffset();qe=new Date(qe,6,1).getTimezoneOffset(),D[fe>>2]=60*Math.max(xt,qe),w[ne>>2]=+(xt!=qe),ne=ut=>{var vt=Math.abs(ut);return`UTC${0<=ut?"-":"+"}${String(Math.floor(vt/60)).padStart(2,"0")}${String(vt%60).padStart(2,"0")}`},fe=ne(xt),ne=ne(qe),qe<xt?(vo(fe,xe,17),vo(ne,Se,17)):(vo(fe,Se,17),vo(ne,xe,17))},z:fe=>{var ne=T.length;if(fe>>>=0,2147483648<fe)return!1;for(var xe=1;4>=xe;xe*=2){var Se=ne*(1+.2/xe);Se=Math.min(Se,fe+100663296);e:{Se=(Math.min(2147483648,65536*Math.ceil(Math.max(fe,Se)/65536))-a0.buffer.byteLength+65535)/65536|0;try{a0.grow(Se),S();var qe=1;break e}catch{}qe=void 0}if(qe)return!0}return!1},u:(fe,ne)=>{var xe=0,Se=0,qe;for(qe of $g()){var xt=ne+xe;D[fe+Se>>2]=xt,xe+=vo(qe,xt,1/0)+1,Se+=4}return 0},v:(fe,ne)=>{var xe=$g();D[fe>>2]=xe.length,fe=0;for(var Se of xe)fe+=ys(Se)+1;return D[ne>>2]=fe,0},w:()=>52,x:function(){return 70},l:(fe,ne,xe,Se)=>{for(var qe=0,xt=0;xt<xe;xt++){var ut=D[ne>>2],vt=D[ne+4>>2];ne+=8;for(var yn=0;yn<vt;yn++){var Hn=fe,un=T[ut+yn],Gr=XO[Hn];un===0||un===10?(Hn=Hn===1?p:g,un=oi(Gr,0),un=Kg.decode(Gr.buffer?Gr.subarray(0,un):new Uint8Array(Gr.slice(0,un))),Hn(un),Gr.length=0):Gr.push(un)}qe+=vt}return D[Se>>2]=qe,0}},sl;return sl=await(async function(){function fe(xe){return xe=sl=xe.exports,Bw=xe.J,Jg=o._malloc=xe.K,Ff=o._free=xe.L,a0=xe.G,s0=xe.I,S(),sl}var ne={a:NA};return o.instantiateWasm?new Promise(xe=>{o.instantiateWasm(ne,(Se,qe)=>{xe(fe(Se))})}):(L??(L=y(`\0asm\0\0\0\xD79\`\x7F\x7F\`\x7F\x7F\0\`\x7F\x7F\x7F\x7F\`\x7F\x7F\x7F\`\x7F\0\`\x7F\x7F\x7F\x7F\x7F\x7F\x7F\`\x7F\x7F\x7F\x7F\x7F\`\x7F\x7F\x7F\0\`\x7F\x7F\x7F\x7F\0\`\x7F\x7F\x7F\x7F\x7F\x7F\`\x7F\x7F\x7F\x7F\x7F\0\`\x7F\x7F\x7F\x7F\x7F\x7F\0\`\b\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\`\0\0\`\x07\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\`\x7F~~~~\0\`\0\x7F\`
|
|
\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\0\`\x07\x7F\x7F\x7F\x7F\x7F\x7F\x7F\0\`\x7F\x7F\x7F\x7F~\x7F\`\b\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\0\`\x7F~~\x7F\0\`\x7F~\x7F~\`\x7F\x7F~\x7F\x7F\0\`
|
|
\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\`\f\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\`\x7F\x7F\x7F~\`\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\0\`\v\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\`\x7F\x7F\x7F\x7F~\`\x7F|\x7F\x7F\x7F\x7F\x7F\`\x07\x7F\x7F\x7F\x7F\x7F~~\x7F\`\x7F\x7F\x7F\x7F~~\x7F\`\x7F\x7F\x7F\x7F|\x7F\`\r\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\0\`\x7F\x7F\x7F~~\0\`\x7F\x7F\x7F\x7F\x7F|\`\x7F~\x7F\x7F\x7F\`\x7F~\0\`\x7F|\0\`~~~~\x7F\`~\x7F\x7F\`\x7F\x7F\x7F~\x7F\0\`\x7F\x7F\x7F~~\`~~|\`\x7F|\`\x7F\x7F\x7F|\`\x7F\x7F\x7F}\`\x7F\x7F~\0\`~~}\`\x7F\x7F~\`\x7F~~~\0\`~~~\x7F\`|\x7F|\`\x7F\x7F\x7F}\x7F\`\x7F\x7F\x7F}\0\`\x7F\x7F}\0\xC1 aa\0\x07ab\0ac\0
|
|
ad\0\x07ae\0af\0\x07ag\0\vah\0ai\0\vaj\0\bak\0"al\0am\0an\0\x07ao\0#ap\0$aq\0ar\0as\0
|
|
at\0\bau\0av\0aw\0\0ax\0%ay\0\raz\0\0aA\0aB\0aC\0\baD\0aE\0aF\0\x8D\x8B\0\0\0\0\r\x07\0\b
|
|
\0\0\0\0\0\0\0\0\0\0\0&\0\0 \0\0\0'\0\f\f\0\r(\x07\r\x07\0\0\0\0\0)\0 \x07\x07\0\r
|
|
\0\0\0*
|
|
\r\0\0
|
|
\v\b\x07\0\0
|
|
|
|
\b\0+\0\0,\x07-\0\r\0\x07\b\0\x07\b\x07\x07\x07\0\0 \f\f \f\f\0 \f\0\0\0\x1B\x1B\0\0
|
|
\0\0\x07\v
|
|
\v\v
|
|
\v\v\0\r\b./\x07\0012\b34\0 \0\0\0\0\0\0\b\0\b\0 5\0\b\x07678\x07\x07\v\v\v
|
|
|
|
|
|
\b\b\b\x07\0\0\0\0\0\0\0\0\0\0\0\x07\0\0\0\0\0\0\0\0\0\0 \0 \f\f\x07 \0 \x07\v\v\0\f\f ! ! \0\b\b \b \0\0\b\0\0\0\0\0\0\0\0\0\0\b\0\r\x07p\xFD\xFD\x07\x82\x80\x80\b\x7FA\xC0\xEC\v\x07\x1BG\0H\0\xAAI\0J\0\xD4K\0/L\0! \xAE\0A\v\xFC\x95\xF3\xEF\xD4\xCD\xC9\x81\xFA\xBE\xB7\xAE\xA5\x9D\x9B\x81\xFA\x91\x87\xFC\xF1\xEF\xEE\xEA\xD8\xD7\xE1\xE0\xDF\xDE\xDD,\xD8\xD7\xD5\xDC\xDB\xD3\xDA\xD9\xD5\xD8\xD7\xD3\xD6\xD5\xCC\xD3\xD28\xA9\xA8\xA7\xA6\xC3\xA3\xC2\xA2\xA1\xA088\x9F\x9E\x9D\xC6\x9C\xC6\xB0\x8C\x8D\x8B\x90\x8F\x8E\x81\xC0\x8A\x89\x88\x87\x95\xC1\x94\x92\x93\x91\x9B\xC5\x9A\x99\x98\xC1\x97\x96K\x86\x85\x84\xA0!\xF2\x8D\x8B\x89\x86\x84\x82\x80\xFE\xFB\xF9\xF7\xF5\xF3\xF0\xF5\xBD\xBC\xF0\xAF\xAD\xAC\xAB\xAA\xF1\xA9\xA8\xA7\xF6\xA4\xA3\xA2\xA1\xA08\x9F\x9E\xE6\x9C\x99\x97\x95\x93\x90\xE5\x9A\x98\x96\x94\x92\x8Fq,,\xBB\xBA\xB9\xB8\xB6\xB5\xB4\xB3\xF1\xB2\xB1\xB0,\xEF\xEF{\xA1\xA1\xA6\xA1,\xEC\xEB{88\xEA\x8B,\xEC\xEB{88\xEA\x8B,\xE9\xE8{88\xE7\x8B,\xE9\xE8{88\xE7\x8Bq,\x83\x82\x81q,\x80\xFF\xFE,\xFD\xFC\xFB\xFA\x9E\x9E\xF9\xF8\xF7\xF6\xF5,\xF4\xF2\xF1\xF0\x97\x97\xEE\xED\xEC\xEB\xEA,\xE9\xE8\xE7\xE6\xE5\xE4\xE3\xE2,\xE1\xE0\xDF\xDE\xDD\xDC\xDB\xDAq,\x8F\xD9\xD8\xD7\xD6\xD5\xD3\x8E\x8A\x85\xF8\xF4\x81\xFDq,\x8F\xD2\xD1\xD0\xCF\xCE\xCC\x8C\x88\x83\xF6\xF2\xFF\xFA\xAE\xE4\xCB\xAE\xE4\xCA,\x8E\x8EFFF\x878[[,\x8E\x8EFFF\x878[[,\x8D\x8DFFF\x868[[,\x8D\x8DFFF\x868[[,\xC8\xC7,\xC6\xC5,\xC4\xC3,\xC2\xC1,\xF7\xC0\xC2,\xF7\xBF\xC2\xA4\xA5q,\xA0\xA0\xDB,\xDB,\xED\xE2\xE5\xEC,\xE3\xE6\xEB,\xE4\xE7\xE9,\xE8\f(
|
|
\xC9\xCB\b\x8B\0 \0,\0\vA\0H@ \0(\b \0(\0!\v \0\v\x82\f\b\x7F@ \0E\r\0 \0A\bk" \0Ak(\0"Axq"\0j!@ Aq\r\0 AqE\r (\0"k"A\x8C\xD8(\0I\r \0 j!\0@@@A\x90\xD8(\0 G@ (\f! A\xFFM@ (\b"G\rA\xFC\xD7A\xFC\xD7(\0A~ Avwq6\0\f\v (!\x07 G@ (\b" 6\f 6\b\f\v ("\x7F Aj ("E\r Aj\v!@ ! "Aj! ("\r\0 Aj! ("\r\0\v A\x006\0\f\v ("AqAG\rA\x84\xD8 \x006\0 A~q6 \0Ar6 \x006\0\v 6\f 6\b\f\vA\0!\v \x07E\r\0@ ("At"(\xAC\xDA F@ A\xAC\xDAj 6\0 \rA\x80\xD8A\x80\xD8(\0A~ wq6\0\f\v@ \x07(F@ \x07 6\f\v \x07 6\v E\r\v \x076 ("@ 6 6\v ("E\r\0 6 6\v O\r\0 ("AqE\r\0@@@@ AqE@A\x94\xD8(\0 F@A\x94\xD8 6\0A\x88\xD8A\x88\xD8(\0 \0j"\x006\0 \0Ar6 A\x90\xD8(\0G\rA\x84\xD8A\x006\0A\x90\xD8A\x006\0\vA\x90\xD8(\0"\x07 F@A\x90\xD8 6\0A\x84\xD8A\x84\xD8(\0 \0j"\x006\0 \0Ar6 \0 j \x006\0\v Axq \0j!\0 (\f! A\xFFM@ (\b" F@A\xFC\xD7A\xFC\xD7(\0A~ Avwq6\0\f\v 6\f 6\b\f\v (!\b G@ (\b" 6\f 6\b\f\v ("\x7F Aj ("E\r Aj\v!@ ! "Aj! ("\r\0 Aj! ("\r\0\v A\x006\0\f\v A~q6 \0Ar6 \0 j \x006\0\f\vA\0!\v \bE\r\0@ ("At"(\xAC\xDA F@ A\xAC\xDAj 6\0 \rA\x80\xD8A\x80\xD8(\0A~ wq6\0\f\v@ \b(F@ \b 6\f\v \b 6\v E\r\v \b6 ("@ 6 6\v ("E\r\0 6 6\v \0Ar6 \0 j \x006\0 \x07G\r\0A\x84\xD8 \x006\0\v \0A\xFFM@ \0A\xF8qA\xA4\xD8j!\x7FA\xFC\xD7(\0"A \0Avt"\0qE@A\xFC\xD7 \0 r6\0 \f\v (\b\v!\0 6\b \0 6\f 6\f \x006\b\vA! \0A\xFF\xFF\xFF\x07M@ \0A& \0A\bvg"kvAq AtrA>s!\v 6 B\x007 AtA\xAC\xDAj!\x7F@\x7FA\x80\xD8(\0"A t"qE@A\x80\xD8 r6\0 6\0A!A\b\f\v \0A AvkA\0 AG\x1Bt! (\0!@ "(Axq \0F\r Av! At! Aqj"("\r\0\v 6A! !A\b\v!\0 "\f\v (\b" 6\f 6\bA!\0A\b!A\0\v! j 6\0 6\f \0 j 6\0A\x9C\xD8A\x9C\xD8(\0Ak"\0A\x7F \0\x1B6\0\v\v\xA0\x7F \0( \0,\0\v" A\0H\x1B" I@ k"@\x7F \0(\b"A\xFF\xFF\xFF\xFF\x07qAkA
|
|
\0,\0\v"A\0H"\x1B" \0( \x1B"kM@ Av\f\v \0 j k \xA4 \0-\0\v\v! \0(\0 \0 \xC0A\0H\x1B" j! !@ @ A\0:\0\0 Ak! Aj!\f\v\v j!@ \0,\0\vA\0H@ \0 6\f\v \0 A\xFF\0q:\0\v\v jA\0:\0\0\v\v@ \0,\0\vA\0H@ \0 6 \0(\0!\0\f\v \0 A\xFF\0q:\0\v\v \0 jA\0:\0\0\v0\x7F@ \0A\xEC\xDEF\r\0 \0 \0("Ak6 \r\0 \0 \0(\0(\b\0\v\v%\0 \0 ("\x006\0 \0A\xEC\xDEG@ \0 \0(Aj6\v\v\x8B\x7F~@ \0)p"PE \0)x \0(" \0(,"k\xAC|"WqE@#\0Ak"$\0A\x7F!@ \0\xC8\r\0 \0 AjA \0( \0AG\r\0 -\0!\v Aj$\0 "A\0N\r \0(! \0(,!\v \0B\x7F7p \0 6h \0 k\xAC|7xA\x7F\v B|! \0(! \0(\b!@ \0)p"P\r\0 }" k\xACY\r\0 \xA7j!\v \0 6h \0 \0(,"\0 k\xAC|7x \0 O@ Ak :\0\0\v \v\xB1\x7F@ \xA5" \0(\b"A\xFF\xFF\xFF\xFF\x07qAkA \0,\0\v"A\0H"\x1B"M@ \0(\0 \0 \x1B!@ \x7F At"@ \xFC
|
|
\0\0\v \0,\0\v Av\v\xC0A\0H@ \0 6\f\v \0 A\xFF\0q:\0\v\v AtjA\x006\0\f\v \0 k \0( \x1B"\0A\0 \0 \xDE\v\v\r\0 \0 y\xE0\v\0 \0\xBC \xBCsAs\v\0 \0\xBD \xBDsAs\v\xE5\x7FA\xE8\xDE-\0\0@A\xE4\xDE(\0\v#\0A k"$\0@@@ A\bj" \0At"j\x7FA \0tA\xFF\xFF\xFF\xFF\x07q"ArE@ (\0\f\v \0A\xAFA\xD7 \x1B\xBB\v"6\0 A\x7FF\r \0Aj"\0AG\r\0\vA\0\xBAE@A\xF8\xFC\0! A\xF8\xFC\0AhE\rA\x90\xFD\0! A\x90\xFD\0AhE\rA\0!\0A\xA8\xDC-\0\0E@@ \0At \0A\xD7\xBB6\xF8\xDB \0Aj"\0AG\r\0\vA\xA8\xDCA:\0\0A\x90\xDCA\xF8\xDB(\x006\0\vA\xF8\xDB! A\bj"\0A\xF8\xDBAhE\rA\x90\xDC! \0A\x90\xDCAhE\rA/"E\r\v )7 )7\b )\b7\0\f\vA\0!\v A j$\0A\xE8\xDEA:\0\0A\xE4\xDE 6\0 \v\xCB
|
|
\x7F ~#\0A\xE0\0k"$\0 B\xFF\xFF\xFF\xFF\xFF\xFF?\x83!
|
|
\x85B\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7F\x83!\v B\xFF\xFF\xFF\xFF\xFF\xFF?\x83"\fB \x88! B0\x88\xA7A\xFF\xFFq!\x07@@ B0\x88\xA7A\xFF\xFFq" A\xFF\xFFkA\x82\x80~O@ \x07A\xFF\xFFkA\x81\x80~K\r\v P B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\x83"\rB\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0T \rB\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0Q\x1BE@ B\x80\x80\x80\x80\x80\x80 \x84!\v\f\v P B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\x83"B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0T B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0Q\x1BE@ B\x80\x80\x80\x80\x80\x80 \x84!\v !\f\v \rB\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x85\x84P@ \x84P@B\x80\x80\x80\x80\x80\x80\xE0\xFF\xFF\0!\vB\0!\f\v \vB\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x84!\vB\0!\f\v B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x85\x84P@ \r\x84B\0!P@B\x80\x80\x80\x80\x80\x80\xE0\xFF\xFF\0!\v\f\v \vB\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x84!\v\f\v \r\x84P@B\0!\f\v \x84P@B\0!\f\v \rB\xFF\xFF\xFF\xFF\xFF\xFF?X@ A\xD0\0j \f \f \fP"\x1ByB\xC0\0B\0 \x1B|\xA7"Ak6A k! )X"\fB \x88! )P!\v B\xFF\xFF\xFF\xFF\xFF\xFF?V\r\0 A@k
|
|
|
|
|
|
P"\b\x1ByB\xC0\0B\0 \b\x1B|\xA7"\bAk6 \bkAj! )H!
|
|
)@!\v \x07 j jA\xFF\xFF\0k!@
|
|
B\x86"B \x88B\x80\x80\x80\x80\b\x84" B \x88"~" B\x86"B \x88"
|
|
B\x80\x80\x84"\r~|" T\xAD B1\x88 \x84B\xFF\xFF\xFF\xFF\x83" \fB\xFF\xFF\xFF\xFF\x83"\f~|" T\xAD| \r~| B\x80\x80\xFE\xFF\x83" \f~"
|
|
~|" T\xAD B\xFF\xFF\xFF\xFF\x83"~|"V\xAD||"V\xAD| \r~" \f~|" T\xADB \x86 B \x88\x84| B \x86|"V\xAD| \r ~"\r
|
|
\f~|"\f ~|" ~|"B \x88 V\xAD \f \rT\xAD \fT\xAD||B \x86\x84|" T\xAD| ~"\f
|
|
~|"B \x88 \fT\xADB \x86\x84|"
|
|
T\xAD
|
|
B \x86|"
|
|
T\xAD||"
|
|
T\xAD|
|
|
B \x86" ~|" T\xAD|" T\xAD|"
|
|
T\xAD|"B\x80\x80\x80\x80\x80\x80\xC0\0\x83PE@ Aj!\f\v B?\x88 B\x86 B?\x88\x84! B\x86 B?\x88\x84! B\x86! B\x86\x84!\v A\xFF\xFFN@ \vB\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x84!\vB\0!\f\v~ A\0L@A k"\x07A\xFF\0M@ A0j A\xFF\0j"6 A j 6 Aj \x07g \x07g )0 )8\x84B\0R\xAD ) )\x84\x84! )( )\x84! )\0! )\b\f\vB\0!\f\v B\xFF\xFF\xFF\xFF\xFF\xFF?\x83 \xADB0\x86\x84\v \v\x84!\v P B\0Y B\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7FQ\x1BE@ \v B|"P\xAD|!\v\f\v B\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7F\x85\x84PE@ !\f\v \v B\x83|" T\xAD|!\v\v \0 7\0 \0 \v7\b A\xE0\0j$\0\v\0 \0!\vr\x7F#\0Ak"$\0 \x006 \0(\0A\x7FG@ Aj6\f A\fj6\b A\bj!@ \0(\0AF\r\0\v \0(\0E@ \0A6\0 \xF2 \0A\x7F6\0\v\v \0( Aj$\0Ak\v\xB2\x7F#\0Ak"$\0 \0 \0(Aj6 \x006\f@A\xF8\xDE(\0A\xF4\xDE(\0"\0kAu M\x7F@ Aj"\0A\xF8\xDE(\0A\xF4\xDE(\0"kAu"K@#\0A k"\x07$\0@ \0 k"A\xFC\xDE(\0A\xF8\xDE(\0"kAuM@A\xF4\xDE \xB9\f\v A\xF4\xDE(\0kAu j"\0A\x80\x80\x80\x80O@0\0\vA\xFF\xFF\xFF\xFFA\xFC\xDE(\0A\xF4\xDE(\0k"Au" \0 \0 I\x1B A\xFC\xFF\xFF\xFF\x07O\x1B!A\xF8\xDE(\0A\xF4\xDE(\0kAu!A\0! \x07A\fj"\0A\x80\xDF6 \0A\x006\f @A\x80\xDF \xE3!\v \0 6\0 \0 Atj"6\b \0 Atj6\f \0 6 \0 \xCFA\xF4\xDE \0\x96 \0\xD4 \0(\0"@ \0(\f \0( \xE2\v\v \x07A j$\0\f\v \0 I@A\xF8\xDE \0Atj6\0\v\vA\xF4\xDE(\0 \0\v Atj(\0"\0E\r\0 \0 \0("Ak6 \r\0 \0 \0(\0(\b\0\v (\f!\0 A\x006\fA\xF4\xDE(\0 Atj \x006\0 (\f!\0 A\x006\f@ \0E\r\0 \0 \0("Ak6 \r\0 \0 \0(\0(\b\0\v Aj$\0\v\xBC(\v\x7F#\0Ak"
|
|
$\0@@@@@@@@@@ \0A\xF4M@A\xFC\xD7(\0"A \0A\vjA\xF8q \0A\vI\x1B"Av"\0v"Aq@@ A\x7FsAq \0j"At"A\xA4\xD8j"\0 (\xAC\xD8"(\b"F@A\xFC\xD7 A~ wq6\0\f\v \x006\f \0 6\b\v A\bj!\0 Ar6 j" (Ar6\f\v\v A\x84\xD8(\0"\bM\r @@A \0t"A\0 kr \0tqh"At"A\xA4\xD8j" (\xAC\xD8"\0(\b"F@A\xFC\xD7 A~ wq"6\0\f\v 6\f 6\b\v \0 Ar6 \0 j"\x07 k"Ar6 \0 j 6\0 \b@ \bAxqA\xA4\xD8j!A\x90\xD8(\0!\x7F A \bAvt"qE@A\xFC\xD7 r6\0 \f\v (\b\v! 6\b 6\f 6\f 6\b\v \0A\bj!\0A\x90\xD8 \x076\0A\x84\xD8 6\0\f\v\vA\x80\xD8(\0"\vE\r \vhAt(\xAC\xDA"(Axq k! !@@ ("\0E@ ("\0E\r\v \0(Axq k" I"\x1B! \0 \x1B! \0!\f\v\v (! (\f"\0G@ (\b" \x006\f \0 6\b\f
|
|
\v ("\x7F Aj ("E\r Aj\v!@ !\x07 "\0Aj! \0("\r\0 \0Aj! \0("\r\0\v \x07A\x006\0\f \vA\x7F! \0A\xBF\x7FK\r\0 \0A\vj"Axq!A\x80\xD8(\0"\x07E\r\0A!\bA\0 k! \0A\xF4\xFF\xFF\x07M@ A& A\bvg"\0kvAq \0AtkA>j!\b\v@@@ \bAt(\xAC\xDA"E@A\0!\0\f\vA\0!\0 A \bAvkA\0 \bAG\x1Bt!@@ (Axq k" O\r\0 ! "\r\0A\0! !\0\f\v \0 (" AvAqj("F\x1B \0 \x1B!\0 At! \r\0\v\v \0 rE@A\0!A \bt"\0A\0 \0kr \x07q"\0E\r \0hAt(\xAC\xDA!\0\v \0E\r\v@ \0(Axq k" I! \x1B! \0 \x1B! \0("\x7F \0(\v"\0\r\0\v\v E\r\0 A\x84\xD8(\0 kO\r\0 (!\b (\f"\0G@ (\b" \x006\f \0 6\b\f\b\v ("\x7F Aj ("E\r Aj\v!@ ! "\0Aj! \0("\r\0 \0Aj! \0("\r\0\v A\x006\0\f\x07\v A\x84\xD8(\0"M@A\x90\xD8(\0!\0@ k"AO@ \0 j" Ar6 \0 j 6\0 \0 Ar6\f\v \0 Ar6 \0 j" (Ar6A\0!A\0!\vA\x84\xD8 6\0A\x90\xD8 6\0 \0A\bj!\0\f \v A\x88\xD8(\0"I@A\x88\xD8 k"6\0A\x94\xD8A\x94\xD8(\0"\0 j"6\0 Ar6 \0 Ar6 \0A\bj!\0\f \vA\0!\0 A/j"\x7FA\xD4\xDB(\0@A\xDC\xDB(\0\f\vA\xE0\xDBB\x7F7\0A\xD8\xDBB\x80\xA0\x80\x80\x80\x807\0A\xD4\xDB
|
|
A\fjApqA\xD8\xAA\xD5\xAAs6\0A\xE8\xDBA\x006\0A\xB8\xDBA\x006\0A\x80 \v"j"A\0 k"\x07q" M\r\bA\xB4\xDB(\0"@A\xAC\xDB(\0"\b j" \bM Ir\r \v@A\xB8\xDB-\0\0AqE@@@@@A\x94\xD8(\0"@A\xBC\xDB!\0@ \0(\0"\b M@ \b \0(jI\r\v \0(\b"\0\r\0\v\vA\0v"A\x7FF\r !A\xD8\xDB(\0"\0Ak" q@ k jA\0 \0kqj!\v M\rA\xB4\xDB(\0"\0@A\xAC\xDB(\0" j"\x07 M \0 \x07Ir\r\v v"\0 G\r\f\v k \x07q"v" \0(\0 \0(jF\r !\0\v \0A\x7FF\r A0j M@ \0!\f\vA\xDC\xDB(\0" kjA\0 kq"vA\x7FF\r j! \0!\f\v A\x7FG\r\vA\xB8\xDBA\xB8\xDB(\0Ar6\0\v v"A\x7FFA\0v"\0A\x7FFr \0 Mr\r \0 k" A(jM\r\vA\xAC\xDBA\xAC\xDB(\0 j"\x006\0A\xB0\xDB(\0 \0I@A\xB0\xDB \x006\0\v@A\x94\xD8(\0"@A\xBC\xDB!\0@ \0(\0" \0("jF\r \0(\b"\0\r\0\v\f\vA\x8C\xD8(\0"\0A\0 \0 M\x1BE@A\x8C\xD8 6\0\vA\0!\0A\xC0\xDB 6\0A\xBC\xDB 6\0A\x9C\xD8A\x7F6\0A\xA0\xD8A\xD4\xDB(\x006\0A\xC8\xDBA\x006\0@ \0At" A\xA4\xD8j"6\xAC\xD8 6\xB0\xD8 \0Aj"\0A G\r\0\vA\x88\xD8 A(k"\0Ax kA\x07q"k"6\0A\x94\xD8 j"6\0 Ar6 \0 jA(6A\x98\xD8A\xE4\xDB(\x006\0\f\v M Kr\r \0(\fA\bq\r \0 j6A\x94\xD8 Ax kA\x07q"\0j"6\0A\x88\xD8A\x88\xD8(\0 j" \0k"\x006\0 \0Ar6 jA(6A\x98\xD8A\xE4\xDB(\x006\0\f\vA\0!\0\f\vA\0!\0\f\vA\x8C\xD8(\0 K@A\x8C\xD8 6\0\v j!A\xBC\xDB!\0@@ \0(\0"G@ \0(\b"\0\r\f\v\v \0-\0\fA\bqE\r\vA\xBC\xDB!\0@@ \0(\0" M@ \0(j"I\r\v \0(\b!\0\f\v\vA\x88\xD8 A(k"\0Ax kA\x07q"k"\x076\0A\x94\xD8 j"6\0 \x07Ar6 \0 jA(6A\x98\xD8A\xE4\xDB(\x006\0 A' kA\x07qjA/k"\0 \0 AjI\x1B"A\x1B6 A\xC4\xDB)\x007 A\xBC\xDB)\x007\bA\xC4\xDB A\bj6\0A\xC0\xDB 6\0A\xBC\xDB 6\0A\xC8\xDBA\x006\0 Aj!\0@ \0A\x076 \0A\bj \0Aj!\0 I\r\0\v F\r\0 (A~q6 k"Ar6 6\0\x7F A\xFFM@ A\xF8qA\xA4\xD8j!\0\x7FA\xFC\xD7(\0"A Avt"qE@A\xFC\xD7 r6\0 \0\f\v \0(\b\v! \0 6\b 6\fA\f!A\b\f\vA!\0 A\xFF\xFF\xFF\x07M@ A& A\bvg"\0kvAq \0AtrA>s!\0\v \x006 B\x007 \0AtA\xAC\xDAj!@@A\x80\xD8(\0"A \0t"qE@A\x80\xD8 r6\0 6\0\f\v A \0AvkA\0 \0AG\x1Bt!\0 (\0!@ "(Axq F\r \0Av! \0At!\0 Aqj"("\r\0\v 6\v 6A\b! "!\0A\f\f\v (\b"\0 6\f 6\b \x006\bA\0!\0A!A\f\v j 6\0 j \x006\0\vA\x88\xD8(\0"\0 M\r\0A\x88\xD8 \0 k"6\0A\x94\xD8A\x94\xD8(\0"\0 j"6\0 Ar6 \0 Ar6 \0A\bj!\0\f\vA\xF8\xD7A06\0A\0!\0\f\v \0 6\0 \0 \0( j6 Ax kA\x07qj"\b Ar6 Ax kA\x07qj" \bj"k!\x07@A\x94\xD8(\0 F@A\x94\xD8 6\0A\x88\xD8A\x88\xD8(\0 \x07j"\x006\0 \0Ar6\f\vA\x90\xD8(\0 F@A\x90\xD8 6\0A\x84\xD8A\x84\xD8(\0 \x07j"\x006\0 \0Ar6 \0 j \x006\0\f\v ("\0AqAF@ \0Axq! (\f!@ \0A\xFFM@ (\b" F@A\xFC\xD7A\xFC\xD7(\0A~ \0Avwq6\0\f\v 6\f 6\b\f\v (!@ G@ (\b"\0 6\f \x006\b\f\v@ ("\0\x7F Aj ("\0E\r Aj\v!@ ! \0"Aj! \0("\0\r\0 Aj! ("\0\r\0\v A\x006\0\f\vA\0!\v E\r\0@ ("\0At"(\xAC\xDA F@ A\xAC\xDAj 6\0 \rA\x80\xD8A\x80\xD8(\0A~ \0wq6\0\f\v@ (F@ 6\f\v 6\v E\r\v 6 ("\0@ \x006 \0 6\v ("\0E\r\0 \x006 \0 6\v \x07 j!\x07 j"(!\0\v \0A~q6 \x07Ar6 \x07j \x076\0 \x07A\xFFM@ \x07A\xF8qA\xA4\xD8j!\0\x7FA\xFC\xD7(\0"A \x07Avt"qE@A\xFC\xD7 r6\0 \0\f\v \0(\b\v! \0 6\b 6\f \x006\f 6\b\f\vA! \x07A\xFF\xFF\xFF\x07M@ \x07A& \x07A\bvg"\0kvAq \0AtrA>s!\v 6 B\x007 AtA\xAC\xDAj!\0@@A\x80\xD8(\0"A t"qE@A\x80\xD8 r6\0 \0 6\0\f\v \x07A AvkA\0 AG\x1Bt! \0(\0!@ "\0(Axq \x07F\r Av! At! \0 Aqj"("\r\0\v 6\v \x006 6\f 6\b\f\v \0(\b" 6\f \0 6\b A\x006 \x006\f 6\b\v \bA\bj!\0\f\v@ \bE\r\0@ ("At"(\xAC\xDA F@ A\xAC\xDAj \x006\0 \0\rA\x80\xD8 \x07A~ wq"\x076\0\f\v@ \b(F@ \b \x006\f\v \b \x006\v \0E\r\v \0 \b6 ("@ \0 6 \x006\v ("E\r\0 \0 6 \x006\v@ AM@ j"\0Ar6 \0 j"\0 \0(Ar6\f\v Ar6 j" Ar6 j 6\0 A\xFFM@ A\xF8qA\xA4\xD8j!\0\x7FA\xFC\xD7(\0"A Avt"qE@A\xFC\xD7 r6\0 \0\f\v \0(\b\v! \0 6\b 6\f \x006\f 6\b\f\vA!\0 A\xFF\xFF\xFF\x07M@ A& A\bvg"\0kvAq \0AtrA>s!\0\v \x006 B\x007 \0AtA\xAC\xDAj!@@ \x07A \0t"qE@A\x80\xD8 \x07r6\0 6\0 6\f\v A \0AvkA\0 \0AG\x1Bt!\0 (\0!@ "(Axq F\r \0Av! \0At!\0 Aqj"\x07("\r\0\v \x07 6 6\v 6\f 6\b\f\v (\b"\0 6\f 6\b A\x006 6\f \x006\b\v A\bj!\0\f\v@ E\r\0@ ("At"(\xAC\xDA F@ A\xAC\xDAj \x006\0 \0\rA\x80\xD8 \vA~ wq6\0\f\v@ (F@ \x006\f\v \x006\v \0E\r\v \0 6 ("@ \0 6 \x006\v ("E\r\0 \0 6 \x006\v@ AM@ j"\0Ar6 \0 j"\0 \0(Ar6\f\v Ar6 j" Ar6 j 6\0 \b@ \bAxqA\xA4\xD8j!\0A\x90\xD8(\0!\x7FA \bAvt"\x07 qE@A\xFC\xD7 \x07r6\0 \0\f\v \0(\b\v! \0 6\b 6\f \x006\f 6\b\vA\x90\xD8 6\0A\x84\xD8 6\0\v A\bj!\0\v
|
|
Aj$\0 \0\v\0\x9C\0\v;\x7F#\0Ak"$\0 \x006\f (\f"\0(\0"@ \0 6 \0(\b !\v Aj$\0\vu~ \0 ~ ~| B \x88" B \x88"~| B\xFF\xFF\xFF\xFF\x83" B\xFF\xFF\xFF\xFF\x83"~"B \x88 ~|"B \x88| ~ B\xFF\xFF\xFF\xFF\x83|"B \x88|7\b \0 B\xFF\xFF\xFF\xFF\x83 B \x86\x847\0\v\xC1\x7F \0-\0\0A qE@@ \0("\x7F \0\xC9\r \0(\v \0("k I@ \0 \0($\0\f\v@@ E \0(PA\0Hr\r\0 !@ j"Ak-\0\0A
|
|
G@ Ak"\r\f\v\v \0 \0($\0 I\r k! \0(!\f\v !\v Y \0 \0( j6\v\v\v\x7FA9" \0(\x006\0 \v\xC0\x7F@ kAH\r\0 \0( \0,\0\v" A\0H\x1BE\r\0 \x8F \0(\0 \0 \0,\0\v"A\0H"\x1B" \0( \x1Bj! Ak!\0@@@ -\0\0"Ak! \0 M\r\0 A\xFFqA\xFD\0M@ (\0 G\r\v Aj! kAJj!\f\v\v A\xFFqA\xFD\0K\r \0(\0Ak I\r\v A6\0\v\vP~@ A\xC0\0q@ A@j\xAD\x86!B\0!\f\v E\r\0 \xAD"\x86 A\xC0\0 k\xAD\x88\x84! \x86!\v \0 7\0 \0 7\b\vi\x7F#\0A\x80k"$\0 A\x80\xC0q LrE@ k"A\x80 A\x80I"\x1B\xC6 E@@ \0 A\x803 A\x80k"A\xFFK\r\0\v\v \0 3\v A\x80j$\0\v\0A\0\v<\x7FA \0 \0AM\x1B!@@ /"\0\r\0A\xB4\xEC(\0"E\r\0 \r\0\f\v\v \0E@0\0\v \0\v \0 \0(\0C\v
|
|
\0 \0(\0A\xC0\v\xCD \x7F~#\0A\xF0\0k"$\0 B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\x83! @@ P" B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\x83"
|
|
B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0}B\x80\x80\x80\x80\x80\x80\xC0\x80\x80\x7FT
|
|
P\x1BE@ B\0R B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0}"\vB\x80\x80\x80\x80\x80\x80\xC0\x80\x80\x7FV \vB\x80\x80\x80\x80\x80\x80\xC0\x80\x80\x7FQ\x1B\r\v
|
|
B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0T
|
|
B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0Q\x1BE@ B\x80\x80\x80\x80\x80\x80 \x84! !\f\v P B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0T B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0Q\x1BE@ B\x80\x80\x80\x80\x80\x80 \x84!\f\v
|
|
B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x85\x84P@B\x80\x80\x80\x80\x80\x80\xE0\xFF\xFF\0 \x85 \x85B\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7F\x85\x84P"\x1B!B\0 \x1B!\f\v B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x85\x84P\r
|
|
\x84P@ \x84B\0R\r \x83! \x83!\f\v \x84PE\r\0 ! !\f\v T
|
|
V
|
|
Q\x1B"\b\x1B!
|
|
\b\x1B"\fB\xFF\xFF\xFF\xFF\xFF\xFF?\x83! \b\x1B"\vB0\x88\xA7A\xFF\xFFq!\x07 \fB0\x88\xA7A\xFF\xFFq"E@ A\xE0\0j
|
|
|
|
P"\x1ByB\xC0\0B\0 \x1B|\xA7"Ak6 )h! )\`!
|
|
A k!\v \b\x1B! \vB\xFF\xFF\xFF\xFF\xFF\xFF?\x83! \x07~ A\xD0\0j P"\x07\x1ByB\xC0\0B\0 \x07\x1B|\xA7"\x07Ak6A \x07k!\x07 )P! )X\vB\x86 B=\x88\x84B\x80\x80\x80\x80\x80\x80\x80\x84! B\x86
|
|
B=\x88\x84 \x85!~ B\x86" \x07F\r\0 \x07k"\x07A\xFF\0K@B\0!B\f\v A@k A\x80 \x07k6 A0j \x07g )8! )0 )@ )H\x84B\0R\xAD\x84\v! B\x80\x80\x80\x80\x80\x80\x80\x84!\v
|
|
B\x86!
|
|
@ B\0S@B\0!B\0!
|
|
\x85 \v\x85\x84P\r
|
|
}! \v }
|
|
V\xAD}"B\xFF\xFF\xFF\xFF\xFF\xFF\xFFV\r A j P"\x07\x1ByB\xC0\0B\0 \x07\x1B\x84\xA7A\fk"\x076 \x07k! )(! ) !\f\v
|
|
|" T\xAD \v||"B\x80\x80\x80\x80\x80\x80\x80\b\x83P\r\0 B\x83 B?\x86 B\x88\x84\x84! Aj! B\x88!\v \fB\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7F\x83! A\xFF\xFFN@ B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x84!B\0!\f\vA\0!\x07@ A\0J@ !\x07\f\v Aj A\xFF\0j6 A kg )\0 ) )\x84B\0R\xAD\x84! )\b!\v B=\x86 B\x88\x84! B\x88B\xFF\xFF\xFF\xFF\xFF\xFF?\x83 \x07\xADB0\x86\x84 \x84!@@ \xA7A\x07q"AG@ AK\xAD|"V\xAD|!\f\v B\x83|"V\xAD|!\f\v E\r\v\v \0 7\0 \0 7\b A\xF0\0j$\0\v
|
|
\0 \0A\x9C\xE0^\v
|
|
\0 \0A\xA4\xE0^\v\x84\x7F~#\0Ak"$\0 \0~ E@B\0\f\v Au"s k"\xADB\0 g"A\xD1\0j6 )\bB\x80\x80\x80\x80\x80\x80\xC0\0\x85A\x9E\x80 k\xADB0\x86|B\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7FB\0 A\0H\x1B\x84! )\0\v7\0 \0 7\b Aj$\0\v1\x7F \0(\f" \0(F@ \0 \0(\0((\0\0\v -\0\0 \0 Aj6\f\v'\x7F \0(\f" \0(F@ \0 \0(\0($\0\0\v -\0\0\v1\x7F \0(\f" \0(F@ \0 \0(\0((\0\0\v (\0 \0 Aj6\f\v'\x7F \0(\f" \0(F@ \0 \0(\0($\0\0\v (\0\v\xAA\f\b\x7F\x7FA\0 E\r\0 \0A\x7Fs! AO@@ AqE\r\0 -\0\0 sA\xFFqAt(\xE03 A\bvs! Ak"\0E Aj"AqErE@ -\0 sA\xFFqAt(\xE03 A\bvs! Ak"\0E Aj"AqErE@ -\0 sA\xFFqAt(\xE03 A\bvs! Ak"\0E Aj"AqErE@ -\0 sA\xFFqAt(\xE03 A\bvs! Aj! Ak!\f\v \0! !\f\v \0! !\f\v \0! !\v An"\bAll!
|
|
@ \bAk" E@A\0!\f\v !\0A\0!@ \0( \x07s"\x07AvA\xFC\x07q(\xE0S \x07AvA\xFC\x07q(\xE0K \x07AvA\xFC\x07q(\xE0C \x07A\xFFqAt(\xE0;sss!\x07 \0(\f s"AvA\xFC\x07q(\xE0S AvA\xFC\x07q(\xE0K AvA\xFC\x07q(\xE0C A\xFFqAt(\xE0;sss! \0(\b s"AvA\xFC\x07q(\xE0S AvA\xFC\x07q(\xE0K AvA\xFC\x07q(\xE0C A\xFFqAt(\xE0;sss! \0( s"AvA\xFC\x07q(\xE0S AvA\xFC\x07q(\xE0K AvA\xFC\x07q(\xE0C A\xFFqAt(\xE0;sss! \0(\0 s"AvA\xFC\x07q(\xE0S AvA\xFC\x07q(\xE0K AvA\xFC\x07q(\xE0C A\xFFqAt(\xE0;sss! \0Aj!\0 Ak" \r\0\v \bAljAk!\v
|
|
j! ( (\f (\b ( (\0 s"\0A\bv \0A\xFFqAt(\xE03s"\0A\bv \0A\xFFqAt(\xE03s"\0A\bv \0A\xFFqAt(\xE03s"\0A\xFFqAt(\xE03 ss \0A\bvs"\0A\bv \0A\xFFqAt(\xE03s"\0A\bv \0A\xFFqAt(\xE03s"\0A\bv \0A\xFFqAt(\xE03s"\0A\xFFqAt(\xE03 ss \0A\bvs"\0A\bv \0A\xFFqAt(\xE03s"\0A\bv \0A\xFFqAt(\xE03s"\0A\bv \0A\xFFqAt(\xE03s"\0A\xFFqAt(\xE03 ss \0A\bvs"\0A\bv \0A\xFFqAt(\xE03s"\0A\bv \0A\xFFqAt(\xE03s"\0A\bv \0A\xFFqAt(\xE03s"\0A\xFFqAt(\xE03 \x07ss \0A\bvs"\0A\bv \0A\xFFqAt(\xE03s"\0A\bv \0A\xFFqAt(\xE03s"\0A\bv \0A\xFFqAt(\xE03s"\0A\bv \0A\xFFqAt(\xE03s! Aj!\v A\x07K@@ -\0\0 sA\xFFqAt(\xE03 A\bvs"\0A\bv -\0 \0sA\xFFqAt(\xE03s"\0A\bv -\0 \0sA\xFFqAt(\xE03s"\0A\bv -\0 \0sA\xFFqAt(\xE03s"\0A\bv -\0 \0sA\xFFqAt(\xE03s"\0A\bv -\0 \0sA\xFFqAt(\xE03s"\0A\bv -\0 \0sA\xFFqAt(\xE03s"\0A\bv -\0\x07 \0sA\xFFqAt(\xE03s! A\bj! A\bk"A\x07K\r\0\v\v@ E\r\0 -\0\0 sA\xFFqAt(\xE03 A\bvs! AF\r\0 -\0 sA\xFFqAt(\xE03 A\bvs! AF\r\0 -\0 sA\xFFqAt(\xE03 A\bvs! AF\r\0 -\0 sA\xFFqAt(\xE03 A\bvs! AF\r\0 -\0 sA\xFFqAt(\xE03 A\bvs! AF\r\0 -\0 sA\xFFqAt(\xE03 A\bvs! AF\r\0 -\0 sA\xFFqAt(\xE03 A\bvs!\v A\x7Fs\v\v\x97\x7F#\0A@j"$\0 \0 \0(\0"A\bk(\0"j!@ Ak(\0"( (F@A\0 \x1B!\0\f\v \0 N@ B\x007 A\x006 6\f \x006\b 6 B\x007 B\x007$ B\x007, A\x006< B\x81\x80\x80\x80\x80\x80\x80\x8074 Aj AA\0 (\0(\v\0 (\r\v B\x007 A\x006 A\x98\xC46\f \x006\b 6 B\x007 B\x007$ B\x007, B\x007\x003 A\x006< A:\0; Aj AA\0 (\0(
|
|
\0A\0!\0@@ ((\0\v (A\0 ($AF\x1BA\0 ( AF\x1BA\0 (,AF\x1B!\0\f\v (AG@ (,\r ( AG\r ($AG\r\v (!\0\v A@k$\0 \0\v\0 \0A\x006\b \0B\x007\0\vc\0 (A\xB0q"A F@ \v@ AG\r\0@@ \0-\0\0"A+k\0\0\v \0Aj\v A0G \0kAHr\r\0 \0-\0A rA\xF8\0G\r\0 \0Aj!\0\v \0\v1\x7FA\xCC\xCF(\0! \0@A\xCC\xCFA\xD4\xCE \0 \0A\x7FF\x1B6\0\vA\x7F A\xD4\xCEF\x1B\v\0 \0(\0"\0@ \0H\v\vA\x7F \0 7p \0 \0(, \0("k\xAC7x \0 P \0(\b"\0 k\xACYr\x7F \0 \xA7j\v6h\vs\x7F \0A\x90\xFC\x006\0 \0(@ \0((!@ @A\0 \0 Ak"At" \0($j(\0 \0( j(\0\x07\0\f\v\v \0Aj\xF3 \0( ! \0($! \0(0! \0(<!\v \0\v\xEC\x7F \0E@A\xC8\xCC(\0@A\xC8\xCC(\0L!\vA\xF8\xCD(\0@A\xF8\xCD(\0L r!\vA\xB0\xCE(\0"\0@@ \0(L \0( \0(G@ \0L r!\v \0(8"\0\r\0\v\v \v \0(LA\0H!@@ \0( \0(F\r\0 \0A\0A\0 \0($\0 \0(\r\0A\x7F!\f\v \0(" \0(\b"G@ \0 k\xACA \0((\0\vA\0! \0A\x006 \0B\x007 \0B\x007 \r\0\v \v-\0 E@ \0( (F\v \0 F@A\v \0( (\x9BE\v\xDB\x7F#\0Ak"$\0 6\fA\0!@ \x7FA \0 A\fj(\r\0A A\xC0\0 \0:" (\0(\f\0E\r\0 A\0 (\0(4\0!@@ \0Q A0k! \0 A\fj( AHr\r\0 A\xC0\0 \0:" (\0(\f\0E\r Ak! A\0 (\0(4\0 A
|
|
lj!\f\v\v \0 A\fj(E\rA\v (\0r6\0\v Aj$\0 \v\xF6\x7F#\0Ak"$\0 6\f@@ \0 A\fj)@A\0!A!\f\vA\0!A! \0;"\x07A\0H\r\0 (\b \x07Atj-\0\0A\xC0\0qE\r\0 \x07A\0 (\0($\0!@@ \0S A0k! \0 A\fj) AHr\r\0 \0;"A\0H\r (\b Atj-\0\0A\xC0\0qE\r Ak! A\0 (\0($\0 A
|
|
lj!\f\v\v \0 A\fj)E\rA!\v (\0 r6\0\v Aj$\0 \v\x90\x7F#\0Ak"$\0 6\f H6\b (\f!#\0Ak"$\0 6\f 6\bA\x7F!@A\0A\0 \x9A"A\0H\r\0 \0 Aj"/"\x006\0 \0E\r\0 \0 (\f\x9A!\v Aj$\0 A\bjI Aj$\0 \v\f\0 \0(\0B \0\v.\0@ \0(A\xCA\0q"\0@ \0A\xC0\0F@A\b\v \0A\bG\rA\vA\0\vA
|
|
\v\f\0 \0(\0@ \0\v\xCE~\x7F#\0Ak"$\0 \xBD"B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x07\x83! \0~ B4\x88B\xFF\x83"PE@ B\xFFR@ B\x88! B\x80\xF8\0|! B<\x86\f\v B\x88!B\xFF\xFF! B<\x86\f\v P@B\0!B\0\f\v B\0 y\xA7"\x07A1j6 )\bB\x80\x80\x80\x80\x80\x80\xC0\0\x85!A\x8C\xF8\0 \x07k\xAD! )\0\v7\0 \0 B\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7F\x83 B0\x86\x84 \x847\b Aj$\0\v\0 \0A\x80\x80\x80\x80O@A\xBFA\0\xDC\0\v \0At9\v\x85\x7F#\0Ak"\b$\0 \b 6\b \b 6\f \bAj" $ =! \b(# A\x006\0A\0!@@ \x07F r\r@ \bA\fj \bA\bj(\r\0@ (\0A\0 (\0(4\0A%F@ Aj \x07F\rA\0!\x7F@ (A\0 (\0(4\0"A\xC5\0F\r\0A!
|
|
A\xFFqA0F\r\0 \f\v A\bj \x07F\rA\b!
|
|
! (\bA\0 (\0(4\0\v! \b \0 \b(\f \b(\b \0(\0($\f\x006\f
|
|
jAj!\f\v A (\0 (\0(\f\0@@ \x07 Aj"G@ A (\0 (\0(\f\0\r\v\v@ \bA\fj \bA\bj(\r A \b(\fC (\0(\f\0E\r \b(\fB\f\0\v\0\v \b(\fC (\0(\0 (\0 (\0(\0F@ \b(\fB Aj!\f\v A6\0\v (\0!\f\v\v A6\0\v \bA\fj \bA\bj(@ (\0Ar6\0\v \b(\f \bAj$\0\v\xB1\x7F#\0Ak"\b$\0 \b 6\b \b 6\f \bAj" $ >! \b(# A\x006\0A\0!@@ \x07F r\r@ \bA\fj \bA\bj)\r\0@ ,\0\0A\0 (\0($\0A%F@ Aj \x07F\rA\0!\x7F@ ,\0A\0 (\0($\0"A\xC5\0F\r\0A!
|
|
A\xFFqA0F\r\0 \f\v Aj \x07F\rA!
|
|
! ,\0A\0 (\0($\0\v! \b \0 \b(\f \b(\b \0(\0($\f\x006\f
|
|
jAj!\f\v@ ,\0\0"A\0H\r\0 (\b" Atj-\0\0AqE\r\0@@ \x07 Aj"F@ \x07!\f\v ,\0\0"A\0H\r\0 Atj-\0\0Aq\r\v\v@ \bA\fj \bA\bj)\r \b(\fA"A\x80q\r (\b A\xFF\0qAtj-\0\0AqE\r \b(\f@\f\0\v\0\v \b(\fA\xC0 (\0(\f\0 ,\0\0 (\0(\f\0F@ \b(\f@ Aj!\f\v A6\0\v (\0!\f\v\v A6\0\v \bA\fj \bA\bj)@ (\0Ar6\0\v \b(\f \bAj$\0\v<\0 \0,\0\vA\0H@ \0(\b \0(\0!\v \0 (\b6\b \0 )\x007\0 A\0:\0\v A\0:\0\0\v\0 @ \0 \xFC
|
|
\0\0\v \0\v\xC3\x7F#\0Ak"\x07$\0@ \0E\r\0 (\f! k"A\0J@ \0 \0(\0(0\0 G\r\v k" H@ \x07Aj" k" \xE1 \0 \x07( \x07,\0A\0H\x1B \0(\0(0\0! G\r\v k"A\0J@ \0 \0(\0(0\0 G\r\v A\x006\f \0!\b\v \x07Aj$\0 \b\v\f\0 \0A\x82\x86\x80 6\0\0\v\xCC\x7F#\0Ak"\x07$\0@ \0E\r\0 (\f! kAu"A\0J@ \0 \0(\0(0\0 G\r\v kAu" H@ \x07Aj" k" \xDF \0 \x07( \x07,\0A\0H\x1B \0(\0(0\0! G\r\v kAu"A\0J@ \0 \0(\0(0\0 G\r\v A\x006\f \0!\b\v \x07Aj$\0 \b\v9\x7F#\0Ak"$\0 6\f H6\b \0A (\f\x9A A\bjI Aj$\0\vK\x7F \0(\0!\0 -" \0(\f \0(\b"kAuI\x7F Atj(\0A\0GA\0\vE@0\0\v \0(\b Atj(\0\v\0 \0A F \0A kAIr\v\xD7\x7F@A\x84\xCC(\0"\0A\0N@ \0E\rA\x84\xCF(\0 \0A\xFF\xFF\xFF\xFFqG\r\v@A\x88\xCC(\0A
|
|
F\r\0A\xCC\xCB(\0"\0A\xC8\xCB(\0F\r\0A\xCC\xCB \0Aj6\0 \0A
|
|
:\0\0\vA\xB8\xCB\x9F\vA\x84\xCCA\x84\xCC(\0"\0A\xFF\xFF\xFF\xFF \0\x1B6\0@@A\x88\xCC(\0A
|
|
F\r\0A\xCC\xCB(\0"\0A\xC8\xCB(\0F\r\0A\xCC\xCB \0Aj6\0 \0A
|
|
:\0\0\f\vA\xB8\xCB\x9F\vA\x84\xCC(\0A\x84\xCCA\x006\0\v+\x7F#\0Ak"$\0 6\fA\xB8\xCB \0 A\0A\0\xD0 Aj$\0\v^\x7F \0A\x006\b \0B\x007\0 (\0! (" k"Au"@ \0 \xA8 \0(! E FrE@ \xFC
|
|
\0\0\v \0 j6\v \0\v?\x7F@ \0 F\r\0@ \0 Ak"O\r \0-\0\0! \0 -\0\0:\0\0 :\0\0 \0Aj!\0\f\0\v\0\v\v\xDB\x7F~A!@ \0B\0R B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\x83"B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0V B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0Q\x1B\r\0 B\0R B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\x83"B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0V B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0Q\x1B\r\0 \0 \x84 \x84\x84P@A\0\v \x83B\0Y@ \0 T S Q\x1B@A\x7F\v \0 \x85 \x85\x84B\0R\v \0 V U Q\x1B@A\x7F\v \0 \x85 \x85\x84B\0R!\v \v'\x7F#\0Ak"$\0 6\f \0A\xE4\0 \x9A Aj$\0\v\xD7\x7F#\0Ak"$\0 \0A\x006#\0Ak"$\0 A\0:\0@ \0 \0(\0"A\fk(\0j"(E@ \0 (H"\x7F \xC4 \0(\0 \vA\fk(\0j(E:\0\f\v A\x99\v Aj$\0A! -\0AF@ \0 \0 \0(\0A\fk(\0j(" (\0( \0"6AA\0 G\x1B!\v \0 \0(\0A\fk(\0j \x99 Aj$\0\vP~@ A\xC0\0q@ A@j\xAD\x88!B\0!\f\v E\r\0 A\xC0\0 k\xAD\x86 \xAD"\x88\x84! \x88!\v \0 7\0 \0 7\b\vC\x7F@ E\r\0@ \0-\0\0" -\0\0"F@ Aj! \0Aj!\0 Ak"\r\f\v\v k!\v \v \0A\x97\xD6\0\v\x88\x7F@ \xA5"A\xF7\xFF\xFF\xFFI@@@ AO@ Ar"AjU! \0 A\xFF\xFF\xFF\xFF\x07k6\b \0 6\0 \0 6 !\0\f\v \0 :\0\v E\r\v At"E\r\0 \0 \xFC
|
|
\0\0\v \0 AtjA\x006\0\f\v0\0\v\v\xBB\x7F (\0!\x07A\0 \0(\0" \0(A\xE3\0F"\x1BA\x7FA (\0" k"At F\x1B A\xFF\xFF\xFF\xFF\x07O\x1B"\b\x9D"@@ E@ \0 6\0\f\v \0(\0! @ \xFC
|
|
\0\0\v \0 6\0 E\r\0 \0(\0 \0(\0!\v \0A\xE4\x006 \x07 kj6\0 \0(\0 \bA|qj6\0\v0\0\vA\x7F#\0Ak"$\0 6\fA\xB0 A\xFC A\xDD,A A\fj"4A\xFC A\xE1,A 4 Aj$\0 \0\v\xFA\x7F#\0Ak"
|
|
$\0
|
|
\x006\f@@@ (\0"\v G\r\0 (\` \0F\x7FA+ \0 (dG\rA-\v!\0 \vAj6\0 \v \0:\0\0\f\v@ \0 G\r\0 ( ,\0\v"\0 \0A\0H\x1BE\r\0A\0!\0 \b(\0" \x07kA\x9FJ\r (\0!\0 \b Aj6\0 \x006\0\f\vA\x7F!\0 A\xE8\0j
|
|
A\fj\xB1 kAu"AJ\r@@@ A\bk\0\0\v J\r\f\v AG AHr\r\0 (\0" F kAJr\r Ak-\0\0A0G\rA\0!\0 A\x006\0 Aj6\0 -\0\xD0\x85:\0\0\f\v (\0"\0Aj6\0 \0 A\xD0\x85j-\0\0:\0\0 (\0Aj6\0A\0!\0\f\vA\0!\0 A\x006\0\v
|
|
Aj$\0 \0\v
|
|
\0 \0A\xE4\xE0^\v\xFC\x7F#\0Ak"
|
|
$\0
|
|
\0:\0@@@ (\0"\v G\r\0 \0A\xFFq"\f -\0F\x7FA+ \f -\0G\rA-\v!\0 \vAj6\0 \v \0:\0\0\f\v@ \0 G\r\0 ( ,\0\v"\0 \0A\0H\x1BE\r\0A\0!\0 \b(\0" \x07kA\x9FJ\r (\0!\0 \b Aj6\0 \x006\0\f\vA\x7F!\0 Aj
|
|
Aj\xB4 k"AJ\r@@@ A\bk\0\0\v J\r\f\v AG AHr\r\0 (\0" F kAJr\r Ak-\0\0A0G\rA\0!\0 A\x006\0 Aj6\0 -\0\xD0\x85:\0\0\f\v (\0"\0Aj6\0 \0 A\xD0\x85j-\0\0:\0\0 (\0Aj6\0A\0!\0\f\vA\0!\0 A\x006\0\v
|
|
Aj$\0 \0\v
|
|
\0 \0A\xDC\xE0^\v\0 \0\vf\x7F~#\0Ak"$\0 \0~ E@B\0\f\v \xADB\0A\xF0\0 g"Ask6 )\bB\x80\x80\x80\x80\x80\x80\xC0\0\x85A\x9E\x80 k\xADB0\x86|! )\0\v7\0 \0 7\b Aj$\0\v\0 \0A\xDF\0q \0 \0A\xE1\0kAI\x1B\v<\0 \0A\x006\b \0B\x007\0 \0 (\x006\0 \0 (6 \0 (\b6\b A\x006\b B\x007\0\v,\x7F \0A\x006\b \0B\x007\0 \0 (\0" (" k\xC2 \0\vW\x7F~@A\xCC\xCC(\0"\xAD \0\xADB\x07|B\xF8\xFF\xFF\xFF\x83|"B\xFF\xFF\xFF\xFFX@ \xA7"\0?\0AtM\r \0\r\vA\xF8\xD7A06\0A\x7F\vA\xCC\xCC \x006\0 \v\xA7\x7F \0( \0(\0"kAu" I@#\0A k"$\0@ k" \0(\b \0("kAuM@ \0 \xB9\f\v A\fj \0 \0(\0kAu j\x86 \0( \0(\0kAu \0\xB8" \xCF \0 \x96 \xB5\v A j$\0\v I@ \0 Atj6\v\vt\x7F~ \0B\x80\x80\x80\x80Z@@ Ak" \0" \0B
|
|
\x80"\0B
|
|
~}\xA7A0r:\0\0 B\xFF\xFF\xFF\xFF\x9FV\r\0\v\v \0PE@ \0\xA7!@ Ak" A
|
|
n"A
|
|
lkA0r:\0\0 A K !\r\0\v\v \v}\x7F@@ \0"AqE\r\0 -\0\0E@A\0\v@ Aj"AqE\r -\0\0\r\0\v\f\v@ "Aj!A\x80\x82\x84\b (\0"k rA\x80\x81\x82\x84xqA\x80\x81\x82\x84xF\r\0\v@ "Aj! -\0\0\r\0\v\v \0k\v\xBF\x7F \0( \0(\0"k" I@#\0A k"$\0@ k" \0(\b \0("kM@ \0 \x96\f\v A\fj \0 j \0(\0k\x83 \0( \0(\0k \0\x8C"(\b"j!@ G@ A\0:\0\0 Aj!\f\v\v 6\b \0 \xA9 \x87\v A j$\0\v I@ \0 j6\v\v\v\0 6\0A\v<\0 \0,\0\vA\0H@ \0(\b \0(\0!\v \0 (\b6\b \0 )\x007\0 A\0:\0\v A\x006\0\vK\x7F#\0Ak"$\0 A\fj" $ n" (\0(\0\x006\0 \0 (\0(\0 (\f# Aj$\0\vD\x7F#\0Ak"$\0 A\fj" \0$ ="\0A\xD0\x85A\xEA\x85 \0(\0(0\0 (\f# Aj$\0 \vK\x7F#\0Ak"$\0 A\fj" $ p" (\0(\0\0:\0\0 \0 (\0(\0 (\f# Aj$\0\v\x7F\x7F@ y"A\xF7\xFF\xFF\xFF\x07I@@@ A\vO@ A\x07r"Aj9! \0 A\xFF\xFF\xFF\xFF\x07k6\b \0 6\0 \0 6 !\0\f\v \0 :\0\v E\r\v E\r\0 \0 \xFC
|
|
\0\0\v \0 jA\0:\0\0\f\vi\0\v\vF\x7F \0A\x80\xFA\0(\0"6\0 \0 A\fk(\0jA\xA0\xFA\0(\x006\0 \0A\xA4\xFA\0(\x006\b \0A\fj\xB0 \0A@kK \0\v\xB5\x07\x7F\x7F \0A\xFF\xFFq! \0Av! AF@ -\0\0j"\0A\xF1\xFFk \0 \0A\xF0\xFFK\x1B"\0 j"At"A\x80\x80<j A\xF0\xFFK\x1B \0r\f\v \x7F@@@@ AO@@ A\xAF+K@@A\xDB! !\0@ \0-\0\0j" j \0-\0j"j \0-\0j"j \0-\0j"j \0-\0j"j \0-\0j"j \0-\0j"j \0-\0\x07j"j \0-\0\bj"j \0-\0 j"j \0-\0
|
|
j"j \0-\0\vj"j \0-\0\fj"j \0-\0\rj"j \0-\0j"j \0-\0j"j! \0Aj!\0 Ak"\r\0\v A\xF1\xFFp! A\xF1\xFFp! A\xB0+j! A\xB0+k"A\xAF+K\r\0\v E\r AI\r\v@ -\0\0j"\0 j \0 -\0j"\0j \0 -\0j"\0j \0 -\0j"\0j \0 -\0j"\0j \0 -\0j"\0j \0 -\0j"\0j \0 -\0\x07j"\0j \0 -\0\bj"\0j \0 -\0 j"\0j \0 -\0
|
|
j"\0j \0 -\0\vj"\0j \0 -\0\fj"\0j \0 -\0\rj"\0j \0 -\0j"\0j \0 -\0j"j! Aj! Ak"AK\r\0\v E\r\v Aq"\x07\r !\0\f\v@ E\r\0@ Aq"\x07E@ !\0\f\v !\0@ "Aj! \0Ak!\0 -\0\0j" j! Aj" \x07G\r\0\v\v AI\r\0@ -\0\0j" -\0j" -\0j" -\0j" jjjj! Aj! \0Ak"\0\r\0\v\v A\xF1\xFFpAt A\xF1\xFFk A\xF0\xFFK\x1Br\f\vA\0! !\0@ "Aj! \0Ak!\0 -\0\0j" j! Aj" \x07G\r\0\v\v AI\r\0@ -\0\0j" -\0j" -\0j" -\0j" jjjj! Aj! \0Ak"\0\r\0\v\v A\xF1\xFFp! A\xF1\xFFp!\v At rA\v\v\v:\x7F A\0H@\x85\0\vA\xFF\xFF\xFF\xFF\x07 \0(\b \0(\0k"\0At" I\x1B \0A\xFF\xFF\xFF\xFFO\x1B\v\0 \0("\0A O@ \0\v\v \0A\x9F\f\xD6\0\v>\x7F A\x80\x80\x80\x80O@\x85\0\vA\xFF\xFF\xFF\xFF \0(\b \0(\0k"\0Au" I\x1B \0A\xFC\xFF\xFF\xFF\x07O\x1B\v?\x7F \0(! \0(\b!@ G@ \0 Ak"6\b\f\v\v \0(\0"@ \0(\f !\v\vI\x7F \0("A\bu! \0(\0"\0 Aq\x7F (\0 j(\0 \v j A Aq\x1B \0(\0(
|
|
\0\v\xF1\x7FA\xF6\xFF\xFF\xFF\x07 k O@A\xF7\xFF\xFF\xFF\x07!\b \0(\0 \0 \0,\0\vA\0H\x1B! A\xF2\xFF\xFF\xFFM@A\v j" At"\b \bK\x1B"A\x07rAj A\vI\x1B!\b\v \b9! @ \xFC
|
|
\0\0\v @ j \x07 \xFC
|
|
\0\0\v j"
|
|
k"\x07E
|
|
FrE@ j j j j \x07\xFC
|
|
\0\0\v A
|
|
G@ !\v \0 6\0 \0 \bA\x80\x80\x80\x80xr6\b \0 j \x07j"\x006 \0 jA\0:\0\0\vi\0\v,\x7F \0 A\xC0\x84=n"At/\xC0\xBB;\0\0 \0Aj A\xC0\x84=lk\xAB\v\0A\v;\0 \0 6 \0 \x7F 9A\0\v"6\0 \0 j"6\b \0 j6\f \0 6 \0\v\b\0A\xFF\xFF\xFF\xFF\x07\v\0A\xFF\0\v?\x7F@ \0 F\r\0@ \0 Ak"O\r \0(\0! \0 (\x006\0 6\0 \0Aj!\0\f\0\v\0\v\v\xCB \x7F#\0Ak" $\0 =!
|
|
Aj n" (\0(\0@ (\b ,\0"\x07 \x07A\0H\x1BE@
|
|
\0
|
|
(\0(0\0 \0kAtj"6\0\f\v 6\0@@ \0"\x07-\0\0"\bA+k\0\0\v
|
|
\b\xC0
|
|
(\0(,\0!\x07 (\0"\bAj6\0 \b \x076\0 \0Aj!\x07\v@ \x07kAH\r\0 \x07-\0\0A0G\r\0 \x07-\0A rA\xF8\0G\r\0
|
|
A0
|
|
(\0(,\0!\b (\0"\vAj6\0 \v \b6\0
|
|
\x07,\0
|
|
(\0(,\0!\b (\0"\vAj6\0 \v \b6\0 \x07Aj!\x07\v \x07 c (\0(\0\0!A\0!\vA\0!\b \x07!\x7F M\x7F \x07 \0kAtj (\0\x8F (\0@ ("\f Aj"\r ,\0A\0H"\x1B \bj-\0\0E\r\0 \v \f \r \x1B \bj,\0\0G\r\0 (\0"\vAj6\0 \v 6\0A\0!\v \b \b (\b ,\0"\f \fA\0H\x1BAkIj!\b\v
|
|
,\0\0
|
|
(\0(,\0!\f (\0"\rAj6\0 \r \f6\0 Aj! \vAj!\v\f\v\v!\v \0kAtj F\x1B6\0 Aj Aj$\0\v\xD0\x7F A\x80q@ \0A+:\0\0 \0Aj!\0\v A\x80\bq@ \0A#:\0\0 \0Aj!\0\v A\x84q"A\x84G@ \0A\xAE\xD4\0;\0\0 \0Aj!\0\v A\x80\x80q!@ -\0\0"@ \0 :\0\0 \0Aj!\0 Aj!\f\v\v \0\x7F@ A\x80G@ AG\rA\xC6\0A\xE6\0 \x1B\f\vA\xC5\0A\xE5\0 \x1B\f\vA\xC1\0A\xE1\0 \x1B A\x84F\r\0A\xC7\0A\xE7\0 \x1B\v:\0\0 A\x84G\v\xB4\x7F~@@@@@@ AkAw\b\0\v \0\x7F k"AL@A= A\xC0\0 B\x84y\xA7kA\xD1 lA\fv" At)\xD0\xC2TkAjH\r\v\x7F B\xFF\xFF\xFF\xFFX@ \xA7\xAD\f\v B\x80\xC8\xAF\xA0%Z@ B\x80\xC8\xAF\xA0%\x80"B\x80\xC8\xAF\xA0%~}! \xA7\xAD!\v B\x80\xC2\xD7/\x80"\xA7At/\xC0\xBB;\0\0 Aj B\x80\xC2\xD7/~}\xA7\x8A\v!A\0\v6\f\v \0A\xC0\0 B\x84y\xA7k" kJ\x7FA= j"!\x7F BT\x7F@ Ak" \xA7Aq-\0\x91:\0\0 B\x88"B\0R\r\0\vA\0 Ak" \xA7AtA<q(\x90\xBD6\0\0 B\x88!\f\v\v\v6\f\v \0A\xC2\0 B\x84y\xA7kAn" kJ\x7FA= j"!\x7F B\xC1\0T\x7F@ Ak" \xA7A\x07q-\0\xFA\x1B:\0\0 B\x88"B\0R\r\0\vA\0 Ak" \xA7AtA\xFE\0q/\xD0\xBD;\0\0 B\x88!\f\v\v\v6\f\v \0A\xC3\0 B\x84y\xA7kAv" kJ\x7FA= j"!\x7F B\x81T\x7F@ Ak" \xA7Aq-\0\xD2:\0\0 B\x88"B\0R\r\0\vA\0 Ak" \xA7AtA\xFEq/\xD0\xBE;\0\0 B\b\x88!\f\v\v\v6\f\v\x7F ! l" l\xAD!\b \xAD! \xAD!
|
|
l\xAD!\x07A\0!\x7F Ar T\r Ar
|
|
T\r Ar \bT\r \x07T\x7F Aj Aj! \x07\x80!\f\v\v\v" kJ@ \0A=6\f\v \xAC!\x07 j"!@ Ak" \x07\x80" \x07~}\xA7-\0\x80\b:\0\0 \x07Z !\r\0\v \0A\x006 \0 6\0\v \0 6\0\v\xC1 \x7F#\0Ak" $\0 >!
|
|
Aj p" (\0(\0@ (\b ,\0"\x07 \x07A\0H\x1BE@
|
|
\0
|
|
(\0( \0 \0kj"6\0\f\v 6\0@@ \0"\x07-\0\0"\bA+k\0\0\v
|
|
\b\xC0
|
|
(\0(\0!\x07 (\0"\bAj6\0 \b \x07:\0\0 \0Aj!\x07\v@ \x07kAH\r\0 \x07-\0\0A0G\r\0 \x07-\0A rA\xF8\0G\r\0
|
|
A0
|
|
(\0(\0!\b (\0"\vAj6\0 \v \b:\0\0
|
|
\x07,\0
|
|
(\0(\0!\b (\0"\vAj6\0 \v \b:\0\0 \x07Aj!\x07\v \x07 c (\0(\0\0!A\0!\vA\0!\b \x07!\x7F M\x7F \x07 \0kj (\0c (\0@ ("\f Aj"\r ,\0A\0H"\x1B \bj-\0\0E\r\0 \v \f \r \x1B \bj,\0\0G\r\0 (\0"\vAj6\0 \v :\0\0A\0!\v \b \b (\b ,\0"\f \fA\0H\x1BAkIj!\b\v
|
|
,\0\0
|
|
(\0(\0!\f (\0"\rAj6\0 \r \f:\0\0 Aj! \vAj!\v\f\v\v!\v \0kj F\x1B6\0 Aj Aj$\0\v\x9A\x7F@@@@@@ AkAw\b\0\v \0\x7F k"A L@A= A ArgkA\xD1 lA\fv" At(\x90\xBBIkAjH\r\v \xAD!A\0\v6\f\v \0A Argk" kJ\x7FA= j"!\x7F AI\x7F@ Ak" Aq-\0\x91:\0\0 Av"\r\0\vA\0 Ak" AtA<q(\x90\xBD6\0\0 Av!\f\v\v\v6\f\v \0A" ArgkAn" kJ\x7FA= j"!\x7F A\xC1\0I\x7F@ Ak" A\x07q-\0\xFA\x1B:\0\0 Av"\r\0\vA\0 Ak" AtA\xFE\0q/\xD0\xBD;\0\0 Av!\f\v\v\v6\f\v \0A# ArgkAv" kJ\x7FA= j"!\x7F A\x81I\x7F@ Ak" Aq-\0\xD2:\0\0 Av"\r\0\vA\0 Ak" AtA\xFEq/\xD0\xBE;\0\0 A\bv!\f\v\v\v6\f\v\x7F ! l"\x07 l! \x07 \x07l!\b\x7F Ar K\r Ar \x07I\r Ar I\r \bI\x7F Aj Aj! \bn!\f\v\v\v" kJ@ \0A=6\f\v j"!@ Ak" n" lk-\0\x80\b:\0\0 O !\r\0\v \0A\x006 \0 6\0\v \0 6\0\v\xCB\v\x7F#\0A\xF0\0k"\f$\0 \f 6l \f! @@@ kA\fm"
|
|
A\xE5\0O@
|
|
/"! E\r\v !\x07 !@ F@A\0!\b@ \0 \fA\xEC\0j"(A
|
|
\x1B@ \0 (@ (\0Ar6\0\v@ F\r -\0\0AF\r\x07 Aj! A\fj!\f\0\v\0\v \0:!\r E@ \r (\0(\0!\r\v \bAj!A\0! !\x07 !@ F@ !\b E\r \0Q !\x07 !
|
|
\vjAI\r@ F@\f@ \x07-\0\0AG\r\0 ( ,\0\v" A\0H\x1B \bF\r\0 \x07A\0:\0\0 \vAk!\v\v \x07Aj!\x07 A\fj!\f\v\0\v\0@ \x07-\0\0AG\r\0 \bAt (\0 ,\0\vA\0H\x1Bj(\0!@ \x7F (\0(\0\v \rF@A! ( ,\0\v" A\0H\x1B G\r \x07A:\0\0 \vAj!\v\f\v \x07A\0:\0\0\v
|
|
Ak!
|
|
\v \x07Aj!\x07 A\fj!\f\v\0\v\0\v\0 \x07AA ( ,\0\v"\b \bA\0H\x1B"\b\x1B:\0\0 \x07Aj!\x07 A\fj! \v \bE"\bj!\v
|
|
\bk!
|
|
\f\v\0\v\0\v0\0\v (\0Ar6\0\v ! \fA\xF0\0j$\0 \v\x88\x7F ( \0( \0(\0"k"k! @ \xFC
|
|
\0\0\v 6 \0 \0(\0"6 \0 (6\0 6 \0(! \0 (\b6 6\b \0(\b! \0 (\f6\b 6\f (6\0\v\xC8\v\x7F#\0A\xF0\0k"\f$\0 \f 6l \f! @@@ kA\fm"
|
|
A\xE5\0O@
|
|
/"! E\r\v !\x07 !@ F@A\0!\b@ \0 \fA\xEC\0j")A
|
|
\x1B@ \0 )@ (\0Ar6\0\v@ F\r -\0\0AF\r\x07 Aj! A\fj!\f\0\v\0\v \0;!\r E@ \r (\0(\f\0!\r\v \bAj!A\0! !\x07 !@ F@ !\b E\r \0S !\x07 !
|
|
\vjAI\r@ F@\f@ \x07-\0\0AG\r\0 ( ,\0\v" A\0H\x1B \bF\r\0 \x07A\0:\0\0 \vAk!\v\v \x07Aj!\x07 A\fj!\f\v\0\v\0@ \x07-\0\0AG\r\0 (\0 ,\0\vA\0H\x1B \bj,\0\0!@ \x7F (\0(\f\0\v \rF@A! ( ,\0\v" A\0H\x1B G\r \x07A:\0\0 \vAj!\v\f\v \x07A\0:\0\0\v
|
|
Ak!
|
|
\v \x07Aj!\x07 A\fj!\f\v\0\v\0\v\0 \x07AA ( ,\0\v"\b \bA\0H\x1B"\b\x1B:\0\0 \x07Aj!\x07 A\fj! \v \bE"\bj!\v
|
|
\bk!
|
|
\f\v\0\v\0\v0\0\v (\0Ar6\0\v ! \fA\xF0\0j$\0 \v\xBB\x7F A\xF4\xDC \x1B"(\0!@\x7F@ E@ \rA\0\vA~ E\r@ @ !\f\v -\0\0"\xC0"A\0N@ \0@ \0 6\0\v A\0G\vA\xCC\xCF(\0(\0E@A \0E\r \0 A\xFF\xBFq6\0A\v A\xC2k"A2K\r At(\x80\x84! Ak"E\r Aj!\v -\0\0"Av"\x07Ak Au \x07jrA\x07K\r\0@ Ak! A\xFFqA\x80k Atr"A\0N@ A\x006\0 \0@ \0 6\0\v k\v E\r Aj",\0\0"A@H\r\0\v\v A\x006\0A\xF8\xD7A6\0A\x7F\v\v 6\0A~\v'\0 \0 \0(E \0( rr"6 \0( q@\x9C\0\v\v}\x7F#\0A\xA0k"$\0 \0 A\x9Ej \x1B"\x006\x94 A\0Gk6\x98 A\0A\x90\xFC\v\0 A\x7F6L A\xE1\x006$ A\x7F6P A\x9Fj6, A\x94j6T \0A\0:\0\0 \xCB A\xA0j$\0\vJ\x7F@ \0-\0\0"E -\0\0"Gr\r\0@ -\0! \0-\0"E\r Aj! \0Aj!\0 F\r\0\v\v k\v\0\0\v\x8D\b\v\x7F \0E@ /\v A@O@A\xF8\xD7A06\0A\0\v\x7FA A\vjAxq A\vI\x1B! \0A\bk"(" Axq!\b@ AqE@ A\x80I\r Aj \bM@ ! \b kA\xDC\xDB(\0AtM\r\vA\0\f\v \bj!\x07@ \bM@ \b k"AI\r AqrAr6 j" Ar6 \x07 \x07(Ar6 \xC9\f\vA\x94\xD8(\0 \x07F@A\x88\xD8(\0 \bj"\b M\r AqrAr6 j" \b k"Ar6A\x88\xD8 6\0A\x94\xD8 6\0\f\vA\x90\xD8(\0 \x07F@A\x84\xD8(\0 \bj" I\r@ k"AO@ AqrAr6 j"\b Ar6 j" 6\0 (A~q6\f\v Aq rAr6 j" (Ar6A\0!\bA\0!\vA\x90\xD8 \b6\0A\x84\xD8 6\0\f\v \x07("Aq\r Axq \bj"\v I\r \v k!\f \x07(\f!@ A\xFFM@ \x07(\b" F@A\xFC\xD7A\xFC\xD7(\0A~ Avwq6\0\f\v 6\f 6\b\f\v \x07(!
|
|
@ \x07G@ \x07(\b" 6\f 6\b\f\v@ \x07("\x7F \x07Aj \x07("E\r \x07Aj\v!\b@ \b! "Aj!\b ("\r\0 Aj!\b ("\r\0\v A\x006\0\f\vA\0!\v
|
|
E\r\0@ \x07("At"(\xAC\xDA \x07F@ A\xAC\xDAj 6\0 \rA\x80\xD8A\x80\xD8(\0A~ wq6\0\f\v@ \x07
|
|
(F@
|
|
6\f\v
|
|
6\v E\r\v
|
|
6 \x07("@ 6 6\v \x07("E\r\0 6 6\v \fAM@ Aq \vrAr6 \vj" (Ar6\f\v AqrAr6 j" \fAr6 \vj" (Ar6 \f\xC9\v !\v \v"@ A\bj\v /"E@A\0\v \0A|Ax \0Ak(\0"Aq\x1B Axqj" K\x1BY \0! \v\0 \0E@A\0\vA\xF8\xD7 \x006\0A\x7F\v}\x7F#\0Ak"$\0 A
|
|
:\0@@ \0("\x7F \0\xC9\r \0(\v \0("F\r\0 \0(PA
|
|
F\r\0 \0 Aj6 A
|
|
:\0\0\f\v \0 AjA \0($\0AG\r\0 -\0\v Aj$\0\v\0\v\0A\v\xF4\x7F#\0A@j"\x07B\x007 \x07B\x007( \x07B\x0070 \x07B\x0078@@\x7F@\x7F @ Aq!@ AO@ A|q!@ \x07A j"\f \bAtj"/\0Atj" /\0Aj;\0 /At \fj" /\0Aj;\0 /At \fj" /\0Aj;\0 /At \fj" /\0Aj;\0 \bAj!\b Aj" G\r\0\v E\r\v@ \x07A j \bAtj/\0Atj" /\0Aj;\0 \bAj!\b
|
|
Aj"
|
|
G\r\0\v\v (\0"\b \x07/>"\rE\rA!\v\f\v (\0\v!\bA\0!\r \x07/<@A!\v\f\v \x07/:@A\r!\v\f\v \x07/8@A\f!\v\f\v \x07/6@A\v!\v\f\v \x07/4@A
|
|
!\v\f\v \x07/2@A !\v\f\v \x07/0@A\b!\v\f\v \x07/.@A\x07!\v\f\v \x07/,@A!\v\f\v \x07/*@A!\v\f\v \x07/(@A!\v\f\v \x07/&@A!\v\f\v \x07/$@A!\v\f\v \x07/"@A!\fA!\vA!\bA\0\f\v (\0"\0Aj6\0 \0A\xC06\0 (\0"\0Aj6\0 \0A\xC06\0A!\f\f\v \b \v \b \vI\x1B!A!\b@@ \x07A j \bAtj/\0\r \bAj"\b \vG\r\0\v \v!\b\v \b \bK\x1B!\fA\v! A\x7F!
|
|
\x07/""AK\rA AtkA\xFE\xFFq \x07/$"k"A\0H\r At \x07/&"k"A\0H\r At \x07/("k"A\0H\r At \x07/*"k"A\0H\r At \x07/,"k"A\0H\r At \x07/."k"A\0H\r At \x07/0"k"A\0H\r At \x07/2"k"A\0H\r At \x07/4"k"A\0H\r At \x07/6"\x1Bk"A\0H\r At \x07/8"k"A\0H\r At \x07/:"k"A\0H\r At \x07/<"k"A\0H\r At" \rI \rGA\0 \0E r\x1Br\rA\0!
|
|
\x07A\0; \x07 ; \x07 j"; \x07 j";\b \x07 j";
|
|
\x07 j";\f \x07 j"; \x07 j"; \x07 j"; \x07 j"; \x07 j"; \x07 \x1Bj"; \x07 j"; \x07 j"; \x07 j;@ E\r\0 AG@ Aq A~q!A\0! @
|
|
Atj/\0"@ \x07 Atj" /\0"Aj;\0 Atj
|
|
;\0\v
|
|
Ar"Atj/\0"@ \x07 Atj" /\0"Aj;\0 Atj ;\0\v
|
|
Aj!
|
|
Aj" G\r\0\vE\r\v
|
|
Atj/\0"E\r\0 \x07 Atj" /\0"Aj;\0 Atj
|
|
;\0\vA!A\0! "!A\0!@@@ \0\0\vA!
|
|
\fA K\rA\x81!A\xD0\xED\0!A\x90\xED\0!A!\f\v \0AF!A\0!A\xD0\xEE\0!A\x90\xEE\0! \0AG@\f\vA!
|
|
\fA K\r\vA \ft"Ak! (\0!A\0! \f! A\0!A\0!\rA\x7F!@A t!@@\x7FA\0 Atj/\0" AjK\r\0 I@A\0! A\xE0\0\f\v kAt"\0j/\0! \0 j-\0\0\v!\0A\x7F \b k"t!\x1B \r vAtj! !
|
|
@
|
|
\x1Bj"
|
|
Atj" ; :\0 \0:\0\0
|
|
\r\0\vA \bAkt! @ "\0Av! \0 \rq\r\0\v \x07A j \bAtj" /\0Ak" ;\0 \0Ak \rq \0jA\0 \0\x1B!\r Aj! A\xFF\xFFqE@ \b \vF\r Atj/\0Atj/\0!\b\v \b \fM\r\0 \r q"\0 F\r\0\vA \b \f \x1B"k" t! \b \vI@ \v k! \b!
|
|
@@ \x07A j
|
|
Atj/\0k"A\0L\r At! Aj" j"
|
|
\vI\r\0\v ! \vA t!\vA!
|
|
j"A\xD4Kq A\xD0Kqr\r (\0" \0Atj"
|
|
\f:\0
|
|
:\0\0
|
|
Atj" kAv; \0!\f\v\v \r@ \rAtj"\0A\0; \0 :\0 \0A\xC0\0:\0\0\v (\0 Atj6\0\v \f6\0A\0!
|
|
\v
|
|
\v\x9C\x7F ,\0\vA\0N@ \0 (\b6\b \0 )\x007\0\v (\0!@@@ ("A
|
|
M@ \0 :\0\v\f\v A\xF7\xFF\xFF\xFF\x07O\r A\x07r"Aj9! \0 A\xFF\xFF\xFF\xFF\x07k6\b \0 6\0 \0 6 !\0\v Aj"@ \0 \xFC
|
|
\0\0\v\f\vi\0\v\v\xCC\x7F@A\xF6\xFF\xFF\xFF\x07 k O@ \0,\0\vA\0H! \0(\0A\xF7\xFF\xFF\xFF\x07! A\xF2\xFF\xFF\xFFM@A\v j" At" K\x1B"A\x07rAj A\vI\x1B!\v \0 \x1B! 9! @ \xFC
|
|
\0\0\v@ F\r\0 k"\x07E\r\0 j j \x07\xFC
|
|
\0\0\v A
|
|
G@ !\v \0 6\0 \0 A\x80\x80\x80\x80xr6\b\f\vi\0\v \0 6\v\0 \0 \0(\0A\fk(\0j"\0 jK \0\vK\x7F \0("A\bu!\x07 \0(\0"\0 Aq\x7F (\0 \x07j(\0 \x07\v j A Aq\x1B \0(\0(\v\0\v\x9A\0 \0A:\x005@ \0(G\r\0 \0A:\x004@ \0("E@ \0A6$ \0 6 \0 6 AG\r \0(0AF\r\f\v F@ \0("AF@ \0 6 !\v \0(0AG\r AF\r\f\v \0 \0($Aj6$\v \0A:\x006\v\vv\x7F \0($"E@ \0 6 \0 6 \0A6$ \0 \0(86\v@@ \0( \0(8G\r\0 \0( G\r\0 \0(AG\r \0 6\v \0A:\x006 \0A6 \0 Aj6$\v\v\x8D\x7F ( \0(\0" \0("kj! k"@ \xFC
|
|
\0\0\v 6 \0 \0(\0"6 \0 (6\0 6 \0(! \0 (\b6 6\b \0(\b! \0 (\f6\b 6\f (6\0\v\x85\x7F@@@ \0,\0\v"A\0N@A
|
|
! A
|
|
F\r \0 AjA\xFF\0q:\0\v\f\v \0(" \0(\bA\xFF\xFF\xFF\xFF\x07qAk"G\r\v \0 A \xA4 !\v \0 Aj6 \0(\0!\0\v \0 j"\0A\0:\0 \0 :\0\0\v,\x7F \0 A\x90\xCE\0n"At/\xC0\xBB;\0\0 \0Aj A\x90\xCE\0lk\xAC\v4\x7F \0 A\xE4\0n"At/\xC0\xBB;\0\0 \0 A\xE4\0lkAt/\xC0\xBB;\0 \0Aj\v\xE9\x7F A\xBF\x84=M@ A\x8F\xCE\0M@ A\xE3\0M@ A M@ \0 A0r:\0\0 \0Aj\v \0 At/\xC0\xBB;\0\0 \0Aj\v A\xE7\x07M@ \0 A\xFF\xFFqA\xE4\0n"A0r:\0\0 \0 A\xE4\0lkA\xFF\xFFqAt/\xC0\xBB;\0 \0Aj\v \0 \xAC\v A\x9F\x8DM@ \0 A\x90\xCE\0n"A0j:\0\0 \0Aj A\x90\xCE\0lk\xAC\v \0 \xAB\v A\xFF\xC1\xD7/M@ A\xFF\xAC\xE2M@ \0 A\xC0\x84=n"A0j:\0\0 \0Aj A\xC0\x84=lk\xAB\v \0 \x8A\v A\xFF\x93\xEB\xDCM@ \0 A\x80\xC2\xD7/n"A0j:\0\0 \0Aj A\x80\xC2\xD7/lk\x8A\v \0 A\x80\xC2\xD7/n"At/\xC0\xBB;\0\0 \0Aj A\x80\xC2\xD7/lk\x8A\v\0 \0(\b*G@ \0(\b\xA6\v \0\v+\x7F#\0Ak"$\0 H6\f \0 \xC5 A\fjI Aj$\0\v\0 \0A\xE8\xF5\x006\0 \0A j \0\xC3\vT\x7F#\0Ak"$\0\x7F (\0! \0kAu"@@ \0 \0(\0F\r \0Aj!\0 Ak"\r\0\v\vA\0\v"\0 \0\x1B Aj$\0\v\x9F\x7F#\0Ak"\f$\0 \f \x006\f@@ \0 F@ -\0\0AG\rA\0!\0 A\0:\0\0 (\0"Aj6\0 A.:\0\0 \x07( \x07,\0\v" A\0H\x1BE\r (\0" \bkA\x9FJ\r
|
|
(\0! Aj6\0 6\0\f\v@@ \0 G\r\0 \x07( \x07,\0\v"\0 \0A\0H\x1BE\r\0 -\0\0AG\r (\0"\0 \bkA\x9FJ\r
|
|
(\0! \0Aj6\0 \0 6\0A\0!\0
|
|
A\x006\0\f\v \v \vA\xF0\0j \fA\fj\xB1 \vk"\0Au"A\x1BJ\r A\xD0\x85j,\0\0!@@ \0A{q"\0A\xD8\0G@ \0A\xE0\0G\r (\0"G@A\x7F!\0 Ak,\0\0s ,\0\0sG\r\v Aj6\0 :\0\0\f\v A\xD0\0:\0\0\f\v s"\0 ,\0\0G\r\0 \0\xB9:\0\0 -\0\0AG\r\0 A\0:\0\0 \x07( \x07,\0\v"\0 \0A\0H\x1BE\r\0 (\0"\0 \bkA\x9FJ\r\0
|
|
(\0! \0Aj6\0 \0 6\0\v (\0"\0Aj6\0 \0 :\0\0A\0!\0 AJ\r
|
|
|
|
(\0Aj6\0\f\vA\0!\0\f\vA\x7F!\0\v \fAj$\0 \0\vy\x7F#\0Ak"$\0 A\fj" $ ="A\xD0\x85A\xEC\x85 (\0(0\0 n" (\0(\f\0\x006\0 (\0(\0\x006\0 \0 (\0(\0 (\f# Aj$\0\v*\x7F#\0Ak"$\0 \0 ,\0\0 \0k\xCA"\0 \0\x1B Aj$\0\v\x7F \0\xD4 \0(\0"@ \0(\f !\v\v\x97\x7F#\0Ak"\f$\0 \f \0:\0@@ \0 F@ -\0\0AG\rA\0!\0 A\0:\0\0 (\0"Aj6\0 A.:\0\0 \x07( \x07,\0\v" A\0H\x1BE\r (\0" \bkA\x9FJ\r
|
|
(\0! Aj6\0 6\0\f\v@@ \0 G\r\0 \x07( \x07,\0\v"\0 \0A\0H\x1BE\r\0 -\0\0AG\r (\0"\0 \bkA\x9FJ\r
|
|
(\0! \0Aj6\0 \0 6\0A\0!\0
|
|
A\x006\0\f\v \v \vAj \fAj\xB4 \vk"A\x1BJ\r A\xD0\x85j,\0\0!@@@@ A~qAk\0\v (\0"G@A\x7F!\0 Ak,\0\0s ,\0\0sG\r\v Aj6\0 :\0\0\f\v A\xD0\0:\0\0\f\v s"\0 ,\0\0G\r\0 \0\xB9:\0\0 -\0\0AG\r\0 A\0:\0\0 \x07( \x07,\0\v"\0 \0A\0H\x1BE\r\0 (\0"\0 \bkA\x9FJ\r\0
|
|
(\0! \0Aj6\0 \0 6\0\v (\0"\0Aj6\0 \0 :\0\0A\0!\0 AJ\r
|
|
|
|
(\0Aj6\0\f\vA\0!\0\f\vA\x7F!\0\v \fAj$\0 \0\vy\x7F#\0Ak"$\0 A\fj" $ >"A\xD0\x85A\xEC\x85 (\0( \0 p" (\0(\f\0\0:\0\0 (\0(\0\0:\0\0 \0 (\0(\0 (\f# Aj$\0\vI\x7F \0 6 \0A\x006\f @ U!\v \0 6\0 \0 Atj"6\b \0 Atj6\f \0 6 \0\v6\x7F \0(" Atj!@ F@ \0 6 A\x006\0 Aj!\f\v\v\v~\x7F~#\0A\xA0k"$\0 6< 6 A\x7F6 Aj"B\0J A\xAD )\b! )\0!\x07 @ (\x88 ( (<kjj6\0\v \0 7\b \0 \x077\0 A\xA0j$\0\v\r\0 \0 B\x7F\xBE\vD\x7F#\0Ak"$\0 B\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7F\x85< )\0! \0 )\b7\b \0 7\0 Aj$\0\v\x9C\x7FA5!@ \0(" \0("AjA\x07pkA\x07jA\x07n k"A\xF1jA\x07pAIj"A5G@ "\rA4!@@ AjA\x07pAk\0\v \0(A\x90oAk\xB3E\r\vA5\v@@ A\xF3jA\x07pAk\0\v \0(\xB3\r\vA!\v \v\x95\x07\x7F~#\0Ak"\b$\0@@@ A$L@ \0-\0\0"\r \0!\f\vA\xF8\xD7A6\0B\0!\f\v \0!@@ \xC0_E\r -\0! Aj! \r\0\v\f\v@ A\xFFq"A+k\0\0\vA\x7FA\0 A-F\x1B!\x07 Aj!\v\x7F@ ArAG\r\0 -\0\0A0G\r\0A! -\0A\xDFqA\xD8\0F@ Aj!A\f\v Aj! A\b \x1B\f\v A
|
|
\x1B\v"
|
|
\xAD!\fA\0!@@@ -\0\0"A0k"A\xFFqA
|
|
I\r\0 A\xE1\0kA\xFFqAM@ A\xD7\0k!\f\v A\xC1\0kA\xFFqAK\r A7k!\v
|
|
A\xFFqL\r\0 \b \fB\0 \vB\02A!@ \b)\bB\0R\r\0 \v \f~"\r \xADB\xFF\x83"B\x7F\x85V\r\0 \r |!\vA! !\v Aj! !\f\v\v @ \0 \x1B6\0\v@@ @A\xF8\xD7A\xC4\x006\0 \x07A\0 B\x83P\x1B!\x07 !\v\f\v \vV\r\v \x07 \xA7AqrE@A\xF8\xD7A\xC4\x006\0 B}!\f\v \vZ\r\0A\xF8\xD7A\xC4\x006\0\f\v \v \x07\xAC"\x85 }!\v \bAj$\0 \v\x9A\b\x7F@ \0"Aq@@ -\0\0"E A=Fr\r Aj"Aq\r\0\v\v@@A\x80\x82\x84\b (\0"k rA\x80\x81\x82\x84xqA\x80\x81\x82\x84xG\r\0@A\x80\x82\x84\b A\xBD\xFA\xF4\xE9s"k rA\x80\x81\x82\x84xqA\x80\x81\x82\x84xG\r (! Aj"! A\x80\x82\x84\b krA\x80\x81\x82\x84xqA\x80\x81\x82\x84xF\r\0\v\f\v !\v@ "-\0\0"E\r Aj! A=G\r\0\v\v \0 F@A\0\v@ \0 \0k"j-\0\0\r\0A\xEC\xDB(\0"E\r\0 (\0"E\r\0@@\x7F \0!A\0 "E\r\0 \0-\0\0"\x7F@@ -\0\0"\x07G \x07Er\r Ak"E\r Aj! -\0! Aj! \r\0\vA\0!\v A\0\v -\0\0k\vE@ (\0 j"-\0\0A=F\r\v (! Aj! \r\f\v\v Aj!\b\v \b\v \0 \0\x81!\v\0 \0A\fjK \0!\v\0\v\0 \0A\xA8\xF5\x006\0 \0Aj\xF3 \0\v\xFD~\x7F#\0A k"$\0 B\xFF\xFF\xFF\xFF\xFF\xFF?\x83!~ B0\x88B\xFF\xFF\x83"\xA7"A\x81\xF8\0kA\xFDM@ B\x86 \0B<\x88\x84! A\x80\xF8\0k\xAD!@ \0B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x83"\0B\x81\x80\x80\x80\x80\x80\x80\x80\bZ@ B|!\f\v \0B\x80\x80\x80\x80\x80\x80\x80\x80\bR\r\0 B\x83 |!\vB\0 B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x07V"\x1B!\0 \xAD |\f\v \0 \x84P B\xFF\xFFRrE@ B\x86 \0B<\x88\x84B\x80\x80\x80\x80\x80\x80\x80\x84!\0B\xFF\f\v A\xFE\x87K@B\0!\0B\xFF\f\vA\x80\xF8\0A\x81\xF8\0 P"\x1B"\b k"\x07A\xF0\0J@B\0!\0B\0\f\v B\x80\x80\x80\x80\x80\x80\xC0\0\x84 \x1B!A\0! \bG@ Aj \0 A\x80 \x07k6 ) )\x84B\0R!\v \0 \x07g )\bB\x86 )\0"B<\x88\x84!\0@ \xAD B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x83\x84"B\x81\x80\x80\x80\x80\x80\x80\x80\bZ@ \0B|!\0\f\v B\x80\x80\x80\x80\x80\x80\x80\x80\bR\r\0 \0B\x83 \0|!\0\v \0B\x80\x80\x80\x80\x80\x80\x80\b\x85 \0 \0B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x07V"\x1B!\0 \xAD\v! A j$\0 B\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7F\x83 B4\x86\x84 \0\x84\xBF\v\x89\0@ \0\x7F A\xFF\0M\r@A\xCC\xCF(\0(\0E@ A\x80\x7FqA\x80\xBFF\r\f\v A\xFFM@ \0 A?qA\x80r:\0 \0 AvA\xC0r:\0\0A\v A\x80@qA\x80\xC0G A\x80\xB0OqE@ \0 A?qA\x80r:\0 \0 A\fvA\xE0r:\0\0 \0 AvA?qA\x80r:\0A\v A\x80\x80kA\xFF\xFF?M@ \0 A?qA\x80r:\0 \0 AvA\xF0r:\0\0 \0 AvA?qA\x80r:\0 \0 A\fvA?qA\x80r:\0A\v\vA\xF8\xD7A6\0A\x7FA\v\v \0 :\0\0A\v\0 @ \0 \xC0 \xFC\v\0\v\v0\x7F#\0Ak"$\0 (\x006\0 \0 a\`A\xB0\xF1\0(\0L Aj$\0\v\xA9|D\0\0\0\0\0\0\xF0?!@ \0A\x80\bN@D\0\0\0\0\0\0\xE0\x7F! \0A\xFFI@ \0A\xFF\x07k!\0\f\vD\0\0\0\0\0\0\xF0\x7F!A\xFD \0 \0A\xFDO\x1BA\xFEk!\0\f\v \0A\x81xJ\r\0D\0\0\0\0\0\0\`! \0A\xB8pK@ \0A\xC9\x07j!\0\f\vD\0\0\0\0\0\0\0\0!A\xF0h \0 \0A\xF0hM\x1BA\x92j!\0\v \0A\xFF\x07j\xADB4\x86\xBF\xA2\vY\x7F \0 \0(H"Ak r6H \0(\0"A\bq@ \0 A r6\0A\x7F\v \0B\x007 \0 \0(,"6 \0 6 \0 \0(0j6A\0\v\xE2\x7F A\0G!@@@ \0AqE Er\r\0 A\xFFq!@ \0-\0\0 F\r Ak"A\0G! \0Aj"\0AqE\r \r\0\v\v E\r A\xFFq" \0-\0\0F AIrE@ A\x81\x82\x84\bl!@A\x80\x82\x84\b \0(\0 s"k rA\x80\x81\x82\x84xqA\x80\x81\x82\x84xG\r \0Aj!\0 Ak"AK\r\0\v\v E\r\v A\xFFq!@ \0-\0\0F@ \0\v \0Aj!\0 Ak"\r\0\v\vA\0\vx\x7F@ \0E\r\0 \0( E\r\0 \0($"E\r\0 \0("E\r\0 (\0 \0G\r\0 (A\xB4\xFE\0kAK\r\0 (8"@ \0(( \0 \0($! \0(!\v \0(( \0 \0A\x006\v\v\xE9\0A\x98\xC7A\xA8A\xA8\xC7A\xA9AA\0A\xB4\xC7A\x96\rAA\x80\x7FA\xFF\0A\xCC\xC7A\x8F\rAA\x80\x7FA\xFF\0A\xC0\xC7A\x8D\rAA\0A\xFFA\xD8\xC7A\xC8 AA\x80\x80~A\xFF\xFFA\xE4\xC7A\xBF AA\0A\xFF\xFFA\xF0\xC7A\xD7 AA\x80\x80\x80\x80xA\xFF\xFF\xFF\xFF\x07A\xFC\xC7A\xCE AA\0A\x7FA\x88\xC8A\x85AA\x80\x80\x80\x80xA\xFF\xFF\xFF\xFF\x07A\x94\xC8A\xFCAA\0A\x7FA\xA0\xC8A\xF2A\bB\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7FB\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0A\xAC\xC8A\xE9A\bB\0B\x7FA\xB8\xC8A\xC7
|
|
A\rA\xC4\xC8A\xAFA\b\rA\xA8-A\xA4\x1BA\xF0-AA\x8AA\xB8.AA\xB0A\x84/AA\xBFA\xDC&A\xD0/A\0A\x98\0A\xF8/A\0A\xDD\0A\xA00AA\xB6\0A\xC80AA\xE5\0A\xF00AA\x84\0A\x981AA\xAC\0A\xC01AA\xC9\0A\xE81AA\x82\x1B\0A\x902AA\xA0\x1B\0A\xF8/A\0A\xAF\0A\xA00AA\x8E\0A\xC80AA\xF1\0A\xF00AA\xCF\0A\x981AA\xF7\0A\xC01AA\xD5\0A\xB82A\bA\xB4\0A\xE02A A\x92\0A\x883AA\xEF\0A\xB03A\x07A\xC7\x1B\0\v>\x7F#\0Ak"$\0 \x006\f\x7F \0AO@A\xAE A\fj\xC7A\0\f\v \0At(\x98-\v Aj$\0\v\x85\x7F@ k"A\xF7\xFF\xFF\xFF\x07I@@ A
|
|
M@ \0 :\0\v\f\v A\x07r"Aj9! \0 A\xFF\xFF\xFF\xFF\x07k6\b \0 6\0 \0 6 !\0\v k"E FrE@ \0 \xFC
|
|
\0\0\v \0 jA\0:\0\0\f\vi\0\v\v6\x7F \0(\b" Atj!@ FE@ A\x006\0 Aj!\f\v\v \0 6\b\vD\x7F#\0Ak"$\0 \0(\0!\0 6\b \x006 A\x9F6\0A\xED\v a\`A\xB0\xF1\0(\0L Aj$\0\v\`\x7F \0(" k"\x07j! !@ M@ \0 6 \x07E FrE@ \x07k \x07\xFC
|
|
\0\0\v -\0\0:\0\0 Aj! Aj!\f\v\v\v\0 \0(\0"\0@ \0\v\v\f\0 \0(\0\0\0\v+\x7F \0(! \0(\b!@ G@ \0 Ak"6\b\f\v\v\v\x07\0 \0\0\v\x7F#\0Ak"$\0 \x006\0A\xEC \xDC\0\v\0 \0(\0j 6\0\v\r\0 \0(\0j(\0\vQ\x7F@ E\r\0 A\x8C\xC6E"E\r\0 (\b \0(\bA\x7Fsq\r\0 \0(\f( (\f(G\r\0 \0(( ((F!\v \v{\x7F \0("Aq!\x7F -\x007AF@ A\bu" E\r (\0 j(\0\f\v A\bu E\r\0 \0(\0(68A\0!A\0\v! \0(\0"\0 j A Aq\x1B \0(\0(\b\0\v\r\0 \0( (F\v\xF6\x7F#\0Ak"$\0 6\fA\x94\xC4(\0" \0 \xCB \0y \0jAk-\0\0A
|
|
G@@@ (L"\0A\0N@ \0E\rA\x84\xCF(\0 \0A\xFF\xFF\xFF\xFFqG\r\v@ (PA
|
|
F\r\0 ("\0 (F\r\0 \0Aj6 \0A
|
|
:\0\0\f\v \x9F\f\v (L"\0A\xFF\xFF\xFF\xFF \0\x1B6L@@ (PA
|
|
F\r\0 ("\0 (F\r\0 \0Aj6 \0A
|
|
:\0\0\f\v \x9F\v (L A\x006L\v\v\x9C\0\v\x88\x7F@@@ \0,\0\v"A\0N@A! AF\r \0 AjA\xFF\0q:\0\v\f\v \0(" \0(\bA\xFF\xFF\xFF\xFF\x07qAk"G\r\v \0 A \xFF !\v \0 Aj6 \0(\0!\0\v \0 Atj"\0A\x006 \0 6\0\v\x9B\x7FA\xF6\xFF\xFF\xFF k O@A\xF7\xFF\xFF\xFF! \0(\0 \0 \0,\0\vA\0H\x1B!
|
|
A\xF2\xFF\xFF\xFFM@ j" At" K\x1BArAj! \v U!@ E\r\0 At"\bE\r\0
|
|
\b\xFC
|
|
\0\0\v@ E\r\0 At"\bE\r\0 Atj \x07 \b\xFC
|
|
\0\0\v j"\bk!\x07@ \bF\r\0 \x07At"E\r\0 At"\bj Atj \b
|
|
j Atj \xFC
|
|
\0\0\v AG@
|
|
!\v \0 6\0 \0 A\x80\x80\x80\x80xr6\b \0 j \x07j"\x006 \0AtjA\x006\0\v0\0\v\x8A\x7F A\xF7\xFF\xFF\xFFI@@ AM@ \0 :\0\v\f\v Ar"AjU! \0 A\xFF\xFF\xFF\xFF\x07k6\b \0 6\0 \0 6 !\0\v ! \0!@ @ 6\0 Ak! Aj!\f\v\v \0 AtjA\x006\0\v0\0\v\xA0\x7F \0(\b"A\xFF\xFF\xFF\xFF\x07qAkA
|
|
\0,\0\v"A\0H"\x1B" O@ \0(\0 \0 \x1B!@ \x7F @ \xFC
|
|
\0\0\v \0,\0\v Av\v\xC0A\0H@ \0 6\f\v \0 A\xFF\0q:\0\v\v jA\0:\0\0\v \0 k \0( \x1B"\0A\0 \0 \x89\v\x87\x7F A\xF7\xFF\xFF\xFF\x07I@@ A
|
|
M@ \0 :\0\v\f\v A\x07r"Aj9! \0 A\xFF\xFF\xFF\xFF\x07k6\b \0 6\0 \0 6 !\0\v ! \0!@ @ :\0\0 Ak! Aj!\f\v\v \0 jA\0:\0\0\vi\0\v\0 \0 F@ \0A\0:\0x\v !\v<\x7F#\0Ak"$\0@@ AK\r\0 \0-\0xAq\r\0 \0A:\0x\f\v U!\0\v Aj$\0 \0\v \0 \0\xAE!\v\0 \0A\xF0\x906\0 \0Aj \0\v\0 \0A\xC8\x906\0 \0A\fj \0\v\x80\x7F !\0@@ \x07M \0 Or\r\0 \0,\0\0"A\xFFq!\x7FA A\0N\r\0 ABI\r A_M@ \0kAH\r \0-\0A\xC0qA\x80G\rA\f\v AoM@ \0kAH\r \0-\0 \0,\0!@@ A\xEDG@ A\xE0G\r A\`qA\xA0\x7FF\r\f\v A\xA0\x7FN\r\f\v A\xBF\x7FJ\r\vA\xC0qA\x80G\rA\f\v \0kAH AtKr\r \0-\0! \0-\0!\b \0,\0!@@@@ A\xF0k\0\v A\xF0\0jA\xFFqA0O\r\f\v A\x90\x7FN\r\f\v A\xBF\x7FJ\r\v \bA\xC0qA\x80G A\xC0qA\x80Gr A?q \bAtA\xC0q AtA\x80\x80\xF0\0q A?qA\ftrrrA\xFF\xFF\xC3\0Kr\rA\v! \x07Aj!\x07 \0 j!\0\f\v\v \0 k\v\xB8\x7F#\0Ak"\0$\0\x7F \0 6\f \0 6\b@@@ O OrE@ ,\0\0"\bA\xFFq!\x7F \bA\0N@ A\xFF\xFF\xC3\0K\rA\f\v \bABI\r \bA_M@A kAH\rA!\b -\0" A\xC0qA\x80G\r A?q AtA\xC0qr!A\f\v \bAoM@A!\b k"
|
|
AH\r ,\0! @@ A\xEDG@ A\xE0G\r A\`qA\xA0\x7FF\r\f\b\v A\xA0\x7FH\r\f\x07\v A\xBF\x7FJ\r\v
|
|
AF\r -\0"\bA\xC0qA\x80G\r \bA?q A\ftA\x80\xE0q A?qAtrr!A\f\v \bAtK\rA!\b k"
|
|
AH\r ,\0! @@@@ A\xF0k\0\v A\xF0\0jA\xFFqA0O\r\x07\f\v A\x90\x7FN\r\f\v A\xBF\x7FJ\r\v
|
|
AF\r -\0"\vA\xC0qA\x80G\r
|
|
AF\r -\0"
|
|
A\xC0qA\x80G\rA!\b
|
|
A?q \vAtA\xC0q AtA\x80\x80\xF0\0q A?qA\ftrrr"A\xFF\xFF\xC3\0K\rA\v!\b 6\0 \0 \bj"6\f \0 Aj"6\b\f\v\v I!\b\v \b\f\vA\v \0(\f6\0 \x07 \0(\b6\0 \0Aj$\0\v\xF5\0#\0Ak"\0$\0\x7F \0 6\f \0 6\b@@@ O@A\0!\f\vA! (\0"A\xFF\xFF\xC3\0K A\x80pqA\x80\xB0Fr\r\0@ A\xFF\0M@A! \0(\b"kA\0L\r \0 Aj6\b :\0\0\f\v A\xFFM@ \0(\b"kAH\r \0 Aj6\b AvA\xC0r:\0\0 \0 \0(\b"Aj6\b A?qA\x80r:\0\0\f\v \0(\b"k! A\xFF\xFFM@ AH\r \0 Aj6\b A\fvA\xE0r:\0\0 \0 \0(\b"Aj6\b AvA?qA\x80r:\0\0 \0 \0(\b"Aj6\b A?qA\x80r:\0\0\f\v AH\r \0 Aj6\b AvA\xF0r:\0\0 \0 \0(\b"Aj6\b A\fvA?qA\x80r:\0\0 \0 \0(\b"Aj6\b AvA?qA\x80r:\0\0 \0 \0(\b"Aj6\b A?qA\x80r:\0\0\v \0 \0(\fAj"6\f\f\v\v \f\vA\v \0(\f6\0 \x07 \0(\b6\0 \0Aj$\0\v\x92\x7F !\0@@ M \0 Or\r\0\x7F \0Aj \0-\0\0"\xC0A\0N\r\0 A\xC2I\r A\xDFM@ \0kAH\r \0-\0A\xC0qA\x80G\r \0Aj\f\v A\xEFM@ \0kAH\r \0-\0 \0,\0!@@ A\xEDG@ A\xE0G\r A\`qA\xA0\x7FF\r\f\v A\xA0\x7FN\r\f\v A\xBF\x7FJ\r\vA\xC0qA\x80G\r \0Aj\f\v \0kAH A\xF4Kr kAIr\r \0-\0!\x07 \0-\0!\b \0,\0!@@@@ A\xF0k\0\v A\xF0\0jA\xFFqA0O\r\f\v A\x90\x7FN\r\f\v A\xBF\x7FJ\r\v \bA\xC0qA\x80G \x07A\xC0qA\x80Gr \x07A?q \bAtA\xC0q AtA\x80\x80\xF0\0q A?qA\ftrrrA\xFF\xFF\xC3\0Kr\r Aj! \0Aj\v!\0 Aj!\f\v\v \0 k\v\x81\x7F#\0Ak"\0$\0\x7F \0 6\f \0 6\b@@@ O OrE@A! \0\x7F -\0\0"\xC0A\0N@ ;\0A\f\v A\xC2I\r A\xDFM@A kAH\r -\0"\bA\xC0qA\x80G\r \bA?q AtA\xC0qr;\0A\f\v A\xEFM@A! k"
|
|
AH\r ,\0!\b@@ A\xEDG@ A\xE0G\r \bA\`qA\xA0\x7FG\r\b\f\v \bA\xA0\x7FN\r\x07\f\v \bA\xBF\x7FJ\r\v
|
|
AF\r -\0" A\xC0qA\x80G\r A?q \bA?qAt A\ftrr;\0A\f\v A\xF4K\rA! k"
|
|
AH\r -\0"\v\xC0!\b@@@@ A\xF0k\0\v \bA\xF0\0jA\xFFqA0O\r\x07\f\v \bA\x90\x7FN\r\f\v \bA\xBF\x7FJ\r\v
|
|
AF\r -\0"\bA\xC0qA\x80G\r
|
|
AF\r -\0"
|
|
A\xC0qA\x80G\r kAH\rA!
|
|
A?q"
|
|
\bAt"\fA\xC0q \vA\ftA\x80\xE0q A\x07q"AtrrrA\xFF\xFF\xC3\0K\r
|
|
\fA\xC0\x07qrA\x80\xB8r; \bAvAq \vAt" A\xC0q A\btr A<qrrA\xC0\xFF\0jA\x80\xB0r;\0 Aj!A\v j"6\f \0 Aj"6\b\f\v\v I! \v \f\vA\v \0(\f6\0 \x07 \0(\b6\0 \0Aj$\0\v\xCB\x7F#\0Ak"\0$\0\x7F \0 6\f \0 6\b@@@ O@A\0!\f\vA!@@ /\0"A\xFF\0M@A! \0(\b"kA\0L\r \0 Aj6\b :\0\0\f\v A\xFFM@ \0(\b"kAH\r \0 Aj6\b AvA\xC0r:\0\0 \0 \0(\b"Aj6\b A?qA\x80r:\0\0\f\v A\xFF\xAFM@ \0(\b"kAH\r \0 Aj6\b A\fvA\xE0r:\0\0 \0 \0(\b"Aj6\b AvA?qA\x80r:\0\0 \0 \0(\b"Aj6\b A?qA\x80r:\0\0\f\v A\xFF\xB7M@A! kAH\r /"\bA\x80\xF8qA\x80\xB8G\r \0(\b" kAH\r \bA\xFF\x07q A
|
|
tA\x80\xF8q A\xC0\x07q"A
|
|
trrA\xFF\xFF?K\r \0 Aj6\f \0 Aj6\b AvAj"AvA\xF0r:\0\0 \0 \0(\b"Aj6\b AtA0q AvAqrA\x80r:\0\0 \0 \0(\b"Aj6\b \bAvAq AtA0qrA\x80r:\0\0 \0 \0(\b"Aj6\b \bA?qA\x80r:\0\0\f\v A\x80\xC0I\r \0(\b"kAH\r \0 Aj6\b A\fvA\xE0r:\0\0 \0 \0(\b"Aj6\b AvA\xBFq:\0\0 \0 \0(\b"Aj6\b A?qA\x80r:\0\0\v \0 \0(\fAj"6\f\f\v\vA\f\v \f\vA\v \0(\f6\0 \x07 \0(\b6\0 \0Aj$\0\v3\x7F#\0Ak"$\0 \0H6\fAAA\xCC\xCF(\0(\0\x1B A\fjI Aj$\0\v/\x7F#\0Ak"$\0 H6\f \0 \x98 A\fjI Aj$\0\v\0 6\0 \x07 6\0A\v+\x7F \0A\xDC\x876\0@ \0(\b"E\r\0 \0-\0\fAqE\r\0 !\v \0\v\0 \v'\x7F \0(\0(\0(\0A\x98\xE0A\x98\xE0(\0Aj"6\0 6\v \0 \0(\0#\v\xDB
|
|
\x7F \0A\x94\xE0-\0\0E@A\x8C\xE0-\0\0E@A\xEC\xDEA\xC8\x876\0A\xF0\xDEA\x006\0A\xF8\xDFA\0:\0\0A\xFC\xDEA\x006\0A\xF4\xDEB\x007\0A\xF8\xDEA\x80\xDFA\xE3"\x006\0A\xF4\xDE \x006\0A\xFC\xDE \0A\xF8\0j6\0A\xF4\xDEA\xB9A\xFC\xDFA\xAF\x80A\xF8\xDEA\xF4\xDE(\x006\0A\xFC\xE9A\xE8\x9B6\0A\x80\xEAA\x006\0A\xFC\xE9A\xC4\xDD-.A\x84\xEAA\x88\x9C6\0A\x88\xEAA\x006\0A\x84\xEAA\xCC\xDD-.A\x8C\xEAA\xDC\x876\0A\x94\xEAA\x90\x886\0A\x98\xEAA\0:\0\0A\x90\xEAA\x006\0A\x8C\xEAA\xA4\xE0-.A\x9C\xEAA\xC8\x936\0A\xA0\xEAA\x006\0A\x9C\xEAA\x9C\xE0-.A\xA4\xEAA\xE0\x946\0A\xA8\xEAA\x006\0A\xA4\xEAA\xAC\xE0-.A\xAC\xEAA\x98\x906\0A\xB0\xEAA\x006\0A\xB4\xEA*6\0A\xAC\xEAA\xB4\xE0-.A\xB8\xEAA\xF4\x956\0A\xBC\xEAA\x006\0A\xB8\xEAA\xBC\xE0-.A\xC0\xEAA\xDC\x976\0A\xC4\xEAA\x006\0A\xC0\xEAA\xCC\xE0-.A\xC8\xEAA\xE8\x966\0A\xCC\xEAA\x006\0A\xC8\xEAA\xC4\xE0-.A\xD0\xEAA\xD0\x986\0A\xD4\xEAA\x006\0A\xD0\xEAA\xD4\xE0-.A\xE4\xEAB\x007\0A\xE0\xEAA\xAE\xD8\0;\0A\xD8\xEAA\xC8\x906\0A\xDC\xEAA\x006\0A\xEC\xEAA\x006\0A\xD8\xEAA\xDC\xE0-.A\x80\xEBB\x007\0A\xFC\xEAA,6\0A\xF0\xEAA\xF0\x906\0A\xF4\xEAB\x80\x80\x80\x80\xE07\0A\x88\xEBA\x006\0A\xF0\xEAA\xE4\xE0-.A\x8C\xEBA\xA8\x9C6\0A\x90\xEBA\x006\0A\x8C\xEBA\xD4\xDD-.A\x94\xEBA\xA0\x9E6\0A\x98\xEBA\x006\0A\x94\xEBA\xDC\xDD-.A\x9C\xEBA\xF4\x9F6\0A\xA0\xEBA\x006\0A\x9C\xEBA\xE4\xDD-.A\xA4\xEBA\xE0\xA16\0A\xA8\xEBA\x006\0A\xA4\xEBA\xEC\xDD-.A\xAC\xEBA\xC4\xA96\0A\xB0\xEBA\x006\0A\xAC\xEBA\x94\xDE-.A\xB4\xEBA\xD8\xAA6\0A\xB8\xEBA\x006\0A\xB4\xEBA\x9C\xDE-.A\xBC\xEBA\xCC\xAB6\0A\xC0\xEBA\x006\0A\xBC\xEBA\xA4\xDE-.A\xC4\xEBA\xC0\xAC6\0A\xC8\xEBA\x006\0A\xC4\xEBA\xAC\xDE-.A\xCC\xEBA\xB4\xAD6\0A\xD0\xEBA\x006\0A\xCC\xEBA\xB4\xDE-.A\xD4\xEBA\xDC\xAE6\0A\xD8\xEBA\x006\0A\xD4\xEBA\xBC\xDE-.A\xDC\xEBA\x84\xB06\0A\xE0\xEBA\x006\0A\xDC\xEBA\xC4\xDE-.A\xE4\xEBA\xAC\xB16\0A\xE8\xEBA\x006\0A\xE4\xEBA\xCC\xDE-.A\xF4\xEBA\xD8\xA36\0A\xEC\xEBA\xA8\xA36\0A\xF0\xEBA\x006\0A\xEC\xEBA\xF4\xDD-.A\x80\xECA\xE4\xA56\0A\xF8\xEBA\xB4\xA56\0A\xFC\xEBA\x006\0A\xF8\xEBA\xFC\xDD-.A\x84\xECA\x90\x936\0A\x88\xECA\x006\0*!\0A\x84\xECA\xA4\xA76\0A\x8C\xEC \x006\0A\x84\xECA\x84\xDE-.A\x90\xECA\x90\x936\0A\x94\xECA\x006\0*!\0A\x90\xECA\xC4\xA86\0A\x98\xEC \x006\0A\x90\xECA\x8C\xDE-.A\x9C\xECA\xD4\xB26\0A\xA0\xECA\x006\0A\x9C\xECA\xD4\xDE-.A\xA4\xECA\xCC\xB36\0A\xA8\xECA\x006\0A\xA4\xECA\xDC\xDE-.A\x8C\xE0A:\0\0A\x88\xE0A\xEC\xDE6\0\vA\x90\xE0A\x88\xE0(\0"\x006\0 \0A\xEC\xDEG@ \0 \0(Aj6\vA\x94\xE0A:\0\0\vA\x90\xE0(\0"\x006\0 \0A\xEC\xDEG@ \0 \0(Aj6\v\v\xB1\x7F \0A\xC8\x876\0 \0A\bj!@ \0(\f \0(\b"kAu K@@ Atj(\0"E\r\0 ("Ak6 \r\0 (\0(\b\0\v Aj!\f\v\v \0A\x90j #\0Ak"$\0 6\f (\f"(\0"@ 6 (\b A\fj \xE2\v Aj$\0 \0\v \0 \0A\x98\x906\0 \0(\b*G@ \0(\b\xA6\v \0\v\0A\x7F\v\x9D\x07 \x7F \x006\0AA\0 \x07\x1B! A\x80q!@ AF@ \r( \r,\0\v" A\0H"\x1B"AK@ (\0! AtAk"@ \r(\0 \r \x1BAj \xFC
|
|
\0\0\v j6\0\v A\xB0q"AG@ A F\x7F (\0 \0\v6\0\v@@@@@@ \b j-\0\0\0\v (\x006\0\f\v (\x006\0 A (\0(,\0!\x07 (\0"Aj6\0 \x076\0\f\v \r( \r,\0\v"\x07 \x07A\0H"\x07\x1BE\r \r(\0 \r \x07\x1B(\0!\x07 (\0"Aj6\0 \x076\0\f\v E\r \f( \f,\0\v"\x07 \x07A\0H"\x1B"E\r (\0!\x07 At"@ \x07 \f(\0 \f \x1B \xFC
|
|
\0\0\v \x07 j6\0\f\v (\0 j"!\x07@@ \x07M\r\0 A\xC0\0 \x07(\0 (\0(\f\0E\r\0 \x07Aj!\x07\f\v\v A\0J@ (\0! !@ E \x07OrE@ Ak! \x07Ak"\x07(\0! Aj"6\0 6\0 !\f\v\v \x7F A0 (\0(,\0A\0\v! (\0!@ A\0LE@ Aj"6\0 6\0 Ak! !\f\v\v (\0"Aj6\0 6\0\v@ \x07F@ A0 (\0(,\0!\x07 (\0"Aj6\0 \x076\0\f\v \v( \v,\0\v" A\0H"\x1B\x7F \v(\0 \v \x1B,\0\0A\x7F\v!A\0!A\0!@ \x07F\r@ G@ !\f\v (\0"Aj6\0
|
|
6\0A\0! Aj" \v( \v,\0\v" A\0H\x1BO@ !\f\vA\x7F! \v(\0" \v A\0H"\x1B j-\0\0A\xFF\0F\r\0 \v \x1B j,\0\0!\v \x07Ak"\x07(\0! (\0"Aj6\0 6\0 Aj!\f\0\v\0\v (\0\x8F\v Aj!\f\v\v\v\x8A\x7F#\0Ak"
|
|
$\0@ \0@ \xFE!\f\v \xFD!\v@ @
|
|
Aj"\0 (\0(,\0
|
|
(6\0\0 \0 (\0( \0\f\v
|
|
Aj"\0 (\0((\0
|
|
(6\0\0 \0 (\0(\0\v \b \0| \0 (\0(\f\0\x006\0 (\0(\0\x006\0
|
|
Aj"\0 (\0(\0 \0X \0 \0 (\0(\0 \x07 \0| \0 (\0($\0\x006\0
|
|
Aj$\0\v\x7FA\f9"\0A\x006\b \0B\x007\0 \0\v\xF7 \x7F \x006\0 A\x80q!@ AF@ \r( \r,\0\v" A\0H"\x1B"AK@ (\0! Ak"@ \r(\0 \r \x1BAj \xFC
|
|
\0\0\v j6\0\v A\xB0q"AG@ A F\x7F (\0 \0\v6\0\v@@@@@@ \b j-\0\0\0\v (\x006\0\f\v (\x006\0 A (\0(\0! (\0"Aj6\0 :\0\0\f\v \r( \r,\0\v" A\0H"\x1BE\r \r(\0 \r \x1B-\0\0! (\0"Aj6\0 :\0\0\f\v E\r \f( \f,\0\v" A\0H"\x1B"E\r (\0! @ \f(\0 \f \x1B \xFC
|
|
\0\0\v j6\0\f\v (\b! (\0 \x07j"!@@ M\r\0 ,\0\0"A\0H\r\0 Atj-\0\0A\xC0\0qE\r\0 Aj!\f\v\v "A\0J@@ E OrE@ Ak! Ak"-\0\0! (\0"Aj6\0 :\0\0\f\v\v \x7F A0 (\0(\0A\0\v!@ (\0"Aj6\0 A\0LE@ :\0\0 Ak!\f\v\v :\0\0\v@ F@ A0 (\0(\0! (\0"Aj6\0 :\0\0\f\v \v( \v,\0\v" A\0H"\x1B\x7F \v(\0 \v \x1B,\0\0A\x7F\v!A\0!A\0!@ F\r@ G@ !\f\v (\0"Aj6\0
|
|
:\0\0A\0! Aj" \v( \v,\0\v" A\0H\x1BO@ !\f\vA\x7F! \v(\0" \v A\0H"\x1B j-\0\0A\xFF\0F\r\0 \v \x1B j,\0\0!\v Ak"-\0\0! (\0"Aj6\0 :\0\0 Aj!\f\0\v\0\v (\0c\v Aj!\f\v\v\v\x8A\x7F#\0Ak"
|
|
$\0@ \0@ \x83!\f\v \x82!\v@ @
|
|
Aj"\0 (\0(,\0
|
|
(6\0\0 \0 (\0( \0\f\v
|
|
Aj"\0 (\0((\0
|
|
(6\0\0 \0 (\0(\0\v \b \0X \0 (\0(\f\0\0:\0\0 (\0(\0\0:\0\0
|
|
Aj"\0 (\0(\0 \0X \0 \0 (\0(\0 \x07 \0X \0 (\0($\0\x006\0
|
|
Aj$\0\v
|
|
\0 \0A\xA4\xDE^\v
|
|
\0 \0A\xAC\xDE^\v\xD7\x7F@A\xF6\xFF\xFF\xFF k O@ \0,\0\vA\0H! \0(\0A\xF7\xFF\xFF\xFF! A\xF2\xFF\xFF\xFFM@ j" At" K\x1BArAj!\v \0 \x1B! U!@ E\r\0 At"\x07E\r\0 \x07\xFC
|
|
\0\0\v@ F\r\0 kAt"\x07E\r\0 At" j j \x07\xFC
|
|
\0\0\v AG@ !\v \0 6\0 \0 A\x80\x80\x80\x80xr6\b\f\v0\0\v \0 6\v\xD8\x7F#\0A\x90k"\v$\0 \v
|
|
6\x88 \v 6\x8C@ \0 \vA\x8Cj(@ (\0Ar6\0A\0!\0\f\v \vA\xE3\x006l \v \vA\xF0\0j"6h \v 6d \v \vA\x80j6\` \vA\x006P \vB\x007H \vA\x006@ \vB\x0078 \vA\x0060 \vB\x007( \vA\x006 \vB\x007 \vA\x006 \vB\x007\b \vA\xC8\0j \vA8j!\f \vA(j \vAj#\0Ak"
|
|
$\0@ @
|
|
Aj" \xFE" (\0(,\0\f\v
|
|
Aj" \xFD" (\0(,\0\v \v
|
|
(6\0\\ (\0( \0 | (\0(\0 | \v (\0(\f\0\x006X \v (\0(\0\x006T (\0(\0 X (\0(\0 \f | \v (\0($\0\x006
|
|
Aj$\0 \b(\x006\0 A\x80q!A\0!A\0!
|
|
@
|
|
!@@\x7F@@@@ AF\r\0 \0 \vA\x8Cj(\r\0A\0!@@@@@@ \vA\xDC\0j j"\f-\0\0\0\f\v AF\r
|
|
\x07A \0: \x07(\0(\f\0\r\x07 (\0Ar6\0A\0!\0\f\v AG\r\x07\f \v@ \v(, \v,\x003" A\0H\x1BE\r\0 \0: \v(( \vA(j" \v,\x003"A\0H\x1B(\0G\r\0 \0Q A\0:\0\0 \v(, \v,\x003" A\0H\x1BAK\x1B!
|
|
\f
|
|
\v \v( \v,\0#"
|
|
|
|
A\0H\x1B@ \0: \v( \vAj \v,\0#"
|
|
A\0H\x1B(\0F\r \v-\x003!\v \v(
|
|
|
|
A\0H\x1B!@ \v(, A\xFFq \xC0A\0H\x1B"@ E\r (\0Ar6\0A\0!\0\f\v E\r \v A\0G:\0\0\f\b\v AIrrE@A\0!
|
|
AF \v-\0_A\0GqE\r \v \v(8" \vA8j \v,\0C"
|
|
A\0H\x1B!@ E\r\0 \fAk-\0\0AK\r\0@@ \vA8j
|
|
\xC0A\0H"\f\x1B \v(<
|
|
A\xFFq \f\x1BAtjF\r\0 \x07A (\0 \x07(\0(\f\0 \v(8! \v-\0C!
|
|
E\r\0 Aj!\f\v\v \vA8j
|
|
\xC0A\0H\x1B"\fkAu"\r \v(\f \v,\0" A\0H"\x1B"M\x7F At \v(\b \vA\bj \x1Bj"
|
|
\rAtk!#\0Ak"\r$\0 \f
|
|
kA|qhE \rAj$\0\r \v-\0C!
|
|
\v(8 \v \vA8j
|
|
\xC0A\0H\x1B!\v@@ \v(8 \vA8j \v,\0C"A\0H"
|
|
\x1B \v(<
|
|
\x1BAtjF\r\0 \0 \vA\x8Cj(\r\0 \0: (\0G\r\0 \0Q Aj!\f\v\v E\r\x07 !
|
|
\v(8 \vA8j \v,\0C"A\0H"\x1B \v(< \x1BAtjF\r\b (\0Ar6\0A\0!\0\f\v@@ \0 \vA\x8Cj(\r\0\x7F \x07A\xC0\0 \0:"
|
|
\x07(\0(\f\0@ (\0" \v(\x88F@ \b \vA\x88jk (\0!\v Aj6\0
|
|
6\0 Aj\f\v \v(L \v,\0S" A\0H\x1BE Er\r
|
|
\v(TG\r \v(d"
|
|
\v(\`F@ \vA\xE8\0j \vA\xE4\0j \vA\xE0\0jk \v(d!
|
|
\v \v
|
|
Aj6d
|
|
6\0A\0\v! \0Q\f\v\v E \v(d"
|
|
\v(hFrE@ \v(\`
|
|
F@ \vA\xE8\0j \vA\xE4\0j \vA\xE0\0jk \v(d!
|
|
\v \v
|
|
Aj6d
|
|
6\0\v@ \v(A\0L\r\0@ \0 \vA\x8Cj(E@ \0: \v(XF\r\v (\0Ar6\0A\0!\0\f\v@ \0Q \v(A\0L\r@ \0 \vA\x8Cj(E@ \x07A\xC0\0 \0: \x07(\0(\f\0\r\v (\0Ar6\0A\0!\0\f\v (\0 \v(\x88F@ \b \vA\x88jk\v \0:! (\0"Aj6\0 6\0 \v \v(Ak6\f\0\v\0\v !
|
|
(\0 \b(\0G\r\x07 (\0Ar6\0A\0!\0\f\v \0Q A:\0\0 \vAj \v( \v,\0#" A\0H\x1BAK\x1B!
|
|
\f\v@ E\r\0A!\x07@ \x07 ( ,\0\v" A\0H\x1BO\r@ \0 \vA\x8Cj(E@ \0: \x07At (\0 ,\0\vA\0H\x1Bj(\0F\r\v (\0Ar6\0A\0!\0\f\v \0Q \x07Aj!\x07\f\0\v\0\vA!\0 \v(h" \v(d"F\r\0A\0!\0 \vA\x006\0 \vA\xC8\0j \v5 \v(\0@ (\0Ar6\0\f\vA!\0\v \vA\bj \vAj \vA(j \vA8j \vA\xC8\0j \v(h! \vA\x006h E\r \v(l\0\f\vA\0\f\vA\v!@ E@ \vA\bj \0(\0B\xDDA!\f\v \0 \vA\x8Cj(\r \x07A \0: \x07(\0(\f\0E\rA\0!\f\0\v\0\v !
|
|
\v Aj!\f\0\v\0\v \vA\x90j$\0 \0\v\0 \0@ \01\v \0!\v
|
|
\0 \0A\x94\xDE^\v
|
|
\0 \0A\x9C\xDE^\v\xB8\x7F (\0!\x07A\0 \0(\0" \0(A\xE3\0F"\x1BA\x7FA (\0 k"At" AM\x1B A\xFF\xFF\xFF\xFF\x07O\x1B"\b\x9D"@@ E@ \0 6\0\f\v \0(\0! @ \xFC
|
|
\0\0\v \0 6\0 E\r\0 \0(\0 \0(\0!\v \0A\xE4\x006 \x07 kj6\0 \0(\0 \bj6\0\v0\0\v\xEE\x7F#\0A\x90k"\v$\0 \v
|
|
6\x88 \v 6\x8C@ \0 \vA\x8Cj)@ (\0Ar6\0A\0!\0\f\v \vA\xE3\x006l \v \vA\xF0\0j"6h \v 6d \v \vA\x80j6\` \vA\x006P \vB\x007H \vA\x006@ \vB\x0078 \vA\x0060 \vB\x007( \vA\x006 \vB\x007 \vA\x006 \vB\x007\b \vA\xC8\0j \vA8j! \vA(j \vAj#\0Ak"
|
|
$\0@ @
|
|
Aj" \x83" (\0(,\0\f\v
|
|
Aj" \x82" (\0(,\0\v \v
|
|
(6\0\\ (\0( \0 X (\0(\0 X \v (\0(\f\0\0:\0[ \v (\0(\0\0:\0Z (\0(\0 X (\0(\0 X \v (\0($\0\x006
|
|
Aj$\0 \b(\x006\0 A\x80q!A\0!A\0!
|
|
@@
|
|
!@@@@@@@\x7F@@@ AF\r\0 \0 \vA\x8Cj)\r\0A\0!@@@@@@ \vA\xDC\0j j"\f-\0\0\0\v AF\r\r \0;"A\0N@ \x07(\b Atj-\0\0Aq\r\x07\v (\0Ar6\0A\0!\0\f\v AG\r\f\f\v@ \v(, \v,\x003" A\0H\x1BE\r\0 \0;A\xFFq \v(( \vA(j" \v,\x003"A\0H\x1B-\0\0G\r\0 \0S A\0:\0\0 \v(, \v,\x003" A\0H\x1BAK\x1B!
|
|
\f\v \v( \v,\0#"
|
|
|
|
A\0H\x1B@ \0;A\xFFq \v( \vAj \v,\0#"
|
|
A\0H\x1B-\0\0F\r \v-\x003!\v \v(
|
|
|
|
A\0H\x1B!@ \v(, A\xFFq \xC0A\0H\x1B"@ E\r (\0Ar6\0A\0!\0\f\v E\r\f\v A\0G:\0\0\f\v\v AIrrE@A\0!
|
|
AF \v-\0_A\0GqE\r\r\v \v(8" \vA8j \v,\0C"\rA\0H"\x1B! E\r\b \fAk-\0\0AK\r\b \v(< \r \x1Bj! \x07(\b!\f !
|
|
@
|
|
F\r\b
|
|
,\0\0"A\0H\r\x07 \f Atj-\0\0AqE\r\x07
|
|
Aj!
|
|
\f\0\v\0\v@@ \0 \vA\x8Cj)\r\0\x7F@ \0;"
|
|
A\0H\r\0 \x07(\b
|
|
Atj-\0\0A\xC0\0qE\r\0 (\0" \v(\x88F@ \b \vA\x88j\x84 (\0!\v Aj6\0
|
|
:\0\0 Aj\f\v \v(L \v,\0S" A\0H\x1BE Er\r \v-\0Z
|
|
A\xFFqG\r \v(d"
|
|
\v(\`F@ \vA\xE8\0j \vA\xE4\0j \vA\xE0\0jk \v(d!
|
|
\v \v
|
|
Aj6d
|
|
6\0A\0\v! \0S\f\v\v E \v(d"
|
|
\v(hFrE@ \v(\`
|
|
F@ \vA\xE8\0j \vA\xE4\0j \vA\xE0\0jk \v(d!
|
|
\v \v
|
|
Aj6d
|
|
6\0\v@ \v(A\0L\r\0@ \0 \vA\x8Cj)E@ \0;A\xFFq \v-\0[F\r\v (\0Ar6\0A\0!\0\f\v@ \0S \v(A\0L\r@@ \0 \vA\x8Cj)\r\0 \0;"A\0H\r\0 \x07(\b Atj-\0\0A\xC0\0q\r\v (\0Ar6\0A\0!\0\f\v (\0 \v(\x88F@ \b \vA\x88j\x84\v \0;! (\0"Aj6\0 :\0\0 \v \v(Ak6\f\0\v\0\v !
|
|
(\0 \b(\0G\r\v (\0Ar6\0A\0!\0\f\f\v \0S A:\0\0 \vAj \v( \v,\0#" A\0H\x1BAK\x1B!
|
|
\f
|
|
\v@ E\r\0A!@ ( ,\0\v" A\0H\x1BO\r@ \0 \vA\x8Cj)E@ \0;A\xFFq (\0 ,\0\vA\0H\x1B j-\0\0F\r\v (\0Ar6\0A\0!\0\f\r\v \0S Aj!\f\0\v\0\vA!\0 \v(h" \v(d"F\r
|
|
A\0!\0 \vA\x006\0 \vA\xC8\0j \v5 \v(\0@ (\0Ar6\0\f\v\vA!\0\f
|
|
\vA\0\f\vA\v!@ E@ \vA\bj \0(\0@\xC0\xAAA!\f\v \0 \vA\x8Cj)\r \0;"A\0H\r \x07(\b Atj-\0\0AqE\rA\0!\f\0\v\0\v
|
|
!\v k"
|
|
\v(\f \v,\0"\f \fA\0H"\f\x1B"M@ \v(\b \vA\bj \f\x1B j"\r
|
|
k"
|
|
\r
|
|
khE\r \v(8! \v-\0C!\r\v \vA8j \r\xC0A\0H\x1B!\f\v !\v@@ \v(8 \vA8j \v,\0C"A\0H"
|
|
\x1B \v(<
|
|
\x1BjF\r\0 \0 \vA\x8Cj)\r\0 \0;A\xFFq -\0\0G\r\0 \0S Aj!\f\v\v \r\v !
|
|
\f\v !
|
|
\v(8 \vA8j \v,\0C"A\0H"\x1B \v(< \x1BjF\r\0 (\0Ar6\0A\0!\0\f\v Aj!\f\v\v \vA\bj \vAj \vA(j \vA8j \vA\xC8\0j \v(h! \vA\x006h E\r\0 \v(l\0\v \vA\x90j$\0 \0\v\v\0 \0AA-\xDF\v\v\0 \0AA-\xE1\vd\x7F#\0Ak"$\0 A\0:\0 :\0 :\0\r A%:\0\f @ :\0 :\0\r\v (\0 k A\fj \0(\0\xB4 j6\0 Aj$\0\vA\0 AN! -\0\0AqE@ \0 A\xD0j A\xECj A\xE4\0I\x1B A\xC5\0H\x1BA\xECk6\0\v\v@\0 \0A\bj \0(\b(\0\0"\0 \0A\xA0j A\0\x95 \0k"\0A\x9FL@ \0A\fmA\fo6\0\v\v@\0 \0A\bj \0(\b(\0\0\0"\0 \0A\xA8j A\0\x95 \0k"\0A\xA7L@ \0A\fmA\x07o6\0\v\vA\0 AO! -\0\0AqE@ \0 A\xD0j A\xECj A\xE4\0I\x1B A\xC5\0H\x1BA\xECk6\0\v\v@\0 \0A\bj \0(\b(\0\0"\0 \0A\xA0j A\0\x97 \0k"\0A\x9FL@ \0A\fmA\fo6\0\v\v@\0 \0A\bj \0(\b(\0\0\0"\0 \0A\xA8j A\0\x97 \0k"\0A\xA7L@ \0A\fmA\x07o6\0\v\v\0A\v\xBD\x7F#\0Ak"
|
|
$\0 =!
|
|
Aj n"\f \f(\0(\0 6\0@@ \0"\b-\0\0"A+k\0\0\v \xC0 (\0(,\0! (\0"\x07Aj6\0 \x07 6\0 \0Aj!\b\v@@ \b"kAL\r\0 -\0\0A0G\r\0 -\0A rA\xF8\0G\r\0 A0 (\0(,\0!\x07 (\0"\bAj6\0 \b \x076\0 ,\0 (\0(,\0!\x07 (\0"\bAj6\0 \b \x076\0 Aj"\b!@ M\r ,\0\0*!\xB8E\r Aj!\f\0\v\0\v@ M\r ,\0\0*!\xB7E\r Aj!\f\0\v\0\v@
|
|
(\b
|
|
,\0"\x07 \x07A\0H\x1BE@ \b (\0 (\0(0\0 (\0 \bkAtj6\0\f\v \b c \f \f(\0(\0\0! \b!\x07@ \x07M@ \b \0kAtj (\0\x8F@
|
|
("
|
|
Aj"
|
|
,\0A\0H"\x1B \rj,\0\0A\0L\r\0 \v \x1B \rj,\0\0G\r\0 (\0"\vAj6\0 \v 6\0A\0!\v \r \r
|
|
(\b
|
|
,\0" A\0H\x1BAkIj!\r\v \x07,\0\0 (\0(,\0! (\0"Aj6\0 6\0 \x07Aj!\x07 \vAj!\v\f\v\v\v@@@ M\r Aj!\x07 ,\0\0"A.G@ (\0(,\0! (\0"\bAj6\0 \b 6\0 \x07!\f\v\v \f \f(\0(\f\0\0! (\0"\bAj"\v6\0 \b 6\0\f\v (\0!\v !\x07\v \x07 \v (\0(0\0 (\0 \x07kAtj"6\0 \0kAtj F\x1B6\0
|
|
Aj
|
|
Aj$\0\v\xC4\x7F#\0A\x90k"$\0A\bAA
|
|
("A\xCA\0q"\x07A\bF\x1B \x07A\xC0\0F"\b\x1B! A\x83j!@ E A\x80qEr\r\0 \b@ A0:\0\x83 A\x84j!\f\v \x07A\bG\r\0 A0:\0\x83 A\xD8\0A\xF8\0 A\x80\x80q\x1B:\0\x84 A\x85j!\v A\xF8\0j A\x90j \x94 (x!@ A\x88\x80qA\x88\x80G\r\0@ F\r -\0\0"A k A\xE1\0kA\xFFqAI\x1B:\0\0 Aj!\f\0\v\0\v A\x83j" G! Aj"\x07 $ Aj" A\fj A\bj \x07\x90 (# \0 (\f (\b \\ A\x90j$\0\vC\x7F#\0Ak"$\0 6\fA\xB0 A\xF0\xC7A\xCB,A A\fj"4A\xF0\xC7A\xCF,A 4 Aj$\0 \0\v\xAC\x7F#\0Ak"
|
|
$\0 >!
|
|
Aj p"\f \f(\0(\0 6\0@@ \0"\b-\0\0"A+k\0\0\v \xC0 (\0(\0! (\0"\x07Aj6\0 \x07 :\0\0 \0Aj!\b\v@@ \b"kAL\r\0 -\0\0A0G\r\0 -\0A rA\xF8\0G\r\0 A0 (\0(\0!\x07 (\0"\bAj6\0 \b \x07:\0\0 ,\0 (\0(\0!\x07 (\0"\bAj6\0 \b \x07:\0\0 Aj"\b!@ M\r ,\0\0*!\xB8E\r Aj!\f\0\v\0\v@ M\r ,\0\0*!\xB7E\r Aj!\f\0\v\0\v@
|
|
(\b
|
|
,\0"\x07 \x07A\0H\x1BE@ \b (\0 (\0( \0 (\0 \bkj6\0\f\v \b c \f \f(\0(\0\0! \b!\x07@ \x07M@ \b \0kj (\0c@
|
|
("
|
|
Aj"
|
|
,\0A\0H"\x1B \rj,\0\0A\0L\r\0 \v \x1B \rj,\0\0G\r\0 (\0"\vAj6\0 \v :\0\0A\0!\v \r \r
|
|
(\b
|
|
,\0" A\0H\x1BAkIj!\r\v \x07,\0\0 (\0(\0! (\0"Aj6\0 :\0\0 \x07Aj!\x07 \vAj!\v\f\v\v\v@@@ M@ !\x07\f\v Aj!\x07 ,\0\0"A.G\r \f \f(\0(\f\0\0! (\0"\bAj6\0 \b :\0\0\v \x07 (\0 (\0( \0 (\0 \x07kj"6\0 \0kj F\x1B6\0
|
|
Aj
|
|
Aj$\0\v (\0(\0! (\0"\bAj6\0 \b :\0\0 \x07!\f\0\v\0\v\xB9\x7F#\0A@j"$\0A\bAA
|
|
("A\xCA\0q"\x07A\bF\x1B \x07A\xC0\0F"\b\x1B! A3j!@ E A\x80qEr\r\0 \b@ A0:\x003 A4j!\f\v \x07A\bG\r\0 A0:\x003 A\xD8\0A\xF8\0 A\x80\x80q\x1B:\x004 A5j!\v A(j A@k \x94 ((!@ A\x88\x80qA\x88\x80G\r\0@ F\r -\0\0"A k A\xE1\0kA\xFFqAI\x1B:\0\0 Aj!\f\0\v\0\v A3j" G! Aj"\x07 $ Aj" A\fj A\bj \x07\x93 (# \0 (\f (\b Z A@k$\0\v\xED\b\x7F#\0Ak"$\0A\xA5\bAA\xA0 A\xEE AAA\0A\0\fA\x92\fAA\xF4 A\xA8!AAA\0A\0\fA\x88\xCE-\0\0E@A\x88\xCEA:\0\0A\xAC!A\xB8\xC8\x07\vA\xFC A\x9C%A\xD4%A\0A\x8A&AA\x8D&A\0A\x8D&A\0A\x83A\x8F&A\x07
|
|
A\xFC AA\x94&A\x98&A"A\b#\0Ak"\0$\0 \0A 6\fA\xFC A\x9CAA\x9C&A\xA8&A# \0A\fj4A\0A\0A\0 \0Aj$\0#\0Ak"\0$\0 \0A
|
|
6\fA\xFC A\xEDAA\xB0&A\xC0&A$ \0A\fj4A\0A\0A\0 \0Aj$\0#\0Ak"\0$\0 \0A\v6\fA\xFC A\x83AA\xC8&A\xD0&A% \0A\fj4A\0A\0A\0 \0Aj$\0#\0Ak"\0$\0 \0A\f6\fA\xFC A\xBF
|
|
AA\xF8&A\x84'A& \0A\fj4A\0A\0A\0 \0Aj$\0#\0Ak"\0$\0 \0A\r6\fA\xFC A\xBB
|
|
AA\x90'A\xA0'A' \0A\fj4A\0A\0A\0 \0Aj$\0A\xFC A\xB8\xC8A\x83A\xBF
|
|
A\x94\xCE-\0\0E@A\x94\xCEA:\0\0A\xA8'A\xC0\xC7\x07\vA\xB4*A\xE0*A\x98+A\0A\xCE+AA\x8D&A\0A\x8D&A\0A\xD7A\xD1+A
|
|
A\xB4*AA\xD4+A\xD8+A(A#\0Ak"\0$\0 \0A6\fA\xB4*A\x9CAA\xDC+A\xE8+A) \0A\fj4A\0A\0A\0 \0Aj$\0#\0Ak"\0$\0 \0A6\fA\xB4*A\xEDAA\xF0+A\x80,A* \0A\fj4A\0A\0A\0 \0Aj$\0#\0Ak"\0$\0 \0A6\fA\xB4*A\x83AA\x88,A\x90,A+ \0A\fj4A\0A\0A\0 \0Aj$\0#\0Ak"\0$\0 \0A6\fA\xB4*A\xBF
|
|
AA\x9C,A\xA8,A, \0A\fj4A\0A\0A\0 \0Aj$\0#\0Ak"\0$\0 \0A6\fA\xB4*A\xBB
|
|
AA\xB0,A\xC0,A- \0A\fj4A\0A\0A\0 \0Aj$\0A\xB4*A\xC0\xC7A\x83A\xBF
|
|
A\xB0 A\xA9A\xC6,AA\xC8,A\b AjA\xEB
|
|
A\0\x92A\xB6A\x92#\0Ak"\0$\0 \0A\b6\fA\xB0 A\xC2A\xA8\xC7A\xD4,A \0A\fj"4A\xA8\xC7A\xD8,A\x1B 4 \0Aj$\0A\x8A\vA\flA\xDF\vAlA\x94\vA$lA\xE6\vA0lA\xF5
|
|
A<lA\xC8A\xC8\0lA\xB0 A\xE8,A\x94AAA\0A\xE8,A\xA3A\0A\xE8,A\xBDAA\xE8,A\xB9AA\xE8,A\xB5AA\xE8,A\xB1AA\xE8,A\x9FAA\xE8,A\x9BAA\xE8,A\x93A\x07A\xE8,A\x8FA\bA\xD0 A\xFC
|
|
A\x89-AA\x8B-A\b#\0Ak"\0$\0 \0A\x006\fA\xD0 A\x83A\xE8,A\x8E-A \0A\fj"4A\xE8,A\x92-A! 4 \0Aj$\0A\xD0 Aj$\0\v3\x7F \0("j!@ F@ \0 6 A\0:\0\0 Aj!\f\v\v\v\xF1\x7F#\0A\xD0k"\0$\0 \0 6\xC8 \0 6\xCC R! \0A\xD0j~! \0A\xC4j \0A\xC4j} \0A\x006\xC0 \0B\x007\xB8 \0A\xB8j"A
|
|
" \0 \0(\xB8 \0,\0\xC3A\0H\x1B"6\xB4 \0 \0Aj6\f \0A\x006\b@@ \0A\xCCj \0A\xC8j(\r\0 \0(\xB4 \0(\xBC \0,\0\xC3" A\0H\x1B"jF@ \0A\xB8j" At" A
|
|
\0(\xC0A\xFF\xFF\xFF\xFF\x07qAk \0,\0\xC3A\0N\x1B" \0 \0(\xB8 \0,\0\xC3A\0H\x1B" j6\xB4\v \0(\xCCC \0A\xB4j \0A\bj \0(\xC4 \0A\xC4j \0Aj \0A\fj m\r\0 \0(\xCCB\f\v\v@ \0(\xC8 \0,\0\xCF" A\0H\x1BE\r\0 \0(\f" \0AjkA\x9FJ\r\0 \0 Aj6\f \0(\b6\0\v \0(\xB4 \x9D6\0 \0A\xC4j \0Aj \0(\f 5 \0A\xCCj \0A\xC8j(@ (\0Ar6\0\v \0(\xCC \0A\xB8j \0A\xC4j \0A\xD0j$\0\v8\x7F#\0Ak"$\0 6\f H6\b \0A\xEC\r (\f\xA9 A\bjI Aj$\0\v\xB1~\x7F#\0A k"\b$\0@@@ G@A\xF8\xD7(\0!\fA\xF8\xD7A\x006\0#\0Ak" $\0*#\0Ak"
|
|
$\0#\0Ak"\v$\0 \v \bAjA\xBA \v)\0!
|
|
\v)\b7\b
|
|
7\0 \vAj$\0
|
|
)\0!
|
|
)\b7\b 7\0
|
|
Aj$\0 )\0! \b )\b7 \b 7\b Aj$\0 \b)! \b)\b!A\xF8\xD7(\0"E\r \b( G\r ! !\x07 A\xC4\0G\r\f\v A6\0\f\vA\xF8\xD7 \f6\0 \b( F\r\v A6\0 ! \x07!\v \0 7\0 \0 7\b \bA j$\0\v\xC0\x7F|#\0Ak"$\0@@@ \0 G@A\xF8\xD7(\0!A\xF8\xD7A\x006\0*#\0Ak"$\0 \0 A\fjA\xBA )\0 )\b\xC4! Aj$\0@A\xF8\xD7(\0"\0@ (\f F\r\f\vA\xF8\xD7 6\0 (\f G\r\f\v \0A\xC4\0G\r\f\v A6\0\f\vD\0\0\0\0\0\0\0\0!\v A6\0\v Aj$\0 \v\xBC\x7F}#\0Ak"$\0@@@ \0 G@A\xF8\xD7(\0!A\xF8\xD7A\x006\0*#\0Ak"$\0 \0 A\fjA\0\xBA )\0 )\b\xAB! Aj$\0@A\xF8\xD7(\0"\0@ (\f F\r\f\vA\xF8\xD7 6\0 (\f G\r\f\v \0A\xC4\0G\r\f\v A6\0\f\vC\0\0\0\0!\v A6\0\v Aj$\0 \v\xBD\x7F~#\0Ak"$\0~ \0 G@@@ \0-\0\0"A-G\r\0 \0Aj"\0 G\r\0\f\vA\xF8\xD7(\0!A\xF8\xD7A\x006\0* \0 A\fj \xBB!\x07@A\xF8\xD7(\0"\0@ (\f G\r \0A\xC4\0G\r A6\0B\x7F\f\vA\xF8\xD7 6\0 (\f F\r\0\f\vB\0 \x07} \x07 A-F\x1B\f\v\v A6\0B\0\v Aj$\0\v\xD8\x7F~#\0Ak"$\0\x7F@ \0 G@@@ \0-\0\0"A-G\r\0 \0Aj"\0 G\r\0\f\vA\xF8\xD7(\0!A\xF8\xD7A\x006\0* \0 A\fj \xBB!\x07@A\xF8\xD7(\0"\0@ (\f G\r \0A\xC4\0F \x07B\xFF\xFF\xFF\xFFVr\r\f\vA\xF8\xD7 6\0 (\fG\r \x07B\x80\x80\x80\x80T\r\v A6\0A\x7F\f\v\v A6\0A\0\f\vA\0 \x07\xA7"\0k \0 A-F\x1B\v Aj$\0\v\xE6\0#\0A\xE0k"\0$\0 \0 6\xD8 \0 6\xDC R! \0A\xC8j \0A\xD7j\x7F \0A\x006\xC0 \0B\x007\xB8 \0A\xB8j"A
|
|
" \0 \0(\xB8 \0,\0\xC3A\0H\x1B"6\xB4 \0 \0Aj6\f \0A\x006\b@@ \0A\xDCj \0A\xD8j)\r\0 \0(\xB4 \0(\xBC \0,\0\xC3" A\0H\x1B"jF@ \0A\xB8j" At" A
|
|
\0(\xC0A\xFF\xFF\xFF\xFF\x07qAk \0,\0\xC3A\0N\x1B" \0 \0(\xB8 \0,\0\xC3A\0H\x1B" j6\xB4\v \0(\xDCA\xC0 \0A\xB4j \0A\bj \0,\0\xD7 \0A\xC8j \0Aj \0A\fjA\xD0\x85o\r\0 \0(\xDC@\f\v\v@ \0(\xCC \0,\0\xD3" A\0H\x1BE\r\0 \0(\f" \0AjkA\x9FJ\r\0 \0 Aj6\f \0(\b6\0\v \0(\xB4 \x9D6\0 \0A\xC8j \0Aj \0(\f 5 \0A\xDCj \0A\xD8j)@ (\0Ar6\0\v \0(\xDC \0A\xB8j \0A\xC8j \0A\xE0j$\0\v\xDB\x7F~#\0Ak"$\0\x7F@ \0 G@@@ \0-\0\0"A-G\r\0 \0Aj"\0 G\r\0\f\vA\xF8\xD7(\0!A\xF8\xD7A\x006\0* \0 A\fj \xBB!\x07@A\xF8\xD7(\0"\0@ (\f G\r \0A\xC4\0F \x07B\xFF\xFFVr\r\f\vA\xF8\xD7 6\0 (\fG\r \x07B\x80\x80T\r\v A6\0A\xFF\xFF\f\v\v A6\0A\0\f\vA\0 \x07\xA7"\0k \0 A-F\x1B\v Aj$\0A\xFF\xFFq\v\xAC\x7F~#\0Ak"$\0@ \0 G@A\xF8\xD7(\0!A\xF8\xD7A\x006\0* \0 A\fj \xA3!@A\xF8\xD7(\0"\0@ (\f G\r \0A\xC4\0G\r A6\0B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0B\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7F B\0U\x1B!\f\vA\xF8\xD7 6\0 (\f F\r\v\v A6\0B\0!\v Aj$\0 \v\xDD\x7F~#\0Ak"$\0\x7F@ \0 G@@A\xF8\xD7(\0!A\xF8\xD7A\x006\0* \0 A\fj \xA3!@A\xF8\xD7(\0"\0@ (\f G\r \0A\xC4\0G\r A6\0A\xFF\xFF\xFF\xFF\x07 B\0U\r\f\vA\xF8\xD7 6\0 (\f F\r\0\f\v B\xFF\xFF\xFF\xFFwW@ A6\0\f\v B\x80\x80\x80\x80\bY@ A6\0A\xFF\xFF\xFF\xFF\x07\f\v \xA7\f\v\v A6\0A\0\f\vA\x80\x80\x80\x80x\v Aj$\0\v\x88\x7F@ kAu"A\xF7\xFF\xFF\xFFI@@ AM@ \0 :\0\v\f\v Ar"AjU! \0 A\xFF\xFF\xFF\xFF\x07k6\b \0 6\0 \0 6 !\0\v k"E FrE@ \0 \xFC
|
|
\0\0\v \0 jA\x006\0\f\v0\0\v\v\0 \0 B\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7F\xBE\v\x86\b\x7F (\0!@@@@@@@\x7F@@@@ E\r\0 (\0"E\r\0 \0E@ !\f\v A\x006\0 !\f\v@A\xCC\xCF(\0(\0E@ \0E\r E\r\f !@ ,\0\0"@ \0 A\xFF\xBFq6\0 \0Aj!\0 Aj! Ak"\r\f\v\v \0A\x006\0 A\x006\0 k\v ! \0E\r\f\v y\vA!\x07\f\vA\0\f\vA\v!\x07@ \x07E@ -\0\0Av"Ak Au jrA\x07K\r\x7F Aj" A\x80\x80\x80qE\r\0 ,\0\0A@N@ Ak!\f\x07\v Aj" A\x80\x80 qE\r\0 ,\0\0A@N@ Ak!\f\x07\v Aj\v! Ak!A!\x07\f\v@@ Aq ,\0\0"A\0Lr\r\0 (\0"A\x81\x82\x84\bk rA\x80\x81\x82\x84xq\r\0@ Ak! "Aj! ("A\x81\x82\x84\bk rA\x80\x81\x82\x84xqE\r\0\v\v \xC0A\0J@ Ak! Aj!\f\v\v A\xFFqA\xC2k"A2K\r Aj! At(\x80\x84!A\0!\x07\f\0\v\0\v@ \x07E@ E\r\x07@@ -\0\0"\x07\xC0"A\0L\r\0 Aq AIrE@@@ (\0"A\x81\x82\x84\bk rA\x80\x81\x82\x84xq\r \0 A\xFFq6\0 \0 -\06 \0 -\06\b \0 -\06\f \0Aj!\0 Aj! Ak"AK\r\0\v -\0\0!\v A\xFFq!\x07 \xC0A\0L\r\v \0 \x076\0 \0Aj!\0 Aj! Ak"\r\f \v\v \x07A\xC2k"A2K\r Aj! At(\x80\x84!A!\x07\f\v -\0\0"\bAv"Ak AujrA\x07K\r@@\x7F Aj" \bA\x80k Atr"\x07A\0N\r\0 -\0\0A\x80k"A?K\r \x07At"\br!\x07 Aj" \bA\0N\r\0 -\0\0A\x80k"A?K\r \x07Atr!\x07 Aj\v! \0 \x076\0 Ak! \0Aj!\0\f\vA\xF8\xD7A6\0 Ak!\f\vA\0!\x07\f\0\v\0\v Ak! \r -\0\0!\v A\xFFq\r\0 \0@ \0A\x006\0 A\x006\0\v k\vA\xF8\xD7A6\0 \0E\r\v 6\0\vA\x7F\v 6\0 \v#\x7F \0!@ "Aj! (\0\r\0\v \0kAu\v\0 \0\xBA@ \0!\v\v%\x7F#\0Ak"$\0 6\f \0A\xE9 \xA9 Aj$\0\v3\x7F A\x80\x80\x80\x80O@\x85\0\v \0 U"6 \0 6\0 \0 Atj6\b\v\xC9\x7F~#\0A\x90k"$\0 A\0A\x90\xFC\v\0 A\x7F6L \x006, A\xE2\x006 \x006T ! !#\0A\xB0k"$\0 (L@@ (E@ \xC8 (E\r\v -\0\0"E\r@@@@@ A\xFFq"\0_@@ "Aj! -\0_\r\0\v B\0J@\x7F ("\0 (hG@ \0Aj6 \0-\0\0\f\v %\v_\r\0\v (! )pB\0Y@ Ak"6\v (,k\xAC )x ||!\f\v\x7F@@ \0A%F@ -\0"\0A*F\r \0A%G\r\v B\0J@ -\0\0A%F@@\x7F ("\0 (hG@ \0Aj6 \0-\0\0\f\v %\v"_\r\0\v Aj!\f\v ("\0 (hG@ \0Aj6 \0-\0\0!\f\v %!\v -\0\0 G@ )pB\0Y@ (Ak6\v A\0N \rr\r
|
|
\f \v ( (,k\xAC )x ||! !\f\vA\0!\x07 Aj\f\v@ \0A0k"\0A K\r\0 -\0A$G\r\0#\0Ak" 6\f \0AtjAk \0AK\x1B"\0Aj6\b \0(\0!\x07 Aj\f\v (\0!\x07 Aj! Aj\v!A\0!\vA\0! -\0\0"A0kA\xFFqA M@@ A
|
|
l A\xFFqjA0k! -\0! Aj! A0kA\xFFqA
|
|
I\r\0\v\v A\xFFqA\xED\0G\x7F A\0! \x07A\0G!\v -\0!A\0!
|
|
Aj\v"Aj!A!\0@@@@@@ A\xFFqA\xC1\0k: \0 \v Aj -\0A\xE8\0F"\0\x1B!A~A\x7F \0\x1B!\0\f\v Aj -\0A\xEC\0F"\0\x1B!AA \0\x1B!\0\f\vA!\0\f\vA!\0\f\vA\0!\0 !\vA \0 -\0\0"\0A/qAF"\x1B!@ \0A r \0 \x1B"\fA\xDB\0F\r\0@ \fA\xEE\0G@ \fA\xE3\0G\rA AL\x1B!\f\v \x07 \xAA\f\v B\0J@\x7F ("\0 (hG@ \0Aj6 \0-\0\0\f\v %\v_\r\0\v (! )pB\0Y@ Ak"6\v (,k\xAC )x ||!\v \xAC"J@ ("\0 (hG@ \0Aj6\f\v %A\0H\r\v )pB\0Y@ (Ak6\vA!@@@@@@@@@@@@ \fA\xD8\0k!\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\0\v \fA\xC1\0k"\0AKA \0tA\xF1\0qEr\r
|
|
\v A\bj A\0\xAD )xB\0 ( (,k\xAC}Q\r \x07E\r )! )\b! \x07 \v \fArA\xF3\0F@ A jA\x7FA\x81\xC6 A\0:\0 \fA\xF3\0G\r\b A\0:\0A A\0:\0. A\x006*\f\b\v A j -\0"\0A\xDE\0F"A\x81\xC6 A\0:\0 Aj Aj \x1B!\x7F@@ AA \x1Bj-\0\0"A-G@ A\xDD\0F\r \0A\xDE\0G!\b \f\v \0A\xDE\0G"\b:\0N\f\v \0A\xDE\0G"\b:\0~\v Aj\v!@@ -\0\0"\0A-G@ \0E\r \0A\xDD\0F\r
|
|
\f\vA-!\0 -\0"E A\xDD\0Fr\r\0 Aj!@ Ak-\0\0"M@ !\0\f\v@ Aj" A jj \b:\0\0 -\0\0"\0I\r\0\v\v !\v A j \0j \b:\0 Aj!\f\0\v\0\vA\b!\f\vA
|
|
!\f\vA\0!\vB\0!A\0!A\0!A\0!#\0Ak"\b$\0@ AG A$MqE@A\xF8\xD7A6\0\f\v@\x7F ("\0 (hG@ \0Aj6 \0-\0\0\f\v %\v"\0_\r\0\v@@ \0A+k\0\0\vA\x7FA\0 \0A-F\x1B! ("\0 (hG@ \0Aj6 \0-\0\0!\0\f\v %!\0\v@@@@ A\0G AGq \0A0GrE@\x7F ("\0 (hG@ \0Aj6 \0-\0\0\f\v %\v"\0A_qA\xD8\0F@A!\x7F ("\0 (hG@ \0Aj6 \0-\0\0\f\v %\v"\0A\xF1\x81j-\0\0AI\r )pB\0Y@ (Ak6\v B\0J\f\v \rA\b!\f\v A
|
|
\x1B" \0A\xF1\x81j-\0\0K\r\0 )pB\0Y@ (Ak6\v B\0JA\xF8\xD7A6\0\f\v A
|
|
G\r\0 \0A0k"A M@A\0!\0@ \0A
|
|
l j"\0A\x99\xB3\xE6\xCCI\x7F (" (hG@ Aj6 -\0\0\f\v %\vA0k"A Mq\r\0\v \0\xAD!\v A K\r B
|
|
~! \xAD!@@\x7F ("\0 (hG@ \0Aj6 \0-\0\0\f\v %\v"\0A0k"A M |"B\x9A\xB3\xE6\xCC\x99\xB3\xE6\xCCTqE@ A M\r\f\v B
|
|
~" \xAD"B\x7F\x85X\r\v\vA
|
|
!\f\v@@ Akq@ \0A\xF1\x81j-\0\0"K\r\f\v \0A\xF1\x81j-\0\0"M\r AlAvA\x07q,\0\xF1\x83!@ t"r! \x7F ("\0 (hG@ \0Aj6 \0-\0\0\f\v %\v"\0A\xF1\x81j-\0\0"M"E A\x80\x80\x80\xC0\0Iq\r\0\v \xAD! \rB\x7F \xAD"\x88" T\r@ \xADB\xFF\x83 \x86\x84! \x7F ("\0 (hG@ \0Aj6 \0-\0\0\f\v %\v"\0A\xF1\x81j-\0\0"M\r X\r\0\v\f\v@ lj! \x7F ("\0 (hG@ \0Aj6 \0-\0\0\f\v %\v"\0A\xF1\x81j-\0\0"M"E A\xC7\xE3\xF18Iq\r\0\v \xAD! \r \xAD!@ ~" \xADB\xFF\x83"B\x7F\x85V\r |! \x7F ("\0 (hG@ \0Aj6 \0-\0\0\f\v %\v"\0A\xF1\x81j-\0\0"M\r \b B\0 B\02 \b)\bP\r\0\v\v\v \0A\xF1\x81j-\0\0M\r\0@ \x7F ("\0 (hG@ \0Aj6 \0-\0\0\f\v %\vA\xF1\x81j-\0\0K\r\0\vA\xF8\xD7A\xC4\x006\0A\0!B\x7F!\v )pB\0Y@ (Ak6\v ArE B\x7FQq@A\xF8\xD7A\xC4\x006\0B~!\f\v \xAC"\x85 }!\v \bAj$\0 )xB\0 ( (,k\xAC}Q\r \x07E \fA\xF0\0GrE@ \x07 >\0\f\v \x07 \xAA\f\v \x07 \xAB8\0\f\v \x07 \xC49\0\f\v \x07 7\0 \x07 7\b\f\vA Aj \fA\xE3\0G"\x1B!\b\x7F AF@ \x07! \v@ \bAt/"E\r\v B\x007\xA8A\0!@@@ !\0@ \x7F (" (hG@ Aj6 -\0\0\f\v %\v"j-\0!E\r :\0\x1B Aj A\x1BjA A\xA8j\x98"A~F\r\0 A\x7FF@A\0! \f\v \0@ \0 Atj (6\0 Aj!\v \vE \bGr\r\0\v \0 \bAtAr"\bAt\x9D"\r\0\vA\0! \0!
|
|
A!\v\f\b\vA\0! \0 A\xA8j\x7F (\xA8A\0\vE\r\v \0!
|
|
\f\v \v@A\0! \b/"E\r@ !\0@ \x7F (" (hG@ Aj6 -\0\0\f\v %\v"j-\0!E@ \0! A\0\f\v \0 j :\0\0 Aj" \bG\r\0\v \0 \bAtAr"\b\x9D"\r\0\vA\0!
|
|
\0! A!\v\f\vA\0! \x07@@ \x7F ("\0 (hG@ \0Aj6 \0-\0\0\f\v %\v"\0j-\0!@ \x07j \0:\0\0 Aj!\f \x07"\0! A\0\f\v\0\v\0\v@\x7F ("\0 (hG@ \0Aj6 \0-\0\0\f\v %\v j-\0!\r\0\vA\0!\0A\0! A\0\v!
|
|
(! )pB\0Y@ Ak"6\v )x (,k\xAC|"P QrEr\r \v@ \x07 \x006\0\v \fA\xE3\0F\r\0
|
|
@
|
|
AtjA\x006\0\v E@A\0! \f\v jA\0:\0\0\v ( (,k\xAC )x ||! \r \x07A\0Gj!\r\v Aj! -\0"\r\f\v\vA!\vA\0! A\0!
|
|
\v \rA\x7F \r\x1B!\r\v \vE\r !
|
|
!\f\vA\x7F!\r\v A\xB0j$\0 A\x90j$\0 \r\vC\0@ \0E\r\0@@@@ Aj\0\v \0 <\0\0\v \0 =\0\v \0 >\0\v \0 7\0\v\v\xE4\x7F~#\0A k"$\0 B\xFF\xFF\xFF\xFF\xFF\xFF?\x83!\x07@ B0\x88B\xFF\xFF\x83"\b\xA7"A\x81\xFF\0kA\xFDM@ \x07B\x88\xA7!@ \0P B\xFF\xFF\xFF\x83"\x07B\x80\x80\x80\bT \x07B\x80\x80\x80\bQ\x1BE@ Aj!\f\v \0 \x07B\x80\x80\x80\b\x85\x84B\0R\r\0 Aq j!\vA\0 A\xFF\xFF\xFFK"\x1B!A\x81\x81\x7FA\x80\x81\x7F \x1B j!\f\v \0 \x07\x84P \bB\xFF\xFFRrE@ \x07B\x88\xA7A\x80\x80\x80r!A\xFF!\f\v A\xFE\x80K@A\xFF!\f\vA\x80\xFF\0A\x81\xFF\0 \bP"\x1B" k"A\xF0\0J@A\0!A\0!\f\v \x07 \x07B\x80\x80\x80\x80\x80\x80\xC0\0\x84 \x1B!\x07A\0! G@ Aj \0 \x07A\x80 k6 ) )\x84B\0R!\v \0 \x07 g )\b"\0B\x88\xA7!@ )\0 \xAD\x84"\x07P \0B\xFF\xFF\xFF\x83"\0B\x80\x80\x80\bT \0B\x80\x80\x80\bQ\x1BE@ Aj!\f\v \x07 \0B\x80\x80\x80\b\x85\x84B\0R\r\0 Aq j!\v A\x80\x80\x80s A\xFF\xFF\xFFK"\x1B!\v A j$\0 B \x88\xA7A\x80\x80\x80\x80xq Atr r\xBE\v\x89\x7F~@@\x7F@@\x7F \0(" \0(hG@ \0 Aj6 -\0\0\f\v \0%\v"A+k\0\0\v A-F E\x7F \0(" \0(hG@ \0 Aj6 -\0\0\f\v \0%\v"A:k"AuKr\r \0)pB\0S\r \0 \0(Ak6\f\v A:k! !A\0\v! AvI\r\0@ A0kA
|
|
O\r\0A\0!@ A
|
|
lj\x7F \0(" \0(hG@ \0 Aj6 -\0\0\f\v \0%\v!A0k! A\xCC\x99\xB3\xE6\0H A0k"A Mq\r\0\v \xAC! A
|
|
O\r\0@ \xAD B
|
|
~|!\x7F \0(" \0(hG@ \0 Aj6 -\0\0\f\v \0%\v"A0k"A M B0}"B\xAE\x8F\x85\xD7\xC7\xC2\xEB\xA3Sq\r\0\v A
|
|
O\r\0@\x7F \0(" \0(hG@ \0 Aj6 -\0\0\f\v \0%\vA0kA
|
|
I\r\0\v\v \0)pB\0Y@ \0 \0(Ak6\vB\0 } \x1B!\f\vB\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7F! \0)pB\0S\r\0 \0 \0(Ak6B\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7F\v \v\x842\x7F\x07~|#\0A0k"\r$\0@@ AK\r\0 At"(\xDC\x81! (\xD0\x81!@\x7F (" (hG@ Aj6 -\0\0\f\v %\v"_\r\0\vA!\b@@ A+k\0\0\vA\x7FA A-F\x1B!\b (" (hG@ Aj6 -\0\0!\f\v %!\v@@ A_qA\xC9\0F@@ A\x07F\r\x7F (" (hG@ Aj6 -\0\0\f\v %\v! ,\0\xAF\b Aj! A rF\r\0\v\v AG@ A\bF"\f\r E AIr\r \f\r\v )p"B\0Y@ (Ak6\v E AIr\r\0 B\0S!@ E@ (Ak6\v Ak"AK\r\0\v\vB\0!#\0Ak"$\0 \b\xB2C\0\0\x80\x7F\x94\xBC"A\xFF\xFF\xFFq!\b\x7F Av"A\xFFq"@ A\xFFG@ \b\xADB\x86! A\xFFqA\x80\xFF\0j\f\v \b\xADB\x86!A\xFF\xFF\f\vA\0 \bE\r\0 \b\xADB\0 \bg"A\xD1\0j6 )\bB\x80\x80\x80\x80\x80\x80\xC0\0\x85! )\0!A\x89\xFF\0 k\v! \r 7\0 \r \xADB0\x86 Av\xADB?\x86\x84 \x847\b Aj$\0 \r)\b! \r)\0!\f\v@@@@@@ \r\0A\0! A_qA\xCE\0G\r\0@ AF\r\x7F (" (hG@ Aj6 -\0\0\f\v %\v! ,\0\xFC\r Aj! A rF\r\0\v\v \0\v@\x7F (" (hG@ Aj6 -\0\0\f\v %\vA(F@A!\f\vB\x80\x80\x80\x80\x80\x80\xE0\xFF\xFF\0! )pB\0S\r (Ak6\f\v@\x7F (" (hG@ Aj6 -\0\0\f\v %\v"A0kA
|
|
I A\xC1\0kAIr A\xDF\0FrE A\xE1\0kAOqE@ Aj!\f\v\vB\x80\x80\x80\x80\x80\x80\xE0\xFF\xFF\0! A)F\r )p"B\0Y@ (Ak6\v@ @ \r\f\vA\xF8\xD7A6\0B\0!\f\v@ B\0Y@ (Ak6\v Ak"\r\0\v\f\v )pB\0Y@ (Ak6\vA\xF8\xD7A6\0\v B\0J\f\v@ A0G\r\0\x7F (" (hG@ Aj6 -\0\0\f\v %\vA_qA\xD8\0F@#\0A\xB0k"$\0\x7F (" (hG@ Aj6 -\0\0\f\v %\v!@\x7F@ A0G@@ A.G\r (" (hF\r\0 Aj6 -\0\0\f\v (" (hG\x7FA! Aj6 -\0\0A! %\v!\f\v\v %\v"A0G@A!\v\f\v@ B}!\x7F (" (hG@ Aj6 -\0\0\f\v %\v"A0F\r\0\vA!\vA!\vB\x80\x80\x80\x80\x80\x80\xC0\xFF?!@@ !@@ A0k"\x07A
|
|
I\r\0 A.G"\f A r"A\xE1\0kAKq\r \f\r\0 \v\rA!\v !\f\v A\xD7\0k \x07 A9J\x1B!@ B\x07W@ Atj! \f\v BX@ A0j ? A j B\0B\x80\x80\x80\x80\x80\x80\xC0\xFD?+ Aj )0 )8 ) " )("+ ) ) < )\b! )\0!\f\v E
|
|
r\r\0 A\xD0\0j B\0B\x80\x80\x80\x80\x80\x80\x80\xFF?+ A@k )P )X <A!
|
|
)H! )@!\v B|!A!\v (" (hG\x7F Aj6 -\0\0 %\v!\f\v\v~ E@@@ )pB\0Y@ ("Ak6 E\r Ak6 \vE\r Ak6\f\v \r\v B\0J\v A\xE0\0jD\0\0\0\0\0\0\0\0 \b\xB7\xA6T )\`! )h\f\v B\x07W@ !@ At! B|"B\bR\r\0\v\v@@@ A_qA\xD0\0F@ \xAC"B\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7FR\r @ )pB\0Y\r\f\vB\0! B\0JB\0\f\vB\0! )pB\0S\r\v (Ak6\vB\0!\v E@ A\xF0\0jD\0\0\0\0\0\0\0\0 \b\xB7\xA6T )p! )x\f\v \v\x1BB\x86 |B }"A\0 k\xADU@A\xF8\xD7A\xC4\x006\0 A\xA0j \b? A\x90j )\xA0 )\xA8B\x7FB\xFF\xFF\xFF\xFF\xFF\xFF\xBF\xFF\xFF\0+ A\x80j )\x90 )\x98B\x7FB\xFF\xFF\xFF\xFF\xFF\xFF\xBF\xFF\xFF\0+ )\x80! )\x88\f\v A\xE2k\xAC W@ A\0N@@ A\xA0j B\0B\x80\x80\x80\x80\x80\x80\xC0\xFF\xBF\x7F< B\x80\x80\x80\x80\x80\x80\x80\xFF?\xB2! A\x90j )\xA0 A\0N"\x1B )\xA8 \x1B< At"r! B}! )\x98! )\x90! A\0N\r\0\v\v~ A k\xAD|"\xA7"A\0 A\0J\x1B \xADS\x1B"A\xF1\0O@ A\x80j \b? )\x88! )\x80!B\0\f\v A\xE0jA\x90 k\xC8T A\xD0j \b? )\xD0! A\xF0j )\xE0 )\xE8 )\xD8"\xB1 )\xF8! )\xF0\v! A\xC0j AqE B\0B\0dA\0G A Iqq"rr A\xB0j )\xC0 )\xC8+ A\x90j )\xB0 )\xB8 < A\xA0j B\0 \x1BB\0 \x1B+ A\x80j )\xA0 )\xA8 )\x90 )\x98< A\xF0j )\x80 )\x88 \xBC )\xF0" )\xF8"B\0B\0dE@A\xF8\xD7A\xC4\x006\0\v A\xE0j \xA7\xB0 )\xE0! )\xE8\f\vA\xF8\xD7A\xC4\x006\0 A\xD0j \b? A\xC0j )\xD0 )\xD8B\0B\x80\x80\x80\x80\x80\x80\xC0\0+ A\xB0j )\xC0 )\xC8B\0B\x80\x80\x80\x80\x80\x80\xC0\0+ )\xB0! )\xB8\v! \r 7 \r 7 A\xB0j$\0 \r)! \r)!\f\v )pB\0S\r\0 (Ak6\v !\x07 ! \b!\f !\bA\0!#\0A\x90\xC6\0k"$\0A\0 k" k!@\x7F@@ A0G@ A.G\r \x07(" \x07(hF\r \x07 Aj6 -\0\0\f\v \x07(" \x07(hG@ \x07 Aj6 -\0\0! \x07%!\vA!\f\v\v \x07%\v"A0F@@ B}!\x7F \x07(" \x07(hG@ \x07 Aj6 -\0\0\f\v \x07%\v"A0F\r\0\vA!\vA!\v\v A\x006\x90~@@@@ A.F" A0k"A Mr@@@ Aq@ \vE@ !A!\v\f\v E!\f\v B|! A\xFCL@ \xA7 A0F\x1B! A\x90j Atj"
|
|
\x7F (\0A
|
|
ljA0k \v6\0A!A\0
|
|
Aj" A F"\x1B!
|
|
j! \f\v A0F\r\0 (\x80FAr6\x80FA\xDC\x8F!\v\x7F \x07(" \x07(hG@ \x07 Aj6 -\0\0\f\v \x07%\v"A.F" A0k"A
|
|
Ir\r\0\v\v \v\x1B! E A_qA\xC5\0GrE@@ \x07 \b\xAC"B\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7FR\r\0 \bE\rB\0! \x07)pB\0S\r\0 \x07 \x07(Ak6\v |!\f\v E! A\0H\r\v \x07)pB\0S\r\0 \x07 \x07(Ak6\v E\rA\xF8\xD7A6\0\v \x07B\0JB\0!B\0\f\v (\x90"E@ D\0\0\0\0\0\0\0\0 \f\xB7\xA6T )\b! )\0\f\v R B Ur AMA\0 v\x1BrE@ A0j \f? A j r Aj )0 )8 ) )(+ )! )\f\v Av\xAD S@A\xF8\xD7A\xC4\x006\0 A\xE0\0j \f? A\xD0\0j )\` )hB\x7FB\xFF\xFF\xFF\xFF\xFF\xFF\xBF\xFF\xFF\0+ A@k )P )XB\x7FB\xFF\xFF\xFF\xFF\xFF\xFF\xBF\xFF\xFF\0+ )H! )@\f\v A\xE2k\xAC U@A\xF8\xD7A\xC4\x006\0 A\x90j \f? A\x80j )\x90 )\x98B\0B\x80\x80\x80\x80\x80\x80\xC0\0+ A\xF0\0j )\x80 )\x88B\0B\x80\x80\x80\x80\x80\x80\xC0\0+ )x! )p\f\v
|
|
@
|
|
A\bL@ A\x90j Atj"(\0!@ A
|
|
l!
|
|
Aj"
|
|
A G\r\0\v 6\0\v Aj! \v@ A N BUr \xA7"
|
|
Hr\r\0 B Q@ A\xC0j \f? A\xB0j (\x90r A\xA0j )\xC0 )\xC8 )\xB0 )\xB8+ )\xA8! )\xA0\f\v B\bW@ A\x90j \f? A\x80j (\x90r A\xF0j )\x90 )\x98 )\x80 )\x88+ A\xE0jA\b
|
|
kAt(\xB0\x81? A\xD0j )\xF0 )\xF8 )\xE0 )\xE8\xAF )\xD8! )\xD0\f\v
|
|
A}ljA\x1Bj"ALA\0 (\x90" v\x1B\r\0 A\xE0j \f? A\xD0j r A\xC0j )\xE0 )\xE8 )\xD0 )\xD8+ A\xB0j
|
|
AtA\x88\x81j(\0? A\xA0j )\xC0 )\xC8 )\xB0 )\xB8+ )\xA8! )\xA0\f\v@ "Ak! A\x90j Atj"Ak(\0E\r\0\vA\0!@
|
|
A o"E@A\0!\f\v A j B\0S\x1B!@ E@A\0!A\0!\f\vA\x80\x94\xEB\xDCA\0 kAtA\xD0\x81j(\0"\vm!\x07A\0!A\0!A\0!@ A\x90j Atj"\b \b(\0" \vn"\bj"6\0 AjA\xFFq E Fq"\x1B!
|
|
A k
|
|
\x1B!
|
|
\x07 \b \vlkl! Aj" G\r\0\v E\r\0 6\0 Aj!\v
|
|
kA j!
|
|
\v@ A\x90j Atj!
|
|
A$H!\x07@@ \x07E@
|
|
A$G\r (\0A\xD1\xE9\xF9O\r\v A\xFFj! A\0!@ !\b \xAD A\x90j A\xFFq"\vAtj"5\0B\x86|"B\x81\x94\xEB\xDCT\x7FA\0 B\x80\x94\xEB\xDC\x80"B\x80\x94\xEB\xDC~}! \xA7\v! >\0 \b \b \b \v B\0R\x1B \v \bAkA\xFFq"G\x1B \vF\x1B! \vAk! \vG\r\0\v Ak! \b! E\r\0\v AkA\xFFq" F@ A\x90j"\b A\xFEjA\xFFqAtj" (\0 At \bj(\0r6\0 !\v
|
|
A j!
|
|
A\x90j Atj 6\0\f\v\v@@ AjA\xFFq!\b A\x90j AkA\xFFqAtj!@A A
|
|
A-J\x1B!@@ !A\0!@@@ jA\xFFq" F\r\0 A\x90j Atj(\0" At(\xA0\x81"I\r\0 I\r Aj"AG\r\v\v
|
|
A$G\r\0B\0!A\0!B\0!@ jA\xFFq"F@ AjA\xFFq"At jA\x006\x8C\v A\x80j A\x90j Atj(\0r A\xF0j B\0B\x80\x80\x80\x80\xE5\x9A\xB7\x8E\xC0\0+ A\xE0j )\xF0 )\xF8 )\x80 )\x88< )\xE8! )\xE0! Aj"AG\r\0\v A\xD0j \f? A\xC0j )\xD0 )\xD8+B\0! )\xC8! )\xC0! A\xF1\0j" k" A\0 A\0J\x1B H"\b\x1B"\x07A\xF0\0M\r\f\v j! ! F\r\0\vA\x80\x94\xEB\xDC v!\vA\x7F tA\x7Fs!A\0! !@ A\x90j"\x07 Atj" (\0" vj"6\0 AjA\xFFq E Fq"\x1B!
|
|
A k
|
|
\x1B!
|
|
q \vl! AjA\xFFq" G\r\0\v E\r \bG@ At \x07j 6\0 \b!\f\v (\0Ar6\0\f\v\v\v A\x90jA\xE1 \x07k\xC8T A\xB0j )\x90 )\x98 \xB1 )\xB8! )\xB0! A\x80jA\xF1\0 \x07k\xC8T A\xA0j )\x80 )\x88\xAE A\xF0j )\xA0" )\xA8"\xBC A\xE0j )\xF0 )\xF8< )\xE8! )\xE0!\v@ AjA\xFFq" F\r\0@ A\x90j Atj(\0"A\xFF\xC9\xB5\xEEM@ E AjA\xFFq Fq\r A\xF0j \f\xB7D\0\0\0\0\0\0\xD0?\xA2T A\xE0j )\xF0 )\xF8< )\xE8! )\xE0!\f\v A\x80\xCA\xB5\xEEG@ A\xD0j \f\xB7D\0\0\0\0\0\0\xE8?\xA2T A\xC0j )\xD0 )\xD8< )\xC8! )\xC0!\f\v \f\xB7!\x1B AjA\xFFqF@ A\x90j \x1BD\0\0\0\0\0\0\xE0?\xA2T A\x80j )\x90 )\x98< )\x88! )\x80!\f\v A\xB0j \x1BD\0\0\0\0\0\0\xE8?\xA2T A\xA0j )\xB0 )\xB8< )\xA8! )\xA0!\v \x07A\xEF\0K\r\0 A\xD0j B\0B\x80\x80\x80\x80\x80\x80\xC0\xFF?\xAE )\xD0 )\xD8B\0B\0d\r\0 A\xC0j B\0B\x80\x80\x80\x80\x80\x80\xC0\xFF?< )\xC8! )\xC0!\v A\xB0j < A\xA0j )\xB0 )\xB8 \xBC )\xA8! )\xA0!@ Ak A\xFF\xFF\xFF\xFF\x07qN\r\0 B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\x837\x98 7\x90 A\x80j B\0B\x80\x80\x80\x80\x80\x80\x80\xFF?+ )\x90 )\x98B\x80\x80\x80\x80\x80\x80\x80\xB8\xC0\0\xB2! )\x88 A\0N"\x1B! )\x80 \x1B! \b \x07 G A\0Hrq B\0B\0dA\0GqE j"A\xEE\0jNq\r\0A\xF8\xD7A\xC4\x006\0\v A\xF0j \xB0 )\xF8! )\xF0\v! \r 7( \r 7 A\x90\xC6\0j$\0 \r)(! \r) !\f\vB\0!\f\vB\0!\v \0 7\0 \0 7\b \rA0j$\0\v\xC0\x7F~#\0A\x80k"$\0@@@ B\0B\0dE\r\0\x7F B\xFF\xFF\xFF\xFF\xFF\xFF?\x83!
|
|
\x7F B0\x88\xA7A\xFF\xFFq"\x07A\xFF\xFFG@A \x07\rAA
|
|
\x84P\x1B\f\v
|
|
\x84P\v\vE\r\0 B0\x88\xA7"\bA\xFF\xFFq"A\xFF\xFFG\r\v Aj + )" )" \xAF )\b! )\0!\f\v B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\x83"
|
|
B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\x83" dA\0L@
|
|
d@ !\f\v A\xF0\0j B\0B\0+ )x! )p!\f\v B0\x88\xA7A\xFF\xFFq!\x07 ~ A\xE0\0j
|
|
B\0B\x80\x80\x80\x80\x80\x80\xC0\xBB\xC0\0+ )h"
|
|
B0\x88\xA7A\xF8\0k! )\`\v! \x07E@ A\xD0\0j B\0B\x80\x80\x80\x80\x80\x80\xC0\xBB\xC0\0+ )X" B0\x88\xA7A\xF8\0k!\x07 )P!\v B\xFF\xFF\xFF\xFF\xFF\xFF?\x83B\x80\x80\x80\x80\x80\x80\xC0\0\x84!\v
|
|
B\xFF\xFF\xFF\xFF\xFF\xFF?\x83B\x80\x80\x80\x80\x80\x80\xC0\0\x84!
|
|
\x07J@@~
|
|
\v} V\xAD}" B\0Y@ }"\x84P@ A j B\0B\0+ )(! ) !\f\v B\x86 B?\x88\x84\f\v
|
|
B\x86 B?\x88\x84\v!
|
|
B\x86! Ak" \x07J\r\0\v \x07!\v@
|
|
\v} V\xAD}" B\0S@
|
|
! \f\v }"\x84B\0R\r\0 A0j B\0B\0+ )8! )0!\f\v B\xFF\xFF\xFF\xFF\xFF\xFF?X@@ B?\x88 Ak! B\x86! B\x86\x84" B\x80\x80\x80\x80\x80\x80\xC0\0T\r\0\v\v \bA\x80\x80q!\x07 A\0L@ A@k B\xFF\xFF\xFF\xFF\xFF\xFF?\x83 A\xF8\0j \x07r\xADB0\x86\x84B\0B\x80\x80\x80\x80\x80\x80\xC0\xC3?+ )H! )@!\f\v B\xFF\xFF\xFF\xFF\xFF\xFF?\x83 \x07r\xADB0\x86\x84!\v \0 7\0 \0 7\b A\x80j$\0\v\x87\x7F~#\0A\xD0k"$\0 B\xFF\xFF\xFF\xFF\xFF\xFF?\x83!\v B\xFF\xFF\xFF\xFF\xFF\xFF?\x83!
|
|
\x85B\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7F\x83!\f B0\x88\xA7A\xFF\xFFq!\x07@@ B0\x88\xA7A\xFF\xFFq"\bA\xFF\xFFkA\x82\x80~O@ \x07A\xFF\xFFkA\x81\x80~K\r\v P B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\x83"B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0T B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0Q\x1BE@ B\x80\x80\x80\x80\x80\x80 \x84!\f\f\v P B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\x83"B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0T B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0Q\x1BE@ B\x80\x80\x80\x80\x80\x80 \x84!\f !\f\v B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x85\x84P@ B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x85\x84P@B\0!B\x80\x80\x80\x80\x80\x80\xE0\xFF\xFF\0!\f\f\v \fB\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x84!\fB\0!\f\v B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x85\x84P@B\0!\f\v \x84P@B\x80\x80\x80\x80\x80\x80\xE0\xFF\xFF\0 \f \x84P\x1B!\fB\0!\f\v \x84P@ \fB\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x84!\fB\0!\f\v B\xFF\xFF\xFF\xFF\xFF\xFF?X@ A\xC0j
|
|
|
|
|
|
P"\x1ByB\xC0\0B\0 \x1B|\xA7"Ak6A k! )\xC8!
|
|
)\xC0!\v B\xFF\xFF\xFF\xFF\xFF\xFF?V\r\0 A\xB0j \v \v \vP" \x1ByB\xC0\0B\0 \x1B|\xA7" Ak6 jAk! )\xB8!\v )\xB0!\v A\xA0j \vB\x80\x80\x80\x80\x80\x80\xC0\0\x84"B\x86 B1\x88\x84"B\0B\x80\x80\x80\x80\xB0\xE6\xBC\x82\xF5\0 }"B\02 A\x90jB\0 )\xA8}B\0 B\02 A\x80j )\x98B\x86 )\x90B?\x88\x84"B\0 B\02 A\xF0j B\0B\0 )\x88}B\02 A\xE0j )\xF8B\x86 )\xF0B?\x88\x84"B\0 B\02 A\xD0j B\0B\0 )\xE8}B\02 A\xC0j )\xD8B\x86 )\xD0B?\x88\x84"B\0 B\02 A\xB0j B\0B\0 )\xC8}B\02 A\xA0j B\0 )\xB8B\x86 )\xB0B?\x88\x84B}"B\02 A\x90j B\x86B\0 B\02 A\xF0\0j B\0B\0 )\xA8 )\xA0" )\x98|" T\xAD| BV\xAD|}B\02 A\x80jB }B\0 B\02 \b \x07kj"\bA\xFF\xFF\0j!~ )p"B\x86"\r )\x88"B\x86 )\x80B?\x88\x84|"B\xE7\xEC\0}"B \x88"
|
|
B\x80\x80\x80\x80\x80\x80\xC0\0\x84"B\x86"B \x88"~" B\x86"B \x88"\v V\xAD \r V\xAD )xB\x86 B?\x88\x84 B?\x88|||B}"B \x88"~|"\r T\xAD \r \r B\xFF\xFF\xFF\xFF\x83" B?\x88"
|
|
B\x86\x84B\xFF\xFF\xFF\xFF\x83"
|
|
~|"\rV\xAD| ~| ~"
|
|
~|" T\xADB \x86 B \x88\x84| \r B \x86|" \rT\xAD| B\xFF\xFF\xFF\xFF\x83"
|
|
~"\r \v~|" \rT\xAD B\xFE\xFF\xFF\xFF\x83"\r~|"V\xAD||"V\xAD| ~" \r ~|"
|
|
~|"
|
|
\v ~|"B \x88
|
|
V\xAD T\xAD
|
|
V\xAD||B \x86\x84|" T\xAD| \r~"
|
|
\v ~|"B \x88
|
|
T\xADB \x86\x84|"
|
|
T\xAD
|
|
|
|
B \x86|"
|
|
V\xAD||"V\xAD|
|
|
B \x86" \r ~| T\xADB\x7F\x85"V
|
|
Rq\xAD|"V\xAD|"B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0X@ \x84! A\xD0\0j B\x80\x80\x80\x80\x80\x80\xC0\0T"\x07\xAD"\v\x86"
|
|
\v\x86 B\x88 \x07A?s\xAD\x88\x84" 2 \bA\xFE\xFF\0j \x07\x1BAk! B1\x86 )X} )P"B\0R\xAD}!\vB\0 }\f\v A\xE0\0j B?\x86 B\x88\x84"
|
|
B\x88" 2 B0\x86 )h} )\`"B\0R\xAD}!\v !B\0 }\v! A\xFF\xFFN@ \fB\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x84!\fB\0!\f\v~ A\0J@ \vB\x86 B?\x88\x84! B\xFF\xFF\xFF\xFF\xFF\xFF?\x83 \xADB0\x86\x84!\v B\x86\f\v A\x8F\x7FL@B\0!\f\v A@k
|
|
A kg A0j A\xF0\0j6 A j )@"
|
|
)H"\v2 )8 )(B\x86 ) "B?\x88\x84} )0" B\x86"T\xAD}! }\v! Aj BB\02 BB\02 \v
|
|
|
|
B\x83" |"T T\xAD|" V Q\x1B\xAD|"
|
|
T\xAD|" B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0T )V )"V Q\x1Bq\xAD|"V\xAD|" B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0T )\0V )\b"V Q\x1Bq\xAD|" T\xAD| \f\x84!\f\v \0 7\0 \0 \f7\b A\xD0j$\0\v\xBF\x7F#\0A\xD0\0k"$\0@ A\x80\x80N@ A j B\0B\x80\x80\x80\x80\x80\x80\x80\xFF\xFF\0+ )(! ) ! A\xFF\xFFI@ A\xFF\xFF\0k!\f\v Aj B\0B\x80\x80\x80\x80\x80\x80\x80\xFF\xFF\0+A\xFD\xFF A\xFD\xFFO\x1BA\xFE\xFFk! )! )!\f\v A\x81\x80\x7FJ\r\0 A@k B\0B\x80\x80\x80\x80\x80\x80\x809+ )H! )@! A\xF4\x80~K@ A\x8D\xFF\0j!\f\v A0j B\0B\x80\x80\x80\x80\x80\x80\x809+A\xE8\x81} A\xE8\x81}M\x1BA\x9A\xFEj! )8! )0!\v B\0 A\xFF\xFF\0j\xADB0\x86+ \0 )\b7\b \0 )\x007\0 A\xD0\0j$\0\v<\0 \0 7\0 \0 B\xFF\xFF\xFF\xFF\xFF\xFF?\x83 B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x83B0\x88\xA7 B0\x88\xA7A\x80\x80qr\xADB0\x86\x847\b\v\xC0\x7F~A\x7F!@ \0B\0R B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\x83"B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0V B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0Q\x1B\r\0 B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\x83"B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0V B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0Rq\r\0 \0 \x84\x84P@A\0\v \x83B\0Y@ R Sq\r \0 \x85\x84B\0R\v \0B\0R U Q\x1B\r\0 \0 \x85\x84B\0R!\v \v8\0 \0A\xD0k \0 \0A\x93\xF1\xFF\xFF\x07J\x1B"\0Aq@A\0\v \0A\xECj"\0A\xE4\0o@A\v \0A\x90oE\v\x85\x7F~#\0A\x80k"\b$\0 @\x7F@@\x7F@@@ -\0\0"A%G@ \r
|
|
\f\x07\vA\0!A! @ -\0"\x07A-k\0\v \x07A\xDF\0F\r \x07\r\v \0
|
|
j :\0\0
|
|
Aj\f\v \x07! -\0!\x07A! \vA\0!@\x7F j \x07"A+Fj" ,\0\0A0kA M@ \bA\fjA
|
|
B\xFF\xFF\xFF\xFF\xBE\xA7! \b(\f\f\v \b 6\fA\0! \v"\x07-\0\0"A\xC3\0k"\vAKA \vtA\x99\x80\x80qEr\r\0 "\r\0 \x07 G!\v A\xCF\0F A\xC5\0Fr\x7F \x07-\0! \x07Aj \x07\v! \bAj!\x07 ! A\0!#\0A\xD0\0k"\v$\0A\x8A !\rA0!A\xA8\x80\b!\f@ \b\x7F@@@@@@@\x7F@@@@@@@@@~@@@@@@@@@@@@@@@@@@@@@@@@@@ \xC0"A%kV!---------------------------'-\x07\b
|
|
---\r---- ------\0&-\b-\v--\f--%-\x1B-\v ("AM\r"\f*\v ("AK\r) A\x87\x80\bj\f"\v ("A\vK\r( A\x8E\x80\bj\f!\v ("A\vK\r' A\x9A\x80\bj\f \v 4B\xEC|B\xE4\0\x7F!\f#\vA\xDF\0!\v 4\f!\f!\vA\xD2!\r\f\v 4"B\xEC|!@ ("AL@ B\xEB| \xBDAF\x1B!\f\v A\xE9I\r\0 B\xED| \xBDAF\x1B!\v A\xE7\0F\r\f \v 4\b!\f\vA! (\b"E@B\f!\f \v \xAC"B\f} A\fJ\x1B!\f\v (Aj\xAC!A!\f\v (Aj\xAC!\f\x1B\v 4!\f\v \bA6|A\xD4!\f\vA\xA7\x80\bA\xA6\x80\b (\bA\vJ\x1B\f\vA\xF7!\r\f\vA\0!\fA\0!#\0Ak"$\0 4!~ ("\rA\fO@ \r \rA\fm"A\flk"A\fj A\0H\x1B!\r Auj\xAC |!\v A\fj! B}B\x88X@ \xA7"\fA\xC4\0kAu!@ \x7F \fAqE@ Ak! E\rA\f\v E\rA\0\v6\0\v \fA\x80\xE7\x84l A\x80\xA3ljA\x80\xD6\xAF\xE3\x07j\xAC\f\v B\xE4\0}" B\x90\x7F"B\x90~}"B?\x87\xA7 \xA7j!@@@ \xA7"A\x90j B\0S\x1B"\x7F\x7F A\xC8N@ A\xACO@A!\f A\xACk\f\vA!\f A\xC8k\f\v A\xE4\0k A\xE3\0J"\f\x1B\v"\rA\0A\v! \r\f\v Av! AqE! E\r\v 6\0\v B\x80\xE7\x84~ \fAl A\xE1\0ljj k\xACB\x80\xA3~|B\x80\xAA\xBA\xC3|\v! \rAtA\x80\xFE\0j(\0"A\x80\xA3j (\f\x1B \rAJ\x1B! (\f! 4\b! 4! 4\0 Aj$\0 \xAC| Ak\xACB\x80\xA3~| B\x90~| B<~|| 4$}\f\b\v 4\0!\f\v \bA6|A\xD6!\f\vA\xE4!\r\f\v ("A\x07 \x1B\xAC\f\v ( (kA\x07jA\x07n\xAD!\f\v ( (AjA\x07pkA\x07jA\x07n\xAD!\f\v \xBD\xAD!\f\v 4\v!A!\f\vA\xA9\x80\b!\f\f
|
|
\vA\xAA\x80\b!\f\f \v 4B\xEC|B\xE4\0\x81" B?\x87"\x85 }!\f
|
|
\v 4"B\xEC|! B\xA4?S\r
|
|
\v 70 \b \x07A\x9B \vA0je6| \x07!\f\v ( A\0H@ \bA\x006|A\xD7!\f\v \v ($"A\x90m"A\xE4\0l A\x90lk\xC1A<m\xC1j6@ \b \x07A\xA1 \vA@ke6| \x07!\f\r\v ( A\0H@ \bA\x006|A\xD7!\f\r\v ((A\xB4\xDC(\0E@A\xAC\xDCA\xB0\xDCA\xC0\xDCA\xE0\xDCA\xB8\xDCA\xE0\xDC6\0A\xB4\xDCA\xC0\xDC6\0\v\f\v\v \bA6|A\xEA!\f\v\v B\xE4\0\x81!\f\v A\x80\x80\br\v \xB5\f\x07\vA\xAB\x80\b!\f\v \f \xB5!\r\v \b \x07A\xE4\0 \r \xB4"6| \x07A\0 \x1B!\f\vA!\f\vA!\v@ \x1B"A\xDF\0G@ A-G\r \v 7 \b \x07A\x9C \vAje6| \x07!\f\v \v 7( \v 6 \b \x07A\x95 \vA je6| \x07!\f\v \v 7\b \v 6\0 \b \x07A\x8E \ve6| \x07!\f\vA\x9C\v"y6|\v \vA\xD0\0j$\0 E\r@ E@ \b(|! \f\v\x7F@@ -\0\0"A+k\0\0\v \b(|\f\v -\0! Aj! \b(|Ak\v! @ A\xFFqA0G\r\0@ ,\0"\x07A0kA K\r Aj! Ak! \x07A0F\r\0\v\v \b 6|A\0!@ "\x07Aj! \x07j,\0\0A0kA
|
|
I\r\0\v I\x1B!@ \0
|
|
j (A\x94qH\x7FA- A+G\r k \x07jAA \b(\f-\0\0A\xC3\0F\x1BI\rA+\v:\0\0 Ak!
|
|
Aj!
|
|
\v M
|
|
Mr\r\0@ \0
|
|
jA0:\0\0
|
|
Aj!
|
|
Ak" M\r
|
|
K\r\0\v\v \b
|
|
k"\x07 \x07 K\x1B"\x076| \0
|
|
j \x07Y \b(|
|
|
j\v!
|
|
Aj!
|
|
K\r\v\v Ak
|
|
|
|
F\x1B!
|
|
A\0\v! \0
|
|
jA\0:\0\0\v \bA\x80j$\0 \v\xB8\x7F \0AF@A\xF4\x1BA\x84 (\0\x1B\v \0A\xFF\xFFq"A\xFF\xFFG \0Au"AJrE@ Atj(\0"\0A\bjA\xAF \0\x1B\vA\xD7!\0@\x7F@@@ Ak\0\v AK\rA\xB0\xFE\0\f\v A1K\rA\xC0\xFE\0\f\v AK\rA\x80\x81\v!\0 E\r\0@ \0"Aj!\0 -\0\0\r\0 Ak"\r\0\v\v \0\v,\x7F A\0H@\x85\0\v \0 9"6 \0 6\0 \0 j6\b\v
|
|
\0 \0A0kA
|
|
I\v\0 \0A0kA
|
|
I \0A rA\xE1\0kAIr\v\0 \0A r \0 \0A\xC1\0kAI\x1B\v'\0 \0A\0G \0A\xF8\xFC\0Gq \0A\x90\xFD\0Gq \0A\xF8\xDBGq \0A\x90\xDCGq\v\xE4\x7F@ -\0\0\r\0A\xFD\xBF"@ -\0\0\r\v \0A\flA\xB0\xFD\0j\xBF"@ -\0\0\r\vA\x8A\xBF"@ -\0\0\r\vA\xF2\x1B!\v@@ j-\0\0"E A/FrE@A! Aj"AG\r\f\v\v !\vA\xF2\x1B!@@@@@ -\0\0"A.F\r\0 j-\0\0\r\0 ! A\xC3\0G\r\v -\0E\r\v A\xF2\x1B\x9BE\r\0 A\xD1\x9B\r\v \0E@A\xD4\xFC\0! -\0A.F\r\vA\0\vA\xF4\xDB(\0"@@ A\bj\x9BE\r ( "\r\0\v\vA$/"@ A\xD4\xFC\0)\x007\0 A\bj" Y jA\0:\0\0 A\xF4\xDB(\x006 A\xF4\xDB 6\0\v A\xD4\xFC\0 \0 r\x1B!\v \v(\x7F \0(\0"@ CA\x7FG@ \0(\0E\v \0A\x006\0\vA\v(\x7F \0(\0"@ AA\x7FG@ \0(\0E\v \0A\x006\0\vA\vT\x7F@ \0(\0"E\r\0\x7F (" (F@ (\0(4\0\f\v 6\0 Aj6 \vA\x7FG\r\0 \0A\x006\0\v\v.\x7F#\0Ak"$\0 \x006\0A\x8F\f a\`A\xB0\xF1\0(\0L Aj$\0\v$\x7F@ \0(\0"E\r\0 \xC3A\x7FG\r\0 \0A\x006\0\v\v\0 \0AjK \0!\v=\x7F @ \0 \xB6 \0(! k"E FrE@ \xFC
|
|
\0\0\v \0 j6\v\vB\x7F \0(" \0(F@ \0 A\xFFq \0(\0(4\0\v :\0\0 \0 \0(Aj6 A\xFFq\v\x96\x7F#\0Ak"$\0 \0 \0(\0A\fk(\0j(@ \x006\f A\0:\0\b \0 \0(\0A\fk(\0j"(E@ (H"@ \xC4\v A:\0\b\v@ -\0\bAG\r\0 \0 \0(\0A\fk(\0j(" (\0(\0\0A\x7FG\r\0 \0 \0(\0A\fk(\0jA\x99\v@ (\f"\0 \0(\0A\fk(\0j"\0(E\r\0 \0(\r\0 \0-\0A qE\r\0 (\f"\0 \0(\0A\fk(\0j("\0 \0(\0(\0\0A\x7FG\r\0 (\f"\0 \0(\0A\fk(\0jA\x99\v\v Aj$\0\v\0 \0A\bjK \0!\v\0A\x7F\v-\0 \0A\xC8\0j1 \0A<j1 \0A0j1 \0A$j1 \0Aj1 \0A\fj1\v|\x7F \0 \0(H"Ak r6H \0( \0(G@ \0A\0A\0 \0($\0\v \0A\x006 \0B\x007 \0(\0"Aq@ \0 A r6\0A\x7F\v \0 \0(, \0(0j"6\b \0 6 A\x1BtAu\v\xAD\v\x07\x7F \0 j!@@ \0("Aq\r\0 AqE\r \0(\0" j!@@@ \0 k"\0A\x90\xD8(\0G@ \0(\f! A\xFFM@ \0(\b"G\rA\xFC\xD7A\xFC\xD7(\0A~ Avwq6\0\f\v \0(! \0 G@ \0(\b" 6\f 6\b\f\v \0("\x7F \0Aj \0("E\r \0Aj\v!@ !\x07 "Aj! ("\r\0 Aj! ("\r\0\v \x07A\x006\0\f\v ("AqAG\rA\x84\xD8 6\0 A~q6 \0 Ar6 6\0\v 6\f 6\b\f\vA\0!\v E\r\0@ \0("At"(\xAC\xDA \0F@ A\xAC\xDAj 6\0 \rA\x80\xD8A\x80\xD8(\0A~ wq6\0\f\v@ \0 (F@ 6\f\v 6\v E\r\v 6 \0("@ 6 6\v \0("E\r\0 6 6\v@@@@ ("AqE@A\x94\xD8(\0 F@A\x94\xD8 \x006\0A\x88\xD8A\x88\xD8(\0 j"6\0 \0 Ar6 \0A\x90\xD8(\0G\rA\x84\xD8A\x006\0A\x90\xD8A\x006\0\vA\x90\xD8(\0"\b F@A\x90\xD8 \x006\0A\x84\xD8A\x84\xD8(\0 j"6\0 \0 Ar6 \0 j 6\0\v Axq j! (\f! A\xFFM@ (\b" F@A\xFC\xD7A\xFC\xD7(\0A~ Avwq6\0\f\v 6\f 6\b\f\v (! G@ (\b" 6\f 6\b\f\v ("\x7F Aj ("E\r Aj\v!@ !\x07 "Aj! ("\r\0 Aj! ("\r\0\v \x07A\x006\0\f\v A~q6 \0 Ar6 \0 j 6\0\f\vA\0!\v E\r\0@ ("At"(\xAC\xDA F@ A\xAC\xDAj 6\0 \rA\x80\xD8A\x80\xD8(\0A~ wq6\0\f\v@ (F@ 6\f\v 6\v E\r\v 6 ("@ 6 6\v ("E\r\0 6 6\v \0 Ar6 \0 j 6\0 \0 \bG\r\0A\x84\xD8 6\0\v A\xFFM@ A\xF8qA\xA4\xD8j!\x7FA\xFC\xD7(\0"A Avt"qE@A\xFC\xD7 r6\0 \f\v (\b\v! \x006\b \x006\f \0 6\f \0 6\b\vA! A\xFF\xFF\xFF\x07M@ A& A\bvg"kvAq AtrA>s!\v \0 6 \0B\x007 AtA\xAC\xDAj!@@A\x80\xD8(\0"A t"\x07qE@A\x80\xD8 \x07r6\0 \x006\0 \0 6\f\v A AvkA\0 AG\x1Bt! (\0!@ "(Axq F\r Av! At! Aqj"\x07("\r\0\v \x07 \x006 \0 6\v \0 \x006\f \0 \x006\b\v (\b" \x006\f \x006\b \0A\x006 \0 6\f \0 6\b\v\v\0 \0E@A\0\v \0 \xC5\v\0 \0 A4A5\xD0\v-\0 \0A\xCC\0j1 \0A@k1 \0A4j1 \0A(j1 \0Aj1 \0Aj1\v\xBC\0@@@@@@@@@@@ A k\0\b
|
|
\b
|
|
|
|
|
|
\b \x07\v (\0"Aj6\0 \0 (\x006\0\v (\0"Aj6\0 \0 2\x007\0\v (\0"Aj6\0 \0 3\x007\0\v (\0"Aj6\0 \0 0\0\x007\0\v (\0"Aj6\0 \0 1\0\x007\0\v (\0A\x07jAxq"A\bj6\0 \0 +\x009\0\v \0 \0\v\v (\0"Aj6\0 \0 4\x007\0\v (\0"Aj6\0 \0 5\x007\0\v (\0A\x07jAxq"A\bj6\0 \0 )\x007\0\vo\x7F \0(\0",\0\0A0k"A K@A\0\v@A\x7F! A\xCC\x99\xB3\xE6\0M@A\x7F A
|
|
l"j A\xFF\xFF\xFF\xFF\x07sK\x1B!\v \0 Aj"6\0 ,\0 ! !A0k"A
|
|
I\r\0\v \v\xF5\x7F~#\0A@j"\b$\0 \b 6< \bA)j! \bA'j! \bA(j!@@@@@A\0!\x07@ !\r \x07 A\xFF\xFF\xFF\xFF\x07sJ\r \x07 j!@@@@ "\x07-\0\0"\v@@@@ \vA\xFFq"E@ \x07!\f\v A%G\r \x07!\v@ \v-\0A%G@ \v!\f\v \x07Aj!\x07 \v-\0 \vAj"!\vA%F\r\0\v\v \x07 \rk"\x07 A\xFF\xFF\xFF\xFF\x07s"J\r \0@ \0 \r \x073\v \x07\r\x07 \b 6< Aj!\x07A\x7F!@ ,\0A0k"
|
|
A K\r\0 -\0A$G\r\0 Aj!\x07A!
|
|
!\v \b \x076<A\0!\f@ \x07,\0\0"\vA k"AK@ \x07!
|
|
\f\v \x07!
|
|
A t"A\x89\xD1qE\r\0@ \b \x07Aj"
|
|
6< \fr!\f \x07,\0"\vA k"A O\r
|
|
!\x07A t"A\x89\xD1q\r\0\v\v@ \vA*F@\x7F@
|
|
,\0A0k"A K\r\0
|
|
-\0A$G\r\0\x7F \0E@ AtjA
|
|
6\0A\0\f\v Atj(\0\v!
|
|
Aj!A\f\v \r
|
|
Aj! \0E@ \b 6<A\0!A\0!\f\v (\0"\x07Aj6\0 \x07(\0!A\0\v! \b 6< A\0N\rA\0 k! \fA\x80\xC0\0r!\f\f\v \bA<j\xCE"A\0H\r
|
|
\b(<!\vA\0!\x07A\x7F! \x7FA\0 -\0\0A.G\r\0 -\0A*F@\x7F@ ,\0A0k"
|
|
A K\r\0 -\0A$G\r\0 Aj!\x7F \0E@
|
|
AtjA
|
|
6\0A\0\f\v
|
|
Atj(\0\v\f\v \r Aj!A\0 \0E\r\0 (\0"
|
|
Aj6\0
|
|
(\0\v! \b 6< A\0N\f\v \b Aj6< \bA<j\xCE! \b(<!A\v!@ \x07!A!
|
|
",\0\0"\x07A\xFB\0kAFI\r\v Aj! A:l \x07jA\xFF\xF0\0j-\0\0"\x07AkA\xFFqA\bI\r\0\v \b 6<@ \x07A\x1BG@ \x07E\r\f A\0N@ \0E@ Atj \x076\0\f\f\v \b Atj)\x0070\f\v \0E\r\b \bA0j \x07 \xCD\f\v A\0N\r\vA\0!\x07 \0E\r\b\v \0-\0\0A q\r\v \fA\xFF\xFF{q"\v \f \fA\x80\xC0\0q\x1B!\fA\0!A\x93 ! !
|
|
@@\x7F@@@@@@\x7F@@@@@@@ -\0\0"\x07\xC0"ASq \x07AqAF\x1B \x1B"\x07A\xD8\0k!
|
|
\0\v@ \x07A\xC1\0k\x07\v\0\v \x07A\xD3\0F\r\v\f\v \b)0!A\x93 \f\vA\0!\x07@@@@@@@ \b\0\v \b(0 6\0\f\x1B\v \b(0 6\0\f\v \b(0 \xAC7\0\f\v \b(0 ;\0\f\v \b(0 :\0\0\f\v \b(0 6\0\f\v \b(0 \xAC7\0\f\vA\b A\bM\x1B! \fA\br!\fA\xF8\0!\x07\v ! \x07A q!\r \b)0""\x1BPE@@ Ak" \x1B\xA7Aq-\0\x90u \rr:\0\0 \x1BB\x88"\x1BB\0R\r\0\v\v !\r \fA\bqE Pr\r \x07AvA\x93 j!A!\f\v ! \b)0""\x1BPE@@ Ak" \x1B\xA7A\x07qA0r:\0\0 \x1BB\x88"\x1BB\0R\r\0\v\v !\r \fA\bqE\r k" H\x1B! \f\v \b)0"B\0S@ \bB\0 }"70A!A\x93 \f\v \fA\x80q@A!A\x94 \f\vA\x95 A\x93 \fAq"\x1B\v! x!\r\v A\0Hq\r \fA\xFF\xFF{q \f \x1B!\f B\0R rE@ !\rA\0! \f\v P \rkj" H\x1B! \f\r\v \b-\x000!\x07\f\v\v \b(0"A\xC4 \x1B"\rA\0A\xFF\xFF\xFF\xFF\x07 A\xFF\xFF\xFF\xFF\x07O\x1B"\x07\xCA" \rk \x07 \x1B" \rj!
|
|
A\0N@ \v!\f ! \f\f\v \v!\f !
|
|
-\0\0\r\f\v\v \b)0"\x1BPE\rA\0!\x07\f \v @ \b(0\f\vA\0!\x07 \0A A\0 \f7\f\v \bA\x006\f \b \x1B>\b \b \bA\bj"\x0760A\x7F! \x07\v!\vA\0!\x07@@ \v(\0"\rE\r\0 \bAj \r\xCA"\rA\0H\r \r \x07kK\r\0 \vAj!\v \x07 \rj"\x07 I\r\v\vA=!
|
|
\x07A\0H\r\f \0A \x07 \f7 \x07E@A\0!\x07\f\vA\0!
|
|
\b(0!\v@ \v(\0"\rE\r \bAj" \r\xCA"\r
|
|
j"
|
|
\x07K\r \0 \r3 \vAj!\v \x07
|
|
K\r\0\v\v \0A \x07 \fA\x80\xC0\0s7 \x07 \x07 H\x1B!\x07\f\b\v A\0Hq\r A=!
|
|
\0 \b+0 \f \x07 \0"\x07A\0N\r\x07\f
|
|
\v \x07-\0!\v \x07Aj!\x07\f\0\v\0\v \0\r E\rA!\x07@ \x07Atj(\0"\0@ \x07Atj \0 \xCDA! \x07Aj"\x07A
|
|
G\r\f\v\v\v \x07A
|
|
O@A!\f
|
|
\v@ \x07Atj(\0\rA! \x07Aj"\x07A
|
|
G\r\0\v\f \vA!
|
|
\f\v \b \x07:\0'A! !\r \v!\f\v
|
|
\rk"\v \vJ\x1B" A\xFF\xFF\xFF\xFF\x07sJ\rA=!
|
|
j" H\x1B"\x07 K\r \0A \x07 \f7 \0 3 \0A0 \x07 \fA\x80\x80s7 \0A0 \vA\07 \0 \r \v3 \0A \x07 \fA\x80\xC0\0s7 \b(<!\f\v\v\vA\0!\f\vA=!
|
|
\vA\xF8\xD7
|
|
6\0\vA\x7F!\v \bA@k$\0 \v\xC2\x7F#\0A\xD0k"$\0 6\xCC A\xA0j"A\0A(\xFC\v\0 (\xCC6\xC8@A\0 A\xC8j A\xD0\0j \xCFA\0H@A\x7F!\f\v \0(LA\0H \0 \0(\0"\bA_q6\0\x7F@@ \0(0E@ \0A\xD0\x0060 \0A\x006 \0B\x007 \0(,! \0 6,\f\v \0(\r\vA\x7F \0\xC9\r\v \0 A\xC8j A\xD0\0j A\xA0j \xCF\v! @ \0A\0A\0 \0($\0 \0A\x0060 \0 6, \0A\x006 \0(! \0B\x007 A\x7F \x1B!\v \0 \0(\0"\0 \bA qr6\0A\x7F \0A q\x1B!\r\0\v A\xD0j$\0 \v\x7F\x7F~ \0\xBD"B4\x88\xA7A\xFFq"A\xFFG| E@ \0D\0\0\0\0\0\0\0\0a\x7FA\0 \0D\0\0\0\0\0\0\xF0C\xA2 \xD1!\0 (\0A@j\v6\0 \0\v A\xFE\x07k6\0 B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x87\x80\x7F\x83B\x80\x80\x80\x80\x80\x80\x80\xF0?\x84\xBF \0\v\v\0 !\v \0 l/\v$\x7F \0("\0yAj"/"\x7F \0 YA\0\v\v0\x7F#\0Ak"$\0 \0(\0!\0 :\0 Aj \0\0 Aj$\0\v\x8D\x7F|#\0Ak"$\0 Aj \0(\0\x07\0 /\0;\f#\0Ak"$\0@ -\0\rAF@#\0Ak"$\0A\x9C\xCE-\0\0AqE@AA\x94,A!\0A\x9C\xCEA:\0\0A\x98\xCE \x006\0\v -\0\f6\b A\x006A\x98\xCE(\0A\0A\0 Aj A\bj! (6\0 A\bj"\0 \xFC6 \0A\xEC\xCE6\0 \xD2 Aj$\0 \0(! \0A\x006 \0\x84\f\v A\x006\f A\xEC\xCE6\b A\bj\x84A!\v Aj$\0 Aj$\0 \v0\x7F#\0Ak"$\0 \0(\0!\0 :\0 Aj \0\x07\0 Aj$\0\v.\x7F#\0Ak"$\0 \0(\0!\0 :\0 Aj \0\0 Aj$\0\v0\x7F#\0Ak"$\0 \0(\0!\0 8\f A\fj \0\0 Aj$\0\v\x8D\x7F|#\0Ak"$\0 A\bj \0(\0\x07\0 )\b7\0#\0Ak"$\0@ -\0AF@#\0Ak"$\0A\x90\xCE-\0\0AqE@AA\xD4&A!\0A\x90\xCEA:\0\0A\x8C\xCE \x006\0\v *\x008\b A\x006A\x8C\xCE(\0A\0A\0 Aj A\bj! (6\0 A\bj"\0 \xFC6 \0A\xEC\xCE6\0 \xD2 Aj$\0 \0(! \0A\x006 \0\x84\f\v A\x006\f A\xEC\xCE6\b A\bj\x84A!\v Aj$\0 Aj$\0 \v0\x7F#\0Ak"$\0 \0(\0!\0 8\f A\fj \0\x07\0 Aj$\0\v.\x7F#\0Ak"$\0 \0(\0!\0 8\f A\fj \0\0 Aj$\0\v\x7FA9"\0A\x006\0 \0\v\xA9\x7F \0(\0j"\0G@@ (" (\0"kAu" \0(\b \0(\0"kAuM@ \0(" k"AuK@ G@ @ \xFC
|
|
\0\0\v \0(!\v j"k"E FrE@ \xFC
|
|
\0\0\v \0 j6\f\v k"E FrE@ \xFC
|
|
\0\0\v \0 j6\f\v \0(\0"@ \0 6 \0(\b ! \0A\x006\b \0B\x007\0\v \0 \0 \x86\xA8 \0(! k"E FrE@ \xFC
|
|
\0\0\v \0 j6\v\v\v\0 \0(\0j!\0A\f9 \0b\v\0 \0(\0j :\0\0\v\r\0 \0(\0j-\0\0\v\x1B\0 \0 (\b M@ \xA7\v\v8\0 \0 (\b M@ \xA7\v \0(\b"\0 \0(\0(\v\0\v\x92\x7F \0 (\b M@ \xA7\v -\x005 \0(\f! A\0:\x005 -\x004 A\0:\x004 \0Aj" \xA6 -\x004"
|
|
r!\b -\x005"\vr!\x07@ AI\r\0 Atj! \0Aj!@ -\x006\r@
|
|
Aq@ (AF\r \0-\0\bAq\r\f\v \vAqE\r\0 \0-\0\bAqE\r\v A\0;4 \xA6 -\x005"\v \x07rAq!\x07 -\x004"
|
|
\brAq!\b A\bj" I\r\0\v\v \x07Aq:\x005 \bAq:\x004\v\xA4\0@ \0 (\b M@ (G\r (AF\r 6\v \0 (\0 ME\r\0@ ( G@ (G\r\v AG\r A6 \v 6 6 ((Aj6(@ ($AG\r\0 (AG\r\0 A:\x006\v A6,\v\v\x88\0@ \0 (\b M@ (G\r (AF\r 6\v \0 (\0 M@@ ( G@ (G\r\v AG\r A6 \v 6 @ (,AF\r\0 A\0;4 \0(\b"\0 A \0(\0(\v\0 -\x005AF@ A6, -\x004E\r\f\v A6,\v 6 ((Aj6( ($AG\r (AG\r A:\x006\v \0(\b"\0 \0(\0(
|
|
\0\v\v\xC1\x7F@ \0 (\b M@ (G\r (AF\r 6\v@ \0 (\0 M@@ ( G@ (G\r\v AG\r A6 \v 6 (,AF\r \0Aj" \0(\fAtj!\x07A\0!@@@ \x7F@ \x07O\r\0 A\0;4 A \xA6 -\x006\r\0 -\x005AG\r -\x004AF@ (AF\rA!A! \0-\0\bAqE\r\f\vA! \0-\0\bAq\rA\f\vAA \x1B\v6, \r\f\v A6,\f\v A\bj!\f\0\v\0\v \0(\f! \0Aj" \x88 AI\r Atj! \0Aj!@ \0(\b"\0AqE@ ($AG\r\v@ -\x006\r \x88 A\bj" I\r\0\v\f\v \0AqE@@ -\x006\r ($AF\r \x88 A\bj" I\r\0\f\v\0\v@ -\x006\r ($AF@ (AF\r\v \x88 A\bj" I\r\0\v\f\v 6 ((Aj6( ($AG\r\0 (AG\r\0 A:\x006\v\v\xCB\x7F#\0A@j"$\0@@@ (A\xA2\xC7F@ A\x006\0\f\v@ \0 \0-\0\bAq\x7FA E\r A\xF8\xC4E"E\r -\0\bAqA\0G\vM!\v @A! (\0"\0E\r \0(\x006\0\f\v A\xA8\xC5E"E\rA\0! (\0"@ (\0"6\0\v (\b"\x07 \0(\b"A\x7FsqA\x07q \x07A\x7Fs qA\xE0\0qr\r \0(\f"\x07(" (\f"\0(G\r\vA!\f\v A\xA0\xC7F@ \0A\xD8\xC5EE!\f\vA\0! \x07A\xA8\xC5E"@ AqE\r\x7F !A\0!@@A\0 \0E\r \0A\xA8\xC5E"\0E\r \0(\b (\b"A\x7Fsq\rA (\f"( \0(\f"\0(F\r AqE\r A\xA8\xC5E"\r\0\v A\x8C\xC6E"E\r\0 \0\xD9!\v \v!\f\v \x07A\x8C\xC6E"@ AqE\r \0\xD9!\f\v \x07A\xC8\xC4E"E\r\0 \0A\xC8\xC4E"\0E\r\0 A\bjA\0A8\xFC\v\0 A\0G:\0; A\x7F6 6\f \x006 A64 \0 Aj A \0(\0(\b\0 ("\0AF@ (A\0 \x1B6\0\v \0AF!\v A@k$\0 \vr\x7F \0( (\b(F@ \xA8\v \0(\f! \0Aj" \xDA@ AI\r\0 Atj! \0Aj!\0@ \0 \xDA -\x006\r \0A\bj"\0 I\r\0\v\v\v\0 \0@ \0\xC7\v \0!\v5\0 \0( (\b(F@ \xA8\v \0(\b"\0 \0(\0(\b\0\v\0 \0( (\b(F@ \xA8\v\v\xC4\x7F#\0A\xD0\0k"$\0@\x7FA \0( (F\r\0A\0 A\xC8\xC4E"E\r\0 (\0"E\r AjA\0A8\xFC\v\0 A:\0K A\x7F6 \x006 6 A6D Aj A (\0(\b\0 (,"\0AF@ ($6\0\v \0AF\v A\xD0\0j$\0\v A\xC16\b A\xE76 A\x9F\r6\0\x9C\0\v\x7FA\xD4\09"\0A\0A\xD4\0\xFC\v\0 \0\v\0 \0(\0 j -\0\0:\0\0A\v \0A\xEC\xE1 \v3\x7F ( (\0"k K@A! j-\0\0!\v \0 :\0 \0 :\0\0\v$\0A\xF8\xE1-\0\0E@A\xEC\xE1A\xD8\x92jA\xF8\xE1A:\0\0\vA\xEC\xE1\v \0A\xDC\xE1 \v$\0A\xE8\xE1-\0\0E@A\xDC\xE1A\xE3\r\x80A\xE8\xE1A:\0\0\vA\xDC\xE1\v \0A\xCC\xE1 \v$\0A\xD8\xE1-\0\0E@A\xCC\xE1A\x84\x92jA\xD8\xE1A:\0\0\vA\xCC\xE1\v \0A\xBC\xE1 \v$\0A\xC8\xE1-\0\0E@A\xBC\xE1A\xBC\x80A\xC8\xE1A:\0\0\vA\xBC\xE1\v \0A\xAC\xE1 \v$\0A\xB8\xE1-\0\0E@A\xAC\xE1A\xE0\x91jA\xB8\xE1A:\0\0\vA\xAC\xE1\v \0A\xDC\xCC \v\r\0 \0( \0(\0k\v\0A\xA9\xE1-\0\0E@A\xA9\xE1A:\0\0\vA\xDC\xCC\v \0A\x9C\xE1 \v$\0A\xA8\xE1-\0\0E@A\x9C\xE1A\xBC\x91jA\xA8\xE1A:\0\0\vA\x9C\xE1\v \0A\xD0\xCC \v\0A\x99\xE1-\0\0E@A\x99\xE1A:\0\0\vA\xD0\xCC\v\x1B\0A\xF8\xE9!\0@ \0A\fk "\0A\xE0\xE9G\r\0\v\vT\0A\x98\xE1-\0\0@A\x94\xE1(\0\vA\xF8\xE9-\0\0E@A\xF8\xE9A:\0\0\vA\xE0\xE9A\xF8\xBA&A\xEC\xE9A\x84\xBB&A\x98\xE1A:\0\0A\x94\xE1A\xE0\xE96\0A\xE0\xE9\v\x1B\0A\xD8\xE9!\0@ \0A\fk "\0A\xC0\xE9G\r\0\v\vR\0A\x90\xE1-\0\0@A\x8C\xE1(\0\vA\xD8\xE9-\0\0E@A\xD8\xE9A:\0\0\vA\xC0\xE9A\xF4'A\xCC\xE9A\xF1'A\x90\xE1A:\0\0A\x8C\xE1A\xC0\xE96\0A\xC0\xE9\v\x1B\0A\xB0\xE9!\0@ \0A\fk "\0A\x90\xE7G\r\0\v\v\xF1\x7F@ \0( \0(\0"k" I@#\0A k"$\0@ k" \0(\b \0("kM@ \0("j!@ F@ \0 6 -\0\0:\0\0 Aj!\f\v\v\f\v A\fj \0 j \0(\0k\x83 \0( \0(\0k \0\x8C"(\b"j!@ G@ -\0\0:\0\0 Aj!\f\v\v 6\b \0 \xA9 \x87\v A j$\0\f\v I@ \0 j6\v\v\v\xB0\0A\x88\xE1-\0\0@A\x84\xE1(\0\vA\xB0\xE9-\0\0E@A\xB0\xE9A:\0\0\vA\x90\xE7A\xF0\xB6&A\x9C\xE7A\x90\xB7&A\xA8\xE7A\xB4\xB7&A\xB4\xE7A\xCC\xB7&A\xC0\xE7A\xE4\xB7&A\xCC\xE7A\xF4\xB7&A\xD8\xE7A\x88\xB8&A\xE4\xE7A\x9C\xB8&A\xF0\xE7A\xB8\xB8&A\xFC\xE7A\xE0\xB8&A\x88\xE8A\x80\xB9&A\x94\xE8A\xA4\xB9&A\xA0\xE8A\xC8\xB9&A\xAC\xE8A\xD8\xB9&A\xB8\xE8A\xE8\xB9&A\xC4\xE8A\xF8\xB9&A\xD0\xE8A\xE4\xB7&A\xDC\xE8A\x88\xBA&A\xE8\xE8A\x98\xBA&A\xF4\xE8A\xA8\xBA&A\x80\xE9A\xB8\xBA&A\x8C\xE9A\xC8\xBA&A\x98\xE9A\xD8\xBA&A\xA4\xE9A\xE8\xBA&A\x88\xE1A:\0\0A\x84\xE1A\x90\xE76\0A\x90\xE7\v\x1B\0A\x80\xE7!\0@ \0A\fk "\0A\xE0\xE4G\r\0\v\v\x98\0A\x80\xE1-\0\0@A\xFC\xE0(\0\vA\x80\xE7-\0\0E@A\x80\xE7A:\0\0\vA\xE0\xE4A\xC0\b'A\xEC\xE4A\xB7\b'A\xF8\xE4A\xDF'A\x84\xE5A\xAE'A\x90\xE5A\x86 'A\x9C\xE5A\xAA'A\xA8\xE5A\xC8\b'A\xB4\xE5A\xB8 'A\xC0\xE5A\xFA\f'A\xCC\xE5A\xE9\f'A\xD8\xE5A\xF1\f'A\xE4\xE5A\x84\r'A\xF0\xE5A\xFF\r'A\xFC\xE5A\xB8'A\x88\xE6A\x9B\r'A\x94\xE6A\x9B\f'A\xA0\xE6A\x86 'A\xAC\xE6A\xF3\r'A\xB8\xE6A\xA5'A\xC4\xE6A\xE5'A\xD0\xE6A\xDF\r'A\xDC\xE6A\xC3
|
|
'A\xE8\xE6A\xB0 'A\xF4\xE6A\x9B'A\x80\xE1A:\0\0A\xFC\xE0A\xE0\xE46\0A\xE0\xE4\v\x1B\0A\xD8\xE4!\0@ \0A\fk "\0A\xB0\xE3G\r\0\v\v\xCC\0A\xF8\xE0-\0\0@A\xF4\xE0(\0\vA\xD8\xE4-\0\0E@A\xD8\xE4A:\0\0\vA\xB0\xE3A\x9C\xB4&A\xBC\xE3A\xB8\xB4&A\xC8\xE3A\xD4\xB4&A\xD4\xE3A\xF4\xB4&A\xE0\xE3A\x9C\xB5&A\xEC\xE3A\xC0\xB5&A\xF8\xE3A\xDC\xB5&A\x84\xE4A\x80\xB6&A\x90\xE4A\x90\xB6&A\x9C\xE4A\xA0\xB6&A\xA8\xE4A\xB0\xB6&A\xB4\xE4A\xC0\xB6&A\xC0\xE4A\xD0\xB6&A\xCC\xE4A\xE0\xB6&A\xF8\xE0A:\0\0A\xF4\xE0A\xB0\xE36\0A\xB0\xE3\v\x1B\0A\xA8\xE3!\0@ \0A\fk "\0A\x80\xE2G\r\0\v\v\xBE\0A\xF0\xE0-\0\0@A\xEC\xE0(\0\vA\xA8\xE3-\0\0E@A\xA8\xE3A:\0\0\vA\x80\xE2A\xF1\b'A\x8C\xE2A\xF8\b'A\x98\xE2A\xD6\b'A\xA4\xE2A\xDE\b'A\xB0\xE2A\xCD\b'A\xBC\xE2A\xFF\b'A\xC8\xE2A\xE8\b'A\xD4\xE2A\xEF\r'A\xE0\xE2A\xF7\r'A\xEC\xE2A\x8D'A\xF8\xE2A\xCE'A\x84\xE3A\xB4 'A\x90\xE3A\xC4'A\x9C\xE3A\xE7
|
|
'A\xF0\xE0A:\0\0A\xEC\xE0A\x80\xE26\0A\x80\xE2\v
|
|
\0 \0A\xA4\x91j\v
|
|
\0 \0A\x91\x80\v\x90\x7F \0\x7F \0(" \0(\bI@ -\0\0:\0\0 Aj\f\v#\0A k"$\0 A\fj \0 \0( \0(\0kAj\x83 \0( \0(\0k \0\x8C"(\b -\0\0:\0\0 (\bAj6\b \0 \xA9 \0( \x87 A j$\0\v6\v
|
|
\0 \0A\x90\x91j\v
|
|
\0 \0A\x88\x80\v\f\0 \0 Aj\xA3\v\f\0 \0 A\fj\xA3\v\x07\0 \0(\f\v\x07\0 \0,\0 \v\x07\0 \0(\b\v\x07\0 \0,\0\b\v \0 \0\xE5!\v\0A\xB4*\v \0 \0\xE6!\v\0 \0(\0 Atj *\x008\0A\v\0 \0(\b"\0E@A\v \0\xED\v\x87\x7F@@ F \bMr\r\0A! \0(\b!#\0Ak"\x07$\0 \x07 H6\fA\0 k A\xC0\xDD \x1B\x98! \x07A\fjI \x07Aj$\0@@ Aj\0\v !\v \bAj!\b j! j!\f\v\v \vA\x7F \0(\b!#\0Ak"$\0 H6\f A\fjI Aj$\0 \0(\b"\0E@A\v \0\xEDAF\v\x89\x7F#\0Ak"$\0 6\0\x7FA A\fj"A\0 \0(\b\xAF"\0AjAI\r\0A \0Ak" (\0kK\r\0\x7F \x7F -\0\0!\0 (\0"Aj6\0 \0:\0\0 Ak! Aj!\fA\0\v\v\v Aj$\0\v\xBD\f\x7F#\0Ak"$\0 !\b@@ \bF@ !\b\f\v \b-\0\0E\r\0 \bAj!\b\f\v\v \x07 6\0 6\0@@\x7F@ F Fr\r\0 )\x007\b \0(\b! #\0Ak"$\0 H6\f \b k!A\0!
|
|
#\0A\x90\bk"\f$\0 \f (\0" 6\f \fAj \x1B!@@@ E kAuA\x80 \x1B"\rErE@@ A\x83K Av"\v \rOrE@ !\v\f\v \fA\fj \v \r \v \rI\x1B \xA4! \f(\f!\v A\x7FF@A\0!\rA\x7F!
|
|
\f\v \r A\0 \fAjG\x1B"k!\r Atj! j \vkA\0 \v\x1B!
|
|
j!
|
|
\vE\r \v! \r\r\0\f\v\0\v !\v\v \vE\r\v \rE Er\r\0
|
|
! @@@ \v \x98"
|
|
AjAM@@@
|
|
Aj\0\v \fA\x006\f\f\v A\x006\0\f\v \f \f(\f
|
|
j"\v6\f Aj! \rAk"\r\r\v !
|
|
\f\v Aj!
|
|
k! !
|
|
\r\0\v\v @ \f(\f6\0\v \fA\x90\bj$\0 A\fjI Aj$\0@@@@
|
|
A\x7FF@@@ \x07 6\0 (\0F\r\0A!@@@ \b k A\bj \0(\b\xEE"Aj\b\0\v 6\0\f\v !\v j! \x07(\0Aj!\f\v\v 6\0\f\v \x07 \x07(\0
|
|
Atj"6\0 F\r (\0! \bF\r A \0(\b\xEEE\r\vA\f\v \x07 \x07(\0Aj"6\0 (\0Aj"6\0 !\b@ \bF\r \b-\0\0E\r \bAj!\b\f\0\v\0\v 6\0A\f\v (\0!\v G\v Aj$\0\v !\b\f\0\v\0\v\x9F\v\x7F#\0Ak"$\0 !\b@@ \bF@ !\b\f\v \b(\0E\r\0 \bAj!\b\f\v\v \x07 6\0 6\0@@@@ F Fr\x7F )\x007\bA! \0(\b! #\0Ak"$\0 H6\f ! k!
|
|
A\0!\f#\0Ak"$\0@ (\0"\vE \b kAu"Er\r\0
|
|
A\0 \x1B!
|
|
@ A\fj
|
|
AI\x1B \v(\0\xC5"\rA\x7FF@A\x7F!\f\f\v \x7F
|
|
AM@
|
|
\rI\r A\fj \rY\v
|
|
\rk!
|
|
\rjA\0\v! \v(\0E@A\0!\v\f\v \f \rj!\f \vAj!\v Ak"\r\0\v\v @ \v6\0\v Aj$\0 A\fjI Aj$\0@@@@ \fAj\0\b\v \x07 6\0@ (\0F\r (\0 \0(\b\xAF"A\x7FF\r \x07 \x07(\0 j"6\0 Aj!\f\0\v\0\v \x07 \x07(\0 \fj"6\0 F\r \bF@ (\0! !\b\f\v Aj"A\0 \0(\b\xAF"\bA\x7FF\r \x07(\0k \bI\r@ \b@ -\0\0! \x07 \x07(\0" Aj6\0 :\0\0 \bAk!\b Aj!\f\v\v (\0Aj"6\0 !\b@ \bF@ !\b\f\v \b(\0E\r \bAj!\b\f\0\v\0\v 6\0\f\v (\0\v G!\f\v \x07(\0!\f\v\vA!\v Aj$\0 \v \0 \0\xF6!\v=\0 \0\x7F ( (\0"kAu K@ \0 Atj*\x008\0A\f\v \0A\0:\0\0A\0\v:\0\v\0 k"\0 \0 I\x1B\v4\0@ FE@ ,\0\0"\0 \0A\0H\x1B:\0\0 Aj! Aj!\f\v\v \v\f\0 A\0H\x1B\v*\0@ FE@ -\0\0:\0\0 Aj! Aj!\f\v\v \v9\0@ FE@ -\0\0"\0 \0A r \0A\xDB\0kA\xFFqA\xE6I\x1B:\0\0 Aj!\f\v\v \v\0 A r A\xDB\0kA\xFFqA\xE6I\x1B\v:\0@ FE@ -\0\0"\0 \0A\xDF\0q \0A\xFB\0kA\xFFqA\xE6I\x1B:\0\0 Aj!\f\v\v \v\0 A\xDF\0q A\xFB\0kA\xFFqA\xE6I\x1B\v\0 \0( \0(\0kAu\v \0 \0\xF0!\v5\0@ FE@ (\0"\0 \0A\x80I\x1B:\0\0 Aj! Aj!\f\v\v \v\0 A\x80I\x1B\xC0\v*\0@ FE@ ,\0\x006\0 Aj! Aj!\f\v\v \v4\0@ FE@ (\0"\0 \0A r \0A\xDB\0kAfI\x1B6\0 Aj!\f\v\v \v\0 A r A\xDB\0kAfI\x1B\v5\0@ FE@ (\0"\0 \0A\xDF\0q \0A\xFB\0kAfI\x1B6\0 Aj!\f\v\v \v\0 A\xDF\0q A\xFB\0kAfI\x1B\v\x86\x7F@ \0( \0(\0"kAu" I@#\0A k"$\0@ k" \0(\b \0("kAuM@ \0(" Atj!@ F@ \0 6 *\x008\0 Aj!\f\v\v\f\v A\fj \0 \0(\0kAu j\x86 \0( \0(\0kAu \0\xB8"(\b" Atj!@ G@ *\x008\0 Aj!\f\v\v 6\b \0 \x96 \xB5\v A j$\0\f\v I@ \0 Atj6\v\v\v7\0@@ F\r\0 (\0"\0A\xFF\0K\r\0 \0At(\x90\x88 qE\r\0 Aj!\f\v\v \v7\0@@ F\r\0 (\0"\0A\xFF\0M@ \0At(\x90\x88 q\r\v Aj!\f\v\v \vF\x7F@ FE@A\0!\0 (\0"A\xFF\0M\x7F At(\x90\x88A\0\v6\0 Aj! Aj!\f\v\v \v"\0A\0!\0 A\xFF\0M\x7F At(\x90\x88 qA\0GA\0\v\v\0 \0 \0(\0(\0\v \0 \0\xF5!\v\x95\x7F \0\x7F \0(" \0(\bI@ *\x008\0 Aj\f\v#\0A k"$\0 A\fj \0 \0( \0(\0kAuAj\x86 \0( \0(\0kAu \0\xB8"(\b" *\x008\0 Aj6\b \0 \x96 \0( \xB5 A j$\0\v6\v\xA1\0@ ,\0\vA\0N@ \0 (\b6\b \0 )\x007\0\f\v (\0!@@@ ("AM@ \0 :\0\v\f\v A\xF7\xFF\xFF\xFFO\r Ar"AjU! \0 A\xFF\xFF\xFF\xFF\x07k6\b \0 6\0 \0 6 !\0\v AtAj"@ \0 \xFC
|
|
\0\0\v\f\v0\0\v\v\v \0 \0 \xA3\v\x9F\x07\x7F#\0A\xF0k"$\0 A\xECj"\0 $ \0=!
|
|
( ,\0\v"\0 \0A\0H"\0\x1B@ (\0 \0\x1B(\0
|
|
A-
|
|
(\0(,\0F!\x07\v A\x006\xD8 B\x007\xD0 A\x006\xC8 B\x007\xC0 A\x006\xB8 B\x007\xB0 \x07 A\xECj A\xE8j A\xE4j A\xE0j A\xD0j A\xC0j A\xB0j A\xACj\xF9@\x7F\x7F ("\v ,\0\v"\b \bA\0H\x1B"\0 (\xAC" J@ \0 kAtj (\xB4 ,\0\xBB"\0 \0A\0H\x1Bj (\xC4 ,\0\xCB"\0 \0A\0H\x1BjAj\f\v (\xB4 ,\0\xBB"\0 \0A\0H\x1Bj (\xC4 ,\0\xCB"\0 \0A\0H\x1BjAj\v"\0A\xE5\0I@A\0! Aj\f\v \0At/"E\r -\0\v!\b (!\v \v"\0 A\fj A\bj ( (\0 \b\xC0A\0H"\x1B"\f \f \v \b \x1BAtj
|
|
\x07 A\xE8j (\xE4 (\xE0 A\xD0j" A\xC0j"\x07 A\xB0j"\b \xF8 \0 (\f (\b \\ ! \b \x07 (\xEC# A\xF0j$\0\v0\0\v\xE4\b\x7F#\0A\xA0\bk"\0$\0 \0 7 \0 7 \0 \0A\xB0\x07j"\x076\xAC\x07 \0A\x90j! @ \x07A\xE3 \0Aje"\x07A\xE4\0O@*!\x07 \0 7\0 \0 7\b \0A\xAC\x07j \x07A\xE3 \0P"\x07A\x7FF\r \0(\xAC\x07!\r \x07At/"\v! \vE\r\v \0A\x8Cj"\b $ \b=" \0(\xAC\x07"\b \x07 \bj (\0(0\0 \x07A\0J@ \0(\xAC\x07-\0\0A-F!
|
|
\v \0A\x006\xF8 \0B\x007\xF0 \0A\x006\xE8 \0B\x007\xE0 \0A\x006\xD8 \0B\x007\xD0
|
|
\0A\x8Cj \0A\x88j \0A\x84j \0A\x80j \0A\xF0j \0A\xE0j \0A\xD0j \0A\xCCj\xF9@\x7F \0(\xCC"\b \x07H@ \b \x07 \bkAtj \0(\xD4 \0,\0\xDB" A\0H\x1Bj \0(\xE4 \0,\0\xEB" A\0H\x1BjAj\f\v \b \0(\xD4 \0,\0\xDB" A\0H\x1Bj \0(\xE4 \0,\0\xEB" A\0H\x1BjAj\v"A\xE5\0I@ \0A0j!\f\v At/"\f! \fE\r\v \0A,j \0A(j ( \x07Atj
|
|
\0A\x88j \0(\x84 \0(\x80 \0A\xF0j"
|
|
\0A\xE0j"\x07 \0A\xD0j" \b\xF8 \0(, \0(( \\ \f! \x07
|
|
\0(\x8C# \v! \r! \0A\xA0\bj$\0\v0\0\v\x99\x07\x7F#\0A\xB0k"$\0 A\xACj"\0 $ \0>!
|
|
( ,\0\v"\0 \0A\0H"\0\x1B@ (\0 \0\x1B-\0\0
|
|
A-
|
|
(\0(\0A\xFFqF!\x07\v A\x006\xA0 B\x007\x98 A\x006\x90 B\x007\x88 A\x006\x80 B\x007x \x07 A\xACj A\xA8j A\xA7j A\xA6j A\x98j A\x88j A\xF8\0j A\xF4\0j\xFC@\x7F\x7F ("\v ,\0\v"\b \bA\0H\x1B"\0 (t" J@ \0 kAtj (| ,\0\x83"\0 \0A\0H\x1Bj (\x8C ,\0\x93"\0 \0A\0H\x1BjAj\f\v (| ,\0\x83"\0 \0A\0H\x1Bj (\x8C ,\0\x93"\0 \0A\0H\x1BjAj\v"\0A\xE5\0I@A\0! Aj\f\v \0/"E\r -\0\v!\b (!\v \v"\0 A\fj A\bj ( (\0 \b\xC0A\0H"\x1B"\f \f \v \b \x1Bj
|
|
\x07 A\xA8j ,\0\xA7 ,\0\xA6 A\x98j" A\x88j"\x07 A\xF8\0j"\b \xFB \0 (\f (\b Z ! \b \x07 (\xAC# A\xB0j$\0\v0\0\v\xDB\b\x7F#\0A\xB0k"\0$\0 \0 7 \0 7 \0 \0A\xC0j"\x076\xBC \0A\xD0j! @ \x07A\xE3 \0Aje"\x07A\xE4\0O@*!\x07 \0 7\0 \0 7\b \0A\xBCj \x07A\xE3 \0P"\x07A\x7FF\r \0(\xBC!\r \x07/"\v! \vE\r\v \0A\xCCj"\b $ \b>" \0(\xBC"\b \x07 \bj (\0( \0 \x07A\0J@ \0(\xBC-\0\0A-F!
|
|
\v \0A\x006\xC0 \0B\x007\xB8 \0A\x006\xB0 \0B\x007\xA8 \0A\x006\xA0 \0B\x007\x98
|
|
\0A\xCCj \0A\xC8j \0A\xC7j \0A\xC6j \0A\xB8j \0A\xA8j \0A\x98j \0A\x94j\xFC@\x7F \0(\x94"\b \x07H@ \b \x07 \bkAtj \0(\x9C \0,\0\xA3" A\0H\x1Bj \0(\xAC \0,\0\xB3" A\0H\x1BjAj\f\v \b \0(\x9C \0,\0\xA3" A\0H\x1Bj \0(\xAC \0,\0\xB3" A\0H\x1BjAj\v"A\xE5\0I@ \0A0j!\f\v /"\f! \fE\r\v \0A,j \0A(j ( \x07 j
|
|
\0A\xC8j \0,\0\xC7 \0,\0\xC6 \0A\xB8j"
|
|
\0A\xA8j"\x07 \0A\x98j" \b\xFB \0(, \0(( Z \f! \x07
|
|
\0(\xCC# \v! \r! \0A\xB0j$\0\v0\0\v\xC0\x7F#\0A\xC0k"\0$\0 \0 6\xB8 \0 6\xBC \0A\xE3\x006 \0 \0A j6 \0Aj"\x07 $ \x07=! \0A\0:\0 \0A\xBCj \x07 ( \0Aj \0Aj \0Aj \0A\xB0j\x80@@ ,\0\vA\0H@ (\0A\x006\0 A\x006\f\v A\0:\0\v A\x006\0\v \0-\0AF@ A- (\0(,\0\xDD\v A0 (\0(,\0! \0("Ak! \0(!@@ O\r\0 (\0 G\r\0 Aj!\f\v\v#\0Ak"$\0@ F\r\0 ,\0\v! (\b!\b (!\x07 (\0 ,\0\v" A\0H"
|
|
\x1B"\vO \v (
|
|
\x1BAtjAjIqE@ \x07 A\0H" \x1B" k"Au"
|
|
j!\x07
|
|
\bA\xFF\xFF\xFF\xFF\x07qAkA \x1B"\b kK@ \b \x07 \bk \xFF\v At (\0 ,\0\vA\0H\x1Bj! @ \xFC
|
|
\0\0\v jA\x006\0 ,\0\vA\0H@ \x076\f\v \x07A\xFF\0q:\0\v\f\v Aj"\x07 \xA2 ( \x07 ,\0"A\0H"
|
|
\x1B!@ (\b
|
|
\x1B" (\bA\xFF\xFF\xFF\xFF\x07qAkA ,\0\v"\bA\0H"\x1B" ( \b \x1B"kM@ E\r (\0 \bA\0H\x1B!\b At" @ \b Atj \xFC
|
|
\0\0\v j!@ ,\0\vA\0H@ 6\f\v A\xFF\0q:\0\v\v \b AtjA\x006\0\f\v j k A\0 \xDE\v \x07 \v Aj$\0\v \0A\xBCj \0A\xB8j(@ (\0Ar6\0\v \0(\xBC \0(# \0(! \0A\x006 @ \0(\0\v \0A\xC0j$\0\v\xDD\x7F#\0A\xF0k"\x07$\0 \x07 6\xE8 \x07 6\xEC \x07A\xE3\x006\xCC \x07 \x07A\xD0j6\xC8 \x07A\xC0j" $ =!\0 \x07A\0:\0\xBF@ \x07A\xECj ( \x07A\xBFj \0 \x07A\xC8j \x07A\xC4j \x07A\xE0j\x80E\r\0 \x07A\xEE\x1B(\0\x006\0\xB7 \x07A\xE7\x1B)\0\x007\xB0 \0 \x07A\xB0j \x07A\xBAj \x07A\x80j \0(\0(0\0 \x07Aj!\0@ \x07(\xC4" \x07(\xC8"k"A\x89N@ AvAj/"\0!\b \0E\r\v \0! \x07-\0\xBFAF@ \0A-:\0\0 \0Aj!\v \x07A\xA8j!@ M@@ A\0:\0\0 \x07 6\0 \0 \x07\xA7AG\r\0 \b!\f\v \x07A\xB0j \x07A\x80j" \xB1 kAuj-\0\0:\0\0 Aj! Aj! \x07(\xC4!\f\v\v0\0\v0\0\v \x07A\xECj \x07A\xE8j(@ (\0Ar6\0\v \x07(\xEC \x07(\xC0# \x07(\xC8!\0 \x07A\x006\xC8 \0@ \0 \x07(\xCC\0\v \x07A\xF0j$\0\v\xAE\x7F#\0A\x90k"\0$\0 \0 6\x88 \0 6\x8C \0A\xE3\x006 \0 \0A j6 \0Aj"\x07 $ \x07>! \0A\0:\0 \0A\x8Cj \x07 ( \0Aj \0Aj \0Aj \0A\x84j\x85@@ ,\0\vA\0H@ (\0A\0:\0\0 A\x006\f\v A\0:\0\v A\0:\0\0\v \0-\0AF@ A- (\0(\0\xAA\v A0 (\0(\0 \0("Ak! \0(!A\xFFq!@@ O\r\0 -\0\0 G\r\0 Aj!\f\v\v#\0Ak"$\0@ F\r\0 ,\0\v! (\b!\b (!\x07 (\0 ,\0\v" A\0H"
|
|
\x1B"\vO \v (
|
|
\x1BjAjIqE@ \x07 A\0H" \x1B" k"j!\x07 \bA\xFF\xFF\xFF\xFF\x07qAkA
|
|
\x1B"\b kK@ \b \x07 \bk \xA4\v (\0 ,\0\vA\0H\x1B j! @ \xFC
|
|
\0\0\v jA\0:\0\0 ,\0\vA\0H@ \x076\f\v \x07A\xFF\0q:\0\v\f\v Aj"\x07 \xCE ( \x07 ,\0"A\0H"
|
|
\x1B!@ (\b
|
|
\x1B" (\bA\xFF\xFF\xFF\xFF\x07qAkA
|
|
,\0\v"\bA\0H"\x1B" ( \b \x1B"kM@ E\r (\0 \bA\0H\x1B!\b @ \bj \xFC
|
|
\0\0\v j!@ ,\0\vA\0H@ 6\f\v A\xFF\0q:\0\v\v \bjA\0:\0\0\f\v j k A\0 \x89\v \x07 \v Aj$\0\v \0A\x8Cj \0A\x88j)@ (\0Ar6\0\v \0(\x8C \0(# \0(! \0A\x006 @ \0(\0\v \0A\x90j$\0\v\xD1\x7F#\0A\x90k"\x07$\0 \x07 6\x88 \x07 6\x8C \x07A\xE3\x006\x9C \x07 \x07A\xA0j6\x98 \x07A\x90j" $ >!\0 \x07A\0:\0\x8F@ \x07A\x8Cj ( \x07A\x8Fj \0 \x07A\x98j \x07A\x94j \x07A\x84j\x85E\r\0 \x07A\xEE\x1B(\0\x006\0\x87 \x07A\xE7\x1B)\0\x007\x80 \0 \x07A\x80j \x07A\x8Aj \x07A\xF6\0j \0(\0( \0 \x07Aj!\0@ \x07(\x94" \x07(\x98"k"A\xE3\0N@ Aj/"\0!\b \0E\r\v \0! \x07-\0\x8FAF@ \0A-:\0\0 \0Aj!\v \x07A\x80j!@ M@@ A\0:\0\0 \x07 6\0 \0 \x07\xA7AG\r\0 \b!\f\v \x07A\xF6\0j \xB4 \x07k \x07j-\0
|
|
:\0\0 Aj! Aj! \x07(\x94!\f\v\v0\0\v0\0\v \x07A\x8Cj \x07A\x88j)@ (\0Ar6\0\v \x07(\x8C \x07(\x90# \x07(\x98!\0 \x07A\x006\x98 \0@ \0 \x07(\x9C\0\v \x07A\x90j$\0\v\0A\xFC \v\xC7\x7F#\0A\xA0k"\b$\0 \b \bA\xA0j"6\f#\0A\x90k"\x07$\0 \x07 \x07A\x84j6 \0A\bj \x07A j" \x07Aj \x88 \x07B\x007 \x07 6\f \b(\f \bAj"kAu! \0(\b!\0#\0Ak"$\0 \0H6\f \x07A\fj \x07Aj\xA4!\0 A\fjI Aj$\0 \0A\x7FF@0\0\v \b \0Atj6\f \x07A\x90j$\0 \b(\f!\0#\0Ak"$\0#\0Ak"$\0#\0Ak"$\0 6\f@ \0 G@ A\fj (\0\xBE Aj!\f\v\v 6\b (\f6\f Aj$\0 )\b7\b Aj$\0 (\f Aj$\0 $\0\v\xB8\0#\0A\x80k"$\0 A\xF4\0j6\f \0A\bj Aj" A\fj \x88 (\f!\0#\0Ak"$\0#\0Ak"$\0#\0Ak"$\0 6\f@ \0 G@ A\fj ,\0\0\xC0 Aj!\f\v\v 6\b (\f6\f Aj$\0 )\b7\b Aj$\0 (\f Aj$\0 A\x80j$\0\v\xB8\r\x7F#\0A0k"\x07$\0 \x07 6, A\x006\0 \x07 $ \x07=!\b \x07(\0#\x7F@@@@@@@@@@@@@@@@@@@@@@@@@@ A\xC1\0k9\0\x07
|
|
\0\b \v\f\r\v\v \0 Aj \x07A,j \b\x8B\f\v \0 Aj \x07A,j \b\x8A\f\v \0A\bj \0(\b(\f\0\0! \x07 \0 \x07(, (\0 ,\0\v"\0A\0H"\x1B" ( \0 \x1BAtjV6,\f\v \x07A,j \bAN!\0@ (\0"Aq \0AkAKrE@ \x006\f\f\v Ar6\0\v\f\v \x07A\xA8\x86)\x007 \x07A\xA0\x86)\x007 \x07A\x98\x86)\x007\b \x07A\x90\x86)\x007\0 \x07 \0 \x07 \x07A jV6,\f\v \x07A\xC8\x86)\x007 \x07A\xC0\x86)\x007 \x07A\xB8\x86)\x007\b \x07A\xB0\x86)\x007\0 \x07 \0 \x07 \x07A jV6,\f\v \x07A,j \bAN!\0@ (\0"Aq \0AJrE@ \x006\b\f\v Ar6\0\v\f\v \x07A,j \bAN!\0@ (\0"Aq \0AkA\vKrE@ \x006\b\f\v Ar6\0\v\f\v \x07A,j \bAN!\0@ (\0"Aq \0A\xEDJrE@ \x006\f\v Ar6\0\v\f\v \x07A,j \bAN!\0@ (\0"Aq \0Ak"\0A\vKrE@ \x006\f\v Ar6\0\v\f\v \x07A,j \bAN!\0@ (\0"Aq \0A;JrE@ \x006\f\v Ar6\0\v\f\v \x07A,j!\0#\0Ak"$\0 6\f@@ \0 A\fj(\r\0 \bA \0: \b(\0(\f\0E\r\0 \0Q\f\v\v \0 A\fj(@ (\0Ar6\0\v Aj$\0\f\r\v \x07A,j!@ \0A\bj \0(\b(\b\0\0"\0( \0,\0\v" A\0H\x1BA\0 \0( \0,\0" A\0H\x1BkF@ (\0Ar6\0\f\v \0 \0Aj \b A\0\x95" \0G (\b"A\fGrE@ A\x006\b\f\v \0kA\fG A\vJrE@ A\fj6\b\v\v\f\f\v \x07A\xD0\x86A,\xFC
|
|
\0\0 \x07 \0 \x07 \x07A,jV6,\f\v\v \x07A\x90\x87(\x006 \x07A\x88\x87)\x007\b \x07A\x80\x87)\x007\0 \x07 \0 \x07 \x07AjV6,\f
|
|
\v \x07A,j \bAN!\0@ (\0"Aq \0A<JrE@ \x006\0\f\v Ar6\0\v\f \v \x07A\xB8\x87)\x007 \x07A\xB0\x87)\x007 \x07A\xA8\x87)\x007\b \x07A\xA0\x87)\x007\0 \x07 \0 \x07 \x07A jV6,\f\b\v \x07A,j \bAN!\0@ (\0"Aq \0AJrE@ \x006\f\v Ar6\0\v\f\x07\v \0 \0(\0(\0\f\x07\v \0A\bj \0(\b(\0\0! \x07 \0 \x07(, (\0 ,\0\v"\0A\0H"\x1B" ( \0 \x1BAtjV6,\f\v Aj \x07A,j \b\x89\f\v \x07A,j \bAN!\0 -\0\0AqE@ \0A\xECk6\v\f\v A%F\r\v (\0Ar6\0\f\v#\0Ak"\0$\0 \0 6\f@ \x7FA \x07A,j" \0A\fj"(\r\0A \b :A\0 \b(\0(4\0A%G\r\0 Q (E\rA\v (\0r6\0\v \0Aj$\0\v \x07(,\v \x07A0j$\0\v \0 \0\0\0\vK\x7F#\0Ak"$\0 6\f A\bj" $ =! (\b# Aj A\fj \x89 (\f Aj$\0\vM\x7F#\0Ak"$\0 6\f A\bj" $ =! (\b# \0 Aj A\fj \x8A (\f Aj$\0\vM\x7F#\0Ak"$\0 6\f A\bj" $ =! (\b# \0 Aj A\fj \x8B (\f Aj$\0\vF\0 \0 \0A\bj \0(\b(\0\0"\0(\0 \0 \0,\0\v"A\0H"\x1B" \0( \x1BAtjV\vX\x7F#\0A k"$\0 A\xB8\x87)\x007 A\xB0\x87)\x007 A\xA8\x87)\x007\b A\xA0\x87)\x007\0 \0 A j"V $\0\v\xDB\f\x7F#\0Ak"\x07$\0 \x07 6\f A\x006\0 \x07 $ \x07>!\b \x07(\0#\x7F@@@@@@@@@@@@@@@@@@@@@@@@@@ A\xC1\0k9\0\x07
|
|
\0\b \v\f\r\v\v \0 Aj \x07A\fj \b\x8E\f\v \0 Aj \x07A\fj \b\x8D\f\v \0A\bj \0(\b(\f\0\0! \x07 \0 \x07(\f (\0 ,\0\v"\0A\0H"\x1B" ( \0 \x1BjW6\f\f\v \x07A\fj \bAO!\0@ (\0"Aq \0AkAKrE@ \x006\f\f\v Ar6\0\v\f\v \x07B\xA5\xDA\xBD\xA9\xC2\xEC\xCB\x92\xF9\x007\0 \x07 \0 \x07 \x07A\bjW6\f\f\v \x07B\xA5\xB2\xB5\xA9\xD2\xAD\xCB\x92\xE4\x007\0 \x07 \0 \x07 \x07A\bjW6\f\f\v \x07A\fj \bAO!\0@ (\0"Aq \0AJrE@ \x006\b\f\v Ar6\0\v\f\v \x07A\fj \bAO!\0@ (\0"Aq \0AkA\vKrE@ \x006\b\f\v Ar6\0\v\f\v \x07A\fj \bAO!\0@ (\0"Aq \0A\xEDJrE@ \x006\f\v Ar6\0\v\f\v \x07A\fj \bAO!\0@ (\0"Aq \0Ak"\0A\vKrE@ \x006\f\v Ar6\0\v\f\v \x07A\fj \bAO!\0@ (\0"Aq \0A;JrE@ \x006\f\v Ar6\0\v\f\v \x07A\fj!\0#\0Ak"$\0 6\f@@ \0 A\fj)\r\0 \0;"A\0H\r\0 \b(\b Atj-\0\0AqE\r\0 \0S\f\v\v \0 A\fj)@ (\0Ar6\0\v Aj$\0\f\r\v \x07A\fj!@ \0A\bj \0(\b(\b\0\0"\0( \0,\0\v" A\0H\x1BA\0 \0( \0,\0" A\0H\x1BkF@ (\0Ar6\0\f\v \0 \0Aj \b A\0\x97" \0G (\b"A\fGrE@ A\x006\b\f\v \0kA\fG A\vJrE@ A\fj6\b\v\v\f\f\v \x07A\xF8\x85(\0\x006\0\x07 \x07A\xF1\x85)\0\x007\0 \x07 \0 \x07 \x07A\vjW6\f\f\v\v \x07A\x80\x86-\0\0:\0 \x07A\xFC\x85(\0\x006\0 \x07 \0 \x07 \x07AjW6\f\f
|
|
\v \x07A\fj \bAO!\0@ (\0"Aq \0A<JrE@ \x006\0\f\v Ar6\0\v\f \v \x07B\xA5\x90\xE9\xA9\xD2\xC9\xCE\x92\xD3\x007\0 \x07 \0 \x07 \x07A\bjW6\f\f\b\v \x07A\fj \bAO!\0@ (\0"Aq \0AJrE@ \x006\f\v Ar6\0\v\f\x07\v \0 \0(\0(\0\f\x07\v \0A\bj \0(\b(\0\0! \x07 \0 \x07(\f (\0 ,\0\v"\0A\0H"\x1B" ( \0 \x1BjW6\f\f\v Aj \x07A\fj \b\x8C\f\v \x07A\fj \bAO!\0 -\0\0AqE@ \0A\xECk6\v\f\v A%F\r\v (\0Ar6\0\f\v#\0Ak"\0$\0 \0 6\f@ \x7FA \x07A\fj" \0A\fj")\r\0A \b ;A\0 \b(\0($\0A%G\r\0 S )E\rA\v (\0r6\0\v \0Aj$\0\v \x07(\f\v \x07Aj$\0\v\x9B\x7F#\0A\xE0\0k"$\0 A\fj" (\0 \0\b\0A\xD4\09"\0 -\0\b:\0\b \0 )\x007\0 \0A\fj A\fjb \0Aj Ajb \0A$j A$jb \0A0j A0jb \0A<j A<jb \0A\xC8\0j A\xC8\0jb \xC7 A\xE0\0j$\0 \0\vK\x7F#\0Ak"$\0 6\f A\bj" $ >! (\b# Aj A\fj \x8C (\f Aj$\0\vM\x7F#\0Ak"$\0 6\f A\bj" $ >! (\b# \0 Aj A\fj \x8D (\f Aj$\0\vM\x7F#\0Ak"$\0 6\f A\bj" $ >! (\b# \0 Aj A\fj \x8E (\f Aj$\0\vC\0 \0 \0A\bj \0(\b(\0\0"\0(\0 \0 \0,\0\v"A\0H"\x1B" \0( \x1BjW\v;\x7F#\0Ak"$\0 B\xA5\x90\xE9\xA9\xD2\xC9\xCE\x92\xD3\x007\b \0 A\bj Aj"W $\0\v+\x7F ("A\xB5\xFB~qA\x88r6 \x91 6\v\xB7\x07\x7F\x7F#\0A\x90k"\0$\0 \0B%7\x88 \0A\x88j"\x07ArA\x82 (\x91!\b \0 \0A\xE0j" 6\xDC*!@\x7F@\x7F@ \b@ (\b!\b \0 70 \0 7( \0 \b6 \x07 \0A j]"AJ\r\f\v \0 7P \0 7X \0A\xE0j \0A\x88j"\x07 \0A\xD0\0j]"AL\r*! \0 7@ \0 7H \0A\xDCj \x07 \0A@kP\f\v*! (\b!\x07 \0 7 \0 7\b \0 \x076\0 \0A\xDCj \0A\x88j \0P\v"A\x7FF\r \0(\xDC\f\vA\0\v \0(\xDC"\x07 \x07j"
|
|
G!\v@ \0A\xE0j \x07F@ \0A\xF0\0j!A\0!\b\f\v At/"\b! \bE\r\v \0A\xE4\0j"\f $ \x07 \v
|
|
\0A\xEC\0j \0A\xE8\0j \f\x90 \0(d# \0(l \0(h \\! \b!! \0A\x90j$\0 \f\v0\0\v\v\x9A\x07\x7F\x7F#\0A\xF0k"\0$\0 \0B%7\xE8 \0A\xE8j"ArA\xD7 (\x91!\x07 \0 \0A\xC0j"\b6\xBC*!@\x7F@\x7F@ \x07@ (\b!\x07 \0 9 \0 \x076 \b \0Aj]"AJ\r\f\v \0 90 \0A\xC0j \0A\xE8j" \0A0j]"AL\r*! \0 9 \0A\xBCj \0A jP\f\v*! (\b! \0 9\b \0 6\0 \0A\xBCj \0A\xE8j \0P\v"A\x7FF\r \0(\xBC\f\vA\0\v \0(\xBC" j" G!
|
|
@ \0A\xC0j F@ \0A\xD0\0j!A\0!\x07\f\v At/"\x07! \x07E\r\v \0A\xC4\0j"\v $
|
|
\0A\xCC\0j \0A\xC8\0j \v\x90 \0(D# \0(L \0(H \\! \x07!! \0A\xF0j$\0 \f\v0\0\v\v\xC7\x7F#\0A\xF0k"\0$\0A\bAA
|
|
("A\xCA\0q"\x07A\bF\x1B \x07A\xC0\0F"\b\x1B! \0A\xD0j!@ A\x80qE Pr\r\0 \b@ \0A0:\0\xD0 Ar!\f\v \x07A\bG\r\0 \0A0:\0\xD0 \0A\xD8\0A\xF8\0 A\x80\x80q\x1B:\0\xD1 \0A\xD0jAr!\v \0A\xC8j \0A\xE8j \x92 \0(\xC8!\x07@ A\x88\x80qA\x88\x80G\r\0@ \x07F\r -\0\0"A k A\xE1\0kA\xFFqAI\x1B:\0\0 Aj!\f\0\v\0\v \0A\xD0j" \x07 G! \0Aj"\b $ \x07 \0Aj" \0A\fj \0A\bj \b\x90 \0(# \0(\f \0(\b \\ \0A\xF0j$\0\v\r\0 \x91\v\xA8\x7F~#\0A\xF0k"$\0 A\xD0j!\0~ ("A\xCA\0q"\x07A\bF"\b B\0YrE@ \x07A\xC0\0F\r A-:\0\xD0 \0Ar!\0B\0 }\f\v \v!
|
|
\b \x07A\xC0\0F" r A\x80qE B\0SrrE@ \0A+:\0\0 \0Aj!\0\vA\bAA
|
|
\b\x1B \x1B!\b@ A\x80qE Pr\r\0 \x07A\xC0\0F@ \0A0:\0\0 \0Aj!\0\f\v \x07A\bG\r\0 \0A0:\0\0 \0A\xD8\0A\xF8\0 A\x80\x80q\x1B:\0 \0Aj!\0\v A\xC8j \0 A\xE8j
|
|
\b\x92@ A\x88\x80qA\x88\x80F@@ \0 (\xC8"F\r \0 \0-\0\0"A k A\xE1\0kA\xFFqAI\x1B:\0\0 \0Aj!\0\f\0\v\0\v (\xC8!\v A\xD0j"\0 G!\x07 Aj"\b $ \0 \x07 Aj"\0 A\fj A\bj \b\x90 (# \0 (\f (\b \\ A\xF0j$\0\v\xA5\x7F#\0A\x90k"$\0 A\x83j!\0\x7F ("A\xCA\0q"\x07A\bF"\b A\0NrE@ \x07A\xC0\0F\r A-:\0\x83 A\x84j!\0A\0 k\f\v \v! \b \x07A\xC0\0F"
|
|
r A\x80qE A\0HrrE@ \0A+:\0\0 \0Aj!\0\vA\bAA
|
|
\b\x1B
|
|
\x1B!\b@ E A\x80qEr\r\0 \x07A\xC0\0F@ \0A0:\0\0 \0Aj!\0\f\v \x07A\bG\r\0 \0A0:\0\0 \0A\xD8\0A\xF8\0 A\x80\x80q\x1B:\0 \0Aj!\0\v A\xF8\0j \0 A\x90j \b\x94@ A\x88\x80qA\x88\x80F@@ \0 (x"F\r \0 \0-\0\0"A k A\xE1\0kA\xFFqAI\x1B:\0\0 \0Aj!\0\f\0\v\0\v (x!\v A\x83j"\0 G! Aj"\x07 $ \0 Aj"\0 A\fj A\bj \x07\x90 (# \0 (\f (\b \\ A\x90j$\0\v\xDE\x7F#\0Ak"$\0 6\f@ -\0AqE@ \0 \0(\0( \0!\f\v $ n!\0 (\0# \0 \0(\0AA \x1Bj(\0\0 (\0" ,\0\v"A\0H\x1B!@ \xC0A\0H"\0\x1B ( A\xFFq \0\x1BAtj F@ (\f! A\fj (\0\xBE Aj! (\0! -\0\v!\f\v\v\v Aj$\0 \v+\x7F ("A\xB5\xFB~qA\x88r6 \x94 6\v\xB7\x07\x7F\x7F#\0A\xE0k"\0$\0 \0B%7\xD8 \0A\xD8j"\x07ArA\x82 (\x91!\b \0 \0A\xB0j" 6\xAC*!@\x7F@\x7F@ \b@ (\b!\b \0 70 \0 7( \0 \b6 \x07 \0A j]"AJ\r\f\v \0 7P \0 7X \0A\xB0j \0A\xD8j"\x07 \0A\xD0\0j]"AL\r*! \0 7@ \0 7H \0A\xACj \x07 \0A@kP\f\v*! (\b!\x07 \0 7 \0 7\b \0 \x076\0 \0A\xACj \0A\xD8j \0P\v"A\x7FF\r \0(\xAC\f\vA\0\v \0(\xAC"\x07 \x07j"
|
|
G!\v@ \0A\xB0j \x07F@ \0A\xF0\0j!A\0!\b\f\v At/"\b! \bE\r\v \0A\xE4\0j"\f $ \x07 \v
|
|
\0A\xEC\0j \0A\xE8\0j \f\x93 \0(d# \0(l \0(h Z! \b!! \0A\xE0j$\0 \f\v0\0\v\v\x9A\x07\x7F\x7F#\0A\xC0k"\0$\0 \0B%7\xB8 \0A\xB8j"ArA\xD7 (\x91!\x07 \0 \0A\x90j"\b6\x8C*!@\x7F@\x7F@ \x07@ (\b!\x07 \0 9 \0 \x076 \b \0Aj]"AJ\r\f\v \0 90 \0A\x90j \0A\xB8j" \0A0j]"AL\r*! \0 9 \0A\x8Cj \0A jP\f\v*! (\b! \0 9\b \0 6\0 \0A\x8Cj \0A\xB8j \0P\v"A\x7FF\r \0(\x8C\f\vA\0\v \0(\x8C" j" G!
|
|
@ \0A\x90j F@ \0A\xD0\0j!A\0!\x07\f\v At/"\x07! \x07E\r\v \0A\xC4\0j"\v $
|
|
\0A\xCC\0j \0A\xC8\0j \v\x93 \0(D# \0(L \0(H Z! \x07!! \0A\xC0j$\0 \f\v0\0\v\v\xC3\x7F#\0A\xF0\0k"\0$\0A\bAA
|
|
("A\xCA\0q"\x07A\bF\x1B \x07A\xC0\0F"\b\x1B! \0A\xD0\0j!@ A\x80qE Pr\r\0 \b@ \0A0:\0P Ar!\f\v \x07A\bG\r\0 \0A0:\0P \0A\xD8\0A\xF8\0 A\x80\x80q\x1B:\0Q \0A\xD0\0jAr!\v \0A\xC8\0j \0A\xE8\0j \x92 \0(H!\x07@ A\x88\x80qA\x88\x80G\r\0@ \x07F\r -\0\0"A k A\xE1\0kA\xFFqAI\x1B:\0\0 Aj!\f\0\v\0\v \0A\xD0\0j" \x07 G! \0Aj"\b $ \x07 \0Aj" \0A\fj \0A\bj \b\x93 \0(# \0(\f \0(\b Z \0A\xF0\0j$\0\v\r\0 \x94\v\xA5\x7F~#\0A\xF0\0k"$\0 A\xD0\0j!\0~ ("A\xCA\0q"\x07A\bF"\b B\0YrE@ \x07A\xC0\0F\r A-:\0P \0Ar!\0B\0 }\f\v \v!
|
|
\b \x07A\xC0\0F" r A\x80qE B\0SrrE@ \0A+:\0\0 \0Aj!\0\vA\bAA
|
|
\b\x1B \x1B!\b@ A\x80qE Pr\r\0 \x07A\xC0\0F@ \0A0:\0\0 \0Aj!\0\f\v \x07A\bG\r\0 \0A0:\0\0 \0A\xD8\0A\xF8\0 A\x80\x80q\x1B:\0 \0Aj!\0\v A\xC8\0j \0 A\xE8\0j
|
|
\b\x92@ A\x88\x80qA\x88\x80F@@ \0 (H"F\r \0 \0-\0\0"A k A\xE1\0kA\xFFqAI\x1B:\0\0 \0Aj!\0\f\0\v\0\v (H!\v A\xD0\0j"\0 G!\x07 Aj"\b $ \0 \x07 Aj"\0 A\fj A\bj \b\x93 (# \0 (\f (\b Z A\xF0\0j$\0\v\x9D\x7F#\0A@j"$\0 A3j!\0\x7F ("A\xCA\0q"\x07A\bF"\b A\0NrE@ \x07A\xC0\0F\r A-:\x003 A4j!\0A\0 k\f\v \v! \b \x07A\xC0\0F"
|
|
r A\x80qE A\0HrrE@ \0A+:\0\0 \0Aj!\0\vA\bAA
|
|
\b\x1B
|
|
\x1B!\b@ E A\x80qEr\r\0 \x07A\xC0\0F@ \0A0:\0\0 \0Aj!\0\f\v \x07A\bG\r\0 \0A0:\0\0 \0A\xD8\0A\xF8\0 A\x80\x80q\x1B:\0 \0Aj!\0\v A(j \0 A@k \b\x94@ A\x88\x80qA\x88\x80F@@ \0 (("F\r \0 \0-\0\0"A k A\xE1\0kA\xFFqAI\x1B:\0\0 \0Aj!\0\f\0\v\0\v ((!\v A3j"\0 G! Aj"\x07 $ \0 Aj"\0 A\fj A\bj \x07\x93 (# \0 (\f (\b Z A@k$\0\v\xDB\x7F#\0Ak"$\0 6\f@ -\0AqE@ \0 \0(\0( \0!\f\v $ p!\0 (\0# \0 \0(\0AA \x1Bj(\0\0 (\0" ,\0\v"A\0H\x1B!@ \xC0A\0H"\0\x1B ( A\xFFq \0\x1Bj F@ (\f! A\fj ,\0\0\xC0 Aj! (\0! -\0\v!\f\v\v\v Aj$\0 \v\xED\x7F#\0A\xD0k"\0$\0 \0 6\xC8 \0 6\xCC \0A\x006\xD8 \0B\x007\xD0 \0Aj" $ ="A\xD0\x85A\xEA\x85 \0A\xE0j (\0(0\0 \0(# \0A\x006\xC8 \0B\x007\xC0 \0A\xC0j"A
|
|
" \0 \0(\xC0 \0,\0\xCBA\0H\x1B"6\xBC \0 6\f \0A\x006\b@@ \0A\xCCj \0A\xC8j(\r\0 \0(\xBC \0(\xC4 \0,\0\xCB" A\0H\x1B"jF@ \0A\xC0j" At" A
|
|
\0(\xC8A\xFF\xFF\xFF\xFF\x07qAk \0,\0\xCBA\0N\x1B" \0 \0(\xC0 \0,\0\xCBA\0H\x1B" j6\xBC\v \0(\xCCCA \0A\xBCj \0A\bjA\0 \0A\xD0j \0Aj \0A\fj \0A\xE0jm\r\0 \0(\xCCB\f\v\v \0A\xC0j" \0(\xBC k" \0(\xC0 \0,\0\xCB!*! \0 6\0 A\0H\x1B \0\x98AG@ A6\0\v \0A\xCCj \0A\xC8j(@ (\0Ar6\0\v \0(\xCC \0A\xC0j \0A\xD0j \0A\xD0j$\0\v\xBD\x7F~\x7F#\0A\xF0k"\0$\0 \0 6\xE8 \0 6\xEC \0A\xDCj \0A\xF0j \0A\xECj \0A\xE8j\xB3 \0A\x006\xD8 \0B\x007\xD0 \0A\xD0j"A
|
|
" \0 \0(\xD0 \0,\0\xDBA\0H\x1B"6\xCC \0 \0A j6 \0A\x006 \0A:\0 \0A\xC5\0:\0A\0!@@@@ \0A\xECj \0A\xE8j(\r\0 \0(\xCC \0(\xD4 \0,\0\xDB" A\0H\x1B"jF@ \0A\xD0j" At" A
|
|
\0(\xD8A\xFF\xFF\xFF\xFF\x07qAk \0,\0\xDBA\0N\x1B" \0 \0(\xD0 \0,\0\xDBA\0H\x1B" j6\xCC\v \0(\xECC \0Aj \0Aj \0A\xCCj \0(\xEC \0(\xE8 \0A\xDCj \0A j \0Aj \0Aj \0A\xF0j\xB2\r\0 \rA\0! \0(\xCC k"A\0L\r@@ -\0\0"A+k"\x07\0\0\v A.F\rA! A0kA\xFFqA
|
|
I\r\f\v AF\r@ \x07\0\0\v -\0"A.F\rA! A0kA\xFFqA M\r\v@ \0(\xE0 \0,\0\xE7" A\0H\x1BE\r\0 \0-\0AqE\r\0 \0(" \0A jkA\x9FJ\r\0 \0 Aj6 \0(6\0\v \0 \0(\xCC \x99 \0)\0!\b \0)\b7\b \b7\0 \0A\xDCj \0A j \0( 5 \0A\xECj \0A\xE8j(@ (\0Ar6\0\v \0(\xEC \0A\xD0j \0A\xDCj \0A\xF0j$\0\f\vA!\v \0(\xECB\f\0\v\0\v\v\xA6\x7F\x7F#\0A\xE0k"\0$\0 \0 6\xD8 \0 6\xDC \0A\xCCj \0A\xE0j \0A\xDCj \0A\xD8j\xB3 \0A\x006\xC8 \0B\x007\xC0 \0A\xC0j"A
|
|
" \0 \0(\xC0 \0,\0\xCBA\0H\x1B"6\xBC \0 \0Aj6\f \0A\x006\b \0A:\0\x07 \0A\xC5\0:\0A\0!@@@@ \0A\xDCj \0A\xD8j(\r\0 \0(\xBC \0(\xC4 \0,\0\xCB" A\0H\x1B"jF@ \0A\xC0j" At" A
|
|
\0(\xC8A\xFF\xFF\xFF\xFF\x07qAk \0,\0\xCBA\0N\x1B" \0 \0(\xC0 \0,\0\xCBA\0H\x1B" j6\xBC\v \0(\xDCC \0A\x07j \0Aj \0A\xBCj \0(\xDC \0(\xD8 \0A\xCCj \0Aj \0A\fj \0A\bj \0A\xE0j\xB2\r\0 \rA\0! \0(\xBC k"A\0L\r@@ -\0\0"A+k"\x07\0\0\v A.F\rA! A0kA\xFFqA
|
|
I\r\f\v AF\r@ \x07\0\0\v -\0"A.F\rA! A0kA\xFFqA M\r\v@ \0(\xD0 \0,\0\xD7" A\0H\x1BE\r\0 \0-\0\x07AqE\r\0 \0(\f" \0AjkA\x9FJ\r\0 \0 Aj6\f \0(\b6\0\v \0(\xBC \x9A9\0 \0A\xCCj \0Aj \0(\f 5 \0A\xDCj \0A\xD8j(@ (\0Ar6\0\v \0(\xDC \0A\xC0j \0A\xCCj \0A\xE0j$\0\f\vA!\v \0(\xDCB\f\0\v\0\v\v\xA6\x7F\x7F#\0A\xE0k"\0$\0 \0 6\xD8 \0 6\xDC \0A\xCCj \0A\xE0j \0A\xDCj \0A\xD8j\xB3 \0A\x006\xC8 \0B\x007\xC0 \0A\xC0j"A
|
|
" \0 \0(\xC0 \0,\0\xCBA\0H\x1B"6\xBC \0 \0Aj6\f \0A\x006\b \0A:\0\x07 \0A\xC5\0:\0A\0!@@@@ \0A\xDCj \0A\xD8j(\r\0 \0(\xBC \0(\xC4 \0,\0\xCB" A\0H\x1B"jF@ \0A\xC0j" At" A
|
|
\0(\xC8A\xFF\xFF\xFF\xFF\x07qAk \0,\0\xCBA\0N\x1B" \0 \0(\xC0 \0,\0\xCBA\0H\x1B" j6\xBC\v \0(\xDCC \0A\x07j \0Aj \0A\xBCj \0(\xDC \0(\xD8 \0A\xCCj \0Aj \0A\fj \0A\bj \0A\xE0j\xB2\r\0 \rA\0! \0(\xBC k"A\0L\r@@ -\0\0"A+k"\x07\0\0\v A.F\rA! A0kA\xFFqA
|
|
I\r\f\v AF\r@ \x07\0\0\v -\0"A.F\rA! A0kA\xFFqA M\r\v@ \0(\xD0 \0,\0\xD7" A\0H\x1BE\r\0 \0-\0\x07AqE\r\0 \0(\f" \0AjkA\x9FJ\r\0 \0 Aj6\f \0(\b6\0\v \0(\xBC \x9B8\0 \0A\xCCj \0Aj \0(\f 5 \0A\xDCj \0A\xD8j(@ (\0Ar6\0\v \0(\xDC \0A\xC0j \0A\xCCj \0A\xE0j$\0\f\vA!\v \0(\xDCB\f\0\v\0\v\v\xF1\x7F#\0A\xD0k"\0$\0 \0 6\xC8 \0 6\xCC R! \0A\xD0j~! \0A\xC4j \0A\xC4j} \0A\x006\xC0 \0B\x007\xB8 \0A\xB8j"A
|
|
" \0 \0(\xB8 \0,\0\xC3A\0H\x1B"6\xB4 \0 \0Aj6\f \0A\x006\b@@ \0A\xCCj \0A\xC8j(\r\0 \0(\xB4 \0(\xBC \0,\0\xC3" A\0H\x1B"jF@ \0A\xB8j" At" A
|
|
\0(\xC0A\xFF\xFF\xFF\xFF\x07qAk \0,\0\xC3A\0N\x1B" \0 \0(\xB8 \0,\0\xC3A\0H\x1B" j6\xB4\v \0(\xCCC \0A\xB4j \0A\bj \0(\xC4 \0A\xC4j \0Aj \0A\fj m\r\0 \0(\xCCB\f\v\v@ \0(\xC8 \0,\0\xCF" A\0H\x1BE\r\0 \0(\f" \0AjkA\x9FJ\r\0 \0 Aj6\f \0(\b6\0\v \0(\xB4 \x9C7\0 \0A\xC4j \0Aj \0(\f 5 \0A\xCCj \0A\xC8j(@ (\0Ar6\0\v \0(\xCC \0A\xB8j \0A\xC4j \0A\xD0j$\0\v\x07\0 \0(\0\v\xF1\x7F#\0A\xD0k"\0$\0 \0 6\xC8 \0 6\xCC R! \0A\xD0j~! \0A\xC4j \0A\xC4j} \0A\x006\xC0 \0B\x007\xB8 \0A\xB8j"A
|
|
" \0 \0(\xB8 \0,\0\xC3A\0H\x1B"6\xB4 \0 \0Aj6\f \0A\x006\b@@ \0A\xCCj \0A\xC8j(\r\0 \0(\xB4 \0(\xBC \0,\0\xC3" A\0H\x1B"jF@ \0A\xB8j" At" A
|
|
\0(\xC0A\xFF\xFF\xFF\xFF\x07qAk \0,\0\xC3A\0N\x1B" \0 \0(\xB8 \0,\0\xC3A\0H\x1B" j6\xB4\v \0(\xCCC \0A\xB4j \0A\bj \0(\xC4 \0A\xC4j \0Aj \0A\fj m\r\0 \0(\xCCB\f\v\v@ \0(\xC8 \0,\0\xCF" A\0H\x1BE\r\0 \0(\f" \0AjkA\x9FJ\r\0 \0 Aj6\f \0(\b6\0\v \0(\xB4 \x9F;\0 \0A\xC4j \0Aj \0(\f 5 \0A\xCCj \0A\xC8j(@ (\0Ar6\0\v \0(\xCC \0A\xB8j \0A\xC4j \0A\xD0j$\0\v\xF1\x7F#\0A\xD0k"\0$\0 \0 6\xC8 \0 6\xCC R! \0A\xD0j~! \0A\xC4j \0A\xC4j} \0A\x006\xC0 \0B\x007\xB8 \0A\xB8j"A
|
|
" \0 \0(\xB8 \0,\0\xC3A\0H\x1B"6\xB4 \0 \0Aj6\f \0A\x006\b@@ \0A\xCCj \0A\xC8j(\r\0 \0(\xB4 \0(\xBC \0,\0\xC3" A\0H\x1B"jF@ \0A\xB8j" At" A
|
|
\0(\xC0A\xFF\xFF\xFF\xFF\x07qAk \0,\0\xC3A\0N\x1B" \0 \0(\xB8 \0,\0\xC3A\0H\x1B" j6\xB4\v \0(\xCCC \0A\xB4j \0A\bj \0(\xC4 \0A\xC4j \0Aj \0A\fj m\r\0 \0(\xCCB\f\v\v@ \0(\xC8 \0,\0\xCF" A\0H\x1BE\r\0 \0(\f" \0AjkA\x9FJ\r\0 \0 Aj6\f \0(\b6\0\v \0(\xB4 \xA07\0 \0A\xC4j \0Aj \0(\f 5 \0A\xCCj \0A\xC8j(@ (\0Ar6\0\v \0(\xCC \0A\xB8j \0A\xC4j \0A\xD0j$\0\v\xF1\x7F#\0A\xD0k"\0$\0 \0 6\xC8 \0 6\xCC R! \0A\xD0j~! \0A\xC4j \0A\xC4j} \0A\x006\xC0 \0B\x007\xB8 \0A\xB8j"A
|
|
" \0 \0(\xB8 \0,\0\xC3A\0H\x1B"6\xB4 \0 \0Aj6\f \0A\x006\b@@ \0A\xCCj \0A\xC8j(\r\0 \0(\xB4 \0(\xBC \0,\0\xC3" A\0H\x1B"jF@ \0A\xB8j" At" A
|
|
\0(\xC0A\xFF\xFF\xFF\xFF\x07qAk \0,\0\xC3A\0N\x1B" \0 \0(\xB8 \0,\0\xC3A\0H\x1B" j6\xB4\v \0(\xCCC \0A\xB4j \0A\bj \0(\xC4 \0A\xC4j \0Aj \0A\fj m\r\0 \0(\xCCB\f\v\v@ \0(\xC8 \0,\0\xCF" A\0H\x1BE\r\0 \0(\f" \0AjkA\x9FJ\r\0 \0 Aj6\f \0(\b6\0\v \0(\xB4 \xA16\0 \0A\xC4j \0Aj \0(\f 5 \0A\xCCj \0A\xC8j(@ (\0Ar6\0\v \0(\xCC \0A\xB8j \0A\xC4j \0A\xD0j$\0\v\x99\x8B.\x7F}|#\0Ak"$\0 6\f A\x006\b B\x007\0 j" k\xC2#\0A\xE0\0k"%$\0 %A\bj! (\0"! ( k!#\0A\xC0k"$\0 A\x006\xA0 B\x007\x98 A\x006\xB0 B\x007\xA8 A\xB4j"A\x006\b B\x007\0 A\x80\xC0\0\xB6 A\x80\xC0\0\x96 A\fjA\0A0\xFC\v\0 6\b 6@\x7F Aj!\v\x7FAzA\x94-\0\0A1G\r\0A~ \vE\r \vA\x006 \v( "E@ \vA\x006( \vA/6 A/!\v \v($E@ \vA06$\vA| \v((AA\xD07 \0"E\r \v 6 A\x0068 \v6\0 A\xB4\xFE\x006A~!@ \vE\r\0 \v( E\r\0 \v($"E\r\0 \v("E\r\0 (\0 \vG\r\0 (A\xB4\xFE\0kAK\r\0@@ (8"@ ((AG\r\v A6( A6\f\f\v \v(( \0 A\x0068 \v( A6( A6\fE\r\v \v($E\r\0 \v("E\r\0 (\0 \vG\r\0 (A\xB4\xFE\0kAK\r\0A\0! A\x0064 B\x007, A\x006 \vA\x006\b \vB\x007 (\f"@ \v Aq60\v B\x007< A\x006$ A\x80\x806 B\x80\x80\x80\x80p7 B\xB4\xFE\x007 B\x81\x80\x80\x80p7\xC47 A\xB4
|
|
j"6p 6T 6P\vA\0 E\r\0 \v(( \v($\0 \vA\x006 \v\vE@ A\x006\xAC@@ (\0"6 ( k6A\0!\v#\0Ak"$\0A~!\x1B@ Aj"\rE\r\0 \r( E\r\0 \r($E\r\0 \r("\x07E\r\0 \x07(\0 \rG\r\0 \x07("A\xB4\xFE\0kAK\r\0 \r(\f"E\r\0 \r(\0"E@ \r(\r\v A\xBF\xFE\0F@ \x07A\xC0\xFE\x006A\xC0\xFE\0!\v \x07A\xDC\0j!- \x07A\xF2\0j!. \x07A\xF4j!" \x07A\xD8\0j!& \x07A\xF0\0j!# \x07A\xB4
|
|
j! \x07A\xF4\0j! \x07(@! \x07(<! \r("'! \r("!@@@@@@A}!@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ A\xB4\xFE\0k\x07
|
|
\r9:;<%&(\0*@BCD\v \x07(L! \f(\v \x07(L! \f%\v \x07(l! \f!\v \x07(\f!\f9\v AO\r E\r< A\bj! Aj! Ak! -\0\0 t j! AM\r ! ! !\f\v A O\r E\r; Aj! Ak! -\0\0 t j! AM\r\r ! !\f\v AO\r E\r: A\bj! Aj! Ak! -\0\0 t j! A\x07M\r ! ! !\f\v \x07(\f"
|
|
E\r@ AO\r\0 E\r: A\bj! Aj! Ak! -\0\0 t j! A\x07K@ ! ! !\f\v E@ !A\0! ! \v!\f<\v Ar! Ak! -\0 t j! Aj!\v
|
|
AqE A\x9F\x96GrE@ \x07((E@ \x07A6(\vA\0! \x07A\0A\0A\0D"6 A\x9F\x96;\f A\fjAD! \x07A\xB5\xFE\x006 \x07 6A\0! \x07(!\f7\v \x07($"@ A\x7F60\v A\btA\x80\xFEq A\bvjApE
|
|
AqqE@ \rA\xD96 \x07A\xD1\xFE\x006 \x07(!\f7\v AqA\bG@ \rA\xBA6 \x07A\xD1\xFE\x006 \x07(!\f7\v Av"Aq" A\bj!
|
|
A\x07M \x07(("\x7F \x07
|
|
6(
|
|
\v
|
|
OqE@ Ak! \rA\xF46 \x07A\xD1\xFE\x006 ! \x07(!\f7\vA\0! \x07A\x006 \x07A\x80 t6 \x07A\0A\0A\0\x82"6 \r 60 \x07A\xBD\xFE\0A\xBF\xFE\0 A\x80\xC0\0q\x1B6A\0! \x07(!\f6\v E@ !A\0! ! \v!\f:\v Ar! Ak! -\0 t j! Aj!\v \x07 6 A\xFFqA\bG@ \rA\xBA6 \x07A\xD1\xFE\x006 \x07(!\f5\v A\x80\xC0q@ \rA\x90
|
|
6 \x07A\xD1\xFE\x006 \x07(!\f5\v \x07($"@ A\bvAq6\0\v@ A\x80qE\r\0 \x07-\0\fAqE\r\0 A\b:\0\f A\bv:\0\r \x07 \x07( A\fjAD6\v \x07A\xB6\xFE\x006A\0!A\0!\f\v AK\r\v E\r5 Aj! Ak! -\0\0 t j! AK@ ! !\f\v A\bj! E@ !A\0! ! \v!\f7\v Aj! Ak! -\0 t j! AK@ ! !\f\v Aj! E@ !A\0! ! \v!\f7\v Aj! Ak! -\0 t j! A\x07K@ ! !\f\v Aj! E@ !\f6\v Ak! -\0 t j! Aj!\v \x07($"@ 6\v@ \x07-\0AqE\r\0 \x07-\0\fAqE\r\0 6\f \x07 \x07( A\fjAD6\v \x07A\xB7\xFE\x006A\0!A\0!\f\v AK\r\v E\r2 Aj! Ak! -\0\0 t j! A\x07K@ ! !\f\v A\bj! E@ !\f3\v Ak! -\0 t j! Aj!\v \x07($"@ A\bv6\f A\xFFq6\b\v@ \x07-\0AqE\r\0 \x07-\0\fAqE\r\0 ;\f \x07 \x07( A\fjAD6\v \x07A\xB8\xFE\x006A\0!A\0!A\0! \x07("A\x80\bq\r\f'\v \x07("A\x80\bqE@ !\f'\v ! AK\r\v E@A\0! ! \v!\f1\v Aj! Ak!
|
|
-\0\0 t j! A\x07K@ !
|
|
!\f\v A\bj!
|
|
E@ !\f0\v Ak! -\0 t j! Aj!\v \x07 6D \x07($"@ 6\vA\0!@ A\x80qE\r\0 \x07-\0\fAqE\r\0 ;\f \x07 \x07( A\fjAD6\vA\0!\f%\v A\bj! E@ !A\0! ! \v!\f/\v Aj! Ak! -\0 t j! AK@ ! !\f\v Aj! E@ !A\0! ! \v!\f/\v Aj! Ak! -\0 t j! A\x07K@ ! !\f\v Aj! E@ !\f.\v Ak! -\0 t j! Aj!\v \x07 AxA\xFF\x81\xFC\x07q A\xFF\x81\xFC\x07qA\bxr"6 \r 60 \x07A\xBE\xFE\x006A\0!A\0!\v \x07(E@ \r 6 \r 6\f \r 6 \r 6\0 \x07 6@ \x07 6<A!\x1B\f/\v \x07A\0A\0A\0\x82"6 \r 60 \x07A\xBF\xFE\x006\v\x7F@ \x07(\bE@ AK\r \r\f-\v \x07A\xCE\xFE\x006 A\x07qv! Axq! \x07(!\f)\v Ak! -\0\0 t j! Aj! A\br\v \x07 Aq6\bA\xC1\xFE\0!@@@@@ AvAqAk\0\v \x07A\x90\xDC\x006P \x07B\x89\x80\x80\x80\xD0\x007X \x07A\x90\xEC\x006T \x07A\xC7\xFE\x006\f\vA\xC4\xFE\0!\f\v \rA\x976A\xD1\xFE\0!\v \x07 6\vAk! Av! \x07(!\f'\v A\x07qv!\x7F Axq"\b AK\r\0 E@A\0! \b! \v!\f,\v \bA\bj! Aj! Ak! -\0\0 \bt j! AK@ ! ! \f\v E@ !A\0! ! \v!\f,\v \bAj!
|
|
Aj! Ak! -\0 t j! AK@ ! !
|
|
\f\v E@ !A\0!
|
|
! \v!\f,\v \bAj! Aj! Ak! -\0
|
|
t j! A\x07K@ ! ! \f\v E@ !A\0! ! \v!\f,\v Ak! -\0 t j! Aj!A \v! A\xFF\xFFq" A\x7FsAvG@ \rA\xC2\v6 \x07A\xD1\xFE\x006 \x07(!\f'\v \x07A\xC2\xFE\x006 \x07 6DA\0!A\0!\v \x07A\xC3\xFE\x006\v \x07(D"@ I\x1B" I\x1B"E@ \v!\f*\v @ \xFC
|
|
\0\0\v \x07 \x07(D k6D j! k! j! k! \x07(!\f%\v \x07A\xBF\xFE\x006 \x07(!\f$\v E@ !A\0! ! \v!\f(\v Ar! Ak! -\0 t j! Aj!\v \x07 Aq"A\x81j6d \x07 AvAq"Aj6h \x07 A
|
|
vAqAj"
|
|
6\` Ak! Av! AI AMqE@ \rA\x9E\v6 \x07A\xD1\xFE\x006 \x07(!\f#\v \x07A\xC5\xFE\x006A\0! \x07A\x006l\f\v \x07(l" \x07(\`"
|
|
I\r\f\v E\r\r \x07(D:\0\0 \x07A\xC8\xFE\x006 Ak! Aj! \x07(!\f \v \x07(\f"E@A\0!\f\v@ AK@ ! \f\v E\r# A\bj! Aj! Ak!
|
|
-\0\0 t j! AK@
|
|
! !\f\v
|
|
E@ !A\0! ! \v!\f%\v Aj!
|
|
Aj! Ak!\b -\0 t j! AK@ \b!
|
|
!\f\v \bE@ !A\0!
|
|
! \v!\f%\v Aj! Aj! Ak!\b -\0
|
|
t j! A\x07K@ \b! !\f\v \bE@ !A\0! ! \v!\f%\v A r! Aj! Ak! -\0 t j!\v \r k"
|
|
\r(j6 \x07 \x07(
|
|
j6 Aq"E Fr\x7F
|
|
k! \x07(! \x07\x7F \x07(@
|
|
D\f\v
|
|
\x82\v"6 \r 60 \x07(\f"Aq\vE\r \x07( AxA\xFF\x81\xFC\x07q A\xFF\x81\xFC\x07qA\bxr \x07(\x1BF\r \rA\x876 \x07A\xD1\xFE\x006 ! ! \x07(!\f\v \x07A\xC0\xFE\x006\f\v !A\0!A\0! !\v \x07A\xCF\xFE\x006\f\x1B\v@ AM@ E\r Ak! -\0\0 t j! A\br! Aj!\v \x07 Aj"6l At/\xE0[Atj A\x07q;\0 Ak! Av! "
|
|
G\r\0\v
|
|
!\v AM@A\0! "Aq"\vAG@@ At/\xE0[AtjA\0;\0 Aj! \v Aj" sAG\r\0\v\v AM@@ At"A\xE0\xDB\0j/\0AtjA\0;\0 A\xE2\xDB\0j/\0AtjA\0;\0 A\xE4\xDB\0j/\0AtjA\0;\0 A\xE6\xDB\0j/\0AtjA\0;\0 Aj"AG\r\0\v\v \x07A6l\v \x07A\x076X \x07 6P \x07 6pA\0! A\0 A # & "\xA2"\v@ \rA\xF7 6 \x07A\xD1\xFE\x006 \x07(!\f\x1B\v \x07A\xC6\xFE\x006 \x07A\x006lA\0!\v\v \x07(d" \x07(hj" K@A\x7F \x07(XtA\x7Fs! \x07(P!@ !\f ! !@@@@@@ q"Atj-\0"\b M@ !
|
|
\f\v@ E\r -\0\0 \ft!\b Aj! Ak! \fA\bj"
|
|
!\f
|
|
\bj" q"Atj-\0"\bI\r\0\v\v Atj/"AM@ \x07 Aj"6l Atj ;\0
|
|
\bk! \bv! ! \f\v\x7F\x7F@@@ Ak\0\v \bAj"
|
|
K@@ E\r Ak! -\0\0
|
|
t j! Aj!
|
|
A\bj"
|
|
I\r\0\v\v
|
|
\bk! \bv!
|
|
E@ \rA\xCD
|
|
6 \x07A\xD1\xFE\x006 ! !
|
|
! \x07(!\f%\v Ak!
|
|
Av!
|
|
AqAj!\b . Atj/\0\f\v \bAj"
|
|
K@@ E\r Ak! -\0\0
|
|
t j! Aj!
|
|
A\bj"
|
|
I\r\0\v\v
|
|
\bkAk! \bv"Av! A\x07qAj\f\v \bA\x07j"
|
|
K@@ E\r Ak! -\0\0
|
|
t j! Aj!
|
|
A\bj"
|
|
I\r\0\v\v
|
|
\bkA\x07k! \bv"A\x07v! A\xFF\0qA\vj\v!\bA\0\v!\f \b j K\rA\0!
|
|
\bAq"E\r \b!@ Atj \f;\0 Aj! Ak!
|
|
Aj"
|
|
G\r\0\v\f\v j! Atj!\f"\v \b!\f\v \rA\xCD
|
|
6 \x07A\xD1\xFE\x006 ! ! \x07(!\f\v \bAO@@ Atj" \f;\0 \f; \f; \f; Aj! Ak"\r\0\v\v \x07 6l\v ! ! I\r\0\v\v \x07/\xF4E@ \rA\xB46 \x07A\xD1\xFE\x006 \x07(!\f\v \x07A 6X \x07 6P \x07 6pA # & "\xA2"\v@ \rA\xDB 6 \x07A\xD1\xFE\x006 \x07(!\f\v \x07A6\\ \x07 \x07(p6TA \x07(dAtj \x07(h # - "\xA2"\v@ \rA\xA9
|
|
6 \x07A\xD1\xFE\x006 \x07(!\f\v \x07A\xC7\xFE\x006A\0!\v\v \x07A\xC8\xFE\x006\v AI A\x82IrE@ \r 6 \r 6\f \r 6 \r 6\0 \x07 6@ \x07 6< \r("(4"\bA\x07q!( \b j!/ \b (,"0j!1 \r(\f" \r("j"$A\x81k!) kj! \r(\0" \r(jAk!*A\x7F (\\tA\x7Fs!A\x7F (XtA\x7Fs! (T!+ (P!, (@! (<!\f (8!
|
|
(0!@ AM\x7F -\0\0 t \fj -\0 A\bjtj!\f Aj! Ar \v , \f qAtj"-\0"k! \f v!\f@@@@@ \x7F \r\x7F@@ -\0\0"E@ -\0:\0\0 Aj!\f\b\v Aq@ /!\x7F Aq"E@ ! \f\f\v\x7F M@ ! \f\v A\bj! -\0\0 t \fj!\f Aj\v! k! \fA\x7F tA\x7Fsq j! \f v\v! AM@ -\0\0 t j -\0 A\bjtj! Ar! Aj!\v + qAtj"-\0" k! v!\f -\0\0"Aq\r@ A\xC0\0qE@ + /Atj \fA\x7F tA\x7FsqAtj"-\0"k! \f v!\f -\0\0"AqE\r\f\v\v ! A\x93\f\v A\xC0\0qE@ , /Atj \fA\x7F tA\x7FsqAtj"-\0"k! \f v!\f\f\v\vA\xBF\xFE\0 A q\rA\xF7\f\v /!\x7F Aq" M@ ! \f\v -\0\0 t \fj!\f Aj A\bj"M\r\0 -\0 t \fj!\f Aj! Aj\v! \fA\x7F tA\x7Fsq! k! \f v!\f j"! k"M\r ! k" M\r (\xC47E\rA\xA6\v6A\xD1\xFE\0\v6\f\v@@ \bE@
|
|
0 kj! O@ !\f\vA\0! ! "A\x07q"@@ -\0\0:\0\0 Ak! Aj! Aj! Aj" G\r\0\v\v $j jk jAxK\r@ -\0\0:\0\0 -\0:\0 -\0:\0 -\0:\0 -\0:\0 -\0:\0 -\0:\0 -\0\x07:\0\x07 A\bj! A\bj! A\bk"\r\0\v\f\v \bK@
|
|
1 kj! \bk" O@ !\f\vA\0! ! "A\x07q"@@ -\0\0:\0\0 Ak! Aj! Aj! Aj" G\r\0\v\v / $j jk jAxM@@ -\0\0:\0\0 -\0:\0 -\0:\0 -\0:\0 -\0:\0 -\0:\0 -\0:\0 -\0\x07:\0\x07 A\bj! A\bj! A\bk"\r\0\v\v \b k"O@
|
|
!\f\vA\0! \b!
|
|
! (@@ -\0\0:\0\0 Ak! Aj! Aj! Aj" (G\r\0\v\v \bA\bO@@ -\0\0:\0\0 -\0:\0 -\0:\0 -\0:\0 -\0:\0 -\0:\0 -\0:\0 -\0\x07:\0\x07 A\bj! A\bj! A\bk"\r\0\v\v !k! \bk!\f\v
|
|
\b kj! O@ !\f\vA\0! ! "A\x07q"@@ -\0\0:\0\0 Ak! Aj! Aj! Aj" G\r\0\v\v $j jk jAxK\r\0@ -\0\0:\0\0 -\0:\0 -\0:\0 -\0:\0 -\0:\0 -\0:\0 -\0:\0 -\0\x07:\0\x07 A\bj! A\bj! A\bk"\r\0\v\v !k! k!\v@ AI\r\0A\0! Ak"AnAjAq"@@ -\0\0:\0\0 -\0:\0 -\0:\0 Ak! Aj! Aj! Aj" G\r\0\v\v A I\r\0@ -\0\0:\0\0 -\0:\0 -\0:\0 -\0:\0 -\0:\0 -\0:\0 -\0:\0 -\0\x07:\0\x07 -\0\b:\0\b -\0 :\0 -\0
|
|
:\0
|
|
-\0\v:\0\v A\fj! A\fj! A\fk"AK\r\0\v\v E@ !\f\v -\0\0:\0\0 AF\r Aj!\f\v !k!@ " "-\0\0:\0\0 -\0:\0 -\0:\0 Aj! Aj! Ak"AK\r\0\v E\r -\0\0:\0 AG@ Aj!\f\v -\0:\0 Aj!\f\v -\0:\0 Aj!\v *O\r\0 )I\r\v\v \r 6\f \r Avk"6\0 \r ) kA\x81j6 \r * kAj6 A\x07q"6@ \fA\x7F tA\x7Fsq6< \x07(@! \x07(<! \r(! \r(\0! \r(! \r(\f! \x07(A\xBF\xFE\0G\r \x07A\x7F6\xC87 \x07(!\f\v \x07A\x006\xC87 ! ! !@ \x07(P" A\x7F \x07(XtA\x7Fs"qAtj"\b-\0"\f M@ !
|
|
\f\v@ E\r\r -\0\0 t!\b Aj! Ak! A\bj"
|
|
!
|
|
\bj" qAtj"\b-\0"\fI\r\0\v\v \f! \b/!@ \b-\0\0"\bAkA\xFFqAK@A\0! ! !\f\v ! !@
|
|
" Atj" A\x7F \bjtA\x7Fs"q vAtj"-\0"\fjO@
|
|
!\b\f\v@ E\r\r -\0\0 t!\f Aj! Ak! A\bj"\b! \fj" q vAtj"-\0"\fj \bK\r\0\v\v \b k!
|
|
v! -\0\0!\b /!\v \x07 A\xFF\xFFq6D \x07 \fj6\xC87
|
|
\fk! \fv! \bA\xFFq"E@ \x07A\xCD\xFE\x006 \x07(!\f\v A q@ \x07A\xBF\xFE\x006 \x07A\x7F6\xC87 \x07(!\f\v A\xC0\0q@ \rA\xF76 \x07A\xD1\xFE\x006 \x07(!\f\v \x07A\xC9\xFE\x006 \x07 Aq" 6L\v !
|
|
!\b@ E@ \x07(D!\f\v ! ! I@@ E\r\v Ak! -\0\0 t j! Aj"! A\bj" I\r\0\v\v \x07 \x07(\xC87 j6\xC87 \x07 \x07(D A\x7F tA\x7Fsqj"6D k! v!\v \x07A\xCA\xFE\x006 \x07 6\xCC7\v ! ! !@ \x07(T" A\x7F \x07(\\tA\x7Fs"qAtj"\b-\0"\f M@ !
|
|
\f\v@ E\r\b -\0\0 t!\b Aj! Ak! A\bj"
|
|
!
|
|
\bj" qAtj"\b-\0"\fI\r\0\v\v \b/! \x07\x7F \b-\0\0" AO@ ! ! \f!\b \x07(\xC87\f\v ! !@
|
|
" \f Atj" A\x7F \fjtA\x7Fs"q \fvAtj"-\0"\bjO@ ! \f\v@ E\r\b -\0\0 t!\b Aj! Ak! A\bj" ! \f \bj" q \fvAtj"-\0"\bj K\r\0\v\v \fk!
|
|
\fv! -\0\0! /! \x07(\xC87 \fj\v \bj6\xC87
|
|
\bk! \bv! A\xC0\0q@ \rA\x936 \x07A\xD1\xFE\x006 \x07(!\f\v \x07A\xCB\xFE\x006 \x07 Aq" 6L \x07 A\xFF\xFFq6H\v !
|
|
!\b @ ! ! I@@ E\r Ak! -\0\0 t j! Aj"! A\bj" I\r\0\v\v \x07 \x07(\xC87 j6\xC87 \x07 \x07(H A\x7F tA\x7Fsqj6H v! k!\v \x07A\xCC\xFE\x006\v \r\vA\0! \v!\f\v\x7F \x07(H" k"K@@ k" \x07(0M\r\0 \x07(\xC47E\r\0 \rA\xA66 \x07A\xD1\xFE\x006 \x07(!\f\v\x7F \x07(4" I@ \x07(8 \x07(, k"kj\f\v \x07(8 kj\v! \x07(D" I\x1B\f\v k! \x07(D" \v! \x07 I\x1B"
|
|
k6D
|
|
Ak!\fA\0!
|
|
A\x07q"\bE\r
|
|
!@ -\0\0:\0\0 Ak! Aj! Aj! Aj" \bG\r\0\v\f\x07\v \b
|
|
j! \bAtj!\f\v j!
|
|
Atj!\f\v j! Atj!\f\v \b
|
|
j! \bAtj!\f\v j!
|
|
Atj!\f\v j! Atj!\f\v
|
|
!\v \fA\x07O@@ -\0\0:\0\0 -\0:\0 -\0:\0 -\0:\0 -\0:\0 -\0:\0 -\0:\0 -\0\x07:\0\x07 A\bj! A\bj! A\bk"\r\0\v\v
|
|
k! \x07(D\r\0 \x07A\xC8\xFE\x006 \x07(!\f \v \x07(!\f\b\vA\0! !
|
|
! \v!\f\v\v \x07($"@ A\x006\v !\v \x07A\xB9\xFE\x006\v@ \x07(" A\x80\bqE\r\0 \x07(D" K\x1B"\f@@ \x07($"\bE\r\0 \b("
|
|
E\r\0 \b(" \b( k"M\r\0 k \f \fj K\x1B"@
|
|
j \xFC
|
|
\0\0\v \x07(! \v@ A\x80qE\r\0 \x07-\0\fAqE\r\0 \x07 \x07( \fD6\v \x07 \x07(D \fk"6D \fk! \fj!\v E\r\0 \v!\f \v \x07A\xBA\xFE\x006 \x07A\x006D\v@ \x07-\0A\bq@A\0! E\r\b@ j-\0\0!\b@ \x07($"
|
|
E\r\0
|
|
("E\r\0 \x07(D"
|
|
( O\r\0 \x07 Aj6D j \b:\0\0\v \bA\0 Aj"K\x1B\r\0\v@ \x07-\0AqE\r\0 \x07-\0\fAqE\r\0 \x07 \x07( D6\v j! k! \bE\r \v!\f \v \x07($"E\r\0 A\x006\v \x07A\xBB\xFE\x006 \x07A\x006D\v@ \x07-\0Aq@A\0! E\r\x07@ j-\0\0!\b@ \x07($"
|
|
E\r\0
|
|
($"E\r\0 \x07(D"
|
|
((O\r\0 \x07 Aj6D j \b:\0\0\v \bA\0 Aj"K\x1B\r\0\v@ \x07-\0AqE\r\0 \x07-\0\fAqE\r\0 \x07 \x07( D6\v j! k! \bE\r \v!\f\b\v \x07($"E\r\0 A\x006$\v \x07A\xBC\xFE\x006\v \x07("
|
|
A\x80q@@ AK@ !\f\v E\r A\bj! Aj! Ak! -\0\0 t j! A\x07K@ ! !\f\v E@ !A\0! ! \v!\f\b\v Ar! Aj! Ak! -\0 t j!\v@ \x07-\0\fAqE\r\0 \x07/F\r\0 \rA\xCB6 \x07A\xD1\xFE\x006 ! \x07(!\f\vA\0!A\0! !\v \x07($"@ A60
|
|
A vAq6,\v \x07A\0A\0A\0D"6 \r 60 \x07A\xBF\xFE\x006 \x07(!\f\v E\r \x07(E\r@ AK@ !\f\v E\r A\bj! Aj! Ak!
|
|
-\0\0 t j! AK@
|
|
! !\f\v
|
|
E@ !A\0! ! \v!\f\v Aj!
|
|
Aj! Ak!\b -\0 t j! AK@ \b!
|
|
!\f\v \bE@ !A\0!
|
|
! \v!\f\v Aj! Aj! Ak!\b -\0
|
|
t j! A\x07K@ \b! !\f\v \bE@ !A\0! ! \v!\f\v A r! Aj! Ak! -\0 t j!\v@ AqE\r\0 \x07( F\r\0 \rA\xF06 \x07A\xD1\xFE\x006 ! \x07(!\f\v\v !A\0!A\0!\v \x07A\xD0\xFE\x006\vA!\f\vA\0! \v!\v \r 6 \r 6\f \r 6 \r 6\0 \x07 6@ \x07 6<@@ \x07(,E@ F\r \x07(A\xD0\xFE\0K\r\v\x7F k! @@ \r("
|
|
(8"\vE@A!
|
|
\r((A
|
|
((tA \r( \0"\v68 \vE\r\v
|
|
(,"E@
|
|
B\x0070
|
|
A
|
|
((t"6,\v M@ @ \v k \xFC
|
|
\0\0\v
|
|
A\x0064\f\v
|
|
(4"k" I\x1B"@ \vj k \xFC
|
|
\0\0\v I@ k"@
|
|
(8 k \xFC
|
|
\0\0\v
|
|
64\f\vA\0!
|
|
|
|
(4 j"A\0
|
|
(,"G\x1B64
|
|
(0"M\r\0
|
|
j60\v \f\v
|
|
|
|
(,60A\0\v\r \r(! \r(!\v \r \r(\b ' kj6\b \r k" \r(j6 \x07 \x07( j6 \x07-\0\fAqE FrE@ \r(\f k! \x07(! \x07\x7F \x07(@ D\f\v \x82\v"6 \r 60\v \r \x07(@A\xC0\0A\0 \x07(\b\x1BjA\x80A\0 \x07("A\xBF\xFE\0F\x1BjA\x80A\x80A\0 A\xC2\xFE\0F\x1B A\xC7\xFE\0F\x1Bj6, A{ \x1B F\x1B 'F\x1B!\x1B\f\v \x07A\xD2\xFE\x006\vA|!\x1B\v Aj$\0 \x1BAK\r A\xA8j!
|
|
(\xAC!\b (\0! ( (k!#\0A k"$\0@ k" A\0L\r\0
|
|
(\b
|
|
("\vk N@ \v \bk" H@ j"k"E FrE@ \v \xFC
|
|
\0\0\v
|
|
\vj6 A\0L\r
|
|
\b \v \b j\xD1 \bj!@ \bF\r \b -\0\0:\0\0 Aj! \bAj!\b\f\0\v\0\v
|
|
\b \v \b j"\xD1@ \bF\r \b -\0\0:\0\0 Aj! \bAj!\b\f\0\v\0\v A\fj
|
|
|
|
(\0k \vj\x83 \b
|
|
(\0k
|
|
\x8C"\v(\b"j!@ G@ -\0\0:\0\0 Aj! Aj!\f\v\v \v 6\b \v(
|
|
( \bk"@ \v(\b \b \xFC
|
|
\0\0\v \v \v(\b
|
|
( \bkj6\b
|
|
\b6 \v(
|
|
(\0" \bkj! \b k"@ \xFC
|
|
\0\0\v \v 6
|
|
|
|
(\0"6
|
|
\v(6\0 \v 6
|
|
(!
|
|
\v(\b6 \v 6\b
|
|
(\b!
|
|
\v(\f6\b \v 6\f \v \v(6\0 \v\x87\v A j$\0 \x1BAG\r\0\v \r\xCB 1 A\x98j" (\xA8" (\xAC k\xE0
|
|
1 \rA\x006\\ \rA\xF8\xF9\x006@ \rA\xD0\xF9\x006\0 \rA\xE4\xF9\x006\b \rA\x88\xFA\0(\0"6\0 \r A\fk(\0jA\x8C\xFA\0(\x006\0 \rA\x006 \r \r(\0A\fk(\0j"A\x006 \rA\fj""6 A\x006\f B\x82\xA0\x80\x80\xE0\x007 E6 A jA\0A(\xFC\v\0 Aj\xF4 A\0:\0P B\x80\x80\x80\x80p7H \rA\x90\xFA\0(\0"6\b A\fk(\0 \rA\bjjA\x94\xFA\0(\x006\0 \rA\x84\xFA\0(\0"6\0 \r A\fk(\0jA\x98\xFA\0(\x006\0 \rA\x9C\xFA\0(\x006\b \r"A\xD0\xF9\x006\0 A\xE4\xF9\x006\b A\xF8\xF9\x006@ A\xA8\xF5\x006\0 Aj\xF4 B\x007 B\x007 B\x007\b B\x007 A\xE8\xF5\x006\0 B\x007( A60 A j"\vG@@ ,\0\v! \v,\0\vA\0H@ (\0 A\0H"\x1B!@ ( \x1B" \v(\bA\xFF\xFF\xFF\xFF\x07q"I@ \v 6 \v(\0! @ \xFC
|
|
\0\0\v jA\0:\0\0\f\v \v Ak kAj \v("A\0 \x89\v\f\v A\0H@ (\0!@ ("A
|
|
M@ \v :\0\v @ \v \xFC
|
|
\0\0\v \vjA\0:\0\0\f\v \vA
|
|
A
|
|
k \v-\0\vA\xFF\0q"A\0 \x89\v\f\v \v (\b6\b \v )\x007\0\v\v A\x006, ( A j" ,\0+"A\0H"\x1B!
|
|
($ \x1B! (0"A\bq@
|
|
6\f
|
|
6\b
|
|
j"6 6,\v@ AqE\r\0
|
|
j6, A
|
|
((A\xFF\xFF\xFF\xFF\x07qAk A\0N\x1B"
|
|
6
|
|
6
|
|
($ ,\0+" A\0H\x1Bj6 -\x000AqE\r\0@ A\0H@
|
|
A\xFF\xFF\xFF\xFF\x07j"
|
|
6 A\xFF\xFF\xFF\xFF\x07k! \f\v\v E\r\0
|
|
j6\v#\0A\xC0k"\b$\0 \bB\x007\xB8 \bB\xCE\x8E\xCD\x8257\xB0 \bA\xB0jAf@@ (\0A\fk(\0j-\0AqE@ \b(\xB0A\xCE\x8E\xCD\x82F\r\vA\xD5\xBF B\x007\0 B\x007\0 A:\0\r AjA\0A\xC8\0\xFC\v\0\f\v \b(\xB4AkA|M@A\xD9 \bA\xB4j\xC7 B\x007\0 B\x007\0 A:\0\r AjA\0A\xC8\0\xFC\v\0\f\v \b(\xB8"A\x81\xAD\xE2O@A\xDB \bA\xB8j\xC7 B\x007\0 B\x007\0 A:\0\r AjA\0A\xC8\0\xFC\v\0\f\v \b-\0\xBC"AO@ \b 6\0A\x97 \ba\`A\xB0\xF1\0(\0L B\x007\0 B\x007\0 A:\0\r AjA\0A\xC8\0\xFC\v\0\f\v \xCD! \b(\xB4! \bA:\0e \bA\xE8\0j"
|
|
A\0A\xC8\0\xFC\v\0 \b 6X \b \b-\0\xBC6\\ \b \b-\0\xBD6\` \b \b-\0\xBEAq:\0d
|
|
Al"AA AF\x1Blz \bA\xF4\0j"\v z \b AK":\0e \bA\x80j"AA \x1B lz \bA\x8Cj" z \bA\x98j" z \bA\xA4j" lz \b(h \bA\xCC\0j
|
|
u" ( (\0kf 1 \b(\x8C \bA@k u"( (\0kf 1 \b(\x98 \bA4j u"( (\0kf 1 \b(t \bA(j \vu"( (\0kf 1 \b(\x80 \bAj u"( (\0kf 1 \b(\xA4 \bAj u"( (\0kf 1@ (\0A\fk(\0j-\0Aq@A\xB6\f\xBF B\x007\0 B\x007\0 A:\0\r AjA\0A\xC8\0\xFC\v\0\f\v \bA\xD8\0j")7 )\x007\0 Aj Ajt Aj Ajt A(j A(jt A4j A4jt A@k A@kt A\xCC\0j A\xCC\0jt\v \bA\xD8\0j\xCC\v \bA\xC0j$\0 \x81\f\v Aj\xCB\v 1 A\xA8j1 B\x007\0 B\x007\0 A:\0\r AjA\0A\xC8\0\xFC\v\0\v A\x98j A\xC0j$\0#\0A\x90k"\b$\0 (\0! (\xCD!@@@ ( (k"\v Al"
|
|
AA \v (\0"Al"F\x1BlG@ \bA\xA568 \bA\xF8\x0064 \bA\x9F60A\xED\v \bA0ja\`A\xB0\xF1\0(\0L\f\v
|
|
( (kG@ \bA\xF9\x006< \bA<jA\xF5\xD0\f\v (, ((kAA -\0\r"Aq\x1B lG@ \bA\xCD6( \bA\xFA\x006$ \bA\x9F6 A\xED\v \bA ja\`A\xB0\xF1\0(\0L\f\v (8 (4kG@ \bA\x9E6 \bA\xFB\x006 \bA\x9F6A\xED\v \bAja\`A\xB0\xF1\0(\0L\f\v
|
|
(D (@kG@ \bA\xFC\x006< \bA<jA\xCB\xD0\f\v (P (Lk"
|
|
lF\r \bA\x9F6\b \bA\xFD\x006 \bA\x9F6\0A\xED\v \ba\`A\xB0\xF1\0(\0L\v \0A\0:\0\b \0B\x007\0 \0A\fjA\0A\xC8\0\xFC\v\0\f\v \0A\fj"A\0A\xC8\0\xFC\v\0 \0 6\0 \0 (6 \0 -\0\f:\0\b
|
|
w \0Aj
|
|
w \0A$j Atw \0A0j w \0A<j
|
|
w \0A\xC8\0j w@ \vF@ (\0! (!A\0!\f@
|
|
\fF\r \fAtj}C\0\0\x80?C\0\0\x80\xBF \fAtj/\0"\xC1A\0N\x1B!2 A\xFF\x07q!@ A
|
|
vAq"AG@ \r 2C\0\0\x808\x94 \xB3\x94C\0\0\x80:\x94\f\vC\0\0\xC0\x7F 2C\0\0\x80\x7F\x94 \x1B\f\vC\0\0\x80?!3@ Ak"A\x80N@C\0\0\0\x7F!3 A\xFFI@ A\xFF\0k!\f\vC\0\0\x80\x7F!3A\xFD A\xFDO\x1BA\xFEk!\f\v A\x81\x7FJ\r\0C\0\0\x80\f!3 A\x9B~K@ A\xE6\0j!\f\vC\0\0\0\0!3A\xB6} A\xB6}M\x1BA\xCCj!\v \xB3C\0\0\x80:\x94C\0\0\x80?\x92 2 3 AtA\x80\x80\x80\xFCj\xBE\x94\x94\x94\v8\0 \fAj!\f\f\0\v\0\vD\0\0\0\0\0\0\xF0?A (\bt\xB7\xA3\xB6!2 (\0! (!A\0!\f@
|
|
\fF\r \fAtj 2 \fAlj"/\0\0 ,\0"A\xFFqAtrA\x80\x80\x80xA\0 A\0H\x1Br\xB2\x948\0 \fAj!\f\f\0\v\0\v \0(! (!A\0!\f@
|
|
\fF@ \bA\xD4\0j!\vA\0!\f Aq!\x7F \fF\x7F \0(0! (4!A\0@ @ \0($ ((! \bB\x80\x80\x80\xFC\x83\x80\x80\xC0?7L \bB\x80\x80\x80\xFC\x83\x80\x80\xC0?7D \bB\x80\x80\x80\xFC\x83\x80\x80\xC0?7< \vA\xD8A<\xFC
|
|
\0\0 \fAtj! \bA<j!C\0\0\0\0!3 \fAtj"/\0\0 -\0Atr -\0"Atr! Av!A!\x7F A\0H\x7F AtjC\0\0\x80? 3\x93\x918\0 A\fj!A\0 G@ Atj A\xFFq\xB3C\xF35?\x94C\0\x80\xFFC\x95"2\x8C 2 A\x80q\x1B"28\0 2 2\x94 3\x92!3 A
|
|
v!\v Ak!\f\v\v!@ AG@ At"j" j*\0 *\0\x948\0 Aj!\f\v\v\f\v \0($ (( \bB\x80\x80\x80\xFC\x83\x80\x80\xC0?7L \bB\x80\x80\x80\xFC\x83\x80\x80\xC0?7D \bB\x80\x80\x80\xFC\x83\x80\x80\xC0?7< \vA\xD8A<\xFC
|
|
\0\0#\0Ak"$\0 \fAlj"-\0! -\0! -\0\0\xB3C\x81\x80\0<\x94C\0\0\x80\xBF\x92 \b*H\x948 \xB3C\x81\x80\0<\x94C\0\0\x80\xBF\x92 \b*L\x948\b \xB3C\x81\x80\0<\x94C\0\0\x80\xBF\x92 \b*P\x94"28\f \fAtj" 28\b )7\0 C\0\0\x80? *\f *\f\x94 * *\x94 *\b *\b\x94\x92\x92\x93"2C\0\0\0\0 2C\0\0\0\0^\x1B\x918\f Aj$\0\v \fAj!\f\f\v\v!\f@ \fG@ \fAtj}C\0\0\0\0 \fj-\0\0\xB3C\0\0\x7FC\x95"2C\0\0\x80? 2\x93\x95"3\xBC"A\x80\x80\x80\xFCF\r\0@ A\x80\x80\x80\xFC\x07kA\xFF\xFF\xFF\x87xM@ At"E@#\0Ak"C\0\0\x80\xBF8\f *\fC\0\0\0\0\x95\f\v A\x80\x80\x80\xFC\x07F\r A\x80\x80\x80xI A\0NqE@ 3 3\x93"2 2\x95\f\v 3C\0\0\0K\x94\xBCA\x80\x80\x80\xDC\0k!\vA\x98\xF1\0+\0 A\x80\x80\xCC\xF9k"A\x80\x80\x80|qk\xBE\xBB AvA\xF0q"+\x90o\xA2D\0\0\0\0\0\0\xF0\xBF\xA0"7 7\xA2"8\xA2A\xA0\xF1\0+\0 7\xA2A\xA8\xF1\0+\0\xA0\xA0 8\xA2 Au\xB7A\x90\xF1\0+\0\xA2 +\x98o\xA0 7\xA0\xA0\xB6!3\v 3\v8\0 \fAj!\f\f\v\v \0(<! (@!A\0!\f@
|
|
\fF@ (P (L"k! \0(H!A\0!@ F@ (\f!A\0!#\0A\xE0\0k"\v$\0#\0Ak"$\0A!\x7FA!A A\0L\r\0 AkAs"A\x7FsAq! AqE! AqE\v! :\0 :\0 :\0\r -\0! -\0! -\0\r! \vA\x80\x80\x80\xFC6@ \vA\x80\x80\x80\xFC68 \vC\0\0\x80?C\0\0\x80\xBF \x1B"68\\ \vC\0\0\x80?C\0\0\x80\xBF \x1B"58X \v 68T \v 58P \vC\0\0\x80?C\0\0\x80\xBF \x1B"48L \v 48D \v 68, \v 58( \v 48$ \v 58 \v 48 \v 68\f \v 6 5\x94"38< \v 4 5\x94"284 \v 6 4\x94"480 \v 48 \v 38 \v 28 \v 4 5\x948H Aj$\0 \0( \0(\f"kAu!@ M@ \0(( \0($"kAu!A\0!@ M@@ \0(L \0(H"kAuAn" \0(\0n! \vA$j!\0A\0!A\0!@A\0!\f M\r@ \fM@ j!\f Atj" \0 \fAtj*\0"2 *\0\x948\0 2 *\x948 2 *\b\x948\b Aj! \fAj!\f\f\v\0\v\0\v\0\v Atj" \v* *\0\x948\0 \v* *\x948 \v* *\b\x948\b Aj!\f\v\v \vA\xE0\0j$\0 Atj" \v*\f *\0\x948\0 \v* *\x948 \v* *\b\x948\b Aj!\f\v\v Atj j-\0\0\xB3C\0\0\0\xC3\x92C\0\0\0<\x948\0 Aj!\f\v\v \fAtj \fj-\0\0\xB3C\0\0\x7FC\x95C\0\0\0\xBF\x92C\x9A\x99>\x958\0 \fAj!\f\f\v\v \fAtj \fj-\0\0\xB3C\0\0\x80=\x94C\0\0 \xC1\x928\0 \fAj!\f\f\v\v\v \bA\x90j$\0 \xCC %A\xE0\0j$\0 1 Aj$\0\v\x81\x7F#\0A k"$\0 6@ -\0AqE@ A\x7F6\0 \0 \0(\0(\0!@@@ (\0\0\v A\0:\0\0\f\v A:\0\0\f\v A:\0\0 A6\0\f\v $ =! (\0# $ n!\0 (\0# \0 \0(\0(\0 A\fr \0 \0(\0(\0 Aj Aj" A\x95 F:\0\0 (!@ A\fk " G\r\0\v\v A j$\0 \v\xEE\x7F#\0A\x90k"\0$\0 \0 6\x88 \0 6\x8C \0A\x006\xD8 \0B\x007\xD0 \0Aj" $ >"A\xD0\x85A\xEA\x85 \0A\xE0j (\0( \0 \0(# \0A\x006\xC8 \0B\x007\xC0 \0A\xC0j"A
|
|
" \0 \0(\xC0 \0,\0\xCBA\0H\x1B"6\xBC \0 6\f \0A\x006\b@@ \0A\x8Cj \0A\x88j)\r\0 \0(\xBC \0(\xC4 \0,\0\xCB" A\0H\x1B"jF@ \0A\xC0j" At" A
|
|
\0(\xC8A\xFF\xFF\xFF\xFF\x07qAk \0,\0\xCBA\0N\x1B" \0 \0(\xC0 \0,\0\xCBA\0H\x1B" j6\xBC\v \0(\x8CA\xC0A \0A\xBCj \0A\bjA\0 \0A\xD0j \0Aj \0A\fj \0A\xE0jo\r\0 \0(\x8C@\f\v\v \0A\xC0j" \0(\xBC k" \0(\xC0 \0,\0\xCB!*! \0 6\0 A\0H\x1B \0\x98AG@ A6\0\v \0A\x8Cj \0A\x88j)@ (\0Ar6\0\v \0(\x8C \0A\xC0j \0A\xD0j \0A\x90j$\0\v\xBE\x7F~\x7F#\0A\xA0k"\0$\0 \0 6\x98 \0 6\x9C \0A\xE0j \0A\xF0j \0A\xEFj \0A\xEEj\xB7 \0A\x006\xD8 \0B\x007\xD0 \0A\xD0j"A
|
|
" \0 \0(\xD0 \0,\0\xDBA\0H\x1B"6\xCC \0 \0A j6 \0A\x006 \0A:\0 \0A\xC5\0:\0A\0!@@@@ \0A\x9Cj \0A\x98j)\r\0 \0(\xCC \0(\xD4 \0,\0\xDB" A\0H\x1B"jF@ \0A\xD0j" At" A
|
|
\0(\xD8A\xFF\xFF\xFF\xFF\x07qAk \0,\0\xDBA\0N\x1B" \0 \0(\xD0 \0,\0\xDBA\0H\x1B" j6\xCC\v \0(\x9CA\xC0 \0Aj \0Aj \0A\xCCj \0,\0\xEF \0,\0\xEE \0A\xE0j \0A j \0Aj \0Aj \0A\xF0j\xB6\r\0 \rA\0! \0(\xCC k"A\0L\r@@ -\0\0"A+k"\x07\0\0\v A.F\rA! A0kA\xFFqA
|
|
I\r\f\v AF\r@ \x07\0\0\v -\0"A.F\rA! A0kA\xFFqA M\r\v@ \0(\xE4 \0,\0\xEB" A\0H\x1BE\r\0 \0-\0AqE\r\0 \0(" \0A jkA\x9FJ\r\0 \0 Aj6 \0(6\0\v \0 \0(\xCC \x99 \0)\0!\b \0)\b7\b \b7\0 \0A\xE0j \0A j \0( 5 \0A\x9Cj \0A\x98j)@ (\0Ar6\0\v \0(\x9C \0A\xD0j \0A\xE0j \0A\xA0j$\0\f\vA!\v \0(\x9C@\f\0\v\0\v\v\xA7\x7F\x7F#\0A\x90k"\0$\0 \0 6\x88 \0 6\x8C \0A\xD0j \0A\xE0j \0A\xDFj \0A\xDEj\xB7 \0A\x006\xC8 \0B\x007\xC0 \0A\xC0j"A
|
|
" \0 \0(\xC0 \0,\0\xCBA\0H\x1B"6\xBC \0 \0Aj6\f \0A\x006\b \0A:\0\x07 \0A\xC5\0:\0A\0!@@@@ \0A\x8Cj \0A\x88j)\r\0 \0(\xBC \0(\xC4 \0,\0\xCB" A\0H\x1B"jF@ \0A\xC0j" At" A
|
|
\0(\xC8A\xFF\xFF\xFF\xFF\x07qAk \0,\0\xCBA\0N\x1B" \0 \0(\xC0 \0,\0\xCBA\0H\x1B" j6\xBC\v \0(\x8CA\xC0 \0A\x07j \0Aj \0A\xBCj \0,\0\xDF \0,\0\xDE \0A\xD0j \0Aj \0A\fj \0A\bj \0A\xE0j\xB6\r\0 \rA\0! \0(\xBC k"A\0L\r@@ -\0\0"A+k"\x07\0\0\v A.F\rA! A0kA\xFFqA
|
|
I\r\f\v AF\r@ \x07\0\0\v -\0"A.F\rA! A0kA\xFFqA M\r\v@ \0(\xD4 \0,\0\xDB" A\0H\x1BE\r\0 \0-\0\x07AqE\r\0 \0(\f" \0AjkA\x9FJ\r\0 \0 Aj6\f \0(\b6\0\v \0(\xBC \x9A9\0 \0A\xD0j \0Aj \0(\f 5 \0A\x8Cj \0A\x88j)@ (\0Ar6\0\v \0(\x8C \0A\xC0j \0A\xD0j \0A\x90j$\0\f\vA!\v \0(\x8C@\f\0\v\0\v\v\xA7\x7F\x7F#\0A\x90k"\0$\0 \0 6\x88 \0 6\x8C \0A\xD0j \0A\xE0j \0A\xDFj \0A\xDEj\xB7 \0A\x006\xC8 \0B\x007\xC0 \0A\xC0j"A
|
|
" \0 \0(\xC0 \0,\0\xCBA\0H\x1B"6\xBC \0 \0Aj6\f \0A\x006\b \0A:\0\x07 \0A\xC5\0:\0A\0!@@@@ \0A\x8Cj \0A\x88j)\r\0 \0(\xBC \0(\xC4 \0,\0\xCB" A\0H\x1B"jF@ \0A\xC0j" At" A
|
|
\0(\xC8A\xFF\xFF\xFF\xFF\x07qAk \0,\0\xCBA\0N\x1B" \0 \0(\xC0 \0,\0\xCBA\0H\x1B" j6\xBC\v \0(\x8CA\xC0 \0A\x07j \0Aj \0A\xBCj \0,\0\xDF \0,\0\xDE \0A\xD0j \0Aj \0A\fj \0A\bj \0A\xE0j\xB6\r\0 \rA\0! \0(\xBC k"A\0L\r@@ -\0\0"A+k"\x07\0\0\v A.F\rA! A0kA\xFFqA
|
|
I\r\f\v AF\r@ \x07\0\0\v -\0"A.F\rA! A0kA\xFFqA M\r\v@ \0(\xD4 \0,\0\xDB" A\0H\x1BE\r\0 \0-\0\x07AqE\r\0 \0(\f" \0AjkA\x9FJ\r\0 \0 Aj6\f \0(\b6\0\v \0(\xBC \x9B8\0 \0A\xD0j \0Aj \0(\f 5 \0A\x8Cj \0A\x88j)@ (\0Ar6\0\v \0(\x8C \0A\xC0j \0A\xD0j \0A\x90j$\0\f\vA!\v \0(\x8C@\f\0\v\0\v\v\xE6\0#\0A\xE0k"\0$\0 \0 6\xD8 \0 6\xDC R! \0A\xC8j \0A\xD7j\x7F \0A\x006\xC0 \0B\x007\xB8 \0A\xB8j"A
|
|
" \0 \0(\xB8 \0,\0\xC3A\0H\x1B"6\xB4 \0 \0Aj6\f \0A\x006\b@@ \0A\xDCj \0A\xD8j)\r\0 \0(\xB4 \0(\xBC \0,\0\xC3" A\0H\x1B"jF@ \0A\xB8j" At" A
|
|
\0(\xC0A\xFF\xFF\xFF\xFF\x07qAk \0,\0\xC3A\0N\x1B" \0 \0(\xB8 \0,\0\xC3A\0H\x1B" j6\xB4\v \0(\xDCA\xC0 \0A\xB4j \0A\bj \0,\0\xD7 \0A\xC8j \0Aj \0A\fjA\xD0\x85o\r\0 \0(\xDC@\f\v\v@ \0(\xCC \0,\0\xD3" A\0H\x1BE\r\0 \0(\f" \0AjkA\x9FJ\r\0 \0 Aj6\f \0(\b6\0\v \0(\xB4 \x9C7\0 \0A\xC8j \0Aj \0(\f 5 \0A\xDCj \0A\xD8j)@ (\0Ar6\0\v \0(\xDC \0A\xB8j \0A\xC8j \0A\xE0j$\0\v\xE6\0#\0A\xE0k"\0$\0 \0 6\xD8 \0 6\xDC R! \0A\xC8j \0A\xD7j\x7F \0A\x006\xC0 \0B\x007\xB8 \0A\xB8j"A
|
|
" \0 \0(\xB8 \0,\0\xC3A\0H\x1B"6\xB4 \0 \0Aj6\f \0A\x006\b@@ \0A\xDCj \0A\xD8j)\r\0 \0(\xB4 \0(\xBC \0,\0\xC3" A\0H\x1B"jF@ \0A\xB8j" At" A
|
|
\0(\xC0A\xFF\xFF\xFF\xFF\x07qAk \0,\0\xC3A\0N\x1B" \0 \0(\xB8 \0,\0\xC3A\0H\x1B" j6\xB4\v \0(\xDCA\xC0 \0A\xB4j \0A\bj \0,\0\xD7 \0A\xC8j \0Aj \0A\fjA\xD0\x85o\r\0 \0(\xDC@\f\v\v@ \0(\xCC \0,\0\xD3" A\0H\x1BE\r\0 \0(\f" \0AjkA\x9FJ\r\0 \0 Aj6\f \0(\b6\0\v \0(\xB4 \x9F;\0 \0A\xC8j \0Aj \0(\f 5 \0A\xDCj \0A\xD8j)@ (\0Ar6\0\v \0(\xDC \0A\xB8j \0A\xC8j \0A\xE0j$\0\v\xE6\0#\0A\xE0k"\0$\0 \0 6\xD8 \0 6\xDC R! \0A\xC8j \0A\xD7j\x7F \0A\x006\xC0 \0B\x007\xB8 \0A\xB8j"A
|
|
" \0 \0(\xB8 \0,\0\xC3A\0H\x1B"6\xB4 \0 \0Aj6\f \0A\x006\b@@ \0A\xDCj \0A\xD8j)\r\0 \0(\xB4 \0(\xBC \0,\0\xC3" A\0H\x1B"jF@ \0A\xB8j" At" A
|
|
\0(\xC0A\xFF\xFF\xFF\xFF\x07qAk \0,\0\xC3A\0N\x1B" \0 \0(\xB8 \0,\0\xC3A\0H\x1B" j6\xB4\v \0(\xDCA\xC0 \0A\xB4j \0A\bj \0,\0\xD7 \0A\xC8j \0Aj \0A\fjA\xD0\x85o\r\0 \0(\xDC@\f\v\v@ \0(\xCC \0,\0\xD3" A\0H\x1BE\r\0 \0(\f" \0AjkA\x9FJ\r\0 \0 Aj6\f \0(\b6\0\v \0(\xB4 \xA07\0 \0A\xC8j \0Aj \0(\f 5 \0A\xDCj \0A\xD8j)@ (\0Ar6\0\v \0(\xDC \0A\xB8j \0A\xC8j \0A\xE0j$\0\v\xE6\0#\0A\xE0k"\0$\0 \0 6\xD8 \0 6\xDC R! \0A\xC8j \0A\xD7j\x7F \0A\x006\xC0 \0B\x007\xB8 \0A\xB8j"A
|
|
" \0 \0(\xB8 \0,\0\xC3A\0H\x1B"6\xB4 \0 \0Aj6\f \0A\x006\b@@ \0A\xDCj \0A\xD8j)\r\0 \0(\xB4 \0(\xBC \0,\0\xC3" A\0H\x1B"jF@ \0A\xB8j" At" A
|
|
\0(\xC0A\xFF\xFF\xFF\xFF\x07qAk \0,\0\xC3A\0N\x1B" \0 \0(\xB8 \0,\0\xC3A\0H\x1B" j6\xB4\v \0(\xDCA\xC0 \0A\xB4j \0A\bj \0,\0\xD7 \0A\xC8j \0Aj \0A\fjA\xD0\x85o\r\0 \0(\xDC@\f\v\v@ \0(\xCC \0,\0\xD3" A\0H\x1BE\r\0 \0(\f" \0AjkA\x9FJ\r\0 \0 Aj6\f \0(\b6\0\v \0(\xB4 \xA16\0 \0A\xC8j \0Aj \0(\f 5 \0A\xDCj \0A\xD8j)@ (\0Ar6\0\v \0(\xDC \0A\xB8j \0A\xC8j \0A\xE0j$\0\v\x81\x7F#\0A k"$\0 6@ -\0AqE@ A\x7F6\0 \0 \0(\0(\0!@@@ (\0\0\v A\0:\0\0\f\v A:\0\0\f\v A:\0\0 A6\0\f\v $ >! (\0# $ p!\0 (\0# \0 \0(\0(\0 A\fr \0 \0(\0(\0 Aj Aj" A\x97 F:\0\0 (!@ A\fk " G\r\0\v\v A j$\0 \v@\x7FA\0!\0\x7F F\x7F \0 (\0 \0Atj"\0A\x80\x80\x80\x80\x7Fq"Av r \0s!\0 Aj!\f\v\v\v\v\0 \0 \xA2\vT\x7F@@ G@A\x7F!\0 F\r (\0" (\0"H\r J@A Aj! Aj!\f\v\0\v\v G!\0\v \0\v@\x7FA\0!\0\x7F F\x7F \0 ,\0\0 \0Atj"\0A\x80\x80\x80\x80\x7Fq"Av r \0s!\0 Aj!\f\v\v\v\v\0 \0 \xCE\v^\x7F kj!@@ G@A\x7F!\0 F\r ,\0\0" ,\0\0"\x07H\r \x07J@A Aj! Aj!\f\v\0\v\v G!\0\v \0\vT\x7F \0(T" A\0 A\x80j"\xCA" k \x1B" K\x1B"Y \0 j"6T \0 6\b \0 j6 \v\xA8\x7F \0(T"(\0! (" \0( \0("\x07k" I\x1B"@ \x07 Y (\0 j"6\0 ( k"6\v K\x1B"@ Y (\0 j"6\0 ( k6\v A\0:\0\0 \0 \0(,"6 \0 6 \v\b\0 \0K!\v\0 \0 \0(\0A\fk(\0j\xC0\v\0 \0 \0(\0A\fk(\0j\x81\v
|
|
\0 \0A\bk\xC0\v
|
|
\0 \0A\bk\x81\v\0 \0 )\bA\0 (\0(\0\v \0 \0\xB0!\v\x95\x7F~ (," ("I@ 6, !\vB\x7F!
|
|
@ Aq"\x07E AF \x07AFqr\r\0 @ ( A j ,\0+A\0H\x1Bk\xAC! \v@@@ \0\v A\bq@ (\f (\bk\xAC!\b\f\v (k\xAC!\b\f\v !\b\v \b|"B\0S Ur\r\0 A\bq!@ P\r\0 @ (\fE\r\v AqE\r\0 E\r\v @ 6 (\b \xA7j6\f\v Aq@ ( \xA7j6\v !
|
|
\v \0
|
|
7\b \0B\x007\0\v\x99\b\x7F A\x7FF@A\0\v \0(\b! \0(\f! \0\x7F \0(" \0(G@ \0(,\f\v \0-\x000AqE@A\x7F\v \0(,!\x07 \0(! \0A j"A\0\xAA A
|
|
\0((A\xFF\xFF\xFF\xFF\x07qAk \0,\0+A\0N\x1B" \0 \0( \0,\0+"\bA\0H" \x1B"6 \0 \0($ \b \x1Bj6 \0 kj"6 \x07 kj\v" Aj" I\x1B"6, \0-\x000A\bq@ \0 6 \0 \0( \0A j \0,\0+A\0H\x1B"6\b \0 kj6\f\v \0 \xC0\xC3\v\x8E\x7F \0(," \0("I@ \0 6, !\v\x7FA\x7F \0(\f" \0(\bM\r\0 A\x7FF@ \0 6 \0 Ak6\fA\0\v \0-\x000AqE@A\x7F Ak-\0\0 A\xFFqG\r\v \0 6 \0 Ak"\x006\f \0 :\0\0 \v\v_\x7F \0(," \0("I@ \0 6, !\vA\x7F!@ \0-\x000A\bqE\r\0 \0("K\x7F \0 6 \v \0(\f"\0M\r\0 \0-\0\0!\v \v\0 \0 \0(\0A\fk(\0j\xC1\v
|
|
\0 \0A\bk\xC1\v \0 \0A\f\xA5\v\0 \0AjK \0A\bk\v\f\0 \0A\fjK \0\v\0 \0 \0(\0A\fk(\0j\xC1\v \0 \0A\xA5\v\f\0 \0AjK \0\v\0 \0 \0(\0A\fk(\0j\xC5\v \0 \0A\b\xA5\v\f\0 \0A\bjK \0\v\x96\x7F@@ L\r\0 \0(" \0("O@ \0 -\0\0 \0(\0(4\0A\x7FF\r Aj! Aj!\f \0 k" k" J\x1B"\x7F @ \xFC
|
|
\0\0\v \0( \v j6 j! j!\f\v\0\v\v \v3\x7FA\x7F! \0 \0(\0($\0\0A\x7FG@ \0(\f"-\0\0! \0 Aj6\f\v \v\0A\x7F\v\x91\x7F@@ L\r\0@ \0(\f" \0("I@ \0 k" k" J\x1B"\x7F @ \xFC
|
|
\0\0\v \0(\f \v j6\f\f\v \0 \0(\0((\0\0"A\x7FF\r :\0\0A!\v j! j!\f\v\v \v\0 \0B\x7F7\b \0B\x007\0\v\0 \0B\x7F7\b \0B\x007\0\v\0 \0\v\f\0 \0\xC3 \0!\v\f\0 \0(<\x9E\v;\x7F \0(<#\0Ak"\0$\0 A\xFFq \0A\bj\x9E! \0)\b! \0Aj$\0B\x7F \x1B\v)\0 (\0A\x07jAxq"Aj6\0 \0 )\0 )\b\xC49\0\v\xB4\x7F|~#\0A\xB0k"\v$\0 \vA\x006,@ \xBD"B\0S@A!A\x9D ! \x9A"\xBD!\f\v A\x80q@A!A\xA0 !\f\vA\xA3 A\x9E Aq"\x1B! E!\v@ B\x80\x80\x80\x80\x80\x80\x80\xF8\xFF\0\x83B\x80\x80\x80\x80\x80\x80\x80\xF8\xFF\0Q@ \0A Aj" A\xFF\xFF{q7 \0 3 \0A\xFB\rA\xED A q"\x1BA\xCEA\x97 \x1B b\x1BA3 \0A A\x80\xC0\0s7 J\x1B!\r\f\v \vAj!@@@ \vA,j\xD1" \xA0"D\0\0\0\0\0\0\0\0b@ \v \v(,"Ak6, A r"A\xE1\0G\r\f\v A r"A\xE1\0F\r \v(,!\f\f\v \v Ak"\f6, D\0\0\0\0\0\0\xB0A\xA2!\vA A\0H\x1B!
|
|
\vA0jA\xA0A\0 \fA\0N\x1Bj"!\x07@ \x07 \xFC"6\0 \x07Aj!\x07 \xB8\xA1D\0\0\0\0e\xCD\xCDA\xA2"D\0\0\0\0\0\0\0\0b\r\0\v@ \fA\0L@ \f! \x07! !\b\f\v !\b \f! @A AO\x1B!@ \x07Ak" \bI\r\0 \xAD!\x1BB\0!@ 5\0 \x1B\x86 |" B\x80\x94\xEB\xDC\x80"B\x80\x94\xEB\xDC~}>\0 Ak" \bO\r\0\v B\x80\x94\xEB\xDCT\r\0 \bAk"\b >\0\v@ \b \x07"I@ Ak"\x07(\0E\r\v\v \v \v(, k" 6, !\x07 A\0J\r\0\v\v A\0H@
|
|
AjA nAj! A\xE6\0F!@A A\0 k" A O\x1B!\r@ \bM@A\0A \b(\0\x1B!\x07\f\vA\x80\x94\xEB\xDC \rv!A\x7F \rtA\x7Fs!A\0! \b!\x07@ \x07 \x07(\0" \rv j6\0 q l! \x07Aj"\x07 I\r\0\vA\0A \b(\0\x1B!\x07 E\r\0 6\0 Aj!\v \v \v(, \rj" 6, \x07 \bj"\b \x1B" Atj kAu J\x1B! A\0H\r\0\v\vA\0! @ \bM\r\0 \bkAuA l! A
|
|
!\x07 \b(\0"A
|
|
I\r\0@ Aj! \x07A
|
|
l"\x07O\r\0\v\v
|
|
A\0 A\xE6\0G\x1Bk A\xE7\0F
|
|
A\0Gqk" kAuA lA kH@ \vA0jA\x84\`A\xA4b \fA\0H\x1Bj A\x80\xC8\0j"\fA m"Atj!\rA
|
|
!\x07 \f A lk"A\x07L@@ \x07A
|
|
l!\x07 Aj"A\bG\r\0\v\v@ \r(\0"\f \f \x07n" \x07lk"E \rAj" Fq\r\0@ AqE@D\0\0\0\0\0\0@C! \x07A\x80\x94\xEB\xDCG \b \rOr\r \rAk-\0\0AqE\r\vD\0\0\0\0\0@C!\vD\0\0\0\0\0\0\xE0?D\0\0\0\0\0\0\xF0?D\0\0\0\0\0\0\xF8? F\x1BD\0\0\0\0\0\0\xF8? \x07Av"F\x1B K\x1B!@ \r\0 -\0\0A-G\r\0 \x9A! \x9A!\v \r \f k"6\0 \xA0 a\r\0 \r \x07j"6\0 A\x80\x94\xEB\xDCO@@ \rA\x006\0 \b \rAk"\rK@ \bAk"\bA\x006\0\v \r \r(\0Aj"6\0 A\xFF\x93\xEB\xDCK\r\0\v\v \bkAuA l! A
|
|
!\x07 \b(\0"A
|
|
I\r\0@ Aj! \x07A
|
|
l"\x07O\r\0\v\v \rAj" I\x1B!\v@ "\f \bM"\x07E@ Ak"(\0E\r\v\v@ A\xE7\0G@ A\bq!\f\v A\x7FsA\x7F
|
|
A
|
|
\x1B" J A{Jq"\x1B j!
|
|
A\x7FA~ \x1B j! A\bq"\r\0Aw!@ \x07\r\0 \fAk(\0"E\r\0A
|
|
!A\0! A
|
|
p\r\0@ "\x07Aj! A
|
|
l"pE\r\0\v \x07A\x7Fs!\v \f kAuA l! A_qA\xC6\0F@A\0!
|
|
jA k"A\0 A\0J\x1B"
|
|
J\x1B!
|
|
\f\vA\0!
|
|
j jA k"A\0 A\0J\x1B"
|
|
J\x1B!
|
|
\vA\x7F!\r
|
|
A\xFD\xFF\xFF\xFF\x07A\xFE\xFF\xFF\xFF\x07
|
|
r"\x1BJ\r
|
|
A\0GjAj!@ A_q"\x07A\xC6\0F@ A\xFF\xFF\xFF\xFF\x07sJ\r A\0 A\0J\x1B!\f\v Au"s k\xAD x"kAL@@ Ak"A0:\0\0 kAH\r\0\v\v Ak" :\0\0 AkA-A+ A\0H\x1B:\0\0 k" A\xFF\xFF\xFF\xFF\x07sJ\r\v j" A\xFF\xFF\xFF\xFF\x07sJ\r \0A j" 7 \0 3 \0A0 A\x80\x80s7@@@ \x07A\xC6\0F@ \vAjA r! \b \b K\x1B"!\b@ \b5\0 x!@ \bG@ \vAjM\r@ Ak"A0:\0\0 \vAjK\r\0\v\f\v G\r\0 Ak"A0:\0\0\v \0 k3 \bAj"\b M\r\0\v @ \0A\x9AA3\v
|
|
A\0L \b \fOr\r@ \b5\0 x" \vAjK@@ Ak"A0:\0\0 \vAjK\r\0\v\v \0 A
|
|
|
|
A N\x1B3
|
|
A k! \bAj"\b \fO\r
|
|
A J !
|
|
\r\0\v\f\v@
|
|
A\0H\r\0 \f \bAj \b \fI\x1B! \vAjA r!\f \b!\x07@ \f \x075\0 \fx"F@ Ak"A0:\0\0\v@ \x07 \bG@ \vAjM\r@ Ak"A0:\0\0 \vAjK\r\0\v\f\v \0 A3 Aj!
|
|
rE\r\0 \0A\x9AA3\v \0 \f k"
|
|
|
|
H\x1B3
|
|
k!
|
|
\x07Aj"\x07 O\r
|
|
A\0N\r\0\v\v \0A0
|
|
AjAA\07 \0 k3\f\v
|
|
!\v \0A0 A jA A\07\v \0A A\x80\xC0\0s7 J\x1B!\r\f\v AtAuA qj! @ A\vK\r\0A\f k!D\0\0\0\0\0\x000@!@ D\0\0\0\0\0\x000@\xA2! Ak"\r\0\v -\0\0A-F@ \x9A \xA1\xA0\x9A!\f\v \xA0 \xA1!\v \v(,"\x07 \x07Au"s k\xAD x"F@ Ak"A0:\0\0 \v(,!\x07\v Ar!
|
|
A q!\f Ak" Aj:\0\0 AkA-A+ \x07A\0H\x1B:\0\0 A\bqE A\0Lq!\b \vAj!\x07@ \x07" \xFC"A\x90\xF5\0j-\0\0 \fr:\0\0 \xB7\xA1D\0\0\0\0\0\x000@\xA2"D\0\0\0\0\0\0\0\0a \bq \x07Aj"\x07 \vAjkAGrE@ A.:\0 Aj!\x07\v D\0\0\0\0\0\0\0\0b\r\0\vA\x7F!\r A\xFD\xFF\xFF\xFF\x07
|
|
k"\bj"kJ\r\0 \0A Aj \x07 \vAj"k"\x07 \x07Ak H\x1B \x07 \x1B"j" 7 \0
|
|
3 \0A0 A\x80\x80s7 \0 \x073 \0A0 \x07kA\0A\07 \0 \b3 \0A A\x80\xC0\0s7 J\x1B!\r\v \vA\xB0j$\0 \r\v\0B\0\v\xD6\x07\x7F#\0A k"$\0 \0("6 \0(! 6 6 k"6 j! Aj!A!\x07\x7F@@@ \0(< A A\fj\v\x9E@ !\f\v@ (\f"F\r A\0H@ !\f\v A\bA\0 ("\bK" \x1Bj" \bA\0 \x1Bk"\b (\0j6\0 A\fA \x1Bj" (\0 \bk6\0 k! \0(< " \x07 k"\x07 A\fj\v\x9EE\r\0\v\v A\x7FG\r\v \0 \0(,"6 \0 6 \0 \0(0j6 \f\v \0A\x006 \0B\x007 \0 \0(\0A r6\0A\0 \x07AF\r\0 (k\v A j$\0\v\x89\x7F#\0Ak"\0$\0@ \0A\fj \0A\bj\r\0A\xEC\xDB \0(\fAtAj/"6\0 E\r\0 \0(\b/"@A\xEC\xDB(\0" \0(\fAtjA\x006\0 E\r\vA\xEC\xDBA\x006\0\v \0Aj$\0A\x84\xCEA\x006\0A\x80\xCEA6\0\x95A\x84\xCEA\xA0\xCE(\x006\0A\xA0\xCEA\x80\xCE6\0A\xA4\xCEA.6\0A\xA8\xCEA\x006\0\xCCA\xA8\xCEA\xA0\xCE(\x006\0A\xA0\xCEA\xA4\xCE6\0A\xCC\xCFA\xD4\xCE6\0A\xA4\xCFA\x80\x806\0A\xA0\xCFA\xC0\xEC6\0A\x84\xCFA*6\0A\xA8\xCFA\xB0\xCB(\x006\0\v\v\xBF\xBE(\0A\x80\b\v\x940123456789abcdefghijklmnopqrstuvwxyz\0load_spz\0infinity\0February\0January\0July\0Thursday\0Tuesday\0Wednesday\0Saturday\0Sunday\0Monday\0Friday\0May\0%m/%d/%y\0-+ 0X0x\0-0X+0X 0X-0x+0x 0x\0Nov\0Thu\0August\0unsigned short\0unsigned int\0invalid literal/lengths set\0invalid code lengths set\0unknown header flags set\0invalid distances set\0get\0Oct\0float\0invalid bit length repeat\0Sat\0numPoints\0colors\0UnpackOptions\0positions\0rotations\0too many length or distance symbols\0invalid stored block lengths\0scales\0alphas\0[SPZ: ERROR] Check failed: %s:%d: %s\0vf32_ptr\0Apr\0vector\0money_get error\0[SPZ ERROR] deserializePackedGaussians: read error\0October\0November\0September\0December\0unsigned char\0Mar\0/emsdk/emscripten/system/lib/libcxxabi/src/private_typeinfo.cpp\0Sep\0%I:%M:%S %p\0Sun\0Jun\0Mon\0nan\0Jan\0coordinateSystem\0CoordinateSystem\0Jul\0bool\0April\0invalid code -- missing end-of-block\0incorrect header check\0incorrect length check\0incorrect data check\0push_back\0invalid distance too far back\0Fri\0sh\0header crc mismatch\0March\0Aug\0unsigned long long\0unsigned long\0std::wstring\0basic_string\0std::string\0std::u16string\0std::u32string\0inf\x000123456789abcdef\0%.0Lf\0%Lf\0resize\0invalid window size\0true\0Tue\0false\0invalid block type\0June\0double\0shDegree\0bad_array_new_length was thrown in -fno-exceptions mode\0invalid literal/length code\0invalid distance code\0RawGaussianCloud\0unknown compression method\0[SPZ ERROR] deserializePackedGaussians: header not found\0%0*lld\0%*lld\0+%lld\0%+.4ld\0void\0locale not supported\0antialiased\0Wed\0%Y-%m-%d\0[SPZ ERROR] deserializePackedGaussians: Too many points: %d\0[SPZ ERROR] deserializePackedGaussians: Unsupported SH degree: %d\0[SPZ ERROR] deserializePackedGaussians: version not supported: %d\0Dec\0./spz/src/cc/load-spz.cc\0Feb\0%a %b %d %H:%M:%S %Y\0POSIX\0VectorUInt8T\0%H:%M:%S\0NAN\0PM\0AM\0%H:%M\0LC_ALL\0ASCII\0LANG\0RUF\0LUF\0INF\0RDF\0LDF\0UNSPECIFIED\0C\0RUB\0LUB\0RDB\0LDB\0catching a class without an object?\0emscripten::memory_view<short>\0emscripten::memory_view<unsigned short>\0emscripten::memory_view<int>\0emscripten::memory_view<unsigned int>\0emscripten::memory_view<float>\0emscripten::memory_view<uint8_t>\0emscripten::memory_view<int8_t>\0emscripten::memory_view<uint16_t>\0emscripten::memory_view<int16_t>\0emscripten::memory_view<uint64_t>\0emscripten::memory_view<int64_t>\0emscripten::memory_view<uint32_t>\0emscripten::memory_view<int32_t>\0emscripten::memory_view<char>\0emscripten::memory_view<unsigned char>\0emscripten::memory_view<signed char>\0emscripten::memory_view<long>\0emscripten::memory_view<unsigned long>\0emscripten::memory_view<double>\x000123456789\0C.UTF-8\x0001234567\0VectorFloat32\x0001\x001.3.1\0.\0-\0(packed.alphas.size()) == (numPoints)\0(null)\0(packed.colors.size()) == (numPoints * 3)\0(packed.scales.size()) == (numPoints * 3)\0(packed.sh.size()) == (numPoints * shDim * 3)\0(packed.rotations.size()) == (numPoints * (packed.usesQuaternionSmallestThree ? 4 : 3))\0(packed.positions.size()) == (numPoints * 3 * (usesFloat16 ? 2 : 3))\0%\0length_error was thrown in -fno-exceptions mode with message "%s"\0[SPZ: ERROR] Unsupported SH degree: %d
|
|
\0 \0\0\0\x80?\0\0\x80?\0\0\x80?\0\0\x80?\0\0\x80?\0\0\x80?\0\0\x80?\0\0\x80?\0\0\x80?\0\0\x80?\0\0\x80?\0\0\x80?\0\0\x80?\0\0\x80?\0\0\x80?\0A\xA0 \v\xB60\0\0\xF0c\0\0\xF0c\0\0P\0\0\xA4d\0\x008\0\0N3spz13GaussianCloudE\0\0\0\xA4d\0\0X\0\0N3spz13UnpackOptionsE\0ppiip\0\xF0c\0\0|\0\0\xA4d\0\0\x84\0\0NSt3__26vectorIfNS_9allocatorIfEEEE\0ipp\0(e\0\0\xD4\0\0\0\0\0\0\0\0\0\xEC\0\0\0\0\0\x008\0\0\0\0\0\0h\0\0\0\0\0\0NSt3__28optionalIfEE\0\0\0\0\xCCd\0\0\xF8\0\0(\0\0NSt3__227__optional_move_assign_baseIfLb1EEE\0\0\0\0\xCCd\0\x004\0\0d\0\0NSt3__227__optional_copy_assign_baseIfLb1EEE\0\0\0\0\xCCd\0\0p\0\0\x98\0\0NSt3__220__optional_move_baseIfLb1EEE\0\0\0\xCCd\0\0\xA4\0\0\xCC\0\0NSt3__220__optional_copy_baseIfLb1EEE\0\0\0\xCCd\0\0\xD8\0\0\0\0NSt3__223__optional_storage_baseIfLb0EEE\0\0\0\0\xA4d\0\0\f\0\0NSt3__224__optional_destruct_baseIfLb1EEE\0\0\0\xA4d\0\0@\0\0NSt3__218__sfinae_ctor_baseILb1ELb1EEE\0\0\xA4d\0\0p\0\0NSt3__220__sfinae_assign_baseILb1ELb1EEE\0\0\0\0\x84e\0\0\xAC\0\0\0\0\0\0|\0\0PNSt3__26vectorIfNS_9allocatorIfEEEE\0\0\0\0\x84e\0\0\xE4\0\0\0\0\0|\0\0PKNSt3__26vectorIfNS_9allocatorIfEEEE\0pp\0v\0vp\0\0\0\x9C\0\0pp\0\0\x98c\0\0|\0\x008d\0\0vppf\0\0\0\0\x98c\0\0|\0\0\xFCc\0\x008d\0\0vppif\0\0\0\xFCc\0\0|\0\0ipp\0\\\0\x008d\0\0\xA4d\0\0d\0\0N10emscripten3valE\0\0\xAC\0\0|\0\0\xFCc\0\0pppi\0\0\0\0\0\0\0\0\xA8c\0\0|\0\0\xFCc\0\x008d\0\0ippif\0\0\0(e\0\0\xD0\0\0\0\0\0\0\0\0\0\xE8\0\0\0\0\0\x008\0\0\0\0\0\0h\0\0\0\0\0\0NSt3__28optionalIhEE\0\0\0\0\xCCd\0\0\xF4\0\0$\0\0NSt3__227__optional_move_assign_baseIhLb1EEE\0\0\0\0\xCCd\0\x000\0\0\`\0\0NSt3__227__optional_copy_assign_baseIhLb1EEE\0\0\0\0\xCCd\0\0l\0\0\x94\0\0NSt3__220__optional_move_baseIhLb1EEE\0\0\0\xCCd\0\0\xA0\0\0\xC8\0\0NSt3__220__optional_copy_baseIhLb1EEE\0\0\0\xCCd\0\0\xD4\0\0\0\0\0NSt3__223__optional_storage_baseIhLb0EEE\0\0\0\0\xA4d\0\0\b\0\0NSt3__224__optional_destruct_baseIhLb1EEE\0\0\0\xA4d\0\0<\0\0NSt3__26vectorIhNS_9allocatorIhEEEE\0\x84e\0\0p\0\0\0\0\0\x004\0\0PNSt3__26vectorIhNS_9allocatorIhEEEE\0\0\0\0\x84e\0\0\xA8\0\0\0\0\x004\0\0PKNSt3__26vectorIhNS_9allocatorIhEEEE\0pp\0vp\0\`\0\0pp\0\0\x98c\0\x004\0\0\xC0c\0\0vppi\0\0\0\0\x98c\0\x004\0\0\xFCc\0\0\xC0c\0\0vppii\0\0\0\xFCc\0\x004\0\0ipp\0\\\0\0\xC0c\0\0\xA8\0\x004\0\0\xFCc\0\0pppi\0\0\0\0\xA8c\0\x004\0\0\xFCc\0\0\xC0c\0\0ippii\0p\0vp\0ipp\0vppi\0ipp\0vppi\0ppp\0vppp\0\0\0Xd\0\0p\0\0N3spz16CoordinateSystemE\0p\0vp\0ipp\0vppi\0\0\0\0\0\0\0\0\0\b\0\0\0\0\0\0\xA4d\0\0\xB0\0\0NSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE\0\0\xA4d\0\0\xF8\0\0NSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEE\0\0\xA4d\0\0@\0\0NSt3__212basic_stringIDsNS_11char_traitsIDsEENS_9allocatorIDsEEEE\0\0\0\xA4d\0\0\x8C\0\0NSt3__212basic_stringIDiNS_11char_traitsIDiEENS_9allocatorIDiEEEE\0\0\0\xA4d\0\0\xD8\0\0N10emscripten11memory_viewIcEE\0\0\xA4d\0\0\0\0\0N10emscripten11memory_viewIaEE\0\0\xA4d\0\0(\0\0N10emscripten11memory_viewIhEE\0\0\xA4d\0\0P\0\0N10emscripten11memory_viewIsEE\0\0\xA4d\0\0x\0\0N10emscripten11memory_viewItEE\0\0\xA4d\0\0\xA0\0\0N10emscripten11memory_viewIiEE\0\0\xA4d\0\0\xC8\0\0N10emscripten11memory_viewIjEE\0\0\xA4d\0\0\xF0\0\0N10emscripten11memory_viewIlEE\0\0\xA4d\0\0\0\0N10emscripten11memory_viewImEE\0\0\xA4d\0\0@\0\0N10emscripten11memory_viewIxEE\0\0\xA4d\0\0h\0\0N10emscripten11memory_viewIyEE\0\0\xA4d\0\0\x90\0\0N10emscripten11memory_viewIfEE\0\0\xA4d\0\0\xB8\0\0N10emscripten11memory_viewIdEE\0A\xE43\v\xA1(\x960\x07w,a\xEE\xBAQ \x99\xC4m\x07\x8F\xF4jp5\xA5c\xE9\xA3\x95d\x9E2\x88\xDB\xA4\xB8\xDCy\xE9\xD5\xE0\x88\xD9\xD2\x97+L\xB6 \xBD|\xB1~\x07-\xB8\xE7\x91\xBF\x90d\xB7\xF2 \xB0jHq\xB9\xF3\xDEA\xBE\x84}\xD4\xDA\xEB\xE4\xDDmQ\xB5\xD4\xF4\xC7\x85\xD3\x83V\x98l\xC0\xA8kdz\xF9b\xFD\xEC\xC9e\x8AO\\\xD9lcc=\xFA\xF5\r\b\x8D\xC8 n;^iL\xE4A\`\xD5rqg\xA2\xD1\xE4<G\xD4K\xFD\x85\r\xD2k\xB5
|
|
\xA5\xFA\xA8\xB55l\x98\xB2B\xD6\xC9\xBB\xDB@\xF9\xBC\xAC\xE3l\xD82u\\\xDFE\xCF\r\xD6\xDCY=\xD1\xAB\xAC0\xD9&:\0\xDEQ\x80Q\xD7\xC8a\xD0\xBF\xB5\xF4\xB4!#\xC4\xB3V\x99\x95\xBA\xCF\xA5\xBD\xB8\x9E\xB8(\b\x88_\xB2\xD9\f\xC6$\xE9\v\xB1\x87|o/LhX\xABa\xC1=-f\xB6\x90A\xDCvq\xDB\xBC \xD2\x98*\xD5\xEF\x89\x85\xB1q\xB5\xB6\xA5\xE4\xBF\x9F3\xD4\xB8\xE8\xA2\xC9\x07x4\xF9\0\x8E\xA8 \x96\x98\xE1\xBB\rj\x7F-=m\b\x97ld\x91\\c\xE6\xF4Qkkbal\xD80e\x85N\0b\xF2\xED\x95l{\xA5\x1B\xC1\xF4\b\x82W\xC4\xF5\xC6\xD9\xB0eP\xE9\xB7\xEA\xB8\xBE\x8B|\x88\xB9\xFC\xDF\xDDbI-\xDA\xF3|\xD3\x8CeL\xD4\xFBXa\xB2M\xCEQ\xB5:t\0\xBC\xA3\xE20\xBB\xD4A\xA5\xDFJ\xD7\x95\xD8=m\xC4\xD1\xA4\xFB\xF4\xD6\xD3j\xE9iC\xFC\xD9n4F\x88g\xAD\xD0\xB8\`\xDAs-D\xE53_L
|
|
\xAA\xC9|\r\xDD<qP\xAAA'\v\xBE\x86 \f\xC9%\xB5hW\xB3\x85o \xD4f\xB9\x9F\xE4a\xCE\xF9\xDE^\x98\xC9\xD9)"\x98\xD0\xB0\xB4\xA8\xD7\xC7=\xB3Y\x81\r\xB4.;\\\xBD\xB7\xADl\xBA\xC0 \x83\xB8\xED\xB6\xB3\xBF\x9A\f\xE2\xB6\x9A\xD2\xB1t9G\xD5\xEA\xAFw\xD2\x9D&\xDB\x83\xDCs\vc\xE3\x84;d\x94>jm\r\xA8Zjz\v\xCF\xE4\x9D\xFF \x93'\xAE\0
|
|
\xB1\x9E\x07}D\x93\xF0\xD2\xA3\b\x87h\xF2\xFE\xC2i]Wb\xF7\xCBge\x80q6l\xE7knv\x1B\xD4\xFE\xE0+\xD3\x89Zz\xDA\xCCJ\xDDgo\xDF\xB9\xF9\xF9\xEF\xBE\x8EC\xBE\xB7\xD5\x8E\xB0\`\xE8\xA3\xD6\xD6~\x93\xD1\xA1\xC4\xC2\xD88R\xF2\xDFO\xF1g\xBB\xD1gW\xBC\xA6\xDD\xB5?K6\xB2H\xDA+\r\xD8L\x1B
|
|
\xAF\xF6J6\`zA\xC3\xEF\`\xDFU\xDFg\xA8\xEF\x8En1y\xBEiF\x8C\xB3a\xCB\x83f\xBC\xA0\xD2o%6\xE2hR\x95w\f\xCCG\v\xBB\xB9"/&U\xBE;\xBA\xC5(\v\xBD\xB2\x92Z\xB4+j\xB3\\\xA7\xFF\xD7\xC21\xCF\xD0\xB5\x8B\x9E\xD9,\xAE\xDE[\xB0\xC2d\x9B&\xF2c\xEC\x9C\xA3ju
|
|
\x93m\xA9 \x9C?6\xEB\x85g\x07rW\0\x82J\xBF\x95z\xB8\xE2\xAE+\xB1{8\x1B\xB6\f\x9B\x8E\xD2\x92\r\xBE\xD5\xE5\xB7\xEF\xDC|!\xDF\xDB\v\xD4\xD2\xD3\x86B\xE2\xD4\xF1\xF8\xB3\xDDhn\x83\xDA\xCD\xBE\x81[&\xB9\xF6\xE1w\xB0owG\xB7\xE6Z\b\x88pj\xFF\xCA;f\\\v\xFF\x9Ee\x8Fi\xAEb\xF8\xD3\xFFkaE\xCFlx\xE2
|
|
\xA0\xEE\xD2\r\xD7T\x83N\xC2\xB39a&g\xA7\xF7\`\xD0MGiI\xDBwn>Jj\xD1\xAE\xDCZ\xD6\xD9f\v\xDF@\xF0;\xD87S\xAE\xBC\xA9\xC5\x9E\xBB\xDE\x7F\xCF\xB2G\xE9\xFF\xB50\xF2\xBD\xBD\x8A\xC2\xBA\xCA0\x93\xB3S\xA6\xA3\xB4$6\xD0\xBA\x93\xD7\xCD)W\xDET\xBFg\xD9#.zf\xB3\xB8Ja\xC4\x1Bh]\x94+o*7\xBE\v\xB4\xA1\x8E\f\xC3\x1B\xDFZ\x8D\xEF-\0\0\0\0F;ge\x8Cv\xCE\xCA\xCAM\xA9\xAFY\xEB\xEDN\xD0\x8A+\xD5\x9D#\x84\x93\xA6D\xE1\xB2\xD6\xDB\x9D\xF4\xED\xBC\xF8>\xA0Wx\x9Br2\xEB=6\xD3\xADQ\xB6gK\xF8!p\x9F|%\xAB\xC6\xE0c\x90\xA1\x85\xA9\xDD\b*\xEF\xE6oO|@+\xAE:{L\xCB\xF06\xE5d\xB6\r\x82\x97}}\xD1Fz\x1B\v\xD3\xB7]0\xB4\xD2\xCE\x96\xF03\x88\xAD\x97VB\xE0>\xF9\xDBY\x9C\vP\xFCMk\x9B\x7F\x87&2\xD0\xC1U\xB5R\xBBT\x80v1\xDE\xCD\xDF\x9E\x98\xF6\xB8\xFB\xB9\x86'\x87\xFF\xBD@\xE25\xF0\xE9Ms\xCB\x8E(\xE0m\xCA\xC9\xA6V\xAD\xACl\x1B* cf.\xFB:\xFAh\xC0]\x9F\xA2\x8D\xF40\xE4\xB6\x93Uw\xD7\xB41+\xB0\xD1\xFBf~\xBD]~\x1B\x9C-\xE1g\xDA\x86[/\xADV\`H\xC8\xC5\xC6\f)\x83\xFDkLI\xB0\xC2\xE3\x8B\xA5\x86\xA0\xF85P\x9B\x9FP\x9A\xD66\xFF\xDC\xEDQ\x9AOK{ pr\xC3=\xDB\xB1\x85\xBC\xD4\xA4v#\xA8\xE2MD\xCD(\0\xEDbn;\x8A\x07\xFD\x9D\xCE\xE6\xBB\xA6\xA9\x83q\xEB\0,7\xD0gI3\v>\xD5u0Y\xB0\xBF}\xF0\xF9F\x97zj\xE0\xD3\x9B,\xDB\xB4\xFE\xE6\x96Q\xA0\xADz4\x81\xDD\xE5H\xC7\xE6\x82-\r\xAB+\x82K\x90L\xE7\xD86\b\x9E\rocT@\xC6\xCC{\xA1\xA9\xF0/[\xCBcJ\x91\x86\xCA\xE5\xD7\xBD\xAD\x80D\x1B\xE9a \x8E\xC8m'\xAB\x8EV@\xCE\xAF&\xDF\xB2\xE9\xB8\xD7#Pxekv\xF6\xCD2\xFC\xB0\xF6U\x99z\xBB\xFC6<\x80\x9BS8[\xC2\xCF~\`\xA5\xAA\xB4-\f\xF2k\`a\xB0/\x81'\x8BH\xE4\xED\xC6\xE1K\xAB\xFD\x86.\x8A\x8DR\xCC\xB6~7\xFB\xD7\x98@\xC0\xB0\xFD\xD3f\xF4\x95]\x93y_:\xD6+]\xB3,@\xF1kj{\x96\xA06?\xA1\xE6\rX\xC4u\xAB%3\x90{@\xF9\xDD\xD2\xEF\xBF\xE6\xB5\x8A\x9E\x96*\xF6\xD8\xADM\x93\xE0\xE4<T\xDB\x83Y\xC7}\xC7\xB8\x81F\xA0\xDDK\v r\r0n \xEB7\x8BO\xD0P\xEE\x85\x9D\xF9A\xC3\xA6\x9E$P\0\xDA\xC5;\xBD\xA0\xDCv\x9AMsj\xBB=\xEC\xFD\x8Bs7K"\xDCqpE\xB9\xE2\xD6X\xA4\xEDf=n\xA0\xCF\x92(\x9B\xA8\xF7'\rqa+j\xABf\xC3\xBB\xED]\xA4\xDE~\xFB\xE0?8\xC0\x87Z\xF2\x8D.\xF5\xB4\xB6I\x90\x95\xC6\xD6\xEC\xD3\xFD\xB1\x89\xB0&_\x8B\x7FC\xCC-;\xA2\x8A\\\xC7@[\xF5h\`\x92\r\xBB\xCB\x91D\x80\xAC\xF4\x8E\xCD[\xC8\xF6b>[P&\xDFkA\xBA\xD7&\xE8\x91\x8Fp\xB0m\f\xF6Vwi<\x1B\xDE\xC6z \xB9\xA3\xE9\x86\xFDB\xAF\xBD\x9A'e\xF03\x88#\xCBT\xED:\xE0 ^|\xDBn;\xB6\x96\xC7\x94\xF0\xAD\xA0\xF1c\v\xE4%0\x83u\xEF}*\xDA\xA9FM\xBF\x886\xD2\xC3\xCE\r\xB5\xA6@ B{{l\xD1\xDD?\x8D\x97\xE6X\xE8]\xAB\xF1G\x1B\x90\x96"K\xCF\xBEYp\xA8\xDB\x93=t\xD5fF\xA0"\xF0\0\x9BE\x95\xCA\xD6\xEC:\x8C\xED\x8B_\xAD\x9D#\xEB\xA6sF!\xEB\xDA\xE9g\xD0\xBD\x8C\xF4v\xF9m\xB2M\x9E\bx\x007\xA7>;P\xC21\xB0\xF5Dw\x8B\x92!\xBD\xC6;\x8E\xFB\xFD\\\xEBh[
|
|
.\`\x7Fo\xE4-\xD6\xC0\xA2\xB1\xA5\x83f.\xD9\xC5]I\xBC\xE0I+\x87v\xDA\x8D\xC3\x97\x9C\xB6\xA4\xF2V\xFB\r]\xC0j8\x1B3\xA4R T\xC1\x98m\xFDn\xDEV\x9A\vM\xF0\xDE\xEA\v\xCB\xB9\x8F\xC1\x86 \x87\xBDwE\xA6\xCD\xE89\xE0\xF6\x8F\\*\xBB&\xF3l\x80A\x96\xFF&w\xB9bsP\xCB\xBD5k\xAC\xD8\0\0\0\0X\x80\xE2\xD7\xF1\xB4t\xA9\x86V\xA3\xE2\rh\xE9\xBA\x8D\x8A>\v\xDC\x9DK\x8B>J\x85\xA1 \xDD\x9DC\xDEt\x1B},\x9B\xF7\xAAg\xC9\xE0?\x90+7\x96}\x94\xCE\x96\x9FC
|
|
;BR\xBB\xA0\xC4\xFB=\xF6g\xA3\xBD\xB0\xE86*\xFA\xB0\xB6\xC8-0\x9E\x8EA\xB0|Y\x8F&\xE3\xD7\xA6\xCD~ Wn&\xA0\xB5\xB9m+\x8B\xF35\xABi$\x9C-?\x87\xC4\xAD\xDDPv\x84&L\xF6f\xF1\xE5p0R\xBD\xF0\xD2\x85\xF6{\xEC\xCF\xAE\xFB\x07}X\xBB_\xFD\xBAl\x91k%/\xC9\xEB\xC7\xF8\`m\x91[8\xEDs\x8CsfM\xC6+\xE6\xAF\x82\`\xF9\xB2\xDA\xE0\x1BeM\xC65F\xCD$\xE2\xEFKrA\xB7\xCB\x90\x96\xFC@\xAE\xDC\xA4\xC0L\v\rF\xA8U\xC6\xF8\x7F\x9BPg<\xC3\xD0\x85\xEBjV\xD3H2\xD61\x9Fy]\xD5!\xDD\xED\x88[\xBB\xA1\xD0\xDBYv(\xEC\bMpl\xEA\x9A\xD9\xEA\xBC9\x81j^\xEE\xCA\xE1\`\xA4\x92a\x82s;\xE7\xD4\xD0cg6\x07\xAD\xF1\xA9D\xF5qK\x93\\\xF70w\xFF\xE7O\xFC\xC1\xAD|#z\xBE\xFAu\xD9\xE6z\x97"\xD7J^zW\xA8\x89\xD3\xD1\xFE*\x8BQ\xFD\xC0\xDA"\xB7\x98Z\xC0\`1\xDC\x96\xC3i\\t\xA7\xCA\xEBW\xFFJ \x80V\xCC_#L\xBD\xF4E\xC7\x83\xBEGai\xB4\xC17\xCA\xECA\xD5<\x9A\x8Ckdn\xBC\xCD\x9C8\x95\xDA\xC8\xDE\x97\xE4\x82\x86U/\x91P\xF6w\xB2!\xB9\x87-b\xE1\x07\xCF\xB5H\x81\x99{\xC1[\x8AE\x8B
|
|
\xA7\\\xAA\x8C\xF1\xFF\xF2\f(6\xA1\xCExn!,\xAF\xC7\xA7z\f\x9F'\x98\xDB\xD4\xAC\xA6\x91\x8C,DF%\xAA\xE5}*\xF02\xB3\xBCoq\xEB<\x8D\xA6B\xBA\xDB:9\xD2Q\xB1\x07\x98 1\xE5O\xA0\xB7\xB3\xEC\xF87Q;P\xD8\x9A\bX\xF3M\xA1\xDE\xA5\xEE\xF9^G9\xB2\xD5ys\xEAU\x9B\xA4C\xD3\xCD\x07\x1BS/\xD0\xD5\xC5\xB0\x93\x8DERD$\xC3\xE7|C\xE607\xC8\xD8zoH:\xAD\xC6\xCEl\x9EN\x8E\xD9Z\xE3S\x89c\xB1^\xAB\xE5\xE7\xFD\xF3e*\xB8\xEE;\`\xE0n\xD9\xB7I\xE8\x8Fhm\xC3\xDF\xFE\xF2\x80\x87~W.\xF8F\xF4vx\xA4#=\xF3\x9Aiesx\xBE\xCC\xF5.\x94u\xCC\xCAD\xAE\x95\xBC.wk\xB5\xA8!\xC8\xED(\xC3\xA6\xA3\xFDU\xFE#\x82W\xA5I!%\xAB\xF6\xC1\xB34\xB5\x993\xD6b0\xB5\x80\xC1h5b#\xBE\\\\{>\xBE\x8B\xD2\xB8\xE8(\x8A8
|
|
\xFFN\x95\xD7\xAF5x\xBF\x93c\xDB\xE7\x81\f\xAC\x98\xBFF\xF4]\x91]\x9E\v2\xE9\xE5\xCB\x88v\xA6\x93\b\x94q:\x8E\xC2\xD2b )\x85Oq\xFC\x98\xD8\x83\xAA;\x80H\xECx4\xD7 \xB4\xFB\0\x892\xAD\xA3\xD1\xB2Ot\x9A9q>\xC2\xB9\x93\xE9k?\xC5J3\xBF'\x9D\xFD)\xB8\xDE\xA5\xA9Z \f/\f\xAAT\xAF\xEE}$\xD07G\xA42\xE0\xEE"dC\xB6\xA2\x86\x94r[\xC4*\x8F\xB9\x83 \xEF\xB0\xDB\x89\rg\x903-\xC8\x82\xD1\xFAa\x87Y9\x84e\x8E\xF7\xFA\xCD\xAF\x92N\xB9^\x94\xACn\x92$M\x9Fp\xF3\xE4&P\xBC\x99\xC4\x87lB\x9D\xF14\xC2\x7F&\x9DD)\x85\xC5\xC4\xCBR\x8EO\xF5\xD6\xCF\xCF\x7FIAl'\xC9\xA3\xBB\xE9_<\xF8\xB1\xDF\xDE/Y\x88\x8C@\xD9j[\vRTS\xD2\xB6\xC6\xFAT\xE0e\xA2\xD4\xB2fy\xDF\xE2>\xF9=5\x97\x7Fk\x96\xCF\xFF\x89A\x84t\xB7\v\xDC\xF4U\xDCur\x7F-\xF2\xE1\xA8\xE3d~\xEB\xBB\xE4\x9C<b\xCA\x9FJ\xE2(HiY\xE9\xF4\xD5\xF0o\xA2v\xA8\xEF@\xA1\0\0\0\0\xE1\xB6R\xEF\x83k\xD4b\xDD\x86\xEA\xD7\xA8\v\xE7a\xFA\xE4\x85\xBC|d
|
|
.\xE1\f\xAEQ\xED\xF8\x8F\xC5\x85ns\xD7\xFD
|
|
y\xF9\xEB\xCF\xAB\xF3\x89-h\xA4\x7F\xF6\\\xA3.\xF9\xEA\xF1\xC1\x9B7w+z\x81%\xC4\x8B\v%\xFF=Y\xCA\x9D\xE0\xDF |V\x8D\xCF\xF2\xF29\xF5D\xA0\xD6\x97\x99&<v/t\xD3%Z2\xF3\x93\b\xDD\x91N\x8E7p\xF8\xDC\xD80\xB8F]\xD1\xB2\xB3\xD3\x92XRe\xC0\xB76o\xEEV\xD7\xD9\xBC\xB9\xB5:ST\xB2h\xBC<J\xDD\xA0E\xA5\xBF}\xC3O^\xCB\x91\xA0:\xC1\xBFA\xDBw\xED\xAE\xB9\xAAkDX9\xAB(\xE4\xE5s\xC9R\xB7\x9C\xAB\x8F1vJ9c\x99.3Mx\xCF\x85\x97\xADX\x99}L\xEE\xCB\x92$J\xB4d\xC5\xFC\xE6\x8B\xA7!\`aF\x972\x8E"\x9Do\xC3+N\x80\xA1\xF6\xC8j@@\x9A\x85\`p\x8D\xBA\x81\xC6\xDFU\xE3\x1BY\xBF\xAD\vPf\xA7%\xB1\x87w^\xE5\xCC\xF1\xB4z\xA3[l\xDE\xDC\xAD\x8Dh\x8EB\xEF\xB5\b\xA8ZGj t\xA6\x8B\xBF&I\xE9b\xA0\xA3\b\xD4\xF2Lx,.\x94\x99\x9A|{\xFBG\xFA\x91\xF1\xA8~~\xFB\x86\x9F\x9FM\xD4p\xFD\x90R\x9A&\0ut\x82\x7F\x83\x954-l\xF7\xE9\xAB\x86_\xF9irU\xD7\x88\x93\xE3\x85g\xF1>\x8D\x88QbP\xC8\xCB\xE7\xB1~\x99\b\xD3\xA3\xE22M\rVc\xEC\xB7\xA91\xD5t\xB7\xE94\xC2\xE5\\f\x9A\xF0\xBD\xD0\xC8\xDF\rN\xF5>\xBBZ\xB12\xFB\xBB\x07\`\xD9\xDA\xE6\xFE8l\xB4H\x94h\xC9\xA9":&\xCB\xFF\xBC\xCC*I\xEE#NC\xC0\xC2\xAF\xF5\x92-\xCD(\xC7,\x9EF(D:9\xDE\xA5\x8Ck1\xC7Q\xED\xDB&\xE7\xBF4B\xED\x91\xD5\xA3[\xC3:\xC1\x86E\xD0 0?\x81\xE6k\xAE\`P9A\x8D\xBF\xAB\xE3;\xEDD\x871\xC3\xA5f\x87\x91JZ\xA0\xE5\xECEO\x8DH:\xB9l\xFEhV#\xEE\xBC\xEF\x95\xBCS\x8B\x9F\x92\xB2j)\xC0]\b\xF4F\xB7\xE9BX\x99\xBA\xC8\x80x\f\x9Ao\xD1\x85\xFBgNj\x9Fm\`\x8B~\xDB2d\xB4\x8E\xFD\xB0\xE6a\x95\x99\x97t\xA2\xCBx\x7FM\x92\xF7\xC9}\x93\xC31\x9Crucs\xA8\xE5\x99\xF1\xB7v\xB1^-\xF3P\xE8\x7F25\xF9\xF6\xD3\x83\xAB\xB7\x89\x85\xF8V?\xD74\xE2Q\xFD\xD5T\xBD\xF0|\xE4\\F.\v>\x9B\xA8\xE1\xDF-\xFA\xBB'\xD4\xEFZ\x91\x86\x008L\0\xEA\xD9\xFAR\xA9\x8E\xDDH\xB4\xDC2*iZ\xD8\xCB\xDF\b7\xAF\xD5&\xD6Nct9,\xBE\xF2\xD3\xCD\b\xA0<\xA5\xAC\xDF\xCAD\x8D%&\xC7\v\xCF\xC7qY \xA3{w\xC1B\xCD%. \xA3\xC4\xC1\xA6\xF1+\xE1\x96\xE6\0 \xB4\xFBb\xFD2\x83K\`\xFE\xE7AN\xF7\xF0d*\x9A\x85\x9C\xC8\xF5\xED8\xB7\f\x8E\xE5\xECnSc\x8F\xE51\xE9\xEB\xEF\b
|
|
YM\xE7h\x84\xCB\r\x892\x99\xE2\xF9\xCAE:|\xD5z\xA1\x91?\x9B\xC3\xD0\xFF\xED1\xAB\xBF\xDE|v94\x9D\xC0k\xDB\xF5d-\xD2F\xC2v\xC0(\x97\xB9\x92\xC7\xF3\xB3\xBC&\xEE\xC9p\xD8h#\x91n:\xCC\xD1.\xA0I0\x98\xF2\xA6REtL\xB3\xF3&\xA3\xD7\xF9\bB6OZ\xADT\x92\xDCG\xB5$\x8E\xA8\xDD\x80\xF1^<6\xA3\xB1^\xEB%[\xBF]w\xB4\xDBWYU:\xE1\v\xBAX<\x8DP\xB9\x8A\xDF\xBF\xC9rg(\xC4Q\x88J\xD7b\xAB\xAF\x85\x8D\xCF\xA5\xABl.\xF9\x83L\xCE\x7Fi\xADx-\x86\xC5\xDCRp$j\0\x9FF\xB7\x86u\xA7\xD4\x9A\xC3\v\xFA{"\xBD\xA8\x94@\`.~\xA1\xD6|\x91\0\0\0\0C\xCB\xA6\x87\xC7\x90<\xD4\x84[\x9AS\xCF'\bs\x8C\xEC\xAE\xF4\b\xB74\xA7K|\x92 \x9EO\xE6\xDD\x84\xB6aY\xDF,2\x8A\xB5Qh\x95\xA3\xBE\x96\xF8$A\xD53\x82\xC6}\x99Q>R\xF7\x90\xBA m\xC3\xF9\xC2\xCBD\xB2\xBEYd\xF1u\xFF\xE3u.e\xB06\xE5\xC37\xE3\xD6A\xF1\xA0\xE7v$F}%g\x8D\xDB\xA2,\xF1I\x82o:\xEF\xEBauV\xA8\xAA\xD3\xD1\xFA2\xA3.\xB9\xF9\xA9=\xA2\x9F\xFA~i9}5\xAB]v\xDE\r\xDA\xF2\x85\x97\x89\xB1N1d}\xB3\xC8'\xB6O\xA3\xED\x8F\xE0&)\x9B\xABZ\xBB\xBB\xE8\x91<l\xCA\x87o/!\xE8\x87\xAB\xF29\xC4\`T\xBE@;\xCE\xED\xF0hjH\x8C\xFAJ\vG\\\xCD\x8F\xC6\x9E\xCC\xD7\`\xE4\xE2\xDFZ/DX\xDEt\xDE\v\x9D\xBFx\x8C\xD6\xC3\xEA\xAC\x95\bL+S\xD6xR\x98p\xFF\xF4eF]\xB7\xAE\xE0\xDA3\xF5z\x89p>\xDC;BN.x\x89\xE8\xA9\xFC\xD2r\xFA\xBF\xD4}j*V\xBB)\xE1\xF0<\xAD\xBAjo\xEEq\xCC\xE8\xA5\r^\xC8\xE6\xC6\xF8Ob\x9Db!V\xC4\x9B\x89\xFCJ\xCA7\xB1\xCDNl+\x9E\r\xA7\x8DF\xDB9\xB9\xBE\x81K#\xED\xC2\x80\x85j\xB3\x07\xACTx\xA1+\xD0#;x\x93\xE8\x9D\xFF\xD8\x94\xDF\x9B_\xA9X3\v\\\xCF\x95\x8CW\xE5sM\x9CC\xF4\xC9\xC7\xD9\xA7\x8A\f\x7F \xC1p\xED\0\x82\xBBK\x87\xE0\xD1\xD4E+wS\x90\xF5\x95\xD3\xD3SW\x88\xC9ACo\xC6_?\xFD\xE6\xF4[a\x98\xAF\xC12\xDBdg\xB5s\xCE\xB4d0\xE3\xB4^\x88\xB0\xF7\x95.7\xBC\xE9\xBC\xFF"\x90{y\x80\xC38\xB2&D\xED\x81\xA4\x82\xAEJ*\x98Vi\xDA>\xD1"\xA6\xAC\xF1am
|
|
v\xE56\x90%\xA6\xFD6\xA2\xE8\xCB\x8C\xBA\xAB\0*=/[\xB0nl\x90\xE9'\xEC\x84\xC9d'"N\xE0|\xB8\xA3\xB7\x9Av\x84\x9C\\5O:\xDB\xB1\xA0\x88\xF2\xDF\xB9\xA3\x94/\xFAh2\xA8~3\xA8\xFB=\xF8|\x95R\xDD\xAD\xD6\x99{*R\xC2\xE1y G\xFEZu\xD5\xDE\xBEsY\x9D\xE5\xE9
|
|
\xDE.O\x8D\v\xCDKH\xD6k\xCC\xCC\x8D\xF1\x9F\x8FFW\xC4:\xC58\x87\xF1c\xBF\xAA\xF9\xEC@a_k\xF9/\x94Q2\x89\xD5i@\x96\xA2\xB5\xC7\xDD\xDE'\xE7\x9E\x81\`N\x1B3Y\x85\xBD\xB4\x8C\xB6?r\xCF}\x99\xF5K&\xA6\b\xED\xA5!C\x917\0Z\x91\x86\x84\v\xD5\xC7\xCA\xADRo\`~\x83,\xAB\xD8\xA8\xF0BW\xEB;\xE4\xD0\xA0Gv\xF0\xE3\x8C\xD0wg\xD7J$$\xEC\xA3\xF1/ne\xB2\xE4\xC8\xE26\xBFR\xB1ut\xF46>\bf}\xC3\xC0\x91\xF9\x98Z\xC2\xBAS\xFCE\xAE\xCA\xE7_el\`\xDB>\xF63\x98\xF5P\xB4\xD3\x89\xC2\x94\x90Bd\xFE@W\xD2X\xC7\x82\xE1\xDA\xC1*|\x86Eq\xE6\xD5\xBA@RM\xC6\xD2r\rt\xF5\x8AV\xEE\xA6\xC9\x9DH!a7\x9B\xF0"\xFC=w\xA6\xA7\xA7$\xE5l\xA3\xAE\x93\x83\xED\xDB5i\x80\xAFW*K \xD0\xFFx\x8B\xBC\xB3-\x918\xE8\xB7\xC2{#E0_\x83es\x94%\xE2\xF7\xCF\xBF\xB1\xB46\xE6\x9Ci\xC9\xA5W\xCFN!\fUb\xC7\xF3\x9A)\xBBa\xBAjp\xC7=\xEE+]n\xAD\xE0\xFB\xE9x\xD3y/;\xDF\xA8\xBFCE\xFB\xFC\x88\xE3|\xB7\xF4q\\\xF4?\xD7\xDBpdM\x883\xAF\xEB\x9B8\xDE\xD8\xCE\x9EY\\\x95
|
|
^\xA2\x8DT"0\xAD\xE9\x96*\x93\xB2\fy\xD0y\xAA\xFEJ(8F\x81\x8E\xBF\xC2\xDA\xEC\x81\xB2k\xCAm K\x89\xA6\x86\xCC\r\xFD\x9FN6\xBA\0\0\0\0\0\b\0\x07\0 \0\0
|
|
\0\0\v\0\0\f\0\0\r\0\0\0\0\0A\x90\xDC\0\v\xA2\`\x07\0\0\0\bP\0\0\b\0\bs\0\x07\0\0\bp\0\0\b0\0\0 \xC0\0\x07
|
|
\0\0\b\`\0\0\b \0\0 \xA0\0\0\b\0\0\0\b\x80\0\0\b@\0\0 \xE0\0\x07\0\0\bX\0\0\b\0\0 \x90\0\x07;\0\0\bx\0\0\b8\0\0 \xD0\0\x07\0\0\bh\0\0\b(\0\0 \xB0\0\0\b\b\0\0\b\x88\0\0\bH\0\0 \xF0\0\x07\0\0\bT\0\0\b\0\b\xE3\0\x07+\0\0\bt\0\0\b4\0\0 \xC8\0\x07\r\0\0\bd\0\0\b$\0\0 \xA8\0\0\b\0\0\b\x84\0\0\bD\0\0 \xE8\0\x07\b\0\0\b\\\0\0\b\0\0 \x98\0\x07S\0\0\b|\0\0\b<\0\0 \xD8\0\x07\0\0\bl\0\0\b,\0\0 \xB8\0\0\b\f\0\0\b\x8C\0\0\bL\0\0 \xF8\0\x07\0\0\bR\0\0\b\0\b\xA3\0\x07#\0\0\br\0\0\b2\0\0 \xC4\0\x07\v\0\0\bb\0\0\b"\0\0 \xA4\0\0\b\0\0\b\x82\0\0\bB\0\0 \xE4\0\x07\x07\0\0\bZ\0\0\b\0\0 \x94\0\x07C\0\0\bz\0\0\b:\0\0 \xD4\0\x07\0\0\bj\0\0\b*\0\0 \xB4\0\0\b
|
|
\0\0\b\x8A\0\0\bJ\0\0 \xF4\0\x07\0\0\bV\0\0\b\0@\b\0\0\x073\0\0\bv\0\0\b6\0\0 \xCC\0\x07\0\0\bf\0\0\b&\0\0 \xAC\0\0\b\0\0\b\x86\0\0\bF\0\0 \xEC\0\x07 \0\0\b^\0\0\b\0\0 \x9C\0\x07c\0\0\b~\0\0\b>\0\0 \xDC\0\x07\x1B\0\0\bn\0\0\b.\0\0 \xBC\0\0\b\0\0\b\x8E\0\0\bN\0\0 \xFC\0\`\x07\0\0\0\bQ\0\0\b\0\b\x83\0\x07\0\0\bq\0\0\b1\0\0 \xC2\0\x07
|
|
\0\0\ba\0\0\b!\0\0 \xA2\0\0\b\0\0\b\x81\0\0\bA\0\0 \xE2\0\x07\0\0\bY\0\0\b\0\0 \x92\0\x07;\0\0\by\0\0\b9\0\0 \xD2\0\x07\0\0\bi\0\0\b)\0\0 \xB2\0\0\b \0\0\b\x89\0\0\bI\0\0 \xF2\0\x07\0\0\bU\0\0\b\0\b\x07+\0\0\bu\0\0\b5\0\0 \xCA\0\x07\r\0\0\be\0\0\b%\0\0 \xAA\0\0\b\0\0\b\x85\0\0\bE\0\0 \xEA\0\x07\b\0\0\b]\0\0\b\0\0 \x9A\0\x07S\0\0\b}\0\0\b=\0\0 \xDA\0\x07\0\0\bm\0\0\b-\0\0 \xBA\0\0\b\r\0\0\b\x8D\0\0\bM\0\0 \xFA\0\x07\0\0\bS\0\0\b\0\b\xC3\0\x07#\0\0\bs\0\0\b3\0\0 \xC6\0\x07\v\0\0\bc\0\0\b#\0\0 \xA6\0\0\b\0\0\b\x83\0\0\bC\0\0 \xE6\0\x07\x07\0\0\b[\0\0\b\x1B\0\0 \x96\0\x07C\0\0\b{\0\0\b;\0\0 \xD6\0\x07\0\0\bk\0\0\b+\0\0 \xB6\0\0\b\v\0\0\b\x8B\0\0\bK\0\0 \xF6\0\x07\0\0\bW\0\0\b\0@\b\0\0\x073\0\0\bw\0\0\b7\0\0 \xCE\0\x07\0\0\bg\0\0\b'\0\0 \xAE\0\0\b\x07\0\0\b\x87\0\0\bG\0\0 \xEE\0\x07 \0\0\b_\0\0\b\0\0 \x9E\0\x07c\0\0\b\x7F\0\0\b?\0\0 \xDE\0\x07\x1B\0\0\bo\0\0\b/\0\0 \xBE\0\0\b\0\0\b\x8F\0\0\bO\0\0 \xFE\0\`\x07\0\0\0\bP\0\0\b\0\bs\0\x07\0\0\bp\0\0\b0\0\0 \xC1\0\x07
|
|
\0\0\b\`\0\0\b \0\0 \xA1\0\0\b\0\0\0\b\x80\0\0\b@\0\0 \xE1\0\x07\0\0\bX\0\0\b\0\0 \x91\0\x07;\0\0\bx\0\0\b8\0\0 \xD1\0\x07\0\0\bh\0\0\b(\0\0 \xB1\0\0\b\b\0\0\b\x88\0\0\bH\0\0 \xF1\0\x07\0\0\bT\0\0\b\0\b\xE3\0\x07+\0\0\bt\0\0\b4\0\0 \xC9\0\x07\r\0\0\bd\0\0\b$\0\0 \xA9\0\0\b\0\0\b\x84\0\0\bD\0\0 \xE9\0\x07\b\0\0\b\\\0\0\b\0\0 \x99\0\x07S\0\0\b|\0\0\b<\0\0 \xD9\0\x07\0\0\bl\0\0\b,\0\0 \xB9\0\0\b\f\0\0\b\x8C\0\0\bL\0\0 \xF9\0\x07\0\0\bR\0\0\b\0\b\xA3\0\x07#\0\0\br\0\0\b2\0\0 \xC5\0\x07\v\0\0\bb\0\0\b"\0\0 \xA5\0\0\b\0\0\b\x82\0\0\bB\0\0 \xE5\0\x07\x07\0\0\bZ\0\0\b\0\0 \x95\0\x07C\0\0\bz\0\0\b:\0\0 \xD5\0\x07\0\0\bj\0\0\b*\0\0 \xB5\0\0\b
|
|
\0\0\b\x8A\0\0\bJ\0\0 \xF5\0\x07\0\0\bV\0\0\b\0@\b\0\0\x073\0\0\bv\0\0\b6\0\0 \xCD\0\x07\0\0\bf\0\0\b&\0\0 \xAD\0\0\b\0\0\b\x86\0\0\bF\0\0 \xED\0\x07 \0\0\b^\0\0\b\0\0 \x9D\0\x07c\0\0\b~\0\0\b>\0\0 \xDD\0\x07\x1B\0\0\bn\0\0\b.\0\0 \xBD\0\0\b\0\0\b\x8E\0\0\bN\0\0 \xFD\0\`\x07\0\0\0\bQ\0\0\b\0\b\x83\0\x07\0\0\bq\0\0\b1\0\0 \xC3\0\x07
|
|
\0\0\ba\0\0\b!\0\0 \xA3\0\0\b\0\0\b\x81\0\0\bA\0\0 \xE3\0\x07\0\0\bY\0\0\b\0\0 \x93\0\x07;\0\0\by\0\0\b9\0\0 \xD3\0\x07\0\0\bi\0\0\b)\0\0 \xB3\0\0\b \0\0\b\x89\0\0\bI\0\0 \xF3\0\x07\0\0\bU\0\0\b\0\b\x07+\0\0\bu\0\0\b5\0\0 \xCB\0\x07\r\0\0\be\0\0\b%\0\0 \xAB\0\0\b\0\0\b\x85\0\0\bE\0\0 \xEB\0\x07\b\0\0\b]\0\0\b\0\0 \x9B\0\x07S\0\0\b}\0\0\b=\0\0 \xDB\0\x07\0\0\bm\0\0\b-\0\0 \xBB\0\0\b\r\0\0\b\x8D\0\0\bM\0\0 \xFB\0\x07\0\0\bS\0\0\b\0\b\xC3\0\x07#\0\0\bs\0\0\b3\0\0 \xC7\0\x07\v\0\0\bc\0\0\b#\0\0 \xA7\0\0\b\0\0\b\x83\0\0\bC\0\0 \xE7\0\x07\x07\0\0\b[\0\0\b\x1B\0\0 \x97\0\x07C\0\0\b{\0\0\b;\0\0 \xD7\0\x07\0\0\bk\0\0\b+\0\0 \xB7\0\0\b\v\0\0\b\x8B\0\0\bK\0\0 \xF7\0\x07\0\0\bW\0\0\b\0@\b\0\0\x073\0\0\bw\0\0\b7\0\0 \xCF\0\x07\0\0\bg\0\0\b'\0\0 \xAF\0\0\b\x07\0\0\b\x87\0\0\bG\0\0 \xEF\0\x07 \0\0\b_\0\0\b\0\0 \x9F\0\x07c\0\0\b\x7F\0\0\b?\0\0 \xDF\0\x07\x1B\0\0\bo\0\0\b/\0\0 \xBF\0\0\b\0\0\b\x8F\0\0\bO\0\0 \xFF\0\0\0\x1B\0A\0@\0!\0 \0\b\x81\0@\0\0\0\x81\0\x1B\x07\0a\0\`\01\00\r\0\f\xC1\0@\0\0\0\0\0\0\x07\0\b\0 \0
|
|
\0\v\0\r\0\0\0\0\0\x1B\0\0#\0+\x003\0;\0C\0S\0c\0s\0\x83\0\xA3\0\xC3\0\xE3\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xCB\0M\0\0\0\0\0\0\0\0\x07\0 \0\r\0\0\0!\x001\0A\0a\0\x81\0\xC1\0\x81\b\f 0@\`\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x1B\0\x1B\0\0\0\0\0@\0@\0\xBE\xF3\xF8y\xECa\xF6?\xDE\xAA\x8C\x80\xF7{\xD5\xBF=\x88\xAFJ\xEDq\xF5?\xDBm\xC0\xA7\xF0\xBE\xD2\xBF\xB0\xF0\xF09\x95\xF4?g:Q\x7F\xAE\xD0\xBF\x85\xB8\xB0\x95\xC9\xF3?\xE9$\x82\xA6\xD81\xCB\xBF\xA5d\x88\f\r\xF3?Xw\xC0
|
|
OW\xC6\xBF\xA0\x8E\v{"^\xF2?\0\x81\x9C\xC7+\xAA\xC1\xBF?4JJ\xBB\xF1?^\x8C\xCEvN\xBA\xBF\xBA\xE5\x8A\xF0X#\xF1?\xCCaZ<\x97\xB1\xBF\xA7\0\x99A?\x95\xF0?\f\xE18\xF4R\xA2\xBF\0\0\0\0\0\0\xF0?\0\0\0\0\0\0\0\0\xACG\x9A\xFD\x8C\`\xEE?\x84Y\xF2]\xAA\xA5\xAA?\xA0j\xB3\xA4\xEC?\xB4.6\xAAS^\xBC?\xE6\xFCjW6 \xEB?\b\xDB w\xE5&\xC5?-\xAA\xA1c\xD1\xC2\xE9?pG"\r\x86\xC2\xCB?\xEDAx\xE6\x86\xE8?\xE1~\xA0\xC8\x8B\xD1?bHS\xF5\xDCg\xE7? \xEE\xB6W0\xD4?\xEF9\xFA\xFEB.\xE6?4\x83\xB8H\xA3\xD0\xBFj\v\xE0\v[W\xD5?#A
|
|
\xF2\xFE\xFF\xDF\xBF\xB8e\0A\xC0\xF1\0\vA\0\v\0\0\0\0\0\0\0\0\0\0\0 \0\0\0\0\v\0\0\0\0\0\0\0\0\0
|
|
|
|
|
|
\x07\0\0 \v\0\0 \v\0\0\v\0\0\0\0\0A\x91\xF2\0\v!\0\0\0\0\0\0\0\0\0\v\r\0\r\0\0\0 \0\0\0 \0\0\0\0A\xCB\xF2\0\v\f\0A\xD7\xF2\0\v\0\0\0\0\0\0\0\0 \f\0\0\0\0\0\f\0\0\f\0A\x85\xF3\0\v\0A\x91\xF3\0\v\0\0\0\0\0\0\0 \0\0\0\0\0\0\0\0A\xBF\xF3\0\v\0A\xCB\xF3\0\v\0\0\0\0\0\0\0\0 \0\0\0\0\0\0\0\0\0\0\0\0\0A\x82\xF4\0\v\0\0\0\0\0\0\0\0\0 \0A\xB3\xF4\0\v\0A\xBF\xF4\0\v\0\0\0\0\0\0\0\0 \0\0\0\0\0\0\0\0A\xED\xF4\0\v\0A\xF9\xF4\0\v\xB8\x07\0\0\0\0\0\0\0\0 \0\0\0\0\0\0\0\0\x000123456789ABCDEF\0\0\0\0X;\0\x006\0\0\x007\0\0\x008\0\0\x009\0\0\0:\0\0\0;\0\0\0<\0\0\0=\0\0\0>\0\0\0?\0\0\0@\0\0\0A\0\0\0B\0\0\0C\0\0\0\0\0\0\0t<\0\0D\0\0\0E\0\0\x008\0\0\x009\0\0\0F\0\0\0G\0\0\0<\0\0\0=\0\0\0>\0\0\0H\0\0\0@\0\0\0I\0\0\0B\0\0\0J\0\0\0\xCCd\0\0,;\0\0>\0\0NSt3__29basic_iosIcNS_11char_traitsIcEEEE\0\0\0\xA4d\0\0\`;\0\0NSt3__215basic_streambufIcNS_11char_traitsIcEEEE\0\0\0\0(e\0\0\xAC;\0\0\0\0\0\0\0\0\0 ;\0\0\xF4\xFF\xFFNSt3__213basic_istreamIcNS_11char_traitsIcEEEE\0\0(e\0\0\xF4;\0\0\0\0\0\0\0\0\0 ;\0\0\xF4\xFF\xFFNSt3__213basic_ostreamIcNS_11char_traitsIcEEEE\0\0(e\0\0D<\0\0\0\0\0\0\0\0\x94;\0\0\0\0\0\xDC;\0\0\b\0\0NSt3__214basic_iostreamIcNS_11char_traitsIcEEEE\0\xCCd\0\0\x80<\0\0X;\0\0NSt3__215basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEEE\0\0\0@\0\0\0\0\0\0\0\xB4=\0\0K\0\0\0L\0\0\x008\0\0\0\xF8\xFF\xFF\xFF\xB4=\0\0M\0\0\0N\0\0\0\xC0\xFF\xFF\xFF\xC0\xFF\xFF\xFF\xB4=\0\0O\0\0\0P\0\0\0\xD0<\0\x004=\0\0p=\0\0\x84=\0\0\x98=\0\0\xAC=\0\0\\=\0\0H=\0\0\xF8<\0\0\xE4<\0\0@\0\0\0\0\0\0\0$<\0\0Q\0\0\0R\0\0\x008\0\0\0\xF8\xFF\xFF\xFF$<\0\0S\0\0\0T\0\0\0\xC0\xFF\xFF\xFF\xC0\xFF\xFF\xFF$<\0\0U\0\0\0V\0\0\0@\0\0\0\0\0\0\0\x94;\0\0W\0\0\0X\0\0\0\xC0\xFF\xFF\xFF\xC0\xFF\xFF\xFF\x94;\0\0Y\0\0\0Z\0\0\x008\0\0\0\0\0\0\0\xDC;\0\0[\0\0\0\\\0\0\0\xC8\xFF\xFF\xFF\xC8\xFF\xFF\xFF\xDC;\0\0]\0\0\0^\0\0\0\xCCd\0\0\xC0=\0\0$<\0\0NSt3__218basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE\0\0\0\0\0\0\0\0>\0\0_\0\0\0\`\0\0\0\xA4d\0\0 >\0\0NSt3__28ios_baseE\0A\xC0\xFC\0\v#\xDE\x95\0\0\0\0\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF@>\0\0\0\0\0C.UTF-8\0A\x90\xFD\0\vT>\0A\xB0\xFD\0\vGLC_CTYPE\0\0\0\0LC_NUMERIC\0\0LC_TIME\0\0\0\0\0LC_COLLATE\0\0LC_MONETARY\0LC_MESSAGES\0A\x84\xFE\0\v-\x80\xDE(\0\x80\xC8M\0\0\xA7v\0\x004\x9E\0\x80\xC7\0\x80\x9F\xEE\0\0~\x80\\@\x80\xE9g\0\xC8\x90\0U\xB8.\0A\xC0\xFE\0\v\xD2Sun\0Mon\0Tue\0Wed\0Thu\0Fri\0Sat\0Sunday\0Monday\0Tuesday\0Wednesday\0Thursday\0Friday\0Saturday\0Jan\0Feb\0Mar\0Apr\0May\0Jun\0Jul\0Aug\0Sep\0Oct\0Nov\0Dec\0January\0February\0March\0April\0May\0June\0July\0August\0September\0October\0November\0December\0AM\0PM\0%a %b %e %T %Y\0%m/%d/%y\0%H:%M:%S\0%I:%M:%S %p\0\0\0%m/%d/%y\x000123456789\0%a %b %e %T %Y\0%H:%M:%S\0\0\0\0\0^[yY]\0^[nN]\0yes\0no\0A\xA0\x81\v\xE1\xD1t\x9E\0W\x9D\xBD*\x80pR\xFF\xFF>'
|
|
\0\0\0d\0\0\0\xE8\0\0'\0\0\xA0\x86\0@B\0\x80\x96\x98\0\0\xE1\xF5\0\0\x005\0\0\0q\0\0\0k\xFF\xFF\xFF\xCE\xFB\xFF\xFF\x92\xBF\xFF\xFF\0\0\0\0\0\0\0\0\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\x07\b \xFF\xFF\xFF\xFF\xFF\xFF\xFF
|
|
\v\f\r\x1B !"#\xFF\xFF\xFF\xFF\xFF\xFF
|
|
\v\f\r\x1B !"#\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\x07\0\0\0\0\0\0\0\0\0\xC0\0\0\xC0\0\0\xC0\0\0\xC0\0\0\xC0\x07\0\0\xC0\b\0\0\xC0 \0\0\xC0
|
|
\0\0\xC0\v\0\0\xC0\f\0\0\xC0\r\0\0\xC0\0\0\xC0\0\0\xC0\0\0\xC0\0\0\xC0\0\0\xC0\0\0\xC0\0\0\xC0\0\0\xC0\0\0\xC0\0\0\xC0\0\0\xC0\0\0\xC0\0\0\xC0\x1B\0\0\xC0\0\0\xC0\0\0\xC0\0\0\xC0\0\0\xC0\0\0\0\xB3\0\0\xC3\0\0\xC3\0\0\xC3\0\0\xC3\0\0\xC3\0\0\xC3\x07\0\0\xC3\b\0\0\xC3 \0\0\xC3
|
|
\0\0\xC3\v\0\0\xC3\f\0\0\xC3\r\0\0\xD3\0\0\xC3\0\0\xC3\0\0\f\xBB\0\f\xC3\0\f\xC3\0\f\xC3\0\f\xDB\0\0\0\x000123456789abcdefABCDEFxX+-pPiInN\0%I:%M:%S %p%H:%M\0A\x90\x86\v\x81%\0\0\0m\0\0\0/\0\0\0%\0\0\0d\0\0\0/\0\0\0%\0\0\0y\0\0\0%\0\0\0Y\0\0\0-\0\0\0%\0\0\0m\0\0\0-\0\0\0%\0\0\0d\0\0\0%\0\0\0I\0\0\0:\0\0\0%\0\0\0M\0\0\0:\0\0\0%\0\0\0S\0\0\0 \0\0\0%\0\0\0p\0\0\0\0\0\0\0%\0\0\0H\0\0\0:\0\0\0%\0\0\0M\0A\xA0\x87\ve%\0\0\0H\0\0\0:\0\0\0%\0\0\0M\0\0\0:\0\0\0%\0\0\0S\0\0\0\0\0\0\0\0M\0\0t\0\0\0u\0\0\0v\0\0\0\0\0\0\0dM\0\0w\0\0\0x\0\0\0v\0\0\0y\0\0\0z\0\0\0{\0\0\0|\0\0\0}\0\0\0~\0\0\0\x7F\0\0\0\x80\0A\x90\x88\v\xFD\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x82\0\0\0\x82\0\0\0\x82\0\0\0\x82\0\0\0\x82\0\0\0\x82\0\0\0\x82\0\0\0\x82\0\0\0\x82\0\0\0\x82\0\0\0\x82\0\0\0\x82\0\0\0\x82\0\0\0\x82\0\0\0\x82\0\0\0B\0\0B\0\0B\0\0B\0\0B\0\0B\0\0B\0\0B\0\0B\0\0B\0\0\x82\0\0\0\x82\0\0\0\x82\0\0\0\x82\0\0\0\x82\0\0\0\x82\0\0\0\x82\0\0\0*\0\0*\0\0*\0\0*\0\0*\0\0*\0\0*\0\0\0*\0\0\0*\0\0\0*\0\0\0*\0\0\0*\0\0\0*\0\0\0*\0\0\0*\0\0\0*\0\0\0*\0\0\0*\0\0\0*\0\0\0*\0\0\0*\0\0\0*\0\0\0*\0\0\0*\0\0\0*\0\0\0*\0\0\0\x82\0\0\0\x82\0\0\0\x82\0\0\0\x82\0\0\0\x82\0\0\0\x82\0\0\x002\0\x002\0\x002\0\x002\0\x002\0\x002\0\x002\0\0\x002\0\0\x002\0\0\x002\0\0\x002\0\0\x002\0\0\x002\0\0\x002\0\0\x002\0\0\x002\0\0\x002\0\0\x002\0\0\x002\0\0\x002\0\0\x002\0\0\x002\0\0\x002\0\0\x002\0\0\x002\0\0\x002\0\0\0\x82\0\0\0\x82\0\0\0\x82\0\0\0\x82\0\0\0\0A\x94\x90\v\xED\xBCL\0\0\x81\0\0\0\x82\0\0\0v\0\0\0\x83\0\0\0\x84\0\0\0\x85\0\0\0\x86\0\0\0\x87\0\0\0\x88\0\0\0\x89\0\0\0\0\0\0\0\x98M\0\0\x8A\0\0\0\x8B\0\0\0v\0\0\0\x8C\0\0\0\x8D\0\0\0\x8E\0\0\0\x8F\0\0\0\x90\0\0\0\0\0\0\0\xBCM\0\0\x91\0\0\0\x92\0\0\0v\0\0\0\x93\0\0\0\x94\0\0\0\x95\0\0\0\x96\0\0\0\x97\0\0\0t\0\0\0r\0\0\0u\0\0\0e\0\0\0\0\0\0\0f\0\0\0a\0\0\0l\0\0\0s\0\0\0e\0\0\0\0\0\0\0%\0\0\0m\0\0\0/\0\0\0%\0\0\0d\0\0\0/\0\0\0%\0\0\0y\0\0\0\0\0\0\0%\0\0\0H\0\0\0:\0\0\0%\0\0\0M\0\0\0:\0\0\0%\0\0\0S\0\0\0\0\0\0\0%\0\0\0a\0\0\0 \0\0\0%\0\0\0b\0\0\0 \0\0\0%\0\0\0d\0\0\0 \0\0\0%\0\0\0H\0\0\0:\0\0\0%\0\0\0M\0\0\0:\0\0\0%\0\0\0S\0\0\0 \0\0\0%\0\0\0Y\0\0\0\0\0\0\0%\0\0\0I\0\0\0:\0\0\0%\0\0\0M\0\0\0:\0\0\0%\0\0\0S\0\0\0 \0\0\0%\0\0\0p\0A\x8C\x93\v\xFD'\x9CI\0\0\x98\0\0\0\x99\0\0\0v\0\0\0\xCCd\0\0\xA8I\0\0\xF0a\0\0NSt3__26locale5facetE\0\0\0\0\0\0\0J\0\0\x98\0\0\0\x9A\0\0\0v\0\0\0\x9B\0\0\0\x9C\0\0\0\x9D\0\0\0\x9E\0\0\0\x9F\0\0\0\xA0\0\0\0\xA1\0\0\0\xA2\0\0\0\xA3\0\0\0\xA4\0\0\0\xA5\0\0\0\xA6\0\0\0(e\0\0$J\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\x008J\0\0\0\0\0NSt3__25ctypeIwEE\0\0\0\xA4d\0\0@J\0\0NSt3__210ctype_baseE\0\0\0\0\0\0\0\0\x88J\0\0\x98\0\0\0\xA7\0\0\0v\0\0\0\xA8\0\0\0\xA9\0\0\0\xAA\0\0\0\xAB\0\0\0\xAC\0\0\0\xAD\0\0\0\xAE\0\0\0(e\0\0\xA8J\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\0\xCCJ\0\0\0\0\0NSt3__27codecvtIcc11__mbstate_tEE\0\0\0\xA4d\0\0\xD4J\0\0NSt3__212codecvt_baseE\0\0\0\0\0\0K\0\0\x98\0\0\0\xAF\0\0\0v\0\0\0\xB0\0\0\0\xB1\0\0\0\xB2\0\0\0\xB3\0\0\0\xB4\0\0\0\xB5\0\0\0\xB6\0\0\0(e\0\0<K\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\0\xCCJ\0\0\0\0\0NSt3__27codecvtIDsc11__mbstate_tEE\0\0\0\0\0\0\x90K\0\0\x98\0\0\0\xB7\0\0\0v\0\0\0\xB8\0\0\0\xB9\0\0\0\xBA\0\0\0\xBB\0\0\0\xBC\0\0\0\xBD\0\0\0\xBE\0\0\0(e\0\0\xB0K\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\0\xCCJ\0\0\0\0\0NSt3__27codecvtIDsDu11__mbstate_tEE\0\0\0\0\0L\0\0\x98\0\0\0\xBF\0\0\0v\0\0\0\xC0\0\0\0\xC1\0\0\0\xC2\0\0\0\xC3\0\0\0\xC4\0\0\0\xC5\0\0\0\xC6\0\0\0(e\0\0$L\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\0\xCCJ\0\0\0\0\0NSt3__27codecvtIDic11__mbstate_tEE\0\0\0\0\0\0xL\0\0\x98\0\0\0\xC7\0\0\0v\0\0\0\xC8\0\0\0\xC9\0\0\0\xCA\0\0\0\xCB\0\0\0\xCC\0\0\0\xCD\0\0\0\xCE\0\0\0(e\0\0\x98L\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\0\xCCJ\0\0\0\0\0NSt3__27codecvtIDiDu11__mbstate_tEE\0(e\0\0\xDCL\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\0\xCCJ\0\0\0\0\0NSt3__27codecvtIwc11__mbstate_tEE\0\0\0\xCCd\0\0\fM\0\0\x9CI\0\0NSt3__26locale5__impE\0\0\0\xCCd\0\x000M\0\0\x9CI\0\0NSt3__27collateIcEE\0\xCCd\0\0PM\0\0\x9CI\0\0NSt3__27collateIwEE\0(e\0\0\x84M\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\x008J\0\0\0\0\0NSt3__25ctypeIcEE\0\0\0\xCCd\0\0\xA4M\0\0\x9CI\0\0NSt3__28numpunctIcEE\0\0\0\0\xCCd\0\0\xC8M\0\0\x9CI\0\0NSt3__28numpunctIwEE\0\0\0\0\0\0\0\0$M\0\0\xCF\0\0\0\xD0\0\0\0v\0\0\0\xD1\0\0\0\xD2\0\0\0\xD3\0\0\0\0\0\0\0DM\0\0\xD4\0\0\0\xD5\0\0\0v\0\0\0\xD6\0\0\0\xD7\0\0\0\xD8\0\0\0\0\0\0\0\`N\0\0\x98\0\0\0\xD9\0\0\0v\0\0\0\xDA\0\0\0\xDB\0\0\0\xDC\0\0\0\xDD\0\0\0\xDE\0\0\0\xDF\0\0\0\xE0\0\0\0\xE1\0\0\0\xE2\0\0\0\xE3\0\0\0\xE4\0\0\0(e\0\0\x80N\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\0\xC4N\0\0\0\0\0\0NSt3__27num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE\0(e\0\0\xDCN\0\0\0\0\0\0\0\0\0\xF4N\0\0\0\0\0\0NSt3__29__num_getIcEE\0\0\0\xA4d\0\0\xFCN\0\0NSt3__214__num_get_baseE\0\0\0\0\0\0\0\0XO\0\0\x98\0\0\0\xE5\0\0\0v\0\0\0\xE6\0\0\0\xE7\0\0\0\xE8\0\0\0\xE9\0\0\0\xEA\0\0\0\xEB\0\0\0\xEC\0\0\0\xED\0\0\0\xEE\0\0\0\xEF\0\0\0\xF0\0\0\0(e\0\0xO\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\0\xBCO\0\0\0\0\0\0NSt3__27num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE\0(e\0\0\xD4O\0\0\0\0\0\0\0\0\0\xF4N\0\0\0\0\0\0NSt3__29__num_getIwEE\0\0\0\0\0\0\0 P\0\0\x98\0\0\0\xF1\0\0\0v\0\0\0\xF2\0\0\0\xF3\0\0\0\xF4\0\0\0\xF5\0\0\0\xF6\0\0\0\xF7\0\0\0\xF8\0\0\0\xF9\0\0\0(e\0\0@P\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\0\x84P\0\0\0\0\0\0NSt3__27num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE\0(e\0\0\x9CP\0\0\0\0\0\0\0\0\0\xB4P\0\0\0\0\0\0NSt3__29__num_putIcEE\0\0\0\xA4d\0\0\xBCP\0\0NSt3__214__num_put_baseE\0\0\0\0\0\0\0\0\fQ\0\0\x98\0\0\0\xFA\0\0\0v\0\0\0\xFB\0\0\0\xFC\0\0\0\xFD\0\0\0\xFE\0\0\0\xFF\0\0\0\0\0\0\0\0\0\0(e\0\0,Q\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\0pQ\0\0\0\0\0\0NSt3__27num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE\0(e\0\0\x88Q\0\0\0\0\0\0\0\0\0\xB4P\0\0\0\0\0\0NSt3__29__num_putIwEE\0\0\0\0\0\0\0\xF4Q\0\0\0\0\0\0v\0\0\0\0\0\0\0\x07\0\0\b\0\0 \0\0
|
|
\0\0\v\0\0\xF8\xFF\xFF\xFF\xF4Q\0\0\f\0\0\r\0\0\0\0\0\0\0\0\0\0\0\0(e\0\0R\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\0dR\0\0\0\0\0\x80R\0\0\0\b\0\0NSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE\0\0\0\0\xA4d\0\0lR\0\0NSt3__29time_baseE\0\0\xA4d\0\0\x88R\0\0NSt3__220__time_get_c_storageIcEE\0\0\0\0\0\0\0\0S\0\0\0\0\0\0v\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x1B\0\0\xF8\xFF\xFF\xFF\0S\0\0\0\0\0\0\0\0\0\0 \0\0!\0\0"\0\0(e\0\0(S\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\0dR\0\0\0\0\0pS\0\0\0\b\0\0NSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE\0\0\0\0\xA4d\0\0xS\0\0NSt3__220__time_get_c_storageIwEE\0\0\0\0\0\0\0\xB4S\0\0#\0\0$\0\0v\0\0\0%\0\0(e\0\0\xD4S\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\0T\0\0\0\b\0\0NSt3__28time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE\0\0\0\0\xA4d\0\0$T\0\0NSt3__210__time_putE\0\0\0\0\0\0\0\0TT\0\0&\0\0'\0\0v\0\0\0(\0\0(e\0\0tT\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\0T\0\0\0\b\0\0NSt3__28time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE\0\0\0\0\0\0\0\0\xF4T\0\0\x98\0\0\0)\0\0v\0\0\0*\0\0+\0\0,\0\0-\0\0.\0\0/\0\x000\0\x001\0\x002\0\0(e\0\0U\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\x000U\0\0\0\0\0NSt3__210moneypunctIcLb0EEE\0\xA4d\0\x008U\0\0NSt3__210money_baseE\0\0\0\0\0\0\0\0\x88U\0\0\x98\0\0\x003\0\0v\0\0\x004\0\x005\0\x006\0\x007\0\x008\0\x009\0\0:\0\0;\0\0<\0\0(e\0\0\xA8U\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\x000U\0\0\0\0\0NSt3__210moneypunctIcLb1EEE\0\0\0\0\0\xFCU\0\0\x98\0\0\0=\0\0v\0\0\0>\0\0?\0\0@\0\0A\0\0B\0\0C\0\0D\0\0E\0\0F\0\0(e\0\0V\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\x000U\0\0\0\0\0NSt3__210moneypunctIwLb0EEE\0\0\0\0\0pV\0\0\x98\0\0\0G\0\0v\0\0\0H\0\0I\0\0J\0\0K\0\0L\0\0M\0\0N\0\0O\0\0P\0\0(e\0\0\x90V\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\x000U\0\0\0\0\0NSt3__210moneypunctIwLb1EEE\0\0\0\0\0\xC8V\0\0\x98\0\0\0Q\0\0v\0\0\0R\0\0S\0\0(e\0\0\xE8V\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\x000W\0\0\0\0\0\0NSt3__29money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE\0\0\0\xA4d\0\x008W\0\0NSt3__211__money_getIcEE\0\0\0\0\0\0\0\0pW\0\0\x98\0\0\0T\0\0v\0\0\0U\0\0V\0\0(e\0\0\x90W\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\0\xD8W\0\0\0\0\0\0NSt3__29money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE\0\0\0\xA4d\0\0\xE0W\0\0NSt3__211__money_getIwEE\0\0\0\0\0\0\0\0X\0\0\x98\0\0\0W\0\0v\0\0\0X\0\0Y\0\0(e\0\x008X\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\0\x80X\0\0\0\0\0\0NSt3__29money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE\0\0\0\xA4d\0\0\x88X\0\0NSt3__211__money_putIcEE\0\0\0\0\0\0\0\0\xC0X\0\0\x98\0\0\0Z\0\0v\0\0\0[\0\0\\\0\0(e\0\0\xE0X\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\0(Y\0\0\0\0\0\0NSt3__29money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE\0\0\0\xA4d\0\x000Y\0\0NSt3__211__money_putIwEE\0\0\0\0\0\0\0\0lY\0\0\x98\0\0\0]\0\0v\0\0\0^\0\0_\0\0\`\0\0(e\0\0\x8CY\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\0\xA4Y\0\0\0\0\0NSt3__28messagesIcEE\0\0\0\0\xA4d\0\0\xACY\0\0NSt3__213messages_baseE\0\0\0\0\0\xE4Y\0\0\x98\0\0\0a\0\0v\0\0\0b\0\0c\0\0d\0\0(e\0\0Z\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\0\xA4Y\0\0\0\0\0NSt3__28messagesIwEE\0\0\0\0S\0\0\0u\0\0\0n\0\0\0d\0\0\0a\0\0\0y\0\0\0\0\0\0\0M\0\0\0o\0\0\0n\0\0\0d\0\0\0a\0\0\0y\0\0\0\0\0\0\0T\0\0\0u\0\0\0e\0\0\0s\0\0\0d\0\0\0a\0\0\0y\0\0\0\0\0\0\0W\0\0\0e\0\0\0d\0\0\0n\0\0\0e\0\0\0s\0\0\0d\0\0\0a\0\0\0y\0\0\0\0\0\0\0T\0\0\0h\0\0\0u\0\0\0r\0\0\0s\0\0\0d\0\0\0a\0\0\0y\0\0\0\0\0\0\0F\0\0\0r\0\0\0i\0\0\0d\0\0\0a\0\0\0y\0\0\0\0\0\0\0S\0\0\0a\0\0\0t\0\0\0u\0\0\0r\0\0\0d\0\0\0a\0\0\0y\0\0\0\0\0\0\0S\0\0\0u\0\0\0n\0\0\0\0\0\0\0M\0\0\0o\0\0\0n\0\0\0\0\0\0\0T\0\0\0u\0\0\0e\0\0\0\0\0\0\0W\0\0\0e\0\0\0d\0\0\0\0\0\0\0T\0\0\0h\0\0\0u\0\0\0\0\0\0\0F\0\0\0r\0\0\0i\0\0\0\0\0\0\0S\0\0\0a\0\0\0t\0\0\0\0\0\0\0J\0\0\0a\0\0\0n\0\0\0u\0\0\0a\0\0\0r\0\0\0y\0\0\0\0\0\0\0F\0\0\0e\0\0\0b\0\0\0r\0\0\0u\0\0\0a\0\0\0r\0\0\0y\0\0\0\0\0\0\0M\0\0\0a\0\0\0r\0\0\0c\0\0\0h\0\0\0\0\0\0\0A\0\0\0p\0\0\0r\0\0\0i\0\0\0l\0\0\0\0\0\0\0M\0\0\0a\0\0\0y\0\0\0\0\0\0\0J\0\0\0u\0\0\0n\0\0\0e\0\0\0\0\0\0\0J\0\0\0u\0\0\0l\0\0\0y\0\0\0\0\0\0\0A\0\0\0u\0\0\0g\0\0\0u\0\0\0s\0\0\0t\0\0\0\0\0\0\0S\0\0\0e\0\0\0p\0\0\0t\0\0\0e\0\0\0m\0\0\0b\0\0\0e\0\0\0r\0\0\0\0\0\0\0O\0\0\0c\0\0\0t\0\0\0o\0\0\0b\0\0\0e\0\0\0r\0\0\0\0\0\0\0N\0\0\0o\0\0\0v\0\0\0e\0\0\0m\0\0\0b\0\0\0e\0\0\0r\0\0\0\0\0\0\0D\0\0\0e\0\0\0c\0\0\0e\0\0\0m\0\0\0b\0\0\0e\0\0\0r\0\0\0\0\0\0\0J\0\0\0a\0\0\0n\0\0\0\0\0\0\0F\0\0\0e\0\0\0b\0\0\0\0\0\0\0M\0\0\0a\0\0\0r\0\0\0\0\0\0\0A\0\0\0p\0\0\0r\0\0\0\0\0\0\0J\0\0\0u\0\0\0n\0\0\0\0\0\0\0J\0\0\0u\0\0\0l\0\0\0\0\0\0\0A\0\0\0u\0\0\0g\0\0\0\0\0\0\0S\0\0\0e\0\0\0p\0\0\0\0\0\0\0O\0\0\0c\0\0\0t\0\0\0\0\0\0\0N\0\0\0o\0\0\0v\0\0\0\0\0\0\0D\0\0\0e\0\0\0c\0\0\0\0\0\0\0A\0\0\0M\0\0\0\0\0\0\0P\0\0\0M\0A\x94\xBB\v\x98
|
|
\0\0\0d\0\0\0\xE8\0\0'\0\0\xA0\x86\0@B\0\x80\x96\x98\0\0\xE1\xF5\0\xCA\x9A;\0\0\0\0\0\0\0\x0000010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899\0\0\0\0\0\0\0\x00000000010010001101000101011001111000100110101011110011011110111100010203040506071011121314151617202122232425262730313233343536374041424344454647505152535455565760616263646566677071727374757677000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff\0\0\0\0\0\0\0\0
|
|
\0\0\0\0\0\0\0d\0\0\0\0\0\0\0\xE8\0\0\0\0\0\0'\0\0\0\0\0\0\xA0\x86\0\0\0\0\0@B\0\0\0\0\0\x80\x96\x98\0\0\0\0\0\0\xE1\xF5\0\0\0\0\0\xCA\x9A;\0\0\0\0\0\xE4\vT\0\0\0\0\xE8vH\0\0\0\0\xA5\xD4\xE8\0\0\0\0\xA0rN \0\0\0@z\xF3Z\0\0\0\x80\xC6\xA4~\x8D\0\0\0\xC1o\xF2\x86#\0\0\0\x8A]xEc\0\0d\xA7\xB3\xB6\xE0\r\0\0\xE8\x89#\xC7\x8A\xA4d\0\0\xF8a\0\0NSt3__214__shared_countE\0\0\0\0hf\0\0\xCCd\0\0$b\0\0\x98e\0\0N10__cxxabiv116__shim_type_infoE\0\0\0\0\xCCd\0\0Tb\0\0b\0\0N10__cxxabiv117__class_type_infoE\0\0\0\xCCd\0\0\x84b\0\0b\0\0N10__cxxabiv117__pbase_type_infoE\0\0\0\xCCd\0\0\xB4b\0\0xb\0\0N10__cxxabiv119__pointer_type_infoE\0\xCCd\0\0\xE4b\0\0b\0\0N10__cxxabiv120__function_type_infoE\0\0\0\0\xCCd\0\0c\0\0xb\0\0N10__cxxabiv129__pointer_to_member_type_infoE\0\0\0\0\0\0\0dc\0\0g\0\0h\0\0i\0\0j\0\0k\0\0\xCCd\0\0pc\0\0b\0\0N10__cxxabiv123__fundamental_type_infoE\0Pc\0\0\xA0c\0\0v\0Dn\0\0\0\0Pc\0\0\xB0c\0\0b\0\0\0Pc\0\0\xBCc\0\0c\0\0\0Pc\0\0\xC8c\0\0h\0\0\0Pc\0\0\xD4c\0\0a\0\0\0Pc\0\0\xE0c\0\0s\0\0\0Pc\0\0\xECc\0\0t\0\0\0Pc\0\0\xF8c\0\0i\0\0\0Pc\0\0d\0\0j\0\0\0Pc\0\0d\0\0l\0\0\0Pc\0\0d\0\0m\0\0\0Pc\0\0(d\0\0x\0\0\0Pc\0\x004d\0\0y\0\0\0Pc\0\0@d\0\0f\0\0\0Pc\0\0Ld\0\0d\0\0\0\0\0\0\0ld\0\0g\0\0l\0\0i\0\0j\0\0m\0\0\xCCd\0\0xd\0\0b\0\0N10__cxxabiv116__enum_type_infoE\0\0\0\0\0\0\0\0Hb\0\0g\0\0n\0\0i\0\0j\0\0o\0\0p\0\0q\0\0r\0\0\0\0\0\0\xECd\0\0g\0\0s\0\0i\0\0j\0\0o\0\0t\0\0u\0\0v\0\0\xCCd\0\0\xF8d\0\0Hb\0\0N10__cxxabiv120__si_class_type_infoE\0\0\0\0\0\0\0\0He\0\0g\0\0w\0\0i\0\0j\0\0o\0\0x\0\0y\0\0z\0\0\xCCd\0\0Te\0\0Hb\0\0N10__cxxabiv121__vmi_class_type_infoE\0\0\0\0\0\0\0\xA8b\0\0g\0\0{\0\0i\0\0j\0\0|\0\0\xA4d\0\0\xA0e\0\0St9type_info\0A\xB1\xCB\v\b \0\0\0\0\0\0\0A\xC4\xCB\v1\0A\xDC\xCB\v2\0\0\x003\0\0\0\xF8g\0\0\0\0A\xF4\xCB\v\0A\x84\xCC\v\xFF\xFF\xFF\xFF
|
|
\0A\xC8\xCC\v!\xB8e\0\0@v\0%m/%d/%y\0\0\0\b%H:%M:%S\0\0\0\b\0A\xF4\xCC\ve\0A\x8C\xCD\v
|
|
2\0\0\0f\0\x004v\0A\xA4\xCD\v\0A\xB4\xCD\v\b\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0A\xF8\xCD\vhf`)),fe((await z(ne)).instance))})(),(function(){function fe(){var ne;if(o.calledRun=!0,!m){if(v=!0,sl.H(),A?.(o),(ne=o.onRuntimeInitialized)==null||ne.call(o),o.postRun)for(typeof o.postRun=="function"&&(o.postRun=[o.postRun]);o.postRun.length;){var xe=o.postRun.shift();B.push(xe)}j(B)}}if(o.preRun)for(typeof o.preRun=="function"&&(o.preRun=[o.preRun]);o.preRun.length;)W();j(G),o.setStatus?(o.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>o.setStatus(""),1),fe()},1)):fe()})(),v?r=o:r=new Promise((fe,ne)=>{A=fe,b=ne}),r}var uC=(e,t,n)=>{let i=e.vf32_ptr(t),r=t.size(),o=i>>2,a=e.HEAPF32.slice(o,o+r);if(n!==void 0)for(let s=0;s<r;s++)a[s]=n(a[s]);return a},m8e=e=>1/(1+Math.exp(-e)),p8e=e=>t=>t*e+.5,g8e=(e,t,n)=>{let i=n?.colorScaleFactor??.282;return{numPoints:t.numPoints,shDegree:t.shDegree,antialiased:t.antialiased,positions:uC(e,t.positions),scales:uC(e,t.scales,Math.exp),rotations:uC(e,t.rotations),alphas:uC(e,t.alphas,m8e),colors:uC(e,t.colors,p8e(i)),sh:uC(e,t.sh)}},_8e=(e,t)=>{e._free(e.vf32_ptr(t.positions)),e._free(e.vf32_ptr(t.scales)),e._free(e.vf32_ptr(t.rotations)),e._free(e.vf32_ptr(t.alphas)),e._free(e.vf32_ptr(t.colors)),e._free(e.vf32_ptr(t.sh))},ele=async(e,t)=>{var n;let i=await h8e(),r=e instanceof Uint8Array?e:new Uint8Array(e),o=null;try{if(o=i._malloc(Uint8Array.BYTES_PER_ELEMENT*r.length),o===null)throw new Error("couldn't allocate memory");i.HEAPU8.set(r,o/Uint8Array.BYTES_PER_ELEMENT);let a=i.CoordinateSystem[((n=t?.unpackOptions)==null?void 0:n.coordinateSystem)??"UNSPECIFIED"],s=i.load_spz(o,r.length,{coordinateSystem:a}),c=g8e(i,s,t);return _8e(i,s),c}catch(a){throw a}finally{o!==null&&i._free(o)}};var y8e=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var A8e=[0,9,24,45],b8e=14,x8e=1.6*1024*1024*1024;function T8e(e,t){let n=t?.attributes;if(!l(n))return;let i=n.POSITION;if(!l(i))return;let r=e?.accessors?.[i];if(!l(r)||r.count<=0)return;let o=0;for(let a in n)if(Object.prototype.hasOwnProperty.call(n,a)){let s=/SH_DEGREE_(\d+)_COEF_/.exec(a);s&&(o=Math.max(o,parseInt(s[1],10)))}return{numPoints:r.count,shDegree:o}}function C8e(e,t){let n=b8e+(A8e[t]??0);return e*n*Float32Array.BYTES_PER_ELEMENT*2}var lY=class extends er{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,r=t.primitive,o=t.spz,a=t.gltfResource,s=t.baseResource,c=t.cacheKey;this._resourceCache=n,this._gltfResource=a,this._baseResource=s,this._gltf=i,this._primitive=r,this._spz=o,this._cacheKey=c,this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodePromise=void 0,this._decodedData=void 0,this._state=At.UNLOADED,this._promise=void 0,this._spzError=void 0}get cacheKey(){return this._cacheKey}get decodedData(){return this._decodedData}async load(){return l(this._promise)?this._promise:(this._state=At.LOADING,this._promise=v8e(this),this._promise)}process(t){if(this._state===At.READY)return!0;if(this._state!==At.PROCESSING||(l(this._spzError)&&uY(this,this._spzError),!l(this._bufferViewTypedArray))||l(this._decodePromise))return!1;let n=T8e(this._gltf,this._primitive);if(l(n)){let r=C8e(n.numPoints,n.shDegree);if(r>x8e){let o=Math.round(r/1048576);return uY(this,new oe(`SPZ data too large to decode: ${n.numPoints.toLocaleString()} splats with spherical harmonics degree ${n.shDegree} would require approximately ${o} MB, which exceeds the WASM memory limit. Consider using a lower spherical harmonics degree or splitting the dataset into smaller tiles.`)),!1}}let i=ele(this._bufferViewTypedArray,{unpackOptions:{coordinateSystem:"UNSPECIFIED"}});if(!l(i))return!1;this._decodePromise=E8e(this,i)}unload(){l(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}};async function v8e(e){let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._spz.bufferView,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoader=n,await n.load(),e.isDestroyed()?void 0:(e._bufferViewTypedArray=n.typedArray,e._state=At.PROCESSING,e)}catch(n){if(e.isDestroyed())return;uY(e,n)}}function uY(e,t){throw e.unload(),e._state=At.FAILED,e.getError("Failed to load SPZ",t)}async function E8e(e,t){try{let n=await t;return e.isDestroyed()?void 0:(e.unload(),e._decodedData={gcloud:n},e._state=At.READY,e._baseResource)}catch(n){if(e.isDestroyed())return;e._spzError=n}}var ML=lY;function OI(e){e=e??H.EMPTY_OBJECT;let t=e.id,n=e.properties??{},i={};for(let r in n)if(n.hasOwnProperty(r)){let o=n[r];l(o.semantic)&&(i[o.semantic]=o)}this._id=t,this._name=e.name,this._description=e.description,this._properties=n,this._propertiesBySemantic=i,this._extras=Xe(e.extras,!0),this._extensions=Xe(e.extensions,!0)}OI.fromJson=function(e){e=e??H.EMPTY_OBJECT;let t=e.id,n=e.class,i={};for(let r in n.properties)if(n.properties.hasOwnProperty(r)){let o=A0.fromJson({id:r,property:n.properties[r],enums:e.enums});i[r]=o}return new OI({id:t,name:n.name,description:n.description,properties:i,extras:n.extras,extensions:n.extensions})};Object.defineProperties(OI.prototype,{properties:{get:function(){return this._properties}},propertiesBySemantic:{get:function(){return this._propertiesBySemantic}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});OI.BATCH_TABLE_CLASS_NAME="_batchTable";var Nm=OI;function LL(e){e=e??H.EMPTY_OBJECT;let t=e.value,n=e.name;this._value=t,this._name=n,this._description=e.description,this._extras=Xe(e.extras,!0),this._extensions=Xe(e.extensions,!0)}LL.fromJson=function(e){return new LL({value:e.value,name:e.name,description:e.description,extras:e.extras,extensions:e.extensions})};Object.defineProperties(LL.prototype,{value:{get:function(){return this._value}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var NL=LL;function FL(e){e=e??H.EMPTY_OBJECT;let t=e.id,n=e.values,i={},r={},o=n.length;for(let s=0;s<o;++s){let c=n[s];i[c.value]=c.name,r[c.name]=c.value}let a=e.valueType??Mt.UINT16;this._values=n,this._namesByValue=i,this._valuesByName=r,this._valueType=a,this._id=t,this._name=e.name,this._description=e.description,this._extras=Xe(e.extras,!0),this._extensions=Xe(e.extensions,!0)}FL.fromJson=function(e){e=e??H.EMPTY_OBJECT;let t=e.id,n=e.enum,i=n.values.map(function(r){return NL.fromJson(r)});return new FL({id:t,values:i,valueType:Mt[n.valueType],name:n.name,description:n.description,extras:n.extras,extensions:n.extensions})};Object.defineProperties(FL.prototype,{values:{get:function(){return this._values}},namesByValue:{get:function(){return this._namesByValue}},valuesByName:{get:function(){return this._valuesByName}},valueType:{get:function(){return this._valueType}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var BL=FL;function kL(e){e=e??H.EMPTY_OBJECT;let t=e.classes??{},n=e.enums??{};this._classes=t,this._enums=n,this._id=e.id,this._name=e.name,this._description=e.description,this._version=e.version,this._extras=Xe(e.extras,!0),this._extensions=Xe(e.extensions,!0)}kL.fromJson=function(e){let t={};if(l(e.enums))for(let i in e.enums)e.enums.hasOwnProperty(i)&&(t[i]=BL.fromJson({id:i,enum:e.enums[i]}));let n={};if(l(e.classes))for(let i in e.classes)e.classes.hasOwnProperty(i)&&(n[i]=Nm.fromJson({id:i,class:e.classes[i],enums:t}));return new kL({id:e.id,name:e.name,description:e.description,version:e.version,classes:n,enums:t,extras:e.extras,extensions:e.extensions})};Object.defineProperties(kL.prototype,{classes:{get:function(){return this._classes}},enums:{get:function(){return this._enums}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},version:{get:function(){return this._version}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var Zl=kL;var fY=class extends er{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.schema,i=t.resource,r=t.cacheKey;this._schema=l(n)?Zl.fromJson(n):void 0,this._resource=i,this._cacheKey=r,this._state=At.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get schema(){return this._schema}async load(){return l(this._promise)?this._promise:l(this._schema)?(this._promise=Promise.resolve(this),this._promise):(this._promise=S8e(this),this._promise)}unload(){this._schema=void 0}};async function S8e(e){let t=e._resource;e._state=At.LOADING;try{let n=await t.fetchJson();return e.isDestroyed()?void 0:(e._schema=Zl.fromJson(n),e._state=At.READY,e)}catch(n){if(e.isDestroyed())return;e._state=At.FAILED;let i=`Failed to load schema: ${t.url}`;throw e.getError(i,n)}}var tb=fY;var Wf={};function fC(e){return Jd(e.url)}function MI(e){let{byteOffset:t,byteLength:n}=e,i=XA(e);return l(i)&&(t=i.byteOffset??0,n=i.byteLength),`${t}-${t+n}`}function w8e(e,t){let n=t.byteOffset+e.byteOffset,{componentType:i,type:r,count:o}=e;return`${n}-${i}-${r}-${o}`}function tle(e,t){return`${fC(e)}-buffer-id-${t}`}function dC(e,t,n,i){if(l(e.uri)){let r=i.getDerivedResource({url:e.uri});return fC(r)}return tle(n,t)}function dY(e,t,n,i){let r=t.bufferView,o=e.bufferViews[r],a=o.buffer,s=e.buffers[a],c=dC(s,a,n,i),u=MI(o);return`${c}-range-${u}`}function nle(e,t,n,i){let r=t.bufferView,o=e.bufferViews[r],a=o.buffer,s=e.buffers[a],c=dC(s,a,n,i),u=MI(o);return`${c}-range-${u}`}function ile(e,t,n,i){let r=e.images[t],o=r.bufferView,a=r.uri;if(l(a)){let p=i.getDerivedResource({url:a});return fC(p)}let s=e.bufferViews[o],c=s.buffer,u=e.buffers[c],f=dC(u,c,n,i),d=MI(s);return`${f}-range-${d}`}function I8e(e,t){let n=Xu.createSampler({gltf:e,textureInfo:t});return`${n.wrapS}-${n.wrapT}-${n.minificationFilter}-${n.magnificationFilter}`}Wf.getSchemaCacheKey=function(e){let{schema:t,resource:n}=e;return l(t)?`embedded-schema:${JSON.stringify(t)}`:`external-schema:${fC(n)}`};Wf.getExternalBufferCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{resource:t}=e;return`external-buffer:${fC(t)}`};Wf.getEmbeddedBufferCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{parentResource:t,bufferId:n}=e;return`embedded-buffer:${tle(t,n)}`};Wf.getGltfCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltfResource:t}=e;return`gltf:${fC(t)}`};Wf.getBufferViewCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,bufferViewId:n,gltfResource:i,baseResource:r}=e,o=t.bufferViews[n],a=o.buffer,s=t.buffers[a],c=XA(o);l(c)&&(a=c.buffer);let u=dC(s,a,i,r),f=MI(o);return`buffer-view:${u}-range-${f}`};Wf.getDracoCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,draco:n,gltfResource:i,baseResource:r}=e;return`draco:${dY(t,n,i,r)}`};Wf.getSpzCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,spz:n,gltfResource:i,baseResource:r}=e;return`spz:${nle(t,n,i,r)}`};Wf.getVertexBufferCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,gltfResource:n,baseResource:i,frameState:r,bufferViewId:o,draco:a,spz:s,attributeSemantic:c,dequantize:u=!1,loadBuffer:f=!1,loadTypedArray:d=!1}=e,p="";if(u&&(p+="-dequantize"),f&&(p+="-buffer",p+=`-context-${r.context.id}`),d&&(p+="-typed-array"),l(s))return`vertex-buffer:${nle(t,s,n,i)}-spz-${c}${p}`;if(l(a))return`vertex-buffer:${dY(t,a,n,i)}-draco-${c}${p}`;let g=t.bufferViews[o],m=g.buffer,y=t.buffers[m],A=dC(y,m,n,i),b=MI(g);return`vertex-buffer:${A}-range-${b}${p}`};Wf.getIndexBufferCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,accessorId:n,gltfResource:i,baseResource:r,frameState:o,draco:a,loadBuffer:s=!1,loadTypedArray:c=!1}=e,u="";if(s&&(u+="-buffer",u+=`-context-${o.context.id}`),c&&(u+="-typed-array"),l(a))return`index-buffer:${dY(t,a,i,r)}-draco${u}`;let f=t.accessors[n],d=f.bufferView,p=t.bufferViews[d],g=p.buffer,m=t.buffers[g],y=dC(m,g,i,r),A=w8e(f,p);return`index-buffer:${y}-accessor-${A}${u}`};Wf.getImageCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,imageId:n,gltfResource:i,baseResource:r}=e;return`image:${ile(t,n,i,r)}`};Wf.getTextureCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,textureInfo:n,gltfResource:i,baseResource:r,supportedImageFormats:o,frameState:a}=e,s=n.index,c=Xu.getImageIdFromTexture({gltf:t,textureId:s,supportedImageFormats:o}),u=ile(t,c,i,r),f=I8e(t,n);return`texture:${u}-sampler-${f}-context-${a.context.id}`};var Ql=Wf;function LI(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}}LI.prototype.clear=function(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}};LI.prototype.addGeometryLoader=function(e){let t=e.cacheKey;if(this._geometrySizes.hasOwnProperty(t))return;this._geometrySizes[t]=0;let n=e.buffer,i=e.typedArray,r=0;l(n)&&(r+=n.sizeInBytes),l(i)&&(r+=i.byteLength),this.geometryByteLength+=r,this._geometrySizes[t]=r};LI.prototype.addTextureLoader=function(e){let t=e.cacheKey;if(this._textureSizes.hasOwnProperty(t))return;this._textureSizes[t]=0;let n=e.texture.sizeInBytes;this.texturesByteLength+=e.texture.sizeInBytes,this._textureSizes[t]=n};LI.prototype.removeLoader=function(e){let t=e.cacheKey,n=this._geometrySizes[t];delete this._geometrySizes[t],l(n)&&(this.geometryByteLength-=n);let i=this._textureSizes[t];delete this._textureSizes[t],l(i)&&(this.texturesByteLength-=i)};var zL=LI;function Nn(){}Nn.cacheEntries={};Nn.statistics=new zL;function P8e(e){this.referenceCount=1,this.resourceLoader=e,this._statisticsPromise=void 0}Nn.get=function(e){let t=Nn.cacheEntries[e];if(l(t))return++t.referenceCount,t.resourceLoader};Nn.add=function(e){let t=e.cacheKey;return Nn.cacheEntries[t]=new P8e(e),e};Nn.unload=function(e){let t=e.cacheKey,n=Nn.cacheEntries[t];--n.referenceCount,n.referenceCount===0&&(Nn.statistics.removeLoader(e),e.destroy(),delete Nn.cacheEntries[t])};Nn.getSchemaLoader=function(e){e=e??H.EMPTY_OBJECT;let{schema:t,resource:n}=e,i=Ql.getSchemaCacheKey({schema:t,resource:n}),r=Nn.get(i);return l(r)?r:(r=new tb({schema:t,resource:n,cacheKey:i}),Nn.add(r))};Nn.getEmbeddedBufferLoader=function(e){e=e??H.EMPTY_OBJECT;let{parentResource:t,bufferId:n,typedArray:i}=e,r=Ql.getEmbeddedBufferCacheKey({parentResource:t,bufferId:n}),o=Nn.get(r);return l(o)?o:(o=new tC({typedArray:i,cacheKey:r}),Nn.add(o))};Nn.getExternalBufferLoader=function(e){e=e??H.EMPTY_OBJECT;let{resource:t}=e,n=Ql.getExternalBufferCacheKey({resource:t}),i=Nn.get(n);return l(i)?i:(i=new tC({resource:t,cacheKey:n}),Nn.add(i))};Nn.getGltfJsonLoader=function(e){e=e??H.EMPTY_OBJECT;let{gltfResource:t,baseResource:n,typedArray:i,gltfJson:r}=e,o=Ql.getGltfCacheKey({gltfResource:t}),a=Nn.get(o);return l(a)?a:(a=new EI({resourceCache:Nn,gltfResource:t,baseResource:n,typedArray:i,gltfJson:r,cacheKey:o}),Nn.add(a))};Nn.getBufferViewLoader=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,bufferViewId:n,gltfResource:i,baseResource:r}=e,o=Ql.getBufferViewCacheKey({gltf:t,bufferViewId:n,gltfResource:i,baseResource:r}),a=Nn.get(o);return l(a)?a:(a=new AI({resourceCache:Nn,gltf:t,bufferViewId:n,gltfResource:i,baseResource:r,cacheKey:o}),Nn.add(a))};Nn.getDracoLoader=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,primitive:n,draco:i,gltfResource:r,baseResource:o}=e,a=Ql.getDracoCacheKey({gltf:t,draco:i,gltfResource:r,baseResource:o}),s=Nn.get(a);return l(s)?s:(s=new bI({resourceCache:Nn,gltf:t,primitive:n,draco:i,gltfResource:r,baseResource:o,cacheKey:a}),Nn.add(s))};Nn.getSpzLoader=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,primitive:n,spz:i,gltfResource:r,baseResource:o}=e,a=Ql.getSpzCacheKey({gltf:t,spz:i,gltfResource:r,baseResource:o}),s=Nn.get(a);return l(s)?s:(s=new ML({resourceCache:Nn,gltf:t,primitive:n,spz:i,gltfResource:r,baseResource:o,cacheKey:a}),Nn.add(s))};Nn.getVertexBufferLoader=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,gltfResource:n,baseResource:i,frameState:r,bufferViewId:o,primitive:a,draco:s,spz:c,attributeSemantic:u,accessorId:f,asynchronous:d=!0,dequantize:p=!1,loadBuffer:g=!1,loadTypedArray:m=!1}=e,y=Ql.getVertexBufferCacheKey({gltf:t,gltfResource:n,baseResource:i,frameState:r,bufferViewId:o,draco:s,spz:c,attributeSemantic:u,dequantize:p,loadBuffer:g,loadTypedArray:m}),A=Nn.get(y);return l(A)?A:(A=new RI({resourceCache:Nn,gltf:t,gltfResource:n,baseResource:i,bufferViewId:o,primitive:a,draco:s,spz:c,attributeSemantic:u,accessorId:f,cacheKey:y,asynchronous:d,dequantize:p,loadBuffer:g,loadTypedArray:m}),Nn.add(A))};Nn.getIndexBufferLoader=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,accessorId:n,gltfResource:i,baseResource:r,frameState:o,primitive:a,draco:s,asynchronous:c=!0,loadBuffer:u=!1,loadTypedArray:f=!1}=e,d=Ql.getIndexBufferCacheKey({gltf:t,accessorId:n,gltfResource:i,baseResource:r,frameState:o,draco:s,loadBuffer:u,loadTypedArray:f}),p=Nn.get(d);return l(p)?p:(p=new CI({resourceCache:Nn,gltf:t,accessorId:n,gltfResource:i,baseResource:r,primitive:a,draco:s,cacheKey:d,asynchronous:c,loadBuffer:u,loadTypedArray:f}),Nn.add(p))};Nn.getImageLoader=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,imageId:n,gltfResource:i,baseResource:r}=e,o=Ql.getImageCacheKey({gltf:t,imageId:n,gltfResource:i,baseResource:r}),a=Nn.get(o);return l(a)?a:(a=new TI({resourceCache:Nn,gltf:t,imageId:n,gltfResource:i,baseResource:r,cacheKey:o}),Nn.add(a))};Nn.getTextureLoader=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,textureInfo:n,gltfResource:i,baseResource:r,supportedImageFormats:o,frameState:a,asynchronous:s=!0}=e,c=Ql.getTextureCacheKey({gltf:t,textureInfo:n,gltfResource:i,baseResource:r,supportedImageFormats:o,frameState:a}),u=Nn.get(c);return l(u)?u:(u=new DI({resourceCache:Nn,gltf:t,textureInfo:n,gltfResource:i,baseResource:r,supportedImageFormats:o,cacheKey:c,asynchronous:s}),Nn.add(u))};Nn.clearForSpecs=function(){let e=[RI,CI,bI,DI,TI,AI,tC,tb,EI],t,n=Nn.cacheEntries,i=[];for(t in n)n.hasOwnProperty(t)&&i.push(n[t]);i.sort(function(o,a){let s=e.indexOf(o.resourceLoader.constructor),c=e.indexOf(a.resourceLoader.constructor);return s-c});let r=i.length;for(let o=0;o<r;++o){let a=i[o];t=a.resourceLoader.cacheKey,l(n[t])&&(a.resourceLoader.destroy(),delete n[t])}Nn.statistics.clear()};var Ni=Nn;function Ys(e,t,n){this._resource=e,this._subtreeJson=void 0,this._bufferLoader=void 0,this._tileAvailability=void 0,this._contentAvailabilityBitstreams=[],this._childSubtreeAvailability=void 0,this._implicitCoordinates=n,this._subtreeLevels=t.subtreeLevels,this._subdivisionScheme=t.subdivisionScheme,this._branchingFactor=t.branchingFactor,this._metadata=void 0,this._tileMetadataTable=void 0,this._tilePropertyTableJson=void 0,this._contentMetadataTables=[],this._contentPropertyTableJsons=[],this._tileJumpBuffer=void 0,this._contentJumpBuffers=[],this._ready=!1}Object.defineProperties(Ys.prototype,{ready:{get:function(){return this._ready}},metadata:{get:function(){return this._metadata}},tileMetadataTable:{get:function(){return this._tileMetadataTable}},tilePropertyTableJson:{get:function(){return this._tilePropertyTableJson}},contentMetadataTables:{get:function(){return this._contentMetadataTables}},contentPropertyTableJsons:{get:function(){return this._contentPropertyTableJsons}},implicitCoordinates:{get:function(){return this._implicitCoordinates}}});Ys.prototype.tileIsAvailableAtIndex=function(e){return this._tileAvailability.getBit(e)};Ys.prototype.tileIsAvailableAtCoordinates=function(e){let t=this.getTileIndex(e);return this.tileIsAvailableAtIndex(t)};Ys.prototype.contentIsAvailableAtIndex=function(e,t){return t=t??0,this._contentAvailabilityBitstreams[t].getBit(e)};Ys.prototype.contentIsAvailableAtCoordinates=function(e,t){let n=this.getTileIndex(e);return this.contentIsAvailableAtIndex(n,t)};Ys.prototype.childSubtreeIsAvailableAtIndex=function(e){return this._childSubtreeAvailability.getBit(e)};Ys.prototype.childSubtreeIsAvailableAtCoordinates=function(e){let t=this.getChildSubtreeIndex(e);return this.childSubtreeIsAvailableAtIndex(t)};Ys.prototype.getLevelOffset=function(e){let t=this._branchingFactor;return(Math.pow(t,e)-1)/(t-1)};Ys.prototype.getParentMortonIndex=function(e){let t=2;return this._subdivisionScheme===ka.OCTREE&&(t=3),e>>t};Ys.fromSubtreeJson=async function(e,t,n,i,r){let o=new Ys(e,i,r),a;l(t)?a={json:t,binary:void 0}:a=D8e(n);let s=a.json;o._subtreeJson=s;let c;if(Qi(s,"3DTILES_metadata"))c=s.extensions["3DTILES_metadata"];else if(l(s.tileMetadata)){let x=s.tileMetadata;c=s.propertyTables[x]}let u=[];if(l(s.contentMetadata)){let x=s.contentMetadata.length;for(let T=0;T<x;T++){let C=s.contentMetadata[T];u.push(s.propertyTables[C])}}let f,d=i.metadataSchema,p=s.subtreeMetadata;if(l(p)){let x=p.class,T=d.classes[x];f=new oL({subtreeMetadata:p,class:T})}o._metadata=f,o._tilePropertyTableJson=c,o._contentPropertyTableJsons=u;let g={constant:0};s.contentAvailabilityHeaders=[],Qi(s,"3DTILES_multiple_contents")?s.contentAvailabilityHeaders=s.extensions["3DTILES_multiple_contents"].contentAvailability:Array.isArray(s.contentAvailability)?s.contentAvailabilityHeaders=s.contentAvailability:s.contentAvailabilityHeaders.push(s.contentAvailability??g);let m=R8e(s.buffers),y=O8e(s.bufferViews,m);M8e(s,y),l(c)&&rle(c,y);for(let x=0;x<u.length;x++){let T=u[x];rle(T,y)}let A=await L8e(o,m,a.binary),b=F8e(y,A);return B8e(o,s,i,b),l(c)&&(k8e(o,i,b),U8e(o)),z8e(o,i,b),V8e(o),o._ready=!0,o};function D8e(e){let n=new DataView(e.buffer,e.byteOffset),i=8,r=n.getUint32(i,!0);i+=8;let o=n.getUint32(i,!0);i+=8;let a=wo(e,i,r);i+=r;let s=e.subarray(i,i+o);return{json:a,binary:s}}function R8e(e){e=l(e)?e:[];for(let t=0;t<e.length;t++){let n=e[t];n.isExternal=l(n.uri),n.isActive=!1}return e}function O8e(e,t){e=l(e)?e:[];for(let n=0;n<e.length;n++){let i=e[n],r=t[i.buffer];i.bufferHeader=r,i.isActive=!1}return e}function M8e(e,t){let n,i=e.tileAvailability;l(i.bitstream)?n=t[i.bitstream]:l(i.bufferView)&&(n=t[i.bufferView]),l(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0);let r=e.contentAvailabilityHeaders;for(let a=0;a<r.length;a++)n=void 0,l(r[a].bitstream)?n=t[r[a].bitstream]:l(r[a].bufferView)&&(n=t[r[a].bufferView]),l(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0);n=void 0;let o=e.childSubtreeAvailability;l(o.bitstream)?n=t[o.bitstream]:l(o.bufferView)&&(n=t[o.bufferView]),l(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0)}function rle(e,t){let n=e.properties,i;for(let r in n)if(n.hasOwnProperty(r)){let o=n[r],a=o.values??o.bufferView;i=t[a],i.isActive=!0,i.bufferHeader.isActive=!0;let s=o.stringOffsets??o.stringOffsetBufferView;l(s)&&(i=t[s],i.isActive=!0,i.bufferHeader.isActive=!0);let c=o.arrayOffsets??o.arrayOffsetBufferView;l(c)&&(i=t[c],i.isActive=!0,i.bufferHeader.isActive=!0)}}function L8e(e,t,n){let i=[];for(let r=0;r<t.length;r++){let o=t[r];if(!o.isActive)i.push(Promise.resolve(void 0));else if(o.isExternal){let a=N8e(e,o);i.push(a)}else i.push(Promise.resolve(n))}return Promise.all(i).then(function(r){let o={};for(let a=0;a<r.length;a++){let s=r[a];l(s)&&(o[a]=s)}return o})}async function N8e(e,t){let i=e._resource.getDerivedResource({url:t.uri}),r=Ni.getExternalBufferLoader({resource:i});e._bufferLoader=r;try{await r.load()}catch(o){if(r.isDestroyed())return;throw o}return r.typedArray}function F8e(e,t){let n={};for(let i=0;i<e.length;i++){let r=e[i];if(!r.isActive)continue;let o=r.byteOffset,a=o+r.byteLength,c=t[r.buffer].subarray(o,a);n[i]=c}return n}function B8e(e,t,n,i){let r=n.branchingFactor,o=n.subtreeLevels,a=(Math.pow(r,o)-1)/(r-1),s=Math.pow(r,o),c=Qi(t,"3DTILES_metadata"),u=l(e._tilePropertyTableJson),f=c||u;e._tileAvailability=hY(t.tileAvailability,i,a,f);let d=e._contentPropertyTableJsons.length>0;f=f||d;for(let p=0;p<t.contentAvailabilityHeaders.length;p++){let g=hY(t.contentAvailabilityHeaders[p],i,a,f);e._contentAvailabilityBitstreams.push(g)}e._childSubtreeAvailability=hY(t.childSubtreeAvailability,i,s)}function hY(e,t,n,i){if(l(e.constant))return new mI({constant:!!e.constant,lengthBits:n,availableCount:e.availableCount});let r;return l(e.bitstream)?r=t[e.bitstream]:l(e.bufferView)&&(r=t[e.bufferView]),new mI({bitstream:r,lengthBits:n,availableCount:e.availableCount,computeAvailableCountEnabled:i})}function k8e(e,t,n){let i=e._tilePropertyTableJson,r=e._tileAvailability.availableCount,o=t.metadataSchema,a=i.class,s=o.classes[a];e._tileMetadataTable=new oh({class:s,count:r,properties:i.properties,bufferViews:n})}function z8e(e,t,n){let i=e._contentPropertyTableJsons,r=e._contentAvailabilityBitstreams,o=t.metadataSchema,a=e._contentMetadataTables;for(let s=0;s<i.length;s++){let c=i[s],f=r[s].availableCount,d=c.class,p=o.classes[d],g=new oh({class:p,count:f,properties:c.properties,bufferViews:n});a.push(g)}}function ole(e){let t=0,n=e.lengthBits,i=e.availableCount,r;i<256?r=new Uint8Array(n):i<65536?r=new Uint16Array(n):r=new Uint32Array(n);for(let o=0;o<e.lengthBits;o++)e.getBit(o)&&(r[o]=t,t++);return r}function U8e(e){let t=ole(e._tileAvailability);e._tileJumpBuffer=t}function V8e(e){let t=e._contentJumpBuffers,n=e._contentAvailabilityBitstreams;for(let i=0;i<n.length;i++){let r=n[i],o=ole(r);t.push(o)}}Ys.prototype.getTileIndex=function(e){let t=e.level-this._implicitCoordinates.level;if(t<0||this._subtreeLevels<=t)throw new oe("level is out of bounds for this subtree");return e.getSubtreeCoordinates().getOffsetCoordinates(e).tileIndex};Ys.prototype.getChildSubtreeIndex=function(e){if(e.level-this._implicitCoordinates.level!==this._implicitCoordinates.subtreeLevels)throw new oe("level is out of bounds for this subtree");return e.getParentSubtreeCoordinates().getOffsetCoordinates(e).mortonIndex};function j8e(e,t){if(!l(e._tileMetadataTable))return;let n=e.getTileIndex(t);if(e._tileAvailability.getBit(n))return e._tileJumpBuffer[n]}function H8e(e,t,n){let i=e._contentMetadataTables;if(!l(i))return;let r=i[n];if(!l(r))return;let o=e._contentAvailabilityBitstreams[n],a=e.getTileIndex(t);if(o.getBit(a))return e._contentJumpBuffers[n][a]}Ys.prototype.getTileMetadataView=function(e){let t=j8e(this,e);if(!l(t))return;let n=this._tileMetadataTable;return new pI({class:n.class,metadataTable:n,entityId:t,propertyTableJson:this._tilePropertyTableJson})};Ys.prototype.getContentMetadataView=function(e,t){let n=H8e(this,e,t);if(!l(n))return;let i=this._contentMetadataTables[t],r=this._contentPropertyTableJsons[t];return new pI({class:i.class,metadataTable:i,entityId:n,contentIndex:t,propertyTableJson:r})};Ys.prototype.isDestroyed=function(){return!1};Ys.prototype.destroy=function(){return l(this._bufferLoader)&&Ni.unload(this._bufferLoader),ue(this)};var y_=Ys;var NI={};function ale(e){return e=(e^e<<8)&16711935,e=(e^e<<4)&252645135,e=(e^e<<2)&858993459,e=(e^e<<1)&1431655765,e}function mY(e){return e=(e^e<<16)&50331903,e=(e^e<<8)&50393103,e=(e^e<<4)&51130563,e=(e^e<<2)&153391689,e}function sle(e){return e&=1431655765,e=(e^e>>1)&858993459,e=(e^e>>2)&252645135,e=(e^e>>4)&16711935,e=(e^e>>8)&65535,e}function pY(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}NI.encode2D=function(e,t){return(ale(e)|ale(t)<<1)>>>0};NI.decode2D=function(e,t){return l(t)||(t=new Array(2)),t[0]=sle(e),t[1]=sle(e>>1),t};NI.encode3D=function(e,t,n){return mY(e)|mY(t)<<1|mY(n)<<2};NI.decode3D=function(e,t){return l(t)||(t=new Array(3)),t[0]=pY(e),t[1]=pY(e>>1),t[2]=pY(e>>2),t};var nb=NI;function ro(e){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===ka.OCTREE&&(this.z=e.z)}Object.defineProperties(ro.prototype,{childIndex:{get:function(){let e=0;return e|=this.x&1,e|=(this.y&1)<<1,this.subdivisionScheme===ka.OCTREE&&(e|=(this.z&1)<<2),e}},mortonIndex:{get:function(){return this.subdivisionScheme===ka.OCTREE?nb.encode3D(this.x,this.y,this.z):nb.encode2D(this.x,this.y)}},tileIndex:{get:function(){let e=this.subdivisionScheme===ka.OCTREE?((1<<3*this.level)-1)/7:((1<<2*this.level)-1)/3,t=this.mortonIndex;return e+t}}});ro.prototype.getDescendantCoordinates=function(e){let t=this.level+e.level,n=(this.x<<e.level)+e.x,i=(this.y<<e.level)+e.y;if(this.subdivisionScheme===ka.OCTREE){let r=(this.z<<e.level)+e.z;return new ro({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:r})}return new ro({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};ro.prototype.getAncestorCoordinates=function(e){let t=1<<e,n=this.level-e,i=Math.floor(this.x/t),r=Math.floor(this.y/t);if(this.subdivisionScheme===ka.OCTREE){let o=Math.floor(this.z/t);return new ro({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:r,z:o})}return new ro({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:r})};ro.prototype.getOffsetCoordinates=function(e){let t=e.level-this.level,n=1<<t,i=e.x%n,r=e.y%n;if(this.subdivisionScheme===ka.OCTREE){let o=e.z%n;return new ro({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:r,z:o})}return new ro({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:r})};ro.prototype.getChildCoordinates=function(e){let t=this.level+1,n=2*this.x+e%2,i=2*this.y+Math.floor(e/2)%2;if(this.subdivisionScheme===ka.OCTREE){let r=2*this.z+Math.floor(e/4)%2;return new ro({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:r})}return new ro({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};ro.prototype.getSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels)};ro.prototype.getParentSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels+this.subtreeLevels)};ro.prototype.isAncestor=function(e){let t=e.level-this.level;if(t<=0)return!1;let n=e.x>>t,i=e.y>>t,r=this.x===n,o=this.y===i;if(this.subdivisionScheme===ka.OCTREE){let a=e.z>>t,s=this.z===a;return r&&o&&s}return r&&o};ro.prototype.isEqual=function(e){return this.subdivisionScheme===e.subdivisionScheme&&this.subtreeLevels===e.subtreeLevels&&this.level===e.level&&this.x===e.x&&this.y===e.y&&(this.subdivisionScheme===ka.OCTREE?this.z===e.z:!0)};ro.prototype.isImplicitTilesetRoot=function(){return this.level===0};ro.prototype.isSubtreeRoot=function(){return this.level%this.subtreeLevels===0};ro.prototype.isBottomOfSubtree=function(){return this.level%this.subtreeLevels===this.subtreeLevels-1};ro.prototype.getTemplateValues=function(){let e={level:this.level,x:this.x,y:this.y};return this.subdivisionScheme===ka.OCTREE&&(e.z=this.z),e};var cle=[0,0,0];ro.fromMortonIndex=function(e,t,n,i){let r;return e===ka.OCTREE?(r=nb.decode3D(i,cle),new ro({subdivisionScheme:e,subtreeLevels:t,level:n,x:r[0],y:r[1],z:r[2]})):(r=nb.decode2D(i,cle),new ro({subdivisionScheme:e,subtreeLevels:t,level:n,x:r[0],y:r[1]}))};ro.fromTileIndex=function(e,t,n){let i,r,o;return e===ka.OCTREE?(i=Math.floor(I.log2(7*n+1)/3),r=((1<<3*i)-1)/7,o=n-r):(i=Math.floor(I.log2(3*n+1)/2),r=((1<<2*i)-1)/3,o=n-r),ro.fromMortonIndex(e,t,i,o)};var v0=ro;var _Y=La(Uu(),1);var gY,lle="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJkYjZkM2MyOS1mODRiLTRlMGQtYTYzMy0xNWYyYmNiZjE1NGUiLCJpZCI6MjU5LCJzdWIiOiJDZXNpdW1KUyIsImlzcyI6Imh0dHBzOi8vYXBpLmNlc2l1bS5jb20iLCJhdWQiOiIxLjE0NCBSZWxlYXNlIC0gRGVsZXRlIG9uIE9jdG9iZXIgMSwgMjAyNiIsImlhdCI6MTc4NDk1ODg5MH0.x3Ra1-m0GEx7jwv8wnz-bAt4SSG3_ZCC9zU_MwzfjA4",UL={};UL.defaultAccessToken=lle;UL.defaultServer=new De({url:"https://api.cesium.com/"});UL.getDefaultTokenCredit=function(e){if(e===lle){if(!l(gY)){let t=`<b> This application is using Cesium's default ion access token. Please assign <i>Cesium.Ion.defaultAccessToken</i> with an access token from your ion account before making any Cesium API calls. You can sign up for a free ion account at <a href="https://cesium.com">https://cesium.com</a>.</b>`;gY=new wt(t,!0)}return gY}};var Fm=UL;function ml(e,t){let n,i=e.externalType,r=l(i);if(!r)n={url:e.url,retryAttempts:1,retryCallback:G8e};else if(i==="3DTILES"||i==="STK_TERRAIN_SERVER")n={url:e.options.url};else throw new oe("Ion.createResource does not support external imagery assets; use IonImageryProvider instead.");De.call(this,n),this._ionEndpoint=e,this._ionEndpointDomain=r?void 0:new _Y.default(e.url).authority(),this._ionEndpointResource=t,this._ionRoot=void 0,this._pendingPromise=void 0,this._credits=void 0,this._isExternal=r,this.refreshCallback=void 0}l(Object.create)&&(ml.prototype=Object.create(De.prototype),ml.prototype.constructor=ml);ml.fromAssetId=function(e,t){let n=ml._createEndpointResource(e,t);return n.fetchJson().then(function(i){return new ml(i,n)})};Object.defineProperties(ml.prototype,{credits:{get:function(){return l(this._ionRoot)?this._ionRoot.credits:l(this._credits)?this._credits:(this._credits=ml.getCreditsFromEndpoint(this._ionEndpoint,this._ionEndpointResource),this._credits)}}});ml.getCreditsFromEndpoint=function(e,t){let n=e.attributions.map(wt.getIonCredit),i=Fm.getDefaultTokenCredit(t.queryParameters.access_token);return l(i)&&n.push(wt.clone(i)),n};ml.prototype.clone=function(e){let t=this._ionRoot??this;return l(e)||(e=new ml(t._ionEndpoint,t._ionEndpointResource)),e=De.prototype.clone.call(this,e),e._ionRoot=t,e._isExternal=this._isExternal,e};ml.prototype.fetchImage=function(e){if(!this._isExternal){let t=e;e={preferBlob:!0},l(t)&&(e.flipY=t.flipY,e.preferImageBitmap=t.preferImageBitmap)}return De.prototype.fetchImage.call(this,e)};ml.prototype._makeRequest=function(e){return this._isExternal||new _Y.default(this.url).authority()!==this._ionEndpointDomain?De.prototype._makeRequest.call(this,e):(e.headers=ule(e.headers),e.headers.Authorization=`Bearer ${this._ionEndpoint.accessToken}`,De.prototype._makeRequest.call(this,e))};ml._createEndpointResource=function(e,t){t=t??H.EMPTY_OBJECT;let n=t.server??Fm.defaultServer,i=t.accessToken??Fm.defaultAccessToken;n=De.createIfNeeded(n);let r={url:`v1/assets/${e}/endpoint`};return l(i)&&(r.queryParameters={access_token:i}),l(t.queryParameters)&&(r.queryParameters={...r.queryParameters,...t.queryParameters}),r.headers=ule(r.headers),n.getDerivedResource(r)};function ule(e={}){return e["X-Cesium-Client"]="CesiumJS",typeof CESIUM_VERSION<"u"&&(e["X-Cesium-Client-Version"]=CESIUM_VERSION),e}function G8e(e,t){let n=e._ionRoot??e,i=n._ionEndpointResource,r=typeof Image<"u";return!l(t)||t.statusCode!==401&&!(r&&t.target instanceof Image)?Promise.resolve(!1):(l(n._pendingPromise)||(n._pendingPromise=i.fetchJson().then(function(o){let a=e.refreshCallback??n.refreshCallback;return l(a)&&a(n,o),n._ionEndpoint=o,n._ionEndpoint}).finally(function(o){return n._pendingPromise=void 0,o})),n._pendingPromise.then(function(o){return e._ionEndpoint=o,!0}))}var ga=ml;function W8e(e,t,n){let i=Qi(t,"3DTILES_implicit_tiling")?t.extensions["3DTILES_implicit_tiling"]:t.implicitTiling;this.baseResource=e,this.geometricError=t.geometricError,this.metadataSchema=n;let r=t.boundingVolume;if(!l(r.box)&&!l(r.region)&&!Qi(r,"3DTILES_bounding_volume_S2")&&!Qi(r,"3DTILES_bounding_volume_cylinder"))throw new oe("Only box, region, 3DTILES_bounding_volume_S2, and 3DTILES_bounding_volume_cylinder are supported for implicit tiling");this.boundingVolume=r,this.refine=t.refine,this.subtreeUriTemplate=new De({url:i.subtrees.uri}),this.contentUriTemplates=[],this.contentHeaders=[];let o=q8e(t);for(let a=0;a<o.length;a++){let s=o[a];this.contentHeaders.push(Xe(s,!0));let c=new De({url:s.uri});this.contentUriTemplates.push(c)}this.contentCount=this.contentHeaders.length,this.tileHeader=Y8e(t),this.subdivisionScheme=ka[i.subdivisionScheme],this.branchingFactor=ka.getBranchingFactor(this.subdivisionScheme),this.subtreeLevels=i.subtreeLevels,l(i.availableLevels)?this.availableLevels=i.availableLevels:this.availableLevels=i.maximumLevel+1}function q8e(e){if(Qi(e,"3DTILES_multiple_contents")){let t=e.extensions["3DTILES_multiple_contents"];return l(t.contents)?t.contents:t.content}return l(e.contents)?e.contents:l(e.content)?[e.content]:[]}function Y8e(e){let t=Xe(e,!0);return l(t.extensions)&&(delete t.extensions["3DTILES_implicit_tiling"],delete t.extensions["3DTILES_multiple_contents"],Object.keys(t.extensions).length===0&&delete t.extensions),delete t.implicitTiling,delete t.contents,delete t.content,t}var E0=W8e;var fle={ID:"ID",NAME:"NAME",DESCRIPTION:"DESCRIPTION",TILESET_TILE_COUNT:"TILESET_TILE_COUNT",TILE_BOUNDING_BOX:"TILE_BOUNDING_BOX",TILE_BOUNDING_REGION:"TILE_BOUNDING_REGION",TILE_BOUNDING_SPHERE:"TILE_BOUNDING_SPHERE",TILE_MINIMUM_HEIGHT:"TILE_MINIMUM_HEIGHT",TILE_MAXIMUM_HEIGHT:"TILE_MAXIMUM_HEIGHT",TILE_HORIZON_OCCLUSION_POINT:"TILE_HORIZON_OCCLUSION_POINT",TILE_GEOMETRIC_ERROR:"TILE_GEOMETRIC_ERROR",CONTENT_BOUNDING_BOX:"CONTENT_BOUNDING_BOX",CONTENT_BOUNDING_REGION:"CONTENT_BOUNDING_REGION",CONTENT_BOUNDING_SPHERE:"CONTENT_BOUNDING_SPHERE",CONTENT_MINIMUM_HEIGHT:"CONTENT_MINIMUM_HEIGHT",CONTENT_MAXIMUM_HEIGHT:"CONTENT_MAXIMUM_HEIGHT",CONTENT_HORIZON_OCCLUSION_POINT:"CONTENT_HORIZON_OCCLUSION_POINT"};Object.freeze(fle);var ch=fle;function Bm(e){e=e??H.EMPTY_OBJECT;let t=e.credit;typeof t=="string"&&(t=new wt(t)),this._credit=t,this._tileCredits=void 0,this._errorEvent=new be,this._ellipsoid=e.ellipsoid??te.WGS84,this._tilingScheme=new $i({ellipsoid:this._ellipsoid}),this._subtreeCache=new ib({provider:this}),this._tileset0=void 0,this._tileset1=void 0,this._resource=void 0,this._requestVertexNormals=e.requestVertexNormals??!1,this._requestWaterMask=e.requestWaterMask??!1}Bm.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT,e=await Promise.resolve(e);let n=De.createIfNeeded(e),i;try{i=await n.fetchJson()}catch(f){throw new oe("Could not load tileset JSON",f)}let r=new Bm(t);r._tileCredits=n.credits,r._resource=n;let o=i.root.children,a=o[0],s=o[1],c=i.schema,u=Zl.fromJson(c);return r._tileset0=new E0(n,a,u),r._tileset1=new E0(n,s,u),r};Bm.fromIonAssetId=async function(e,t){let n=await ga.fromAssetId(e);return Bm.fromUrl(n,t)};var X8e=new Array(3);Bm.prototype.requestTileGeometry=async function(e,t,n,i){let r=hle(n,e),o=r===0?this._tileset0:this._tileset1,a=mle(o,n,e,t),s=a.getSubtreeCoordinates(),c=this._subtreeCache,u=c.find(r,s),f=this._requestWaterMask,d=this,p;if(u===void 0){let x=o.subtreeUriTemplate.getDerivedResource({templateValues:s.getTemplateValues()});p=o.baseResource.getDerivedResource({url:x.url}).fetchArrayBuffer().then(async function(C){if(u=c.find(r,s),u===void 0){let E=new Uint8Array(C);u=await y_.fromSubtreeJson(d._resource,void 0,E,o,s),c.addSubtree(r,u)}return u})}else p=Promise.resolve(u);let g=o.contentUriTemplates[0].getDerivedResource({templateValues:a.getTemplateValues()}),m=o.baseResource.getDerivedResource({url:g.url}),y=m.fetchArrayBuffer();if(y===void 0)return;let A=y.then(x=>rC(new Uint8Array(x))),b=X8e;b[0]=p,b[1]=A,b[2]=f?A.then(x=>K8e(x,m)):void 0;try{let x=await Promise.all(b),T=x[0],C=x[1],E=x[2],w=T.getTileMetadataView(a),D=w.getPropertyBySemantic(ch.TILE_MINIMUM_HEIGHT),R=w.getPropertyBySemantic(ch.TILE_MAXIMUM_HEIGHT),M=w.getPropertyBySemantic(ch.TILE_BOUNDING_SPHERE),N=se.unpack(M,0,new se),_=w.getPropertyBySemantic(ch.TILE_HORIZON_OCCLUSION_POINT),S=d._tilingScheme.tileXYToRectangle(e,t,n,new ie),P=d._ellipsoid,L=Jt.fromRectangle(S,D,R,P,new Jt),F=d.getLevelMaximumGeometricError(n)*5,V=VL(o,T,a,0,0),z=VL(o,T,a,1,0),j=VL(o,T,a,0,1),B=VL(o,T,a,1,1),G=(V?1:0)|(z?2:0)|(j?4:0)|(B?8:0),W=new iL({gltf:C,minimumHeight:D,maximumHeight:R,boundingSphere:N,orientedBoundingBox:L,horizonOcclusionPoint:_,skirtHeight:F,requestVertexNormals:d._requestVertexNormals,childTileMask:G,credits:d._tileCredits,waterMask:E});return Promise.resolve(W)}catch(x){console.log(`Could not load subtree: ${r} ${s.level} ${s.x} ${s.y}: ${x}`),console.log(`Could not load tile: ${r} ${a.level} ${a.x} ${a.y}: ${x}`);return}};Bm.prototype.getTileDataAvailable=function(e,t,n){let i=this._subtreeCache,r=hle(n,e),o=r===0?this._tileset0:this._tileset1,a=mle(o,n,e,t),s=a.getSubtreeCoordinates(),c=i.find(r,s);if(c!==void 0)return c.tileIsAvailableAtCoordinates(a);if(s.isImplicitTilesetRoot())return a.isSubtreeRoot()?!0:void 0;let u=s.getParentSubtreeCoordinates(),f=i.find(r,u);if(f!==void 0)return f.childSubtreeIsAvailableAtCoordinates(s)?a.isSubtreeRoot()?!0:void 0:!1};function hle(e,t){let n=1<<e;return t/n|0}function mle(e,t,n,i){let r=1<<t,o=t,a=n%r,s=r-i-1,{subdivisionScheme:c,subtreeLevels:u}=e;return new v0({subdivisionScheme:c,subtreeLevels:u,level:o,x:a,y:s})}async function K8e(e,t){let n=e.extensions?.EXT_structural_metadata;if(!l(n)||!l(n.propertyTextures))return;let i=new tb({schema:n.schema});await i.load();let r=i.schema,o,a;if(l(r.classes)){for(let g in r.classes)if(r.classes.hasOwnProperty(g)&&(o=r.classes[g],a=o.propertiesBySemantic.WATERMASK,l(a)))break}if(!l(a))return;let s=n.propertyTextures.find(g=>g.class===o.id);if(!l(s))throw new pe(`Expected a propertyTexture with a class ${o.id}`);let c=s.properties[a.id],u=e.textures[c.index],f=e.images[u.source]?.bufferView,d=Ni.getBufferViewLoader({gltf:e,bufferViewId:f,gltfResource:t,baseResource:t});return await d.load(),await m_({uint8Array:new Uint8Array(d.typedArray),format:"image/png",flipY:!1,skipColorSpaceConversion:!0})}function VL(e,t,n,i,r){let o=n.isBottomOfSubtree(),s=yY(e,1,i,r),c=n.getDescendantCoordinates(s);return o?t.childSubtreeIsAvailableAtCoordinates(c):t.tileIsAvailableAtCoordinates(c)}function yY(e,t,n,i){let{subdivisionScheme:r,subtreeLevels:o}=e;return new v0({subdivisionScheme:r,subtreeLevels:o,level:t,x:n,y:i})}Bm.prototype.loadTileDataAvailability=function(e,t,n){};Bm.prototype.getLevelMaximumGeometricError=function(e){let t=this._ellipsoid;return Vr.getEstimatedLevelZeroGeometricErrorForAHeightmap(t,64,2)/(1<<e)};Object.defineProperties(Bm.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return this._requestWaterMask}},hasVertexNormals:{get:function(){return this._requestVertexNormals}},availability:{get:function(){return this._subtreeCache}}});function $8e(e,t,n){this.rootId=e,this.subtree=t,this.stamp=n}function ib(e){this._maximumSubtreeCount=e.maximumSubtreeCount??0,this._subtreeRequestCounter=0,this._queue=new f_({comparator:ib.comparator}),this._provider=e.provider}ib.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};ib.prototype.addSubtree=function(e,t){let n=new $8e(e,t,this._subtreeRequestCounter);this._queue.insert(n),this._subtreeRequestCounter++;let i=t.implicitCoordinates;if(i.level>0){let r=i.getParentSubtreeCoordinates(),o=this.find(e,r)}if(this._maximumSubtreeCount>0)for(;this._queue.length>this._maximumSubtreeCount&&this._queue.getMinimum()!==n;)this._queue.removeMinimum()};ib.prototype.find=function(e,t){let n=this._queue,i=n.internalArray,{level:r,x:o,y:a}=t;for(let s=0;s<n.length;s++){let c=i[s],u=c.rootId,f=c.subtree.implicitCoordinates;if(u===e&&f.level===r&&f.x===o&&f.y===a)return c.subtree}};ib.prototype._computeMaximumImplicitTileCoordinatesAtPosition=function(e){let{longitude:t,latitude:n}=e,i=this._provider,r=t<0?0:1,o=r===0?i._tileset0:i._tileset1,a=o.subtreeLevels,s=yY(o,0,0,0),c=this.find(r,s);if(c===void 0)return;let u=c.implicitCoordinates,f=u.x,d=u.y,p=u.level,g=-I.PI,m=+I.PI,y=I.lerp(g,m,r/2),A=I.lerp(g,m,(r+1)/2),b=-I.PI*.5,x=+I.PI*.5,T=0,C=0,E=!0;for(;E;){let D=1/(1<<p),R=(A-y)*D,M=y+f*R,N=(x-b)*D,_=b+d*N;T=(t-M)/R,C=(n-_)/N;let v=dle(o,u,T,C,a);if(c.childSubtreeIsAvailableAtCoordinates(v)){let S=this.find(r,v);if(S!==void 0)c=S,u=c.implicitCoordinates,f=u.x,d=u.y,p=u.level;else return v}else E=!1}let w;for(let D=0;D<a;D++){let R=dle(o,u,T,C,D);if(c.tileIsAvailableAtCoordinates(R))w=R;else break}return w};function dle(e,t,n,i,r){let o=1<<r,a=I.clamp(n*o|0,0,o-1),s=I.clamp(i*o|0,0,o-1),c=yY(e,r,a,s);return t.getDescendantCoordinates(c)}ib.prototype.computeMaximumLevelAtPosition=function(e){let t=this._computeMaximumImplicitTileCoordinatesAtPosition(e);return t===void 0?0:t.level};var ple=Bm;function A_(e){e=e??H.EMPTY_OBJECT,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 r(a,s){return i[a]-i[s]}function o(a,s){return n[a]-n[s]}this._westIndices=HL(e.westIndices,r,t),this._southIndices=HL(e.southIndices,o,t),this._eastIndices=HL(e.eastIndices,r,t),this._northIndices=HL(e.northIndices,o,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(A_.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}},canUpsample:{get:function(){return l(this._mesh)}}});var jL=[];function HL(e,t,n){jL.length=e.length;let i=!1;for(let r=0,o=e.length;r<o;++r)jL[r]=e[r],i=i||r>0&&t(e[r-1],e[r])>0;return i?(jL.sort(t),Ve.createTypedArray(n,jL)):e}var gle="createVerticesFromQuantizedTerrainMesh",J8e=new Yn(gle),Z8e=new Yn(gle,Hu.maximumAsynchronousTasks);A_.prototype.createMesh=function(e){e=e??H.EMPTY_OBJECT;let t=e.tilingScheme,n=e.x,i=e.y,r=e.level,o=e.exaggeration??1,a=e.exaggerationRelativeHeight??0,s=e.throttle??!0,c=t.ellipsoid,u=t.tileXYToRectangle(n,i,r),d=(s?Z8e:J8e).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:c,exaggeration:o,exaggerationRelativeHeight:a});if(!l(d))return;let p=this;return Promise.resolve(d).then(function(g){let m=p._quantizedVertices.length/3,y=m+p._westIndices.length+p._southIndices.length+p._eastIndices.length+p._northIndices.length,A=Ve.createTypedArray(y,g.indices),b=new Float32Array(g.vertices),x=g.center,T=g.minimumHeight,C=g.maximumHeight,E=p._boundingSphere,w=p._orientedBoundingBox,D=h.clone(g.occludeePointInScaledSpace)??p._horizonOcclusionPoint,R=g.vertexStride,M=po.clone(g.encoding);return p._mesh=new mc(x,b,A,g.indexCountWithoutSkirts,m,T,C,u,E,D,R,w,M,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 Q8e=new Yn("upsampleQuantizedTerrainMesh",Hu.maximumAsynchronousTasks);A_.prototype.upsample=function(e,t,n,i,r,o,a){let s=this._mesh;if(!l(this._mesh))return;let c=t*2!==r,u=n*2===o,f=e.ellipsoid,d=e.tileXYToRectangle(r,o,a),p=Q8e.scheduleTask({vertices:s.vertices,vertexCountWithoutSkirts:s.vertexCountWithoutSkirts,indices:s.indices,indexCountWithoutSkirts:s.indexCountWithoutSkirts,encoding:s.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:c,isNorthChild:u,childRectangle:d,ellipsoid:f});if(!l(p))return;let g=Math.min(this._westSkirtHeight,this._eastSkirtHeight);g=Math.min(g,this._southSkirtHeight),g=Math.min(g,this._northSkirtHeight);let m=c?g*.5:this._westSkirtHeight,y=u?g*.5:this._southSkirtHeight,A=c?this._eastSkirtHeight:g*.5,b=u?this._northSkirtHeight:g*.5,x=this._credits;return Promise.resolve(p).then(function(T){let C=new Uint16Array(T.vertices),E=Ve.createTypedArray(C.length/3,T.indices),w;return l(T.encodedNormals)&&(w=new Uint8Array(T.encodedNormals)),new A_({quantizedVertices:C,indices:E,encodedNormals:w,minimumHeight:T.minimumHeight,maximumHeight:T.maximumHeight,boundingSphere:se.clone(T.boundingSphere),orientedBoundingBox:Jt.clone(T.orientedBoundingBox),horizonOcclusionPoint:h.clone(T.horizonOcclusionPoint),westIndices:T.westIndices,southIndices:T.southIndices,eastIndices:T.eastIndices,northIndices:T.northIndices,westSkirtHeight:m,southSkirtHeight:y,eastSkirtHeight:A,northSkirtHeight:b,childTileMask:0,credits:x,createdByUpsampling:!0})})};var AY=32767,_le=new h;A_.prototype.interpolateHeight=function(e,t,n){let i=I.clamp((t-e.west)/e.width,0,1);i*=AY;let r=I.clamp((n-e.south)/e.height,0,1);return r*=AY,l(this._mesh)?ije(this,i,r):rje(this,i,r)};function yle(e,t,n,i,r,o,a,s){let c=Math.min(n,r,a),u=Math.max(n,r,a),f=Math.min(i,o,s),d=Math.max(i,o,s);return e>=c&&e<=u&&t>=f&&t<=d}var eje=new k,tje=new k,nje=new k;function ije(e,t,n){let i=e._mesh,r=i.vertices,o=i.encoding,a=i.indices;for(let s=0,c=a.length;s<c;s+=3){let u=a[s],f=a[s+1],d=a[s+2],p=o.decodeTextureCoordinates(r,u,eje),g=o.decodeTextureCoordinates(r,f,tje),m=o.decodeTextureCoordinates(r,d,nje);if(yle(t,n,p.x,p.y,g.x,g.y,m.x,m.y)){let y=Rm.computeBarycentricCoordinates(t,n,p.x,p.y,g.x,g.y,m.x,m.y,_le);if(y.x>=-1e-15&&y.y>=-1e-15&&y.z>=-1e-15){let A=o.decodeHeight(r,u),b=o.decodeHeight(r,f),x=o.decodeHeight(r,d);return y.x*A+y.y*b+y.z*x}}}}function rje(e,t,n){let i=e._uValues,r=e._vValues,o=e._heightValues,a=e._indices;for(let s=0,c=a.length;s<c;s+=3){let u=a[s],f=a[s+1],d=a[s+2],p=i[u],g=i[f],m=i[d],y=r[u],A=r[f],b=r[d];if(yle(t,n,p,y,g,A,m,b)){let x=Rm.computeBarycentricCoordinates(t,n,p,y,g,A,m,b,_le);if(x.x>=-1e-15&&x.y>=-1e-15&&x.z>=-1e-15){let T=x.x*o[u]+x.y*o[f]+x.z*o[d];return I.lerp(e._minimumHeight,e._maximumHeight,T/AY)}}}}A_.prototype.isChildAvailable=function(e,t,n,i){let r=2;return n!==e*2&&++r,i!==t*2&&(r-=2),(this._childTileMask&1<<r)!==0};A_.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var hC=A_;function oje(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 ble(e){this.requestVertexNormals=e.requestVertexNormals??!1,this.requestWaterMask=e.requestWaterMask??!1,this.requestMetadata=e.requestMetadata??!0,this.ellipsoid=e.ellipsoid??te.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=[]}ble.prototype.build=function(e){e._heightmapWidth=this.heightmapWidth,e._scheme=this.scheme;let t=l(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 xle(e,t,n){if(!t.format){let y="The tile format is not specified in the layer.json file.";throw e.previousError=qr.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,y),new oe(y)}if(!t.tiles||t.tiles.length===0){let y="The layer.json file does not specify any tile URL templates.";throw e.previousError=qr.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,y),new oe(y)}let i=!1,r=!1,o=!1,a=!0,s=!1;if(t.format==="heightmap-1.0")s=!0,l(e.heightmapStructure)||(e.heightmapStructure={heightScale:1/5,heightOffset:-1e3,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1,lowestEncodedHeight:0,highestEncodedHeight:256*256-1}),r=!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=qr.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,y),new oe(y)}let c=t.tiles,u=t.maxzoom;if(e.overallMaxZoom=Math.max(e.overallMaxZoom,u),!t.projection||t.projection==="EPSG:4326")e.tilingScheme=new $i({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else if(t.projection==="EPSG:3857")e.tilingScheme=new So({numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else{let y=`The projection "${t.projection}" is invalid or not supported.`;throw e.previousError=qr.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,y),new oe(y)}if(e.levelZeroMaximumGeometricError=Vr.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=qr.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,y),new oe(y)}let f;l(t.extensions)&&t.extensions.indexOf("octvertexnormals")!==-1?i=!0:l(t.extensions)&&t.extensions.indexOf("vertexnormals")!==-1&&(i=!0,a=!1),l(t.extensions)&&t.extensions.indexOf("watermask")!==-1&&(r=!0),l(t.extensions)&&t.extensions.indexOf("metadata")!==-1&&(o=!0);let d=t.metadataAvailability,p=t.available,g;if(l(p)&&!l(d)){g=new wm(e.tilingScheme,p.length);for(let y=0;y<p.length;++y){let A=p[y],b=e.tilingScheme.getNumberOfYTilesAtLevel(y);l(e.overallAvailability[y])||(e.overallAvailability[y]=[]);for(let x=0;x<A.length;++x){let T=A[x],C=b-T.endY-1,E=b-T.startY-1;e.overallAvailability[y].push([T.startX,C,T.endX,E]),g.addAvailableTileRange(y,T.startX,C,T.endX,E)}}}else l(d)&&(f=new wm(e.tilingScheme,u),g=new wm(e.tilingScheme,u),e.overallAvailability[0]=[[0,0,1,0]],g.addAvailableTileRange(0,0,0,1,0));e.hasWaterMask=e.hasWaterMask||r,e.hasVertexNormals=e.hasVertexNormals||i,e.hasMetadata=e.hasMetadata||o,l(t.attribution)&&(e.attribution.length>0&&(e.attribution+=" "),e.attribution+=t.attribution),e.layers.push(new oje({resource:e.lastResource,version:t.version,isHeightmap:s,tileUrlTemplates:c,availability:g,hasVertexNormals:i,hasWaterMask:r,hasMetadata:o,availabilityLevels:d,availabilityTilesLoaded:f,littleEndianExtensionSize:a}));let m=t.parentUrl;return l(m)?l(g)?(e.lastResource=e.lastResource.getDerivedResource({url:m}),e.lastResource.appendForwardSlash(),e.layerJsonResource=e.lastResource.getDerivedResource({url:"layer.json"}),await TY(e),!0):(console.log("A layer.json can't have a parentUrl if it does't have an available array."),!0):!0}function aje(e,t,n){let i=`An error occurred while accessing ${e.layerJsonResource.url}.`;if(l(t)&&(i+=`
|
|
${t.message}`),e.previousError=qr.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,i),e.previousError.retry)return TY(e,n);throw new oe(i)}async function sje(e,t,n){await xle(e,t,n);let i=e.overallAvailability.length;if(i>0){let r=e.availability=new wm(e.tilingScheme,e.overallMaxZoom);for(let o=0;o<i;++o){let a=e.overallAvailability[o];for(let s=0;s<a.length;++s){let c=a[s];r.addAvailableTileRange(o,c[0],c[1],c[2],c[3])}}}if(e.attribution.length>0){let r=new wt(e.attribution);e.tileCredits.push(r)}return!0}async function TY(e,t){try{let n=await e.layerJsonResource.fetchJson();return sje(e,n,t)}catch(n){return l(n)&&n.statusCode===404?(await xle(e,{tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]},t),!0):aje(e,n,t)}}function lh(e){e=e??H.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 be;let t=e.credit;typeof t=="string"&&(t=new wt(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 bY={OCT_VERTEX_NORMALS:1,WATER_MASK:2,METADATA:4};function Ale(e){return!l(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 cje(e,t,n,i,r){let o=new Uint16Array(t,0,e._heightmapWidth*e._heightmapWidth);return new Lc({buffer:o,childTileMask:new Uint8Array(t,o.byteLength,1)[0],waterMask:new Uint8Array(t,o.byteLength+1,t.byteLength-o.byteLength-1),width:e._heightmapWidth,height:e._heightmapWidth,structure:e._heightmapStructure,credits:e._tileCredits})}function lje(e,t,n,i,r,o){let a=o.littleEndianExtensionSize,s=0,c=3,u=c+1,f=Float64Array.BYTES_PER_ELEMENT*c,d=Float64Array.BYTES_PER_ELEMENT*u,g=Uint16Array.BYTES_PER_ELEMENT*3,m=3,y=Uint16Array.BYTES_PER_ELEMENT,A=y*m,b=new DataView(t),x=new h(b.getFloat64(s,!0),b.getFloat64(s+8,!0),b.getFloat64(s+16,!0));s+=f;let T=b.getFloat32(s,!0);s+=Float32Array.BYTES_PER_ELEMENT;let C=b.getFloat32(s,!0);s+=Float32Array.BYTES_PER_ELEMENT;let E=new se(new h(b.getFloat64(s,!0),b.getFloat64(s+8,!0),b.getFloat64(s+16,!0)),b.getFloat64(s+f,!0));s+=d;let w=new h(b.getFloat64(s,!0),b.getFloat64(s+8,!0),b.getFloat64(s+16,!0));s+=f;let D=b.getUint32(s,!0);s+=Uint32Array.BYTES_PER_ELEMENT;let R=new Uint16Array(t,s,D*3);s+=D*g,D>64*1024&&(y=Uint32Array.BYTES_PER_ELEMENT,A=y*m);let M=R.subarray(0,D),N=R.subarray(D,2*D),_=R.subarray(D*2,3*D);an.zigZagDeltaDecode(M,N,_),s%y!==0&&(s+=y-s%y);let v=b.getUint32(s,!0);s+=Uint32Array.BYTES_PER_ELEMENT;let S=Ve.createTypedArrayFromArrayBuffer(D,t,s,v*m);s+=v*A;let P=0,L=S.length;for(let le=0;le<L;++le){let Ce=S[le];S[le]=P-Ce,Ce===0&&++P}let F=b.getUint32(s,!0);s+=Uint32Array.BYTES_PER_ELEMENT;let V=Ve.createTypedArrayFromArrayBuffer(D,t,s,F);s+=F*y;let z=b.getUint32(s,!0);s+=Uint32Array.BYTES_PER_ELEMENT;let j=Ve.createTypedArrayFromArrayBuffer(D,t,s,z);s+=z*y;let B=b.getUint32(s,!0);s+=Uint32Array.BYTES_PER_ELEMENT;let G=Ve.createTypedArrayFromArrayBuffer(D,t,s,B);s+=B*y;let W=b.getUint32(s,!0);s+=Uint32Array.BYTES_PER_ELEMENT;let Q=Ve.createTypedArrayFromArrayBuffer(D,t,s,W);s+=W*y;let q,J;for(;s<b.byteLength;){let le=b.getUint8(s,!0);s+=Uint8Array.BYTES_PER_ELEMENT;let Ce=b.getUint32(s,a);if(s+=Uint32Array.BYTES_PER_ELEMENT,le===bY.OCT_VERTEX_NORMALS&&e._requestVertexNormals)q=new Uint8Array(t,s,D*2);else if(le===bY.WATER_MASK&&e._requestWaterMask)J=new Uint8Array(t,s,Ce);else if(le===bY.METADATA&&e._requestMetadata){let ye=b.getUint32(s,!0);if(ye>0){let Ie=wo(new Uint8Array(t),s+Uint32Array.BYTES_PER_ELEMENT,ye).available;if(l(Ie))for(let Le=0;Le<Ie.length;++Le){let $e=n+Le+1,Ye=Ie[Le],yt=e._tilingScheme.getNumberOfYTilesAtLevel($e);for(let Ke=0;Ke<Ye.length;++Ke){let we=Ye[Ke],We=yt-we.endY-1,Ct=yt-we.startY-1;e.availability.addAvailableTileRange($e,we.startX,We,we.endX,Ct),o.availability.addAvailableTileRange($e,we.startX,We,we.endX,Ct)}}}o.availabilityTilesLoaded.addAvailableTileRange(n,i,r,i,r)}s+=Ce}let Z=e.getLevelMaximumGeometricError(n)*5,ce=e._tilingScheme.tileXYToRectangle(i,r,n),Ae=Jt.fromRectangle(ce,T,C,e._tilingScheme.ellipsoid);return new hC({center:x,minimumHeight:T,maximumHeight:C,boundingSphere:E,orientedBoundingBox:Ae,horizonOcclusionPoint:w,quantizedVertices:R,encodedNormals:q,indices:S,westIndices:V,southIndices:j,eastIndices:G,northIndices:Q,westSkirtHeight:Z,southSkirtHeight:Z,eastSkirtHeight:Z,northSkirtHeight:Z,childTileMask:e.availability.computeChildMaskForTile(n,i,r),waterMask:J,credits:e._tileCredits})}lh.prototype.requestTileGeometry=function(e,t,n,i){let r=this._layers,o,a=r.length,s=!1,c=Promise.resolve();if(a===1)o=r[0];else for(let u=0;u<a;++u){let f=r[u];if(!l(f.availability)||f.availability.isTileAvailable(n,e,t)){o=f;break}let d=CY(this,e,t,n,f,u===0);d.result&&(s=!0,c=c.then(()=>d.promise))}return!l(o)&&s?c.then(()=>new Promise(u=>{setTimeout(()=>{let f=this.requestTileGeometry(e,t,n,i);u(f)},0)})):Tle(this,e,t,n,o,i)};function Tle(e,t,n,i,r,o){if(!l(r))return Promise.reject(new oe("Terrain tile doesn't exist"));let a=r.tileUrlTemplates;if(a.length===0)return;let s;!e._scheme||e._scheme==="tms"?s=e._tilingScheme.getNumberOfYTilesAtLevel(i)-n-1:s=n;let c=[];e._requestVertexNormals&&r.hasVertexNormals&&c.push(r.littleEndianExtensionSize?"octvertexnormals":"vertexnormals"),e._requestWaterMask&&r.hasWaterMask&&c.push("watermask"),e._requestMetadata&&r.hasMetadata&&c.push("metadata");let u,f,d=a[(t+s+i)%a.length],p=r.resource;l(p._ionEndpoint)&&!l(p._ionEndpoint.externalType)?(c.length!==0&&(f={extensions:c.join("-")}),u=Ale(void 0)):u=Ale(c);let g=p.getDerivedResource({url:d,templateValues:{version:r.version,z:i,x:t,y:s},queryParameters:f,headers:u,request:o}).fetchArrayBuffer();if(l(g))return g.then(function(m){return l(m)?l(e._heightmapStructure)?cje(e,m,i,t,n):lje(e,m,i,t,n,r):Promise.reject(new oe("Mesh buffer doesn't exist."))})}Object.defineProperties(lh.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}}});lh.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};lh.fromIonAssetId=async function(e,t){let n=await ga.fromAssetId(e);return lh.fromUrl(n,t)};lh.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT,e=await Promise.resolve(e);let n=De.createIfNeeded(e);n.appendForwardSlash();let i=new ble(t);i.lastResource=n,i.layerJsonResource=i.lastResource.getDerivedResource({url:"layer.json"}),await TY(i);let r=new lh(t);return i.build(r),r};lh.prototype.getTileDataAvailable=function(e,t,n){if(!l(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,r=i.length;for(let o=0;o<r;++o)if(CY(this,e,t,n,i[o],o===0).result)return;return!1};lh.prototype.loadTileDataAvailability=function(e,t,n){if(!l(this._availability)||n>this._availability._maximumLevel||this._availability.isTileAvailable(n,e,t)||!this._hasMetadata)return;let i=this._layers,r=i.length;for(let o=0;o<r;++o){let a=CY(this,e,t,n,i[o],o===0);if(l(a.promise))return a.promise}};function xY(e,t,n,i){if(i===0)return;let r=e.availabilityLevels,o=i%r===0?i-r:(i/r|0)*r,a=1<<i-o,s=t/a|0,c=n/a|0;return{level:o,x:s,y:c}}function CY(e,t,n,i,r,o){if(!l(r.availabilityLevels))return{result:!1};let a,s=function(){delete r.availabilityPromiseCache[a]},c=r.availabilityTilesLoaded,u=r.availability,f=xY(r,t,n,i);for(;l(f);){if(u.isTileAvailable(f.level,f.x,f.y)&&!c.isTileAvailable(f.level,f.x,f.y)){let d;if(!o&&(a=`${f.level}-${f.x}-${f.y}`,d=r.availabilityPromiseCache[a],!l(d))){let p=new Eo({throttle:!1,throttleByServer:!0,type:Za.TERRAIN});d=Tle(e,f.x,f.y,f.level,r,p),l(d)&&(r.availabilityPromiseCache[a]=d,d.then(s))}return{result:!0,promise:d}}f=xY(r,f.x,f.y,f.level)}return{result:!1}}lh._getAvailabilityTile=xY;var mC=lh;var EY={},GL=new h,Cle=new h,vle=new Fe,Ele=new $;function pC(e,t,n,i,r,o,a,s,c,u){let f=e+t;h.multiplyByScalar(i,Math.cos(f),GL),h.multiplyByScalar(n,Math.sin(f),Cle),h.add(GL,Cle,GL);let d=Math.cos(e);d=d*d;let p=Math.sin(e);p=p*p;let m=o/Math.sqrt(a*d+r*p)/s;return Fe.fromAxisAngle(GL,m,vle),$.fromQuaternion(vle,Ele),$.multiplyByVector(Ele,c,u),h.normalize(u,u),h.multiplyByScalar(u,s,u),u}var Sle=new h,wle=new h,vY=new h,uje=new h;EY.raisePositionsToHeight=function(e,t,n){let i=t.ellipsoid,r=t.height,o=t.extrudedHeight,a=n?e.length/3*2:e.length/3,s=new Float64Array(a*3),c=e.length,u=n?c:0;for(let f=0;f<c;f+=3){let d=f+1,p=f+2,g=h.fromArray(e,f,Sle);i.scaleToGeodeticSurface(g,g);let m=h.clone(g,wle),y=i.geodeticSurfaceNormal(g,uje),A=h.multiplyByScalar(y,r,vY);h.add(g,A,g),n&&(h.multiplyByScalar(y,o,A),h.add(m,A,m),s[f+u]=m.x,s[d+u]=m.y,s[p+u]=m.z),s[f]=g.x,s[d]=g.y,s[p]=g.z}return s};var fje=new h,dje=new h,hje=new h;EY.computeEllipsePositions=function(e,t,n){let i=e.semiMinorAxis,r=e.semiMajorAxis,o=e.rotation,a=e.center,s=e.granularity*8,c=i*i,u=r*r,f=r*i,d=h.magnitude(a),p=h.normalize(a,fje),g=h.cross(h.UNIT_Z,a,dje);g=h.normalize(g,g);let m=h.cross(p,g,hje),y=1+Math.ceil(I.PI_OVER_TWO/s),A=I.PI_OVER_TWO/(y-1),b=I.PI_OVER_TWO-y*A;b<0&&(y-=Math.ceil(Math.abs(b)/A));let x=2*(y*(y+2)),T=t?new Array(x*3):void 0,C=0,E=Sle,w=wle,D=y*4*3,R=D-1,M=0,N=n?new Array(D):void 0,_,v,S,P,L;for(b=I.PI_OVER_TWO,E=pC(b,o,m,g,c,f,u,d,p,E),t&&(T[C++]=E.x,T[C++]=E.y,T[C++]=E.z),n&&(N[R--]=E.z,N[R--]=E.y,N[R--]=E.x),b=I.PI_OVER_TWO-A,_=1;_<y+1;++_){if(E=pC(b,o,m,g,c,f,u,d,p,E),w=pC(Math.PI-b,o,m,g,c,f,u,d,p,w),t){for(T[C++]=E.x,T[C++]=E.y,T[C++]=E.z,S=2*_+2,v=1;v<S-1;++v)P=v/(S-1),L=h.lerp(E,w,P,vY),T[C++]=L.x,T[C++]=L.y,T[C++]=L.z;T[C++]=w.x,T[C++]=w.y,T[C++]=w.z}n&&(N[R--]=E.z,N[R--]=E.y,N[R--]=E.x,N[M++]=w.x,N[M++]=w.y,N[M++]=w.z),b=I.PI_OVER_TWO-(_+1)*A}for(_=y;_>1;--_){if(b=I.PI_OVER_TWO-(_-1)*A,E=pC(-b,o,m,g,c,f,u,d,p,E),w=pC(b+Math.PI,o,m,g,c,f,u,d,p,w),t){for(T[C++]=E.x,T[C++]=E.y,T[C++]=E.z,S=2*(_-1)+2,v=1;v<S-1;++v)P=v/(S-1),L=h.lerp(E,w,P,vY),T[C++]=L.x,T[C++]=L.y,T[C++]=L.z;T[C++]=w.x,T[C++]=w.y,T[C++]=w.z}n&&(N[R--]=E.z,N[R--]=E.y,N[R--]=E.x,N[M++]=w.x,N[M++]=w.y,N[M++]=w.z)}b=I.PI_OVER_TWO,E=pC(-b,o,m,g,c,f,u,d,p,E);let F={};return t&&(T[C++]=E.x,T[C++]=E.y,T[C]=E.z,F.positions=T,F.numPts=y),n&&(N[R--]=E.z,N[R--]=E.y,N[R]=E.x,F.outerPositions=N),F};var Ku=EY;function mje(e){e=e??H.EMPTY_OBJECT,this.geometry=e.geometry,this.modelMatrix=O.clone(e.modelMatrix??O.IDENTITY),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=e.attributes??{},this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}var Bt=mje;var Ile=new h,Ple=new h,Dle=new h;function pje(e,t,n,i,r){l(r)||(r=new h);let o,a,s,c,u,f,d,p;if(l(t.z)){if(h.equalsEpsilon(e,t,I.EPSILON14))return h.clone(h.UNIT_X,r);if(h.equalsEpsilon(e,n,I.EPSILON14))return h.clone(h.UNIT_Y,r);if(h.equalsEpsilon(e,i,I.EPSILON14))return h.clone(h.UNIT_Z,r);o=h.subtract(n,t,Ile),a=h.subtract(i,t,Ple),s=h.subtract(e,t,Dle),c=h.dot(o,o),u=h.dot(o,a),f=h.dot(o,s),d=h.dot(a,a),p=h.dot(a,s)}else{if(k.equalsEpsilon(e,t,I.EPSILON14))return h.clone(h.UNIT_X,r);if(k.equalsEpsilon(e,n,I.EPSILON14))return h.clone(h.UNIT_Y,r);if(k.equalsEpsilon(e,i,I.EPSILON14))return h.clone(h.UNIT_Z,r);o=k.subtract(n,t,Ile),a=k.subtract(i,t,Ple),s=k.subtract(e,t,Dle),c=k.dot(o,o),u=k.dot(o,a),f=k.dot(o,s),d=k.dot(a,a),p=k.dot(a,s)}r.y=d*f-u*p,r.z=c*p-u*f;let g=c*d-u*u;if(g!==0)return r.y/=g,r.z/=g,r.x=1-r.y-r.z,r}var gC=pje;function km(){this.high=h.clone(h.ZERO),this.low=h.clone(h.ZERO)}km.encode=function(e,t){l(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 S0={high:0,low:0};km.fromCartesian=function(e,t){l(t)||(t=new km);let n=t.high,i=t.low;return km.encode(e.x,S0),n.x=S0.high,i.x=S0.low,km.encode(e.y,S0),n.y=S0.high,i.y=S0.low,km.encode(e.z,S0),n.z=S0.high,i.z=S0.low,t};var SY=new km;km.writeElements=function(e,t,n){km.fromCartesian(e,SY);let i=SY.high,r=SY.low;t[n]=i.x,t[n+1]=i.y,t[n+2]=i.z,t[n+3]=r.x,t[n+4]=r.y,t[n+5]=r.z};var Sn=km;var wY={};wY.calculateACMR=function(e){e=e??H.EMPTY_OBJECT;let t=e.indices,n=e.maximumIndex,i=e.cacheSize??24,r=t.length;if(!l(n)){n=0;let s=0,c=t[s];for(;s<r;)c>n&&(n=c),++s,c=t[s]}let o=[];for(let s=0;s<n+1;s++)o[s]=0;let a=i+1;for(let s=0;s<r;++s)a-o[t[s]]>i&&(o[t[s]]=a,++a);return(a-i+1)/(r/3)};wY.tipsify=function(e){e=e??H.EMPTY_OBJECT;let t=e.indices,n=e.maximumIndex,i=e.cacheSize??24,r;function o(_,v,S,P){for(;v.length>=1;){let L=v[v.length-1];if(v.splice(v.length-1,1),_[L].numLiveTriangles>0)return L}for(;r<P;){if(_[r].numLiveTriangles>0)return++r,r-1;++r}return-1}function a(_,v,S,P,L,F,V){let z=-1,j,B=-1,G=0;for(;G<S.length;){let W=S[G];P[W].numLiveTriangles&&(j=0,L-P[W].timeStamp+2*P[W].numLiveTriangles<=v&&(j=L-P[W].timeStamp),(j>B||B===-1)&&(B=j,z=W)),++G}return z===-1?o(P,F,_,V):z}let s=t.length,c=0,u=0,f=t[u],d=s;if(l(n))c=n+1;else{for(;u<d;)f>c&&(c=f),++u,f=t[u];if(c===-1)return 0;++c}let p=[],g;for(g=0;g<c;g++)p[g]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};u=0;let m=0;for(;u<d;)p[t[u]].vertexTriangles.push(m),++p[t[u]].numLiveTriangles,p[t[u+1]].vertexTriangles.push(m),++p[t[u+1]].numLiveTriangles,p[t[u+2]].vertexTriangles.push(m),++p[t[u+2]].numLiveTriangles,++m,u+=3;let y=0,A=i+1;r=1;let b,x=[],T,C,E=0,w=[],D=s/3,R=[];for(g=0;g<D;g++)R[g]=!1;let M,N;for(;y!==-1;){b=[],C=p[y],N=C.vertexTriangles.length;for(let _=0;_<N;++_)if(m=C.vertexTriangles[_],!R[m]){R[m]=!0,u=m+m+m;for(let v=0;v<3;++v)M=t[u],b.push(M),x.push(M),w[E]=M,++E,T=p[M],--T.numLiveTriangles,A-T.timeStamp>i&&(T.timeStamp=A,++A),++u}y=a(t,i,b,p,A,x,c)}return w};var WL=wY;var pl={};function ZL(e,t,n,i,r){e[t++]=n,e[t++]=i,e[t++]=i,e[t++]=r,e[t++]=r,e[t]=n}function gje(e){let t=e.length,n=t/3*6,i=Ve.createTypedArray(t,n),r=0;for(let o=0;o<t;o+=3,r+=6)ZL(i,r,e[o],e[o+1],e[o+2]);return i}function _je(e){let t=e.length;if(t>=3){let n=(t-2)*6,i=Ve.createTypedArray(t,n);ZL(i,0,e[0],e[1],e[2]);let r=6;for(let o=3;o<t;++o,r+=6)ZL(i,r,e[o-1],e[o],e[o-2]);return i}return new Uint16Array}function yje(e){if(e.length>0){let t=e.length-1,n=(t-1)*6,i=Ve.createTypedArray(t,n),r=e[0],o=0;for(let a=1;a<t;++a,o+=6)ZL(i,o,r,e[a],e[a+1]);return i}return new Uint16Array}pl.toWireframe=function(e){let t=e.indices;if(l(t)){switch(e.primitiveType){case Re.TRIANGLES:e.indices=gje(t);break;case Re.TRIANGLE_STRIP:e.indices=_je(t);break;case Re.TRIANGLE_FAN:e.indices=yje(t);break}e.primitiveType=Re.LINES}return e};pl.createLineSegmentsForVectors=function(e,t,n){t=t??"normal",n=n??1e4;let i=e.attributes.position.values,r=e.attributes[t].values,o=i.length,a=new Float64Array(2*o),s=0;for(let f=0;f<o;f+=3)a[s++]=i[f],a[s++]=i[f+1],a[s++]=i[f+2],a[s++]=i[f]+r[f]*n,a[s++]=i[f+1]+r[f+1]*n,a[s++]=i[f+2]+r[f+2]*n;let c,u=e.boundingSphere;return l(u)&&(c=new se(u.center,u.radius+n)),new Tt({attributes:{position:new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:a})},primitiveType:Re.LINES,boundingSphere:c})};pl.createAttributeLocations=function(e){let t=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=e.attributes,i={},r=0,o,a=t.length;for(o=0;o<a;++o){let s=t[o];l(n[s])&&(i[s]=r++)}for(let s in n)n.hasOwnProperty(s)&&!l(i[s])&&(i[s]=r++);return i};pl.reorderForPreVertexCache=function(e){let t=Tt.computeNumberOfVertices(e),n=e.indices;if(l(n)){let i=new Int32Array(t);for(let p=0;p<t;p++)i[p]=-1;let r=n,o=r.length,a=Ve.createTypedArray(t,o),s=0,c=0,u=0,f;for(;s<o;)f=i[r[s]],f!==-1?a[c]=f:(f=r[s],i[f]=u,a[c]=u,++u),++s,++c;e.indices=a;let d=e.attributes;for(let p in d)if(d.hasOwnProperty(p)&&l(d[p])&&l(d[p].values)){let g=d[p],m=g.values,y=0,A=g.componentsPerAttribute,b=Y.createTypedArray(g.componentDatatype,u*A);for(;y<t;){let x=i[y];if(x!==-1)for(let T=0;T<A;T++)b[A*x+T]=m[A*y+T];++y}g.values=b}}return e};pl.reorderForPostVertexCache=function(e,t){let n=e.indices;if(e.primitiveType===Re.TRIANGLES&&l(n)){let i=n.length,r=0;for(let o=0;o<i;o++)n[o]>r&&(r=n[o]);e.indices=WL.tipsify({indices:n,maximumIndex:r,cacheSize:t})}return e};function Rle(e){let t={};for(let n in e)if(e.hasOwnProperty(n)&&l(e[n])&&l(e[n].values)){let i=e[n];t[n]=new Me({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return t}function Aje(e,t,n){for(let i in t)if(t.hasOwnProperty(i)&&l(t[i])&&l(t[i].values)){let r=t[i];for(let o=0;o<r.componentsPerAttribute;++o)e[i].values.push(r.values[n*r.componentsPerAttribute+o])}}pl.fitToUnsignedShortIndices=function(e){let t=[],n=Tt.computeNumberOfVertices(e);if(l(e.indices)&&n>=I.SIXTY_FOUR_KILOBYTES){let i=[],r=[],o=0,a=Rle(e.attributes),s=e.indices,c=s.length,u;e.primitiveType===Re.TRIANGLES?u=3:e.primitiveType===Re.LINES?u=2:e.primitiveType===Re.POINTS&&(u=1);for(let f=0;f<c;f+=u){for(let d=0;d<u;++d){let p=s[f+d],g=i[p];l(g)||(g=o++,i[p]=g,Aje(a,e.attributes,p)),r.push(g)}o+u>=I.SIXTY_FOUR_KILOBYTES&&(t.push(new Tt({attributes:a,indices:r,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),i=[],r=[],o=0,a=Rle(e.attributes))}r.length!==0&&t.push(new Tt({attributes:a,indices:r,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var Ole=new h,bje=new de;pl.projectTo2D=function(e,t,n,i,r){let o=e.attributes[t];r=l(r)?r:new ki;let a=r.ellipsoid,s=o.values,c=new Float64Array(s.length),u=0;for(let f=0;f<s.length;f+=3){let d=h.fromArray(s,f,Ole),p=a.cartesianToCartographic(d,bje),g=r.project(p,Ole);c[u++]=g.x,c[u++]=g.y,c[u++]=g.z}return e.attributes[n]=o,e.attributes[i]=new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:c}),delete e.attributes[t],e};var IY={high:0,low:0};pl.encodeAttribute=function(e,t,n,i){let r=e.attributes[t],o=r.values,a=o.length,s=new Float32Array(a),c=new Float32Array(a);for(let f=0;f<a;++f)Sn.encode(o[f],IY),s[f]=IY.high,c[f]=IY.low;let u=r.componentsPerAttribute;return e.attributes[n]=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:u,values:s}),e.attributes[i]=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:u,values:c}),delete e.attributes[t],e};var fh=new h;function PY(e,t){if(l(t)){let n=t.values,i=n.length;for(let r=0;r<i;r+=3)h.unpack(n,r,fh),O.multiplyByPoint(e,fh,fh),h.pack(fh,n,r)}}function DY(e,t){if(l(t)){let n=t.values,i=n.length;for(let r=0;r<i;r+=3)h.unpack(n,r,fh),$.multiplyByVector(e,fh,fh),fh=h.normalize(fh,fh),h.pack(fh,n,r)}}var qL=new O,YL=new $;pl.transformToWorldCoordinates=function(e){let t=e.modelMatrix;if(O.equals(t,O.IDENTITY))return e;let n=e.geometry.attributes;PY(t,n.position),PY(t,n.prevPosition),PY(t,n.nextPosition),(l(n.normal)||l(n.tangent)||l(n.bitangent))&&(O.inverse(t,qL),O.transpose(qL,qL),O.getMatrix3(qL,YL),DY(YL,n.normal),DY(YL,n.tangent),DY(YL,n.bitangent));let i=e.geometry.boundingSphere;return l(i)&&(e.geometry.boundingSphere=se.transform(i,t,i)),e.modelMatrix=O.clone(O.IDENTITY),e};function xje(e,t){let n=e.length,i={},r=e[0][t].attributes,o;for(o in r)if(r.hasOwnProperty(o)&&l(r[o])&&l(r[o].values)){let a=r[o],s=a.values.length,c=!0;for(let u=1;u<n;++u){let f=e[u][t].attributes[o];if(!l(f)||a.componentDatatype!==f.componentDatatype||a.componentsPerAttribute!==f.componentsPerAttribute||a.normalize!==f.normalize){c=!1;break}s+=f.values.length}c&&(i[o]=new Me({componentDatatype:a.componentDatatype,componentsPerAttribute:a.componentsPerAttribute,normalize:a.normalize,values:Y.createTypedArray(a.componentDatatype,s)}))}return i}var Tje=new h;function RY(e,t){let n=e.length,i,r,o,a,s=e[0].modelMatrix,c=l(e[0][t].indices),u=e[0][t].primitiveType,f=xje(e,t),d,p,g;for(i in f)if(f.hasOwnProperty(i))for(d=f[i].values,a=0,r=0;r<n;++r)for(p=e[r][t].attributes[i].values,g=p.length,o=0;o<g;++o)d[a++]=p[o];let m;if(c){let x=0;for(r=0;r<n;++r)x+=e[r][t].indices.length;let T=Tt.computeNumberOfVertices(new Tt({attributes:f,primitiveType:Re.POINTS})),C=Ve.createTypedArray(T,x),E=0,w=0;for(r=0;r<n;++r){let D=e[r][t].indices,R=D.length;for(a=0;a<R;++a)C[E++]=w+D[a];w+=Tt.computeNumberOfVertices(e[r][t])}m=C}let y=new h,A=0,b;for(r=0;r<n;++r){if(b=e[r][t].boundingSphere,!l(b)){y=void 0;break}h.add(b.center,y,y)}if(l(y))for(h.divideByScalar(y,n,y),r=0;r<n;++r){b=e[r][t].boundingSphere;let x=h.magnitude(h.subtract(b.center,y,Tje))+b.radius;x>A&&(A=x)}return new Tt({attributes:f,indices:m,primitiveType:u,boundingSphere:l(y)?new se(y,A):void 0})}pl.combineInstances=function(e){let t=[],n=[],i=e.length;for(let o=0;o<i;++o){let a=e[o];l(a.geometry)?t.push(a):l(a.westHemisphereGeometry)&&l(a.eastHemisphereGeometry)&&n.push(a)}let r=[];return t.length>0&&r.push(RY(t,"geometry")),n.length>0&&(r.push(RY(n,"westHemisphereGeometry")),r.push(RY(n,"eastHemisphereGeometry"))),r};var qf=new h,FI=new h,_C=new h,yC=new h;pl.computeNormal=function(e){let t=e.indices,n=e.attributes,i=n.position.values,r=n.position.values.length/3,o=t.length,a=new Array(r),s=new Array(o/3),c=new Array(o),u;for(u=0;u<r;u++)a[u]={indexOffset:0,count:0,currentCount:0};let f=0;for(u=0;u<o;u+=3){let m=t[u],y=t[u+1],A=t[u+2],b=m*3,x=y*3,T=A*3;FI.x=i[b],FI.y=i[b+1],FI.z=i[b+2],_C.x=i[x],_C.y=i[x+1],_C.z=i[x+2],yC.x=i[T],yC.y=i[T+1],yC.z=i[T+2],a[m].count++,a[y].count++,a[A].count++,h.subtract(_C,FI,_C),h.subtract(yC,FI,yC),s[f]=h.cross(_C,yC,new h),f++}let d=0;for(u=0;u<r;u++)a[u].indexOffset+=d,d+=a[u].count;f=0;let p;for(u=0;u<o;u+=3){p=a[t[u]];let m=p.indexOffset+p.currentCount;c[m]=f,p.currentCount++,p=a[t[u+1]],m=p.indexOffset+p.currentCount,c[m]=f,p.currentCount++,p=a[t[u+2]],m=p.indexOffset+p.currentCount,c[m]=f,p.currentCount++,f++}let g=new Float32Array(r*3);for(u=0;u<r;u++){let m=u*3;if(p=a[u],h.clone(h.ZERO,qf),p.count>0){for(f=0;f<p.count;f++)h.add(qf,s[c[p.indexOffset+f]],qf);h.equalsEpsilon(h.ZERO,qf,I.EPSILON10)&&h.clone(s[c[p.indexOffset]],qf)}h.equalsEpsilon(h.ZERO,qf,I.EPSILON10)&&(qf.z=1),h.normalize(qf,qf),g[m]=qf.x,g[m+1]=qf.y,g[m+2]=qf.z}return e.attributes.normal=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:g}),e};var Cje=new h,Mle=new h,vje=new h;pl.computeTangentAndBitangent=function(e){let t=e.attributes,n=e.indices,i=e.attributes.position.values,r=e.attributes.normal.values,o=e.attributes.st.values,a=e.attributes.position.values.length/3,s=n.length,c=new Array(a*3),u;for(u=0;u<c.length;u++)c[u]=0;let f,d,p;for(u=0;u<s;u+=3){let y=n[u],A=n[u+1],b=n[u+2];f=y*3,d=A*3,p=b*3;let x=y*2,T=A*2,C=b*2,E=i[f],w=i[f+1],D=i[f+2],R=o[x],M=o[x+1],N=o[T+1]-M,_=o[C+1]-M,v=1/((o[T]-R)*_-(o[C]-R)*N),S=(_*(i[d]-E)-N*(i[p]-E))*v,P=(_*(i[d+1]-w)-N*(i[p+1]-w))*v,L=(_*(i[d+2]-D)-N*(i[p+2]-D))*v;c[f]+=S,c[f+1]+=P,c[f+2]+=L,c[d]+=S,c[d+1]+=P,c[d+2]+=L,c[p]+=S,c[p+1]+=P,c[p+2]+=L}let g=new Float32Array(a*3),m=new Float32Array(a*3);for(u=0;u<a;u++){f=u*3,d=f+1,p=f+2;let y=h.fromArray(r,f,Cje),A=h.fromArray(c,f,vje),b=h.dot(y,A);h.multiplyByScalar(y,b,Mle),h.normalize(h.subtract(A,Mle,A),A),g[f]=A.x,g[d]=A.y,g[p]=A.z,h.normalize(h.cross(y,A,A),A),m[f]=A.x,m[d]=A.y,m[p]=A.z}return e.attributes.tangent=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:g}),e.attributes.bitangent=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:m}),e};var BI=new k,uh=new h,Lle=new h,Nle=new h,XL=new k;pl.compressVertices=function(e){let t=e.attributes.extrudeDirection,n,i;if(l(t)){let w=t.values;i=w.length/3;let D=new Float32Array(i*2),R=0;for(n=0;n<i;++n){if(h.fromArray(w,n*3,uh),h.equals(uh,h.ZERO)){R+=2;continue}XL=an.octEncodeInRange(uh,65535,XL),D[R++]=XL.x,D[R++]=XL.y}return e.attributes.compressedAttributes=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:D}),delete e.attributes.extrudeDirection,e}let r=e.attributes.normal,o=e.attributes.st,a=l(r),s=l(o);if(!a&&!s)return e;let c=e.attributes.tangent,u=e.attributes.bitangent,f=l(c),d=l(u),p,g,m,y;a&&(p=r.values),s&&(g=o.values),f&&(m=c.values),d&&(y=u.values),i=(a?p.length:g.length)/(a?3:2);let x=i,T=s&&a?2:1;T+=f||d?1:0,x*=T;let C=new Float32Array(x),E=0;for(n=0;n<i;++n){s&&(k.fromArray(g,n*2,BI),C[E++]=an.compressTextureCoordinates(BI));let w=n*3;a&&l(m)&&l(y)?(h.fromArray(p,w,uh),h.fromArray(m,w,Lle),h.fromArray(y,w,Nle),an.octPack(uh,Lle,Nle,BI),C[E++]=BI.x,C[E++]=BI.y):(a&&(h.fromArray(p,w,uh),C[E++]=an.octEncodeFloat(uh)),f&&(h.fromArray(m,w,uh),C[E++]=an.octEncodeFloat(uh)),d&&(h.fromArray(y,w,uh),C[E++]=an.octEncodeFloat(uh)))}return e.attributes.compressedAttributes=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:T,values:C}),a&&delete e.attributes.normal,s&&delete e.attributes.st,d&&delete e.attributes.bitangent,f&&delete e.attributes.tangent,e};function Eje(e){if(l(e.indices))return e;let t=Tt.computeNumberOfVertices(e),n=Ve.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function Sje(e){let t=Tt.computeNumberOfVertices(e),n=Ve.createTypedArray(t,(t-2)*3);n[0]=1,n[1]=0,n[2]=2;let i=3;for(let r=3;r<t;++r)n[i++]=r-1,n[i++]=0,n[i++]=r;return e.indices=n,e.primitiveType=Re.TRIANGLES,e}function wje(e){let t=Tt.computeNumberOfVertices(e),n=Ve.createTypedArray(t,(t-2)*3);n[0]=0,n[1]=1,n[2]=2,t>3&&(n[3]=0,n[4]=2,n[5]=3);let i=6;for(let r=3;r<t-1;r+=2)n[i++]=r,n[i++]=r-1,n[i++]=r+1,r+2<t&&(n[i++]=r,n[i++]=r+1,n[i++]=r+2);return e.indices=n,e.primitiveType=Re.TRIANGLES,e}function Ije(e){if(l(e.indices))return e;let t=Tt.computeNumberOfVertices(e),n=Ve.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function Pje(e){let t=Tt.computeNumberOfVertices(e),n=Ve.createTypedArray(t,(t-1)*2);n[0]=0,n[1]=1;let i=2;for(let r=2;r<t;++r)n[i++]=r-1,n[i++]=r;return e.indices=n,e.primitiveType=Re.LINES,e}function Dje(e){let t=Tt.computeNumberOfVertices(e),n=Ve.createTypedArray(t,t*2);n[0]=0,n[1]=1;let i=2;for(let r=2;r<t;++r)n[i++]=r-1,n[i++]=r;return n[i++]=t-1,n[i]=0,e.indices=n,e.primitiveType=Re.LINES,e}function Rje(e){switch(e.primitiveType){case Re.TRIANGLE_FAN:return Sje(e);case Re.TRIANGLE_STRIP:return wje(e);case Re.TRIANGLES:return Eje(e);case Re.LINE_STRIP:return Pje(e);case Re.LINE_LOOP:return Dje(e);case Re.LINES:return Ije(e)}return e}function b_(e,t){Math.abs(e.y)<I.EPSILON6&&(t?e.y=-I.EPSILON6:e.y=I.EPSILON6)}function Oje(e,t,n){if(e.y!==0&&t.y!==0&&n.y!==0){b_(e,e.y<0),b_(t,t.y<0),b_(n,n.y<0);return}let i=Math.abs(e.y),r=Math.abs(t.y),o=Math.abs(n.y),a;i>r?i>o?a=I.sign(e.y):a=I.sign(n.y):r>o?a=I.sign(t.y):a=I.sign(n.y);let s=a<0;b_(e,s),b_(t,s),b_(n,s)}var Fle=new h;function Yf(e,t,n,i){h.add(e,h.multiplyByScalar(h.subtract(t,e,Fle),e.y/(e.y-t.y),Fle),n),h.clone(n,i),b_(n,!0),b_(i,!1)}var rb=new h,ob=new h,ab=new h,sb=new h,OY={positions:new Array(7),indices:new Array(9)};function Mje(e,t,n){if(e.x>=0||t.x>=0||n.x>=0)return;Oje(e,t,n);let i=e.y<0,r=t.y<0,o=n.y<0,a=0;a+=i?1:0,a+=r?1:0,a+=o?1:0;let s=OY.indices;a===1?(s[1]=3,s[2]=4,s[5]=6,s[7]=6,s[8]=5,i?(Yf(e,t,rb,ab),Yf(e,n,ob,sb),s[0]=0,s[3]=1,s[4]=2,s[6]=1):r?(Yf(t,n,rb,ab),Yf(t,e,ob,sb),s[0]=1,s[3]=2,s[4]=0,s[6]=2):o&&(Yf(n,e,rb,ab),Yf(n,t,ob,sb),s[0]=2,s[3]=0,s[4]=1,s[6]=0)):a===2&&(s[2]=4,s[4]=4,s[5]=3,s[7]=5,s[8]=6,i?r?o||(Yf(n,e,rb,ab),Yf(n,t,ob,sb),s[0]=0,s[1]=1,s[3]=0,s[6]=2):(Yf(t,n,rb,ab),Yf(t,e,ob,sb),s[0]=2,s[1]=0,s[3]=2,s[6]=1):(Yf(e,t,rb,ab),Yf(e,n,ob,sb),s[0]=1,s[1]=2,s[3]=1,s[6]=0));let c=OY.positions;return c[0]=e,c[1]=t,c[2]=n,c.length=3,(a===1||a===2)&&(c[3]=rb,c[4]=ob,c[5]=ab,c[6]=sb,c.length=7),OY}function Ble(e,t){let n=e.attributes;if(n.position.values.length===0)return;for(let r in n)if(n.hasOwnProperty(r)&&l(n[r])&&l(n[r].values)){let o=n[r];o.values=Y.createTypedArray(o.componentDatatype,o.values)}let i=Tt.computeNumberOfVertices(e);return e.indices=Ve.createTypedArray(i,e.indices),t&&(e.boundingSphere=se.fromVertices(n.position.values)),e}function bC(e){let t=e.attributes,n={};for(let i in t)if(t.hasOwnProperty(i)&&l(t[i])&&l(t[i].values)){let r=t[i];n[i]=new Me({componentDatatype:r.componentDatatype,componentsPerAttribute:r.componentsPerAttribute,normalize:r.normalize,values:[]})}return new Tt({attributes:n,indices:[],primitiveType:e.primitiveType})}function FY(e,t,n){let i=l(e.geometry.boundingSphere);t=Ble(t,i),n=Ble(n,i),l(n)&&!l(t)?e.geometry=n:!l(n)&&l(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=n,e.geometry=void 0)}function BY(e,t){let n=new e,i=new e,r=new e;return function(o,a,s,c,u,f,d,p){let g=e.fromArray(u,o*t,n),m=e.fromArray(u,a*t,i),y=e.fromArray(u,s*t,r);e.multiplyByScalar(g,c.x,g),e.multiplyByScalar(m,c.y,m),e.multiplyByScalar(y,c.z,y);let A=e.add(g,m,g);e.add(A,y,A),p&&e.normalize(A,A),e.pack(A,f,d*t)}}var Lje=BY(ae,4),JL=BY(h,3),Hle=BY(k,2),Nje=function(e,t,n,i,r,o,a){let s=r[e]*i.x,c=r[t]*i.y,u=r[n]*i.z;o[a]=s+c+u>I.EPSILON6?1:0},kI=new h,MY=new h,LY=new h,Fje=new h;function KL(e,t,n,i,r,o,a,s,c,u,f,d,p,g,m,y){if(!l(o)&&!l(a)&&!l(s)&&!l(c)&&!l(u)&&g===0)return;let A=h.fromArray(r,e*3,kI),b=h.fromArray(r,t*3,MY),x=h.fromArray(r,n*3,LY),T=gC(i,A,b,x,Fje);if(l(T)){if(l(o)&&JL(e,t,n,T,o,d.normal.values,y,!0),l(u)){let C=h.fromArray(u,e*3,kI),E=h.fromArray(u,t*3,MY),w=h.fromArray(u,n*3,LY);h.multiplyByScalar(C,T.x,C),h.multiplyByScalar(E,T.y,E),h.multiplyByScalar(w,T.z,w);let D;!h.equals(C,h.ZERO)||!h.equals(E,h.ZERO)||!h.equals(w,h.ZERO)?(D=h.add(C,E,C),h.add(D,w,D),h.normalize(D,D)):(D=kI,D.x=0,D.y=0,D.z=0),h.pack(D,d.extrudeDirection.values,y*3)}if(l(f)&&Nje(e,t,n,T,f,d.applyOffset.values,y),l(a)&&JL(e,t,n,T,a,d.tangent.values,y,!0),l(s)&&JL(e,t,n,T,s,d.bitangent.values,y,!0),l(c)&&Hle(e,t,n,T,c,d.st.values,y),g>0)for(let C=0;C<g;C++){let E=p[C];Bje(e,t,n,T,y,m[E],d[E])}}}function Bje(e,t,n,i,r,o,a){let s=o.componentsPerAttribute,c=o.values,u=a.values;switch(s){case 4:Lje(e,t,n,i,c,u,r,!1);break;case 3:JL(e,t,n,i,c,u,r,!1);break;case 2:Hle(e,t,n,i,c,u,r,!1);break;default:u[r]=c[e]*i.x+c[t]*i.y+c[n]*i.z}}function zm(e,t,n,i,r,o){let a=e.position.values.length/3;if(r!==-1){let s=i[r],c=n[s];return c===-1?(n[s]=a,e.position.values.push(o.x,o.y,o.z),t.push(a),a):(t.push(c),c)}return e.position.values.push(o.x,o.y,o.z),t.push(a),a}var kje={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function kle(e){let t=e.geometry,n=t.attributes,i=n.position.values,r=l(n.normal)?n.normal.values:void 0,o=l(n.bitangent)?n.bitangent.values:void 0,a=l(n.tangent)?n.tangent.values:void 0,s=l(n.st)?n.st.values:void 0,c=l(n.extrudeDirection)?n.extrudeDirection.values:void 0,u=l(n.applyOffset)?n.applyOffset.values:void 0,f=t.indices,d=[];for(let D in n)n.hasOwnProperty(D)&&!kje[D]&&l(n[D])&&d.push(D);let p=d.length,g=bC(t),m=bC(t),y,A,b,x,T,C=[];C.length=i.length/3;let E=[];for(E.length=i.length/3,T=0;T<C.length;++T)C[T]=-1,E[T]=-1;let w=f.length;for(T=0;T<w;T+=3){let D=f[T],R=f[T+1],M=f[T+2],N=h.fromArray(i,D*3),_=h.fromArray(i,R*3),v=h.fromArray(i,M*3),S=Mje(N,_,v);if(l(S)&&S.positions.length>3){let P=S.positions,L=S.indices,F=L.length;for(let V=0;V<F;++V){let z=L[V],j=P[z];j.y<0?(y=m.attributes,A=m.indices,b=C):(y=g.attributes,A=g.indices,b=E),x=zm(y,A,b,f,z<3?T+z:-1,j),KL(D,R,M,j,i,r,a,o,s,c,u,y,d,p,n,x)}}else l(S)&&(N=S.positions[0],_=S.positions[1],v=S.positions[2]),N.y<0?(y=m.attributes,A=m.indices,b=C):(y=g.attributes,A=g.indices,b=E),x=zm(y,A,b,f,T,N),KL(D,R,M,N,i,r,a,o,s,c,u,y,d,p,n,x),x=zm(y,A,b,f,T+1,_),KL(D,R,M,_,i,r,a,o,s,c,u,y,d,p,n,x),x=zm(y,A,b,f,T+2,v),KL(D,R,M,v,i,r,a,o,s,c,u,y,d,p,n,x)}FY(e,m,g)}var Gle=tn.fromPointNormal(h.ZERO,h.UNIT_Y),zje=new h,Uje=new h;function AC(e,t,n,i,r,o,a){if(!l(a))return;let s=h.fromArray(i,e*3,kI);h.equalsEpsilon(s,n,I.EPSILON10)?o.applyOffset.values[r]=a[e]:o.applyOffset.values[r]=a[t]}function zle(e){let t=e.geometry,n=t.attributes,i=n.position.values,r=l(n.applyOffset)?n.applyOffset.values:void 0,o=t.indices,a=bC(t),s=bC(t),c,u=o.length,f=[];f.length=i.length/3;let d=[];for(d.length=i.length/3,c=0;c<f.length;++c)f[c]=-1,d[c]=-1;for(c=0;c<u;c+=2){let p=o[c],g=o[c+1],m=h.fromArray(i,p*3,kI),y=h.fromArray(i,g*3,MY),A;Math.abs(m.y)<I.EPSILON6&&(m.y<0?m.y=-I.EPSILON6:m.y=I.EPSILON6),Math.abs(y.y)<I.EPSILON6&&(y.y<0?y.y=-I.EPSILON6:y.y=I.EPSILON6);let b=a.attributes,x=a.indices,T=d,C=s.attributes,E=s.indices,w=f,D=ci.lineSegmentPlane(m,y,Gle,LY);if(l(D)){let R=h.multiplyByScalar(h.UNIT_Y,5*I.EPSILON9,zje);m.y<0&&(h.negate(R,R),b=s.attributes,x=s.indices,T=f,C=a.attributes,E=a.indices,w=d);let M=h.add(D,R,Uje);A=zm(b,x,T,o,c,m),AC(p,g,m,i,A,b,r),A=zm(b,x,T,o,-1,M),AC(p,g,M,i,A,b,r),h.negate(R,R),h.add(D,R,M),A=zm(C,E,w,o,-1,M),AC(p,g,M,i,A,C,r),A=zm(C,E,w,o,c+1,y),AC(p,g,y,i,A,C,r)}else{let R,M,N;m.y<0?(R=s.attributes,M=s.indices,N=f):(R=a.attributes,M=a.indices,N=d),A=zm(R,M,N,o,c,m),AC(p,g,m,i,A,R,r),A=zm(R,M,N,o,c+1,y),AC(p,g,y,i,A,R,r)}}FY(e,s,a)}var Ule=new k,Vje=new k,Wle=new h,qle=new h,NY=new h,jje=new h,Hje=new h,Gje=new h,Vle=new ae;function jle(e){let t=e.attributes,n=t.position.values,i=t.prevPosition.values,r=t.nextPosition.values,o=n.length;for(let a=0;a<o;a+=3){let s=h.unpack(n,a,Wle);if(s.x>0)continue;let c=h.unpack(i,a,qle);(s.y<0&&c.y>0||s.y>0&&c.y<0)&&(a-3>0?(i[a]=n[a-3],i[a+1]=n[a-2],i[a+2]=n[a-1]):h.pack(s,i,a));let u=h.unpack(r,a,NY);(s.y<0&&u.y>0||s.y>0&&u.y<0)&&(a+3<o?(r[a]=n[a+3],r[a+1]=n[a+4],r[a+2]=n[a+5]):h.pack(s,r,a))}}var Wje=5*I.EPSILON9,$L=I.EPSILON6;function qje(e){let t=e.geometry,n=t.attributes,i=n.position.values,r=n.prevPosition.values,o=n.nextPosition.values,a=n.expandAndWidth.values,s=l(n.st)?n.st.values:void 0,c=l(n.color)?n.color.values:void 0,u=bC(t),f=bC(t),d,p,g,m=!1,y=i.length/3;for(d=0;d<y;d+=4){let A=d,b=d+2,x=h.fromArray(i,A*3,Wle),T=h.fromArray(i,b*3,qle);if(Math.abs(x.y)<$L)for(x.y=$L*(T.y<0?-1:1),i[d*3+1]=x.y,i[(d+1)*3+1]=x.y,p=A*3;p<A*3+12;p+=3)r[p]=i[d*3],r[p+1]=i[d*3+1],r[p+2]=i[d*3+2];if(Math.abs(T.y)<$L)for(T.y=$L*(x.y<0?-1:1),i[(d+2)*3+1]=T.y,i[(d+3)*3+1]=T.y,p=A*3;p<A*3+12;p+=3)o[p]=i[(d+2)*3],o[p+1]=i[(d+2)*3+1],o[p+2]=i[(d+2)*3+2];let C=u.attributes,E=u.indices,w=f.attributes,D=f.indices,R=ci.lineSegmentPlane(x,T,Gle,jje);if(l(R)){m=!0;let M=h.multiplyByScalar(h.UNIT_Y,Wje,Hje);x.y<0&&(h.negate(M,M),C=f.attributes,E=f.indices,w=u.attributes,D=u.indices);let N=h.add(R,M,Gje);C.position.values.push(x.x,x.y,x.z,x.x,x.y,x.z),C.position.values.push(N.x,N.y,N.z),C.position.values.push(N.x,N.y,N.z),C.prevPosition.values.push(r[A*3],r[A*3+1],r[A*3+2]),C.prevPosition.values.push(r[A*3+3],r[A*3+4],r[A*3+5]),C.prevPosition.values.push(x.x,x.y,x.z,x.x,x.y,x.z),C.nextPosition.values.push(N.x,N.y,N.z),C.nextPosition.values.push(N.x,N.y,N.z),C.nextPosition.values.push(N.x,N.y,N.z),C.nextPosition.values.push(N.x,N.y,N.z),h.negate(M,M),h.add(R,M,N),w.position.values.push(N.x,N.y,N.z),w.position.values.push(N.x,N.y,N.z),w.position.values.push(T.x,T.y,T.z,T.x,T.y,T.z),w.prevPosition.values.push(N.x,N.y,N.z),w.prevPosition.values.push(N.x,N.y,N.z),w.prevPosition.values.push(N.x,N.y,N.z),w.prevPosition.values.push(N.x,N.y,N.z),w.nextPosition.values.push(T.x,T.y,T.z,T.x,T.y,T.z),w.nextPosition.values.push(o[b*3],o[b*3+1],o[b*3+2]),w.nextPosition.values.push(o[b*3+3],o[b*3+4],o[b*3+5]);let _=k.fromArray(a,A*2,Ule),v=Math.abs(_.y);C.expandAndWidth.values.push(-1,v,1,v),C.expandAndWidth.values.push(-1,-v,1,-v),w.expandAndWidth.values.push(-1,v,1,v),w.expandAndWidth.values.push(-1,-v,1,-v);let S=h.magnitudeSquared(h.subtract(R,x,NY));if(S/=h.magnitudeSquared(h.subtract(T,x,NY)),l(c)){let P=ae.fromArray(c,A*4,Vle),L=ae.fromArray(c,b*4,Vle),F=I.lerp(P.x,L.x,S),V=I.lerp(P.y,L.y,S),z=I.lerp(P.z,L.z,S),j=I.lerp(P.w,L.w,S);for(p=A*4;p<A*4+8;++p)C.color.values.push(c[p]);for(C.color.values.push(F,V,z,j),C.color.values.push(F,V,z,j),w.color.values.push(F,V,z,j),w.color.values.push(F,V,z,j),p=b*4;p<b*4+8;++p)w.color.values.push(c[p])}if(l(s)){let P=k.fromArray(s,A*2,Ule),L=k.fromArray(s,(d+3)*2,Vje),F=I.lerp(P.x,L.x,S);for(p=A*2;p<A*2+4;++p)C.st.values.push(s[p]);for(C.st.values.push(F,P.y),C.st.values.push(F,L.y),w.st.values.push(F,P.y),w.st.values.push(F,L.y),p=b*2;p<b*2+4;++p)w.st.values.push(s[p])}g=C.position.values.length/3-4,E.push(g,g+2,g+1),E.push(g+1,g+2,g+3),g=w.position.values.length/3-4,D.push(g,g+2,g+1),D.push(g+1,g+2,g+3)}else{let M,N;for(x.y<0?(M=f.attributes,N=f.indices):(M=u.attributes,N=u.indices),M.position.values.push(x.x,x.y,x.z),M.position.values.push(x.x,x.y,x.z),M.position.values.push(T.x,T.y,T.z),M.position.values.push(T.x,T.y,T.z),p=d*3;p<d*3+12;++p)M.prevPosition.values.push(r[p]),M.nextPosition.values.push(o[p]);for(p=d*2;p<d*2+8;++p)M.expandAndWidth.values.push(a[p]),l(s)&&M.st.values.push(s[p]);if(l(c))for(p=d*4;p<d*4+16;++p)M.color.values.push(c[p]);g=M.position.values.length/3-4,N.push(g,g+2,g+1),N.push(g+1,g+2,g+3)}}m&&(jle(f),jle(u)),FY(e,f,u)}pl.splitLongitude=function(e){let t=e.geometry,n=t.boundingSphere;if(l(n)&&(n.center.x-n.radius>0||se.intersectPlane(n,tn.ORIGIN_ZX_PLANE)!==Xt.INTERSECTING))return e;if(t.geometryType!==nh.NONE)switch(t.geometryType){case nh.POLYLINES:qje(e);break;case nh.TRIANGLES:kle(e);break;case nh.LINES:zle(e);break}else Rje(t),t.primitiveType===Re.TRIANGLES?kle(e):t.primitiveType===Re.LINES&&zle(e);return e};var Gn=pl;var xC=new h,kY=new h,zY=new h,Yle=new h,ts=new k,Xle=new $,Yje=new $,UY=new Fe,Kle=new h,$le=new h,Jle=new h,tN=new de,Zle=new h,Qle=new k,eue=new k;function tue(e,t,n){let i=t.vertexFormat,r=t.center,o=t.semiMajorAxis,a=t.semiMinorAxis,s=t.ellipsoid,c=t.stRotation,u=n?e.length/3*2:e.length/3,f=t.shadowVolume,d=i.st?new Float32Array(u*2):void 0,p=i.normal?new Float32Array(u*3):void 0,g=i.tangent?new Float32Array(u*3):void 0,m=i.bitangent?new Float32Array(u*3):void 0,y=f?new Float32Array(u*3):void 0,A=0,b=Kle,x=$le,T=Jle,C=new ki(s),E=C.project(s.cartesianToCartographic(r,tN),Zle),w=s.scaleToGeodeticSurface(r,xC);s.geodeticSurfaceNormal(w,w);let D=Xle,R=Yje;if(c!==0){let L=Fe.fromAxisAngle(w,c,UY);D=$.fromQuaternion(L,D),L=Fe.fromAxisAngle(w,-c,UY),R=$.fromQuaternion(L,R)}else D=$.clone($.IDENTITY,D),R=$.clone($.IDENTITY,R);let M=k.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Qle),N=k.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,eue),_=e.length,v=n?_:0,S=v/3*2;for(let L=0;L<_;L+=3){let F=L+1,V=L+2,z=h.fromArray(e,L,xC);if(i.st){let j=$.multiplyByVector(D,z,kY),B=C.project(s.cartesianToCartographic(j,tN),zY);h.subtract(B,E,B),ts.x=(B.x+o)/(2*o),ts.y=(B.y+a)/(2*a),M.x=Math.min(ts.x,M.x),M.y=Math.min(ts.y,M.y),N.x=Math.max(ts.x,N.x),N.y=Math.max(ts.y,N.y),n&&(d[A+S]=ts.x,d[A+1+S]=ts.y),d[A++]=ts.x,d[A++]=ts.y}(i.normal||i.tangent||i.bitangent||f)&&(b=s.geodeticSurfaceNormal(z,b),f&&(y[L+v]=-b.x,y[F+v]=-b.y,y[V+v]=-b.z),(i.normal||i.tangent||i.bitangent)&&((i.tangent||i.bitangent)&&(x=h.normalize(h.cross(h.UNIT_Z,b,x),x),$.multiplyByVector(R,x,x)),i.normal&&(p[L]=b.x,p[F]=b.y,p[V]=b.z,n&&(p[L+v]=-b.x,p[F+v]=-b.y,p[V+v]=-b.z)),i.tangent&&(g[L]=x.x,g[F]=x.y,g[V]=x.z,n&&(g[L+v]=-x.x,g[F+v]=-x.y,g[V+v]=-x.z)),i.bitangent&&(T=h.normalize(h.cross(b,x,T),T),m[L]=T.x,m[F]=T.y,m[V]=T.z,n&&(m[L+v]=T.x,m[F+v]=T.y,m[V+v]=T.z))))}if(i.st){_=d.length;for(let L=0;L<_;L+=2)d[L]=(d[L]-M.x)/(N.x-M.x),d[L+1]=(d[L+1]-M.y)/(N.y-M.y)}let P=new xn;if(i.position){let L=Ku.raisePositionsToHeight(e,t,n);P.position=new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:L})}if(i.st&&(P.st=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:d})),i.normal&&(P.normal=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:p})),i.tangent&&(P.tangent=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:g})),i.bitangent&&(P.bitangent=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:m})),f&&(P.extrudeDirection=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:y})),n&&l(t.offsetAttribute)){let L=new Uint8Array(u);if(t.offsetAttribute===mn.TOP)L=L.fill(1,0,u/2);else{let F=t.offsetAttribute===mn.NONE?0:1;L=L.fill(F)}P.applyOffset=new Me({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:L})}return P}function nue(e){let t=new Array(12*(e*(e+1))-6),n=0,i,r,o,a,s;for(i=0,o=1,a=0;a<3;a++)t[n++]=o++,t[n++]=i,t[n++]=o;for(a=2;a<e+1;++a){for(o=a*(a+1)-1,i=(a-1)*a-1,t[n++]=o++,t[n++]=i,t[n++]=o,r=2*a,s=0;s<r-1;++s)t[n++]=o,t[n++]=i++,t[n++]=i,t[n++]=o++,t[n++]=i,t[n++]=o;t[n++]=o++,t[n++]=i,t[n++]=o}for(r=e*2,++o,++i,a=0;a<r-1;++a)t[n++]=o,t[n++]=i++,t[n++]=i,t[n++]=o++,t[n++]=i,t[n++]=o;for(t[n++]=o,t[n++]=i++,t[n++]=i,t[n++]=o++,t[n++]=i++,t[n++]=i,++i,a=e-1;a>1;--a){for(t[n++]=i++,t[n++]=i,t[n++]=o,r=2*a,s=0;s<r-1;++s)t[n++]=o,t[n++]=i++,t[n++]=i,t[n++]=o++,t[n++]=i,t[n++]=o;t[n++]=i++,t[n++]=i++,t[n++]=o++}for(a=0;a<3;a++)t[n++]=i++,t[n++]=i,t[n++]=o;return t}var cb=new h;function Xje(e){let t=e.center;cb=h.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,cb),e.height,cb),cb=h.add(t,cb,cb);let n=new se(cb,e.semiMajorAxis),i=Ku.computeEllipsePositions(e,!0,!1),r=i.positions,o=i.numPts,a=tue(r,e,!1),s=nue(o);return s=Ve.createTypedArray(r.length/3,s),{boundingSphere:n,attributes:a,indices:s}}function Kje(e,t){let n=t.vertexFormat,i=t.center,r=t.semiMajorAxis,o=t.semiMinorAxis,a=t.ellipsoid,s=t.height,c=t.extrudedHeight,u=t.stRotation,f=e.length/3*2,d=new Float64Array(f*3),p=n.st?new Float32Array(f*2):void 0,g=n.normal?new Float32Array(f*3):void 0,m=n.tangent?new Float32Array(f*3):void 0,y=n.bitangent?new Float32Array(f*3):void 0,A=t.shadowVolume,b=A?new Float32Array(f*3):void 0,x=0,T=Kle,C=$le,E=Jle,w=new ki(a),D=w.project(a.cartesianToCartographic(i,tN),Zle),R=a.scaleToGeodeticSurface(i,xC);a.geodeticSurfaceNormal(R,R);let M=Fe.fromAxisAngle(R,u,UY),N=$.fromQuaternion(M,Xle),_=k.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Qle),v=k.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,eue),S=e.length,P=S/3*2;for(let F=0;F<S;F+=3){let V=F+1,z=F+2,j=h.fromArray(e,F,xC),B;if(n.st){let W=$.multiplyByVector(N,j,kY),Q=w.project(a.cartesianToCartographic(W,tN),zY);h.subtract(Q,D,Q),ts.x=(Q.x+r)/(2*r),ts.y=(Q.y+o)/(2*o),_.x=Math.min(ts.x,_.x),_.y=Math.min(ts.y,_.y),v.x=Math.max(ts.x,v.x),v.y=Math.max(ts.y,v.y),p[x+P]=ts.x,p[x+1+P]=ts.y,p[x++]=ts.x,p[x++]=ts.y}j=a.scaleToGeodeticSurface(j,j),B=h.clone(j,kY),T=a.geodeticSurfaceNormal(j,T),A&&(b[F+S]=-T.x,b[V+S]=-T.y,b[z+S]=-T.z);let G=h.multiplyByScalar(T,s,Yle);if(j=h.add(j,G,j),G=h.multiplyByScalar(T,c,G),B=h.add(B,G,B),n.position&&(d[F+S]=B.x,d[V+S]=B.y,d[z+S]=B.z,d[F]=j.x,d[V]=j.y,d[z]=j.z),n.normal||n.tangent||n.bitangent){E=h.clone(T,E);let W=h.fromArray(e,(F+3)%S,Yle);h.subtract(W,j,W);let Q=h.subtract(B,j,zY);T=h.normalize(h.cross(Q,W,T),T),n.normal&&(g[F]=T.x,g[V]=T.y,g[z]=T.z,g[F+S]=T.x,g[V+S]=T.y,g[z+S]=T.z),n.tangent&&(C=h.normalize(h.cross(E,T,C),C),m[F]=C.x,m[V]=C.y,m[z]=C.z,m[F+S]=C.x,m[F+1+S]=C.y,m[F+2+S]=C.z),n.bitangent&&(y[F]=E.x,y[V]=E.y,y[z]=E.z,y[F+S]=E.x,y[V+S]=E.y,y[z+S]=E.z)}}if(n.st){S=p.length;for(let F=0;F<S;F+=2)p[F]=(p[F]-_.x)/(v.x-_.x),p[F+1]=(p[F+1]-_.y)/(v.y-_.y)}let L=new xn;if(n.position&&(L.position=new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:d})),n.st&&(L.st=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:p})),n.normal&&(L.normal=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:g})),n.tangent&&(L.tangent=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:m})),n.bitangent&&(L.bitangent=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:y})),A&&(L.extrudeDirection=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:b})),l(t.offsetAttribute)){let F=new Uint8Array(f);if(t.offsetAttribute===mn.TOP)F=F.fill(1,0,f/2);else{let V=t.offsetAttribute===mn.NONE?0:1;F=F.fill(V)}L.applyOffset=new Me({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:F})}return L}function $je(e){let t=e.length/3,n=Ve.createTypedArray(t,t*6),i=0;for(let r=0;r<t;r++){let o=r,a=r+t,s=(o+1)%t,c=s+t;n[i++]=o,n[i++]=a,n[i++]=s,n[i++]=s,n[i++]=a,n[i++]=c}return n}var QL=new se,eN=new se;function Jje(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,r=h.multiplyByScalar(n.geodeticSurfaceNormal(t,xC),e.height,xC);QL.center=h.add(t,r,QL.center),QL.radius=i,r=h.multiplyByScalar(n.geodeticSurfaceNormal(t,r),e.extrudedHeight,r),eN.center=h.add(t,r,eN.center),eN.radius=i;let o=Ku.computeEllipsePositions(e,!0,!0),a=o.positions,s=o.numPts,c=o.outerPositions,u=se.union(QL,eN),f=tue(a,e,!0),d=nue(s),p=d.length;d.length=p*2;let g=a.length/3;for(let C=0;C<p;C+=3)d[C+p]=d[C+2]+g,d[C+1+p]=d[C+1]+g,d[C+2+p]=d[C]+g;let m=Ve.createTypedArray(g*2/3,d),y=new Tt({attributes:f,indices:m,primitiveType:Re.TRIANGLES}),A=Kje(c,e);d=$je(c);let b=Ve.createTypedArray(c.length*2/3,d),x=new Tt({attributes:A,indices:b,primitiveType:Re.TRIANGLES}),T=Gn.combineInstances([new Bt({geometry:y}),new Bt({geometry:x})]);return{boundingSphere:u,attributes:T[0].attributes,indices:T[0].indices}}function iue(e,t,n,i,r,o,a){let c=Ku.computeEllipsePositions({center:e,semiMajorAxis:t,semiMinorAxis:n,rotation:i,granularity:r},!1,!0).outerPositions,u=c.length/3,f=new Array(u);for(let p=0;p<u;++p)f[p]=h.fromArray(c,p*3);let d=ie.fromCartesianArray(f,o,a);return d.width>I.PI&&(d.north=d.north>0?I.PI_OVER_TWO-I.EPSILON7:d.north,d.south=d.south<0?I.EPSILON7-I.PI_OVER_TWO:d.south,d.east=I.PI,d.west=-I.PI),d}function Vm(e){e=e??H.EMPTY_OBJECT;let t=e.center,n=e.ellipsoid??te.default,i=e.semiMajorAxis,r=e.semiMinorAxis,o=e.granularity??I.RADIANS_PER_DEGREE,a=e.vertexFormat??Be.DEFAULT,s=e.height??0,c=e.extrudedHeight??s;this._center=h.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=r,this._ellipsoid=te.clone(n),this._rotation=e.rotation??0,this._stRotation=e.stRotation??0,this._height=Math.max(c,s),this._granularity=o,this._vertexFormat=Be.clone(a),this._extrudedHeight=Math.min(c,s),this._shadowVolume=e.shadowVolume??!1,this._workerName="createEllipseGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}Vm.packedLength=h.packedLength+te.packedLength+Be.packedLength+9;Vm.pack=function(e,t,n){return n=n??0,h.pack(e._center,t,n),n+=h.packedLength,te.pack(e._ellipsoid,t,n),n+=te.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n++]=e._semiMajorAxis,t[n++]=e._semiMinorAxis,t[n++]=e._rotation,t[n++]=e._stRotation,t[n++]=e._height,t[n++]=e._granularity,t[n++]=e._extrudedHeight,t[n++]=e._shadowVolume?1:0,t[n]=e._offsetAttribute??-1,t};var rue=new h,oue=new te,aue=new Be,Um={center:rue,ellipsoid:oue,vertexFormat:aue,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,stRotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};Vm.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,rue);t+=h.packedLength;let r=te.unpack(e,t,oue);t+=te.packedLength;let o=Be.unpack(e,t,aue);t+=Be.packedLength;let a=e[t++],s=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t++],g=e[t++]===1,m=e[t];return l(n)?(n._center=h.clone(i,n._center),n._ellipsoid=te.clone(r,n._ellipsoid),n._vertexFormat=Be.clone(o,n._vertexFormat),n._semiMajorAxis=a,n._semiMinorAxis=s,n._rotation=c,n._stRotation=u,n._height=f,n._granularity=d,n._extrudedHeight=p,n._shadowVolume=g,n._offsetAttribute=m===-1?void 0:m,n):(Um.height=f,Um.extrudedHeight=p,Um.granularity=d,Um.stRotation=u,Um.rotation=c,Um.semiMajorAxis=a,Um.semiMinorAxis=s,Um.shadowVolume=g,Um.offsetAttribute=m===-1?void 0:m,new Vm(Um))};Vm.computeRectangle=function(e,t){e=e??H.EMPTY_OBJECT;let n=e.center,i=e.ellipsoid??te.default,r=e.semiMajorAxis,o=e.semiMinorAxis,a=e.granularity??I.RADIANS_PER_DEGREE,s=e.rotation??0;return iue(n,r,o,s,a,i,t)};Vm.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!I.equalsEpsilon(t,n,0,I.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let r={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,vertexFormat:e._vertexFormat,stRotation:e._stRotation},o;if(i)r.extrudedHeight=n,r.shadowVolume=e._shadowVolume,r.offsetAttribute=e._offsetAttribute,o=Jje(r);else if(o=Xje(r),l(e._offsetAttribute)){let a=o.attributes.position.values.length,s=e._offsetAttribute===mn.NONE?0:1,c=new Uint8Array(a/3).fill(s);o.attributes.applyOffset=new Me({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new Tt({attributes:o.attributes,indices:o.indices,primitiveType:Re.TRIANGLES,boundingSphere:o.boundingSphere,offsetAttribute:e._offsetAttribute})};Vm.createShadowVolume=function(e,t,n){let i=e._granularity,r=e._ellipsoid,o=t(i,r),a=n(i,r);return new Vm({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:r,rotation:e._rotation,stRotation:e._stRotation,granularity:i,extrudedHeight:o,height:a,vertexFormat:Be.POSITION_ONLY,shadowVolume:!0})};function Zje(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let i=Ku.computeEllipsePositions({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,rotation:e._rotation,granularity:e._granularity},!1,!0).outerPositions,r=i.length/3,o=new Array(r);for(let c=0;c<r;++c)o[c]=h.fromArray(i,c*3);let a=e._ellipsoid,s=e.rectangle;return Tt._textureCoordinateRotationPoints(o,t,a,s)}Object.defineProperties(Vm.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=iue(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=Zje(this)),this._textureCoordinateRotationPoints}}});var eu=Vm;function w0(e){e=e??H.EMPTY_OBJECT;let t=e.radius,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 eu(n),this._workerName="createCircleGeometry"}w0.packedLength=eu.packedLength;w0.pack=function(e,t,n){return eu.pack(e._ellipseGeometry,t,n)};var sue=new eu({center:new h,semiMajorAxis:1,semiMinorAxis:1}),pc={center:new h,radius:void 0,ellipsoid:te.clone(te.default),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new Be,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};w0.unpack=function(e,t,n){let i=eu.unpack(e,t,sue);return pc.center=h.clone(i._center,pc.center),pc.ellipsoid=te.clone(i._ellipsoid,pc.ellipsoid),pc.ellipsoid=te.clone(i._ellipsoid,sue._ellipsoid),pc.height=i._height,pc.extrudedHeight=i._extrudedHeight,pc.granularity=i._granularity,pc.vertexFormat=Be.clone(i._vertexFormat,pc.vertexFormat),pc.stRotation=i._stRotation,pc.shadowVolume=i._shadowVolume,l(n)?(pc.semiMajorAxis=i._semiMajorAxis,pc.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new eu(pc),n):(pc.radius=i._semiMajorAxis,new w0(pc))};w0.createGeometry=function(e){return eu.createGeometry(e._ellipseGeometry)};w0.createShadowVolume=function(e,t,n){let i=e._ellipseGeometry._granularity,r=e._ellipseGeometry._ellipsoid,o=t(i,r),a=n(i,r);return new w0({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:r,stRotation:e._ellipseGeometry._stRotation,granularity:i,extrudedHeight:o,height:a,vertexFormat:Be.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(w0.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}},textureCoordinateRotationPoints:{get:function(){return this._ellipseGeometry.textureCoordinateRotationPoints}}});var cue=w0;var lue=new h,lb=new h;function Qje(e){let t=e.center;lb=h.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,lb),e.height,lb),lb=h.add(t,lb,lb);let n=new se(lb,e.semiMajorAxis),i=Ku.computeEllipsePositions(e,!1,!0).outerPositions,r=new xn({position:new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:Ku.raisePositionsToHeight(i,e,!1)})}),o=i.length/3,a=Ve.createTypedArray(o,o*2),s=0;for(let c=0;c<o;++c)a[s++]=c,a[s++]=(c+1)%o;return{boundingSphere:n,attributes:r,indices:a}}var nN=new se,iN=new se;function e6e(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,r=h.multiplyByScalar(n.geodeticSurfaceNormal(t,lue),e.height,lue);nN.center=h.add(t,r,nN.center),nN.radius=i,r=h.multiplyByScalar(n.geodeticSurfaceNormal(t,r),e.extrudedHeight,r),iN.center=h.add(t,r,iN.center),iN.radius=i;let o=Ku.computeEllipsePositions(e,!1,!0).outerPositions,a=new xn({position:new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:Ku.raisePositionsToHeight(o,e,!0)})});o=a.position.values;let s=se.union(nN,iN),c=o.length/3;if(l(e.offsetAttribute)){let m=new Uint8Array(c);if(e.offsetAttribute===mn.TOP)m=m.fill(1,0,c/2);else{let y=e.offsetAttribute===mn.NONE?0:1;m=m.fill(y)}a.applyOffset=new Me({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:m})}let u=e.numberOfVerticalLines??16;u=I.clamp(u,0,c/2);let f=Ve.createTypedArray(c,c*2+u*2);c/=2;let d=0,p;for(p=0;p<c;++p)f[d++]=p,f[d++]=(p+1)%c,f[d++]=p+c,f[d++]=(p+1)%c+c;let g;if(u>0){let m=Math.min(u,c);g=Math.round(c/m);let y=Math.min(g*u,c);for(p=0;p<y;p+=g)f[d++]=p,f[d++]=p+c}return{boundingSphere:s,attributes:a,indices:f}}function TC(e){e=e??H.EMPTY_OBJECT;let t=e.center,n=e.ellipsoid??te.default,i=e.semiMajorAxis,r=e.semiMinorAxis,o=e.granularity??I.RADIANS_PER_DEGREE,a=e.height??0,s=e.extrudedHeight??a;this._center=h.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=r,this._ellipsoid=te.clone(n),this._rotation=e.rotation??0,this._height=Math.max(s,a),this._granularity=o,this._extrudedHeight=Math.min(s,a),this._numberOfVerticalLines=Math.max(e.numberOfVerticalLines??16,0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}TC.packedLength=h.packedLength+te.packedLength+8;TC.pack=function(e,t,n){return n=n??0,h.pack(e._center,t,n),n+=h.packedLength,te.pack(e._ellipsoid,t,n),n+=te.packedLength,t[n++]=e._semiMajorAxis,t[n++]=e._semiMinorAxis,t[n++]=e._rotation,t[n++]=e._height,t[n++]=e._granularity,t[n++]=e._extrudedHeight,t[n++]=e._numberOfVerticalLines,t[n]=e._offsetAttribute??-1,t};var uue=new h,fue=new te,I0={center:uue,ellipsoid:fue,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};TC.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,uue);t+=h.packedLength;let r=te.unpack(e,t,fue);t+=te.packedLength;let o=e[t++],a=e[t++],s=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t];return l(n)?(n._center=h.clone(i,n._center),n._ellipsoid=te.clone(r,n._ellipsoid),n._semiMajorAxis=o,n._semiMinorAxis=a,n._rotation=s,n._height=c,n._granularity=u,n._extrudedHeight=f,n._numberOfVerticalLines=d,n._offsetAttribute=p===-1?void 0:p,n):(I0.height=c,I0.extrudedHeight=f,I0.granularity=u,I0.rotation=s,I0.semiMajorAxis=o,I0.semiMinorAxis=a,I0.numberOfVerticalLines=d,I0.offsetAttribute=p===-1?void 0:p,new TC(I0))};TC.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!I.equalsEpsilon(t,n,0,I.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let r={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines},o;if(i)r.extrudedHeight=n,r.offsetAttribute=e._offsetAttribute,o=e6e(r);else if(o=Qje(r),l(e._offsetAttribute)){let a=o.attributes.position.values.length,s=e._offsetAttribute===mn.NONE?0:1,c=new Uint8Array(a/3).fill(s);o.attributes.applyOffset=new Me({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new Tt({attributes:o.attributes,indices:o.indices,primitiveType:Re.LINES,boundingSphere:o.boundingSphere,offsetAttribute:e._offsetAttribute})};var Xf=TC;function CC(e){e=e??H.EMPTY_OBJECT;let t=e.radius,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 Xf(n),this._workerName="createCircleOutlineGeometry"}CC.packedLength=Xf.packedLength;CC.pack=function(e,t,n){return Xf.pack(e._ellipseGeometry,t,n)};var t6e=new Xf({center:new h,semiMajorAxis:1,semiMinorAxis:1}),$u={center:new h,radius:void 0,ellipsoid:te.clone(te.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};CC.unpack=function(e,t,n){let i=Xf.unpack(e,t,t6e);return $u.center=h.clone(i._center,$u.center),$u.ellipsoid=te.clone(i._ellipsoid,$u.ellipsoid),$u.height=i._height,$u.extrudedHeight=i._extrudedHeight,$u.granularity=i._granularity,$u.numberOfVerticalLines=i._numberOfVerticalLines,l(n)?($u.semiMajorAxis=i._semiMajorAxis,$u.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new Xf($u),n):($u.radius=i._semiMajorAxis,new CC($u))};CC.createGeometry=function(e){return Xf.createGeometry(e._ellipseGeometry)};var due=CC;var hue={UNBOUNDED:0,CLAMPED:1,LOOP_STOP:2};Object.freeze(hue);var _a=hue;var mue={TICK_DEPENDENT:0,SYSTEM_CLOCK_MULTIPLIER:1,SYSTEM_CLOCK:2};Object.freeze(mue);var Br=mue;var VY;typeof performance<"u"&&typeof performance.now=="function"&&isFinite(performance.now())?VY=function(){return performance.now()}:VY=function(){return Date.now()};var An=VY;function jY(e){e=e??H.EMPTY_OBJECT;let t=e.currentTime,n=e.startTime,i=e.stopTime;l(t)?t=K.clone(t):l(n)?t=K.clone(n):l(i)?t=K.addDays(i,-1,new K):t=K.now(),l(n)?n=K.clone(n):n=K.clone(t),l(i)?i=K.clone(i):i=K.addDays(n,1,new K),this.startTime=n,this.stopTime=i,this.clockRange=e.clockRange??_a.UNBOUNDED,this.canAnimate=e.canAnimate??!0,this.onTick=new be,this.onStop=new be,this._currentTime=void 0,this._multiplier=void 0,this._clockStep=void 0,this._shouldAnimate=void 0,this._lastSystemTime=An(),this.currentTime=t,this.multiplier=e.multiplier??1,this.shouldAnimate=e.shouldAnimate??!1,this.clockStep=e.clockStep??Br.SYSTEM_CLOCK_MULTIPLIER}Object.defineProperties(jY.prototype,{currentTime:{get:function(){return this._currentTime},set:function(e){K.equals(this._currentTime,e)||(this._clockStep===Br.SYSTEM_CLOCK&&(this._clockStep=Br.SYSTEM_CLOCK_MULTIPLIER),this._currentTime=e)}},multiplier:{get:function(){return this._multiplier},set:function(e){this._multiplier!==e&&(this._clockStep===Br.SYSTEM_CLOCK&&(this._clockStep=Br.SYSTEM_CLOCK_MULTIPLIER),this._multiplier=e)}},clockStep:{get:function(){return this._clockStep},set:function(e){e===Br.SYSTEM_CLOCK&&(this._multiplier=1,this._shouldAnimate=!0,this._currentTime=K.now()),this._clockStep=e}},shouldAnimate:{get:function(){return this._shouldAnimate},set:function(e){this._shouldAnimate!==e&&(this._clockStep===Br.SYSTEM_CLOCK&&(this._clockStep=Br.SYSTEM_CLOCK_MULTIPLIER),this._shouldAnimate=e)}}});jY.prototype.tick=function(){let e=An(),t=K.clone(this._currentTime);if(this.canAnimate&&this._shouldAnimate){let n=this._clockStep;if(n===Br.SYSTEM_CLOCK)t=K.now(t);else{let i=this._multiplier;if(n===Br.TICK_DEPENDENT)t=K.addSeconds(t,i,t);else{let s=e-this._lastSystemTime;t=K.addSeconds(t,i*(s/1e3),t)}let r=this.clockRange,o=this.startTime,a=this.stopTime;if(r===_a.CLAMPED)K.lessThan(t,o)?t=K.clone(o,t):K.greaterThan(t,a)&&(t=K.clone(a,t),this.onStop.raiseEvent(this));else if(r===_a.LOOP_STOP)for(K.lessThan(t,o)&&(t=K.clone(o,t));K.greaterThan(t,a);)t=K.addSeconds(o,K.secondsDifference(t,a),t),this.onStop.raiseEvent(this)}}return this._currentTime=t,this._lastSystemTime=e,this.onTick.raiseEvent(this),t};var jm=jY;function vC(e,t,n,i){e=e??1,t=t??1,n=n??1,i=i??1,this.value=new Uint8Array([U.floatToByte(e),U.floatToByte(t),U.floatToByte(n),U.floatToByte(i)])}Object.defineProperties(vC.prototype,{componentDatatype:{get:function(){return Y.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}});vC.fromColor=function(e){return new vC(e.red,e.green,e.blue,e.alpha)};vC.toValue=function(e,t){return l(t)?e.toBytes(t):new Uint8Array(e.toBytes())};vC.equals=function(e,t){return e===t||l(e)&&l(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 Kt=vC;function EC(e){this._value=e,this._valueType=Er.getPointType(e)}Object.defineProperties(EC.prototype,{value:{get:function(){return this._value}}});EC.prototype.findTimeInterval=function(e){};EC.prototype.wrapTime=function(e){return 0};EC.prototype.clampTime=function(e){return 0};EC.prototype.evaluate=function(e,t){let n=this._value,i=this._valueType;return i===Number?n:i.clone(n,t)};var rN=EC;var pue=I.EPSILON10;function n6e(e,t,n,i){if(!l(e))return;n=n??!1;let r=l(i),o=e.length;if(o<2)return e;let a,s=e[0],c,u,f=0,d=-1;for(a=1;a<o;++a)c=e[a],t(s,c,pue)?(l(u)||(u=e.slice(0,a),f=a-1,d=0),r&&i.push(a)):(l(u)&&(u.push(c),f=a,r&&(d=i.length)),s=c);return n&&t(e[0],e[o-1],pue)&&(r&&(l(u)?i.splice(d,0,f):i.push(o-1)),l(u)?u.length-=1:u=e.slice(0,-1)),l(u)?u:e}var Pr=n6e;var zI={},i6e=new h,gue=new h,_ue=new h,yue=new h,Aue=new Jt;zI.validOutline=function(e){let n=Jt.fromPoints(e,Aue).halfAxes,i=$.getColumn(n,0,gue),r=$.getColumn(n,1,_ue),o=$.getColumn(n,2,yue),a=h.magnitude(i),s=h.magnitude(r),c=h.magnitude(o);return!(a===0&&(s===0||c===0)||s===0&&c===0)};zI.computeProjectTo2DArguments=function(e,t,n,i){let r=Jt.fromPoints(e,Aue),o=r.halfAxes,a=$.getColumn(o,0,gue),s=$.getColumn(o,1,_ue),c=$.getColumn(o,2,yue),u=h.magnitude(a),f=h.magnitude(s),d=h.magnitude(c),p=Math.min(u,f,d);if(u===0&&(f===0||d===0)||f===0&&d===0)return!1;let g,m;return(p===f||p===d)&&(g=a),p===u?g=s:p===d&&(m=s),(p===u||p===f)&&(m=c),h.normalize(g,n),h.normalize(m,i),h.clone(r.center,t),!0};function bue(e,t,n,i,r){let o=h.subtract(e,t,i6e),a=h.dot(n,o),s=h.dot(i,o);return k.fromElements(a,s,r)}zI.createProjectPointsTo2DFunction=function(e,t,n){return function(i){let r=new Array(i.length);for(let o=0;o<i.length;o++)r[o]=bue(i[o],e,t,n);return r}};zI.createProjectPointTo2DFunction=function(e,t,n){return function(i,r){return bue(i,e,t,n,r)}};var x_=zI;function GY(e,t,n){if(e===0)return t*n;let i=e*e,r=i*i,o=r*i,a=o*i,s=a*i,c=s*i,u=n,f=Math.sin(2*u),d=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*r/64-5*o/256-175*a/16384-441*s/65536-4851*c/1048576)*u-(3*i/8+3*r/32+45*o/1024+105*a/4096+2205*s/131072+6237*c/524288)*f+(15*r/256+45*o/1024+525*a/16384+1575*s/65536+155925*c/8388608)*d-(35*o/3072+175*a/12288+3675*s/262144+13475*c/1048576)*p+(315*a/131072+2205*s/524288+43659*c/8388608)*g-(693*s/1310720+6237*c/5242880)*m+1001*c/8388608*y)}function r6e(e,t,n){let i=e/n;if(t===0)return i;let r=i*i,o=r*i,a=o*i,s=t,c=s*s,u=c*c,f=u*c,d=f*c,p=d*c,g=p*c,m=Math.sin(2*i),y=Math.cos(2*i),A=Math.sin(4*i),b=Math.cos(4*i),x=Math.sin(6*i),T=Math.cos(6*i),C=Math.sin(8*i),E=Math.cos(8*i),w=Math.sin(10*i),D=Math.cos(10*i),R=Math.sin(12*i);return i+i*c/4+7*i*u/64+15*i*f/256+579*i*d/16384+1515*i*p/65536+16837*i*g/1048576+(3*i*u/16+45*i*f/256-i*(32*r-561)*d/4096-i*(232*r-1677)*p/16384+i*(399985-90560*r+512*a)*g/5242880)*y+(21*i*f/256+483*i*d/4096-i*(224*r-1969)*p/16384-i*(33152*r-112599)*g/1048576)*b+(151*i*d/4096+4681*i*p/65536+1479*i*g/16384-453*o*g/32768)*T+(1097*i*p/65536+42783*i*g/1048576)*E+8011*i*g/1048576*D+(3*c/8+3*u/16+213*f/2048-3*r*f/64+255*d/4096-33*r*d/512+20861*p/524288-33*r*p/512+a*p/1024+28273*g/1048576-471*r*g/8192+9*a*g/4096)*m+(21*u/256+21*f/256+533*d/8192-21*r*d/512+197*p/4096-315*r*p/4096+584039*g/16777216-12517*r*g/131072+7*a*g/2048)*A+(151*f/6144+151*d/4096+5019*p/131072-453*r*p/16384+26965*g/786432-8607*r*g/131072)*x+(1097*d/131072+1097*p/65536+225797*g/10485760-1097*r*g/65536)*C+(8011*p/2621440+8011*g/1048576)*w+293393*g/251658240*R}function SC(e,t){if(e===0)return Math.log(Math.tan(.5*(I.PI_OVER_TWO+t)));let n=e*Math.sin(t);return Math.log(Math.tan(.5*(I.PI_OVER_TWO+t)))-e/2*Math.log((1+n)/(1-n))}function o6e(e,t,n,i,r){let o=SC(e._ellipticity,n),a=SC(e._ellipticity,r);return Math.atan2(I.negativePiToPi(i-t),a-o)}function a6e(e,t,n,i,r,o,a){let s=e._heading,c=o-i,u;if(I.equalsEpsilon(Math.abs(s),I.PI_OVER_TWO,I.EPSILON8))if(t===n)u=t*Math.cos(r)*I.negativePiToPi(c);else{let f=Math.sin(r);u=t*Math.cos(r)*I.negativePiToPi(c)/Math.sqrt(1-e._ellipticitySquared*f*f)}else{let f=GY(e._ellipticity,t,r);u=(GY(e._ellipticity,t,a)-f)/Math.cos(s)}return Math.abs(u)}var s6e=new h,HY=new h;function xue(e,t,n,i){let r=h.normalize(i.cartographicToCartesian(t,HY),s6e),o=h.normalize(i.cartographicToCartesian(n,HY),HY),a=i.maximumRadius,s=i.minimumRadius,c=a*a,u=s*s;e._ellipticitySquared=(c-u)/c,e._ellipticity=Math.sqrt(e._ellipticitySquared),e._start=de.clone(t,e._start),e._start.height=0,e._end=de.clone(n,e._end),e._end.height=0,e._heading=o6e(e,t.longitude,t.latitude,n.longitude,n.latitude),e._distance=a6e(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude)}function Tue(e,t,n,i,r,o){if(n===0)return de.clone(e,o);let a=r*r,s,c,u;if(Math.abs(I.PI_OVER_TWO-Math.abs(t))>I.EPSILON8){let f=GY(r,i,e.latitude),d=n*Math.cos(t),p=f+d;if(c=r6e(p,r,i),Math.abs(t)<I.EPSILON10)s=I.negativePiToPi(e.longitude);else{let g=SC(r,e.latitude),m=SC(r,c);u=Math.tan(t)*(m-g),s=I.negativePiToPi(e.longitude+u)}}else{c=e.latitude;let f;if(r===0)f=i*Math.cos(e.latitude);else{let d=Math.sin(e.latitude);f=i*Math.cos(e.latitude)/Math.sqrt(1-a*d*d)}u=n/f,t>0?s=I.negativePiToPi(e.longitude+u):s=I.negativePiToPi(e.longitude-u)}return l(o)?(o.longitude=s,o.latitude=c,o.height=0,o):new de(s,c,0)}function P0(e,t,n){let i=n??te.default;this._ellipsoid=i,this._start=new de,this._end=new de,this._heading=void 0,this._distance=void 0,this._ellipticity=void 0,this._ellipticitySquared=void 0,l(e)&&l(t)&&xue(this,e,t,i)}Object.defineProperties(P0.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},heading:{get:function(){return this._heading}}});P0.fromStartHeadingDistance=function(e,t,n,i,r){let o=i??te.default,a=o.maximumRadius,s=o.minimumRadius,c=a*a,u=s*s,f=Math.sqrt((c-u)/c);t=I.negativePiToPi(t);let d=Tue(e,t,n,o.maximumRadius,f);return!l(r)||l(i)&&!i.equals(r.ellipsoid)?new P0(e,d,o):(r.setEndPoints(e,d),r)};P0.prototype.setEndPoints=function(e,t){xue(this,e,t,this._ellipsoid)};P0.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(e*this._distance,t)};P0.prototype.interpolateUsingSurfaceDistance=function(e,t){return Tue(this._start,this._heading,e,this._ellipsoid.maximumRadius,this._ellipticity,t)};P0.prototype.findIntersectionWithLongitude=function(e,t){let n=this._ellipticity,i=this._heading,r=Math.abs(i),o=this._start;if(e=I.negativePiToPi(e),I.equalsEpsilon(Math.abs(e),Math.PI,I.EPSILON14)&&(e=I.sign(o.longitude)*Math.PI),l(t)||(t=new de),Math.abs(I.PI_OVER_TWO-r)<=I.EPSILON8)return t.longitude=e,t.latitude=o.latitude,t.height=0,t;if(I.equalsEpsilon(Math.abs(I.PI_OVER_TWO-r),I.PI_OVER_TWO,I.EPSILON8))return I.equalsEpsilon(e,o.longitude,I.EPSILON12)?void 0:(t.longitude=e,t.latitude=I.PI_OVER_TWO*I.sign(I.PI_OVER_TWO-i),t.height=0,t);let a=o.latitude,s=n*Math.sin(a),c=Math.tan(.5*(I.PI_OVER_TWO+a))*Math.exp((e-o.longitude)/Math.tan(i)),u=(1+s)/(1-s),f=o.latitude,d;do{d=f;let p=n*Math.sin(d),g=(1+p)/(1-p);f=2*Math.atan(c*Math.pow(g/u,n/2))-I.PI_OVER_TWO}while(!I.equalsEpsilon(f,d,I.EPSILON12));return t.longitude=e,t.latitude=f,t.height=0,t};P0.prototype.findIntersectionWithLatitude=function(e,t){let n=this._ellipticity,i=this._heading,r=this._start;if(I.equalsEpsilon(Math.abs(i),I.PI_OVER_TWO,I.EPSILON8))return;let o=SC(n,r.latitude),a=SC(n,e),s=Math.tan(i)*(a-o),c=I.negativePiToPi(r.longitude+s);return l(t)?(t.longitude=c,t.latitude=e,t.height=0,t):new de(c,e,0)};var Uc=P0;function c6e(e,t){this.positions=l(e)?e:[],this.holes=l(t)?t:[]}var Vc=c6e;function YY(e,t,n=2){let i=t&&t.length,r=i?t[0]*n:e.length,o=vue(e,0,r,n,!0),a=[];if(!o||o.next===o.prev)return a;let s,c,u;if(i&&(o=h6e(e,t,o,n)),e.length>80*n){s=e[0],c=e[1];let f=s,d=c;for(let p=n;p<r;p+=n){let g=e[p],m=e[p+1];g<s&&(s=g),m<c&&(c=m),g>f&&(f=g),m>d&&(d=m)}u=Math.max(f-s,d-c),u=u!==0?32767/u:0}return VI(o,a,n,s,c,u,0),a}function vue(e,t,n,i,r){let o;if(r===v6e(e,t,n,i)>0)for(let a=t;a<n;a+=i)o=Cue(a/i|0,e[a],e[a+1],o);else for(let a=n-i;a>=t;a-=i)o=Cue(a/i|0,e[a],e[a+1],o);return o&&wC(o,o.next)&&(HI(o),o=o.next),o}function ub(e,t){if(!e)return e;t||(t=e);let n=e,i;do if(i=!1,!n.steiner&&(wC(n,n.next)||ea(n.prev,n,n.next)===0)){if(HI(n),n=t=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==t);return t}function VI(e,t,n,i,r,o,a){if(!e)return;!a&&o&&y6e(e,i,r,o);let s=e;for(;e.prev!==e.next;){let c=e.prev,u=e.next;if(o?u6e(e,i,r,o):l6e(e)){t.push(c.i,e.i,u.i),HI(e),e=u.next,s=u.next;continue}if(e=u,e===s){a?a===1?(e=f6e(ub(e),t),VI(e,t,n,i,r,o,2)):a===2&&d6e(e,t,n,i,r,o):VI(ub(e),t,n,i,r,o,1);break}}}function l6e(e){let t=e.prev,n=e,i=e.next;if(ea(t,n,i)>=0)return!1;let r=t.x,o=n.x,a=i.x,s=t.y,c=n.y,u=i.y,f=Math.min(r,o,a),d=Math.min(s,c,u),p=Math.max(r,o,a),g=Math.max(s,c,u),m=i.next;for(;m!==t;){if(m.x>=f&&m.x<=p&&m.y>=d&&m.y<=g&&UI(r,s,o,c,a,u,m.x,m.y)&&ea(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function u6e(e,t,n,i){let r=e.prev,o=e,a=e.next;if(ea(r,o,a)>=0)return!1;let s=r.x,c=o.x,u=a.x,f=r.y,d=o.y,p=a.y,g=Math.min(s,c,u),m=Math.min(f,d,p),y=Math.max(s,c,u),A=Math.max(f,d,p),b=WY(g,m,t,n,i),x=WY(y,A,t,n,i),T=e.prevZ,C=e.nextZ;for(;T&&T.z>=b&&C&&C.z<=x;){if(T.x>=g&&T.x<=y&&T.y>=m&&T.y<=A&&T!==r&&T!==a&&UI(s,f,c,d,u,p,T.x,T.y)&&ea(T.prev,T,T.next)>=0||(T=T.prevZ,C.x>=g&&C.x<=y&&C.y>=m&&C.y<=A&&C!==r&&C!==a&&UI(s,f,c,d,u,p,C.x,C.y)&&ea(C.prev,C,C.next)>=0))return!1;C=C.nextZ}for(;T&&T.z>=b;){if(T.x>=g&&T.x<=y&&T.y>=m&&T.y<=A&&T!==r&&T!==a&&UI(s,f,c,d,u,p,T.x,T.y)&&ea(T.prev,T,T.next)>=0)return!1;T=T.prevZ}for(;C&&C.z<=x;){if(C.x>=g&&C.x<=y&&C.y>=m&&C.y<=A&&C!==r&&C!==a&&UI(s,f,c,d,u,p,C.x,C.y)&&ea(C.prev,C,C.next)>=0)return!1;C=C.nextZ}return!0}function f6e(e,t){let n=e;do{let i=n.prev,r=n.next.next;!wC(i,r)&&Sue(i,n,n.next,r)&&jI(i,r)&&jI(r,i)&&(t.push(i.i,n.i,r.i),HI(n),HI(n.next),n=e=r),n=n.next}while(n!==e);return ub(n)}function d6e(e,t,n,i,r,o){let a=e;do{let s=a.next.next;for(;s!==a.prev;){if(a.i!==s.i&&x6e(a,s)){let c=wue(a,s);a=ub(a,a.next),c=ub(c,c.next),VI(a,t,n,i,r,o,0),VI(c,t,n,i,r,o,0);return}s=s.next}a=a.next}while(a!==e)}function h6e(e,t,n,i){let r=[];for(let o=0,a=t.length;o<a;o++){let s=t[o]*i,c=o<a-1?t[o+1]*i:e.length,u=vue(e,s,c,i,!1);u===u.next&&(u.steiner=!0),r.push(b6e(u))}r.sort(m6e);for(let o=0;o<r.length;o++)n=p6e(r[o],n);return n}function m6e(e,t){let n=e.x-t.x;if(n===0&&(n=e.y-t.y,n===0)){let i=(e.next.y-e.y)/(e.next.x-e.x),r=(t.next.y-t.y)/(t.next.x-t.x);n=i-r}return n}function p6e(e,t){let n=g6e(e,t);if(!n)return t;let i=wue(n,e);return ub(i,i.next),ub(n,n.next)}function g6e(e,t){let n=t,i=e.x,r=e.y,o=-1/0,a;if(wC(e,n))return n;do{if(wC(e,n.next))return n.next;if(r<=n.y&&r>=n.next.y&&n.next.y!==n.y){let d=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(d<=i&&d>o&&(o=d,a=n.x<n.next.x?n:n.next,d===i))return a}n=n.next}while(n!==t);if(!a)return null;let s=a,c=a.x,u=a.y,f=1/0;n=a;do{if(i>=n.x&&n.x>=c&&i!==n.x&&Eue(r<u?i:o,r,c,u,r<u?o:i,r,n.x,n.y)){let d=Math.abs(r-n.y)/(i-n.x);jI(n,e)&&(d<f||d===f&&(n.x>a.x||n.x===a.x&&_6e(a,n)))&&(a=n,f=d)}n=n.next}while(n!==s);return a}function _6e(e,t){return ea(e.prev,e,t.prev)<0&&ea(t.next,e,e.next)<0}function y6e(e,t,n,i){let r=e;do r.z===0&&(r.z=WY(r.x,r.y,t,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==e);r.prevZ.nextZ=null,r.prevZ=null,A6e(r)}function A6e(e){let t,n=1;do{let i=e,r;e=null;let o=null;for(t=0;i;){t++;let a=i,s=0;for(let u=0;u<n&&(s++,a=a.nextZ,!!a);u++);let c=n;for(;s>0||c>0&&a;)s!==0&&(c===0||!a||i.z<=a.z)?(r=i,i=i.nextZ,s--):(r=a,a=a.nextZ,c--),o?o.nextZ=r:e=r,r.prevZ=o,o=r;i=a}o.nextZ=null,n*=2}while(t>1);return e}function WY(e,t,n,i,r){return e=(e-n)*r|0,t=(t-i)*r|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 b6e(e){let t=e,n=e;do(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next;while(t!==e);return n}function Eue(e,t,n,i,r,o,a,s){return(r-a)*(t-s)>=(e-a)*(o-s)&&(e-a)*(i-s)>=(n-a)*(t-s)&&(n-a)*(o-s)>=(r-a)*(i-s)}function UI(e,t,n,i,r,o,a,s){return!(e===a&&t===s)&&Eue(e,t,n,i,r,o,a,s)}function x6e(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!T6e(e,t)&&(jI(e,t)&&jI(t,e)&&C6e(e,t)&&(ea(e.prev,e,t.prev)||ea(e,t.prev,t))||wC(e,t)&&ea(e.prev,e,e.next)>0&&ea(t.prev,t,t.next)>0)}function ea(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function wC(e,t){return e.x===t.x&&e.y===t.y}function Sue(e,t,n,i){let r=aN(ea(e,t,n)),o=aN(ea(e,t,i)),a=aN(ea(n,i,e)),s=aN(ea(n,i,t));return!!(r!==o&&a!==s||r===0&&oN(e,n,t)||o===0&&oN(e,i,t)||a===0&&oN(n,e,i)||s===0&&oN(n,t,i))}function oN(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 aN(e){return e>0?1:e<0?-1:0}function T6e(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&&Sue(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function jI(e,t){return ea(e.prev,e,e.next)<0?ea(e,t,e.next)>=0&&ea(e,e.prev,t)>=0:ea(e,t,e.prev)<0||ea(e,e.next,t)<0}function C6e(e,t){let n=e,i=!1,r=(e.x+t.x)/2,o=(e.y+t.y)/2;do n.y>o!=n.next.y>o&&n.next.y!==n.y&&r<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next;while(n!==e);return i}function wue(e,t){let n=qY(e.i,e.x,e.y),i=qY(t.i,t.x,t.y),r=e.next,o=t.prev;return e.next=t,t.prev=e,n.next=r,r.prev=n,i.next=n,n.prev=i,o.next=i,i.prev=o,i}function Cue(e,t,n,i){let r=qY(e,t,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function HI(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 qY(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function v6e(e,t,n,i){let r=0;for(let o=t,a=n-i;o<n;o+=i)r+=(e[a]-e[o])*(e[o+1]+e[a+1]),a=o;return r}var GI={CLOCKWISE:ee.CW,COUNTER_CLOCKWISE:ee.CCW};GI.validate=function(e){return e===GI.CLOCKWISE||e===GI.COUNTER_CLOCKWISE};Object.freeze(GI);var ns=GI;var E6e=new h,S6e=new h,T_={};T_.computeArea2D=function(e){let t=e.length,n=0;for(let i=t-1,r=0;r<t;i=r++){let o=e[i],a=e[r];n+=o.x*a.y-a.x*o.y}return n*.5};T_.computeWindingOrder2D=function(e){return T_.computeArea2D(e)>0?ns.COUNTER_CLOCKWISE:ns.CLOCKWISE};T_.triangulate=function(e,t){let n=k.packArray(e);return YY(n,t,2)};var Rue=new h,Oue=new h,Mue=new h,Iue=new h,Pue=new h,Due=new h,D0=new h,Lue=new k,Nue=new k,Fue=new k,IC=new k;T_.computeSubdivision=function(e,t,n,i,r){r=r??I.RADIANS_PER_DEGREE;let o=l(i),a=n.slice(0),s,c=t.length,u=new Array(c*3),f=new Array(c*2),d=0,p=0;for(s=0;s<c;s++){let T=t[s];if(u[d++]=T.x,u[d++]=T.y,u[d++]=T.z,o){let C=i[s];f[p++]=C.x,f[p++]=C.y}}let g=[],m={},y=e.maximumRadius,A=I.chordLength(r,y),b=A*A;for(;a.length>0;){let T=a.pop(),C=a.pop(),E=a.pop(),w=h.fromArray(u,E*3,Rue),D=h.fromArray(u,C*3,Oue),R=h.fromArray(u,T*3,Mue),M,N,_;o&&(M=k.fromArray(f,E*2,Lue),N=k.fromArray(f,C*2,Nue),_=k.fromArray(f,T*2,Fue));let v=h.multiplyByScalar(h.normalize(w,Iue),y,Iue),S=h.multiplyByScalar(h.normalize(D,Pue),y,Pue),P=h.multiplyByScalar(h.normalize(R,Due),y,Due),L=h.magnitudeSquared(h.subtract(v,S,D0)),F=h.magnitudeSquared(h.subtract(S,P,D0)),V=h.magnitudeSquared(h.subtract(P,v,D0)),z=Math.max(L,F,V),j,B,G;z>b?L===z?(j=`${Math.min(E,C)} ${Math.max(E,C)}`,s=m[j],l(s)||(B=h.add(w,D,D0),h.multiplyByScalar(B,.5,B),u.push(B.x,B.y,B.z),s=u.length/3-1,m[j]=s,o&&(G=k.add(M,N,IC),k.multiplyByScalar(G,.5,G),f.push(G.x,G.y))),a.push(E,s,T),a.push(s,C,T)):F===z?(j=`${Math.min(C,T)} ${Math.max(C,T)}`,s=m[j],l(s)||(B=h.add(D,R,D0),h.multiplyByScalar(B,.5,B),u.push(B.x,B.y,B.z),s=u.length/3-1,m[j]=s,o&&(G=k.add(N,_,IC),k.multiplyByScalar(G,.5,G),f.push(G.x,G.y))),a.push(C,s,E),a.push(s,T,E)):V===z&&(j=`${Math.min(T,E)} ${Math.max(T,E)}`,s=m[j],l(s)||(B=h.add(R,w,D0),h.multiplyByScalar(B,.5,B),u.push(B.x,B.y,B.z),s=u.length/3-1,m[j]=s,o&&(G=k.add(_,M,IC),k.multiplyByScalar(G,.5,G),f.push(G.x,G.y))),a.push(T,s,C),a.push(s,E,C)):(g.push(E),g.push(C),g.push(T))}let x={attributes:{position:new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:u})},indices:g,primitiveType:Re.TRIANGLES};return o&&(x.attributes.st=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:f})),new Tt(x)};var w6e=new de,I6e=new de,P6e=new de,XY=new de;T_.computeRhumbLineSubdivision=function(e,t,n,i,r){r=r??I.RADIANS_PER_DEGREE;let o=l(i),a=n.slice(0),s,c=t.length,u=new Array(c*3),f=new Array(c*2),d=0,p=0;for(s=0;s<c;s++){let E=t[s];if(u[d++]=E.x,u[d++]=E.y,u[d++]=E.z,o){let w=i[s];f[p++]=w.x,f[p++]=w.y}}let g=[],m={},y=e.maximumRadius,A=I.chordLength(r,y),b=new Uc(void 0,void 0,e),x=new Uc(void 0,void 0,e),T=new Uc(void 0,void 0,e);for(;a.length>0;){let E=a.pop(),w=a.pop(),D=a.pop(),R=h.fromArray(u,D*3,Rue),M=h.fromArray(u,w*3,Oue),N=h.fromArray(u,E*3,Mue),_,v,S;o&&(_=k.fromArray(f,D*2,Lue),v=k.fromArray(f,w*2,Nue),S=k.fromArray(f,E*2,Fue));let P=e.cartesianToCartographic(R,w6e),L=e.cartesianToCartographic(M,I6e),F=e.cartesianToCartographic(N,P6e);b.setEndPoints(P,L);let V=b.surfaceDistance;x.setEndPoints(L,F);let z=x.surfaceDistance;T.setEndPoints(F,P);let j=T.surfaceDistance,B=Math.max(V,z,j),G,W,Q,q,J;B>A?V===B?(G=`${Math.min(D,w)} ${Math.max(D,w)}`,s=m[G],l(s)||(W=b.interpolateUsingFraction(.5,XY),Q=(P.height+L.height)*.5,q=h.fromRadians(W.longitude,W.latitude,Q,e,D0),u.push(q.x,q.y,q.z),s=u.length/3-1,m[G]=s,o&&(J=k.add(_,v,IC),k.multiplyByScalar(J,.5,J),f.push(J.x,J.y))),a.push(D,s,E),a.push(s,w,E)):z===B?(G=`${Math.min(w,E)} ${Math.max(w,E)}`,s=m[G],l(s)||(W=x.interpolateUsingFraction(.5,XY),Q=(L.height+F.height)*.5,q=h.fromRadians(W.longitude,W.latitude,Q,e,D0),u.push(q.x,q.y,q.z),s=u.length/3-1,m[G]=s,o&&(J=k.add(v,S,IC),k.multiplyByScalar(J,.5,J),f.push(J.x,J.y))),a.push(w,s,D),a.push(s,E,D)):j===B&&(G=`${Math.min(E,D)} ${Math.max(E,D)}`,s=m[G],l(s)||(W=T.interpolateUsingFraction(.5,XY),Q=(F.height+P.height)*.5,q=h.fromRadians(W.longitude,W.latitude,Q,e,D0),u.push(q.x,q.y,q.z),s=u.length/3-1,m[G]=s,o&&(J=k.add(S,_,IC),k.multiplyByScalar(J,.5,J),f.push(J.x,J.y))),a.push(E,s,w),a.push(s,D,w)):(g.push(D),g.push(w),g.push(E))}let C={attributes:{position:new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:u})},indices:g,primitiveType:Re.TRIANGLES};return o&&(C.attributes.st=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:f})),new Tt(C)};T_.scaleToGeodeticHeight=function(e,t,n,i){n=n??te.default;let r=E6e,o=S6e;if(t=t??0,i=i??!0,l(e)){let a=e.length;for(let s=0;s<a;s+=3)h.fromArray(e,s,o),i&&(o=n.scaleToGeodeticSurface(o,o)),t!==0&&(r=n.geodeticSurfaceNormal(o,r),h.multiplyByScalar(r,t,r),h.add(o,r,o)),e[s]=o.x,e[s+1]=o.y,e[s+2]=o.z}return e};var li=T_;function C_(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(C_.prototype,{length:{get:function(){return this._length}}});C_.prototype.enqueue=function(e){this._array.push(e),this._length++};C_.prototype.dequeue=function(){if(this._length===0)return;let e=this._array,t=this._offset,n=e[t];return e[t]=void 0,t++,t>10&&t*2>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this._length--,n};C_.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};C_.prototype.contains=function(e){return this._array.indexOf(e)!==-1};C_.prototype.clear=function(){this._array.length=this._offset=this._length=0};C_.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)};var fb=C_;var go={};go.computeHierarchyPackedLength=function(e,t){let n=0,i=[e];for(;i.length>0;){let r=i.pop();if(!l(r))continue;n+=2;let o=r.positions,a=r.holes;if(l(o)&&o.length>0&&(n+=o.length*t.packedLength),l(a)){let s=a.length;for(let c=0;c<s;++c)i.push(a[c])}}return n};go.packPolygonHierarchy=function(e,t,n,i){let r=[e];for(;r.length>0;){let o=r.pop();if(!l(o))continue;let a=o.positions,s=o.holes;if(t[n++]=l(a)?a.length:0,t[n++]=l(s)?s.length:0,l(a)){let c=a.length;for(let u=0;u<c;++u,n+=i.packedLength)i.pack(a[u],t,n)}if(l(s)){let c=s.length;for(let u=0;u<c;++u)r.push(s[u])}}return n};go.unpackPolygonHierarchy=function(e,t,n){let i=e[t++],r=e[t++],o=new Array(i),a=r>0?new Array(r):void 0;for(let s=0;s<i;++s,t+=n.packedLength)o[s]=n.unpack(e,t);for(let s=0;s<r;++s)a[s]=go.unpackPolygonHierarchy(e,t,n),t=a[s].startingIndex,delete a[s].startingIndex;return{positions:o,holes:a,startingIndex:t}};var db=new k;function zue(e,t,n,i){return k.subtract(t,e,db),k.multiplyByScalar(db,n/i,db),k.add(e,db,db),[db.x,db.y]}var v_=new h;function D6e(e,t,n,i){return h.subtract(t,e,v_),h.multiplyByScalar(v_,n/i,v_),h.add(e,v_,v_),[v_.x,v_.y,v_.z]}go.subdivideLineCount=function(e,t,n){let r=h.distance(e,t)/n,o=Math.max(0,Math.ceil(I.log2(r)));return Math.pow(2,o)};var cN=new de,lN=new de,R6e=new de,O6e=new h,sN=new Uc;go.subdivideRhumbLineCount=function(e,t,n,i){let r=e.cartesianToCartographic(t,cN),o=e.cartesianToCartographic(n,lN),s=new Uc(r,o,e).surfaceDistance/i,c=Math.max(0,Math.ceil(I.log2(s)));return Math.pow(2,c)};go.subdivideTexcoordLine=function(e,t,n,i,r,o){let a=go.subdivideLineCount(n,i,r),s=k.distance(e,t),c=s/a,u=o;u.length=a*2;let f=0;for(let d=0;d<a;d++){let p=zue(e,t,d*c,s);u[f++]=p[0],u[f++]=p[1]}return u};go.subdivideLine=function(e,t,n,i){let r=go.subdivideLineCount(e,t,n),o=h.distance(e,t),a=o/r;l(i)||(i=[]);let s=i;s.length=r*3;let c=0;for(let u=0;u<r;u++){let f=D6e(e,t,u*a,o);s[c++]=f[0],s[c++]=f[1],s[c++]=f[2]}return s};go.subdivideTexcoordRhumbLine=function(e,t,n,i,r,o,a){let s=n.cartesianToCartographic(i,cN),c=n.cartesianToCartographic(r,lN);sN.setEndPoints(s,c);let u=sN.surfaceDistance/o,f=Math.max(0,Math.ceil(I.log2(u))),d=Math.pow(2,f),p=k.distance(e,t),g=p/d,m=a;m.length=d*2;let y=0;for(let A=0;A<d;A++){let b=zue(e,t,A*g,p);m[y++]=b[0],m[y++]=b[1]}return m};go.subdivideRhumbLine=function(e,t,n,i,r){let o=e.cartesianToCartographic(t,cN),a=e.cartesianToCartographic(n,lN),s=new Uc(o,a,e);if(l(r)||(r=[]),s.surfaceDistance<=i)return r.length=3,r[0]=t.x,r[1]=t.y,r[2]=t.z,r;let c=s.surfaceDistance/i,u=Math.max(0,Math.ceil(I.log2(c))),f=Math.pow(2,u),d=s.surfaceDistance/f,p=r;p.length=f*3;let g=0;for(let m=0;m<f;m++){let y=s.interpolateUsingSurfaceDistance(m*d,R6e),A=e.cartographicToCartesian(y,O6e);p[g++]=A.x,p[g++]=A.y,p[g++]=A.z}return p};var M6e=new h,L6e=new h,N6e=new h,F6e=new h;go.scaleToGeodeticHeightExtruded=function(e,t,n,i,r){i=i??te.default;let o=M6e,a=L6e,s=N6e,c=F6e;if(l(e)&&l(e.attributes)&&l(e.attributes.position)){let u=e.attributes.position.values,f=u.length/2;for(let d=0;d<f;d+=3)h.fromArray(u,d,s),i.geodeticSurfaceNormal(s,o),c=i.scaleToGeodeticSurface(s,c),a=h.multiplyByScalar(o,n,a),a=h.add(c,a,a),u[d+f]=a.x,u[d+1+f]=a.y,u[d+2+f]=a.z,r&&(c=h.clone(s,c)),a=h.multiplyByScalar(o,t,a),a=h.add(c,a,a),u[d]=a.x,u[d+1]=a.y,u[d+2]=a.z}return e};go.polygonOutlinesFromHierarchy=function(e,t,n){let i=[],r=new fb;r.enqueue(e);let o,a,s;for(;r.length!==0;){let c=r.dequeue(),u=c.positions;if(t)for(s=u.length,o=0;o<s;o++)n.scaleToGeodeticSurface(u[o],u[o]);if(u=Pr(u,h.equalsEpsilon,!0),u.length<3)continue;let f=c.holes?c.holes.length:0;for(o=0;o<f;o++){let d=c.holes[o],p=d.positions;if(t)for(s=p.length,a=0;a<s;++a)n.scaleToGeodeticSurface(p[a],p[a]);if(p=Pr(p,h.equalsEpsilon,!0),p.length<3)continue;i.push(p);let g=0;for(l(d.holes)&&(g=d.holes.length),a=0;a<g;a++)r.enqueue(d.holes[a])}i.push(u)}return i};var B6e=new de;function k6e(e,t,n){let i=n.cartesianToCartographic(e,cN),r=n.cartesianToCartographic(t,lN);if(Math.sign(i.latitude)===Math.sign(r.latitude))return;sN.setEndPoints(i,r);let o=sN.findIntersectionWithLatitude(0,B6e);if(!l(o))return;let a=Math.min(i.longitude,r.longitude),s=Math.max(i.longitude,r.longitude);if(Math.abs(s-a)>I.PI){let c=a;a=s,s=c}if(!(o.longitude<a||o.longitude>s))return n.cartographicToCartesian(o)}function z6e(e,t,n,i){if(i===sn.RHUMB)return k6e(e,t,n);let r=ci.lineSegmentPlane(e,t,tn.ORIGIN_XY_PLANE);if(l(r))return n.scaleToGeodeticSurface(r,r)}var U6e=new de;function V6e(e,t,n){let i=[],r,o,a,s,c,u=0;for(;u<e.length;){r=e[u],o=e[(u+1)%e.length],a=I.sign(r.z),s=I.sign(o.z);let f=d=>t.cartesianToCartographic(d,U6e).longitude;if(a===0)i.push({position:u,type:a,visited:!1,next:s,theta:f(r)});else if(s!==0){if(c=z6e(r,o,t,n),++u,!l(c))continue;e.splice(u,0,c),i.push({position:u,type:a,visited:!1,next:s,theta:f(c)})}++u}return i}function Uue(e,t,n,i,r,o,a){let s=[],c=o,u=d=>p=>p.position===d,f=[];do{let d=n[c];s.push(d);let p=i.findIndex(u(c)),g=i[p];if(!l(g)){++c;continue}let{visited:m,type:y,next:A}=g;if(g.visited=!0,y===0){if(A===0){let C=i[p-(a?1:-1)];if(C?.position===c+1)C.visited=!0;else{++c;continue}}if(!m&&a&&A>0||o===c&&!a&&A<0){++c;continue}}if(!(a?y>=0:y<=0)){++c;continue}m||f.push(c);let x=p+(a?1:-1),T=i[x];if(!l(T)){++c;continue}c=T.position}while(c<n.length&&c>=0&&c!==o&&s.length<n.length);e.splice(t,r,s);for(let d of f)t=Uue(e,t+1,n,i,0,d,!a);return t}go.splitPolygonsOnEquator=function(e,t,n,i){l(i)||(i=[]),i.splice(0,0,...e),i.length=e.length;let r=0;for(;r<i.length;){let o=i[r],a=o.slice();if(o.length<3){i[r]=a,++r;continue}let s=V6e(a,t,n);if(a.length===o.length||s.length<=1){i[r]=a,++r;continue}s.sort((u,f)=>u.theta-f.theta);let c=a[0].z>=0;r=Uue(i,r,a,s,1,0,c)}return i};go.polygonsFromHierarchy=function(e,t,n,i,r,o){let a=[],s=[],c=new fb;c.enqueue(e);let u=l(o);for(;c.length!==0;){let f=c.dequeue(),d=f.positions,p=f.holes,g,m;if(i)for(m=d.length,g=0;g<m;g++)r.scaleToGeodeticSurface(d[g],d[g]);if(t||(d=Pr(d,h.equalsEpsilon,!0)),d.length<3)continue;let y=n(d);if(!l(y))continue;let A=[],b=li.computeWindingOrder2D(y);if(b===ns.CLOCKWISE&&(y.reverse(),d=d.slice().reverse()),u){u=!1;let w=[d];if(w=o(w,w),w.length>1){for(let D of w)c.enqueue(new Vc(D,p));continue}}let x=d.slice(),T=l(p)?p.length:0,C=[],E;for(g=0;g<T;g++){let w=p[g],D=w.positions;if(i)for(m=D.length,E=0;E<m;++E)r.scaleToGeodeticSurface(D[E],D[E]);if(t||(D=Pr(D,h.equalsEpsilon,!0)),D.length<3)continue;let R=n(D);if(!l(R))continue;b=li.computeWindingOrder2D(R),b===ns.CLOCKWISE&&(R.reverse(),D=D.slice().reverse()),C.push(D),A.push(x.length),x=x.concat(D),y=y.concat(R);let M=0;for(l(w.holes)&&(M=w.holes.length),E=0;E<M;E++)c.enqueue(w.holes[E])}a.push({outerRing:d,holes:C}),s.push({positions:x,positions2D:y,holes:A})}return{hierarchy:a,polygons:s}};var j6e=new k,H6e=new h,G6e=new Fe,W6e=new $;go.computeBoundingRectangle=function(e,t,n,i,r){let o=Fe.fromAxisAngle(e,i,G6e),a=$.fromQuaternion(o,W6e),s=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,u=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY,d=n.length;for(let p=0;p<d;++p){let g=h.clone(n[p],H6e);$.multiplyByVector(a,g,g);let m=t(g,j6e);l(m)&&(s=Math.min(s,m.x),c=Math.max(c,m.x),u=Math.min(u,m.y),f=Math.max(f,m.y))}return r.x=s,r.y=u,r.width=c-s,r.height=f-u,r};go.createGeometryFromPositions=function(e,t,n,i,r,o,a){let s=li.triangulate(t.positions2D,t.holes);s.length<3&&(s=[0,1,2]);let c=t.positions,u=l(n),f=u?n.positions:void 0;if(r){let d=c.length,p=new Array(d*3),g=0;for(let A=0;A<d;A++){let b=c[A];p[g++]=b.x,p[g++]=b.y,p[g++]=b.z}let m={attributes:{position:new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:p})},indices:s,primitiveType:Re.TRIANGLES};u&&(m.attributes.st=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:k.packArray(f)}));let y=new Tt(m);return o.normal?Gn.computeNormal(y):y}if(a===sn.GEODESIC)return li.computeSubdivision(e,c,s,f,i);if(a===sn.RHUMB)return li.computeRhumbLineSubdivision(e,c,s,f,i)};var Bue=[],kue=[],q6e=new h,Y6e=new h;go.computeWallGeometry=function(e,t,n,i,r,o){let a,s,c,u,f,d,p,g,m,y=e.length,A=0,b=0,x=l(t),T=x?t.positions:void 0;if(r)for(s=y*3*2,a=new Array(s*2),x&&(m=y*2*2,g=new Array(m*2)),c=0;c<y;c++)u=e[c],f=e[(c+1)%y],a[A]=a[A+s]=u.x,++A,a[A]=a[A+s]=u.y,++A,a[A]=a[A+s]=u.z,++A,a[A]=a[A+s]=f.x,++A,a[A]=a[A+s]=f.y,++A,a[A]=a[A+s]=f.z,++A,x&&(d=T[c],p=T[(c+1)%y],g[b]=g[b+m]=d.x,++b,g[b]=g[b+m]=d.y,++b,g[b]=g[b+m]=p.x,++b,g[b]=g[b+m]=p.y,++b);else{let R=I.chordLength(i,n.maximumRadius),M=0;if(o===sn.GEODESIC)for(c=0;c<y;c++)M+=go.subdivideLineCount(e[c],e[(c+1)%y],R);else if(o===sn.RHUMB)for(c=0;c<y;c++)M+=go.subdivideRhumbLineCount(n,e[c],e[(c+1)%y],R);for(s=(M+y)*3,a=new Array(s*2),x&&(m=(M+y)*2,g=new Array(m*2)),c=0;c<y;c++){u=e[c],f=e[(c+1)%y];let N,_;x&&(d=T[c],p=T[(c+1)%y]),o===sn.GEODESIC?(N=go.subdivideLine(u,f,R,kue),x&&(_=go.subdivideTexcoordLine(d,p,u,f,R,Bue))):o===sn.RHUMB&&(N=go.subdivideRhumbLine(n,u,f,R,kue),x&&(_=go.subdivideTexcoordRhumbLine(d,p,n,u,f,R,Bue)));let v=N.length;for(let S=0;S<v;++S,++A)a[A]=N[S],a[A+s]=N[S];if(a[A]=f.x,a[A+s]=f.x,++A,a[A]=f.y,a[A+s]=f.y,++A,a[A]=f.z,a[A+s]=f.z,++A,x){let S=_.length;for(let P=0;P<S;++P,++b)g[b]=_[P],g[b+m]=_[P];g[b]=p.x,g[b+m]=p.x,++b,g[b]=p.y,g[b+m]=p.y,++b}}}y=a.length;let C=Ve.createTypedArray(y/3,y-e.length*6),E=0;for(y/=6,c=0;c<y;c++){let R=c,M=R+1,N=R+y,_=N+1;u=h.fromArray(a,R*3,q6e),f=h.fromArray(a,M*3,Y6e),!h.equalsEpsilon(u,f,I.EPSILON10,I.EPSILON10)&&(C[E++]=R,C[E++]=N,C[E++]=M,C[E++]=M,C[E++]=N,C[E++]=_)}let w={attributes:new xn({position:new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:a})}),indices:C,primitiveType:Re.TRIANGLES};return x&&(w.attributes.st=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:g})),new Tt(w)};var $n=go;var X6e=new h,K6e=new Je,$6e=new k,J6e=new k,Z6e=new h,Q6e=new h,eHe=new h,WI=new h,tHe=new h,nHe=new h,Vue=new Fe,iHe=new $,rHe=new $,oHe=new h;function aHe(e,t,n,i,r,o,a,s,c){let u=e.positions,f=li.triangulate(e.positions2D,e.holes);f.length<3&&(f=[0,1,2]);let d=Ve.createTypedArray(u.length,f.length);d.set(f);let p=iHe;if(i!==0){let _=Fe.fromAxisAngle(a,i,Vue);if(p=$.fromQuaternion(_,p),t.tangent||t.bitangent){_=Fe.fromAxisAngle(a,-i,Vue);let v=$.fromQuaternion(_,rHe);s=h.normalize($.multiplyByVector(v,s,s),s),t.bitangent&&(c=h.normalize(h.cross(a,s,c),c))}}else p=$.clone($.IDENTITY,p);let g=J6e;t.st&&(g.x=n.x,g.y=n.y);let m=u.length,y=m*3,A=new Float64Array(y),b=t.normal?new Float32Array(y):void 0,x=t.tangent?new Float32Array(y):void 0,T=t.bitangent?new Float32Array(y):void 0,C=t.st?new Float32Array(m*2):void 0,E=0,w=0,D=0,R=0,M=0;for(let _=0;_<m;_++){let v=u[_];if(A[E++]=v.x,A[E++]=v.y,A[E++]=v.z,t.st)if(l(r)&&r.positions.length===m)C[M++]=r.positions[_].x,C[M++]=r.positions[_].y;else{let S=$.multiplyByVector(p,v,X6e),P=o(S,$6e);k.subtract(P,g,P);let L=I.clamp(P.x/n.width,0,1),F=I.clamp(P.y/n.height,0,1);C[M++]=L,C[M++]=F}t.normal&&(b[w++]=a.x,b[w++]=a.y,b[w++]=a.z),t.tangent&&(x[R++]=s.x,x[R++]=s.y,x[R++]=s.z),t.bitangent&&(T[D++]=c.x,T[D++]=c.y,T[D++]=c.z)}let N=new xn;return t.position&&(N.position=new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:A})),t.normal&&(N.normal=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:b})),t.tangent&&(N.tangent=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:x})),t.bitangent&&(N.bitangent=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:T})),t.st&&(N.st=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:C})),new Tt({attributes:N,indices:d,primitiveType:Re.TRIANGLES})}function hb(e){e=e??H.EMPTY_OBJECT;let t=e.polygonHierarchy,n=e.textureCoordinates,i=e.vertexFormat??Be.DEFAULT;this._vertexFormat=Be.clone(i),this._polygonHierarchy=t,this._stRotation=e.stRotation??0,this._ellipsoid=te.clone(e.ellipsoid??te.default),this._workerName="createCoplanarPolygonGeometry",this._textureCoordinates=n,this.packedLength=$n.computeHierarchyPackedLength(t,h)+Be.packedLength+te.packedLength+(l(n)?$n.computeHierarchyPackedLength(n,k):1)+2}hb.fromPositions=function(e){e=e??H.EMPTY_OBJECT;let t={polygonHierarchy:{positions:e.positions},vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,textureCoordinates:e.textureCoordinates};return new hb(t)};hb.pack=function(e,t,n){return n=n??0,n=$n.packPolygonHierarchy(e._polygonHierarchy,t,n,h),te.pack(e._ellipsoid,t,n),n+=te.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n++]=e._stRotation,l(e._textureCoordinates)?n=$n.packPolygonHierarchy(e._textureCoordinates,t,n,k):t[n++]=-1,t[n]=e.packedLength,t};var sHe=te.clone(te.UNIT_SPHERE),cHe=new Be,lHe={polygonHierarchy:{}};hb.unpack=function(e,t,n){t=t??0;let i=$n.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let r=te.unpack(e,t,sHe);t+=te.packedLength;let o=Be.unpack(e,t,cHe);t+=Be.packedLength;let a=e[t++],s=e[t]===-1?void 0:$n.unpackPolygonHierarchy(e,t,k);l(s)?(t=s.startingIndex,delete s.startingIndex):t++;let c=e[t];return l(n)||(n=new hb(lHe)),n._polygonHierarchy=i,n._ellipsoid=te.clone(r,n._ellipsoid),n._vertexFormat=Be.clone(o,n._vertexFormat),n._stRotation=a,n._textureCoordinates=s,n.packedLength=c,n};hb.createGeometry=function(e){let t=e._vertexFormat,n=e._polygonHierarchy,i=e._stRotation,r=e._textureCoordinates,o=l(r),a=n.positions;if(a=Pr(a,h.equalsEpsilon,!0),a.length<3)return;let s=Z6e,c=Q6e,u=eHe,f=tHe,d=nHe;if(!x_.computeProjectTo2DArguments(a,WI,f,d))return;if(s=h.cross(f,d,s),s=h.normalize(s,s),!h.equalsEpsilon(WI,h.ZERO,I.EPSILON6)){let M=e._ellipsoid.geodeticSurfaceNormal(WI,oHe);h.dot(s,M)<0&&(s=h.negate(s,s),f=h.negate(f,f))}let g=x_.createProjectPointsTo2DFunction(WI,f,d),m=x_.createProjectPointTo2DFunction(WI,f,d);t.tangent&&(c=h.clone(f,c)),t.bitangent&&(u=h.clone(d,u));let y=$n.polygonsFromHierarchy(n,o,g,!1),A=y.hierarchy,b=y.polygons,x=function(M){return M},T=o?$n.polygonsFromHierarchy(r,!0,x,!1).polygons:void 0;if(A.length===0)return;a=A[0].outerRing;let C=se.fromPoints(a),E=$n.computeBoundingRectangle(s,m,a,i,K6e),w=[];for(let M=0;M<b.length;M++){let N=new Bt({geometry:aHe(b[M],t,E,i,o?T[M]:void 0,m,s,c,u)});w.push(N)}let D=Gn.combineInstances(w)[0];D.attributes.position.values=new Float64Array(D.attributes.position.values),D.indices=Ve.createTypedArray(D.attributes.position.values.length/3,D.indices);let R=D.attributes;return t.position||delete R.position,new Tt({attributes:R,indices:D.indices,primitiveType:D.primitiveType,boundingSphere:C})};var uN=hb;function uHe(e){let t=e.length,n=new Float64Array(t*3),i=Ve.createTypedArray(t,t*2),r=0,o=0;for(let s=0;s<t;s++){let c=e[s];n[r++]=c.x,n[r++]=c.y,n[r++]=c.z,i[o++]=s,i[o++]=(s+1)%t}let a=new xn({position:new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:n})});return new Tt({attributes:a,indices:i,primitiveType:Re.LINES})}function mb(e){e=e??H.EMPTY_OBJECT;let t=e.polygonHierarchy;this._polygonHierarchy=t,this._workerName="createCoplanarPolygonOutlineGeometry",this.packedLength=$n.computeHierarchyPackedLength(t,h)+1}mb.fromPositions=function(e){e=e??H.EMPTY_OBJECT;let t={polygonHierarchy:{positions:e.positions}};return new mb(t)};mb.pack=function(e,t,n){return n=n??0,n=$n.packPolygonHierarchy(e._polygonHierarchy,t,n,h),t[n]=e.packedLength,t};var fHe={polygonHierarchy:{}};mb.unpack=function(e,t,n){t=t??0;let i=$n.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let r=e[t];return l(n)||(n=new mb(fHe)),n._polygonHierarchy=i,n.packedLength=r,n};mb.createGeometry=function(e){let t=e._polygonHierarchy,n=t.positions;if(n=Pr(n,h.equalsEpsilon,!0),n.length<3||!x_.validOutline(n))return;let r=$n.polygonOutlinesFromHierarchy(t,!1);if(r.length===0)return;let o=[];for(let c=0;c<r.length;c++){let u=new Bt({geometry:uHe(r[c])});o.push(u)}let a=Gn.combineInstances(o)[0],s=se.fromPoints(t.positions);return new Tt({attributes:a.attributes,indices:a.indices,primitiveType:a.primitiveType,boundingSphere:s})};var dh=mb;var jue={ROUNDED:0,MITERED:1,BEVELED:2};Object.freeze(jue);var tr=jue;function dHe(e){let t=e._uSquared,n=e._ellipsoid.maximumRadius,i=e._ellipsoid.minimumRadius,r=(n-i)/n,o=Math.cos(e._startHeading),a=Math.sin(e._startHeading),s=(1-r)*Math.tan(e._start.latitude),c=1/Math.sqrt(1+s*s),u=c*s,f=Math.atan2(s,o),d=c*a,p=d*d,g=1-p,m=Math.sqrt(g),y=t/4,A=y*y,b=A*y,x=A*A,T=1+y-3*A/4+5*b/4-175*x/64,C=1-y+15*A/8-35*b/8,E=1-3*y+35*A/4,w=1-5*y,D=T*f-C*Math.sin(2*f)*y/2-E*Math.sin(4*f)*A/16-w*Math.sin(6*f)*b/48-Math.sin(8*f)*5*x/512,R=e._constants;R.a=n,R.b=i,R.f=r,R.cosineHeading=o,R.sineHeading=a,R.tanU=s,R.cosineU=c,R.sineU=u,R.sigma=f,R.sineAlpha=d,R.sineSquaredAlpha=p,R.cosineSquaredAlpha=g,R.cosineAlpha=m,R.u2Over4=y,R.u4Over16=A,R.u6Over64=b,R.u8Over256=x,R.a0=T,R.a1=C,R.a2=E,R.a3=w,R.distanceRatio=D}function hHe(e,t){return e*t*(4+e*(4-3*t))/16}function Hue(e,t,n,i,r,o,a){let s=hHe(e,n);return(1-s)*e*t*(i+s*r*(a+s*o*(2*a*a-1)))}function mHe(e,t,n,i,r,o,a){let s=(t-n)/t,c=o-i,u=Math.atan((1-s)*Math.tan(r)),f=Math.atan((1-s)*Math.tan(a)),d=Math.cos(u),p=Math.sin(u),g=Math.cos(f),m=Math.sin(f),y=d*g,A=d*m,b=p*m,x=p*g,T=c,C,E,w,D,R,M,N,_;do{E=Math.cos(T),w=Math.sin(T);let B=A-x*E;M=Math.sqrt(g*g*w*w+B*B),R=b+y*E,D=Math.atan2(M,R);let G;M===0?(G=0,N=1):(G=y*w/M,N=1-G*G),C=T,_=R-2*b/N,isFinite(_)||(_=0),T=c+Hue(s,G,N,D,M,R,_)}while(Math.abs(T-C)>I.EPSILON12);let v=N*(t*t-n*n)/(n*n),S=1+v*(4096+v*(v*(320-175*v)-768))/16384,P=v*(256+v*(v*(74-47*v)-128))/1024,L=_*_,F=P*M*(_+P*(R*(2*L-1)-P*_*(4*M*M-3)*(4*L-3)/6)/4),V=n*S*(D-F),z=Math.atan2(g*w,A-x*E),j=Math.atan2(d*w,A*E-x);e._distance=V,e._startHeading=z,e._endHeading=j,e._uSquared=v}var pHe=new h,KY=new h;function Gue(e,t,n,i){let r=h.normalize(i.cartographicToCartesian(t,KY),pHe),o=h.normalize(i.cartographicToCartesian(n,KY),KY);mHe(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude),e._start=de.clone(t,e._start),e._end=de.clone(n,e._end),e._start.height=0,e._end.height=0,dHe(e)}function qI(e,t,n){let i=n??te.default;this._ellipsoid=i,this._start=new de,this._end=new de,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,l(e)&&l(t)&&Gue(this,e,t,i)}Object.defineProperties(qI.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return this._startHeading}},endHeading:{get:function(){return this._endHeading}}});qI.prototype.setEndPoints=function(e,t){Gue(this,e,t,this._ellipsoid)};qI.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)};qI.prototype.interpolateUsingSurfaceDistance=function(e,t){let n=this._constants,i=n.distanceRatio+e/n.b,r=Math.cos(2*i),o=Math.cos(4*i),a=Math.cos(6*i),s=Math.sin(2*i),c=Math.sin(4*i),u=Math.sin(6*i),f=Math.sin(8*i),d=i*i,p=i*d,g=n.u8Over256,m=n.u2Over4,y=n.u6Over64,A=n.u4Over16,b=2*p*g*r/3+i*(1-m+7*A/4-15*y/4+579*g/64-(A-15*y/4+187*g/16)*r-(5*y/4-115*g/16)*o-29*g*a/16)+(m/2-A+71*y/32-85*g/16)*s+(5*A/16-5*y/4+383*g/96)*c-d*((y-11*g/2)*s+5*g*c/2)+(29*y/96-29*g/16)*u+539*g*f/1536,x=Math.asin(Math.sin(b)*n.cosineAlpha),T=Math.atan(n.a/n.b*Math.tan(x));b=b-n.sigma;let C=Math.cos(2*n.sigma+b),E=Math.sin(b),w=Math.cos(b),D=n.cosineU*w,R=n.sineU*E,N=Math.atan2(E*n.sineHeading,D-R*n.cosineHeading)-Hue(n.f,n.sineAlpha,n.cosineSquaredAlpha,b,E,w,C);return l(t)?(t.longitude=this._start.longitude+N,t.latitude=T,t.height=0,t):new de(this._start.longitude+N,T,0)};var E_=qI;var gl={};gl.numberOfPoints=function(e,t,n){let i=h.distance(e,t);return Math.ceil(i/n)};gl.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 gHe=new de;gl.extractHeights=function(e,t){let n=e.length,i=new Array(n);for(let r=0;r<n;r++){let o=e[r];i[r]=t.cartesianToCartographic(o,gHe).height}return i};var _He=new O,yHe=new h,Wue=new h,AHe=new tn(h.UNIT_X,0),que=new h,bHe=new tn(h.UNIT_X,0),xHe=new h,THe=new h,JY=[];function Xue(e,t,n){let i=JY;i.length=e;let r;if(t===n){for(r=0;r<e;r++)i[r]=t;return i}let a=(n-t)/e;for(r=0;r<e;r++){let s=t+r*a;i[r]=s}return i}var dN=new de,fN=new de,S_=new h,ZY=new h,CHe=new h,$Y=new E_,YI=new Uc;function vHe(e,t,n,i,r,o,a,s){let c=i.scaleToGeodeticSurface(e,ZY),u=i.scaleToGeodeticSurface(t,CHe),f=gl.numberOfPoints(e,t,n),d=i.cartesianToCartographic(c,dN),p=i.cartesianToCartographic(u,fN),g=Xue(f,r,o);$Y.setEndPoints(d,p);let m=$Y.surfaceDistance/f,y=s;d.height=r;let A=i.cartographicToCartesian(d,S_);h.pack(A,a,y),y+=3;for(let b=1;b<f;b++){let x=$Y.interpolateUsingSurfaceDistance(b*m,fN);x.height=g[b],A=i.cartographicToCartesian(x,S_),h.pack(A,a,y),y+=3}return y}function EHe(e,t,n,i,r,o,a,s){let c=i.cartesianToCartographic(e,dN),u=i.cartesianToCartographic(t,fN),f=gl.numberOfPointsRhumbLine(c,u,n);c.height=0,u.height=0;let d=Xue(f,r,o);YI.ellipsoid.equals(i)||(YI=new Uc(void 0,void 0,i)),YI.setEndPoints(c,u);let p=YI.surfaceDistance/f,g=s;c.height=r;let m=i.cartographicToCartesian(c,S_);h.pack(m,a,g),g+=3;for(let y=1;y<f;y++){let A=YI.interpolateUsingSurfaceDistance(y*p,fN);A.height=d[y],m=i.cartographicToCartesian(A,S_),h.pack(m,a,g),g+=3}return g}gl.wrapLongitude=function(e,t){let n=[],i=[];if(l(e)&&e.length>0){t=t??O.IDENTITY;let r=O.inverseTransformation(t,_He),o=O.multiplyByPoint(r,h.ZERO,yHe),a=h.normalize(O.multiplyByPointAsVector(r,h.UNIT_Y,Wue),Wue),s=tn.fromPointNormal(o,a,AHe),c=h.normalize(O.multiplyByPointAsVector(r,h.UNIT_X,que),que),u=tn.fromPointNormal(o,c,bHe),f=1;n.push(h.clone(e[0]));let d=n[0],p=e.length;for(let g=1;g<p;++g){let m=e[g];if(tn.getPointDistance(u,d)<0||tn.getPointDistance(u,m)<0){let y=ci.lineSegmentPlane(d,m,s,xHe);if(l(y)){let A=h.multiplyByScalar(a,5e-9,THe);tn.getPointDistance(s,d)<0&&h.negate(A,A),n.push(h.add(y,A,new h)),i.push(f+1),h.negate(A,A),n.push(h.add(y,A,new h)),f=1}}n.push(h.clone(e[g])),f++,d=m}i.push(f)}return{positions:n,lengths:i}};gl.generateArc=function(e){l(e)||(e={});let t=e.positions,n=t.length,i=e.ellipsoid??te.default,r=e.height??0,o=Array.isArray(r);if(n<1)return[];if(n===1){let y=i.scaleToGeodeticSurface(t[0],ZY);if(r=o?r[0]:r,r!==0){let A=i.geodeticSurfaceNormal(y,S_);h.multiplyByScalar(A,r,A),h.add(y,A,y)}return[y.x,y.y,y.z]}let a=e.minDistance;if(!l(a)){let y=e.granularity??I.RADIANS_PER_DEGREE;a=I.chordLength(y,i.maximumRadius)}let s=0,c;for(c=0;c<n-1;c++)s+=gl.numberOfPoints(t[c],t[c+1],a);let u=(s+1)*3,f=new Array(u),d=0;for(c=0;c<n-1;c++){let y=t[c],A=t[c+1],b=o?r[c]:r,x=o?r[c+1]:r;d=vHe(y,A,a,i,b,x,f,d)}JY.length=0;let p=t[n-1],g=i.cartesianToCartographic(p,dN);g.height=o?r[n-1]:r;let m=i.cartographicToCartesian(g,S_);return h.pack(m,f,u-3),f};var Yue=new de,SHe=new de;gl.generateRhumbArc=function(e){l(e)||(e={});let t=e.positions,n=t.length,i=e.ellipsoid??te.default,r=e.height??0,o=Array.isArray(r);if(n<1)return[];if(n===1){let b=i.scaleToGeodeticSurface(t[0],ZY);if(r=o?r[0]:r,r!==0){let x=i.geodeticSurfaceNormal(b,S_);h.multiplyByScalar(x,r,x),h.add(b,x,b)}return[b.x,b.y,b.z]}let a=e.granularity??I.RADIANS_PER_DEGREE,s=0,c,u=i.cartesianToCartographic(t[0],Yue),f;for(c=0;c<n-1;c++)f=i.cartesianToCartographic(t[c+1],SHe),s+=gl.numberOfPointsRhumbLine(u,f,a),u=de.clone(f,Yue);let d=(s+1)*3,p=new Array(d),g=0;for(c=0;c<n-1;c++){let b=t[c],x=t[c+1],T=o?r[c]:r,C=o?r[c+1]:r;g=EHe(b,x,a,i,T,C,p,g)}JY.length=0;let m=t[n-1],y=i.cartesianToCartographic(m,dN);y.height=o?r[n-1]:r;let A=i.cartographicToCartesian(y,S_);return h.pack(A,p,d-3),p};gl.generateCartesianArc=function(e){let t=gl.generateArc(e),n=t.length/3,i=new Array(n);for(let r=0;r<n;r++)i[r]=h.unpack(t,r*3);return i};gl.generateCartesianRhumbArc=function(e){let t=gl.generateRhumbArc(e),n=t.length/3,i=new Array(n);for(let r=0;r<n;r++)i[r]=h.unpack(t,r*3);return i};var nr=gl;var Xs=[new h,new h],wHe=new h,IHe=new h,PHe=new h,DHe=new h,RHe=new h,OHe=new h,MHe=new h,LHe=new h,NHe=new h,PC=new h,hN=new h,XI={},QY=new de;function FHe(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++){let r=e[i];QY=t.cartesianToCartographic(r,QY),n[i]=QY.height,e[i]=t.scaleToGeodeticSurface(r,r)}return n}function eX(e,t,n,i){let r=e[0],o=e[1],a=h.angleBetween(r,o),s=Math.ceil(a/i),c=new Array(s),u;if(t===n){for(u=0;u<s;u++)c[u]=t;return c.push(n),c}let d=(n-t)/s;for(u=1;u<s;u++){let p=t+u*d;c[u]=p}return c[0]=t,c.push(n),c}var mN=new h,pN=new h;function BHe(e,t,n,i){let r=new Fa(n,i),o=r.projectPointOntoPlane(h.add(n,e,mN),mN),a=r.projectPointOntoPlane(h.add(n,t,pN),pN),s=k.angleBetween(o,a);return a.x*o.y-a.y*o.x>=0?-s:s}var kHe=new h(-1,0,0),pb=new O,zHe=new O,tX=new $,UHe=$.IDENTITY.clone(),VHe=new h,jHe=new ae,Kue=new h;function R0(e,t,n,i,r,o,a,s){let c=VHe,u=jHe;pb=mt.eastNorthUpToFixedFrame(e,r,pb),c=O.multiplyByPointAsVector(pb,kHe,c),c=h.normalize(c,c);let f=BHe(c,t,e,r);tX=$.fromRotationZ(f,tX),Kue.z=o,pb=O.multiplyTransformation(pb,O.fromRotationTranslation(tX,Kue,zHe),pb);let d=UHe;d[0]=a;for(let p=0;p<s;p++)for(let g=0;g<n.length;g+=3)u=h.fromArray(n,g,u),u=$.multiplyByVector(d,u,u),u=O.multiplyByPoint(pb,u,u),i.push(u.x,u.y,u.z);return i}var HHe=new h;function nX(e,t,n,i,r,o,a){for(let s=0;s<e.length;s+=3){let c=h.fromArray(e,s,HHe);i=R0(c,t,n,i,r,o[s/3],a,1)}return i}function GHe(e,t){let n=e.length,i=new Array(n*6),r=0,o=t.x+t.width/2,a=t.y+t.height/2,s=e[0];i[r++]=s.x-o,i[r++]=0,i[r++]=s.y-a;for(let c=1;c<n;c++){s=e[c];let u=s.x-o,f=s.y-a;i[r++]=u,i[r++]=0,i[r++]=f,i[r++]=u,i[r++]=0,i[r++]=f}return s=e[0],i[r++]=s.x-o,i[r++]=0,i[r]=s.y-a,i}function $ue(e,t){let n=e.length,i=new Array(n*3),r=0,o=t.x+t.width/2,a=t.y+t.height/2;for(let s=0;s<n;s++)i[r++]=e[s].x-o,i[r++]=0,i[r++]=e[s].y-a;return i}var Jue=new Fe,Zue=new h,Que=new $;function efe(e,t,n,i,r,o,a,s,c,u){let f=h.angleBetween(h.subtract(t,e,PC),h.subtract(n,e,hN)),d=i===tr.BEVELED?0:Math.ceil(f/I.toRadians(5)),p;r?p=$.fromQuaternion(Fe.fromAxisAngle(h.negate(e,PC),f/(d+1),Jue),Que):p=$.fromQuaternion(Fe.fromAxisAngle(e,f/(d+1),Jue),Que);let g,m;if(t=h.clone(t,Zue),d>0){let y=u?2:1;for(let A=0;A<d;A++)t=$.multiplyByVector(p,t,t),g=h.subtract(t,e,PC),g=h.normalize(g,g),r||(g=h.negate(g,g)),m=o.scaleToGeodeticSurface(t,hN),a=R0(m,g,s,a,o,c,1,y)}else g=h.subtract(t,e,PC),g=h.normalize(g,g),r||(g=h.negate(g,g)),m=o.scaleToGeodeticSurface(t,hN),a=R0(m,g,s,a,o,c,1,1),n=h.clone(n,Zue),g=h.subtract(n,e,PC),g=h.normalize(g,g),r||(g=h.negate(g,g)),m=o.scaleToGeodeticSurface(n,hN),a=R0(m,g,s,a,o,c,1,1);return a}XI.removeDuplicatesFromShape=function(e){let t=e.length,n=[];for(let i=t-1,r=0;r<t;i=r++){let o=e[i],a=e[r];k.equals(o,a)||n.push(a)}return n};XI.angleIsGreaterThanPi=function(e,t,n,i){let r=new Fa(n,i),o=r.projectPointOntoPlane(h.add(n,e,mN),mN),a=r.projectPointOntoPlane(h.add(n,t,pN),pN);return a.x*o.y-a.y*o.x>=0};var WHe=new h,qHe=new h;XI.computePositions=function(e,t,n,i,r){let o=i._ellipsoid,a=FHe(e,o),s=i._granularity,c=i._cornerType,u=r?GHe(t,n):$ue(t,n),f=r?$ue(t,n):void 0,d=n.height/2,p=n.width/2,g=e.length,m=[],y=r?[]:void 0,A=wHe,b=IHe,x=PHe,T=DHe,C=RHe,E=OHe,w=MHe,D=LHe,R=NHe,M=e[0],N=e[1];T=o.geodeticSurfaceNormal(M,T),A=h.subtract(N,M,A),A=h.normalize(A,A),D=h.cross(T,A,D),D=h.normalize(D,D);let _=a[0],v=a[1];r&&(y=R0(M,D,f,y,o,_+d,1,1)),R=h.clone(M,R),M=N,b=h.negate(A,b);let S,P;for(let V=1;V<g-1;V++){let z=r?2:1;if(N=e[V+1],M.equals(N)){pt("Positions are too close and are considered equivalent with rounding error.");continue}A=h.subtract(N,M,A),A=h.normalize(A,A),T=o.geodeticSurfaceNormal(M,T);let j=h.multiplyByScalar(T,h.dot(A,T),WHe);h.subtract(A,j,j),h.normalize(j,j);let B=h.multiplyByScalar(T,h.dot(b,T),qHe);if(h.subtract(b,B,B),h.normalize(B,B),!I.equalsEpsilon(Math.abs(h.dot(j,B)),1,I.EPSILON7)){x=h.add(A,b,x),x=h.normalize(x,x),x=h.cross(x,T,x),x=h.cross(T,x,x),x=h.normalize(x,x);let W=1/Math.max(.25,h.magnitude(h.cross(x,b,PC))),Q=XI.angleIsGreaterThanPi(A,b,M,o);Q?(C=h.add(M,h.multiplyByScalar(x,W*p,x),C),E=h.add(C,h.multiplyByScalar(D,p,E),E),Xs[0]=h.clone(R,Xs[0]),Xs[1]=h.clone(E,Xs[1]),S=eX(Xs,_+d,v+d,s),P=nr.generateArc({positions:Xs,granularity:s,ellipsoid:o}),m=nX(P,D,u,m,o,S,1),D=h.cross(T,A,D),D=h.normalize(D,D),w=h.add(C,h.multiplyByScalar(D,p,w),w),c===tr.ROUNDED||c===tr.BEVELED?efe(C,E,w,c,Q,o,m,u,v+d,r):(x=h.negate(x,x),m=R0(M,x,u,m,o,v+d,W,z)),R=h.clone(w,R)):(C=h.add(M,h.multiplyByScalar(x,W*p,x),C),E=h.add(C,h.multiplyByScalar(D,-p,E),E),Xs[0]=h.clone(R,Xs[0]),Xs[1]=h.clone(E,Xs[1]),S=eX(Xs,_+d,v+d,s),P=nr.generateArc({positions:Xs,granularity:s,ellipsoid:o}),m=nX(P,D,u,m,o,S,1),D=h.cross(T,A,D),D=h.normalize(D,D),w=h.add(C,h.multiplyByScalar(D,-p,w),w),c===tr.ROUNDED||c===tr.BEVELED?efe(C,E,w,c,Q,o,m,u,v+d,r):m=R0(M,x,u,m,o,v+d,W,z),R=h.clone(w,R)),b=h.negate(A,b)}else m=R0(R,D,u,m,o,_+d,1,1),R=M;_=v,v=a[V+1],M=N}Xs[0]=h.clone(R,Xs[0]),Xs[1]=h.clone(M,Xs[1]),S=eX(Xs,_+d,v+d,s),P=nr.generateArc({positions:Xs,granularity:s,ellipsoid:o}),m=nX(P,D,u,m,o,S,1),r&&(y=R0(M,D,f,y,o,v+d,1,1)),g=m.length;let L=r?g+y.length:g,F=new Float64Array(L);return F.set(m),r&&F.set(y,g),F};var Hm=XI;var rX={},DC=new h,ofe=new h,YHe=new h,tfe=new h,_l=[new h,new h],afe=new h,sfe=new h,cfe=new h,XHe=new h,KHe=new h,$He=new h,JHe=new h,ZHe=new h,QHe=new h,eGe=new h,nfe=new Fe,ife=new $;function gN(e,t,n,i,r){let o=h.angleBetween(h.subtract(t,e,DC),h.subtract(n,e,ofe)),a=i===tr.BEVELED?1:Math.ceil(o/I.toRadians(5))+1,s=a*3,c=new Array(s);c[s-3]=n.x,c[s-2]=n.y,c[s-1]=n.z;let u;r?u=$.fromQuaternion(Fe.fromAxisAngle(h.negate(e,DC),o/a,nfe),ife):u=$.fromQuaternion(Fe.fromAxisAngle(e,o/a,nfe),ife);let f=0;t=h.clone(t,DC);for(let d=0;d<a;d++)t=$.multiplyByVector(u,t,t),c[f++]=t.x,c[f++]=t.y,c[f++]=t.z;return c}function tGe(e){let t=afe,n=sfe,i=cfe,r=e[1];n=h.fromArray(e[1],r.length-3,n),i=h.fromArray(e[0],0,i),t=h.midpoint(n,i,t);let o=gN(t,n,i,tr.ROUNDED,!1),a=e.length-1,s=e[a-1];r=e[a],n=h.fromArray(s,s.length-3,n),i=h.fromArray(r,0,i),t=h.midpoint(n,i,t);let c=gN(t,n,i,tr.ROUNDED,!1);return[o,c]}function rfe(e,t,n,i){let r=DC;return i?r=h.add(e,t,r):(t=h.negate(t,t),r=h.add(e,t,r)),[r.x,r.y,r.z,n.x,n.y,n.z]}function iX(e,t,n,i){let r=new Array(e.length),o=new Array(e.length),a=h.multiplyByScalar(t,n,DC),s=h.negate(a,ofe),c=0,u=e.length-1;for(let f=0;f<e.length;f+=3){let d=h.fromArray(e,f,YHe),p=h.add(d,s,tfe);r[c++]=p.x,r[c++]=p.y,r[c++]=p.z;let g=h.add(d,a,tfe);o[u--]=g.z,o[u--]=g.y,o[u--]=g.x}return i.push(r,o),i}rX.addAttribute=function(e,t,n,i){let r=t.x,o=t.y,a=t.z;l(n)&&(e[n]=r,e[n+1]=o,e[n+2]=a),l(i)&&(e[i]=a,e[i-1]=o,e[i-2]=r)};var nGe=new h,iGe=new h;rX.computePositions=function(e){let t=e.granularity,n=e.positions,i=e.ellipsoid,r=e.width/2,o=e.cornerType,a=e.saveAttributes,s=afe,c=sfe,u=cfe,f=XHe,d=KHe,p=$He,g=JHe,m=ZHe,y=QHe,A=eGe,b=[],x=a?[]:void 0,T=a?[]:void 0,C=n[0],E=n[1];c=h.normalize(h.subtract(E,C,c),c),s=i.geodeticSurfaceNormal(C,s),f=h.normalize(h.cross(s,c,f),f),a&&(x.push(f.x,f.y,f.z),T.push(s.x,s.y,s.z)),g=h.clone(C,g),C=E,u=h.negate(c,u);let w,D=[],R,M=n.length;for(R=1;R<M-1;R++){s=i.geodeticSurfaceNormal(C,s),E=n[R+1],c=h.normalize(h.subtract(E,C,c),c);let _=h.multiplyByScalar(s,h.dot(c,s),nGe);h.subtract(c,_,_),h.normalize(_,_);let v=h.multiplyByScalar(s,h.dot(u,s),iGe);if(h.subtract(u,v,v),h.normalize(v,v),!I.equalsEpsilon(Math.abs(h.dot(_,v)),1,I.EPSILON7)){d=h.normalize(h.add(c,u,d),d),d=h.cross(d,s,d),d=h.cross(s,d,d),d=h.normalize(d,d);let P=r/Math.max(.25,h.magnitude(h.cross(d,u,DC))),L=Hm.angleIsGreaterThanPi(c,u,C,i);d=h.multiplyByScalar(d,P,d),L?(m=h.add(C,d,m),A=h.add(m,h.multiplyByScalar(f,r,A),A),y=h.add(m,h.multiplyByScalar(f,r*2,y),y),_l[0]=h.clone(g,_l[0]),_l[1]=h.clone(A,_l[1]),w=nr.generateArc({positions:_l,granularity:t,ellipsoid:i}),b=iX(w,f,r,b),a&&(x.push(f.x,f.y,f.z),T.push(s.x,s.y,s.z)),p=h.clone(y,p),f=h.normalize(h.cross(s,c,f),f),y=h.add(m,h.multiplyByScalar(f,r*2,y),y),g=h.add(m,h.multiplyByScalar(f,r,g),g),o===tr.ROUNDED||o===tr.BEVELED?D.push({leftPositions:gN(m,p,y,o,L)}):D.push({leftPositions:rfe(C,h.negate(d,d),y,L)})):(y=h.add(C,d,y),A=h.add(y,h.negate(h.multiplyByScalar(f,r,A),A),A),m=h.add(y,h.negate(h.multiplyByScalar(f,r*2,m),m),m),_l[0]=h.clone(g,_l[0]),_l[1]=h.clone(A,_l[1]),w=nr.generateArc({positions:_l,granularity:t,ellipsoid:i}),b=iX(w,f,r,b),a&&(x.push(f.x,f.y,f.z),T.push(s.x,s.y,s.z)),p=h.clone(m,p),f=h.normalize(h.cross(s,c,f),f),m=h.add(y,h.negate(h.multiplyByScalar(f,r*2,m),m),m),g=h.add(y,h.negate(h.multiplyByScalar(f,r,g),g),g),o===tr.ROUNDED||o===tr.BEVELED?D.push({rightPositions:gN(y,p,m,o,L)}):D.push({rightPositions:rfe(C,d,m,L)})),u=h.negate(c,u)}C=E}s=i.geodeticSurfaceNormal(C,s),_l[0]=h.clone(g,_l[0]),_l[1]=h.clone(C,_l[1]),w=nr.generateArc({positions:_l,granularity:t,ellipsoid:i}),b=iX(w,f,r,b),a&&(x.push(f.x,f.y,f.z),T.push(s.x,s.y,s.z));let N;return o===tr.ROUNDED&&(N=tGe(b)),{positions:b,corners:D,lefts:x,normals:T,endPositions:N}};var sr=rX;var ffe=new h,dfe=new h,_N=new h,yN=new h,rGe=new h,hfe=new h,w_=new h,RC=new h;function mfe(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function hh(e,t,n,i,r,o){let a=e.normals,s=e.tangents,c=e.bitangents,u=h.normalize(h.cross(n,t,w_),w_);o.normal&&sr.addAttribute(a,t,i,r),o.tangent&&sr.addAttribute(s,u,i,r),o.bitangent&&sr.addAttribute(c,n,i,r)}function pfe(e,t,n){let i=e.positions,r=e.corners,o=e.endPositions,a=e.lefts,s=e.normals,c=new xn,u=0,f=0,d,p=0,g;for(d=0;d<i.length;d+=2)g=i[d].length-3,u+=g,p+=g*2,f+=i[d+1].length-3;for(u+=3,f+=3,d=0;d<r.length;d++){let J=r[d].leftPositions;l(J)?(g=J.length,u+=g,p+=g):(g=r[d].rightPositions.length,f+=g,p+=g)}let m=l(o),y;m&&(y=o[0].length-3,u+=y,f+=y,y/=3,p+=y*6);let A=u+f,b=new Float64Array(A),x=t.normal?new Float32Array(A):void 0,T=t.tangent?new Float32Array(A):void 0,C=t.bitangent?new Float32Array(A):void 0,E={normals:x,tangents:T,bitangents:C},w=0,D=A-1,R,M,N,_,v=ffe,S=dfe,P,L,F=y/2,V=Ve.createTypedArray(A/3,p),z=0;if(m){L=_N,P=yN;let J=o[0];for(v=h.fromArray(s,0,v),S=h.fromArray(a,0,S),d=0;d<F;d++)L=h.fromArray(J,(F-1-d)*3,L),P=h.fromArray(J,(F+d)*3,P),sr.addAttribute(b,P,w),sr.addAttribute(b,L,void 0,D),hh(E,v,S,w,D,t),M=w/3,_=M+1,R=(D-2)/3,N=R-1,V[z++]=R,V[z++]=M,V[z++]=N,V[z++]=N,V[z++]=M,V[z++]=_,w+=3,D-=3}let j=0,B=0,G=i[j++],W=i[j++];b.set(G,w),b.set(W,D-W.length+1),S=h.fromArray(a,B,S);let Q,q;for(g=W.length-3,d=0;d<g;d+=3)Q=n.geodeticSurfaceNormal(h.fromArray(G,d,w_),w_),q=n.geodeticSurfaceNormal(h.fromArray(W,g-d,RC),RC),v=h.normalize(h.add(Q,q,v),v),hh(E,v,S,w,D,t),M=w/3,_=M+1,R=(D-2)/3,N=R-1,V[z++]=R,V[z++]=M,V[z++]=N,V[z++]=N,V[z++]=M,V[z++]=_,w+=3,D-=3;for(Q=n.geodeticSurfaceNormal(h.fromArray(G,g,w_),w_),q=n.geodeticSurfaceNormal(h.fromArray(W,g,RC),RC),v=h.normalize(h.add(Q,q,v),v),B+=3,d=0;d<r.length;d++){let J,Z=r[d],ce=Z.leftPositions,Ae=Z.rightPositions,le,Ce,ye=hfe,ve=_N,Ie=yN;if(v=h.fromArray(s,B,v),l(ce)){for(hh(E,v,S,void 0,D,t),D-=3,le=_,Ce=N,J=0;J<ce.length/3;J++)ye=h.fromArray(ce,J*3,ye),V[z++]=le,V[z++]=Ce-J-1,V[z++]=Ce-J,sr.addAttribute(b,ye,void 0,D),ve=h.fromArray(b,(Ce-J-1)*3,ve),Ie=h.fromArray(b,le*3,Ie),S=h.normalize(h.subtract(ve,Ie,S),S),hh(E,v,S,void 0,D,t),D-=3;ye=h.fromArray(b,le*3,ye),ve=h.subtract(h.fromArray(b,Ce*3,ve),ye,ve),Ie=h.subtract(h.fromArray(b,(Ce-J)*3,Ie),ye,Ie),S=h.normalize(h.add(ve,Ie,S),S),hh(E,v,S,w,void 0,t),w+=3}else{for(hh(E,v,S,w,void 0,t),w+=3,le=N,Ce=_,J=0;J<Ae.length/3;J++)ye=h.fromArray(Ae,J*3,ye),V[z++]=le,V[z++]=Ce+J,V[z++]=Ce+J+1,sr.addAttribute(b,ye,w),ve=h.fromArray(b,le*3,ve),Ie=h.fromArray(b,(Ce+J)*3,Ie),S=h.normalize(h.subtract(ve,Ie,S),S),hh(E,v,S,w,void 0,t),w+=3;ye=h.fromArray(b,le*3,ye),ve=h.subtract(h.fromArray(b,(Ce+J)*3,ve),ye,ve),Ie=h.subtract(h.fromArray(b,Ce*3,Ie),ye,Ie),S=h.normalize(h.negate(h.add(Ie,ve,S),S),S),hh(E,v,S,void 0,D,t),D-=3}for(G=i[j++],W=i[j++],G.splice(0,3),W.splice(W.length-3,3),b.set(G,w),b.set(W,D-W.length+1),g=W.length-3,B+=3,S=h.fromArray(a,B,S),J=0;J<W.length;J+=3)Q=n.geodeticSurfaceNormal(h.fromArray(G,J,w_),w_),q=n.geodeticSurfaceNormal(h.fromArray(W,g-J,RC),RC),v=h.normalize(h.add(Q,q,v),v),hh(E,v,S,w,D,t),_=w/3,M=_-1,N=(D-2)/3,R=N+1,V[z++]=R,V[z++]=M,V[z++]=N,V[z++]=N,V[z++]=M,V[z++]=_,w+=3,D-=3;w-=3,D+=3}if(v=h.fromArray(s,s.length-3,v),hh(E,v,S,w,D,t),m){w+=3,D-=3,L=_N,P=yN;let J=o[1];for(d=0;d<F;d++)L=h.fromArray(J,(y-d-1)*3,L),P=h.fromArray(J,d*3,P),sr.addAttribute(b,L,void 0,D),sr.addAttribute(b,P,w),hh(E,v,S,w,D,t),_=w/3,M=_-1,N=(D-2)/3,R=N+1,V[z++]=R,V[z++]=M,V[z++]=N,V[z++]=N,V[z++]=M,V[z++]=_,w+=3,D-=3}if(c.position=new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:b}),t.st){let J=new Float32Array(A/3*2),Z,ce,Ae=0;if(m){u/=3,f/=3;let le=Math.PI/(y+1);ce=1/(u-y+1),Z=1/(f-y+1);let Ce,ye=y/2;for(d=ye+1;d<y+1;d++)Ce=I.PI_OVER_TWO+le*d,J[Ae++]=Z*(1+Math.cos(Ce)),J[Ae++]=.5*(1+Math.sin(Ce));for(d=1;d<f-y+1;d++)J[Ae++]=d*Z,J[Ae++]=0;for(d=y;d>ye;d--)Ce=I.PI_OVER_TWO-d*le,J[Ae++]=1-Z*(1+Math.cos(Ce)),J[Ae++]=.5*(1+Math.sin(Ce));for(d=ye;d>0;d--)Ce=I.PI_OVER_TWO-le*d,J[Ae++]=1-ce*(1+Math.cos(Ce)),J[Ae++]=.5*(1+Math.sin(Ce));for(d=u-y;d>0;d--)J[Ae++]=d*ce,J[Ae++]=1;for(d=1;d<ye+1;d++)Ce=I.PI_OVER_TWO+le*d,J[Ae++]=ce*(1+Math.cos(Ce)),J[Ae++]=.5*(1+Math.sin(Ce))}else{for(u/=3,f/=3,ce=1/(u-1),Z=1/(f-1),d=0;d<f;d++)J[Ae++]=d*Z,J[Ae++]=0;for(d=u;d>0;d--)J[Ae++]=(d-1)*ce,J[Ae++]=1}c.st=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:J})}return t.normal&&(c.normal=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:E.normals})),t.tangent&&(c.tangent=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:E.tangents})),t.bitangent&&(c.bitangent=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:E.bitangents})),{attributes:c,indices:V}}function oGe(e,t){if(!t.normal&&!t.tangent&&!t.bitangent&&!t.st)return e;let n=e.position.values,i,r;(t.normal||t.bitangent)&&(i=e.normal.values,r=e.bitangent.values);let o=e.position.values.length/18,a=o*3,s=o*2,c=a*2,u;if(t.normal||t.bitangent||t.tangent){let f=t.normal?new Float32Array(a*6):void 0,d=t.tangent?new Float32Array(a*6):void 0,p=t.bitangent?new Float32Array(a*6):void 0,g=ffe,m=dfe,y=_N,A=yN,b=rGe,x=hfe,T=c;for(u=0;u<a;u+=3){let C=T+c;g=h.fromArray(n,u,g),m=h.fromArray(n,u+a,m),y=h.fromArray(n,(u+3)%a,y),m=h.subtract(m,g,m),y=h.subtract(y,g,y),A=h.normalize(h.cross(m,y,A),A),t.normal&&(sr.addAttribute(f,A,C),sr.addAttribute(f,A,C+3),sr.addAttribute(f,A,T),sr.addAttribute(f,A,T+3)),(t.tangent||t.bitangent)&&(x=h.fromArray(i,u,x),t.bitangent&&(sr.addAttribute(p,x,C),sr.addAttribute(p,x,C+3),sr.addAttribute(p,x,T),sr.addAttribute(p,x,T+3)),t.tangent&&(b=h.normalize(h.cross(x,A,b),b),sr.addAttribute(d,b,C),sr.addAttribute(d,b,C+3),sr.addAttribute(d,b,T),sr.addAttribute(d,b,T+3))),T+=6}if(t.normal){for(f.set(i),u=0;u<a;u+=3)f[u+a]=-i[u],f[u+a+1]=-i[u+1],f[u+a+2]=-i[u+2];e.normal.values=f}else e.normal=void 0;if(t.bitangent?(p.set(r),p.set(r,a),e.bitangent.values=p):e.bitangent=void 0,t.tangent){let C=e.tangent.values;d.set(C),d.set(C,a),e.tangent.values=d}}if(t.st){let f=e.st.values,d=new Float32Array(s*6);d.set(f),d.set(f,s);let p=s*2;for(let g=0;g<2;g++){for(d[p++]=f[0],d[p++]=f[1],u=2;u<s;u+=2){let m=f[u],y=f[u+1];d[p++]=m,d[p++]=y,d[p++]=m,d[p++]=y}d[p++]=f[0],d[p++]=f[1]}e.st.values=d}return e}function oX(e,t,n){n[t++]=e[0],n[t++]=e[1],n[t++]=e[2];for(let i=3;i<e.length;i+=3){let r=e[i],o=e[i+1],a=e[i+2];n[t++]=r,n[t++]=o,n[t++]=a,n[t++]=r,n[t++]=o,n[t++]=a}return n[t++]=e[0],n[t++]=e[1],n[t]=e[2],n}function aGe(e,t){let n=new Be({position:t.position,normal:t.normal||t.bitangent||e.shadowVolume,tangent:t.tangent,bitangent:t.normal||t.bitangent,st:t.st}),i=e.ellipsoid,r=sr.computePositions(e),o=pfe(r,n,i),a=e.height,s=e.extrudedHeight,c=o.attributes,u=o.indices,f=c.position.values,d=f.length,p=new Float64Array(d*6),g=new Float64Array(d);g.set(f);let m=new Float64Array(d*4);f=li.scaleToGeodeticHeight(f,a,i),m=oX(f,0,m),g=li.scaleToGeodeticHeight(g,s,i),m=oX(g,d*2,m),p.set(f),p.set(g,d),p.set(m,d*2),c.position.values=p,c=oGe(c,t);let y,A=d/3;if(e.shadowVolume){let M=c.normal.values;d=M.length;let N=new Float32Array(d*6);for(y=0;y<d;y++)M[y]=-M[y];N.set(M,d),N=oX(M,d*4,N),c.extrudeDirection=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:N}),t.normal||(c.normal=void 0)}if(l(e.offsetAttribute)){let M=new Uint8Array(A*6);if(e.offsetAttribute===mn.TOP)M=M.fill(1,0,A).fill(1,A*2,A*4);else{let N=e.offsetAttribute===mn.NONE?0:1;M=M.fill(N)}c.applyOffset=new Me({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:M})}let b=u.length,x=A+A,T=Ve.createTypedArray(p.length/3,b*2+x*3);T.set(u);let C=b;for(y=0;y<b;y+=3){let M=u[y],N=u[y+1],_=u[y+2];T[C++]=_+A,T[C++]=N+A,T[C++]=M+A}let E,w,D,R;for(y=0;y<x;y+=2)E=y+x,w=E+x,D=E+1,R=w+1,T[C++]=E,T[C++]=w,T[C++]=D,T[C++]=D,T[C++]=w,T[C++]=R;return{attributes:c,indices:T}}var lfe=new h,KI=new h,$f=new de;function ufe(e,t,n,i,r,o){let a=h.subtract(t,e,lfe);h.normalize(a,a);let s=n.geodeticSurfaceNormal(e,KI),c=h.cross(a,s,lfe);h.multiplyByScalar(c,i,c);let u=r.latitude,f=r.longitude,d=o.latitude,p=o.longitude;h.add(e,c,KI),n.cartesianToCartographic(KI,$f);let g=$f.latitude,m=$f.longitude;u=Math.min(u,g),f=Math.min(f,m),d=Math.max(d,g),p=Math.max(p,m),h.subtract(e,c,KI),n.cartesianToCartographic(KI,$f),g=$f.latitude,m=$f.longitude,u=Math.min(u,g),f=Math.min(f,m),d=Math.max(d,g),p=Math.max(p,m),r.latitude=u,r.longitude=f,o.latitude=d,o.longitude=p}var Kf=new h,$I=new h,tu=new de,nu=new de;function gfe(e,t,n,i,r){e=mfe(e,t);let o=Pr(e,h.equalsEpsilon),a=o.length;if(a<2||n<=0)return new ie;let s=n*.5;tu.latitude=Number.POSITIVE_INFINITY,tu.longitude=Number.POSITIVE_INFINITY,nu.latitude=Number.NEGATIVE_INFINITY,nu.longitude=Number.NEGATIVE_INFINITY;let c,u;if(i===tr.ROUNDED){let p=o[0];h.subtract(p,o[1],Kf),h.normalize(Kf,Kf),h.multiplyByScalar(Kf,s,Kf),h.add(p,Kf,$I),t.cartesianToCartographic($I,$f),c=$f.latitude,u=$f.longitude,tu.latitude=Math.min(tu.latitude,c),tu.longitude=Math.min(tu.longitude,u),nu.latitude=Math.max(nu.latitude,c),nu.longitude=Math.max(nu.longitude,u)}for(let p=0;p<a-1;++p)ufe(o[p],o[p+1],t,s,tu,nu);let f=o[a-1];h.subtract(f,o[a-2],Kf),h.normalize(Kf,Kf),h.multiplyByScalar(Kf,s,Kf),h.add(f,Kf,$I),ufe(f,$I,t,s,tu,nu),i===tr.ROUNDED&&(t.cartesianToCartographic($I,$f),c=$f.latitude,u=$f.longitude,tu.latitude=Math.min(tu.latitude,c),tu.longitude=Math.min(tu.longitude,u),nu.latitude=Math.max(nu.latitude,c),nu.longitude=Math.max(nu.longitude,u));let d=l(r)?r:new ie;return d.north=nu.latitude,d.south=tu.latitude,d.east=nu.longitude,d.west=tu.longitude,d}function M0(e){e=e??H.EMPTY_OBJECT;let t=e.positions,n=e.width,i=e.height??0,r=e.extrudedHeight??i;this._positions=t,this._ellipsoid=te.clone(e.ellipsoid??te.default),this._vertexFormat=Be.clone(e.vertexFormat??Be.DEFAULT),this._width=n,this._height=Math.max(i,r),this._extrudedHeight=Math.min(i,r),this._cornerType=e.cornerType??tr.ROUNDED,this._granularity=e.granularity??I.RADIANS_PER_DEGREE,this._shadowVolume=e.shadowVolume??!1,this._workerName="createCorridorGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this.packedLength=1+t.length*h.packedLength+te.packedLength+Be.packedLength+7}M0.pack=function(e,t,n){n=n??0;let i=e._positions,r=i.length;t[n++]=r;for(let o=0;o<r;++o,n+=h.packedLength)h.pack(i[o],t,n);return te.pack(e._ellipsoid,t,n),n+=te.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n++]=e._width,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._cornerType,t[n++]=e._granularity,t[n++]=e._shadowVolume?1:0,t[n]=e._offsetAttribute??-1,t};var _fe=te.clone(te.UNIT_SPHERE),yfe=new Be,O0={positions:void 0,ellipsoid:_fe,vertexFormat:yfe,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0,offsetAttribute:void 0};M0.unpack=function(e,t,n){t=t??0;let i=e[t++],r=new Array(i);for(let m=0;m<i;++m,t+=h.packedLength)r[m]=h.unpack(e,t);let o=te.unpack(e,t,_fe);t+=te.packedLength;let a=Be.unpack(e,t,yfe);t+=Be.packedLength;let s=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t++]===1,g=e[t];return l(n)?(n._positions=r,n._ellipsoid=te.clone(o,n._ellipsoid),n._vertexFormat=Be.clone(a,n._vertexFormat),n._width=s,n._height=c,n._extrudedHeight=u,n._cornerType=f,n._granularity=d,n._shadowVolume=p,n._offsetAttribute=g===-1?void 0:g,n):(O0.positions=r,O0.width=s,O0.height=c,O0.extrudedHeight=u,O0.cornerType=f,O0.granularity=d,O0.shadowVolume=p,O0.offsetAttribute=g===-1?void 0:g,new M0(O0))};M0.computeRectangle=function(e,t){e=e??H.EMPTY_OBJECT;let n=e.positions,i=e.width,r=e.ellipsoid??te.default,o=e.cornerType??tr.ROUNDED;return gfe(n,r,i,o,t)};M0.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=mfe(t,i);let r=Pr(t,h.equalsEpsilon);if(r.length<2||n<=0)return;let o=e._height,a=e._extrudedHeight,s=!I.equalsEpsilon(o,a,0,I.EPSILON2),c=e._vertexFormat,u={ellipsoid:i,positions:r,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!0},f;if(s)u.height=o,u.extrudedHeight=a,u.shadowVolume=e._shadowVolume,u.offsetAttribute=e._offsetAttribute,f=aGe(u,c);else{let g=sr.computePositions(u);if(f=pfe(g,c,i),f.attributes.position.values=li.scaleToGeodeticHeight(f.attributes.position.values,o,i),l(e._offsetAttribute)){let m=e._offsetAttribute===mn.NONE?0:1,y=f.attributes.position.values.length,A=new Uint8Array(y/3).fill(m);f.attributes.applyOffset=new Me({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:A})}}let d=f.attributes,p=se.fromVertices(d.position.values,void 0,3);return c.position||(f.attributes.position.values=void 0),new Tt({attributes:d,indices:f.indices,primitiveType:Re.TRIANGLES,boundingSphere:p,offsetAttribute:e._offsetAttribute})};M0.createShadowVolume=function(e,t,n){let i=e._granularity,r=e._ellipsoid,o=t(i,r),a=n(i,r);return new M0({positions:e._positions,width:e._width,cornerType:e._cornerType,ellipsoid:r,granularity:i,extrudedHeight:o,height:a,vertexFormat:Be.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(M0.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=gfe(this._positions,this._ellipsoid,this._width,this._cornerType)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return[0,0,0,1,1,0]}}});var OC=M0;var Afe=new h,bfe=new h,sGe=new h;function cGe(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function xfe(e,t){let n=[],i=e.positions,r=e.corners,o=e.endPositions,a=new xn,s,c=0,u=0,f,d=0,p;for(f=0;f<i.length;f+=2)p=i[f].length-3,c+=p,d+=p/3*4,u+=i[f+1].length-3;for(c+=3,u+=3,f=0;f<r.length;f++){let L=r[f].leftPositions;l(L)?(p=L.length,c+=p,d+=p/3*2):(p=r[f].rightPositions.length,u+=p,d+=p/3*2)}let g=l(o),m;g&&(m=o[0].length-3,c+=m,u+=m,m/=3,d+=m*4);let y=c+u,A=new Float64Array(y),b=0,x=y-1,T,C,E,w,D,R,M=m/2,N=Ve.createTypedArray(y/3,d+4),_=0;if(N[_++]=b/3,N[_++]=(x-2)/3,g){n.push(b/3),R=Afe,D=bfe;let L=o[0];for(f=0;f<M;f++)R=h.fromArray(L,(M-1-f)*3,R),D=h.fromArray(L,(M+f)*3,D),sr.addAttribute(A,D,b),sr.addAttribute(A,R,void 0,x),C=b/3,w=C+1,T=(x-2)/3,E=T-1,N[_++]=T,N[_++]=E,N[_++]=C,N[_++]=w,b+=3,x-=3}let v=0,S=i[v++],P=i[v++];for(A.set(S,b),A.set(P,x-P.length+1),p=P.length-3,n.push(b/3,(x-2)/3),f=0;f<p;f+=3)C=b/3,w=C+1,T=(x-2)/3,E=T-1,N[_++]=T,N[_++]=E,N[_++]=C,N[_++]=w,b+=3,x-=3;for(f=0;f<r.length;f++){let L;s=r[f];let F=s.leftPositions,V=s.rightPositions,z,j=sGe;if(l(F)){for(x-=3,z=E,n.push(w),L=0;L<F.length/3;L++)j=h.fromArray(F,L*3,j),N[_++]=z-L-1,N[_++]=z-L,sr.addAttribute(A,j,void 0,x),x-=3;n.push(z-Math.floor(F.length/6)),t===tr.BEVELED&&n.push((x-2)/3+1),b+=3}else{for(b+=3,z=w,n.push(E),L=0;L<V.length/3;L++)j=h.fromArray(V,L*3,j),N[_++]=z+L,N[_++]=z+L+1,sr.addAttribute(A,j,b),b+=3;n.push(z+Math.floor(V.length/6)),t===tr.BEVELED&&n.push(b/3-1),x-=3}for(S=i[v++],P=i[v++],S.splice(0,3),P.splice(P.length-3,3),A.set(S,b),A.set(P,x-P.length+1),L=0;L<P.length;L+=3)w=b/3,C=w-1,E=(x-2)/3,T=E+1,N[_++]=T,N[_++]=E,N[_++]=C,N[_++]=w,b+=3,x-=3;b-=3,x+=3,n.push(b/3,(x-2)/3)}if(g){b+=3,x-=3,R=Afe,D=bfe;let L=o[1];for(f=0;f<M;f++)R=h.fromArray(L,(m-f-1)*3,R),D=h.fromArray(L,f*3,D),sr.addAttribute(A,R,void 0,x),sr.addAttribute(A,D,b),w=b/3,C=w-1,E=(x-2)/3,T=E+1,N[_++]=T,N[_++]=E,N[_++]=C,N[_++]=w,b+=3,x-=3;n.push(b/3)}else n.push(b/3,(x-2)/3);return N[_++]=b/3,N[_]=(x-2)/3,a.position=new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:A}),{attributes:a,indices:N,wallIndices:n}}function lGe(e){let t=e.ellipsoid,n=sr.computePositions(e),i=xfe(n,e.cornerType),r=i.wallIndices,o=e.height,a=e.extrudedHeight,s=i.attributes,c=i.indices,u=s.position.values,f=u.length,d=new Float64Array(f);d.set(u);let p=new Float64Array(f*2);if(u=li.scaleToGeodeticHeight(u,o,t),d=li.scaleToGeodeticHeight(d,a,t),p.set(u),p.set(d,f),s.position.values=p,f/=3,l(e.offsetAttribute)){let T=new Uint8Array(f*2);if(e.offsetAttribute===mn.TOP)T=T.fill(1,0,f);else{let C=e.offsetAttribute===mn.NONE?0:1;T=T.fill(C)}s.applyOffset=new Me({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:T})}let g,m=c.length,y=Ve.createTypedArray(p.length/3,(m+r.length)*2);y.set(c);let A=m;for(g=0;g<m;g+=2){let T=c[g],C=c[g+1];y[A++]=T+f,y[A++]=C+f}let b,x;for(g=0;g<r.length;g++)b=r[g],x=b+f,y[A++]=b,y[A++]=x;return{attributes:s,indices:y}}function JI(e){e=e??H.EMPTY_OBJECT;let t=e.positions,n=e.width,i=e.height??0,r=e.extrudedHeight??i;this._positions=t,this._ellipsoid=te.clone(e.ellipsoid??te.default),this._width=n,this._height=Math.max(i,r),this._extrudedHeight=Math.min(i,r),this._cornerType=e.cornerType??tr.ROUNDED,this._granularity=e.granularity??I.RADIANS_PER_DEGREE,this._offsetAttribute=e.offsetAttribute,this._workerName="createCorridorOutlineGeometry",this.packedLength=1+t.length*h.packedLength+te.packedLength+6}JI.pack=function(e,t,n){n=n??0;let i=e._positions,r=i.length;t[n++]=r;for(let o=0;o<r;++o,n+=h.packedLength)h.pack(i[o],t,n);return te.pack(e._ellipsoid,t,n),n+=te.packedLength,t[n++]=e._width,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._cornerType,t[n++]=e._granularity,t[n]=e._offsetAttribute??-1,t};var Tfe=te.clone(te.UNIT_SPHERE),I_={positions:void 0,ellipsoid:Tfe,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,offsetAttribute:void 0};JI.unpack=function(e,t,n){t=t??0;let i=e[t++],r=new Array(i);for(let p=0;p<i;++p,t+=h.packedLength)r[p]=h.unpack(e,t);let o=te.unpack(e,t,Tfe);t+=te.packedLength;let a=e[t++],s=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t];return l(n)?(n._positions=r,n._ellipsoid=te.clone(o,n._ellipsoid),n._width=a,n._height=s,n._extrudedHeight=c,n._cornerType=u,n._granularity=f,n._offsetAttribute=d===-1?void 0:d,n):(I_.positions=r,I_.width=a,I_.height=s,I_.extrudedHeight=c,I_.cornerType=u,I_.granularity=f,I_.offsetAttribute=d===-1?void 0:d,new JI(I_))};JI.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=cGe(t,i);let r=Pr(t,h.equalsEpsilon);if(r.length<2||n<=0)return;let o=e._height,a=e._extrudedHeight,s=!I.equalsEpsilon(o,a,0,I.EPSILON2),c={ellipsoid:i,positions:r,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!1},u;if(s)c.height=o,c.extrudedHeight=a,c.offsetAttribute=e._offsetAttribute,u=lGe(c);else{let p=sr.computePositions(c);if(u=xfe(p,c.cornerType),u.attributes.position.values=li.scaleToGeodeticHeight(u.attributes.position.values,o,i),l(e._offsetAttribute)){let g=u.attributes.position.values.length,m=e._offsetAttribute===mn.NONE?0:1,y=new Uint8Array(g/3).fill(m);u.attributes.applyOffset=new Me({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:y})}}let f=u.attributes,d=se.fromVertices(f.position.values,void 0,3);return new Tt({attributes:f,indices:u.indices,primitiveType:Re.LINES,boundingSphere:d,offsetAttribute:e._offsetAttribute})};var AN=JI;function Jf(e){this.planes=e??[]}var ZI=[new h,new h,new h];h.clone(h.UNIT_X,ZI[0]);h.clone(h.UNIT_Y,ZI[1]);h.clone(h.UNIT_Z,ZI[2]);var P_=new h,uGe=new h,Cfe=new tn(new h(1,0,0),0);Jf.fromBoundingSphere=function(e,t){l(t)||(t=new Jf);let n=ZI.length,i=t.planes;i.length=2*n;let r=e.center,o=e.radius,a=0;for(let s=0;s<n;++s){let c=ZI[s],u=i[a],f=i[a+1];l(u)||(u=i[a]=new ae),l(f)||(f=i[a+1]=new ae),h.multiplyByScalar(c,-o,P_),h.add(r,P_,P_),u.x=c.x,u.y=c.y,u.z=c.z,u.w=-h.dot(c,P_),h.multiplyByScalar(c,o,P_),h.add(r,P_,P_),f.x=-c.x,f.y=-c.y,f.z=-c.z,f.w=-h.dot(h.negate(c,uGe),P_),a+=2}return t};Jf.prototype.computeVisibility=function(e){let t=this.planes,n=!1;for(let i=0,r=t.length;i<r;++i){let o=e.intersectPlane(tn.fromCartesian4(t[i],Cfe));if(o===Xt.OUTSIDE)return Xt.OUTSIDE;o===Xt.INTERSECTING&&(n=!0)}return n?Xt.INTERSECTING:Xt.INSIDE};Jf.prototype.computeVisibilityWithPlaneMask=function(e,t){if(t===Jf.MASK_OUTSIDE||t===Jf.MASK_INSIDE)return t;let n=Jf.MASK_INSIDE,i=this.planes;for(let r=0,o=i.length;r<o;++r){let a=r<31?1<<r:0;if(r<31&&(t&a)===0)continue;let s=e.intersectPlane(tn.fromCartesian4(i[r],Cfe));if(s===Xt.OUTSIDE)return Jf.MASK_OUTSIDE;s===Xt.INTERSECTING&&(n|=a)}return n};Jf.MASK_OUTSIDE=4294967295;Jf.MASK_INSIDE=0;Jf.MASK_INDETERMINATE=2147483647;var is=Jf;function MC(e){e=e??H.EMPTY_OBJECT,this._callback=e.callback,this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new $i({ellipsoid:e.ellipsoid??te.default})),this._width=e.width,this._height=e.height;let t=Math.max(this._width,this._height);this._levelZeroMaximumGeometricError=Vr.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,t,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new be;let n=e.credit;typeof n=="string"&&(n=new wt(n)),this._credit=n}Object.defineProperties(MC.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}}});MC.prototype.requestTileGeometry=function(e,t,n,i){let r=this._callback(e,t,n);if(!l(r))return;let o=this._width,a=this._height;return Promise.resolve(r).then(function(s){let c=s;return Array.isArray(c)&&(c=new Float64Array(c)),new Lc({buffer:c,width:o,height:a})})};MC.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};MC.prototype.getTileDataAvailable=function(e,t,n){};MC.prototype.loadTileDataAvailability=function(e,t,n){};var vfe=MC;var Efe={};Efe.computePositions=function(e,t,n,i,r){let o=e*.5,a=-o,s=i+i,c=r?2*s:s,u=new Float64Array(c*3),f,d=0,p=0,g=r?s*3:0,m=r?(s+i)*3:i*3;for(f=0;f<i;f++){let y=f/i*I.TWO_PI,A=Math.cos(y),b=Math.sin(y),x=A*n,T=b*n,C=A*t,E=b*t;u[p+g]=x,u[p+g+1]=T,u[p+g+2]=a,u[p+m]=C,u[p+m+1]=E,u[p+m+2]=o,p+=3,r&&(u[d++]=x,u[d++]=T,u[d++]=a,u[d++]=C,u[d++]=E,u[d++]=o)}return u};var LC=Efe;var aX=new k,fGe=new h,dGe=new h,hGe=new h,mGe=new h;function L0(e){e=e??H.EMPTY_OBJECT;let t=e.length,n=e.topRadius,i=e.bottomRadius,r=e.vertexFormat??Be.DEFAULT,o=e.slices??128;this._length=t,this._topRadius=n,this._bottomRadius=i,this._vertexFormat=Be.clone(r),this._slices=o,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderGeometry"}L0.packedLength=Be.packedLength+5;L0.pack=function(e,t,n){return n=n??0,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n]=e._offsetAttribute??-1,t};var Sfe=new Be,NC={vertexFormat:Sfe,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};L0.unpack=function(e,t,n){t=t??0;let i=Be.unpack(e,t,Sfe);t+=Be.packedLength;let r=e[t++],o=e[t++],a=e[t++],s=e[t++],c=e[t];return l(n)?(n._vertexFormat=Be.clone(i,n._vertexFormat),n._length=r,n._topRadius=o,n._bottomRadius=a,n._slices=s,n._offsetAttribute=c===-1?void 0:c,n):(NC.length=r,NC.topRadius=o,NC.bottomRadius=a,NC.slices=s,NC.offsetAttribute=c===-1?void 0:c,new L0(NC))};L0.createGeometry=function(e){let t=e._length,n=e._topRadius,i=e._bottomRadius,r=e._vertexFormat,o=e._slices;if(t<=0||n<0||i<0||n===0&&i===0)return;let a=o+o,s=o+a,c=a+a,u=LC.computePositions(t,n,i,o,!0),f=r.st?new Float32Array(c*2):void 0,d=r.normal?new Float32Array(c*3):void 0,p=r.tangent?new Float32Array(c*3):void 0,g=r.bitangent?new Float32Array(c*3):void 0,m,y=r.normal||r.tangent||r.bitangent;if(y){let D=r.tangent||r.bitangent,R=0,M=0,N=0,_=Math.atan2(i-n,t),v=fGe;v.z=Math.sin(_);let S=Math.cos(_),P=hGe,L=dGe;for(m=0;m<o;m++){let F=m/o*I.TWO_PI,V=S*Math.cos(F),z=S*Math.sin(F);y&&(v.x=V,v.y=z,D&&(P=h.normalize(h.cross(h.UNIT_Z,v,P),P)),r.normal&&(d[R++]=v.x,d[R++]=v.y,d[R++]=v.z,d[R++]=v.x,d[R++]=v.y,d[R++]=v.z),r.tangent&&(p[M++]=P.x,p[M++]=P.y,p[M++]=P.z,p[M++]=P.x,p[M++]=P.y,p[M++]=P.z),r.bitangent&&(L=h.normalize(h.cross(v,P,L),L),g[N++]=L.x,g[N++]=L.y,g[N++]=L.z,g[N++]=L.x,g[N++]=L.y,g[N++]=L.z))}for(m=0;m<o;m++)r.normal&&(d[R++]=0,d[R++]=0,d[R++]=-1),r.tangent&&(p[M++]=1,p[M++]=0,p[M++]=0),r.bitangent&&(g[N++]=0,g[N++]=-1,g[N++]=0);for(m=0;m<o;m++)r.normal&&(d[R++]=0,d[R++]=0,d[R++]=1),r.tangent&&(p[M++]=1,p[M++]=0,p[M++]=0),r.bitangent&&(g[N++]=0,g[N++]=1,g[N++]=0)}let A=12*o-12,b=Ve.createTypedArray(c,A),x=0,T=0;for(m=0;m<o-1;m++)b[x++]=T,b[x++]=T+2,b[x++]=T+3,b[x++]=T,b[x++]=T+3,b[x++]=T+1,T+=2;for(b[x++]=a-2,b[x++]=0,b[x++]=1,b[x++]=a-2,b[x++]=1,b[x++]=a-1,m=1;m<o-1;m++)b[x++]=a+m+1,b[x++]=a+m,b[x++]=a;for(m=1;m<o-1;m++)b[x++]=s,b[x++]=s+m,b[x++]=s+m+1;let C=0;if(r.st){let D=Math.max(n,i);for(m=0;m<c;m++){let R=h.fromArray(u,m*3,mGe);f[C++]=(R.x+D)/(2*D),f[C++]=(R.y+D)/(2*D)}}let E=new xn;r.position&&(E.position=new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:u})),r.normal&&(E.normal=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:d})),r.tangent&&(E.tangent=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:p})),r.bitangent&&(E.bitangent=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:g})),r.st&&(E.st=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:f})),aX.x=t*.5,aX.y=Math.max(i,n);let w=new se(h.ZERO,k.magnitude(aX));if(l(e._offsetAttribute)){t=u.length;let D=e._offsetAttribute===mn.NONE?0:1,R=new Uint8Array(t/3).fill(D);E.applyOffset=new Me({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:R})}return new Tt({attributes:E,indices:b,primitiveType:Re.TRIANGLES,boundingSphere:w,offsetAttribute:e._offsetAttribute})};var sX;L0.getUnitCylinder=function(){return l(sX)||(sX=L0.createGeometry(new L0({topRadius:1,bottomRadius:1,length:1,vertexFormat:Be.POSITION_ONLY}))),sX};var bN=L0;var cX=new k;function FC(e){e=e??H.EMPTY_OBJECT;let t=e.length,n=e.topRadius,i=e.bottomRadius,r=e.slices??128,o=Math.max(e.numberOfVerticalLines??16,0);this._length=t,this._topRadius=n,this._bottomRadius=i,this._slices=r,this._numberOfVerticalLines=o,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderOutlineGeometry"}FC.packedLength=6;FC.pack=function(e,t,n){return n=n??0,t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n++]=e._numberOfVerticalLines,t[n]=e._offsetAttribute??-1,t};var gb={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};FC.unpack=function(e,t,n){t=t??0;let i=e[t++],r=e[t++],o=e[t++],a=e[t++],s=e[t++],c=e[t];return l(n)?(n._length=i,n._topRadius=r,n._bottomRadius=o,n._slices=a,n._numberOfVerticalLines=s,n._offsetAttribute=c===-1?void 0:c,n):(gb.length=i,gb.topRadius=r,gb.bottomRadius=o,gb.slices=a,gb.numberOfVerticalLines=s,gb.offsetAttribute=c===-1?void 0:c,new FC(gb))};FC.createGeometry=function(e){let t=e._length,n=e._topRadius,i=e._bottomRadius,r=e._slices,o=e._numberOfVerticalLines;if(t<=0||n<0||i<0||n===0&&i===0)return;let a=r*2,s=LC.computePositions(t,n,i,r,!1),c=r*2,u;if(o>0){let y=Math.min(o,r);u=Math.round(r/y),c+=y}let f=Ve.createTypedArray(a,c*2),d=0,p;for(p=0;p<r-1;p++)f[d++]=p,f[d++]=p+1,f[d++]=p+r,f[d++]=p+1+r;if(f[d++]=r-1,f[d++]=0,f[d++]=r+r-1,f[d++]=r,o>0)for(p=0;p<r;p+=u)f[d++]=p,f[d++]=p+r;let g=new xn;g.position=new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:s}),cX.x=t*.5,cX.y=Math.max(i,n);let m=new se(h.ZERO,k.magnitude(cX));if(l(e._offsetAttribute)){t=s.length;let y=e._offsetAttribute===mn.NONE?0:1,A=new Uint8Array(t/3).fill(y);g.applyOffset=new Me({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:A})}return new Tt({attributes:g,indices:f,primitiveType:Re.LINES,boundingSphere:m,offsetAttribute:e._offsetAttribute})};var xN=FC;function wfe(e){this.proxy=e}wfe.prototype.getURL=function(e){let t=this.proxy.indexOf("?")===-1?"?":"";return this.proxy+t+encodeURIComponent(e)};var Ife=wfe;function Ju(e,t){e=e??0,this._near=e,t=t??Number.MAX_VALUE,this._far=t}Object.defineProperties(Ju.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}}});Ju.packedLength=2;Ju.pack=function(e,t,n){return n=n??0,t[n++]=e.near,t[n]=e.far,t};Ju.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Ju),n.near=e[t++],n.far=e[t],n};Ju.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.far===t.far};Ju.clone=function(e,t){if(l(e))return l(t)||(t=new Ju),t.near=e.near,t.far=e.far,t};Ju.prototype.clone=function(e){return Ju.clone(this,e)};Ju.prototype.equals=function(e){return Ju.equals(this,e)};var jt=Ju;function QI(e,t){e=e??0,t=t??Number.MAX_VALUE,this.value=new Float32Array([e,t])}Object.defineProperties(QI.prototype,{componentDatatype:{get:function(){return Y.FLOAT}},componentsPerAttribute:{get:function(){return 2}},normalize:{get:function(){return!1}}});QI.fromDistanceDisplayCondition=function(e){return new QI(e.near,e.far)};QI.toValue=function(e,t){return l(t)?(t[0]=e.near,t[1]=e.far,t):new Float32Array([e.near,e.far])};var Jn=QI;function eP(){this.head=void 0,this.tail=void 0,this._length=0}Object.defineProperties(eP.prototype,{length:{get:function(){return this._length}}});function pGe(e,t,n){this.item=e,this.previous=t,this.next=n}eP.prototype.add=function(e){let t=new pGe(e,this.tail,void 0);return l(this.tail)?(this.tail.next=t,this.tail=t):(this.head=t,this.tail=t),++this._length,t};function Pfe(e,t){l(t.previous)&&l(t.next)?(t.previous.next=t.next,t.next.previous=t.previous):l(t.previous)?(t.previous.next=void 0,e.tail=t.previous):l(t.next)?(t.next.previous=void 0,e.head=t.next):(e.head=void 0,e.tail=void 0),t.next=void 0,t.previous=void 0}eP.prototype.remove=function(e){l(e)&&(Pfe(this,e),--this._length)};eP.prototype.splice=function(e,t){if(e===t)return;Pfe(this,t);let n=e.next;e.next=t,this.tail===e?this.tail=t:n.previous=t,t.next=n,t.previous=e};var TN=eP;var qi=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-qi.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?qi.Bounce.In(e*2)*.5:qi.Bounce.Out(e*2-1)*.5+.5}}),generatePow:function(e){return e===void 0&&(e=4),e=e<Number.EPSILON?Number.EPSILON:e,e=e>1e4?1e4:e,{In:function(t){return Math.pow(t,e)},Out:function(t){return 1-Math.pow(1-t,e)},InOut:function(t){return t<.5?Math.pow(t*2,e)/2:(1-Math.pow(2-t*2,e))/2+.5}}}}),tP=function(){return performance.now()},gGe=(function(){function e(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,t)}return e.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map(function(n){return t._tweens[n]})},e.prototype.removeAll=function(){this._tweens={}},e.prototype.add=function(){for(var t,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];for(var r=0,o=n;r<o.length;r++){var a=o[r];(t=a._group)===null||t===void 0||t.remove(a),a._group=this,this._tweens[a.getId()]=a,this._tweensAddedDuringUpdate[a.getId()]=a}},e.prototype.remove=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var i=0,r=t;i<r.length;i++){var o=r[i];o._group=void 0,delete this._tweens[o.getId()],delete this._tweensAddedDuringUpdate[o.getId()]}},e.prototype.allStopped=function(){return this.getAll().every(function(t){return!t.isPlaying()})},e.prototype.update=function(t,n){t===void 0&&(t=tP()),n===void 0&&(n=!0);var i=Object.keys(this._tweens);if(i.length!==0)for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var r=0;r<i.length;r++){var o=this._tweens[i[r]],a=!n;o&&o.update(t,a)===!1&&!n&&this.remove(o)}i=Object.keys(this._tweensAddedDuringUpdate)}},e})(),BC={Linear:function(e,t){var n=e.length-1,i=n*t,r=Math.floor(i),o=BC.Utils.Linear;return t<0?o(e[0],e[1],i):t>1?o(e[n],e[n-1],n-i):o(e[r],e[r+1>n?n:r+1],i-r)},Bezier:function(e,t){for(var n=0,i=e.length-1,r=Math.pow,o=BC.Utils.Bernstein,a=0;a<=i;a++)n+=r(1-t,i-a)*r(t,a)*e[a]*o(i,a);return n},CatmullRom:function(e,t){var n=e.length-1,i=n*t,r=Math.floor(i),o=BC.Utils.CatmullRom;return e[0]===e[n]?(t<0&&(r=Math.floor(i=n*(1+t))),o(e[(r-1+n)%n],e[r],e[(r+1)%n],e[(r+2)%n],i-r)):t<0?e[0]-(o(e[0],e[0],e[1],e[1],-i)-e[0]):t>1?e[n]-(o(e[n],e[n],e[n-1],e[n-1],i-n)-e[n]):o(e[r?r-1:0],e[r],e[n<r+1?n:r+1],e[n<r+2?n:r+2],i-r)},Utils:{Linear:function(e,t,n){return(t-e)*n+e},Bernstein:function(e,t){var n=BC.Utils.Factorial;return n(e)/n(t)/n(e-t)},Factorial:(function(){var e=[1];return function(t){var n=1;if(e[t])return e[t];for(var i=t;i>1;i--)n*=i;return e[t]=n,n}})(),CatmullRom:function(e,t,n,i,r){var o=(n-e)*.5,a=(i-t)*.5,s=r*r,c=r*s;return(2*t-2*n+o+a)*c+(-3*t+3*n-2*o-a)*s+o*r+t}}},Dfe=(function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e})(),lX=new gGe,Rfe=(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=qi.Linear.None,this._interpolationFunction=BC.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=Dfe.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=lX,lX.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=tP()),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 r={};for(var o in this._valuesEnd)r[o]=this._valuesEnd[o];this._valuesEnd=r}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,r,o){for(var a in i){var s=t[a],c=Array.isArray(s),u=c?"array":typeof s,f=!c&&Array.isArray(i[a]);if(!(u==="undefined"||u==="function")){if(f){var d=i[a];if(d.length===0)continue;for(var p=[s],g=0,m=d.length;g<m;g+=1){var y=this._handleRelativeValue(s,d[g]);if(isNaN(y)){f=!1,console.warn("Found invalid interpolation list. Skipping.");break}p.push(y)}f&&(i[a]=p)}if((u==="object"||c)&&s&&!f){n[a]=c?[]:{};var A=s;for(var b in A)n[a][b]=A[b];r[a]=c?[]:{};var d=i[a];if(!this._isDynamic){var x={};for(var b in d)x[b]=d[b];i[a]=d=x}this._setupProperties(A,n[a],d,r[a],o)}else(typeof n[a]>"u"||o)&&(n[a]=s),c||(n[a]*=1),f?r[a]=i[a].slice().reverse():r[a]=n[a]||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=tP()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this)},e.prototype.resume=function(t){return t===void 0&&(t=tP()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this)},e.prototype.stopChainedTweens=function(){for(var t=0,n=this._chainedTweens.length;t<n;t++)this._chainedTweens[t].stop();return this},e.prototype.group=function(t){return t?(t.add(this),this):(console.warn("tween.group() without args has been removed, use group.add(tween) instead."),this)},e.prototype.remove=function(){var t;return(t=this._group)===null||t===void 0||t.remove(this),this},e.prototype.delay=function(t){return t===void 0&&(t=0),this._delayTime=t,this},e.prototype.repeat=function(t){return t===void 0&&(t=0),this._initialRepeat=t,this._repeat=t,this},e.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},e.prototype.yoyo=function(t){return t===void 0&&(t=!1),this._yoyo=t,this},e.prototype.easing=function(t){return t===void 0&&(t=qi.Linear.None),this._easingFunction=t,this},e.prototype.interpolation=function(t){return t===void 0&&(t=BC.Linear),this._interpolationFunction=t,this},e.prototype.chain=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return this._chainedTweens=t,this},e.prototype.onStart=function(t){return this._onStartCallback=t,this},e.prototype.onEveryStart=function(t){return this._onEveryStartCallback=t,this},e.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},e.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},e.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},e.prototype.onStop=function(t){return this._onStopCallback=t,this},e.prototype.update=function(t,n){var i=this,r;if(t===void 0&&(t=tP()),n===void 0&&(n=e.autoStartOnUpdate),this._isPaused)return!0;var o;if(!this._goToEnd&&!this._isPlaying)if(n)this.start(t,!0);else return!1;if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var a=t-this._startTime,s=this._duration+((r=this._repeatDelayTime)!==null&&r!==void 0?r:this._delayTime),c=this._duration+this._repeat*s,u=function(){if(i._duration===0||a>c)return 1;var y=Math.trunc(a/s),A=a-y*s,b=Math.min(A/i._duration,1);return b===0&&a===i._duration?1:b},f=u(),d=this._easingFunction(f);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,d),this._onUpdateCallback&&this._onUpdateCallback(this._object,f),this._duration===0||a>=this._duration)if(this._repeat>0){var p=Math.min(Math.trunc((a-this._duration)/s)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=p);for(o in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[o]=="string"&&(this._valuesStartRepeat[o]=this._valuesStartRepeat[o]+parseFloat(this._valuesEnd[o])),this._yoyo&&this._swapEndStartRepeatValues(o),this._valuesStart[o]=this._valuesStartRepeat[o];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=s*p,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var g=0,m=this._chainedTweens.length;g<m;g++)this._chainedTweens[g].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},e.prototype._updateProperties=function(t,n,i,r){for(var o in i)if(n[o]!==void 0){var a=n[o]||0,s=i[o],c=Array.isArray(t[o]),u=Array.isArray(s),f=!c&&u;f?t[o]=this._interpolationFunction(s,r):typeof s=="object"&&s?this._updateProperties(t[o],a,s,r):(s=this._handleRelativeValue(a,s),typeof s=="number"&&(t[o]=a+(s-a)*r))}},e.prototype._handleRelativeValue=function(t,n){return typeof n!="string"?n:n.charAt(0)==="+"||n.charAt(0)==="-"?t+parseFloat(n):parseFloat(n)},e.prototype._swapEndStartRepeatValues=function(t){var n=this._valuesStartRepeat[t],i=this._valuesEnd[t];typeof i=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(i):this._valuesStartRepeat[t]=this._valuesEnd[t],this._valuesEnd[t]=n},e.autoStartOnUpdate=!1,e})();var kcn=Dfe.nextId,Gm=lX,zcn=Gm.getAll.bind(Gm),Ucn=Gm.removeAll.bind(Gm),Vcn=Gm.add.bind(Gm),jcn=Gm.remove.bind(Gm),Hcn=Gm.update.bind(Gm);var _Ge={LINEAR_NONE:qi.Linear.None,QUADRATIC_IN:qi.Quadratic.In,QUADRATIC_OUT:qi.Quadratic.Out,QUADRATIC_IN_OUT:qi.Quadratic.InOut,CUBIC_IN:qi.Cubic.In,CUBIC_OUT:qi.Cubic.Out,CUBIC_IN_OUT:qi.Cubic.InOut,QUARTIC_IN:qi.Quartic.In,QUARTIC_OUT:qi.Quartic.Out,QUARTIC_IN_OUT:qi.Quartic.InOut,QUINTIC_IN:qi.Quintic.In,QUINTIC_OUT:qi.Quintic.Out,QUINTIC_IN_OUT:qi.Quintic.InOut,SINUSOIDAL_IN:qi.Sinusoidal.In,SINUSOIDAL_OUT:qi.Sinusoidal.Out,SINUSOIDAL_IN_OUT:qi.Sinusoidal.InOut,EXPONENTIAL_IN:qi.Exponential.In,EXPONENTIAL_OUT:qi.Exponential.Out,EXPONENTIAL_IN_OUT:qi.Exponential.InOut,CIRCULAR_IN:qi.Circular.In,CIRCULAR_OUT:qi.Circular.Out,CIRCULAR_IN_OUT:qi.Circular.InOut,ELASTIC_IN:qi.Elastic.In,ELASTIC_OUT:qi.Elastic.Out,ELASTIC_IN_OUT:qi.Elastic.InOut,BACK_IN:qi.Back.In,BACK_OUT:qi.Back.Out,BACK_IN_OUT:qi.Back.InOut,BOUNCE_IN:qi.Bounce.In,BOUNCE_OUT:qi.Bounce.Out,BOUNCE_IN_OUT:qi.Bounce.InOut},ya=Object.freeze(_Ge);var yGe=new h,AGe=new h,bGe=new h,xGe=new h,TGe=new h,CGe=new h(1,1,1),Ofe=Math.cos,Mfe=Math.sin;function N0(e){e=e??H.EMPTY_OBJECT;let t=e.radii??CGe,n=e.innerRadii??t,i=e.minimumClock??0,r=e.maximumClock??I.TWO_PI,o=e.minimumCone??0,a=e.maximumCone??I.PI,s=Math.round(e.stackPartitions??64),c=Math.round(e.slicePartitions??64),u=e.vertexFormat??Be.DEFAULT;this._radii=h.clone(t),this._innerRadii=h.clone(n),this._minimumClock=i,this._maximumClock=r,this._minimumCone=o,this._maximumCone=a,this._stackPartitions=s,this._slicePartitions=c,this._vertexFormat=Be.clone(u),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidGeometry"}N0.packedLength=2*h.packedLength+Be.packedLength+7;N0.pack=function(e,t,n){return n=n??0,h.pack(e._radii,t,n),n+=h.packedLength,h.pack(e._innerRadii,t,n),n+=h.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n++]=e._minimumClock,t[n++]=e._maximumClock,t[n++]=e._minimumCone,t[n++]=e._maximumCone,t[n++]=e._stackPartitions,t[n++]=e._slicePartitions,t[n]=e._offsetAttribute??-1,t};var Lfe=new h,Nfe=new h,Ffe=new Be,D_={radii:Lfe,innerRadii:Nfe,vertexFormat:Ffe,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};N0.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,Lfe);t+=h.packedLength;let r=h.unpack(e,t,Nfe);t+=h.packedLength;let o=Be.unpack(e,t,Ffe);t+=Be.packedLength;let a=e[t++],s=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t];return l(n)?(n._radii=h.clone(i,n._radii),n._innerRadii=h.clone(r,n._innerRadii),n._vertexFormat=Be.clone(o,n._vertexFormat),n._minimumClock=a,n._maximumClock=s,n._minimumCone=c,n._maximumCone=u,n._stackPartitions=f,n._slicePartitions=d,n._offsetAttribute=p===-1?void 0:p,n):(D_.minimumClock=a,D_.maximumClock=s,D_.minimumCone=c,D_.maximumCone=u,D_.stackPartitions=f,D_.slicePartitions=d,D_.offsetAttribute=p===-1?void 0:p,new N0(D_))};N0.createGeometry=function(e){let t=e._radii;if(t.x<=0||t.y<=0||t.z<=0)return;let n=e._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let i=e._minimumClock,r=e._maximumClock,o=e._minimumCone,a=e._maximumCone,s=e._vertexFormat,c=e._slicePartitions+1,u=e._stackPartitions+1;c=Math.round(c*Math.abs(r-i)/I.TWO_PI),u=Math.round(u*Math.abs(a-o)/I.PI),c<2&&(c=2),u<2&&(u=2);let f,d,p=0,g=[o],m=[i];for(f=0;f<u;f++)g.push(o+f*(a-o)/(u-1));for(g.push(a),d=0;d<c;d++)m.push(i+d*(r-i)/(c-1));m.push(r);let y=g.length,A=m.length,b=0,x=1,T=n.x!==t.x||n.y!==t.y||n.z!==t.z,C=!1,E=!1,w=!1;T&&(x=2,o>0&&(C=!0,b+=c-1),a<Math.PI&&(E=!0,b+=c-1),(r-i)%I.TWO_PI?(w=!0,b+=(u-1)*2+1):b+=1);let D=A*y*x,R=new Float64Array(D*3),M=new Array(D).fill(!1),N=new Array(D).fill(!1),_=c*u*x,v=6*(_+b+1-(c+u)*x),S=Ve.createTypedArray(_,v),P=s.normal?new Float32Array(D*3):void 0,L=s.tangent?new Float32Array(D*3):void 0,F=s.bitangent?new Float32Array(D*3):void 0,V=s.st?new Float32Array(D*2):void 0,z=new Array(y),j=new Array(y);for(f=0;f<y;f++)z[f]=Mfe(g[f]),j[f]=Ofe(g[f]);let B=new Array(A),G=new Array(A);for(d=0;d<A;d++)G[d]=Ofe(m[d]),B[d]=Mfe(m[d]);for(f=0;f<y;f++)for(d=0;d<A;d++)R[p++]=t.x*z[f]*G[d],R[p++]=t.y*z[f]*B[d],R[p++]=t.z*j[f];let W=D/2;if(T)for(f=0;f<y;f++)for(d=0;d<A;d++)R[p++]=n.x*z[f]*G[d],R[p++]=n.y*z[f]*B[d],R[p++]=n.z*j[f],M[W]=!0,f>0&&f!==y-1&&d!==0&&d!==A-1&&(N[W]=!0),W++;p=0;let Q,q;for(f=1;f<y-2;f++)for(Q=f*A,q=(f+1)*A,d=1;d<A-2;d++)S[p++]=q+d,S[p++]=q+d+1,S[p++]=Q+d+1,S[p++]=q+d,S[p++]=Q+d+1,S[p++]=Q+d;if(T){let Ye=y*A;for(f=1;f<y-2;f++)for(Q=Ye+f*A,q=Ye+(f+1)*A,d=1;d<A-2;d++)S[p++]=q+d,S[p++]=Q+d,S[p++]=Q+d+1,S[p++]=q+d,S[p++]=Q+d+1,S[p++]=q+d+1}let J,Z;if(T){if(C)for(Z=y*A,f=1;f<A-2;f++)S[p++]=f,S[p++]=f+1,S[p++]=Z+f+1,S[p++]=f,S[p++]=Z+f+1,S[p++]=Z+f;if(E)for(J=y*A-A,Z=y*A*x-A,f=1;f<A-2;f++)S[p++]=J+f+1,S[p++]=J+f,S[p++]=Z+f,S[p++]=J+f+1,S[p++]=Z+f,S[p++]=Z+f+1}if(w){for(f=1;f<y-2;f++)Z=A*y+A*f,J=A*f,S[p++]=Z,S[p++]=J+A,S[p++]=J,S[p++]=Z,S[p++]=Z+A,S[p++]=J+A;for(f=1;f<y-2;f++)Z=A*y+A*(f+1)-1,J=A*(f+1)-1,S[p++]=J+A,S[p++]=Z,S[p++]=J,S[p++]=J+A,S[p++]=Z+A,S[p++]=Z}let ce=new xn;s.position&&(ce.position=new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:R}));let Ae=0,le=0,Ce=0,ye=0,ve=D/2,Ie,Le=te.fromCartesian3(t),$e=te.fromCartesian3(n);if(s.st||s.normal||s.tangent||s.bitangent){for(f=0;f<D;f++){Ie=M[f]?$e:Le;let Ye=h.fromArray(R,f*3,yGe),yt=Ie.geodeticSurfaceNormal(Ye,AGe);if(N[f]&&h.negate(yt,yt),s.st){let Ke=k.negate(yt,TGe);V[Ae++]=Math.atan2(Ke.y,Ke.x)/I.TWO_PI+.5,V[Ae++]=Math.asin(yt.z)/Math.PI+.5}if(s.normal&&(P[le++]=yt.x,P[le++]=yt.y,P[le++]=yt.z),s.tangent||s.bitangent){let Ke=bGe,we=0,We;if(M[f]&&(we=ve),!C&&f>=we&&f<we+A*2?We=h.UNIT_X:We=h.UNIT_Z,h.cross(We,yt,Ke),h.normalize(Ke,Ke),s.tangent&&(L[Ce++]=Ke.x,L[Ce++]=Ke.y,L[Ce++]=Ke.z),s.bitangent){let Ct=h.cross(yt,Ke,xGe);h.normalize(Ct,Ct),F[ye++]=Ct.x,F[ye++]=Ct.y,F[ye++]=Ct.z}}}s.st&&(ce.st=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:V})),s.normal&&(ce.normal=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:P})),s.tangent&&(ce.tangent=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:L})),s.bitangent&&(ce.bitangent=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:F}))}if(l(e._offsetAttribute)){let Ye=R.length,yt=e._offsetAttribute===mn.NONE?0:1,Ke=new Uint8Array(Ye/3).fill(yt);ce.applyOffset=new Me({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:Ke})}return new Tt({attributes:ce,indices:S,primitiveType:Re.TRIANGLES,boundingSphere:se.fromEllipsoid(Le),offsetAttribute:e._offsetAttribute})};var uX;N0.getUnitEllipsoid=function(){return l(uX)||(uX=N0.createGeometry(new N0({radii:new h(1,1,1),vertexFormat:Be.POSITION_ONLY}))),uX};var Ks=N0;var vGe=new h(1,1,1),CN=Math.cos,vN=Math.sin;function kC(e){e=e??H.EMPTY_OBJECT;let t=e.radii??vGe,n=e.innerRadii??t,i=e.minimumClock??0,r=e.maximumClock??I.TWO_PI,o=e.minimumCone??0,a=e.maximumCone??I.PI,s=Math.round(e.stackPartitions??10),c=Math.round(e.slicePartitions??8),u=Math.round(e.subdivisions??128);this._radii=h.clone(t),this._innerRadii=h.clone(n),this._minimumClock=i,this._maximumClock=r,this._minimumCone=o,this._maximumCone=a,this._stackPartitions=s,this._slicePartitions=c,this._subdivisions=u,this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}kC.packedLength=2*h.packedLength+8;kC.pack=function(e,t,n){return n=n??0,h.pack(e._radii,t,n),n+=h.packedLength,h.pack(e._innerRadii,t,n),n+=h.packedLength,t[n++]=e._minimumClock,t[n++]=e._maximumClock,t[n++]=e._minimumCone,t[n++]=e._maximumCone,t[n++]=e._stackPartitions,t[n++]=e._slicePartitions,t[n++]=e._subdivisions,t[n]=e._offsetAttribute??-1,t};var Bfe=new h,kfe=new h,F0={radii:Bfe,innerRadii:kfe,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};kC.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,Bfe);t+=h.packedLength;let r=h.unpack(e,t,kfe);t+=h.packedLength;let o=e[t++],a=e[t++],s=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t];return l(n)?(n._radii=h.clone(i,n._radii),n._innerRadii=h.clone(r,n._innerRadii),n._minimumClock=o,n._maximumClock=a,n._minimumCone=s,n._maximumCone=c,n._stackPartitions=u,n._slicePartitions=f,n._subdivisions=d,n._offsetAttribute=p===-1?void 0:p,n):(F0.minimumClock=o,F0.maximumClock=a,F0.minimumCone=s,F0.maximumCone=c,F0.stackPartitions=u,F0.slicePartitions=f,F0.subdivisions=d,F0.offsetAttribute=p===-1?void 0:p,new kC(F0))};kC.createGeometry=function(e){let t=e._radii;if(t.x<=0||t.y<=0||t.z<=0)return;let n=e._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let i=e._minimumClock,r=e._maximumClock,o=e._minimumCone,a=e._maximumCone,s=e._subdivisions,c=te.fromCartesian3(t),u=e._slicePartitions+1,f=e._stackPartitions+1;u=Math.round(u*Math.abs(r-i)/I.TWO_PI),f=Math.round(f*Math.abs(a-o)/I.PI),u<2&&(u=2),f<2&&(f=2);let d=0,p=1,g=n.x!==t.x||n.y!==t.y||n.z!==t.z,m=!1,y=!1;g&&(p=2,o>0&&(m=!0,d+=u),a<Math.PI&&(y=!0,d+=u));let A=s*p*(f+u),b=new Float64Array(A*3),x=2*(A+d-(u+f)*p),T=Ve.createTypedArray(A,x),C,E,w,D,R=0,M=new Array(f),N=new Array(f);for(C=0;C<f;C++)D=o+C*(a-o)/(f-1),M[C]=vN(D),N[C]=CN(D);let _=new Array(s),v=new Array(s);for(C=0;C<s;C++)w=i+C*(r-i)/(s-1),_[C]=vN(w),v[C]=CN(w);for(C=0;C<f;C++)for(E=0;E<s;E++)b[R++]=t.x*M[C]*v[E],b[R++]=t.y*M[C]*_[E],b[R++]=t.z*N[C];if(g)for(C=0;C<f;C++)for(E=0;E<s;E++)b[R++]=n.x*M[C]*v[E],b[R++]=n.y*M[C]*_[E],b[R++]=n.z*N[C];for(M.length=s,N.length=s,C=0;C<s;C++)D=o+C*(a-o)/(s-1),M[C]=vN(D),N[C]=CN(D);for(_.length=u,v.length=u,C=0;C<u;C++)w=i+C*(r-i)/(u-1),_[C]=vN(w),v[C]=CN(w);for(C=0;C<s;C++)for(E=0;E<u;E++)b[R++]=t.x*M[C]*v[E],b[R++]=t.y*M[C]*_[E],b[R++]=t.z*N[C];if(g)for(C=0;C<s;C++)for(E=0;E<u;E++)b[R++]=n.x*M[C]*v[E],b[R++]=n.y*M[C]*_[E],b[R++]=n.z*N[C];for(R=0,C=0;C<f*p;C++){let L=C*s;for(E=0;E<s-1;E++)T[R++]=L+E,T[R++]=L+E+1}let S=f*s*p;for(C=0;C<u;C++)for(E=0;E<s-1;E++)T[R++]=S+C+E*u,T[R++]=S+C+(E+1)*u;if(g)for(S=f*s*p+u*s,C=0;C<u;C++)for(E=0;E<s-1;E++)T[R++]=S+C+E*u,T[R++]=S+C+(E+1)*u;if(g){let L=f*s*p,F=L+s*u;if(m)for(C=0;C<u;C++)T[R++]=L+C,T[R++]=F+C;if(y)for(L+=s*u-u,F+=s*u-u,C=0;C<u;C++)T[R++]=L+C,T[R++]=F+C}let P=new xn({position:new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:b})});if(l(e._offsetAttribute)){let L=b.length,F=e._offsetAttribute===mn.NONE?0:1,V=new Uint8Array(L/3).fill(F);P.applyOffset=new Me({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:V})}return new Tt({attributes:P,indices:T,primitiveType:Re.LINES,boundingSphere:se.fromEllipsoid(c),offsetAttribute:e._offsetAttribute})};var Zf=kC;function zC(e){e=e??H.EMPTY_OBJECT,this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new $i({ellipsoid:e.ellipsoid??te.default})),this._levelZeroMaximumGeometricError=Vr.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,64,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new be}Object.defineProperties(zC.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(){}}});zC.prototype.requestTileGeometry=function(e,t,n,i){return Promise.resolve(new Lc({buffer:new Uint8Array(256),width:16,height:16}))};zC.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};zC.prototype.getTileDataAvailable=function(e,t,n){};zC.prototype.loadTileDataAvailability=function(e,t,n){};var B0=zC;function fX(){this._removalFunctions=[]}fX.prototype.add=function(e,t,n){let i=e.addEventListener(t,n);this._removalFunctions.push(i);let r=this;return function(){i();let o=r._removalFunctions;o.splice(o.indexOf(i),1)}};fX.prototype.removeAll=function(){let e=this._removalFunctions;for(let t=0,n=e.length;t<n;++t)e[t]();e.length=0};var Fo=fX;var zfe={NONE:0,HOLD:1,EXTRAPOLATE:2};Object.freeze(zfe);var Qf=zfe;function Wm(e){e=e??H.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 is,this._orthographicMatrix=new O}function Ufe(e){(e.top!==e._top||e.bottom!==e._bottom||e.left!==e._left||e.right!==e._right||e.near!==e._near||e.far!==e._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=O.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix))}Object.defineProperties(Wm.prototype,{projectionMatrix:{get:function(){return Ufe(this),this._orthographicMatrix}}});var EGe=new h,SGe=new h,wGe=new h,dX=new h;Wm.prototype.computeCullingVolume=function(e,t,n){let i=this._cullingVolume.planes,r=this.top,o=this.bottom,a=this.right,s=this.left,c=this.near,u=this.far,f=h.cross(t,n,EGe);h.normalize(f,f);let d=SGe;h.multiplyByScalar(t,c,d),h.add(e,d,d);let p=wGe;h.multiplyByScalar(f,s,p),h.add(d,p,p);let g=i[0];return l(g)||(g=i[0]=new ae),g.x=f.x,g.y=f.y,g.z=f.z,g.w=-h.dot(f,p),h.multiplyByScalar(f,a,p),h.add(d,p,p),g=i[1],l(g)||(g=i[1]=new ae),g.x=-f.x,g.y=-f.y,g.z=-f.z,g.w=-h.dot(h.negate(f,dX),p),h.multiplyByScalar(n,o,p),h.add(d,p,p),g=i[2],l(g)||(g=i[2]=new ae),g.x=n.x,g.y=n.y,g.z=n.z,g.w=-h.dot(n,p),h.multiplyByScalar(n,r,p),h.add(d,p,p),g=i[3],l(g)||(g=i[3]=new ae),g.x=-n.x,g.y=-n.y,g.z=-n.z,g.w=-h.dot(h.negate(n,dX),p),g=i[4],l(g)||(g=i[4]=new ae),g.x=t.x,g.y=t.y,g.z=t.z,g.w=-h.dot(t,d),h.multiplyByScalar(t,u,p),h.add(e,p,p),g=i[5],l(g)||(g=i[5]=new ae),g.x=-t.x,g.y=-t.y,g.z=-t.z,g.w=-h.dot(h.negate(t,dX),p),this._cullingVolume};Wm.prototype.getPixelDimensions=function(e,t,n,i,r){Ufe(this);let o=this.right-this.left,a=this.top-this.bottom,s=i*o/e,c=i*a/t;return r.x=s,r.y=c,r};Wm.prototype.clone=function(e){return l(e)||(e=new Wm),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};Wm.prototype.equals=function(e){return l(e)&&e instanceof Wm&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};Wm.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof Wm&&I.equalsEpsilon(this.right,e.right,t,n)&&I.equalsEpsilon(this.left,e.left,t,n)&&I.equalsEpsilon(this.top,e.top,t,n)&&I.equalsEpsilon(this.bottom,e.bottom,t,n)&&I.equalsEpsilon(this.near,e.near,t,n)&&I.equalsEpsilon(this.far,e.far,t,n)};var Aa=Wm;function iu(e){e=e??H.EMPTY_OBJECT,this._offCenterFrustum=new Aa,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}iu.packedLength=4;iu.pack=function(e,t,n){return n=n??0,t[n++]=e.width,t[n++]=e.aspectRatio,t[n++]=e.near,t[n]=e.far,t};iu.unpack=function(e,t,n){return t=t??0,l(n)||(n=new iu),n.width=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t],n};function R_(e){let t=e._offCenterFrustum;if(e.width!==e._width||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._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(iu.prototype,{projectionMatrix:{get:function(){return R_(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return R_(this),this._offCenterFrustum}}});iu.prototype.computeCullingVolume=function(e,t,n){return R_(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};iu.prototype.getPixelDimensions=function(e,t,n,i,r){return R_(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,r)};iu.prototype.clone=function(e){return l(e)||(e=new iu),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};iu.prototype.equals=function(e){return!l(e)||!(e instanceof iu)?!1:(R_(this),R_(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};iu.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof iu)?!1:(R_(this),R_(e),I.equalsEpsilon(this.width,e.width,t,n)&&I.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var pn=iu;function qm(e){e=e??H.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 is,this._perspectiveMatrix=new O,this._infinitePerspective=new O}function hX(e){let{top:t,bottom:n,right:i,left:r,near:o,far:a}=e;(t!==e._top||n!==e._bottom||r!==e._left||i!==e._right||o!==e._near||a!==e._far)&&(e._left=r,e._right=i,e._top=t,e._bottom=n,e._near=o,e._far=a,e._perspectiveMatrix=O.computePerspectiveOffCenter(r,i,n,t,o,a,e._perspectiveMatrix),e._infinitePerspective=O.computeInfinitePerspectiveOffCenter(r,i,n,t,o,e._infinitePerspective))}Object.defineProperties(qm.prototype,{projectionMatrix:{get:function(){return hX(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return hX(this),this._infinitePerspective}}});var IGe=new h,PGe=new h,DGe=new h,RGe=new h;qm.prototype.computeCullingVolume=function(e,t,n){let i=this._cullingVolume.planes,r=this.top,o=this.bottom,a=this.right,s=this.left,c=this.near,u=this.far,f=h.cross(t,n,IGe),d=PGe;h.multiplyByScalar(t,c,d),h.add(e,d,d);let p=DGe;h.multiplyByScalar(t,u,p),h.add(e,p,p);let g=RGe;h.multiplyByScalar(f,s,g),h.add(d,g,g),h.subtract(g,e,g),h.normalize(g,g),h.cross(g,n,g),h.normalize(g,g);let m=i[0];return l(m)||(m=i[0]=new ae),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-h.dot(g,e),h.multiplyByScalar(f,a,g),h.add(d,g,g),h.subtract(g,e,g),h.cross(n,g,g),h.normalize(g,g),m=i[1],l(m)||(m=i[1]=new ae),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-h.dot(g,e),h.multiplyByScalar(n,o,g),h.add(d,g,g),h.subtract(g,e,g),h.cross(f,g,g),h.normalize(g,g),m=i[2],l(m)||(m=i[2]=new ae),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-h.dot(g,e),h.multiplyByScalar(n,r,g),h.add(d,g,g),h.subtract(g,e,g),h.cross(g,f,g),h.normalize(g,g),m=i[3],l(m)||(m=i[3]=new ae),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-h.dot(g,e),m=i[4],l(m)||(m=i[4]=new ae),m.x=t.x,m.y=t.y,m.z=t.z,m.w=-h.dot(t,d),h.negate(t,g),m=i[5],l(m)||(m=i[5]=new ae),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-h.dot(g,p),this._cullingVolume};qm.prototype.getPixelDimensions=function(e,t,n,i,r){hX(this);let o=1/this.near,a=this.top*o,s=2*i*n*a/t;a=this.right*o;let c=2*i*n*a/e;return r.x=c,r.y=s,r};qm.prototype.clone=function(e){return l(e)||(e=new qm),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};qm.prototype.equals=function(e){return l(e)&&e instanceof qm&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};qm.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof qm&&I.equalsEpsilon(this.right,e.right,t,n)&&I.equalsEpsilon(this.left,e.left,t,n)&&I.equalsEpsilon(this.top,e.top,t,n)&&I.equalsEpsilon(this.bottom,e.bottom,t,n)&&I.equalsEpsilon(this.near,e.near,t,n)&&I.equalsEpsilon(this.far,e.far,t,n)};var ru=qm;function ou(e){e=e??H.EMPTY_OBJECT,this._offCenterFrustum=new ru,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}ou.packedLength=6;ou.pack=function(e,t,n){return 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};ou.unpack=function(e,t,n){return t=t??0,l(n)||(n=new ou),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 mh(e){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;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(ou.prototype,{projectionMatrix:{get:function(){return mh(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return mh(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return mh(this),this._fovy}},sseDenominator:{get:function(){return mh(this),this._sseDenominator}},offCenterFrustum:{get:function(){return mh(this),this._offCenterFrustum}}});ou.prototype.computeCullingVolume=function(e,t,n){return mh(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};ou.prototype.getPixelDimensions=function(e,t,n,i,r){return mh(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,r)};ou.prototype.clone=function(e){return l(e)||(e=new ou),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};ou.prototype.equals=function(e){return!l(e)||!(e instanceof ou)?!1:(mh(this),mh(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};ou.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof ou)?!1:(mh(this),mh(e),I.equalsEpsilon(this.fov,e.fov,t,n)&&I.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var Yi=ou;var EN=0,OGe=1;function _b(e){let t=e.frustum,n=e.orientation,i=e.origin,r=e.vertexFormat??Be.DEFAULT,o=e._drawNearPlane??!0,a,s;t instanceof Yi?(a=EN,s=Yi.packedLength):t instanceof pn&&(a=OGe,s=pn.packedLength),this._frustumType=a,this._frustum=t.clone(),this._origin=h.clone(i),this._orientation=Fe.clone(n),this._drawNearPlane=o,this._vertexFormat=r,this._workerName="createFrustumGeometry",this.packedLength=2+s+h.packedLength+Fe.packedLength+Be.packedLength}_b.pack=function(e,t,n){n=n??0;let i=e._frustumType,r=e._frustum;return t[n++]=i,i===EN?(Yi.pack(r,t,n),n+=Yi.packedLength):(pn.pack(r,t,n),n+=pn.packedLength),h.pack(e._origin,t,n),n+=h.packedLength,Fe.pack(e._orientation,t,n),n+=Fe.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n]=e._drawNearPlane?1:0,t};var MGe=new Yi,LGe=new pn,NGe=new Fe,FGe=new h,BGe=new Be;_b.unpack=function(e,t,n){t=t??0;let i=e[t++],r;i===EN?(r=Yi.unpack(e,t,MGe),t+=Yi.packedLength):(r=pn.unpack(e,t,LGe),t+=pn.packedLength);let o=h.unpack(e,t,FGe);t+=h.packedLength;let a=Fe.unpack(e,t,NGe);t+=Fe.packedLength;let s=Be.unpack(e,t,BGe);t+=Be.packedLength;let c=e[t]===1;if(!l(n))return new _b({frustum:r,origin:o,orientation:a,vertexFormat:s,_drawNearPlane:c});let u=i===n._frustumType?n._frustum:void 0;return n._frustum=r.clone(u),n._frustumType=i,n._origin=h.clone(o,n._origin),n._orientation=Fe.clone(a,n._orientation),n._vertexFormat=Be.clone(s,n._vertexFormat),n._drawNearPlane=c,n};function UC(e,t,n,i,r,o,a,s){let c=e/3*2;for(let u=0;u<4;++u)l(t)&&(t[e]=o.x,t[e+1]=o.y,t[e+2]=o.z),l(n)&&(n[e]=a.x,n[e+1]=a.y,n[e+2]=a.z),l(i)&&(i[e]=s.x,i[e+1]=s.y,i[e+2]=s.z),e+=3;r[c]=0,r[c+1]=0,r[c+2]=1,r[c+3]=0,r[c+4]=1,r[c+5]=1,r[c+6]=0,r[c+7]=1}var kGe=new $,zGe=new O,mX=new O,Vfe=new h,jfe=new h,Hfe=new h,UGe=new h,VGe=new h,jGe=new h,O_=new Array(3),nP=new Array(4);nP[0]=new ae(-1,-1,1,1);nP[1]=new ae(1,-1,1,1);nP[2]=new ae(1,1,1,1);nP[3]=new ae(-1,1,1,1);var Gfe=new Array(4);for(let e=0;e<4;++e)Gfe[e]=new ae;_b._computeNearFarPlanes=function(e,t,n,i,r,o,a,s){let c=$.fromQuaternion(t,kGe),u=o??Vfe,f=a??jfe,d=s??Hfe;u=$.getColumn(c,0,u),f=$.getColumn(c,1,f),d=$.getColumn(c,2,d),h.normalize(u,u),h.normalize(f,f),h.normalize(d,d),h.negate(u,u);let p=O.computeView(e,d,f,u,zGe),g,m,y=i.projectionMatrix;if(n===EN){let A=O.multiply(y,p,mX);m=O.inverse(A,mX)}else g=O.inverseTransformation(p,mX);l(m)?(O_[0]=i.near,O_[1]=i.far):(O_[0]=0,O_[1]=i.near,O_[2]=i.far);for(let A=0;A<2;++A)for(let b=0;b<4;++b){let x=ae.clone(nP[b],Gfe[b]);if(l(m)){x=O.multiplyByVector(m,x,x);let T=1/x.w;h.multiplyByScalar(x,T,x),h.subtract(x,e,x),h.normalize(x,x);let C=h.dot(d,x);h.multiplyByScalar(x,O_[A]/C,x),h.add(x,e,x)}else{let T=i.offCenterFrustum;l(T)&&(i=T);let C=O_[A],E=O_[A+1];x.x=(x.x*(i.right-i.left)+i.left+i.right)*.5,x.y=(x.y*(i.top-i.bottom)+i.bottom+i.top)*.5,x.z=(x.z*(C-E)-C-E)*.5,x.w=1,O.multiplyByVector(g,x,x)}r[12*A+b*3]=x.x,r[12*A+b*3+1]=x.y,r[12*A+b*3+2]=x.z}};_b.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,r=e._orientation,o=e._drawNearPlane,a=e._vertexFormat,s=o?6:5,c=new Float64Array(72);_b._computeNearFarPlanes(i,r,t,n,c);let u=24;c[u]=c[12],c[u+1]=c[13],c[u+2]=c[14],c[u+3]=c[0],c[u+4]=c[1],c[u+5]=c[2],c[u+6]=c[9],c[u+7]=c[10],c[u+8]=c[11],c[u+9]=c[21],c[u+10]=c[22],c[u+11]=c[23],u+=12,c[u]=c[15],c[u+1]=c[16],c[u+2]=c[17],c[u+3]=c[3],c[u+4]=c[4],c[u+5]=c[5],c[u+6]=c[0],c[u+7]=c[1],c[u+8]=c[2],c[u+9]=c[12],c[u+10]=c[13],c[u+11]=c[14],u+=12,c[u]=c[3],c[u+1]=c[4],c[u+2]=c[5],c[u+3]=c[15],c[u+4]=c[16],c[u+5]=c[17],c[u+6]=c[18],c[u+7]=c[19],c[u+8]=c[20],c[u+9]=c[6],c[u+10]=c[7],c[u+11]=c[8],u+=12,c[u]=c[6],c[u+1]=c[7],c[u+2]=c[8],c[u+3]=c[18],c[u+4]=c[19],c[u+5]=c[20],c[u+6]=c[21],c[u+7]=c[22],c[u+8]=c[23],c[u+9]=c[9],c[u+10]=c[10],c[u+11]=c[11],o||(c=c.subarray(12));let f=new xn({position:new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:c})});if(l(a.normal)||l(a.tangent)||l(a.bitangent)||l(a.st)){let p=l(a.normal)?new Float32Array(12*s):void 0,g=l(a.tangent)?new Float32Array(12*s):void 0,m=l(a.bitangent)?new Float32Array(12*s):void 0,y=l(a.st)?new Float32Array(8*s):void 0,A=Vfe,b=jfe,x=Hfe,T=h.negate(A,UGe),C=h.negate(b,VGe),E=h.negate(x,jGe);u=0,o&&(UC(u,p,g,m,y,E,A,b),u+=12),UC(u,p,g,m,y,x,T,b),u+=12,UC(u,p,g,m,y,T,E,b),u+=12,UC(u,p,g,m,y,C,E,T),u+=12,UC(u,p,g,m,y,A,x,b),u+=12,UC(u,p,g,m,y,b,x,T),l(p)&&(f.normal=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:p})),l(g)&&(f.tangent=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:g})),l(m)&&(f.bitangent=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:m})),l(y)&&(f.st=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:y}))}let d=new Uint16Array(6*s);for(let p=0;p<s;++p){let g=p*6,m=p*4;d[g]=m,d[g+1]=m+1,d[g+2]=m+2,d[g+3]=m,d[g+4]=m+2,d[g+5]=m+3}return new Tt({attributes:f,indices:d,primitiveType:Re.TRIANGLES,boundingSphere:se.fromVertices(c)})};var VC=_b;var pX=0,HGe=1;function iP(e){let t=e.frustum,n=e.orientation,i=e.origin,r=e._drawNearPlane??!0,o,a;t instanceof Yi?(o=pX,a=Yi.packedLength):t instanceof pn&&(o=HGe,a=pn.packedLength),this._frustumType=o,this._frustum=t.clone(),this._origin=h.clone(i),this._orientation=Fe.clone(n),this._drawNearPlane=r,this._workerName="createFrustumOutlineGeometry",this.packedLength=2+a+h.packedLength+Fe.packedLength}iP.pack=function(e,t,n){n=n??0;let i=e._frustumType,r=e._frustum;return t[n++]=i,i===pX?(Yi.pack(r,t,n),n+=Yi.packedLength):(pn.pack(r,t,n),n+=pn.packedLength),h.pack(e._origin,t,n),n+=h.packedLength,Fe.pack(e._orientation,t,n),n+=Fe.packedLength,t[n]=e._drawNearPlane?1:0,t};var GGe=new Yi,WGe=new pn,qGe=new Fe,YGe=new h;iP.unpack=function(e,t,n){t=t??0;let i=e[t++],r;i===pX?(r=Yi.unpack(e,t,GGe),t+=Yi.packedLength):(r=pn.unpack(e,t,WGe),t+=pn.packedLength);let o=h.unpack(e,t,YGe);t+=h.packedLength;let a=Fe.unpack(e,t,qGe);t+=Fe.packedLength;let s=e[t]===1;if(!l(n))return new iP({frustum:r,origin:o,orientation:a,_drawNearPlane:s});let c=i===n._frustumType?n._frustum:void 0;return n._frustum=r.clone(c),n._frustumType=i,n._origin=h.clone(o,n._origin),n._orientation=Fe.clone(a,n._orientation),n._drawNearPlane=s,n};iP.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,r=e._orientation,o=e._drawNearPlane,a=new Float64Array(24);VC._computeNearFarPlanes(i,r,t,n,a);let s=new xn({position:new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:a})}),c,u,f=o?2:1,d=new Uint16Array(8*(f+1)),p=o?0:1;for(;p<2;++p)c=o?p*8:0,u=p*4,d[c]=u,d[c+1]=u+1,d[c+2]=u+1,d[c+3]=u+2,d[c+4]=u+2,d[c+5]=u+3,d[c+6]=u+3,d[c+7]=u;for(p=0;p<2;++p)c=(f+p)*8,u=p*4,d[c]=u,d[c+1]=u+4,d[c+2]=u+1,d[c+3]=u+5,d[c+4]=u+2,d[c+5]=u+6,d[c+6]=u+3,d[c+7]=u+7;return new Tt({attributes:s,indices:d,primitiveType:Re.LINES,boundingSphere:se.fromVertices(a)})};var SN=iP;var Wfe={SEARCH:0,AUTOCOMPLETE:1};Object.freeze(Wfe);var yb=Wfe;function wN(){pe.throwInstantiationError()}Object.defineProperties(wN.prototype,{credit:{get:pe.throwInstantiationError}});wN.getCreditsFromResult=function(e){if(l(e.attributions))return e.attributions.map(wt.getIonCredit)};wN.prototype.geocode=pe.throwInstantiationError;var rP=wN;function qfe(){pe.throwInstantiationError()}qfe.createGeometry=function(e){pe.throwInstantiationError()};var Yfe=qfe;function XGe(e){e=e??H.EMPTY_OBJECT,this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=e.normalize??!1,this.value=e.value}var yl=XGe;var e5e=La(gX(),1);function KGe(e,t){return(e&t)!==0}var Al=KGe;var $Ge=[1,2,4,8],Xfe=15,JGe=16,ZGe=64,QGe=128;function Ym(e,t,n,i,r,o){this._bits=e,this.cnodeVersion=t,this.imageryVersion=n,this.terrainVersion=i,this.imageryProvider=r,this.terrainProvider=o,this.ancestorHasTerrain=!1,this.terrainState=void 0}Ym.clone=function(e,t){return l(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 Ym(e._bits,e.cnodeVersion,e.imageryVersion,e.terrainVersion,e.imageryProvider,e.terrainProvider),t.ancestorHasTerrain=e.ancestorHasTerrain,t.terrainState=e.terrainState,t};Ym.prototype.setParent=function(e){this.ancestorHasTerrain=e.ancestorHasTerrain||this.hasTerrain()};Ym.prototype.hasSubtree=function(){return Al(this._bits,JGe)};Ym.prototype.hasImagery=function(){return Al(this._bits,ZGe)};Ym.prototype.hasTerrain=function(){return Al(this._bits,QGe)};Ym.prototype.hasChildren=function(){return Al(this._bits,Xfe)};Ym.prototype.hasChild=function(e){return Al(this._bits,$Ge[e])};Ym.prototype.getChildBitmask=function(){return this._bits&Xfe};var IN=Ym;function t5e(e){let t=e.length,n=new ArrayBuffer(t),i=new Uint8Array(n);for(let r=0;r<t;++r)i[r]=e.charCodeAt(r);return n}var n5e=t5e(`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 Zu(e){this.imageryPresent=!0,this.protoImagery=void 0,this.terrainPresent=!0,this.negativeAltitudeExponentBias=32,this.negativeAltitudeThreshold=I.EPSILON12,this.providers={},this.key=void 0,this._resource=void 0,this._quadPacketVersion=1,this._tileInfo={},this._subtreePromises={}}Object.defineProperties(Zu.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},resource:{get:function(){return this._resource}}});Zu.fromUrl=async function(e){let t=e;typeof t!="string"&&!(t instanceof De)&&(t=e.url);let n=De.createIfNeeded(t);n.appendForwardSlash();let i=new Zu;i._resource=n;try{await i5e(i),await i.getQuadTreePacket("",i._quadPacketVersion)}catch(r){let o=`An error occurred while accessing ${$fe(i,"",1).url}: ${r}`;throw new oe(o)}return i};Zu.tileXYToQuadKey=function(e,t,n){let i="";for(let r=n;r>=0;--r){let o=1<<r,a=0;Al(t,o)?Al(e,o)&&(a|=1):(a|=2,Al(e,o)||(a|=1)),i+=a}return i};Zu.quadKeyToTileXY=function(e){let t=0,n=0,i=e.length-1;for(let r=i;r>=0;--r){let o=1<<r,a=+e[i-r];Al(a,2)?Al(a,1)||(t|=o):(n|=o,Al(a,1)&&(t|=o))}return{x:t,y:n,level:i}};Zu.prototype.isValid=function(e){let t=this.getTileInformationFromQuadKey(e);if(l(t))return t!==null;let n=!0,i=e,r;for(;i.length>1;)if(r=i.substring(i.length-1),i=i.substring(0,i.length-1),t=this.getTileInformationFromQuadKey(i),l(t)){!t.hasSubtree()&&!t.hasChild(parseInt(r))&&(n=!1);break}else if(t===null){n=!1;break}return n};var Kfe=new Yn("decodeGoogleEarthEnterprisePacket");Zu.prototype.getQuadTreePacket=function(e,t,n){t=t??1,e=e??"";let r=$fe(this,e,t,n).fetchArrayBuffer();if(!l(r))return;let o=this._tileInfo,a=this.key;return r.then(function(s){return Kfe.scheduleTask({buffer:s,quadKey:e,type:"Metadata",key:a},[s]).then(function(u){let f,d=-1;if(e!==""){d=e.length+1;let m=u[e];f=o[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 b=IN.clone(u[y]),x=y.length;if(x===d)b.setParent(f);else if(x>1){let T=o[y.substring(0,y.length-1)];b.setParent(T)}o[y]=b}else o[y]=null}})})};Zu.prototype.populateSubtree=function(e,t,n,i){let r=Zu.tileXYToQuadKey(e,t,n);return AX(this,r,i)};function AX(e,t,n){let i=e._tileInfo,r=t,o=i[r];if(l(o)&&(!o.hasSubtree()||o.hasChildren()))return o;for(;o===void 0&&r.length>1;)r=r.substring(0,r.length-1),o=i[r];let a,s=e._subtreePromises,c=s[r];if(l(c))return c.then(function(){return a=new Eo({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),AX(e,t,a)});if(!l(o)||!o.hasSubtree())return Promise.reject(new oe(`Couldn't load metadata for tile ${t}`));if(c=e.getQuadTreePacket(r,o.cnodeVersion,n),!!l(c))return s[r]=c,c.then(function(){return a=new Eo({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),AX(e,t,a)}).finally(function(){delete s[r]})}Zu.prototype.getTileInformation=function(e,t,n){let i=Zu.tileXYToQuadKey(e,t,n);return this._tileInfo[i]};Zu.prototype.getTileInformationFromQuadKey=function(e){return this._tileInfo[e]};function $fe(e,t,n,i){return e._resource.getDerivedResource({url:`flatfile?q2-0${t}-q.${n.toString()}`,request:i})}var _X,yX;function i5e(e){let t=e._resource.getDerivedResource({url:"dbRoot.v5",queryParameters:{output:"proto"}});if(!l(yX)){let n=$t("ThirdParty/google-earth-dbroot-parser.js"),i=window.cesiumGoogleEarthDbRootParser;yX=LT(n).then(function(){_X=window.cesiumGoogleEarthDbRootParser(e5e),l(i)?window.cesiumGoogleEarthDbRootParser=i:delete window.cesiumGoogleEarthDbRootParser})}return yX.then(function(){return t.fetchArrayBuffer()}).then(function(n){let i=_X.EncryptedDbRootProto.decode(new Uint8Array(n)),r=i.encryptionData,o=r.byteOffset,a=o+r.byteLength,s=e.key=r.buffer.slice(o,a);r=i.dbrootData,o=r.byteOffset,a=o+r.byteLength;let c=r.buffer.slice(o,a);return Kfe.scheduleTask({buffer:c,type:"DbRoot",key:s},[c])}).then(function(n){let i=_X.DbRootProto.decode(new Uint8Array(n.buffer));if(e.imageryPresent=i.imageryPresent??e.imageryPresent,e.protoImagery=i.protoImagery,e.terrainPresent=i.terrainPresent??e.terrainPresent,l(i.endSnippet)&&l(i.endSnippet.model)){let s=i.endSnippet.model;e.negativeAltitudeExponentBias=s.negativeAltitudeExponentBias??e.negativeAltitudeExponentBias,e.negativeAltitudeThreshold=s.compressedNegativeAltitudeThreshold??e.negativeAltitudeThreshold}l(i.databaseVersion)&&(e._quadPacketVersion=i.databaseVersion.quadtreeVersion??e._quadPacketVersion);let r=e.providers,o=i.providerInfo??[],a=o.length;for(let s=0;s<a;++s){let c=o[s],u=c.copyrightString;l(u)&&(r[c.providerId]=new wt(u.value))}}).catch(function(){console.log(`Failed to retrieve ${t.url}. Using defaults.`),e.key=n5e})}var M_=Zu;function Ab(e){e=e??H.EMPTY_OBJECT,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(Ab.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var Qfe="createVerticesFromGoogleEarthEnterpriseBuffer",r5e=new Yn(Qfe),o5e=new Yn(Qfe,Hu.maximumAsynchronousTasks),Jfe=new ie,PN=new ie;Ab.prototype.createMesh=function(e){e=e??H.EMPTY_OBJECT;let t=e.tilingScheme,n=e.x,i=e.y,r=e.level,o=e.exaggeration??1,a=e.exaggerationRelativeHeight??0,s=e.throttle??!0,c=t.ellipsoid;t.tileXYToNativeRectangle(n,i,r,Jfe),t.tileXYToRectangle(n,i,r,PN);let u=c.cartographicToCartesian(ie.center(PN)),d=40075.16/(1<<r);this._skirtHeight=Math.min(d*8,1e3);let g=(s?o5e:r5e).scheduleTask({buffer:this._buffer,nativeRectangle:Jfe,rectangle:PN,relativeToCenter:u,ellipsoid:c,skirtHeight:this._skirtHeight,exaggeration:o,exaggerationRelativeHeight:a,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(!l(g))return;let m=this;return g.then(function(y){return m._mesh=new mc(u,new Float32Array(y.vertices),new Uint16Array(y.indices),y.indexCountWithoutSkirts,y.vertexCountWithoutSkirts,y.minimumHeight,y.maximumHeight,PN,se.clone(y.boundingSphere3D),h.clone(y.occludeePointInScaledSpace),y.numberOfAttributes,Jt.clone(y.orientedBoundingBox),po.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})};Ab.prototype.interpolateHeight=function(e,t,n){let i=I.clamp((t-e.west)/e.width,0,1),r=I.clamp((n-e.south)/e.height,0,1);return l(this._mesh)?u5e(this,i,r):h5e(this,i,r,e)};var a5e=new Yn("upsampleQuantizedTerrainMesh",Hu.maximumAsynchronousTasks);Ab.prototype.upsample=function(e,t,n,i,r,o,a){let s=this._mesh;if(!l(this._mesh))return;let c=t*2!==r,u=n*2===o,f=e.ellipsoid,d=e.tileXYToRectangle(r,o,a),p=a5e.scheduleTask({vertices:s.vertices,indices:s.indices,indexCountWithoutSkirts:s.indexCountWithoutSkirts,vertexCountWithoutSkirts:s.vertexCountWithoutSkirts,encoding:s.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:c,isNorthChild:u,childRectangle:d,ellipsoid:f});if(!l(p))return;let g=this;return p.then(function(m){let y=new Uint16Array(m.vertices),A=Ve.createTypedArray(y.length/3,m.indices),b=g._skirtHeight;return new hC({quantizedVertices:y,indices:A,minimumHeight:m.minimumHeight,maximumHeight:m.maximumHeight,boundingSphere:se.clone(m.boundingSphere),orientedBoundingBox:Jt.clone(m.orientedBoundingBox),horizonOcclusionPoint:h.clone(m.horizonOcclusionPoint),westIndices:m.westIndices,southIndices:m.southIndices,eastIndices:m.eastIndices,northIndices:m.northIndices,westSkirtHeight:b,southSkirtHeight:b,eastSkirtHeight:b,northSkirtHeight:b,childTileMask:0,createdByUpsampling:!0,credits:g._credits})})};Ab.prototype.isChildAvailable=function(e,t,n,i){let r=2;return n!==e*2&&++r,i!==t*2&&(r-=2),(this._childTileMask&1<<r)!==0};Ab.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var s5e=new k,c5e=new k,l5e=new k,ede=new h;function u5e(e,t,n){let i=e._mesh,r=i.vertices,o=i.encoding,a=i.indices;for(let s=0,c=a.length;s<c;s+=3){let u=a[s],f=a[s+1],d=a[s+2],p=o.decodeTextureCoordinates(r,u,s5e),g=o.decodeTextureCoordinates(r,f,c5e),m=o.decodeTextureCoordinates(r,d,l5e),y=Rm.computeBarycentricCoordinates(t,n,p.x,p.y,g.x,g.y,m.x,m.y,ede);if(y.x>=-1e-15&&y.y>=-1e-15&&y.z>=-1e-15){let A=o.decodeHeight(r,u),b=o.decodeHeight(r,f),x=o.decodeHeight(r,d);return y.x*A+y.y*b+y.z*x}}}var f5e=Uint16Array.BYTES_PER_ELEMENT,Zfe=Uint32Array.BYTES_PER_ELEMENT,bX=Int32Array.BYTES_PER_ELEMENT,d5e=Float32Array.BYTES_PER_ELEMENT,xX=Float64Array.BYTES_PER_ELEMENT;function h5e(e,t,n,i){let r=e._buffer,o=0,a=0,s=0;n>.5?(t>.5?(o=2,a=.5):o=3,s=.5):t>.5&&(o=1,a=.5);let c=new DataView(r),u=0;for(let E=0;E<o;++E)u+=c.getUint32(u,!0),u+=Zfe;u+=Zfe,u+=2*xX;let f=I.toRadians(c.getFloat64(u,!0)*180);u+=xX;let d=I.toRadians(c.getFloat64(u,!0)*180);u+=xX;let p=i.width/f/2,g=i.height/d/2,m=c.getInt32(u,!0);u+=bX;let y=c.getInt32(u,!0)*3;u+=bX,u+=bX;let A=new Array(m),b=new Array(m),x=new Array(m),T;for(T=0;T<m;++T)A[T]=a+c.getUint8(u++)*p,b[T]=s+c.getUint8(u++)*g,x[T]=c.getFloat32(u,!0)*6371010,u+=d5e;let C=new Array(y);for(T=0;T<y;++T)C[T]=c.getUint16(u,!0),u+=f5e;for(T=0;T<y;T+=3){let E=C[T],w=C[T+1],D=C[T+2],R=A[E],M=A[w],N=A[D],_=b[E],v=b[w],S=b[D],P=Rm.computeBarycentricCoordinates(t,n,R,_,M,v,N,S,ede);if(P.x>=-1e-15&&P.y>=-1e-15&&P.z>=-1e-15)return P.x*x[E]+P.y*x[w]+P.z*x[D]}}var aP=Ab;var ed={UNKNOWN:0,NONE:1,SELF:2,PARENT:3},DN=new K;function RN(){this._terrainCache={},this._lastTidy=K.now()}RN.prototype.add=function(e,t){this._terrainCache[e]={buffer:t,timestamp:K.now()}};RN.prototype.get=function(e){let n=this._terrainCache[e];if(l(n))return delete this._terrainCache[e],n.buffer};RN.prototype.tidy=function(){if(K.now(DN),K.secondsDifference(DN,this._lastTidy)>10){let e=this._terrainCache,t=Object.keys(e),n=t.length;for(let i=0;i<n;++i){let r=t[i],o=e[r];K.secondsDifference(DN,o.timestamp)>10&&delete e[r]}K.clone(DN,this._lastTidy)}};function L_(e){e=e??H.EMPTY_OBJECT,this._tilingScheme=new $i({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ie(-I.PI,-I.PI,I.PI,I.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new wt(t)),this._credit=t,this._levelZeroMaximumGeometricError=40075.16,this._terrainCache=new RN,this._terrainPromises={},this._terrainRequests={},this._errorEvent=new be}Object.defineProperties(L_.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(){}}});L_.fromMetadata=function(e,t){if(!e.terrainPresent)throw new oe(`The server ${e.url} doesn't have terrain`);let n=new L_(t);return n._metadata=e,n};var m5e=new Yn("decodeGoogleEarthEnterprisePacket");function tde(e,t,n){let i=t.getChildBitmask();if(t.terrainState===ed.PARENT){i=0;for(let r=0;r<4;++r){let o=n.getTileInformationFromQuadKey(e+r.toString());l(o)&&o.hasTerrain()&&(i|=1<<r)}}return i}L_.prototype.requestTileGeometry=function(e,t,n,i){let r=M_.tileXYToQuadKey(e,t,n),o=this._terrainCache,a=this._metadata,s=a.getTileInformationFromQuadKey(r);if(!l(s))return Promise.reject(new oe("Terrain tile doesn't exist"));let c=s.terrainState;l(c)||(c=s.terrainState=ed.UNKNOWN);let u=o.get(r);if(l(u)){let b=a.providers[s.terrainProvider];return Promise.resolve(new aP({buffer:u,childTileMask:tde(r,s,a),credits:l(b)?[b]:void 0,negativeAltitudeExponentBias:a.negativeAltitudeExponentBias,negativeElevationThreshold:a.negativeAltitudeThreshold}))}if(o.tidy(),s.ancestorHasTerrain){if(c===ed.NONE)return Promise.reject(new oe("Terrain tile doesn't exist"))}else return Promise.resolve(new Lc({buffer:new Uint8Array(256),width:16,height:16}));let f,d=r,p=-1;switch(c){case ed.SELF:p=s.terrainVersion;break;case ed.PARENT:d=d.substring(0,d.length-1),f=a.getTileInformationFromQuadKey(d),p=f.terrainVersion;break;case ed.UNKNOWN:s.hasTerrain()?p=s.terrainVersion:(d=d.substring(0,d.length-1),f=a.getTileInformationFromQuadKey(d),l(f)&&f.hasTerrain()&&(p=f.terrainVersion));break}if(p<0)return Promise.reject(new oe("Terrain tile doesn't exist"));let g=this._terrainPromises,m=this._terrainRequests,y,A;if(l(g[d]))y=g[d],A=m[d];else{A=i;let b=p5e(this,d,p,A).fetchArrayBuffer();if(!l(b))return;y=b.then(function(x){return l(x)?m5e.scheduleTask({buffer:x,type:"Terrain",key:a.key},[x]).then(function(T){let C=a.getTileInformationFromQuadKey(d);C.terrainState=ed.SELF,o.add(d,T[0]);let E=C.terrainProvider,w=T.length-1;for(let D=0;D<w;++D){let R=d+D.toString(),M=a.getTileInformationFromQuadKey(R);l(M)&&(o.add(R,T[D+1]),M.terrainState=ed.PARENT,M.terrainProvider===0&&(M.terrainProvider=E))}}):Promise.reject(new oe("Failed to load terrain."))}),g[d]=y,m[d]=A,y=y.finally(function(){delete g[d],delete m[d]})}return y.then(function(){let b=o.get(r);if(l(b)){let x=a.providers[s.terrainProvider];return new aP({buffer:b,childTileMask:tde(r,s,a),credits:l(x)?[x]:void 0,negativeAltitudeExponentBias:a.negativeAltitudeExponentBias,negativeElevationThreshold:a.negativeAltitudeThreshold})}return Promise.reject(new oe("Failed to load terrain."))}).catch(function(b){return A.state===Ti.CANCELLED?(i.state=A.state,Promise.reject(b)):(s.terrainState=ed.NONE,Promise.reject(b))})};L_.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};L_.prototype.getTileDataAvailable=function(e,t,n){let i=this._metadata,r=M_.tileXYToQuadKey(e,t,n),o=i.getTileInformation(e,t,n);if(o===null)return!1;if(l(o)){if(!o.ancestorHasTerrain)return!0;let a=o.terrainState;if(a===ed.NONE)return!1;if((!l(a)||a===ed.UNKNOWN)&&(o.terrainState=ed.UNKNOWN,!o.hasTerrain())){r=r.substring(0,r.length-1);let s=i.getTileInformationFromQuadKey(r);if(!l(s)||!s.hasTerrain())return!1}return!0}if(i.isValid(r)){let a=new Eo({throttle:!1,throttleByServer:!0,type:Za.TERRAIN});i.populateSubtree(e,t,n,a)}return!1};L_.prototype.loadTileDataAvailability=function(e,t,n){};function p5e(e,t,n,i){return n=l(n)&&n>0?n:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1c-0${t}-t.${n.toString()}`,request:i})}var nde=L_;var g5e="https://maps.googleapis.com/maps/api/geocode/json",ide='<img alt="Google" src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align:-5px">';function TX(e){e=e??H.EMPTY_OBJECT;let t=e.key;this._resource=new De({url:g5e,queryParameters:{key:t}}),this._credit=new wt(ide,!0)}Object.defineProperties(TX.prototype,{credit:{get:function(){return this._credit}}});TX.prototype.geocode=async function(e){let n=await this._resource.getDerivedResource({queryParameters:{address:e}}).fetchJson();if(n.status==="ZERO_RESULTS")return[];if(n.status!=="OK")throw new oe(`GoogleGeocoderService got a bad response ${n.status}: ${n.error_message}`);return n.results.map(r=>{let o=r.geometry.viewport.southwest,a=r.geometry.viewport.northeast;return{displayName:r.formatted_address,destination:ie.fromDegrees(o.lng,o.lat,a.lng,a.lat),attribution:{html:ide,collapsible:!1}}})};var rde=TX;var jC={};jC.defaultApiKey=void 0;jC.mapTilesApiEndpoint=new De({url:"https://tile.googleapis.com/"});jC.defaultStreetViewStaticApiKey=void 0;jC.streetViewStaticApiEndpoint=new De({url:"https://maps.googleapis.com/maps/api/streetview"});jC.getDefaultCredit=function(){return new wt('<img alt="Google" src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align:-6px">',!0)};var xs=jC;var DX=[ki,_i],_5e=DX.length,vde=Math.cos(I.toRadians(30)),ode=Math.cos(I.toRadians(150)),Ede=0,Sde=1e3;function F_(e){e=e??H.EMPTY_OBJECT;let t=e.positions;this.width=e.width??1,this._positions=t,this.granularity=e.granularity??9999,this.loop=e.loop??!1,this.arcType=e.arcType??sn.GEODESIC,this._ellipsoid=te.default,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(F_.prototype,{packedLength:{get:function(){return 1+this._positions.length*3+1+1+1+te.packedLength+1+1}}});F_.setProjectionAndEllipsoid=function(e,t){let n=0;for(let i=0;i<_5e;i++)if(t instanceof DX[i]){n=i;break}e._projectionIndex=n,e._ellipsoid=t.ellipsoid};var y5e=new h,ade=new h,sde=new h;function PX(e,t,n,i,r){let o=bl(i,e,0,y5e),a=bl(i,e,n,ade),s=bl(i,t,0,sde),c=k0(a,o,ade),u=k0(s,o,sde);return h.cross(u,c,r),h.normalize(r,r)}var A5e=new de,b5e=new h,x5e=new h,T5e=new h;function CX(e,t,n,i,r,o,a,s,c,u,f){if(r===0)return;let d;o===sn.GEODESIC?d=new E_(e,t,a):o===sn.RHUMB&&(d=new Uc(e,t,a));let p=d.surfaceDistance;if(p<r)return;let g=PX(e,t,i,a,T5e),m=Math.ceil(p/r),y=p/m,A=y,b=m-1,x=s.length;for(let T=0;T<b;T++){let C=d.interpolateUsingSurfaceDistance(A,A5e),E=bl(a,C,n,b5e),w=bl(a,C,i,x5e);h.pack(g,s,x),h.pack(E,c,x),h.pack(w,u,x),f.push(C.latitude),f.push(C.longitude),x+=3,A+=y}}var vX=new de;function bl(e,t,n,i){return de.clone(t,vX),vX.height=n,de.toCartesian(vX,e,i)}F_.pack=function(e,t,n){let i=n??0,r=e._positions,o=r.length;t[i++]=o;for(let a=0;a<o;++a){let s=r[a];h.pack(s,t,i),i+=3}return t[i++]=e.granularity,t[i++]=e.loop?1:0,t[i++]=e.arcType,te.pack(e._ellipsoid,t,i),i+=te.packedLength,t[i++]=e._projectionIndex,t[i]=e._scene3DOnly?1:0,t};F_.unpack=function(e,t,n){let i=t??0,r=e[i++],o=new Array(r);for(let p=0;p<r;p++)o[p]=h.unpack(e,i),i+=3;let a=e[i++],s=e[i++]===1,c=e[i++],u=te.unpack(e,i);i+=te.packedLength;let f=e[i++],d=e[i]===1;return l(n)||(n=new F_({positions:o})),n._positions=o,n.granularity=a,n.loop=s,n.arcType=c,n._ellipsoid=u,n._projectionIndex=f,n._scene3DOnly=d,n};function k0(e,t,n){return h.subtract(e,t,n),h.normalize(n,n),n}function cde(e,t,n,i){return i=k0(e,t,i),i=h.cross(i,n,i),i=h.normalize(i,i),i=h.cross(n,i,i),i}var C5e=new h,v5e=new h,E5e=new h,wde=new h,S5e=0,w5e=-1;function EX(e,t,n,i,r){let o=k0(n,t,wde),a=cde(e,t,o,C5e),s=cde(i,t,o,v5e);if(I.equalsEpsilon(h.dot(a,s),w5e,I.EPSILON5))return r=h.cross(o,a,r),r=h.normalize(r,r),r;r=h.add(s,a,r),r=h.normalize(r,r);let c=h.cross(o,r,E5e);return h.dot(s,c)<S5e&&(r=h.negate(r,r)),r}var NN=tn.fromPointNormal(h.ZERO,h.UNIT_Y),I5e=new h,P5e=new h,D5e=new h,R5e=new h,O5e=new h,ON=new h,MN=new de,lde=new de,ude=new de;F_.createGeometry=function(e){let t=!e._scene3DOnly,n=e.loop,i=e._ellipsoid,r=e.granularity,o=e.arcType,a=new DX[e._projectionIndex](i),s=Ede,c=Sde,u,f,d=e._positions,p=d.length;p===2&&(n=!1);let g,m,y,A,b=new Uc(void 0,void 0,i),x,T,C,E=[d[0]];for(f=0;f<p-1;f++)g=d[f],m=d[f+1],x=ci.lineSegmentPlane(g,m,NN,ON),l(x)&&!h.equalsEpsilon(x,g,I.EPSILON7)&&!h.equalsEpsilon(x,m,I.EPSILON7)&&(e.arcType===sn.GEODESIC?E.push(h.clone(x)):e.arcType===sn.RHUMB&&(C=i.cartesianToCartographic(x,MN).longitude,y=i.cartesianToCartographic(g,MN),A=i.cartesianToCartographic(m,lde),b.setEndPoints(y,A),T=b.findIntersectionWithLongitude(C,ude),x=i.cartographicToCartesian(T,ON),l(x)&&!h.equalsEpsilon(x,g,I.EPSILON7)&&!h.equalsEpsilon(x,m,I.EPSILON7)&&E.push(h.clone(x)))),E.push(m);n&&(g=d[p-1],m=d[0],x=ci.lineSegmentPlane(g,m,NN,ON),l(x)&&!h.equalsEpsilon(x,g,I.EPSILON7)&&!h.equalsEpsilon(x,m,I.EPSILON7)&&(e.arcType===sn.GEODESIC?E.push(h.clone(x)):e.arcType===sn.RHUMB&&(C=i.cartesianToCartographic(x,MN).longitude,y=i.cartesianToCartographic(g,MN),A=i.cartesianToCartographic(m,lde),b.setEndPoints(y,A),T=b.findIntersectionWithLongitude(C,ude),x=i.cartographicToCartesian(T,ON),l(x)&&!h.equalsEpsilon(x,g,I.EPSILON7)&&!h.equalsEpsilon(x,m,I.EPSILON7)&&E.push(h.clone(x)))));let w=E.length,D=new Array(w);for(f=0;f<w;f++){let W=de.fromCartesian(E[f],i);W.height=0,D[f]=W}if(D=Pr(D,de.equalsEpsilon),w=D.length,w<2)return;let R=[],M=[],N=[],_=[],v=I5e,S=P5e,P=D5e,L=R5e,F=O5e,V=D[0],z=D[1],j=D[w-1];for(v=bl(i,j,s,v),L=bl(i,z,s,L),S=bl(i,V,s,S),P=bl(i,V,c,P),n?F=EX(v,S,P,L,F):F=PX(V,z,c,i,F),h.pack(F,M,0),h.pack(S,N,0),h.pack(P,_,0),R.push(V.latitude),R.push(V.longitude),CX(V,z,s,c,r,o,i,M,N,_,R),f=1;f<w-1;++f){v=h.clone(S,v),S=h.clone(L,S);let W=D[f];bl(i,W,c,P),bl(i,D[f+1],s,L),EX(v,S,P,L,F),u=M.length,h.pack(F,M,u),h.pack(S,N,u),h.pack(P,_,u),R.push(W.latitude),R.push(W.longitude),CX(D[f],D[f+1],s,c,r,o,i,M,N,_,R)}let B=D[w-1],G=D[w-2];if(S=bl(i,B,s,S),P=bl(i,B,c,P),n){let W=D[0];v=bl(i,G,s,v),L=bl(i,W,s,L),F=EX(v,S,P,L,F)}else F=PX(G,B,c,i,F);if(u=M.length,h.pack(F,M,u),h.pack(S,N,u),h.pack(P,_,u),R.push(B.latitude),R.push(B.longitude),n){for(CX(B,V,s,c,r,o,i,M,N,_,R),u=M.length,f=0;f<3;++f)M[u+f]=M[f],N[u+f]=N[f],_[u+f]=_[f];R.push(V.latitude),R.push(V.longitude)}return r9e(n,a,N,_,M,R,t)};var M5e=new h,L5e=new $,N5e=new Fe;function fde(e,t,n,i){let r=k0(n,t,M5e),o=h.dot(r,e);if(o>vde||o<ode){let a=k0(i,n,wde),s=o<ode?I.PI_OVER_TWO:-I.PI_OVER_TWO,c=Fe.fromAxisAngle(a,s,N5e),u=$.fromQuaternion(c,L5e);return $.multiplyByVector(u,e,e),!0}return!1}var dde=new de,F5e=new h,hde=new h;function sP(e,t,n,i,r){let o=de.toCartesian(t,e._ellipsoid,F5e),a=h.add(o,n,hde),s=!1,c=e._ellipsoid,u=c.cartesianToCartographic(a,dde);Math.abs(t.longitude-u.longitude)>I.PI_OVER_TWO&&(s=!0,a=h.subtract(o,n,hde),u=c.cartesianToCartographic(a,dde)),u.height=0;let f=e.project(u,r);return r=h.subtract(f,i,r),r.z=0,r=h.normalize(r,r),s&&h.negate(r,r),r}var B5e=new h,mde=new h;function pde(e,t,n,i,r,o){let a=h.subtract(t,e,B5e);h.normalize(a,a);let s=n-Ede,c=h.multiplyByScalar(a,s,mde);h.add(e,c,r);let u=i-Sde;c=h.multiplyByScalar(a,u,mde),h.add(t,c,o)}var k5e=new h;function LN(e,t){let n=tn.getPointDistance(NN,e),i=tn.getPointDistance(NN,t),r=k5e;I.equalsEpsilon(n,0,I.EPSILON2)?(r=k0(t,e,r),h.multiplyByScalar(r,I.EPSILON2,r),h.add(e,r,e)):I.equalsEpsilon(i,0,I.EPSILON2)&&(r=k0(e,t,r),h.multiplyByScalar(r,I.EPSILON2,r),h.add(t,r,t))}function z5e(e,t){let n=Math.abs(e.longitude),i=Math.abs(t.longitude);if(I.equalsEpsilon(n,I.PI,I.EPSILON11)){let r=I.sign(t.longitude);return e.longitude=r*(n-I.EPSILON11),1}else if(I.equalsEpsilon(i,I.PI,I.EPSILON11)){let r=I.sign(e.longitude);return t.longitude=r*(i-I.EPSILON11),2}return 0}var Ide=new de,Pde=new de,gde=new h,SX=new h,_de=new h,yde=new h,U5e=new h,Ade=new h,V5e=[Ide,Pde],j5e=new ie,H5e=new h,G5e=new h,W5e=new h,q5e=new h,Y5e=new h,X5e=new h,wX=new h,IX=new h,K5e=new h,$5e=new h,J5e=new h,bde=new h,Z5e=new h,Q5e=new h,e9e=new Sn,t9e=new Sn,xde=new h,n9e=new h,Tde=new h,i9e=[new se,new se],Dde=[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],Cde=Dde.length;function r9e(e,t,n,i,r,o,a){let s,c,u=t._ellipsoid,f=n.length/3-1,d=f*8,p=d*4,g=f*36,m=d>65535?new Uint32Array(g):new Uint16Array(g),y=new Float64Array(d*3),A=new Float32Array(p),b=new Float32Array(p),x=new Float32Array(p),T=new Float32Array(p),C=new Float32Array(p),E,w,D,R;a&&(E=new Float32Array(p),w=new Float32Array(p),D=new Float32Array(p),R=new Float32Array(d*2));let M=o.length/2,N=0,_=Ide;_.height=0;let v=Pde;v.height=0;let S=gde,P=SX;if(a)for(c=0,s=1;s<M;s++)_.latitude=o[c],_.longitude=o[c+1],v.latitude=o[c+2],v.longitude=o[c+3],S=t.project(_,S),P=t.project(v,P),N+=h.distance(S,P),c+=2;let L=i.length/3;P=h.unpack(i,0,P);let F=0;for(c=3,s=1;s<L;s++)S=h.clone(P,S),P=h.unpack(i,c,P),F+=h.distance(S,P),c+=3;let V;c=3;let z=0,j=0,B=0,G=0,W=!1,Q=h.unpack(n,0,yde),q=h.unpack(i,0,SX),J=h.unpack(r,0,Ade);if(e){let Ie=h.unpack(n,n.length-6,_de);fde(J,Ie,Q,q)&&(J=h.negate(J,J))}let Z=0,ce=0,Ae=0;for(s=0;s<f;s++){let Ie=h.clone(Q,_de),Le=h.clone(q,gde),$e=h.clone(J,U5e);W&&($e=h.negate($e,$e)),Q=h.unpack(n,c,yde),q=h.unpack(i,c,SX),J=h.unpack(r,c,Ade),W=fde(J,Ie,Q,q),_.latitude=o[z],_.longitude=o[z+1],v.latitude=o[z+2],v.longitude=o[z+3];let Ye,yt,Ke,we;if(a){let mi=z5e(_,v);Ye=t.project(_,Y5e),yt=t.project(v,X5e);let eo=k0(yt,Ye,xde);eo.y=Math.abs(eo.y),Ke=wX,we=IX,mi===0||h.dot(eo,h.UNIT_Y)>vde?(Ke=sP(t,_,$e,Ye,wX),we=sP(t,v,J,yt,IX)):mi===1?(we=sP(t,v,J,yt,IX),Ke.x=0,Ke.y=I.sign(_.longitude-Math.abs(v.longitude)),Ke.z=0):(Ke=sP(t,_,$e,Ye,wX),we.x=0,we.y=I.sign(_.longitude-v.longitude),we.z=0)}let We=h.distance(Le,q),Ct=Sn.fromCartesian(Ie,e9e),ct=h.subtract(Q,Ie,K5e),dn=h.normalize(ct,bde),Ht=h.subtract(Le,Ie,$5e);Ht=h.normalize(Ht,Ht);let bt=h.cross(dn,Ht,bde);bt=h.normalize(bt,bt);let Dt=h.cross(Ht,$e,Z5e);Dt=h.normalize(Dt,Dt);let In=h.subtract(q,Q,J5e);In=h.normalize(In,In);let rt=h.cross(J,In,Q5e);rt=h.normalize(rt,rt);let dt=We/F,vi=Z/F,wn=0,Mi,lr,Li,Wi=0,ri=0;if(a){wn=h.distance(Ye,yt),Mi=Sn.fromCartesian(Ye,t9e),lr=h.subtract(yt,Ye,xde),Li=h.normalize(lr,n9e);let mi=Li.x;Li.x=Li.y,Li.y=-mi,Wi=wn/N,ri=ce/N}for(V=0;V<8;V++){let mi=G+V*4,eo=j+V*2,Di=mi+3,Mo=V<4?1:-1,Ri=V===2||V===3||V===6||V===7?1:-1;h.pack(Ct.high,A,mi),A[Di]=ct.x,h.pack(Ct.low,b,mi),b[Di]=ct.y,h.pack(Dt,x,mi),x[Di]=ct.z,h.pack(rt,T,mi),T[Di]=dt*Mo,h.pack(bt,C,mi);let Tr=vi*Ri;Tr===0&&Ri<0&&(Tr=9),C[Di]=Tr,a&&(E[mi]=Mi.high.x,E[mi+1]=Mi.high.y,E[mi+2]=Mi.low.x,E[mi+3]=Mi.low.y,D[mi]=-Ke.y,D[mi+1]=Ke.x,D[mi+2]=we.y,D[mi+3]=-we.x,w[mi]=lr.x,w[mi+1]=lr.y,w[mi+2]=Li.x,w[mi+3]=Li.y,R[eo]=Wi*Mo,Tr=ri*Ri,Tr===0&&Ri<0&&(Tr=9),R[eo+1]=Tr)}let ei=W5e,vn=q5e,ti=H5e,xr=G5e,fa=ie.fromCartographicArray(V5e,j5e),Ma=Oi.getMinimumMaximumHeights(fa,u),Xa=Ma.minimumTerrainHeight,Ka=Ma.maximumTerrainHeight;Ae+=Math.abs(Xa),Ae+=Math.abs(Ka),pde(Ie,Le,Xa,Ka,ei,ti),pde(Q,q,Xa,Ka,vn,xr);let Qr=h.multiplyByScalar(bt,I.EPSILON5,Tde);h.add(ei,Qr,ei),h.add(vn,Qr,vn),h.add(ti,Qr,ti),h.add(xr,Qr,xr),LN(ei,vn),LN(ti,xr),h.pack(ei,y,B),h.pack(vn,y,B+3),h.pack(xr,y,B+6),h.pack(ti,y,B+9),Qr=h.multiplyByScalar(bt,-2*I.EPSILON5,Tde),h.add(ei,Qr,ei),h.add(vn,Qr,vn),h.add(ti,Qr,ti),h.add(xr,Qr,xr),LN(ei,vn),LN(ti,xr),h.pack(ei,y,B+12),h.pack(vn,y,B+15),h.pack(xr,y,B+18),h.pack(ti,y,B+21),z+=2,c+=3,j+=16,B+=24,G+=32,Z+=We,ce+=wn}c=0;let le=0;for(s=0;s<f;s++){for(V=0;V<Cde;V++)m[c+V]=Dde[V]+le;le+=8,c+=Cde}let Ce=i9e;se.fromVertices(n,h.ZERO,3,Ce[0]),se.fromVertices(i,h.ZERO,3,Ce[1]);let ye=se.fromBoundingSpheres(Ce);ye.radius+=Ae/(f*2);let ve={position:new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,normalize:!1,values:y}),startHiAndForwardOffsetX:N_(A),startLoAndForwardOffsetY:N_(b),startNormalAndForwardOffsetZ:N_(x),endNormalAndTextureCoordinateNormalizationX:N_(T),rightNormalAndTextureCoordinateNormalizationY:N_(C)};return a&&(ve.startHiLo2D=N_(E),ve.offsetAndRight2D=N_(w),ve.startEndNormals2D=N_(D),ve.texcoordNormalization2D=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:2,normalize:!1,values:R})),new Tt({attributes:ve,indices:m,boundingSphere:ye})}function N_(e){return new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}F_._projectNormal=sP;var HC=F_;function RX(e,t,n){this.heading=e??0,this.pitch=t??0,this.range=n??0}RX.clone=function(e,t){if(l(e))return l(t)||(t=new RX),t.heading=e.heading,t.pitch=e.pitch,t.range=e.range,t};var ph=RX;var o9e=I.factorial;function OX(e,t,n,i,r,o){let a=0,s,c,u;if(i>0){for(c=0;c<r;c++){for(s=!1,u=0;u<o.length&&!s;u++)c===o[u]&&(s=!0);s||(o.push(c),a+=OX(e,t,n,i-1,r,o),o.splice(o.length-1,1))}return a}for(a=1,c=0;c<r;c++){for(s=!1,u=0;u<o.length&&!s;u++)c===o[u]&&(s=!0);s||(a*=e-n[t[c]])}return a}var a9e=[],MX=class{static get type(){return"Hermite"}static getRequiredDataPoints(t,n){return n=n??0,Math.max(Math.floor((t+1)/(n+1)),2)}static interpolateOrderZero(t,n,i,r,o){l(o)||(o=new Array(r));let a,s,c,u,f,d,p=n.length,g=new Array(r);for(a=0;a<r;a++){o[a]=0;let b=new Array(p);for(g[a]=b,s=0;s<p;s++)b[s]=[]}let m=p,y=new Array(m);for(a=0;a<m;a++)y[a]=a;let A=p-1;for(u=0;u<r;u++){for(s=0;s<m;s++)d=y[s]*r+u,g[u][0].push(i[d]);for(a=1;a<m;a++){let b=!1;for(s=0;s<m-a;s++){let x=n[y[s]],T=n[y[s+a]],C;T-x<=0?(d=y[s]*r+r*a+u,C=i[d],g[u][a].push(C/o9e(a))):(C=g[u][a-1][s+1]-g[u][a-1][s],g[u][a].push(C/(T-x))),b=b||C!==0}b||(A=a-1)}}for(c=0,f=0;c<=f;c++)for(a=c;a<=A;a++){let b=OX(t,y,n,c,a,[]);for(u=0;u<r;u++){let x=g[u][a][0];o[u+c*r]+=x*b}}return o}static interpolate(t,n,i,r,o,a,s){let c=r*(a+1);l(s)||(s=new Array(c));for(let x=0;x<c;x++)s[x]=0;let u=n.length,f=new Array(u*(o+1)),d;for(d=0;d<u;d++)for(let x=0;x<o+1;x++)f[d*(o+1)+x]=d;let p=f.length,g=a9e,m=s9e(g,f,n,i,r,o),y=[],A=p*(p+1)/2,b=Math.min(m,a);for(let x=0;x<=b;x++)for(d=x;d<=m;d++){y.length=0;let T=OX(t,f,n,x,d,y),C=Math.floor(d*(1-d)/2)+p*d;for(let E=0;E<r;E++){let w=Math.floor(E*A),D=g[w+C];s[E+x*r]+=D*T}}return s}};function s9e(e,t,n,i,r,o){let a,s,c=-1,u=t.length,f=u*(u+1)/2;for(let d=0;d<r;d++){let p=Math.floor(d*f);for(a=0;a<u;a++)s=t[a]*r*(o+1)+d,e[p+a]=i[s];for(let g=1;g<u;g++){let m=0,y=Math.floor(g*(1-g)/2)+u*g,A=!1;for(a=0;a<u-g;a++){let b=n[t[a]],x=n[t[a+g]],T,C;if(x-b<=0)s=t[a]*r*(o+1)+r*g+d,T=i[s],C=T/I.factorial(g),e[p+y+m]=C,m++;else{let E=Math.floor((g-1)*(2-g)/2)+u*(g-1);T=e[p+E+a+1]-e[p+E+a],C=T/(x-b),e[p+y+m]=C,m++}A=A||T!==0}A&&(c=Math.max(c,g))}}return c}var FN=MX;var LX={};LX.encode2D=function(e,t,n){let i=Math.pow(2,e),r={x:t,y:n},o,a,s,c=BigInt(0);for(s=i/2;s>0;s/=2)o=(r.x&s)>0?1:0,a=(r.y&s)>0?1:0,c+=BigInt((3*o^a)*s*s),Rde(i,r,o,a);return c};LX.decode2D=function(e,t){let n=Math.pow(2,e),i={x:0,y:0},r,o,a,s;for(a=1,s=t;a<n;a*=2)r=1&Number(s/BigInt(2)),o=1&Number(s^BigInt(r)),Rde(a,i,r,o),i.x+=a*r,i.y+=a*o,s/=BigInt(4);return[i.x,i.y]};function Rde(e,t,n,i){if(i!==0)return;n===1&&(t.x=e-1-t.x,t.y=e-1-t.y);let r=t.x;t.x=t.y,t.y=r}var cP=LX;var za={};za.ExportStatus=Object.freeze({NotStarted:"NotStarted",InProgress:"InProgress",Complete:"Complete",Invalid:"Invalid"});za.ExportType=Object.freeze({IMODEL:"IMODEL",CESIUM:"CESIUM","3DTILES":"3DTILES"});za.RealityDataType=Object.freeze({Cesium3DTiles:"Cesium3DTiles",PNTS:"PNTS",RealityMesh3DTiles:"RealityMesh3DTiles",Terrain3DTiles:"Terrain3DTiles",GaussianSplat3DTiles:"GS_3DT",KML:"KML",GeoJSON:"GeoJSON",Unstructured:"Unstructured"});za.defaultAccessToken=void 0;za.defaultShareKey=void 0;za._getAuthorizationHeader=function(){return l(za.defaultShareKey)?`Basic ${za.defaultShareKey}`:`Bearer ${za.defaultAccessToken}`};za.apiEndpoint=new De({url:"https://api.bentley.com"});za.getExports=async function(e,t){let n=new De({url:`${za.apiEndpoint}mesh-export`,headers:{Authorization:za._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json",Prefer:"return=representation"},queryParameters:{iModelId:e,exportType:za.ExportType["3DTILES"],$top:"5",client:"CesiumJS"}});typeof CESIUM_VERSION<"u"&&n.appendQueryParameters({clientVersion:CESIUM_VERSION}),l(t)&&t!==""&&n.appendQueryParameters({changesetId:t});try{return await n.fetchJson()}catch(i){let r=JSON.parse(i.response);if(i.statusCode===401){let o=r.error.details?.[0].code??"";throw new oe(`Unauthorized, bad token, wrong scopes or headers bad. ${o}`)}else{if(i.statusCode===403)throw console.error(r.error.code,r.error.message),new oe("Not allowed, forbidden");if(i.statusCode===422)throw new oe(`Unprocessable Entity:${r.error.code} ${r.error.message}`);if(i.statusCode===429)throw new oe("Too many requests")}throw new oe(`Unknown request failure ${i.statusCode}`)}};za.getRealityDataMetadata=async function(e,t){let n=new De({url:`${za.apiEndpoint}reality-management/reality-data/${t}`,headers:{Authorization:za._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{iTwinId:e}});try{return(await n.fetchJson()).realityData}catch(i){let r=JSON.parse(i.response);if(i.statusCode===401){let o=r.error.details?.[0].code??"";throw new oe(`Unauthorized, bad token, wrong scopes or headers bad. ${o}`)}else{if(i.statusCode===403)throw console.error(r.error.code,r.error.message),new oe("Not allowed, forbidden");if(i.statusCode===404)throw new oe(`Reality data not found: ${e}, ${t}`);if(i.statusCode===422)throw new oe(`Unprocessable Entity:${r.error.code} ${r.error.message}`);if(i.statusCode===429)throw new oe("Too many requests")}throw new oe(`Unknown request failure ${i.statusCode}`)}};za.getRealityDataURL=async function(e,t,n){let i=new De({url:`${za.apiEndpoint}reality-management/reality-data/${t}/readaccess`,headers:{Authorization:za._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{iTwinId:e}});try{let o=(await i.fetchJson())._links.containerUrl.href,a=new URL(o);return a.pathname=`${a.pathname}/${n}`,a.toString()}catch(r){let o=JSON.parse(r.response);if(r.statusCode===401){let a=o.error.details?.[0].code??"";throw new oe(`Unauthorized, bad token, wrong scopes or headers bad. ${a}`)}else{if(r.statusCode===403)throw console.error(o.error.code,o.error.message),new oe("Not allowed, forbidden");if(r.statusCode===404)throw new oe(`Reality data not found: ${e}, ${t}`);if(r.statusCode===422)throw new oe(`Unprocessable Entity:${o.error.code} ${o.error.message}`);if(r.statusCode===429)throw new oe("Too many requests")}throw new oe(`Unknown request failure ${r.statusCode}`)}};var rs=za;function c9e(e,t,n,i){this.rightAscension=e,this.declination=t,this.rotation=n,this.rotationRate=i}var BN=c9e;var Wde={},l9e=32.184,u9e=2451545,Ode=-.0529921,Mde=-.1059842,Lde=13.0120009,Nde=13.3407154,Fde=.9856003,Bde=26.4057084,kde=13.064993,zde=.3287146,Ude=1.7484877,Vde=-.1589763,jde=.0036096,Hde=.1643573,Gde=12.9590088,NX=new K;Wde.ComputeMoon=function(e,t){l(e)||(e=K.now()),NX=K.addSeconds(e,l9e,NX);let n=K.totalDays(NX)-u9e,i=n/Un.DAYS_PER_JULIAN_CENTURY,r=(125.045+Ode*n)*I.RADIANS_PER_DEGREE,o=(250.089+Mde*n)*I.RADIANS_PER_DEGREE,a=(260.008+Lde*n)*I.RADIANS_PER_DEGREE,s=(176.625+Nde*n)*I.RADIANS_PER_DEGREE,c=(357.529+Fde*n)*I.RADIANS_PER_DEGREE,u=(311.589+Bde*n)*I.RADIANS_PER_DEGREE,f=(134.963+kde*n)*I.RADIANS_PER_DEGREE,d=(276.617+zde*n)*I.RADIANS_PER_DEGREE,p=(34.226+Ude*n)*I.RADIANS_PER_DEGREE,g=(15.134+Vde*n)*I.RADIANS_PER_DEGREE,m=(119.743+jde*n)*I.RADIANS_PER_DEGREE,y=(239.961+Hde*n)*I.RADIANS_PER_DEGREE,A=(25.053+Gde*n)*I.RADIANS_PER_DEGREE,b=Math.sin(r),x=Math.sin(o),T=Math.sin(a),C=Math.sin(s),E=Math.sin(c),w=Math.sin(u),D=Math.sin(f),R=Math.sin(d),M=Math.sin(p),N=Math.sin(g),_=Math.sin(m),v=Math.sin(y),S=Math.sin(A),P=Math.cos(r),L=Math.cos(o),F=Math.cos(a),V=Math.cos(s),z=Math.cos(c),j=Math.cos(u),B=Math.cos(f),G=Math.cos(d),W=Math.cos(p),Q=Math.cos(g),q=Math.cos(m),J=Math.cos(y),Z=Math.cos(A),ce=(269.9949+.0031*i-3.8787*b-.1204*x+.07*T-.0172*C+.0072*w-.0052*N+.0043*S)*I.RADIANS_PER_DEGREE,Ae=(66.5392+.013*i+1.5419*P+.0239*L-.0278*F+.0068*V-.0029*j+9e-4*B+8e-4*Q-9e-4*Z)*I.RADIANS_PER_DEGREE,le=(38.3213+13.17635815*n-14e-13*n*n+3.561*b+.1208*x-.0642*T+.0158*C+.0252*E-.0066*w-.0047*D-.0046*R+.0028*M+.0052*N+.004*_+.0019*v-.0044*S)*I.RADIANS_PER_DEGREE,Ce=(13.17635815-14e-13*(2*n)+3.561*P*Ode+.1208*L*Mde-.0642*F*Lde+.0158*V*Nde+.0252*z*Fde-.0066*j*Bde-.0047*B*kde-.0046*G*zde+.0028*W*Ude+.0052*Q*Vde+.004*q*jde+.0019*J*Hde-.0044*Z*Gde)/86400*I.RADIANS_PER_DEGREE;return l(t)||(t=new BN),t.rightAscension=ce,t.declination=Ae,t.rotation=le,t.rotationRate=Ce,t};var kN=Wde;function qde(e){(!l(e)||typeof e!="function")&&(e=kN.ComputeMoon),this._computeFunction=e}var f9e=new h,d9e=new h,h9e=new h;function m9e(e,t,n){let i=f9e;i.x=Math.cos(e+I.PI_OVER_TWO),i.y=Math.sin(e+I.PI_OVER_TWO),i.z=0;let r=Math.cos(t),o=h9e;o.x=r*Math.cos(e),o.y=r*Math.sin(e),o.z=Math.sin(t);let a=h.cross(o,i,d9e);return l(n)||(n=new $),n[0]=i.x,n[1]=a.x,n[2]=o.x,n[3]=i.y,n[4]=a.y,n[5]=o.y,n[6]=i.z,n[7]=a.z,n[8]=o.z,n}var p9e=new $,g9e=new Fe;qde.prototype.evaluate=function(e,t){l(e)||(e=K.now());let n=this._computeFunction(e),i=m9e(n.rightAscension,n.declination,t),r=I.zeroToTwoPi(n.rotation),o=Fe.fromAxisAngle(h.UNIT_Z,r,g9e),a=$.fromQuaternion(Fe.conjugate(o,o),p9e);return $.multiply(a,i,i)};var zN=qde;var FX=class{constructor(){at(this,"type")}getRequiredDataPoints(t){pe.throwInstantiationError()}interpolateOrderZero(t,n,i,r,o){pe.throwInstantiationError()}interpolate(t,n,i,r,o,a,s){pe.throwInstantiationError()}},Yde=FX;var Xde={STEP:0,LINEAR:1,CUBICSPLINE:2};Object.freeze(Xde);var Xm=Xde;var Kde={GOOGLE:"GOOGLE",BING:"BING",DEFAULT:"DEFAULT"};Object.freeze(Kde);var B_=Kde;function BX(e){this._url=De.createIfNeeded(e),this._url.appendForwardSlash()}Object.defineProperties(BX.prototype,{url:{get:function(){return this._url}},credit:{get:function(){}}});BX.prototype.geocode=async function(e,t){return this._url.getDerivedResource({url:t===yb.AUTOCOMPLETE?"autocomplete":"search",queryParameters:{text:e}}).fetchJson().then(function(i){return i.features.map(function(r){let o,a=r.bbox;if(l(a))o=ie.fromDegrees(a[0],a[1],a[2],a[3]);else{let s=r.geometry.coordinates[0],c=r.geometry.coordinates[1];o=h.fromDegrees(s,c)}return{displayName:r.properties.label,destination:o,attributions:i.attributions}})})};var UN=BX;function _9e(e){if(!Object.values(B_).some(t=>t===e))throw new pe(`Invalid geocodeProviderType: "${e}"`)}var $de=Object.freeze({[B_.GOOGLE]:"google",[B_.BING]:"bing",[B_.DEFAULT]:void 0});function y9e(e){return $de[e]}function A9e(e){return Object.entries($de).find(t=>t[1]===e)[0]}function kX(e){e=e??H.EMPTY_OBJECT;let t=e.geocodeProviderType??B_.DEFAULT,n=e.accessToken??Fm.defaultAccessToken,i=De.createIfNeeded(e.server??Fm.defaultServer);i.appendForwardSlash();let r=Fm.getDefaultTokenCredit(n);l(r)&&e.scene.frameState.creditDisplay.addStaticCredit(wt.clone(r));let o=i.getDerivedResource({url:"v1/geocode"});l(n)&&o.appendQueryParameters({access_token:n}),this._accessToken=n,this._server=i,this._pelias=new UN(o),this.geocodeProviderType=t}Object.defineProperties(kX.prototype,{credit:{get:function(){}},geocodeProviderType:{get:function(){return A9e(this._pelias.url.queryParameters.geocoder)},set:function(e){_9e(e);let t={...this._pelias.url.queryParameters,geocoder:y9e(e)};l(t.geocoder)||delete t.geocoder,this._pelias.url.setQueryParameters(t)}}});kX.prototype.geocode=async function(e,t){return this._pelias.geocode(e,t)};var GC=kX;function _o(e){e=e??H.EMPTY_OBJECT,this.start=l(e.start)?K.clone(e.start):new K,this.stop=l(e.stop)?K.clone(e.stop):new K,this.data=e.data,this.isStartIncluded=e.isStartIncluded??!0,this.isStopIncluded=e.isStopIncluded??!0}Object.defineProperties(_o.prototype,{isEmpty:{get:function(){let e=K.compare(this.stop,this.start);return e<0||e===0&&(!this.isStartIncluded||!this.isStopIncluded)}}});var WC={start:void 0,stop:void 0,isStartIncluded:void 0,isStopIncluded:void 0,data:void 0};_o.fromIso8601=function(e,t){let n=e.iso8601.split("/");if(n.length!==2)throw new pe("options.iso8601 is an invalid ISO 8601 interval.");let i=K.fromIso8601(n[0]),r=K.fromIso8601(n[1]),o=e.isStartIncluded??!0,a=e.isStopIncluded??!0,s=e.data;return l(t)?(t.start=i,t.stop=r,t.isStartIncluded=o,t.isStopIncluded=a,t.data=s,t):(WC.start=i,WC.stop=r,WC.isStartIncluded=o,WC.isStopIncluded=a,WC.data=s,new _o(WC))};_o.toIso8601=function(e,t){return`${K.toIso8601(e.start,t)}/${K.toIso8601(e.stop,t)}`};_o.clone=function(e,t){if(l(e))return l(t)?(t.start=e.start,t.stop=e.stop,t.isStartIncluded=e.isStartIncluded,t.isStopIncluded=e.isStopIncluded,t.data=e.data,t):new _o(e)};_o.equals=function(e,t,n){return e===t||l(e)&&l(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&K.equals(e.start,t.start)&&K.equals(e.stop,t.stop)&&(e.data===t.data||l(n)&&n(e.data,t.data)))};_o.equalsEpsilon=function(e,t,n,i){return n=n??0,e===t||l(e)&&l(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&K.equalsEpsilon(e.start,t.start,n)&&K.equalsEpsilon(e.stop,t.stop,n)&&(e.data===t.data||l(i)&&i(e.data,t.data)))};_o.intersect=function(e,t,n,i){if(!l(t))return _o.clone(_o.EMPTY,n);let r=e.start,o=e.stop,a=t.start,s=t.stop,c=K.greaterThanOrEquals(a,r)&&K.greaterThanOrEquals(o,a),u=!c&&K.lessThanOrEquals(a,r)&&K.lessThanOrEquals(r,s);if(!c&&!u)return _o.clone(_o.EMPTY,n);let f=e.isStartIncluded,d=e.isStopIncluded,p=t.isStartIncluded,g=t.isStopIncluded,m=K.lessThan(o,s);return l(n)||(n=new _o),n.start=c?a:r,n.isStartIncluded=f&&p||!K.equals(a,r)&&(c&&p||u&&f),n.stop=m?o:s,n.isStopIncluded=m?d:d&&g||!K.equals(s,o)&&g,n.data=l(i)?i(e.data,t.data):e.data,n};_o.contains=function(e,t){if(e.isEmpty)return!1;let n=K.compare(e.start,t);if(n===0)return e.isStartIncluded;let i=K.compare(t,e.stop);return i===0?e.isStopIncluded:n<0&&i<0};_o.prototype.clone=function(e){return _o.clone(this,e)};_o.prototype.equals=function(e,t){return _o.equals(this,e,t)};_o.prototype.equalsEpsilon=function(e,t,n){return _o.equalsEpsilon(this,e,t,n)};_o.prototype.toString=function(){return _o.toIso8601(this)};_o.EMPTY=Object.freeze(new _o({start:new K,stop:new K,isStartIncluded:!1,isStopIncluded:!1}));var Cn=_o;var Jde=Object.freeze(K.fromIso8601("0000-01-01T00:00:00Z")),Zde=Object.freeze(K.fromIso8601("9999-12-31T24:00:00Z")),b9e=Object.freeze(new Cn({start:Jde,stop:Zde})),x9e={MINIMUM_VALUE:Jde,MAXIMUM_VALUE:Zde,MAXIMUM_INTERVAL:b9e},Qe=x9e;var Qde={SHIFT:0,CTRL:1,ALT:2};Object.freeze(Qde);var Xr=Qde;var zX=class{static get type(){return"Lagrange"}static getRequiredDataPoints(t){return Math.max(t+1,2)}static interpolateOrderZero(t,n,i,r,o){l(o)||(o=new Array(r));let a,s,c=n.length;for(a=0;a<r;a++)o[a]=0;for(a=0;a<c;a++){let u=1;for(s=0;s<c;s++)if(s!==a){let f=n[a]-n[s];u*=(t-n[s])/f}for(s=0;s<r;s++)o[s]+=u*i[a*r+s]}return o}},VN=zX;var UX=class{static get type(){return"Linear"}static getRequiredDataPoints(t){return 2}static interpolateOrderZero(t,n,i,r,o){l(o)||(o=new Array(r));let a,s,c,u=n[0],f=n[1];for(a=0;a<r;a++)s=i[a],c=i[a+r],o[a]=((c-s)*t+f*s-u*c)/(f-u);return o}},qC=UX;function Km(e){e=e??0,this._array=new Array(e),this._length=e}Object.defineProperties(Km.prototype,{length:{get:function(){return this._length},set:function(e){let t=this._array,n=this._length;if(e<n)for(let i=e;i<n;++i)t[i]=void 0;else e>t.length&&(t.length=e);this._length=e}},values:{get:function(){return this._array}}});Km.prototype.get=function(e){return this._array[e]};Km.prototype.set=function(e,t){e>=this._length&&(this.length=e+1),this._array[e]=t};Km.prototype.peek=function(){return this._array[this._length-1]};Km.prototype.push=function(e){let t=this.length++;this._array[t]=e};Km.prototype.pop=function(){if(this._length===0)return;let e=this._array[this._length-1];return--this.length,e};Km.prototype.reserve=function(e){e>this._array.length&&(this._array.length=e)};Km.prototype.resize=function(e){this.length=e};Km.prototype.trim=function(e){e=e??this._length,this._array.length=e};var au=Km;var VX=class{constructor(){at(this,"ellipsoid")}project(t,n){pe.throwInstantiationError()}unproject(t,n){pe.throwInstantiationError()}},ehe=VX;function YC(e){e=e??H.EMPTY_OBJECT;let t=e.weights,n=e.times;this._times=n,this._weights=t,this._count=t.length/n.length,this._lastTimeIndex=0}Object.defineProperties(YC.prototype,{times:{get:function(){return this._times}},weights:{get:function(){return this._weights}}});YC.prototype.findTimeInterval=Er.prototype.findTimeInterval;YC.prototype.wrapTime=Er.prototype.wrapTime;YC.prototype.clampTime=Er.prototype.clampTime;YC.prototype.evaluate=function(e,t){let n=this.weights,i=this.times,r=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),o=(e-i[r])/(i[r+1]-i[r]);l(t)||(t=new Array(this._count));for(let a=0;a<this._count;a++){let s=r*this._count+a;t[a]=n[s]*(1-o)+n[s+this._count]*o}return t};var the=YC;function td(e,t,n,i){this.near=e??0,this.nearValue=t??0,this.far=n??1,this.farValue=i??0}td.clone=function(e,t){if(l(e))return l(t)?(t.near=e.near,t.nearValue=e.nearValue,t.far=e.far,t.farValue=e.farValue,t):new td(e.near,e.nearValue,e.far,e.farValue)};td.packedLength=4;td.pack=function(e,t,n){return n=n??0,t[n++]=e.near,t[n++]=e.nearValue,t[n++]=e.far,t[n]=e.farValue,t};td.unpack=function(e,t,n){return t=t??0,l(n)||(n=new td),n.near=e[t++],n.nearValue=e[t++],n.far=e[t++],n.farValue=e[t],n};td.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.nearValue===t.nearValue&&e.far===t.far&&e.farValue===t.farValue};td.prototype.clone=function(e){return td.clone(this,e)};td.prototype.equals=function(e){return td.equals(this,e)};var Wt=td;var nhe={NONE:-1,PARTIAL:0,FULL:1};Object.freeze(nhe);var Bo=nhe;function jc(e,t){this._occluderPosition=h.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 jN=new h;Object.defineProperties(jc.prototype,{position:{get:function(){return this._occluderPosition}},radius:{get:function(){return this._occluderRadius}},cameraPosition:{set:function(e){e=h.clone(e,this._cameraPosition);let t=h.subtract(this._occluderPosition,e,jN),n=h.magnitudeSquared(t),i=this._occluderRadius*this._occluderRadius,r,o,a;if(n>i){r=Math.sqrt(n-i),n=1/Math.sqrt(n),o=h.multiplyByScalar(t,n,jN);let s=r*r*n;a=h.add(e,h.multiplyByScalar(o,s,jN),jN)}else r=Number.MAX_VALUE;this._horizonDistance=r,this._horizonPlaneNormal=o,this._horizonPlanePosition=a,this._cameraPosition=e}}});jc.fromBoundingSphere=function(e,t,n){return l(n)?(h.clone(e.center,n._occluderPosition),n._occluderRadius=e.radius,n.cameraPosition=t,n):new jc(e,t)};var rhe=new h;jc.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){let t=h.subtract(e,this._occluderPosition,rhe),n=this._occluderRadius;if(n=h.magnitudeSquared(t)-n*n,n>0)return n=Math.sqrt(n)+this._horizonDistance,t=h.subtract(e,this._cameraPosition,t),n*n>h.magnitudeSquared(t)}return!1};var T9e=new h;jc.prototype.isBoundingSphereVisible=function(e){let t=h.clone(e.center,T9e),n=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){let i=h.subtract(t,this._occluderPosition,rhe),r=this._occluderRadius-n;if(r=h.magnitudeSquared(i)-r*r,n<this._occluderRadius)return r>0?(r=Math.sqrt(r)+this._horizonDistance,i=h.subtract(t,this._cameraPosition,i),r*r+n*n>h.magnitudeSquared(i)):!1;if(r>0){i=h.subtract(t,this._cameraPosition,i);let o=h.magnitudeSquared(i),a=this._occluderRadius*this._occluderRadius,s=n*n;return(this._horizonDistance*this._horizonDistance+a)*s>o*a?!0:(r=Math.sqrt(r)+this._horizonDistance,r*r+s>o)}return!0}return!1};var C9e=new h;jc.prototype.computeVisibility=function(e){let t=h.clone(e.center),n=e.radius;if(n>this._occluderRadius)return Bo.FULL;if(this._horizonDistance!==Number.MAX_VALUE){let i=h.subtract(t,this._occluderPosition,C9e),r=this._occluderRadius-n,o=h.magnitudeSquared(i);if(r=o-r*r,r>0){r=Math.sqrt(r)+this._horizonDistance,i=h.subtract(t,this._cameraPosition,i);let a=h.magnitudeSquared(i);return r*r+n*n<a?Bo.NONE:(r=this._occluderRadius+n,r=o-r*r,r>0?(r=Math.sqrt(r)+this._horizonDistance,a<r*r+n*n?Bo.FULL:Bo.PARTIAL):(i=h.subtract(t,this._horizonPlanePosition,i),h.dot(i,this._horizonPlaneNormal)>-n?Bo.PARTIAL:Bo.FULL))}}return Bo.NONE};var HN=new h;jc.computeOccludeePoint=function(e,t,n){let i=h.clone(t),r=h.clone(e.center),o=e.radius,a=n.length,s=h.normalize(h.subtract(i,r,HN),HN),c=-h.dot(s,r),u=jc._anyRotationVector(r,s,c),f=jc._horizonToPlaneNormalDotProduct(e,s,c,u,n[0]);if(!f)return;let d;for(let g=1;g<a;++g){if(d=jc._horizonToPlaneNormalDotProduct(e,s,c,u,n[g]),!d)return;d<f&&(f=d)}if(f<.0017453283658983088)return;let p=o/f;return h.add(r,h.multiplyByScalar(s,p,HN),HN)};var v9e=[];jc.computeOccludeePointFromRectangle=function(e,t){t=t??te.default;let n=ie.subsample(e,t,0,v9e),i=se.fromPoints(n),r=h.ZERO;if(!h.equals(r,i.center))return jc.computeOccludeePoint(new se(r,t.minimumRadius),i.center,n)};var E9e=new h;jc._anyRotationVector=function(e,t,n){let i=h.abs(t,E9e),r=i.x>i.y?0:1;(r===0&&i.z>i.x||r===1&&i.z>i.y)&&(r=2);let o=new h,a;r===0?(i.x=e.x,i.y=e.y+1,i.z=e.z+1,a=h.UNIT_X):r===1?(i.x=e.x+1,i.y=e.y,i.z=e.z+1,a=h.UNIT_Y):(i.x=e.x+1,i.y=e.y+1,i.z=e.z,a=h.UNIT_Z);let s=(h.dot(t,i)+n)/-h.dot(t,a);return h.normalize(h.subtract(h.add(i,h.multiplyByScalar(a,s,o),i),e,i),i)};var S9e=new h;jc._rotationVector=function(e,t,n,i,r){let o=h.subtract(i,e,S9e);if(o=h.normalize(o,o),h.dot(t,o)<.9999999847691291){let a=h.cross(t,o,o);if(h.magnitude(a)>I.EPSILON13)return h.normalize(a,new h)}return r};var jX=new h,w9e=new h,GN=new h,ihe=new h;jc._horizonToPlaneNormalDotProduct=function(e,t,n,i,r){let o=h.clone(r,jX),a=h.clone(e.center,w9e),s=e.radius,c=h.subtract(a,o,GN),u=h.magnitudeSquared(c),f=s*s;if(u<f)return!1;let d=u-f,p=Math.sqrt(d),m=1/Math.sqrt(u),A=p*m*p;c=h.normalize(c,c);let b=h.add(o,h.multiplyByScalar(c,A,ihe),ihe),x=Math.sqrt(d-A*A),T=this._rotationVector(a,t,n,o,i),C=h.fromElements(T.x*T.x*c.x+(T.x*T.y-T.z)*c.y+(T.x*T.z+T.y)*c.z,(T.x*T.y+T.z)*c.x+T.y*T.y*c.y+(T.y*T.z-T.x)*c.z,(T.x*T.z-T.y)*c.x+(T.y*T.z+T.x)*c.y+T.z*T.z*c.z,jX);C=h.normalize(C,C);let E=h.multiplyByScalar(C,x,jX);T=h.normalize(h.subtract(h.add(b,E,GN),a,GN),GN);let w=h.dot(t,T);T=h.normalize(h.subtract(h.subtract(b,E,T),a,T),T);let D=h.dot(t,T);return w<D?w:D};var WN=jc;function lP(e,t,n){e=e??0,t=t??0,n=n??0,this.value=new Float32Array([e,t,n])}Object.defineProperties(lP.prototype,{componentDatatype:{get:function(){return Y.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}});lP.fromCartesian3=function(e){return new lP(e.x,e.y,e.z)};lP.toValue=function(e,t){return l(t)||(t=new Float32Array([e.x,e.y,e.z])),t[0]=e.x,t[1]=e.y,t[2]=e.z,t};var yr=lP;function HX(e,t,n){e=De.createIfNeeded(e),e.appendForwardSlash(),e.setQueryParameters({key:t}),this._url=e,this._params=n??{},this._credit=new wt('Geodata copyright <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors',!1)}Object.defineProperties(HX.prototype,{url:{get:function(){return this._url}},params:{get:function(){return this._params}},credit:{get:function(){return this._credit}}});HX.prototype.geocode=async function(e){return this._url.getDerivedResource({url:"json",queryParameters:Ot(this._params,{q:e})}).fetchJson().then(function(n){return n.results.map(function(i){let r,o=i.bounds;if(l(o))r=ie.fromDegrees(o.southwest.lng,o.southwest.lat,o.northeast.lng,o.northeast.lat);else{let{lng:a,lat:s}=i.geometry;r=h.fromDegrees(a,s)}return{displayName:i.formatted,destination:r}})})};var ohe=HX;var I9e={packedLength:void 0,pack:pe.throwInstantiationError,unpack:pe.throwInstantiationError},ahe=I9e;var P9e={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:pe.throwInstantiationError,unpackInterpolationResult:pe.throwInstantiationError},she=P9e;function D9e(e,t){let n=e.measureText(t);if(!/\S/.test(t))return{width:n.width,height:0,ascent:0,descent:0,minx:0};let r=Math.round(n.actualBoundingBoxAscent),o=Math.round(n.actualBoundingBoxDescent),a=Math.max(r+o,1);return{width:n.width,height:a,ascent:r,descent:o,minx:-Math.round(n.actualBoundingBoxLeft)}}var bb;function R9e(e,t){if(e==="")return;t=t??H.EMPTY_OBJECT;let n=t.font??"10px sans-serif",i=t.stroke??!1,r=t.fill??!0,o=t.strokeWidth??1,a=t.backgroundColor??U.TRANSPARENT,s=t.padding??0,c=s*2,u=document.createElement("canvas");u.width=1,u.height=1,u.style.font=n;let f=u.getContext("2d",{willReadFrequently:!0});l(bb)||(l(f.imageSmoothingEnabled)?bb="imageSmoothingEnabled":l(f.mozImageSmoothingEnabled)?bb="mozImageSmoothingEnabled":l(f.webkitImageSmoothingEnabled)?bb="webkitImageSmoothingEnabled":l(f.msImageSmoothingEnabled)&&(bb="msImageSmoothingEnabled")),f.font=n,f.lineJoin="round",f.lineWidth=o,f[bb]=!1,u.style.visibility="hidden",document.body.appendChild(u);let d=D9e(f,e);u.dimensions=d,document.body.removeChild(u),u.style.visibility="";let p=!/\S/.test(e),g=i&&!p?Math.ceil(o/2):0,m=g*2,y=-d.minx+g,A=Math.ceil(d.width)+y+c+g,b=d.height+c+m,x=d.ascent+s+g;if(u.width=A,u.height=b,f.font=n,f.lineJoin="round",f.lineWidth=o,f[bb]=!1,a!==U.TRANSPARENT&&(f.fillStyle=a.toCssColorString(),f.fillRect(0,0,u.width,u.height)),i){let T=t.strokeColor??U.BLACK;f.strokeStyle=T.toCssColorString(),f.strokeText(e,y+s,x)}if(r){let T=t.fillColor??U.WHITE;f.fillStyle=T.toCssColorString(),f.fillText(e,y+s,x)}return u}var XC=R9e;function fP(){this._cache={}}fP.prototype.fromColor=function(e,t){return qN(void 0,void 0,e,t,this._cache)};fP.prototype.fromUrl=function(e,t,n){return qN(e,void 0,t,n,this._cache)};fP.prototype.fromMakiIconId=function(e,t,n){return qN($t(`Assets/Textures/maki/${encodeURIComponent(e)}.png`),void 0,t,n,this._cache)};fP.prototype.fromText=function(e,t,n){return qN(void 0,e,t,n,this._cache)};var O9e=new U;function M9e(e,t,n){e.save(),e.scale(n/24,n/24),e.fillStyle=t.toCssColorString(),e.strokeStyle=t.brighten(.6,O9e).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 che(e,t,n){let i=n/2.5,r=i,o=i;t.width>t.height?o=i*(t.height/t.width):t.width<t.height&&(r=i*(t.width/t.height));let a=Math.round((n-r)/2),s=Math.round(7/24*n-o/2);e.globalCompositeOperation="destination-out",e.drawImage(t,a-1,s,r,o),e.drawImage(t,a,s-1,r,o),e.drawImage(t,a+1,s,r,o),e.drawImage(t,a,s+1,r,o),e.globalCompositeOperation="destination-over",e.fillStyle=U.BLACK.toCssColorString(),e.fillRect(a-1,s-1,r+2,o+2),e.globalCompositeOperation="destination-out",e.drawImage(t,a,s,r,o),e.globalCompositeOperation="destination-over",e.fillStyle=U.WHITE.toCssColorString(),e.fillRect(a-1,s-2,r+2,o+2)}var uP=new Array(4);function qN(e,t,n,i,r){uP[0]=e,uP[1]=t,uP[2]=n,uP[3]=i;let o=JSON.stringify(uP),a=r[o];if(l(a))return a;let s=document.createElement("canvas");s.width=i,s.height=i;let c=s.getContext("2d");if(M9e(c,n,i),l(e)){let f=De.createIfNeeded(e).fetchImage().then(function(d){return che(c,d,i),r[o]=s,s});return r[o]=f,f}else if(l(t)){let u=XC(t,{font:`bold ${i}px sans-serif`});che(c,u,i)}return r[o]=s,s}var k_=fP;function KC(e){e=e??H.EMPTY_OBJECT;let t=e.vertexFormat??Be.DEFAULT;this._vertexFormat=t,this._workerName="createPlaneGeometry"}KC.packedLength=Be.packedLength;KC.pack=function(e,t,n){return n=n??0,Be.pack(e._vertexFormat,t,n),t};var lhe=new Be,L9e={vertexFormat:lhe};KC.unpack=function(e,t,n){t=t??0;let i=Be.unpack(e,t,lhe);return l(n)?(n._vertexFormat=Be.clone(i,n._vertexFormat),n):new KC(L9e)};var YN=new h(-.5,-.5,0),XN=new h(.5,.5,0);KC.createGeometry=function(e){let t=e._vertexFormat,n=new xn,i,r;if(t.position){if(r=new Float64Array(12),r[0]=YN.x,r[1]=YN.y,r[2]=0,r[3]=XN.x,r[4]=YN.y,r[5]=0,r[6]=XN.x,r[7]=XN.y,r[8]=0,r[9]=YN.x,r[10]=XN.y,r[11]=0,n.position=new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:r}),t.normal){let o=new Float32Array(12);o[0]=0,o[1]=0,o[2]=1,o[3]=0,o[4]=0,o[5]=1,o[6]=0,o[7]=0,o[8]=1,o[9]=0,o[10]=0,o[11]=1,n.normal=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:o})}if(t.st){let o=new Float32Array(8);o[0]=0,o[1]=0,o[2]=1,o[3]=0,o[4]=1,o[5]=1,o[6]=0,o[7]=1,n.st=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:o})}if(t.tangent){let o=new Float32Array(12);o[0]=1,o[1]=0,o[2]=0,o[3]=1,o[4]=0,o[5]=0,o[6]=1,o[7]=0,o[8]=0,o[9]=1,o[10]=0,o[11]=0,n.tangent=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:o})}if(t.bitangent){let o=new Float32Array(12);o[0]=0,o[1]=1,o[2]=0,o[3]=0,o[4]=1,o[5]=0,o[6]=0,o[7]=1,o[8]=0,o[9]=0,o[10]=1,o[11]=0,n.bitangent=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:o})}i=new Uint16Array(6),i[0]=0,i[1]=1,i[2]=2,i[3]=0,i[4]=2,i[5]=3}return new Tt({attributes:n,indices:i,primitiveType:Re.TRIANGLES,boundingSphere:new se(h.ZERO,Math.sqrt(2))})};var KN=KC;function $C(){this._workerName="createPlaneOutlineGeometry"}$C.packedLength=0;$C.pack=function(e,t){return t};$C.unpack=function(e,t,n){return l(n)?n:new $C};var z_=new h(-.5,-.5,0),$N=new h(.5,.5,0);$C.createGeometry=function(){let e=new xn,t=new Uint16Array(8),n=new Float64Array(12);return n[0]=z_.x,n[1]=z_.y,n[2]=z_.z,n[3]=$N.x,n[4]=z_.y,n[5]=z_.z,n[6]=$N.x,n[7]=$N.y,n[8]=z_.z,n[9]=z_.x,n[10]=$N.y,n[11]=z_.z,e.position=new Me({componentDatatype:Y.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 Tt({attributes:e,indices:t,primitiveType:Re.LINES,boundingSphere:new se(h.ZERO,Math.sqrt(2))})};var JN=$C;function ta(e,t){this.position=e,l(this.position)||(this.position=new k),this.tangentPlane=t,l(this.tangentPlane)||(this.tangentPlane=ta.NORTH_POLE_TANGENT_PLANE)}Object.defineProperties(ta.prototype,{ellipsoid:{get:function(){return this.tangentPlane.ellipsoid}},x:{get:function(){return this.position.x}},y:{get:function(){return this.position.y}},conformalLatitude:{get:function(){let e=k.magnitude(this.position),t=2*this.ellipsoid.maximumRadius;return this.tangentPlane.plane.normal.z*(I.PI_OVER_TWO-2*Math.atan2(e,t))}},longitude:{get:function(){let e=I.PI_OVER_TWO+Math.atan2(this.y,this.x);return e>Math.PI&&(e-=I.TWO_PI),e}}});var JC=new de,N9e=new h;ta.prototype.getLatitude=function(e){l(e)||(e=te.default),JC.latitude=this.conformalLatitude,JC.longitude=this.longitude,JC.height=0;let t=this.ellipsoid.cartographicToCartesian(JC,N9e);return e.cartesianToCartographic(t,JC),JC.latitude};var F9e=new hn,B9e=new h,k9e=new h;ta.fromCartesian=function(e,t){let n=I.signNotZero(e.z),i=ta.NORTH_POLE_TANGENT_PLANE,r=ta.SOUTH_POLE;n<0&&(i=ta.SOUTH_POLE_TANGENT_PLANE,r=ta.NORTH_POLE);let o=F9e;o.origin=i.ellipsoid.scaleToGeocentricSurface(e,o.origin),o.direction=h.subtract(o.origin,r,B9e),h.normalize(o.direction,o.direction);let a=ci.rayPlane(o,i.plane,k9e),s=h.subtract(a,r,a),c=h.dot(i.xAxis,s),u=n*h.dot(i.yAxis,s);return l(t)?(t.position=new k(c,u),t.tangentPlane=i,t):new ta(new k(c,u),i)};ta.fromCartesianArray=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;i++)t[i]=ta.fromCartesian(e[i],t[i]);return t};ta.clone=function(e,t){if(l(e))return l(t)?(t.position=e.position,t.tangentPlane=e.tangentPlane,t):new ta(e.position,e.tangentPlane)};ta.HALF_UNIT_SPHERE=Object.freeze(new te(.5,.5,.5));ta.NORTH_POLE=Object.freeze(new h(0,0,.5));ta.SOUTH_POLE=Object.freeze(new h(0,0,-.5));ta.NORTH_POLE_TANGENT_PLANE=Object.freeze(new Fa(ta.NORTH_POLE,ta.HALF_UNIT_SPHERE));ta.SOUTH_POLE_TANGENT_PLANE=Object.freeze(new Fa(ta.SOUTH_POLE,ta.HALF_UNIT_SPHERE));var xl=ta;var z9e=new de,uhe=new de;function U9e(e,t,n,i){let o=i.cartesianToCartographic(e,z9e).height,a=i.cartesianToCartographic(t,uhe);a.height=o,i.cartographicToCartesian(a,t);let s=i.cartesianToCartographic(n,uhe);s.height=o-100,i.cartographicToCartesian(s,n)}var fhe=new Je,V9e=new h,j9e=new h,H9e=new h,G9e=new h,W9e=new h,q9e=new h,ZN=new h,$m=new h,ZC=new h,Y9e=new k,X9e=new k,K9e=new h,dhe=new Fe,$9e=new $,J9e=new $;function GX(e){let t=e.vertexFormat,n=e.geometry,i=e.shadowVolume,r=n.attributes.position.values,o=l(n.attributes.st)?n.attributes.st.values:void 0,a=r.length,s=e.wall,c=e.top||s,u=e.bottom||s;if(t.st||t.normal||t.tangent||t.bitangent||i){let f=e.boundingRectangle,d=e.rotationAxis,p=e.projectTo2d,g=e.ellipsoid,m=e.stRotation,y=e.perPositionHeight,A=Y9e;A.x=f.x,A.y=f.y;let b=t.st?new Float32Array(2*(a/3)):void 0,x;t.normal&&(y&&c&&!s?x=n.attributes.normal.values:x=new Float32Array(a));let T=t.tangent?new Float32Array(a):void 0,C=t.bitangent?new Float32Array(a):void 0,E=i?new Float32Array(a):void 0,w=0,D=0,R=j9e,M=H9e,N=G9e,_=!0,v=$9e,S=J9e;if(m!==0){let F=Fe.fromAxisAngle(d,m,dhe);v=$.fromQuaternion(F,v),F=Fe.fromAxisAngle(d,-m,dhe),S=$.fromQuaternion(F,S)}else v=$.clone($.IDENTITY,v),S=$.clone($.IDENTITY,S);let P=0,L=0;c&&u&&(P=a/2,L=a/3,a/=2);for(let F=0;F<a;F+=3){let V=h.fromArray(r,F,K9e);if(t.st&&!l(o)){let z=$.multiplyByVector(v,V,V9e);z=g.scaleToGeodeticSurface(z,z);let j=p([z],X9e)[0];k.subtract(j,A,j);let B=I.clamp(j.x/f.width,0,1),G=I.clamp(j.y/f.height,0,1);u&&(b[w+L]=B,b[w+1+L]=G),c&&(b[w]=B,b[w+1]=G),w+=2}if(t.normal||t.tangent||t.bitangent||i){let z=D+1,j=D+2;if(s){if(F+3<a){let B=h.fromArray(r,F+3,W9e);if(_){let G=h.fromArray(r,F+a,q9e);y&&U9e(V,B,G,g),h.subtract(B,V,B),h.subtract(G,V,G),R=h.normalize(h.cross(G,B,R),R),_=!1}h.equalsEpsilon(B,V,I.EPSILON10)&&(_=!0)}(t.tangent||t.bitangent)&&(N=g.geodeticSurfaceNormal(V,N),t.tangent&&(M=h.normalize(h.cross(N,R,M),M)))}else R=g.geodeticSurfaceNormal(V,R),(t.tangent||t.bitangent)&&(y&&(ZN=h.fromArray(x,D,ZN),$m=h.cross(h.UNIT_Z,ZN,$m),$m=h.normalize($.multiplyByVector(S,$m,$m),$m),t.bitangent&&(ZC=h.normalize(h.cross(ZN,$m,ZC),ZC))),M=h.cross(h.UNIT_Z,R,M),M=h.normalize($.multiplyByVector(S,M,M),M),t.bitangent&&(N=h.normalize(h.cross(R,M,N),N)));t.normal&&(e.wall?(x[D+P]=R.x,x[z+P]=R.y,x[j+P]=R.z):u&&(x[D+P]=-R.x,x[z+P]=-R.y,x[j+P]=-R.z),(c&&!y||s)&&(x[D]=R.x,x[z]=R.y,x[j]=R.z)),i&&(s&&(R=g.geodeticSurfaceNormal(V,R)),E[D+P]=-R.x,E[z+P]=-R.y,E[j+P]=-R.z),t.tangent&&(e.wall?(T[D+P]=M.x,T[z+P]=M.y,T[j+P]=M.z):u&&(T[D+P]=-M.x,T[z+P]=-M.y,T[j+P]=-M.z),c&&(y?(T[D]=$m.x,T[z]=$m.y,T[j]=$m.z):(T[D]=M.x,T[z]=M.y,T[j]=M.z))),t.bitangent&&(u&&(C[D+P]=N.x,C[z+P]=N.y,C[j+P]=N.z),c&&(y?(C[D]=ZC.x,C[z]=ZC.y,C[j]=ZC.z):(C[D]=N.x,C[z]=N.y,C[j]=N.z))),D+=3}}t.st&&!l(o)&&(n.attributes.st=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:b})),t.normal&&(n.attributes.normal=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:x})),t.tangent&&(n.attributes.tangent=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:T})),t.bitangent&&(n.attributes.bitangent=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:C})),i&&(n.attributes.extrudeDirection=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:E}))}if(e.extrude&&l(e.offsetAttribute)){let f=r.length/3,d=new Uint8Array(f);if(e.offsetAttribute===mn.TOP)c&&u||s?d=d.fill(1,0,f/2):c&&(d=d.fill(1));else{let p=e.offsetAttribute===mn.NONE?0:1;d=d.fill(p)}n.attributes.applyOffset=new Me({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}return n}var hhe=[];function Z9e(e,t,n,i,r,o,a,s,c,u){let f={walls:[]},d;if(a||s){let x=$n.createGeometryFromPositions(e,t,n,i,o,c,u),T=x.attributes.position.values,C=x.indices,E,w;if(a&&s){let D=T.concat(T);E=D.length/3,w=Ve.createTypedArray(E,C.length*2),w.set(C);let R=C.length,M=E/2;for(d=0;d<R;d+=3){let N=w[d]+M,_=w[d+1]+M,v=w[d+2]+M;w[d+R]=v,w[d+1+R]=_,w[d+2+R]=N}if(x.attributes.position.values=D,o&&c.normal){let N=x.attributes.normal.values;x.attributes.normal.values=new Float32Array(D.length),x.attributes.normal.values.set(N)}if(c.st&&l(n)){let N=x.attributes.st.values;x.attributes.st.values=new Float32Array(E*2),x.attributes.st.values=N.concat(N)}x.indices=w}else if(s){for(E=T.length/3,w=Ve.createTypedArray(E,C.length),d=0;d<C.length;d+=3)w[d]=C[d+2],w[d+1]=C[d+1],w[d+2]=C[d];x.indices=w}f.topAndBottom=new Bt({geometry:x})}let p=r.outerRing,g=Fa.fromPoints(p,e),m=g.projectPointsOntoPlane(p,hhe),y=li.computeWindingOrder2D(m);y===ns.CLOCKWISE&&(p=p.slice().reverse());let A=$n.computeWallGeometry(p,n,e,i,o,u);f.walls.push(new Bt({geometry:A}));let b=r.holes;for(d=0;d<b.length;d++){let x=b[d];m=g.projectPointsOntoPlane(x,hhe),y=li.computeWindingOrder2D(m),y===ns.COUNTER_CLOCKWISE&&(x=x.slice().reverse()),A=$n.computeWallGeometry(x,n,e,i,o,u),f.walls.push(new Bt({geometry:A}))}return f}function id(e){let t=e.polygonHierarchy,n=e.vertexFormat??Be.DEFAULT,i=e.ellipsoid??te.default,r=e.granularity??I.RADIANS_PER_DEGREE,o=e.stRotation??0,a=e.textureCoordinates,s=e.perPositionHeight??!1,c=s&&l(e.extrudedHeight),u=e.height??0,f=e.extrudedHeight??u;if(!c){let d=Math.max(u,f);f=Math.min(u,f),u=d}this._vertexFormat=Be.clone(n),this._ellipsoid=te.clone(i),this._granularity=r,this._stRotation=o,this._height=u,this._extrudedHeight=f,this._closeTop=e.closeTop??!0,this._closeBottom=e.closeBottom??!0,this._polygonHierarchy=t,this._perPositionHeight=s,this._perPositionHeightExtrude=c,this._shadowVolume=e.shadowVolume??!1,this._workerName="createPolygonGeometry",this._offsetAttribute=e.offsetAttribute,this._arcType=e.arcType??sn.GEODESIC,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0,this._textureCoordinates=a,this.packedLength=$n.computeHierarchyPackedLength(t,h)+te.packedLength+Be.packedLength+(a?$n.computeHierarchyPackedLength(a,k):1)+12}id.fromPositions=function(e){e=e??H.EMPTY_OBJECT;let t={polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,closeTop:e.closeTop,closeBottom:e.closeBottom,offsetAttribute:e.offsetAttribute,arcType:e.arcType,textureCoordinates:e.textureCoordinates};return new id(t)};id.pack=function(e,t,n){return n=n??0,n=$n.packPolygonHierarchy(e._polygonHierarchy,t,n,h),te.pack(e._ellipsoid,t,n),n+=te.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._granularity,t[n++]=e._stRotation,t[n++]=e._perPositionHeightExtrude?1:0,t[n++]=e._perPositionHeight?1:0,t[n++]=e._closeTop?1:0,t[n++]=e._closeBottom?1:0,t[n++]=e._shadowVolume?1:0,t[n++]=e._offsetAttribute??-1,t[n++]=e._arcType,l(e._textureCoordinates)?n=$n.packPolygonHierarchy(e._textureCoordinates,t,n,k):t[n++]=-1,t[n]=e.packedLength,t};var Q9e=te.clone(te.UNIT_SPHERE),e7e=new Be,t7e={polygonHierarchy:{}};id.unpack=function(e,t,n){t=t??0;let i=$n.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let r=te.unpack(e,t,Q9e);t+=te.packedLength;let o=Be.unpack(e,t,e7e);t+=Be.packedLength;let a=e[t++],s=e[t++],c=e[t++],u=e[t++],f=e[t++]===1,d=e[t++]===1,p=e[t++]===1,g=e[t++]===1,m=e[t++]===1,y=e[t++],A=e[t++],b=e[t]===-1?void 0:$n.unpackPolygonHierarchy(e,t,k);l(b)?(t=b.startingIndex,delete b.startingIndex):t++;let x=e[t];return l(n)||(n=new id(t7e)),n._polygonHierarchy=i,n._ellipsoid=te.clone(r,n._ellipsoid),n._vertexFormat=Be.clone(o,n._vertexFormat),n._height=a,n._extrudedHeight=s,n._granularity=c,n._stRotation=u,n._perPositionHeightExtrude=f,n._perPositionHeight=d,n._closeTop=p,n._closeBottom=g,n._shadowVolume=m,n._offsetAttribute=y===-1?void 0:y,n._arcType=A,n._textureCoordinates=b,n.packedLength=x,n};var n7e=new k,i7e=new k,r7e=new xl;function mhe(e,t,n,i,r,o){let a=e.longitude,s=a>=0?a:a+I.TWO_PI;r.westOverIdl=Math.min(r.westOverIdl,s),r.eastOverIdl=Math.max(r.eastOverIdl,s),o.west=Math.min(o.west,a),o.east=Math.max(o.east,a);let c=e.getLatitude(n),u=c;if(o.south=Math.min(o.south,c),o.north=Math.max(o.north,c),i!==sn.RHUMB){let p=k.subtract(t.position,e.position,n7e),g=k.dot(t.position,p)/k.dot(p,p);if(g>0&&g<1){let m=k.add(t.position,k.multiplyByScalar(p,-g,p),i7e),y=xl.clone(t,r7e);y.position=m;let A=y.getLatitude(n);o.south=Math.min(o.south,A),o.north=Math.max(o.north,A),Math.abs(c)>Math.abs(A)&&(u=A)}}let f=t.x*e.y-e.x*t.y,d=Math.sign(f);d!==0&&(d*=k.angleBetween(t.position,e.position)),u>=0&&(r.northAngle+=d),u<=0&&(r.southAngle+=d)}var phe=new xl,o7e=new xl,nd={northAngle:0,southAngle:0,westOverIdl:0,eastOverIdl:0};id.computeRectangleFromPositions=function(e,t,n,i){if(l(i)||(i=new ie),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,nd.northAngle=0,nd.southAngle=0,nd.westOverIdl=Number.POSITIVE_INFINITY,nd.eastOverIdl=Number.NEGATIVE_INFINITY;let r=e.length,o=xl.fromCartesian(e[0],o7e);for(let a=1;a<r;a++){let s=xl.fromCartesian(e[a],phe);mhe(s,o,t,n,nd,i),o=xl.clone(s,o)}return mhe(xl.fromCartesian(e[0],phe),o,t,n,nd,i),i.east-i.west>nd.eastOverIdl-nd.westOverIdl&&(i.west=nd.westOverIdl,i.east=nd.eastOverIdl,i.east>I.PI&&(i.east=i.east-I.TWO_PI),i.west>I.PI&&(i.west=i.west-I.TWO_PI)),I.equalsEpsilon(Math.abs(nd.northAngle),I.TWO_PI,I.EPSILON10)&&(i.north=I.PI_OVER_TWO,i.east=I.PI,i.west=-I.PI),I.equalsEpsilon(Math.abs(nd.southAngle),I.TWO_PI,I.EPSILON10)&&(i.south=-I.PI_OVER_TWO,i.east=I.PI,i.west=-I.PI),i};var a7e=new xl;function s7e(e,t,n){return e.height>=I.PI||e.width>=I.PI?xl.fromCartesian(t[0],a7e).tangentPlane:Fa.fromPoints(t,n)}var ghe=new de;function c7e(e,t,n){return(i,r)=>{if(e.height>=I.PI||e.width>=I.PI){if(e.south<0&&e.north>0){l(r)||(r=[]);for(let a=0;a<i.length;++a){let s=n.cartesianToCartographic(i[a],ghe);r[a]=new k(s.longitude/I.PI,s.latitude/I.PI_OVER_TWO)}return r.length=i.length,r}return xl.fromCartesianArray(i,r)}return Fa.fromPoints(t,n).projectPointsOntoPlane(i,r)}}function l7e(e,t,n){if(e.height>=I.PI||e.width>=I.PI)return(r,o)=>{if(e.south<0&&e.north>0){let a=n.cartesianToCartographic(r,ghe);return l(o)||(o=new k),o.x=a.longitude/I.PI,o.y=a.latitude/I.PI_OVER_TWO,o}return xl.fromCartesian(r,o)};let i=Fa.fromPoints(t,n);return(r,o)=>i.projectPointsOntoPlane(r,o)}function u7e(e,t,n,i){return(r,o)=>!i&&(e.height>=I.PI_OVER_TWO||e.width>=2*I.PI_OVER_THREE)?$n.splitPolygonsOnEquator(r,t,n,o):r}function f7e(e,t,n,i){if(t.height>=I.PI||t.width>=I.PI)return Je.fromRectangle(t,void 0,fhe);let r=e,o=Fa.fromPoints(r,n);return $n.computeBoundingRectangle(o.plane.normal,o.projectPointOntoPlane.bind(o),r,i,fhe)}id.createGeometry=function(e){let t=e._vertexFormat,n=e._ellipsoid,i=e._granularity,r=e._stRotation,o=e._polygonHierarchy,a=e._perPositionHeight,s=e._closeTop,c=e._closeBottom,u=e._arcType,f=e._textureCoordinates,d=l(f),p=o.positions;if(p.length<3)return;let g=e.rectangle,m=$n.polygonsFromHierarchy(o,d,c7e(g,p,n),!a,n,u7e(g,n,u,a)),y=m.hierarchy,A=m.polygons,b=function(P){return P},x=d?$n.polygonsFromHierarchy(f,!0,b,!1,n).polygons:void 0;if(y.length===0)return;let T=y[0].outerRing,C=f7e(T,g,n,r),E=[],w=e._height,D=e._extrudedHeight,R=e._perPositionHeightExtrude||!I.equalsEpsilon(w,D,0,I.EPSILON2),M={perPositionHeight:a,vertexFormat:t,geometry:void 0,rotationAxis:s7e(g,T,n).plane.normal,projectTo2d:l7e(g,T,n),boundingRectangle:C,ellipsoid:n,stRotation:r,textureCoordinates:void 0,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:u},N;if(R)for(M.extrude=!0,M.top=s,M.bottom=c,M.shadowVolume=e._shadowVolume,M.offsetAttribute=e._offsetAttribute,N=0;N<A.length;N++){let P=Z9e(n,A[N],d?x[N]:void 0,i,y[N],a,s,c,t,u),L;s&&c?(L=P.topAndBottom,M.geometry=$n.scaleToGeodeticHeightExtruded(L.geometry,w,D,n,a)):s?(L=P.topAndBottom,L.geometry.attributes.position.values=li.scaleToGeodeticHeight(L.geometry.attributes.position.values,w,n,!a),M.geometry=L.geometry):c&&(L=P.topAndBottom,L.geometry.attributes.position.values=li.scaleToGeodeticHeight(L.geometry.attributes.position.values,D,n,!0),M.geometry=L.geometry),(s||c)&&(M.wall=!1,L.geometry=GX(M),E.push(L));let F=P.walls;M.wall=!0;for(let V=0;V<F.length;V++){let z=F[V];M.geometry=$n.scaleToGeodeticHeightExtruded(z.geometry,w,D,n,a),z.geometry=GX(M),E.push(z)}}else for(N=0;N<A.length;N++){let P=new Bt({geometry:$n.createGeometryFromPositions(n,A[N],d?x[N]:void 0,i,a,t,u)});if(P.geometry.attributes.position.values=li.scaleToGeodeticHeight(P.geometry.attributes.position.values,w,n,!a),M.geometry=P.geometry,P.geometry=GX(M),l(e._offsetAttribute)){let L=P.geometry.attributes.position.values.length,F=e._offsetAttribute===mn.NONE?0:1,V=new Uint8Array(L/3).fill(F);P.geometry.attributes.applyOffset=new Me({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:V})}E.push(P)}let _=Gn.combineInstances(E)[0];_.attributes.position.values=new Float64Array(_.attributes.position.values),_.indices=Ve.createTypedArray(_.attributes.position.values.length/3,_.indices);let v=_.attributes,S=se.fromVertices(v.position.values);return t.position||delete v.position,new Tt({attributes:v,indices:_.indices,primitiveType:_.primitiveType,boundingSphere:S,offsetAttribute:e._offsetAttribute})};id.createShadowVolume=function(e,t,n){let i=e._granularity,r=e._ellipsoid,o=t(i,r),a=n(i,r);return new id({polygonHierarchy:e._polygonHierarchy,ellipsoid:r,stRotation:e._stRotation,granularity:i,perPositionHeight:!1,extrudedHeight:o,height:a,vertexFormat:Be.POSITION_ONLY,shadowVolume:!0,arcType:e._arcType})};function d7e(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let n=e._ellipsoid,i=e._polygonHierarchy.positions,r=e.rectangle;return Tt._textureCoordinateRotationPoints(i,t,n,r)}Object.defineProperties(id.prototype,{rectangle:{get:function(){if(!l(this._rectangle)){let e=this._polygonHierarchy.positions;this._rectangle=id.computeRectangleFromPositions(e,this._ellipsoid,this._arcType)}return this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=d7e(this)),this._textureCoordinateRotationPoints}}});var U_=id;var _he=[],QN=[];function h7e(e,t,n,i,r){let a=Fa.fromPoints(t,e).projectPointsOntoPlane(t,_he);li.computeWindingOrder2D(a)===ns.CLOCKWISE&&(a.reverse(),t=t.slice().reverse());let c,u,f=t.length,d=0;if(i)for(c=new Float64Array(f*2*3),u=0;u<f;u++){let m=t[u],y=t[(u+1)%f];c[d++]=m.x,c[d++]=m.y,c[d++]=m.z,c[d++]=y.x,c[d++]=y.y,c[d++]=y.z}else{let m=0;if(r===sn.GEODESIC)for(u=0;u<f;u++)m+=$n.subdivideLineCount(t[u],t[(u+1)%f],n);else if(r===sn.RHUMB)for(u=0;u<f;u++)m+=$n.subdivideRhumbLineCount(e,t[u],t[(u+1)%f],n);for(c=new Float64Array(m*3),u=0;u<f;u++){let y;r===sn.GEODESIC?y=$n.subdivideLine(t[u],t[(u+1)%f],n,QN):r===sn.RHUMB&&(y=$n.subdivideRhumbLine(e,t[u],t[(u+1)%f],n,QN));let A=y.length;for(let b=0;b<A;++b)c[d++]=y[b]}}f=c.length/3;let p=f*2,g=Ve.createTypedArray(f,p);for(d=0,u=0;u<f-1;u++)g[d++]=u,g[d++]=u+1;return g[d++]=f-1,g[d]=0,new Bt({geometry:new Tt({attributes:new xn({position:new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:c})}),indices:g,primitiveType:Re.LINES})})}function m7e(e,t,n,i,r){let a=Fa.fromPoints(t,e).projectPointsOntoPlane(t,_he);li.computeWindingOrder2D(a)===ns.CLOCKWISE&&(a.reverse(),t=t.slice().reverse());let c,u,f=t.length,d=new Array(f),p=0;if(i)for(c=new Float64Array(f*2*3*2),u=0;u<f;++u){d[u]=p/3;let A=t[u],b=t[(u+1)%f];c[p++]=A.x,c[p++]=A.y,c[p++]=A.z,c[p++]=b.x,c[p++]=b.y,c[p++]=b.z}else{let A=0;if(r===sn.GEODESIC)for(u=0;u<f;u++)A+=$n.subdivideLineCount(t[u],t[(u+1)%f],n);else if(r===sn.RHUMB)for(u=0;u<f;u++)A+=$n.subdivideRhumbLineCount(e,t[u],t[(u+1)%f],n);for(c=new Float64Array(A*3*2),u=0;u<f;++u){d[u]=p/3;let b;r===sn.GEODESIC?b=$n.subdivideLine(t[u],t[(u+1)%f],n,QN):r===sn.RHUMB&&(b=$n.subdivideRhumbLine(e,t[u],t[(u+1)%f],n,QN));let x=b.length;for(let T=0;T<x;++T)c[p++]=b[T]}}f=c.length/6;let g=d.length,m=(f*2+g)*2,y=Ve.createTypedArray(f+g,m);for(p=0,u=0;u<f;++u)y[p++]=u,y[p++]=(u+1)%f,y[p++]=u+f,y[p++]=(u+1)%f+f;for(u=0;u<g;u++){let A=d[u];y[p++]=A,y[p++]=A+f}return new Bt({geometry:new Tt({attributes:new xn({position:new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:c})}),indices:y,primitiveType:Re.LINES})})}function xb(e){let t=e.polygonHierarchy,n=e.ellipsoid??te.default,i=e.granularity??I.RADIANS_PER_DEGREE,r=e.perPositionHeight??!1,o=r&&l(e.extrudedHeight),a=e.arcType??sn.GEODESIC,s=e.height??0,c=e.extrudedHeight??s;if(!o){let u=Math.max(s,c);c=Math.min(s,c),s=u}this._ellipsoid=te.clone(n),this._granularity=i,this._height=s,this._extrudedHeight=c,this._arcType=a,this._polygonHierarchy=t,this._perPositionHeight=r,this._perPositionHeightExtrude=o,this._offsetAttribute=e.offsetAttribute,this._workerName="createPolygonOutlineGeometry",this.packedLength=$n.computeHierarchyPackedLength(t,h)+te.packedLength+8}xb.pack=function(e,t,n){return n=n??0,n=$n.packPolygonHierarchy(e._polygonHierarchy,t,n,h),te.pack(e._ellipsoid,t,n),n+=te.packedLength,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._granularity,t[n++]=e._perPositionHeightExtrude?1:0,t[n++]=e._perPositionHeight?1:0,t[n++]=e._arcType,t[n++]=e._offsetAttribute??-1,t[n]=e.packedLength,t};var p7e=te.clone(te.UNIT_SPHERE),g7e={polygonHierarchy:{}};xb.unpack=function(e,t,n){t=t??0;let i=$n.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let r=te.unpack(e,t,p7e);t+=te.packedLength;let o=e[t++],a=e[t++],s=e[t++],c=e[t++]===1,u=e[t++]===1,f=e[t++],d=e[t++],p=e[t];return l(n)||(n=new xb(g7e)),n._polygonHierarchy=i,n._ellipsoid=te.clone(r,n._ellipsoid),n._height=o,n._extrudedHeight=a,n._granularity=s,n._perPositionHeight=u,n._perPositionHeightExtrude=c,n._arcType=f,n._offsetAttribute=d===-1?void 0:d,n.packedLength=p,n};xb.fromPositions=function(e){e=e??H.EMPTY_OBJECT;let t={polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,arcType:e.arcType,offsetAttribute:e.offsetAttribute};return new xb(t)};xb.createGeometry=function(e){let t=e._ellipsoid,n=e._granularity,i=e._polygonHierarchy,r=e._perPositionHeight,o=e._arcType,a=$n.polygonOutlinesFromHierarchy(i,!r,t);if(a.length===0)return;let s,c=[],u=I.chordLength(n,t.maximumRadius),f=e._height,d=e._extrudedHeight,p=e._perPositionHeightExtrude||!I.equalsEpsilon(f,d,0,I.EPSILON2),g,m;if(p)for(m=0;m<a.length;m++){if(s=m7e(t,a[m],u,r,o),s.geometry=$n.scaleToGeodeticHeightExtruded(s.geometry,f,d,t,r),l(e._offsetAttribute)){let b=s.geometry.attributes.position.values.length/3,x=new Uint8Array(b);e._offsetAttribute===mn.TOP?x=x.fill(1,0,b/2):(g=e._offsetAttribute===mn.NONE?0:1,x=x.fill(g)),s.geometry.attributes.applyOffset=new Me({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:x})}c.push(s)}else for(m=0;m<a.length;m++){if(s=h7e(t,a[m],u,r,o),s.geometry.attributes.position.values=li.scaleToGeodeticHeight(s.geometry.attributes.position.values,f,t,!r),l(e._offsetAttribute)){let b=s.geometry.attributes.position.values.length;g=e._offsetAttribute===mn.NONE?0:1;let x=new Uint8Array(b/3).fill(g);s.geometry.attributes.applyOffset=new Me({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:x})}c.push(s)}let y=Gn.combineInstances(c)[0],A=se.fromVertices(y.attributes.position.values);return new Tt({attributes:y.attributes,indices:y.indices,primitiveType:y.primitiveType,boundingSphere:A,offsetAttribute:e._offsetAttribute})};var eF=xb;var The=[];function _7e(e,t,n,i,r){let o=The;o.length=r;let a,s=n.red,c=n.green,u=n.blue,f=n.alpha,d=i.red,p=i.green,g=i.blue,m=i.alpha;if(U.equals(n,i)){for(a=0;a<r;a++)o[a]=U.clone(n);return o}let y=(d-s)/r,A=(p-c)/r,b=(g-u)/r,x=(m-f)/r;for(a=0;a<r;a++)o[a]=new U(s+a*y,c+a*A,u+a*b,f+a*x);return o}function dP(e){e=e??H.EMPTY_OBJECT;let t=e.positions,n=e.colors,i=e.width??1,r=e.colorsPerVertex??!1;this._positions=t,this._colors=n,this._width=i,this._colorsPerVertex=r,this._vertexFormat=Be.clone(e.vertexFormat??Be.DEFAULT),this._arcType=e.arcType??sn.GEODESIC,this._granularity=e.granularity??I.RADIANS_PER_DEGREE,this._ellipsoid=te.clone(e.ellipsoid??te.default),this._workerName="createPolylineGeometry";let o=1+t.length*h.packedLength;o+=l(n)?1+n.length*U.packedLength:1,this.packedLength=o+te.packedLength+Be.packedLength+4}dP.pack=function(e,t,n){n=n??0;let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=h.packedLength)h.pack(r[i],t,n);let a=e._colors;for(o=l(a)?a.length:0,t[n++]=o,i=0;i<o;++i,n+=U.packedLength)U.pack(a[i],t,n);return te.pack(e._ellipsoid,t,n),n+=te.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n++]=e._width,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};var Che=te.clone(te.UNIT_SPHERE),vhe=new Be,Tb={positions:void 0,colors:void 0,ellipsoid:Che,vertexFormat:vhe,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};dP.unpack=function(e,t,n){t=t??0;let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=h.packedLength)o[i]=h.unpack(e,t);r=e[t++];let a=r>0?new Array(r):void 0;for(i=0;i<r;++i,t+=U.packedLength)a[i]=U.unpack(e,t);let s=te.unpack(e,t,Che);t+=te.packedLength;let c=Be.unpack(e,t,vhe);t+=Be.packedLength;let u=e[t++],f=e[t++]===1,d=e[t++],p=e[t];return l(n)?(n._positions=o,n._colors=a,n._ellipsoid=te.clone(s,n._ellipsoid),n._vertexFormat=Be.clone(c,n._vertexFormat),n._width=u,n._colorsPerVertex=f,n._arcType=d,n._granularity=p,n):(Tb.positions=o,Tb.colors=a,Tb.width=u,Tb.colorsPerVertex=f,Tb.arcType=d,Tb.granularity=p,new dP(Tb))};var yhe=new h,Ahe=new h,bhe=new h,xhe=new h;dP.createGeometry=function(e){let t=e._width,n=e._vertexFormat,i=e._colors,r=e._colorsPerVertex,o=e._arcType,a=e._granularity,s=e._ellipsoid,c,u,f,d=[],p=Pr(e._positions,h.equalsEpsilon,!1,d);if(l(i)&&d.length>0){let L=0,F=d[0];i=i.filter(function(V,z){let j;return r?j=z===F||z===0&&F===1:j=z+1===F,j?(L++,F=d[L],!1):!0})}let g=p.length;if(g<2||t<=0)return;if(o===sn.GEODESIC||o===sn.RHUMB){let L,F;o===sn.GEODESIC?(L=I.chordLength(a,s.maximumRadius),F=nr.numberOfPoints):(L=a,F=nr.numberOfPointsRhumbLine);let V=nr.extractHeights(p,s);if(l(i)){let z=1;for(c=0;c<g-1;++c)z+=F(p[c],p[c+1],L);let j=new Array(z),B=0;for(c=0;c<g-1;++c){let G=p[c],W=p[c+1],Q=i[c],q=F(G,W,L);if(r&&c<z){let J=i[c+1],Z=_7e(G,W,Q,J,q),ce=Z.length;for(u=0;u<ce;++u)j[B++]=Z[u]}else for(u=0;u<q;++u)j[B++]=U.clone(Q)}j[B]=U.clone(i[i.length-1]),i=j,The.length=0}o===sn.GEODESIC?p=nr.generateCartesianArc({positions:p,minDistance:L,ellipsoid:s,height:V}):p=nr.generateCartesianRhumbArc({positions:p,granularity:L,ellipsoid:s,height:V})}g=p.length;let m=g*4-4,y=new Float64Array(m*3),A=new Float64Array(m*3),b=new Float64Array(m*3),x=new Float32Array(m*2),T=n.st?new Float32Array(m*2):void 0,C=l(i)?new Uint8Array(m*4):void 0,E=0,w=0,D=0,R=0,M;for(u=0;u<g;++u){u===0?(M=yhe,h.subtract(p[0],p[1],M),h.add(p[0],M,M)):M=p[u-1],h.clone(M,bhe),h.clone(p[u],Ahe),u===g-1?(M=yhe,h.subtract(p[g-1],p[g-2],M),h.add(p[g-1],M,M)):M=p[u+1],h.clone(M,xhe);let L,F;l(C)&&(u!==0&&!r?L=i[u-1]:L=i[u],u!==g-1&&(F=i[u]));let V=u===0?2:0,z=u===g-1?2:4;for(f=V;f<z;++f){h.pack(Ahe,y,E),h.pack(bhe,A,E),h.pack(xhe,b,E),E+=3;let j=f-2<0?-1:1;if(x[w++]=2*(f%2)-1,x[w++]=j*t,n.st&&(T[D++]=u/(g-1),T[D++]=Math.max(x[w-2],0)),l(C)){let B=f<2?L:F;C[R++]=U.floatToByte(B.red),C[R++]=U.floatToByte(B.green),C[R++]=U.floatToByte(B.blue),C[R++]=U.floatToByte(B.alpha)}}}let N=new xn;N.position=new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:y}),N.prevPosition=new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:A}),N.nextPosition=new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:b}),N.expandAndWidth=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:x}),n.st&&(N.st=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:T})),l(C)&&(N.color=new Me({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:4,values:C,normalize:!0}));let _=Ve.createTypedArray(m,g*6-6),v=0,S=0,P=g-1;for(u=0;u<P;++u)_[S++]=v,_[S++]=v+2,_[S++]=v+1,_[S++]=v+1,_[S++]=v+2,_[S++]=v+3,v+=4;return new Tt({attributes:N,indices:_,primitiveType:Re.TRIANGLES,boundingSphere:se.fromPoints(p),geometryType:nh.POLYLINES})};var V_=dP;function y7e(e,t,n,i){let r=new xn;i.position&&(r.position=new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:e}));let o=t.length,a=e.length/3,s=(a-o*2)/(o*2),c=li.triangulate(t),u=(s-1)*o*6+c.length*2,f=Ve.createTypedArray(a,u),d,p,g,m,y,A,b=o*2,x=0;for(d=0;d<s-1;d++){for(p=0;p<o-1;p++)g=p*2+d*o*2,A=g+b,m=g+1,y=m+b,f[x++]=m,f[x++]=g,f[x++]=y,f[x++]=y,f[x++]=g,f[x++]=A;g=o*2-2+d*o*2,m=g+1,y=m+b,A=g+b,f[x++]=m,f[x++]=g,f[x++]=y,f[x++]=y,f[x++]=g,f[x++]=A}if(i.st||i.tangent||i.bitangent){let E=new Float32Array(a*2),w=1/(s-1),D=1/n.height,R=n.height/2,M,N,_=0;for(d=0;d<s;d++){for(M=d*w,N=D*(t[0].y+R),E[_++]=M,E[_++]=N,p=1;p<o;p++)N=D*(t[p].y+R),E[_++]=M,E[_++]=N,E[_++]=M,E[_++]=N;N=D*(t[0].y+R),E[_++]=M,E[_++]=N}for(p=0;p<o;p++)M=0,N=D*(t[p].y+R),E[_++]=M,E[_++]=N;for(p=0;p<o;p++)M=(s-1)*w,N=D*(t[p].y+R),E[_++]=M,E[_++]=N;r.st=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:new Float32Array(E)})}let T=a-o*2;for(d=0;d<c.length;d+=3){let E=c[d]+T,w=c[d+1]+T,D=c[d+2]+T;f[x++]=E,f[x++]=w,f[x++]=D,f[x++]=D+o,f[x++]=w+o,f[x++]=E+o}let C=new Tt({attributes:r,indices:f,boundingSphere:se.fromVertices(e),primitiveType:Re.TRIANGLES});if(i.normal&&(C=Gn.computeNormal(C)),i.tangent||i.bitangent){try{C=Gn.computeTangentAndBitangent(C)}catch{pt("polyline-volume-tangent-bitangent","Unable to compute tangents and bitangents for polyline volume geometry")}i.tangent||(C.attributes.tangent=void 0),i.bitangent||(C.attributes.bitangent=void 0),i.st||(C.attributes.st=void 0)}return C}function mP(e){e=e??H.EMPTY_OBJECT;let t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=te.clone(e.ellipsoid??te.default),this._cornerType=e.cornerType??tr.ROUNDED,this._vertexFormat=Be.clone(e.vertexFormat??Be.DEFAULT),this._granularity=e.granularity??I.RADIANS_PER_DEGREE,this._workerName="createPolylineVolumeGeometry";let i=1+t.length*h.packedLength;i+=1+n.length*k.packedLength,this.packedLength=i+te.packedLength+Be.packedLength+2}mP.pack=function(e,t,n){n=n??0;let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=h.packedLength)h.pack(r[i],t,n);let a=e._shape;for(o=a.length,t[n++]=o,i=0;i<o;++i,n+=k.packedLength)k.pack(a[i],t,n);return te.pack(e._ellipsoid,t,n),n+=te.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var Ehe=te.clone(te.UNIT_SPHERE),She=new Be,hP={polylinePositions:void 0,shapePositions:void 0,ellipsoid:Ehe,vertexFormat:She,cornerType:void 0,granularity:void 0};mP.unpack=function(e,t,n){t=t??0;let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=h.packedLength)o[i]=h.unpack(e,t);r=e[t++];let a=new Array(r);for(i=0;i<r;++i,t+=k.packedLength)a[i]=k.unpack(e,t);let s=te.unpack(e,t,Ehe);t+=te.packedLength;let c=Be.unpack(e,t,She);t+=Be.packedLength;let u=e[t++],f=e[t];return l(n)?(n._positions=o,n._shape=a,n._ellipsoid=te.clone(s,n._ellipsoid),n._vertexFormat=Be.clone(c,n._vertexFormat),n._cornerType=u,n._granularity=f,n):(hP.polylinePositions=o,hP.shapePositions=a,hP.cornerType=u,hP.granularity=f,new mP(hP))};var A7e=new Je;mP.createGeometry=function(e){let t=e._positions,n=Pr(t,h.equalsEpsilon),i=e._shape;if(i=Hm.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;li.computeWindingOrder2D(i)===ns.CLOCKWISE&&i.reverse();let r=Je.fromPoints(i,A7e),o=Hm.computePositions(n,i,r,e,!0);return y7e(o,i,r,e._vertexFormat)};var tF=mP;function b7e(e,t){let n=new xn;n.position=new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:e});let i=t.length,r=n.position.values.length/3,a=e.length/3/i,s=Ve.createTypedArray(r,2*i*(a+1)),c,u,f=0;c=0;let d=c*i;for(u=0;u<i-1;u++)s[f++]=u+d,s[f++]=u+d+1;for(s[f++]=i-1+d,s[f++]=d,c=a-1,d=c*i,u=0;u<i-1;u++)s[f++]=u+d,s[f++]=u+d+1;for(s[f++]=i-1+d,s[f++]=d,c=0;c<a-1;c++){let g=i*c,m=g+i;for(u=0;u<i;u++)s[f++]=u+g,s[f++]=u+m}return new Tt({attributes:n,indices:Ve.createTypedArray(r,s),boundingSphere:se.fromVertices(e),primitiveType:Re.LINES})}function gP(e){e=e??H.EMPTY_OBJECT;let t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=te.clone(e.ellipsoid??te.default),this._cornerType=e.cornerType??tr.ROUNDED,this._granularity=e.granularity??I.RADIANS_PER_DEGREE,this._workerName="createPolylineVolumeOutlineGeometry";let i=1+t.length*h.packedLength;i+=1+n.length*k.packedLength,this.packedLength=i+te.packedLength+2}gP.pack=function(e,t,n){n=n??0;let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=h.packedLength)h.pack(r[i],t,n);let a=e._shape;for(o=a.length,t[n++]=o,i=0;i<o;++i,n+=k.packedLength)k.pack(a[i],t,n);return te.pack(e._ellipsoid,t,n),n+=te.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var whe=te.clone(te.UNIT_SPHERE),pP={polylinePositions:void 0,shapePositions:void 0,ellipsoid:whe,height:void 0,cornerType:void 0,granularity:void 0};gP.unpack=function(e,t,n){t=t??0;let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=h.packedLength)o[i]=h.unpack(e,t);r=e[t++];let a=new Array(r);for(i=0;i<r;++i,t+=k.packedLength)a[i]=k.unpack(e,t);let s=te.unpack(e,t,whe);t+=te.packedLength;let c=e[t++],u=e[t];return l(n)?(n._positions=o,n._shape=a,n._ellipsoid=te.clone(s,n._ellipsoid),n._cornerType=c,n._granularity=u,n):(pP.polylinePositions=o,pP.shapePositions=a,pP.cornerType=c,pP.granularity=u,new gP(pP))};var x7e=new Je;gP.createGeometry=function(e){let t=e._positions,n=Pr(t,h.equalsEpsilon),i=e._shape;if(i=Hm.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;li.computeWindingOrder2D(i)===ns.CLOCKWISE&&i.reverse();let r=Je.fromPoints(i,x7e),o=Hm.computePositions(n,i,r,e,!1);return b7e(o,i)};var nF=gP;function Ihe(){pe.throwInstantiationError()}Ihe.prototype.getURL=pe.throwInstantiationError;var Phe=Ihe;function T7e(e){let t=e.points,n=e.times;return function(i,r){l(r)||(r=new Fe);let o=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),a=(i-n[o])/(n[o+1]-n[o]),s=t[o],c=t[o+1];return Fe.fastSlerp(s,c,a,r)}}function QC(e){e=e??H.EMPTY_OBJECT;let t=e.points,n=e.times;this._times=n,this._points=t,this._evaluateFunction=T7e(this),this._lastTimeIndex=0}Object.defineProperties(QC.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});QC.prototype.findTimeInterval=Er.prototype.findTimeInterval;QC.prototype.wrapTime=Er.prototype.wrapTime;QC.prototype.clampTime=Er.prototype.clampTime;QC.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var iF=QC;function rF(e,t,n=0,i=e.length-1,r=C7e){for(;i>n;){if(i-n>600){let c=i-n+1,u=t-n+1,f=Math.log(c),d=.5*Math.exp(2*f/3),p=.5*Math.sqrt(f*d*(c-d)/c)*(u-c/2<0?-1:1),g=Math.max(n,Math.floor(t-u*d/c+p)),m=Math.min(i,Math.floor(t+(c-u)*d/c+p));rF(e,t,g,m,r)}let o=e[t],a=n,s=i;for(_P(e,n,t),r(e[i],o)>0&&_P(e,n,i);a<s;){for(_P(e,a,s),a++,s--;r(e[a],o)<0;)a++;for(;r(e[s],o)>0;)s--}r(e[n],o)===0?_P(e,n,s):(s++,_P(e,s,i)),s<=t&&(n=s+1),t<=s&&(i=s-1)}}function _P(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function C7e(e,t){return e<t?-1:e>t?1:0}var bP=class{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(t){let n=this.data,i=[];if(!aF(t,n))return i;let r=this.toBBox,o=[];for(;n;){for(let a=0;a<n.children.length;a++){let s=n.children[a],c=n.leaf?r(s):s;aF(t,c)&&(n.leaf?i.push(s):qX(t,c)?this._all(s,i):o.push(s))}n=o.pop()}return i}collides(t){let n=this.data;if(!aF(t,n))return!1;let i=[];for(;n;){for(let r=0;r<n.children.length;r++){let o=n.children[r],a=n.leaf?this.toBBox(o):o;if(aF(t,a)){if(n.leaf||qX(t,a))return!0;i.push(o)}}n=i.pop()}return!1}load(t){if(!(t&&t.length))return this;if(t.length<this._minEntries){for(let i=0;i<t.length;i++)this.insert(t[i]);return this}let n=this._build(t.slice(),0,t.length-1,0);if(!this.data.children.length)this.data=n;else if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){let i=this.data;this.data=n,n=i}this._insert(n,this.data.height-n.height-1,!0)}return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=tv([]),this}remove(t,n){if(!t)return this;let i=this.data,r=this.toBBox(t),o=[],a=[],s,c,u;for(;i||o.length;){if(i||(i=o.pop(),c=o[o.length-1],s=a.pop(),u=!0),i.leaf){let f=v7e(t,i.children,n);if(f!==-1)return i.children.splice(f,1),o.push(i),this._condense(o),this}!u&&!i.leaf&&qX(i,r)?(o.push(i),a.push(s),s=0,c=i,i=i.children[0]):c?(s++,i=c.children[s],u=!1):i=null}return this}toBBox(t){return t}compareMinX(t,n){return t.minX-n.minX}compareMinY(t,n){return t.minY-n.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,n){let i=[];for(;t;)t.leaf?n.push(...t.children):i.push(...t.children),t=i.pop();return n}_build(t,n,i,r){let o=i-n+1,a=this._maxEntries,s;if(o<=a)return s=tv(t.slice(n,i+1)),ev(s,this.toBBox),s;r||(r=Math.ceil(Math.log(o)/Math.log(a)),a=Math.ceil(o/Math.pow(a,r-1))),s=tv([]),s.leaf=!1,s.height=r;let c=Math.ceil(o/a),u=c*Math.ceil(Math.sqrt(a));Dhe(t,n,i,u,this.compareMinX);for(let f=n;f<=i;f+=u){let d=Math.min(f+u-1,i);Dhe(t,f,d,c,this.compareMinY);for(let p=f;p<=d;p+=c){let g=Math.min(p+c-1,d);s.children.push(this._build(t,p,g,r-1))}}return ev(s,this.toBBox),s}_chooseSubtree(t,n,i,r){for(;r.push(n),!(n.leaf||r.length-1===i);){let o=1/0,a=1/0,s;for(let c=0;c<n.children.length;c++){let u=n.children[c],f=WX(u),d=w7e(t,u)-f;d<a?(a=d,o=f<o?f:o,s=u):d===a&&f<o&&(o=f,s=u)}n=s||n.children[0]}return n}_insert(t,n,i){let r=i?t:this.toBBox(t),o=[],a=this._chooseSubtree(r,this.data,n,o);for(a.children.push(t),AP(a,r);n>=0&&o[n].children.length>this._maxEntries;)this._split(o,n),n--;this._adjustParentBBoxes(r,o,n)}_split(t,n){let i=t[n],r=i.children.length,o=this._minEntries;this._chooseSplitAxis(i,o,r);let a=this._chooseSplitIndex(i,o,r),s=tv(i.children.splice(a,i.children.length-a));s.height=i.height,s.leaf=i.leaf,ev(i,this.toBBox),ev(s,this.toBBox),n?t[n-1].children.push(s):this._splitRoot(i,s)}_splitRoot(t,n){this.data=tv([t,n]),this.data.height=t.height+1,this.data.leaf=!1,ev(this.data,this.toBBox)}_chooseSplitIndex(t,n,i){let r,o=1/0,a=1/0;for(let s=n;s<=i-n;s++){let c=yP(t,0,s,this.toBBox),u=yP(t,s,i,this.toBBox),f=I7e(c,u),d=WX(c)+WX(u);f<o?(o=f,r=s,a=d<a?d:a):f===o&&d<a&&(a=d,r=s)}return r||i-n}_chooseSplitAxis(t,n,i){let r=t.leaf?this.compareMinX:E7e,o=t.leaf?this.compareMinY:S7e,a=this._allDistMargin(t,n,i,r),s=this._allDistMargin(t,n,i,o);a<s&&t.children.sort(r)}_allDistMargin(t,n,i,r){t.children.sort(r);let o=this.toBBox,a=yP(t,0,n,o),s=yP(t,i-n,i,o),c=oF(a)+oF(s);for(let u=n;u<i-n;u++){let f=t.children[u];AP(a,t.leaf?o(f):f),c+=oF(a)}for(let u=i-n-1;u>=n;u--){let f=t.children[u];AP(s,t.leaf?o(f):f),c+=oF(s)}return c}_adjustParentBBoxes(t,n,i){for(let r=i;r>=0;r--)AP(n[r],t)}_condense(t){for(let n=t.length-1,i;n>=0;n--)t[n].children.length===0?n>0?(i=t[n-1].children,i.splice(i.indexOf(t[n]),1)):this.clear():ev(t[n],this.toBBox)}};function v7e(e,t,n){if(!n)return t.indexOf(e);for(let i=0;i<t.length;i++)if(n(e,t[i]))return i;return-1}function ev(e,t){yP(e,0,e.children.length,t,e)}function yP(e,t,n,i,r){r||(r=tv(null)),r.minX=1/0,r.minY=1/0,r.maxX=-1/0,r.maxY=-1/0;for(let o=t;o<n;o++){let a=e.children[o];AP(r,e.leaf?i(a):a)}return r}function AP(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function E7e(e,t){return e.minX-t.minX}function S7e(e,t){return e.minY-t.minY}function WX(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function oF(e){return e.maxX-e.minX+(e.maxY-e.minY)}function w7e(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function I7e(e,t){let n=Math.max(e.minX,t.minX),i=Math.max(e.minY,t.minY),r=Math.min(e.maxX,t.maxX),o=Math.min(e.maxY,t.maxY);return Math.max(0,r-n)*Math.max(0,o-i)}function qX(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function aF(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function tv(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Dhe(e,t,n,i,r){let o=[t,n];for(;o.length;){if(n=o.pop(),t=o.pop(),n-t<=i)continue;let a=t+Math.ceil((n-t)/i/2)*i;rF(e,a,t,n,r),o.push(t,a,a,n)}}function sF(){this._tree=new bP}function Cb(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.id=""}Cb.fromRectangleAndId=function(e,t,n){return n.minX=t.west,n.minY=t.south,n.maxX=t.east,n.maxY=t.north,n.id=e,n};sF.prototype.insert=function(e,t){let n=Cb.fromRectangleAndId(e,t,new Cb);this._tree.insert(n)};function P7e(e,t){return e.id===t.id}var D7e=new Cb;sF.prototype.remove=function(e,t){let n=Cb.fromRectangleAndId(e,t,D7e);this._tree.remove(n,P7e)};var R7e=new Cb;sF.prototype.collides=function(e){let t=Cb.fromRectangleAndId("",e,R7e);return this._tree.collides(t)};var nv=sF;var Rhe=Math.cos,Ohe=Math.sin,O7e=Math.sqrt,YX={};YX.computePosition=function(e,t,n,i,r,o,a){let s=t.radiiSquared,c=e.nwCorner,u=e.boundingRectangle,f=c.latitude-e.granYCos*i+r*e.granXSin,d=Rhe(f),p=Ohe(f),g=s.z*p,m=c.longitude+i*e.granYSin+r*e.granXCos,y=d*Rhe(m),A=d*Ohe(m),b=s.x*y,x=s.y*A,T=O7e(b*y+x*A+g*p);if(o.x=b/T,o.y=x/T,o.z=g/T,n){let C=e.stNwCorner;l(C)?(f=C.latitude-e.stGranYCos*i+r*e.stGranXSin,m=C.longitude+i*e.stGranYSin+r*e.stGranXCos,a.x=(m-e.stWest)*e.lonScalar,a.y=(f-e.stSouth)*e.latScalar):(a.x=(m-u.west)*e.lonScalar,a.y=(f-u.south)*e.latScalar)}};var M7e=new Zi,rd=new h,L7e=new de,cF=new h,xP=new ki;function Mhe(e,t,n,i,r,o,a){let s=Math.cos(t),c=i*s,u=n*s,f=Math.sin(t),d=i*f,p=n*f;xP._ellipsoid=te.default,rd=xP.project(e,rd),rd=h.subtract(rd,cF,rd);let g=Zi.fromRotation(t,M7e);rd=Zi.multiplyByVector(g,rd,rd),rd=h.add(rd,cF,rd),e=xP.unproject(rd,e),o-=1,a-=1;let m=e.latitude,y=m+o*p,A=m-c*a,b=m-c*a+o*p,x=Math.max(m,y,A,b),T=Math.min(m,y,A,b),C=e.longitude,E=C+o*u,w=C+a*d,D=C+a*d+o*u,R=Math.max(C,E,w,D),M=Math.min(C,E,w,D);return{north:x,south:T,east:R,west:M,granYCos:c,granYSin:d,granXCos:u,granXSin:p,nwCorner:e}}YX.computeOptions=function(e,t,n,i,r,o,a){let s=e.east,c=e.west,u=e.north,f=e.south,d=!1,p=!1;u===I.PI_OVER_TWO&&(d=!0),f===-I.PI_OVER_TWO&&(p=!0);let g,m=u-f;c>s?g=I.TWO_PI-c+s:g=s-c;let y=Math.ceil(g/t)+1,A=Math.ceil(m/t)+1,b=g/(y-1),x=m/(A-1),T=ie.northwest(e,o),C=ie.center(e,L7e);(n!==0||i!==0)&&(C.longitude<T.longitude&&(C.longitude+=I.TWO_PI),xP._ellipsoid=te.default,cF=xP.project(C,cF));let E=x,w=b,D=0,R=0,M=ie.clone(e,r),N={granYCos:E,granYSin:D,granXCos:w,granXSin:R,nwCorner:T,boundingRectangle:M,width:y,height:A,northCap:d,southCap:p};if(n!==0){let _=Mhe(T,n,b,x,C,y,A);u=_.north,f=_.south,s=_.east,c=_.west,N.granYCos=_.granYCos,N.granYSin=_.granYSin,N.granXCos=_.granXCos,N.granXSin=_.granXSin,M.north=u,M.south=f,M.east=s,M.west=c}if(i!==0){n=n-i;let _=ie.northwest(M,a),v=Mhe(_,n,b,x,C,y,A);N.stGranYCos=v.granYCos,N.stGranXCos=v.granXCos,N.stGranYSin=v.granYSin,N.stGranXSin=v.granXSin,N.stNwCorner=_,N.stWest=v.west,N.stSouth=v.south}return N};var Ts=YX;var XX=new h,Fhe=new h,Bhe=new h,khe=new h,zhe=new ie,N7e=new k,F7e=new se,B7e=new se;function Uhe(e,t){let n=new Tt({attributes:new xn,primitiveType:Re.TRIANGLES});return n.attributes.position=new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:t.positions}),e.normal&&(n.attributes.normal=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:t.normals})),e.tangent&&(n.attributes.tangent=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:t.tangents})),e.bitangent&&(n.attributes.bitangent=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:t.bitangents})),n}function k7e(e,t,n,i){let r=e.length,o=t.normal?new Float32Array(r):void 0,a=t.tangent?new Float32Array(r):void 0,s=t.bitangent?new Float32Array(r):void 0,c=0,u=khe,f=Bhe,d=Fhe;if(t.normal||t.tangent||t.bitangent)for(let p=0;p<r;p+=3){let g=h.fromArray(e,p,XX),m=c+1,y=c+2;d=n.geodeticSurfaceNormal(g,d),(t.tangent||t.bitangent)&&(h.cross(h.UNIT_Z,d,f),$.multiplyByVector(i,f,f),h.normalize(f,f),t.bitangent&&h.normalize(h.cross(d,f,u),u)),t.normal&&(o[c]=d.x,o[m]=d.y,o[y]=d.z),t.tangent&&(a[c]=f.x,a[m]=f.y,a[y]=f.z),t.bitangent&&(s[c]=u.x,s[m]=u.y,s[y]=u.z),c+=3}return Uhe(t,{positions:e,normals:o,tangents:a,bitangents:s})}var KX=new h,Vhe=new h;function z7e(e,t,n){let i=e.length,r=t.normal?new Float32Array(i):void 0,o=t.tangent?new Float32Array(i):void 0,a=t.bitangent?new Float32Array(i):void 0,s=0,c=0,u=0,f=!0,d=khe,p=Bhe,g=Fhe;if(t.normal||t.tangent||t.bitangent)for(let m=0;m<i;m+=6){let y=h.fromArray(e,m,XX),A=h.fromArray(e,(m+6)%i,KX);if(f){let b=h.fromArray(e,(m+3)%i,Vhe);h.subtract(A,y,A),h.subtract(b,y,b),g=h.normalize(h.cross(b,A,g),g),f=!1}h.equalsEpsilon(A,y,I.EPSILON10)&&(f=!0),(t.tangent||t.bitangent)&&(d=n.geodeticSurfaceNormal(y,d),t.tangent&&(p=h.normalize(h.cross(d,g,p),p))),t.normal&&(r[s++]=g.x,r[s++]=g.y,r[s++]=g.z,r[s++]=g.x,r[s++]=g.y,r[s++]=g.z),t.tangent&&(o[c++]=p.x,o[c++]=p.y,o[c++]=p.z,o[c++]=p.x,o[c++]=p.y,o[c++]=p.z),t.bitangent&&(a[u++]=d.x,a[u++]=d.y,a[u++]=d.z,a[u++]=d.x,a[u++]=d.y,a[u++]=d.z)}return Uhe(t,{positions:e,normals:r,tangents:o,bitangents:a})}function jhe(e,t){let n=e._vertexFormat,i=e._ellipsoid,r=t.height,o=t.width,a=t.northCap,s=t.southCap,c=0,u=r,f=r,d=0;a&&(c=1,f-=1,d+=1),s&&(u-=1,f-=1,d+=1),d+=o*f;let p=n.position?new Float64Array(d*3):void 0,g=n.st?new Float32Array(d*2):void 0,m=0,y=0,A=XX,b=N7e,x=Number.MAX_VALUE,T=Number.MAX_VALUE,C=-Number.MAX_VALUE,E=-Number.MAX_VALUE;for(let v=c;v<u;++v)for(let S=0;S<o;++S)Ts.computePosition(t,i,n.st,v,S,A,b),p[m++]=A.x,p[m++]=A.y,p[m++]=A.z,n.st&&(g[y++]=b.x,g[y++]=b.y,x=Math.min(x,b.x),T=Math.min(T,b.y),C=Math.max(C,b.x),E=Math.max(E,b.y));if(a&&(Ts.computePosition(t,i,n.st,0,0,A,b),p[m++]=A.x,p[m++]=A.y,p[m++]=A.z,n.st&&(g[y++]=b.x,g[y++]=b.y,x=b.x,T=b.y,C=b.x,E=b.y)),s&&(Ts.computePosition(t,i,n.st,r-1,0,A,b),p[m++]=A.x,p[m++]=A.y,p[m]=A.z,n.st&&(g[y++]=b.x,g[y]=b.y,x=Math.min(x,b.x),T=Math.min(T,b.y),C=Math.max(C,b.x),E=Math.max(E,b.y))),n.st&&(x<0||T<0||C>1||E>1))for(let v=0;v<g.length;v+=2)g[v]=(g[v]-x)/(C-x),g[v+1]=(g[v+1]-T)/(E-T);let w=k7e(p,n,i,t.tangentRotationMatrix),D=6*(o-1)*(f-1);a&&(D+=3*(o-1)),s&&(D+=3*(o-1));let R=Ve.createTypedArray(d,D),M=0,N=0,_;for(_=0;_<f-1;++_){for(let v=0;v<o-1;++v){let S=M,P=S+o,L=P+1,F=S+1;R[N++]=S,R[N++]=P,R[N++]=F,R[N++]=F,R[N++]=P,R[N++]=L,++M}++M}if(a||s){let v=d-1,S=d-1;a&&s&&(v=d-2);let P,L;if(M=0,a)for(_=0;_<o-1;_++)P=M,L=P+1,R[N++]=v,R[N++]=P,R[N++]=L,++M;if(s)for(M=(f-1)*o,_=0;_<o-1;_++)P=M,L=P+1,R[N++]=P,R[N++]=S,R[N++]=L,++M}return w.indices=R,n.st&&(w.attributes.st=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:g})),w}function iv(e,t,n,i,r){return e[t++]=i[n],e[t++]=i[n+1],e[t++]=i[n+2],e[t++]=r[n],e[t++]=r[n+1],e[t]=r[n+2],e}function rv(e,t,n,i){return e[t++]=i[n],e[t++]=i[n+1],e[t++]=i[n],e[t]=i[n+1],e}var $X=new Be;function U7e(e,t){let n=e._shadowVolume,i=e._offsetAttribute,r=e._vertexFormat,o=e._extrudedHeight,a=e._surfaceHeight,s=e._ellipsoid,c=t.height,u=t.width,f;if(n){let we=Be.clone(r,$X);we.normal=!0,e._vertexFormat=we}let d=jhe(e,t);n&&(e._vertexFormat=r);let p=li.scaleToGeodeticHeight(d.attributes.position.values,a,s,!1);p=new Float64Array(p);let g=p.length,m=g*2,y=new Float64Array(m);y.set(p);let A=li.scaleToGeodeticHeight(d.attributes.position.values,o,s);y.set(A,g),d.attributes.position.values=y;let b=r.normal?new Float32Array(m):void 0,x=r.tangent?new Float32Array(m):void 0,T=r.bitangent?new Float32Array(m):void 0,C=r.st?new Float32Array(m/3*2):void 0,E,w;if(r.normal){for(w=d.attributes.normal.values,b.set(w),f=0;f<g;f++)w[f]=-w[f];b.set(w,g),d.attributes.normal.values=b}if(n){w=d.attributes.normal.values,r.normal||(d.attributes.normal=void 0);let we=new Float32Array(m);for(f=0;f<g;f++)w[f]=-w[f];we.set(w,g),d.attributes.extrudeDirection=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:we})}let D,R=l(i);if(R){let we=g/3*2,We=new Uint8Array(we);i===mn.TOP?We=We.fill(1,0,we/2):(D=i===mn.NONE?0:1,We=We.fill(D)),d.attributes.applyOffset=new Me({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:We})}if(r.tangent){let we=d.attributes.tangent.values;for(x.set(we),f=0;f<g;f++)we[f]=-we[f];x.set(we,g),d.attributes.tangent.values=x}if(r.bitangent){let we=d.attributes.bitangent.values;T.set(we),T.set(we,g),d.attributes.bitangent.values=T}r.st&&(E=d.attributes.st.values,C.set(E),C.set(E,g/3*2),d.attributes.st.values=C);let M=d.indices,N=M.length,_=g/3,v=Ve.createTypedArray(m/3,N*2);for(v.set(M),f=0;f<N;f+=3)v[f+N]=M[f+2]+_,v[f+1+N]=M[f+1]+_,v[f+2+N]=M[f]+_;d.indices=v;let S=t.northCap,P=t.southCap,L=c,F=2,V=0,z=4,j=4;S&&(F-=1,L-=1,V+=1,z-=2,j-=1),P&&(F-=1,L-=1,V+=1,z-=2,j-=1),V+=F*u+2*L-z;let B=(V+j)*2,G=new Float64Array(B*3),W=n?new Float32Array(B*3):void 0,Q=R?new Uint8Array(B):void 0,q=r.st?new Float32Array(B*2):void 0,J=i===mn.TOP;R&&!J&&(D=i===mn.ALL?1:0,Q=Q.fill(D));let Z=0,ce=0,Ae=0,le=0,Ce=u*L,ye;for(f=0;f<Ce;f+=u)ye=f*3,G=iv(G,Z,ye,p,A),Z+=6,r.st&&(q=rv(q,ce,f*2,E),ce+=4),n&&(Ae+=3,W[Ae++]=w[ye],W[Ae++]=w[ye+1],W[Ae++]=w[ye+2]),J&&(Q[le++]=1,le+=1);if(P){let we=S?Ce+1:Ce;for(ye=we*3,f=0;f<2;f++)G=iv(G,Z,ye,p,A),Z+=6,r.st&&(q=rv(q,ce,we*2,E),ce+=4),n&&(Ae+=3,W[Ae++]=w[ye],W[Ae++]=w[ye+1],W[Ae++]=w[ye+2]),J&&(Q[le++]=1,le+=1)}else for(f=Ce-u;f<Ce;f++)ye=f*3,G=iv(G,Z,ye,p,A),Z+=6,r.st&&(q=rv(q,ce,f*2,E),ce+=4),n&&(Ae+=3,W[Ae++]=w[ye],W[Ae++]=w[ye+1],W[Ae++]=w[ye+2]),J&&(Q[le++]=1,le+=1);for(f=Ce-1;f>0;f-=u)ye=f*3,G=iv(G,Z,ye,p,A),Z+=6,r.st&&(q=rv(q,ce,f*2,E),ce+=4),n&&(Ae+=3,W[Ae++]=w[ye],W[Ae++]=w[ye+1],W[Ae++]=w[ye+2]),J&&(Q[le++]=1,le+=1);if(S){let we=Ce;for(ye=we*3,f=0;f<2;f++)G=iv(G,Z,ye,p,A),Z+=6,r.st&&(q=rv(q,ce,we*2,E),ce+=4),n&&(Ae+=3,W[Ae++]=w[ye],W[Ae++]=w[ye+1],W[Ae++]=w[ye+2]),J&&(Q[le++]=1,le+=1)}else for(f=u-1;f>=0;f--)ye=f*3,G=iv(G,Z,ye,p,A),Z+=6,r.st&&(q=rv(q,ce,f*2,E),ce+=4),n&&(Ae+=3,W[Ae++]=w[ye],W[Ae++]=w[ye+1],W[Ae++]=w[ye+2]),J&&(Q[le++]=1,le+=1);let ve=z7e(G,r,s);r.st&&(ve.attributes.st=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:q})),n&&(ve.attributes.extrudeDirection=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:W})),R&&(ve.attributes.applyOffset=new Me({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:Q}));let Ie=Ve.createTypedArray(B,V*6),Le,$e,Ye,yt;g=G.length/3;let Ke=0;for(f=0;f<g-1;f+=2){Le=f,yt=(Le+2)%g;let we=h.fromArray(G,Le*3,KX),We=h.fromArray(G,yt*3,Vhe);h.equalsEpsilon(we,We,I.EPSILON10)||($e=(Le+1)%g,Ye=($e+2)%g,Ie[Ke++]=Le,Ie[Ke++]=$e,Ie[Ke++]=yt,Ie[Ke++]=yt,Ie[Ke++]=$e,Ie[Ke++]=Ye)}return ve.indices=Ie,ve=Gn.combineInstances([new Bt({geometry:d}),new Bt({geometry:ve})]),ve[0]}var V7e=[new h,new h,new h,new h],Hhe=new de,j7e=new de;function JX(e,t,n,i,r){if(n===0)return ie.clone(e,r);let o=Ts.computeOptions(e,t,n,0,zhe,Hhe),a=o.height,s=o.width,c=V7e;return Ts.computePosition(o,i,!1,0,0,c[0]),Ts.computePosition(o,i,!1,0,s-1,c[1]),Ts.computePosition(o,i,!1,a-1,0,c[2]),Ts.computePosition(o,i,!1,a-1,s-1,c[3]),ie.fromCartesianArray(c,i,r)}function Jm(e){e=e??H.EMPTY_OBJECT;let t=e.rectangle,n=e.height??0,i=e.extrudedHeight??n;this._rectangle=ie.clone(t),this._granularity=e.granularity??I.RADIANS_PER_DEGREE,this._ellipsoid=te.clone(e.ellipsoid??te.default),this._surfaceHeight=Math.max(n,i),this._rotation=e.rotation??0,this._stRotation=e.stRotation??0,this._vertexFormat=Be.clone(e.vertexFormat??Be.DEFAULT),this._extrudedHeight=Math.min(n,i),this._shadowVolume=e.shadowVolume??!1,this._workerName="createRectangleGeometry",this._offsetAttribute=e.offsetAttribute,this._rotatedRectangle=void 0,this._textureCoordinateRotationPoints=void 0}Jm.packedLength=ie.packedLength+te.packedLength+Be.packedLength+7;Jm.pack=function(e,t,n){return n=n??0,ie.pack(e._rectangle,t,n),n+=ie.packedLength,te.pack(e._ellipsoid,t,n),n+=te.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=e._stRotation,t[n++]=e._extrudedHeight,t[n++]=e._shadowVolume?1:0,t[n]=e._offsetAttribute??-1,t};var Ghe=new ie,Whe=te.clone(te.UNIT_SPHERE),j_={rectangle:Ghe,ellipsoid:Whe,vertexFormat:$X,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};Jm.unpack=function(e,t,n){t=t??0;let i=ie.unpack(e,t,Ghe);t+=ie.packedLength;let r=te.unpack(e,t,Whe);t+=te.packedLength;let o=Be.unpack(e,t,$X);t+=Be.packedLength;let a=e[t++],s=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++]===1,p=e[t];return l(n)?(n._rectangle=ie.clone(i,n._rectangle),n._ellipsoid=te.clone(r,n._ellipsoid),n._vertexFormat=Be.clone(o,n._vertexFormat),n._granularity=a,n._surfaceHeight=s,n._rotation=c,n._stRotation=u,n._extrudedHeight=f,n._shadowVolume=d,n._offsetAttribute=p===-1?void 0:p,n):(j_.granularity=a,j_.height=s,j_.rotation=c,j_.stRotation=u,j_.extrudedHeight=f,j_.shadowVolume=d,j_.offsetAttribute=p===-1?void 0:p,new Jm(j_))};Jm.computeRectangle=function(e,t){e=e??H.EMPTY_OBJECT;let n=e.rectangle,i=e.granularity??I.RADIANS_PER_DEGREE,r=e.ellipsoid??te.default,o=e.rotation??0;return JX(n,i,o,r,t)};var H7e=new $,Lhe=new Fe,G7e=new de;Jm.createGeometry=function(e){if(I.equalsEpsilon(e._rectangle.north,e._rectangle.south,I.EPSILON10)||I.equalsEpsilon(e._rectangle.east,e._rectangle.west,I.EPSILON10))return;let t=e._rectangle,n=e._ellipsoid,i=e._rotation,r=e._stRotation,o=e._vertexFormat,a=Ts.computeOptions(t,e._granularity,i,r,zhe,Hhe,j7e),s=H7e;if(r!==0||i!==0){let g=ie.center(t,G7e),m=n.geodeticSurfaceNormalCartographic(g,KX);Fe.fromAxisAngle(m,-r,Lhe),$.fromQuaternion(Lhe,s)}else $.clone($.IDENTITY,s);let c=e._surfaceHeight,u=e._extrudedHeight,f=!I.equalsEpsilon(c,u,0,I.EPSILON2);a.lonScalar=1/e._rectangle.width,a.latScalar=1/e._rectangle.height,a.tangentRotationMatrix=s;let d,p;if(t=e._rectangle,f){d=U7e(e,a);let g=se.fromRectangle3D(t,n,c,B7e),m=se.fromRectangle3D(t,n,u,F7e);p=se.union(g,m)}else{if(d=jhe(e,a),d.attributes.position.values=li.scaleToGeodeticHeight(d.attributes.position.values,c,n,!1),l(e._offsetAttribute)){let g=d.attributes.position.values.length,m=e._offsetAttribute===mn.NONE?0:1,y=new Uint8Array(g/3).fill(m);d.attributes.applyOffset=new Me({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:y})}p=se.fromRectangle3D(t,n,c)}return o.position||delete d.attributes.position,new Tt({attributes:d.attributes,indices:d.indices,primitiveType:d.primitiveType,boundingSphere:p,offsetAttribute:e._offsetAttribute})};Jm.createShadowVolume=function(e,t,n){let i=e._granularity,r=e._ellipsoid,o=t(i,r),a=n(i,r);return new Jm({rectangle:e._rectangle,rotation:e._rotation,ellipsoid:r,stRotation:e._stRotation,granularity:i,extrudedHeight:a,height:o,vertexFormat:Be.POSITION_ONLY,shadowVolume:!0})};var Nhe=new ie,W7e=[new k,new k,new k],q7e=new Zi,Y7e=new de;function X7e(e){if(e._stRotation===0)return[0,0,0,1,1,0];let t=ie.clone(e._rectangle,Nhe),n=e._granularity,i=e._ellipsoid,r=e._rotation-e._stRotation,o=JX(t,n,r,i,Nhe),a=W7e;a[0].x=o.west,a[0].y=o.south,a[1].x=o.west,a[1].y=o.north,a[2].x=o.east,a[2].y=o.south;let s=e.rectangle,c=Zi.fromRotation(e._stRotation,q7e),u=ie.center(s,Y7e);for(let m=0;m<3;++m){let y=a[m];y.x-=u.longitude,y.y-=u.latitude,Zi.multiplyByVector(c,y,y),y.x+=u.longitude,y.y+=u.latitude,y.x=(y.x-s.west)/s.width,y.y=(y.y-s.south)/s.height}let f=a[0],d=a[1],p=a[2],g=new Array(6);return k.pack(f,g),k.pack(d,g,2),k.pack(p,g,4),g}Object.defineProperties(Jm.prototype,{rectangle:{get:function(){return l(this._rotatedRectangle)||(this._rotatedRectangle=JX(this._rectangle,this._granularity,this._rotation,this._ellipsoid)),this._rotatedRectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=X7e(this)),this._textureCoordinateRotationPoints}}});var ov=Jm;var K7e=new se,$7e=new se,J7e=new h,Z7e=new ie;function qhe(e,t){let n=e._ellipsoid,i=t.height,r=t.width,o=t.northCap,a=t.southCap,s=i,c=2,u=0,f=4;o&&(c-=1,s-=1,u+=1,f-=2),a&&(c-=1,s-=1,u+=1,f-=2),u+=c*r+2*s-f;let d=new Float64Array(u*3),p=0,g=0,m,y=J7e;if(o)Ts.computePosition(t,n,!1,g,0,y),d[p++]=y.x,d[p++]=y.y,d[p++]=y.z;else for(m=0;m<r;m++)Ts.computePosition(t,n,!1,g,m,y),d[p++]=y.x,d[p++]=y.y,d[p++]=y.z;for(m=r-1,g=1;g<i;g++)Ts.computePosition(t,n,!1,g,m,y),d[p++]=y.x,d[p++]=y.y,d[p++]=y.z;if(g=i-1,!a)for(m=r-2;m>=0;m--)Ts.computePosition(t,n,!1,g,m,y),d[p++]=y.x,d[p++]=y.y,d[p++]=y.z;for(m=0,g=i-2;g>0;g--)Ts.computePosition(t,n,!1,g,m,y),d[p++]=y.x,d[p++]=y.y,d[p++]=y.z;let A=d.length/3*2,b=Ve.createTypedArray(d.length/3,A),x=0;for(let C=0;C<d.length/3-1;C++)b[x++]=C,b[x++]=C+1;b[x++]=d.length/3-1,b[x]=0;let T=new Tt({attributes:new xn,primitiveType:Re.LINES});return T.attributes.position=new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:d}),T.indices=b,T}function Q7e(e,t){let n=e._surfaceHeight,i=e._extrudedHeight,r=e._ellipsoid,o=qhe(e,t),a=t.height,s=t.width,c=li.scaleToGeodeticHeight(o.attributes.position.values,n,r,!1),u=c.length,f=new Float64Array(u*2);f.set(c);let d=li.scaleToGeodeticHeight(o.attributes.position.values,i,r);f.set(d,u),o.attributes.position.values=f;let p=t.northCap,g=t.southCap,m=4;p&&(m-=1),g&&(m-=1);let y=(f.length/3+m)*2,A=Ve.createTypedArray(f.length/3,y);u=f.length/6;let b=0;for(let T=0;T<u-1;T++)A[b++]=T,A[b++]=T+1,A[b++]=T+u,A[b++]=T+u+1;A[b++]=u-1,A[b++]=0,A[b++]=u+u-1,A[b++]=u,A[b++]=0,A[b++]=u;let x;if(p)x=a-1;else{let T=s-1;A[b++]=T,A[b++]=T+u,x=s+a-2}if(A[b++]=x,A[b++]=x+u,!g){let T=s+x-1;A[b++]=T,A[b]=T+u}return o.indices=A,o}function sv(e){e=e??H.EMPTY_OBJECT;let t=e.rectangle,n=e.granularity??I.RADIANS_PER_DEGREE,i=e.ellipsoid??te.default,r=e.rotation??0,o=e.height??0,a=e.extrudedHeight??o;this._rectangle=ie.clone(t),this._granularity=n,this._ellipsoid=i,this._surfaceHeight=Math.max(o,a),this._rotation=r,this._extrudedHeight=Math.min(o,a),this._offsetAttribute=e.offsetAttribute,this._workerName="createRectangleOutlineGeometry"}sv.packedLength=ie.packedLength+te.packedLength+5;sv.pack=function(e,t,n){return n=n??0,ie.pack(e._rectangle,t,n),n+=ie.packedLength,te.pack(e._ellipsoid,t,n),n+=te.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=e._extrudedHeight,t[n]=e._offsetAttribute??-1,t};var Yhe=new ie,Xhe=te.clone(te.UNIT_SPHERE),av={rectangle:Yhe,ellipsoid:Xhe,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0,offsetAttribute:void 0};sv.unpack=function(e,t,n){t=t??0;let i=ie.unpack(e,t,Yhe);t+=ie.packedLength;let r=te.unpack(e,t,Xhe);t+=te.packedLength;let o=e[t++],a=e[t++],s=e[t++],c=e[t++],u=e[t];return l(n)?(n._rectangle=ie.clone(i,n._rectangle),n._ellipsoid=te.clone(r,n._ellipsoid),n._surfaceHeight=a,n._rotation=s,n._extrudedHeight=c,n._offsetAttribute=u===-1?void 0:u,n):(av.granularity=o,av.height=a,av.rotation=s,av.extrudedHeight=c,av.offsetAttribute=u===-1?void 0:u,new sv(av))};var eWe=new de;sv.createGeometry=function(e){let t=e._rectangle,n=e._ellipsoid,i=Ts.computeOptions(t,e._granularity,e._rotation,0,Z7e,eWe),r,o;if(I.equalsEpsilon(t.north,t.south,I.EPSILON10)||I.equalsEpsilon(t.east,t.west,I.EPSILON10))return;let a=e._surfaceHeight,s=e._extrudedHeight,c=!I.equalsEpsilon(a,s,0,I.EPSILON2),u;if(c){if(r=Q7e(e,i),l(e._offsetAttribute)){let p=r.attributes.position.values.length/3,g=new Uint8Array(p);e._offsetAttribute===mn.TOP?g=g.fill(1,0,p/2):(u=e._offsetAttribute===mn.NONE?0:1,g=g.fill(u)),r.attributes.applyOffset=new Me({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:g})}let f=se.fromRectangle3D(t,n,a,$7e),d=se.fromRectangle3D(t,n,s,K7e);o=se.union(f,d)}else{if(r=qhe(e,i),r.attributes.position.values=li.scaleToGeodeticHeight(r.attributes.position.values,a,n,!1),l(e._offsetAttribute)){let f=r.attributes.position.values.length;u=e._offsetAttribute===mn.NONE?0:1;let d=new Uint8Array(f/3).fill(u);r.attributes.applyOffset=new Me({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}o=se.fromRectangle3D(t,n,a)}return new Tt({attributes:r.attributes,indices:r.indices,primitiveType:Re.LINES,boundingSphere:o,offsetAttribute:e._offsetAttribute})};var cv=sv;var Khe={FIXED:0,INERTIAL:1};Object.freeze(Khe);var Vi=Khe;var vb=30,tWe=1<<vb,nWe=1<<vb+1>>>0,ZX=2*vb+1,H_=4,Zhe=[],Qhe=[],iWe=[[0,1,3,2],[0,2,3,1],[3,2,0,1],[3,1,0,2]],G_=1,lv=2,lF=[G_,0,0,G_|lv];function ba(e){if(!fn.supportsBigInt())throw new oe("S2 required BigInt support");this._cellId=e,this._level=ba.getLevel(e)}ba.fromToken=function(e){return new ba(ba.getIdFromToken(e))};ba.isValidId=function(e){return!(e<=0||e>>BigInt(ZX)>5||!(e&~e+BigInt(1)&BigInt("0x1555555555555555")))};ba.isValidToken=function(e){return/^[0-9a-fA-F]{1,16}$/.test(e)?ba.isValidId(ba.getIdFromToken(e)):!1};ba.getIdFromToken=function(e){return BigInt("0x"+e+"0".repeat(16-e.length))};ba.getTokenFromId=function(e){let t=Math.floor(hWe(e)/4),n=e.toString(16).replace(/0*$/,"");return Array(17-t-n.length).join("0")+n};ba.getLevel=function(e){let t=0;for(;e!==BigInt(0)&&!(e&BigInt(1));)t++,e=e>>BigInt(1);return vb-(t>>1)};ba.prototype.getChild=function(e){let t=nme(this._cellId)>>BigInt(2),n=this._cellId+BigInt(2*e+1-4)*t;return new ba(n)};ba.prototype.getParent=function(){let e=nme(this._cellId)<<BigInt(2);return new ba(this._cellId&~e+BigInt(1)|e)};ba.prototype.getParentAtLevel=function(e){let t=fWe(e);return new ba(this._cellId&-t|t)};ba.prototype.getCenter=function(e){e=e??te.WGS84;let t=rWe(this._cellId,this._level);t=h.normalize(t,t);let n=de.fromCartesian(t,te.UNIT_SPHERE);return de.toCartesian(n,e,new h)};ba.prototype.getVertex=function(e,t){t=t??te.WGS84;let n=oWe(this._cellId,this._level,e);n=h.normalize(n,n);let i=de.fromCartesian(n,te.UNIT_SPHERE);return de.toCartesian(i,t,new h)};ba.fromFacePositionLevel=function(e,t,n){let i=(e<4?"0":"")+(e<2?"0":"")+e.toString(2),r=t.toString(2),o=Array(2*n-r.length+1).join("0"),a=Array(ZX-2*n).join("0"),s=BigInt(`0b${i}${o}${r}1${a}`);return new ba(s)};function rWe(e,t){let n=aWe(e,t);return sWe(n[0],n[1],n[2])}function oWe(e,t,n){let i=eme(e,t),r=cWe([i[1],i[2]],t),o=n>>1&1;return tme(i[0],r[0][o^n&1],r[1][o])}function aWe(e,t){let n=eme(e),i=n[0],r=n[1],o=n[2],a=t===30,s=!a&&(BigInt(r)^e>>BigInt(2))&BigInt(1),c=a?1:s?2:0,u=(r<<1)+c,f=(o<<1)+c;return[i,u,f]}function eme(e){Zhe.length===0&&uWe();let t=Number(e>>BigInt(ZX)),n=t&G_,i=(1<<H_)-1,r=0,o=0;for(let a=7;a>=0;a--){let c=(1<<2*(a===7?vb-7*H_:H_))-1;n+=Number(e>>BigInt(a*2*H_+1)&BigInt(c))<<2,n=Qhe[n];let u=a*H_;r+=n>>H_+2<<u,o+=(n>>2&i)<<u,n&=G_|lv}return[t,r,o]}function sWe(e,t,n){let i=$he(t),r=$he(n),o=uF(i),a=uF(r);return tme(e,o,a)}function tme(e,t,n){switch(e){case 0:return new h(1,t,n);case 1:return new h(-t,1,n);case 2:return new h(-t,-n,1);case 3:return new h(-1,-n,-t);case 4:return new h(n,-1,-t);default:return new h(n,t,-1)}}function uF(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function $he(e){return 1/nWe*e}function cWe(e,t){let n=[[],[]],i=lWe(t);for(let r=0;r<2;++r){let o=e[r]&-i,a=o+i;n[r][0]=uF(Jhe(o)),n[r][1]=uF(Jhe(a))}return n}function lWe(e){return 1<<vb-e>>>0}function Jhe(e){return 1/tWe*e}function W_(e,t,n,i,r,o){if(e===H_){let a=(t<<H_)+n;Zhe[(a<<2)+i]=(r<<2)+o,Qhe[(r<<2)+i]=(a<<2)+o}else{e++,t<<=1,n<<=1,r<<=2;let a=iWe[o];W_(e,t+(a[0]>>1),n+(a[0]&1),i,r,o^lF[0]),W_(e,t+(a[1]>>1),n+(a[1]&1),i,r+1,o^lF[1]),W_(e,t+(a[2]>>1),n+(a[2]&1),i,r+2,o^lF[2]),W_(e,t+(a[3]>>1),n+(a[3]&1),i,r+3,o^lF[3])}}function uWe(){W_(0,0,0,0,0,0),W_(0,0,0,G_,0,G_),W_(0,0,0,lv,0,lv),W_(0,0,0,G_|lv,0,G_|lv)}function nme(e){return e&~e+BigInt(1)}function fWe(e){return BigInt(1)<<BigInt(2*(vb-e))}var dWe=[64,0,1,39,2,15,40,23,3,12,16,59,41,19,24,54,4,64,13,10,17,62,60,28,42,30,20,51,25,44,55,47,5,32,65,38,14,22,11,58,18,53,63,9,61,27,29,50,43,46,31,37,21,57,52,8,26,49,45,36,56,7,48,35,6,34,33,0];function hWe(e){return dWe[(-e&e)%BigInt(67)]}var q_=ba;var ime={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};Object.freeze(ime);var ln=ime;function Y_(e,t,n){let i=e._element;if(i===document)return n.x=t.clientX,n.y=t.clientY,n;let r=i.getBoundingClientRect();return n.x=t.clientX-r.left,n.y=t.clientY-r.top,n}function rK(e,t){if(!l(t))return`${e}`;let n=Array.isArray(t)?t.toSorted():[t];return`${e}+${n.join("+")}`}function Eb(e){let t=[];if(e.shiftKey&&t.push(Xr.SHIFT),e.ctrlKey&&t.push(Xr.CTRL),e.altKey&&t.push(Xr.ALT),t.length)return t}var na={LEFT:0,MIDDLE:1,RIGHT:2};function Qu(e,t,n,i){function r(o){i(e,o)}n.addEventListener(t,r,{capture:!1,passive:!1}),e._removalFunctions.push(function(){n.removeEventListener(t,r,!1)})}function mWe(e){let t=e._element,n=l(t.disableRootEvents)?t:document;fn.supportsPointerEvents()?(Qu(e,"pointerdown",t,bWe),Qu(e,"pointerup",t,hme),Qu(e,"pointermove",t,xWe),Qu(e,"pointercancel",t,hme)):(Qu(e,"mousedown",t,mme),Qu(e,"mouseup",n,pme),Qu(e,"mousemove",n,gme),Qu(e,"touchstart",t,yWe),Qu(e,"touchend",n,cme),Qu(e,"touchmove",n,AWe),Qu(e,"touchcancel",n,cme)),Qu(e,"dblclick",t,gWe);let i;"onwheel"in t?i="wheel":document.onmousewheel!==void 0?i="mousewheel":i="DOMMouseScroll",Qu(e,i,t,_We)}function pWe(e){let t=e._removalFunctions;for(let n=0;n<t.length;++n)t[n]()}var rme={position:new k};function oK(e){e._lastSeenTouchEvent=An()}function aK(e){return An()-e._lastSeenTouchEvent>gh.mouseEmulationIgnoreMilliseconds}function iK(e,t,n){let i=e.x-t.x,r=e.y-t.y;return Math.sqrt(i*i+r*r)<n}function mme(e,t){if(!aK(e))return;let n=t.button;e._buttonDown[n]=!0;let i;if(n===na.LEFT)i=ln.LEFT_DOWN;else if(n===na.MIDDLE)i=ln.MIDDLE_DOWN;else if(n===na.RIGHT)i=ln.RIGHT_DOWN;else return;let r=Y_(e,t,e._primaryPosition);k.clone(r,e._primaryStartPosition),k.clone(r,e._primaryPreviousPosition);let o=Eb(t),a=e.getInputAction(i,o);l(a)&&(k.clone(r,rme.position),a(rme),t.preventDefault())}var ome={position:new k},ame={position:new k};function QX(e,t,n,i){let r=Eb(i),o=e.getInputAction(t,r),a=e.getInputAction(n,r);if(l(o)||l(a)){let s=Y_(e,i,e._primaryPosition);if(l(o)&&(k.clone(s,ome.position),o(ome)),l(a)){let c=e._primaryStartPosition;iK(c,s,e._clickPixelTolerance)&&(k.clone(s,ame.position),a(ame))}}}function pme(e,t){if(!aK(e))return;let n=t.button;n!==na.LEFT&&n!==na.MIDDLE&&n!==na.RIGHT||(e._buttonDown[na.LEFT]&&(QX(e,ln.LEFT_UP,ln.LEFT_CLICK,t),e._buttonDown[na.LEFT]=!1),e._buttonDown[na.MIDDLE]&&(QX(e,ln.MIDDLE_UP,ln.MIDDLE_CLICK,t),e._buttonDown[na.MIDDLE]=!1),e._buttonDown[na.RIGHT]&&(QX(e,ln.RIGHT_UP,ln.RIGHT_CLICK,t),e._buttonDown[na.RIGHT]=!1))}var eK={startPosition:new k,endPosition:new k};function gme(e,t){if(!aK(e))return;let n=Eb(t),i=Y_(e,t,e._primaryPosition),r=e._primaryPreviousPosition,o=e.getInputAction(ln.MOUSE_MOVE,n);l(o)&&(k.clone(r,eK.startPosition),k.clone(i,eK.endPosition),o(eK)),k.clone(i,r),(e._buttonDown[na.LEFT]||e._buttonDown[na.MIDDLE]||e._buttonDown[na.RIGHT])&&t.preventDefault()}var sme={position:new k};function gWe(e,t){let n=t.button,i;if(n===na.LEFT)i=ln.LEFT_DOUBLE_CLICK;else return;let r=Eb(t),o=e.getInputAction(i,r);l(o)&&(Y_(e,t,sme.position),o(sme))}function _We(e,t){let n;if(l(t.deltaY)){let o=t.deltaMode;o===t.DOM_DELTA_PIXEL?n=-t.deltaY:o===t.DOM_DELTA_LINE?n=-t.deltaY*40:n=-t.deltaY*120}else t.detail>0?n=t.detail*-120:n=t.wheelDelta;if(!l(n))return;let i=Eb(t),r=e.getInputAction(ln.WHEEL,i);l(r)&&(r(n),t.preventDefault())}function yWe(e,t){oK(e);let n=t.changedTouches,i,r=n.length,o,a,s=e._positions;for(i=0;i<r;++i)o=n[i],a=o.identifier,s.set(a,Y_(e,o,new k));fF(e,t);let c=e._previousPositions;for(i=0;i<r;++i)o=n[i],a=o.identifier,c.set(a,k.clone(s.get(a)))}function cme(e,t){oK(e);let n=t.changedTouches,i,r=n.length,o,a,s=e._positions;for(i=0;i<r;++i)o=n[i],a=o.identifier,s.remove(a);fF(e,t);let c=e._previousPositions;for(i=0;i<r;++i)o=n[i],a=o.identifier,c.remove(a)}var lme={position:new k},tK={position1:new k,position2:new k},ume={position:new k},fme={position:new k},dme={position:new k};function fF(e,t){let n=Eb(t),i=e._positions,r=i.length,o,a,s=e._isPinching;if(r!==1&&e._buttonDown[na.LEFT]){if(e._buttonDown[na.LEFT]=!1,l(e._touchHoldTimer)&&(clearTimeout(e._touchHoldTimer),e._touchHoldTimer=void 0),o=e.getInputAction(ln.LEFT_UP,n),l(o)&&(k.clone(e._primaryPosition,ume.position),o(ume)),r===0&&!e._isTouchHolding&&(a=e.getInputAction(ln.LEFT_CLICK,n),l(a))){let c=e._primaryStartPosition,u=e._previousPositions.values[0];iK(c,u,e._clickPixelTolerance)&&(k.clone(e._primaryPosition,fme.position),a(fme))}e._isTouchHolding=!1}if(r===0&&s&&(e._isPinching=!1,o=e.getInputAction(ln.PINCH_END,n),l(o)&&o()),r===1&&!s){let c=i.values[0];k.clone(c,e._primaryPosition),k.clone(c,e._primaryStartPosition),k.clone(c,e._primaryPreviousPosition),e._buttonDown[na.LEFT]=!0,o=e.getInputAction(ln.LEFT_DOWN,n),l(o)&&(k.clone(c,lme.position),o(lme)),e._touchHoldTimer=setTimeout(function(){if(!e.isDestroyed()&&(e._touchHoldTimer=void 0,e._isTouchHolding=!0,a=e.getInputAction(ln.RIGHT_CLICK,n),l(a))){let u=e._primaryStartPosition,f=e._previousPositions.values[0];iK(u,f,e._holdPixelTolerance)&&(k.clone(e._primaryPosition,dme.position),a(dme))}},gh.touchHoldDelayMilliseconds),t.preventDefault()}r===2&&!s&&(e._isPinching=!0,o=e.getInputAction(ln.PINCH_START,n),l(o)&&(k.clone(i.values[0],tK.position1),k.clone(i.values[1],tK.position2),o(tK),t.preventDefault()))}function AWe(e,t){oK(e);let n=t.changedTouches,i,r=n.length,o,a,s=e._positions;for(i=0;i<r;++i){o=n[i],a=o.identifier;let u=s.get(a);l(u)&&Y_(e,o,u)}_me(e,t);let c=e._previousPositions;for(i=0;i<r;++i)o=n[i],a=o.identifier,k.clone(s.get(a),c.get(a))}var nK={startPosition:new k,endPosition:new k},TP={distance:{startPosition:new k,endPosition:new k},angleAndHeight:{startPosition:new k,endPosition:new k}};function _me(e,t){let n=Eb(t),i=e._positions,r=e._previousPositions,o=i.length,a;if(o===1&&e._buttonDown[na.LEFT]){let s=i.values[0];k.clone(s,e._primaryPosition);let c=e._primaryPreviousPosition;a=e.getInputAction(ln.MOUSE_MOVE,n),l(a)&&(k.clone(c,nK.startPosition),k.clone(s,nK.endPosition),a(nK)),k.clone(s,c),t.preventDefault()}else if(o===2&&e._isPinching&&(a=e.getInputAction(ln.PINCH_MOVE,n),l(a))){let s=i.values[0],c=i.values[1],u=r.values[0],f=r.values[1],d=c.x-s.x,p=c.y-s.y,g=Math.sqrt(d*d+p*p)*.25,m=f.x-u.x,y=f.y-u.y,A=Math.sqrt(m*m+y*y)*.25,b=(c.y+s.y)*.125,x=(f.y+u.y)*.125,T=Math.atan2(p,d),C=Math.atan2(y,m);k.fromElements(0,A,TP.distance.startPosition),k.fromElements(0,g,TP.distance.endPosition),k.fromElements(C,x,TP.angleAndHeight.startPosition),k.fromElements(T,b,TP.angleAndHeight.endPosition),a(TP)}}function bWe(e,t){if(t.target.setPointerCapture(t.pointerId),t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.set(i,Y_(e,t,new k)),fF(e,t),e._previousPositions.set(i,k.clone(n.get(i)))}else mme(e,t)}function hme(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.remove(i),fF(e,t),e._previousPositions.remove(i)}else pme(e,t)}function xWe(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId,r=n.get(i);if(!l(r))return;Y_(e,t,r),_me(e,t);let o=e._previousPositions;k.clone(n.get(i),o.get(i))}else gme(e,t)}function gh(e){this._inputEvents={},this._buttonDown={[na.LEFT]:!1,[na.MIDDLE]:!1,[na.RIGHT]:!1},this._isPinching=!1,this._isTouchHolding=!1,this._lastSeenTouchEvent=-gh.mouseEmulationIgnoreMilliseconds,this._primaryStartPosition=new k,this._primaryPosition=new k,this._primaryPreviousPosition=new k,this._positions=new zt,this._previousPositions=new zt,this._removalFunctions=[],this._touchHoldTimer=void 0,this._clickPixelTolerance=5,this._holdPixelTolerance=25,this._element=e??document,mWe(this)}gh.prototype.setInputAction=function(e,t,n){let i=rK(t,n);this._inputEvents[i]=e};gh.prototype.getInputAction=function(e,t){let n=rK(e,t);return this._inputEvents[n]};gh.prototype.removeInputAction=function(e,t){let n=rK(e,t);delete this._inputEvents[n]};gh.prototype.isDestroyed=function(){return!1};gh.prototype.destroy=function(){return pWe(this),ue(this)};gh.mouseEmulationIgnoreMilliseconds=800;gh.touchHoldDelayMilliseconds=1500;var os=gh;function dF(e){e=e??!0,this.value=dF.toValue(e)}Object.defineProperties(dF.prototype,{componentDatatype:{get:function(){return Y.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 1}},normalize:{get:function(){return!1}}});dF.toValue=function(e,t){return l(t)?(t[0]=e,t):new Uint8Array([e])};var Dn=dF;var sK={};function TWe(e){let t=6.239996+.0172019696544*e;return .001657*Math.sin(t+.01671*Math.sin(t))}var CWe=32.184,vWe=2451545;function Fme(e,t){t=K.addSeconds(e,CWe,t);let n=K.totalDays(t)-vWe;return t=K.addSeconds(t,TWe(n),t),t}var hF=new K(2451545,0,ai.TAI),EWe=1e3,od=I.RADIANS_PER_DEGREE,ef=I.RADIANS_PER_ARCSECOND,gc=14959787e4,yme=new $;function Bme(e,t,n,i,r,o,a){n<0&&(n=-n,r+=I.PI);let s=e*(1-t),c=i-r,u=r,f=wWe(o-i,t),d=SWe(t,0);OWe(c,n,u,yme);let p=s*(1+t),g=Math.cos(f),m=Math.sin(f),y=1+t*g,A=p/y;return l(a)?(a.x=A*g,a.y=A*m,a.z=0):a=new h(A*g,A*m,0),$.multiplyByVector(yme,a,a)}function SWe(e,t){return e<=t?"Circular":e<1-t?"Elliptical":e<=1+t?"Parabolic":"Hyperbolic"}function wWe(e,t){let n=DWe(e,t);return RWe(n,t)}var IWe=50,PWe=I.EPSILON8;function DWe(e,t){let n=Math.floor(e/I.TWO_PI);e-=n*I.TWO_PI;let i=e+t*Math.sin(e)/(1-Math.sin(e+t)+Math.sin(e)),r=Number.MAX_VALUE,o;for(o=0;o<IWe&&Math.abs(r-i)>PWe;++o){r=i;let a=r-t*Math.sin(r)-e,s=1-t*Math.cos(r);i=r-a/s}return r=i+n*I.TWO_PI,r}function RWe(e,t){let n=Math.floor(e/I.TWO_PI);e-=n*I.TWO_PI;let i=Math.cos(e)-t,r=Math.sin(e)*Math.sqrt(1-t*t),o=Math.atan2(r,i);return o=I.zeroToTwoPi(o),e<0&&(o-=I.TWO_PI),o+=n*I.TWO_PI,o}function OWe(e,t,n,i){let r=Math.cos(e),o=Math.sin(e),a=Math.cos(t),s=Math.sin(t),c=Math.cos(n),u=Math.sin(n);return l(i)?(i[0]=c*r-u*o*a,i[1]=u*r+c*o*a,i[2]=o*s,i[3]=-c*o-u*r*a,i[4]=-u*o+c*r*a,i[5]=r*s,i[6]=u*s,i[7]=-c*s,i[8]=a):i=new $(c*r-u*o*a,-c*o-u*r*a,u*s,u*r+c*o*a,-u*o+c*r*a,-c*s,o*s,r*s,a),i}var MWe=1.0000010178*gc,LWe=100.46645683*od,NWe=129597742283429e-5*ef,Ame=16002,bme=21863,xme=32004,Tme=10931,Cme=14529,vme=16368,Eme=15318,Sme=32794,FWe=64*1e-7*gc,BWe=-152*1e-7*gc,kWe=62*1e-7*gc,zWe=-8*1e-7*gc,UWe=32*1e-7*gc,VWe=-41*1e-7*gc,jWe=19*1e-7*gc,HWe=-11*1e-7*gc,GWe=-150*1e-7*gc,WWe=-46*1e-7*gc,qWe=68*1e-7*gc,YWe=54*1e-7*gc,XWe=14*1e-7*gc,KWe=24*1e-7*gc,$We=-28*1e-7*gc,JWe=22*1e-7*gc,wme=10,Ime=16002,Pme=21863,Dme=10931,Rme=1473,Ome=32004,Mme=4387,Lme=73,ZWe=-325*1e-7,QWe=-322*1e-7,eqe=-79*1e-7,tqe=232*1e-7,nqe=-52*1e-7,iqe=97*1e-7,rqe=55*1e-7,oqe=-41*1e-7,aqe=-105*1e-7,sqe=-137*1e-7,cqe=258*1e-7,lqe=35*1e-7,uqe=-116*1e-7,fqe=-88*1e-7,dqe=-112*1e-7,hqe=-80*1e-7,uv=new K(0,0,ai.TAI);function mqe(e,t){Fme(e,uv);let i=(uv.dayNumber-hF.dayNumber+(uv.secondsOfDay-hF.secondsOfDay)/Un.SECONDS_PER_DAY)/(Un.DAYS_PER_JULIAN_CENTURY*10),r=.3595362*i,o=MWe+FWe*Math.cos(Ame*r)+GWe*Math.sin(Ame*r)+BWe*Math.cos(bme*r)+WWe*Math.sin(bme*r)+kWe*Math.cos(xme*r)+qWe*Math.sin(xme*r)+zWe*Math.cos(Tme*r)+YWe*Math.sin(Tme*r)+UWe*Math.cos(Cme*r)+XWe*Math.sin(Cme*r)+VWe*Math.cos(vme*r)+KWe*Math.sin(vme*r)+jWe*Math.cos(Eme*r)+$We*Math.sin(Eme*r)+HWe*Math.cos(Sme*r)+JWe*Math.sin(Sme*r),a=LWe+NWe*i+ZWe*Math.cos(wme*r)+aqe*Math.sin(wme*r)+QWe*Math.cos(Ime*r)+sqe*Math.sin(Ime*r)+eqe*Math.cos(Pme*r)+cqe*Math.sin(Pme*r)+tqe*Math.cos(Dme*r)+lqe*Math.sin(Dme*r)+nqe*Math.cos(Rme*r)+uqe*Math.sin(Rme*r)+iqe*Math.cos(Ome*r)+fqe*Math.sin(Ome*r)+rqe*Math.cos(Mme*r)+dqe*Math.sin(Mme*r)+oqe*Math.cos(Lme*r)+hqe*Math.sin(Lme*r),s=.0167086342-.0004203654*i,c=102.93734808*od+11612.3529*ef*i,u=469.97289*ef*i,f=174.87317577*od-8679.27034*ef*i;return Bme(o,s,u,c,f,a,t)}function kme(e,t){Fme(e,uv);let i=(uv.dayNumber-hF.dayNumber+(uv.secondsOfDay-hF.secondsOfDay)/Un.SECONDS_PER_DAY)/Un.DAYS_PER_JULIAN_CENTURY,r=i*i,o=r*i,a=o*i,s=383397.7725+.004*i,c=.055545526-16e-9*i,u=5.15668983*od,f=-8e-5*i+.02966*r-42e-6*o-13e-8*a,d=83.35324312*od,p=146434202669e-4*i-38.2702*r-.045047*o+21301e-8*a,g=125.04455501*od,m=-69679193631e-4*i+6.3602*r+.007625*o-3586e-8*a,y=218.31664563*od,A=17325593434847e-4*i-6.391*r+.006588*o-3169e-8*a,b=297.85019547*od+ef*(1602961601209e-3*i-6.3706*r+.006593*o-3169e-8*a),x=93.27209062*od+ef*(17395272628478e-4*i-12.7512*r-.001037*o+417e-8*a),T=134.96340251*od+ef*(17179159232178e-4*i+31.8792*r+.051635*o-2447e-7*a),C=357.52910918*od+ef*(1295965810481e-4*i-.5532*r+136e-6*o-1149e-8*a),E=310.17137918*od-ef*(6967051436e-3*i+6.2068*r+.007618*o-3219e-8*a),w=2*b,D=4*b,R=6*b,M=2*T,N=3*T,_=4*T,v=2*x;s+=3400.4*Math.cos(w)-635.6*Math.cos(w-T)-235.6*Math.cos(T)+218.1*Math.cos(w-C)+181*Math.cos(w+T),c+=.014216*Math.cos(w-T)+.008551*Math.cos(w-M)-.001383*Math.cos(T)+.001356*Math.cos(w+T)-.001147*Math.cos(D-N)-914e-6*Math.cos(D-M)+869e-6*Math.cos(w-C-T)-627e-6*Math.cos(w)-394e-6*Math.cos(D-_)+282e-6*Math.cos(w-C-M)-279e-6*Math.cos(b-T)-236e-6*Math.cos(M)+231e-6*Math.cos(D)+229e-6*Math.cos(R-_)-201e-6*Math.cos(M-v),f+=486.26*Math.cos(w-v)-40.13*Math.cos(w)+37.51*Math.cos(v)+25.73*Math.cos(M-v)+19.97*Math.cos(w-C-v),p+=-55609*Math.sin(w-T)-34711*Math.sin(w-M)-9792*Math.sin(T)+9385*Math.sin(D-N)+7505*Math.sin(D-M)+5318*Math.sin(w+T)+3484*Math.sin(D-_)-3417*Math.sin(w-C-T)-2530*Math.sin(R-_)-2376*Math.sin(w)-2075*Math.sin(w-N)-1883*Math.sin(M)-1736*Math.sin(R-5*T)+1626*Math.sin(C)-1370*Math.sin(R-N),m+=-5392*Math.sin(w-v)-540*Math.sin(C)-441*Math.sin(w)+423*Math.sin(v)-288*Math.sin(M-v),A+=-3332.9*Math.sin(w)+1197.4*Math.sin(w-T)-662.5*Math.sin(C)+396.3*Math.sin(T)-218*Math.sin(w-C);let S=2*E,P=3*E;f+=46.997*Math.cos(E)*i-.614*Math.cos(w-v+E)*i+.614*Math.cos(w-v-E)*i-.0297*Math.cos(S)*r-.0335*Math.cos(E)*r+.0012*Math.cos(w-v+S)*r-16e-5*Math.cos(E)*o+4e-5*Math.cos(P)*o+4e-5*Math.cos(S)*o;let L=2.116*Math.sin(E)*i-.111*Math.sin(w-v-E)*i-.0015*Math.sin(E)*r;p+=L,A+=L,m+=-520.77*Math.sin(E)*i+13.66*Math.sin(w-v+E)*i+1.12*Math.sin(w-E)*i-1.06*Math.sin(v-E)*i+.66*Math.sin(S)*r+.371*Math.sin(E)*r-.035*Math.sin(w-v+S)*r-.015*Math.sin(w-v+E)*r+.0014*Math.sin(E)*o-.0011*Math.sin(P)*o-9e-4*Math.sin(S)*o,s*=EWe;let F=u+f*ef,V=d+p*ef,z=y+A*ef,j=g+m*ef;return Bme(s,c,F,V,j,z,t)}var Nme=.012300034,pqe=Nme/(Nme+1)*-1;function gqe(e,t){return t=kme(e,t),h.multiplyByScalar(t,pqe,t)}var zme=new $(1.0000000000000002,5619723173785822e-31,4690511510146299e-34,-5154129427414611e-31,.9174820620691819,-.39777715593191376,-223970096136568e-30,.39777715593191376,.9174820620691819),CP=new h;sK.computeSunPositionInEarthInertialFrame=function(e,t){return l(e)||(e=K.now()),l(t)||(t=new h),CP=mqe(e,CP),t=h.negate(CP,t),gqe(e,CP),h.subtract(t,CP,t),$.multiplyByVector(zme,t,t),t};sK.computeMoonPositionInEarthInertialFrame=function(e,t){return l(e)||(e=K.now()),t=kme(e,t),$.multiplyByVector(zme,t,t),t};var Sb=sK;function _qe(e,t,n,i,r,o,a){let s=nr.numberOfPoints(e,t,r),c,u=n.red,f=n.green,d=n.blue,p=n.alpha,g=i.red,m=i.green,y=i.blue,A=i.alpha;if(U.equals(n,i)){for(c=0;c<s;c++)o[a++]=U.floatToByte(u),o[a++]=U.floatToByte(f),o[a++]=U.floatToByte(d),o[a++]=U.floatToByte(p);return a}let b=(g-u)/s,x=(m-f)/s,T=(y-d)/s,C=(A-p)/s,E=a;for(c=0;c<s;c++)o[E++]=U.floatToByte(u+c*b),o[E++]=U.floatToByte(f+c*x),o[E++]=U.floatToByte(d+c*T),o[E++]=U.floatToByte(p+c*C);return E}function vP(e){e=e??H.EMPTY_OBJECT;let t=e.positions,n=e.colors,i=e.colorsPerVertex??!1;this._positions=t,this._colors=n,this._colorsPerVertex=i,this._arcType=e.arcType??sn.GEODESIC,this._granularity=e.granularity??I.RADIANS_PER_DEGREE,this._ellipsoid=e.ellipsoid??te.default,this._workerName="createSimplePolylineGeometry";let r=1+t.length*h.packedLength;r+=l(n)?1+n.length*U.packedLength:1,this.packedLength=r+te.packedLength+3}vP.pack=function(e,t,n){n=n??0;let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=h.packedLength)h.pack(r[i],t,n);let a=e._colors;for(o=l(a)?a.length:0,t[n++]=o,i=0;i<o;++i,n+=U.packedLength)U.pack(a[i],t,n);return te.pack(e._ellipsoid,t,n),n+=te.packedLength,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};vP.unpack=function(e,t,n){t=t??0;let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=h.packedLength)o[i]=h.unpack(e,t);r=e[t++];let a=r>0?new Array(r):void 0;for(i=0;i<r;++i,t+=U.packedLength)a[i]=U.unpack(e,t);let s=te.unpack(e,t);t+=te.packedLength;let c=e[t++]===1,u=e[t++],f=e[t];return l(n)?(n._positions=o,n._colors=a,n._ellipsoid=s,n._colorsPerVertex=c,n._arcType=u,n._granularity=f,n):new vP({positions:o,colors:a,ellipsoid:s,colorsPerVertex:c,arcType:u,granularity:f})};var mF=new Array(2),pF=new Array(2),yqe={positions:mF,height:pF,ellipsoid:void 0,minDistance:void 0,granularity:void 0};vP.createGeometry=function(e){let t=e._positions,n=e._colors,i=e._colorsPerVertex,r=e._arcType,o=e._granularity,a=e._ellipsoid,s=I.chordLength(o,a.maximumRadius),c=l(n)&&!i,u,f=t.length,d,p,g,m,y=0;if(r===sn.GEODESIC||r===sn.RHUMB){let C,E,w;r===sn.GEODESIC?(C=I.chordLength(o,a.maximumRadius),E=nr.numberOfPoints,w=nr.generateArc):(C=o,E=nr.numberOfPointsRhumbLine,w=nr.generateRhumbArc);let D=nr.extractHeights(t,a),R=yqe;if(r===sn.GEODESIC?R.minDistance=s:R.granularity=o,R.ellipsoid=a,c){let M=0;for(u=0;u<f-1;u++)M+=E(t[u],t[u+1],C)+1;d=new Float64Array(M*3),g=new Uint8Array(M*4),R.positions=mF,R.height=pF;let N=0;for(u=0;u<f-1;++u){mF[0]=t[u],mF[1]=t[u+1],pF[0]=D[u],pF[1]=D[u+1];let _=w(R);if(l(n)){let v=_.length/3;m=n[u];for(let S=0;S<v;++S)g[N++]=U.floatToByte(m.red),g[N++]=U.floatToByte(m.green),g[N++]=U.floatToByte(m.blue),g[N++]=U.floatToByte(m.alpha)}d.set(_,y),y+=_.length}}else if(R.positions=t,R.height=D,d=new Float64Array(w(R)),l(n)){for(g=new Uint8Array(d.length/3*4),u=0;u<f-1;++u){let N=t[u],_=t[u+1],v=n[u],S=n[u+1];y=_qe(N,_,v,S,s,g,y)}let M=n[f-1];g[y++]=U.floatToByte(M.red),g[y++]=U.floatToByte(M.green),g[y++]=U.floatToByte(M.blue),g[y]=U.floatToByte(M.alpha)}}else{p=c?f*2-2:f,d=new Float64Array(p*3),g=l(n)?new Uint8Array(p*4):void 0;let C=0,E=0;for(u=0;u<f;++u){let w=t[u];if(c&&u>0&&(h.pack(w,d,C),C+=3,m=n[u-1],g[E++]=U.floatToByte(m.red),g[E++]=U.floatToByte(m.green),g[E++]=U.floatToByte(m.blue),g[E++]=U.floatToByte(m.alpha)),c&&u===f-1)break;h.pack(w,d,C),C+=3,l(n)&&(m=n[u],g[E++]=U.floatToByte(m.red),g[E++]=U.floatToByte(m.green),g[E++]=U.floatToByte(m.blue),g[E++]=U.floatToByte(m.alpha))}}let A=new xn;A.position=new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:d}),l(n)&&(A.color=new Me({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:4,values:g,normalize:!0})),p=d.length/3;let b=(p-1)*2,x=Ve.createTypedArray(p,b),T=0;for(u=0;u<p-1;++u)x[T++]=u,x[T++]=u+1;return new Tt({attributes:A,indices:x,primitiveType:Re.LINES,boundingSphere:se.fromPoints(t)})};var Ume=vP;function fv(e){let t=e.radius??1,i={radii:new h(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,vertexFormat:e.vertexFormat};this._ellipsoidGeometry=new Ks(i),this._workerName="createSphereGeometry"}fv.packedLength=Ks.packedLength;fv.pack=function(e,t,n){return Ks.pack(e._ellipsoidGeometry,t,n)};var Aqe=new Ks,X_={radius:void 0,radii:new h,vertexFormat:new Be,stackPartitions:void 0,slicePartitions:void 0};fv.unpack=function(e,t,n){let i=Ks.unpack(e,t,Aqe);return X_.vertexFormat=Be.clone(i._vertexFormat,X_.vertexFormat),X_.stackPartitions=i._stackPartitions,X_.slicePartitions=i._slicePartitions,l(n)?(h.clone(i._radii,X_.radii),n._ellipsoidGeometry=new Ks(X_),n):(X_.radius=i._radii.x,new fv(X_))};fv.createGeometry=function(e){return Ks.createGeometry(e._ellipsoidGeometry)};var gF=fv;function dv(e){let t=e.radius??1,i={radii:new h(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,subdivisions:e.subdivisions};this._ellipsoidGeometry=new Zf(i),this._workerName="createSphereOutlineGeometry"}dv.packedLength=Zf.packedLength;dv.pack=function(e,t,n){return Zf.pack(e._ellipsoidGeometry,t,n)};var bqe=new Zf,wb={radius:void 0,radii:new h,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};dv.unpack=function(e,t,n){let i=Zf.unpack(e,t,bqe);return wb.stackPartitions=i._stackPartitions,wb.slicePartitions=i._slicePartitions,wb.subdivisions=i._subdivisions,l(n)?(h.clone(i._radii,wb.radii),n._ellipsoidGeometry=new Zf(wb),n):(wb.radius=i._radii.x,new dv(wb))};dv.createGeometry=function(e){return Zf.createGeometry(e._ellipsoidGeometry)};var K_=dv;function Hc(e,t,n){this.clock=e??0,this.cone=t??0,this.magnitude=n??1}Hc.fromCartesian3=function(e,t){let n=e.x,i=e.y,r=e.z,o=n*n+i*i;return l(t)||(t=new Hc),t.clock=Math.atan2(i,n),t.cone=Math.atan2(Math.sqrt(o),r),t.magnitude=Math.sqrt(o+r*r),t};Hc.clone=function(e,t){if(l(e))return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=e.magnitude,t):new Hc(e.clock,e.cone,e.magnitude)};Hc.normalize=function(e,t){return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=1,t):new Hc(e.clock,e.cone,1)};Hc.equals=function(e,t){return e===t||l(e)&&l(t)&&e.clock===t.clock&&e.cone===t.cone&&e.magnitude===t.magnitude};Hc.equalsEpsilon=function(e,t,n){return n=n??0,e===t||l(e)&&l(t)&&Math.abs(e.clock-t.clock)<=n&&Math.abs(e.cone-t.cone)<=n&&Math.abs(e.magnitude-t.magnitude)<=n};Hc.prototype.equals=function(e){return Hc.equals(this,e)};Hc.prototype.clone=function(e){return Hc.clone(this,e)};Hc.prototype.equalsEpsilon=function(e,t){return Hc.equalsEpsilon(this,e,t)};Hc.prototype.toString=function(){return`(${this.clock}, ${this.cone}, ${this.magnitude})`};var _F=Hc;function hv(e){e=e??H.EMPTY_OBJECT;let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=Er.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(hv.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});hv.prototype.findTimeInterval=Er.prototype.findTimeInterval;hv.prototype.wrapTime=Er.prototype.wrapTime;hv.prototype.clampTime=Er.prototype.clampTime;hv.prototype.evaluate=function(e,t){let n=this.points;this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex);let i=this._lastTimeIndex,r=this._pointType;return r===Number?n[i]:(l(t)||(t=new r),r.clone(n[i],t))};var yF=hv;function EP({x:e,y:t,width:n,height:i}){this.rectangle=new Je(e,t,n,i),this.childNode1=void 0,this.childNode2=void 0,this.index=void 0}function cK({width:e,height:t,borderPadding:n}){this._width=e,this._height=t,this._borderPadding=n,this._root=new EP({x:n,y:n,width:e-2*n,height:t-2*n})}cK.prototype.pack=function(e,{width:t,height:n}){let i=this._findNode(this._root,{width:t,height:n});if(l(i))return i.index=e,i};cK.prototype._findNode=function(e,{width:t,height:n}){if(l(e)){if(!l(e.childNode1)&&!l(e.childNode2)){if(l(e.index))return;let{rectangle:i}=e,r=i.width,o=i.height,a=r-t,s=o-n;if(a<0||s<0)return;if(a===0&&s===0)return e;let c=this._borderPadding;if(a>s){e.childNode1=new EP({x:i.x,y:i.y,width:t,height:o});let f=a-c;return f>0&&(e.childNode2=new EP({x:i.x+t+c,y:i.y,width:f,height:o})),this._findNode(e.childNode1,{width:t,height:n})}e.childNode1=new EP({x:i.x,y:i.y,width:r,height:n});let u=s-c;return u>0&&(e.childNode2=new EP({x:i.x,y:i.y+n+c,width:r,height:u})),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 SP=cK;var xqe={WEST:0,NORTH:1,EAST:2,SOUTH:3,NORTHWEST:4,NORTHEAST:5,SOUTHWEST:6,SOUTHEAST:7},Pn=xqe;var lK=class{constructor(t){at(this,"ellipsoid");at(this,"rectangle");at(this,"projection")}getNumberOfXTilesAtLevel(t){pe.throwInstantiationError()}getNumberOfYTilesAtLevel(t){pe.throwInstantiationError()}rectangleToNativeRectangle(t,n){pe.throwInstantiationError()}tileXYToNativeRectangle(t,n,i,r){pe.throwInstantiationError()}tileXYToRectangle(t,n,i,r){pe.throwInstantiationError()}positionToTileXY(t,n,i){pe.throwInstantiationError()}},Vme=lK;function dK(e,t){return K.compare(e.start,t.start)}function ia(e){if(this._intervals=[],this._changedEvent=new be,l(e)){let t=e.length;for(let n=0;n<t;n++)this.addInterval(e[n])}}Object.defineProperties(ia.prototype,{changedEvent:{get:function(){return this._changedEvent}},start:{get:function(){let e=this._intervals;return e.length===0?void 0:e[0].start}},isStartIncluded:{get:function(){let e=this._intervals;return e.length===0?!1:e[0].isStartIncluded}},stop:{get:function(){let e=this._intervals,t=e.length;return t===0?void 0:e[t-1].stop}},isStopIncluded:{get:function(){let e=this._intervals,t=e.length;return t===0?!1:e[t-1].isStopIncluded}},length:{get:function(){return this._intervals.length}},isEmpty:{get:function(){return this._intervals.length===0}}});ia.prototype.equals=function(e,t){if(this===e)return!0;if(!(e instanceof ia))return!1;let n=this._intervals,i=e._intervals,r=n.length;if(r!==i.length)return!1;for(let o=0;o<r;o++)if(!Cn.equals(n[o],i[o],t))return!1;return!0};ia.prototype.get=function(e){return this._intervals[e]};ia.prototype.removeAll=function(){this._intervals.length>0&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))};ia.prototype.findIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t]:void 0};ia.prototype.findDataForIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0};ia.prototype.contains=function(e){return this.indexOf(e)>=0};var uK=new Cn;ia.prototype.indexOf=function(e){let t=this._intervals;uK.start=e,uK.stop=e;let n=Cr(t,uK,dK);return n>=0?t[n].isStartIncluded?n:n>0&&t[n-1].stop.equals(e)&&t[n-1].isStopIncluded?n-1:~n:(n=~n,n>0&&n-1<t.length&&Cn.contains(t[n-1],e)?n-1:~n)};ia.prototype.findInterval=function(e){e=e??H.EMPTY_OBJECT;let t=e.start,n=e.stop,i=e.isStartIncluded,r=e.isStopIncluded,o=this._intervals;for(let a=0,s=o.length;a<s;a++){let c=o[a];if((!l(t)||c.start.equals(t))&&(!l(n)||c.stop.equals(n))&&(!l(i)||c.isStartIncluded===i)&&(!l(r)||c.isStopIncluded===r))return o[a]}};ia.prototype.addInterval=function(e,t){if(e.isEmpty)return;let n=this._intervals;if(n.length===0||K.greaterThan(e.start,n[n.length-1].stop)){n.push(e),this._changedEvent.raiseEvent(this);return}let i=Cr(n,e,dK);i<0?i=~i:i>0&&e.isStartIncluded&&n[i-1].isStartIncluded&&n[i-1].start.equals(e.start)?--i:i<n.length&&!e.isStartIncluded&&n[i].isStartIncluded&&n[i].start.equals(e.start)&&++i;let r;for(i>0&&(r=K.compare(n[i-1].stop,e.start),(r>0||r===0&&(n[i-1].isStopIncluded||e.isStartIncluded))&&((l(t)?t(n[i-1].data,e.data):n[i-1].data===e.data)?(K.greaterThan(e.stop,n[i-1].stop)?e=new Cn({start:n[i-1].start,stop:e.stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:e.isStopIncluded,data:e.data}):e=new Cn({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):(r=K.compare(n[i-1].stop,e.stop),(r>0||r===0&&n[i-1].isStopIncluded&&!e.isStopIncluded)&&n.splice(i,0,new Cn({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 Cn({start:n[i-1].start,stop:e.start,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:n[i-1].data}))));i<n.length&&(r=K.compare(e.stop,n[i].start),r>0||r===0&&(e.isStopIncluded||n[i].isStartIncluded));)if(l(t)?t(n[i].data,e.data):n[i].data===e.data)e=new Cn({start:e.start,stop:K.greaterThan(n[i].stop,e.stop)?n[i].stop:e.stop,isStartIncluded:e.isStartIncluded,isStopIncluded:K.greaterThan(n[i].stop,e.stop)?n[i].isStopIncluded:e.isStopIncluded,data:e.data}),n.splice(i,1);else if(n[i]=new Cn({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)};ia.prototype.removeInterval=function(e){if(e.isEmpty)return!1;let t=this._intervals,n=Cr(t,e,dK);n<0&&(n=~n);let i=!1;for(n>0&&(K.greaterThan(t[n-1].stop,e.start)||t[n-1].stop.equals(e.start)&&t[n-1].isStopIncluded&&e.isStartIncluded)&&(i=!0,(K.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 Cn({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 Cn({start:t[n-1].start,stop:e.start,isStartIncluded:t[n-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:t[n-1].data})),n<t.length&&!e.isStartIncluded&&t[n].isStartIncluded&&e.start.equals(t[n].start)&&(i=!0,t.splice(n,0,new Cn({start:t[n].start,stop:t[n].start,isStartIncluded:!0,isStopIncluded:!0,data:t[n].data})),++n);n<t.length&&K.greaterThan(e.stop,t[n].stop);)i=!0,t.splice(n,1);return n<t.length&&e.stop.equals(t[n].stop)&&(i=!0,!e.isStopIncluded&&t[n].isStopIncluded?n+1<t.length&&t[n+1].start.equals(e.stop)&&t[n].data===t[n+1].data?(t.splice(n,1),t[n]=new Cn({start:t[n].start,stop:t[n].stop,isStartIncluded:!0,isStopIncluded:t[n].isStopIncluded,data:t[n].data})):t[n]=new Cn({start:e.stop,stop:e.stop,isStartIncluded:!0,isStopIncluded:!0,data:t[n].data}):t.splice(n,1)),n<t.length&&(K.greaterThan(e.stop,t[n].start)||e.stop.equals(t[n].start)&&e.isStopIncluded&&t[n].isStartIncluded)&&(i=!0,t[n]=new Cn({start:e.stop,stop:t[n].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[n].isStopIncluded,data:t[n].data})),i&&this._changedEvent.raiseEvent(this),i};ia.prototype.intersect=function(e,t,n){let i=new ia,r=0,o=0,a=this._intervals,s=e._intervals;for(;r<a.length&&o<s.length;){let c=a[r],u=s[o];if(K.lessThan(c.stop,u.start))++r;else if(K.lessThan(u.stop,c.start))++o;else{if(l(n)||l(t)&&t(c.data,u.data)||!l(t)&&u.data===c.data){let f=Cn.intersect(c,u,new Cn,n);f.isEmpty||i.addInterval(f,t)}K.lessThan(c.stop,u.stop)||c.stop.equals(u.stop)&&!c.isStopIncluded&&u.isStopIncluded?++r:++o}}return i};ia.fromJulianDateArray=function(e,t){l(t)||(t=new ia);let n=e.julianDates,i=n.length,r=e.dataCallback,o=e.isStartIncluded??!0,a=e.isStopIncluded??!0,s=e.leadingInterval??!1,c=e.trailingInterval??!1,u,f=0;s&&(++f,u=new Cn({start:Qe.MINIMUM_VALUE,stop:n[0],isStartIncluded:!0,isStopIncluded:!o}),u.data=l(r)?r(u,t.length):t.length,t.addInterval(u));for(let d=0;d<i-1;++d){let p=n[d],g=n[d+1];u=new Cn({start:p,stop:g,isStartIncluded:t.length===f?o:!0,isStopIncluded:d===i-2?a:!1}),u.data=l(r)?r(u,t.length):t.length,t.addInterval(u)}return c&&(u=new Cn({start:n[i-1],stop:Qe.MAXIMUM_VALUE,isStartIncluded:!a,isStopIncluded:!0}),u.data=l(r)?r(u,t.length):t.length,t.addInterval(u)),t};var Gc=new Zg,wP=[0,31,28,31,30,31,30,31,31,30,31,30,31];function fK(e,t,n){l(n)||(n=new K),K.toGregorianDate(e,Gc);let i=Gc.millisecond+t.millisecond,r=Gc.second+t.second,o=Gc.minute+t.minute,a=Gc.hour+t.hour,s=Gc.day+t.day,c=Gc.month+t.month,u=Gc.year+t.year;for(i>=1e3&&(r+=Math.floor(i/1e3),i=i%1e3),r>=60&&(o+=Math.floor(r/60),r=r%60),o>=60&&(a+=Math.floor(o/60),o=o%60),a>=24&&(s+=Math.floor(a/24),a=a%24),wP[2]=_m(u)?29:28;s>wP[c]||c>=13;)s>wP[c]&&(s-=wP[c],++c),c>=13&&(--c,u+=Math.floor(c/12),c=c%12,++c),wP[2]=_m(u)?29:28;return Gc.millisecond=i,Gc.second=r,Gc.minute=o,Gc.hour=a,Gc.day=s,Gc.month=c,Gc.year=u,K.fromGregorianDate(Gc,n)}var Tqe=new K,Cqe=/P(?:([\d.,]+)Y)?(?:([\d.,]+)M)?(?:([\d.,]+)W)?(?:([\d.,]+)D)?(?:T(?:([\d.,]+)H)?(?:([\d.,]+)M)?(?:([\d.,]+)S)?)?/;function jme(e,t){if(!l(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(Cqe);if(!l(n))return!1;if(l(n[1])&&(t.year=Number(n[1].replace(",","."))),l(n[2])&&(t.month=Number(n[2].replace(",","."))),l(n[3])&&(t.day=Number(n[3].replace(",","."))*7),l(n[4])&&(t.day+=Number(n[4].replace(",","."))),l(n[5])&&(t.hour=Number(n[5].replace(",","."))),l(n[6])&&(t.minute=Number(n[6].replace(",","."))),l(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"),K.toGregorianDate(K.fromIso8601(e,Tqe),t);return t.year||t.month||t.day||t.hour||t.minute||t.second||t.millisecond}var IP=new Zg;ia.fromIso8601=function(e,t){let n=e.iso8601.split("/"),i=K.fromIso8601(n[0]),r=K.fromIso8601(n[1]),o=[];if(!jme(n[2],IP))o.push(i,r);else{let a=K.clone(i);for(o.push(a);K.compare(a,r)<0;)a=fK(a,IP),K.compare(r,a)<=0&&K.clone(r,a),o.push(a)}return ia.fromJulianDateArray({julianDates:o,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};ia.fromIso8601DateArray=function(e,t){return ia.fromJulianDateArray({julianDates:e.iso8601Dates.map(function(n){return K.fromIso8601(n)}),isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};ia.fromIso8601DurationArray=function(e,t){let n=e.epoch,i=e.iso8601Durations,r=e.relativeToPrevious??!1,o=[],a,s,c=i.length;for(let u=0;u<c;++u)(jme(i[u],IP)||u===0)&&(r&&l(s)?a=fK(s,IP):a=fK(n,IP),o.push(a),s=a);return ia.fromJulianDateArray({julianDates:o,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};var xa=ia;var Hme={AUTODETECT:0,ENU:1,INERTIAL:2,VELOCITY:3};Object.freeze(Hme);var $_=Hme;var vqe=new h(1,1,1),Eqe=h.ZERO,Sqe=Fe.IDENTITY;function Gme(e,t,n){this.translation=h.clone(e??Eqe),this.rotation=Fe.clone(t??Sqe),this.scale=h.clone(n??vqe)}Gme.prototype.equals=function(e){return this===e||l(e)&&h.equals(this.translation,e.translation)&&Fe.equals(this.rotation,e.rotation)&&h.equals(this.scale,e.scale)};var Ib=Gme;function wqe(e,t){this.rectangle=e,this.maxLevel=t}function Wme(e){this.ellipsoid=e.ellipsoid??te.default,this.tilingScheme=void 0,this.heightmapWidth=void 0,this.heightmapHeight=void 0,this.levelZeroMaximumGeometricError=void 0,this.rectangles=[]}Wme.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 Iqe(e,t){let n=t.getElementsByTagName("SRS")[0].textContent;if(n==="EPSG:4326")e.tilingScheme=new $i({ellipsoid:e.ellipsoid});else throw new oe(`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=Vr.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.ellipsoid,Math.min(e.heightmapWidth,e.heightmapHeight),e.tilingScheme.getNumberOfXTilesAtLevel(0));let r=t.getElementsByTagName("DataExtent");for(let o=0;o<r.length;++o){let a=r[o],s=I.toRadians(parseFloat(a.getAttribute("minx"))),c=I.toRadians(parseFloat(a.getAttribute("miny"))),u=I.toRadians(parseFloat(a.getAttribute("maxx"))),f=I.toRadians(parseFloat(a.getAttribute("maxy"))),d=parseInt(a.getAttribute("maxlevel"),10);e.rectangles.push(new wqe(new ie(s,c,u,f),d))}}function Pqe(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i=`${i}: ${t.message}`),qr.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new oe(i)}async function Dqe(e,t,n){try{let i=await t.fetchXML();Iqe(e,i)}catch(i){Pqe(t,i,n)}}function J_(e){e=e??H.EMPTY_OBJECT,this._errorEvent=new be,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 wt(t)),this._credit=t,this._tilingScheme=void 0,this._rectangles=[]}Object.defineProperties(J_.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(){}}});J_.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT;let n=new Wme(t),i=De.createIfNeeded(e);await Dqe(n,i);let r=new J_(t);return n.build(r),r._resource=i,r};J_.prototype.requestTileGeometry=function(e,t,n,i){let r=this._tilingScheme.getNumberOfYTilesAtLevel(n),a=this._resource.getDerivedResource({url:`${n}/${e}/${r-t-1}.tif`,queryParameters:{cesium:!0},request:i}).fetchImage({preferImageBitmap:!0});if(!l(a))return;let s=this;return Promise.resolve(a).then(function(c){return new Lc({buffer:ym(c),width:s._heightmapWidth,height:s._heightmapHeight,childTileMask:Rqe(s,e,t,n),structure:s._terrainDataStructure})})};J_.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};var qme=new ie;function Rqe(e,t,n,i){let r=e._tilingScheme,o=e._rectangles,a=r.tileXYToRectangle(t,n,i),s=0;for(let c=0;c<o.length&&s!==15;++c){let u=o[c];if(u.maxLevel<=i)continue;let f=u.rectangle,d=ie.intersection(f,a,qme);l(d)&&(AF(r,f,t*2,n*2,i+1)&&(s|=4),AF(r,f,t*2+1,n*2,i+1)&&(s|=8),AF(r,f,t*2,n*2+1,i+1)&&(s|=1),AF(r,f,t*2+1,n*2+1,i+1)&&(s|=2))}return s}function AF(e,t,n,i,r){let o=e.tileXYToRectangle(n,i,r);return l(ie.intersection(o,t,qme))}J_.prototype.getTileDataAvailable=function(e,t,n){};J_.prototype.loadTileDataAvailability=function(e,t,n){};var Yme=J_;function Oqe(e,t){if(!e)throw new pe(t)}var Xme=Oqe;var _h=class _h{constructor(){at(this,"_collection",null);at(this,"_index",-1);at(this,"_byteOffset",-1)}static clone(t,n){let i=t._collection._getMaterialClass();return n.featureId=t.featureId,n.show=t.show,n.setMaterial(t.getMaterial(new i)),n}_isResizable(){return this._index===this._collection.primitiveCount-1}get featureId(){return this._getUint32(_h.Layout.FEATURE_ID_U32)}set featureId(t){this._setUint32(_h.Layout.FEATURE_ID_U32,t)}get show(){return this._getUint8(_h.Layout.SHOW_U8)===1}set show(t){this._setUint8(_h.Layout.SHOW_U8,t?1:0)}getMaterial(t){let n=this._collection,i=n._getMaterialClass();return i.unpack(n._materialView,this._index*i.packedLength,t)}setMaterial(t){let n=this._collection,i=n._getMaterialClass();return i.pack(t,n._materialView,this._index*i.packedLength),this._dirty=!0,t}get _dirty(){return this._getUint8(_h.Layout.DIRTY_U8)===1}set _dirty(t){this._collection._primitiveView.setUint8(this._byteOffset+_h.Layout.DIRTY_U8,t?1:0),t&&this._collection._makeDirty(this._index)}get _pickId(){return this._getUint32(_h.Layout.PICK_ID_U32)}set _pickId(t){this._setUint32(_h.Layout.PICK_ID_U32,t)}_getUint8(t){return this._collection._primitiveView.getUint8(this._byteOffset+t)}_setUint8(t,n){this._collection._primitiveView.setUint8(this._byteOffset+t,n),this._dirty=!0}_getUint32(t){return this._collection._primitiveView.getUint32(this._byteOffset+t,!0)}_setUint32(t,n){this._collection._primitiveView.setUint32(this._byteOffset+t,n,!0),this._dirty=!0}_getFloat32(t){return this._collection._primitiveView.getFloat32(this._byteOffset+t,!0)}_setFloat32(t,n){this._collection._primitiveView.setFloat32(this._byteOffset+t,n,!0),this._dirty=!0}toJSON(){let n=this._collection._getMaterialClass();return{featureId:this.featureId,show:this.show,dirty:this._dirty,material:this.getMaterial(new n).toJSON()}}};at(_h,"Layout",{FEATURE_ID_U32:0,SHOW_U8:4,DIRTY_U8:5,PICK_ID_U32:8,__BYTE_LENGTH:12});var hK=_h,ra=hK;var Kme={OPAQUE:0,TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};Object.freeze(Kme);var Fi=Kme;var PP=class PP{constructor(t=H.EMPTY_OBJECT){at(this,"_renderContext",null);this.show=t.show??!0,this._blendOption=t.blendOption??Fi.TRANSLUCENT,this._modelMatrix=O.clone(t.modelMatrix??O.IDENTITY),this._boundingVolume=se.clone(t.boundingVolume??new se,new se),this._boundingVolumeAutoUpdate=!l(t.boundingVolume),this._allowPicking=t.allowPicking??!1,this._pickIds=new Map,this._pickObjects=[],this.debugShowBoundingVolume=t.debugShowBoundingVolume??!1,this._primitiveCount=0,this._primitiveCountMax=t.primitiveCountMax??PP.DEFAULT_CAPACITY,this._primitiveView=null,this._positionCount=0,this._positionCountMax=t.vertexCountMax??PP.DEFAULT_CAPACITY,this._positionView=null,this._positionDatatype=t.positionDatatype??Y.DOUBLE,this._positionNormalized=t.positionNormalized??!1,this._materialView=null,this._dirtyOffset=0,this._dirtyCount=0,this._dirtyBoundingVolume=!1,this._version=0,this._allocatePrimitiveBuffer(),this._allocatePositionBuffer(),this._allocateMaterialBuffer()}_getCollectionClass(){pe.throwInstantiationError()}_getPrimitiveClass(){pe.throwInstantiationError()}_getMaterialClass(){pe.throwInstantiationError()}_allocatePrimitiveBuffer(){let t=this._getPrimitiveClass().Layout;this._primitiveView=new DataView(new ArrayBuffer(this._primitiveCountMax*t.__BYTE_LENGTH))}_allocatePositionBuffer(){this._positionView=Y.createTypedArray(this._positionDatatype,this._positionCountMax*3)}_allocateMaterialBuffer(){let t=this._getMaterialClass();this._materialView=new DataView(new ArrayBuffer(this._primitiveCountMax*t.packedLength))}isDestroyed(){return!1}destroy(){this._pickObjects.length=0;for(let t of this._pickIds.values())for(let n of t)n.destroy();l(this._renderContext)&&(this._renderContext.destroy(),this._renderContext=void 0,this._dirtyOffset=0,this._dirtyCount=this.primitiveCount)}sort(t,n=new Uint32Array(this.primitiveCount)){let i=this._getPrimitiveClass(),r=this._getCollectionClass(),{primitiveCount:o}=this,a=new i,s=new i,c=new Uint32Array(o);for(let f=0;f<o;f++)c[f]=f;c.sort((f,d)=>t(this.get(f,a),this.get(d,s)));for(let f=0;f<o;f++)n[c[f]]=f;let u=r._cloneEmpty(this);for(let f=0;f<o;f++){let d=this.get(c[f],a),p=u.add({},s);i.clone(d,p)}return r._replaceBuffers(u,this),this._dirtyOffset=0,this._dirtyCount=o,n}static clone(t,n){let i=t._getPrimitiveClass().Layout,r=t._getMaterialClass(),o=t._getPrimitiveClass();this._copySubDataView(t._primitiveView,n._primitiveView,t.primitiveCount*i.__BYTE_LENGTH),this._copySubArray(t._positionView,n._positionView,t.vertexCount*3),this._copySubDataView(t._materialView,n._materialView,t.primitiveCount*r.packedLength),n.show=t.show,n.debugShowBoundingVolume=t.debugShowBoundingVolume,n._primitiveCount=t._primitiveCount,n._positionCount=t._positionCount;let a=new o;for(let s=0,c=n.primitiveCount;s<c;s++)n.get(s,a)._pickId=0;return n._dirtyOffset=0,n._dirtyCount=n.primitiveCount,t.boundingVolume.clone(n.boundingVolume),n}static _cloneEmpty(t){pe.throwInstantiationError()}static _replaceBuffers(t,n){n._primitiveView=t._primitiveView,n._positionView=t._positionView,n._materialView=t._materialView}_updateBoundingVolume(){let t=this._positionView.subarray(0,this._positionCount*3);this._positionNormalized&&(t=an.dequantize(t,this._positionDatatype,Vt.VEC3,this._positionCount)),se.fromVertices(t,h.ZERO,3,this._boundingVolume),se.transform(this._boundingVolume,this._modelMatrix,this._boundingVolume),this._dirtyBoundingVolume=!1}_updatePickIds(t){let n=this._pickIds.get(t);if(n&&n.length===this._primitiveCount)return;n||(n=[],this._pickIds.set(t,n));let i=this,r=this._getPrimitiveClass(),o=new r;for(let a=n.length,s=this._primitiveCount;a<s;a++){this.get(a,o);let c=this._pickObjects[a]||{collection:this,index:a,get primitive(){return i.get(a,new r)}},u=t.createPickId(c);o._pickId=u.key,n.push(u)}}get(t,n){return n._collection=this,n._index=t,n._byteOffset=t*this._getPrimitiveClass().Layout.__BYTE_LENGTH,n}add(t=H.EMPTY_OBJECT,n){let i=this._getMaterialClass(),r=this._primitiveCount++;return n=this.get(r,n),n.featureId=t.featureId??r,n.show=t.show??!0,n.setMaterial(t.material??i.DEFAULT_MATERIAL),n._pickId=0,n._dirty=!0,l(t.pickObject)&&(this._pickObjects[r]=t.pickObject),n}_makeDirty(t){this._dirtyCount===0?(this._dirtyCount=1,this._dirtyOffset=t):t<this._dirtyOffset?(this._dirtyCount+=this._dirtyOffset-t,this._dirtyOffset=t):t+1>this._dirtyOffset+this._dirtyCount&&(this._dirtyCount=t+1-this._dirtyOffset)}_makeClean(){this._dirtyCount>0&&(this._dirtyCount=0,this._dirtyOffset=0,this._version++)}_makeDirtyBoundingVolume(){this._boundingVolumeAutoUpdate&&(this._dirtyBoundingVolume=!0)}update(t){t.mode!==re.SCENE3D&&pt("bufferprim-scenemode","BufferPrimitiveCollection requires SceneMode.SCENE3D."),this._dirtyBoundingVolume&&this._updateBoundingVolume(),this._allowPicking&&this._dirtyCount>0&&this._updatePickIds(t.context)}get primitiveCount(){return this._primitiveCount}get primitiveCountMax(){return this._primitiveCountMax}get byteLength(){return this._primitiveView.byteLength+this._positionView.byteLength+this._materialView.byteLength}get vertexCount(){return this._positionCount}get vertexCountMax(){return this._positionCountMax}get modelMatrix(){return this._modelMatrix}get boundingVolume(){return this._dirtyBoundingVolume&&this._updateBoundingVolume(),this._boundingVolume}get positionDatatype(){return this._positionDatatype}get positionNormalized(){return this._positionNormalized}static _copySubArray(t,n,i){for(let r=0;r<i;r++)n[r]=t[r]}static _copySubDataView(t,n,i){this._copySubArray(new Uint32Array(t.buffer,t.byteOffset,t.byteLength/4),new Uint32Array(n.buffer,n.byteOffset,n.byteLength/4),i/4)}toJSON(){let t=this._getPrimitiveClass(),n=new t,i=[];for(let r=0,o=this.primitiveCount;r<o;r++)i.push(this.get(r,n).toJSON());return i}};at(PP,"Error",{ERR_RESIZE:"BufferPrimitive range cannot be resized after initialization.",ERR_CAPACITY:"BufferPrimitiveCollection capacity exceeded.",ERR_MULTIPLE_OF_FOUR:"BufferPrimitive byte length must be a multiple of 4.",ERR_OUT_OF_RANGE:"BufferPrimitive buffer access out of range."});var bF=PP;bF.DEFAULT_CAPACITY=1024;var as=bF;var{ERR_CAPACITY:lAn,ERR_RESIZE:uAn,ERR_OUT_OF_RANGE:fAn}=as.Error,ad=class ad extends ra{constructor(){super(...arguments);at(this,"_collection",null)}static clone(n,i){return super.clone(n,i),i.setPositions(n.getPositions()),i.setHoles(n.getHoles()),i.setTriangles(n.getTriangles()),i}get vertexOffset(){return this._getUint32(ad.Layout.POSITION_OFFSET_U32)}get vertexCount(){return this._getUint32(ad.Layout.POSITION_COUNT_U32)}getPositions(n){return this._getPositionsRange(0,this.vertexCount,n)}setPositions(n){let i=this._collection,r=this.vertexOffset,o=this.vertexCount,a=n.length/3,s=i.vertexCount+a-o;i._positionCount=s,this._setUint32(ad.Layout.POSITION_COUNT_U32,a);let c=i._positionView;for(let u=0;u<a;u++)c[(r+u)*3]=n[u*3],c[(r+u)*3+1]=n[u*3+1],c[(r+u)*3+2]=n[u*3+2];this._dirty=!0,i._makeDirtyBoundingVolume()}get outerVertexOffset(){return this.vertexOffset}get outerVertexCount(){return this.holeCount>0?this.getHoles()[0]:this.vertexCount}getOuterPositions(n){return this._getPositionsRange(0,this.outerVertexCount,n)}get holeOffset(){return this._getUint32(ad.Layout.HOLE_OFFSET_U32)}get holeCount(){return this._getUint32(ad.Layout.HOLE_COUNT_U32)}getHoles(n){let{holeOffset:i,holeCount:r}=this,o=this._collection._holeIndexView;if(!l(n)){let a=o.byteOffset+i*o.BYTES_PER_ELEMENT,s=o.constructor;return new s(o.buffer,a,r)}for(let a=0;a<r;a++)n[a]=o[i+a];return n}setHoles(n){let i=this._collection,r=this.holeOffset,o=this.holeCount,a=n.length,s=i.holeCount+a-o;i._holeCount=s,this._setUint32(ad.Layout.HOLE_COUNT_U32,a);let c=i._holeIndexView;for(let u=0;u<a;u++)c[r+u]=n[u];this._dirty=!0}getHoleVertexCount(n){let i=this.getHoles(),r=i[n];return n===i.length-1?this.vertexCount-r:i[n+1]-r}getHolePositions(n,i){let o=this.getHoles()[n],a=this.getHoleVertexCount(n);return this._getPositionsRange(o,a,i)}_getPositionsRange(n,i,r){let o=this._collection,a=this._collection._positionView,s=this.vertexOffset+n;if(!l(r)){let c=a.byteOffset+s*3*a.BYTES_PER_ELEMENT,u=a.constructor;return new u(a.buffer,c,i*3)}for(let c=0;c<i;c++)r[c*3]=a[(s+c)*3],r[c*3+1]=a[(s+c)*3+1],r[c*3+2]=a[(s+c)*3+2];return r}get triangleOffset(){return this._getUint32(ad.Layout.TRIANGLE_OFFSET_U32)}get triangleCount(){return this._getUint32(ad.Layout.TRIANGLE_COUNT_U32)}getTriangles(n){let{triangleOffset:i,triangleCount:r}=this,o=this._collection._triangleIndexView;if(!l(n)){let a=o.byteOffset+i*3*o.BYTES_PER_ELEMENT,s=o.constructor;return new s(o.buffer,a,r*3)}for(let a=0;a<r;a++)n[a*3]=o[(i+a)*3],n[a*3+1]=o[(i+a)*3+1],n[a*3+2]=o[(i+a)*3+2];return n}setTriangles(n){let i=this._collection,r=this.triangleOffset,o=this.triangleCount,a=n.length/3,s=i.triangleCount+a-o;i._triangleCount+=a-o,this._setUint32(ad.Layout.TRIANGLE_COUNT_U32,a);let c=i._triangleIndexView;for(let u=0;u<a;u++)c[(r+u)*3]=n[u*3],c[(r+u)*3+1]=n[u*3+1],c[(r+u)*3+2]=n[u*3+2];this._dirty=!0}toJSON(){return{...super.toJSON(),positions:Array.from(this.getPositions()),holes:Array.from(this.getHoles()),triangles:Array.from(this.getTriangles())}}};at(ad,"Layout",{...ra.Layout,POSITION_OFFSET_U32:ra.Layout.__BYTE_LENGTH,POSITION_COUNT_U32:ra.Layout.__BYTE_LENGTH+4,HOLE_OFFSET_U32:ra.Layout.__BYTE_LENGTH+8,HOLE_COUNT_U32:ra.Layout.__BYTE_LENGTH+12,TRIANGLE_OFFSET_U32:ra.Layout.__BYTE_LENGTH+16,TRIANGLE_COUNT_U32:ra.Layout.__BYTE_LENGTH+20,__BYTE_LENGTH:ra.Layout.__BYTE_LENGTH+24});var mK=ad,oa=mK;var DP=class{constructor(t=H.EMPTY_OBJECT){this.color=U.clone(t.color??U.WHITE),this.outlineColor=U.clone(t.outlineColor??U.WHITE),this.outlineWidth=t.outlineWidth??0}static get packedLength(){return this.Layout.__BYTE_LENGTH}static pack(t,n,i){n.setUint32(this.Layout.COLOR_U32+i,t.color.toRgba(),!0),n.setUint32(this.Layout.OUTLINE_COLOR_U32+i,t.outlineColor.toRgba(),!0),n.setUint8(this.Layout.OUTLINE_WIDTH_U8+i,t.outlineWidth)}static unpack(t,n,i){return U.fromRgba(t.getUint32(this.Layout.COLOR_U32+n,!0),i.color),U.fromRgba(t.getUint32(this.Layout.OUTLINE_COLOR_U32+n,!0),i.outlineColor),i.outlineWidth=t.getUint8(this.Layout.OUTLINE_WIDTH_U8+n),i}toJSON(){return{color:this.color.toCssHexString(),outlineColor:this.outlineColor.toCssHexString(),outlineWidth:this.outlineWidth}}};at(DP,"Layout",{COLOR_U32:0,OUTLINE_COLOR_U32:4,OUTLINE_WIDTH_U8:8,__BYTE_LENGTH:12}),at(DP,"DEFAULT_MATERIAL");var su=DP;var xF=class xF extends su{constructor(t=H.EMPTY_OBJECT){super(t)}};at(xF,"DEFAULT_MATERIAL",Object.freeze(new xF));var pK=xF,sd=pK;var{ERR_RESIZE:EAn,ERR_CAPACITY:SAn}=as.Error,mv=class mv extends ra{constructor(){super(...arguments);at(this,"_collection",null)}static clone(n,i){return super.clone(n,i),i.setPositions(n.getPositions()),i}get vertexOffset(){return this._getUint32(mv.Layout.POSITION_OFFSET_U32)}get vertexCount(){return this._getUint32(mv.Layout.POSITION_COUNT_U32)}getPositions(n){let{vertexOffset:i,vertexCount:r}=this,o=this._collection._positionView;if(!l(n)){let a=o.byteOffset+i*3*o.BYTES_PER_ELEMENT,s=o.constructor;return new s(o.buffer,a,r*3)}for(let a=0;a<r;a++)n[a*3]=o[(i+a)*3],n[a*3+1]=o[(i+a)*3+1],n[a*3+2]=o[(i+a)*3+2];return n}setPositions(n){let i=this._collection,r=this.vertexOffset,o=this.vertexCount,a=n.length/3,s=i._positionCount+a-o;i._positionCount=s,this._setUint32(mv.Layout.POSITION_COUNT_U32,a);let c=i._positionView;for(let u=0;u<a;u++)c[(r+u)*3]=n[u*3],c[(r+u)*3+1]=n[u*3+1],c[(r+u)*3+2]=n[u*3+2];this._dirty=!0,i._makeDirtyBoundingVolume()}toJSON(){return{...super.toJSON(),positions:Array.from(this.getPositions())}}};at(mv,"Layout",{...ra.Layout,POSITION_OFFSET_U32:ra.Layout.__BYTE_LENGTH,POSITION_COUNT_U32:ra.Layout.__BYTE_LENGTH+4,__BYTE_LENGTH:ra.Layout.__BYTE_LENGTH+8});var gK=mv,Cs=gK;var RP=class RP extends su{constructor(t=H.EMPTY_OBJECT){super(t),this.width=t.width??1}static pack(t,n,i){super.pack(t,n,i),n.setUint8(this.Layout.WIDTH_U8+i,t.width)}static unpack(t,n,i){return super.unpack(t,n,i),i.width=t.getUint8(this.Layout.WIDTH_U8+n),i}toJSON(){return{...super.toJSON(),width:this.width}}};at(RP,"Layout",{...su.Layout,WIDTH_U8:su.Layout.__BYTE_LENGTH,__BYTE_LENGTH:su.Layout.__BYTE_LENGTH+4}),at(RP,"DEFAULT_MATERIAL",Object.freeze(new RP));var _K=RP,cd=_K;var $me=16,Mqe=.35,Jme=new Cs,Lqe=new cd,Zme=new oa,Nqe=new sd,Fqe=new h,Bqe=new h,kqe=new de,zqe=new k,Uqe=new k,AK=class{static packPolylineCollectionData(t,n,i){if(l(i)&&t._dirtyCount===0&&t._version===i.version)return i;let r=t.primitiveCount,o=t.boundingVolume,a=n.ellipsoid,s=ie.fromBoundingSphere(o,a),c=ipe(t,a),u=new Uint8Array(r),f=new Uint8Array(r*4);for(let d=0;d<r;d++){let g=t.get(d,Jme).getMaterial(Lqe);u[d]=g.width,f[d*4]=U.floatToByte(g.color.red),f[d*4+1]=U.floatToByte(g.color.green),f[d*4+2]=U.floatToByte(g.color.blue),f[d*4+3]=U.floatToByte(g.color.alpha)}return Object.assign(i??{},{version:t._version,rectangle:s,positions:c,widths:u,colors:f})}static packPolylineSegments(t,n,i,r){r.polylineSegments??(r.polylineSegments=[]),r.widths??(r.widths=[]),r.colors??(r.colors=[]),r.polylineSegmentPrimitiveIndices??(r.polylineSegmentPrimitiveIndices=[]),r.primitiveCount??(r.primitiveCount=0);let o=i.width,a=t.primitiveCount,s=n.positions;for(let c=0;c<a;c++){let u=t.get(c,Jme);if(!u.show)continue;let f=u.vertexCount,d=u.vertexOffset;for(let p=0;p+1<f;p++){let g=k.fromArray(s,(d+p)*2,zqe),m=k.fromArray(s,(d+p+1)*2,Uqe);Vqe(g,m,i,o),jqe(g,m,I.EPSILON3)&&(r.polylineSegments.push([g.x,g.y,m.x,m.y]),r.polylineSegmentPrimitiveIndices.push(r.primitiveCount+c))}}r.widths.push(n.widths),r.colors.push(n.colors),r.primitiveCount+=a}static packPolylineGrid(t){let n=t.polylineSegments,i=t.polylineSegmentPrimitiveIndices,r=Math.max(1,Math.ceil(Math.sqrt(n.length/$me))),o=new Array(r*r);for(let y=0;y<o.length;y++)o[y]=[];let a=0,s=Mqe/r;for(let y=0;y<n.length;y++){let A=n[y],b=Math.max(0,Math.min(A[0],A[2])-s),x=Math.min(1,Math.max(A[0],A[2])+s),T=Math.max(0,Math.min(A[1],A[3])-s),C=Math.min(1,Math.max(A[1],A[3])+s),E=Z_(Math.floor(b*r),r),w=Z_(Math.floor(x*r),r),D=Z_(Math.floor(T*r),r),R=Z_(Math.floor(C*r),r);for(let M=D;M<=R;M++)for(let N=E;N<=w;N++)o[M*r+N].push(y),a++}let[c,u]=TF(a),f=c*u,d=new Float32Array(f*4).fill(-1),p=new Float32Array(f).fill(-1),g=new Uint32Array(o.length+2);g[0]=r,g[1]=r;let m=0;for(let y=0;y<o.length;y++){let A=o[y];for(let b=0;b<A.length;b++){let x=A[b],T=n[x];d[m*4]=T[0],d[m*4+1]=T[1],d[m*4+2]=T[2],d[m*4+3]=T[3];let C=i[x];p[m]=C,m++}g[y+2]=m}t.polylineSegmentTexels=d,t.polylineSegmentTextureWidth=c,t.polylineSegmentTextureHeight=u,t.polylineSegmentPrimitiveIndicesTexels=p,t.polylineGridCellIndices=g}static packPolygonCollectionData(t,n,i){if(l(i)&&t._dirtyCount===0&&t._version===i.version)return i;let r=t.primitiveCount,o=t.boundingVolume,a=n.ellipsoid,s=ie.fromBoundingSphere(o,a),c=ipe(t,a),u=new Uint8Array(r),f=new Uint8Array(r*4);for(let d=0;d<r;d++){let g=t.get(d,Zme).getMaterial(Nqe);f[d*4]=U.floatToByte(g.color.red),f[d*4+1]=U.floatToByte(g.color.green),f[d*4+2]=U.floatToByte(g.color.blue),f[d*4+3]=U.floatToByte(g.color.alpha)}return Object.assign(i??{},{version:t._version,rectangle:s,positions:c,widths:u,colors:f})}static packPolygonRings(t,n,i,r){r.polygonRings??(r.polygonRings=[]),r.polygonRingPrimitiveIndices??(r.polygonRingPrimitiveIndices=[]),r.widths??(r.widths=[]),r.colors??(r.colors=[]),r.primitiveCount??(r.primitiveCount=0);let o=i.width,a=t.primitiveCount,s=n.positions;for(let c=0;c<a;c++){let u=t.get(c,Zme);if(!u.show)continue;let f=u.vertexOffset,d=u.vertexCount,p=u.getHoles();for(let g=0;g<=p.length;g++){let m=g===0?0:p[g-1],A=(g===p.length?d:p[g])-m;if(A<3)continue;let b=Hqe(s,f+m,A,i,o),x=tpe(b,A,-I.EPSILON3,1+I.EPSILON3,-I.EPSILON3,1+I.EPSILON3,epe);x.vertexCount<3||(r.polygonRings.push(x.positions.slice(0,x.vertexCount*2)),r.polygonRingPrimitiveIndices.push(r.primitiveCount+c))}}r.widths.push(n.widths),r.colors.push(n.colors),r.primitiveCount+=a}static packPolygonGrid(t){let n=t.polygonRings,i=t.polygonRingPrimitiveIndices,r=0;for(let y=0;y<n.length;y++)r+=n[y].length/2;let o=Math.max(1,Math.ceil(Math.sqrt(r/$me))),a=new Array(o*o);for(let y=0;y<a.length;y++)a[y]=[];let s=0;for(let y=0;y<n.length;y++){let A=n[y],b=i[y],x=A.length/2,T=1/0,C=1/0,E=-1/0,w=-1/0;for(let _=0;_<x;_++)T=Math.min(T,A[_*2]),E=Math.max(E,A[_*2]),C=Math.min(C,A[_*2+1]),w=Math.max(w,A[_*2+1]);let D=Z_(Math.floor(T*o),o),R=Z_(Math.floor(E*o),o),M=Z_(Math.floor(C*o),o),N=Z_(Math.floor(w*o),o);for(let _=M;_<=N;_++)for(let v=D;v<=R;v++){let S=tpe(A,x,v/o-I.EPSILON5,(v+1)/o+I.EPSILON5,_/o-I.EPSILON5,(_+1)/o+I.EPSILON5,epe),P=S.vertexCount;if(P<3)continue;let L=S.positions,F=a[_*o+v];for(let V=0;V<P;V++){let z=(V+1)%P,j=L[V*2],B=L[V*2+1],G=L[z*2],W=L[z*2+1];B!==W&&(F.push(j,B,G,W,b),s++)}}}let[c,u]=TF(s),f=c*u,d=new Float32Array(f*4).fill(-1),p=new Float32Array(f).fill(-1),g=new Uint32Array(a.length+2);g[0]=o,g[1]=o;let m=0;for(let y=0;y<a.length;y++){let A=a[y];for(let b=0;b<A.length;b+=5)d[m*4]=A[b],d[m*4+1]=A[b+1],d[m*4+2]=A[b+2],d[m*4+3]=A[b+3],p[m]=A[b+4],m++;g[y+2]=m}t.polygonEdgeTexels=d,t.polygonEdgeTextureWidth=c,t.polygonEdgeTextureHeight=u,t.polygonEdgePrimitiveIndicesTexels=p,t.polygonGridCellIndices=g}static packPrimitiveTextures(t,n){let[i,r]=TF(n.primitiveCount),o=new Uint8Array(i*r);o.set(rpe(n.widths)),n.widthTexture=new Et({context:t,pixelFormat:He.RED,pixelDatatype:ke.UNSIGNED_BYTE,source:{width:i,height:r,arrayBufferView:o},sampler:Ut.NEAREST,flipY:!1});let a=new Uint8Array(i*r*4);a.set(rpe(n.colors)),n.colorTexture=new Et({context:t,pixelFormat:He.RGBA,pixelDatatype:ke.UNSIGNED_BYTE,source:{width:i,height:r,arrayBufferView:a},sampler:Ut.NEAREST,flipY:!1})}static packPolylineTextures(t,n){n.polylineSegmentTexture=new Et({context:t,pixelFormat:He.RGBA,pixelDatatype:ke.FLOAT,source:{width:n.polylineSegmentTextureWidth,height:n.polylineSegmentTextureHeight,arrayBufferView:n.polylineSegmentTexels},sampler:Ut.NEAREST,flipY:!1}),n.polylineSegmentPrimitiveIndicesTexture=new Et({context:t,pixelFormat:He.RED,pixelDatatype:ke.FLOAT,source:{width:n.polylineSegmentTextureWidth,height:n.polylineSegmentTextureHeight,arrayBufferView:n.polylineSegmentPrimitiveIndicesTexels},sampler:Ut.NEAREST,flipY:!1}),n.polylineGridCellIndicesTexture=npe(t,n.polylineGridCellIndices)}static packPolygonTextures(t,n){n.polygonEdgeTexture=new Et({context:t,pixelFormat:He.RGBA,pixelDatatype:ke.FLOAT,source:{width:n.polygonEdgeTextureWidth,height:n.polygonEdgeTextureHeight,arrayBufferView:n.polygonEdgeTexels},sampler:Ut.NEAREST,flipY:!1}),n.polygonEdgePrimitiveIndicesTexture=new Et({context:t,pixelFormat:He.RED,pixelDatatype:ke.FLOAT,source:{width:n.polygonEdgeTextureWidth,height:n.polygonEdgeTextureHeight,arrayBufferView:n.polygonEdgePrimitiveIndicesTexels},sampler:Ut.NEAREST,flipY:!1}),n.polygonGridCellIndicesTexture=npe(t,n.polygonGridCellIndices)}static freeResources(t){t.polylineSegmentTexture?.destroy(),t.widthTexture?.destroy(),t.colorTexture?.destroy(),t.polylineSegmentPrimitiveIndicesTexture?.destroy(),t.polylineGridCellIndicesTexture?.destroy(),t.polygonEdgeTexture?.destroy(),t.polygonEdgePrimitiveIndicesTexture?.destroy(),t.polygonGridCellIndicesTexture?.destroy()}};function Vqe(e,t,n,i){let r=e.x,o=t.x;o=r+I.negativePiToPi(o-r);let a=n.west+i*.5,s=a+I.negativePiToPi(r-a)-r;r+=s,o+=s;let c=n.north-n.south;e.x=(r-n.west)/i,e.y=(e.y-n.south)/c,t.x=(o-n.west)/i,t.y=(t.y-n.south)/c}function jqe(e,t,n){let i=-n,r=1+n,o=0,a=1,s=e.x,c=e.y,u=t.x,f=t.y,d=u-s,p=f-c,g=[-d,d,-p,p],m=[s-i,r-s,c-i,r-c];for(let y=0;y<4;y++){if(Math.abs(g[y])<1e-12){if(m[y]<0)return!1;continue}let A=m[y]/g[y];if(g[y]<0?o=Math.max(o,A):a=Math.min(a,A),o>a)return!1}return e.x=s+o*d,e.y=c+o*p,t.x=s+a*d,t.y=c+a*p,!0}function Z_(e,t){return Math.max(0,Math.min(t-1,e))}var yK=new Float64Array(512),Qme=new Float64Array(512),epe={positions:new Float64Array(512),vertexCount:0};function Hqe(e,t,n,i,r){yK.length<n*2&&(yK=new Float64Array(n*4));let o=yK,a=i.north-i.south,s=e[t*2];o[0]=s,o[1]=e[t*2+1];for(let d=1;d<n;d++){let p=s+I.negativePiToPi(e[(t+d)*2]-s);o[d*2]=p,o[d*2+1]=e[(t+d)*2+1],s=p}let c=i.west+r*.5,u=o[0],f=c+I.negativePiToPi(u-c)-u;for(let d=0;d<n;d++)o[d*2]=(o[d*2]+f-i.west)/r,o[d*2+1]=(o[d*2+1]-i.south)/a;return o}function tpe(e,t,n,i,r,o,a){let s=e,c=t;for(let u=0;u<4;u++){let f=u>>1,d=(u&1)===0?1:-1,p=u===0?n:u===1?i:u===2?r:o,g=c*4+4,m=(u&1)===0,y=m?Qme:a.positions;y.length<g&&(y=new Float64Array(g*2),m?Qme=y:a.positions=y);let A=0,b=s[(c-1)*2],x=s[(c-1)*2+1],T=d*((f===0?b:x)-p)>=0;for(let C=0;C<c;C++){let E=s[C*2],w=s[C*2+1],D=d*((f===0?E:w)-p)>=0;if(D!==T){let R=f===0?(p-b)/(E-b):(p-x)/(w-x);y[A*2]=f===0?p:b+R*(E-b),y[A*2+1]=f===0?x+R*(w-x):p,A++}D&&(y[A*2]=E,y[A*2+1]=w,A++),b=E,x=w,T=D}if(A===0)return a.vertexCount=0,a;s=y,c=A}return a.vertexCount=c,a}function TF(e){let t=I.nextPowerOfTwo(Math.max(1,Math.ceil(Math.sqrt(e)))),n=I.nextPowerOfTwo(Math.max(1,Math.ceil(e/t)));return[t,n]}function npe(e,t){let[n,i]=TF(t.length),r=new Float32Array(n*i);return r.set(t),new Et({context:e,pixelFormat:He.RED,pixelDatatype:ke.FLOAT,source:{width:n,height:i,arrayBufferView:r},sampler:Ut.NEAREST,flipY:!1})}function ipe(e,t,n){l(n)||(n=new Float64Array(e._positionCountMax*2));let i=e._positionView,r=e.modelMatrix;for(let o=0;o<e._positionCount;o++){let a=h.fromArray(i,o*3,Fqe),s=O.multiplyByPoint(r,a,Bqe),c=t.cartesianToCartographic(s,kqe);n[o*2]=c.longitude,n[o*2+1]=c.latitude}return n}function rpe(e){let t=0;for(let r of e)t+=r.byteLength;let n=new Uint8Array(t),i=0;for(let r of e)n.set(r,i),i+=r.byteLength;return n}var Tl=AK;function Gqe(e,t,n,i){let r=l(t.vertexBuffer),o=l(t.value),a=t.value?t.value.length:t.componentsPerAttribute,s={index:t.index??n,enabled:t.enabled??!0,vertexBuffer:t.vertexBuffer,value:o?t.value.slice(0):void 0,componentsPerAttribute:a,componentDatatype:t.componentDatatype??Y.FLOAT,normalize:t.normalize??!1,offsetInBytes:t.offsetInBytes??0,strideInBytes:t.strideInBytes??0,instanceDivisor:t.instanceDivisor??0};if(r)s.vertexAttrib=function(c){let u=this.index;c.bindBuffer(c.ARRAY_BUFFER,this.vertexBuffer._getBuffer()),c.vertexAttribPointer(u,this.componentsPerAttribute,this.componentDatatype,this.normalize,this.strideInBytes,this.offsetInBytes),c.enableVertexAttribArray(u),this.instanceDivisor>0&&(i.glVertexAttribDivisor(u,this.instanceDivisor),i._vertexAttribDivisors[u]=this.instanceDivisor,i._previousDrawInstanced=!0)},s.disableVertexAttribArray=function(c){c.disableVertexAttribArray(this.index),this.instanceDivisor>0&&i.glVertexAttribDivisor(n,0)};else{switch(s.componentsPerAttribute){case 1:s.vertexAttrib=function(c){c.vertexAttrib1fv(this.index,this.value)};break;case 2:s.vertexAttrib=function(c){c.vertexAttrib2fv(this.index,this.value)};break;case 3:s.vertexAttrib=function(c){c.vertexAttrib3fv(this.index,this.value)};break;case 4:s.vertexAttrib=function(c){c.vertexAttrib4fv(this.index,this.value)};break}s.disableVertexAttribArray=function(c){}}e.push(s)}function ape(e,t,n){for(let i=0;i<t.length;++i){let r=t[i];r.enabled&&r.vertexAttrib(e)}l(n)&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,n._getBuffer())}function yh(e){e=e??H.EMPTY_OBJECT;let t=e.context,n=t._gl,i=e.attributes,r=e.indexBuffer,o,a=[],s=1,c=!1,u=!1,f=i.length;for(o=0;o<f;++o)Gqe(a,i[o],o,t);for(f=a.length,o=0;o<f;++o){let p=a[o];if(l(p.vertexBuffer)&&p.instanceDivisor===0){let g=p.strideInBytes||p.componentsPerAttribute*Y.getSizeInBytes(p.componentDatatype);s=p.vertexBuffer.sizeInBytes/g;break}}for(o=0;o<f;++o)a[o].instanceDivisor>0&&(c=!0),l(a[o].value)&&(u=!0);let d;t.vertexArrayObject&&(d=t.glCreateVertexArray(),t.glBindVertexArray(d),ape(n,a,r),t.glBindVertexArray(null)),this._numberOfVertices=s,this._hasInstancedAttributes=c,this._hasConstantAttributes=u,this._context=t,this._gl=n,this._vao=d,this._attributes=a,this._indexBuffer=r}function ope(e){return e.values.length/e.componentsPerAttribute}function Wqe(e){return Y.getSizeInBytes(e.componentDatatype)*e.componentsPerAttribute}function qqe(e){let t,n,i,r=[];for(n in e)e.hasOwnProperty(n)&&l(e[n])&&l(e[n].values)&&(r.push(n),e[n].componentDatatype===Y.DOUBLE&&(e[n].componentDatatype=Y.FLOAT,e[n].values=Y.createTypedArray(Y.FLOAT,e[n].values)));let o,a=r.length;if(a>0)for(o=ope(e[r[0]]),t=1;t<a;++t){let u=ope(e[r[t]]);if(u!==o)throw new oe(`Each attribute list must have the same number of vertices. Attribute ${r[t]} has a different number of vertices (${u.toString()}) than attribute ${r[0]} (${o.toString()}).`)}r.sort(function(u,f){return Y.getSizeInBytes(e[f].componentDatatype)-Y.getSizeInBytes(e[u].componentDatatype)});let s=0,c={};for(t=0;t<a;++t)n=r[t],i=e[n],c[n]=s,s+=Wqe(i);if(s>0){let u=Y.getSizeInBytes(e[r[0]].componentDatatype),f=s%u;f!==0&&(s+=u-f);let d=o*s,p=new ArrayBuffer(d),g={};for(t=0;t<a;++t){n=r[t];let m=Y.getSizeInBytes(e[n].componentDatatype);g[n]={pointer:Y.createTypedArray(e[n].componentDatatype,p),index:c[n]/m,strideInComponentType:s/m}}for(t=0;t<o;++t)for(let m=0;m<a;++m){n=r[m],i=e[n];let y=i.values,A=g[n],b=A.pointer,x=i.componentsPerAttribute;for(let T=0;T<x;++T)b[A.index+T]=y[t*x+T];A.index+=A.strideInComponentType}return{buffer:p,offsetsInBytes:c,vertexSizeInBytes:s}}}yh.fromGeometry=function(e){e=e??H.EMPTY_OBJECT;let t=e.context,n=e.geometry??H.EMPTY_OBJECT,i=e.bufferUsage??Oe.DYNAMIC_DRAW,r=e.attributeLocations??H.EMPTY_OBJECT,o=e.interleave??!1,a=e.vertexArrayAttributes,s,c,u,f=l(a)?a:[],d=n.attributes;if(o){let m=qqe(d);if(l(m)){u=Ze.createVertexBuffer({context:t,typedArray:m.buffer,usage:i});let y=m.offsetsInBytes,A=m.vertexSizeInBytes;for(s in d)d.hasOwnProperty(s)&&l(d[s])&&(c=d[s],l(c.values)?f.push({index:r[s],vertexBuffer:u,componentDatatype:c.componentDatatype,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize,offsetInBytes:y[s],strideInBytes:A}):f.push({index:r[s],value:c.value,componentDatatype:c.componentDatatype,normalize:c.normalize}))}}else for(s in d)if(d.hasOwnProperty(s)&&l(d[s])){c=d[s];let m=c.componentDatatype;m===Y.DOUBLE&&(m=Y.FLOAT);let y={};l(c.values)&&(u=Ze.createVertexBuffer({context:t,typedArray:Y.createTypedArray(m,c.values),usage:i}),y={index:r[s],vertexBuffer:u,value:c.value,componentDatatype:m,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize}),l(c.typedArray)&&(u=Ze.createVertexBuffer({context:t,typedArray:c.typedArray,usage:i}),y={index:r[s],vertexBuffer:u,value:void 0,componentDatatype:m,componentsPerAttribute:Vt.getNumberOfComponents(c.type),normalize:c.normalized,instanceDivisor:c.instanceDivisor}),f.push(y)}let p,g=n.indices;return l(g)&&(Tt.computeNumberOfVertices(n)>=I.SIXTY_FOUR_KILOBYTES&&t.elementIndexUint?p=Ze.createIndexBuffer({context:t,typedArray:new Uint32Array(g),usage:i,indexDatatype:Ve.UNSIGNED_INT}):p=Ze.createIndexBuffer({context:t,typedArray:new Uint16Array(g),usage:i,indexDatatype:Ve.UNSIGNED_SHORT})),new yh({context:t,attributes:f,indexBuffer:p})};Object.defineProperties(yh.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}});yh.prototype.getAttribute=function(e){return this._attributes[e]};function Yqe(e){let t=e._context,n=e._hasInstancedAttributes;if(!n&&!t._previousDrawInstanced)return;t._previousDrawInstanced=n;let i=t._vertexAttribDivisors,r=e._attributes,o=Ft.maximumVertexAttributes,a;if(n){let s=r.length;for(a=0;a<s;++a){let c=r[a];if(c.enabled){let u=c.instanceDivisor,f=c.index;u!==i[f]&&(t.glVertexAttribDivisor(f,u),i[f]=u)}}}else for(a=0;a<o;++a)i[a]>0&&(t.glVertexAttribDivisor(a,0),i[a]=0)}function Xqe(e,t){let n=e._attributes,i=n.length;for(let r=0;r<i;++r){let o=n[r];o.enabled&&l(o.value)&&o.vertexAttrib(t)}}yh.prototype.copyAttributeFromRange=function(e,t,n,i){let r=this.getAttribute(e),o=r.vertexBuffer,a=r.componentsPerAttribute,s=t.constructor,c=n*a*s.BYTES_PER_ELEMENT,u=new s(t.buffer,t.byteOffset+c,i*a);o.copyFromArrayView(u,c)};yh.prototype.copyIndexFromRange=function(e,t,n){let i=this._indexBuffer,r=e.constructor,o=t*r.BYTES_PER_ELEMENT,a=new r(e.buffer,e.byteOffset+o,n);i.copyFromArrayView(a,o)};yh.prototype._bind=function(){l(this._vao)?(this._context.glBindVertexArray(this._vao),this._context.instancedArrays&&Yqe(this),this._hasConstantAttributes&&Xqe(this,this._gl)):ape(this._gl,this._attributes,this._indexBuffer)};yh.prototype._unBind=function(){if(l(this._vao))this._context.glBindVertexArray(null);else{let e=this._attributes,t=this._gl;for(let n=0;n<e.length;++n){let i=e[n];i.enabled&&i.disableVertexAttribArray(t)}this._indexBuffer&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null)}};yh.prototype.isDestroyed=function(){return!1};yh.prototype.destroy=function(){let e=this._attributes;for(let n=0;n<e.length;++n){let i=e[n].vertexBuffer;l(i)&&!i.isDestroyed()&&i.vertexArrayDestroyable&&i.destroy()}let t=this._indexBuffer;return l(t)&&!t.isDestroyed()&&t.vertexArrayDestroyable&&t.destroy(),l(this._vao)&&this._context.glDeleteVertexArray(this._vao),ue(this)};var Vn=yh;function spe(e){if(typeof e!="object"||e===null)return e;let t,n=Object.keys(e);for(let i=0;i<n.length;i++)t=n[i],e.hasOwnProperty(t)&&t!=="_applyFunctions"&&(e[t]=spe(e[t]));return Object.freeze(e)}var cpe=spe;function Qm(e){let t=e??H.EMPTY_OBJECT,n=t.cull??H.EMPTY_OBJECT,i=t.polygonOffset??H.EMPTY_OBJECT,r=t.scissorTest??H.EMPTY_OBJECT,o=r.rectangle??H.EMPTY_OBJECT,a=t.depthRange??H.EMPTY_OBJECT,s=t.depthTest??H.EMPTY_OBJECT,c=t.colorMask??H.EMPTY_OBJECT,u=t.blending??H.EMPTY_OBJECT,f=u.color??H.EMPTY_OBJECT,d=t.stencilTest??H.EMPTY_OBJECT,p=d.frontOperation??H.EMPTY_OBJECT,g=d.backOperation??H.EMPTY_OBJECT,m=t.sampleCoverage??H.EMPTY_OBJECT,y=t.viewport;this.frontFace=t.frontFace??ns.COUNTER_CLOCKWISE,this.cull={enabled:n.enabled??!1,face:n.face??ee.BACK},this.lineWidth=t.lineWidth??1,this.polygonOffset={enabled:i.enabled??!1,factor:i.factor??0,units:i.units??0},this.scissorTest={enabled:r.enabled??!1,rectangle:Je.clone(o)},this.depthRange={near:a.near??0,far:a.far??1},this.depthTest={enabled:s.enabled??!1,func:s.func??ee.LESS},this.colorMask={red:c.red??!0,green:c.green??!0,blue:c.blue??!0,alpha:c.alpha??!0},this.depthMask=t.depthMask??!0,this.stencilMask=t.stencilMask??-1,this.blending={enabled:u.enabled??!1,color:new U(f.red??0,f.green??0,f.blue??0,f.alpha??0),equationRgb:u.equationRgb??ee.FUNC_ADD,equationAlpha:u.equationAlpha??ee.FUNC_ADD,functionSourceRgb:u.functionSourceRgb??ee.ONE,functionSourceAlpha:u.functionSourceAlpha??ee.ONE,functionDestinationRgb:u.functionDestinationRgb??ee.ZERO,functionDestinationAlpha:u.functionDestinationAlpha??ee.ZERO},this.stencilTest={enabled:d.enabled??!1,frontFunction:d.frontFunction??ee.ALWAYS,backFunction:d.backFunction??ee.ALWAYS,reference:d.reference??0,mask:d.mask??-1,frontOperation:{fail:p.fail??ee.KEEP,zFail:p.zFail??ee.KEEP,zPass:p.zPass??ee.KEEP},backOperation:{fail:g.fail??ee.KEEP,zFail:g.zFail??ee.KEEP,zPass:g.zPass??ee.KEEP}},this.sampleCoverage={enabled:m.enabled??!1,value:m.value??1,invert:m.invert??!1},this.viewport=l(y)?new Je(y.x,y.y,y.width,y.height):void 0,this.id=0,this._applyFunctions=[]}var Kqe=0,Zm={};Qm.fromCache=function(e){let t=JSON.stringify(e),n=Zm[t];if(l(n))return++n.referenceCount,n.state;let i=new Qm(e),r=JSON.stringify(i);return n=Zm[r],l(n)||(i.id=Kqe++,n={referenceCount:0,state:i},Zm[r]=n),++n.referenceCount,Zm[t]={referenceCount:1,state:n.state},n.state};Qm.removeFromCache=function(e){let t=new Qm(e),n=JSON.stringify(t),i=Zm[n],r=JSON.stringify(e),o=Zm[r];l(o)&&(--o.referenceCount,o.referenceCount===0&&(delete Zm[r],l(i)&&--i.referenceCount)),l(i)&&i.referenceCount===0&&delete Zm[n]};Qm.getCache=function(){return Zm};Qm.clearCache=function(){Zm={}};function Pb(e,t,n){n?e.enable(t):e.disable(t)}function lpe(e,t){e.frontFace(t.frontFace)}function upe(e,t){let n=t.cull,i=n.enabled;Pb(e,e.CULL_FACE,i),i&&e.cullFace(n.face)}function fpe(e,t){e.lineWidth(t.lineWidth)}function dpe(e,t){let n=t.polygonOffset,i=n.enabled;Pb(e,e.POLYGON_OFFSET_FILL,i),i&&e.polygonOffset(n.factor,n.units)}function hpe(e,t,n){let i=t.scissorTest,r=l(n.scissorTest)?n.scissorTest.enabled:i.enabled;if(Pb(e,e.SCISSOR_TEST,r),r){let o=l(n.scissorTest)?n.scissorTest.rectangle:i.rectangle;e.scissor(o.x,o.y,o.width,o.height)}}function mpe(e,t){let n=t.depthRange;e.depthRange(n.near,n.far)}function ppe(e,t){let n=t.depthTest,i=n.enabled;Pb(e,e.DEPTH_TEST,i),i&&e.depthFunc(n.func)}function gpe(e,t){let n=t.colorMask;e.colorMask(n.red,n.green,n.blue,n.alpha)}function _pe(e,t){e.depthMask(t.depthMask)}function ype(e,t){e.stencilMask(t.stencilMask)}function $qe(e,t){e.blendColor(t.red,t.green,t.blue,t.alpha)}function Ape(e,t,n){let i=t.blending,r=l(n.blendingEnabled)?n.blendingEnabled:i.enabled;Pb(e,e.BLEND,r),r&&($qe(e,i.color),e.blendEquationSeparate(i.equationRgb,i.equationAlpha),e.blendFuncSeparate(i.functionSourceRgb,i.functionDestinationRgb,i.functionSourceAlpha,i.functionDestinationAlpha))}function bpe(e,t){let n=t.stencilTest,i=n.enabled;if(Pb(e,e.STENCIL_TEST,i),i){let r=n.frontFunction,o=n.backFunction,a=n.reference,s=n.mask;e.stencilFunc(r,a,s),e.stencilFuncSeparate(e.BACK,o,a,s),e.stencilFuncSeparate(e.FRONT,r,a,s);let c=n.frontOperation,u=c.fail,f=c.zFail,d=c.zPass;e.stencilOpSeparate(e.FRONT,u,f,d);let p=n.backOperation,g=p.fail,m=p.zFail,y=p.zPass;e.stencilOpSeparate(e.BACK,g,m,y)}}function xpe(e,t){let n=t.sampleCoverage,i=n.enabled;Pb(e,e.SAMPLE_COVERAGE,i),i&&e.sampleCoverage(n.value,n.invert)}var Jqe=new Je;function Tpe(e,t,n){let i=t.viewport??n.viewport;l(i)||(i=Jqe,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)}Qm.apply=function(e,t,n){lpe(e,t),upe(e,t),fpe(e,t),dpe(e,t),mpe(e,t),ppe(e,t),gpe(e,t),_pe(e,t),ype(e,t),bpe(e,t),xpe(e,t),hpe(e,t,n),Ape(e,t,n),Tpe(e,t,n)};function Zqe(e,t){let n=[];return e.frontFace!==t.frontFace&&n.push(lpe),(e.cull.enabled!==t.cull.enabled||e.cull.face!==t.cull.face)&&n.push(upe),e.lineWidth!==t.lineWidth&&n.push(fpe),(e.polygonOffset.enabled!==t.polygonOffset.enabled||e.polygonOffset.factor!==t.polygonOffset.factor||e.polygonOffset.units!==t.polygonOffset.units)&&n.push(dpe),(e.depthRange.near!==t.depthRange.near||e.depthRange.far!==t.depthRange.far)&&n.push(mpe),(e.depthTest.enabled!==t.depthTest.enabled||e.depthTest.func!==t.depthTest.func)&&n.push(ppe),(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(gpe),e.depthMask!==t.depthMask&&n.push(_pe),e.stencilMask!==t.stencilMask&&n.push(ype),(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(bpe),(e.sampleCoverage.enabled!==t.sampleCoverage.enabled||e.sampleCoverage.value!==t.sampleCoverage.value||e.sampleCoverage.invert!==t.sampleCoverage.invert)&&n.push(xpe),n}Qm.partialApply=function(e,t,n,i,r,o){if(t!==n){let f=n._applyFunctions[t.id];l(f)||(f=Zqe(t,n),n._applyFunctions[t.id]=f);let d=f.length;for(let p=0;p<d;++p)f[p](e,n)}let a=l(i.scissorTest)?i.scissorTest:t.scissorTest,s=l(r.scissorTest)?r.scissorTest:n.scissorTest;(a!==s||o)&&hpe(e,n,r);let c=l(i.blendingEnabled)?i.blendingEnabled:t.blending.enabled,u=l(r.blendingEnabled)?r.blendingEnabled:n.blending.enabled;(c!==u||u&&t.blending!==n.blending)&&Ape(e,n,r),(t!==n||i!==r||i.context!==r.context)&&Tpe(e,n,r)};Qm.getState=function(e){return{frontFace:e.frontFace,cull:{enabled:e.cull.enabled,face:e.cull.face},lineWidth:e.lineWidth,polygonOffset:{enabled:e.polygonOffset.enabled,factor:e.polygonOffset.factor,units:e.polygonOffset.units},scissorTest:{enabled:e.scissorTest.enabled,rectangle:Je.clone(e.scissorTest.rectangle)},depthRange:{near:e.depthRange.near,far:e.depthRange.far},depthTest:{enabled:e.depthTest.enabled,func:e.depthTest.func},colorMask:{red:e.colorMask.red,green:e.colorMask.green,blue:e.colorMask.blue,alpha:e.colorMask.alpha},depthMask:e.depthMask,stencilMask:e.stencilMask,blending:{enabled:e.blending.enabled,color:U.clone(e.blending.color),equationRgb:e.blending.equationRgb,equationAlpha:e.blending.equationAlpha,functionSourceRgb:e.blending.functionSourceRgb,functionSourceAlpha:e.blending.functionSourceAlpha,functionDestinationRgb:e.blending.functionDestinationRgb,functionDestinationAlpha:e.blending.functionDestinationAlpha},stencilTest:{enabled:e.stencilTest.enabled,frontFunction:e.stencilTest.frontFunction,backFunction:e.stencilTest.backFunction,reference:e.stencilTest.reference,mask:e.stencilTest.mask,frontOperation:{fail:e.stencilTest.frontOperation.fail,zFail:e.stencilTest.frontOperation.zFail,zPass:e.stencilTest.frontOperation.zPass},backOperation:{fail:e.stencilTest.backOperation.fail,zFail:e.stencilTest.backOperation.zFail,zPass:e.stencilTest.backOperation.zPass}},sampleCoverage:{enabled:e.sampleCoverage.enabled,value:e.sampleCoverage.value,invert:e.sampleCoverage.invert},viewport:l(e.viewport)?Je.clone(e.viewport):void 0}};var je=Qm;var Cpe={ADD:ee.FUNC_ADD,SUBTRACT:ee.FUNC_SUBTRACT,REVERSE_SUBTRACT:ee.FUNC_REVERSE_SUBTRACT,MIN:ee.MIN,MAX:ee.MAX};Object.freeze(Cpe);var Wc=Cpe;var vpe={ZERO:ee.ZERO,ONE:ee.ONE,SOURCE_COLOR:ee.SRC_COLOR,ONE_MINUS_SOURCE_COLOR:ee.ONE_MINUS_SRC_COLOR,DESTINATION_COLOR:ee.DST_COLOR,ONE_MINUS_DESTINATION_COLOR:ee.ONE_MINUS_DST_COLOR,SOURCE_ALPHA:ee.SRC_ALPHA,ONE_MINUS_SOURCE_ALPHA:ee.ONE_MINUS_SRC_ALPHA,DESTINATION_ALPHA:ee.DST_ALPHA,ONE_MINUS_DESTINATION_ALPHA:ee.ONE_MINUS_DST_ALPHA,CONSTANT_COLOR:ee.CONSTANT_COLOR,ONE_MINUS_CONSTANT_COLOR:ee.ONE_MINUS_CONSTANT_COLOR,CONSTANT_ALPHA:ee.CONSTANT_ALPHA,ONE_MINUS_CONSTANT_ALPHA:ee.ONE_MINUS_CONSTANT_ALPHA,SOURCE_ALPHA_SATURATE:ee.SRC_ALPHA_SATURATE};Object.freeze(vpe);var Kr=vpe;var Epe={DISABLED:Object.freeze({enabled:!1}),ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Wc.ADD,equationAlpha:Wc.ADD,functionSourceRgb:Kr.SOURCE_ALPHA,functionSourceAlpha:Kr.ONE,functionDestinationRgb:Kr.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:Kr.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Wc.ADD,equationAlpha:Wc.ADD,functionSourceRgb:Kr.ONE,functionSourceAlpha:Kr.ONE,functionDestinationRgb:Kr.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:Kr.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:Object.freeze({enabled:!0,equationRgb:Wc.ADD,equationAlpha:Wc.ADD,functionSourceRgb:Kr.SOURCE_ALPHA,functionSourceAlpha:Kr.ONE,functionDestinationRgb:Kr.ONE,functionDestinationAlpha:Kr.ONE})};Object.freeze(Epe);var en=Epe;var CF=`/**
|
|
* A built-in GLSL floating-point constant for converting radians to degrees.
|
|
*
|
|
* @alias czm_degreesPerRadian
|
|
* @glslConstant
|
|
*
|
|
* @see CesiumMath.DEGREES_PER_RADIAN
|
|
*
|
|
* @example
|
|
* // GLSL declaration
|
|
* const float czm_degreesPerRadian = ...;
|
|
*
|
|
* // Example
|
|
* float deg = czm_degreesPerRadian * rad;
|
|
*/
|
|
const float czm_degreesPerRadian = 57.29577951308232;
|
|
`;var vF=`/**
|
|
* A built-in GLSL vec2 constant for defining the depth range.
|
|
* This is a workaround to a bug where IE11 does not implement gl_DepthRange.
|
|
*
|
|
* @alias czm_depthRange
|
|
* @glslConstant
|
|
*
|
|
* @example
|
|
* // GLSL declaration
|
|
* float depthRangeNear = czm_depthRange.near;
|
|
* float depthRangeFar = czm_depthRange.far;
|
|
*
|
|
*/
|
|
const czm_depthRangeStruct czm_depthRange = czm_depthRangeStruct(0.0, 1.0);
|
|
`;var EF=`/**
|
|
* 0.1
|
|
*
|
|
* @name czm_epsilon1
|
|
* @glslConstant
|
|
*/
|
|
const float czm_epsilon1 = 0.1;
|
|
`;var SF=`/**
|
|
* 0.01
|
|
*
|
|
* @name czm_epsilon2
|
|
* @glslConstant
|
|
*/
|
|
const float czm_epsilon2 = 0.01;
|
|
`;var wF=`/**
|
|
* 0.001
|
|
*
|
|
* @name czm_epsilon3
|
|
* @glslConstant
|
|
*/
|
|
const float czm_epsilon3 = 0.001;
|
|
`;var IF=`/**
|
|
* 0.0001
|
|
*
|
|
* @name czm_epsilon4
|
|
* @glslConstant
|
|
*/
|
|
const float czm_epsilon4 = 0.0001;
|
|
`;var PF=`/**
|
|
* 0.00001
|
|
*
|
|
* @name czm_epsilon5
|
|
* @glslConstant
|
|
*/
|
|
const float czm_epsilon5 = 0.00001;
|
|
`;var DF=`/**
|
|
* 0.000001
|
|
*
|
|
* @name czm_epsilon6
|
|
* @glslConstant
|
|
*/
|
|
const float czm_epsilon6 = 0.000001;
|
|
`;var RF=`/**
|
|
* 0.0000001
|
|
*
|
|
* @name czm_epsilon7
|
|
* @glslConstant
|
|
*/
|
|
const float czm_epsilon7 = 0.0000001;
|
|
`;var OF=`/**
|
|
* DOC_TBA
|
|
*
|
|
* @name czm_infinity
|
|
* @glslConstant
|
|
*/
|
|
const float czm_infinity = 5906376272000.0; // Distance from the Sun to Pluto in meters. TODO: What is best given lowp, mediump, and highp?
|
|
`;var MF=`/**
|
|
* A built-in GLSL floating-point constant for <code>1/pi</code>.
|
|
*
|
|
* @alias czm_oneOverPi
|
|
* @glslConstant
|
|
*
|
|
* @see CesiumMath.ONE_OVER_PI
|
|
*
|
|
* @example
|
|
* // GLSL declaration
|
|
* const float czm_oneOverPi = ...;
|
|
*
|
|
* // Example
|
|
* float pi = 1.0 / czm_oneOverPi;
|
|
*/
|
|
const float czm_oneOverPi = 0.3183098861837907;
|
|
`;var LF=`/**
|
|
* A built-in GLSL floating-point constant for <code>1/2pi</code>.
|
|
*
|
|
* @alias czm_oneOverTwoPi
|
|
* @glslConstant
|
|
*
|
|
* @see CesiumMath.ONE_OVER_TWO_PI
|
|
*
|
|
* @example
|
|
* // GLSL declaration
|
|
* const float czm_oneOverTwoPi = ...;
|
|
*
|
|
* // Example
|
|
* float pi = 2.0 * czm_oneOverTwoPi;
|
|
*/
|
|
const float czm_oneOverTwoPi = 0.15915494309189535;
|
|
`;var NF=`/**
|
|
* The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE}
|
|
*
|
|
* @name czm_passCesium3DTile
|
|
* @glslConstant
|
|
*
|
|
* @see czm_pass
|
|
*/
|
|
const float czm_passCesium3DTile = 6.0;
|
|
`;var FF=`/**
|
|
* The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE_CLASSIFICATION}
|
|
*
|
|
* @name czm_passCesium3DTileClassification
|
|
* @glslConstant
|
|
*
|
|
* @see czm_pass
|
|
*/
|
|
const float czm_passCesium3DTileClassification = 7.0;
|
|
`;var BF=`/**
|
|
* The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW}
|
|
*
|
|
* @name czm_passCesium3DTileClassificationIgnoreShow
|
|
* @glslConstant
|
|
*
|
|
* @see czm_pass
|
|
*/
|
|
const float czm_passCesium3DTileClassificationIgnoreShow = 8.0;
|
|
`;var kF=`/**
|
|
* The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE_EDGES}
|
|
*
|
|
* @name czm_passCesium3DTileEdges
|
|
* @glslConstant
|
|
*
|
|
* @see czm_pass
|
|
*/
|
|
const float czm_passCesium3DTileEdges = 4.0;
|
|
|
|
`;var zF=`/**
|
|
* The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE_EDGES_DIRECT}
|
|
*
|
|
* @name czm_passCesium3DTileEdgesDirect
|
|
* @glslConstant
|
|
*
|
|
* @see czm_pass
|
|
*/
|
|
const float czm_passCesium3DTileEdgesDirect = 12.0;
|
|
`;var UF=`/**
|
|
* The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE_PLANAR_FILL_ID}
|
|
*
|
|
* @name czm_passCesium3DTilePlanarFillId
|
|
* @glslConstant
|
|
*
|
|
* @see czm_pass
|
|
*/
|
|
const float czm_passCesium3DTilePlanarFillId = 5.0;
|
|
`;var VF=`/**
|
|
* The automatic GLSL constant for {@link Pass#CLASSIFICATION}
|
|
*
|
|
* @name czm_passClassification
|
|
* @glslConstant
|
|
*
|
|
* @see czm_pass
|
|
*/
|
|
const float czm_passClassification = 8.0;
|
|
`;var jF=`/**
|
|
* The automatic GLSL constant for {@link Pass#COMPUTE}
|
|
*
|
|
* @name czm_passCompute
|
|
* @glslConstant
|
|
*
|
|
* @see czm_pass
|
|
*/
|
|
const float czm_passCompute = 1.0;
|
|
`;var HF=`/**
|
|
* The automatic GLSL constant for {@link Pass#ENVIRONMENT}
|
|
*
|
|
* @name czm_passEnvironment
|
|
* @glslConstant
|
|
*
|
|
* @see czm_pass
|
|
*/
|
|
const float czm_passEnvironment = 0.0;
|
|
`;var GF=`/**
|
|
* The automatic GLSL constant for {@link Pass#GAUSSIAN_SPLATS}
|
|
*
|
|
* @name czm_passGaussianSplats
|
|
* @glslConstant
|
|
*
|
|
* @see czm_pass
|
|
*/
|
|
const float czm_passGaussianSplats = 12.0;
|
|
`;var WF=`/**
|
|
* The automatic GLSL constant for {@link Pass#GLOBE}
|
|
*
|
|
* @name czm_passGlobe
|
|
* @glslConstant
|
|
*
|
|
* @see czm_pass
|
|
*/
|
|
const float czm_passGlobe = 2.0;
|
|
`;var qF=`/**
|
|
* The automatic GLSL constant for {@link Pass#OPAQUE}
|
|
*
|
|
* @name czm_passOpaque
|
|
* @glslConstant
|
|
*
|
|
* @see czm_pass
|
|
*/
|
|
const float czm_passOpaque = 9.0;
|
|
`;var YF=`/**
|
|
* The automatic GLSL constant for {@link Pass#OVERLAY}
|
|
*
|
|
* @name czm_passOverlay
|
|
* @glslConstant
|
|
*
|
|
* @see czm_pass
|
|
*/
|
|
const float czm_passOverlay = 13.0;
|
|
`;var XF=`/**
|
|
* The automatic GLSL constant for {@link Pass#TERRAIN_CLASSIFICATION}
|
|
*
|
|
* @name czm_passTerrainClassification
|
|
* @glslConstant
|
|
*
|
|
* @see czm_pass
|
|
*/
|
|
const float czm_passTerrainClassification = 3.0;
|
|
`;var KF=`/**
|
|
* The automatic GLSL constant for {@link Pass#TRANSLUCENT}
|
|
*
|
|
* @name czm_passTranslucent
|
|
* @glslConstant
|
|
*
|
|
* @see czm_pass
|
|
*/
|
|
const float czm_passTranslucent = 10.0;
|
|
`;var $F=`/**
|
|
* The automatic GLSL constant for {@link Pass#VOXELS}
|
|
*
|
|
* @name czm_passVoxels
|
|
* @glslConstant
|
|
*
|
|
* @see czm_pass
|
|
*/
|
|
const float czm_passVoxels = 11.0;
|
|
`;var JF=`/**
|
|
* A built-in GLSL floating-point constant for <code>Math.PI</code>.
|
|
*
|
|
* @alias czm_pi
|
|
* @glslConstant
|
|
*
|
|
* @see CesiumMath.PI
|
|
*
|
|
* @example
|
|
* // GLSL declaration
|
|
* const float czm_pi = ...;
|
|
*
|
|
* // Example
|
|
* float twoPi = 2.0 * czm_pi;
|
|
*/
|
|
const float czm_pi = 3.141592653589793;
|
|
`;var ZF=`/**
|
|
* A built-in GLSL floating-point constant for <code>pi/4</code>.
|
|
*
|
|
* @alias czm_piOverFour
|
|
* @glslConstant
|
|
*
|
|
* @see CesiumMath.PI_OVER_FOUR
|
|
*
|
|
* @example
|
|
* // GLSL declaration
|
|
* const float czm_piOverFour = ...;
|
|
*
|
|
* // Example
|
|
* float pi = 4.0 * czm_piOverFour;
|
|
*/
|
|
const float czm_piOverFour = 0.7853981633974483;
|
|
`;var QF=`/**
|
|
* A built-in GLSL floating-point constant for <code>pi/6</code>.
|
|
*
|
|
* @alias czm_piOverSix
|
|
* @glslConstant
|
|
*
|
|
* @see CesiumMath.PI_OVER_SIX
|
|
*
|
|
* @example
|
|
* // GLSL declaration
|
|
* const float czm_piOverSix = ...;
|
|
*
|
|
* // Example
|
|
* float pi = 6.0 * czm_piOverSix;
|
|
*/
|
|
const float czm_piOverSix = 0.5235987755982988;
|
|
`;var eB=`/**
|
|
* A built-in GLSL floating-point constant for <code>pi/3</code>.
|
|
*
|
|
* @alias czm_piOverThree
|
|
* @glslConstant
|
|
*
|
|
* @see CesiumMath.PI_OVER_THREE
|
|
*
|
|
* @example
|
|
* // GLSL declaration
|
|
* const float czm_piOverThree = ...;
|
|
*
|
|
* // Example
|
|
* float pi = 3.0 * czm_piOverThree;
|
|
*/
|
|
const float czm_piOverThree = 1.0471975511965976;
|
|
`;var tB=`/**
|
|
* A built-in GLSL floating-point constant for <code>pi/2</code>.
|
|
*
|
|
* @alias czm_piOverTwo
|
|
* @glslConstant
|
|
*
|
|
* @see CesiumMath.PI_OVER_TWO
|
|
*
|
|
* @example
|
|
* // GLSL declaration
|
|
* const float czm_piOverTwo = ...;
|
|
*
|
|
* // Example
|
|
* float pi = 2.0 * czm_piOverTwo;
|
|
*/
|
|
const float czm_piOverTwo = 1.5707963267948966;
|
|
`;var nB=`/**
|
|
* A built-in GLSL floating-point constant for converting degrees to radians.
|
|
*
|
|
* @alias czm_radiansPerDegree
|
|
* @glslConstant
|
|
*
|
|
* @see CesiumMath.RADIANS_PER_DEGREE
|
|
*
|
|
* @example
|
|
* // GLSL declaration
|
|
* const float czm_radiansPerDegree = ...;
|
|
*
|
|
* // Example
|
|
* float rad = czm_radiansPerDegree * deg;
|
|
*/
|
|
const float czm_radiansPerDegree = 0.017453292519943295;
|
|
`;var iB=`/**
|
|
* The constant identifier for the 2D {@link SceneMode}
|
|
*
|
|
* @name czm_sceneMode2D
|
|
* @glslConstant
|
|
* @see czm_sceneMode
|
|
* @see czm_sceneModeColumbusView
|
|
* @see czm_sceneMode3D
|
|
* @see czm_sceneModeMorphing
|
|
*/
|
|
const float czm_sceneMode2D = 2.0;
|
|
`;var rB=`/**
|
|
* The constant identifier for the 3D {@link SceneMode}
|
|
*
|
|
* @name czm_sceneMode3D
|
|
* @glslConstant
|
|
* @see czm_sceneMode
|
|
* @see czm_sceneMode2D
|
|
* @see czm_sceneModeColumbusView
|
|
* @see czm_sceneModeMorphing
|
|
*/
|
|
const float czm_sceneMode3D = 3.0;
|
|
`;var oB=`/**
|
|
* The constant identifier for the Columbus View {@link SceneMode}
|
|
*
|
|
* @name czm_sceneModeColumbusView
|
|
* @glslConstant
|
|
* @see czm_sceneMode
|
|
* @see czm_sceneMode2D
|
|
* @see czm_sceneMode3D
|
|
* @see czm_sceneModeMorphing
|
|
*/
|
|
const float czm_sceneModeColumbusView = 1.0;
|
|
`;var aB=`/**
|
|
* The constant identifier for the Morphing {@link SceneMode}
|
|
*
|
|
* @name czm_sceneModeMorphing
|
|
* @glslConstant
|
|
* @see czm_sceneMode
|
|
* @see czm_sceneMode2D
|
|
* @see czm_sceneModeColumbusView
|
|
* @see czm_sceneMode3D
|
|
*/
|
|
const float czm_sceneModeMorphing = 0.0;
|
|
`;var sB=`/**
|
|
* A built-in GLSL floating-point constant for one solar radius.
|
|
*
|
|
* @alias czm_solarRadius
|
|
* @glslConstant
|
|
*
|
|
* @see CesiumMath.SOLAR_RADIUS
|
|
*
|
|
* @example
|
|
* // GLSL declaration
|
|
* const float czm_solarRadius = ...;
|
|
*/
|
|
const float czm_solarRadius = 695500000.0;
|
|
`;var cB=`/**
|
|
* A built-in GLSL floating-point constant for <code>3pi/2</code>.
|
|
*
|
|
* @alias czm_threePiOver2
|
|
* @glslConstant
|
|
*
|
|
* @see CesiumMath.THREE_PI_OVER_TWO
|
|
*
|
|
* @example
|
|
* // GLSL declaration
|
|
* const float czm_threePiOver2 = ...;
|
|
*
|
|
* // Example
|
|
* float pi = (2.0 / 3.0) * czm_threePiOver2;
|
|
*/
|
|
const float czm_threePiOver2 = 4.71238898038469;
|
|
`;var lB=`/**
|
|
* A built-in GLSL floating-point constant for <code>2pi</code>.
|
|
*
|
|
* @alias czm_twoPi
|
|
* @glslConstant
|
|
*
|
|
* @see CesiumMath.TWO_PI
|
|
*
|
|
* @example
|
|
* // GLSL declaration
|
|
* const float czm_twoPi = ...;
|
|
*
|
|
* // Example
|
|
* float pi = czm_twoPi / 2.0;
|
|
*/
|
|
const float czm_twoPi = 6.283185307179586;
|
|
`;var uB=`/**
|
|
* The maximum latitude, in radians, both North and South, supported by a Web Mercator
|
|
* (EPSG:3857) projection. Technically, the Mercator projection is defined
|
|
* for any latitude up to (but not including) 90 degrees, but it makes sense
|
|
* to cut it off sooner because it grows exponentially with increasing latitude.
|
|
* The logic behind this particular cutoff value, which is the one used by
|
|
* Google Maps, Bing Maps, and Esri, is that it makes the projection
|
|
* square. That is, the rectangle is equal in the X and Y directions.
|
|
*
|
|
* The constant value is computed as follows:
|
|
* czm_pi * 0.5 - (2.0 * atan(exp(-czm_pi)))
|
|
*
|
|
* @name czm_webMercatorMaxLatitude
|
|
* @glslConstant
|
|
*/
|
|
const float czm_webMercatorMaxLatitude = 1.4844222297453324;
|
|
`;var fB=`/**
|
|
* @name czm_depthRangeStruct
|
|
* @glslStruct
|
|
*/
|
|
struct czm_depthRangeStruct
|
|
{
|
|
float near;
|
|
float far;
|
|
};
|
|
`;var dB=`/**
|
|
* Holds material information that can be used for lighting. Returned by all czm_getMaterial functions.
|
|
*
|
|
* @name czm_material
|
|
* @glslStruct
|
|
*
|
|
* @property {vec3} diffuse Incoming light that scatters evenly in all directions.
|
|
* @property {float} specular Intensity of incoming light reflecting in a single direction.
|
|
* @property {float} shininess The sharpness of the specular reflection. Higher values create a smaller, more focused specular highlight.
|
|
* @property {vec3} normal Surface's normal in eye coordinates. It is used for effects such as normal mapping. The default is the surface's unmodified normal.
|
|
* @property {vec3} emission Light emitted by the material equally in all directions. The default is vec3(0.0), which emits no light.
|
|
* @property {float} alpha Alpha of this material. 0.0 is completely transparent; 1.0 is completely opaque.
|
|
*/
|
|
struct czm_material
|
|
{
|
|
vec3 diffuse;
|
|
float specular;
|
|
float shininess;
|
|
vec3 normal;
|
|
vec3 emission;
|
|
float alpha;
|
|
};
|
|
`;var hB=`/**
|
|
* Used as input to every material's czm_getMaterial function.
|
|
*
|
|
* @name czm_materialInput
|
|
* @glslStruct
|
|
*
|
|
* @property {float} s 1D texture coordinates.
|
|
* @property {vec2} st 2D texture coordinates.
|
|
* @property {vec3} str 3D texture coordinates.
|
|
* @property {vec3} normalEC Unperturbed surface normal in eye coordinates.
|
|
* @property {mat3} tangentToEyeMatrix Matrix for converting a tangent space normal to eye space.
|
|
* @property {vec3} positionToEyeEC Vector from the fragment to the eye in eye coordinates. The magnitude is the distance in meters from the fragment to the eye.
|
|
* @property {float} height The height of the terrain in meters above or below the ellipsoid. Only available for globe materials.
|
|
* @property {float} slope The slope of the terrain in radians. 0 is flat; pi/2 is vertical. Only available for globe materials.
|
|
* @property {float} aspect The aspect of the terrain in radians. 0 is East, pi/2 is North, pi is West, 3pi/2 is South. Only available for globe materials.
|
|
* @property {float} waterMask The value of the water mask. 0 is land, 1 is water. Only available for globe materials.
|
|
*/
|
|
struct czm_materialInput
|
|
{
|
|
float s;
|
|
vec2 st;
|
|
vec3 str;
|
|
vec3 normalEC;
|
|
mat3 tangentToEyeMatrix;
|
|
vec3 positionToEyeEC;
|
|
float height;
|
|
float slope;
|
|
float aspect;
|
|
float waterMask;
|
|
};
|
|
`;var mB=`/**
|
|
* Struct for representing a material for a {@link Model}. The model
|
|
* rendering pipeline will pass this struct between material, custom shaders,
|
|
* and lighting stages. This is not to be confused with {@link czm_material}
|
|
* which is used by the older Fabric materials system, although they are similar.
|
|
* <p>
|
|
* All color values (diffuse, specular, emissive) are in linear color space.
|
|
* </p>
|
|
*
|
|
* @name czm_modelMaterial
|
|
* @glslStruct
|
|
*
|
|
* @property {vec4} baseColor The base color of the material.
|
|
* @property {vec3} diffuse Incoming light that scatters evenly in all directions.
|
|
* @property {float} alpha Alpha of this material. 0.0 is completely transparent; 1.0 is completely opaque.
|
|
* @property {vec3} specular Color of reflected light at normal incidence in PBR materials. This is sometimes referred to as f0 in the literature.
|
|
* @property {float} roughness A number from 0.0 to 1.0 representing how rough the surface is. Values near 0.0 produce glossy surfaces, while values near 1.0 produce rough surfaces.
|
|
* @property {vec3} normalEC Surface's normal in eye coordinates. It is used for effects such as normal mapping. The default is the surface's unmodified normal.
|
|
* @property {float} occlusion Ambient occlusion recieved at this point on the material. 1.0 means fully lit, 0.0 means fully occluded.
|
|
* @property {vec3} emissive Light emitted by the material equally in all directions. The default is vec3(0.0), which emits no light.
|
|
*/
|
|
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;
|
|
// Add clearcoatF0 when KHR_materials_ior is implemented
|
|
#endif
|
|
};
|
|
`;var pB=`/**
|
|
* Struct for representing the output of a custom vertex shader.
|
|
*
|
|
* @name czm_modelVertexOutput
|
|
* @glslStruct
|
|
*
|
|
* @see {@link CustomShader}
|
|
* @see {@link Model}
|
|
*
|
|
* @property {vec3} positionMC The position of the vertex in model coordinates
|
|
* @property {float} pointSize A custom value for gl_PointSize. This is only used for point primitives.
|
|
*/
|
|
struct czm_modelVertexOutput {
|
|
vec3 positionMC;
|
|
float pointSize;
|
|
};
|
|
`;var gB=`/**
|
|
* DOC_TBA
|
|
*
|
|
* @name czm_ray
|
|
* @glslStruct
|
|
*/
|
|
struct czm_ray
|
|
{
|
|
vec3 origin;
|
|
vec3 direction;
|
|
};
|
|
`;var _B=`/**
|
|
* DOC_TBA
|
|
*
|
|
* @name czm_raySegment
|
|
* @glslStruct
|
|
*/
|
|
struct czm_raySegment
|
|
{
|
|
float start;
|
|
float stop;
|
|
};
|
|
|
|
/**
|
|
* DOC_TBA
|
|
*
|
|
* @name czm_emptyRaySegment
|
|
* @glslConstant
|
|
*/
|
|
const czm_raySegment czm_emptyRaySegment = czm_raySegment(-czm_infinity, -czm_infinity);
|
|
|
|
/**
|
|
* DOC_TBA
|
|
*
|
|
* @name czm_fullRaySegment
|
|
* @glslConstant
|
|
*/
|
|
const czm_raySegment czm_fullRaySegment = czm_raySegment(0.0, czm_infinity);
|
|
`;var yB=`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 AB=`/**
|
|
* Converts an HSB color (hue, saturation, brightness) to RGB
|
|
* HSB <-> RGB conversion with minimal branching: {@link http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl}
|
|
*
|
|
* @name czm_HSBToRGB
|
|
* @glslFunction
|
|
*
|
|
* @param {vec3} hsb The color in HSB.
|
|
*
|
|
* @returns {vec3} The color in RGB.
|
|
*
|
|
* @example
|
|
* vec3 hsb = czm_RGBToHSB(rgb);
|
|
* hsb.z *= 0.1;
|
|
* rgb = czm_HSBToRGB(hsb);
|
|
*/
|
|
|
|
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 bB=`/**
|
|
* Converts an HSL color (hue, saturation, lightness) to RGB
|
|
* HSL <-> RGB conversion: {@link http://www.chilliant.com/rgb2hsv.html}
|
|
*
|
|
* @name czm_HSLToRGB
|
|
* @glslFunction
|
|
*
|
|
* @param {vec3} rgb The color in HSL.
|
|
*
|
|
* @returns {vec3} The color in RGB.
|
|
*
|
|
* @example
|
|
* vec3 hsl = czm_RGBToHSL(rgb);
|
|
* hsl.z *= 0.1;
|
|
* rgb = czm_HSLToRGB(hsl);
|
|
*/
|
|
|
|
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 xB=`/**
|
|
* Converts an RGB color to HSB (hue, saturation, brightness)
|
|
* HSB <-> RGB conversion with minimal branching: {@link http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl}
|
|
*
|
|
* @name czm_RGBToHSB
|
|
* @glslFunction
|
|
*
|
|
* @param {vec3} rgb The color in RGB.
|
|
*
|
|
* @returns {vec3} The color in HSB.
|
|
*
|
|
* @example
|
|
* vec3 hsb = czm_RGBToHSB(rgb);
|
|
* hsb.z *= 0.1;
|
|
* rgb = czm_HSBToRGB(hsb);
|
|
*/
|
|
|
|
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 TB=`/**
|
|
* Converts an RGB color to HSL (hue, saturation, lightness)
|
|
* HSL <-> RGB conversion: {@link http://www.chilliant.com/rgb2hsv.html}
|
|
*
|
|
* @name czm_RGBToHSL
|
|
* @glslFunction
|
|
*
|
|
* @param {vec3} rgb The color in RGB.
|
|
*
|
|
* @returns {vec3} The color in HSL.
|
|
*
|
|
* @example
|
|
* vec3 hsl = czm_RGBToHSL(rgb);
|
|
* hsl.z *= 0.1;
|
|
* rgb = czm_HSLToRGB(hsl);
|
|
*/
|
|
|
|
vec3 RGBtoHCV(vec3 rgb)
|
|
{
|
|
// Based on work by Sam Hocevar and Emil Persson
|
|
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 CB=`/**
|
|
* Converts an RGB color to CIE Yxy.
|
|
* <p>The conversion is described in
|
|
* {@link http://content.gpwiki.org/index.php/D3DBook:High-Dynamic_Range_Rendering#Luminance_Transform|Luminance Transform}
|
|
* </p>
|
|
*
|
|
* @name czm_RGBToXYZ
|
|
* @glslFunction
|
|
*
|
|
* @param {vec3} rgb The color in RGB.
|
|
*
|
|
* @returns {vec3} The color in CIE Yxy.
|
|
*
|
|
* @example
|
|
* vec3 xyz = czm_RGBToXYZ(rgb);
|
|
* xyz.x = max(xyz.x - luminanceThreshold, 0.0);
|
|
* rgb = czm_XYZToRGB(xyz);
|
|
*/
|
|
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 vB=`/**
|
|
* Converts a CIE Yxy color to RGB.
|
|
* <p>The conversion is described in
|
|
* {@link http://content.gpwiki.org/index.php/D3DBook:High-Dynamic_Range_Rendering#Luminance_Transform|Luminance Transform}
|
|
* </p>
|
|
*
|
|
* @name czm_XYZToRGB
|
|
* @glslFunction
|
|
*
|
|
* @param {vec3} Yxy The color in CIE Yxy.
|
|
*
|
|
* @returns {vec3} The color in RGB.
|
|
*
|
|
* @example
|
|
* vec3 xyz = czm_RGBToXYZ(rgb);
|
|
* xyz.x = max(xyz.x - luminanceThreshold, 0.0);
|
|
* rgb = czm_XYZToRGB(xyz);
|
|
*/
|
|
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 EB=`// See:
|
|
// https://knarkowicz.wordpress.com/2016/01/06/aces-filmic-tone-mapping-curve/
|
|
|
|
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 SB=`/**
|
|
* @private
|
|
*/
|
|
float czm_alphaWeight(float a)
|
|
{
|
|
float z = (gl_FragCoord.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2];
|
|
|
|
// See Weighted Blended Order-Independent Transparency for examples of different weighting functions:
|
|
// http://jcgt.org/published/0002/02/09/
|
|
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 wB=`/**
|
|
* Procedural anti-aliasing by blurring two colors that meet at a sharp edge.
|
|
*
|
|
* @name czm_antialias
|
|
* @glslFunction
|
|
*
|
|
* @param {vec4} color1 The color on one side of the edge.
|
|
* @param {vec4} color2 The color on the other side of the edge.
|
|
* @param {vec4} currentcolor The current color, either <code>color1</code> or <code>color2</code>.
|
|
* @param {float} dist The distance to the edge in texture coordinates.
|
|
* @param {float} [fuzzFactor=0.1] Controls the blurriness between the two colors.
|
|
* @returns {vec4} The anti-aliased color.
|
|
*
|
|
* @example
|
|
* // GLSL declarations
|
|
* vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist, float fuzzFactor);
|
|
* vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist);
|
|
*
|
|
* // get the color for a material that has a sharp edge at the line y = 0.5 in texture space
|
|
* float dist = abs(textureCoordinates.t - 0.5);
|
|
* vec4 currentColor = mix(bottomColor, topColor, step(0.5, textureCoordinates.t));
|
|
* vec4 color = czm_antialias(bottomColor, topColor, currentColor, dist, 0.1);
|
|
*/
|
|
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); //makes the transition nicer
|
|
|
|
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 IB=`/**
|
|
* Apply a HSB color shift to an RGB color.
|
|
*
|
|
* @param {vec3} rgb The color in RGB space.
|
|
* @param {vec3} hsbShift The amount to shift each component. The xyz components correspond to hue, saturation, and brightness. Shifting the hue by +/- 1.0 corresponds to shifting the hue by a full cycle. Saturation and brightness are clamped between 0 and 1 after the adjustment
|
|
* @param {bool} ignoreBlackPixels If true, black pixels will be unchanged. This is necessary in some shaders such as atmosphere-related effects.
|
|
*
|
|
* @return {vec3} The RGB color after shifting in HSB space and clamping saturation and brightness to a valid range.
|
|
*/
|
|
vec3 czm_applyHSBShift(vec3 rgb, vec3 hsbShift, bool ignoreBlackPixels) {
|
|
// Convert rgb color to hsb
|
|
vec3 hsb = czm_RGBToHSB(rgb);
|
|
|
|
// Perform hsb shift
|
|
// Hue cycles around so no clamp is needed.
|
|
hsb.x += hsbShift.x; // hue
|
|
hsb.y = clamp(hsb.y + hsbShift.y, 0.0, 1.0); // saturation
|
|
|
|
// brightness
|
|
//
|
|
// Some shaders such as atmosphere-related effects need to leave black
|
|
// pixels unchanged
|
|
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);
|
|
|
|
// Convert shifted hsb back to rgb
|
|
return czm_HSBToRGB(hsb);
|
|
}
|
|
`;var PB=`/**
|
|
* Approximately computes spherical coordinates given a normal.
|
|
* Uses approximate inverse trigonometry for speed and consistency,
|
|
* since inverse trigonometry can differ from vendor-to-vendor and when compared with the CPU.
|
|
*
|
|
* @name czm_approximateSphericalCoordinates
|
|
* @glslFunction
|
|
*
|
|
* @param {vec3} normal arbitrary-length normal.
|
|
*
|
|
* @returns {vec2} Approximate latitude and longitude spherical coordinates.
|
|
*/
|
|
vec2 czm_approximateSphericalCoordinates(vec3 normal) {
|
|
// Project into plane with vertical for latitude
|
|
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 DB=`/**
|
|
* Compute a rational approximation to tanh(x)
|
|
*
|
|
* @param {float} x A real number input
|
|
* @returns {float} An approximation for tanh(x)
|
|
*/
|
|
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 RB=`/**
|
|
* Determines if the fragment is back facing
|
|
*
|
|
* @name czm_backFacing
|
|
* @glslFunction
|
|
*
|
|
* @returns {bool} <code>true</code> if the fragment is back facing; otherwise, <code>false</code>.
|
|
*/
|
|
bool czm_backFacing()
|
|
{
|
|
// !gl_FrontFacing doesn't work as expected on Mac/Intel so use the more verbose form instead. See https://github.com/CesiumGS/cesium/pull/8494.
|
|
return gl_FrontFacing == false;
|
|
}
|
|
`;var OB=`/**
|
|
* Branchless ternary operator to be used when it's inexpensive to explicitly
|
|
* evaluate both possibilities for a float expression.
|
|
*
|
|
* @name czm_branchFreeTernary
|
|
* @glslFunction
|
|
*
|
|
* @param {bool} comparison A comparison statement
|
|
* @param {float} a Value to return if the comparison is true.
|
|
* @param {float} b Value to return if the comparison is false.
|
|
*
|
|
* @returns {float} equivalent of comparison ? a : b
|
|
*/
|
|
float czm_branchFreeTernary(bool comparison, float a, float b) {
|
|
float useA = float(comparison);
|
|
return a * useA + b * (1.0 - useA);
|
|
}
|
|
|
|
/**
|
|
* Branchless ternary operator to be used when it's inexpensive to explicitly
|
|
* evaluate both possibilities for a vec2 expression.
|
|
*
|
|
* @name czm_branchFreeTernary
|
|
* @glslFunction
|
|
*
|
|
* @param {bool} comparison A comparison statement
|
|
* @param {vec2} a Value to return if the comparison is true.
|
|
* @param {vec2} b Value to return if the comparison is false.
|
|
*
|
|
* @returns {vec2} equivalent of comparison ? a : b
|
|
*/
|
|
vec2 czm_branchFreeTernary(bool comparison, vec2 a, vec2 b) {
|
|
float useA = float(comparison);
|
|
return a * useA + b * (1.0 - useA);
|
|
}
|
|
|
|
/**
|
|
* Branchless ternary operator to be used when it's inexpensive to explicitly
|
|
* evaluate both possibilities for a vec3 expression.
|
|
*
|
|
* @name czm_branchFreeTernary
|
|
* @glslFunction
|
|
*
|
|
* @param {bool} comparison A comparison statement
|
|
* @param {vec3} a Value to return if the comparison is true.
|
|
* @param {vec3} b Value to return if the comparison is false.
|
|
*
|
|
* @returns {vec3} equivalent of comparison ? a : b
|
|
*/
|
|
vec3 czm_branchFreeTernary(bool comparison, vec3 a, vec3 b) {
|
|
float useA = float(comparison);
|
|
return a * useA + b * (1.0 - useA);
|
|
}
|
|
|
|
/**
|
|
* Branchless ternary operator to be used when it's inexpensive to explicitly
|
|
* evaluate both possibilities for a vec4 expression.
|
|
*
|
|
* @name czm_branchFreeTernary
|
|
* @glslFunction
|
|
*
|
|
* @param {bool} comparison A comparison statement
|
|
* @param {vec3} a Value to return if the comparison is true.
|
|
* @param {vec3} b Value to return if the comparison is false.
|
|
*
|
|
* @returns {vec3} equivalent of comparison ? a : b
|
|
*/
|
|
vec4 czm_branchFreeTernary(bool comparison, vec4 a, vec4 b) {
|
|
float useA = float(comparison);
|
|
return a * useA + b * (1.0 - useA);
|
|
}
|
|
`;var MB=`
|
|
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 LB=`
|
|
uniform vec4 shadowMap_cascadeDistances;
|
|
|
|
float czm_cascadeDistance(vec4 weights)
|
|
{
|
|
return dot(shadowMap_cascadeDistances, weights);
|
|
}
|
|
`;var NB=`
|
|
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 FB=`
|
|
uniform vec4 shadowMap_cascadeSplits[2];
|
|
|
|
vec4 czm_cascadeWeights(float depthEye)
|
|
{
|
|
// One component is set to 1.0 and all others set to 0.0.
|
|
vec4 near = step(shadowMap_cascadeSplits[0], vec4(depthEye));
|
|
vec4 far = step(depthEye, shadowMap_cascadeSplits[1]);
|
|
return near * far;
|
|
}
|
|
`;var BB=`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) {
|
|
// Position is completely outside of polygons bounds
|
|
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 kB=`/**
|
|
* DOC_TBA
|
|
*
|
|
* @name czm_columbusViewMorph
|
|
* @glslFunction
|
|
*/
|
|
vec4 czm_columbusViewMorph(vec4 position2D, vec4 position3D, float time)
|
|
{
|
|
// Just linear for now.
|
|
// We're manually doing the equivalent of a \`mix\` here because, some GPUs
|
|
// (NVidia GeForce 3070 Ti and Intel Arc A750, to name two), \`mix\` seems to
|
|
// use an alternate formulation that introduces jitter even when \`time\` is
|
|
// 0.0 or 1.0. That is, the value of \`p\` won't be exactly \`position2D.xyz\`
|
|
// when \`time\` is 0.0 and it won't be exactly \`position3D.xyz\` when \`time\` is
|
|
// 1.0. The "textbook" formulation here, while probably a bit slower,
|
|
// does not have this problem.
|
|
vec3 p = position2D.xyz * (1.0 - time) + position3D.xyz * time;
|
|
return vec4(p, 1.0);
|
|
}
|
|
`;var zB=`/**
|
|
* Compute the atmosphere color, applying Rayleigh and Mie scattering. This
|
|
* builtin uses automatic uniforms so the atmophere settings are synced with the
|
|
* state of the Scene, even in other contexts like Model.
|
|
*
|
|
* @name czm_computeAtmosphereColor
|
|
* @glslFunction
|
|
*
|
|
* @param {vec3} positionWC Position of the fragment in world coords (low precision)
|
|
* @param {vec3} lightDirection Light direction from the sun or other light source.
|
|
* @param {vec3} rayleighColor The Rayleigh scattering color computed by a scattering function
|
|
* @param {vec3} mieColor The Mie scattering color computed by a scattering function
|
|
* @param {float} opacity The opacity computed by a scattering function.
|
|
*/
|
|
vec4 czm_computeAtmosphereColor(
|
|
vec3 positionWC,
|
|
vec3 lightDirection,
|
|
vec3 rayleighColor,
|
|
vec3 mieColor,
|
|
float opacity
|
|
) {
|
|
// Setup the primary ray: from the camera position to the vertex position.
|
|
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;
|
|
|
|
// The Rayleigh phase function.
|
|
float rayleighPhase = 3.0 / (50.2654824574) * (1.0 + cosAngleSq);
|
|
// The Mie phase function.
|
|
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));
|
|
|
|
// The final color is generated by combining the effects of the Rayleigh and Mie scattering.
|
|
vec3 rayleigh = rayleighPhase * rayleighColor;
|
|
vec3 mie = miePhase * mieColor;
|
|
|
|
vec3 color = (rayleigh + mie) * czm_atmosphereLightIntensity;
|
|
|
|
return vec4(color, opacity);
|
|
}
|
|
|
|
/**
|
|
* Compute the atmosphere color, applying Rayleigh and Mie scattering. This
|
|
* builtin uses automatic uniforms so the atmophere settings are synced with the
|
|
* state of the Scene, even in other contexts like Model.
|
|
*
|
|
* @name czm_computeAtmosphereColor
|
|
* @glslFunction
|
|
*
|
|
* @param {czm_ray} primaryRay Ray from the origin to sky fragment to in world coords (low precision)
|
|
* @param {vec3} lightDirection Light direction from the sun or other light source.
|
|
* @param {vec3} rayleighColor The Rayleigh scattering color computed by a scattering function
|
|
* @param {vec3} mieColor The Mie scattering color computed by a scattering function
|
|
* @param {float} opacity The opacity computed by a scattering function.
|
|
*/
|
|
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;
|
|
|
|
// The Rayleigh phase function.
|
|
float rayleighPhase = 3.0 / (50.2654824574) * (1.0 + cosAngleSq);
|
|
// The Mie phase function.
|
|
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));
|
|
|
|
// The final color is generated by combining the effects of the Rayleigh and Mie scattering.
|
|
vec3 rayleigh = rayleighPhase * rayleighColor;
|
|
vec3 mie = miePhase * mieColor;
|
|
|
|
vec3 color = (rayleigh + mie) * czm_atmosphereLightIntensity;
|
|
|
|
return vec4(color, opacity);
|
|
}
|
|
|
|
`;var UB=`/**
|
|
* Compute atmosphere scattering for the ground atmosphere and fog. This method
|
|
* uses automatic uniforms so it is always synced with the scene settings.
|
|
*
|
|
* @name czm_computeGroundAtmosphereScattering
|
|
* @glslfunction
|
|
*
|
|
* @param {vec3} positionWC The position of the fragment in world coordinates.
|
|
* @param {vec3} lightDirection The direction of the light to calculate the scattering from.
|
|
* @param {vec3} rayleighColor The variable the Rayleigh scattering will be written to.
|
|
* @param {vec3} mieColor The variable the Mie scattering will be written to.
|
|
* @param {float} opacity The variable the transmittance will be written to.
|
|
*/
|
|
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 VB=`/**
|
|
* Returns a position in model coordinates relative to eye taking into
|
|
* account the current scene mode: 3D, 2D, or Columbus view.
|
|
* <p>
|
|
* This uses standard position attributes, <code>position3DHigh</code>,
|
|
* <code>position3DLow</code>, <code>position2DHigh</code>, and <code>position2DLow</code>,
|
|
* and should be used when writing a vertex shader for an {@link Appearance}.
|
|
* </p>
|
|
*
|
|
* @name czm_computePosition
|
|
* @glslFunction
|
|
*
|
|
* @returns {vec4} The position relative to eye.
|
|
*
|
|
* @example
|
|
* vec4 p = czm_computePosition();
|
|
* v_positionEC = (czm_modelViewRelativeToEye * p).xyz;
|
|
* gl_Position = czm_modelViewProjectionRelativeToEye * p;
|
|
*
|
|
* @see czm_translateRelativeToEye
|
|
*/
|
|
vec4 czm_computePosition();
|
|
`;var jB=`/**
|
|
* This function computes the colors contributed by Rayliegh and Mie scattering on a given ray, as well as
|
|
* the transmittance value for the ray. This function uses automatic uniforms
|
|
* so the atmosphere settings are always synced with the current scene.
|
|
*
|
|
* @name czm_computeScattering
|
|
* @glslfunction
|
|
*
|
|
* @param {czm_ray} primaryRay The ray from the camera to the position.
|
|
* @param {float} primaryRayLength The length of the primary ray.
|
|
* @param {vec3} lightDirection The direction of the light to calculate the scattering from.
|
|
* @param {vec3} rayleighColor The variable the Rayleigh scattering will be written to.
|
|
* @param {vec3} mieColor The variable the Mie scattering will be written to.
|
|
* @param {float} opacity The variable the transmittance will be written to.
|
|
*/
|
|
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; // The thickness of the atmosphere in meters.
|
|
const int PRIMARY_STEPS_MAX = 16; // Maximum number of times the ray from the camera to the world position (primary ray) is sampled.
|
|
const int LIGHT_STEPS_MAX = 4; // Maximum number of times the light is sampled from the light source's intersection with the atmosphere to a sample position on the primary ray.
|
|
|
|
// Initialize the default scattering amounts to 0.
|
|
rayleighColor = vec3(0.0);
|
|
mieColor = vec3(0.0);
|
|
opacity = 0.0;
|
|
|
|
float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS;
|
|
|
|
vec3 origin = vec3(0.0);
|
|
|
|
// Calculate intersection from the camera to the outer ring of the atmosphere.
|
|
czm_raySegment primaryRayAtmosphereIntersect = czm_raySphereIntersectionInterval(primaryRay, origin, atmosphereOuterRadius);
|
|
|
|
// Return empty colors if no intersection with the atmosphere geometry.
|
|
if (primaryRayAtmosphereIntersect == czm_emptyRaySegment) {
|
|
return;
|
|
}
|
|
|
|
// To deal with smaller values of PRIMARY_STEPS (e.g. 4)
|
|
// we implement a split strategy: sky or horizon.
|
|
// For performance reasons, instead of a if/else branch
|
|
// a soft choice is implemented through a weight 0.0 <= w_stop_gt_lprl <= 1.0
|
|
float x = 1e-7 * primaryRayAtmosphereIntersect.stop / length(primaryRayLength);
|
|
// Value close to 0.0: close to the horizon
|
|
// Value close to 1.0: above in the sky
|
|
float w_stop_gt_lprl = 0.5 * (1.0 + czm_approximateTanh(x));
|
|
|
|
// The ray should start from the first intersection with the outer atmopshere, or from the camera position, if it is inside the atmosphere.
|
|
float start_0 = primaryRayAtmosphereIntersect.start;
|
|
primaryRayAtmosphereIntersect.start = max(primaryRayAtmosphereIntersect.start, 0.0);
|
|
// The ray should end at the exit from the atmosphere or at the distance to the vertex, whichever is smaller.
|
|
primaryRayAtmosphereIntersect.stop = min(primaryRayAtmosphereIntersect.stop, length(primaryRayLength));
|
|
|
|
// For the number of ray steps, distinguish inside or outside atmosphere (outer space)
|
|
// (1) from outer space we have to use more ray steps to get a realistic rendering
|
|
// (2) within atmosphere we need fewer steps for faster rendering
|
|
float x_o_a = start_0 - ATMOSPHERE_THICKNESS; // ATMOSPHERE_THICKNESS used as an ad-hoc constant, no precise meaning here, only the order of magnitude matters
|
|
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); // Number of times the ray from the camera to the world position (primary ray) is sampled.
|
|
int LIGHT_STEPS = LIGHT_STEPS_MAX - int(w_inside_atmosphere * 2.0); // Number of times the light is sampled from the light source's intersection with the atmosphere to a sample position on the primary ray.
|
|
|
|
// Setup for sampling positions along the ray - starting from the intersection with the outer ring of the atmosphere.
|
|
float rayPositionLength = primaryRayAtmosphereIntersect.start;
|
|
// (1) Outside the atmosphere: constant rayStepLength
|
|
// (2) Inside atmosphere: variable rayStepLength to compensate the rough rendering of the smaller number of ray steps
|
|
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);
|
|
|
|
// Sample positions on the primary ray.
|
|
for (int i = 0; i < PRIMARY_STEPS_MAX; ++i) {
|
|
|
|
// The loop should be: for (int i = 0; i < PRIMARY_STEPS; ++i) {...} but WebGL1 cannot
|
|
// loop with non-constant condition, so it has to break early instead
|
|
if (i >= PRIMARY_STEPS) {
|
|
break;
|
|
}
|
|
|
|
// Calculate sample position along viewpoint ray.
|
|
vec3 samplePosition = primaryRay.origin + primaryRay.direction * (rayPositionLength + rayStepLength);
|
|
|
|
// Calculate height of sample position above ellipsoid.
|
|
float sampleHeight = length(samplePosition) - atmosphereInnerRadius;
|
|
|
|
// Calculate and accumulate density of particles at the sample position.
|
|
vec2 sampleDensity = exp(-sampleHeight / heightScale) * rayStepLength;
|
|
opticalDepth += sampleDensity;
|
|
|
|
// Generate ray from the sample position segment to the light source, up to the outer ring of the atmosphere.
|
|
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);
|
|
|
|
// Sample positions along the light ray, to accumulate incidence of light on the latest sample segment.
|
|
for (int j = 0; j < LIGHT_STEPS_MAX; ++j) {
|
|
|
|
// The loop should be: for (int j = 0; i < LIGHT_STEPS; ++j) {...} but WebGL1 cannot
|
|
// loop with non-constant condition, so it has to break early instead
|
|
if (j >= LIGHT_STEPS) {
|
|
break;
|
|
}
|
|
|
|
// Calculate sample position along light ray.
|
|
vec3 lightPosition = samplePosition + lightDirection * (lightPositionLength + lightStepLength * 0.5);
|
|
|
|
// Calculate height of the light sample position above ellipsoid.
|
|
float lightHeight = length(lightPosition) - atmosphereInnerRadius;
|
|
|
|
// Calculate density of photons at the light sample position.
|
|
lightOpticalDepth += exp(-lightHeight / heightScale) * lightStepLength;
|
|
|
|
// Increment distance on light ray.
|
|
lightPositionLength += lightStepLength;
|
|
}
|
|
|
|
// Compute attenuation via the primary ray and the light ray.
|
|
vec3 attenuation = exp(-((czm_atmosphereMieCoefficient * (opticalDepth.y + lightOpticalDepth.y)) + (czm_atmosphereRayleighCoefficient * (opticalDepth.x + lightOpticalDepth.x))));
|
|
|
|
// Accumulate the scattering.
|
|
rayleighAccumulation += sampleDensity.x * attenuation;
|
|
mieAccumulation += sampleDensity.y * attenuation;
|
|
|
|
// Increment distance on primary ray.
|
|
rayPositionLength += (rayStepLength += rayStepLengthIncrease);
|
|
}
|
|
|
|
// Compute the scattering amount.
|
|
rayleighColor = czm_atmosphereRayleighCoefficient * rayleighAccumulation;
|
|
mieColor = czm_atmosphereMieCoefficient * mieAccumulation;
|
|
|
|
// Compute the transmittance i.e. how much light is passing through the atmosphere.
|
|
opacity = length(exp(-((czm_atmosphereMieCoefficient * opticalDepth.y) + (czm_atmosphereRayleighCoefficient * opticalDepth.x))));
|
|
}
|
|
`;var HB=`/**
|
|
* Applies a 2D texture transformation matrix to texture coordinates.
|
|
* This function applies translation, rotation, and scaling transformations
|
|
* as specified by the KHR_texture_transform glTF extension.
|
|
*
|
|
* @name czm_computeTextureTransform
|
|
* @glslFunction
|
|
*
|
|
* @param {vec2} texCoord The texture coordinates to transform.
|
|
* @param {mat3} textureTransform The 3x3 transformation matrix.
|
|
*
|
|
* @returns {vec2} The transformed texture coordinates.
|
|
*
|
|
* @example
|
|
* // GLSL declaration
|
|
* vec2 czm_computeTextureTransform(vec2 texCoord, mat3 textureTransform);
|
|
*
|
|
* // Apply texture transform to UV coordinates
|
|
* vec2 transformedUV = czm_computeTextureTransform(uv, u_textureTransform);
|
|
*/
|
|
vec2 czm_computeTextureTransform(vec2 texCoord, mat3 textureTransform)
|
|
{
|
|
return vec2(textureTransform * vec3(texCoord, 1.0));
|
|
}`;var GB=`/**
|
|
* @private
|
|
*/
|
|
vec2 cordic(float angle)
|
|
{
|
|
// Scale the vector by the appropriate factor for the 24 iterations to follow.
|
|
vec2 vector = vec2(6.0725293500888267e-1, 0.0);
|
|
// Iteration 1
|
|
float sense = (angle < 0.0) ? -1.0 : 1.0;
|
|
// float factor = sense * 1.0; // 2^-0
|
|
mat2 rotation = mat2(1.0, sense, -sense, 1.0);
|
|
vector = rotation * vector;
|
|
angle -= sense * 7.8539816339744828e-1; // atan(2^-0)
|
|
// Iteration 2
|
|
sense = (angle < 0.0) ? -1.0 : 1.0;
|
|
float factor = sense * 5.0e-1; // 2^-1
|
|
rotation[0][1] = factor;
|
|
rotation[1][0] = -factor;
|
|
vector = rotation * vector;
|
|
angle -= sense * 4.6364760900080609e-1; // atan(2^-1)
|
|
// Iteration 3
|
|
sense = (angle < 0.0) ? -1.0 : 1.0;
|
|
factor = sense * 2.5e-1; // 2^-2
|
|
rotation[0][1] = factor;
|
|
rotation[1][0] = -factor;
|
|
vector = rotation * vector;
|
|
angle -= sense * 2.4497866312686414e-1; // atan(2^-2)
|
|
// Iteration 4
|
|
sense = (angle < 0.0) ? -1.0 : 1.0;
|
|
factor = sense * 1.25e-1; // 2^-3
|
|
rotation[0][1] = factor;
|
|
rotation[1][0] = -factor;
|
|
vector = rotation * vector;
|
|
angle -= sense * 1.2435499454676144e-1; // atan(2^-3)
|
|
// Iteration 5
|
|
sense = (angle < 0.0) ? -1.0 : 1.0;
|
|
factor = sense * 6.25e-2; // 2^-4
|
|
rotation[0][1] = factor;
|
|
rotation[1][0] = -factor;
|
|
vector = rotation * vector;
|
|
angle -= sense * 6.2418809995957350e-2; // atan(2^-4)
|
|
// Iteration 6
|
|
sense = (angle < 0.0) ? -1.0 : 1.0;
|
|
factor = sense * 3.125e-2; // 2^-5
|
|
rotation[0][1] = factor;
|
|
rotation[1][0] = -factor;
|
|
vector = rotation * vector;
|
|
angle -= sense * 3.1239833430268277e-2; // atan(2^-5)
|
|
// Iteration 7
|
|
sense = (angle < 0.0) ? -1.0 : 1.0;
|
|
factor = sense * 1.5625e-2; // 2^-6
|
|
rotation[0][1] = factor;
|
|
rotation[1][0] = -factor;
|
|
vector = rotation * vector;
|
|
angle -= sense * 1.5623728620476831e-2; // atan(2^-6)
|
|
// Iteration 8
|
|
sense = (angle < 0.0) ? -1.0 : 1.0;
|
|
factor = sense * 7.8125e-3; // 2^-7
|
|
rotation[0][1] = factor;
|
|
rotation[1][0] = -factor;
|
|
vector = rotation * vector;
|
|
angle -= sense * 7.8123410601011111e-3; // atan(2^-7)
|
|
// Iteration 9
|
|
sense = (angle < 0.0) ? -1.0 : 1.0;
|
|
factor = sense * 3.90625e-3; // 2^-8
|
|
rotation[0][1] = factor;
|
|
rotation[1][0] = -factor;
|
|
vector = rotation * vector;
|
|
angle -= sense * 3.9062301319669718e-3; // atan(2^-8)
|
|
// Iteration 10
|
|
sense = (angle < 0.0) ? -1.0 : 1.0;
|
|
factor = sense * 1.953125e-3; // 2^-9
|
|
rotation[0][1] = factor;
|
|
rotation[1][0] = -factor;
|
|
vector = rotation * vector;
|
|
angle -= sense * 1.9531225164788188e-3; // atan(2^-9)
|
|
// Iteration 11
|
|
sense = (angle < 0.0) ? -1.0 : 1.0;
|
|
factor = sense * 9.765625e-4; // 2^-10
|
|
rotation[0][1] = factor;
|
|
rotation[1][0] = -factor;
|
|
vector = rotation * vector;
|
|
angle -= sense * 9.7656218955931946e-4; // atan(2^-10)
|
|
// Iteration 12
|
|
sense = (angle < 0.0) ? -1.0 : 1.0;
|
|
factor = sense * 4.8828125e-4; // 2^-11
|
|
rotation[0][1] = factor;
|
|
rotation[1][0] = -factor;
|
|
vector = rotation * vector;
|
|
angle -= sense * 4.8828121119489829e-4; // atan(2^-11)
|
|
// Iteration 13
|
|
sense = (angle < 0.0) ? -1.0 : 1.0;
|
|
factor = sense * 2.44140625e-4; // 2^-12
|
|
rotation[0][1] = factor;
|
|
rotation[1][0] = -factor;
|
|
vector = rotation * vector;
|
|
angle -= sense * 2.4414062014936177e-4; // atan(2^-12)
|
|
// Iteration 14
|
|
sense = (angle < 0.0) ? -1.0 : 1.0;
|
|
factor = sense * 1.220703125e-4; // 2^-13
|
|
rotation[0][1] = factor;
|
|
rotation[1][0] = -factor;
|
|
vector = rotation * vector;
|
|
angle -= sense * 1.2207031189367021e-4; // atan(2^-13)
|
|
// Iteration 15
|
|
sense = (angle < 0.0) ? -1.0 : 1.0;
|
|
factor = sense * 6.103515625e-5; // 2^-14
|
|
rotation[0][1] = factor;
|
|
rotation[1][0] = -factor;
|
|
vector = rotation * vector;
|
|
angle -= sense * 6.1035156174208773e-5; // atan(2^-14)
|
|
// Iteration 16
|
|
sense = (angle < 0.0) ? -1.0 : 1.0;
|
|
factor = sense * 3.0517578125e-5; // 2^-15
|
|
rotation[0][1] = factor;
|
|
rotation[1][0] = -factor;
|
|
vector = rotation * vector;
|
|
angle -= sense * 3.0517578115526096e-5; // atan(2^-15)
|
|
// Iteration 17
|
|
sense = (angle < 0.0) ? -1.0 : 1.0;
|
|
factor = sense * 1.52587890625e-5; // 2^-16
|
|
rotation[0][1] = factor;
|
|
rotation[1][0] = -factor;
|
|
vector = rotation * vector;
|
|
angle -= sense * 1.5258789061315762e-5; // atan(2^-16)
|
|
// Iteration 18
|
|
sense = (angle < 0.0) ? -1.0 : 1.0;
|
|
factor = sense * 7.62939453125e-6; // 2^-17
|
|
rotation[0][1] = factor;
|
|
rotation[1][0] = -factor;
|
|
vector = rotation * vector;
|
|
angle -= sense * 7.6293945311019700e-6; // atan(2^-17)
|
|
// Iteration 19
|
|
sense = (angle < 0.0) ? -1.0 : 1.0;
|
|
factor = sense * 3.814697265625e-6; // 2^-18
|
|
rotation[0][1] = factor;
|
|
rotation[1][0] = -factor;
|
|
vector = rotation * vector;
|
|
angle -= sense * 3.8146972656064961e-6; // atan(2^-18)
|
|
// Iteration 20
|
|
sense = (angle < 0.0) ? -1.0 : 1.0;
|
|
factor = sense * 1.9073486328125e-6; // 2^-19
|
|
rotation[0][1] = factor;
|
|
rotation[1][0] = -factor;
|
|
vector = rotation * vector;
|
|
angle -= sense * 1.9073486328101870e-6; // atan(2^-19)
|
|
// Iteration 21
|
|
sense = (angle < 0.0) ? -1.0 : 1.0;
|
|
factor = sense * 9.5367431640625e-7; // 2^-20
|
|
rotation[0][1] = factor;
|
|
rotation[1][0] = -factor;
|
|
vector = rotation * vector;
|
|
angle -= sense * 9.5367431640596084e-7; // atan(2^-20)
|
|
// Iteration 22
|
|
sense = (angle < 0.0) ? -1.0 : 1.0;
|
|
factor = sense * 4.76837158203125e-7; // 2^-21
|
|
rotation[0][1] = factor;
|
|
rotation[1][0] = -factor;
|
|
vector = rotation * vector;
|
|
angle -= sense * 4.7683715820308884e-7; // atan(2^-21)
|
|
// Iteration 23
|
|
sense = (angle < 0.0) ? -1.0 : 1.0;
|
|
factor = sense * 2.384185791015625e-7; // 2^-22
|
|
rotation[0][1] = factor;
|
|
rotation[1][0] = -factor;
|
|
vector = rotation * vector;
|
|
angle -= sense * 2.3841857910155797e-7; // atan(2^-22)
|
|
// Iteration 24
|
|
sense = (angle < 0.0) ? -1.0 : 1.0;
|
|
factor = sense * 1.1920928955078125e-7; // 2^-23
|
|
rotation[0][1] = factor;
|
|
rotation[1][0] = -factor;
|
|
vector = rotation * vector;
|
|
// angle -= sense * 1.1920928955078068e-7; // atan(2^-23)
|
|
|
|
return vector;
|
|
}
|
|
|
|
/**
|
|
* Computes the cosine and sine of the provided angle using the CORDIC algorithm.
|
|
*
|
|
* @name czm_cosineAndSine
|
|
* @glslFunction
|
|
*
|
|
* @param {float} angle The angle in radians.
|
|
*
|
|
* @returns {vec2} The resulting cosine of the angle (as the x coordinate) and sine of the angle (as the y coordinate).
|
|
*
|
|
* @example
|
|
* vec2 v = czm_cosineAndSine(czm_piOverSix);
|
|
* float cosine = v.x;
|
|
* float sine = v.y;
|
|
*/
|
|
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 WB=`/**
|
|
* Decodes RGB values packed into a single float at 8-bit precision. Encoded
|
|
* representation is equivalent to 0xFFFFFF in JavaScript.
|
|
*
|
|
* @name czm_decodeRGB8
|
|
* @glslFunction
|
|
*
|
|
* @param {float} encoded Float-encoded RGB values.
|
|
* @returns {vec4} Decoded RGB values.
|
|
*/
|
|
vec4 czm_decodeRGB8(float encoded) {
|
|
const float SHIFT_RIGHT16 = 1.0 / 65536.0;
|
|
const float SHIFT_RIGHT8 = 1.0 / 256.0;
|
|
const float SHIFT_LEFT16 = 65536.0;
|
|
const float SHIFT_LEFT8 = 256.0;
|
|
|
|
vec4 color = vec4(255.0);
|
|
color.r = floor(encoded * SHIFT_RIGHT16);
|
|
color.g = floor((encoded - color.r * SHIFT_LEFT16) * SHIFT_RIGHT8);
|
|
color.b = floor(encoded - color.r * SHIFT_LEFT16 - color.g * SHIFT_LEFT8);
|
|
return color / 255.0;
|
|
}
|
|
`;var qB=`/**
|
|
* Decompresses texture coordinates that were packed into a single float.
|
|
*
|
|
* @name czm_decompressTextureCoordinates
|
|
* @glslFunction
|
|
*
|
|
* @param {float} encoded The compressed texture coordinates.
|
|
* @returns {vec2} The decompressed texture coordinates.
|
|
*/
|
|
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 YB=`// emulated noperspective
|
|
#if (__VERSION__ == 300 || defined(GL_EXT_frag_depth)) && !defined(LOG_DEPTH)
|
|
out float v_WindowZ;
|
|
#endif
|
|
|
|
/**
|
|
* Emulates GL_DEPTH_CLAMP, which is not available in WebGL 1 or 2.
|
|
* GL_DEPTH_CLAMP clamps geometry that is outside the near and far planes,
|
|
* capping the shadow volume. More information here:
|
|
* https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_depth_clamp.txt.
|
|
*
|
|
* When GL_EXT_frag_depth is available we emulate GL_DEPTH_CLAMP by ensuring
|
|
* no geometry gets clipped by setting the clip space z value to 0.0 and then
|
|
* sending the unaltered screen space z value (using emulated noperspective
|
|
* interpolation) to the frag shader where it is clamped to [0,1] and then
|
|
* written with gl_FragDepth (see czm_writeDepthClamp). This technique is based on:
|
|
* https://stackoverflow.com/questions/5960757/how-to-emulate-gl-depth-clamp-nv.
|
|
*
|
|
* When GL_EXT_frag_depth is not available, which is the case on some mobile
|
|
* devices, we must attempt to fix this only in the vertex shader.
|
|
* The approach is to clamp the z value to the far plane, which closes the
|
|
* shadow volume but also distorts the geometry, so there can still be artifacts
|
|
* on frustum seams.
|
|
*
|
|
* @name czm_depthClamp
|
|
* @glslFunction
|
|
*
|
|
* @param {vec4} coords The vertex in clip coordinates.
|
|
* @returns {vec4} The modified vertex.
|
|
*
|
|
* @example
|
|
* gl_Position = czm_depthClamp(czm_modelViewProjection * vec4(position, 1.0));
|
|
*
|
|
* @see czm_writeDepthClamp
|
|
*/
|
|
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 XB=`/**
|
|
* Computes a 3x3 rotation matrix that transforms vectors from an ellipsoid's east-north-up coordinate system
|
|
* to eye coordinates. In east-north-up coordinates, x points east, y points north, and z points along the
|
|
* surface normal. East-north-up can be used as an ellipsoid's tangent space for operations such as bump mapping.
|
|
* <br /><br />
|
|
* The ellipsoid is assumed to be centered at the model coordinate's origin.
|
|
*
|
|
* @name czm_eastNorthUpToEyeCoordinates
|
|
* @glslFunction
|
|
*
|
|
* @param {vec3} positionMC The position on the ellipsoid in model coordinates.
|
|
* @param {vec3} normalEC The normalized ellipsoid surface normal, at <code>positionMC</code>, in eye coordinates.
|
|
*
|
|
* @returns {mat3} A 3x3 rotation matrix that transforms vectors from the east-north-up coordinate system to eye coordinates.
|
|
*
|
|
* @example
|
|
* // Transform a vector defined in the east-north-up coordinate
|
|
* // system, (0, 0, 1) which is the surface normal, to eye
|
|
* // coordinates.
|
|
* mat3 m = czm_eastNorthUpToEyeCoordinates(positionMC, normalEC);
|
|
* vec3 normalEC = m * vec3(0.0, 0.0, 1.0);
|
|
*/
|
|
mat3 czm_eastNorthUpToEyeCoordinates(vec3 positionMC, vec3 normalEC)
|
|
{
|
|
vec3 tangentMC = normalize(vec3(-positionMC.y, positionMC.x, 0.0)); // normalized surface tangent in model coordinates
|
|
vec3 tangentEC = normalize(czm_normal3D * tangentMC); // normalized surface tangent in eye coordinates
|
|
vec3 bitangentEC = normalize(cross(normalEC, tangentEC)); // normalized surface bitangent in eye coordinates
|
|
|
|
return mat3(
|
|
tangentEC.x, tangentEC.y, tangentEC.z,
|
|
bitangentEC.x, bitangentEC.y, bitangentEC.z,
|
|
normalEC.x, normalEC.y, normalEC.z);
|
|
}
|
|
`;var KB=`/**
|
|
* DOC_TBA
|
|
*
|
|
* @name czm_ellipsoidContainsPoint
|
|
* @glslFunction
|
|
*
|
|
*/
|
|
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 $B=`/**
|
|
* Approximate uv coordinates based on the ellipsoid normal.
|
|
*
|
|
* @name czm_ellipsoidTextureCoordinates
|
|
* @glslFunction
|
|
*/
|
|
vec2 czm_ellipsoidTextureCoordinates(vec3 normal)
|
|
{
|
|
return vec2(atan(normal.y, normal.x) * czm_oneOverTwoPi + 0.5, asin(normal.z) * czm_oneOverPi + 0.5);
|
|
}
|
|
`;var JB=`/**
|
|
* Compares <code>left</code> and <code>right</code> componentwise. Returns <code>true</code>
|
|
* if they are within <code>epsilon</code> and <code>false</code> otherwise. The inputs
|
|
* <code>left</code> and <code>right</code> can be <code>float</code>s, <code>vec2</code>s,
|
|
* <code>vec3</code>s, or <code>vec4</code>s.
|
|
*
|
|
* @name czm_equalsEpsilon
|
|
* @glslFunction
|
|
*
|
|
* @param {} left The first vector.
|
|
* @param {} right The second vector.
|
|
* @param {float} epsilon The epsilon to use for equality testing.
|
|
* @returns {bool} <code>true</code> if the components are within <code>epsilon</code> and <code>false</code> otherwise.
|
|
*
|
|
* @example
|
|
* // GLSL declarations
|
|
* bool czm_equalsEpsilon(float left, float right, float epsilon);
|
|
* bool czm_equalsEpsilon(vec2 left, vec2 right, float epsilon);
|
|
* bool czm_equalsEpsilon(vec3 left, vec3 right, float epsilon);
|
|
* bool czm_equalsEpsilon(vec4 left, vec4 right, float epsilon);
|
|
*/
|
|
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 ZB=`/**
|
|
* DOC_TBA
|
|
*
|
|
* @name czm_eyeOffset
|
|
* @glslFunction
|
|
*
|
|
* @param {vec4} positionEC DOC_TBA.
|
|
* @param {vec3} eyeOffset DOC_TBA.
|
|
*
|
|
* @returns {vec4} DOC_TBA.
|
|
*/
|
|
vec4 czm_eyeOffset(vec4 positionEC, vec3 eyeOffset)
|
|
{
|
|
// This equation is approximate in x and y.
|
|
vec4 p = positionEC;
|
|
vec4 zEyeOffset = normalize(p) * eyeOffset.z;
|
|
p.xy += eyeOffset.xy + zEyeOffset.xy;
|
|
p.z += zEyeOffset.z;
|
|
return p;
|
|
}
|
|
`;var QB=`/**
|
|
* Transforms a position from eye to window coordinates. The transformation
|
|
* from eye to clip coordinates is done using {@link czm_projection}.
|
|
* The transform from normalized device coordinates to window coordinates is
|
|
* done using {@link czm_viewportTransformation}, which assumes a depth range
|
|
* of <code>near = 0</code> and <code>far = 1</code>.
|
|
* <br /><br />
|
|
* This transform is useful when there is a need to manipulate window coordinates
|
|
* in a vertex shader as done by {@link BillboardCollection}.
|
|
*
|
|
* @name czm_eyeToWindowCoordinates
|
|
* @glslFunction
|
|
*
|
|
* @param {vec4} position The position in eye coordinates to transform.
|
|
*
|
|
* @returns {vec4} The transformed position in window coordinates.
|
|
*
|
|
* @see czm_modelToWindowCoordinates
|
|
* @see czm_projection
|
|
* @see czm_viewportTransformation
|
|
* @see BillboardCollection
|
|
*
|
|
* @example
|
|
* vec4 positionWC = czm_eyeToWindowCoordinates(positionEC);
|
|
*/
|
|
vec4 czm_eyeToWindowCoordinates(vec4 positionEC)
|
|
{
|
|
vec4 q = czm_projection * positionEC; // clip coordinates
|
|
q.xyz /= q.w; // normalized device coordinates
|
|
q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz; // window coordinates
|
|
return q;
|
|
}
|
|
`;var e2=`/**
|
|
* Approxiamtes atan over the range [0, 1]. Safe to flip output for negative input.
|
|
*
|
|
* Based on Michal Drobot's approximation from ShaderFastLibs, which in turn is based on
|
|
* "Efficient approximations for the arctangent function," Rajan, S. Sichun Wang Inkol, R. Joyal, A., May 2006.
|
|
* Adapted from ShaderFastLibs under MIT License.
|
|
*
|
|
* Chosen for the following characteristics over range [0, 1]:
|
|
* - basically no error at 0 and 1, important for getting around range limit (naive atan2 via atan requires infinite range atan)
|
|
* - no visible artifacts from first-derivative discontinuities, unlike latitude via range-reduced sqrt asin approximations (at equator)
|
|
*
|
|
* The original code is x * (-0.1784 * abs(x) - 0.0663 * x * x + 1.0301);
|
|
* Removed the abs() in here because it isn't needed, the input range is guaranteed as [0, 1] by how we're approximating atan2.
|
|
*
|
|
* @name czm_fastApproximateAtan
|
|
* @glslFunction
|
|
*
|
|
* @param {float} x Value between 0 and 1 inclusive.
|
|
*
|
|
* @returns {float} Approximation of atan(x)
|
|
*/
|
|
float czm_fastApproximateAtan(float x) {
|
|
return x * (-0.1784 * x - 0.0663 * x * x + 1.0301);
|
|
}
|
|
|
|
/**
|
|
* Approximation of atan2.
|
|
*
|
|
* Range reduction math based on nvidia's cg reference implementation for atan2: http://developer.download.nvidia.com/cg/atan2.html
|
|
* However, we replaced their atan curve with Michael Drobot's (see above).
|
|
*
|
|
* @name czm_fastApproximateAtan
|
|
* @glslFunction
|
|
*
|
|
* @param {float} x Value between -1 and 1 inclusive.
|
|
* @param {float} y Value between -1 and 1 inclusive.
|
|
*
|
|
* @returns {float} Approximation of atan2(x, y)
|
|
*/
|
|
float czm_fastApproximateAtan(float x, float y) {
|
|
// atan approximations are usually only reliable over [-1, 1], or, in our case, [0, 1] due to modifications.
|
|
// So range-reduce using abs and by flipping whether x or y is on top.
|
|
float t = abs(x); // t used as swap and atan result.
|
|
float opposite = abs(y);
|
|
float adjacent = max(t, opposite);
|
|
opposite = min(t, opposite);
|
|
|
|
t = czm_fastApproximateAtan(opposite / adjacent);
|
|
|
|
// Undo range reduction
|
|
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 t2=`/**
|
|
* Gets the color with fog at a distance from the camera.
|
|
*
|
|
* @name czm_fog
|
|
* @glslFunction
|
|
*
|
|
* @param {float} distanceToCamera The distance to the camera in meters.
|
|
* @param {vec3} color The original color.
|
|
* @param {vec3} fogColor The color of the fog.
|
|
*
|
|
* @returns {vec3} The color adjusted for fog at the distance from the camera.
|
|
*/
|
|
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);
|
|
}
|
|
|
|
/**
|
|
* Gets the color with fog at a distance from the camera.
|
|
*
|
|
* @name czm_fog
|
|
* @glslFunction
|
|
*
|
|
* @param {float} distanceToCamera The distance to the camera in meters.
|
|
* @param {vec3} color The original color.
|
|
* @param {vec3} fogColor The color of the fog.
|
|
* @param {float} fogModifierConstant A constant to modify the appearance of fog.
|
|
*
|
|
* @returns {vec3} The color adjusted for fog at the distance from the camera.
|
|
*/
|
|
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 n2=`/**
|
|
* Converts a color from RGB space to linear space.
|
|
*
|
|
* @name czm_gammaCorrect
|
|
* @glslFunction
|
|
*
|
|
* @param {vec3} color The color in RGB space.
|
|
* @returns {vec3} The color in linear space.
|
|
*/
|
|
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 i2=`/**
|
|
* DOC_TBA
|
|
*
|
|
* @name czm_geodeticSurfaceNormal
|
|
* @glslFunction
|
|
*
|
|
* @param {vec3} positionOnEllipsoid DOC_TBA
|
|
* @param {vec3} ellipsoidCenter DOC_TBA
|
|
* @param {vec3} oneOverEllipsoidRadiiSquared DOC_TBA
|
|
*
|
|
* @returns {vec3} DOC_TBA.
|
|
*/
|
|
vec3 czm_geodeticSurfaceNormal(vec3 positionOnEllipsoid, vec3 ellipsoidCenter, vec3 oneOverEllipsoidRadiiSquared)
|
|
{
|
|
return normalize((positionOnEllipsoid - ellipsoidCenter) * oneOverEllipsoidRadiiSquared);
|
|
}
|
|
`;var r2=`/**
|
|
* An czm_material with default values. Every material's czm_getMaterial
|
|
* should use this default material as a base for the material it returns.
|
|
* The default normal value is given by materialInput.normalEC.
|
|
*
|
|
* @name czm_getDefaultMaterial
|
|
* @glslFunction
|
|
*
|
|
* @param {czm_materialInput} input The input used to construct the default material.
|
|
*
|
|
* @returns {czm_material} The default material.
|
|
*
|
|
* @see czm_materialInput
|
|
* @see czm_material
|
|
* @see czm_getMaterial
|
|
*/
|
|
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 o2=`/**
|
|
* Select which direction vector to use for dynamic atmosphere lighting based on an enum value
|
|
*
|
|
* @name czm_getDynamicAtmosphereLightDirection
|
|
* @glslfunction
|
|
* @see DynamicAtmosphereLightingType.js
|
|
*
|
|
* @param {vec3} positionWC the position of the vertex/fragment in world coordinates. This is normalized and returned when dynamic lighting is turned off.
|
|
* @param {float} lightEnum The enum value for selecting between light sources.
|
|
* @return {vec3} The normalized light direction vector. Depending on the enum value, it is either positionWC, czm_lightDirectionWC or czm_sunDirectionWC
|
|
*/
|
|
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 a2=`/**
|
|
* Calculates the intensity of diffusely reflected light.
|
|
*
|
|
* @name czm_getLambertDiffuse
|
|
* @glslFunction
|
|
*
|
|
* @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates.
|
|
* @param {vec3} normalEC The surface normal in eye coordinates.
|
|
*
|
|
* @returns {float} The intensity of the diffuse reflection.
|
|
*
|
|
* @see czm_phong
|
|
*
|
|
* @example
|
|
* float diffuseIntensity = czm_getLambertDiffuse(lightDirectionEC, normalEC);
|
|
* float specularIntensity = czm_getSpecular(lightDirectionEC, toEyeEC, normalEC, 200);
|
|
* vec3 color = (diffuseColor * diffuseIntensity) + (specularColor * specularIntensity);
|
|
*/
|
|
float czm_getLambertDiffuse(vec3 lightDirectionEC, vec3 normalEC)
|
|
{
|
|
return max(dot(lightDirectionEC, normalEC), 0.0);
|
|
}
|
|
`;var s2=`/**
|
|
* Calculates the specular intensity of reflected light.
|
|
*
|
|
* @name czm_getSpecular
|
|
* @glslFunction
|
|
*
|
|
* @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates.
|
|
* @param {vec3} toEyeEC Unit vector pointing to the eye position in eye coordinates.
|
|
* @param {vec3} normalEC The surface normal in eye coordinates.
|
|
* @param {float} shininess The sharpness of the specular reflection. Higher values create a smaller, more focused specular highlight.
|
|
*
|
|
* @returns {float} The intensity of the specular highlight.
|
|
*
|
|
* @see czm_phong
|
|
*
|
|
* @example
|
|
* float diffuseIntensity = czm_getLambertDiffuse(lightDirectionEC, normalEC);
|
|
* float specularIntensity = czm_getSpecular(lightDirectionEC, toEyeEC, normalEC, 200);
|
|
* vec3 color = (diffuseColor * diffuseIntensity) + (specularColor * specularIntensity);
|
|
*/
|
|
float czm_getSpecular(vec3 lightDirectionEC, vec3 toEyeEC, vec3 normalEC, float shininess)
|
|
{
|
|
vec3 toReflectedLight = reflect(-lightDirectionEC, normalEC);
|
|
float specular = max(dot(toReflectedLight, toEyeEC), 0.0);
|
|
|
|
// pow has undefined behavior if both parameters <= 0.
|
|
// Prevent this by making sure shininess is at least czm_epsilon2.
|
|
return pow(specular, max(shininess, czm_epsilon2));
|
|
}
|
|
`;var c2=`/**
|
|
* @private
|
|
*/
|
|
vec4 czm_getWaterNoise(sampler2D normalMap, vec2 uv, float time, float angleInRadians)
|
|
{
|
|
float cosAngle = cos(angleInRadians);
|
|
float sinAngle = sin(angleInRadians);
|
|
|
|
// time dependent sampling directions
|
|
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);
|
|
|
|
// rotate sampling direction by specified angle
|
|
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));
|
|
|
|
// average and scale to between -1 and 1
|
|
return ((noise / 4.0) - 0.5) * 2.0;
|
|
}
|
|
`;var l2=`/**
|
|
* Adjusts the hue of a color.
|
|
*
|
|
* @name czm_hue
|
|
* @glslFunction
|
|
*
|
|
* @param {vec3} rgb The color.
|
|
* @param {float} adjustment The amount to adjust the hue of the color in radians.
|
|
*
|
|
* @returns {float} The color with the hue adjusted.
|
|
*
|
|
* @example
|
|
* vec3 adjustHue = czm_hue(color, czm_pi); // The same as czm_hue(color, -czm_pi)
|
|
*/
|
|
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 u2=`/**
|
|
* Converts a color in linear space to RGB space.
|
|
*
|
|
* @name czm_inverseGamma
|
|
* @glslFunction
|
|
*
|
|
* @param {vec3} color The color in linear space.
|
|
* @returns {vec3} The color in RGB space.
|
|
*/
|
|
vec3 czm_inverseGamma(vec3 color) {
|
|
return pow(color, vec3(1.0 / czm_gamma));
|
|
}
|
|
`;var f2=`/**
|
|
* Determines if a time interval is empty.
|
|
*
|
|
* @name czm_isEmpty
|
|
* @glslFunction
|
|
*
|
|
* @param {czm_raySegment} interval The interval to test.
|
|
*
|
|
* @returns {bool} <code>true</code> if the time interval is empty; otherwise, <code>false</code>.
|
|
*
|
|
* @example
|
|
* bool b0 = czm_isEmpty(czm_emptyRaySegment); // true
|
|
* bool b1 = czm_isEmpty(czm_raySegment(0.0, 1.0)); // false
|
|
* bool b2 = czm_isEmpty(czm_raySegment(1.0, 1.0)); // false, contains 1.0.
|
|
*/
|
|
bool czm_isEmpty(czm_raySegment interval)
|
|
{
|
|
return (interval.stop < 0.0);
|
|
}
|
|
`;var d2=`/**
|
|
* Determines if a time interval is empty.
|
|
*
|
|
* @name czm_isFull
|
|
* @glslFunction
|
|
*
|
|
* @param {czm_raySegment} interval The interval to test.
|
|
*
|
|
* @returns {bool} <code>true</code> if the time interval is empty; otherwise, <code>false</code>.
|
|
*
|
|
* @example
|
|
* bool b0 = czm_isEmpty(czm_emptyRaySegment); // true
|
|
* bool b1 = czm_isEmpty(czm_raySegment(0.0, 1.0)); // false
|
|
* bool b2 = czm_isEmpty(czm_raySegment(1.0, 1.0)); // false, contains 1.0.
|
|
*/
|
|
bool czm_isFull(czm_raySegment interval)
|
|
{
|
|
return (interval.start == 0.0 && interval.stop == czm_infinity);
|
|
}
|
|
`;var h2=`/**
|
|
* Computes the fraction of a Web Wercator rectangle at which a given geodetic latitude is located.
|
|
*
|
|
* @name czm_latitudeToWebMercatorFraction
|
|
* @glslFunction
|
|
*
|
|
* @param {float} latitude The geodetic latitude, in radians.
|
|
* @param {float} southMercatorY The Web Mercator coordinate of the southern boundary of the rectangle.
|
|
* @param {float} oneOverMercatorHeight The total height of the rectangle in Web Mercator coordinates.
|
|
*
|
|
* @returns {float} The fraction of the rectangle at which the latitude occurs. If the latitude is the southern
|
|
* boundary of the rectangle, the return value will be zero. If it is the northern boundary, the return
|
|
* value will be 1.0. Latitudes in between are mapped according to the Web Mercator projection.
|
|
*/
|
|
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 m2=`/**
|
|
* Computes distance from an point in 2D to a line in 2D.
|
|
*
|
|
* @name czm_lineDistance
|
|
* @glslFunction
|
|
*
|
|
* param {vec2} point1 A point along the line.
|
|
* param {vec2} point2 A point along the line.
|
|
* param {vec2} point A point that may or may not be on the line.
|
|
* returns {float} The distance from the point to the line.
|
|
*/
|
|
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 p2=`/**
|
|
* Converts a linear RGB color to an sRGB color.
|
|
*
|
|
* @param {vec3|vec4} linearIn The color in linear color space.
|
|
* @returns {vec3|vec4} The color in sRGB color space. The vector type matches the input.
|
|
*/
|
|
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 g2=`/**
|
|
* Computes the luminance of a color.
|
|
*
|
|
* @name czm_luminance
|
|
* @glslFunction
|
|
*
|
|
* @param {vec3} rgb The color.
|
|
*
|
|
* @returns {float} The luminance.
|
|
*
|
|
* @example
|
|
* float light = czm_luminance(vec3(0.0)); // 0.0
|
|
* float dark = czm_luminance(vec3(1.0)); // ~1.0
|
|
*/
|
|
float czm_luminance(vec3 rgb)
|
|
{
|
|
// Algorithm from Chapter 10 of Graphics Shaders.
|
|
const vec3 W = vec3(0.2125, 0.7154, 0.0721);
|
|
return dot(rgb, W);
|
|
}
|
|
`;var _2=`/**
|
|
* Find the maximum component of a vector.
|
|
*
|
|
* @name czm_maximumComponent
|
|
* @glslFunction
|
|
*
|
|
* @param {vec2|vec3|vec4} v The input vector.
|
|
* @returns {float} The value of the largest component.
|
|
*/
|
|
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 y2=`/**
|
|
* Computes the size of a pixel in meters at a distance from the eye.
|
|
* <p>
|
|
* Use this version when passing in a custom pixel ratio. For example, passing in 1.0 will return meters per native device pixel.
|
|
* </p>
|
|
* @name czm_metersPerPixel
|
|
* @glslFunction
|
|
*
|
|
* @param {vec3} positionEC The position to get the meters per pixel in eye coordinates.
|
|
* @param {float} pixelRatio The scaling factor from pixel space to coordinate space
|
|
*
|
|
* @returns {float} The meters per pixel at positionEC.
|
|
*/
|
|
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;
|
|
}
|
|
|
|
/**
|
|
* Computes the size of a pixel in meters at a distance from the eye.
|
|
* <p>
|
|
* Use this version when scaling by pixel ratio.
|
|
* </p>
|
|
* @name czm_metersPerPixel
|
|
* @glslFunction
|
|
*
|
|
* @param {vec3} positionEC The position to get the meters per pixel in eye coordinates.
|
|
*
|
|
* @returns {float} The meters per pixel at positionEC.
|
|
*/
|
|
float czm_metersPerPixel(vec4 positionEC)
|
|
{
|
|
return czm_metersPerPixel(positionEC, czm_pixelRatio);
|
|
}
|
|
`;var A2=`/**
|
|
* Transforms a position from model to window coordinates. The transformation
|
|
* from model to clip coordinates is done using {@link czm_modelViewProjection}.
|
|
* The transform from normalized device coordinates to window coordinates is
|
|
* done using {@link czm_viewportTransformation}, which assumes a depth range
|
|
* of <code>near = 0</code> and <code>far = 1</code>.
|
|
* <br /><br />
|
|
* This transform is useful when there is a need to manipulate window coordinates
|
|
* in a vertex shader as done by {@link BillboardCollection}.
|
|
* <br /><br />
|
|
* This function should not be confused with {@link czm_viewportOrthographic},
|
|
* which is an orthographic projection matrix that transforms from window
|
|
* coordinates to clip coordinates.
|
|
*
|
|
* @name czm_modelToWindowCoordinates
|
|
* @glslFunction
|
|
*
|
|
* @param {vec4} position The position in model coordinates to transform.
|
|
*
|
|
* @returns {vec4} The transformed position in window coordinates.
|
|
*
|
|
* @see czm_eyeToWindowCoordinates
|
|
* @see czm_modelViewProjection
|
|
* @see czm_viewportTransformation
|
|
* @see czm_viewportOrthographic
|
|
* @see BillboardCollection
|
|
*
|
|
* @example
|
|
* vec4 positionWC = czm_modelToWindowCoordinates(positionMC);
|
|
*/
|
|
vec4 czm_modelToWindowCoordinates(vec4 position)
|
|
{
|
|
vec4 positionEC = czm_modelView * position;
|
|
vec4 q = czm_projection * positionEC;
|
|
q.xyz /= q.w; // normalized device coordinates
|
|
q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz; // window coordinates
|
|
return q;
|
|
}
|
|
`;var b2=`/**
|
|
* DOC_TBA
|
|
*
|
|
* @name czm_multiplyWithColorBalance
|
|
* @glslFunction
|
|
*/
|
|
vec3 czm_multiplyWithColorBalance(vec3 left, vec3 right)
|
|
{
|
|
// Algorithm from Chapter 10 of Graphics Shaders.
|
|
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 x2=`/**
|
|
* Computes a value that scales with distance. The scaling is clamped at the near and
|
|
* far distances, and does not extrapolate. This function works with the
|
|
* {@link NearFarScalar} JavaScript class.
|
|
*
|
|
* @name czm_nearFarScalar
|
|
* @glslFunction
|
|
*
|
|
* @param {vec4} nearFarScalar A vector with 4 components: Near distance (x), Near value (y), Far distance (z), Far value (w).
|
|
* @param {float} cameraDistSq The square of the current distance from the camera.
|
|
*
|
|
* @returns {float} The value at this distance.
|
|
*/
|
|
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 T2=` /**
|
|
* Decodes a unit-length vector in 'oct' encoding to a normalized 3-component Cartesian vector.
|
|
* The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors",
|
|
* Cigolle et al 2014: http://jcgt.org/published/0003/02/01/
|
|
*
|
|
* @name czm_octDecode
|
|
* @param {vec2} encoded The oct-encoded, unit-length vector
|
|
* @param {float} range The maximum value of the SNORM range. The encoded vector is stored in log2(rangeMax+1) bits.
|
|
* @returns {vec3} The decoded and normalized vector
|
|
*/
|
|
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);
|
|
}
|
|
|
|
/**
|
|
* Decodes a unit-length vector in 'oct' encoding to a normalized 3-component Cartesian vector.
|
|
* The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors",
|
|
* Cigolle et al 2014: http://jcgt.org/published/0003/02/01/
|
|
*
|
|
* @name czm_octDecode
|
|
* @param {vec2} encoded The oct-encoded, unit-length vector
|
|
* @returns {vec3} The decoded and normalized vector
|
|
*/
|
|
vec3 czm_octDecode(vec2 encoded)
|
|
{
|
|
return czm_octDecode(encoded, 255.0);
|
|
}
|
|
|
|
/**
|
|
* Decodes a unit-length vector in 'oct' encoding packed into a floating-point number to a normalized 3-component Cartesian vector.
|
|
* The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors",
|
|
* Cigolle et al 2014: http://jcgt.org/published/0003/02/01/
|
|
*
|
|
* @name czm_octDecode
|
|
* @param {float} encoded The oct-encoded, unit-length vector
|
|
* @returns {vec3} The decoded and normalized vector
|
|
*/
|
|
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));
|
|
}
|
|
|
|
/**
|
|
* Decodes three unit-length vectors in 'oct' encoding packed into two floating-point numbers to normalized 3-component Cartesian vectors.
|
|
* The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors",
|
|
* Cigolle et al 2014: http://jcgt.org/published/0003/02/01/
|
|
*
|
|
* @name czm_octDecode
|
|
* @param {vec2} encoded The packed oct-encoded, unit-length vectors.
|
|
* @param {vec3} vector1 One decoded and normalized vector.
|
|
* @param {vec3} vector2 One decoded and normalized vector.
|
|
* @param {vec3} vector3 One decoded and normalized vector.
|
|
*/
|
|
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 C2=`/**
|
|
* Packs a depth value into a vec4 that can be represented by unsigned bytes.
|
|
*
|
|
* @name czm_packDepth
|
|
* @glslFunction
|
|
*
|
|
* @param {float} depth The floating-point depth.
|
|
* @returns {vec4} The packed depth.
|
|
*/
|
|
vec4 czm_packDepth(float depth)
|
|
{
|
|
// See Aras Pranckevi\u010Dius' post Encoding Floats to RGBA
|
|
// http://aras-p.info/blog/2009/07/30/encoding-floats-to-rgba-the-final/
|
|
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 v2=`vec3 lambertianDiffuse(vec3 diffuseColor)
|
|
{
|
|
return diffuseColor / czm_pi;
|
|
}
|
|
|
|
vec3 fresnelSchlick2(vec3 f0, vec3 f90, float VdotH)
|
|
{
|
|
float versine = 1.0 - VdotH;
|
|
// pow(versine, 5.0) is slow. See https://stackoverflow.com/a/68793086/10082269
|
|
float versineSquared = versine * versine;
|
|
return f0 + (f90 - f0) * versineSquared * versineSquared * versine;
|
|
}
|
|
|
|
#ifdef USE_ANISOTROPY
|
|
/**
|
|
* @param {float} bitangentRoughness Material roughness (along the anisotropy bitangent)
|
|
* @param {float} tangentialRoughness Anisotropic roughness (along the anisotropy tangent)
|
|
* @param {vec3} lightDirection The direction from the fragment to the light source, transformed to tangent-bitangent-normal coordinates
|
|
* @param {vec3} viewDirection The direction from the fragment to the camera, transformed to tangent-bitangent-normal coordinates
|
|
*/
|
|
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);
|
|
}
|
|
|
|
/**
|
|
* @param {float} bitangentRoughness Material roughness (along the anisotropy bitangent)
|
|
* @param {float} tangentialRoughness Anisotropic roughness (along the anisotropy tangent)
|
|
* @param {vec3} halfwayDirection The unit vector halfway between light and view directions, transformed to tangent-bitangent-normal coordinates
|
|
*/
|
|
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
|
|
|
|
/**
|
|
* Estimate the geometric self-shadowing of the microfacets in a surface,
|
|
* using the Smith Joint GGX visibility function.
|
|
* Note: Vis = G / (4 * NdotL * NdotV)
|
|
* see Eric Heitz. 2014. Understanding the Masking-Shadowing Function in Microfacet-Based BRDFs. Journal of Computer Graphics Techniques, 3
|
|
* see Real-Time Rendering. Page 331 to 336.
|
|
* see https://google.github.io/filament/Filament.md.html#materialsystem/specularbrdf/geometricshadowing(specularg)
|
|
*
|
|
* @param {float} alphaRoughness The roughness of the material, expressed as the square of perceptual roughness.
|
|
* @param {float} NdotL The cosine of the angle between the surface normal and the direction to the light source.
|
|
* @param {float} NdotV The cosine of the angle between the surface normal and the direction to the camera.
|
|
*/
|
|
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;
|
|
}
|
|
|
|
/**
|
|
* Estimate the fraction of the microfacets in a surface that are aligned with
|
|
* the halfway vector, which is aligned halfway between the directions from
|
|
* the fragment to the camera and from the fragment to the light source.
|
|
*
|
|
* @param {float} alphaRoughness The roughness of the material, expressed as the square of perceptual roughness.
|
|
* @param {float} NdotH The cosine of the angle between the surface normal and the halfway vector.
|
|
* @return {float} The fraction of microfacets aligned to the halfway vector.
|
|
*/
|
|
float GGX(float alphaRoughness, float NdotH)
|
|
{
|
|
float alphaRoughnessSquared = alphaRoughness * alphaRoughness;
|
|
float f = (NdotH * alphaRoughnessSquared - NdotH) * NdotH + 1.0;
|
|
return alphaRoughnessSquared / (czm_pi * f * f);
|
|
}
|
|
|
|
/**
|
|
* Compute the strength of the specular reflection due to direct lighting.
|
|
*
|
|
* @param {vec3} normal The surface normal.
|
|
* @param {vec3} lightDirection The unit vector pointing from the fragment to the light source.
|
|
* @param {vec3} viewDirection The unit vector pointing from the fragment to the camera.
|
|
* @param {vec3} halfwayDirection The unit vector pointing from the fragment to halfway between the light source and the camera.
|
|
* @param {float} alphaRoughness The roughness of the material, expressed as the square of perceptual roughness.
|
|
* @return {float} The strength of the specular reflection.
|
|
*/
|
|
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;
|
|
}
|
|
|
|
/**
|
|
* Compute the diffuse and specular contributions using physically based
|
|
* rendering. This function only handles direct lighting.
|
|
* <p>
|
|
* This function only handles the lighting calculations. Metallic/roughness
|
|
* and specular/glossy must be handled separately. See {@MaterialStageFS}
|
|
* </p>
|
|
*
|
|
* @name czm_pbrLighting
|
|
* @glslFunction
|
|
*
|
|
* @param {vec3} viewDirectionEC Unit vector pointing from the fragment to the eye position
|
|
* @param {vec3} normalEC The surface normal in eye coordinates
|
|
* @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates.
|
|
* @param {czm_modelMaterial} The material properties.
|
|
* @return {vec3} The computed HDR color
|
|
*/
|
|
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);
|
|
// Typical dielectrics will have reflectance 0.04, so f90 will be 1.0.
|
|
// In this case, at grazing angle, all incident energy is reflected.
|
|
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;
|
|
// F here represents the specular contribution
|
|
vec3 diffuseContribution = (1.0 - F) * lambertianDiffuse(diffuseColor);
|
|
|
|
// Lo = (diffuse + specular) * Li * NdotL
|
|
return (diffuseContribution + specularContribution) * NdotL;
|
|
}
|
|
`;var E2=`// KhronosGroup https://github.com/KhronosGroup/ToneMapping/tree/main/PBR_Neutral
|
|
|
|
// Input color is non-negative and resides in the Linear Rec. 709 color space.
|
|
// Output color is also Linear Rec. 709, but in the [0, 1] range.
|
|
|
|
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 S2=`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);
|
|
}
|
|
|
|
/**
|
|
* Computes a color using the Phong lighting model.
|
|
*
|
|
* @name czm_phong
|
|
* @glslFunction
|
|
*
|
|
* @param {vec3} toEye A normalized vector from the fragment to the eye in eye coordinates.
|
|
* @param {czm_material} material The fragment's material.
|
|
*
|
|
* @returns {vec4} The computed color.
|
|
*
|
|
* @example
|
|
* vec3 positionToEyeEC = // ...
|
|
* czm_material material = // ...
|
|
* vec3 lightDirectionEC = // ...
|
|
* out_FragColor = czm_phong(normalize(positionToEyeEC), material, lightDirectionEC);
|
|
*
|
|
* @see czm_getMaterial
|
|
*/
|
|
vec4 czm_phong(vec3 toEye, czm_material material, vec3 lightDirectionEC)
|
|
{
|
|
// Diffuse from directional light sources at eye (for top-down)
|
|
float diffuse = czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 0.0, 1.0), material);
|
|
if (czm_sceneMode == czm_sceneMode3D) {
|
|
// (and horizon views in 3D)
|
|
diffuse += czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 1.0, 0.0), material);
|
|
}
|
|
|
|
float specular = czm_private_getSpecularOfMaterial(lightDirectionEC, toEye, material);
|
|
|
|
// Temporary workaround for adding ambient.
|
|
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 w2=`/**
|
|
* Computes distance from a point to a plane.
|
|
*
|
|
* @name czm_planeDistance
|
|
* @glslFunction
|
|
*
|
|
* param {vec4} plane A Plane in Hessian Normal Form. See Plane.js
|
|
* param {vec3} point A point in the same space as the plane.
|
|
* returns {float} The distance from the point to the plane.
|
|
*/
|
|
float czm_planeDistance(vec4 plane, vec3 point) {
|
|
return (dot(plane.xyz, point) + plane.w);
|
|
}
|
|
|
|
/**
|
|
* Computes distance from a point to a plane.
|
|
*
|
|
* @name czm_planeDistance
|
|
* @glslFunction
|
|
*
|
|
* param {vec3} planeNormal Normal for a plane in Hessian Normal Form. See Plane.js
|
|
* param {float} planeDistance Distance for a plane in Hessian Normal form. See Plane.js
|
|
* param {vec3} point A point in the same space as the plane.
|
|
* returns {float} The distance from the point to the plane.
|
|
*/
|
|
float czm_planeDistance(vec3 planeNormal, float planeDistance, vec3 point) {
|
|
return (dot(planeNormal, point) + planeDistance);
|
|
}
|
|
`;var I2=`/**
|
|
* Computes the point along a ray at the given time. <code>time</code> can be positive, negative, or zero.
|
|
*
|
|
* @name czm_pointAlongRay
|
|
* @glslFunction
|
|
*
|
|
* @param {czm_ray} ray The ray to compute the point along.
|
|
* @param {float} time The time along the ray.
|
|
*
|
|
* @returns {vec3} The point along the ray at the given time.
|
|
*
|
|
* @example
|
|
* czm_ray ray = czm_ray(vec3(0.0), vec3(1.0, 0.0, 0.0)); // origin, direction
|
|
* vec3 v = czm_pointAlongRay(ray, 2.0); // (2.0, 0.0, 0.0)
|
|
*/
|
|
vec3 czm_pointAlongRay(czm_ray ray, float time)
|
|
{
|
|
return ray.origin + (time * ray.direction);
|
|
}
|
|
`;var P2=`/**
|
|
* DOC_TBA
|
|
*
|
|
* @name czm_rayEllipsoidIntersectionInterval
|
|
* @glslFunction
|
|
*/
|
|
czm_raySegment czm_rayEllipsoidIntersectionInterval(czm_ray ray, vec3 ellipsoid_center, vec3 ellipsoid_inverseRadii)
|
|
{
|
|
// ray and ellipsoid center in eye coordinates. radii in model coordinates.
|
|
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) // Outside ellipsoid.
|
|
{
|
|
if (qw >= 0.0) // Looking outward or tangent (0 intersections).
|
|
{
|
|
return czm_emptyRaySegment;
|
|
}
|
|
else // qw < 0.0.
|
|
{
|
|
float qw2 = qw * qw;
|
|
float difference = q2 - 1.0; // Positively valued.
|
|
float w2 = dot(w, w);
|
|
float product = w2 * difference;
|
|
|
|
if (qw2 < product) // Imaginary roots (0 intersections).
|
|
{
|
|
return czm_emptyRaySegment;
|
|
}
|
|
else if (qw2 > product) // Distinct roots (2 intersections).
|
|
{
|
|
float discriminant = qw * qw - product;
|
|
float temp = -qw + sqrt(discriminant); // Avoid cancellation.
|
|
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 // qw2 == product. Repeated roots (2 intersections).
|
|
{
|
|
float root = sqrt(difference / w2);
|
|
czm_raySegment i = czm_raySegment(root, root);
|
|
return i;
|
|
}
|
|
}
|
|
}
|
|
else if (q2 < 1.0) // Inside ellipsoid (2 intersections).
|
|
{
|
|
float difference = q2 - 1.0; // Negatively valued.
|
|
float w2 = dot(w, w);
|
|
float product = w2 * difference; // Negatively valued.
|
|
float discriminant = qw * qw - product;
|
|
float temp = -qw + sqrt(discriminant); // Positively valued.
|
|
czm_raySegment i = czm_raySegment(0.0, temp / w2);
|
|
return i;
|
|
}
|
|
else // q2 == 1.0. On ellipsoid.
|
|
{
|
|
if (qw < 0.0) // Looking inward.
|
|
{
|
|
float w2 = dot(w, w);
|
|
czm_raySegment i = czm_raySegment(0.0, -qw / w2);
|
|
return i;
|
|
}
|
|
else // qw >= 0.0. Looking outward or tangent.
|
|
{
|
|
return czm_emptyRaySegment;
|
|
}
|
|
}
|
|
}
|
|
`;var D2=`/**
|
|
* Compute the intersection interval of a ray with a sphere.
|
|
*
|
|
* @name czm_raySphereIntersectionInterval
|
|
* @glslFunction
|
|
*
|
|
* @param {czm_ray} ray The ray.
|
|
* @param {vec3} center The center of the sphere.
|
|
* @param {float} radius The radius of the sphere.
|
|
* @return {czm_raySegment} The intersection interval of the ray with the sphere.
|
|
*/
|
|
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 R2=`float czm_readDepth(sampler2D depthTexture, vec2 texCoords)
|
|
{
|
|
return czm_reverseLogDepth(texture(depthTexture, texCoords).r);
|
|
}
|
|
`;var O2=`/**
|
|
* Reads a value previously transformed with {@link czm_writeNonPerspective}
|
|
* by dividing it by \`w\`, the value used in the perspective divide.
|
|
* This function is intended to be called in a fragment shader to access a
|
|
* \`varying\` that should not be subject to perspective interpolation.
|
|
* For example, screen-space texture coordinates. The value should have been
|
|
* previously written in the vertex shader with a call to
|
|
* {@link czm_writeNonPerspective}.
|
|
*
|
|
* @name czm_readNonPerspective
|
|
* @glslFunction
|
|
*
|
|
* @param {float|vec2|vec3|vec4} value The non-perspective value to be read.
|
|
* @param {float} oneOverW One over the perspective divide value, \`w\`. Usually this is simply \`gl_FragCoord.w\`.
|
|
* @returns {float|vec2|vec3|vec4} The usable value.
|
|
*/
|
|
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 M2=`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 L2=`/**
|
|
* Round a floating point value. This function exists because round() doesn't
|
|
* exist in GLSL 1.00.
|
|
*
|
|
* @param {float|vec2|vec3|vec4} value The value to round
|
|
* @param {float|vec2|vec3|vec3} The rounded value. The type matches the input.
|
|
*/
|
|
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 N2=`/**
|
|
* Adjusts the saturation of a color.
|
|
*
|
|
* @name czm_saturation
|
|
* @glslFunction
|
|
*
|
|
* @param {vec3} rgb The color.
|
|
* @param {float} adjustment The amount to adjust the saturation of the color.
|
|
*
|
|
* @returns {float} The color with the saturation adjusted.
|
|
*
|
|
* @example
|
|
* vec3 greyScale = czm_saturation(color, 0.0);
|
|
* vec3 doubleSaturation = czm_saturation(color, 2.0);
|
|
*/
|
|
vec3 czm_saturation(vec3 rgb, float adjustment)
|
|
{
|
|
// Algorithm from Chapter 16 of OpenGL Shading Language
|
|
const vec3 W = vec3(0.2125, 0.7154, 0.0721);
|
|
vec3 intensity = vec3(dot(rgb, W));
|
|
return mix(intensity, rgb, adjustment);
|
|
}
|
|
`;var F2=`
|
|
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 B2=`
|
|
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 k2=`/**
|
|
* Returns 1.0 if the given value is positive or zero, and -1.0 if it is negative. This is similar to the GLSL
|
|
* built-in function <code>sign</code> except that returns 1.0 instead of 0.0 when the input value is 0.0.
|
|
*
|
|
* @name czm_signNotZero
|
|
* @glslFunction
|
|
*
|
|
* @param {} value The value for which to determine the sign.
|
|
* @returns {} 1.0 if the value is positive or zero, -1.0 if the value is negative.
|
|
*/
|
|
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 z2=`/**
|
|
* Computes a color from the third order spherical harmonic coefficients and a normalized direction vector.
|
|
* <p>
|
|
* The order of the coefficients is [L00, L1_1, L10, L11, L2_2, L2_1, L20, L21, L22].
|
|
* </p>
|
|
*
|
|
* @name czm_sphericalHarmonics
|
|
* @glslFunction
|
|
*
|
|
* @param {vec3} normal The normalized direction.
|
|
* @param {vec3[9]} coefficients The third order spherical harmonic coefficients.
|
|
* @returns {vec3} The color at the direction.
|
|
*
|
|
* @see https://graphics.stanford.edu/papers/envmap/envmap.pdf
|
|
*/
|
|
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 U2=`/**
|
|
* Converts an sRGB color to a linear RGB color.
|
|
*
|
|
* @param {vec3|vec4} srgbIn The color in sRGB space
|
|
* @returns {vec3|vec4} The color in linear color space. The vector type matches the input.
|
|
*/
|
|
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 V2=`/**
|
|
* Creates a matrix that transforms vectors from tangent space to eye space.
|
|
*
|
|
* @name czm_tangentToEyeSpaceMatrix
|
|
* @glslFunction
|
|
*
|
|
* @param {vec3} normalEC The normal vector in eye coordinates.
|
|
* @param {vec3} tangentEC The tangent vector in eye coordinates.
|
|
* @param {vec3} bitangentEC The bitangent vector in eye coordinates.
|
|
*
|
|
* @returns {mat3} The matrix that transforms from tangent space to eye space.
|
|
*
|
|
* @example
|
|
* mat3 tangentToEye = czm_tangentToEyeSpaceMatrix(normalEC, tangentEC, bitangentEC);
|
|
* vec3 normal = tangentToEye * texture(normalMap, st).xyz;
|
|
*/
|
|
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 j2=`/**
|
|
* A wrapper around the texture (WebGL2) / textureCube (WebGL1)
|
|
* function to allow for WebGL 1 support.
|
|
*
|
|
* @name czm_textureCube
|
|
* @glslFunction
|
|
*
|
|
* @param {samplerCube} sampler The sampler.
|
|
* @param {vec3} p The coordinate at which to sample the texture.
|
|
*/
|
|
vec4 czm_textureCube(samplerCube sampler, vec3 p) {
|
|
#if __VERSION__ == 300
|
|
return texture(sampler, p);
|
|
#else
|
|
return textureCube(sampler, p);
|
|
#endif
|
|
}
|
|
|
|
/**
|
|
* A wrapper around the textureLod (WebGL2) / textureCube (WebGL1)
|
|
* function to allow for WebGL 1 support in fragment shaders.
|
|
*
|
|
* @name czm_textureCubeLod
|
|
* @glslFunction
|
|
*
|
|
* @param {samplerCube} sampler The sampler.
|
|
* @param {vec3} p The coordinate at which to sample the texture.
|
|
* @param {float} lod The mipmap level from which to sample.
|
|
*/
|
|
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 H2=`/**
|
|
* Transforms a plane.
|
|
*
|
|
* @name czm_transformPlane
|
|
* @glslFunction
|
|
*
|
|
* @param {vec4} plane The plane in Hessian Normal Form.
|
|
* @param {mat4} transform The inverse-transpose of a transformation matrix.
|
|
*/
|
|
vec4 czm_transformPlane(vec4 plane, mat4 transform) {
|
|
vec4 transformedPlane = transform * plane;
|
|
// Convert the transformed plane to Hessian Normal Form
|
|
float normalMagnitude = length(transformedPlane.xyz);
|
|
return transformedPlane / normalMagnitude;
|
|
}
|
|
`;var G2=`/**
|
|
* Translates a position (or any <code>vec3</code>) that was encoded with {@link EncodedCartesian3},
|
|
* and then provided to the shader as separate <code>high</code> and <code>low</code> bits to
|
|
* be relative to the eye. As shown in the example, the position can then be transformed in eye
|
|
* or clip coordinates using {@link czm_modelViewRelativeToEye} or {@link czm_modelViewProjectionRelativeToEye},
|
|
* respectively.
|
|
* <p>
|
|
* This technique, called GPU RTE, eliminates jittering artifacts when using large coordinates as
|
|
* described in {@link http://help.agi.com/AGIComponents/html/BlogPrecisionsPrecisions.htm|Precisions, Precisions}.
|
|
* </p>
|
|
*
|
|
* @name czm_translateRelativeToEye
|
|
* @glslFunction
|
|
*
|
|
* @param {vec3} high The position's high bits.
|
|
* @param {vec3} low The position's low bits.
|
|
* @returns {vec3} The position translated to be relative to the camera's position.
|
|
*
|
|
* @example
|
|
* in vec3 positionHigh;
|
|
* in vec3 positionLow;
|
|
*
|
|
* void main()
|
|
* {
|
|
* vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);
|
|
* gl_Position = czm_modelViewProjectionRelativeToEye * p;
|
|
* }
|
|
*
|
|
* @see czm_modelViewRelativeToEye
|
|
* @see czm_modelViewProjectionRelativeToEye
|
|
* @see czm_computePosition
|
|
* @see EncodedCartesian3
|
|
*/
|
|
vec4 czm_translateRelativeToEye(vec3 high, vec3 low)
|
|
{
|
|
vec3 highDifference = high - czm_encodedCameraPositionMCHigh;
|
|
// This check handles the case when NaN values have gotten into \`highDifference\`.
|
|
// Such a thing could happen on devices running iOS.
|
|
if (length(highDifference) == 0.0) {
|
|
highDifference = vec3(0);
|
|
}
|
|
vec3 lowDifference = low - czm_encodedCameraPositionMCLow;
|
|
|
|
return vec4(highDifference + lowDifference, 1.0);
|
|
}
|
|
`;var W2=`/**
|
|
* @private
|
|
*/
|
|
vec4 czm_translucentPhong(vec3 toEye, czm_material material, vec3 lightDirectionEC)
|
|
{
|
|
// Diffuse from directional light sources at eye (for top-down and horizon views)
|
|
float diffuse = czm_getLambertDiffuse(vec3(0.0, 0.0, 1.0), material.normal);
|
|
|
|
if (czm_sceneMode == czm_sceneMode3D) {
|
|
// (and horizon views in 3D)
|
|
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);
|
|
|
|
// Temporary workaround for adding ambient.
|
|
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 q2=`/**
|
|
* Returns the transpose of the matrix. The input <code>matrix</code> can be
|
|
* a <code>mat2</code>, <code>mat3</code>, or <code>mat4</code>.
|
|
*
|
|
* @name czm_transpose
|
|
* @glslFunction
|
|
*
|
|
* @param {} matrix The matrix to transpose.
|
|
*
|
|
* @returns {} The transposed matrix.
|
|
*
|
|
* @example
|
|
* // GLSL declarations
|
|
* mat2 czm_transpose(mat2 matrix);
|
|
* mat3 czm_transpose(mat3 matrix);
|
|
* mat4 czm_transpose(mat4 matrix);
|
|
*
|
|
* // Transpose a 3x3 rotation matrix to find its inverse.
|
|
* mat3 eastNorthUpToEye = czm_eastNorthUpToEyeCoordinates(
|
|
* positionMC, normalEC);
|
|
* mat3 eyeToEastNorthUp = czm_transpose(eastNorthUpToEye);
|
|
*/
|
|
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 Y2=`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; // sample from center of pixel
|
|
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 X2=`/**
|
|
* Unpacks a vec4 depth value to a float in [0, 1) range.
|
|
*
|
|
* @name czm_unpackDepth
|
|
* @glslFunction
|
|
*
|
|
* @param {vec4} packedDepth The packed depth.
|
|
*
|
|
* @returns {float} The floating-point depth in [0, 1) range.
|
|
*/
|
|
float czm_unpackDepth(vec4 packedDepth)
|
|
{
|
|
// See Aras Pranckevi\u010Dius' post Encoding Floats to RGBA
|
|
// http://aras-p.info/blog/2009/07/30/encoding-floats-to-rgba-the-final/
|
|
return dot(packedDepth, vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0));
|
|
}
|
|
`;var K2=`/**
|
|
* Unpack an IEEE 754 single-precision float that is packed as a little-endian unsigned normalized vec4.
|
|
*
|
|
* @name czm_unpackFloat
|
|
* @glslFunction
|
|
*
|
|
* @param {vec4} packedFloat The packed float.
|
|
*
|
|
* @returns {float} The floating-point depth in arbitrary range.
|
|
*/
|
|
float czm_unpackFloat(vec4 packedFloat)
|
|
{
|
|
// Convert to [0.0, 255.0] and round to integer
|
|
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 $2=`/**
|
|
* Useful for reinterpreting texture data as higher-precision values.
|
|
* Only works correctly in WebGL 2, which supports the uint type and bitwise operations.
|
|
*
|
|
* @param {float|vec2|vec3|vec4} 1-4 values from a texture lookup (RGBA channels), normalized to [0.0, 1.0].
|
|
* @return {uint} Raw bits as an unsigned integer.
|
|
*/
|
|
uint czm_unpackTexture(float packedValue) {
|
|
float rounded = czm_round(packedValue * 255.0);
|
|
return uint(rounded);
|
|
}
|
|
|
|
uint czm_unpackTexture(vec2 packedValue) {
|
|
vec2 rounded = czm_round(packedValue * 255.0);
|
|
uint byte0 = uint(rounded.x);
|
|
uint byte1 = uint(rounded.y);
|
|
return byte0 | (byte1 << 8);
|
|
}
|
|
|
|
uint czm_unpackTexture(vec3 packedValue) {
|
|
vec3 rounded = czm_round(packedValue * 255.0);
|
|
uint byte0 = uint(rounded.x);
|
|
uint byte1 = uint(rounded.y);
|
|
uint byte2 = uint(rounded.z);
|
|
return byte0 | (byte1 << 8) | (byte2 << 16);
|
|
}
|
|
|
|
uint czm_unpackTexture(vec4 packedValue) {
|
|
vec4 rounded = czm_round(packedValue * 255.0);
|
|
uint byte0 = uint(rounded.x);
|
|
uint byte1 = uint(rounded.y);
|
|
uint byte2 = uint(rounded.z);
|
|
uint byte3 = uint(rounded.w);
|
|
return byte0 | (byte1 << 8) | (byte2 << 16) | (byte3 << 24);
|
|
}
|
|
`;var J2=`/**
|
|
* Unpack unsigned integers of 1-4 bytes. in WebGL 1, there is no uint type,
|
|
* so the return value is an int.
|
|
* <p>
|
|
* There are also precision limitations in WebGL 1. highp int is still limited
|
|
* to 24 bits. Above the value of 2^24 = 16777216, precision loss may occur.
|
|
* </p>
|
|
*
|
|
* @param {float|vec2|vec3|vec4} packed The packed value. For vectors, the components are listed in little-endian order.
|
|
*
|
|
* @return {int} The unpacked value.
|
|
*/
|
|
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 Z2=`/**
|
|
* Transform metadata values following the EXT_structural_metadata spec
|
|
* by multiplying by scale and adding the offset. Operations are always
|
|
* performed component-wise, even for matrices.
|
|
*
|
|
* @param {float|vec2|vec3|vec4|mat2|mat3|mat4} offset The offset to add
|
|
* @param {float|vec2|vec3|vec4|mat2|mat3|mat4} scale The scale factor to multiply
|
|
* @param {float|vec2|vec3|vec4|mat2|mat3|mat4} value The original value.
|
|
*
|
|
* @return {float|vec2|vec3|vec4|mat2|mat3|mat4} The transformed value of the same scalar/vector/matrix type as the input.
|
|
*/
|
|
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 Q2=`#ifdef LOG_DEPTH
|
|
// 1.0 at the near plane, increasing linearly from there.
|
|
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
|
|
|
|
// With the very high far/near ratios used with the logarithmic depth
|
|
// buffer, floating point rounding errors can cause linear depth values
|
|
// to end up on the wrong side of the far plane, even for vertices that
|
|
// are really nowhere near it. Since we always write a correct logarithmic
|
|
// depth value in the fragment shader anyway, we just need to make sure
|
|
// such errors don't cause the primitive to be clipped entirely before
|
|
// we even get to the fragment shader.
|
|
coords.z = clamp(coords.z / coords.w, -1.0, 1.0) * coords.w;
|
|
#endif
|
|
|
|
return coords;
|
|
}
|
|
|
|
/**
|
|
* Writes the logarithmic depth to gl_Position using the already computed gl_Position.
|
|
*
|
|
* @name czm_vertexLogDepth
|
|
* @glslFunction
|
|
*/
|
|
void czm_vertexLogDepth()
|
|
{
|
|
#ifdef LOG_DEPTH
|
|
v_depthFromNearPlusOne = (gl_Position.w - czm_currentFrustum.x) + 1.0;
|
|
gl_Position = czm_updatePositionDepth(gl_Position);
|
|
#endif
|
|
}
|
|
|
|
/**
|
|
* Writes the logarithmic depth to gl_Position using the provided clip coordinates.
|
|
* <p>
|
|
* An example use case for this function would be moving the vertex in window coordinates
|
|
* before converting back to clip coordinates. Use the original vertex clip coordinates.
|
|
* </p>
|
|
* @name czm_vertexLogDepth
|
|
* @glslFunction
|
|
*
|
|
* @param {vec4} clipCoords The vertex in clip coordinates.
|
|
*
|
|
* @example
|
|
* czm_vertexLogDepth(czm_projection * vec4(positionEyeCoordinates, 1.0));
|
|
*/
|
|
void czm_vertexLogDepth(vec4 clipCoords)
|
|
{
|
|
#ifdef LOG_DEPTH
|
|
v_depthFromNearPlusOne = (clipCoords.w - czm_currentFrustum.x) + 1.0;
|
|
czm_updatePositionDepth(clipCoords);
|
|
#endif
|
|
}
|
|
`;var ek=`vec4 czm_screenToEyeCoordinates(vec4 screenCoordinate)
|
|
{
|
|
// Reconstruct NDC coordinates
|
|
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);
|
|
|
|
// Reverse the perspective division to obtain clip coordinates.
|
|
q /= screenCoordinate.w;
|
|
|
|
// Reverse the projection transformation to obtain eye coordinates.
|
|
if (!(czm_inverseProjection == mat4(0.0))) // IE and Edge sometimes do something weird with != between mat4s
|
|
{
|
|
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;
|
|
}
|
|
|
|
/**
|
|
* Transforms a position from window to eye coordinates.
|
|
* The transform from window to normalized device coordinates is done using components
|
|
* of (@link czm_viewport} and {@link czm_viewportTransformation} instead of calculating
|
|
* the inverse of <code>czm_viewportTransformation</code>. The transformation from
|
|
* normalized device coordinates to clip coordinates is done using <code>fragmentCoordinate.w</code>,
|
|
* which is expected to be the scalar used in the perspective divide. The transformation
|
|
* from clip to eye coordinates is done using {@link czm_inverseProjection}.
|
|
*
|
|
* @name czm_windowToEyeCoordinates
|
|
* @glslFunction
|
|
*
|
|
* @param {vec4} fragmentCoordinate The position in window coordinates to transform.
|
|
*
|
|
* @returns {vec4} The transformed position in eye coordinates.
|
|
*
|
|
* @see czm_modelToWindowCoordinates
|
|
* @see czm_eyeToWindowCoordinates
|
|
* @see czm_inverseProjection
|
|
* @see czm_viewport
|
|
* @see czm_viewportTransformation
|
|
*
|
|
* @example
|
|
* vec4 positionEC = czm_windowToEyeCoordinates(gl_FragCoord);
|
|
*/
|
|
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)
|
|
{
|
|
// See reverseLogDepth.glsl. This is separate to re-use the pow.
|
|
#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; // Better precision
|
|
#else
|
|
vec4 screenCoord = vec4(screenCoordinateXY, depthOrLogDepth, 1.0);
|
|
vec4 eyeCoordinate = czm_screenToEyeCoordinates(screenCoord);
|
|
#endif
|
|
return eyeCoordinate;
|
|
}
|
|
|
|
/**
|
|
* Transforms a position given as window x/y and a depth or a log depth from window to eye coordinates.
|
|
* This function produces more accurate results for window positions with log depth than
|
|
* conventionally unpacking the log depth using czm_reverseLogDepth and using the standard version
|
|
* of czm_windowToEyeCoordinates.
|
|
*
|
|
* @name czm_windowToEyeCoordinates
|
|
* @glslFunction
|
|
*
|
|
* @param {vec2} fragmentCoordinateXY The XY position in window coordinates to transform.
|
|
* @param {float} depthOrLogDepth A depth or log depth for the fragment.
|
|
*
|
|
* @see czm_modelToWindowCoordinates
|
|
* @see czm_eyeToWindowCoordinates
|
|
* @see czm_inverseProjection
|
|
* @see czm_viewport
|
|
* @see czm_viewportTransformation
|
|
*
|
|
* @returns {vec4} The transformed position in eye coordinates.
|
|
*/
|
|
vec4 czm_windowToEyeCoordinates(vec2 fragmentCoordinateXY, float depthOrLogDepth)
|
|
{
|
|
vec2 screenCoordXY = (fragmentCoordinateXY.xy - czm_viewport.xy) / czm_viewport.zw;
|
|
return czm_screenToEyeCoordinates(screenCoordXY, depthOrLogDepth);
|
|
}
|
|
`;var tk=`// emulated noperspective
|
|
#if !defined(LOG_DEPTH)
|
|
in float v_WindowZ;
|
|
#endif
|
|
|
|
/**
|
|
* Emulates GL_DEPTH_CLAMP. Clamps a fragment to the near and far plane
|
|
* by writing the fragment's depth. See czm_depthClamp for more details.
|
|
*
|
|
* @name czm_writeDepthClamp
|
|
* @glslFunction
|
|
*
|
|
* @example
|
|
* out_FragColor = color;
|
|
* czm_writeDepthClamp();
|
|
*
|
|
* @see czm_depthClamp
|
|
*/
|
|
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 nk=`#ifdef LOG_DEPTH
|
|
in float v_depthFromNearPlusOne;
|
|
|
|
#ifdef POLYGON_OFFSET
|
|
uniform vec2 u_polygonOffset;
|
|
#endif
|
|
|
|
#endif
|
|
|
|
/**
|
|
* Writes the fragment depth to the logarithmic depth buffer.
|
|
* <p>
|
|
* Use this when the vertex shader does not call {@link czm_vertexLogDepth}, for example, when
|
|
* ray-casting geometry using a full screen quad.
|
|
* </p>
|
|
* @name czm_writeLogDepth
|
|
* @glslFunction
|
|
*
|
|
* @param {float} depth The depth coordinate, where 1.0 is on the near plane and
|
|
* depth increases in eye-space units from there
|
|
*
|
|
* @example
|
|
* czm_writeLogDepth((czm_projection * v_positionEyeCoordinates).w + 1.0);
|
|
*/
|
|
void czm_writeLogDepth(float depth)
|
|
{
|
|
#if (defined(LOG_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth)))
|
|
// Discard the vertex if it's not between the near and far planes.
|
|
// We allow a bit of epsilon on the near plane comparison because a 1.0
|
|
// from the vertex shader (indicating the vertex should be _on_ the near
|
|
// plane) will not necessarily come here as exactly 1.0.
|
|
if (depth <= 0.9999999 || depth > czm_farDepthFromNearPlusOne) {
|
|
discard;
|
|
}
|
|
|
|
#ifdef POLYGON_OFFSET
|
|
// Polygon offset: m * factor + r * units
|
|
float factor = u_polygonOffset[0];
|
|
float units = u_polygonOffset[1];
|
|
|
|
#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))
|
|
// This factor doesn't work in IE 10
|
|
if (factor != 0.0) {
|
|
// m = sqrt(dZdX^2 + dZdY^2);
|
|
float x = dFdx(depth);
|
|
float y = dFdy(depth);
|
|
float m = sqrt(x * x + y * y);
|
|
|
|
// Apply the factor before computing the log depth.
|
|
depth += m * factor;
|
|
}
|
|
#endif
|
|
|
|
#endif
|
|
|
|
gl_FragDepth = log2(depth) * czm_oneOverLog2FarDepthFromNearPlusOne;
|
|
|
|
#ifdef POLYGON_OFFSET
|
|
// Apply the units after the log depth.
|
|
gl_FragDepth += czm_epsilon7 * units;
|
|
#endif
|
|
|
|
#endif
|
|
}
|
|
|
|
/**
|
|
* Writes the fragment depth to the logarithmic depth buffer.
|
|
* <p>
|
|
* Use this when the vertex shader calls {@link czm_vertexLogDepth}.
|
|
* </p>
|
|
*
|
|
* @name czm_writeLogDepth
|
|
* @glslFunction
|
|
*/
|
|
void czm_writeLogDepth() {
|
|
#ifdef LOG_DEPTH
|
|
czm_writeLogDepth(v_depthFromNearPlusOne);
|
|
#endif
|
|
}
|
|
`;var ik=`/**
|
|
* Transforms a value for non-perspective interpolation by multiplying
|
|
* it by w, the value used in the perspective divide. This function is
|
|
* intended to be called in a vertex shader to compute the value of a
|
|
* \`varying\` that should not be subject to perspective interpolation.
|
|
* For example, screen-space texture coordinates. The fragment shader
|
|
* must call {@link czm_readNonPerspective} to retrieve the final
|
|
* non-perspective value.
|
|
*
|
|
* @name czm_writeNonPerspective
|
|
* @glslFunction
|
|
*
|
|
* @param {float|vec2|vec3|vec4} value The value to be interpolated without accounting for perspective.
|
|
* @param {float} w The perspective divide value. Usually this is the computed \`gl_Position.w\`.
|
|
* @returns {float|vec2|vec3|vec4} The transformed value, intended to be stored in a \`varying\` and read in the
|
|
* fragment shader with {@link czm_readNonPerspective}.
|
|
*/
|
|
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 pv={czm_degreesPerRadian:CF,czm_depthRange:vF,czm_epsilon1:EF,czm_epsilon2:SF,czm_epsilon3:wF,czm_epsilon4:IF,czm_epsilon5:PF,czm_epsilon6:DF,czm_epsilon7:RF,czm_infinity:OF,czm_oneOverPi:MF,czm_oneOverTwoPi:LF,czm_passCesium3DTile:NF,czm_passCesium3DTileClassification:FF,czm_passCesium3DTileClassificationIgnoreShow:BF,czm_passCesium3DTileEdges:kF,czm_passCesium3DTileEdgesDirect:zF,czm_passCesium3DTilePlanarFillId:UF,czm_passClassification:VF,czm_passCompute:jF,czm_passEnvironment:HF,czm_passGaussianSplats:GF,czm_passGlobe:WF,czm_passOpaque:qF,czm_passOverlay:YF,czm_passTerrainClassification:XF,czm_passTranslucent:KF,czm_passVoxels:$F,czm_pi:JF,czm_piOverFour:ZF,czm_piOverSix:QF,czm_piOverThree:eB,czm_piOverTwo:tB,czm_radiansPerDegree:nB,czm_sceneMode2D:iB,czm_sceneMode3D:rB,czm_sceneModeColumbusView:oB,czm_sceneModeMorphing:aB,czm_solarRadius:sB,czm_threePiOver2:cB,czm_twoPi:lB,czm_webMercatorMaxLatitude:uB,czm_depthRangeStruct:fB,czm_material:dB,czm_materialInput:hB,czm_modelMaterial:mB,czm_modelVertexOutput:pB,czm_ray:gB,czm_raySegment:_B,czm_shadowParameters:yB,czm_HSBToRGB:AB,czm_HSLToRGB:bB,czm_RGBToHSB:xB,czm_RGBToHSL:TB,czm_RGBToXYZ:CB,czm_XYZToRGB:vB,czm_acesTonemapping:EB,czm_alphaWeight:SB,czm_antialias:wB,czm_applyHSBShift:IB,czm_approximateSphericalCoordinates:PB,czm_approximateTanh:DB,czm_backFacing:RB,czm_branchFreeTernary:OB,czm_cascadeColor:MB,czm_cascadeDistance:LB,czm_cascadeMatrix:NB,czm_cascadeWeights:FB,czm_clipPolygons:BB,czm_columbusViewMorph:kB,czm_computeAtmosphereColor:zB,czm_computeGroundAtmosphereScattering:UB,czm_computePosition:VB,czm_computeScattering:jB,czm_computeTextureTransform:HB,czm_cosineAndSine:GB,czm_decodeRGB8:WB,czm_decompressTextureCoordinates:qB,czm_depthClamp:YB,czm_eastNorthUpToEyeCoordinates:XB,czm_ellipsoidContainsPoint:KB,czm_ellipsoidTextureCoordinates:$B,czm_equalsEpsilon:JB,czm_eyeOffset:ZB,czm_eyeToWindowCoordinates:QB,czm_fastApproximateAtan:e2,czm_fog:t2,czm_gammaCorrect:n2,czm_geodeticSurfaceNormal:i2,czm_getDefaultMaterial:r2,czm_getDynamicAtmosphereLightDirection:o2,czm_getLambertDiffuse:a2,czm_getSpecular:s2,czm_getWaterNoise:c2,czm_hue:l2,czm_inverseGamma:u2,czm_isEmpty:f2,czm_isFull:d2,czm_latitudeToWebMercatorFraction:h2,czm_lineDistance:m2,czm_linearToSrgb:p2,czm_luminance:g2,czm_maximumComponent:_2,czm_metersPerPixel:y2,czm_modelToWindowCoordinates:A2,czm_multiplyWithColorBalance:b2,czm_nearFarScalar:x2,czm_octDecode:T2,czm_packDepth:C2,czm_pbrLighting:v2,czm_pbrNeutralTonemapping:E2,czm_phong:S2,czm_planeDistance:w2,czm_pointAlongRay:I2,czm_rayEllipsoidIntersectionInterval:P2,czm_raySphereIntersectionInterval:D2,czm_readDepth:R2,czm_readNonPerspective:O2,czm_reverseLogDepth:M2,czm_round:L2,czm_saturation:N2,czm_shadowDepthCompare:F2,czm_shadowVisibility:B2,czm_signNotZero:k2,czm_sphericalHarmonics:z2,czm_srgbToLinear:U2,czm_tangentToEyeSpaceMatrix:V2,czm_textureCube:j2,czm_transformPlane:H2,czm_translateRelativeToEye:G2,czm_translucentPhong:W2,czm_transpose:q2,czm_unpackClippingExtents:Y2,czm_unpackDepth:X2,czm_unpackFloat:K2,czm_unpackTexture:$2,czm_unpackUint:J2,czm_valueTransform:Z2,czm_vertexLogDepth:Q2,czm_windowToEyeCoordinates:ek,czm_writeDepthClamp:tk,czm_writeLogDepth:nk,czm_writeNonPerspective:ik};var Qqe=new h;function Lt(e){this._size=e.size,this._datatype=e.datatype,this.getValue=e.getValue}var $s={};$s[ee.FLOAT]="float";$s[ee.FLOAT_VEC2]="vec2";$s[ee.FLOAT_VEC3]="vec3";$s[ee.FLOAT_VEC4]="vec4";$s[ee.INT]="int";$s[ee.INT_VEC2]="ivec2";$s[ee.INT_VEC3]="ivec3";$s[ee.INT_VEC4]="ivec4";$s[ee.BOOL]="bool";$s[ee.BOOL_VEC2]="bvec2";$s[ee.BOOL_VEC3]="bvec3";$s[ee.BOOL_VEC4]="bvec4";$s[ee.FLOAT_MAT2]="mat2";$s[ee.FLOAT_MAT3]="mat3";$s[ee.FLOAT_MAT4]="mat4";$s[ee.SAMPLER_2D]="sampler2D";$s[ee.SAMPLER_CUBE]="samplerCube";Lt.prototype.getDeclaration=function(e){let t=`uniform ${$s[this._datatype]} ${e}`,n=this._size;return n===1?t+=";":t+=`[${n.toString()}];`,t};var eYe={czm_viewport:new Lt({size:1,datatype:ee.FLOAT_VEC4,getValue:function(e){return e.viewportCartesian4}}),czm_viewportOrthographic:new Lt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.viewportOrthographic}}),czm_viewportTransformation:new Lt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.viewportTransformation}}),czm_globeDepthTexture:new Lt({size:1,datatype:ee.SAMPLER_2D,getValue:function(e){return e.globeDepthTexture}}),czm_edgeIdTexture:new Lt({size:1,datatype:ee.SAMPLER_2D,getValue:function(e){return e.edgeIdTexture}}),czm_edgeColorTexture:new Lt({size:1,datatype:ee.SAMPLER_2D,getValue:function(e){return e.edgeColorTexture}}),czm_edgeDepthTexture:new Lt({size:1,datatype:ee.SAMPLER_2D,getValue:function(e){return e.edgeDepthTexture}}),czm_planarFillIdTexture:new Lt({size:1,datatype:ee.SAMPLER_2D,getValue:function(e){return e.planarFillIdTexture}}),czm_model:new Lt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.model}}),czm_inverseModel:new Lt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.inverseModel}}),czm_view:new Lt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.view}}),czm_view3D:new Lt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.view3D}}),czm_viewRotation:new Lt({size:1,datatype:ee.FLOAT_MAT3,getValue:function(e){return e.viewRotation}}),czm_viewRotation3D:new Lt({size:1,datatype:ee.FLOAT_MAT3,getValue:function(e){return e.viewRotation3D}}),czm_inverseView:new Lt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.inverseView}}),czm_inverseView3D:new Lt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.inverseView3D}}),czm_inverseViewRotation:new Lt({size:1,datatype:ee.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation}}),czm_inverseViewRotation3D:new Lt({size:1,datatype:ee.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation3D}}),czm_projection:new Lt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.projection}}),czm_inverseProjection:new Lt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.inverseProjection}}),czm_infiniteProjection:new Lt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.infiniteProjection}}),czm_modelView:new Lt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.modelView}}),czm_modelView3D:new Lt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.modelView3D}}),czm_modelViewRelativeToEye:new Lt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.modelViewRelativeToEye}}),czm_inverseModelView:new Lt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.inverseModelView}}),czm_inverseModelView3D:new Lt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.inverseModelView3D}}),czm_viewProjection:new Lt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.viewProjection}}),czm_inverseViewProjection:new Lt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.inverseViewProjection}}),czm_modelViewProjection:new Lt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.modelViewProjection}}),czm_inverseModelViewProjection:new Lt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.inverseModelViewProjection}}),czm_modelViewProjectionRelativeToEye:new Lt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.modelViewProjectionRelativeToEye}}),czm_modelViewInfiniteProjection:new Lt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.modelViewInfiniteProjection}}),czm_orthographicIn3D:new Lt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.orthographicIn3D?1:0}}),czm_normal:new Lt({size:1,datatype:ee.FLOAT_MAT3,getValue:function(e){return e.normal}}),czm_normal3D:new Lt({size:1,datatype:ee.FLOAT_MAT3,getValue:function(e){return e.normal3D}}),czm_inverseNormal:new Lt({size:1,datatype:ee.FLOAT_MAT3,getValue:function(e){return e.inverseNormal}}),czm_inverseNormal3D:new Lt({size:1,datatype:ee.FLOAT_MAT3,getValue:function(e){return e.inverseNormal3D}}),czm_eyeHeight:new Lt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.eyeHeight}}),czm_eyeHeight2D:new Lt({size:1,datatype:ee.FLOAT_VEC2,getValue:function(e){return e.eyeHeight2D}}),czm_eyeEllipsoidNormalEC:new Lt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.eyeEllipsoidNormalEC}}),czm_eyeEllipsoidCurvature:new Lt({size:1,datatype:ee.FLOAT_VEC2,getValue:function(e){return e.eyeEllipsoidCurvature}}),czm_modelToEnu:new Lt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.modelToEnu}}),czm_enuToModel:new Lt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.enuToModel}}),czm_entireFrustum:new Lt({size:1,datatype:ee.FLOAT_VEC2,getValue:function(e){return e.entireFrustum}}),czm_currentFrustum:new Lt({size:1,datatype:ee.FLOAT_VEC2,getValue:function(e){return e.currentFrustum}}),czm_frustumPlanes:new Lt({size:1,datatype:ee.FLOAT_VEC4,getValue:function(e){return e.frustumPlanes}}),czm_farDepthFromNearPlusOne:new Lt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.farDepthFromNearPlusOne}}),czm_log2FarDepthFromNearPlusOne:new Lt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.log2FarDepthFromNearPlusOne}}),czm_oneOverLog2FarDepthFromNearPlusOne:new Lt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.oneOverLog2FarDepthFromNearPlusOne}}),czm_sunPositionWC:new Lt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.sunPositionWC}}),czm_sunPositionColumbusView:new Lt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.sunPositionColumbusView}}),czm_sunDirectionEC:new Lt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.sunDirectionEC}}),czm_sunDirectionWC:new Lt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.sunDirectionWC}}),czm_moonDirectionEC:new Lt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.moonDirectionEC}}),czm_lightDirectionEC:new Lt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.lightDirectionEC}}),czm_lightDirectionWC:new Lt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.lightDirectionWC}}),czm_lightColor:new Lt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.lightColor}}),czm_lightColorHdr:new Lt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.lightColorHdr}}),czm_encodedCameraPositionMCHigh:new Lt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCHigh}}),czm_encodedCameraPositionMCLow:new Lt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCLow}}),czm_viewerPositionWC:new Lt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return O.getTranslation(e.inverseView,Qqe)}}),czm_frameNumber:new Lt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.frameState.frameNumber}}),czm_morphTime:new Lt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.frameState.morphTime}}),czm_sceneMode:new Lt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.frameState.mode}}),czm_pass:new Lt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.pass}}),czm_backgroundColor:new Lt({size:1,datatype:ee.FLOAT_VEC4,getValue:function(e){return e.backgroundColor}}),czm_brdfLut:new Lt({size:1,datatype:ee.SAMPLER_2D,getValue:function(e){return e.brdfLut}}),czm_environmentMap:new Lt({size:1,datatype:ee.SAMPLER_CUBE,getValue:function(e){return e.environmentMap}}),czm_specularEnvironmentMaps:new Lt({size:1,datatype:ee.SAMPLER_CUBE,getValue:function(e){return e.specularEnvironmentMaps}}),czm_specularEnvironmentMapsMaximumLOD:new Lt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.specularEnvironmentMapsMaximumLOD}}),czm_sphericalHarmonicCoefficients:new Lt({size:9,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.sphericalHarmonicCoefficients}}),czm_temeToPseudoFixed:new Lt({size:1,datatype:ee.FLOAT_MAT3,getValue:function(e){return e.temeToPseudoFixedMatrix}}),czm_pixelRatio:new Lt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.pixelRatio}}),czm_fogDensity:new Lt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.fogDensity}}),czm_fogVisualDensityScalar:new Lt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.fogVisualDensityScalar}}),czm_fogMinimumBrightness:new Lt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.fogMinimumBrightness}}),czm_atmosphereHsbShift:new Lt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.atmosphereHsbShift}}),czm_atmosphereLightIntensity:new Lt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.atmosphereLightIntensity}}),czm_atmosphereRayleighCoefficient:new Lt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.atmosphereRayleighCoefficient}}),czm_atmosphereRayleighScaleHeight:new Lt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.atmosphereRayleighScaleHeight}}),czm_atmosphereMieCoefficient:new Lt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.atmosphereMieCoefficient}}),czm_atmosphereMieScaleHeight:new Lt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.atmosphereMieScaleHeight}}),czm_atmosphereMieAnisotropy:new Lt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.atmosphereMieAnisotropy}}),czm_atmosphereDynamicLighting:new Lt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.atmosphereDynamicLighting}}),czm_splitPosition:new Lt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.splitPosition}}),czm_geometricToleranceOverMeter:new Lt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.geometricToleranceOverMeter}}),czm_minimumDisableDepthTestDistance:new Lt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.minimumDisableDepthTestDistance}}),czm_invertClassificationColor:new Lt({size:1,datatype:ee.FLOAT_VEC4,getValue:function(e){return e.invertClassificationColor}}),czm_gamma:new Lt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.gamma}}),czm_ellipsoidRadii:new Lt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.radii}}),czm_ellipsoidInverseRadii:new Lt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.oneOverRadii}})},Q_=eYe;function tYe(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 rk=tYe;function Spe(e){return e=e.replace(/\/\/.*/g,""),e.replace(/\/\*\*[\s\S]*?\*\//gm,function(t){let n=t.match(/\n/gm).length,i="";for(let r=0;r<n;++r)i+=`
|
|
`;return i})}function wpe(e,t,n){let i;for(let r=0;r<n.length;++r)n[r].name===e&&(i=n[r]);return l(i)||(t=Spe(t),i={name:e,glslSource:t,dependsOn:[],requiredBy:[],evaluated:!1},n.push(i)),i}function Ipe(e,t){if(e.evaluated)return;e.evaluated=!0;let n=e.glslSource.match(/\bczm_[a-zA-Z0-9_]*/g);l(n)&&n!==null&&(n=n.filter(function(i,r){return n.indexOf(i)===r}),n.forEach(function(i){if(i!==e.name&&vs._czmBuiltinsAndUniforms.hasOwnProperty(i)){let r=wpe(i,vs._czmBuiltinsAndUniforms[i],t);e.dependsOn.push(r),r.requiredBy.push(e),Ipe(r,t)}}))}function nYe(e){let t=[],n=[];for(;e.length>0;){let r=e.pop();n.push(r),r.requiredBy.length===0&&t.push(r)}for(;t.length>0;){let r=t.shift();e.push(r);for(let o=0;o<r.dependsOn.length;++o){let a=r.dependsOn[o],s=a.requiredBy.indexOf(r);a.requiredBy.splice(s,1),a.requiredBy.length===0&&t.push(a)}}let i=[];for(let r=0;r<n.length;++r)n[r].requiredBy.length!==0&&i.push(n[r])}function iYe(e){let t=[],n=wpe("main",e,t);Ipe(n,t),nYe(t);let i="";for(let r=t.length-1;r>=0;--r)i=`${i+t[r].glslSource}
|
|
`;return i.replace(n.glslSource,"")}function Ppe(e,t,n){let i="",r=e.sources;if(l(r))for(let g=0;g<r.length;++g)i+=`
|
|
#line 0
|
|
${r[g]}`;i=Spe(i);let o;i=i.replace(/#version\s+(.*?)\n/gm,function(g,m){return o=m,`
|
|
`});let a=[];i=i.replace(/#extension.*\n/gm,function(g){return a.push(g),`
|
|
`}),i=i.replace(/precision\s(lowp|mediump|highp)\s(float|int);/,"");let s=e.pickColorQualifier;l(s)&&(i=vs.createPickFragmentShaderSource(i,s));let c="",u=a.length;for(let g=0;g<u;g++)c+=a[g];t&&(c+=`
|
|
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
|
precision highp float;
|
|
precision highp int;
|
|
#else
|
|
precision mediump float;
|
|
precision mediump int;
|
|
#define highp mediump
|
|
#endif
|
|
`),n.webgl2&&(c+=`precision highp sampler3D;
|
|
|
|
`);let f=e.defines;if(l(f))for(let g=0,m=f.length;g<m;++g){let y=f[g];y.length!==0&&(c+=`#define ${y}
|
|
`)}n.textureFloatLinear&&(c+=`#define OES_texture_float_linear
|
|
|
|
`),n.floatingPointTexture&&(c+=`#define OES_texture_float
|
|
|
|
`);let d="";e.includeBuiltIns&&(d=iYe(i)),c+=`
|
|
#line 0
|
|
`;let p=d+i;return n.webgl2&&t&&!/layout\s*\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g.test(p)&&!/czm_out_FragColor/g.test(p)&&/out_FragColor/g.test(p)&&(c+=`layout(location = 0) out vec4 out_FragColor;
|
|
|
|
`),c+=d,c+=i,n.webgl2?c=`#version 300 es
|
|
${c}`:c=rk(c,t),c}function vs(e){e=e??H.EMPTY_OBJECT;let t=e.pickColorQualifier;this.defines=l(e.defines)?e.defines.slice(0):[],this.sources=l(e.sources)?e.sources.slice(0):[],this.pickColorQualifier=t,this.includeBuiltIns=e.includeBuiltIns??!0}vs.prototype.clone=function(){return new vs({sources:this.sources,defines:this.defines,pickColorQualifier:this.pickColorQualifier,includeBuiltIns:this.includeBuiltIns})};vs.replaceMain=function(e,t){return t=`void ${t}()`,e.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g,t)};vs.prototype.getCacheKey=function(){let t=this.defines.slice().sort().join(","),n=this.pickColorQualifier,i=this.includeBuiltIns,r=this.sources.join(`
|
|
`);return`${t}:${n}:${i}:${r}`};vs.prototype.createCombinedVertexShader=function(e){return Ppe(this,!1,e)};vs.prototype.createCombinedFragmentShader=function(e){return Ppe(this,!0,e)};vs._czmBuiltinsAndUniforms={};for(let e in pv)pv.hasOwnProperty(e)&&(vs._czmBuiltinsAndUniforms[e]=pv[e]);for(let e in Q_)if(Q_.hasOwnProperty(e)){let t=Q_[e];typeof t.getDeclaration=="function"&&(vs._czmBuiltinsAndUniforms[e]=t.getDeclaration(e))}vs.createPickVertexShaderSource=function(e){return`${vs.replaceMain(e,"czm_old_main")}
|
|
in vec4 pickColor;
|
|
out vec4 czm_pickColor;
|
|
void main()
|
|
{
|
|
czm_old_main();
|
|
czm_pickColor = pickColor;
|
|
}`};vs.createPickFragmentShaderSource=function(e,t){let n=vs.replaceMain(e,"czm_old_main"),i=`${t} vec4 czm_pickColor;
|
|
void main()
|
|
{
|
|
czm_old_main();
|
|
if (out_FragColor.a == 0.0) {
|
|
discard;
|
|
}
|
|
out_FragColor = czm_pickColor;
|
|
}`;return`${n}
|
|
${i}`};function rYe(e,t){let n=e.defines,i=n.length;for(let r=0;r<i;++r)if(n[r]===t)return!0;return!1}function Dpe(e,t){let n=e.sources,i=n.length;for(let r=0;r<i;++r)if(n[r].indexOf(t)!==-1)return!0;return!1}function Rpe(e,t){let n=t.length;for(let i=0;i<n;++i){let r=t[i];if(Dpe(e,r))return r}}var oYe=["v_normalEC","v_normal"];vs.findNormalVarying=function(e){return Dpe(e,"#ifdef HAS_NORMALS")?rYe(e,"HAS_NORMALS")?"v_normalEC":void 0:Rpe(e,oYe)};var aYe=["v_positionEC"];vs.findPositionVarying=function(e){return Rpe(e,aYe)};var Ge=vs;function sYe(e,t,n,i){switch(t.type){case e.FLOAT:return new bK(e,t,n,i);case e.FLOAT_VEC2:return new xK(e,t,n,i);case e.FLOAT_VEC3:return new TK(e,t,n,i);case e.FLOAT_VEC4:return new CK(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_3D:case e.SAMPLER_CUBE:return new ok(e,t,n,i);case e.UNSIGNED_INT_SAMPLER_2D:return new ok(e,t,n,i);case e.INT:case e.BOOL:return new vK(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new EK(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new SK(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new wK(e,t,n,i);case e.FLOAT_MAT2:return new IK(e,t,n,i);case e.FLOAT_MAT3:return new PK(e,t,n,i);case e.FLOAT_MAT4:return new DK(e,t,n,i);default:throw new oe(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}var bK=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=0,this._gl=t,this._location=r}set(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1f(this._location,this.value))}},xK=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=new k,this._gl=t,this._location=r}set(){let t=this.value;k.equals(t,this._value)||(k.clone(t,this._value),this._gl.uniform2f(this._location,t.x,t.y))}},TK=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=void 0,this._gl=t,this._location=r}set(){let t=this.value;l(t.red)?U.equals(t,this._value)||(this._value=U.clone(t,this._value),this._gl.uniform3f(this._location,t.red,t.green,t.blue)):l(t.x)&&(h.equals(t,this._value)||(this._value=h.clone(t,this._value),this._gl.uniform3f(this._location,t.x,t.y,t.z)))}},CK=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=void 0,this._gl=t,this._location=r}set(){let t=this.value;l(t.red)?U.equals(t,this._value)||(this._value=U.clone(t,this._value),this._gl.uniform4f(this._location,t.red,t.green,t.blue,t.alpha)):l(t.x)&&(ae.equals(t,this._value)||(this._value=ae.clone(t,this._value),this._gl.uniform4f(this._location,t.x,t.y,t.z,t.w)))}},ok=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._gl=t,this._location=r,this.textureUnitIndex=void 0}set(){let t=this._gl;t.activeTexture(t.TEXTURE0+this.textureUnitIndex);let n=this.value;t.bindTexture(n._target,n._texture)}_setSampler(t){return this.textureUnitIndex=t,this._gl.uniform1i(this._location,t),t+1}},vK=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=0,this._gl=t,this._location=r}set(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1i(this._location,this.value))}},EK=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=new k,this._gl=t,this._location=r}set(){let t=this.value;k.equals(t,this._value)||(k.clone(t,this._value),this._gl.uniform2i(this._location,t.x,t.y))}},SK=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=new h,this._gl=t,this._location=r}set(){let t=this.value;h.equals(t,this._value)||(h.clone(t,this._value),this._gl.uniform3i(this._location,t.x,t.y,t.z))}},wK=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=new ae,this._gl=t,this._location=r}set(){let t=this.value;ae.equals(t,this._value)||(ae.clone(t,this._value),this._gl.uniform4i(this._location,t.x,t.y,t.z,t.w))}},cYe=new Float32Array(4),IK=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=new Zi,this._gl=t,this._location=r}set(){if(!Zi.equalsArray(this.value,this._value,0)){Zi.clone(this.value,this._value);let t=Zi.toArray(this.value,cYe);this._gl.uniformMatrix2fv(this._location,!1,t)}}},lYe=new Float32Array(9),PK=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=new $,this._gl=t,this._location=r}set(){if(!$.equalsArray(this.value,this._value,0)){$.clone(this.value,this._value);let t=$.toArray(this.value,lYe);this._gl.uniformMatrix3fv(this._location,!1,t)}}},uYe=new Float32Array(16),DK=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=new O,this._gl=t,this._location=r}set(){if(!O.equalsArray(this.value,this._value,0)){O.clone(this.value,this._value);let t=O.toArray(this.value,uYe);this._gl.uniformMatrix4fv(this._location,!1,t)}}},ak=sYe;function fYe(e,t,n,i){switch(t.type){case e.FLOAT:return new RK(e,t,n,i);case e.FLOAT_VEC2:return new OK(e,t,n,i);case e.FLOAT_VEC3:return new MK(e,t,n,i);case e.FLOAT_VEC4:return new LK(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_3D:case e.SAMPLER_CUBE:return new NK(e,t,n,i);case e.INT:case e.BOOL:return new FK(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new BK(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new kK(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new zK(e,t,n,i);case e.FLOAT_MAT2:return new UK(e,t,n,i);case e.FLOAT_MAT3:return new VK(e,t,n,i);case e.FLOAT_MAT4:return new jK(e,t,n,i);default:throw new oe(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}var RK=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Float32Array(o),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1;for(let o=0;o<n;++o){let a=t[o];a!==i[o]&&(i[o]=a,r=!0)}r&&this._gl.uniform1fv(this._location,i)}},OK=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Float32Array(o*2),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1,o=0;for(let a=0;a<n;++a){let s=t[a];k.equalsArray(s,i,o)||(k.pack(s,i,o),r=!0),o+=2}r&&this._gl.uniform2fv(this._location,i)}},MK=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Float32Array(o*3),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1,o=0;for(let a=0;a<n;++a){let s=t[a];l(s.red)?(s.red!==i[o]||s.green!==i[o+1]||s.blue!==i[o+2])&&(i[o]=s.red,i[o+1]=s.green,i[o+2]=s.blue,r=!0):l(s.x)&&(h.equalsArray(s,i,o)||(h.pack(s,i,o),r=!0)),o+=3}r&&this._gl.uniform3fv(this._location,i)}},LK=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Float32Array(o*4),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1,o=0;for(let a=0;a<n;++a){let s=t[a];l(s.red)?U.equalsArray(s,i,o)||(U.pack(s,i,o),r=!0):l(s.x)&&(ae.equalsArray(s,i,o)||(ae.pack(s,i,o),r=!0)),o+=4}r&&this._gl.uniform4fv(this._location,i)}},NK=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Float32Array(o),this._gl=t,this._locations=r,this.textureUnitIndex=void 0}set(){let t=this._gl,n=t.TEXTURE0+this.textureUnitIndex,i=this.value,r=i.length;for(let o=0;o<r;++o){let a=i[o];t.activeTexture(n+o),t.bindTexture(a._target,a._texture)}}_setSampler(t){this.textureUnitIndex=t;let n=this._locations,i=n.length;for(let r=0;r<i;++r){let o=t+r;this._gl.uniform1i(n[r],o)}return t+i}},FK=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Int32Array(o),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1;for(let o=0;o<n;++o){let a=t[o];a!==i[o]&&(i[o]=a,r=!0)}r&&this._gl.uniform1iv(this._location,i)}},BK=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Int32Array(o*2),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1,o=0;for(let a=0;a<n;++a){let s=t[a];k.equalsArray(s,i,o)||(k.pack(s,i,o),r=!0),o+=2}r&&this._gl.uniform2iv(this._location,i)}},kK=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Int32Array(o*3),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1,o=0;for(let a=0;a<n;++a){let s=t[a];h.equalsArray(s,i,o)||(h.pack(s,i,o),r=!0),o+=3}r&&this._gl.uniform3iv(this._location,i)}},zK=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Int32Array(o*4),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1,o=0;for(let a=0;a<n;++a){let s=t[a];ae.equalsArray(s,i,o)||(ae.pack(s,i,o),r=!0),o+=4}r&&this._gl.uniform4iv(this._location,i)}},UK=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Float32Array(o*4),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1,o=0;for(let a=0;a<n;++a){let s=t[a];Zi.equalsArray(s,i,o)||(Zi.pack(s,i,o),r=!0),o+=4}r&&this._gl.uniformMatrix2fv(this._location,!1,i)}},VK=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Float32Array(o*9),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1,o=0;for(let a=0;a<n;++a){let s=t[a];$.equalsArray(s,i,o)||($.pack(s,i,o),r=!0),o+=9}r&&this._gl.uniformMatrix3fv(this._location,!1,i)}},jK=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Float32Array(o*16),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1,o=0;for(let a=0;a<n;++a){let s=t[a];O.equalsArray(s,i,o)||(O.pack(s,i,o),r=!0),o+=16}r&&this._gl.uniformMatrix4fv(this._location,!1,i)}},sk=fYe;var dYe=0;function z0(e){let t=e.vertexShaderText,n=e.fragmentShaderText;typeof spector<"u"&&(t=t.replace(/^#line/gm,"//#line"),n=n.replace(/^#line/gm,"//#line"));let i=hYe(t,n);this._gl=e.gl,this._logShaderCompilation=e.logShaderCompilation,this._debugShaders=e.debugShaders,this._attributeLocations=e.attributeLocations,this._program=void 0,this._numberOfVertexAttributes=void 0,this._vertexAttributes=void 0,this._uniformsByName=void 0,this._uniforms=void 0,this._automaticUniforms=void 0,this._manualUniforms=void 0,this._duplicateUniformNames=i.duplicateUniformNames,this._cachedShader=void 0,this.maximumTextureUnitIndex=void 0,this._vertexShaderSource=e.vertexShaderSource,this._vertexShaderText=e.vertexShaderText,this._fragmentShaderSource=e.fragmentShaderSource,this._fragmentShaderText=i.fragmentShaderText,this.id=dYe++}z0.fromCache=function(e){return e=e??H.EMPTY_OBJECT,e.context.shaderCache.getShaderProgram(e)};z0.replaceCache=function(e){return e=e??H.EMPTY_OBJECT,e.context.shaderCache.replaceShaderProgram(e)};Object.defineProperties(z0.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},vertexAttributes:{get:function(){return ck(this),this._vertexAttributes}},numberOfVertexAttributes:{get:function(){return ck(this),this._numberOfVertexAttributes}},allUniforms:{get:function(){return ck(this),this._uniformsByName}}});function Ope(e){let t=[],n=e.match(/uniform.*?(?![^{]*})(?=[=\[;])/g);if(l(n)){let i=n.length;for(let r=0;r<i;r++){let o=n[r].trim(),a=o.slice(o.lastIndexOf(" ")+1);t.push(a)}}return t}function hYe(e,t){let n={};if(!Ft.highpFloatSupported||!Ft.highpIntSupported){let i,r,o,a,s=Ope(e),c=Ope(t),u=s.length,f=c.length;for(i=0;i<u;i++)for(r=0;r<f;r++)if(s[i]===c[r]){o=s[i],a=`czm_mediump_${o}`;let d=new RegExp(`${o}\\b`,"g");t=t.replace(d,a),n[a]=o}}return{fragmentShaderText:t,duplicateUniformNames:n}}var ep="[Cesium WebGL] ";function mYe(e,t){let n=t._vertexShaderText,i=t._fragmentShaderText,r=e.createShader(e.VERTEX_SHADER);e.shaderSource(r,n),e.compileShader(r);let o=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(o,i),e.compileShader(o);let a=e.createProgram();e.attachShader(a,r),e.attachShader(a,o);let s=t._attributeLocations;if(l(s))for(let p in s)s.hasOwnProperty(p)&&e.bindAttribLocation(a,s[p],p);e.linkProgram(a);let c;if(e.getProgramParameter(a,e.LINK_STATUS))return t._logShaderCompilation&&(c=e.getShaderInfoLog(r),l(c)&&c.length>0&&console.log(`${ep}Vertex shader compile log: ${c}`),c=e.getShaderInfoLog(o),l(c)&&c.length>0&&console.log(`${ep}Fragment shader compile log: ${c}`),c=e.getProgramInfoLog(a),l(c)&&c.length>0&&console.log(`${ep}Shader program link log: ${c}`)),e.deleteShader(r),e.deleteShader(o),a;let u,f=t._debugShaders;throw e.getShaderParameter(o,e.COMPILE_STATUS)?e.getShaderParameter(r,e.COMPILE_STATUS)?(c=e.getProgramInfoLog(a),console.error(`${ep}Shader program link log: ${c}`),d(r,"vertex"),d(o,"fragment"),u=`Program failed to link. Link log: ${c}`):(c=e.getShaderInfoLog(r),console.error(`${ep}Vertex shader compile log: ${c}`),console.error(`${ep} Vertex shader source:
|
|
${n}`),u=`Vertex shader failed to compile. Compile log: ${c}`):(c=e.getShaderInfoLog(o),console.error(`${ep}Fragment shader compile log: ${c}`),console.error(`${ep} Fragment shader source:
|
|
${i}`),u=`Fragment shader failed to compile. Compile log: ${c}`),e.deleteShader(r),e.deleteShader(o),e.deleteProgram(a),new oe(u);function d(p,g){if(!l(f))return;let m=f.getTranslatedShaderSource(p);if(m===""){console.error(`${ep}${g} shader translation failed.`);return}console.error(`${ep}Translated ${g} shaderSource:
|
|
${m}`)}}function pYe(e,t,n){let i={};for(let r=0;r<n;++r){let o=e.getActiveAttrib(t,r),a=e.getAttribLocation(t,o.name);i[o.name]={name:o.name,type:o.type,index:a}}return i}function gYe(e,t){let n={},i=[],r=[],o=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let a=0;a<o;++a){let s=e.getActiveUniform(t,a),c="[0]",u=s.name.indexOf(c,s.name.length-c.length)!==-1?s.name.slice(0,s.name.length-3):s.name;if(u.indexOf("gl_")!==0)if(s.name.indexOf("[")<0){let f=e.getUniformLocation(t,u);if(f!==null){let d=ak(e,s,u,f);n[u]=d,i.push(d),d._setSampler&&r.push(d)}}else{let f,d,p,g,m=u.indexOf("[");if(m>=0){if(f=n[u.slice(0,m)],!l(f))continue;d=f._locations,d.length<=1&&(p=f.value,g=e.getUniformLocation(t,u),g!==null&&(d.push(g),p.push(e.getUniform(t,g))))}else{d=[];for(let y=0;y<s.size;++y)g=e.getUniformLocation(t,`${u}[${y}]`),g!==null&&d.push(g);f=sk(e,s,u,d),n[u]=f,i.push(f),f._setSampler&&r.push(f)}}}return{uniformsByName:n,uniforms:i,samplerUniforms:r}}function _Ye(e,t){let n=[],i=[];for(let r in t)if(t.hasOwnProperty(r)){let o=t[r],a=r,s=e._duplicateUniformNames[a];l(s)&&(o.name=s,a=s);let c=Q_[a];l(c)?n.push({uniform:o,automaticUniform:c}):i.push(o)}return{automaticUniforms:n,manualUniforms:i}}function yYe(e,t,n){e.useProgram(t);let i=0,r=n.length;for(let o=0;o<r;++o)i=n[o]._setSampler(i);return e.useProgram(null),i}function ck(e){l(e._program)||Mpe(e)}function Mpe(e){let t=e._program,n=e._gl,i=mYe(n,e,e._debugShaders),r=n.getProgramParameter(i,n.ACTIVE_ATTRIBUTES),o=gYe(n,i),a=_Ye(e,o.uniformsByName);e._program=i,e._numberOfVertexAttributes=r,e._vertexAttributes=pYe(n,i,r),e._uniformsByName=o.uniformsByName,e._uniforms=o.uniforms,e._automaticUniforms=a.automaticUniforms,e._manualUniforms=a.manualUniforms,e.maximumTextureUnitIndex=yYe(n,i,o.samplerUniforms),t&&e._gl.deleteProgram(t),typeof spector<"u"&&(e._program.__SPECTOR_rebuildProgram=function(s,c,u,f){let d=e._vertexShaderText,p=e._fragmentShaderText,g=/ ! = /g;e._vertexShaderText=s.replace(g," != "),e._fragmentShaderText=c.replace(g," != ");try{Mpe(e),u(e._program)}catch(m){e._vertexShaderText=d,e._fragmentShaderText=p;let A=/(?:Compile|Link) error: ([^]*)/.exec(m.message);f(A?A[1]:m.message)}})}z0.prototype._bind=function(){ck(this),this._gl.useProgram(this._program)};z0.prototype._setUniforms=function(e,t,n){let i,r;if(l(e)){let s=this._manualUniforms;for(i=s.length,r=0;r<i;++r){let c=s[r];c.value=e[c.name]()}}let o=this._automaticUniforms;for(i=o.length,r=0;r<i;++r){let s=o[r];s.uniform.value=s.automaticUniform.getValue(t)}let a=this._uniforms;for(i=a.length,r=0;r<i;++r)a[r].set();if(n){let s=this._gl,c=this._program;s.validateProgram(c)}};z0.prototype.isDestroyed=function(){return!1};z0.prototype.destroy=function(){this._cachedShader.cache.releaseShaderProgram(this)};z0.prototype.finalDestroy=function(){return this._gl.deleteProgram(this._program),ue(this)};var Zt=z0;var zo={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},HK=class e{constructor(t=H.EMPTY_OBJECT){this._boundingVolume=t.boundingVolume,this._orientedBoundingBox=t.orientedBoundingBox,this._modelMatrix=t.modelMatrix,this._primitiveType=t.primitiveType??Re.TRIANGLES,this._vertexArray=t.vertexArray,this._count=t.count,this._offset=t.offset??0,this._instanceCount=t.instanceCount??0,this._shaderProgram=t.shaderProgram,this._uniformMap=t.uniformMap,this._renderState=t.renderState,this._framebuffer=t.framebuffer,this._pass=t.pass,this._owner=t.owner,this._debugOverlappingFrustums=0,this._pickId=t.pickId,this._snapId=t.snapId,this._pickMetadataAllowed=t.pickMetadataAllowed===!0,this._pickedMetadataInfo=void 0,this._flags=0,this.cull=t.cull??!0,this.occlude=t.occlude??!0,this.executeInClosestFrustum=t.executeInClosestFrustum??!1,this.debugShowBoundingVolume=t.debugShowBoundingVolume??!1,this.castShadows=t.castShadows??!1,this.receiveShadows=t.receiveShadows??!1,this.pickOnly=t.pickOnly??!1,this.depthForTranslucentClassification=t.depthForTranslucentClassification??!1,this.dirty=!0,this.lastDirtyTime=0,this.derivedCommands={}}get boundingVolume(){return this._boundingVolume}set boundingVolume(t){this._boundingVolume!==t&&(this._boundingVolume=t,this.dirty=!0)}get orientedBoundingBox(){return this._orientedBoundingBox}set orientedBoundingBox(t){this._orientedBoundingBox!==t&&(this._orientedBoundingBox=t,this.dirty=!0)}get cull(){return qc(this,zo.CULL)}set cull(t){qc(this,zo.CULL)!==t&&(ey(this,zo.CULL,t),this.dirty=!0)}get occlude(){return qc(this,zo.OCCLUDE)}set occlude(t){qc(this,zo.OCCLUDE)!==t&&(ey(this,zo.OCCLUDE,t),this.dirty=!0)}get modelMatrix(){return this._modelMatrix}set modelMatrix(t){this._modelMatrix!==t&&(this._modelMatrix=t,this.dirty=!0)}get primitiveType(){return this._primitiveType}set primitiveType(t){this._primitiveType!==t&&(this._primitiveType=t,this.dirty=!0)}get vertexArray(){return this._vertexArray}set vertexArray(t){this._vertexArray!==t&&(this._vertexArray=t,this.dirty=!0)}get count(){return this._count}set count(t){this._count!==t&&(this._count=t,this.dirty=!0)}get offset(){return this._offset}set offset(t){this._offset!==t&&(this._offset=t,this.dirty=!0)}get instanceCount(){return this._instanceCount}set instanceCount(t){this._instanceCount!==t&&(this._instanceCount=t,this.dirty=!0)}get shaderProgram(){return this._shaderProgram}set shaderProgram(t){this._shaderProgram!==t&&(this._shaderProgram=t,this.dirty=!0)}get castShadows(){return qc(this,zo.CAST_SHADOWS)}set castShadows(t){qc(this,zo.CAST_SHADOWS)!==t&&(ey(this,zo.CAST_SHADOWS,t),this.dirty=!0)}get receiveShadows(){return qc(this,zo.RECEIVE_SHADOWS)}set receiveShadows(t){qc(this,zo.RECEIVE_SHADOWS)!==t&&(ey(this,zo.RECEIVE_SHADOWS,t),this.dirty=!0)}get uniformMap(){return this._uniformMap}set uniformMap(t){this._uniformMap!==t&&(this._uniformMap=t,this.dirty=!0)}get renderState(){return this._renderState}set renderState(t){this._renderState!==t&&(this._renderState=t,this.dirty=!0)}get framebuffer(){return this._framebuffer}set framebuffer(t){this._framebuffer!==t&&(this._framebuffer=t,this.dirty=!0)}get pass(){return this._pass}set pass(t){this._pass!==t&&(this._pass=t,this.dirty=!0)}get executeInClosestFrustum(){return qc(this,zo.EXECUTE_IN_CLOSEST_FRUSTUM)}set executeInClosestFrustum(t){qc(this,zo.EXECUTE_IN_CLOSEST_FRUSTUM)!==t&&(ey(this,zo.EXECUTE_IN_CLOSEST_FRUSTUM,t),this.dirty=!0)}get owner(){return this._owner}set owner(t){this._owner!==t&&(this._owner=t,this.dirty=!0)}get debugShowBoundingVolume(){return qc(this,zo.DEBUG_SHOW_BOUNDING_VOLUME)}set debugShowBoundingVolume(t){qc(this,zo.DEBUG_SHOW_BOUNDING_VOLUME)!==t&&(ey(this,zo.DEBUG_SHOW_BOUNDING_VOLUME,t),this.dirty=!0)}get debugOverlappingFrustums(){return this._debugOverlappingFrustums}set debugOverlappingFrustums(t){this._debugOverlappingFrustums!==t&&(this._debugOverlappingFrustums=t,this.dirty=!0)}get pickId(){return this._pickId}set pickId(t){this._pickId!==t&&(this._pickId=t,this.dirty=!0)}get snapId(){return this._snapId}set snapId(t){this._snapId!==t&&(this._snapId=t,this.dirty=!0)}get pickMetadataAllowed(){return this._pickMetadataAllowed}get pickedMetadataInfo(){return this._pickedMetadataInfo}set pickedMetadataInfo(t){this._pickedMetadataInfo!==t&&(this._pickedMetadataInfo=t,this.dirty=!0)}get pickOnly(){return qc(this,zo.PICK_ONLY)}set pickOnly(t){qc(this,zo.PICK_ONLY)!==t&&(ey(this,zo.PICK_ONLY,t),this.dirty=!0)}get depthForTranslucentClassification(){return qc(this,zo.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)}set depthForTranslucentClassification(t){qc(this,zo.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)!==t&&(ey(this,zo.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION,t),this.dirty=!0)}static shallowClone(t,n){if(l(t))return l(n)||(n=new e),n._boundingVolume=t._boundingVolume,n._orientedBoundingBox=t._orientedBoundingBox,n._modelMatrix=t._modelMatrix,n._primitiveType=t._primitiveType,n._vertexArray=t._vertexArray,n._count=t._count,n._offset=t._offset,n._instanceCount=t._instanceCount,n._shaderProgram=t._shaderProgram,n._uniformMap=t._uniformMap,n._renderState=t._renderState,n._framebuffer=t._framebuffer,n._pass=t._pass,n._owner=t._owner,n._debugOverlappingFrustums=t._debugOverlappingFrustums,n._pickId=t._pickId,n._snapId=t._snapId,n._pickMetadataAllowed=t._pickMetadataAllowed,n._pickedMetadataInfo=t._pickedMetadataInfo,n._flags=t._flags,n.dirty=!0,n.lastDirtyTime=0,n}execute(t,n){t.draw(this,n)}};function qc(e,t){return(e._flags&t)===t}function ey(e,t,n){n?e._flags|=t:e._flags&=~t}var nt=HK;var Lpe={ENVIRONMENT:0,COMPUTE:1,GLOBE:2,TERRAIN_CLASSIFICATION:3,CESIUM_3D_TILE_EDGES:4,CESIUM_3D_TILE_PLANAR_FILL_ID:5,CESIUM_3D_TILE:6,CESIUM_3D_TILE_CLASSIFICATION:7,CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW:8,OPAQUE:9,TRANSLUCENT:10,VOXELS:11,GAUSSIAN_SPLATS:12,CESIUM_3D_TILE_EDGES_DIRECT:13,OVERLAY:14,NUMBER_OF_PASSES:15};Object.freeze(Lpe);var Pe=Lpe;var lk=`#ifdef USE_FLOAT64
|
|
in vec3 positionHigh;
|
|
in vec3 positionLow;
|
|
#else
|
|
in vec3 position;
|
|
#endif
|
|
in vec4 pickColor;
|
|
in vec3 showColorAlpha;
|
|
|
|
out vec4 v_pickColor;
|
|
out vec4 v_color;
|
|
|
|
void main()
|
|
{
|
|
float show = showColorAlpha.x;
|
|
vec4 color = czm_decodeRGB8(showColorAlpha.y);
|
|
float alpha = showColorAlpha.z;
|
|
|
|
///////////////////////////////////////////////////////////////////////////
|
|
|
|
#ifdef USE_FLOAT64
|
|
vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);
|
|
vec4 positionEC = czm_modelViewRelativeToEye * p;
|
|
#else
|
|
vec4 positionEC = czm_modelView * vec4(position, 1.0);
|
|
#endif
|
|
|
|
///////////////////////////////////////////////////////////////////////////
|
|
|
|
gl_Position = czm_projection * positionEC;
|
|
czm_vertexLogDepth();
|
|
|
|
v_pickColor = pickColor / 255.0;
|
|
|
|
v_color = color;
|
|
v_color.a *= alpha * show;
|
|
|
|
gl_Position *= show;
|
|
}
|
|
`;var uk=`in vec4 v_pickColor;
|
|
in vec4 v_color;
|
|
|
|
void main()
|
|
{
|
|
if (v_color.a < 0.005) // matches 0/255 and 1/255
|
|
{
|
|
discard;
|
|
}
|
|
|
|
out_FragColor = czm_gammaCorrect(v_color);
|
|
czm_writeLogDepth();
|
|
}
|
|
`;var GK={positionHigh:0,positionLow:1,pickColor:2,showColorAlpha:3},Npe={position:0,pickColor:1,showColorAlpha:2},ss=new oa,WK=new sd,OP=new U,Fpe=new h,qK=new Sn;function AYe(e,t,n){let i=t.context;n=n||{destroy:xYe};let r=e._positionDatatype===Y.DOUBLE,o=r?GK:Npe;if(!l(n.attributeArrays)||!l(n.indexArray)){let{vertexCountMax:c,triangleCountMax:u}=e;n.indexArray=Ve.createTypedArray(c,u*3),n.attributeArrays={...r?{positionHigh:new Float32Array(c*3),positionLow:new Float32Array(c*3)}:{position:e._positionView},pickColor:new Uint8Array(c*4),showColorAlpha:new Float32Array(c*3)}}if(e._dirtyCount>0){let{attributeArrays:c}=n,{_dirtyOffset:u,_dirtyCount:f}=e,d=c.positionHigh,p=c.positionLow,g=n.indexArray,m=c.pickColor,y=c.showColorAlpha;for(let A=u,b=u+f;A<b;A++){if(e.get(A,ss),!ss._dirty)continue;let x=ss.triangleOffset,T=ss.vertexOffset,C=ss.getTriangles();for(let R=0,M=ss.triangleCount;R<M;R++)g[x*3]=T+C[R*3],g[x*3+1]=T+C[R*3+1],g[x*3+2]=T+C[R*3+2],x++;let E=ss.show,w=r?ss.getPositions():null;ss.getMaterial(WK);let D=an.encodeRGB8(WK.color);U.fromRgba(ss._pickId,OP);for(let R=0,M=ss.vertexCount;R<M;R++)r&&(h.fromArray(w,R*3,Fpe),Sn.fromCartesian(Fpe,qK),h.pack(qK.high,d,T*3),h.pack(qK.low,p,T*3)),m[T*4]=U.floatToByte(OP.red),m[T*4+1]=U.floatToByte(OP.green),m[T*4+2]=U.floatToByte(OP.blue),m[T*4+3]=U.floatToByte(OP.alpha),y[T*3]=E?1:0,y[T*3+1]=D,y[T*3+2]=WK.color.alpha,T++;ss._dirty=!1}}if(l(n.vertexArray)){if(e._dirtyCount>0){let{indexOffset:c,indexCount:u,vertexOffset:f,vertexCount:d}=bYe(e);n.vertexArray.copyIndexFromRange(n.indexArray,c,u);for(let p in o)if(Object.hasOwn(o,p)){let g=p;n.vertexArray.copyAttributeFromRange(o[g],n.attributeArrays[g],f,d)}}}else{let{attributeArrays:c}=n;n.vertexArray=new Vn({context:i,indexBuffer:Ze.createIndexBuffer({context:i,typedArray:n.indexArray,usage:Oe.STATIC_DRAW,indexDatatype:Ve.fromTypedArray(n.indexArray)}),attributes:[...r?[{index:GK.positionHigh,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:Ze.createVertexBuffer({typedArray:c.positionHigh,context:i,usage:Oe.STATIC_DRAW})},{index:GK.positionLow,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:Ze.createVertexBuffer({typedArray:c.positionLow,context:i,usage:Oe.STATIC_DRAW})}]:[{index:Npe.position,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:Ze.createVertexBuffer({typedArray:c.position,context:i,usage:Oe.STATIC_DRAW})}],{index:o.pickColor,componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:4,vertexBuffer:Ze.createVertexBuffer({typedArray:c.pickColor,context:i,usage:Oe.STATIC_DRAW})},{index:o.showColorAlpha,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:Ze.createVertexBuffer({typedArray:c.showColorAlpha,context:i,usage:Oe.STATIC_DRAW})}]})}l(n.renderState)||(n.renderState=je.fromCache({blending:e._blendOption===Fi.OPAQUE?en.DISABLED:en.ALPHA_BLEND,depthTest:{enabled:!0}})),l(n.shaderProgram)||(n.shaderProgram=Zt.fromCache({context:i,vertexShaderSource:new Ge({sources:[lk],defines:r?["USE_FLOAT64"]:[]}),fragmentShaderSource:new Ge({sources:[uk]}),attributeLocations:o}));let a=e.triangleCount*3;l(n.command)||(n.command=new nt({vertexArray:n.vertexArray,renderState:n.renderState,shaderProgram:n.shaderProgram,primitiveType:Re.TRIANGLES,pass:e._blendOption===Fi.OPAQUE?Pe.OPAQUE:Pe.TRANSLUCENT,pickId:e._allowPicking?"v_pickColor":void 0,owner:e,count:a,modelMatrix:e.modelMatrix,boundingVolume:e.boundingVolume,debugShowBoundingVolume:e.debugShowBoundingVolume}));let s=n.command;return s.count!==a&&(s.count=a),s.debugShowBoundingVolume!==e.debugShowBoundingVolume&&(s.debugShowBoundingVolume=e.debugShowBoundingVolume),t.commandList.push(s),e._makeClean(),n}function bYe(e){let{_dirtyOffset:t,_dirtyCount:n}=e;e.get(t,ss);let i=ss.vertexOffset,r=ss.triangleOffset*3;e.get(t+n-1,ss);let o=ss.vertexOffset+ss.vertexCount-i,a=(ss.triangleOffset+ss.triangleCount)*3-r;return{indexOffset:r,indexCount:a,vertexOffset:i,vertexCount:o}}function xYe(){let e=this;l(e.vertexArray)&&e.vertexArray.destroy(),l(e.shaderProgram)&&e.shaderProgram.destroy(),l(e.renderState)&&je.removeFromCache(e.renderState)}var fk=AYe;var{ERR_CAPACITY:uwn}=as.Error,YK=class e extends as{constructor(t=H.EMPTY_OBJECT){super(t),this._holeCount=0,this._holeCountMax=t.holeCountMax??as.DEFAULT_CAPACITY,this._holeIndexView=null,this._triangleCount=0,this._triangleCountMax=t.triangleCountMax??as.DEFAULT_CAPACITY,this._triangleIndexView=null,this._allocateHoleIndexBuffer(),this._allocateTriangleIndexBuffer()}_getCollectionClass(){return e}_getPrimitiveClass(){return oa}_getMaterialClass(){return sd}_allocateHoleIndexBuffer(){this._holeIndexView=Ve.createTypedArray(this._positionCountMax,this._holeCountMax)}_allocateTriangleIndexBuffer(){this._triangleIndexView=Ve.createTypedArray(this._positionCountMax,this._triangleCountMax*3)}static clone(t,n){return super.clone(t,n),this._copySubArray(t._holeIndexView,n._holeIndexView,t.holeCount),this._copySubArray(t._triangleIndexView,n._triangleIndexView,t._triangleCount*3),n._holeCount=t._holeCount,n._triangleCount=t._triangleCount,n}static _cloneEmpty(t){return new e({primitiveCountMax:t.primitiveCountMax,vertexCountMax:t.vertexCountMax,holeCountMax:t.holeCountMax,triangleCountMax:t.triangleCountMax,positionDatatype:t.positionDatatype,positionNormalized:t.positionNormalized})}static _replaceBuffers(t,n){super._replaceBuffers(t,n),n._holeIndexView=t._holeIndexView,n._triangleIndexView=t._triangleIndexView}add(t,n=new oa){super.add(t,n);let i=this._positionCount;n._setUint32(oa.Layout.POSITION_OFFSET_U32,i),n._setUint32(oa.Layout.POSITION_COUNT_U32,0);let r=this._holeCount;n._setUint32(oa.Layout.HOLE_OFFSET_U32,r),n._setUint32(oa.Layout.HOLE_COUNT_U32,0);let o=this._triangleCount;return n._setUint32(oa.Layout.TRIANGLE_OFFSET_U32,o),n._setUint32(oa.Layout.TRIANGLE_COUNT_U32,0),l(t.positions)&&n.setPositions(t.positions),l(t.holes)&&n.setHoles(t.holes),l(t.triangles)&&n.setTriangles(t.triangles),n}update(t){super.update(t);let n=t.passes;this.show&&(n.render||n.pick)&&(this._renderContext=fk(this,t,this._renderContext))}get byteLength(){return super.byteLength+this._holeIndexView.byteLength+this._triangleIndexView.byteLength}get holeCount(){return this._holeCount}get holeCountMax(){return this._holeCountMax}get triangleCount(){return this._triangleCount}get triangleCountMax(){return this._triangleCountMax}},Cl=YK;var dk=`#ifdef USE_FLOAT64
|
|
in vec3 positionHigh;
|
|
in vec3 positionLow;
|
|
in vec3 prevPositionHigh;
|
|
in vec3 prevPositionLow;
|
|
in vec3 nextPositionHigh;
|
|
in vec3 nextPositionLow;
|
|
#else
|
|
in vec3 position;
|
|
in vec3 prevPosition;
|
|
in vec3 nextPosition;
|
|
#endif
|
|
in vec4 pickColor;
|
|
in vec4 showColorWidthAndTexCoord;
|
|
in float alpha;
|
|
|
|
out vec4 v_pickColor;
|
|
out vec4 v_color;
|
|
out vec2 v_st;
|
|
out float v_width;
|
|
out float v_polylineAngle;
|
|
|
|
void main()
|
|
{
|
|
float show = showColorWidthAndTexCoord.x;
|
|
vec4 color = czm_decodeRGB8(showColorWidthAndTexCoord.y);
|
|
float width = showColorWidthAndTexCoord.z;
|
|
float texCoord = showColorWidthAndTexCoord.w;
|
|
|
|
///////////////////////////////////////////////////////////////////////////
|
|
|
|
bool usePrevious = texCoord == 1.0;
|
|
float expandDir = gl_VertexID % 2 == 1 ? 1.0 : -1.0;
|
|
float polylineAngle;
|
|
|
|
#ifdef USE_FLOAT64
|
|
vec4 positionEC = czm_translateRelativeToEye(positionHigh, positionLow);
|
|
vec4 prevPositionEC = czm_translateRelativeToEye(prevPositionHigh, prevPositionLow);
|
|
vec4 nextPositionEC = czm_translateRelativeToEye(nextPositionHigh, nextPositionLow);
|
|
vec4 positionWC = getPolylineWindowCoordinates(positionEC, prevPositionEC, nextPositionEC, expandDir, width, usePrevious, polylineAngle);
|
|
#else
|
|
vec4 positionEC = czm_modelView * vec4(position, 1.0);
|
|
vec4 prevPositionEC = czm_modelView * vec4(prevPosition, 1.0);
|
|
vec4 nextPositionEC = czm_modelView * vec4(nextPosition, 1.0);
|
|
// Positions are already in eye space; use the EC variant to skip the redundant transform.
|
|
vec4 positionWC = getPolylineWindowCoordinatesEC(positionEC, prevPositionEC, nextPositionEC, expandDir, width, usePrevious, polylineAngle);
|
|
#endif
|
|
|
|
///////////////////////////////////////////////////////////////////////////
|
|
|
|
gl_Position = czm_viewportOrthographic * positionWC * show;
|
|
|
|
v_pickColor = pickColor / 255.0;
|
|
|
|
v_color = color;
|
|
v_color.a *= alpha / 255.0 * show;
|
|
|
|
v_st.s = texCoord;
|
|
v_st.t = czm_writeNonPerspective(clamp(expandDir, 0.0, 1.0), gl_Position.w);
|
|
|
|
v_width = width;
|
|
v_polylineAngle = polylineAngle;
|
|
}
|
|
`;var hk=`in vec4 v_pickColor;
|
|
in vec4 v_color;
|
|
|
|
void main()
|
|
{
|
|
if (v_color.a < 0.005) // matches 0/255 and 1/255
|
|
{
|
|
discard;
|
|
}
|
|
|
|
out_FragColor = czm_gammaCorrect(v_color);
|
|
czm_writeLogDepth();
|
|
}
|
|
`;var cu=`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);
|
|
|
|
// Distance that p0 is behind the near plane. Negative means p0 is
|
|
// in front of the near plane.
|
|
float endPoint0Distance = czm_currentFrustum.x + p0.z;
|
|
|
|
// Camera looks down -Z.
|
|
// When moving a point along +Z: LESS VISIBLE
|
|
// * Points in front of the camera move closer to the camera.
|
|
// * Points behind the camrea move farther away from the camera.
|
|
// When moving a point along -Z: MORE VISIBLE
|
|
// * Points in front of the camera move farther away from the camera.
|
|
// * Points behind the camera move closer to the camera.
|
|
|
|
// Positive denominator: -Z, becoming more visible
|
|
// Negative denominator: +Z, becoming less visible
|
|
// Nearly zero: parallel to near plane
|
|
float denominator = -direction.z;
|
|
|
|
if (endPoint0Distance > 0.0 && abs(denominator) < czm_epsilon7)
|
|
{
|
|
// p0 is behind the near plane and the line to p1 is nearly parallel to
|
|
// the near plane, so cull the segment completely.
|
|
culledByNearPlane = true;
|
|
}
|
|
else if (endPoint0Distance > 0.0)
|
|
{
|
|
// p0 is behind the near plane, and the line to p1 is moving distinctly
|
|
// toward or away from it.
|
|
|
|
// t = (-plane distance - dot(plane normal, ray origin)) / dot(plane normal, ray direction)
|
|
float t = endPoint0Distance / denominator;
|
|
if (t < 0.0 || t > magnitude)
|
|
{
|
|
// Near plane intersection is not between the two points.
|
|
// We already confirmed p0 is behind the naer plane, so now
|
|
// we know the entire segment is behind it.
|
|
culledByNearPlane = true;
|
|
}
|
|
else
|
|
{
|
|
// Segment crosses the near plane, update p0 to lie exactly on it.
|
|
p0 = p0 + t * direction;
|
|
|
|
// Numerical noise might put us a bit on the wrong side of the near plane.
|
|
// Don't let that happen.
|
|
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)
|
|
{
|
|
// expandDirection +1 is to the _left_ when looking from positionEC toward nextEC.
|
|
|
|
#ifdef POLYLINE_DASH
|
|
// Compute the window coordinates of the points.
|
|
vec4 positionWindow = czm_eyeToWindowCoordinates(positionEC);
|
|
vec4 previousWindow = czm_eyeToWindowCoordinates(prevEC);
|
|
vec4 nextWindow = czm_eyeToWindowCoordinates(nextEC);
|
|
|
|
// Determine the relative screen space direction of the line.
|
|
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; // precomputed atan(1,0)
|
|
|
|
// Quantize the angle so it doesn't change rapidly between segments.
|
|
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 a segment was culled, we can't use the corresponding direction
|
|
// computed above. We should never see both of these be true without
|
|
// \`segmentCulled\` above also being true.
|
|
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;
|
|
|
|
// When lines are split at the anti-meridian, the position may be at the
|
|
// same location as the next or previous position, and we need to handle
|
|
// that to avoid producing NaNs.
|
|
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);
|
|
|
|
// The sine of the angle between the two vectors is given by the formula
|
|
// |a x b| = |a||b|sin(theta)
|
|
// which is
|
|
// float sinAngle = length(cross(vec3(leftWC, 0.0), vec3(-thisSegmentForwardWC, 0.0)));
|
|
// Because the z components of both vectors are zero, the x and y coordinate will be zero.
|
|
// Therefore, the sine of the angle is just the z component of the cross product.
|
|
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 Db={positionHigh:0,positionLow:1,prevPositionHigh:2,prevPositionLow:3,nextPositionHigh:4,nextPositionLow:5,pickColor:6,showColorWidthAndTexCoord:7,alpha:8},mk={position:0,prevPosition:1,nextPosition:2,pickColor:3,showColorWidthAndTexCoord:4,alpha:5},Yc=new Cs,pk=new cd,MP=new U,Bpe=new h,kpe=new h,zpe=new h,XK=new Sn,KK=new Sn,$K=new Sn;function TYe(e,t,n){let i=t.context;n=n||{destroy:EYe};let r=e._positionDatatype===Y.DOUBLE,o=r?Db:mk;if(!l(n.attributeArrays)||!l(n.indexArray)){let c=e.vertexCountMax-e.primitiveCount,u=e.vertexCountMax*2;n.indexArray=Ve.createTypedArray(u,c*6),n.attributeArrays={...r?{positionHigh:new Float32Array(u*3),positionLow:new Float32Array(u*3),prevPositionHigh:new Float32Array(u*3),prevPositionLow:new Float32Array(u*3),nextPositionHigh:new Float32Array(u*3),nextPositionLow:new Float32Array(u*3)}:{position:Y.createTypedArray(e._positionDatatype,u*3),prevPosition:Y.createTypedArray(e._positionDatatype,u*3),nextPosition:Y.createTypedArray(e._positionDatatype,u*3)},pickColor:new Uint8Array(u*4),showColorWidthAndTexCoord:new Float32Array(u*4),alpha:new Uint8Array(u)}}if(e._dirtyCount>0){let{_dirtyOffset:c,_dirtyCount:u}=e,f=n.indexArray,{pickColor:d,showColorWidthAndTexCoord:p,alpha:g,position:m,prevPosition:y,nextPosition:A,positionHigh:b,positionLow:x,prevPositionHigh:T,prevPositionLow:C,nextPositionHigh:E,nextPositionLow:w}=n.attributeArrays;for(let D=c,R=c+u;D<R;D++){if(e.get(D,Yc),!Yc._dirty)continue;Yc.getMaterial(pk);let M=an.encodeRGB8(pk.color),N=pk.color.alpha;U.fromRgba(Yc._pickId,MP);let _=Yc.show,v=Yc.vertexOffset*2,S=(Yc.vertexOffset-D)*6,P=e._positionView,L=Yc.vertexOffset*3;for(let F=0,V=Yc.vertexCount;F<V;F++){let z=F===0,j=F===V-1,B=P[L+F*3],G=P[L+F*3+1],W=P[L+F*3+2],Q,q,J,Z,ce,Ae;z?(Z=P[L+3],ce=P[L+3+1],Ae=P[L+3+2],Q=2*B-Z,q=2*G-ce,J=2*W-Ae):j?(Q=P[L+(F-1)*3],q=P[L+(F-1)*3+1],J=P[L+(F-1)*3+2],Z=2*B-Q,ce=2*G-q,Ae=2*W-J):(Q=P[L+(F-1)*3],q=P[L+(F-1)*3+1],J=P[L+(F-1)*3+2],Z=P[L+(F+1)*3],ce=P[L+(F+1)*3+1],Ae=P[L+(F+1)*3+2]),j||(f[S]=v,f[S+1]=v+1,f[S+2]=v+2,f[S+3]=v+2,f[S+4]=v+1,f[S+5]=v+3,S+=6),r&&(h.fromElements(B,G,W,Bpe),h.fromElements(Q,q,J,kpe),h.fromElements(Z,ce,Ae,zpe),Sn.fromCartesian(Bpe,XK),Sn.fromCartesian(kpe,KK),Sn.fromCartesian(zpe,$K));for(let le=0;le<2;le++)r?(h.pack(XK.high,b,v*3),h.pack(XK.low,x,v*3),h.pack(KK.high,T,v*3),h.pack(KK.low,C,v*3),h.pack($K.high,E,v*3),h.pack($K.low,w,v*3)):(m[v*3]=B,m[v*3+1]=G,m[v*3+2]=W,y[v*3]=Q,y[v*3+1]=q,y[v*3+2]=J,A[v*3]=Z,A[v*3+1]=ce,A[v*3+2]=Ae),d[v*4]=U.floatToByte(MP.red),d[v*4+1]=U.floatToByte(MP.green),d[v*4+2]=U.floatToByte(MP.blue),d[v*4+3]=U.floatToByte(MP.alpha),p[v*4]=_?1:0,p[v*4+1]=M,p[v*4+2]=pk.width,p[v*4+3]=F/(V-1),g[v]=N*255,v++}Yc._dirty=!1}}if(l(n.vertexArray)){if(e._dirtyCount>0){let{indexOffset:c,indexCount:u,vertexOffset:f,vertexCount:d}=vYe(e);n.vertexArray.copyIndexFromRange(n.indexArray,c,u);for(let p in o)if(Object.hasOwn(o,p)){let g=p;n.vertexArray.copyAttributeFromRange(o[g],n.attributeArrays[g],f,d)}}}else{let c=n.attributeArrays;n.vertexArray=new Vn({context:i,indexBuffer:Ze.createIndexBuffer({context:i,typedArray:n.indexArray,usage:Oe.STATIC_DRAW,indexDatatype:Ve.fromTypedArray(n.indexArray)}),attributes:[...r?[{index:Db.positionHigh,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:Ze.createVertexBuffer({typedArray:c.positionHigh,context:i,usage:Oe.STATIC_DRAW})},{index:Db.positionLow,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:Ze.createVertexBuffer({typedArray:c.positionLow,context:i,usage:Oe.STATIC_DRAW})},{index:Db.prevPositionHigh,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:Ze.createVertexBuffer({typedArray:c.prevPositionHigh,context:i,usage:Oe.STATIC_DRAW})},{index:Db.prevPositionLow,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:Ze.createVertexBuffer({typedArray:c.prevPositionLow,context:i,usage:Oe.STATIC_DRAW})},{index:Db.nextPositionHigh,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:Ze.createVertexBuffer({typedArray:c.nextPositionHigh,context:i,usage:Oe.STATIC_DRAW})},{index:Db.nextPositionLow,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:Ze.createVertexBuffer({typedArray:c.nextPositionLow,context:i,usage:Oe.STATIC_DRAW})}]:[{index:mk.position,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:Ze.createVertexBuffer({typedArray:c.position,context:i,usage:Oe.STATIC_DRAW})},{index:mk.prevPosition,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:Ze.createVertexBuffer({typedArray:c.prevPosition,context:i,usage:Oe.STATIC_DRAW})},{index:mk.nextPosition,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:Ze.createVertexBuffer({typedArray:c.nextPosition,context:i,usage:Oe.STATIC_DRAW})}],{index:o.pickColor,componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:4,vertexBuffer:Ze.createVertexBuffer({typedArray:c.pickColor,context:i,usage:Oe.STATIC_DRAW})},{index:o.showColorWidthAndTexCoord,componentDatatype:Y.FLOAT,componentsPerAttribute:4,vertexBuffer:Ze.createVertexBuffer({typedArray:c.showColorWidthAndTexCoord,context:i,usage:Oe.STATIC_DRAW})},{index:o.alpha,componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,vertexBuffer:Ze.createVertexBuffer({typedArray:c.alpha,context:i,usage:Oe.STATIC_DRAW})}]})}l(n.renderState)||(n.renderState=je.fromCache({blending:e._blendOption===Fi.OPAQUE?en.DISABLED:en.ALPHA_BLEND,depthTest:{enabled:!0}})),l(n.shaderProgram)||(n.shaderProgram=Zt.fromCache({context:i,vertexShaderSource:new Ge({sources:[cu,dk],defines:r?["USE_FLOAT64"]:[]}),fragmentShaderSource:new Ge({sources:[hk]}),attributeLocations:o}));let a=CYe(e);l(n.command)||(n.command=new nt({vertexArray:n.vertexArray,renderState:n.renderState,shaderProgram:n.shaderProgram,primitiveType:Re.TRIANGLES,pass:e._blendOption===Fi.OPAQUE?Pe.OPAQUE:Pe.TRANSLUCENT,pickId:e._allowPicking?"v_pickColor":void 0,owner:e,count:a,modelMatrix:e.modelMatrix,boundingVolume:e.boundingVolume,debugShowBoundingVolume:e.debugShowBoundingVolume}));let s=n.command;return s.count!==a&&(s.count=a),s.debugShowBoundingVolume!==e.debugShowBoundingVolume&&(s.debugShowBoundingVolume=e.debugShowBoundingVolume),t.commandList.push(s),e._makeClean(),n}function CYe(e){return(e.vertexCount-e.primitiveCount)*6}function vYe(e){let{_dirtyOffset:t,_dirtyCount:n}=e;e.get(t,Yc);let i=Yc.vertexOffset*2,o=(Yc.vertexOffset-t)*6;e.get(t+n-1,Yc);let a=(Yc.vertexOffset+Yc.vertexCount)*2-i,c=(a/2-n)*6;return{indexOffset:o,indexCount:c,vertexOffset:i,vertexCount:a}}function EYe(){let e=this;l(e.vertexArray)&&e.vertexArray.destroy(),l(e.shaderProgram)&&e.shaderProgram.destroy(),l(e.renderState)&&je.removeFromCache(e.renderState)}var gk=TYe;var JK=class e extends as{_getCollectionClass(){return e}_getPrimitiveClass(){return Cs}_getMaterialClass(){return cd}static _cloneEmpty(t){return new e({primitiveCountMax:t.primitiveCountMax,vertexCountMax:t.vertexCountMax,positionDatatype:t.positionDatatype,positionNormalized:t.positionNormalized})}add(t,n=new Cs){super.add(t,n);let i=this._positionCount;return n._setUint32(Cs.Layout.POSITION_OFFSET_U32,i),n._setUint32(Cs.Layout.POSITION_COUNT_U32,0),l(t.positions)&&n.setPositions(t.positions),n}update(t){super.update(t);let n=t.passes;this.show&&(n.render||n.pick)&&(this._renderContext=gk(this,t,this._renderContext))}},vl=JK;var SYe=new ie,wYe=new ie,Upe=new ie,QK=new Map;QK.set(vl,{packCollectionData:Tl.packPolylineCollectionData,packTilePrimitives:Tl.packPolylineSegments});QK.set(Cl,{packCollectionData:Tl.packPolygonCollectionData,packTilePrimitives:Tl.packPolygonRings});var ZK=class{constructor(t){this._tilingScheme=t.tilingScheme,this._collections=new Set,this._collectionDataCache=new WeakMap,this._selectedThisFrame=new Set,this._selectionDriven=new Set,this._selectionFrameNumber=-1,this._dirtyRectangles=[]}get tilingScheme(){return this._tilingScheme}set tilingScheme(t){this._tilingScheme=t}get ellipsoid(){return this._tilingScheme.ellipsoid}add(t){let n=this._collections.size;this._collections.add(t),this._collections.size!==n&&this._markCollectionRegionDirty(t)}remove(t){this._selectedThisFrame.delete(t),this._selectionDriven.delete(t),this._collections.delete(t)&&this._markCollectionRegionDirty(t)}markSelected(t,n){n!==this._selectionFrameNumber&&(this._commitSelectedFrame(),this._selectionFrameNumber=n),this._selectedThisFrame.add(t),this._selectionDriven.add(t);let i=this._collections.size;this._collections.add(t),this._collections.size!==i&&this._markCollectionRegionDirty(t)}_commitSelectedFrame(){for(let t of this._selectionDriven)this._selectedThisFrame.has(t)||(this._selectionDriven.delete(t),this._collections.delete(t)&&this._markCollectionRegionDirty(t));this._selectedThisFrame.clear()}_markCollectionRegionDirty(t){let n=ie.fromBoundingSphere(t.boundingVolume,this._tilingScheme.ellipsoid,new ie);this._dirtyRectangles.push(n)}requestTileData(t,n,i,r){let o=this._tilingScheme,a=o.tileXYToRectangle(t,n,i),s={show:!0};for(let f of this._collections){let d=QK.get(f.constructor);if(!l(d))continue;let p=ie.fromBoundingSphere(f.boundingVolume,o.ellipsoid,wYe);if(!!!ie.intersection(a,p,Upe))continue;let m=this._getCollectionDataCached(f,d.packCollectionData);d.packTilePrimitives(f,m,a,s)}let c=l(s.polylineSegments)&&s.polylineSegments.length>0,u=l(s.polygonRings)&&s.polygonRings.length>0;return!c&&!u?(s.show=!1,s):(c&&(Tl.packPolylineGrid(s),Tl.packPolylineTextures(r,s)),u&&(Tl.packPolygonGrid(s),Tl.packPolygonTextures(r,s)),Tl.packPrimitiveTextures(r,s),s)}releaseTileData(t){Tl.freeResources(t)}updateTileData(t,n,i,r,o){let a=this._dirtyRectangles,s=this._tilingScheme;return IYe(t,n,i,a,s)?(l(o)&&this.releaseTileData(o),this.requestTileData(t,n,i,r)):o}makeClean(){this._dirtyRectangles.length=0}update(){for(let t of this._collections){let n=this._collectionDataCache.get(t);!l(n)||!(t._dirtyCount>0||n.version!==t._version)||(l(n.rectangle)&&this._dirtyRectangles.push(ie.clone(n.rectangle)),this._markCollectionRegionDirty(t))}}_getCollectionDataCached(t,n){let i=this._collectionDataCache.get(t),r=t._dirtyCount>0,o=i?.version!==t._version;if(l(i)&&!r&&!o)return i;let a=n(t,this._tilingScheme,i);return a.version=t._version+(r?1:0),a.rectangle=ie.fromBoundingSphere(t.boundingVolume,this.ellipsoid,a.rectangle),this._collectionDataCache.set(t,a),t._makeClean(),a}};function IYe(e,t,n,i,r){if(i.length===0)return!1;let o=r.tileXYToRectangle(e,t,n,SYe);for(let a=0;a<i.length;a++)if(ie.intersection(o,i[a],Upe))return!0;return!1}var _k=ZK;function Rb(e){e=e??H.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??Qe.MINIMUM_VALUE,this.tolerance=e.tolerance??1,this._seeking=!1,this._seekFunction=void 0,this._firstTickAfterSeek=!1}Object.defineProperties(Rb.prototype,{clock:{get:function(){return this._clock},set:function(e){let t=this._clock;t!==e&&(l(t)&&(this._clockSubscription(),this._clockSubscription=void 0),l(e)&&(this._clockSubscription=e.onTick.addEventListener(Rb.prototype._onTick,this)),this._clock=e)}},element:{get:function(){return this._element},set:function(e){let t=this._element;t!==e&&(l(t)&&t.removeEventListener("seeked",this._seekFunction,!1),l(e)&&(this._seeking=!1,this._seekFunction=PYe(this),e.addEventListener("seeked",this._seekFunction,!1)),this._element=e,this._seeking=!1,this._firstTickAfterSeek=!1)}}});Rb.prototype.destroy=function(){return this.element=void 0,this.clock=void 0,ue(this)};Rb.prototype.isDestroyed=function(){return!1};Rb.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};Rb.prototype._onTick=function(e){let t=this._element;if(!l(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 r=e.currentTime,o=this.epoch??Qe.MINIMUM_VALUE,a=K.secondsDifference(r,o),s=t.duration,c,u=t.currentTime;t.loop?(a=a%s,a<0&&(a=s-a),c=a):a>s?c=s:a<0?c=0:c=a;let f=i?this.tolerance??1:.001;Math.abs(c-u)>f&&(this._seeking=!0,t.currentTime=c)};function PYe(e){return function(){e._seeking=!1,e._firstTickAfterSeek=!0}}var Vpe=Rb;var jpe={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};Object.freeze(jpe);var Hpe=jpe;var Gpe={};function DYe(e,t){return I.equalsEpsilon(e.latitude,t.latitude,I.EPSILON10)&&I.equalsEpsilon(e.longitude,t.longitude,I.EPSILON10)}var RYe=new de,OYe=new de;function MYe(e,t,n,i){t=Pr(t,h.equalsEpsilon);let r=t.length;if(r<2)return;let o=l(i),a=l(n),s=new Array(r),c=new Array(r),u=new Array(r),f=t[0];s[0]=f;let d=e.cartesianToCartographic(f,RYe);a&&(d.height=n[0]),c[0]=d.height,o?u[0]=i[0]:u[0]=0;let p=c[0],g=u[0],m=p===g,y=1;for(let A=1;A<r;++A){let b=t[A],x=e.cartesianToCartographic(b,OYe);a&&(x.height=n[A]),m=m&&x.height===0,DYe(d,x)?d.height<x.height&&(c[y-1]=x.height):(s[y]=b,c[y]=x.height,o?u[y]=i[A]:u[y]=0,m=m&&c[y]===u[y],de.clone(x,d),++y)}if(!(m||y<2))return s.length=y,c.length=y,u.length=y,{positions:s,topHeights:c,bottomHeights:u}}var LYe=new Array(2),NYe=new Array(2),FYe={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};Gpe.computePositions=function(e,t,n,i,r,o){let a=MYe(e,t,n,i);if(!l(a))return;t=a.positions,n=a.topHeights,i=a.bottomHeights;let s=t.length,c=s-2,u,f,d=I.chordLength(r,e.maximumRadius),p=FYe;if(p.minDistance=d,p.ellipsoid=e,o){let g=0,m;for(m=0;m<s-1;m++)g+=nr.numberOfPoints(t[m],t[m+1],d)+1;u=new Float64Array(g*3),f=new Float64Array(g*3);let y=LYe,A=NYe;p.positions=y,p.height=A;let b=0;for(m=0;m<s-1;m++){y[0]=t[m],y[1]=t[m+1],A[0]=n[m],A[1]=n[m+1];let x=nr.generateArc(p);u.set(x,b),A[0]=i[m],A[1]=i[m+1],f.set(nr.generateArc(p),b),b+=x.length}}else p.positions=t,p.height=n,u=new Float64Array(nr.generateArc(p)),p.height=i,f=new Float64Array(nr.generateArc(p));return{bottomPositions:f,topPositions:u,numCorners:c}};var gv=Gpe;var e$=new h,yk=new h,BYe=new h,Wpe=new h,kYe=new h,zYe=new h,UYe=new h;function Ob(e){e=e??H.EMPTY_OBJECT;let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,r=e.vertexFormat??Be.DEFAULT,o=e.granularity??I.RADIANS_PER_DEGREE,a=e.ellipsoid??te.default;this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._vertexFormat=Be.clone(r),this._granularity=o,this._ellipsoid=te.clone(a),this._workerName="createWallGeometry";let s=1+t.length*h.packedLength+2;l(i)&&(s+=i.length),l(n)&&(s+=n.length),this.packedLength=s+te.packedLength+Be.packedLength+1}Ob.pack=function(e,t,n){n=n??0;let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=h.packedLength)h.pack(r[i],t,n);let a=e._minimumHeights;if(o=l(a)?a.length:0,t[n++]=o,l(a))for(i=0;i<o;++i)t[n++]=a[i];let s=e._maximumHeights;if(o=l(s)?s.length:0,t[n++]=o,l(s))for(i=0;i<o;++i)t[n++]=s[i];return te.pack(e._ellipsoid,t,n),n+=te.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n]=e._granularity,t};var qpe=te.clone(te.UNIT_SPHERE),Ype=new Be,LP={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:qpe,vertexFormat:Ype,granularity:void 0};Ob.unpack=function(e,t,n){t=t??0;let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=h.packedLength)o[i]=h.unpack(e,t);r=e[t++];let a;if(r>0)for(a=new Array(r),i=0;i<r;++i)a[i]=e[t++];r=e[t++];let s;if(r>0)for(s=new Array(r),i=0;i<r;++i)s[i]=e[t++];let c=te.unpack(e,t,qpe);t+=te.packedLength;let u=Be.unpack(e,t,Ype);t+=Be.packedLength;let f=e[t];return l(n)?(n._positions=o,n._minimumHeights=a,n._maximumHeights=s,n._ellipsoid=te.clone(c,n._ellipsoid),n._vertexFormat=Be.clone(u,n._vertexFormat),n._granularity=f,n):(LP.positions=o,LP.minimumHeights=a,LP.maximumHeights=s,LP.granularity=f,new Ob(LP))};Ob.fromConstantHeights=function(e){e=e??H.EMPTY_OBJECT;let t=e.positions,n,i,r=e.minimumHeight,o=e.maximumHeight,a=l(r),s=l(o);if(a||s){let u=t.length;n=a?new Array(u):void 0,i=s?new Array(u):void 0;for(let f=0;f<u;++f)a&&(n[f]=r),s&&(i[f]=o)}let c={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid,vertexFormat:e.vertexFormat};return new Ob(c)};Ob.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,r=e._vertexFormat,o=e._granularity,a=e._ellipsoid,s=gv.computePositions(a,t,i,n,o,!0);if(!l(s))return;let c=s.bottomPositions,u=s.topPositions,f=s.numCorners,d=u.length,p=d*2,g=r.position?new Float64Array(p):void 0,m=r.normal?new Float32Array(p):void 0,y=r.tangent?new Float32Array(p):void 0,A=r.bitangent?new Float32Array(p):void 0,b=r.st?new Float32Array(p/3*2):void 0,x=0,T=0,C=0,E=0,w=0,D=UYe,R=zYe,M=kYe,N=!0;d/=3;let _,v=0,S=1/(d-f-1);for(_=0;_<d;++_){let z=_*3,j=h.fromArray(u,z,e$),B=h.fromArray(c,z,yk);if(r.position&&(g[x++]=B.x,g[x++]=B.y,g[x++]=B.z,g[x++]=j.x,g[x++]=j.y,g[x++]=j.z),r.st&&(b[w++]=v,b[w++]=0,b[w++]=v,b[w++]=1),r.normal||r.tangent||r.bitangent){let G=h.clone(h.ZERO,Wpe),W=h.subtract(j,a.geodeticSurfaceNormal(j,yk),yk);if(_+1<d&&(G=h.fromArray(u,z+3,Wpe)),N){let Q=h.subtract(G,j,BYe),q=h.subtract(W,j,e$);D=h.normalize(h.cross(q,Q,D),D),N=!1}h.equalsEpsilon(j,G,I.EPSILON10)?N=!0:(v+=S,r.tangent&&(R=h.normalize(h.subtract(G,j,R),R)),r.bitangent&&(M=h.normalize(h.cross(D,R,M),M))),r.normal&&(m[T++]=D.x,m[T++]=D.y,m[T++]=D.z,m[T++]=D.x,m[T++]=D.y,m[T++]=D.z),r.tangent&&(y[E++]=R.x,y[E++]=R.y,y[E++]=R.z,y[E++]=R.x,y[E++]=R.y,y[E++]=R.z),r.bitangent&&(A[C++]=M.x,A[C++]=M.y,A[C++]=M.z,A[C++]=M.x,A[C++]=M.y,A[C++]=M.z)}}let P=new xn;r.position&&(P.position=new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:g})),r.normal&&(P.normal=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:m})),r.tangent&&(P.tangent=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:y})),r.bitangent&&(P.bitangent=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:A})),r.st&&(P.st=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:b}));let L=p/3;p-=6*(f+1);let F=Ve.createTypedArray(L,p),V=0;for(_=0;_<L-2;_+=2){let z=_,j=_+2,B=h.fromArray(g,z*3,e$),G=h.fromArray(g,j*3,yk);if(h.equalsEpsilon(B,G,I.EPSILON10))continue;let W=_+1,Q=_+3;F[V++]=W,F[V++]=z,F[V++]=Q,F[V++]=Q,F[V++]=z,F[V++]=j}return new Tt({attributes:P,indices:F,primitiveType:Re.TRIANGLES,boundingSphere:se.fromVertices(g)})};var Ak=Ob;var Xpe=new h,Kpe=new h;function Mb(e){e=e??H.EMPTY_OBJECT;let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,r=e.granularity??I.RADIANS_PER_DEGREE,o=e.ellipsoid??te.default;this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._granularity=r,this._ellipsoid=te.clone(o),this._workerName="createWallOutlineGeometry";let a=1+t.length*h.packedLength+2;l(i)&&(a+=i.length),l(n)&&(a+=n.length),this.packedLength=a+te.packedLength+1}Mb.pack=function(e,t,n){n=n??0;let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=h.packedLength)h.pack(r[i],t,n);let a=e._minimumHeights;if(o=l(a)?a.length:0,t[n++]=o,l(a))for(i=0;i<o;++i)t[n++]=a[i];let s=e._maximumHeights;if(o=l(s)?s.length:0,t[n++]=o,l(s))for(i=0;i<o;++i)t[n++]=s[i];return te.pack(e._ellipsoid,t,n),n+=te.packedLength,t[n]=e._granularity,t};var $pe=te.clone(te.UNIT_SPHERE),NP={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:$pe,granularity:void 0};Mb.unpack=function(e,t,n){t=t??0;let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=h.packedLength)o[i]=h.unpack(e,t);r=e[t++];let a;if(r>0)for(a=new Array(r),i=0;i<r;++i)a[i]=e[t++];r=e[t++];let s;if(r>0)for(s=new Array(r),i=0;i<r;++i)s[i]=e[t++];let c=te.unpack(e,t,$pe);t+=te.packedLength;let u=e[t];return l(n)?(n._positions=o,n._minimumHeights=a,n._maximumHeights=s,n._ellipsoid=te.clone(c,n._ellipsoid),n._granularity=u,n):(NP.positions=o,NP.minimumHeights=a,NP.maximumHeights=s,NP.granularity=u,new Mb(NP))};Mb.fromConstantHeights=function(e){e=e??H.EMPTY_OBJECT;let t=e.positions,n,i,r=e.minimumHeight,o=e.maximumHeight,a=l(r),s=l(o);if(a||s){let u=t.length;n=a?new Array(u):void 0,i=s?new Array(u):void 0;for(let f=0;f<u;++f)a&&(n[f]=r),s&&(i[f]=o)}let c={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid};return new Mb(c)};Mb.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,r=e._granularity,o=e._ellipsoid,a=gv.computePositions(o,t,i,n,r,!1);if(!l(a))return;let s=a.bottomPositions,c=a.topPositions,u=c.length,f=u*2,d=new Float64Array(f),p=0;u/=3;let g;for(g=0;g<u;++g){let x=g*3,T=h.fromArray(c,x,Xpe),C=h.fromArray(s,x,Kpe);d[p++]=C.x,d[p++]=C.y,d[p++]=C.z,d[p++]=T.x,d[p++]=T.y,d[p++]=T.z}let m=new xn({position:new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:d})}),y=f/3;f=2*y-4+y;let A=Ve.createTypedArray(y,f),b=0;for(g=0;g<y-2;g+=2){let x=g,T=g+2,C=h.fromArray(d,x*3,Xpe),E=h.fromArray(d,T*3,Kpe);if(h.equalsEpsilon(C,E,I.EPSILON10))continue;let w=g+1,D=g+3;A[b++]=w,A[b++]=x,A[b++]=w,A[b++]=D,A[b++]=x,A[b++]=T}return A[b++]=y-2,A[b]=y-1,new Tt({attributes:m,indices:A,primitiveType:Re.LINES,boundingSphere:se.fromVertices(d)})};var bk=Mb;var t$={};function VYe(e){let t=Ve.createTypedArray(e,e*2),n=e,i=0;for(let r=0;r<n;r+=3)t[i++]=r,t[i++]=r+1,t[i++]=r+1,t[i++]=r+2,t[i++]=r+2,t[i++]=r;return t}function jYe(e,t){let n=t.length,i=Ve.createTypedArray(e,n*2),r=0;for(let o=0;o<n;o+=3){let a=t[o],s=t[o+1],c=t[o+2];i[r++]=a,i[r++]=s,i[r++]=s,i[r++]=c,i[r++]=c,i[r++]=a}return i}function HYe(e){let t=e-2,n=2+t*4,i=Ve.createTypedArray(e,n),r=0;i[r++]=0,i[r++]=1;for(let o=0;o<t;o++)i[r++]=o+1,i[r++]=o+2,i[r++]=o+2,i[r++]=o;return i}function GYe(e,t){let i=t.length-2,r=2+i*4,o=Ve.createTypedArray(e,r),a=0;o[a++]=t[0],o[a++]=t[1];for(let s=0;s<i;s++){let c=t[s],u=t[s+1],f=t[s+2];o[a++]=u,o[a++]=f,o[a++]=f,o[a++]=c}return o}function WYe(e){let t=e-2,n=2+t*4,i=Ve.createTypedArray(e,n),r=0;i[r++]=0,i[r++]=1;for(let o=0;o<t;o++)i[r++]=o+1,i[r++]=o+2,i[r++]=o+2,i[r++]=0;return i}function qYe(e,t){let i=t.length-2,r=2+i*4,o=Ve.createTypedArray(e,r),a=0,s=t[0];o[a++]=s,o[a++]=t[1];for(let c=0;c<i;c++){let u=t[c+1],f=t[c+2];o[a++]=u,o[a++]=f,o[a++]=f,o[a++]=s}return o}t$.createWireframeIndices=function(e,t,n){let i=l(n);if(e===Re.TRIANGLES)return i?jYe(t,n):VYe(t);if(e===Re.TRIANGLE_STRIP)return i?GYe(t,n):HYe(t);if(e===Re.TRIANGLE_FAN)return i?qYe(t,n):WYe(t)};t$.getWireframeIndicesCount=function(e,t){return e===Re.TRIANGLES?t*2:e===Re.TRIANGLE_STRIP||e===Re.TRIANGLE_FAN?2+(t-2)*4:t};var FP=t$;function YYe(e,t){let n=document.createElement("canvas");n.width=t,n.height=1;let i=n.getContext("2d"),r=i.createLinearGradient(0,0,n.width,0),o=1/(e.length-1);for(let c=0;c<e.length;c++){let u=e[c],f=c*o,d=u.toCssColorString();r.addColorStop(f,d)}i.fillStyle=r,i.fillRect(0,0,n.width,n.height);let a=i.getImageData(0,0,n.width,n.height);return new Uint8Array(a.data.buffer)}var xk=YYe;function XYe(e){return e=e??H.EMPTY_OBJECT,mC.fromIonAssetId(2426648,{requestVertexNormals:e.requestVertexNormals??!1})}var Tk=XYe;function KYe(e){return e=e??H.EMPTY_OBJECT,mC.fromIonAssetId(1,{requestVertexNormals:e.requestVertexNormals??!1,requestWaterMask:e.requestWaterMask??!1,ellipsoid:te.WGS84})}var _v=KYe;var $Ye=1953029805,JYe=2917034100;function n$(e,t){if(n$.passThroughDataForTesting)return t;let n=e.byteLength;if(n===0||n%4!==0)throw new oe("The length of key must be greater than 0 and a multiple of 4.");let i=new DataView(t),r=i.getUint32(0,!0);if(r===$Ye||r===JYe)return t;let o=new DataView(e),a=0,s=t.byteLength,c=s-s%8,u=n,f,d=8;for(;a<c;)for(d=(d+8)%24,f=d;a<c&&f<u;)i.setUint32(a,i.getUint32(a,!0)^o.getUint32(f,!0),!0),i.setUint32(a+4,i.getUint32(a+4,!0)^o.getUint32(f+4,!0),!0),a+=8,f+=24;if(a<s)for(f>=u&&(d=(d+8)%24,f=d);a<s;)i.setUint8(a,i.getUint8(a)^o.getUint8(f)),a++,f++}n$.passThroughDataForTesting=!1;var Ck=n$;var i$=32767,ZYe=new de,QYe=new h;function eXe(e,t,n,i,r){let o=e.length/3,a=e.subarray(0,o),s=e.subarray(o,2*o),c=e.subarray(2*o,3*o);an.zigZagDeltaDecode(a,s,c);let u=new Float64Array(e.length);for(let f=0;f<o;++f){let d=a[f],p=s[f],g=c[f],m=I.lerp(t.west,t.east,d/i$),y=I.lerp(t.south,t.north,p/i$),A=I.lerp(n,i,g/i$),b=de.fromRadians(m,y,A,ZYe),x=r.cartographicToCartesian(b,QYe);h.pack(x,u,f*3)}return u}var vk=eXe;var Jpe=La(Uu(),1);function tXe(e){let t=new Jpe.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),n}var ty=tXe;function nXe(e,t,n){let i=new Uint8ClampedArray(e.buffer),r=new ImageData(i,t,n),o=document.createElement("canvas");return o.width=t,o.height=n,o.getContext("2d").putImageData(r,0,0),o}var Ek=nXe;var r$=[],o$=[];function iXe(e,t,n,i,r,o){let a=r-i+1,s=o-r,c=r$,u=o$,f,d;for(f=0;f<a;++f)c[f]=e[i+f];for(d=0;d<s;++d)u[d]=e[r+d+1];f=0,d=0;for(let p=i;p<=o;++p){let g=c[f],m=u[d];f<a&&(d>=s||t(g,m,n)<=0)?(e[p]=g,++f):d<s&&(e[p]=m,++d)}}function a$(e,t,n,i,r){if(i>=r)return;let o=Math.floor((i+r)*.5);a$(e,t,n,i,o),a$(e,t,n,o+1,r),iXe(e,t,n,i,o,r)}function rXe(e,t,n){let i=e.length,r=Math.ceil(i*.5);r$.length=r,o$.length=r,a$(e,t,n,0,i-1),r$.length=0,o$.length=0}var U0=rXe;var oXe=new h;function aXe(e,t,n,i){let r=gC(e,t,n,i,oXe);return l(r)?r.x>0&&r.y>0&&r.z>0:!1}var Zpe=aXe;async function sXe(e,t,n,i){return l(i)||(i=!1),uXe(e,t,n,i)}function cXe(e,t,n){let i=e[0],r=i.terrainProvider.requestTileGeometry(i.x,i.y,i.level);if(!r)return!1;let o;return n?o=r.then(e0e(i)):o=r.then(e0e(i)).catch(fXe(i)),e.shift(),t.push(o),!0}function lXe(e){return new Promise(function(t){setTimeout(t,e)})}function s$(e,t,n){return e.length?cXe(e,t,n)?s$(e,t,n):lXe(100).then(()=>s$(e,t,n)):Promise.resolve()}function uXe(e,t,n,i){let r=e.tilingScheme,o,a=[],s={};for(o=0;o<n.length;++o){let u=r.positionToTileXY(n[o],t);if(!l(u))continue;let f=u.toString();if(!s.hasOwnProperty(f)){let d={x:u.x,y:u.y,level:t,tilingScheme:r,terrainProvider:e,positions:[]};s[f]=d,a.push(d)}s[f].positions.push(n[o])}let c=[];return s$(a,c,i).then(function(){return Promise.all(c).then(function(){return n})})}function Qpe(e,t,n){let i=t.interpolateHeight(n,e.longitude,e.latitude);return i===void 0?!1:(e.height=i,!0)}function e0e(e){let t=e.positions,n=e.tilingScheme.tileXYToRectangle(e.x,e.y,e.level);return function(i){let r=!1;for(let o=0;o<t.length;++o){let a=t[o];if(!Qpe(a,i,n)){r=!0;break}}return r?i.createMesh({tilingScheme:e.tilingScheme,x:e.x,y:e.y,level:e.level,throttle:!1}).then(function(){for(let o=0;o<t.length;++o){let a=t[o];Qpe(a,i,n)}}):Promise.resolve()}}function fXe(e){let t=e.positions;return function(){for(let n=0;n<t.length;++n){let i=t[n];i.height=void 0}}}var Sk=sXe;var c$=new k;async function t0e(e,t,n){l(n)||(n=!1);let i=[],r=[],o=e.availability,a=[];for(let c=0;c<t.length;++c){let u=t[c],f=o.computeMaximumLevelAtPosition(u);if(r[c]=f,f===0){e.tilingScheme.positionToTileXY(u,1,c$);let p=e.loadTileDataAvailability(c$.x,c$.y,1);l(p)&&a.push(p)}let d=i[f];l(d)||(i[f]=d=[]),d.push(u)}await Promise.all(a),await Promise.all(i.map(function(c,u){if(l(c))return Sk(e,u,c,n)}));let s=[];for(let c=0;c<t.length;++c){let u=t[c];o.computeMaximumLevelAtPosition(u)!==r[c]&&s.push(u)}return s.length>0&&await t0e(e,s,n),t}var yv=t0e;function dXe(e){return e<=.04045?e*.07739938080495357:Math.pow((e+.055)*.9478672985781991,2.4)}var Av=dXe;function hXe(e,t){let n=[],i=e.length,r=0;for(;r<i;){let o=Math.ceil((i-r)/t--);n.push(e.slice(r,r+o)),r+=o}return n}var wk=hXe;function mXe(e){switch(e){case ee.FLOAT:return"float";case ee.FLOAT_VEC2:return"vec2";case ee.FLOAT_VEC3:return"vec3";case ee.FLOAT_VEC4:return"vec4";case ee.FLOAT_MAT2:return"mat2";case ee.FLOAT_MAT3:return"mat3";case ee.FLOAT_MAT4:return"mat4";case ee.SAMPLER_2D:return"sampler2D";case ee.BOOL:return"bool"}}var n0e=mXe;function pXe(e,t,n){return function(){n.apply(e,arguments),t.apply(e,arguments)}}var Ik=pXe;function Pk(e){e=e??H.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}Pk.ALL=Object.freeze(new Pk({color:new U(0,0,0,0),depth:1,stencil:0}));Pk.prototype.execute=function(e,t){e.clear(this,t)};var ui=Pk;function i0e(e){e=e??H.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=Pe.COMPUTE,this.owner=e.owner}i0e.prototype.execute=function(e){e.execute(this)};var lu=i0e;var bv=`in vec4 position;
|
|
in vec2 textureCoordinates;
|
|
|
|
out vec2 v_textureCoordinates;
|
|
|
|
void main()
|
|
{
|
|
gl_Position = position;
|
|
v_textureCoordinates = textureCoordinates;
|
|
}
|
|
`;function l$(e,t,n){let i=e._gl;i.framebufferTexture2D(i.FRAMEBUFFER,t,n._target,n._texture,0)}function Dk(e,t,n){let i=e._gl;i.framebufferRenderbuffer(i.FRAMEBUFFER,t,i.RENDERBUFFER,n._getRenderbuffer())}function Ah(e){e=e??H.EMPTY_OBJECT;let t=e.context,n=t._gl,i=Ft.maximumColorAttachments;if(this._gl=n,this._framebuffer=n.createFramebuffer(),this._colorTextures=[],this._colorRenderbuffers=[],this._activeColorAttachments=[],this._depthTexture=void 0,this._depthRenderbuffer=void 0,this._stencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this.destroyAttachments=e.destroyAttachments??!0,this._bind(),l(e.colorTextures)){let r=e.colorTextures,o=this._colorTextures.length=this._activeColorAttachments.length=r.length;for(let a=0;a<o;++a){let s=r[a],c=this._gl.COLOR_ATTACHMENT0+a;l$(this,c,s),this._activeColorAttachments[a]=c,this._colorTextures[a]=s}}if(l(e.colorRenderbuffers)){let r=e.colorRenderbuffers,o=this._colorRenderbuffers.length=this._activeColorAttachments.length=r.length;for(let a=0;a<o;++a){let s=r[a],c=this._gl.COLOR_ATTACHMENT0+a;Dk(this,c,s),this._activeColorAttachments[a]=c,this._colorRenderbuffers[a]=s}}if(l(e.depthTexture)){let r=e.depthTexture;l$(this,this._gl.DEPTH_ATTACHMENT,r),this._depthTexture=r}if(l(e.depthRenderbuffer)){let r=e.depthRenderbuffer;Dk(this,this._gl.DEPTH_ATTACHMENT,r),this._depthRenderbuffer=r}if(l(e.stencilRenderbuffer)){let r=e.stencilRenderbuffer;Dk(this,this._gl.STENCIL_ATTACHMENT,r),this._stencilRenderbuffer=r}if(l(e.depthStencilTexture)){let r=e.depthStencilTexture;l$(this,this._gl.DEPTH_STENCIL_ATTACHMENT,r),this._depthStencilTexture=r}if(l(e.depthStencilRenderbuffer)){let r=e.depthStencilRenderbuffer;Dk(this,this._gl.DEPTH_STENCIL_ATTACHMENT,r),this._depthStencilRenderbuffer=r}this._unBind(),t._currentFramebuffer=void 0}Object.defineProperties(Ah.prototype,{status:{get:function(){this._bind();let e=this._gl.checkFramebufferStatus(this._gl.FRAMEBUFFER);return this._unBind(),e}},numberOfColorAttachments:{get:function(){return this._activeColorAttachments.length}},depthTexture:{get:function(){return this._depthTexture}},depthRenderbuffer:{get:function(){return this._depthRenderbuffer}},stencilRenderbuffer:{get:function(){return this._stencilRenderbuffer}},depthStencilTexture:{get:function(){return this._depthStencilTexture}},depthStencilRenderbuffer:{get:function(){return this._depthStencilRenderbuffer}},hasDepthAttachment:{get:function(){return!!(this.depthTexture||this.depthRenderbuffer||this.depthStencilTexture||this.depthStencilRenderbuffer)}}});Ah.prototype._bind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,this._framebuffer)};Ah.prototype._unBind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,null)};Ah.prototype.bindDraw=function(){let e=this._gl;e.bindFramebuffer(e.DRAW_FRAMEBUFFER,this._framebuffer)};Ah.prototype.bindRead=function(){let e=this._gl;e.bindFramebuffer(e.READ_FRAMEBUFFER,this._framebuffer)};Ah.prototype._getActiveColorAttachments=function(){return this._activeColorAttachments};Ah.prototype.getColorTexture=function(e){return this._colorTextures[e]};Ah.prototype.getColorRenderbuffer=function(e){return this._colorRenderbuffers[e]};Ah.prototype.isDestroyed=function(){return!1};Ah.prototype.destroy=function(){if(this.destroyAttachments){let e=this._colorTextures;for(let n=0;n<e.length;++n){let i=e[n];l(i)&&i.destroy()}let t=this._colorRenderbuffers;for(let n=0;n<t.length;++n){let i=t[n];l(i)&&i.destroy()}this._depthTexture=this._depthTexture&&this._depthTexture.destroy(),this._depthRenderbuffer=this._depthRenderbuffer&&this._depthRenderbuffer.destroy(),this._stencilRenderbuffer=this._stencilRenderbuffer&&this._stencilRenderbuffer.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy()}return this._gl.deleteFramebuffer(this._framebuffer),ue(this)};var Ta=Ah;function Rk(e){this._context=e}var BP,gXe=new nt({primitiveType:Re.TRIANGLES}),_Xe=new ui({color:new U(0,0,0,0)});function yXe(e,t){return new Ta({context:e,colorTextures:[t],destroyAttachments:!1})}function AXe(e,t){return Zt.fromCache({context:e,vertexShaderSource:bv,fragmentShaderSource:t,attributeLocations:{position:0,textureCoordinates:1}})}function bXe(e,t){return(!l(BP)||BP.viewport.width!==e||BP.viewport.height!==t)&&(BP=je.fromCache({viewport:new Je(0,0,e,t)})),BP}Rk.prototype.execute=function(e){l(e.preExecute)&&e.preExecute(e);let t=e.outputTexture,n=t.width,i=t.height,r=this._context,o=l(e.vertexArray)?e.vertexArray:r.getViewportQuadVertexArray(),a=l(e.shaderProgram)?e.shaderProgram:AXe(r,e.fragmentShaderSource),s=yXe(r,t),c=bXe(n,i),u=e.uniformMap,f=_Xe;f.framebuffer=s,f.renderState=c,f.execute(r);let d=gXe;d.vertexArray=o,d.renderState=c,d.shaderProgram=a,d.uniformMap=u,d.framebuffer=s,d.execute(r),s.destroy(),e.persists||(a.destroy(),l(e.vertexArray)&&o.destroy()),l(e.postExecute)&&e.postExecute(t)};Rk.prototype.isDestroyed=function(){return!1};Rk.prototype.destroy=function(){return ue(this)};var Ok=Rk;function kP(e,t,n,i,r,o,a,s,c,u,f){this._context=e,this._texture=t,this._textureTarget=n,this._targetFace=i,this._pixelDatatype=a,this._internalFormat=r,this._pixelFormat=o,this._size=s,this._preMultiplyAlpha=c,this._flipY=u,this._initialized=f}Object.defineProperties(kP.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}});kP.prototype.copyFrom=function(e){let{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:r=!1}=e,{width:o,height:a}=i,s=this._context._gl,c=this._textureTarget,u=this._targetFace;s.activeTexture(s.TEXTURE0),s.bindTexture(c,this._texture);let f=i.arrayBufferView,d=this._size,p=this._pixelFormat,g=this._internalFormat,m=this._pixelDatatype,y=this._preMultiplyAlpha,A=this._flipY,b=4;l(f)&&(b=He.alignmentInBytes(p,m,o)),s.pixelStorei(s.UNPACK_ALIGNMENT,b),r?s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,s.NONE):s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,s.BROWSER_DEFAULT_WEBGL);let x=!1;if(!this._initialized){let T;t===0&&n===0&&o===d&&a===d?(l(f)?(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!1),A&&(f=He.flipY(f,p,m,d,d)),T=f):(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,y),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,A),T=i),x=!0):(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!1),T=He.createTypedArray(p,m,d,d)),s.texImage2D(u,0,g,d,d,0,p,ke.toWebGLConstant(m,this._context),T),this._initialized=!0}x||(l(f)?(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!1),A&&(f=He.flipY(f,p,m,o,a)),s.texSubImage2D(u,0,t,n,o,a,p,ke.toWebGLConstant(m,this._context),f)):(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,y),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,A),s.texSubImage2D(u,0,t,n,p,ke.toWebGLConstant(m,this._context),i))),s.bindTexture(c,null)};kP.prototype.copyFromFramebuffer=function(e,t,n,i,r,o){e=e??0,t=t??0,n=n??0,i=i??0,r=r??this._size,o=o??this._size;let a=this._context._gl,s=this._textureTarget;a.activeTexture(a.TEXTURE0),a.bindTexture(s,this._texture),a.copyTexSubImage2D(this._targetFace,0,e,t,n,i,r,o),a.bindTexture(s,null),this._initialized=!0};kP.prototype.copyMipmapFromFramebuffer=function(e,t,n,i,r){e=e??0,t=t??0,n=n??this._size,i=i??this._size,r=r??0;let o=this._context._gl,a=this._textureTarget;o.activeTexture(o.TEXTURE0),o.bindTexture(a,this._texture),o.copyTexImage2D(this._targetFace,r,this._internalFormat,e,t,n,i,0),o.bindTexture(a,null),this._initialized=!0};var Mk=kP;function yo(e){e=e??H.EMPTY_OBJECT;let{context:t,source:n,pixelFormat:i=He.RGBA,pixelDatatype:r=ke.UNSIGNED_BYTE,flipY:o=!0,skipColorSpaceConversion:a=!1,sampler:s=new Ut}=e,c=e.preMultiplyAlpha||i===He.RGB||i===He.LUMINANCE,{width:u,height:f}=e;l(n)&&({width:u,height:f}=n.positiveX);let d=u,p=He.textureSizeInBytes(i,r,d,d)*6,g=He.toInternalFormat(i,r,t),m=t._gl,y=m.TEXTURE_CUBE_MAP,A=m.createTexture();this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=y,this._texture=A,this._pixelFormat=i,this._pixelDatatype=r,this._size=d,this._hasMipmap=!1,this._sizeInBytes=p,this._preMultiplyAlpha=c,this._flipY=o;let b=l(n);function x(T){return new Mk(t,A,y,T,g,i,r,d,c,o,b)}this._positiveX=x(m.TEXTURE_CUBE_MAP_POSITIVE_X),this._negativeX=x(m.TEXTURE_CUBE_MAP_NEGATIVE_X),this._positiveY=x(m.TEXTURE_CUBE_MAP_POSITIVE_Y),this._negativeY=x(m.TEXTURE_CUBE_MAP_NEGATIVE_Y),this._positiveZ=x(m.TEXTURE_CUBE_MAP_POSITIVE_Z),this._negativeZ=x(m.TEXTURE_CUBE_MAP_NEGATIVE_Z),this._sampler=s,r0e(this,s),m.activeTexture(m.TEXTURE0),m.bindTexture(y,A),a?m.pixelStorei(m.UNPACK_COLORSPACE_CONVERSION_WEBGL,m.NONE):m.pixelStorei(m.UNPACK_COLORSPACE_CONVERSION_WEBGL,m.BROWSER_DEFAULT_WEBGL);for(let T of yo.faceNames())u$(this[T],n?.[T],0);m.bindTexture(y,null)}yo.prototype.copyFace=function(e,t,n,i){let r=e.context,o=new Ta({context:r,colorTextures:[t],destroyAttachments:!1});o._bind(),this[n].copyMipmapFromFramebuffer(0,0,t.width,t.height,i??0),o._unBind(),o.destroy()};yo.FaceName=Object.freeze({POSITIVEX:"positiveX",NEGATIVEX:"negativeX",POSITIVEY:"positiveY",NEGATIVEY:"negativeY",POSITIVEZ:"positiveZ",NEGATIVEZ:"negativeZ"});function*xXe(){yield yo.FaceName.POSITIVEX,yield yo.FaceName.NEGATIVEX,yield yo.FaceName.POSITIVEY,yield yo.FaceName.NEGATIVEY,yield yo.FaceName.POSITIVEZ,yield yo.FaceName.NEGATIVEZ}yo.faceNames=function(){return xXe()};function u$(e,t,n){n=n??0;let i=e._targetFace,r=Math.max(Math.floor(e._size/2**n),1),o=e._pixelFormat,a=e._pixelDatatype,s=e._internalFormat,c=e._flipY,u=e._preMultiplyAlpha,f=e._context,d=f._gl;if(!l(t)){d.texImage2D(i,n,s,r,r,0,o,ke.toWebGLConstant(a,f),null);return}let{arrayBufferView:p}=t,g=4;l(p)&&(g=He.alignmentInBytes(o,a,r)),d.pixelStorei(d.UNPACK_ALIGNMENT,g),l(p)?(d.pixelStorei(d.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),d.pixelStorei(d.UNPACK_FLIP_Y_WEBGL,!1),c&&(p=He.flipY(p,o,a,r,r)),d.texImage2D(i,n,s,r,r,0,o,ke.toWebGLConstant(a,f),p)):(d.pixelStorei(d.UNPACK_PREMULTIPLY_ALPHA_WEBGL,u),d.pixelStorei(d.UNPACK_FLIP_Y_WEBGL,c),d.texImage2D(i,n,s,o,ke.toWebGLConstant(a,f),t))}yo.loadFace=u$;Object.defineProperties(yo.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){r0e(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}}});yo.getDirection=function(e,t){switch(e){case yo.FaceName.POSITIVEX:return h.clone(h.UNIT_X,t);case yo.FaceName.NEGATIVEX:return h.negate(h.UNIT_X,t);case yo.FaceName.POSITIVEY:return h.clone(h.UNIT_Y,t);case yo.FaceName.NEGATIVEY:return h.negate(h.UNIT_Y,t);case yo.FaceName.POSITIVEZ:return h.clone(h.UNIT_Z,t);case yo.FaceName.NEGATIVEZ:return h.negate(h.UNIT_Z,t)}};function r0e(e,t){let{minificationFilter:n,magnificationFilter:i}=t,r=[Gt.NEAREST_MIPMAP_NEAREST,Gt.NEAREST_MIPMAP_LINEAR,Gt.LINEAR_MIPMAP_NEAREST,Gt.LINEAR_MIPMAP_LINEAR].includes(n),o=e._context,a=e._pixelDatatype;(a===ke.FLOAT&&!o.textureFloatLinear||a===ke.HALF_FLOAT&&!o.textureHalfFloatLinear)&&(n=r?Gt.NEAREST_MIPMAP_NEAREST:Gt.NEAREST,i=ni.NEAREST);let s=o._gl,c=e._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(c,e._texture),s.texParameteri(c,s.TEXTURE_MIN_FILTER,n),s.texParameteri(c,s.TEXTURE_MAG_FILTER,i),s.texParameteri(c,s.TEXTURE_WRAP_S,t.wrapS),s.texParameteri(c,s.TEXTURE_WRAP_T,t.wrapT),l(e._textureFilterAnisotropic)&&s.texParameteri(c,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),s.bindTexture(c,null)}yo.prototype.loadMipmaps=function(e,t){t=t??!1;let n=this._context._gl,i=this._texture,r=this._textureTarget;n.activeTexture(n.TEXTURE0),n.bindTexture(r,i),t?n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,n.NONE):n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,n.BROWSER_DEFAULT_WEBGL);for(let o=0;o<e.length;o++){let a=e[o],s=o+1;for(let c of yo.faceNames())u$(this[c],a[c],s)}n.bindTexture(r,null),this._hasMipmap=!0};yo.prototype.generateMipmap=function(e){e=e??sh.DONT_CARE,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)};yo.createVertexArray=function(e){let t=Nc.createGeometry(Nc.fromDimensions({dimensions:new h(2,2,2),vertexFormat:Be.POSITION_ONLY})),n=this._attributeLocations=Gn.createAttributeLocations(t);return Vn.fromGeometry({context:e,geometry:t,attributeLocations:n,bufferUsage:Oe.STATIC_DRAW})};yo.prototype.isDestroyed=function(){return!1};yo.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),this._positiveX=ue(this._positiveX),this._negativeX=ue(this._negativeX),this._positiveY=ue(this._positiveY),this._negativeY=ue(this._negativeY),this._positiveZ=ue(this._positiveZ),this._negativeZ=ue(this._negativeZ),ue(this)};var aa=yo;function TXe(e){this.context=e,this.framebuffer=void 0,this.blendingEnabled=void 0,this.scissorTest=void 0,this.viewport=void 0}var _c=TXe;var f$=class{constructor(t,n,i){this._pickObjects=t,this.key=n,this.color=i}get object(){return this._pickObjects.get(this.key)}set object(t){this._pickObjects.set(this.key,t)}destroy(){this._pickObjects.delete(this.key)}},Lk=f$;function bh(e){this._context=e,this._shaders={},this._numberOfShaders=0,this._shadersToRelease={}}Object.defineProperties(bh.prototype,{numberOfShaders:{get:function(){return this._numberOfShaders}}});bh.prototype.replaceShaderProgram=function(e){return l(e.shaderProgram)&&e.shaderProgram.destroy(),this.getShaderProgram(e)};function CXe(e){let t=Object.keys(e).sort();return JSON.stringify(e,t)}bh.prototype.getShaderProgram=function(e){let t=e.vertexShaderSource,n=e.fragmentShaderSource,i=e.attributeLocations;typeof t=="string"&&(t=new Ge({sources:[t]})),typeof n=="string"&&(n=new Ge({sources:[n]}));let r=t.getCacheKey(),o=n.getCacheKey(),a=l(i)?CXe(i):"",s=`${r}:${o}:${a}`,c;if(l(this._shaders[s]))c=this._shaders[s],delete this._shadersToRelease[s];else{let u=this._context,f=t.createCombinedVertexShader(u),d=n.createCombinedFragmentShader(u),p=new Zt({gl:u._gl,logShaderCompilation:u.logShaderCompilation,debugShaders:u.debugShaders,vertexShaderSource:t,vertexShaderText:f,fragmentShaderSource:n,fragmentShaderText:d,attributeLocations:i});c={cache:this,shaderProgram:p,keyword:s,derivedKeywords:[],count:0},p._cachedShader=c,this._shaders[s]=c,++this._numberOfShaders}return++c.count,c.shaderProgram};bh.prototype.replaceDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,r=t+i.keyword,o=this._shaders[r];if(l(o)){d$(this,o);let a=i.derivedKeywords.indexOf(t);a>-1&&i.derivedKeywords.splice(a,1)}return this.createDerivedShaderProgram(e,t,n)};bh.prototype.getDerivedShaderProgram=function(e,t){let n=e._cachedShader,i=t+n.keyword,r=this._shaders[i];if(l(r))return r.shaderProgram};bh.prototype.createDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,r=t+i.keyword,o=n.vertexShaderSource,a=n.fragmentShaderSource,s=n.attributeLocations;typeof o=="string"&&(o=new Ge({sources:[o]})),typeof a=="string"&&(a=new Ge({sources:[a]}));let c=this._context,u=o.createCombinedVertexShader(c),f=a.createCombinedFragmentShader(c),d=new Zt({gl:c._gl,logShaderCompilation:c.logShaderCompilation,debugShaders:c.debugShaders,vertexShaderSource:o,vertexShaderText:u,fragmentShaderSource:a,fragmentShaderText:f,attributeLocations:s}),p={cache:this,shaderProgram:d,keyword:r,derivedKeywords:[],count:0};return i.derivedKeywords.push(t),d._cachedShader=p,this._shaders[r]=p,d};function d$(e,t){let n=t.derivedKeywords,i=n.length;for(let r=0;r<i;++r){let o=n[r]+t.keyword,a=e._shaders[o];d$(e,a)}delete e._shaders[t.keyword],t.shaderProgram.finalDestroy()}bh.prototype.destroyReleasedShaderPrograms=function(){let e=this._shadersToRelease;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];d$(this,n),--this._numberOfShaders}this._shadersToRelease={}};bh.prototype.releaseShaderProgram=function(e){if(l(e)){let t=e._cachedShader;t&&--t.count===0&&(this._shadersToRelease[t.keyword]=t)}};bh.prototype.isDestroyed=function(){return!1};bh.prototype.destroy=function(){let e=this._shaders;for(let t in e)e.hasOwnProperty(t)&&e[t].shaderProgram.finalDestroy();return ue(this)};var Nk=bh;function Lb(){this._textures={},this._numberOfTextures=0,this._texturesToRelease={}}Object.defineProperties(Lb.prototype,{numberOfTextures:{get:function(){return this._numberOfTextures}}});Lb.prototype.getTexture=function(e){let t=this._textures[e];if(l(t))return delete this._texturesToRelease[e],++t.count,t.texture};Lb.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};Lb.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={}};Lb.prototype.isDestroyed=function(){return!1};Lb.prototype.destroy=function(){let e=this._textures;for(let t in e)e.hasOwnProperty(t)&&e[t].texture.finalDestroy();return ue(this)};var Fk=Lb;function vXe(e){e=e??H.EMPTY_OBJECT,this.color=U.clone(e.color??U.WHITE),this.intensity=e.intensity??2}var ny=vXe;function xv(){this.globeDepthTexture=void 0,this.edgeIdTexture=void 0,this.edgeColorTexture=void 0,this.edgeDepthTexture=void 0,this.planarFillIdTexture=void 0,this.gamma=void 0,this._viewport=new Je,this._viewportCartesian4=new ae,this._viewportDirty=!1,this._viewportOrthographicMatrix=O.clone(O.IDENTITY),this._viewportTransformation=O.clone(O.IDENTITY),this._model=O.clone(O.IDENTITY),this._view=O.clone(O.IDENTITY),this._inverseView=O.clone(O.IDENTITY),this._projection=O.clone(O.IDENTITY),this._infiniteProjection=O.clone(O.IDENTITY),this._entireFrustum=new k,this._currentFrustum=new k,this._frustumPlanes=new ae,this._farDepthFromNearPlusOne=void 0,this._log2FarDepthFromNearPlusOne=void 0,this._oneOverLog2FarDepthFromNearPlusOne=void 0,this._frameState=void 0,this._temeToPseudoFixed=$.clone(O.IDENTITY),this._view3DDirty=!0,this._view3D=new O,this._inverseView3DDirty=!0,this._inverseView3D=new O,this._inverseModelDirty=!0,this._inverseModel=new O,this._inverseTransposeModelDirty=!0,this._inverseTransposeModel=new $,this._viewRotation=new $,this._inverseViewRotation=new $,this._viewRotation3D=new $,this._inverseViewRotation3D=new $,this._inverseProjectionDirty=!0,this._inverseProjection=new O,this._modelViewDirty=!0,this._modelView=new O,this._modelView3DDirty=!0,this._modelView3D=new O,this._modelViewRelativeToEyeDirty=!0,this._modelViewRelativeToEye=new O,this._inverseModelViewDirty=!0,this._inverseModelView=new O,this._inverseModelView3DDirty=!0,this._inverseModelView3D=new O,this._viewProjectionDirty=!0,this._viewProjection=new O,this._inverseViewProjectionDirty=!0,this._inverseViewProjection=new O,this._modelViewProjectionDirty=!0,this._modelViewProjection=new O,this._inverseModelViewProjectionDirty=!0,this._inverseModelViewProjection=new O,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewProjectionRelativeToEye=new O,this._modelViewInfiniteProjectionDirty=!0,this._modelViewInfiniteProjection=new O,this._normalDirty=!0,this._normal=new $,this._normal3DDirty=!0,this._normal3D=new $,this._inverseNormalDirty=!0,this._inverseNormal=new $,this._inverseNormal3DDirty=!0,this._inverseNormal3D=new $,this._encodedCameraPositionMCDirty=!0,this._encodedCameraPositionMC=new Sn,this._cameraPosition=new h,this._sunPositionWC=new h,this._sunPositionColumbusView=new h,this._sunDirectionWC=new h,this._sunDirectionEC=new h,this._moonDirectionEC=new h,this._lightDirectionWC=new h,this._lightDirectionEC=new h,this._lightColor=new h,this._lightColorHdr=new h,this._pass=void 0,this._mode=void 0,this._mapProjection=void 0,this._ellipsoid=void 0,this._cameraDirection=new h,this._cameraRight=new h,this._cameraUp=new h,this._frustum2DWidth=0,this._eyeHeight=0,this._eyeHeight2D=new k,this._eyeEllipsoidNormalEC=new h,this._eyeEllipsoidCurvature=new k,this._modelToEnu=new O,this._enuToModel=new O,this._pixelRatio=1,this._orthographicIn3D=!1,this._backgroundColor=new U,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 h,this._atmosphereRayleighScaleHeight=new h,this._atmosphereMieCoefficient=new h,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(xv.prototype,{frameState:{get:function(){return this._frameState}},viewport:{get:function(){return this._viewport},set:function(e){if(!Je.equals(e,this._viewport)){Je.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 a0e(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return a0e(this),this._viewportTransformation}},model:{get:function(){return this._model},set:function(e){O.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,O.inverse(this._model,this._inverseModel)),this._inverseModel}},inverseTransposeModel:{get:function(){let e=this._inverseTransposeModel;return this._inverseTransposeModelDirty&&(this._inverseTransposeModelDirty=!1,O.getMatrix3(this.inverseModel,e),$.transpose(e,e)),e}},view:{get:function(){return this._view}},view3D:{get:function(){return m$(this),this._view3D}},viewRotation:{get:function(){return m$(this),this._viewRotation}},viewRotation3D:{get:function(){return m$(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return l0e(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return l0e(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return NXe(this),this._inverseProjection}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return FXe(this),this._modelView}},modelView3D:{get:function(){return BXe(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return HXe(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return kXe(this),this._inverseModelView}},inverseModelView3D:{get:function(){return zXe(this),this._inverseModelView3D}},viewProjection:{get:function(){return UXe(this),this._viewProjection}},inverseViewProjection:{get:function(){return VXe(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return jXe(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return GXe(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return WXe(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return qXe(this),this._modelViewInfiniteProjection}},normal:{get:function(){return YXe(this),this._normal}},normal3D:{get:function(){return XXe(this),this._normal3D}},inverseNormal:{get:function(){return KXe(this),this._inverseNormal}},inverseNormal3D:{get:function(){return $Xe(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 c0e(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return c0e(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??te.default}}});function EXe(e,t){O.clone(t,e._view),O.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 SXe(e,t){O.clone(t,e._inverseView),O.getMatrix3(t,e._inverseViewRotation)}function wXe(e,t){O.clone(t,e._projection),e._inverseProjectionDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function IXe(e,t){O.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}var o0e=new h,PXe=new O;function DXe(e,t){h.clone(t.positionWC,e._cameraPosition),h.clone(t.directionWC,e._cameraDirection),h.clone(t.rightWC,e._cameraRight),h.clone(t.upWC,e._cameraUp);let n=e._ellipsoid,i,r=t.positionCartographic;if(l(r)?(e._eyeHeight=r.height,e._eyeEllipsoidNormalEC=n.geodeticSurfaceNormalCartographic(r,e._eyeEllipsoidNormalEC),i=h.fromRadians(r.longitude,r.latitude,0,n,o0e)):(e._eyeHeight=-n.maximumRadius,h.magnitude(t.positionWC)>0&&(e._eyeEllipsoidNormalEC=h.normalize(t.positionWC,e._eyeEllipsoidNormalEC)),i=n.scaleToGeodeticSurface(t.positionWC,o0e)),e._encodedCameraPositionMCDirty=!0,!l(i))return;e._eyeEllipsoidNormalEC=$.multiplyByVector(e._viewRotation,e._eyeEllipsoidNormalEC,e._eyeEllipsoidNormalEC);let o=mt.eastNorthUpToFixedFrame(i,n,PXe);e._enuToModel=O.multiplyTransformation(e.inverseModel,o,e._enuToModel),e._modelToEnu=O.inverseTransformation(e._enuToModel,e._modelToEnu),I.equalsEpsilon(n._radii.x,n._radii.y,I.EPSILON15)&&(e._eyeEllipsoidCurvature=n.getLocalCurvature(i,e._eyeEllipsoidCurvature))}var h$=new $,RXe=new de;function OXe(e,t){mt.computeIcrfToCentralBodyFixedMatrix(t.time,h$);let n=Sb.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);$.multiplyByVector(h$,n,n),h.normalize(n,e._sunDirectionWC),n=$.multiplyByVector(e.viewRotation3D,n,e._sunDirectionEC),h.normalize(n,n),n=Sb.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),$.multiplyByVector(h$,n,n),$.multiplyByVector(e.viewRotation3D,n,n),h.normalize(n,n);let i=t.mapProjection,o=i.ellipsoid.cartesianToCartographic(e._sunPositionWC,RXe);i.project(o,e._sunPositionColumbusView)}xv.prototype.updateCamera=function(e){EXe(this,e.viewMatrix),SXe(this,e.inverseViewMatrix),DXe(this,e),this._entireFrustum.x=e.frustum.near,this._entireFrustum.y=e.frustum.far,this.updateFrustum(e.frustum),this._orthographicIn3D=this._mode!==re.SCENE2D&&e.frustum instanceof pn};xv.prototype.updateFrustum=function(e){wXe(this,e.projectionMatrix),l(e.infiniteProjectionMatrix)&&IXe(this,e.infiniteProjectionMatrix),this._currentFrustum.x=e.near,this._currentFrustum.y=e.far,this._farDepthFromNearPlusOne=e.far-e.near+1,this._log2FarDepthFromNearPlusOne=I.log2(this._farDepthFromNearPlusOne),this._oneOverLog2FarDepthFromNearPlusOne=1/this._log2FarDepthFromNearPlusOne;let t=e.offCenterFrustum;l(t)&&(e=t),this._frustumPlanes.x=e.top,this._frustumPlanes.y=e.bottom,this._frustumPlanes.z=e.left,this._frustumPlanes.w=e.right};xv.prototype.updatePass=function(e){this._pass=e};var MXe=[],LXe=new ny;xv.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===re.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),OXe(this,e);let n=e.light??LXe;n instanceof ny?(this._lightDirectionWC=h.clone(this._sunDirectionWC,this._lightDirectionWC),this._lightDirectionEC=h.clone(this._sunDirectionEC,this._lightDirectionEC)):(this._lightDirectionWC=h.normalize(h.negate(n.direction,this._lightDirectionWC),this._lightDirectionWC),this._lightDirectionEC=$.multiplyByVector(this.viewRotation3D,this._lightDirectionWC,this._lightDirectionEC));let i=n.color,r=h.fromElements(i.red,i.green,i.blue,this._lightColorHdr);r=h.multiplyByScalar(r,n.intensity,r);let o=h.maximumComponent(r);o>1?h.divideByScalar(r,o,this._lightColor):h.clone(r,this._lightColor);let a=e.brdfLutGenerator,s=l(a)?a.colorTexture:void 0;this._brdfLut=s,this._environmentMap=e.environmentMap??e.context.defaultCubeMap,this._sphericalHarmonicCoefficients=e.sphericalHarmonicCoefficients??MXe,this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentMapsMaximumLOD=e.specularEnvironmentMapsMaximumLOD,this._fogDensity=e.fog.density,this._fogVisualDensityScalar=e.fog.visualDensityScalar,this._fogMinimumBrightness=e.fog.minimumBrightness;let c=e.atmosphere;l(c)&&(this._atmosphereHsbShift=h.fromElements(c.hueShift,c.saturationShift,c.brightnessShift,this._atmosphereHsbShift),this._atmosphereLightIntensity=c.lightIntensity,this._atmosphereRayleighCoefficient=h.clone(c.rayleighCoefficient,this._atmosphereRayleighCoefficient),this._atmosphereRayleighScaleHeight=c.rayleighScaleHeight,this._atmosphereMieCoefficient=h.clone(c.mieCoefficient,this._atmosphereMieCoefficient),this._atmosphereMieScaleHeight=c.mieScaleHeight,this._atmosphereMieAnisotropy=c.mieAnisotropy,this._atmosphereDynamicLighting=c.dynamicLighting),this._invertClassificationColor=e.invertClassificationColor,this._frameState=e,this._temeToPseudoFixed=mt.computeTemeToPseudoFixedMatrix(e.time,this._temeToPseudoFixed),this._splitPosition=e.splitPosition*e.context.drawingBufferWidth;let u=t.frustum.fov,f=this._viewport,d;l(u)?f.height>f.width?d=Math.tan(.5*u)*2/f.height:d=Math.tan(.5*u)*2/f.width:d=1/Math.max(f.width,f.height),this._geometricToleranceOverMeter=d*e.maximumScreenSpaceError,U.clone(e.backgroundColor,this._backgroundColor),this._minimumDisableDepthTestDistance=e.minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance*=this._minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance===Number.POSITIVE_INFINITY&&(this._minimumDisableDepthTestDistance=-1)};function a0e(e){if(e._viewportDirty){let t=e._viewport;O.computeOrthographicOffCenter(t.x,t.x+t.width,t.y,t.y+t.height,0,1,e._viewportOrthographicMatrix),O.computeViewportTransformation(t,0,1,e._viewportTransformation),e._viewportDirty=!1}}function NXe(e){e._inverseProjectionDirty&&(e._inverseProjectionDirty=!1,e._mode!==re.SCENE2D&&e._mode!==re.MORPHING&&!e._orthographicIn3D?O.inverse(e._projection,e._inverseProjection):O.clone(O.ZERO,e._inverseProjection))}function FXe(e){e._modelViewDirty&&(e._modelViewDirty=!1,O.multiplyTransformation(e._view,e._model,e._modelView))}function BXe(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,O.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function kXe(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,O.inverse(e.modelView,e._inverseModelView))}function zXe(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,O.inverse(e.modelView3D,e._inverseModelView3D))}function UXe(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,O.multiply(e._projection,e._view,e._viewProjection))}function VXe(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,O.inverse(e.viewProjection,e._inverseViewProjection))}function jXe(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,O.multiply(e._projection,e.modelView,e._modelViewProjection))}function HXe(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 GXe(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,O.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function WXe(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,O.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function qXe(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,O.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function YXe(e){if(e._normalDirty){e._normalDirty=!1;let t=e._normal;O.getMatrix3(e.inverseModelView,t),$.transpose(t,t)}}function XXe(e){if(e._normal3DDirty){e._normal3DDirty=!1;let t=e._normal3D;O.getMatrix3(e.inverseModelView3D,t),$.transpose(t,t)}}function KXe(e){if(e._inverseNormalDirty){e._inverseNormalDirty=!1;let t=e._inverseNormal;O.getMatrix3(e.modelView,t),$.transpose(t,t)}}function $Xe(e){if(e._inverseNormal3DDirty){e._inverseNormal3DDirty=!1;let t=e._inverseNormal3D;O.getMatrix3(e.modelView3D,t),$.transpose(t,t)}}var s0e=new h;function c0e(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,O.multiplyByPoint(e.inverseModel,e._cameraPosition,s0e),Sn.fromCartesian(s0e,e._encodedCameraPositionMC))}var JXe=new h,ZXe=new h,QXe=new h,eKe=new h,tKe=new de,nKe=new h,iKe=new O;function rKe(e,t,n,i,r,o,a,s){let c=JXe;c.x=e.y,c.y=e.z,c.z=e.x;let u=ZXe;u.x=n.y,u.y=n.z,u.z=n.x;let f=QXe;f.x=i.y,f.y=i.z,f.z=i.x;let d=eKe;d.x=t.y,d.y=t.z,d.z=t.x,o===re.SCENE2D&&(c.z=r*.5);let p=a.unproject(c,tKe);p.longitude=I.clamp(p.longitude,-Math.PI,Math.PI),p.latitude=I.clamp(p.latitude,-I.PI_OVER_TWO,I.PI_OVER_TWO);let g=a.ellipsoid,m=g.cartographicToCartesian(p,nKe),y=mt.eastNorthUpToFixedFrame(m,g,iKe);return O.multiplyByPointAsVector(y,u,u),O.multiplyByPointAsVector(y,f,f),O.multiplyByPointAsVector(y,d,d),l(s)||(s=new O),s[0]=u.x,s[1]=f.x,s[2]=-d.x,s[3]=0,s[4]=u.y,s[5]=f.y,s[6]=-d.y,s[7]=0,s[8]=u.z,s[9]=f.z,s[10]=-d.z,s[11]=0,s[12]=-h.dot(u,m),s[13]=-h.dot(f,m),s[14]=h.dot(d,m),s[15]=1,s}function m$(e){e._view3DDirty&&(e._mode===re.SCENE3D?O.clone(e._view,e._view3D):rKe(e._cameraPosition,e._cameraDirection,e._cameraRight,e._cameraUp,e._frustum2DWidth,e._mode,e._mapProjection,e._view3D),O.getMatrix3(e._view3D,e._viewRotation3D),e._view3DDirty=!1)}function l0e(e){e._inverseView3DDirty&&(O.inverseTransformation(e.view3D,e._inverseView3D),O.getMatrix3(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}var Bk=xv;function uu(e,t){let{getWebGLStub:n,requestWebgl1:i,webgl:r={},allowTextureFilterAnisotropic:o=!0}=t??{};r.alpha=r.alpha??!1,r.stencil=r.stencil??!0,r.powerPreference=r.powerPreference??"high-performance";let a=l(n)?n(e,r):oKe(e,r,i),c=typeof WebGL2RenderingContext<"u"&&a instanceof WebGL2RenderingContext;this._canvas=e,this._originalGLContext=a,this._gl=a,this._webgl2=c,this._id=Kn(),this.validateFramebuffer=!1,this.validateShaderProgram=!1,this.logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new Nk(this),this._textureCache=new Fk;let u=a;this._stencilBits=u.getParameter(u.STENCIL_BITS),Ft._maximumCombinedTextureImageUnits=u.getParameter(u.MAX_COMBINED_TEXTURE_IMAGE_UNITS),Ft._maximumCubeMapSize=u.getParameter(u.MAX_CUBE_MAP_TEXTURE_SIZE),Ft._maximumFragmentUniformVectors=u.getParameter(u.MAX_FRAGMENT_UNIFORM_VECTORS),Ft._maximumTextureImageUnits=u.getParameter(u.MAX_TEXTURE_IMAGE_UNITS),Ft._maximumRenderbufferSize=u.getParameter(u.MAX_RENDERBUFFER_SIZE),Ft._maximumTextureSize=u.getParameter(u.MAX_TEXTURE_SIZE),Ft._maximum3DTextureSize=u.getParameter(u.MAX_3D_TEXTURE_SIZE),Ft._maximumVaryingVectors=u.getParameter(u.MAX_VARYING_VECTORS),Ft._maximumVertexAttributes=u.getParameter(u.MAX_VERTEX_ATTRIBS),Ft._maximumVertexTextureImageUnits=u.getParameter(u.MAX_VERTEX_TEXTURE_IMAGE_UNITS),Ft._maximumVertexUniformVectors=u.getParameter(u.MAX_VERTEX_UNIFORM_VECTORS),Ft._maximumSamples=this._webgl2?u.getParameter(u.MAX_SAMPLES):0;let f=u.getParameter(u.ALIASED_LINE_WIDTH_RANGE);Ft._minimumAliasedLineWidth=f[0],Ft._maximumAliasedLineWidth=f[1];let d=u.getParameter(u.ALIASED_POINT_SIZE_RANGE);Ft._minimumAliasedPointSize=d[0],Ft._maximumAliasedPointSize=d[1];let p=u.getParameter(u.MAX_VIEWPORT_DIMS);Ft._maximumViewportWidth=p[0],Ft._maximumViewportHeight=p[1];let g=u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.HIGH_FLOAT);Ft._highpFloatSupported=g.precision!==0;let m=u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.HIGH_INT);Ft._highpIntSupported=m.rangeMax!==0,this._antialias=u.getContextAttributes().antialias,this._standardDerivatives=!!Uo(u,["OES_standard_derivatives"]),this._blendMinmax=!!Uo(u,["EXT_blend_minmax"]),this._elementIndexUint=!!Uo(u,["OES_element_index_uint"]),this._depthTexture=!!Uo(u,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._fragDepth=!!Uo(u,["EXT_frag_depth"]),this._debugShaders=Uo(u,["WEBGL_debug_shaders"]),this._textureFloat=!!Uo(u,["OES_texture_float"]),this._textureHalfFloat=!!Uo(u,["OES_texture_half_float"]),this._textureFloatLinear=!!Uo(u,["OES_texture_float_linear"]),this._textureHalfFloatLinear=!!Uo(u,["OES_texture_half_float_linear"]),this._supportsTextureLod=!!Uo(u,["EXT_shader_texture_lod"]),this._colorBufferFloat=!!Uo(u,["EXT_color_buffer_float","WEBGL_color_buffer_float"]),this._floatBlend=!!Uo(u,["EXT_float_blend"]),this._colorBufferHalfFloat=!!Uo(u,["EXT_color_buffer_half_float"]),this._s3tc=!!Uo(u,["WEBGL_compressed_texture_s3tc","MOZ_WEBGL_compressed_texture_s3tc","WEBKIT_WEBGL_compressed_texture_s3tc"]),this._pvrtc=!!Uo(u,["WEBGL_compressed_texture_pvrtc","WEBKIT_WEBGL_compressed_texture_pvrtc"]),this._astc=!!Uo(u,["WEBGL_compressed_texture_astc"]),this._etc=!!Uo(u,["WEBG_compressed_texture_etc"]),this._etc1=!!Uo(u,["WEBGL_compressed_texture_etc1"]),this._bc7=!!Uo(u,["EXT_texture_compression_bptc"]),qu.setKTX2SupportedFormats(this._s3tc,this._pvrtc,this._astc,this._etc,this._etc1,this._bc7);let y=o?Uo(u,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;this._textureFilterAnisotropic=y,Ft._maximumTextureFilterAnisotropy=l(y)?u.getParameter(y.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1;let A,b,x,T,C,E,w,D,R,M;if(c){let S=this;A=function(){return S._gl.createVertexArray()},b=function(P){S._gl.bindVertexArray(P)},x=function(P){S._gl.deleteVertexArray(P)},T=function(P,L,F,V,z){u.drawElementsInstanced(P,L,F,V,z)},C=function(P,L,F,V){u.drawArraysInstanced(P,L,F,V)},E=function(P,L){u.vertexAttribDivisor(P,L)},w=function(P){u.drawBuffers(P)}}else D=Uo(u,["OES_vertex_array_object"]),l(D)&&(A=function(){return D.createVertexArrayOES()},b=function(S){D.bindVertexArrayOES(S)},x=function(S){D.deleteVertexArrayOES(S)}),R=Uo(u,["ANGLE_instanced_arrays"]),l(R)&&(T=function(S,P,L,F,V){R.drawElementsInstancedANGLE(S,P,L,F,V)},C=function(S,P,L,F){R.drawArraysInstancedANGLE(S,P,L,F)},E=function(S,P){R.vertexAttribDivisorANGLE(S,P)}),M=Uo(u,["WEBGL_draw_buffers"]),l(M)&&(w=function(S){M.drawBuffersWEBGL(S)});this.glCreateVertexArray=A,this.glBindVertexArray=b,this.glDeleteVertexArray=x,this.glDrawElementsInstanced=T,this.glDrawArraysInstanced=C,this.glVertexAttribDivisor=E,this.glDrawBuffers=w,this._vertexArrayObject=!!D,this._instancedArrays=!!R,this._drawBuffers=!!M,Ft._maximumDrawBuffers=this.drawBuffers?u.getParameter(ee.MAX_DRAW_BUFFERS):1,Ft._maximumColorAttachments=this.drawBuffers?u.getParameter(ee.MAX_COLOR_ATTACHMENTS):1,this._clearColor=new U(0,0,0,0),this._clearDepth=1,this._clearStencil=0;let N=new Bk,_=new _c(this),v=je.fromCache();this._defaultPassState=_,this._defaultRenderState=v,this._defaultTexture=void 0,this._defaultEmissiveTexture=void 0,this._defaultNormalTexture=void 0,this._defaultCubeMap=void 0,this._us=N,this._currentRenderState=v,this._currentPassState=_,this._currentFramebuffer=void 0,this._maxFrameTextureUnitIndex=0,this._vertexAttribDivisors=[],this._previousDrawInstanced=!1;for(let S=0;S<Ft._maximumVertexAttributes;S++)this._vertexAttribDivisors.push(0);this._pickObjects=new Map,this._nextPickColor=new Uint32Array(1),this.options={getWebGLStub:n,requestWebgl1:i,webgl:r,allowTextureFilterAnisotropic:o},this.cache={},je.apply(u,v,_)}function oKe(e,t,n){if(typeof WebGLRenderingContext>"u")throw new oe("The browser does not support WebGL. Visit http://get.webgl.org.");!n&&!(typeof WebGL2RenderingContext<"u")&&(n=!0);let r=n?"webgl":"webgl2",o=e.getContext(r,t);if(!l(o))throw new oe("The browser supports WebGL, but initialization failed.");return o}function aKe(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 sKe(e,t,n,i){let r=`${aKe(e,i)}: ${t.name}(`;for(let o=0;o<n.length;++o)o!==0&&(r+=", "),r+=n[o];return r+=");",r}function cKe(e,t,n){let i=e.getError();if(i!==e.NO_ERROR)throw new oe(sKe(e,t,n,i))}function lKe(e,t,n){return{get:function(){let i=e[t];return n(e,`get: ${t}`,i),e[t]},set:function(i){e[t]=i,n(e,`set: ${t}`,i)}}}function uKe(e,t){if(!l(t))return e;function n(r){return function(){let o=r.apply(e,arguments);return t(e,r,arguments),o}}let i={};for(let r in e){let o=e[r];o instanceof Function?i[r]=n(o):Object.defineProperty(i,r,lKe(e,r,t))}return i}function Uo(e,t){let n=t.length;for(let i=0;i<n;++i){let r=e.getExtension(t[i]);if(r)return r}}var fKe={};Object.defineProperties(uu.prototype,{id:{get:function(){return this._id}},webgl2:{get:function(){return this._webgl2}},canvas:{get:function(){return this._canvas}},shaderCache:{get:function(){return this._shaderCache}},textureCache:{get:function(){return this._textureCache}},uniformState:{get:function(){return this._us}},stencilBits:{get:function(){return this._stencilBits}},stencilBuffer:{get:function(){return this._stencilBits>=8}},antialias:{get:function(){return this._antialias}},msaa:{get:function(){return this._webgl2}},standardDerivatives:{get:function(){return this._standardDerivatives||this._webgl2}},floatBlend:{get:function(){return this._floatBlend}},blendMinmax:{get:function(){return this._blendMinmax||this._webgl2}},elementIndexUint:{get:function(){return this._elementIndexUint||this._webgl2}},depthTexture:{get:function(){return this._depthTexture||this._webgl2}},floatingPointTexture:{get:function(){return this._webgl2||this._textureFloat}},halfFloatingPointTexture:{get:function(){return this._webgl2||this._textureHalfFloat}},textureFloatLinear:{get:function(){return this._textureFloatLinear}},textureHalfFloatLinear:{get:function(){return this._webgl2&&this._textureFloatLinear||!this._webgl2&&this._textureHalfFloatLinear}},supportsTextureLod:{get:function(){return this._webgl2||this._supportsTextureLod}},textureFilterAnisotropic:{get:function(){return!!this._textureFilterAnisotropic}},s3tc:{get:function(){return this._s3tc}},pvrtc:{get:function(){return this._pvrtc}},astc:{get:function(){return this._astc}},etc:{get:function(){return this._etc}},etc1:{get:function(){return this._etc1}},bc7:{get:function(){return this._bc7}},supportsBasis:{get:function(){return this._s3tc||this._pvrtc||this._astc||this._etc||this._etc1||this._bc7}},vertexArrayObject:{get:function(){return this._vertexArrayObject||this._webgl2}},fragmentDepth:{get:function(){return this._fragDepth||this._webgl2}},instancedArrays:{get:function(){return this._instancedArrays||this._webgl2}},colorBufferFloat:{get:function(){return this._colorBufferFloat}},colorBufferHalfFloat:{get:function(){return this._webgl2&&this._colorBufferFloat||!this._webgl2&&this._colorBufferHalfFloat}},drawBuffers:{get:function(){return this._drawBuffers||this._webgl2}},debugShaders:{get:function(){return this._debugShaders}},throwOnWebGLError:{get:function(){return this._throwOnWebGLError},set:function(e){this._throwOnWebGLError=e,this._gl=uKe(this._originalGLContext,e?cKe:void 0)}},defaultTexture:{get:function(){if(this._defaultTexture===void 0){let e=Et.defaultColor;this._defaultTexture=new Et({context:this,source:{width:1,height:1,arrayBufferView:new Uint8Array([e.red*255,e.green*255,e.blue*255,e.alpha*255])},flipY:!1})}return this._defaultTexture}},defaultEmissiveTexture:{get:function(){return this._defaultEmissiveTexture===void 0&&(this._defaultEmissiveTexture=new Et({context:this,pixelFormat:He.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 Et({context:this,pixelFormat:He.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 aa({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 fKe}}});function u0e(e,t,n,i){let r=e._currentRenderState,o=e._currentPassState;e._currentRenderState=t,e._currentPassState=n,je.partialApply(e._gl,r,t,o,n,i)}var p$;typeof WebGLRenderingContext<"u"&&(p$=[ee.BACK]);function kk(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;let n=p$;if(l(t))t._bind(),n=t._getActiveColorAttachments();else{let i=e._gl;i.bindFramebuffer(i.FRAMEBUFFER,null)}e.drawBuffers&&e.glDrawBuffers(n)}}var dKe=new ui;uu.prototype.clear=function(e,t){e=e??dKe,t=t??this._defaultPassState;let n=this._gl,i=0,r=e.color,o=e.depth,a=e.stencil;l(r)&&(U.equals(this._clearColor,r)||(U.clone(r,this._clearColor),n.clearColor(r.red,r.green,r.blue,r.alpha)),i|=n.COLOR_BUFFER_BIT),l(o)&&(o!==this._clearDepth&&(this._clearDepth=o,n.clearDepth(o)),i|=n.DEPTH_BUFFER_BIT),l(a)&&(a!==this._clearStencil&&(this._clearStencil=a,n.clearStencil(a)),i|=n.STENCIL_BUFFER_BIT);let s=e.renderState??this._defaultRenderState;u0e(this,s,t,!0);let c=e.framebuffer??t.framebuffer;kk(this,c),n.clear(i)};function hKe(e,t,n,i,r){kk(e,t),u0e(e,r,n,!1),i._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,i.maximumTextureUnitIndex)}function mKe(e,t,n,i){let r=t._primitiveType,o=t._vertexArray,a=t._offset,s=t._count,c=t.instanceCount;e._us.model=t._modelMatrix??O.IDENTITY,n._setUniforms(i,e._us,e.validateShaderProgram),o._bind();let u=o.indexBuffer;l(u)?(a=a*u.bytesPerIndex,l(s)?s=Math.min(s,u.numberOfIndices):s=u.numberOfIndices,c===0?e._gl.drawElements(r,s,u.indexDatatype,a):e.glDrawElementsInstanced(r,s,u.indexDatatype,a,c)):(l(s)?s=Math.min(s,o.numberOfVertices):s=o.numberOfVertices,c===0?e._gl.drawArrays(r,a,s):e.glDrawArraysInstanced(r,a,s,c)),o._unBind()}uu.prototype.draw=function(e,t,n,i){t=t??this._defaultPassState;let r=e._framebuffer??t.framebuffer,o=e._renderState??this._defaultRenderState;n=n??e._shaderProgram,i=i??e._uniformMap,hKe(this,r,t,n,o),mKe(this,e,n,i)};uu.prototype.beginFrame=function(){};uu.prototype.endFrame=function(){let e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null);let t=p$;this.drawBuffers&&this.glDrawBuffers(t);let n=this._maxFrameTextureUnitIndex;this._maxFrameTextureUnitIndex=0;for(let i=0;i<n;++i)e.activeTexture(e.TEXTURE0+i),e.bindTexture(e.TEXTURE_2D,null),e.bindTexture(e.TEXTURE_CUBE_MAP,null)};uu.prototype.readPixelsToPBO=function(e){let t=this._gl;e=e??H.EMPTY_OBJECT;let n=Math.max(e.x??0,0),i=Math.max(e.y??0,0),r=e.width??this.drawingBufferWidth,o=e.height??this.drawingBufferHeight,a=e.framebuffer;if(!this._webgl2)throw new pe("A WebGL 2 context is required to read pixels using a PBO.");let s=ke.UNSIGNED_BYTE,c=He.RGBA;l(a)&&a.numberOfColorAttachments>0&&(s=a.getColorTexture(0).pixelDatatype,c=a.getColorTexture(0).pixelFormat);let u=Ze.createPixelBuffer({context:this,sizeInBytes:He.textureSizeInBytes(c,s,r,o),usage:Oe.DYNAMIC_READ});return kk(this,a),u._bind(),t.readPixels(n,i,r,o,c,ke.toWebGLConstant(s,this),0),u._unBind(),u};uu.prototype.readPixels=function(e){let t=this._gl;e=e??H.EMPTY_OBJECT;let n=Math.max(e.x??0,0),i=Math.max(e.y??0,0),r=e.width??this.drawingBufferWidth,o=e.height??this.drawingBufferHeight,a=e.framebuffer,s=ke.UNSIGNED_BYTE,c=He.RGBA;l(a)&&a.numberOfColorAttachments>0&&(s=a.getColorTexture(0).pixelDatatype,c=a.getColorTexture(0).pixelFormat);let u=He.createTypedArray(c,s,r,o);return kk(this,a),t.readPixels(n,i,r,o,He.RGBA,ke.toWebGLConstant(s,this),u),u};var f0e={position:0,textureCoordinates:1};uu.prototype.getViewportQuadVertexArray=function(){let e=this.cache.viewportQuad_vertexArray;if(!l(e)){let t=new Tt({attributes:{position:new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},indices:new Uint16Array([0,1,2,0,2,3]),primitiveType:Re.TRIANGLES});e=Vn.fromGeometry({context:this,geometry:t,attributeLocations:f0e,bufferUsage:Oe.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=e}return e};uu.prototype.createViewportQuadCommand=function(e,t){return t=t??H.EMPTY_OBJECT,new nt({vertexArray:this.getViewportQuadVertexArray(),primitiveType:Re.TRIANGLES,renderState:t.renderState,shaderProgram:Zt.fromCache({context:this,vertexShaderSource:bv,fragmentShaderSource:e,attributeLocations:f0e}),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer,pass:t.pass})};uu.prototype.getObjectByPickColor=function(e){return this._pickObjects.get(e)};uu.prototype.createPickId=function(e){++this._nextPickColor[0];let t=this._nextPickColor[0];if(t===0)throw new oe("Out of unique Pick IDs.");return this._pickObjects.set(t,e),new Lk(this._pickObjects,t,U.fromRgba(t))};uu.prototype.isDestroyed=function(){return!1};uu.prototype.destroy=function(){let e=this.cache;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];l(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(),ue(this)};var Tv=uu;function Cv(e){e=e??H.EMPTY_OBJECT;let{context:t,width:n,height:i,colorRenderbuffers:r,colorTextures:o,depthStencilRenderbuffer:a,depthStencilTexture:s,destroyAttachments:c}=e;if(this._width=n,this._height=i,l(r)!==l(o))throw new pe("Both color renderbuffer and texture attachments must be provided.");if(l(a)!==l(s))throw new pe("Both depth-stencil renderbuffer and texture attachments must be provided.");this._renderFramebuffer=new Ta({context:t,colorRenderbuffers:r,depthStencilRenderbuffer:a,destroyAttachments:c}),this._colorFramebuffer=new Ta({context:t,colorTextures:o,depthStencilTexture:s,destroyAttachments:c})}Cv.prototype.getRenderFramebuffer=function(){return this._renderFramebuffer};Cv.prototype.getColorFramebuffer=function(){return this._colorFramebuffer};Cv.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),l(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)};Cv.prototype.isDestroyed=function(){return!1};Cv.prototype.destroy=function(){return this._renderFramebuffer.destroy(),this._colorFramebuffer.destroy(),ue(this)};var zk=Cv;var El={RGBA4:ee.RGBA4,RGBA8:ee.RGBA8,RGBA16F:ee.RGBA16F,RGBA32F:ee.RGBA32F,RGB5_A1:ee.RGB5_A1,RGB565:ee.RGB565,DEPTH_COMPONENT16:ee.DEPTH_COMPONENT16,STENCIL_INDEX8:ee.STENCIL_INDEX8,DEPTH_STENCIL:ee.DEPTH_STENCIL,DEPTH24_STENCIL8:ee.DEPTH24_STENCIL8,validate:function(e){return e===El.RGBA4||e===El.RGBA8||e===El.RGBA16F||e===El.RGBA32F||e===El.RGB5_A1||e===El.RGB565||e===El.DEPTH_COMPONENT16||e===El.STENCIL_INDEX8||e===El.DEPTH_STENCIL||e===El.DEPTH24_STENCIL8},getColorFormat:function(e){return e===ee.FLOAT?El.RGBA32F:e===ee.HALF_FLOAT_OES?El.RGBA16F:El.RGBA8}};Object.freeze(El);var fu=El;function zP(e){e=e??H.EMPTY_OBJECT;let t=e.context,n=t._gl,i=Ft.maximumRenderbufferSize,r=e.format??fu.RGBA4,o=l(e.width)?e.width:t.drawingBufferWidth,a=l(e.height)?e.height:t.drawingBufferHeight,s=e.numSamples??1;this._gl=n,this._format=r,this._width=o,this._height=a,this._renderbuffer=this._gl.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,this._renderbuffer),s>1?n.renderbufferStorageMultisample(n.RENDERBUFFER,s,r,o,a):n.renderbufferStorage(n.RENDERBUFFER,r,o,a),n.bindRenderbuffer(n.RENDERBUFFER,null)}Object.defineProperties(zP.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});zP.prototype._getRenderbuffer=function(){return this._renderbuffer};zP.prototype.isDestroyed=function(){return!1};zP.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),ue(this)};var ld=zP;function cs(e){e=e??H.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._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(cs.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}}});cs.prototype.isDirty=function(e,t,n,i,r){n=n??1;let o=this._width!==e||this._height!==t,a=this._numSamples!==n,s=l(i)&&this._pixelDatatype!==i||l(r)&&this._pixelFormat!==r,c=n===1?l(this._framebuffer):l(this._multisampleFramebuffer);return this._attachmentsDirty||o||a||s||!c||this._color&&!l(this._colorTextures[0])};cs.prototype.update=function(e,t,n,i,r,o){if(i=e.msaa?i??1:1,r=r??(this._color?this._pixelDatatype??ke.UNSIGNED_BYTE:void 0),o=o??(this._color?this._pixelFormat??He.RGBA:void 0),this.isDirty(t,n,i,r,o)){if(this.destroy(),this._width=t,this._height=n,this._numSamples=i,this._pixelDatatype=r,this._pixelFormat=o,this._attachmentsDirty=!1,this._color&&this._createColorAttachments){for(let a=0;a<this._colorAttachmentsLength;++a)if(this._colorTextures[a]=new Et({context:e,width:t,height:n,pixelFormat:o,pixelDatatype:r,sampler:Ut.NEAREST}),this._numSamples>1){let s=fu.getColorFormat(r);this._colorRenderbuffers[a]=new ld({context:e,width:t,height:n,format:s,numSamples:this._numSamples})}}this._depthStencil&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?(this._depthStencilTexture=new Et({context:e,width:t,height:n,pixelFormat:He.DEPTH_STENCIL,pixelDatatype:ke.UNSIGNED_INT_24_8,sampler:Ut.NEAREST}),this._numSamples>1&&(this._depthStencilRenderbuffer=new ld({context:e,width:t,height:n,format:fu.DEPTH24_STENCIL8,numSamples:this._numSamples}))):this._depthStencilRenderbuffer=new ld({context:e,width:t,height:n,format:fu.DEPTH_STENCIL})),this._depth&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?this._depthTexture=new Et({context:e,width:t,height:n,pixelFormat:He.DEPTH_COMPONENT,pixelDatatype:ke.UNSIGNED_INT,sampler:Ut.NEAREST}):this._depthRenderbuffer=new ld({context:e,width:t,height:n,format:fu.DEPTH_COMPONENT16})),this._numSamples>1?this._multisampleFramebuffer=new zk({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 Ta({context:e,colorTextures:this._colorTextures,depthTexture:this._depthTexture,depthRenderbuffer:this._depthRenderbuffer,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1})}};cs.prototype.getColorTexture=function(e){return e=e??0,this._colorTextures[e]};cs.prototype.setColorTexture=function(e,t){t=t??0,this._attachmentsDirty=e!==this._colorTextures[t],this._colorTextures[t]=e};cs.prototype.getColorRenderbuffer=function(e){return e=e??0,this._colorRenderbuffers[e]};cs.prototype.setColorRenderbuffer=function(e,t){t=t??0,this._attachmentsDirty=e!==this._colorRenderbuffers[t],this._colorRenderbuffers[t]=e};cs.prototype.getDepthRenderbuffer=function(){return this._depthRenderbuffer};cs.prototype.setDepthRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthRenderbuffer,this._depthRenderbuffer=e};cs.prototype.getDepthTexture=function(){return this._depthTexture};cs.prototype.setDepthTexture=function(e){this._attachmentsDirty=e!==this._depthTexture,this._depthTexture=e};cs.prototype.getDepthStencilRenderbuffer=function(){return this._depthStencilRenderbuffer};cs.prototype.setDepthStencilRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthStencilRenderbuffer,this._depthStencilRenderbuffer=e};cs.prototype.getDepthStencilTexture=function(){return this._depthStencilTexture};cs.prototype.setDepthStencilTexture=function(e){this._attachmentsDirty=e!==this._depthStencilTexture,this._depthStencilTexture=e};cs.prototype.prepareTextures=function(e,t){this._numSamples>1&&this._multisampleFramebuffer.blitFramebuffers(e,t)};cs.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this.framebuffer,t.execute(e,n),t.framebuffer=i};cs.prototype.destroyFramebuffer=function(){this._framebuffer=this._framebuffer&&this._framebuffer.destroy(),this._multisampleFramebuffer=this._multisampleFramebuffer&&this._multisampleFramebuffer.destroy()};cs.prototype.destroy=function(){if(this._color){let e=this._colorTextures,t=this._colorRenderbuffers;for(let n=0;n<e.length;++n){let i=e[n];this._createColorAttachments&&l(i)&&!i.isDestroyed()&&i.destroy(),l(i)&&i.isDestroyed()&&(e[n]=void 0);let r=t[n];this._createColorAttachments&&l(r)&&!r.isDestroyed()&&r.destroy(),l(r)&&r.isDestroyed()&&(t[n]=void 0)}}this._depthStencil&&(this._createDepthAttachments&&(this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy()),l(this._depthStencilTexture)&&this._depthStencilTexture.isDestroyed()&&(this._depthStencilTexture=void 0),l(this._depthStencilRenderbuffer)&&this._depthStencilRenderbuffer.isDestroyed()&&(this._depthStencilRenderbuffer=void 0)),this._depth&&(this._createDepthAttachments&&(this._depthTexture=this._depthTexture&&this._depthTexture.destroy(),this._depthRenderbuffer=this._depthRenderbuffer&&this._depthRenderbuffer.destroy()),l(this._depthTexture)&&this._depthTexture.isDestroyed()&&(this._depthTexture=void 0),l(this._depthRenderbuffer)&&this._depthRenderbuffer.isDestroyed()&&(this._depthRenderbuffer=void 0)),this.destroyFramebuffer()};var si=cs;var iy={NONE:0,VERTEX:1,FRAGMENT:2,BOTH:3};iy.includesVertexShader=function(e){return(e&iy.VERTEX)!==0};iy.includesFragmentShader=function(e){return(e&iy.FRAGMENT)!==0};iy.union=function(...e){let t=0;for(let n=0;n<e.length;n++)t|=e[n];return t};iy.intersection=function(...e){let t=e[0];for(let n=1;n<e.length;n++)t&=e[n];return t};Object.freeze(iy);var he=iy;function g$(e){this.name=e,this.fields=[]}g$.prototype.addField=function(e,t){let n=` ${e} ${t};`;this.fields.push(n)};g$.prototype.generateGlslLines=function(){let e=this.fields;return e.length===0&&(e=[" float _empty;"]),[].concat(`struct ${this.name}`,"{",e,"};")};var Uk=g$;function _$(e){this.signature=e,this.body=[]}_$.prototype.addLines=function(e){let t=this.body;if(Array.isArray(e)){let n=e.length;for(let i=0;i<n;i++)t.push(` ${e[i]}`)}else t.push(` ${e}`)};_$.prototype.generateGlslLines=function(){return[].concat(this.signature,"{",this.body,"}")};var Vk=_$;function Sl(){this._positionAttributeLine=void 0,this._nextAttributeLocation=1,this._attributeLocations={},this._attributeLines=[],this._structs={},this._functions={},this._vertexShaderParts={defineLines:[],uniformLines:[],shaderLines:[],varyingLines:[],structIds:[],functionIds:[]},this._fragmentShaderParts={defineLines:[],uniformLines:[],shaderLines:[],varyingLines:[],structIds:[],functionIds:[]}}Object.defineProperties(Sl.prototype,{attributeLocations:{get:function(){return this._attributeLocations}}});Sl.prototype.addDefine=function(e,t,n){n=n??he.BOTH;let i=e;l(t)&&(i+=` ${t.toString()}`),he.includesVertexShader(n)&&this._vertexShaderParts.defineLines.push(i),he.includesFragmentShader(n)&&this._fragmentShaderParts.defineLines.push(i)};Sl.prototype.addStruct=function(e,t,n){this._structs[e]=new Uk(t),he.includesVertexShader(n)&&this._vertexShaderParts.structIds.push(e),he.includesFragmentShader(n)&&this._fragmentShaderParts.structIds.push(e)};Sl.prototype.addStructField=function(e,t,n){this._structs[e].addField(t,n)};Sl.prototype.addFunction=function(e,t,n){this._functions[e]=new Vk(t),he.includesVertexShader(n)&&this._vertexShaderParts.functionIds.push(e),he.includesFragmentShader(n)&&this._fragmentShaderParts.functionIds.push(e)};Sl.prototype.addFunctionLines=function(e,t){this._functions[e].addLines(t)};Sl.prototype.addUniform=function(e,t,n){n=n??he.BOTH;let i=`uniform ${e} ${t};`;he.includesVertexShader(n)&&this._vertexShaderParts.uniformLines.push(i),he.includesFragmentShader(n)&&this._fragmentShaderParts.uniformLines.push(i)};Sl.prototype.setPositionAttribute=function(e,t){return this._positionAttributeLine=`in ${e} ${t};`,this._attributeLocations[t]=0,0};Sl.prototype.addAttribute=function(e,t){let n=`in ${e} ${t};`;this._attributeLines.push(n);let i=this._nextAttributeLocation;return this._attributeLocations[t]=i,this._nextAttributeLocation+=gKe(e),i};Sl.prototype.addVarying=function(e,t,n){n=l(n)?`${n} `:"";let i=`${e} ${t};`;this._vertexShaderParts.varyingLines.push(`${n}out ${i}`),this._fragmentShaderParts.varyingLines.push(`${n}in ${i}`)};Sl.prototype.addVertexLines=function(e){let t=this._vertexShaderParts.shaderLines;Array.isArray(e)?Xn(t,e):t.push(e)};Sl.prototype.addFragmentLines=function(e){let t=this._fragmentShaderParts.shaderLines;Array.isArray(e)?Xn(t,e):t.push(e)};Sl.prototype.buildShaderProgram=function(e){let t=l(this._positionAttributeLine)?[this._positionAttributeLine]:[],n=pKe(this),i=_Ke(this),r=t.concat(this._attributeLines,this._vertexShaderParts.uniformLines,this._vertexShaderParts.varyingLines,n.vertexLines,i.vertexLines,this._vertexShaderParts.shaderLines).join(`
|
|
`),o=new Ge({defines:this._vertexShaderParts.defineLines,sources:[r]}),a=this._fragmentShaderParts.uniformLines.concat(this._fragmentShaderParts.varyingLines,n.fragmentLines,i.fragmentLines,this._fragmentShaderParts.shaderLines).join(`
|
|
`),s=new Ge({defines:this._fragmentShaderParts.defineLines,sources:[a]});return Zt.fromCache({context:e,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:this._attributeLocations})};Sl.prototype.clone=function(){return Xe(this,!0)};function pKe(e){let t=[],n=[],i,r=e._vertexShaderParts.structIds,o,a,s;for(i=0;i<r.length;i++)o=r[i],a=e._structs[o],s=a.generateGlslLines(),Xn(t,s);for(r=e._fragmentShaderParts.structIds,i=0;i<r.length;i++)o=r[i],a=e._structs[o],s=a.generateGlslLines(),Xn(n,s);return{vertexLines:t,fragmentLines:n}}function gKe(e){switch(e){case"mat2":return 2;case"mat3":return 3;case"mat4":return 4;default:return 1}}function _Ke(e){let t=[],n=[],i,r=e._vertexShaderParts.functionIds,o,a,s;for(i=0;i<r.length;i++)o=r[i],a=e._functions[o],s=a.generateGlslLines(),Xn(t,s);for(r=e._fragmentShaderParts.functionIds,i=0;i<r.length;i++)o=r[i],a=e._functions[o],s=a.generateGlslLines(),Xn(n,s);return{vertexLines:t,fragmentLines:n}}var ry=Sl;function jk(e){this._autoDestroy=e?.autoDestroy??!0,this._canvas=document.createElement("canvas"),this._context=new Tv(this._canvas,Xe(e?.contextOptions)),this._canvases=[]}jk.prototype.createSceneContext=function(e){let t=e.getContext("2d",{alpha:!0}),n=this;n._canvases.push(e);let i=!1,r=function(){i=!0;let c=n._canvases.indexOf(e);c!==-1&&(n._canvases.splice(c,1),n._autoDestroy&&n._canvases.length===0&&n.destroy())},o=function(){let c=n._context.canvas,u=this.drawingBufferWidth;c.width<u&&(c.width=u);let f=this.drawingBufferHeight;c.height<f&&(c.height=f)},a=function(){let c=this.drawingBufferWidth,u=this.drawingBufferHeight,f=n._context.canvas.height-u;t.drawImage(n._context.canvas,0,f,c,u,0,0,c,u),n._context.endFrame()};return new Proxy(this._context,{get(c,u,f){if(u==="isDestroyed")return function(){return i};switch(u){case"_canvas":return e;case"destroy":return r;case"drawingBufferWidth":return e.width;case"drawingBufferHeight":return e.height;case"beginFrame":return o;case"endFrame":return a;default:return Reflect.get(c,u,f)}}})};jk.prototype.destroy=function(){this._context.destroy(),ue(this)};jk.prototype.isDestroyed=function(){return!1};var Hk=jk;function Nb(e){e=e??H.EMPTY_OBJECT;let t=e.context;if(!t._webgl2)throw new pe("A WebGL 2 context is required to use Sync operations.");let n=t._gl,i=n.fenceSync(ee.SYNC_GPU_COMMANDS_COMPLETE,0);this._gl=n,this._sync=i}Nb.create=function(e){return new Nb(e)};Nb.prototype.getStatus=function(){return this._gl.getSyncParameter(this._sync,ee.SYNC_STATUS)};Nb.prototype.isDestroyed=function(){return!1};Nb.prototype.destroy=function(){return this._gl.deleteSync(this._sync),ue(this)};Nb.prototype.waitForSignal=async function(e,t){let n=this;t=t??10;function i(r,o,a){return()=>{n.getStatus()===ee.SIGNALED?r():a<=0?o(new oe("Wait for signal timeout")):e(i(r,o,a-1))}}return new Promise((r,o)=>{e(i(r,o,t))})};var Gk=Nb;function oy(e){e=e??H.EMPTY_OBJECT;let{context:t,source:n,pixelFormat:i=He.RGBA,pixelDatatype:r=ke.UNSIGNED_BYTE,flipY:o=!0,skipColorSpaceConversion:a=!1,sampler:s=new Ut}=e;if(!t.webgl2&&!l(t.options.getWebGLStub))throw new pe("WebGL1 does not support texture3D. Please use a WebGL2 context.");let{width:c,height:u,depth:f}=e;l(n)&&(l(c)||(c=n.width),l(u)||(u=n.height),l(f)||(f=n.depth));let d=e.preMultiplyAlpha||i===He.RGB||i===He.LUMINANCE,p=He.toInternalFormat(i,r,t),g=He.isCompressedFormat(p),m=t._gl,y=He.texture3DSizeInBytes(i,r,c,u,f);if(this._id=e.id??Kn(),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=m.TEXTURE_3D,this._texture=m.createTexture(),this._internalFormat=p,this._pixelFormat=i,this._pixelDatatype=r,this._width=c,this._height=u,this._depth=f,this._dimensions=new h(c,u,f),this._hasMipmap=!1,this._sizeInBytes=y,this._preMultiplyAlpha=d,this._flipY=o,this._initialized=!1,this._sampler=void 0,this._sampler=s,m0e(this,s),m.activeTexture(m.TEXTURE0),m.bindTexture(this._textureTarget,this._texture),l(n)){if(a?m.pixelStorei(m.UNPACK_COLORSPACE_CONVERSION_WEBGL,m.NONE):m.pixelStorei(m.UNPACK_COLORSPACE_CONVERSION_WEBGL,m.BROWSER_DEFAULT_WEBGL),!l(n.arrayBufferView))throw new pe("For Texture3D, options.source.arrayBufferView must be defined");d0e(this,n),this._initialized=!0}else h0e(this);m.bindTexture(this._textureTarget,null)}function d0e(e,t){let n=e._context,i=n._gl,r=e._textureTarget,o=e._internalFormat,{width:a,height:s,depth:c,pixelFormat:u,pixelDatatype:f,flipY:d}=e,p=He.alignmentInBytes(u,f,a);i.pixelStorei(i.UNPACK_ALIGNMENT,p),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1);let{arrayBufferView:g}=t;d&&console.warn("texture3D.flipY is not supported.");let m=1;if(t.mipLevels&&t.mipLevels.length&&(m=t.mipLevels.length+1),i.texStorage3D(r,m,o,a,s,c),i.texSubImage3D(r,0,0,0,0,a,s,c,u,ke.toWebGLConstant(f,n),g),m>1){let y=a,A=s,b=c;for(let x=0;x<t.mipLevels.length;++x)y=y$(y),A=y$(A),b=y$(b),i.texSubImage3D(r,x+1,0,0,0,y,A,b,u,ke.toWebGLConstant(f,n),t.mipLevels[x])}}oy.prototype.copyFrom=function(e){e=e??H.EMPTY_OBJECT;let{source:t,xOffset:n=0,yOffset:i=0,zOffset:r=0}=e,a=this._context._gl,s=this._textureTarget;a.activeTexture(a.TEXTURE0),a.bindTexture(s,this._texture);let{width:c,height:u,depth:f}=t,d=!1;this._initialized||(n===0&&i===0&&r===0&&c===this._width&&u===this._height&&f===this._depth?(d0e(this,t),d=!0):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),h0e(this)),this._initialized=!0),d||yKe(this,t.arrayBufferView,n,i,r,c,u,f),a.bindTexture(s,null)};function yKe(e,t,n,i,r,o,a,s){let c=e._context,u=c._gl,{pixelFormat:f,pixelDatatype:d}=e,p=He.alignmentInBytes(f,d,o);u.pixelStorei(u.UNPACK_ALIGNMENT,p),u.pixelStorei(u.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),u.pixelStorei(u.UNPACK_FLIP_Y_WEBGL,!1),u.texSubImage3D(e._textureTarget,0,n,i,r,o,a,s,f,ke.toWebGLConstant(d,c),t)}function y$(e){let t=Math.floor(e/2)|0;return Math.max(t,1)}function h0e(e){let t=e._context;t._gl.texImage3D(e._textureTarget,0,e._internalFormat,e._width,e._height,e._depth,0,e._pixelFormat,ke.toWebGLConstant(e._pixelDatatype,t),null)}oy.create=function(e){return new oy(e)};Object.defineProperties(oy.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){m0e(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}},depth:{get:function(){return this._depth}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(this._sizeInBytes*8/7):this._sizeInBytes}},_target:{get:function(){return this._textureTarget}}});function m0e(e,t){let{minificationFilter:n,magnificationFilter:i}=t,r=[Gt.NEAREST_MIPMAP_NEAREST,Gt.NEAREST_MIPMAP_LINEAR,Gt.LINEAR_MIPMAP_NEAREST,Gt.LINEAR_MIPMAP_LINEAR].includes(n),o=e._context,a=e._pixelFormat,s=e._pixelDatatype;(s===ke.FLOAT&&!o.textureFloatLinear||s===ke.HALF_FLOAT&&!o.textureHalfFloatLinear)&&(n=r?Gt.NEAREST_MIPMAP_NEAREST:Gt.NEAREST,i=ni.NEAREST),He.isDepthFormat(a)&&(n=Gt.NEAREST,i=ni.NEAREST);let c=o._gl,u=e._textureTarget;c.activeTexture(c.TEXTURE0),c.bindTexture(u,e._texture),c.texParameteri(u,c.TEXTURE_MIN_FILTER,n),c.texParameteri(u,c.TEXTURE_MAG_FILTER,i),c.texParameteri(u,c.TEXTURE_WRAP_R,t.wrapR),c.texParameteri(u,c.TEXTURE_WRAP_S,t.wrapS),c.texParameteri(u,c.TEXTURE_WRAP_T,t.wrapT),l(e._textureFilterAnisotropic)&&c.texParameteri(u,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),c.bindTexture(u,null)}oy.prototype.generateMipmap=function(e){e=e??sh.DONT_CARE,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)};oy.prototype.isDestroyed=function(){return!1};oy.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),ue(this)};var Wk=oy;var p0e=16;function wl(e){e=e??H.EMPTY_OBJECT;let t=e.borderWidthInPixels??1,n=e.initialSize??new k(p0e,p0e);this._pixelFormat=e.pixelFormat??He.RGBA,this._sampler=e.sampler,this._borderWidthInPixels=t,this._initialSize=n,this._texturePacker=void 0,this._rectangles=[],this._subRegions=new Map,this._guid=Kn(),this._imagesToAddQueue=[],this._indexById=new Map,this._indexPromiseById=new Map,this._nextIndex=0}Object.defineProperties(wl.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 l(this._texture)?this._texture.sizeInBytes:0}}});wl.prototype.computeTextureCoordinates=function(e,t){let n=this._texture,i=this._rectangles[e];if(l(t)||(t=new Je),!l(i))return t.x=0,t.y=0,t.width=0,t.height=0,t;let r=n.width,o=n.height,a=i.width,s=i.height,c=i.x,u=i.y,f=this._subRegions.get(e);if(l(f)){let d=this._rectangles[f];c+=d.x,u+=d.y}return t.x=c/r,t.y=u/o,t.width=a/r,t.height=s/o,t};wl.prototype._copyFromTexture=function(e,t,n,i){let r=this._pixelFormat,o=this._sampler,a=new Et({context:e,height:n,width:t,pixelFormat:r,sampler:o}),s=e._gl,c=a._textureTarget,u=this._texture,f=new Ta({context:e,colorTextures:[u],destroyAttachments:!1});s.activeTexture(s.TEXTURE0),s.bindTexture(c,a._texture),f._bind();let d=this.rectangles,p=this._subRegions;for(let g=0;g<d.length;++g){let m=i[g],y=d[g];if(!l(m)||!l(y)||l(p.get(g)))continue;let{x:A,y:b,width:x,height:T}=m;s.copyTexSubImage2D(c,0,A,b,y.x,y.y,x,T)}return s.bindTexture(c,null),a._initialized=!0,f._unBind(),f.destroy(),a};wl.prototype._resize=function(e,t=0){let n=this._borderWidthInPixels,i=this._rectangles,r=this._imagesToAddQueue,o=this._texture,a=o.width,s=o.height,c=this._subRegions,u=i.map((A,b)=>new g0e({index:b,image:A})).filter((A,b)=>l(A.image)&&!l(c.get(b))),f=0,d=0,p=0;for(let A=t;A<r.length;++A){let{width:b,height:x}=r[A].image;f=Math.max(f,b),d=Math.max(d,x),p+=b*x,u.push(r[A])}for(a=I.nextPowerOfTwo(Math.max(f,a)),s=I.nextPowerOfTwo(Math.max(d,s));p>=a*s;)a>s?s*=2:a*=2;u.sort(({image:A},{image:b})=>b.height*b.width-A.height*A.width);let g=new Array(this._nextIndex);for(let A of this._subRegions.keys())l(c.get(A))&&(g[A]=i[A]);let m,y=!1;for(;!y;){m=new SP({height:s,width:a,borderPadding:n});let A;for(A=0;A<u.length;++A){let{index:b,image:x}=u[A];if(!l(x))continue;let T=m.pack(b,x);if(!l(T)){a>s?s*=2:a*=2;break}g[b]=T.rectangle}y=A===u.length}this._texturePacker=m,this._texture=this._copyFromTexture(e,a,s,g),o.destroy(),this._rectangles=g,this._guid=Kn()};wl.prototype.getImageIndex=function(e){return this._indexById.get(e)};wl.prototype._copyImageToTexture=function({index:e,image:t,resolve:n,reject:i}){let r=this._texture,o=this._rectangles[e];try{r.copyFrom({source:t,xOffset:o.x,yOffset:o.y}),l(n)&&n(e)}catch(a){if(l(i)){i(a);return}}};function g0e({index:e,image:t,resolve:n,reject:i}){this.index=e,this.image=t,this.resolve=n,this.reject=i,this.rectangle=void 0}wl.prototype._addImage=function(e,t){return new Promise((n,i)=>{this._imagesToAddQueue.push(new g0e({index:e,image:t,resolve:n,reject:i})),this._imagesToAddQueue.sort(({image:r},{image:o})=>o.height*o.width-r.height*r.width)})};wl.prototype._processImageQueue=function(e){let t=this._imagesToAddQueue;if(t.length===0)return!1;this._rectangles.length=this._nextIndex;let n,i;for(n=0;n<t.length;++n){let r=t[n],{image:o,index:a}=r,s=this._texturePacker.pack(a,o);if(!l(s)){try{this._resize(e,n)}catch(c){i=c,l(r.reject)&&r.reject(i)}break}this._rectangles[a]=s.rectangle}if(l(i)){for(n=n+1;n<t.length;++n){let{resolve:r}=t[n];l(r)&&r(-1)}return t.length=0,!1}for(let r=0;r<t.length;++r)this._copyImageToTexture(t[r]);return t.length=0,!0};wl.prototype.update=function(e){if(!l(this._texture)){let t=this._initialSize.x,n=this._initialSize.y,i=this._pixelFormat,r=this._sampler,o=this._borderWidthInPixels;this._texture=new Et({context:e,width:t,height:n,pixelFormat:i,sampler:r}),this._texturePacker=new SP({height:n,width:t,borderPadding:o})}return this._processImageQueue(e)};async function AKe(e,t){return typeof e=="function"&&(e=e(t)),(typeof e=="string"||e instanceof De)&&(e=De.createIfNeeded(e).fetchImage()),e}wl.prototype.addImage=function(e,t,n,i){let r=this._indexPromiseById.get(e),o=this._indexById.get(e);return l(r)?r:l(o)?o:(o=this._nextIndex++,this._indexById.set(e,o),r=(async()=>{let s=await AKe(t,e);if(this.isDestroyed()||!l(s))return this._indexPromiseById.delete(e),-1;l(n)&&(s.width=n),l(i)&&(s.height=i);let c=await this._addImage(o,s);return this._indexPromiseById.delete(e),c})(),this._indexPromiseById.set(e,r),r)};wl.prototype.getCachedImageSubRegion=function(e,t,n){let i=this._indexPromiseById.get(e);for(let[r,o]of this._subRegions.entries())if(n===o&&this._rectangles[r].equals(t))return i?i.then(s=>s===-1?-1:r):r};wl.prototype.addImageSubRegion=function(e,t){let n=this._indexById.get(e);if(!l(n))throw new oe(`image with id "${e}" not found in the atlas.`);let i=this.getCachedImageSubRegion(e,t,n);return l(i)?i:(i=this._nextIndex++,this._subRegions.set(i,n),this._rectangles[i]=t.clone(),(this._indexPromiseById.get(e)??Promise.resolve(n)).then(o=>{if(o===-1)return-1;let a=this._rectangles[o];return i}))};wl.prototype.isDestroyed=function(){return!1};wl.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),this._imagesToAddQueue.forEach(({resolve:e})=>{l(e)&&e(-1)}),ue(this)};var vv=wl;function Es(e,t,n,i){let r=Es._verifyAttributes(t);n=n??0;let o=[],a={},s,c,u=r.length;for(let d=0;d<u;++d){let p=r[d];if(p.vertexBuffer){o.push(p);continue}c=p.usage,s=a[c],l(s)||(s=a[c]=[]),s.push(p)}function f(d,p){return Y.getSizeInBytes(p.componentDatatype)-Y.getSizeInBytes(d.componentDatatype)}this._allBuffers=[];for(c in a)if(a.hasOwnProperty(c)){s=a[c],s.sort(f);let d=Es._vertexSizeInBytes(s),p=s[0].usage,g={vertexSizeInBytes:d,vertexBuffer:void 0,usage:p,needsCommit:!1,arrayBuffer:void 0,arrayViews:Es._createArrayViews(s,d)};this._allBuffers.push(g)}this._size=0,this._instanced=i??!1,this._precreated=o,this._context=e,this.writers=void 0,this.va=void 0,this.resize(n)}Es._verifyAttributes=function(e){let t=[];for(let i=0;i<e.length;++i){let r=e[i],o={index:r.index??i,enabled:r.enabled??!0,componentsPerAttribute:r.componentsPerAttribute,componentDatatype:r.componentDatatype??Y.FLOAT,normalize:r.normalize??!1,vertexBuffer:r.vertexBuffer,usage:r.usage??Oe.STATIC_DRAW};t.push(o)}let n=new Array(t.length);for(let i=0;i<t.length;++i){let o=t[i].index;n[o]=!0}return t};Es._vertexSizeInBytes=function(e){let t=0,n=e.length;for(let a=0;a<n;++a){let s=e[a];t+=s.componentsPerAttribute*Y.getSizeInBytes(s.componentDatatype)}let i=n>0?Y.getSizeInBytes(e[0].componentDatatype):0,r=i>0?t%i:0,o=r===0?0:i-r;return t+=o,t};Es._createArrayViews=function(e,t){let n=[],i=0,r=e.length;for(let o=0;o<r;++o){let a=e[o],s=a.componentDatatype;n.push({index:a.index,enabled:a.enabled,componentsPerAttribute:a.componentsPerAttribute,componentDatatype:s,normalize:a.normalize,offsetInBytes:i,vertexSizeInComponentType:t/Y.getSizeInBytes(s),view:void 0}),i+=a.componentsPerAttribute*Y.getSizeInBytes(s)}return n};Es.prototype.resize=function(e){this._size=e;let t=this._allBuffers;this.writers=[];for(let n=0,i=t.length;n<i;++n){let r=t[n];Es._resize(r,this._size),Es._appendWriters(this.writers,r)}A$(this)};Es._resize=function(e,t){if(e.vertexSizeInBytes>0){let n=new ArrayBuffer(t*e.vertexSizeInBytes);if(l(e.arrayBuffer)){let o=new Uint8Array(n),a=new Uint8Array(e.arrayBuffer),s=a.length;for(let c=0;c<s;++c)o[c]=a[c]}let i=e.arrayViews,r=i.length;for(let o=0;o<r;++o){let a=i[o];a.view=Y.createArrayBufferView(a.componentDatatype,n,a.offsetInBytes)}e.arrayBuffer=n}};var bKe=[function(e,t,n){return function(i,r){t[i*n]=r,e.needsCommit=!0}},function(e,t,n){return function(i,r,o){let a=i*n;t[a]=r,t[a+1]=o,e.needsCommit=!0}},function(e,t,n){return function(i,r,o,a){let s=i*n;t[s]=r,t[s+1]=o,t[s+2]=a,e.needsCommit=!0}},function(e,t,n){return function(i,r,o,a,s){let c=i*n;t[c]=r,t[c+1]=o,t[c+2]=a,t[c+3]=s,e.needsCommit=!0}}];Es._appendWriters=function(e,t){let n=t.arrayViews,i=n.length;for(let r=0;r<i;++r){let o=n[r];e[o.index]=bKe[o.componentsPerAttribute-1](t,o.view,o.vertexSizeInComponentType)}};Es.prototype.commit=function(e){let t=!1,n=this._allBuffers,i,r,o;for(r=0,o=n.length;r<o;++r)i=n[r],t=xKe(this,i)||t;if(t||!l(this.va)){A$(this);let a=this.va=[],s=I.SIXTY_FOUR_KILOBYTES-4,c=l(e)&&!this._instanced?Math.ceil(this._size/s):1;for(let u=0;u<c;++u){let f=[];for(r=0,o=n.length;r<o;++r){i=n[r];let d=u*(i.vertexSizeInBytes*s);Es._appendAttributes(f,i,d,this._instanced)}f=f.concat(this._precreated),a.push({va:new Vn({context:this._context,attributes:f,indexBuffer:e}),indicesCount:1.5*(u!==c-1?s:this._size%s)})}}};function xKe(e,t){if(t.needsCommit&&t.vertexSizeInBytes>0){t.needsCommit=!1;let n=t.vertexBuffer,i=e._size*t.vertexSizeInBytes,r=l(n);if(!r||n.sizeInBytes<i)return r&&n.destroy(),t.vertexBuffer=Ze.createVertexBuffer({context:e._context,typedArray:t.arrayBuffer,usage:t.usage}),t.vertexBuffer.vertexArrayDestroyable=!1,!0;t.vertexBuffer.copyFromArrayView(t.arrayBuffer)}return!1}Es._appendAttributes=function(e,t,n,i){let r=t.arrayViews,o=r.length;for(let a=0;a<o;++a){let s=r[a];e.push({index:s.index,enabled:s.enabled,componentsPerAttribute:s.componentsPerAttribute,componentDatatype:s.componentDatatype,normalize:s.normalize,vertexBuffer:t.vertexBuffer,offsetInBytes:n+s.offsetInBytes,strideInBytes:t.vertexSizeInBytes,instanceDivisor:i?1:0})}};Es.prototype.subCommit=function(e,t){let n=this._allBuffers;for(let i=0,r=n.length;i<r;++i)TKe(n[i],e,t)};function TKe(e,t,n){if(e.needsCommit&&e.vertexSizeInBytes>0){let i=e.vertexSizeInBytes*t,r=e.vertexSizeInBytes*n;e.vertexBuffer.copyFromArrayView(new Uint8Array(e.arrayBuffer,i,r),i)}}Es.prototype.endSubCommits=function(){let e=this._allBuffers;for(let t=0,n=e.length;t<n;++t)e[t].needsCommit=!1};function A$(e){let t=e.va;if(!l(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].va.destroy();e.va=void 0}Es.prototype.isDestroyed=function(){return!1};Es.prototype.destroy=function(){let e=this._allBuffers;for(let t=0,n=e.length;t<n;++t){let i=e[t];i.vertexBuffer=i.vertexBuffer&&i.vertexBuffer.destroy()}return A$(this),ue(this)};var ay=Es;function CKe(e,t,n){let i={flipY:!0,skipColorSpaceConversion:n,preferImageBitmap:!0},r=[De.createIfNeeded(t.positiveX).fetchImage(i),De.createIfNeeded(t.negativeX).fetchImage(i),De.createIfNeeded(t.positiveY).fetchImage(i),De.createIfNeeded(t.negativeY).fetchImage(i),De.createIfNeeded(t.positiveZ).fetchImage(i),De.createIfNeeded(t.negativeZ).fetchImage(i)];return Promise.all(r).then(function(o){return new aa({context:e,source:{positiveX:o[0],negativeX:o[1],positiveY:o[2],negativeY:o[3],positiveZ:o[4],negativeZ:o[5]}})})}var qk=CKe;var vKe=Object.freeze({DONE:0,PENDING:1,FAILED:2}),It=vKe;function Il(){this._dataSources=[],this._dataSourceAdded=new be,this._dataSourceRemoved=new be,this._dataSourceMoved=new be}Object.defineProperties(Il.prototype,{length:{get:function(){return this._dataSources.length}},dataSourceAdded:{get:function(){return this._dataSourceAdded}},dataSourceRemoved:{get:function(){return this._dataSourceRemoved}},dataSourceMoved:{get:function(){return this._dataSourceMoved}}});Il.prototype.add=function(e){let t=this,n=this._dataSources;return Promise.resolve(e).then(function(i){return n===t._dataSources&&(t._dataSources.push(i),t._dataSourceAdded.raiseEvent(t,i)),i})};Il.prototype.remove=function(e,t){t=t??!1;let n=this._dataSources.indexOf(e);return n!==-1?(this._dataSources.splice(n,1),this._dataSourceRemoved.raiseEvent(this,e),t&&typeof e.destroy=="function"&&e.destroy(),!0):!1};Il.prototype.removeAll=function(e){e=e??!1;let t=this._dataSources;for(let n=0,i=t.length;n<i;++n){let r=t[n];this._dataSourceRemoved.raiseEvent(this,r),e&&typeof r.destroy=="function"&&r.destroy()}this._dataSources=[]};Il.prototype.contains=function(e){return this.indexOf(e)!==-1};Il.prototype.indexOf=function(e){return this._dataSources.indexOf(e)};Il.prototype.get=function(e){return this._dataSources[e]};Il.prototype.getByName=function(e){return this._dataSources.filter(function(t){return t.name===e})};function Yk(e,t){return e.indexOf(t)}function _0e(e,t,n){let i=e._dataSources,r=i.length-1;if(t=I.clamp(t,0,r),n=I.clamp(n,0,r),t===n)return;let o=i[t];i[t]=i[n],i[n]=o,e.dataSourceMoved.raiseEvent(o,n,t)}Il.prototype.raise=function(e){let t=Yk(this._dataSources,e);_0e(this,t,t+1)};Il.prototype.lower=function(e){let t=Yk(this._dataSources,e);_0e(this,t,t-1)};Il.prototype.raiseToTop=function(e){let t=Yk(this._dataSources,e);t!==this._dataSources.length-1&&(this._dataSources.splice(t,1),this._dataSources.push(e),this.dataSourceMoved.raiseEvent(e,this._dataSources.length-1,t))};Il.prototype.lowerToBottom=function(e){let t=Yk(this._dataSources,e);t!==0&&(this._dataSources.splice(t,1),this._dataSources.splice(0,0,e),this.dataSourceMoved.raiseEvent(e,0,t))};Il.prototype.isDestroyed=function(){return!1};Il.prototype.destroy=function(){return this.removeAll(!0),ue(this)};var Xk=Il;var Kk=`in vec4 v_startPlaneNormalEcAndHalfWidth;
|
|
in vec4 v_endPlaneNormalEcAndBatchId;
|
|
in vec4 v_rightPlaneEC; // Technically can compute distance for this here
|
|
in vec4 v_endEcAndStartEcX;
|
|
in vec4 v_texcoordNormalizationAndStartEcYZ;
|
|
|
|
#ifdef PER_INSTANCE_COLOR
|
|
in vec4 v_color;
|
|
#endif
|
|
|
|
void main(void)
|
|
{
|
|
float logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw)));
|
|
vec3 ecStart = vec3(v_endEcAndStartEcX.w, v_texcoordNormalizationAndStartEcYZ.zw);
|
|
|
|
// Discard for sky
|
|
if (logDepthOrDepth == 0.0) {
|
|
#ifdef DEBUG_SHOW_VOLUME
|
|
out_FragColor = vec4(1.0, 0.0, 0.0, 0.5);
|
|
return;
|
|
#else // DEBUG_SHOW_VOLUME
|
|
discard;
|
|
#endif // DEBUG_SHOW_VOLUME
|
|
}
|
|
|
|
vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);
|
|
eyeCoordinate /= eyeCoordinate.w;
|
|
|
|
float halfMaxWidth = v_startPlaneNormalEcAndHalfWidth.w * czm_metersPerPixel(eyeCoordinate);
|
|
// Check distance of the eye coordinate against the right-facing plane
|
|
float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz);
|
|
|
|
// Check eye coordinate against the mitering planes
|
|
float distanceFromStart = czm_planeDistance(v_startPlaneNormalEcAndHalfWidth.xyz, -dot(ecStart, v_startPlaneNormalEcAndHalfWidth.xyz), eyeCoordinate.xyz);
|
|
float distanceFromEnd = czm_planeDistance(v_endPlaneNormalEcAndBatchId.xyz, -dot(v_endEcAndStartEcX.xyz, v_endPlaneNormalEcAndBatchId.xyz), eyeCoordinate.xyz);
|
|
|
|
if (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) {
|
|
#ifdef DEBUG_SHOW_VOLUME
|
|
out_FragColor = vec4(1.0, 0.0, 0.0, 0.5);
|
|
return;
|
|
#else // DEBUG_SHOW_VOLUME
|
|
discard;
|
|
#endif // DEBUG_SHOW_VOLUME
|
|
}
|
|
|
|
// Check distance of the eye coordinate against start and end planes with normals in the right plane.
|
|
// For computing unskewed lengthwise texture coordinate.
|
|
// Can also be used for clipping extremely pointy miters, but in practice unnecessary because of miter breaking.
|
|
|
|
// aligned plane: cross the right plane normal with miter plane normal, then cross the result with right again to point it more "forward"
|
|
vec3 alignedPlaneNormal;
|
|
|
|
// start aligned plane
|
|
alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_startPlaneNormalEcAndHalfWidth.xyz);
|
|
alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz));
|
|
distanceFromStart = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, ecStart), eyeCoordinate.xyz);
|
|
|
|
// end aligned plane
|
|
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
|
|
// Clamp - distance to aligned planes may be negative due to mitering,
|
|
// so fragment texture coordinate might be out-of-bounds.
|
|
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
|
|
|
|
// Premultiply alpha. Required for classification primitives on translucent globe.
|
|
out_FragColor.rgb *= out_FragColor.a;
|
|
|
|
czm_writeDepthClamp();
|
|
}
|
|
`;var $k=`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) {
|
|
// We don't expect the ray to ever be parallel to the plane
|
|
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
|
|
// Use distances for planes aligned with segment to prevent skew in dashing
|
|
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);
|
|
|
|
// Clamp - distance to aligned planes may be negative due to mitering
|
|
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 Jk=`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;
|
|
|
|
// For materials
|
|
#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
|
|
|
|
// Morphing planes using SLERP or NLERP doesn't seem to work, so instead draw the material directly on the shadow volume.
|
|
// Morph views are from very far away and aren't meant to be used precisely, so this should be sufficient.
|
|
void main()
|
|
{
|
|
v_batchId = batchId;
|
|
|
|
// Start position
|
|
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;
|
|
|
|
// Start plane
|
|
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);
|
|
|
|
// Right plane
|
|
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);
|
|
|
|
// End position
|
|
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));
|
|
|
|
// End plane
|
|
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);
|
|
|
|
// Forward direction
|
|
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
|
|
// For computing texture coordinates
|
|
|
|
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
|
|
|
|
// Compute a normal along which to "push" the position out, extending the miter depending on view distance.
|
|
// Position has already been "pushed" by unit length along miter normal, and miter normals are encoded in the planes.
|
|
// Decode the normal to use at this specific vertex, push the position back, and then push to where it needs to be.
|
|
// Since this is morphing, compute both 3D and 2D positions and then blend.
|
|
|
|
// ****** 3D ******
|
|
// Check distance to the end plane and start plane, pick the plane that is closer
|
|
vec4 positionEc3D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position3DHigh, position3DLow); // w = 1.0, see czm_computePosition
|
|
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)); // Points "up" for start plane, "down" at end plane.
|
|
vec3 normalEC = normalize(cross(planeDirection, upOrDown)); // In practice, the opposite seems to work too.
|
|
|
|
// Nudge the top vertex upwards to prevent flickering
|
|
vec3 geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc3D));
|
|
geodeticSurfaceNormal *= float(0.0 <= rightNormalAndTextureCoordinateNormalizationY.w && rightNormalAndTextureCoordinateNormalizationY.w <= 1.0);
|
|
geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT;
|
|
positionEc3D.xyz += geodeticSurfaceNormal;
|
|
|
|
// Determine if this vertex is on the "left" or "right"
|
|
normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w);
|
|
|
|
// A "perfect" implementation would push along normals according to the angle against forward.
|
|
// In practice, just pushing the normal out by halfWidth is sufficient for morph views.
|
|
positionEc3D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc3D)) * normalEC; // prevent artifacts when czm_metersPerPixel is negative (behind camera)
|
|
|
|
// ****** 2D ******
|
|
// Check distance to the end plane and start plane, pick the plane that is closer
|
|
vec4 positionEc2D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy); // w = 1.0, see czm_computePosition
|
|
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)); // Points "up" for start plane, "down" at end plane.
|
|
normalEC = normalize(cross(planeDirection, upOrDown)); // In practice, the opposite seems to work too.
|
|
|
|
// Nudge the top vertex upwards to prevent flickering
|
|
geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc2D));
|
|
geodeticSurfaceNormal *= float(0.0 <= texcoordNormalization2D.y && texcoordNormalization2D.y <= 1.0);
|
|
geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT;
|
|
positionEc2D.xyz += geodeticSurfaceNormal;
|
|
|
|
// Determine if this vertex is on the "left" or "right"
|
|
normalEC *= sign(texcoordNormalization2D.x);
|
|
#ifndef PER_INSTANCE_COLOR
|
|
// Use vertex's sidedness to compute its texture coordinate.
|
|
v_texcoordT = clamp(sign(texcoordNormalization2D.x), 0.0, 1.0);
|
|
#endif
|
|
|
|
// A "perfect" implementation would push along normals according to the angle against forward.
|
|
// In practice, just pushing the normal out by halfWidth is sufficient for morph views.
|
|
positionEc2D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc2D)) * normalEC; // prevent artifacts when czm_metersPerPixel is negative (behind camera)
|
|
|
|
// Blend for actual position
|
|
gl_Position = czm_projection * mix(positionEc2D, positionEc3D, czm_morphTime);
|
|
|
|
#ifdef ANGLE_VARYING
|
|
// Approximate relative screen space direction of the line.
|
|
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 Zk=`in vec3 position3DHigh;
|
|
in vec3 position3DLow;
|
|
|
|
// In 2D and in 3D, texture coordinate normalization component signs encodes:
|
|
// * X sign - sidedness relative to right plane
|
|
// * Y sign - is negative OR magnitude is greater than 1.0 if vertex is on bottom of volume
|
|
#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;
|
|
|
|
// For materials
|
|
#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);
|
|
|
|
// Right plane
|
|
v_rightPlaneEC.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw);
|
|
v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart);
|
|
|
|
// start plane
|
|
vec4 startPlaneEC;
|
|
startPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy);
|
|
startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart);
|
|
|
|
// end plane
|
|
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);
|
|
|
|
// start plane
|
|
vec4 startPlaneEC;
|
|
startPlaneEC.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz;
|
|
startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart);
|
|
|
|
// end plane
|
|
vec4 endPlaneEC;
|
|
endPlaneEC.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz;
|
|
endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd);
|
|
|
|
// Right plane
|
|
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
|
|
|
|
// Compute a normal along which to "push" the position out, extending the miter depending on view distance.
|
|
// Position has already been "pushed" by unit length along miter normal, and miter normals are encoded in the planes.
|
|
// Decode the normal to use at this specific vertex, push the position back, and then push to where it needs to be.
|
|
vec4 positionRelativeToEye = czm_computePosition();
|
|
|
|
// Check distance to the end plane and start plane, pick the plane that is closer
|
|
vec4 positionEC = czm_modelViewRelativeToEye * positionRelativeToEye; // w = 1.0, see czm_computePosition
|
|
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)); // Points "up" for start plane, "down" at end plane.
|
|
vec3 normalEC = normalize(cross(planeDirection, upOrDown)); // In practice, the opposite seems to work too.
|
|
|
|
// Extrude bottom vertices downward for far view distances, like for GroundPrimitives
|
|
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));
|
|
|
|
// Determine distance along normalEC to push for a volume of appropriate width.
|
|
// Make volumes about double pixel width for a conservative fit - in practice the
|
|
// extra cost here is minimal compared to the loose volume heights.
|
|
//
|
|
// N = normalEC (guaranteed "right-facing")
|
|
// R = rightEC
|
|
// p = angle between N and R
|
|
// w = distance to push along R if R == N
|
|
// d = distance to push along N
|
|
//
|
|
// N R
|
|
// { p| } * cos(p) = dot(N, R) = w / d
|
|
// d | |w * d = w / dot(N, R)
|
|
// { | }
|
|
// o---------- polyline segment ---->
|
|
//
|
|
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 = distance to push along R
|
|
width = width / dot(normalEC, v_rightPlaneEC.xyz); // width = distance to push along N
|
|
|
|
// Determine if this vertex is on the "left" or "right"
|
|
#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
|
|
// Approximate relative screen space direction of the line.
|
|
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 b$={TERRAIN:0,CESIUM_3D_TILE:1,BOTH:2};b$.NUMBER_OF_CLASSIFICATION_TYPES=3;Object.freeze(b$);var Zn=b$;var Ev=`in vec4 v_color;
|
|
|
|
void main()
|
|
{
|
|
out_FragColor = czm_gammaCorrect(v_color);
|
|
}
|
|
`;var Qk=`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;
|
|
}
|
|
`;function Sv(e){e=e??H.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(Sv.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}}});Sv.prototype.getFragmentShaderSource=function(){let e=[];return this.flat&&e.push("#define FLAT"),this.faceForward&&e.push("#define FACE_FORWARD"),l(this.material)&&e.push(this.material.shaderSource),e.push(this.fragmentShaderSource),e.join(`
|
|
`)};Sv.prototype.isTranslucent=function(){return l(this.material)&&this.material.isTranslucent()||!l(this.material)&&this.translucent};Sv.prototype.getRenderState=function(){let e=this.isTranslucent(),t=Xe(this.renderState,!1);return e?(t.depthMask=!1,t.blending=en.ALPHA_BLEND):t.depthMask=!0,t};Sv.getDefaultRenderState=function(e,t,n){let i={depthTest:{enabled:!0}};return e&&(i.depthMask=!1,i.blending=en.ALPHA_BLEND),t&&(i.cull={enabled:!0,face:Ui.BACK}),l(n)&&(i=Ot(n,i,!0)),i};var Sr=Sv;var EKe=`#define CLIP_POLYLINE
|
|
${cu}
|
|
${Qk}`,SKe=Ev;function Fb(e){e=e??H.EMPTY_OBJECT;let t=e.translucent??!0,n=!1,i=Fb.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??EKe,this._fragmentShaderSource=e.fragmentShaderSource??SKe,this._renderState=Sr.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(Fb.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}}});Fb.VERTEX_FORMAT=Be.POSITION_ONLY;Fb.prototype.getFragmentShaderSource=Sr.prototype.getFragmentShaderSource;Fb.prototype.isTranslucent=Sr.prototype.isTranslucent;Fb.prototype.getRenderState=Sr.prototype.getRenderState;var Ua=Fb;var e3=`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 wv=`#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 t3=`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 n3=`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 i3=`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;
|
|
|
|
// From Stefan Gustavson's Procedural Textures in GLSL in OpenGL Insights
|
|
float b = mod(floor(repeat.s * st.s) + floor(repeat.t * st.t), 2.0); // 0.0 or 1.0
|
|
|
|
// Find the distance from the closest separator (region between two colors)
|
|
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 r3=`uniform vec4 lightColor;
|
|
uniform vec4 darkColor;
|
|
uniform vec2 repeat;
|
|
|
|
czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
{
|
|
czm_material material = czm_getDefaultMaterial(materialInput);
|
|
|
|
// From Stefan Gustavson's Procedural Textures in GLSL in OpenGL Insights
|
|
float b = smoothstep(0.3, 0.32, length(fract(repeat * materialInput.st) - 0.5)); // 0.0 or 1.0
|
|
|
|
vec4 color = mix(lightColor, darkColor, b);
|
|
color = czm_gammaCorrect(color);
|
|
material.diffuse = color.rgb;
|
|
material.alpha = color.a;
|
|
|
|
return material;
|
|
}
|
|
`;var o3=`uniform sampler2D heights;
|
|
uniform sampler2D colors;
|
|
|
|
// This material expects heights to be sorted from lowest to highest.
|
|
|
|
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);
|
|
|
|
// early-out when outside the height range
|
|
if (height < minHeight || height > maxHeight) {
|
|
material.diffuse = vec3(0.0);
|
|
material.alpha = 0.0;
|
|
return material;
|
|
}
|
|
|
|
// Binary search to find heights above and below.
|
|
int idxBelow = 0;
|
|
int idxAbove = heightsDimensions.x;
|
|
float heightBelow = minHeight;
|
|
float heightAbove = maxHeight;
|
|
|
|
// while loop not allowed, so use for loop with max iterations.
|
|
// maxIterations of 16 supports a texture size up to 65536 (2^16).
|
|
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);
|
|
|
|
// undo preumultiplied alpha
|
|
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 a3=`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
|
|
// If no derivatives available (IE 10?), use pixel ratio
|
|
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 s3=`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 c3=`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 l3=`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;
|
|
|
|
// Fuzz Factor - Controls blurriness of lines
|
|
#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))
|
|
const float fuzz = 1.2;
|
|
vec2 thickness = (lineThickness * czm_pixelRatio) - 1.0;
|
|
|
|
// From "3D Engine Design for Virtual Globes" by Cozzi and Ring, Listing 4.13.
|
|
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
|
|
// If no derivatives available (IE 10?), revert to view-dependent fuzz
|
|
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
|
|
|
|
// Edges taken from RimLightingMaterial.glsl
|
|
// See http://www.fundza.com/rman_shaders/surface/fake_rim/fake_rim1.html
|
|
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 u3=`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 f3=`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
|
|
// If no derivatives available (IE 10?), 2.5% of the line will be the arrow head
|
|
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);
|
|
|
|
// Find the distance from the closest separator (region between two colors)
|
|
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 d3=`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;
|
|
|
|
// Get the relative position within the dash from 0 to 1
|
|
float dashPosition = fract(pos.x / (dashLength * czm_pixelRatio));
|
|
// Figure out the mask index.
|
|
float maskIndex = floor(dashPosition * maskLength);
|
|
// Test the bit mask.
|
|
float maskTest = floor(dashPattern / pow(2.0, maskIndex));
|
|
vec4 fragColor = (mod(maskTest, 2.0) < 1.0) ? gapColor : color;
|
|
if (fragColor.a < 0.005) { // matches 0/255 and 1/255
|
|
discard;
|
|
}
|
|
|
|
fragColor = czm_gammaCorrect(fragColor);
|
|
material.emission = fragColor.rgb;
|
|
material.alpha = fragColor.a;
|
|
return material;
|
|
}
|
|
`;var h3=`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(glow, 0.0, 1.0) * color.a;
|
|
fragColor = czm_gammaCorrect(fragColor);
|
|
|
|
material.emission = fragColor.rgb;
|
|
material.alpha = fragColor.a;
|
|
|
|
return material;
|
|
}
|
|
`;var m3=`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);
|
|
|
|
// Find the distance from the closest separator (region between two colors)
|
|
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 p3=`uniform vec4 color;
|
|
uniform vec4 rimColor;
|
|
uniform float width;
|
|
|
|
czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
{
|
|
czm_material material = czm_getDefaultMaterial(materialInput);
|
|
|
|
// See http://www.fundza.com/rman_shaders/surface/fake_rim/fake_rim1.html
|
|
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 g3=`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 _3=`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);
|
|
|
|
// Based on the Stripes Fragment Shader in the Orange Book (11.1.2)
|
|
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 y3=`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 A3=`// Thanks for the contribution Jonas
|
|
// http://29a.ch/2012/7/19/webgl-terrain-rendering-water-fog
|
|
|
|
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;
|
|
|
|
// fade is a function of the distance from the fragment and the frequency of the waves
|
|
float fade = max(1.0, (length(materialInput.positionToEyeEC) / 10000000000.0) * frequency * fadeFactor);
|
|
|
|
float specularMapValue = texture(specularMap, materialInput.st).r;
|
|
|
|
// note: not using directional motion at this time, just set the angle to 0.0;
|
|
vec4 noise = czm_getWaterNoise(normalMap, materialInput.st * frequency, time, 0.0);
|
|
vec3 normalTangentSpace = noise.xyz * vec3(1.0, 1.0, (1.0 / amplitude));
|
|
|
|
// fade out the normal perturbation as we move further from the water surface
|
|
normalTangentSpace.xy /= fade;
|
|
|
|
// attempt to fade out the normal perturbation as we approach non water areas (low specular map value)
|
|
normalTangentSpace = mix(vec3(0.0, 0.0, 50.0), normalTangentSpace, specularMapValue);
|
|
|
|
normalTangentSpace = normalize(normalTangentSpace);
|
|
|
|
// get ratios for alignment of the new normal vector with a vector perpendicular to the tangent plane
|
|
float tsPerturbationRatio = clamp(dot(normalTangentSpace, vec3(0.0, 0.0, 1.0)), 0.0, 1.0);
|
|
|
|
// fade out water effect as specular map value decreases
|
|
material.alpha = mix(blendColor.a, baseWaterColor.a, specularMapValue) * specularMapValue;
|
|
|
|
// base color is a blend of the water and non-water color based on the value from the specular map
|
|
// may need a uniform blend factor to better control this
|
|
material.diffuse = mix(blendColor.rgb, baseWaterColor.rgb, specularMapValue);
|
|
|
|
// diffuse highlights are based on how perturbed the normal is
|
|
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 et(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??Gt.LINEAR,this._magnificationFilter=e.magnificationFilter??ni.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,this._initializationPromises=[],this._initializationError=void 0,wKe(e,this),Object.defineProperties(this,{type:{value:this.type,writable:!1},minificationFilter:{get:function(){return this._minificationFilter},set:function(t){this._minificationFilter=t}},magnificationFilter:{get:function(){return this._magnificationFilter},set:function(t){this._magnificationFilter=t}}}),l(et._uniformList[this.type])||(et._uniformList[this.type]=Object.keys(this._uniforms))}et._uniformList={};et.fromType=function(e,t){let n=new et({fabric:{type:e}});if(l(t))for(let i in t)t.hasOwnProperty(i)&&(n.uniforms[i]=t[i]);return n};et.fromTypeAsync=async function(e,t){let n=[],i=new et({fabric:{type:e,uniforms:t}});if(b0e(i,n),await Promise.all(n),n.length=0,l(i._initializationError))throw i._initializationError;return i};function b0e(e,t){t.push(...e._initializationPromises);let n=e.materials;for(let i in n)if(n.hasOwnProperty(i)){let r=n[i];b0e(r,t)}}et.prototype.isTranslucent=function(){if(l(this.translucent))return typeof this.translucent=="function"?this.translucent():this.translucent;let e=!0,t=this._translucentFunctions,n=t.length;for(let i=0;i<n;++i){let r=t[i];if(typeof r=="function"?e=e&&r():e=e&&r,!e)break}return e};et.prototype.update=function(e){this._defaultTexture=e.defaultTexture;let t,n,i=this._loadedImages,r=i.length;for(t=0;t<r;++t){let c=i[t];n=c.id;let u=c.image,f;Array.isArray(u)&&(f=u.slice(1,u.length).map(function(y){return y.bufferView}),u=u[0]);let d=new Ut({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter}),p;l(u.internalFormat)?p=new Et({context:e,pixelFormat:u.internalFormat,width:u.width,height:u.height,source:{arrayBufferView:u.bufferView,mipLevels:f},sampler:d}):p=new Et({context:e,source:u,sampler:d});let g=this._textures[n];l(g)&&g!==this._defaultTexture&&g.destroy(),this._textures[n]=p;let m=`${n}Dimensions`;if(this.uniforms.hasOwnProperty(m)){let y=this.uniforms[m];y.x=p._width,y.y=p._height}}i.length=0;let o=this._loadedCubeMaps;for(r=o.length,t=0;t<r;++t){let c=o[t];n=c.id;let u=c.images,f=new aa({context:e,source:{positiveX:u[0],negativeX:u[1],positiveY:u[2],negativeY:u[3],positiveZ:u[4],negativeZ:u[5]},sampler:new Ut({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter})});this._textures[n]=f}o.length=0;let a=this._updateFunctions;for(r=a.length,t=0;t<r;++t)a[t](this,e);let s=this.materials;for(let c in s)s.hasOwnProperty(c)&&s[c].update(e)};et.prototype.isDestroyed=function(){return!1};et.prototype.destroy=function(){let e=this._textures;for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];i!==this._defaultTexture&&i.destroy()}let t=this.materials;for(let n in t)t.hasOwnProperty(n)&&t[n].destroy();return ue(this)};function wKe(e,t){e=e??H.EMPTY_OBJECT,t._strict=e.strict??!1,t._count=e.count??0,t._template=Xe(e.fabric??H.EMPTY_OBJECT),t.fabric=Xe(e.fabric??H.EMPTY_OBJECT),t._template.uniforms=Xe(t._template.uniforms??H.EMPTY_OBJECT),t._template.materials=Xe(t._template.materials??H.EMPTY_OBJECT),t.type=l(t._template.type)?t._template.type:Kn(),t.shaderSource="",t.materials={},t.uniforms={},t._uniforms={},t._translucentFunctions=[];let n,i=et._materialCache.getMaterial(t.type);if(l(i)){let o=Xe(i.fabric,!0);t._template=Ot(t._template,o,!0),n=i.translucent}RKe(t),MKe(t),BKe(t),zKe(t),l(i)||et._materialCache.addMaterial(t.type,t);let r=t._translucentFunctions.length===0?!0:void 0;if(n=n??r,n=e.translucent??n,l(n))if(typeof n=="function"){let o=function(){return n(t)};t._translucentFunctions.push(o)}else t._translucentFunctions.push(n)}function x$(e,t,n,i){if(l(e)){for(let r in e)if(e.hasOwnProperty(r)){let o=t.indexOf(r)!==-1;(i&&!o||!i&&o)&&n(r,t)}}}function y0e(e,t){}function IKe(e,t){}var PKe=["type","materials","uniforms","components","source"],DKe=["diffuse","specular","shininess","normal","emission","alpha"];function RKe(e){let t=e._template,n=t.uniforms,i=t.materials,r=t.components;x$(t,PKe,y0e,!0),x$(r,DKe,y0e,!0);let o=[];for(let a in i)i.hasOwnProperty(a)&&o.push(a);x$(n,o,IKe,!1)}function OKe(e,t){let n=t._template.materials;for(let i in n)if(n.hasOwnProperty(i)&&e.indexOf(i)>-1)return!0;return!1}function MKe(e){let t=e._template.components,n=e._template.source;if(l(n))e.shaderSource+=`${n}
|
|
`;else{if(e.shaderSource+=`czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
{
|
|
`,e.shaderSource+=`czm_material material = czm_getDefaultMaterial(materialInput);
|
|
`,l(t)){let i=Object.keys(e._template.materials).length>0;for(let r in t)if(t.hasOwnProperty(r))if(r==="diffuse"||r==="emission"){let a=i&&OKe(t[r],e)?t[r]:`czm_gammaCorrect(${t[r]})`;e.shaderSource+=`material.${r} = ${a};
|
|
`}else r==="alpha"?e.shaderSource+=`material.alpha = ${t.alpha};
|
|
`:e.shaderSource+=`material.${r} = ${t[r]};
|
|
`}e.shaderSource+=`return material;
|
|
}
|
|
`}}var A0e={mat2:Zi,mat3:$,mat4:O},LKe=/\.ktx2$/i;function NKe(e){let t;return function(n,i){let r=n.uniforms,o=r[e],a=t!==o,s=!l(o)||o===et.DefaultImageId;t=o;let c=n._textures[e],u,f;if(o instanceof HTMLVideoElement){if(o.readyState>=2){if(a&&l(c)&&(c!==i.defaultTexture&&c.destroy(),c=void 0),!l(c)||c===i.defaultTexture){let d=new Ut({minificationFilter:n._minificationFilter,magnificationFilter:n._magnificationFilter});c=new Et({context:i,source:o,sampler:d}),n._textures[e]=c;return}c.copyFrom({source:o})}else l(c)||(n._textures[e]=i.defaultTexture);return}if(o instanceof Et&&o!==c){n._texturePaths[e]=void 0;let d=n._textures[e];l(d)&&d!==n._defaultTexture&&d.destroy(),n._textures[e]=o,u=`${e}Dimensions`,r.hasOwnProperty(u)&&(f=r[u],f.x=o._width,f.y=o._height);return}if(a&&l(c)&&s&&(c!==n._defaultTexture&&c.destroy(),c=void 0,n._texturePaths[e]=void 0),l(c)||(c=n._textures[e]=n._defaultTexture,u=`${e}Dimensions`,r.hasOwnProperty(u)&&(f=r[u],f.x=c._width,f.y=c._height)),!s){if((o instanceof HTMLCanvasElement||o instanceof HTMLImageElement||o instanceof ImageBitmap||o instanceof OffscreenCanvas)&&o!==n._texturePaths[e]){n._loadedImages.push({id:e,image:o}),n._texturePaths[e]=o;return}x0e(n,e)}}}function x0e(e,t){let i=e.uniforms[t];if(i===et.DefaultImageId)return Promise.resolve();let r=De.createIfNeeded(i);if(!(r instanceof De))return Promise.resolve();let o=De.createIfNeeded(e._texturePaths[t]);if(!(!l(o)||o.url!==r.url))return Promise.resolve();let s;return LKe.test(r.url)?s=qu(r.url):s=r.fetchImage(),Promise.resolve(s).then(function(c){e._loadedImages.push({id:t,image:c})}).catch(function(c){e._initializationError=c;let u=e._textures[t];l(u)&&u!==e._defaultTexture&&u.destroy(),e._textures[t]=e._defaultTexture}),e._texturePaths[t]=i,s}function FKe(e){return function(t,n){let i=t.uniforms[e];if(i instanceof aa){let r=t._textures[e];r!==t._defaultTexture&&r.destroy(),t._texturePaths[e]=void 0,t._textures[e]=i;return}l(t._textures[e])||(t._textures[e]=n.defaultCubeMap),T0e(t,e)}}function T0e(e,t){let i=e.uniforms[t];if(i===et.DefaultCubeMapId)return Promise.resolve();let r=i.positiveX+i.negativeX+i.positiveY+i.negativeY+i.positiveZ+i.negativeZ;if(r===e._texturePaths[t])return Promise.resolve();let o=[De.createIfNeeded(i.positiveX).fetchImage(),De.createIfNeeded(i.negativeX).fetchImage(),De.createIfNeeded(i.positiveY).fetchImage(),De.createIfNeeded(i.negativeY).fetchImage(),De.createIfNeeded(i.positiveZ).fetchImage(),De.createIfNeeded(i.negativeZ).fetchImage()],a=Promise.all(o);return a.then(function(s){e._loadedCubeMaps.push({id:t,images:s})}).catch(function(s){e._initializationError=s}),e._texturePaths[t]=r,a}function BKe(e){let t=e._template.uniforms;for(let n in t)t.hasOwnProperty(n)&&C0e(e,n)}function C0e(e,t){let n=e._strict,i=e._template.uniforms,r=i[t],o=kKe(r),a;if(o==="channels")a=UP(e,t,r,!1);else{if(o==="sampler2D"){let u=`${t}Dimensions`;UKe(e,u)>0&&(i[u]={type:"ivec3",x:1,y:1},C0e(e,u))}if(!new RegExp(`uniform\\s+${o}\\s+${t}\\s*;`).test(e.shaderSource)){let u=`uniform ${o} ${t};`;e.shaderSource=u+e.shaderSource}let c=`${t}_${e._count++}`;if(a=UP(e,t,c),e.uniforms[t]=r,o==="sampler2D")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(NKe(t)),e._initializationPromises.push(x0e(e,t));else if(o==="samplerCube")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(FKe(t)),e._initializationPromises.push(T0e(e,t));else if(o.indexOf("mat")!==-1){let u=new A0e[o];e._uniforms[c]=function(){return A0e[o].fromColumnMajorArray(e.uniforms[t],u)}}else e._uniforms[c]=function(){return e.uniforms[t]}}}function kKe(e){let t=e.type;if(!l(t)){let n=typeof e;if(n==="number")t="float";else if(n==="boolean")t="bool";else if(n==="string"||e instanceof De||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement||e instanceof ImageBitmap||e instanceof OffscreenCanvas)/^([rgba]){1,4}$/i.test(e)?t="channels":e===et.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 r in e)e.hasOwnProperty(r)&&(i+=1);i>=2&&i<=4?t=`vec${i}`:i===6&&(t="samplerCube")}}return t}function zKe(e){let t=e._strict,n=e._template.materials;for(let i in n)if(n.hasOwnProperty(i)){let r=new et({strict:t,fabric:n[i],count:e._count});e._count=r._count,e._uniforms=Ot(e._uniforms,r._uniforms,!0),e.materials[i]=r,e._translucentFunctions=e._translucentFunctions.concat(r._translucentFunctions);let o="czm_getMaterial",a=`${o}_${e._count++}`;UP(r,o,a),e.shaderSource=r.shaderSource+e.shaderSource;let s=`${a}(materialInput)`,c=UP(e,i,s)}}function UP(e,t,n,i){i=i??!0;let r=0,o="([\\w])?",a=`([\\w${i?".":""}])?`,s=new RegExp(a+t+o,"g");return e.shaderSource=e.shaderSource.replace(s,function(c,u,f){return u||f?c:(r+=1,n)}),r}function UKe(e,t,n){return UP(e,t,t,n)}et._materialCache={_materials:{},addMaterial:function(e,t){this._materials[e]=t},getMaterial:function(e){return this._materials[e]}};et.DefaultImageId="czm_defaultImage";et.DefaultCubeMapId="czm_defaultCubeMap";et.ColorType="Color";et._materialCache.addMaterial(et.ColorType,{fabric:{type:et.ColorType,uniforms:{color:new U(1,0,0,.5)},components:{diffuse:"color.rgb",alpha:"color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});et.ImageType="Image";et._materialCache.addMaterial(et.ImageType,{fabric:{type:et.ImageType,uniforms:{image:et.DefaultImageId,repeat:new k(1,1),color:new U(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}});et.DiffuseMapType="DiffuseMap";et._materialCache.addMaterial(et.DiffuseMapType,{fabric:{type:et.DiffuseMapType,uniforms:{image:et.DefaultImageId,channels:"rgb",repeat:new k(1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});et.AlphaMapType="AlphaMap";et._materialCache.addMaterial(et.AlphaMapType,{fabric:{type:et.AlphaMapType,uniforms:{image:et.DefaultImageId,channel:"a",repeat:new k(1,1)},components:{alpha:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!0});et.SpecularMapType="SpecularMap";et._materialCache.addMaterial(et.SpecularMapType,{fabric:{type:et.SpecularMapType,uniforms:{image:et.DefaultImageId,channel:"r",repeat:new k(1,1)},components:{specular:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!1});et.EmissionMapType="EmissionMap";et._materialCache.addMaterial(et.EmissionMapType,{fabric:{type:et.EmissionMapType,uniforms:{image:et.DefaultImageId,channels:"rgb",repeat:new k(1,1)},components:{emission:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});et.BumpMapType="BumpMap";et._materialCache.addMaterial(et.BumpMapType,{fabric:{type:et.BumpMapType,uniforms:{image:et.DefaultImageId,channel:"r",strength:.8,repeat:new k(1,1)},source:n3},translucent:!1});et.NormalMapType="NormalMap";et._materialCache.addMaterial(et.NormalMapType,{fabric:{type:et.NormalMapType,uniforms:{image:et.DefaultImageId,channels:"rgb",strength:.8,repeat:new k(1,1)},source:u3},translucent:!1});et.GridType="Grid";et._materialCache.addMaterial(et.GridType,{fabric:{type:et.GridType,uniforms:{color:new U(0,1,0,1),cellAlpha:.1,lineCount:new k(8,8),lineThickness:new k(1,1),lineOffset:new k(0,0)},source:l3},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.cellAlpha<1}});et.StripeType="Stripe";et._materialCache.addMaterial(et.StripeType,{fabric:{type:et.StripeType,uniforms:{horizontal:!0,evenColor:new U(1,1,1,.5),oddColor:new U(0,0,1,.5),offset:0,repeat:5},source:_3},translucent:function(e){let t=e.uniforms;return t.evenColor.alpha<1||t.oddColor.alpha<1}});et.CheckerboardType="Checkerboard";et._materialCache.addMaterial(et.CheckerboardType,{fabric:{type:et.CheckerboardType,uniforms:{lightColor:new U(1,1,1,.5),darkColor:new U(0,0,0,.5),repeat:new k(5,5)},source:i3},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});et.DotType="Dot";et._materialCache.addMaterial(et.DotType,{fabric:{type:et.DotType,uniforms:{lightColor:new U(1,1,0,.75),darkColor:new U(0,1,1,.75),repeat:new k(5,5)},source:r3},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});et.WaterType="Water";et._materialCache.addMaterial(et.WaterType,{fabric:{type:et.WaterType,uniforms:{baseWaterColor:new U(.2,.3,.6,1),blendColor:new U(0,1,.699,1),specularMap:et.DefaultImageId,normalMap:et.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:A3},translucent:function(e){let t=e.uniforms;return t.baseWaterColor.alpha<1||t.blendColor.alpha<1}});et.RimLightingType="RimLighting";et._materialCache.addMaterial(et.RimLightingType,{fabric:{type:et.RimLightingType,uniforms:{color:new U(1,0,0,.7),rimColor:new U(1,1,1,.4),width:.3},source:p3},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.rimColor.alpha<1}});et.FadeType="Fade";et._materialCache.addMaterial(et.FadeType,{fabric:{type:et.FadeType,uniforms:{fadeInColor:new U(1,0,0,1),fadeOutColor:new U(0,0,0,0),maximumDistance:.5,repeat:!0,fadeDirection:{x:!0,y:!0},time:new k(.5,.5)},source:c3},translucent:function(e){let t=e.uniforms;return t.fadeInColor.alpha<1||t.fadeOutColor.alpha<1}});et.PolylineArrowType="PolylineArrow";et._materialCache.addMaterial(et.PolylineArrowType,{fabric:{type:et.PolylineArrowType,uniforms:{color:new U(1,1,1,1)},source:f3},translucent:!0});et.PolylineDashType="PolylineDash";et._materialCache.addMaterial(et.PolylineDashType,{fabric:{type:et.PolylineDashType,uniforms:{color:new U(1,0,1,1),gapColor:new U(0,0,0,0),dashLength:16,dashPattern:255},source:d3},translucent:!0});et.PolylineGlowType="PolylineGlow";et._materialCache.addMaterial(et.PolylineGlowType,{fabric:{type:et.PolylineGlowType,uniforms:{color:new U(0,.5,1,1),glowPower:.25,taperPower:1},source:h3},translucent:!0});et.PolylineOutlineType="PolylineOutline";et._materialCache.addMaterial(et.PolylineOutlineType,{fabric:{type:et.PolylineOutlineType,uniforms:{color:new U(1,1,1,1),outlineColor:new U(1,0,0,1),outlineWidth:1},source:m3},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.outlineColor.alpha<1}});et.ElevationContourType="ElevationContour";et._materialCache.addMaterial(et.ElevationContourType,{fabric:{type:et.ElevationContourType,uniforms:{spacing:100,color:new U(1,0,0,1),width:1},source:a3},translucent:!1});et.ElevationRampType="ElevationRamp";et._materialCache.addMaterial(et.ElevationRampType,{fabric:{type:et.ElevationRampType,uniforms:{image:et.DefaultImageId,minimumHeight:0,maximumHeight:1e4},source:s3},translucent:!1});et.SlopeRampMaterialType="SlopeRamp";et._materialCache.addMaterial(et.SlopeRampMaterialType,{fabric:{type:et.SlopeRampMaterialType,uniforms:{image:et.DefaultImageId},source:g3},translucent:!1});et.AspectRampMaterialType="AspectRamp";et._materialCache.addMaterial(et.AspectRampMaterialType,{fabric:{type:et.AspectRampMaterialType,uniforms:{image:et.DefaultImageId},source:t3},translucent:!1});et.ElevationBandType="ElevationBand";et._materialCache.addMaterial(et.ElevationBandType,{fabric:{type:et.ElevationBandType,uniforms:{heights:et.DefaultImageId,colors:et.DefaultImageId},source:o3},translucent:!0});et.WaterMaskType="WaterMask";et._materialCache.addMaterial(et.WaterMaskType,{fabric:{type:et.WaterMaskType,source:y3,uniforms:{waterColor:new U(1,1,1,1),landColor:new U(0,0,0,0)}},translucent:!1});var ir=et;var VKe=`#define CLIP_POLYLINE
|
|
${cu}
|
|
${e3}`,jKe=wv;function Bb(e){e=e??H.EMPTY_OBJECT;let t=e.translucent??!0,n=!1,i=Bb.VERTEX_FORMAT;this.material=l(e.material)?e.material:ir.fromType(ir.ColorType),this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??VKe,this._fragmentShaderSource=e.fragmentShaderSource??jKe,this._renderState=Sr.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(Bb.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}}});Bb.VERTEX_FORMAT=Be.POSITION_AND_ST;Bb.prototype.getFragmentShaderSource=Sr.prototype.getFragmentShaderSource;Bb.prototype.isTranslucent=Sr.prototype.isTranslucent;Bb.prototype.getRenderState=Sr.prototype.getRenderState;var yc=Bb;function V0(e,t,n){if(this._attributes=t,this._numberOfInstances=n,t.length===0)return;let i=HKe(t),r=e.floatingPointTexture,o=i===ke.FLOAT&&!r,a=GKe(t,o),s=WKe(a,t,o),c=Math.floor(Ft.maximumTextureSize/s),u=Math.min(n,c),f=s*u,d=Math.ceil(n/u),p=1/f,g=p*.5,m=1/d,y=m*.5;this._textureDimensions=new k(f,d),this._textureStep=new ae(p,g,m,y),this._pixelDatatype=o?ke.UNSIGNED_BYTE:i,this._packFloats=o,this._offsets=a,this._stride=s,this._texture=void 0;let A=4*f*d;this._batchValues=i===ke.FLOAT&&!o?new Float32Array(A):new Uint8Array(A),this._batchValuesDirty=!1}Object.defineProperties(V0.prototype,{attributes:{get:function(){return this._attributes}},numberOfInstances:{get:function(){return this._numberOfInstances}}});function HKe(e){let t=!1,n=e.length;for(let i=0;i<n;++i)if(e[i].componentDatatype!==Y.UNSIGNED_BYTE){t=!0;break}return t?ke.FLOAT:ke.UNSIGNED_BYTE}function E0e(e,t){let n=e[t].componentsPerAttribute;return n===2?k:n===3?h:n===4?ae:Number}function GKe(e,t){let n=new Array(e.length),i=0,r=e.length;for(let o=0;o<r;++o){let s=e[o].componentDatatype;n[o]=i,s!==Y.UNSIGNED_BYTE&&t?i+=4:++i}return n}function WKe(e,t,n){let i=e.length,r=e[i-1];return t[i-1].componentDatatype!==Y.UNSIGNED_BYTE&&n?r+4:r+1}var VP=new ae;function qKe(e,t,n){let i=ae.unpack(e,t,VP),r=ae.unpackFloat(i);i=ae.unpack(e,t+4,VP);let o=ae.unpackFloat(i);i=ae.unpack(e,t+8,VP);let a=ae.unpackFloat(i);i=ae.unpack(e,t+12,VP);let s=ae.unpackFloat(i);return ae.fromElements(r,o,a,s,n)}function YKe(e,t,n){let i=ae.packFloat(e.x,VP);ae.pack(i,t,n),i=ae.packFloat(e.y,i),ae.pack(i,t,n+4),i=ae.packFloat(e.z,i),ae.pack(i,t,n+8),i=ae.packFloat(e.w,i),ae.pack(i,t,n+12)}var v0e=new ae;V0.prototype.getBatchedAttribute=function(e,t,n){let i=this._attributes,r=this._offsets[t],a=4*this._stride*e+4*r,s;this._packFloats&&i[t].componentDatatype!==ke.UNSIGNED_BYTE?s=qKe(this._batchValues,a,v0e):s=ae.unpack(this._batchValues,a,v0e);let c=E0e(i,t);return l(c.fromCartesian4)?c.fromCartesian4(s,n):l(c.clone)?c.clone(s,n):s.x};var XKe=[void 0,void 0,new k,new h,new ae],KKe=new ae;V0.prototype.setBatchedAttribute=function(e,t,n){let i=this._attributes,r=XKe[i[t].componentsPerAttribute],o=this.getBatchedAttribute(e,t,r),a=E0e(this._attributes,t);if(l(a.equals)?a.equals(o,n):o===n)return;let c=KKe;c.x=l(n.x)?n.x:n,c.y=l(n.y)?n.y:0,c.z=l(n.z)?n.z:0,c.w=l(n.w)?n.w:0;let u=this._offsets[t],d=4*this._stride*e+4*u;this._packFloats&&i[t].componentDatatype!==ke.UNSIGNED_BYTE?YKe(c,this._batchValues,d):ae.pack(c,this._batchValues,d),this._batchValuesDirty=!0};function $Ke(e,t){let n=e._textureDimensions;e._texture=new Et({context:t,pixelFormat:He.RGBA,pixelDatatype:e._pixelDatatype,width:n.x,height:n.y,sampler:Ut.NEAREST,flipY:!1})}function JKe(e){let t=e._textureDimensions;e._texture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}V0.prototype.update=function(e){l(this._texture)&&!this._batchValuesDirty||this._attributes.length===0||(this._batchValuesDirty=!1,l(this._texture)||$Ke(this,e.context),JKe(this))};V0.prototype.getUniformMapCallback=function(){let e=this;return function(t){return e._attributes.length===0?t:Ot(t,{batchTexture:function(){return e._texture},batchTextureDimensions:function(){return e._textureDimensions},batchTextureStep:function(){return e._textureStep}})}};function ZKe(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 QKe(e){return e===1?"float":`vec${e}`}function e$e(e){return e===1?".x":e===2?".xy":e===3?".xyz":""}function t$e(e,t){let i=e._attributes[t],r=i.componentsPerAttribute,o=i.functionName,a=QKe(r),s=e$e(r),c=e._offsets[t],u=`${a} ${o}(float batchId)
|
|
{
|
|
vec2 st = computeSt(batchId);
|
|
st.x += batchTextureStep.x * float(${c});
|
|
`;return e._packFloats&&i.componentDatatype!==ke.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+=` ${a} value = textureValue${s};
|
|
`,e._pixelDatatype===ke.UNSIGNED_BYTE&&i.componentDatatype===Y.UNSIGNED_BYTE&&!i.normalize?u+=`value *= 255.0;
|
|
`:e._pixelDatatype===ke.FLOAT&&i.componentDatatype===Y.UNSIGNED_BYTE&&i.normalize&&(u+=`value /= 255.0;
|
|
`),u+=` return value;
|
|
}
|
|
`,u}V0.prototype.getVertexShaderCallback=function(){let e=this._attributes;if(e.length===0)return function(i){return i};let t=`uniform highp sampler2D batchTexture;
|
|
`;t+=`${ZKe(this)}
|
|
`;let n=e.length;for(let i=0;i<n;++i)t+=t$e(this,i);return function(i){let r=i.indexOf("void main"),o=i.substring(0,r),a=i.substring(r);return`${o}
|
|
${t}
|
|
${a}`}};V0.prototype.isDestroyed=function(){return!1};V0.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),ue(this)};var Iv=V0;var S0e={NEVER:ee.NEVER,LESS:ee.LESS,EQUAL:ee.EQUAL,LESS_OR_EQUAL:ee.LEQUAL,GREATER:ee.GREATER,NOT_EQUAL:ee.NOTEQUAL,GREATER_OR_EQUAL:ee.GEQUAL,ALWAYS:ee.ALWAYS};Object.freeze(S0e);var Ac=S0e;function n$e(e,t,n){let i=!n,r=e.length,o;if(!i&&r>1){let a=e[0].modelMatrix;for(o=1;o<r;++o)if(!O.equals(a,e[o].modelMatrix)){i=!0;break}}if(i)for(o=0;o<r;++o)l(e[o].geometry)&&Gn.transformToWorldCoordinates(e[o]);else O.multiplyTransformation(t,e[0].modelMatrix,t)}function T$(e,t){let n=e.attributes,i=n.position,r=i.values.length/i.componentsPerAttribute;n.batchId=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:1,values:new Float32Array(r)});let o=n.batchId.values;for(let a=0;a<r;++a)o[a]=t}function i$e(e){let t=e.length;for(let n=0;n<t;++n){let i=e[n];l(i.geometry)?T$(i.geometry,n):l(i.westHemisphereGeometry)&&l(i.eastHemisphereGeometry)&&(T$(i.westHemisphereGeometry,n),T$(i.eastHemisphereGeometry,n))}}function r$e(e){let t=e.instances,n=e.projection,i=e.elementIndexUintSupported,r=e.scene3DOnly,o=e.vertexCacheOptimize,a=e.compressVertices,s=e.modelMatrix,c,u,f,d=t.length;for(c=0;c<d;++c)if(l(t[c].geometry)){f=t[c].geometry.primitiveType;break}if(n$e(t,s,r),!r)for(c=0;c<d;++c)l(t[c].geometry)&&Gn.splitLongitude(t[c]);if(i$e(t),o)for(c=0;c<d;++c){let g=t[c];l(g.geometry)?(Gn.reorderForPostVertexCache(g.geometry),Gn.reorderForPreVertexCache(g.geometry)):l(g.westHemisphereGeometry)&&l(g.eastHemisphereGeometry)&&(Gn.reorderForPostVertexCache(g.westHemisphereGeometry),Gn.reorderForPreVertexCache(g.westHemisphereGeometry),Gn.reorderForPostVertexCache(g.eastHemisphereGeometry),Gn.reorderForPreVertexCache(g.eastHemisphereGeometry))}let p=Gn.combineInstances(t);for(d=p.length,c=0;c<d;++c){u=p[c];let g=u.attributes;if(r)for(let m in g)g.hasOwnProperty(m)&&g[m].componentDatatype===Y.DOUBLE&&Gn.encodeAttribute(u,m,`${m}3DHigh`,`${m}3DLow`);else for(let m in g)if(g.hasOwnProperty(m)&&g[m].componentDatatype===Y.DOUBLE){let y=`${m}3D`,A=`${m}2D`;Gn.projectTo2D(u,m,y,A,n),l(u.boundingSphere)&&m==="position"&&(u.boundingSphereCV=se.fromVertices(u.attributes.position2D.values)),Gn.encodeAttribute(u,y,`${y}High`,`${y}Low`),Gn.encodeAttribute(u,A,`${A}High`,`${A}Low`)}a&&Gn.compressVertices(u)}if(!i){let g=[];for(d=p.length,c=0;c<d;++c)u=p[c],g=g.concat(Gn.fitToUnsignedShortIndices(u));p=g}return p}function C$(e,t,n,i){let r,o,a,s=i.length-1;if(s>=0){let u=i[s];r=u.offset+u.count,a=u.index,o=n[a].indices.length}else r=0,a=0,o=n[a].indices.length;let c=e.length;for(let u=0;u<c;++u){let d=e[u][t];if(!l(d))continue;let p=d.indices.length;r+p>o&&(r=0,o=n[++a].indices.length),i.push({index:a,offset:r,count:p}),r+=p}}function o$e(e,t){let n=[];return C$(e,"geometry",t,n),C$(e,"westHemisphereGeometry",t,n),C$(e,"eastHemisphereGeometry",t,n),n}var j0={};j0.combineGeometry=function(e){let t,n,i=e.instances,r=i.length,o,a,s=!1;r>0&&(t=r$e(e),t.length>0&&(n=Gn.createAttributeLocations(t[0]),e.createPickOffsets&&(o=o$e(i,t))),l(i[0].attributes)&&l(i[0].attributes.offset)&&(a=new Array(r),s=!0));let c=new Array(r),u=new Array(r);for(let f=0;f<r;++f){let d=i[f],p=d.geometry;l(p)&&(c[f]=p.boundingSphere,u[f]=p.boundingSphereCV,s&&(a[f]=d.geometry.offsetAttribute));let g=d.eastHemisphereGeometry,m=d.westHemisphereGeometry;l(g)&&l(m)&&(l(g.boundingSphere)&&l(m.boundingSphere)&&(c[f]=se.union(g.boundingSphere,m.boundingSphere)),l(g.boundingSphereCV)&&l(m.boundingSphereCV)&&(u[f]=se.union(g.boundingSphereCV,m.boundingSphereCV)))}return{geometries:t,modelMatrix:e.modelMatrix,attributeLocations:n,pickOffsets:o,offsetInstanceExtend:a,boundingSpheres:c,boundingSpheresCV:u}};function a$e(e,t){let n=e.attributes;for(let i in n)if(n.hasOwnProperty(i)){let r=n[i];l(r)&&l(r.values)&&t.push(r.values.buffer)}l(e.indices)&&t.push(e.indices.buffer)}function s$e(e,t){let n=e.length;for(let i=0;i<n;++i)a$e(e[i],t)}function c$e(e){let t=1,n=e.length;for(let i=0;i<n;i++){let r=e[i];if(++t,!l(r))continue;let o=r.attributes;t+=7+2*se.packedLength+(l(r.indices)?r.indices.length:0);for(let a in o)if(o.hasOwnProperty(a)&&l(o[a])){let s=o[a];t+=5+s.values.length}}return t}j0.packCreateGeometryResults=function(e,t){let n=new Float64Array(c$e(e)),i=[],r={},o=e.length,a=0;n[a++]=o;for(let s=0;s<o;s++){let c=e[s],u=l(c);if(n[a++]=u?1:0,!u)continue;n[a++]=c.primitiveType,n[a++]=c.geometryType,n[a++]=c.offsetAttribute??-1;let f=l(c.boundingSphere)?1:0;n[a++]=f,f&&se.pack(c.boundingSphere,n,a),a+=se.packedLength;let d=l(c.boundingSphereCV)?1:0;n[a++]=d,d&&se.pack(c.boundingSphereCV,n,a),a+=se.packedLength;let p=c.attributes,g=[];for(let y in p)p.hasOwnProperty(y)&&l(p[y])&&(g.push(y),l(r[y])||(r[y]=i.length,i.push(y)));n[a++]=g.length;for(let y=0;y<g.length;y++){let A=g[y],b=p[A];n[a++]=r[A],n[a++]=b.componentDatatype,n[a++]=b.componentsPerAttribute,n[a++]=b.normalize?1:0,n[a++]=b.values.length,n.set(b.values,a),a+=b.values.length}let m=l(c.indices)?c.indices.length:0;n[a++]=m,m>0&&(n.set(c.indices,a),a+=m)}return t.push(n.buffer),{stringTable:i,packedData:n}};j0.unpackCreateGeometryResults=function(e){let t=e.stringTable,n=e.packedData,i,r=new Array(n[0]),o=0,a=1;for(;a<n.length;){if(!(n[a++]===1)){r[o++]=void 0;continue}let c=n[a++],u=n[a++],f=n[a++];f===-1&&(f=void 0);let d,p;n[a++]===1&&(d=se.unpack(n,a)),a+=se.packedLength,n[a++]===1&&(p=se.unpack(n,a)),a+=se.packedLength;let y,A,b,x=new xn,T=n[a++];for(i=0;i<T;i++){let E=t[n[a++]],w=n[a++];b=n[a++];let D=n[a++]!==0;y=n[a++],A=Y.createTypedArray(w,y);for(let R=0;R<y;R++)A[R]=n[a++];x[E]=new Me({componentDatatype:w,componentsPerAttribute:b,normalize:D,values:A})}let C;if(y=n[a++],y>0){let E=A.length/b;for(C=Ve.createTypedArray(E,y),i=0;i<y;i++)C[i]=n[a++]}r[o++]=new Tt({primitiveType:c,geometryType:u,boundingSphere:d,boundingSphereCV:p,indices:C,attributes:x,offsetAttribute:f})}return r};function l$e(e,t){let n=e.length,i=new Float64Array(1+n*19),r=0;i[r++]=n;for(let o=0;o<n;o++){let a=e[o];if(O.pack(a.modelMatrix,i,r),r+=O.packedLength,l(a.attributes)&&l(a.attributes.offset)){let s=a.attributes.offset.value;i[r]=s[0],i[r+1]=s[1],i[r+2]=s[2]}r+=3}return t.push(i.buffer),i}function u$e(e){let t=e,n=new Array(t[0]),i=0,r=1;for(;r<t.length;){let o=O.unpack(t,r),a;r+=O.packedLength,l(t[r])&&(a={offset:new yr(t[r],t[r+1],t[r+2])}),r+=3,n[i++]={modelMatrix:o,attributes:a}}return n}j0.packCombineGeometryParameters=function(e,t){let n=e.createGeometryResults,i=n.length;for(let r=0;r<i;r++)t.push(n[r].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:l$e(e.instances,t),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof ki,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}};j0.unpackCombineGeometryParameters=function(e){let t=u$e(e.packedInstances),n=e.createGeometryResults,i=n.length,r=0;for(let s=0;s<i;s++){let c=j0.unpackCreateGeometryResults(n[s]),u=c.length;for(let f=0;f<u;f++){let d=c[f],p=t[r];p.geometry=d,++r}}let o=te.clone(e.ellipsoid),a=e.isGeographic?new ki(o):new _i(o);return{instances:t,ellipsoid:o,projection:a,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:O.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}};function w0e(e){let t=e.length,n=1+(se.packedLength+1)*t,i=new Float32Array(n),r=0;i[r++]=t;for(let o=0;o<t;++o){let a=e[o];l(a)?(i[r++]=1,se.pack(e[o],i,r)):i[r++]=0,r+=se.packedLength}return i}function I0e(e){let t=new Array(e[0]),n=0,i=1;for(;i<e.length;)e[i++]===1&&(t[n]=se.unpack(e,i)),++n,i+=se.packedLength;return t}j0.packCombineGeometryResults=function(e,t){l(e.geometries)&&s$e(e.geometries,t);let n=w0e(e.boundingSpheres),i=w0e(e.boundingSpheresCV);return t.push(n.buffer,i.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:n,boundingSpheresCV:i}};j0.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:I0e(e.boundingSpheres),boundingSpheresCV:I0e(e.boundingSpheresCV)}};var Pv=j0;var P0e={READY:0,CREATING:1,CREATED:2,COMBINING:3,COMBINED:4,COMPLETE:5,FAILED:6};Object.freeze(P0e);var sa=P0e;var du={DISABLED:0,ENABLED:1,CAST_ONLY:2,RECEIVE_ONLY:3};du.NUMBER_OF_SHADOW_MODES=4;du.castShadows=function(e){return e===du.ENABLED||e===du.CAST_ONLY};du.receiveShadows=function(e){return e===du.ENABLED||e===du.RECEIVE_ONLY};du.fromCastReceive=function(e,t){return e&&t?du.ENABLED:e?du.CAST_ONLY:t?du.RECEIVE_ONLY:du.DISABLED};Object.freeze(du);var Rn=du;function Vo(e){e=e??H.EMPTY_OBJECT,this.geometryInstances=e.geometryInstances,this.appearance=e.appearance,this._appearance=void 0,this._material=void 0,this.depthFailAppearance=e.depthFailAppearance,this._depthFailAppearance=void 0,this._depthFailMaterial=void 0,this.modelMatrix=O.clone(e.modelMatrix??O.IDENTITY),this._modelMatrix=new O,this.show=e.show??!0,this._vertexCacheOptimize=e.vertexCacheOptimize??!1,this._interleave=e.interleave??!1,this._releaseGeometryInstances=e.releaseGeometryInstances??!0,this._allowPicking=e.allowPicking??!0,this._asynchronous=e.asynchronous??!0,this._compressVertices=e.compressVertices??!0,this.cull=e.cull??!0,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.rtcCenter=e.rtcCenter,this.shadows=e.shadows??Rn.DISABLED,this._translucent=void 0,this._state=sa.READY,this._geometries=[],this._error=void 0,this._numberOfInstances=0,this._boundingSpheres=[],this._boundingSphereWC=[],this._boundingSphereCV=[],this._boundingSphere2D=[],this._boundingSphereMorph=[],this._perInstanceAttributeCache=new Map,this._instanceIds=[],this._lastPerInstanceAttributeIndex=0,this._va=[],this._attributeLocations=void 0,this._primitiveType=void 0,this._frontFaceRS=void 0,this._backFaceRS=void 0,this._sp=void 0,this._depthFailAppearance=void 0,this._spDepthFail=void 0,this._frontFaceDepthFailRS=void 0,this._backFaceDepthFailRS=void 0,this._pickIds=[],this._colorCommands=[],this._pickCommands=[],this._createBoundingVolumeFunction=e._createBoundingVolumeFunction,this._createRenderStatesFunction=e._createRenderStatesFunction,this._createShaderProgramFunction=e._createShaderProgramFunction,this._createCommandsFunction=e._createCommandsFunction,this._updateAndQueueCommandsFunction=e._updateAndQueueCommandsFunction,this._createPickOffsets=e._createPickOffsets,this._pickOffsets=void 0,this._createGeometryResults=void 0,this._ready=!1,this._batchTable=void 0,this._batchTableAttributeIndices=void 0,this._offsetInstanceExtend=void 0,this._batchTableOffsetAttribute2DIndex=void 0,this._batchTableOffsetsUpdated=!1,this._instanceBoundingSpheres=void 0,this._instanceBoundingSpheresCV=void 0,this._tempBoundingSpheres=void 0,this._recomputeBoundingSpheres=!1,this._batchTableBoundingSpheresUpdated=!1,this._batchTableBoundingSphereAttributeIndices=void 0}Object.defineProperties(Vo.prototype,{vertexCacheOptimize:{get:function(){return this._vertexCacheOptimize}},interleave:{get:function(){return this._interleave}},releaseGeometryInstances:{get:function(){return this._releaseGeometryInstances}},allowPicking:{get:function(){return this._allowPicking}},asynchronous:{get:function(){return this._asynchronous}},compressVertices:{get:function(){return this._compressVertices}},ready:{get:function(){return this._ready}}});function f$e(e){let t=e.length,n=[],i=e[0].attributes,r;for(r in i)if(i.hasOwnProperty(r)&&l(i[r])){let o=i[r],a=!0;for(let s=1;s<t;++s){let c=e[s].attributes[r];if(!l(c)||o.componentDatatype!==c.componentDatatype||o.componentsPerAttribute!==c.componentsPerAttribute||o.normalize!==c.normalize){a=!1;break}}a&&n.push(r)}return n}var d$e=new k,h$e=new h,k0e=new ae;function z0e(e){let t=e.length;if(t===1)return e[0];if(t===2)return k.unpack(e,0,d$e);if(t===3)return h.unpack(e,0,h$e);if(t===4)return ae.unpack(e,0,k0e)}function m$e(e,t){let n=e.geometryInstances,i=Array.isArray(n)?n:[n],r=i.length;if(r===0)return;let o=f$e(i),a=o.length,s=[],c={},u={},f,p=i[0].attributes,g,m,y;for(g=0;g<a;++g)m=o[g],y=p[m],c[m]=g,s.push({functionName:`czm_batchTable_${m}`,componentDatatype:y.componentDatatype,componentsPerAttribute:y.componentsPerAttribute,normalize:y.normalize});o.indexOf("distanceDisplayCondition")!==-1&&(s.push({functionName:"czm_batchTable_boundingSphereCenter3DHigh",componentDatatype:Y.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter3DLow",componentDatatype:Y.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DHigh",componentDatatype:Y.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DLow",componentDatatype:Y.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereRadius",componentDatatype:Y.FLOAT,componentsPerAttribute:1}),u.center3DHigh=s.length-5,u.center3DLow=s.length-4,u.center2DHigh=s.length-3,u.center2DLow=s.length-2,u.radius=s.length-1),o.indexOf("offset")!==-1&&(s.push({functionName:"czm_batchTable_offset2D",componentDatatype:Y.FLOAT,componentsPerAttribute:3}),f=s.length-1),s.push({functionName:"czm_batchTable_pickColor",componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0});let A=s.length,b=new Iv(t,s,r);for(g=0;g<r;++g){let x=i[g];p=x.attributes;for(let D=0;D<a;++D){m=o[D],y=p[m];let R=z0e(y.value),M=c[m];b.setBatchedAttribute(g,M,R)}let T={primitive:x.pickPrimitive??e};l(x.id)&&(T.id=x.id);let C=t.createPickId(T);e._pickIds.push(C);let E=C.color,w=k0e;w.x=U.floatToByte(E.red),w.y=U.floatToByte(E.green),w.z=U.floatToByte(E.blue),w.w=U.floatToByte(E.alpha),b.setBatchedAttribute(g,A-1,w)}e._batchTable=b,e._batchTableAttributeIndices=c,e._batchTableBoundingSphereAttributeIndices=u,e._batchTableOffsetAttribute2DIndex=f}function p$e(e){let t;return Array.isArray(e.values)?t=e.values.slice(0):t=new e.values.constructor(e.values),new Me({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,values:t})}function g$e(e){let t=e.attributes,n=new xn;for(let r in t)t.hasOwnProperty(r)&&l(t[r])&&(n[r]=p$e(t[r]));let i;if(l(e.indices)){let r=e.indices;Array.isArray(r)?i=r.slice(0):i=new r.constructor(r)}return new Tt({attributes:n,indices:i,primitiveType:e.primitiveType,boundingSphere:se.clone(e.boundingSphere)})}function _$e(e,t){return{geometry:t,attributes:e.attributes,modelMatrix:O.clone(e.modelMatrix),pickPrimitive:e.pickPrimitive,id:e.id}}var y$e=/in\s+vec(?:3|4)\s+(.*)3DHigh;/g;Vo._modifyShaderPosition=function(e,t,n){let i,r="",o="",a="";for(;(i=y$e.exec(t))!==null;){let s=i[1],c=`vec4 czm_compute${s[0].toUpperCase()}${s.substr(1)}()`;c!=="vec4 czm_computePosition()"&&(r+=`${c};
|
|
`),l(e.rtcCenter)?(t=t.replace(/in\s+vec(?:3|4)\s+position3DHigh;/g,""),t=t.replace(/in\s+vec(?:3|4)\s+position3DLow;/g,""),r+=`uniform mat4 u_modifiedModelView;
|
|
`,o+=`in vec4 position;
|
|
`,a+=`${c}
|
|
{
|
|
return u_modifiedModelView * position;
|
|
}
|
|
|
|
`,t=t.replace(/czm_modelViewRelativeToEye\s+\*\s+/g,""),t=t.replace(/czm_modelViewProjectionRelativeToEye/g,"czm_projection")):n?a+=`${c}
|
|
{
|
|
return czm_translateRelativeToEye(${s}3DHigh, ${s}3DLow);
|
|
}
|
|
|
|
`:(o+=`in vec3 ${s}2DHigh;
|
|
in vec3 ${s}2DLow;
|
|
`,a+=`${c}
|
|
{
|
|
vec4 p;
|
|
if (czm_morphTime == 1.0)
|
|
{
|
|
p = czm_translateRelativeToEye(${s}3DHigh, ${s}3DLow);
|
|
}
|
|
else if (czm_morphTime == 0.0)
|
|
{
|
|
p = czm_translateRelativeToEye(${s}2DHigh.zxy, ${s}2DLow.zxy);
|
|
}
|
|
else
|
|
{
|
|
p = czm_columbusViewMorph(
|
|
czm_translateRelativeToEye(${s}2DHigh.zxy, ${s}2DLow.zxy),
|
|
czm_translateRelativeToEye(${s}3DHigh, ${s}3DLow),
|
|
czm_morphTime);
|
|
}
|
|
return p;
|
|
}
|
|
|
|
`)}return[r,o,t,a].join(`
|
|
`)};Vo._appendShowToShader=function(e,t){return l(e._batchTableAttributeIndices.show)?`${Ge.replaceMain(t,"czm_non_show_main")}
|
|
void main()
|
|
{
|
|
czm_non_show_main();
|
|
gl_Position *= czm_batchTable_show(batchId);
|
|
}`:t};Vo._updateColorAttribute=function(e,t,n){if(!l(e._batchTableAttributeIndices.color)&&!l(e._batchTableAttributeIndices.depthFailColor)||t.search(/in\s+vec4\s+color;/g)===-1)return t;let i=t;return i=i.replace(/in\s+vec4\s+color;/g,""),n?i=i.replace(/(\b)color(\b)/g,"$1czm_batchTable_depthFailColor(batchId)$2"):i=i.replace(/(\b)color(\b)/g,"$1czm_batchTable_color(batchId)$2"),i};function D0e(e){return`${Ge.replaceMain(e,"czm_non_pick_main")}
|
|
out vec4 v_pickColor;
|
|
void main()
|
|
{
|
|
czm_non_pick_main();
|
|
v_pickColor = czm_batchTable_pickColor(batchId);
|
|
}`}function R0e(e){return`in vec4 v_pickColor;
|
|
${e}`}Vo._updatePickColorAttribute=function(e){let t=e.replace(/in\s+vec4\s+pickColor;/g,"");return t=t.replace(/(\b)pickColor(\b)/g,"$1czm_batchTable_pickColor(batchId)$2"),t};Vo._appendOffsetToShader=function(e,t){if(!l(e._batchTableAttributeIndices.offset))return t;let n=`in float batchId;
|
|
`;n+="in float applyOffset;";let i=t.replace(/in\s+float\s+batchId;/g,n),r=`vec4 $1 = czm_computePosition();
|
|
`;return r+=` if (czm_sceneMode == czm_sceneMode3D)
|
|
`,r+=` {
|
|
`,r+=" $1 = $1 + vec4(czm_batchTable_offset(batchId) * applyOffset, 0.0);",r+=` }
|
|
`,r+=` else
|
|
`,r+=` {
|
|
`,r+=" $1 = $1 + vec4(czm_batchTable_offset2D(batchId) * applyOffset, 0.0);",r+=` }
|
|
`,i=i.replace(/vec4\s+([A-Za-z0-9_]+)\s+=\s+czm_computePosition\(\);/g,r),i};Vo._appendDistanceDisplayConditionToShader=function(e,t,n){if(!l(e._batchTableAttributeIndices.distanceDisplayCondition))return t;let i=Ge.replaceMain(t,"czm_non_distanceDisplayCondition_main"),r=`void main()
|
|
{
|
|
czm_non_distanceDisplayCondition_main();
|
|
vec2 distanceDisplayCondition = czm_batchTable_distanceDisplayCondition(batchId);
|
|
vec3 boundingSphereCenter3DHigh = czm_batchTable_boundingSphereCenter3DHigh(batchId);
|
|
vec3 boundingSphereCenter3DLow = czm_batchTable_boundingSphereCenter3DLow(batchId);
|
|
float boundingSphereRadius = czm_batchTable_boundingSphereRadius(batchId);
|
|
`;return n?r+=` vec4 centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow);
|
|
`:r+=` vec3 boundingSphereCenter2DHigh = czm_batchTable_boundingSphereCenter2DHigh(batchId);
|
|
vec3 boundingSphereCenter2DLow = czm_batchTable_boundingSphereCenter2DLow(batchId);
|
|
vec4 centerRTE;
|
|
if (czm_morphTime == 1.0)
|
|
{
|
|
centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow);
|
|
}
|
|
else if (czm_morphTime == 0.0)
|
|
{
|
|
centerRTE = czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy);
|
|
}
|
|
else
|
|
{
|
|
centerRTE = czm_columbusViewMorph(
|
|
czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy),
|
|
czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow),
|
|
czm_morphTime);
|
|
}
|
|
`,r+=` float radiusSq = boundingSphereRadius * boundingSphereRadius;
|
|
float distanceSq;
|
|
if (czm_sceneMode == czm_sceneMode2D)
|
|
{
|
|
distanceSq = czm_eyeHeight2D.y - radiusSq;
|
|
}
|
|
else
|
|
{
|
|
distanceSq = dot(centerRTE.xyz, centerRTE.xyz) - radiusSq;
|
|
}
|
|
distanceSq = max(distanceSq, 0.0);
|
|
float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x;
|
|
float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y;
|
|
float show = (distanceSq >= nearSq && distanceSq <= farSq) ? 1.0 : 0.0;
|
|
gl_Position *= show;
|
|
}`,`${i}
|
|
${r}`};function O0e(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 r=t.search(/in\s+vec3\s+tangent;/g)!==-1,o=t.search(/in\s+vec3\s+bitangent;/g)!==-1,a=i&&n?2:1;a+=r||o?1:0;let s=a>1?`vec${a}`:"float",c="compressedAttributes",u=`in ${s} ${c};`,f="",d="";if(i){f+=`vec2 st;
|
|
`;let m=a>1?`${c}.x`:c;d+=` st = czm_decompressTextureCoordinates(${m});
|
|
`}n&&r&&o?(f+=`vec3 normal;
|
|
vec3 tangent;
|
|
vec3 bitangent;
|
|
`,d+=` czm_octDecode(${c}.${i?"yz":"xy"}, normal, tangent, bitangent);
|
|
`):(n&&(f+=`vec3 normal;
|
|
`,d+=` normal = czm_octDecode(${c}${a>1?`.${i?"y":"x"}`:""});
|
|
`),r&&(f+=`vec3 tangent;
|
|
`,d+=` tangent = czm_octDecode(${c}.${i&&n?"z":"y"});
|
|
`),o&&(f+=`vec3 bitangent;
|
|
`,d+=` bitangent = czm_octDecode(${c}.${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=Ge.replaceMain(p,"czm_non_compressed_main");let g=`void main()
|
|
{
|
|
${d} czm_non_compressed_main();
|
|
}`;return[u,f,p,g].join(`
|
|
`)}function A$e(e){let t=Ge.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() {
|
|
czm_non_depth_clamp_main();
|
|
gl_Position = czm_depthClamp(gl_Position);}
|
|
`,t}function b$e(e){let t=Ge.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 M0e(e,t){let n=e.vertexAttributes}function x$e(e,t){return function(){return e[t]}}var v$=Math.max(fn.hardwareConcurrency-1,1),b3,T$e=new Yn("combineGeometry");function C$e(e,t){let n,i,r,o,a=e._instanceIds;if(e._state===sa.READY){n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let s=e._numberOfInstances=n.length,c=[],u=[];for(r=0;r<s;++r)i=n[r].geometry,a.push(n[r].id),u.push({moduleName:i._workerName,modulePath:i._workerPath,geometry:i});if(!l(b3))for(b3=new Array(v$),r=0;r<v$;r++)b3[r]=new Yn("createGeometry");let f;for(u=wk(u,v$),r=0;r<u.length;r++){let d=0,p=u[r],g=p.length;for(o=0;o<g;++o)f=p[o],i=f.geometry,l(i.constructor.pack)&&(f.offset=d,d+=i.constructor.packedLength??i.packedLength);let m;if(d>0){let y=new Float64Array(d);for(m=[y.buffer],o=0;o<g;++o)f=p[o],i=f.geometry,l(i.constructor.pack)&&(i.constructor.pack(i,y,f.offset),f.geometry=y)}c.push(b3[r].scheduleTask({subTasks:u[r]},m))}e._state=sa.CREATING,Promise.all(c).then(function(d){e._createGeometryResults=d,e._state=sa.CREATED}).catch(function(d){HP(e,t,sa.FAILED,d)})}else if(e._state===sa.CREATED){let s=[];n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let c=t.scene3DOnly,u=t.mapProjection,f=T$e.scheduleTask(Pv.packCombineGeometryParameters({createGeometryResults:e._createGeometryResults,instances:n,ellipsoid:u.ellipsoid,projection:u,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:c,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets},s),s);e._createGeometryResults=void 0,e._state=sa.COMBINING,Promise.resolve(f).then(function(d){let p=Pv.unpackCombineGeometryResults(d);e._geometries=p.geometries,e._attributeLocations=p.attributeLocations,e.modelMatrix=O.clone(p.modelMatrix,e.modelMatrix),e._pickOffsets=p.pickOffsets,e._offsetInstanceExtend=p.offsetInstanceExtend,e._instanceBoundingSpheres=p.boundingSpheres,e._instanceBoundingSpheresCV=p.boundingSpheresCV,l(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=sa.COMBINED):HP(e,t,sa.FAILED,void 0)}).catch(function(d){HP(e,t,sa.FAILED,d)})}}function v$e(e,t){let n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances],i=e._numberOfInstances=n.length,r=new Array(i),o=e._instanceIds,a,s,c=0;for(s=0;s<i;s++){a=n[s];let p=a.geometry,g;l(p.attributes)&&l(p.primitiveType)?g=g$e(p):g=p.constructor.createGeometry(p),r[c++]=_$e(a,g),o.push(a.id)}r.length=c;let u=t.scene3DOnly,f=t.mapProjection,d=Pv.combineGeometry({instances:r,ellipsoid:f.ellipsoid,projection:f,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:u,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets});e._geometries=d.geometries,e._attributeLocations=d.attributeLocations,e.modelMatrix=O.clone(d.modelMatrix,e.modelMatrix),e._pickOffsets=d.pickOffsets,e._offsetInstanceExtend=d.offsetInstanceExtend,e._instanceBoundingSpheres=d.boundingSpheres,e._instanceBoundingSpheresCV=d.boundingSpheresCV,l(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=sa.COMBINED):HP(e,t,sa.FAILED,void 0)}function E$e(e,t){let n=e._batchTableAttributeIndices.offset;if(!e._recomputeBoundingSpheres||!l(n)){e._recomputeBoundingSpheres=!1;return}let i,r=e._offsetInstanceExtend,o=e._instanceBoundingSpheres,a=o.length,s=e._tempBoundingSpheres;if(!l(s)){for(s=new Array(a),i=0;i<a;i++)s[i]=new se;e._tempBoundingSpheres=s}for(i=0;i<a;++i){let y=s[i],A=e._batchTable.getBatchedAttribute(i,n,new h);y=o[i].clone(y),H0e(y,A,r[i])}let c=[],u=[],f=[];for(i=0;i<a;++i){let y=s[i];y.center.x-y.radius>0||se.intersectPlane(y,tn.ORIGIN_ZX_PLANE)!==Xt.INTERSECTING?c.push(y):(u.push(y),f.push(y))}let d=c[0],p=f[0],g=u[0];for(i=1;i<c.length;i++)d=se.union(d,c[i]);for(i=1;i<f.length;i++)p=se.union(p,f[i]);for(i=1;i<u.length;i++)g=se.union(g,u[i]);let m=[];for(l(d)&&m.push(d),l(p)&&m.push(p),l(g)&&m.push(g),i=0;i<m.length;i++){let y=m[i].clone(e._boundingSpheres[i]);e._boundingSpheres[i]=y,e._boundingSphereCV[i]=se.projectTo2D(y,t.mapProjection,e._boundingSphereCV[i])}Vo._updateBoundingVolumes(e,t,e.modelMatrix,!0),e._recomputeBoundingSpheres=!1}var L0e=new Sn,U0e=new de,V0e=new h,j0e=new se;function S$e(e,t){if(!l(e._batchTableAttributeIndices.distanceDisplayCondition)||e._batchTableBoundingSpheresUpdated)return;let i=e._batchTableBoundingSphereAttributeIndices,r=i.center3DHigh,o=i.center3DLow,a=i.center2DHigh,s=i.center2DLow,c=i.radius,u=t.mapProjection,f=u.ellipsoid,d=e._batchTable,p=e._instanceBoundingSpheres,g=p.length;for(let m=0;m<g;++m){let y=p[m];if(!l(y))continue;let A=e.modelMatrix;l(A)&&(y=se.transform(y,A,j0e));let b=y.center,x=y.radius,T=Sn.fromCartesian(b,L0e);if(d.setBatchedAttribute(m,r,T.high),d.setBatchedAttribute(m,o,T.low),!t.scene3DOnly){let C=f.cartesianToCartographic(b,U0e),E=u.project(C,V0e);T=Sn.fromCartesian(E,L0e),d.setBatchedAttribute(m,a,T.high),d.setBatchedAttribute(m,s,T.low)}d.setBatchedAttribute(m,c,x)}e._batchTableBoundingSpheresUpdated=!0}var E$=new h,w$e=new h;function N0e(e,t){if(!l(e._batchTableAttributeIndices.offset)||e._batchTableOffsetsUpdated||t.scene3DOnly)return;let i=e._batchTableOffsetAttribute2DIndex,r=t.mapProjection,o=r.ellipsoid,a=e._batchTable,s=e._instanceBoundingSpheres,c=s.length;for(let u=0;u<c;++u){let f=s[u];if(!l(f))continue;let d=a.getBatchedAttribute(u,e._batchTableAttributeIndices.offset);if(h.equals(d,h.ZERO)){a.setBatchedAttribute(u,i,h.ZERO);continue}let p=e.modelMatrix;l(p)&&(f=se.transform(f,p,j0e));let g=f.center;g=o.scaleToGeodeticSurface(g,w$e);let m=o.cartesianToCartographic(g,U0e),y=r.project(m,V0e),A=h.add(d,g,E$);m=o.cartesianToCartographic(A,m);let b=r.project(m,E$),x=h.subtract(b,y,E$),T=x.x;x.x=x.z,x.z=x.y,x.y=T,a.setBatchedAttribute(u,i,x)}e._batchTableOffsetsUpdated=!0}function I$e(e,t){let n=e._attributeLocations,i=e._geometries,r=t.scene3DOnly,o=t.context,a=[],s=i.length;for(let c=0;c<s;++c){let u=i[c];if(a.push(Vn.fromGeometry({context:o,geometry:u,attributeLocations:n,bufferUsage:Oe.STATIC_DRAW,interleave:e._interleave})),l(e._createBoundingVolumeFunction))e._createBoundingVolumeFunction(t,u);else if(e._boundingSpheres.push(se.clone(u.boundingSphere)),e._boundingSphereWC.push(new se),!r){let f=u.boundingSphereCV.center,d=f.x,p=f.y,g=f.z;f.x=g,f.y=d,f.z=p,e._boundingSphereCV.push(se.clone(u.boundingSphereCV)),e._boundingSphere2D.push(new se),e._boundingSphereMorph.push(new se)}}e._va=a,e._primitiveType=i[0].primitiveType,e.releaseGeometryInstances&&(e.geometryInstances=void 0),e._geometries=void 0,HP(e,t,sa.COMPLETE,void 0)}function P$e(e,t,n,i){let r=n.getRenderState(),o;i?(o=Xe(r,!1),o.cull={enabled:!0,face:Ui.BACK},e._frontFaceRS=je.fromCache(o),o.cull.face=Ui.FRONT,e._backFaceRS=je.fromCache(o)):(e._frontFaceRS=je.fromCache(r),e._backFaceRS=e._frontFaceRS),o=Xe(r,!1),l(e._depthFailAppearance)&&(o.depthTest.enabled=!1),l(e._depthFailAppearance)&&(r=e._depthFailAppearance.getRenderState(),o=Xe(r,!1),o.depthTest.func=Ac.GREATER,i?(o.cull={enabled:!0,face:Ui.BACK},e._frontFaceDepthFailRS=je.fromCache(o),o.cull.face=Ui.FRONT,e._backFaceDepthFailRS=je.fromCache(o)):(e._frontFaceDepthFailRS=je.fromCache(o),e._backFaceDepthFailRS=e._frontFaceRS))}function D$e(e,t,n){let i=t.context,r=e._attributeLocations,o=e._batchTable.getVertexShaderCallback()(n.vertexShaderSource);o=Vo._appendOffsetToShader(e,o),o=Vo._appendShowToShader(e,o),o=Vo._appendDistanceDisplayConditionToShader(e,o,t.scene3DOnly),o=D0e(o),o=Vo._updateColorAttribute(e,o,!1),o=O0e(e,o),o=Vo._modifyShaderPosition(e,o,t.scene3DOnly);let a=n.getFragmentShaderSource();a=R0e(a),e._sp=Zt.replaceCache({context:i,shaderProgram:e._sp,vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:r}),M0e(e._sp,r),l(e._depthFailAppearance)&&(o=e._batchTable.getVertexShaderCallback()(e._depthFailAppearance.vertexShaderSource),o=Vo._appendShowToShader(e,o),o=Vo._appendDistanceDisplayConditionToShader(e,o,t.scene3DOnly),o=D0e(o),o=Vo._updateColorAttribute(e,o,!0),o=O0e(e,o),o=Vo._modifyShaderPosition(e,o,t.scene3DOnly),o=A$e(o),a=e._depthFailAppearance.getFragmentShaderSource(),a=R0e(a),a=b$e(a),e._spDepthFail=Zt.replaceCache({context:i,shaderProgram:e._spDepthFail,vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:r}),M0e(e._spDepthFail,r))}var jP=new O,F0e=new h;function B0e(e,t,n,i){let r=l(n)?n._uniforms:void 0,o={},a=t.uniforms;if(l(a))for(let c in a)a.hasOwnProperty(c)&&(o[c]=x$e(a,c));let s=Ot(o,r);return s=e._batchTable.getUniformMapCallback()(s),l(e.rtcCenter)&&(s.u_modifiedModelView=function(){let c=i.context.uniformState.view;return O.multiply(c,e._modelMatrix,jP),O.multiplyByPoint(jP,e.rtcCenter,F0e),O.setTranslation(jP,F0e,jP),jP}),s}function R$e(e,t,n,i,r,o,a,s){let c=B0e(e,t,n,s),u;l(e._depthFailAppearance)&&(u=B0e(e,e._depthFailAppearance,e._depthFailAppearance.material,s));let f=i?Pe.TRANSLUCENT:Pe.OPAQUE,d=r?2:1;d*=l(e._depthFailAppearance)?2:1,o.length=e._va.length*d;let p=o.length,g=0;for(let m=0;m<p;++m){let y;r&&(y=o[m],l(y)||(y=o[m]=new nt({owner:e,primitiveType:e._primitiveType})),y.vertexArray=e._va[g],y.renderState=e._backFaceRS,y.shaderProgram=e._sp,y.uniformMap=c,y.pass=f,++m),y=o[m],l(y)||(y=o[m]=new nt({owner:e,primitiveType:e._primitiveType})),y.vertexArray=e._va[g],y.renderState=e._frontFaceRS,y.shaderProgram=e._sp,y.uniformMap=c,y.pass=f,l(e._depthFailAppearance)&&(r&&(++m,y=o[m],l(y)||(y=o[m]=new nt({owner:e,primitiveType:e._primitiveType})),y.vertexArray=e._va[g],y.renderState=e._backFaceDepthFailRS,y.shaderProgram=e._spDepthFail,y.uniformMap=u,y.pass=f),++m,y=o[m],l(y)||(y=o[m]=new nt({owner:e,primitiveType:e._primitiveType})),y.vertexArray=e._va[g],y.renderState=e._frontFaceDepthFailRS,y.shaderProgram=e._spDepthFail,y.uniformMap=u,y.pass=f),++g}}Vo._updateBoundingVolumes=function(e,t,n,i){let r,o,a;if(i||!O.equals(n,e._modelMatrix))for(O.clone(n,e._modelMatrix),o=e._boundingSpheres.length,r=0;r<o;++r)a=e._boundingSpheres[r],l(a)&&(e._boundingSphereWC[r]=se.transform(a,n,e._boundingSphereWC[r]),t.scene3DOnly||(e._boundingSphere2D[r]=se.clone(e._boundingSphereCV[r],e._boundingSphere2D[r]),e._boundingSphereMorph[r]=se.union(e._boundingSphereWC[r],e._boundingSphereCV[r])));let s=e.appearance.pixelSize;if(l(s))for(o=e._boundingSpheres.length,r=0;r<o;++r){a=e._boundingSpheres[r];let c=e._boundingSphereWC[r],f=t.camera.getPixelSize(a,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*s;c.radius=a.radius+f}};function O$e(e,t,n,i,r,o,a,s){Vo._updateBoundingVolumes(e,t,r);let c;t.mode===re.SCENE3D?c=e._boundingSphereWC:t.mode===re.COLUMBUS_VIEW?c=e._boundingSphereCV:t.mode===re.SCENE2D&&l(e._boundingSphere2D)?c=e._boundingSphere2D:l(e._boundingSphereMorph)&&(c=e._boundingSphereMorph);let u=t.commandList,f=t.passes;if(f.render||f.pick){let d=e.allowPicking,p=Rn.castShadows(e.shadows),g=Rn.receiveShadows(e.shadows),m=n.length,y=s?2:1;y*=l(e._depthFailAppearance)?2:1;for(let A=0;A<m;++A){let b=Math.floor(A/y),x=n[A];x.modelMatrix=r,x.boundingVolume=c[b],x.cull=o,x.debugShowBoundingVolume=a,x.castShadows=p,x.receiveShadows=g,d?x.pickId="v_pickColor":x.pickId=void 0,u.push(x)}}}Vo.prototype.update=function(e){if(!l(this.geometryInstances)&&this._va.length===0||l(this.geometryInstances)&&Array.isArray(this.geometryInstances)&&this.geometryInstances.length===0||!l(this.appearance)||e.mode!==re.SCENE3D&&e.scene3DOnly||!e.passes.render&&!e.passes.pick)return;if(l(this._error))throw this._error;if(this._state===sa.FAILED)return;let t=e.context;if(l(this._batchTable)||m$e(this,t),this._batchTable.attributes.length>0){if(Ft.maximumVertexTextureImageUnits===0)throw new oe("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!==sa.COMPLETE&&this._state!==sa.COMBINED&&(this.asynchronous?C$e(this,e):v$e(this,e)),this._state===sa.COMBINED&&(S$e(this,e),N0e(this,e),I$e(this,e)),!this.show||this._state!==sa.COMPLETE)return;this._batchTableOffsetsUpdated||N0e(this,e),this._recomputeBoundingSpheres&&E$e(this,e);let n=this.appearance,i=n.material,r=!1,o=!1;this._appearance!==n?(this._appearance=n,this._material=i,r=!0,o=!0):this._material!==i&&(this._material=i,o=!0);let a=this.depthFailAppearance,s=l(a)?a.material:void 0;this._depthFailAppearance!==a?(this._depthFailAppearance=a,this._depthFailMaterial=s,r=!0,o=!0):this._depthFailMaterial!==s&&(this._depthFailMaterial=s,o=!0);let c=this._appearance.isTranslucent();this._translucent!==c&&(this._translucent=c,r=!0),l(this._material)&&this._material.update(t);let u=n.closed&&c;r&&(this._createRenderStatesFunction??P$e)(this,t,n,u),o&&(this._createShaderProgramFunction??D$e)(this,e,n),(r||o)&&(this._createCommandsFunction??R$e)(this,n,i,c,u,this._colorCommands,this._pickCommands,e),(this._updateAndQueueCommandsFunction??O$e)(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,u)};var M$e=new se,L$e=new se;function H0e(e,t,n){if(n===mn.TOP){let i=se.clone(e,M$e),r=se.clone(e,L$e);r.center=h.add(r.center,t,r.center),e=se.union(i,r,e)}else n===mn.ALL&&(e.center=h.add(e.center,t,e.center));return e}function N$e(e,t,n){return function(){let i=e.getBatchedAttribute(t,n),r=e.attributes[n],o=r.componentsPerAttribute,a=Y.createTypedArray(r.componentDatatype,o);return l(i.constructor.pack)?i.constructor.pack(i,a,0):a[0]=i,a}}function F$e(e,t,n,i,r){return function(o){let a=z0e(o);e.setBatchedAttribute(t,n,a),r==="offset"&&(i._recomputeBoundingSpheres=!0,i._batchTableOffsetsUpdated=!1)}}var B$e=new h;function k$e(e,t,n){t.boundingSphere={get:function(){let i=e._instanceBoundingSpheres[n];if(l(i)){i=i.clone();let r=e.modelMatrix,o=t.offset;l(o)&&H0e(i,h.fromArray(o.get(),0,B$e),e._offsetInstanceExtend[n]),l(r)&&(i=se.transform(i,r))}return i}},t.boundingSphereCV={get:function(){return e._instanceBoundingSpheresCV[n]}}}function z$e(e,t,n){t.pickId={get:function(){return e._pickIds[n]}}}Vo.prototype.getGeometryInstanceAttributes=function(e){let t=this._perInstanceAttributeCache.get(e);if(l(t))return t;let n=-1,i=this._lastPerInstanceAttributeIndex,r=this._instanceIds,o=r.length;for(let u=0;u<o;++u){let f=(i+u)%o;if(e===r[f]){n=f;break}}if(n===-1)return;let a=this._batchTable,s=this._batchTableAttributeIndices;t={};let c={};for(let u in s)if(s.hasOwnProperty(u)){let f=s[u];c[u]={get:N$e(a,n,f),set:F$e(a,n,f,this,u)}}return k$e(this,c,n),z$e(this,c,n),Object.defineProperties(t,c),this._lastPerInstanceAttributeIndex=n,this._perInstanceAttributeCache.set(e,t),t};Vo.prototype.isDestroyed=function(){return!1};Vo.prototype.destroy=function(){let e,t;this._sp=this._sp&&this._sp.destroy(),this._spDepthFail=this._spDepthFail&&this._spDepthFail.destroy();let n=this._va;for(e=n.length,t=0;t<e;++t)n[t].destroy();this._va=void 0;let i=this._pickIds;for(e=i.length,t=0;t<e;++t)i[t].destroy();return this._pickIds=void 0,this._batchTable=this._batchTable&&this._batchTable.destroy(),this._instanceIds=void 0,this._perInstanceAttributeCache=void 0,this._attributeLocations=void 0,ue(this)};function HP(e,t,n,i){e._error=i,e._state=n,t.afterRender.push(function(){return e._ready=e._state===sa.COMPLETE||e._state===sa.FAILED,!0})}var Fn=Vo;var G0e={NEVER:ee.NEVER,LESS:ee.LESS,EQUAL:ee.EQUAL,LESS_OR_EQUAL:ee.LEQUAL,GREATER:ee.GREATER,NOT_EQUAL:ee.NOTEQUAL,GREATER_OR_EQUAL:ee.GEQUAL,ALWAYS:ee.ALWAYS};Object.freeze(G0e);var Qn=G0e;var W0e={ZERO:ee.ZERO,KEEP:ee.KEEP,REPLACE:ee.REPLACE,INCREMENT:ee.INCR,DECREMENT:ee.DECR,INVERT:ee.INVERT,INCREMENT_WRAP:ee.INCR_WRAP,DECREMENT_WRAP:ee.DECR_WRAP};Object.freeze(W0e);var Pt=W0e;var x3={CESIUM_3D_TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15};x3.setCesium3DTileBit=function(){return{enabled:!0,frontFunction:Qn.ALWAYS,frontOperation:{fail:Pt.KEEP,zFail:Pt.KEEP,zPass:Pt.REPLACE},backFunction:Qn.ALWAYS,backOperation:{fail:Pt.KEEP,zFail:Pt.KEEP,zPass:Pt.REPLACE},reference:x3.CESIUM_3D_TILE_MASK,mask:x3.CESIUM_3D_TILE_MASK}};var qt=Object.freeze(x3);function H0(e){e=e??H.EMPTY_OBJECT,this.geometryInstances=e.geometryInstances,this._hasPerInstanceColors=!0;let t=e.appearance;l(t)||(t=new yc),this.appearance=t,this.show=e.show??!0,this.classificationType=e.classificationType??Zn.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=q0e(!1),this._renderState3DTiles=q0e(!0),this._renderStateMorph=je.fromCache({cull:{enabled:!0,face:Ui.FRONT},depthTest:{enabled:!0},blending:en.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}Object.defineProperties(H0.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}}});H0.initializeTerrainHeights=function(){return Oi.initialize()};function U$e(e,t,n){let i=t.context,r=e._primitive,o=r._attributeLocations,a=r._batchTable.getVertexShaderCallback()(Zk);a=Fn._appendShowToShader(r,a),a=Fn._appendDistanceDisplayConditionToShader(r,a),a=Fn._modifyShaderPosition(e,a,t.scene3DOnly);let s=r._batchTable.getVertexShaderCallback()(Jk);s=Fn._appendShowToShader(r,s),s=Fn._appendDistanceDisplayConditionToShader(r,s),s=Fn._modifyShaderPosition(e,s,t.scene3DOnly);let c=r._batchTable.getVertexShaderCallback()(Kk),u=[`GLOBE_MINIMUM_ALTITUDE ${t.mapProjection.ellipsoid.minimumRadius.toFixed(1)}`],f="",d="";l(n.material)?(d=l(n.material)?n.material.shaderSource:"",d.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&u.push("ANGLE_VARYING"),d.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 Ge({defines:u,sources:[a]}),m=new Ge({defines:p,sources:[d,c]});e._sp=Zt.replaceCache({context:i,shaderProgram:r._sp,vertexShaderSource:g,fragmentShaderSource:m,attributeLocations:o});let y=i.shaderCache.getDerivedShaderProgram(e._sp,"2dColor");if(!l(y)){let b=new Ge({defines:u.concat(["COLUMBUS_VIEW_2D"]),sources:[a]});y=i.shaderCache.createDerivedShaderProgram(e._sp,"2dColor",{context:i,shaderProgram:e._sp2D,vertexShaderSource:b,fragmentShaderSource:m,attributeLocations:o})}e._sp2D=y;let A=i.shaderCache.getDerivedShaderProgram(e._sp,"MorphColor");if(!l(A)){let b=new Ge({defines:u.concat([`MAX_TERRAIN_HEIGHT ${Oi._defaultMaxTerrainHeight.toFixed(1)}`]),sources:[s]});c=r._batchTable.getVertexShaderCallback()($k);let x=new Ge({defines:p,sources:[d,c]});A=i.shaderCache.createDerivedShaderProgram(e._sp,"MorphColor",{context:i,shaderProgram:e._spMorph,vertexShaderSource:b,fragmentShaderSource:x,attributeLocations:o})}e._spMorph=A}function q0e(e){return je.fromCache({cull:{enabled:!0},blending:en.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:Qn.EQUAL,frontOperation:{fail:Pt.KEEP,zFail:Pt.KEEP,zPass:Pt.KEEP},backFunction:Qn.EQUAL,backOperation:{fail:Pt.KEEP,zFail:Pt.KEEP,zPass:Pt.KEEP},reference:qt.CESIUM_3D_TILE_MASK,mask:qt.CESIUM_3D_TILE_MASK}})}function V$e(e,t,n,i,r,o){let a=e._primitive,s=a._va.length;r.length=s,o.length=s;let u=t instanceof Ua?{}:n._uniforms,f=a._batchTable.getUniformMapCallback()(u);for(let d=0;d<s;d++){let p=a._va[d],g=r[d];l(g)||(g=r[d]=new nt({owner:e,primitiveType:a._primitiveType})),g.vertexArray=p,g.renderState=e._renderState,g.shaderProgram=e._sp,g.uniformMap=f,g.pass=Pe.TERRAIN_CLASSIFICATION,g.pickId="czm_batchTable_pickColor(v_endPlaneNormalEcAndBatchId.w)";let m=nt.shallowClone(g,g.derivedCommands.tileset);m.renderState=e._renderState3DTiles,m.pass=Pe.CESIUM_3D_TILE_CLASSIFICATION,g.derivedCommands.tileset=m;let y=nt.shallowClone(g,g.derivedCommands.color2D);y.shaderProgram=e._sp2D,g.derivedCommands.color2D=y;let A=nt.shallowClone(m,m.derivedCommands.color2D);A.shaderProgram=e._sp2D,m.derivedCommands.color2D=A;let b=nt.shallowClone(g,g.derivedCommands.colorMorph);b.renderState=e._renderStateMorph,b.shaderProgram=e._spMorph,b.pickId="czm_batchTable_pickColor(v_batchId)",g.derivedCommands.colorMorph=b}}function Y0e(e,t,n,i,r,o,a){n.mode===re.MORPHING?t=t.derivedCommands.colorMorph:n.mode!==re.SCENE3D&&(t=t.derivedCommands.color2D),t.modelMatrix=i,t.boundingVolume=o,t.cull=r,t.debugShowBoundingVolume=a,n.commandList.push(t)}function j$e(e,t,n,i,r,o,a){let s=e._primitive;Fn._updateBoundingVolumes(s,t,r);let c;t.mode===re.SCENE3D?c=s._boundingSphereWC:t.mode===re.COLUMBUS_VIEW?c=s._boundingSphereCV:t.mode===re.SCENE2D&&l(s._boundingSphere2D)?c=s._boundingSphere2D:l(s._boundingSphereMorph)&&(c=s._boundingSphereMorph);let u=t.mode===re.MORPHING,f=e.classificationType,d=f!==Zn.CESIUM_3D_TILE,p=f!==Zn.TERRAIN&&!u,g,m=t.passes;if(m.render||m.pick&&s.allowPicking){let y=n.length;for(let A=0;A<y;++A){let b=c[A];d&&(g=n[A],Y0e(e,g,t,r,o,b,a)),p&&(g=n[A].derivedCommands.tileset,Y0e(e,g,t,r,o,b,a))}}}H0.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!Oi.initialized){H0.initializeTerrainHeights();return}let t,n=this,i=this._primitiveOptions;if(!l(this._primitive)){let r=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],o=r.length,a=new Array(o),s;for(t=0;t<o;++t)if(s=r[t].attributes,!l(s)||!l(s.color)){this._hasPerInstanceColors=!1;break}for(t=0;t<o;++t){let c=r[t];s={};let u=c.attributes;for(let f in u)u.hasOwnProperty(f)&&(s[f]=u[f]);l(s.width)||(s.width=new yl({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,value:[c.geometry.width]})),c.geometry._scene3DOnly=e.scene3DOnly,HC.setProjectionAndEllipsoid(c.geometry,e.mapProjection),a[t]=new Bt({geometry:c.geometry,attributes:s,id:c.id,pickPrimitive:n})}i.geometryInstances=a,i.appearance=this.appearance,i._createShaderProgramFunction=function(c,u,f){U$e(n,u,f)},i._createCommandsFunction=function(c,u,f,d,p,g,m){V$e(n,u,f,d,g,m)},i._updateAndQueueCommandsFunction=function(c,u,f,d,p,g,m,y){j$e(n,u,f,d,p,g,m)},this._primitive=new Fn(i)}if(this.appearance instanceof Ua&&!this._hasPerInstanceColors)throw new pe("All GeometryInstances must have color attributes to use PolylineColorAppearance with GroundPolylinePrimitive.");this._primitive.appearance=this.appearance,this._primitive.show=this.show,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{!this._ready&&l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};H0.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};H0.isSupported=function(e){return e.frameState.context.depthTexture};H0.prototype.isDestroyed=function(){return!1};H0.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,ue(this)};var tp=H0;var T3=`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;
|
|
|
|
//extrudeDirection is zero for the top layer
|
|
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);
|
|
|
|
// If the primitive is split across the IDL (planes2D_high.x > planes2D_high.w):
|
|
// - If this vertex is on the east side of the IDL (position3DLow.y > 0.0, comparison with position3DHigh may produce artifacts)
|
|
// - existing "east" is on the wrong side of the world, far away (planes2D_high/low.w)
|
|
// - so set "east" as beyond the eastmost extent of the projection (idlSplitNewPlaneHiLow)
|
|
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);
|
|
|
|
// - else, if this vertex is on the west side of the IDL (position3DLow.y < 0.0)
|
|
// - existing "west" is on the wrong side of the world, far away (planes2D_high/low.x)
|
|
// - so set "west" as beyond the westmost extent of the projection (idlSplitNewPlaneHiLow)
|
|
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
|
|
// 3D case has smaller "plane extents," so planes encoded as a 64 bit position and 2 vec3s for distances/direction
|
|
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 kb=`#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 C3=`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 v3=`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; // position in eye coordinates
|
|
v_normalEC = czm_normal * normal; // normal in eye coordinates
|
|
v_color = color;
|
|
|
|
gl_Position = czm_modelViewProjectionRelativeToEye * p;
|
|
}
|
|
`;var E3=`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 G0(e){e=e??H.EMPTY_OBJECT;let t=e.translucent??!0,n=e.closed??!1,i=e.flat??!1,r=i?E3:v3,o=i?Ev:C3,a=i?G0.FLAT_VERTEX_FORMAT:G0.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??r,this._fragmentShaderSource=e.fragmentShaderSource??o,this._renderState=Sr.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=a,this._flat=i,this._faceForward=e.faceForward??!n}Object.defineProperties(G0.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}}});G0.VERTEX_FORMAT=Be.POSITION_AND_NORMAL;G0.FLAT_VERTEX_FORMAT=Be.POSITION_ONLY;G0.prototype.getFragmentShaderSource=Sr.prototype.getFragmentShaderSource;G0.prototype.isTranslucent=Sr.prototype.isTranslucent;G0.prototype.getRenderState=Sr.prototype.getRenderState;var _n=G0;var GP=`#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;
|
|
// Sample depths at both offset and negative offset
|
|
float upOrRightLogDepth = czm_unpackDepth(texture(czm_globeDepthTexture, (glFragCoordXY + positiveOffset) / czm_viewport.zw));
|
|
float downOrLeftLogDepth = czm_unpackDepth(texture(czm_globeDepthTexture, (glFragCoordXY - positiveOffset) / czm_viewport.zw));
|
|
// Explicitly evaluate both paths
|
|
// Necessary for multifrustum and for edges of the screen
|
|
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
|
|
// Treat world coords as a sphere normal for spherical coordinates
|
|
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
|
|
// Unpack planes and transform to eye space
|
|
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 CULL_FRAGMENTS
|
|
// When classifying translucent geometry, logDepthOrDepth == 0.0
|
|
// indicates a region that should not be classified, possibly due to there
|
|
// being opaque pixels there in another buffer.
|
|
if (uv.x <= 0.0 || 1.0 <= uv.x || uv.y <= 0.0 || 1.0 <= uv.y || logDepthOrDepth == 0.0) {
|
|
discard;
|
|
}
|
|
#endif
|
|
|
|
#ifdef PICK
|
|
out_FragColor.a = 1.0; // Explicitly set the alpha, otherwise this may be discarded by ShaderSource.createPickFragmentShaderSource
|
|
#ifdef CULL_FRAGMENTS
|
|
czm_writeDepthClamp();
|
|
#endif // CULL_FRAGMENTS
|
|
#else // PICK
|
|
|
|
#ifdef NORMAL_EC
|
|
// Compute normal by sampling adjacent pixels in 2x2 block in screen space
|
|
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
|
|
|
|
// Premultiply alpha. Required for classification primitives on translucent globe.
|
|
out_FragColor.rgb *= out_FragColor.a;
|
|
|
|
#else // PER_INSTANCE_COLOR
|
|
|
|
// Material support.
|
|
// USES_ is distinct from REQUIRES_, because some things are dependencies of each other or
|
|
// dependencies for culling but might not actually be used by the material.
|
|
|
|
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
|
|
// Remap texture coordinates from computed (approximately aligned with cartographic space) to the desired
|
|
// texture coordinate system, which typically forms a tight oriented bounding box around the geometry.
|
|
// Shader is provided a set of reference points for remapping.
|
|
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
|
|
|
|
// Premultiply alpha. Required for classification primitives on translucent globe.
|
|
out_FragColor.rgb *= out_FragColor.a;
|
|
|
|
#endif // PER_INSTANCE_COLOR
|
|
czm_writeDepthClamp();
|
|
#endif // PICK
|
|
}
|
|
`;function ud(e,t,n){this._projectionExtentDefines={eastMostYhighDefine:"",eastMostYlowDefine:"",westMostYhighDefine:"",westMostYlowDefine:""};let i=new S$;i.requiresTextureCoordinates=e,i.requiresEC=!n.flat;let r=new S$;if(r.requiresTextureCoordinates=e,n instanceof _n)i.requiresNormalEC=!n.flat;else{let o=`${n.material.shaderSource}
|
|
${n.fragmentShaderSource}`;i.normalEC=o.indexOf("materialInput.normalEC")!==-1||o.indexOf("czm_getDefaultMaterial")!==-1,i.positionToEyeEC=o.indexOf("materialInput.positionToEyeEC")!==-1,i.tangentToEyeMatrix=o.indexOf("materialInput.tangentToEyeMatrix")!==-1,i.st=o.indexOf("materialInput.st")!==-1}this._colorShaderDependencies=i,this._pickShaderDependencies=r,this._appearance=n,this._extentsCulling=e,this._planarExtents=t}ud.prototype.createFragmentShader=function(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 _n&&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 r="";return t instanceof _n||(r=t.material.shaderSource),new Ge({defines:i,sources:[r,GP]})};ud.prototype.createPickFragmentShader=function(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 Ge({defines:n,sources:[GP],pickColorQualifier:"in"})};ud.prototype.createVertexShader=function(e,t,n,i){return tge(this._colorShaderDependencies,this._planarExtents,n,e,t,this._appearance,i,this._projectionExtentDefines)};ud.prototype.createPickVertexShader=function(e,t,n,i){return tge(this._pickShaderDependencies,this._planarExtents,n,e,t,void 0,i,this._projectionExtentDefines)};var X0e=new h,K0e=new de,$0e={high:0,low:0};function tge(e,t,n,i,r,o,a,s){let c=i.slice();if(s.eastMostYhighDefine===""){let u=K0e;u.longitude=I.PI,u.latitude=0,u.height=0;let f=a.project(u,X0e),d=Sn.encode(f.x,$0e);s.eastMostYhighDefine=`EAST_MOST_X_HIGH ${d.high.toFixed(`${d.high}`.length+1)}`,s.eastMostYlowDefine=`EAST_MOST_X_LOW ${d.low.toFixed(`${d.low}`.length+1)}`;let p=K0e;p.longitude=-I.PI,p.latitude=0,p.height=0;let g=a.project(p,X0e);d=Sn.encode(g.x,$0e),s.westMostYhighDefine=`WEST_MOST_X_HIGH ${d.high.toFixed(`${d.high}`.length+1)}`,s.westMostYlowDefine=`WEST_MOST_X_LOW ${d.low.toFixed(`${d.low}`.length+1)}`}return n&&(c.push(s.eastMostYhighDefine),c.push(s.eastMostYlowDefine),c.push(s.westMostYhighDefine),c.push(s.westMostYlowDefine)),l(o)&&o instanceof _n&&c.push("PER_INSTANCE_COLOR"),e.requiresTextureCoordinates&&(c.push("TEXTURE_COORDINATES"),t||n||c.push("SPHERICAL"),n&&c.push("COLUMBUS_VIEW_2D")),new Ge({defines:c,sources:[r]})}function S$(){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(S$.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 J0e(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)/k.distance(t,e)}var H$e=[new k,new k,new k,new k];function nge(e,t){let n=H$e,i=k.unpack(t,0,n[0]),r=k.unpack(t,2,n[1]),o=k.unpack(t,4,n[2]);e.uMaxVmax=new yl({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,value:[r.x,r.y,o.x,o.y]});let a=1/J0e(i,r,o),s=1/J0e(i,o,r);e.uvMinAndExtents=new yl({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,value:[i.x,i.y,a,s]})}var ige=new de,rge=new h,G$e=new h,W$e=new h,S3={high:0,low:0};function oge(e,t,n){let i=ige;i.height=0,i.longitude=e.west,i.latitude=e.south;let r=t.project(i,rge);i.latitude=e.north;let o=t.project(i,G$e);i.longitude=e.east,i.latitude=e.south;let a=t.project(i,W$e),s=[0,0,0,0],c=[0,0,0,0],u=Sn.encode(r.x,S3);s[0]=u.high,c[0]=u.low,u=Sn.encode(r.y,S3),s[1]=u.high,c[1]=u.low,u=Sn.encode(o.y,S3),s[2]=u.high,c[2]=u.low,u=Sn.encode(a.x,S3),s[3]=u.high,c[3]=u.low,n.planes2D_HIGH=new yl({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,value:s}),n.planes2D_LOW=new yl({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,value:c})}var q$e=new O,Y$e=new O,Z0e=new h,X$e=new de,K$e=[new de,new de,new de,new de,new de,new de,new de,new de];function $$e(e,t,n,i,r,o){let a=ie.center(e,X$e);a.height=n;let s=de.toCartesian(a,t,Z0e),c=mt.eastNorthUpToFixedFrame(s,t,q$e),u=O.inverse(c,Y$e),f=e.west,d=e.east,p=e.north,g=e.south,m=K$e;m[0].latitude=g,m[0].longitude=f,m[1].latitude=p,m[1].longitude=f,m[2].latitude=p,m[2].longitude=d,m[3].latitude=g,m[3].longitude=d;let y=(f+d)*.5,A=(p+g)*.5;m[4].latitude=g,m[4].longitude=y,m[5].latitude=p,m[5].longitude=y,m[6].latitude=A,m[6].longitude=f,m[7].latitude=A,m[7].longitude=d;let b=Number.POSITIVE_INFINITY,x=Number.NEGATIVE_INFINITY,T=Number.POSITIVE_INFINITY,C=Number.NEGATIVE_INFINITY;for(let R=0;R<8;R++){m[R].height=n;let M=de.toCartesian(m[R],t,Z0e);O.multiplyByPoint(u,M,M),M.z=0,b=Math.min(b,M.x),x=Math.max(x,M.x),T=Math.min(T,M.y),C=Math.max(C,M.y)}let E=i;E.x=b,E.y=T,E.z=0,O.multiplyByPoint(c,E,E);let w=r;w.x=x,w.y=T,w.z=0,O.multiplyByPoint(c,w,w),h.subtract(w,E,r);let D=o;D.x=b,D.y=C,D.z=0,O.multiplyByPoint(c,D,D),h.subtract(D,E,o)}var J$e=new h,Z$e=new h,Q$e=new Sn;ud.getPlanarTextureCoordinateAttributes=function(e,t,n,i,r){let o=rge,a=J$e,s=Z$e;$$e(e,n,r??0,o,a,s);let c={};nge(c,t);let u=Sn.fromCartesian(o,Q$e);return c.southWest_HIGH=new yl({componentDatatype:Y.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(u.high,[0,0,0])}),c.southWest_LOW=new yl({componentDatatype:Y.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(u.low,[0,0,0])}),c.eastward=new yl({componentDatatype:Y.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(a,[0,0,0])}),c.northward=new yl({componentDatatype:Y.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(s,[0,0,0])}),oge(e,i,c),c};var eJe=new h;function Q0e(e,t,n,i){let r=ige;r.latitude=e,r.longitude=t,r.height=0;let o=de.toCartesian(r,n,eJe),a=Math.sqrt(o.x*o.x+o.y*o.y),s=I.fastApproximateAtan2(a,o.z),c=I.fastApproximateAtan2(o.x,o.y);return i.x=s,i.y=c,i}var ege=new k;ud.getSphericalExtentGeometryInstanceAttributes=function(e,t,n,i){let r=Q0e(e.south,e.west,n,ege),o=r.x,a=r.y,s=Q0e(e.north,e.east,n,ege),c=s.x,u=s.y,f=0;a>u&&(f=I.PI-a,a=-I.PI,u+=f),o-=I.EPSILON5,a-=I.EPSILON5,c+=I.EPSILON5,u+=I.EPSILON5;let d=1/(u-a),p=1/(c-o),g={sphericalExtents:new yl({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,value:[o,a,p,d]}),longitudeRotation:new yl({componentDatatype:Y.FLOAT,componentsPerAttribute:1,normalize:!1,value:[f]})};return nge(g,t),oge(e,i,g),g};ud.hasAttributesForTextureCoordinatePlanes=function(e){return l(e.southWest_HIGH)&&l(e.southWest_LOW)&&l(e.northward)&&l(e.eastward)&&l(e.planes2D_HIGH)&&l(e.planes2D_LOW)&&l(e.uMaxVmax)&&l(e.uvMinAndExtents)};ud.hasAttributesForSphericalExtents=function(e){return l(e.sphericalExtents)&&l(e.longitudeRotation)&&l(e.planes2D_HIGH)&&l(e.planes2D_LOW)&&l(e.uMaxVmax)&&l(e.uvMinAndExtents)};function tJe(e){return Math.max(e.width,e.height)>ud.MAX_WIDTH_FOR_PLANAR_EXTENTS}ud.shouldUseSphericalCoordinates=function(e){return tJe(e)};ud.MAX_WIDTH_FOR_PLANAR_EXTENTS=I.toRadians(1);var fd=ud;function zb(e){e=e??H.EMPTY_OBJECT;let t=e.geometryInstances;this.geometryInstances=t,this.show=e.show??!0,this.classificationType=e.classificationType??Zn.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(zb.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}}});zb.isSupported=function(e){return e.context.stencilBuffer};function Dv(e,t){let n=t?Qn.EQUAL:Qn.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:n,frontOperation:{fail:Pt.KEEP,zFail:Pt.DECREMENT_WRAP,zPass:Pt.KEEP},backFunction:n,backOperation:{fail:Pt.KEEP,zFail:Pt.INCREMENT_WRAP,zPass:Pt.KEEP},reference:qt.CESIUM_3D_TILE_MASK,mask:qt.CESIUM_3D_TILE_MASK},stencilMask:qt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:Ac.LESS_OR_EQUAL},depthMask:!1}}function I$(e){return{stencilTest:{enabled:e,frontFunction:Qn.NOT_EQUAL,frontOperation:{fail:Pt.ZERO,zFail:Pt.ZERO,zPass:Pt.ZERO},backFunction:Qn.NOT_EQUAL,backOperation:{fail:Pt.ZERO,zFail:Pt.ZERO,zPass:Pt.ZERO},reference:0,mask:qt.CLASSIFICATION_MASK},stencilMask:qt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:en.PRE_MULTIPLIED_ALPHA_BLEND}}var nJe={stencilTest:{enabled:!0,frontFunction:Qn.NOT_EQUAL,frontOperation:{fail:Pt.ZERO,zFail:Pt.ZERO,zPass:Pt.ZERO},backFunction:Qn.NOT_EQUAL,backOperation:{fail:Pt.ZERO,zFail:Pt.ZERO,zPass:Pt.ZERO},reference:0,mask:qt.CLASSIFICATION_MASK},stencilMask:qt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function iJe(e,t,n,i){if(l(e._rsStencilDepthPass))return;let r=!e.debugShowShadowVolume;e._rsStencilDepthPass=je.fromCache(Dv(r,!1)),e._rsStencilDepthPass3DTiles=je.fromCache(Dv(r,!0)),e._rsColorPass=je.fromCache(I$(r,!1)),e._rsPickPass=je.fromCache(nJe)}function rJe(e,t){if(!e.compressVertices)return t;if(t.search(/in\s+vec3\s+extrudeDirection;/g)!==-1){let n="compressedAttributes",i=`in vec2 ${n};`,r=`vec3 extrudeDirection;
|
|
`,o=` extrudeDirection = czm_octDecode(${n}, 65535.0);
|
|
`,a=t;a=a.replace(/in\s+vec3\s+extrudeDirection;/g,""),a=Ge.replaceMain(a,"czm_non_compressed_main");let s=`void main()
|
|
{
|
|
${o} czm_non_compressed_main();
|
|
}`;return[i,r,a,s].join(`
|
|
`)}}function oJe(e,t){let n=t.context,i=e._primitive,r=T3;r=e._primitive._batchTable.getVertexShaderCallback()(r),r=Fn._appendDistanceDisplayConditionToShader(i,r),r=Fn._modifyShaderPosition(e,r,t.scene3DOnly),r=Fn._updateColorAttribute(i,r);let o=e._hasPlanarExtentsAttributes,a=o||e._hasSphericalExtentsAttribute;e._extruded&&(r=rJe(i,r));let s=e._extruded?"EXTRUDED_GEOMETRY":"",c=new Ge({defines:[s],sources:[r]}),u=new Ge({sources:[kb]}),f=e._primitive._attributeLocations,d=new fd(a,o,e.appearance);if(e._spStencil=Zt.replaceCache({context:n,shaderProgram:e._spStencil,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f}),e._primitive.allowPicking){let m=Ge.createPickVertexShaderSource(r);m=Fn._appendShowToShader(i,m),m=Fn._updatePickColorAttribute(m);let y=d.createPickFragmentShader(!1),A=d.createPickVertexShader([s],m,!1,t.mapProjection);if(e._spPick=Zt.replaceCache({context:n,shaderProgram:e._spPick,vertexShaderSource:A,fragmentShaderSource:y,attributeLocations:f}),a){let b=n.shaderCache.getDerivedShaderProgram(e._spPick,"2dPick");if(!l(b)){let x=d.createPickFragmentShader(!0),T=d.createPickVertexShader([s],m,!0,t.mapProjection);b=n.shaderCache.createDerivedShaderProgram(e._spPick,"2dPick",{vertexShaderSource:T,fragmentShaderSource:x,attributeLocations:f})}e._spPick2D=b}}else e._spPick=Zt.fromCache({context:n,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f});r=Fn._appendShowToShader(i,r),c=new Ge({defines:[s],sources:[r]}),e._sp=Zt.replaceCache({context:n,shaderProgram:e._sp,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f});let p=d.createFragmentShader(!1),g=d.createVertexShader([s],r,!1,t.mapProjection);if(e._spColor=Zt.replaceCache({context:n,shaderProgram:e._spColor,vertexShaderSource:g,fragmentShaderSource:p,attributeLocations:f}),a){let m=n.shaderCache.getDerivedShaderProgram(e._spColor,"2dColor");if(!l(m)){let y=d.createFragmentShader(!0),A=d.createVertexShader([s],r,!0,t.mapProjection);m=n.shaderCache.createDerivedShaderProgram(e._spColor,"2dColor",{vertexShaderSource:A,fragmentShaderSource:y,attributeLocations:f})}e._spColor2D=m}}function aJe(e,t){let n=e._primitive,i=n._va.length*2;t.length=i;let r,o,a,s=0,c=n._batchTable.getUniformMapCallback()(e._uniformMap),u=e._needs2DShader;for(r=0;r<i;r+=2){let g=n._va[s++];o=t[r],l(o)||(o=t[r]=new nt({owner:e,primitiveType:n._primitiveType})),o.vertexArray=g,o.renderState=e._rsStencilDepthPass,o.shaderProgram=e._sp,o.uniformMap=c,o.pass=Pe.TERRAIN_CLASSIFICATION,a=nt.shallowClone(o,o.derivedCommands.tileset),a.renderState=e._rsStencilDepthPass3DTiles,a.pass=Pe.CESIUM_3D_TILE_CLASSIFICATION,o.derivedCommands.tileset=a,o=t[r+1],l(o)||(o=t[r+1]=new nt({owner:e,primitiveType:n._primitiveType})),o.vertexArray=g,o.renderState=e._rsColorPass,o.shaderProgram=e._spColor,o.pass=Pe.TERRAIN_CLASSIFICATION;let y=e.appearance.material;if(l(y)&&(c=Ot(c,y._uniforms)),o.uniformMap=c,a=nt.shallowClone(o,o.derivedCommands.tileset),a.pass=Pe.CESIUM_3D_TILE_CLASSIFICATION,o.derivedCommands.tileset=a,u){let A=nt.shallowClone(o,o.derivedCommands.appearance2D);A.shaderProgram=e._spColor2D,o.derivedCommands.appearance2D=A,A=nt.shallowClone(a,a.derivedCommands.appearance2D),A.shaderProgram=e._spColor2D,a.derivedCommands.appearance2D=A}}let f=e._commandsIgnoreShow,d=e._spStencil,p=0;i=f.length=i/2;for(let g=0;g<i;++g){let m=f[g]=nt.shallowClone(t[p],f[g]);m.shaderProgram=d,m.pass=Pe.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,p+=2}}function sJe(e,t){let n=e._usePickOffsets,i=e._primitive,r=i._va.length*2,o,a=0,s;n&&(o=i._pickOffsets,r=o.length*2),t.length=r;let c,u,f,d=0,p=i._batchTable.getUniformMapCallback()(e._uniformMap),g=e._needs2DShader;for(c=0;c<r;c+=2){let m=i._va[d++];if(n&&(s=o[a++],m=i._va[s.index]),u=t[c],l(u)||(u=t[c]=new nt({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),u.vertexArray=m,u.renderState=e._rsStencilDepthPass,u.shaderProgram=e._sp,u.uniformMap=p,u.pass=Pe.TERRAIN_CLASSIFICATION,n&&(u.offset=s.offset,u.count=s.count),f=nt.shallowClone(u,u.derivedCommands.tileset),f.renderState=e._rsStencilDepthPass3DTiles,f.pass=Pe.CESIUM_3D_TILE_CLASSIFICATION,u.derivedCommands.tileset=f,u=t[c+1],l(u)||(u=t[c+1]=new nt({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),u.vertexArray=m,u.renderState=e._rsPickPass,u.shaderProgram=e._spPick,u.uniformMap=p,u.pass=Pe.TERRAIN_CLASSIFICATION,n&&(u.offset=s.offset,u.count=s.count),f=nt.shallowClone(u,u.derivedCommands.tileset),f.pass=Pe.CESIUM_3D_TILE_CLASSIFICATION,u.derivedCommands.tileset=f,g){let y=nt.shallowClone(u,u.derivedCommands.pick2D);y.shaderProgram=e._spPick2D,u.derivedCommands.pick2D=y,y=nt.shallowClone(f,f.derivedCommands.pick2D),y.shaderProgram=e._spPick2D,f.derivedCommands.pick2D=y}}}function cJe(e,t,n,i,r,o,a){aJe(e,o),sJe(e,a)}function age(e,t){return Math.floor(e%t/2)}function w$(e,t,n,i,r,o){e.modelMatrix=n,e.boundingVolume=r,e.cull=i,e.debugShowBoundingVolume=o,t.commandList.push(e)}function sge(e,t,n,i,r){e.modelMatrix=n,e.boundingVolume=r,e.cull=i,t.commandList.push(e)}function lJe(e,t,n,i,r,o,a,s){let c=e._primitive;Fn._updateBoundingVolumes(c,t,r);let u;t.mode===re.SCENE3D?u=c._boundingSphereWC:t.mode===re.COLUMBUS_VIEW?u=c._boundingSphereCV:t.mode===re.SCENE2D&&l(c._boundingSphere2D)?u=c._boundingSphere2D:l(c._boundingSphereMorph)&&(u=c._boundingSphereMorph);let f=e.classificationType,d=f!==Zn.CESIUM_3D_TILE,p=f!==Zn.TERRAIN,g=t.passes,m,y,A;if(g.render){let b=n.length;for(m=0;m<b;++m)y=u[age(m,b)],d&&(A=n[m],w$(A,t,r,o,y,a)),p&&(A=n[m].derivedCommands.tileset,w$(A,t,r,o,y,a));if(t.invertClassification){let x=e._commandsIgnoreShow,T=x.length;for(m=0;m<T;++m)y=u[m],A=x[m],w$(A,t,r,o,y,a)}}if(g.pick){let b=i.length,x=c._pickOffsets;for(m=0;m<b;++m){let T=x[age(m,b)];y=u[T.index],d&&(A=i[m],sge(A,t,r,o,y)),p&&(A=i[m].derivedCommands.tileset,sge(A,t,r,o,y))}}}zb.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;let t=this.appearance;l(t)&&l(t.material)&&t.material.update(e.context);let n=this,i=this._primitiveOptions;if(!l(this._primitive)){let r=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],o=r.length,a,s,c,u=!1,f=!0,d,p=!1,g=!1;for(o>0&&(c=r[0].attributes,p=fd.hasAttributesForSphericalExtents(c),g=fd.hasAttributesForTextureCoordinatePlanes(c),d=c.color),a=0;a<o;a++){s=r[a];let y=s.attributes.color;l(y)&&(u=!0),f=f&&l(y)&&Kt.equals(d,y)}if(!f&&!p&&!g)throw new pe("All GeometryInstances must have the same color attribute except via GroundPrimitives");u&&!l(t)&&(t=new _n({flat:!0}),this.appearance=t),this._usePickOffsets=!p&&!g,this._hasSphericalExtentsAttribute=p,this._hasPlanarExtentsAttributes=g,this._hasPerColorAttribute=u;let m=new Array(o);for(a=0;a<o;++a)s=r[a],m[a]=new Bt({geometry:s.geometry,attributes:s.attributes,modelMatrix:s.modelMatrix,id:s.id,pickPrimitive:this._pickPrimitive??n});i.appearance=t,i.geometryInstances=m,l(this._createBoundingVolumeFunction)&&(i._createBoundingVolumeFunction=function(y,A){n._createBoundingVolumeFunction(y,A)}),i._createRenderStatesFunction=function(y,A,b,x){iJe(n,A)},i._createShaderProgramFunction=function(y,A,b){oJe(n,A)},i._createCommandsFunction=function(y,A,b,x,T,C,E){cJe(n,void 0,void 0,!0,!1,C,E)},l(this._updateAndQueueCommandsFunction)?i._updateAndQueueCommandsFunction=function(y,A,b,x,T,C,E,w){n._updateAndQueueCommandsFunction(y,A,b,x,T,C,E,w)}:i._updateAndQueueCommandsFunction=function(y,A,b,x,T,C,E,w){lJe(n,A,b,x,T,C,E,w)},this._primitive=new Fn(i)}this.debugShowShadowVolume&&!this._debugShowShadowVolume&&this._ready?(this._debugShowShadowVolume=!0,this._rsStencilDepthPass=je.fromCache(Dv(!1,!1)),this._rsStencilDepthPass3DTiles=je.fromCache(Dv(!1,!0)),this._rsColorPass=je.fromCache(I$(!1))):!this.debugShowShadowVolume&&this._debugShowShadowVolume&&(this._debugShowShadowVolume=!1,this._rsStencilDepthPass=je.fromCache(Dv(!0,!1)),this._rsStencilDepthPass3DTiles=je.fromCache(Dv(!0,!0)),this._rsColorPass=je.fromCache(I$(!0))),this._primitive.appearance!==t&&(this._primitive.appearance=t),this._primitive.show=this.show,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};zb.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};zb.prototype.isDestroyed=function(){return!1};zb.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,ue(this)};var WP=zb;var uJe={u_globeMinimumAltitude:function(){return 55e3}};function hu(e){e=e??H.EMPTY_OBJECT;let t=e.appearance,n=e.geometryInstances;if(!l(t)&&l(n)){let r=Array.isArray(n)?n:[n],o=r.length;for(let a=0;a<o;a++){let s=r[a].attributes;if(l(s)&&l(s.color)){t=new _n({flat:!0});break}}}this.appearance=t,this.geometryInstances=e.geometryInstances,this.show=e.show??!0,this.classificationType=e.classificationType??Zn.BOTH,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowShadowVolume=e.debugShowShadowVolume??!1,this._boundingVolumes=[],this._boundingVolumes2D=[],this._ready=!1,this._primitive=void 0,this._maxHeight=void 0,this._minHeight=void 0,this._maxTerrainHeight=Oi._defaultMaxTerrainHeight,this._minTerrainHeight=Oi._defaultMinTerrainHeight,this._boundingSpheresKeys=[],this._boundingSpheres=[],this._useFragmentCulling=!1,this._zIndex=void 0;let i=this;this._classificationPrimitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:e.vertexCacheOptimize??!1,interleave:e.interleave??!1,releaseGeometryInstances:e.releaseGeometryInstances??!0,allowPicking:e.allowPicking??!0,asynchronous:e.asynchronous??!0,compressVertices:e.compressVertices??!0,_createBoundingVolumeFunction:void 0,_updateAndQueueCommandsFunction:void 0,_pickPrimitive:i,_extruded:!0,_uniformMap:uJe}}Object.defineProperties(hu.prototype,{vertexCacheOptimize:{get:function(){return this._classificationPrimitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._classificationPrimitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._classificationPrimitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._classificationPrimitiveOptions.allowPicking}},asynchronous:{get:function(){return this._classificationPrimitiveOptions.asynchronous}},compressVertices:{get:function(){return this._classificationPrimitiveOptions.compressVertices}},ready:{get:function(){return this._ready}}});hu.isSupported=WP.isSupported;function cge(e){return function(t,n){let i=n.maximumRadius,r=i/Math.cos(t*.5)-i;return e._maxHeight+r}}function lge(e){return function(t,n){return e._minHeight}}var fJe=new h,dJe=new h,hJe=new h,mJe=new de,pJe=new ie;function w3(e,t){let n=e.mapProjection.ellipsoid;if(!l(t.attributes)||!l(t.attributes.position3DHigh))return l(t.rectangle)?t.rectangle:void 0;let i=t.attributes.position3DHigh.values,r=t.attributes.position3DLow.values,o=i.length,a=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,u=Number.NEGATIVE_INFINITY;for(let d=0;d<o;d+=3){let p=h.unpack(i,d,fJe),g=h.unpack(r,d,dJe),m=h.add(p,g,hJe),y=n.cartesianToCartographic(m,mJe),A=y.latitude,b=y.longitude;a=Math.min(a,A),s=Math.min(s,b),c=Math.max(c,A),u=Math.max(u,b)}let f=pJe;return f.north=c,f.south=a,f.east=u,f.west=s,f}function gJe(e,t,n){let i=Oi.getMinimumMaximumHeights(t,n);e._minTerrainHeight=i.minimumTerrainHeight,e._maxTerrainHeight=i.maximumTerrainHeight}function _Je(e,t,n){let i=t.mapProjection.ellipsoid,r=w3(t,n),o=Jt.fromRectangle(r,e._minHeight,e._maxHeight,i);if(e._boundingVolumes.push(o),!t.scene3DOnly){let a=t.mapProjection,s=se.fromRectangleWithHeights2D(r,a,e._maxHeight,e._minHeight);h.fromElements(s.center.z,s.center.x,s.center.y,s.center),e._boundingVolumes2D.push(s)}}function P$(e,t){return Math.floor(e%t/2)}function D$(e,t,n,i,r,o,a){let s=e._primitive;n.mode!==re.SCENE3D&&t.shaderProgram===s._spColor&&s._needs2DShader&&(t=t.derivedCommands.appearance2D),t.owner=e,t.modelMatrix=i,t.boundingVolume=o,t.cull=r,t.debugShowBoundingVolume=a,n.commandList.push(t)}function uge(e,t,n,i,r,o){let a=e._primitive;n.mode!==re.SCENE3D&&t.shaderProgram===a._spPick&&a._needs2DShader&&(t=t.derivedCommands.pick2D),t.owner=e,t.modelMatrix=i,t.boundingVolume=o,t.cull=r,n.commandList.push(t)}function yJe(e,t,n,i,r,o,a,s){let c;t.mode===re.SCENE3D?c=e._boundingVolumes:c=e._boundingVolumes2D;let u=e.classificationType,f=u!==Zn.CESIUM_3D_TILE,d=u!==Zn.TERRAIN,p=t.passes,g=e._primitive,m,y,A;if(p.render){let b=n.length;for(m=0;m<b;++m)y=c[P$(m,b)],f&&(A=n[m],D$(e,A,t,r,o,y,a)),d&&(A=n[m].derivedCommands.tileset,D$(e,A,t,r,o,y,a));if(t.invertClassification){let x=g._commandsIgnoreShow,T=x.length;for(m=0;m<T;++m)y=c[m],A=x[m],D$(e,A,t,r,o,y,a)}}if(p.pick){let b=i.length,x;for(e._useFragmentCulling||(x=g._primitive._pickOffsets),m=0;m<b;++m){if(y=c[P$(m,b)],!e._useFragmentCulling){let T=x[P$(m,b)];y=c[T.index]}f&&(A=i[m],uge(e,A,t,r,o,y)),d&&(A=i[m].derivedCommands.tileset,uge(e,A,t,r,o,y))}}}hu.initializeTerrainHeights=function(){return Oi.initialize()};hu.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!Oi.initialized){hu.initializeTerrainHeights();return}let t=this,n=this._classificationPrimitiveOptions;if(!l(this._primitive)){let i=e.mapProjection.ellipsoid,r,o,a,s=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],c=s.length,u=new Array(c),f,d;for(f=0;f<c;++f){r=s[f],o=r.geometry;let y=w3(e,o);l(d)?l(y)&&ie.union(d,y,d):d=ie.clone(y);let A=r.id;if(l(A)&&l(y)){let b=Oi.getBoundingSphere(y,i);this._boundingSpheresKeys.push(A),this._boundingSpheres.push(b)}a=o.constructor,!l(a)||l(a.createShadowVolume)}gJe(this,d,i);let p=e.verticalExaggeration,g=e.verticalExaggerationRelativeHeight;this._minHeight=pr.getHeight(this._minTerrainHeight,p,g),this._maxHeight=pr.getHeight(this._maxTerrainHeight,p,g);let m=hu._supportsMaterials(e.context);if(this._useFragmentCulling=m,m){let y,A=!0;for(f=0;f<c;++f)if(r=s[f],o=r.geometry,d=w3(e,o),fd.shouldUseSphericalCoordinates(d)){A=!1;break}for(f=0;f<c;++f){r=s[f],o=r.geometry,a=o.constructor;let b=w3(e,o),x=o.textureCoordinateRotationPoints;A?y=fd.getPlanarTextureCoordinateAttributes(b,x,i,e.mapProjection,this._maxHeight):y=fd.getSphericalExtentGeometryInstanceAttributes(b,x,i,e.mapProjection);let T=r.attributes;for(let C in T)T.hasOwnProperty(C)&&(y[C]=T[C]);u[f]=new Bt({geometry:a.createShadowVolume(o,lge(this),cge(this)),attributes:y,id:r.id})}}else for(f=0;f<c;++f)r=s[f],o=r.geometry,a=o.constructor,u[f]=new Bt({geometry:a.createShadowVolume(o,lge(this),cge(this)),attributes:r.attributes,id:r.id});n.geometryInstances=u,n.appearance=this.appearance,n._createBoundingVolumeFunction=function(y,A){_Je(t,y,A)},n._updateAndQueueCommandsFunction=function(y,A,b,x,T,C,E,w){yJe(t,A,b,x,T,C,E,w)},this._primitive=new WP(n)}this._primitive.appearance=this.appearance,this._primitive.show=this.show,this._primitive.debugShowShadowVolume=this.debugShowShadowVolume,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{!this._ready&&l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};hu.prototype.getBoundingSphere=function(e){let t=this._boundingSpheresKeys.indexOf(e);if(t!==-1)return this._boundingSpheres[t]};hu.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};hu.prototype.isDestroyed=function(){return!1};hu.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};hu._supportsMaterials=function(e){return e.depthTexture};hu.supportsMaterials=function(e){return hu._supportsMaterials(e.frameState.context)};var mu=hu;function Js(e){e=e??H.EMPTY_OBJECT,this._primitives=[],this._guid=Kn(),this._primitiveAdded=new be,this._primitiveRemoved=new be,this._zIndex=void 0,this.show=e.show??!0,this.destroyPrimitives=e.destroyPrimitives??!0,this._countReferences=e.countReferences??!1}Object.defineProperties(Js.prototype,{length:{get:function(){return this._primitives.length}},primitiveAdded:{get:function(){return this._primitiveAdded}},primitiveRemoved:{get:function(){return this._primitiveRemoved}}});Js.prototype.add=function(e,t){let n=l(t),i=e._external=e._external||{},r=i._composites=i._composites||{};return r[this._guid]={collection:this},n?this._primitives.splice(t,0,e):this._primitives.push(e),this._countReferences&&(l(i._referenceCount)?++i._referenceCount:i._referenceCount=1),this._primitiveAdded.raiseEvent(e),e};Js.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._countReferences&&e._external._referenceCount--,this.destroyPrimitives&&(!this._countReferences||e._external._referenceCount<=0)&&e.destroy(),this._primitiveRemoved.raiseEvent(e),!0}return!1};Js.prototype.removeAndDestroy=function(e){let t=this.remove(e);return t&&!this.destroyPrimitives&&e.destroy(),t};Js.prototype.removeAll=function(){let e=this._primitives,t=e.length;for(let n=0;n<t;++n){let i=e[n];delete i._external._composites[this._guid],this._countReferences&&i._external._referenceCount--,this.destroyPrimitives&&(!this._countReferences||i._external._referenceCount<=0)&&i.destroy(),this._primitiveRemoved.raiseEvent(i)}this._primitives=[]};Js.prototype.contains=function(e){return!!(l(e)&&e._external&&e._external._composites&&e._external._composites[this._guid])};function I3(e,t){return e._primitives.indexOf(t)}Js.prototype.raise=function(e){if(l(e)){let t=I3(this,e),n=this._primitives;if(t!==n.length-1){let i=n[t];n[t]=n[t+1],n[t+1]=i}}};Js.prototype.raiseToTop=function(e){if(l(e)){let t=I3(this,e),n=this._primitives;t!==n.length-1&&(n.splice(t,1),n.push(e))}};Js.prototype.lower=function(e){if(l(e)){let t=I3(this,e),n=this._primitives;if(t!==0){let i=n[t];n[t]=n[t-1],n[t-1]=i}}};Js.prototype.lowerToBottom=function(e){if(l(e)){let t=I3(this,e),n=this._primitives;t!==0&&(n.splice(t,1),n.unshift(e))}};Js.prototype.get=function(e){return this._primitives[e]};Js.prototype.update=function(e){if(!this.show)return;let t=this._primitives;for(let n=0;n<t.length;++n)t[n].update(e)};Js.prototype.prePassesUpdate=function(e){let t=this._primitives;for(let n=0;n<t.length;++n){let i=t[n];l(i.prePassesUpdate)&&i.prePassesUpdate(e)}};Js.prototype.updateForPass=function(e,t){let n=this._primitives;for(let i=0;i<n.length;++i){let r=n[i];l(r.updateForPass)&&r.updateForPass(e,t)}};Js.prototype.postPassesUpdate=function(e){let t=this._primitives;for(let n=0;n<t.length;++n){let i=t[n];l(i.postPassesUpdate)&&i.postPassesUpdate(e)}};Js.prototype.isDestroyed=function(){return!1};Js.prototype.destroy=function(){return this.removeAll(),ue(this)};var pu=Js;function np(){this._length=0,this._collections={},this._collectionsArray=[],this.show=!0}Object.defineProperties(np.prototype,{length:{get:function(){return this._length}}});np.prototype.add=function(e,t){t=t??0;let n=this._collections[t];if(!l(n)){n=new pu({destroyPrimitives:!1}),n._zIndex=t,this._collections[t]=n;let i=this._collectionsArray,r=0;for(;r<i.length&&i[r]._zIndex<t;)r++;i.splice(r,0,n)}return n.add(e),this._length++,e._zIndex=t,e};np.prototype.set=function(e,t){return t===e._zIndex||(this.remove(e,!0),this.add(e,t)),e};np.prototype.remove=function(e,t){if(this.contains(e)){let n=e._zIndex,i=this._collections[n],r;return t?r=i.remove(e):r=i.removeAndDestroy(e),r&&this._length--,i.length===0&&(this._collectionsArray.splice(this._collectionsArray.indexOf(i),1),this._collections[n]=void 0,i.destroy()),r}return!1};np.prototype.removeAll=function(){let e=this._collectionsArray;for(let t=0;t<e.length;t++){let n=e[t];n.destroyPrimitives=!0,n.destroy()}this._collections={},this._collectionsArray=[],this._length=0};np.prototype.contains=function(e){if(!l(e))return!1;let t=this._collections[e._zIndex];return l(t)&&t.contains(e)};np.prototype.update=function(e){if(!this.show)return;let t=this._collectionsArray;for(let n=0;n<t.length;n++)t[n].update(e)};np.prototype.isDestroyed=function(){return!1};np.prototype.destroy=function(){return this.removeAll(),ue(this)};var P3=np;var sy={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};Object.freeze(sy);var it=sy;function gu(e){return e===sy.CLAMP_TO_GROUND||e===sy.CLAMP_TO_3D_TILE||e===sy.CLAMP_TO_TERRAIN}function Rv(e){return e===sy.RELATIVE_TO_GROUND||e===sy.RELATIVE_TO_3D_TILE||e===sy.RELATIVE_TO_TERRAIN}var fge={CENTER:0,LEFT:1,RIGHT:-1};Object.freeze(fge);var ji=fge;var dge={CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1};Object.freeze(dge);var Wn=dge;function xh(){pe.throwInstantiationError()}Object.defineProperties(xh.prototype,{isConstant:{get:pe.throwInstantiationError},definitionChanged:{get:pe.throwInstantiationError}});xh.prototype.getValue=pe.throwInstantiationError;xh.prototype.equals=pe.throwInstantiationError;xh.equals=function(e,t){return e===t||l(e)&&e.equals(t)};xh.arrayEquals=function(e,t){if(e===t)return!0;if(!l(e)||!l(t)||e.length!==t.length)return!1;let n=e.length;for(let i=0;i<n;i++)if(!xh.equals(e[i],t[i]))return!1;return!0};xh.isConstant=function(e){return!l(e)||e.isConstant};xh.getValueOrUndefined=function(e,t,n){return l(e)?e.getValue(t,n):void 0};xh.getValueOrDefault=function(e,t,n,i){return l(e)?e.getValue(t,i)??n:n};xh.getValueOrClonedDefault=function(e,t,n,i){let r;return l(e)&&(r=e.getValue(t,i)),l(r)||(r=n.clone(r)),r};var X=xh;var hge={LEFT:-1,NONE:0,RIGHT:1};Object.freeze(hge);var jo=hge;var AJe=U.WHITE,bJe=h.ZERO,xJe=it.NONE,TJe=k.ZERO,CJe=1,vJe=0,EJe=h.ZERO,SJe=ji.CENTER,wJe=Wn.CENTER,IJe=!1,PJe=jo.NONE,DJe=new h,RJe=new U,OJe=new h,MJe=new k,LJe=new Wt,NJe=new Wt,FJe=new Wt,BJe=new Je,kJe=new jt;function mge(e){this.entity=e,this.billboard=void 0,this.textureValue=void 0}function cy(e,t){t.collectionChanged.addEventListener(cy.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new zt,this._onCollectionChanged(t,t.values,[],[])}cy.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,r=t.length;i<r;i++){let o=t[i],a=o.entity,s=a._billboard,c,u=o.billboard,f=a.isShowing&&a.isAvailable(e)&&X.getValueOrDefault(s._show,e,!0),d;if(f&&(d=X.getValueOrUndefined(a._position,e,DJe),c=X.getValueOrUndefined(s._image,e),f=l(d)&&l(c)),!f){R$(o,a,n);continue}X.isConstant(a._position)||(n._clusterDirty=!0),l(u)||(u=n.getBillboard(a),u.id=a,o.billboard=u,o.textureValue=void 0),u.show=f,u.position=d,u.color=X.getValueOrDefault(s._color,e,AJe,RJe),u.eyeOffset=X.getValueOrDefault(s._eyeOffset,e,bJe,OJe),u.heightReference=X.getValueOrDefault(s._heightReference,e,xJe),u.pixelOffset=X.getValueOrDefault(s._pixelOffset,e,TJe,MJe),u.scale=X.getValueOrDefault(s._scale,e,CJe),u.rotation=X.getValueOrDefault(s._rotation,e,vJe),u.alignedAxis=X.getValueOrDefault(s._alignedAxis,e,EJe),u.horizontalOrigin=X.getValueOrDefault(s._horizontalOrigin,e,SJe),u.verticalOrigin=X.getValueOrDefault(s._verticalOrigin,e,wJe),u.width=X.getValueOrUndefined(s._width,e),u.height=X.getValueOrUndefined(s._height,e),u.scaleByDistance=X.getValueOrUndefined(s._scaleByDistance,e,LJe),u.translucencyByDistance=X.getValueOrUndefined(s._translucencyByDistance,e,NJe),u.pixelOffsetScaleByDistance=X.getValueOrUndefined(s._pixelOffsetScaleByDistance,e,FJe),u.sizeInMeters=X.getValueOrDefault(s._sizeInMeters,e,IJe),u.distanceDisplayCondition=X.getValueOrUndefined(s._distanceDisplayCondition,e,kJe),u.disableDepthTestDistance=X.getValueOrUndefined(s._disableDepthTestDistance,e),u.splitDirection=X.getValueOrDefault(s._splitDirection,e,PJe),o.textureValue!==c&&(u.image=c,o.textureValue=c);let p=X.getValueOrUndefined(s._imageSubRegion,e,BJe);l(p)&&u.setImageSubRegion(u.image,p)}return!0};cy.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!l(n.billboard))return It.FAILED;let i=n.billboard;if(i.heightReference===it.NONE)t.center=h.clone(i.position,t.center);else{if(!l(i._clampedPosition))return It.PENDING;t.center=h.clone(i._clampedPosition,t.center)}return t.radius=0,It.DONE};cy.prototype.isDestroyed=function(){return!1};cy.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(cy.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeBillboard(e[t]);return ue(this)};cy.prototype._onCollectionChanged=function(e,t,n,i){let r,o,a=this._items,s=this._cluster;for(r=t.length-1;r>-1;r--)o=t[r],l(o._billboard)&&l(o._position)&&a.set(o.id,new mge(o));for(r=i.length-1;r>-1;r--)o=i[r],l(o._billboard)&&l(o._position)?a.contains(o.id)||a.set(o.id,new mge(o)):(R$(a.get(o.id),o,s),a.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],R$(a.get(o.id),o,s),a.remove(o.id)};function R$(e,t,n){l(e)&&(e.billboard=void 0,n.removeBillboard(t))}var D3=cy;function R3(){pe.throwInstantiationError()}Object.defineProperties(R3.prototype,{name:{get:pe.throwInstantiationError},clock:{get:pe.throwInstantiationError},entities:{get:pe.throwInstantiationError},isLoading:{get:pe.throwInstantiationError},changedEvent:{get:pe.throwInstantiationError},errorEvent:{get:pe.throwInstantiationError},loadingEvent:{get:pe.throwInstantiationError},show:{get:pe.throwInstantiationError},clustering:{get:pe.throwInstantiationError}});R3.prototype.update=function(e){pe.throwInstantiationError()};R3.setLoading=function(e,t){e._isLoading!==t&&(t?e._entityCollection.suspendEvents():e._entityCollection.resumeEvents(),e._isLoading=t,e._loading.raiseEvent(e,t))};var Ca=R3;var zJe=Object.freeze({NONE:0,LOADING:2,LOADED:3,ERROR:4,FAILED:5}),Va=zJe;function Th(e){this._billboardCollection=e,this._id=void 0,this._loadState=Va.NONE,this._loadError=void 0,this._index=-1,this._width=void 0,this._height=void 0,this._hasSubregion=!1,this.dirty=!1}Object.defineProperties(Th.prototype,{loadError:{get:function(){return this._loadError}},loadState:{get:function(){return this._loadState}},ready:{get:function(){return this._loadState===Va.LOADED}},hasImage:{get:function(){return this._loadState!==Va.NONE}},id:{get:function(){return this._id}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});Th.prototype.unload=async function(){this._loadState!==Va.NONE&&(this._id=void 0,this._loadError=void 0,this._loadState=Va.NONE,this._index=-1,this._width=void 0,this._height=void 0,this.dirty=!0)};Th.prototype.loadImage=async function(e,t,n,i){if(this._id===e)return;let r=this._billboardCollection,o=r.billboardTextureCache,a=o.get(e);if(l(a)&&t.loadState===Va.LOADING||t.loadState===Va.LOADED){Th.clone(a,this);return}l(a)||(a=new Th(r),o.set(e,a)),a._id=this._id=e,a._loadState=this._loadState=Va.LOADING,a._loadError=this._loadError=void 0;let s,c=this._billboardCollection.textureAtlas;try{let f=c.addImage(e,t,n,i);typeof f=="number"?s=f:s=await f}catch(f){if(a._loadState=Va.ERROR,a._loadError=f,this._id!==e)return;this._loadState=Va.ERROR,this._loadError=f;return}if(!l(s)||s===-1){if(a._loadState=Va.FAILED,a._index=-1,this._id!==e)return;this._loadState=Va.FAILED,this._index=-1;return}a._index=s,a._loadState=Va.LOADED;let u=c.rectangles[s];a._width=u.width,a._height=u.height,this._id===e&&(this._index=s,this._loadState=Va.LOADED,this._width=u.width,this._height=u.height,this.dirty=!0)};Th.prototype.addImageSubRegion=function(e,t){this._id=e,this._loadError=void 0,this._hasSubregion=!0;let i=this._billboardCollection.textureAtlas.addImageSubRegion(e,t);if(typeof i=="number"){this.setImageSubRegion(i,t);return}this.loadImageSubRegion(e,t,i)};Th.prototype.loadImageSubRegion=async function(e,t,n){let i;try{this._loadState=Va.LOADING,i=await n}catch(r){this._loadState=Va.ERROR,this._loadError=r;return}this._id===e&&(this._loadState=Va.LOADED,this.setImageSubRegion(i,t))};Th.prototype.setImageSubRegion=function(e,t){if(this._index!==e){if(!l(e)||e===-1){this._loadState=Va.FAILED,this._index=-1,this._width=void 0,this._height=void 0;return}this._width=t.width,this._height=t.height,this._index=e,this.dirty=!0}};Th.prototype.computeTextureCoordinates=function(e){return this._billboardCollection.textureAtlas.computeTextureCoordinates(this._index,e)};Th.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 ly=Th;var bc={},UJe=new ae(0,0,0,1),Xc=new ae,VJe=new Je,O$=new k,M$=new k;bc.worldToWindowCoordinates=function(e,t,n){return bc.worldWithEyeOffsetToWindowCoordinates(e,t,h.ZERO,n)};var pge=new ae,gge=new h;function qP(e,t,n,i){let r=n.viewMatrix,o=O.multiplyByVector(r,ae.fromElements(e.x,e.y,e.z,1,pge),pge),a=h.multiplyComponents(t,h.normalize(o,gge),gge);return o.x+=t.x+a.x,o.y+=t.y+a.y,o.z+=a.z,O.multiplyByVector(n.frustum.projectionMatrix,o,i)}var jJe=new de(Math.PI,I.PI_OVER_TWO),HJe=new h,GJe=new h;bc.worldWithEyeOffsetToWindowCoordinates=function(e,t,n,i){let r=e.frameState,o=bc.computeActualEllipsoidPosition(r,t,UJe);if(!l(o))return;let a=e.canvas,s=VJe;s.x=0,s.y=0,s.width=a.clientWidth,s.height=a.clientHeight;let c=e.camera,u=!1;if(r.mode===re.SCENE2D){let f=e.mapProjection,d=jJe,p=f.project(d,HJe),g=h.clone(c.position,GJe),m=c.frustum.clone(),y=O.computeViewportTransformation(s,0,1,new O),A=c.frustum.projectionMatrix,b=c.positionWC.y,x=h.fromElements(I.sign(b)*p.x-b,0,-c.positionWC.x),T=mt.pointToGLWindowCoordinates(A,y,x);if(b===0||T.x<=0||T.x>=a.clientWidth)u=!0;else{if(T.x>a.clientWidth*.5){s.width=T.x,c.frustum.right=p.x-b,Xc=qP(o,n,c,Xc),bc.clipToGLWindowCoordinates(s,Xc,O$),s.x+=T.x,c.position.x=-c.position.x;let C=c.frustum.right;c.frustum.right=-c.frustum.left,c.frustum.left=-C,Xc=qP(o,n,c,Xc),bc.clipToGLWindowCoordinates(s,Xc,M$)}else{s.x+=T.x,s.width-=T.x,c.frustum.left=-p.x-b,Xc=qP(o,n,c,Xc),bc.clipToGLWindowCoordinates(s,Xc,O$),s.x=s.x-s.width,c.position.x=-c.position.x;let C=c.frustum.left;c.frustum.left=-c.frustum.right,c.frustum.right=-C,Xc=qP(o,n,c,Xc),bc.clipToGLWindowCoordinates(s,Xc,M$)}h.clone(g,c.position),c.frustum=m.clone(),i=k.clone(O$,i),(i.x<0||i.x>a.clientWidth)&&(i.x=M$.x)}}if(r.mode!==re.SCENE2D||u){if(Xc=qP(o,n,c,Xc),Xc.z<0&&!(c.frustum instanceof pn)&&!(c.frustum instanceof Aa))return;i=bc.clipToGLWindowCoordinates(s,Xc,i)}return i.y=a.clientHeight-i.y,i};bc.worldToDrawingBufferCoordinates=function(e,t,n){if(n=bc.worldToWindowCoordinates(e,t,n),!!l(n))return bc.transformWindowToDrawingBuffer(e,n,n)};var W0=new h,WJe=new de;bc.computeActualEllipsoidPosition=function(e,t,n){let i=e.mode;if(i===re.SCENE3D)return h.clone(t,n);let r=e.mapProjection,o=r.ellipsoid.cartesianToCartographic(t,WJe);if(!l(o))return;if(r.project(o,W0),i===re.COLUMBUS_VIEW)return h.fromElements(W0.z,W0.x,W0.y,n);if(i===re.SCENE2D)return h.fromElements(0,W0.x,W0.y,n);let a=e.morphTime;return h.fromElements(I.lerp(W0.z,t.x,a),I.lerp(W0.x,t.y,a),I.lerp(W0.y,t.z,a),n)};var _ge=new h,yge=new h,Age=new O;bc.clipToGLWindowCoordinates=function(e,t,n){return h.divideByScalar(t,t.w,_ge),O.computeViewportTransformation(e,0,1,Age),O.multiplyByPoint(Age,_ge,yge),k.fromCartesian3(yge,n)};bc.transformWindowToDrawingBuffer=function(e,t,n){let i=e.canvas,r=e.drawingBufferWidth/i.clientWidth,o=e.drawingBufferHeight/i.clientHeight;return k.fromElements(t.x*r,t.y*o,n)};var qJe=new ae,bge=new ae;bc.drawingBufferToWorldCoordinates=function(e,t,n,i){let o=e.context.uniformState,a=o.currentFrustum,s=a.x,c=a.y;if(e.frameState.useLogDepth){let g=n*o.log2FarDepthFromNearPlusOne,m=Math.pow(2,g)-1;n=c*(1-s/(m+s))/(c-s)}let u=e.view.passState.viewport,f=ae.clone(ae.UNIT_W,qJe);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 d,p=e.camera.frustum;if(l(p.fovy)){d=O.multiplyByVector(o.inverseViewProjection,f,bge);let g=1/d.w;h.multiplyByScalar(d,g,d)}else{let g=p.offCenterFrustum;l(g)&&(p=g),d=bge,d.x=(f.x*(p.right-p.left)+p.left+p.right)*.5,d.y=(f.y*(p.top-p.bottom)+p.bottom+p.top)*.5,d.z=(f.z*(s-c)-s-c)*.5,d.w=1,d=O.multiplyByVector(o.inverseView,d,d)}return h.fromCartesian4(d,i)};var cr=bc;function Si(e,t){e=e??H.EMPTY_OBJECT;let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,r=e.scaleByDistance,o=e.distanceDisplayCondition;l(n)&&(n=Wt.clone(n)),l(i)&&(i=Wt.clone(i)),l(r)&&(r=Wt.clone(r)),l(o)&&(o=jt.clone(o)),this._show=e.show??!0,this._position=h.clone(e.position??h.ZERO),this._actualPosition=h.clone(this._position),this._pixelOffset=k.clone(e.pixelOffset??k.ZERO),this._translate=new k(0,0),this._eyeOffset=h.clone(e.eyeOffset??h.ZERO),this._heightReference=e.heightReference??it.NONE,this._verticalOrigin=e.verticalOrigin??Wn.CENTER,this._horizontalOrigin=e.horizontalOrigin??ji.CENTER,this._scale=e.scale??1,this._color=U.clone(e.color??U.WHITE),this._rotation=e.rotation??0,this._alignedAxis=h.clone(e.alignedAxis??h.ZERO),this._width=e.width,this._height=e.height,this._scaleByDistance=r,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._sizeInMeters=e.sizeInMeters??!1,this._distanceDisplayCondition=o,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 ly(t),this._imageId=e.imageId,this._imageWidth=void 0,this._imageHeight=void 0,this._labelDimensions=void 0,this._labelHorizontalOrigin=void 0,this._labelTranslate=void 0;let a=e.image;l(a)&&(this._computeImageTextureProperties(e.imageId,a),this._imageTexture.loadImage(this._imageId,a,this._imageWidth,this._imageHeight)),l(e.imageSubRegion)&&this._imageTexture.addImageSubRegion(this._imageId,e.imageSubRegion),this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=re.SCENE3D,this._clusterShow=!0,this._outlineColor=U.clone(e.outlineColor??U.BLACK),this._outlineWidth=e.outlineWidth??0,this._updateClamping(),this._splitDirection=e.splitDirection??jo.NONE,this._positionFromParent=!1}var xge=Si.SHOW_INDEX=0,M3=Si.POSITION_INDEX=1,wge=Si.PIXEL_OFFSET_INDEX=2,YJe=Si.EYE_OFFSET_INDEX=3,XJe=Si.HORIZONTAL_ORIGIN_INDEX=4,KJe=Si.VERTICAL_ORIGIN_INDEX=5,$Je=Si.SCALE_INDEX=6,Tge=Si.IMAGE_INDEX_INDEX=7,Cge=Si.COLOR_INDEX=8,JJe=Si.ROTATION_INDEX=9,ZJe=Si.ALIGNED_AXIS_INDEX=10,QJe=Si.SCALE_BY_DISTANCE_INDEX=11,eZe=Si.TRANSLUCENCY_BY_DISTANCE_INDEX=12,tZe=Si.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,nZe=Si.DISTANCE_DISPLAY_CONDITION=14,iZe=Si.DISABLE_DEPTH_DISTANCE=15;Si.TEXTURE_COORDINATE_BOUNDS=16;var vge=Si.SDF_INDEX=17,rZe=Si.SPLIT_DIRECTION_INDEX=18;Si.NUMBER_OF_PROPERTIES=19;function Ao(e,t){let n=e._billboardCollection;l(n)&&(n._updateBillboard(e,t),e._dirty=!0)}Object.defineProperties(Si.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,Ao(this,xge))}},position:{get:function(){return this._position},set:function(e){let t=this._position;h.equals(t,e)||(h.clone(e,t),h.clone(e,this._actualPosition),this._updateClamping(),Ao(this,M3))}},heightReference:{get:function(){return this._heightReference},set:function(e){let t=this._heightReference;e!==t&&(this._heightReference=e,this._updateClamping(),Ao(this,M3))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;k.equals(t,e)||(k.clone(e,t),Ao(this,wge))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;Wt.equals(t,e)||(this._scaleByDistance=Wt.clone(e,t),Ao(this,QJe))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;Wt.equals(t,e)||(this._translucencyByDistance=Wt.clone(e,t),Ao(this,eZe))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){let t=this._pixelOffsetScaleByDistance;Wt.equals(t,e)||(this._pixelOffsetScaleByDistance=Wt.clone(e,t),Ao(this,tZe))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;h.equals(t,e)||(h.clone(e,t),Ao(this,YJe))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,Ao(this,XJe))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin!==e&&(this._verticalOrigin=e,Ao(this,KJe))}},scale:{get:function(){return this._scale},set:function(e){this._scale!==e&&(this._scale=e,Ao(this,$Je))}},color:{get:function(){return this._color},set:function(e){let t=this._color;U.equals(t,e)||(U.clone(e,t),Ao(this,Cge))}},rotation:{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,Ao(this,JJe))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){let t=this._alignedAxis;h.equals(t,e)||(h.clone(e,t),Ao(this,ZJe))}},width:{get:function(){return this._width??this._imageTexture.width},set:function(e){this._width!==e&&(this._width=e,Ao(this,Tge))}},height:{get:function(){return this._height??this._imageTexture.height},set:function(e){this._height!==e&&(this._height=e,Ao(this,Tge))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters!==e&&(this._sizeInMeters=e,Ao(this,Cge))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){jt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=jt.clone(e,this._distanceDisplayCondition),Ao(this,nZe))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,Ao(this,iZe))}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickPrimitive:{get:function(){return this._pickPrimitive},set:function(e){this._pickPrimitive=e,l(this._pickId)&&(this._pickId.object.primitive=e)}},pickId:{get:function(){return this._pickId}},image:{get:function(){return this._imageTexture.id},set:function(e){if(!l(e)){this._imageTexture.unload();return}this._computeImageTextureProperties(void 0,e),this._imageTexture.loadImage(this._imageId,e,this._imageWidth,this._imageHeight)}},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=h.clone(e,this._actualClampedPosition),Ao(this,M3)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,Ao(this,xge))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;U.equals(t,e)||(U.clone(e,t),Ao(this,vge))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Ao(this,vge))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,Ao(this,rZe))}}});Si.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId};Si.prototype._updateClamping=function(){Si._updateClamping(this._billboardCollection,this)};var L3=new de;Si._updateClamping=function(e,t){if(!l(e)||!l(e._scene))return;let n=e._scene,i=n.ellipsoid??te.default,r=n.frameState.mode,o=r!==t._mode;if(t._mode=r,(t._heightReference===it.NONE||o)&&l(t._removeCallbackFunc)&&(t._removeCallbackFunc(),t._removeCallbackFunc=void 0,t._clampedPosition=void 0),t._heightReference===it.NONE||t._positionFromParent||!l(t._position))return;l(t._removeCallbackFunc)&&t._removeCallbackFunc();let a=i.cartesianToCartographic(t._position);if(!l(a)){t._actualClampedPosition=void 0;return}function s(u){let f=i.cartographicToCartesian(u,t._clampedPosition);Rv(t._heightReference)&&(t._mode===re.SCENE3D?(u.height+=a.height,i.cartographicToCartesian(u,f)):f.x+=a.height),t._clampedPosition=f}t._removeCallbackFunc=n.updateHeight(a,s,t._heightReference),de.clone(a,L3);let c=n.getHeight(a,t._heightReference);l(c)&&(L3.height=c),s(L3)};Si.prototype.computeTextureCoordinates=function(e){return this._imageTexture.computeTextureCoordinates(e)};Si.prototype.setImage=function(e,t){this._computeImageTextureProperties(e,t),this._imageTexture.loadImage(this._imageId,t,this._imageWidth,this._imageHeight)};Si.prototype.setImageTexture=function(e){ly.clone(e,this._imageTexture)};var Ege=512;Si.prototype._computeImageTextureProperties=function(e,t){if(this._imageWidth=void 0,this._imageHeight=void 0,!l(t)){this._imageId=Kn();return}let n;typeof t=="string"?n=t:t instanceof De?n=t._url:l(t.src)&&(n=t.src),this._imageId=e??n??Kn(),l(this._width)&&l(this._height)&&!this._sizeInMeters&&oZe(n)&&(this._imageWidth=Math.min(this._width,Ege),this._imageHeight=Math.min(this._height,Ege))};function oZe(e){return l(e)?bm(e)?e.startsWith("data:image/svg+xml"):e_(e)==="svg":!1}Si.prototype.setImageSubRegion=function(e,t){this._imageTexture.addImageSubRegion(e,t)};Si.prototype._setTranslate=function(e){let t=this._translate;k.equals(t,e)||(k.clone(e,t),Ao(this,wge))};Si.prototype._getActualPosition=function(){return l(this._clampedPosition)?this._clampedPosition:this._actualPosition};Si.prototype._setActualPosition=function(e){l(this._clampedPosition)||h.clone(e,this._actualPosition),Ao(this,M3)};var Sge=new ae;Si._computeActualPosition=function(e,t,n,i){return l(e._clampedPosition)?(n.mode!==e._mode&&e._updateClamping(),e._clampedPosition):n.mode===re.SCENE3D?t:(O.multiplyByPoint(i,t,Sge),cr.computeActualEllipsoidPosition(n,Sge))};var Ige=new h;Si._computeScreenSpacePosition=function(e,t,n,i,r,o){let a=O.multiplyByPoint(e,t,Ige),s=cr.worldWithEyeOffsetToWindowCoordinates(r,a,n,o);if(l(s))return k.add(s,i,s),s};var O3=new k(0,0);Si.prototype.computeScreenSpacePosition=function(e,t){let n=this._billboardCollection;l(t)||(t=new k),k.clone(this._pixelOffset,O3),k.add(O3,this._translate,O3);let i=n.modelMatrix,r=this._position;if(l(this._clampedPosition)&&(r=this._clampedPosition,e.mode!==re.SCENE3D)){let a=e.mapProjection,s=a.ellipsoid,c=a.unproject(r,L3);r=s.cartographicToCartesian(c,Ige),i=O.IDENTITY}return Si._computeScreenSpacePosition(i,r,this._eyeOffset,O3,e,t)};Si.getScreenSpaceBoundingBox=function(e,t,n){let i=e.width,r=e.height,o=e.scale;i*=o,r*=o;let a=t.x;e.horizontalOrigin===ji.RIGHT?a-=i:e.horizontalOrigin===ji.CENTER&&(a-=i*.5);let s=t.y;return e.verticalOrigin===Wn.BOTTOM||e.verticalOrigin===Wn.BASELINE?s-=r:e.verticalOrigin===Wn.CENTER&&(s-=r*.5),l(n)||(n=new Je),n.x=a,n.y=s,n.width=i,n.height=r,n};Si.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&h.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&&U.equals(this._color,e._color)&&k.equals(this._pixelOffset,e._pixelOffset)&&k.equals(this._translate,e._translate)&&h.equals(this._eyeOffset,e._eyeOffset)&&Wt.equals(this._scaleByDistance,e._scaleByDistance)&&Wt.equals(this._translucencyByDistance,e._translucencyByDistance)&&Wt.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&jt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};Si.prototype._destroy=function(){l(this._customData)&&(this._billboardCollection._scene.globe._surface.removeTileCustomData(this._customData),this._customData=void 0),l(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this.image=void 0,this._pickId=this._pickId&&this._pickId.destroy(),this._billboardCollection=void 0};var Dr=Si;var N3=`uniform sampler2D u_atlas;
|
|
uniform float u_coarseDepthTestDistance;
|
|
uniform float u_threePointDepthTestDistance;
|
|
|
|
#ifdef VECTOR_TILE
|
|
uniform vec4 u_highlightColor;
|
|
#endif
|
|
|
|
in vec2 v_textureCoordinates;
|
|
in vec4 v_pickColor;
|
|
in vec4 v_color;
|
|
flat in vec2 v_splitDirectionAndEllipsoidDepthEC;
|
|
|
|
#ifdef SDF
|
|
in vec4 v_outlineColor;
|
|
in float v_outlineWidth;
|
|
#endif
|
|
|
|
in vec4 v_compressed; // x: eyeDepth, y: applyTranslate & enableDepthCheck, z: dimensions, w: imageSize
|
|
const float SHIFT_LEFT1 = 2.0;
|
|
const float SHIFT_RIGHT1 = 1.0 / 2.0;
|
|
|
|
float getGlobeDepthAtCoords(vec2 st)
|
|
{
|
|
float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, st));
|
|
if (logDepthOrDepth == 0.0)
|
|
{
|
|
return 0.0; // not on the globe
|
|
}
|
|
|
|
vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);
|
|
return eyeCoordinate.z / eyeCoordinate.w;
|
|
}
|
|
|
|
#ifdef SDF
|
|
|
|
// Get the distance from the edge of a glyph at a given position sampling an SDF texture.
|
|
float getDistance(vec2 position)
|
|
{
|
|
return texture(u_atlas, position).r;
|
|
}
|
|
|
|
// Samples the sdf texture at the given position and produces a color based on the fill color and the outline.
|
|
vec4 getSDFColor(vec2 position, float outlineWidth, vec4 outlineColor, float smoothing)
|
|
{
|
|
float distance = getDistance(position);
|
|
|
|
if (outlineWidth > 0.0)
|
|
{
|
|
// Don't get the outline edge exceed the SDF_EDGE
|
|
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
|
|
|
|
bool getDepthTestEnabled() {
|
|
float temp = v_compressed.y;
|
|
temp = temp * SHIFT_RIGHT1;
|
|
float temp2 = (temp - floor(temp)) * SHIFT_LEFT1;
|
|
return temp2 != 0.0;
|
|
}
|
|
|
|
float getRelativeEyeDepth(float eyeDepth, float distanceToEllipsoid, float epsilon) {
|
|
float depthDifferential = eyeDepth - distanceToEllipsoid;
|
|
float depthRatio = abs(depthDifferential / distanceToEllipsoid);
|
|
if (depthRatio < epsilon) {
|
|
// The approximations are imprecise, so use an epsilon check for small value differences and assume a value of 0.0
|
|
return 0.0;
|
|
}
|
|
|
|
return depthDifferential;
|
|
}
|
|
|
|
// Extra manual depth testing is done to allow more control over how a billboard is occluded
|
|
// by the globe when near and far from the camera.
|
|
void doDepthTest(float eyeDepth, float globeDepth) {
|
|
|
|
#ifdef VS_THREE_POINT_DEPTH_CHECK
|
|
// Since discarding vertices is not possible, the vertex shader sets eyeDepth to 0 to indicate the depth test failed. Apply the discard here.
|
|
if (eyeDepth > -u_threePointDepthTestDistance) {
|
|
if (eyeDepth == 0.0) {
|
|
discard;
|
|
}
|
|
return;
|
|
}
|
|
#endif
|
|
bool useGlobeDepth = eyeDepth > -u_coarseDepthTestDistance;
|
|
if (useGlobeDepth && globeDepth == 0.0) {
|
|
// Pixel is not on the globe, so there is no distance to compare against. Pass.
|
|
return;
|
|
}
|
|
|
|
// If the camera is close, compare against the globe depth texture that includes depth from the 3D tile pass.
|
|
if (useGlobeDepth && getRelativeEyeDepth(eyeDepth, globeDepth, czm_epsilon1) < 0.0) {
|
|
discard;
|
|
}
|
|
}
|
|
|
|
#ifdef LOG_DEPTH
|
|
void writeDepth(float eyeDepth, float globeDepth, float distanceToEllipsoid) {
|
|
// If we've made it here, the manual depth test above determined that this fragment should be visible.
|
|
// But the automatic depth test must still run in order to write the result to the depth buffer, and its results may
|
|
// disagree with our manual depth test's results. To prefer our manual results when in front of the globe, apply an offset towards the camera.
|
|
|
|
float depthArg = v_depthFromNearPlusOne;
|
|
|
|
if (globeDepth != 0.0 && getRelativeEyeDepth(eyeDepth, distanceToEllipsoid, czm_epsilon3) > 0.0) {
|
|
float globeDepthFromNearPlusOne = (-globeDepth - czm_currentFrustum.x) + 1.0;
|
|
float nudge = max(globeDepthFromNearPlusOne * 5e-6, czm_epsilon7);
|
|
float globeOnTop = max(1.0, globeDepthFromNearPlusOne - nudge);
|
|
depthArg = min(depthArg, globeOnTop);
|
|
}
|
|
|
|
czm_writeLogDepth(depthArg);
|
|
}
|
|
#endif
|
|
|
|
void main()
|
|
{
|
|
if (v_splitDirectionAndEllipsoidDepthEC.x < 0.0 && gl_FragCoord.x > czm_splitPosition) {
|
|
discard;
|
|
}
|
|
if (v_splitDirectionAndEllipsoidDepthEC.x > 0.0 && gl_FragCoord.x < czm_splitPosition) {
|
|
discard;
|
|
}
|
|
|
|
if (getDepthTestEnabled()) {
|
|
vec2 fragSt = gl_FragCoord.xy / czm_viewport.zw;
|
|
float eyeDepth = v_compressed.x;
|
|
float globeDepth = getGlobeDepthAtCoords(fragSt);
|
|
float distanceToEllipsoid = -v_splitDirectionAndEllipsoidDepthEC.y;
|
|
doDepthTest(eyeDepth, globeDepth);
|
|
|
|
#ifdef LOG_DEPTH
|
|
writeDepth(eyeDepth, globeDepth, distanceToEllipsoid);
|
|
#endif
|
|
}
|
|
|
|
vec4 color = texture(u_atlas, v_textureCoordinates);
|
|
|
|
#ifdef SDF
|
|
float outlineWidth = v_outlineWidth;
|
|
vec4 outlineColor = v_outlineColor;
|
|
|
|
// Get the current distance
|
|
float distance = getDistance(v_textureCoordinates);
|
|
|
|
#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))
|
|
float smoothing = fwidth(distance);
|
|
// Get an offset that is approximately half the distance to the neighbor pixels
|
|
// 0.354 is approximately half of 1/sqrt(2)
|
|
vec2 sampleOffset = 0.354 * vec2(dFdx(v_textureCoordinates) + dFdy(v_textureCoordinates));
|
|
|
|
// Sample the center point
|
|
vec4 center = getSDFColor(v_textureCoordinates, outlineWidth, outlineColor, smoothing);
|
|
|
|
// Sample the 4 neighbors
|
|
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);
|
|
|
|
// Equally weight the center sample and the 4 neighboring samples
|
|
color = (center + color1 + color2 + color3 + color4)/5.0;
|
|
#else
|
|
// If no derivatives available (IE 10?), just do a single sample
|
|
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
|
|
|
|
// Fully transparent parts of the billboard are not pickable.
|
|
#if !defined(OPAQUE) && !defined(TRANSLUCENT)
|
|
if (color.a < 0.005) // matches 0/255 and 1/255
|
|
{
|
|
discard;
|
|
}
|
|
#else
|
|
// The billboard is rendered twice. The opaque pass discards translucent fragments
|
|
// and the translucent pass discards opaque fragments.
|
|
#ifdef OPAQUE
|
|
if (color.a < 0.995) // matches < 254/255
|
|
{
|
|
discard;
|
|
}
|
|
#else
|
|
if (color.a >= 0.995) // matches 254/255 and 255/255
|
|
{
|
|
discard;
|
|
}
|
|
#endif
|
|
#endif
|
|
|
|
#ifdef VECTOR_TILE
|
|
color *= u_highlightColor;
|
|
#endif
|
|
out_FragColor = color;
|
|
}
|
|
`;var F3=`uniform float u_threePointDepthTestDistance;
|
|
in vec2 direction;
|
|
in vec4 positionHighAndScale;
|
|
in vec4 positionLowAndRotation;
|
|
in vec4 compressedAttribute0; // pixel offset, translate, horizontal origin, vertical origin, show, direction, texture coordinates (texture offset)
|
|
in vec4 compressedAttribute1; // aligned axis, translucency by distance, image width
|
|
in vec4 compressedAttribute2; // label horizontal origin, image height, color, pick color, size in meters, valid aligned axis, 13 bits free
|
|
in vec4 eyeOffset; // eye offset in meters, 4 bytes free (texture range)
|
|
in vec4 scaleByDistance; // near, nearScale, far, farScale
|
|
in vec4 pixelOffsetScaleByDistance; // near, nearScale, far, farScale
|
|
in vec4 compressedAttribute3; // distance display condition near, far, disableDepthTestDistanceSq, dimensions
|
|
in vec2 sdf; // sdf outline color (rgb) and width (w)
|
|
in float splitDirection; // splitDirection
|
|
#ifdef VS_THREE_POINT_DEPTH_CHECK
|
|
in vec4 textureCoordinateBoundsOrLabelTranslate; // the min and max x and y values for the texture coordinates
|
|
#endif
|
|
#ifdef VECTOR_TILE
|
|
in float a_batchId;
|
|
#endif
|
|
|
|
out vec2 v_textureCoordinates;
|
|
out vec4 v_compressed; // x: eyeDepth, y: applyTranslate & enableDepthCheck, z: dimensions, w: imageSize
|
|
|
|
out vec4 v_pickColor;
|
|
out vec4 v_color;
|
|
flat out vec2 v_splitDirectionAndEllipsoidDepthEC; // x: splitDirection, y: ellipsoid depth in eye coordinates
|
|
#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)
|
|
{
|
|
// Note the halfSize cannot be computed in JavaScript because it is sent via
|
|
// compressed vertex attributes that coerce it to an integer.
|
|
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 VS_THREE_POINT_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; // not on the globe
|
|
}
|
|
|
|
vec4 eyeCoordinate = czm_windowToEyeCoordinates(posWC.xy, globeDepth);
|
|
return eyeCoordinate.z / eyeCoordinate.w;
|
|
}
|
|
#endif
|
|
void main()
|
|
{
|
|
// Modifying this shader may also require modifications to Billboard._computeScreenSpacePosition
|
|
|
|
// unpack attributes
|
|
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;
|
|
|
|
origin -= vec2(1.0);
|
|
|
|
float show = floor(compressed * SHIFT_RIGHT2);
|
|
compressed -= show * SHIFT_LEFT2;
|
|
|
|
vec2 textureCoordinatesBottomLeft = czm_decompressTextureCoordinates(compressedAttribute0.w);
|
|
vec2 textureCoordinatesRange = czm_decompressTextureCoordinates(eyeOffset.w);
|
|
vec2 textureCoordinates = textureCoordinatesBottomLeft + direction * textureCoordinatesRange;
|
|
|
|
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.x *= SHIFT_RIGHT2; // undo translateX scaling (helps preserve subpixel precision, see BillboardCollection.js attribute writer for more info)
|
|
|
|
translate.y += (temp - floor(temp)) * SHIFT_LEFT8;
|
|
translate.y -= UPPER_BOUND;
|
|
translate.y *= SHIFT_RIGHT2;
|
|
|
|
temp = compressedAttribute1.x * SHIFT_RIGHT8;
|
|
float temp2 = floor(compressedAttribute2.w * SHIFT_RIGHT2);
|
|
|
|
vec2 imageSize = vec2(floor(temp), temp2);
|
|
|
|
#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
|
|
|
|
#ifdef VS_THREE_POINT_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 color = czm_decodeRGB8(compressedAttribute2.x);
|
|
vec4 pickColor = czm_decodeRGB8(compressedAttribute2.y);
|
|
|
|
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.a /= 255.0;
|
|
|
|
color.a = floor(temp);
|
|
color.a /= 255.0;
|
|
|
|
///////////////////////////////////////////////////////////////////////////
|
|
|
|
vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);
|
|
vec4 positionEC = czm_modelViewRelativeToEye * p;
|
|
|
|
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)
|
|
{
|
|
// 2D camera distance is a special case
|
|
// treat all billboards as flattened to the z=0.0 plane
|
|
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;
|
|
// push vertex behind near plane for clipping
|
|
if (scale == 0.0)
|
|
{
|
|
positionEC.xyz = vec3(0.0);
|
|
}
|
|
#endif
|
|
|
|
float translucency = 1.0;
|
|
#ifdef EYE_DISTANCE_TRANSLUCENCY
|
|
translucency = czm_nearFarScalar(translucencyByDistance, lengthSq);
|
|
// push vertex behind near plane for clipping
|
|
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;
|
|
|
|
float enableDepthCheck = 1.0;
|
|
#ifdef DISABLE_DEPTH_DISTANCE
|
|
float disableDepthTestDistanceSq = compressedAttribute3.z;
|
|
if (disableDepthTestDistanceSq == 0.0 && czm_minimumDisableDepthTestDistance != 0.0)
|
|
{
|
|
disableDepthTestDistanceSq = czm_minimumDisableDepthTestDistance;
|
|
}
|
|
|
|
if (lengthSq < disableDepthTestDistanceSq || disableDepthTestDistanceSq < 0.0)
|
|
{
|
|
enableDepthCheck = 0.0;
|
|
}
|
|
#endif
|
|
|
|
v_splitDirectionAndEllipsoidDepthEC.y = czm_infinity;
|
|
vec3 ellipsoidCenter = czm_view[3].xyz;
|
|
vec3 rayDirection = normalize(positionEC.xyz);
|
|
czm_ray ray = czm_ray(vec3(0.0), rayDirection);
|
|
vec3 ellipsoid_inverseRadii = czm_ellipsoidInverseRadii;
|
|
czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoidCenter, ellipsoid_inverseRadii);
|
|
|
|
if (!czm_isEmpty(intersection))
|
|
{
|
|
v_splitDirectionAndEllipsoidDepthEC.y = intersection.start;
|
|
}
|
|
|
|
v_compressed.y = enableDepthCheck;
|
|
|
|
#ifdef VS_THREE_POINT_DEPTH_CHECK
|
|
if (lengthSq < (u_threePointDepthTestDistance * u_threePointDepthTestDistance) && (enableDepthCheck == 1.0)) {
|
|
float depthsilon = 10.0;
|
|
vec2 depthOrigin;
|
|
// Horizontal origin for labels comes from a special attribute. If that value is 0, this is a billboard - use the regular origin.
|
|
// Otherwise, transform the label origin to -1, 0, 1 (right, center, left).
|
|
depthOrigin.x = floor(compressedAttribute2.w - (temp2 * SHIFT_LEFT2));
|
|
depthOrigin.x = czm_branchFreeTernary(depthOrigin.x == 0.0, origin.x, depthOrigin.x - 2.0);
|
|
depthOrigin.y = origin.y;
|
|
|
|
vec4 pEC1 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(0.0), depthOrigin, vec2(0.0), 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), depthOrigin, vec2(0.0), 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), depthOrigin, vec2(0.0), pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);
|
|
float globeDepth3 = getGlobeDepth(pEC3);
|
|
if (globeDepth3 != 0.0 && pEC3.z + depthsilon < globeDepth3)
|
|
{
|
|
// "Discard" this vertex, as three key points fail depth test.
|
|
positionEC.xyz = vec3(0.0);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
#endif
|
|
// Write out the eyespace depth before applying the screen space offset, but after potentially "discarding" the vertex
|
|
// by setting its eyespace position to zero, via the three-point depth test above.
|
|
v_compressed.x = positionEC.z;
|
|
|
|
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 (disableDepthTestDistanceSq != 0.0)
|
|
{
|
|
// Don't try to "multiply both sides" by w. Greater/less-than comparisons won't work for negative values of w.
|
|
float zclip = gl_Position.z / gl_Position.w;
|
|
bool clipped = (zclip < -1.0 || zclip > 1.0);
|
|
// disableDepthTestDistanceSq can be less than zero if it's explicitly set to -1 in JS (as a sentinel value equivalent to infinity)
|
|
if (!clipped && (disableDepthTestDistanceSq < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistanceSq)))
|
|
{
|
|
// Position z on the near plane.
|
|
gl_Position.z = -gl_Position.w;
|
|
#ifdef LOG_DEPTH
|
|
v_depthFromNearPlusOne = 1.0;
|
|
#endif
|
|
}
|
|
}
|
|
#endif
|
|
|
|
#ifdef SDF
|
|
vec4 outlineColor = czm_decodeRGB8(sdf.x);
|
|
float outlineWidth;
|
|
|
|
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.a /= 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_splitDirectionAndEllipsoidDepthEC.x = splitDirection;
|
|
}
|
|
`;var aZe={FONT_SIZE:48,PADDING:10,RADIUS:8,CUTOFF:.25},Zs=Object.freeze(aZe);var sZe=Dr.SHOW_INDEX,YP=Dr.POSITION_INDEX,Dge=Dr.PIXEL_OFFSET_INDEX,Rge=Dr.EYE_OFFSET_INDEX,cZe=Dr.HORIZONTAL_ORIGIN_INDEX,lZe=Dr.VERTICAL_ORIGIN_INDEX,uZe=Dr.SCALE_INDEX,Ub=Dr.IMAGE_INDEX_INDEX,Oge=Dr.COLOR_INDEX,fZe=Dr.ROTATION_INDEX,dZe=Dr.ALIGNED_AXIS_INDEX,Mge=Dr.SCALE_BY_DISTANCE_INDEX,Lge=Dr.TRANSLUCENCY_BY_DISTANCE_INDEX,Nge=Dr.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,Fge=Dr.DISTANCE_DISPLAY_CONDITION,hZe=Dr.DISABLE_DEPTH_DISTANCE,mZe=Dr.TEXTURE_COORDINATE_BOUNDS,Bge=Dr.SDF_INDEX,kge=Dr.SPLIT_DIRECTION_INDEX,z$=Dr.NUMBER_OF_PROPERTIES,Rr={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 hd(e){e=e??H.EMPTY_OBJECT,this._scene=e.scene,this._batchTable=e.batchTable;let t=e.textureAtlas;l(t)||(t=new vv),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(z$),this._maxSize=0,this._maxEyeOffset=0,this._maxScale=1,this._maxPixelOffset=0,this._allHorizontalCenter=!0,this._allVerticalCenter=!0,this._allSizedInMeters=!0,this._baseVolume=new se,this._baseVolumeWC=new se,this._baseVolume2D=new se,this._boundingVolume=new se,this._boundingVolumeDirty=!1,this._colorCommands=[],this._allBillboardsReady=!1,this.show=e.show??!0,this.modelMatrix=O.clone(e.modelMatrix??O.IDENTITY),this._modelMatrix=O.clone(O.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowTextureAtlas=e.debugShowTextureAtlas??!1,this.blendOption=e.blendOption??Fi.OPAQUE_AND_TRANSLUCENT,this._blendOption=void 0,this._mode=re.SCENE3D,this._buffersUsage=[Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW],this._highlightColor=U.clone(U.WHITE),this._coarseDepthTestDistance=e.coarseDepthTestDistance??te.default.minimumRadius/10,this._threePointDepthTestDistance=e.threePointDepthTestDistance??te.default.minimumRadius/1e3,this._uniforms={u_atlas:()=>this.textureAtlas.texture,u_highlightColor:()=>this._highlightColor,u_coarseDepthTestDistance:()=>this._coarseDepthTestDistance,u_threePointDepthTestDistance:()=>this._threePointDepthTestDistance};let n=this._scene;l(n)&&l(n.terrainProviderChanged)&&(this._removeCallbackFunc=n.terrainProviderChanged.addEventListener(function(){let i=this._billboards,r=i.length;for(let o=0;o<r;++o)l(i[o])&&i[o]._updateClamping()},this))}Object.defineProperties(hd.prototype,{length:{get:function(){return U$(this),this._billboards.length}},textureAtlas:{get:function(){return this._textureAtlas},set:function(e){this._textureAtlas!==e&&(this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._textureAtlas=e)}},destroyTextureAtlas:{get:function(){return this._destroyTextureAtlas},set:function(e){this._destroyTextureAtlas=e}},sizeInBytes:{get:function(){return this._textureAtlas.sizeInBytes}},ready:{get:function(){return this._allBillboardsReady}},billboardTextureCache:{get:function(){return this._billboardTextureCache}},coarseDepthTestDistance:{get:function(){return this._coarseDepthTestDistance},set:function(e){this._coarseDepthTestDistance=e}},threePointDepthTestDistance:{get:function(){return this._threePointDepthTestDistance},set:function(e){this._threePointDepthTestDistance=e}}});function zge(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}hd.prototype.add=function(e){let t=new Dr(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,t};hd.prototype.remove=function(e){return this.contains(e)?(this._billboards[e._index]=void 0,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};hd.prototype.removeAll=function(){zge(this._billboards),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0};function U$(e){if(e._billboardsRemoved){e._billboardsRemoved=!1;let t=[],n=e._billboards,i=n.length;for(let r=0,o=0;r<i;++r){let a=n[r];l(a)&&(a._index=o++,t.push(a))}e._billboards=t}}hd.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]};hd.prototype.contains=function(e){return l(e)&&e._billboardCollection===this};hd.prototype.get=function(e){return U$(this),this._billboards[e]};function Pge(e){let t=e.cache.billboardCollection_indexBufferInstanced;return l(t)||(t=Ze.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Oe.STATIC_DRAW,indexDatatype:Ve.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferInstanced=t),t}function pZe(e){let t=e.cache.billboardCollection_vertexBufferInstanced;return l(t)||(t=Ze.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Oe.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_vertexBufferInstanced=t),t}hd.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<z$;++i){let r=n[i]===0?Oe.STATIC_DRAW:Oe.STREAM_DRAW;t=t||e[i]!==r,e[i]=r}return t};function gZe(e,t,n,i,r){let o=[{index:Rr.positionHighAndScale,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[YP]},{index:Rr.positionLowAndRotation,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[YP]},{index:Rr.compressedAttribute0,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[Dge]},{index:Rr.compressedAttribute1,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[Lge]},{index:Rr.compressedAttribute2,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[Oge]},{index:Rr.eyeOffset,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[Rge]},{index:Rr.scaleByDistance,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[Mge]},{index:Rr.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[Nge]},{index:Rr.compressedAttribute3,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[Fge]},{index:Rr.textureCoordinateBoundsOrLabelTranslate,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[mZe]},{index:Rr.splitDirection,componentsPerAttribute:1,componentDatatype:Y.FLOAT,usage:n[kge]},{index:Rr.direction,componentsPerAttribute:2,componentDatatype:Y.FLOAT,vertexBuffer:pZe(e)}];return l(i)&&o.push({index:Rr.a_batchId,componentsPerAttribute:1,componentDatatype:Y.FLOAT,bufferUsage:Oe.STATIC_DRAW}),r&&o.push({index:Rr.sdf,componentsPerAttribute:2,componentDatatype:Y.FLOAT,usage:n[Bge]}),new ay(e,o,t,!0)}var L$=new Sn;function Uge(e,t,n,i){let r=n[Rr.positionHighAndScale],o=n[Rr.positionLowAndRotation],a=i._getActualPosition();e._mode===re.SCENE3D&&(se.expand(e._baseVolume,a,e._baseVolume),e._boundingVolumeDirty=!0),Sn.fromCartesian(a,L$);let s=i.scale,c=i.rotation;c!==0&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,s);let u=L$.high,f=L$.low;r(i._index,u.x,u.y,u.z,s),o(i._index,f.x,f.y,f.z,c)}var uy=new k,dd=32768,V$=65536,N$=4096,Vb=256,_Ze=128,yZe=32,AZe=8,B3=4,bZe=1/256,Vge=new Je;function jge(e,t,n,i){let r=n[Rr.compressedAttribute0],o=i.pixelOffset,a=o.x,s=o.y,c=i._translate,u=c.x,f=c.y;e._maxPixelOffset=Math.max(e._maxPixelOffset,Math.abs(a+u),Math.abs(-s+f));let d=i.horizontalOrigin,p=i._verticalOrigin,g=i.show&&i.clusterShow;i.color.alpha===0&&(g=!1),p===Wn.BASELINE&&(p=Wn.BOTTOM),e._allHorizontalCenter=e._allHorizontalCenter&&d===ji.CENTER,e._allVerticalCenter=e._allVerticalCenter&&p===Wn.CENTER;let m=0,y=0;if(i.ready){let D=i.computeTextureCoordinates(Vge);m=D.x,y=D.y}let A=Math.floor(I.clamp(a,-dd,dd)+dd)*_Ze;A+=(d+1)*yZe,A+=(p+1)*AZe,A+=(g?1:0)*B3;let b=Math.floor(I.clamp(s,-dd,dd)+dd)*Vb,x=Math.floor(I.clamp(u*B3,-dd,dd)+dd)*Vb,T=(I.clamp(f*B3,-dd,dd)+dd)*bZe,C=Math.floor(T),E=Math.floor((T-C)*Vb);b+=C,x+=E,uy.x=m,uy.y=y;let w=an.compressTextureCoordinates(uy);r(i._index,A,b,x,w)}function Hge(e,t,n,i){let r=n[Rr.compressedAttribute1],o=i.alignedAxis;h.equals(o,h.ZERO)||(o=h.normalize(o,new h),e._shaderAlignedAxis=!0);let a=0,s=1,c=1,u=1,f=i.translucencyByDistance;l(f)&&(a=f.near,s=f.nearValue,c=f.far,u=f.farValue,(s!==1||u!==1)&&(e._shaderTranslucencyByDistance=!0));let d=Math.round(i.width??0);e._maxSize=Math.max(e._maxSize,d);let p=I.clamp(d,0,V$),g=0;Math.abs(h.magnitudeSquared(o)-1)<I.EPSILON6&&(g=an.octEncodeFloat(o)),s=I.clamp(s,0,1),s=s===1?255:s*255|0,p=p*Vb+s,u=I.clamp(u,0,1),u=u===1?255:u*255|0,g=g*Vb+u,r(i._index,p,g,a,c)}function B$(e,t,n,i){let r=n[Rr.compressedAttribute2],o=i.color,a=l(e._batchTable)?U.WHITE:i.getPickId(t.context).color,s=i.sizeInMeters?1:0,c=i.alignedAxis,u=h.equals(c,h.ZERO)?c:h.normalize(c,new h),f=Math.abs(h.magnitudeSquared(u)-1)<I.EPSILON6?1:0;e._allSizedInMeters=e._allSizedInMeters&&s===1;let d=i.height??0;e._maxSize=Math.max(e._maxSize,d);let p=i._labelHorizontalOrigin??-2;p+=2;let g=an.encodeRGB8(o),m=an.encodeRGB8(a),y=U.floatToByte(o.alpha)*V$+U.floatToByte(a.alpha)*Vb+(s*2+f),A=d*B3+p;r(i._index,g,m,y,A)}function k$(e,t,n,i){let r=n[Rr.eyeOffset],o=i.eyeOffset,a=o.z;if(i._heightReference!==it.NONE&&(a*=1.005),e._maxEyeOffset=Math.max(e._maxEyeOffset,Math.abs(o.x),Math.abs(o.y),Math.abs(a)),uy.x=0,uy.y=0,i.ready){let c=i.computeTextureCoordinates(Vge);uy.x=c.width,uy.y=c.height}let s=an.compressTextureCoordinates(uy);r(i._index,o.x,o.y,a,s)}function Gge(e,t,n,i){let r=n[Rr.scaleByDistance],o=0,a=1,s=1,c=1,u=i.scaleByDistance;l(u)&&(o=u.near,a=u.nearValue,s=u.far,c=u.farValue,(a!==1||c!==1)&&(e._shaderScaleByDistance=!0)),r(i._index,o,a,s,c)}function Wge(e,t,n,i){let r=n[Rr.pixelOffsetScaleByDistance],o=0,a=1,s=1,c=1,u=i.pixelOffsetScaleByDistance;l(u)&&(o=u.near,a=u.nearValue,s=u.far,c=u.farValue,(a!==1||c!==1)&&(e._shaderPixelOffsetScaleByDistance=!0)),r(i._index,o,a,s,c)}function qge(e,t,n,i){let r=n[Rr.compressedAttribute3],o=0,a=Number.MAX_VALUE,s=i.distanceDisplayCondition;l(s)&&(o=s.near,a=s.far,o*=o,a*=a,e._shaderDistanceDisplayCondition=!0);let c=i.disableDepthTestDistance,u=gu(i.heightReference)&&t.context.depthTexture;c*=c,(u||c>0)&&(e._shaderDisableDepthDistance=!0,c===Number.POSITIVE_INFINITY&&(c=-1));let f,d;l(i._labelDimensions)?(d=i._labelDimensions.x,f=i._labelDimensions.y):(d=i.width??0,f=i.height??0);let p=Math.floor(I.clamp(d,0,N$)),g=Math.floor(I.clamp(f,0,N$)),m=p*N$+g;r(i._index,o,a,c,m)}function Yge(e,t,n,i){if(gu(i.heightReference)){let s=e._scene,c=t.context,u=t.globeTranslucencyState.translucent,f=l(s.globe)&&s.globe.depthTestAgainstTerrain;e._shaderClampToGround=c.depthTexture&&!u&&f}let r=n[Rr.textureCoordinateBoundsOrLabelTranslate],o=0,a=0;l(i._labelTranslate)&&(o=i._labelTranslate.x,a=i._labelTranslate.y),r(i._index,o,a,0,0)}function xZe(e,t,n,i){if(!l(e._batchTable))return;let r=n[Rr.a_batchId],o=i._batchIndex;r(i._index,o)}function Xge(e,t,n,i){if(!e._sdf)return;let r=n[Rr.sdf],o=i.outlineColor,a=i.outlineWidth,s=an.encodeRGB8(o),c=a/Zs.RADIUS,u=U.floatToByte(o.alpha)*V$+U.floatToByte(c)*Vb;r(i._index,s,u)}function Kge(e,t,n,i){let r=n[Rr.splitDirection],o=0,a=i.splitDirection;l(a)&&(o=a),r(i._index,o)}function TZe(e,t,n,i){Uge(e,t,n,i),jge(e,t,n,i),Hge(e,t,n,i),B$(e,t,n,i),k$(e,t,n,i),Gge(e,t,n,i),Wge(e,t,n,i),qge(e,t,n,i),Yge(e,t,n,i),xZe(e,t,n,i),Xge(e,t,n,i),Kge(e,t,n,i)}function F$(e,t,n,i,r,o){let a;i.mode===re.SCENE3D?(a=e._baseVolume,e._boundingVolumeDirty=!0):a=e._baseVolume2D;let s=[];for(let c=0;c<n;++c){let u=t[c],f=u.position,d=Dr._computeActualPosition(u,f,i,r);l(d)&&(u._setActualPosition(d),o?s.push(d):se.expand(a,d,a))}o&&se.fromPoints(s,a)}function CZe(e,t){let n=t.mode,i=e._billboards,r=e._billboardsToUpdate,o=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==re.SCENE3D&&!O.equals(o,e.modelMatrix)?(e._mode=n,O.clone(e.modelMatrix,o),e._createVertexArray=!0,(n===re.SCENE3D||n===re.SCENE2D||n===re.COLUMBUS_VIEW)&&F$(e,i,i.length,t,o,!0)):n===re.MORPHING?F$(e,i,i.length,t,o,!0):(n===re.SCENE2D||n===re.COLUMBUS_VIEW)&&F$(e,r,e._billboardsToUpdateIndex,t,o,!1)}function vZe(e,t,n){let i=1;(!e._allSizedInMeters||e._maxPixelOffset!==0)&&(i=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight));let r=i*e._maxScale*e._maxSize*2;e._allHorizontalCenter&&e._allVerticalCenter&&(r*=.5);let o=i*e._maxPixelOffset+e._maxEyeOffset;n.radius+=r+o}function EZe(e,t){let i=t.createViewportQuadCommand(`uniform sampler2D billboard_texture;
|
|
in vec2 v_textureCoordinates;
|
|
void main()
|
|
{
|
|
out_FragColor = texture(billboard_texture, v_textureCoordinates);
|
|
}
|
|
`,{uniformMap:{billboard_texture:function(){return e.textureAtlas.texture}}});return i.pass=Pe.OVERLAY,i}var SZe=[];hd.prototype.update=function(e){if(U$(this),!this.show)return;let t=e.context;if(!t.instancedArrays||!(Ft.maximumVertexTextureImageUnits>0))throw new pe("Beginning in CesiumJS 1.140, billboards and labels require device support for WebGL 2, or WebGL 1 with ANGLE_instanced_arrays and MAX_VERTEX_TEXTURE_IMAGE_UNITS > 0. For more information or to share feedback, see: https://github.com/CesiumGS/cesium/issues/13053");let n=this._billboards,i=n.length,r=!0;for(let D=0;D<i;++D){let R=n[D];l(R.loadError)&&(console.error(`Error loading image for billboard: ${R.loadError}`),R.image=void 0),R.textureDirty&&this._updateBillboard(R,Ub),R.show&&(r=r&&R.ready)}let o=this._textureAtlas;if(e.afterRender.push(()=>{if(!this.isDestroyed())return o.update(e.context)}),!l(o.texture))return;CZe(this,e),n=this._billboards,i=n.length;let a=this._billboardsToUpdate,s=this._billboardsToUpdateIndex,c=this._propertiesChanged,u=o.guid,f=this._createVertexArray||this._textureAtlasGUID!==u;this._textureAtlasGUID=u;let d,p=e.passes,g=p.pick;if(f||!g&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let D=0;D<z$;++D)c[D]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),i>0){this._vaf=gZe(t,i,this._buffersUsage,this._batchTable,this._sdf),d=this._vaf.writers;for(let D=0;D<i;++D){let R=this._billboards[D];R._dirty=!1,R.textureDirty=!1,TZe(this,e,d,R)}this._vaf.commit(Pge(t))}this._billboardsToUpdateIndex=0}else if(s>0){let D=SZe;D.length=0,(c[YP]||c[fZe]||c[uZe])&&D.push(Uge),(c[Ub]||c[Dge]||c[cZe]||c[lZe]||c[sZe])&&(D.push(jge),D.push(k$)),(c[Ub]||c[dZe]||c[Lge])&&(D.push(Hge),D.push(B$)),(c[Ub]||c[Oge])&&D.push(B$),(c[Ub]||c[Rge])&&D.push(k$),c[Mge]&&D.push(Gge),c[Nge]&&D.push(Wge),(c[Fge]||c[hZe]||c[Ub]||c[YP])&&D.push(qge),(c[Ub]||c[YP])&&D.push(Yge),c[Bge]&&D.push(Xge),c[kge]&&D.push(Kge);let R=D.length;if(d=this._vaf.writers,s/i>.1){for(let M=0;M<s;++M){let N=a[M];N._dirty=!1,N.textureDirty=!1;for(let _=0;_<R;++_)D[_](this,e,d,N)}this._vaf.commit(Pge(t))}else{for(let M=0;M<s;++M){let N=a[M];N._dirty=!1,N.textureDirty=!1;for(let _=0;_<R;++_)D[_](this,e,d,N);this._vaf.subCommit(N._index,1)}this._vaf.endSubCommits()}this._billboardsToUpdateIndex=0}if(s>i*1.5&&(a.length=i),!l(this._vaf)||!l(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,se.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let m,y=O.IDENTITY;e.mode===re.SCENE3D?(y=this.modelMatrix,m=se.clone(this._baseVolumeWC,this._boundingVolume)):m=se.clone(this._baseVolume2D,this._boundingVolume),vZe(this,e,m);let A=this._blendOption!==this.blendOption;if(this._blendOption=this.blendOption,A){this._blendOption===Fi.OPAQUE||this._blendOption===Fi.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=je.fromCache({depthTest:{enabled:!0,func:ee.LESS},depthMask:!0}):this._rsOpaque=void 0;let D=this._blendOption===Fi.TRANSLUCENT;this._blendOption===Fi.TRANSLUCENT||this._blendOption===Fi.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=je.fromCache({depthTest:{enabled:!0,func:D?ee.LEQUAL:ee.LESS},depthMask:D,blending:en.ALPHA_BLEND}):this._rsTranslucent=void 0}this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let b,x,T,C,E;if(A||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){b=F3,x=N3,E=["INSTANCED"],l(this._batchTable)&&(E.push("VECTOR_TILE"),b=this._batchTable.getVertexShaderCallback(!1,"a_batchId",void 0)(b),x=this._batchTable.getFragmentShaderCallback(!1,void 0)(x)),T=new Ge({defines:E,sources:[b]}),this._shaderRotation&&T.defines.push("ROTATION"),this._shaderAlignedAxis&&T.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&T.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&T.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&T.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&T.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&T.defines.push("DISABLE_DEPTH_DISTANCE"),this._shaderClampToGround&&T.defines.push("VS_THREE_POINT_DEPTH_CHECK");let D=1-Zs.CUTOFF;this._sdf&&T.defines.push("SDF");let R=l(this._batchTable)?"VECTOR_TILE":"";this._blendOption===Fi.OPAQUE_AND_TRANSLUCENT&&(C=new Ge({defines:["OPAQUE",R],sources:[x]}),this._shaderClampToGround&&C.defines.push("VS_THREE_POINT_DEPTH_CHECK"),this._sdf&&(C.defines.push("SDF"),C.defines.push(`SDF_EDGE ${D}`)),this._sp=Zt.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:T,fragmentShaderSource:C,attributeLocations:Rr}),C=new Ge({defines:["TRANSLUCENT",R],sources:[x]}),this._shaderClampToGround&&C.defines.push("VS_THREE_POINT_DEPTH_CHECK"),this._sdf&&(C.defines.push("SDF"),C.defines.push(`SDF_EDGE ${D}`)),this._spTranslucent=Zt.replaceCache({context:t,shaderProgram:this._spTranslucent,vertexShaderSource:T,fragmentShaderSource:C,attributeLocations:Rr})),this._blendOption===Fi.OPAQUE&&(C=new Ge({defines:[R],sources:[x]}),this._shaderClampToGround&&C.defines.push("VS_THREE_POINT_DEPTH_CHECK"),this._sdf&&(C.defines.push("SDF"),C.defines.push(`SDF_EDGE ${D}`)),this._sp=Zt.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:T,fragmentShaderSource:C,attributeLocations:Rr})),this._blendOption===Fi.TRANSLUCENT&&(C=new Ge({defines:[R],sources:[x]}),this._shaderClampToGround&&C.defines.push("VS_THREE_POINT_DEPTH_CHECK"),this._sdf&&(C.defines.push("SDF"),C.defines.push(`SDF_EDGE ${D}`)),this._spTranslucent=Zt.replaceCache({context:t,shaderProgram:this._spTranslucent,vertexShaderSource:T,fragmentShaderSource:C,attributeLocations:Rr})),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 w=e.commandList;if(p.render||p.pick){let D=this._colorCommands,R=this._blendOption===Fi.OPAQUE,M=this._blendOption===Fi.OPAQUE_AND_TRANSLUCENT,N=this._vaf.va,_=N.length,v=this._uniforms,S;l(this._batchTable)?(v=this._batchTable.getUniformMapCallback()(v),S=this._batchTable.getPickId()):S="v_pickColor",D.length=_;let P=M?_*2:_;for(let L=0;L<P;++L){let F=D[L];l(F)||(F=D[L]=new nt);let V=R||M&&L%2===0;F.pass=V||!M?Pe.OPAQUE:Pe.TRANSLUCENT,F.owner=this;let z=M?Math.floor(L/2):L;F.boundingVolume=m,F.modelMatrix=y,F.count=N[z].indicesCount,F.shaderProgram=V?this._sp:this._spTranslucent,F.uniformMap=v,F.vertexArray=N[z].va,F.renderState=V?this._rsOpaque:this._rsTranslucent,F.debugShowBoundingVolume=this.debugShowBoundingVolume,F.pickId=S,F.count=6,F.instanceCount=i,w.push(F)}this.debugShowTextureAtlas&&(l(this.debugCommand)||(this.debugCommand=EZe(this,e.context)),w.push(this.debugCommand))}this._allBillboardsReady=r};hd.prototype.isDestroyed=function(){return!1};hd.prototype.destroy=function(){return l(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spTranslucent=this._spTranslucent&&this._spTranslucent.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),zge(this._billboards),ue(this)};var md=hd;var $ge={FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2};Object.freeze($ge);var bo=$ge;var Jge={},Zge=0,wZe=256,IZe=new U(.165,.165,.165,.8),PZe=new k(7,5),ja=Object.freeze({LTR:0,RTL:1,WEAK:2,BRACKETS:3});function jb(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function XP(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}function KP(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)}function e_e(e){let t=Jge[e._font];if(!l(t)){let n=document.createElement("div");n.style.position="absolute",n.style.opacity=0,n.style.font=e._font,document.body.appendChild(n);let i=parseFloat(KP(n,"line-height"));isNaN(i)&&(i=void 0),t={family:KP(n,"font-family"),size:KP(n,"font-size").replace("px",""),style:KP(n,"font-style"),weight:KP(n,"font-weight"),lineHeight:i},document.body.removeChild(n),Zge<wZe&&(Jge[e._font]=t,Zge++)}e._fontFamily=t.family,e._fontSize=t.size,e._fontStyle=t.style,e._fontWeight=t.weight,e._lineHeight=t.lineHeight}function Ch(e,t){e=e??H.EMPTY_OBJECT;let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,r=e.scaleByDistance,o=e.distanceDisplayCondition;l(n)&&(n=Wt.clone(n)),l(i)&&(i=Wt.clone(i)),l(r)&&(r=Wt.clone(r)),l(o)&&(o=jt.clone(o)),this._renderedText=void 0,this._text=void 0,this._show=e.show??!0,this._font=e.font??"30px sans-serif",this._fillColor=U.clone(e.fillColor??U.WHITE),this._outlineColor=U.clone(e.outlineColor??U.BLACK),this._outlineWidth=e.outlineWidth??1,this._showBackground=e.showBackground??!1,this._backgroundColor=U.clone(e.backgroundColor??IZe),this._backgroundPadding=k.clone(e.backgroundPadding??PZe),this._style=e.style??bo.FILL,this._verticalOrigin=e.verticalOrigin??Wn.BASELINE,this._horizontalOrigin=e.horizontalOrigin??ji.LEFT,this._pixelOffset=k.clone(e.pixelOffset??k.ZERO),this._eyeOffset=h.clone(e.eyeOffset??h.ZERO),this._position=h.clone(e.position??h.ZERO),this._scale=e.scale??1,this._id=e.id,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._scaleByDistance=r,this._heightReference=e.heightReference??it.NONE,this._distanceDisplayCondition=o,this._disableDepthTestDistance=e.disableDepthTestDistance,this._labelCollection=t,this._glyphs=[],this._backgroundBillboard=void 0,this._batchIndex=void 0,this._rebindAllGlyphs=!0,this._repositionAllGlyphs=!0,this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=void 0,this._clusterShow=!0,this.text=e.text??"",this._relativeSize=1,e_e(this),this._updateClamping()}Object.defineProperties(Ch.prototype,{show:{get:function(){return this._show},set:function(e){if(this._show!==e){this._show=e;let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i].billboard;l(o)&&(o.show=e)}let n=this._backgroundBillboard;l(n)&&(n.show=e)}}},position:{get:function(){return this._position},set:function(e){let t=this._position;if(!h.equals(t,e)){h.clone(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let a=n[r].billboard;l(a)&&(a.position=e)}let i=this._backgroundBillboard;l(i)&&(i.position=e),this._updateClamping()}}},heightReference:{get:function(){return this._heightReference},set:function(e){if(e!==this._heightReference){this._heightReference=e;let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i].billboard;l(o)&&(o.heightReference=e)}let n=this._backgroundBillboard;l(n)&&(n.heightReference=e),XP(this),this._updateClamping()}}},text:{get:function(){return this._text},set:function(e){if(this._text!==e){this._text=e;let t=Ch.filterUnsupportedCharacters(e);this._renderedText=Ch.enableRightToLeftDetection?NZe(t):t,jb(this)}}},font:{get:function(){return this._font},set:function(e){this._font!==e&&(this._font=e,jb(this),e_e(this))}},fillColor:{get:function(){return this._fillColor},set:function(e){let t=this._fillColor;U.equals(t,e)||(U.clone(e,t),jb(this))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;U.equals(t,e)||(U.clone(e,t),jb(this))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,jb(this))}},showBackground:{get:function(){return this._showBackground},set:function(e){this._showBackground!==e&&(this._showBackground=e,jb(this))}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){let t=this._backgroundColor;if(!U.equals(t,e)){U.clone(e,t);let n=this._backgroundBillboard;l(n)&&(n.color=t)}}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){let t=this._backgroundPadding;k.equals(t,e)||(k.clone(e,t),XP(this))}},style:{get:function(){return this._style},set:function(e){this._style!==e&&(this._style=e,jb(this))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;if(!k.equals(t,e)){k.clone(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let a=n[r];l(a.billboard)&&(a.billboard.pixelOffset=e)}let i=this._backgroundBillboard;l(i)&&(i.pixelOffset=e)}}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;if(!Wt.equals(t,e)){this._translucencyByDistance=Wt.clone(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let a=n[r];l(a.billboard)&&(a.billboard.translucencyByDistance=e)}let i=this._backgroundBillboard;l(i)&&(i.translucencyByDistance=e)}}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){let t=this._pixelOffsetScaleByDistance;if(!Wt.equals(t,e)){this._pixelOffsetScaleByDistance=Wt.clone(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let a=n[r];l(a.billboard)&&(a.billboard.pixelOffsetScaleByDistance=e)}let i=this._backgroundBillboard;l(i)&&(i.pixelOffsetScaleByDistance=e)}}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;if(!Wt.equals(t,e)){this._scaleByDistance=Wt.clone(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let a=n[r];l(a.billboard)&&(a.billboard.scaleByDistance=e)}let i=this._backgroundBillboard;l(i)&&(i.scaleByDistance=e)}}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;if(!h.equals(t,e)){h.clone(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let a=n[r];l(a.billboard)&&(a.billboard.eyeOffset=e)}let i=this._backgroundBillboard;l(i)&&(i.eyeOffset=e)}}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,XP(this))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){if(this._verticalOrigin!==e){this._verticalOrigin=e;let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.billboard.verticalOrigin=e)}let n=this._backgroundBillboard;l(n)&&(n.verticalOrigin=e),XP(this)}}},scale:{get:function(){return this._scale},set:function(e){if(this._scale!==e){this._scale=e;let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.billboard.scale=e*this._relativeSize)}let n=this._backgroundBillboard;l(n)&&(n.scale=e*this._relativeSize),XP(this)}}},totalScale:{get:function(){return this._scale*this._relativeSize}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(!jt.equals(e,this._distanceDisplayCondition)){this._distanceDisplayCondition=jt.clone(e,this._distanceDisplayCondition);let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.billboard.distanceDisplayCondition=e)}let n=this._backgroundBillboard;l(n)&&(n.distanceDisplayCondition=e)}}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if(this._disableDepthTestDistance!==e){this._disableDepthTestDistance=e;let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.billboard.disableDepthTestDistance=e)}let n=this._backgroundBillboard;l(n)&&(n.disableDepthTestDistance=e)}}},id:{get:function(){return this._id},set:function(e){if(this._id!==e){this._id=e;let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.billboard.id=e)}let n=this._backgroundBillboard;l(n)&&(n.id=e)}}},pickId:{get:function(){if(!(this._glyphs.length===0||!l(this._glyphs[0].billboard)))return this._glyphs[0].billboard.pickId}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=h.clone(e,this._actualClampedPosition);let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.billboard._clampedPosition=e)}let n=this._backgroundBillboard;l(n)&&(n._clampedPosition=e)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){if(this._clusterShow!==e){this._clusterShow=e;let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.billboard.clusterShow=e)}let n=this._backgroundBillboard;l(n)&&(n.clusterShow=e)}}},ready:{get:function(){if(this._rebindAllGlyphs||this._repositionAllGlyphs||l(this._backgroundBillboard)&&!this._backgroundBillboard.ready)return!1;let e=this._glyphs;for(let t=0,n=e.length;t<n;t++){let i=e[t];if(l(i.billboard)&&!i.billboard.ready)return!1}return!0}}});Ch.prototype._updateClamping=function(){Dr._updateClamping(this._labelCollection,this)};Ch.prototype.computeScreenSpacePosition=function(e,t){l(t)||(t=new k);let i=this._labelCollection.modelMatrix,r=l(this._actualClampedPosition)?this._actualClampedPosition:this._position;return Dr._computeScreenSpacePosition(i,r,this._eyeOffset,this._pixelOffset,e,t)};Ch.getScreenSpaceBoundingBox=function(e,t,n){let i,r,o,a,s=e.totalScale,c=e._backgroundBillboard;if(l(c))i=t.x+c._translate.x,r=t.y-c._translate.y,o=c.width*s,a=c.height*s,e.verticalOrigin===Wn.BOTTOM||e.verticalOrigin===Wn.BASELINE?r-=a:e.verticalOrigin===Wn.CENTER&&(r-=a*.5);else{i=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY;let u=0,f=0,d=e._glyphs,p=d.length;for(let g=0;g<p;++g){let m=d[g],y=m.billboard;if(!l(y))continue;let A=t.x+y._translate.x,b=t.y-y._translate.y,x=m.dimensions.width*s,T=m.dimensions.height*s;e.verticalOrigin===Wn.BOTTOM||e.verticalOrigin===Wn.BASELINE?b-=T:e.verticalOrigin===Wn.CENTER&&(b-=T*.5),e._verticalOrigin===Wn.TOP?b+=Zs.PADDING*s:(e._verticalOrigin===Wn.BOTTOM||e._verticalOrigin===Wn.BASELINE)&&(b-=Zs.PADDING*s),i=Math.min(i,A),r=Math.min(r,b),u=Math.max(u,A+x),f=Math.max(f,b+T)}o=u-i,a=f-r}return l(n)||(n=new Je),n.x=i,n.y=r,n.width=o,n.height=a,n};Ch.filterUnsupportedCharacters=function(e){let t=new RegExp(/[\u0000-\u0008\u000E-\u001F\u00ad\u202a-\u206f\u200b-\u200f]/,"g");return e.replace(t,"")};Ch.prototype.equals=function(e){return this===e||l(e)&&this._show===e._show&&this._scale===e._scale&&this._outlineWidth===e._outlineWidth&&this._showBackground===e._showBackground&&this._style===e._style&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&this._renderedText===e._renderedText&&this._font===e._font&&h.equals(this._position,e._position)&&U.equals(this._fillColor,e._fillColor)&&U.equals(this._outlineColor,e._outlineColor)&&U.equals(this._backgroundColor,e._backgroundColor)&&k.equals(this._backgroundPadding,e._backgroundPadding)&&k.equals(this._pixelOffset,e._pixelOffset)&&h.equals(this._eyeOffset,e._eyeOffset)&&Wt.equals(this._translucencyByDistance,e._translucencyByDistance)&&Wt.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&Wt.equals(this._scaleByDistance,e._scaleByDistance)&&jt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._id===e._id};Ch.prototype.isDestroyed=function(){return!1};Ch.enableRightToLeftDetection=!1;function DZe(e,t){let n=/[a-zA-Z0-9]/,i=/[()[\]{}<>]/,r=[],o="",a=ja.LTR,s="",c=e.length;for(let u=0;u<c;++u){let f=e.charAt(u);t.test(f)?s=ja.RTL:n.test(f)?s=ja.LTR:i.test(f)?s=ja.BRACKETS:s=ja.WEAK,u===0&&(a=s),a===s&&s!==ja.BRACKETS?o+=f:(o!==""&&r.push({Type:a,Word:o}),a=s,o=f)}return r.push({Type:s,Word:o}),r}function RZe(e){return e.split("").reverse().join("")}function $P(e,t,n){return e.slice(0,t)+n+e.slice(t)}function OZe(e){switch(e){case"(":return")";case")":return"(";case"[":return"]";case"]":return"[";case"{":return"}";case"}":return"{";case"<":return">";case">":return"<"}}var MZe="\u05D0-\u05EA",LZe="\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF",Qge=new RegExp(`[${MZe}${LZe}]`);function NZe(e){let t=e.split(`
|
|
`),n="";for(let i=0;i<t.length;i++){let r=t[i],o=Qge.test(r.charAt(0)),a=DZe(r,Qge),s=0,c="";for(let u=0;u<a.length;++u){let f=a[u],d=f.Type===ja.BRACKETS?OZe(f.Word):RZe(f.Word);o?f.Type===ja.RTL?(c=d+c,s=0):f.Type===ja.LTR?(c=$P(c,s,f.Word),s+=f.Word.length):(f.Type===ja.WEAK||f.Type===ja.BRACKETS)&&(f.Type===ja.WEAK&&a[u-1].Type===ja.BRACKETS?c=d+c:a[u-1].Type===ja.RTL?(c=d+c,s=0):a.length>u+1?a[u+1].Type===ja.RTL?(c=d+c,s=0):(c=$P(c,s,f.Word),s+=f.Word.length):c=$P(c,0,d)):f.Type===ja.RTL?c=$P(c,s,d):f.Type===ja.LTR?(c+=f.Word,s=c.length):(f.Type===ja.WEAK||f.Type===ja.BRACKETS)&&(u>0&&a[u-1].Type===ja.RTL?a.length>u+1?a[u+1].Type===ja.RTL?c=$P(c,s,d):(c+=f.Word,s=c.length):c+=f.Word:(c+=f.Word,s=c.length))}n+=c,i<t.length-1&&(n+=`
|
|
`)}return n}var Hb=Ch;var c_e=La(r_e(),1);var l_e=La(o_e(),1);function kZe(){this.dimensions=void 0,this.billboardTexture=void 0,this.billboard=void 0}var zZe=1.2,a_e="ID_WHITE_PIXEL",j$=new k(4,4),UZe=new Je(1,1,1,1);function VZe(e,t){let n=t._backgroundBillboardTexture;if(!n.hasImage){let r=document.createElement("canvas");r.width=j$.x,r.height=j$.y;let o=r.getContext("2d");o.fillStyle="#fff",o.fillRect(0,0,r.width,r.height),n.loadImage(a_e,r),n.addImageSubRegion(a_e,UZe)}let i=e.add({collection:t});return i.setImageTexture(n),i._positionFromParent=!0,i._labelTranslate=new k,i}var q0={};function jZe(e,t,n,i,r,o){return q0.font=t,q0.fillColor=n,q0.strokeColor=i,q0.strokeWidth=r,q0.padding=Zs.PADDING,q0.fill=o===bo.FILL||o===bo.FILL_AND_OUTLINE,q0.stroke=o===bo.OUTLINE||o===bo.FILL_AND_OUTLINE,q0.backgroundColor=U.BLACK,XC(e,q0)}function H$(e,t){let n=t.billboard;l(n)&&(n.show=!1,n._clampedPosition=void 0,l(n._removeCallbackFunc)&&(n._removeCallbackFunc(),n._removeCallbackFunc=void 0),e._spareBillboards.push(n),t.billboard=void 0)}var HZe=new l_e.default,GZe=/\s/;function WZe(e,t){let n=t._renderedText,i=HZe.splitGraphemes(n),r=i.length,o=t._glyphs,a=o.length;if(t._relativeSize=t._fontSize/Zs.FONT_SIZE,r<a)for(let p=r;p<a;++p)H$(e,o[p]);o.length=r;let s=t._backgroundBillboard,c=e._backgroundBillboardCollection;t._showBackground&&!l(s)&&(s=VZe(c,e),t._backgroundBillboard=s),qZe(c,t,s);let u=e._glyphBillboardCollection,f=u.billboardTextureCache,d=e._textDimensionsCache;for(let p=0;p<r;++p){let g=i[p],m=t._verticalOrigin,y=JSON.stringify([g,t._fontFamily,t._fontStyle,t._fontWeight,+m]),A=d[y],b=f.get(y);if(!l(b)||!l(A)){b=new ly(u),f.set(y,b);let E=`${t._fontStyle} ${t._fontWeight} ${Zs.FONT_SIZE}px ${t._fontFamily}`,w=jZe(g,E,U.WHITE,U.WHITE,0,bo.FILL);if(A=w.dimensions,d[y]=A,w.width>0&&w.height>0&&!GZe.test(g)){let D=(0,c_e.default)(w,{cutoff:Zs.CUTOFF,radius:Zs.RADIUS}),R=w.getContext("2d"),M=w.width,N=w.height,_=R.getImageData(0,0,M,N);for(let v=0;v<M;v++)for(let S=0;S<N;S++){let P=S*M+v,L=D[P]*255,F=P*4;_.data[F+0]=L,_.data[F+1]=L,_.data[F+2]=L,_.data[F+3]=L}R.putImageData(_,0,0),b.loadImage(y,w)}}let x=o[p];if(l(x)||(x=new kZe,x.dimensions=A,x.billboardTexture=b,o[p]=x),x.billboardTexture.id!==y&&(x.billboardTexture=b,x.dimensions=A),!b.hasImage){H$(e,x);continue}let T=x.billboard,C=e._spareBillboards;l(T)||(C.length>0?T=C.pop():(T=u.add({collection:e}),T._labelDimensions=new k,T._labelTranslate=new k,T._positionFromParent=!0),x.billboard=T),T.setImageTexture(b),T.show=t._show,T.position=t._position,T.eyeOffset=t._eyeOffset,T.pixelOffset=t._pixelOffset,T.horizontalOrigin=ji.LEFT,T.verticalOrigin=t._verticalOrigin,T.heightReference=t._heightReference,l(t._clampedPosition)&&(T._clampedPosition=t._clampedPosition),T.scale=t.totalScale,T.pickPrimitive=t,T.id=t._id,T.translucencyByDistance=t._translucencyByDistance,T.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,T.scaleByDistance=t._scaleByDistance,T.distanceDisplayCondition=t._distanceDisplayCondition,T.disableDepthTestDistance=t._disableDepthTestDistance,T._batchIndex=t._batchIndex,T.outlineColor=t.outlineColor,t.style===bo.FILL_AND_OUTLINE?(T.color=t._fillColor,T.outlineWidth=t.outlineWidth):t.style===bo.FILL?(T.color=t._fillColor,T.outlineWidth=0):t.style===bo.OUTLINE&&(T.color=U.TRANSPARENT,T.outlineWidth=t.outlineWidth)}t._repositionAllGlyphs=!0}function qZe(e,t,n){if(!l(n))return;let i=t.show&&t._showBackground&&t._renderedText.split(`
|
|
`).join("").length>0;if(t.show&&!i){e.remove(n),t._backgroundBillboard=void 0;return}n.color=t._backgroundColor,n.show=t._show,n.position=t._position,n.eyeOffset=t._eyeOffset,n.pixelOffset=t._pixelOffset,n.horizontalOrigin=ji.LEFT,n.verticalOrigin=t._verticalOrigin,n.heightReference=t._heightReference,l(t._clampedPosition)&&(n._clampedPosition=t._clampedPosition),n.scale=t.totalScale,n.pickPrimitive=t,n.id=t._id,n.translucencyByDistance=t._translucencyByDistance,n.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,n.scaleByDistance=t._scaleByDistance,n.distanceDisplayCondition=t._distanceDisplayCondition,n.disableDepthTestDistance=t._disableDepthTestDistance,n.clusterShow=t.clusterShow}function s_e(e,t,n){return t===ji.CENTER?-e/2:t===ji.RIGHT?-(e+n.x):n.x}var Po=new k,YZe=new k;function XZe(e){let t=e._glyphs,n=e._renderedText,i=0,r=0,o=[],a=Number.NEGATIVE_INFINITY,s=0,c=1,u=t.length,f=e._backgroundBillboard,d=k.clone(l(f)?e._backgroundPadding:k.ZERO,YZe);d.x/=e._relativeSize,d.y/=e._relativeSize;for(let M=0;M<u;++M){if(n.charAt(M)===`
|
|
`){o.push(i),++c,i=0;continue}let _=t[M].dimensions;l(_)&&(s=Math.max(s,_.height-_.descent),a=Math.max(a,_.descent),i+=_.width-_.minx,M<u-1&&(i+=t[M+1].dimensions.minx),r=Math.max(r,i))}o.push(i);let p=s+a,g=e.totalScale,m=e._horizontalOrigin,y=e._verticalOrigin,A=0,b=o[A],x=s_e(b,m,d),T=(l(e._lineHeight)?e._lineHeight:zZe*e._fontSize)/e._relativeSize,C=T*(c-1),E=r,w=p+C;l(f)&&(E+=d.x*2,w+=d.y*2,f._labelHorizontalOrigin=m),Po.x=x*g,Po.y=0;let D=!0,R=0;for(let M=0;M<u;++M){if(n.charAt(M)===`
|
|
`){++A,R+=T,b=o[A],x=s_e(b,m,d),Po.x=x*g,D=!0;continue}let N=t[M],_=N.dimensions;if(l(_)&&(y===Wn.TOP?(Po.y=_.height-s-d.y,Po.y+=Zs.PADDING):y===Wn.CENTER?Po.y=(C+_.height-s)/2:y===Wn.BASELINE?(Po.y=C,Po.y-=Zs.PADDING):(Po.y=C+a+d.y,Po.y-=Zs.PADDING),Po.y=(Po.y-_.descent-R)*g,D&&(Po.x-=Zs.PADDING*g,D=!1),l(N.billboard)&&(N.billboard._setTranslate(Po),N.billboard._labelDimensions.x=E,N.billboard._labelDimensions.y=w,N.billboard._labelHorizontalOrigin=m,gu(e.heightReference)&&(N.billboard._labelTranslate=k.clone(Po,N.billboard._labelTranslate))),M<u-1)){let v=t[M+1];Po.x+=(_.width-_.minx+v.dimensions.minx)*g}}l(f)&&n.split(`
|
|
`).join("").length>0&&(m===ji.CENTER?x=-r/2-d.x:m===ji.RIGHT?x=-(r+d.x*2):x=0,Po.x=x*g,y===Wn.TOP?Po.y=p-s-a:y===Wn.CENTER?Po.y=(p-s)/2-a:y===Wn.BASELINE?Po.y=-d.y-a:Po.y=0,Po.y=Po.y*g,f.width=E,f.height=w,f._setTranslate(Po),f._labelTranslate=k.clone(Po,f._labelTranslate))}function u_e(e,t){let n=t._glyphs;for(let i=0,r=n.length;i<r;++i)H$(e,n[i]);l(t._backgroundBillboard)&&(e._backgroundBillboardCollection.remove(t._backgroundBillboard),t._backgroundBillboard=void 0),t._labelCollection=void 0,l(t._removeCallbackFunc)&&t._removeCallbackFunc(),ue(t)}function ip(e){e=e??H.EMPTY_OBJECT,this._scene=e.scene,this._batchTable=e.batchTable;let t=new md({scene:this._scene,textureAtlas:new vv({initialSize:j$}),coarseDepthTestDistance:e.coarseDepthTestDistance,threePointDepthTestDistance:e.threePointDepthTestDistance});this._backgroundBillboardCollection=t,this._backgroundBillboardTexture=new ly(t),this._glyphBillboardCollection=new md({scene:this._scene,batchTable:this._batchTable,coarseDepthTestDistance:e.coarseDepthTestDistance,threePointDepthTestDistance:e.threePointDepthTestDistance}),this._glyphBillboardCollection._sdf=!0,this._spareBillboards=[],this._textDimensionsCache={},this._labels=[],this._labelsToUpdate=[],this._totalGlyphCount=0,this._highlightColor=U.clone(U.WHITE),this.show=e.show??!0,this.modelMatrix=O.clone(e.modelMatrix??O.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.blendOption=e.blendOption??Fi.OPAQUE_AND_TRANSLUCENT}Object.defineProperties(ip.prototype,{length:{get:function(){return this._labels.length}},sizeInBytes:{get:function(){return this._glyphBillboardCollection.sizeInBytes+this._backgroundBillboardCollection.sizeInBytes}},ready:{get:function(){let e=this._backgroundBillboardCollection.get(0);return l(e)&&!e.ready?!1:this._glyphBillboardCollection.ready}},coarseDepthTestDistance:{get:function(){return this._backgroundBillboardCollection.coarseDepthTestDistance},set:function(e){this._backgroundBillboardCollection.coarseDepthTestDistance=e,this._glyphBillboardCollection.coarseDepthTestDistance=e}},threePointDepthTestDistance:{get:function(){return this._backgroundBillboardCollection.threePointDepthTestDistance},set:function(e){this._backgroundBillboardCollection.threePointDepthTestDistance=e,this._glyphBillboardCollection.threePointDepthTestDistance=e}}});ip.prototype.add=function(e){let t=new Hb(e,this);return this._labels.push(t),this._labelsToUpdate.push(t),t};ip.prototype.remove=function(e){if(l(e)&&e._labelCollection===this){let t=this._labels.indexOf(e);if(t!==-1)return this._labels.splice(t,1),u_e(this,e),!0}return!1};ip.prototype.removeAll=function(){let e=this._labels;for(let t=0,n=e.length;t<n;++t)u_e(this,e[t]);e.length=0};ip.prototype.contains=function(e){return l(e)&&e._labelCollection===this};ip.prototype.get=function(e){return this._labels[e]};ip.prototype.update=function(e){if(!this.show)return;let t=this._glyphBillboardCollection,n=this._backgroundBillboardCollection;t.modelMatrix=this.modelMatrix,t.debugShowBoundingVolume=this.debugShowBoundingVolume,n.modelMatrix=this.modelMatrix,n.debugShowBoundingVolume=this.debugShowBoundingVolume;let i=this._labelsToUpdate.length;for(let o=0;o<i;++o){let a=this._labelsToUpdate[o];if(a.isDestroyed())continue;let s=a._glyphs.length;a._rebindAllGlyphs&&(WZe(this,a),a._rebindAllGlyphs=!1),a._repositionAllGlyphs&&(XZe(a),a._repositionAllGlyphs=!1);let c=a._glyphs.length-s;this._totalGlyphCount+=c}let r=n.length>0?Fi.TRANSLUCENT:this.blendOption;t.blendOption=r,n.blendOption=r,t._highlightColor=this._highlightColor,n._highlightColor=this._highlightColor,this._labelsToUpdate.length=0,n.update(e),t.update(e)};ip.prototype.isDestroyed=function(){return!1};ip.prototype.destroy=function(){return this.removeAll(),this._glyphBillboardCollection=this._glyphBillboardCollection.destroy(),this._backgroundBillboardCollection=this._backgroundBillboardCollection.destroy(),ue(this)};var Y0=ip;function Ho(e,t){e=e??H.EMPTY_OBJECT;let n=e.translucencyByDistance,i=e.scaleByDistance,r=e.distanceDisplayCondition;l(n)&&(n=Wt.clone(n)),l(i)&&(i=Wt.clone(i)),l(r)&&(r=jt.clone(r)),this._show=e.show??!0,this._position=h.clone(e.position??h.ZERO),this._actualPosition=h.clone(this._position),this._color=U.clone(e.color??U.WHITE),this._outlineColor=U.clone(e.outlineColor??U.TRANSPARENT),this._outlineWidth=e.outlineWidth??0,this._pixelSize=e.pixelSize??10,this._scaleByDistance=i,this._translucencyByDistance=n,this._distanceDisplayCondition=r,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??jo.NONE}var f_e=Ho.SHOW_INDEX=0,m_e=Ho.POSITION_INDEX=1,KZe=Ho.COLOR_INDEX=2,$Ze=Ho.OUTLINE_COLOR_INDEX=3,JZe=Ho.OUTLINE_WIDTH_INDEX=4,ZZe=Ho.PIXEL_SIZE_INDEX=5,QZe=Ho.SCALE_BY_DISTANCE_INDEX=6,eQe=Ho.TRANSLUCENCY_BY_DISTANCE_INDEX=7,tQe=Ho.DISTANCE_DISPLAY_CONDITION_INDEX=8,nQe=Ho.DISABLE_DEPTH_DISTANCE_INDEX=9,iQe=Ho.SPLIT_DIRECTION_INDEX=10;Ho.NUMBER_OF_PROPERTIES=11;function tf(e,t){let n=e._pointPrimitiveCollection;l(n)&&(n._updatePointPrimitive(e,t),e._dirty=!0)}Object.defineProperties(Ho.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,tf(this,f_e))}},position:{get:function(){return this._position},set:function(e){let t=this._position;h.equals(t,e)||(h.clone(e,t),h.clone(e,this._actualPosition),tf(this,m_e))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;Wt.equals(t,e)||(this._scaleByDistance=Wt.clone(e,t),tf(this,QZe))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;Wt.equals(t,e)||(this._translucencyByDistance=Wt.clone(e,t),tf(this,eQe))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){this._pixelSize!==e&&(this._pixelSize=e,tf(this,ZZe))}},color:{get:function(){return this._color},set:function(e){let t=this._color;U.equals(t,e)||(U.clone(e,t),tf(this,KZe))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;U.equals(t,e)||(U.clone(e,t),tf(this,$Ze))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,tf(this,JZe))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){jt.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=jt.clone(e,this._distanceDisplayCondition),tf(this,tQe))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,tf(this,nQe))}},id:{get:function(){return this._id},set:function(e){this._id=e,l(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,tf(this,f_e))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,tf(this,iQe))}}});Ho.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId};Ho.prototype._getActualPosition=function(){return this._actualPosition};Ho.prototype._setActualPosition=function(e){h.clone(e,this._actualPosition),tf(this,m_e)};var d_e=new ae;Ho._computeActualPosition=function(e,t,n){return t.mode===re.SCENE3D?e:(O.multiplyByPoint(n,e,d_e),cr.computeActualEllipsoidPosition(t,d_e))};var h_e=new ae;Ho._computeScreenSpacePosition=function(e,t,n,i){let r=O.multiplyByVector(e,ae.fromElements(t.x,t.y,t.z,1,h_e),h_e);return cr.worldToWindowCoordinates(n,r,i)};Ho.prototype.computeScreenSpacePosition=function(e,t){let n=this._pointPrimitiveCollection;l(t)||(t=new k);let i=n.modelMatrix,r=Ho._computeScreenSpacePosition(i,this._actualPosition,e,t);if(l(r))return r.y=e.canvas.clientHeight-r.y,r};Ho.getScreenSpaceBoundingBox=function(e,t,n){let i=e.pixelSize,r=i*.5,o=t.x-r,a=t.y-r,s=i,c=i;return l(n)||(n=new Je),n.x=o,n.y=a,n.width=s,n.height=c,n};Ho.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&h.equals(this._position,e._position)&&U.equals(this._color,e._color)&&this._pixelSize===e._pixelSize&&this._outlineWidth===e._outlineWidth&&this._show===e._show&&U.equals(this._outlineColor,e._outlineColor)&&Wt.equals(this._scaleByDistance,e._scaleByDistance)&&Wt.equals(this._translucencyByDistance,e._translucencyByDistance)&&jt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};Ho.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0};var Ss=Ho;var Gb=`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;
|
|
|
|
// The distance in UV space from this fragment to the center of the point, at most 0.5.
|
|
float distanceToCenter = length(gl_PointCoord - vec2(0.5));
|
|
// The max distance stops one pixel shy of the edge to leave space for anti-aliasing.
|
|
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;
|
|
|
|
// Fully transparent parts of the billboard are not pickable.
|
|
#if !defined(OPAQUE) && !defined(TRANSLUCENT)
|
|
if (color.a < 0.005) // matches 0/255 and 1/255
|
|
{
|
|
discard;
|
|
}
|
|
#else
|
|
// The billboard is rendered twice. The opaque pass discards translucent fragments
|
|
// and the translucent pass discards opaque fragments.
|
|
#ifdef OPAQUE
|
|
if (color.a < 0.995) // matches < 254/255
|
|
{
|
|
discard;
|
|
}
|
|
#else
|
|
if (color.a >= 0.995) // matches 254/255 and 255/255
|
|
{
|
|
discard;
|
|
}
|
|
#endif
|
|
#endif
|
|
|
|
out_FragColor = czm_gammaCorrect(color);
|
|
czm_writeLogDepth();
|
|
}
|
|
`;var z3=`uniform float u_maxTotalPointSize;
|
|
|
|
in vec4 positionHighAndSize;
|
|
in vec4 positionLowAndOutline;
|
|
in vec4 compressedAttribute0; // color, outlineColor, pick color
|
|
in vec4 compressedAttribute1; // show, translucency by distance, some free space
|
|
in vec4 scaleByDistance; // near, nearScale, far, farScale
|
|
in vec4 distanceDisplayConditionAndDisableDepthAndSplitDirection; // near, far, disableDepthTestDistance, splitDirection
|
|
|
|
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()
|
|
{
|
|
// Modifying this shader may also require modifications to PointPrimitive._computeScreenSpacePosition
|
|
|
|
// unpack attributes
|
|
vec3 positionHigh = positionHighAndSize.xyz;
|
|
vec3 positionLow = positionLowAndOutline.xyz;
|
|
float outlineWidthBothSides = 2.0 * positionLowAndOutline.w;
|
|
float totalSize = positionHighAndSize.w + outlineWidthBothSides;
|
|
float outlinePercent = outlineWidthBothSides / totalSize;
|
|
// Scale in response to browser-zoom.
|
|
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 = czm_decodeRGB8(compressedAttribute0.x);
|
|
vec4 outlineColor = czm_decodeRGB8(compressedAttribute0.y);
|
|
vec4 pickColor = czm_decodeRGB8(compressedAttribute0.z);
|
|
vec4 alphaPacked = czm_decodeRGB8(compressedAttribute0.w);
|
|
|
|
color.a = alphaPacked.x;
|
|
outlineColor.a = alphaPacked.y;
|
|
pickColor.a = alphaPacked.z;
|
|
|
|
///////////////////////////////////////////////////////////////////////////
|
|
|
|
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)
|
|
{
|
|
// 2D camera distance is a special case
|
|
// treat all billboards as flattened to the z=0.0 plane
|
|
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) {
|
|
// Add padding for anti-aliasing on both sides.
|
|
totalSize += 3.0;
|
|
}
|
|
|
|
// Clamp to max point size.
|
|
totalSize = min(totalSize, u_maxTotalPointSize);
|
|
// If size is too small, push vertex behind near plane for clipping.
|
|
// Note that context.minimumAliasedPointSize "will be at most 1.0".
|
|
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);
|
|
// push vertex behind near plane for clipping
|
|
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) {
|
|
// push vertex behind camera to force it to be clipped
|
|
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)
|
|
{
|
|
// Don't try to "multiply both sides" by w. Greater/less-than comparisons won't work for negative values of w.
|
|
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)))
|
|
{
|
|
// Position z on the near plane.
|
|
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 rQe=Ss.SHOW_INDEX,q$=Ss.POSITION_INDEX,p_e=Ss.COLOR_INDEX,oQe=Ss.OUTLINE_COLOR_INDEX,aQe=Ss.OUTLINE_WIDTH_INDEX,sQe=Ss.PIXEL_SIZE_INDEX,g_e=Ss.SCALE_BY_DISTANCE_INDEX,__e=Ss.TRANSLUCENCY_BY_DISTANCE_INDEX,y_e=Ss.DISTANCE_DISPLAY_CONDITION_INDEX,cQe=Ss.DISABLE_DEPTH_DISTANCE_INDEX,lQe=Ss.SPLIT_DIRECTION_INDEX,Y$=Ss.NUMBER_OF_PROPERTIES,Kc={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayConditionAndDisableDepthAndSplitDirection:5};function pd(e){e=e??H.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(Y$),this._maxPixelSize=1,this._baseVolume=new se,this._baseVolumeWC=new se,this._baseVolume2D=new se,this._boundingVolume=new se,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=e.show??!0,this.modelMatrix=O.clone(e.modelMatrix??O.IDENTITY),this._modelMatrix=O.clone(O.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.blendOption=e.blendOption??Fi.OPAQUE_AND_TRANSLUCENT,this._blendOption=void 0,this._mode=re.SCENE3D,this._maxTotalPointSize=1,this._buffersUsage=[Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW];let t=this;this._uniforms={u_maxTotalPointSize:function(){return t._maxTotalPointSize}}}Object.defineProperties(pd.prototype,{length:{get:function(){return X$(this),this._pointPrimitives.length}}});function A_e(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}pd.prototype.add=function(e){let t=new Ss(e,this);return t._index=this._pointPrimitives.length,this._pointPrimitives.push(t),this._createVertexArray=!0,t};pd.prototype.remove=function(e){return this.contains(e)?(this._pointPrimitives[e._index]=null,this._pointPrimitivesRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};pd.prototype.removeAll=function(){A_e(this._pointPrimitives),this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!0};function X$(e){if(e._pointPrimitivesRemoved){e._pointPrimitivesRemoved=!1;let t=[],n=e._pointPrimitives,i=n.length;for(let r=0,o=0;r<i;++r){let a=n[r];a&&(a._index=o++,t.push(a))}e._pointPrimitives=t}}pd.prototype._updatePointPrimitive=function(e,t){e._dirty||(this._pointPrimitivesToUpdate[this._pointPrimitivesToUpdateIndex++]=e),++this._propertiesChanged[t]};pd.prototype.contains=function(e){return l(e)&&e._pointPrimitiveCollection===this};pd.prototype.get=function(e){return X$(this),this._pointPrimitives[e]};pd.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<Y$;++i){let r=n[i]===0?Oe.STATIC_DRAW:Oe.STREAM_DRAW;t=t||e[i]!==r,e[i]=r}return t};function uQe(e,t,n){return new ay(e,[{index:Kc.positionHighAndSize,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[q$]},{index:Kc.positionLowAndShow,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[q$]},{index:Kc.compressedAttribute0,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[p_e]},{index:Kc.compressedAttribute1,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[__e]},{index:Kc.scaleByDistance,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[g_e]},{index:Kc.distanceDisplayConditionAndDisableDepthAndSplitDirection,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[y_e]}],t)}var G$=new Sn,U3=new U;function b_e(e,t,n,i){let r=i._index,o=i._getActualPosition();e._mode===re.SCENE3D&&(se.expand(e._baseVolume,o,e._baseVolume),e._boundingVolumeDirty=!0),Sn.fromCartesian(o,G$);let a=i.pixelSize,s=i.outlineWidth;e._maxPixelSize=Math.max(e._maxPixelSize,a+s);let c=n[Kc.positionHighAndSize],u=G$.high;c(r,u.x,u.y,u.z,a);let f=n[Kc.positionLowAndOutline],d=G$.low;f(r,d.x,d.y,d.z,s)}var fQe=256;function x_e(e,t,n,i){let r=i._index,o=i.color,a=i.outlineColor,s=i.getPickId(t).color;U3.red=o.alpha,U3.green=a.alpha,U3.blue=s.alpha;let c=n[Kc.compressedAttribute0];c(r,an.encodeRGB8(o),an.encodeRGB8(a),an.encodeRGB8(s),an.encodeRGB8(U3))}function T_e(e,t,n,i){let r=i._index,o=0,a=1,s=1,c=1,u=i.translucencyByDistance;l(u)&&(o=u.near,a=u.nearValue,s=u.far,c=u.farValue,(a!==1||c!==1)&&(e._shaderTranslucencyByDistance=!0));let f=i.show&&i.clusterShow;i.color.alpha===0&&i.outlineColor.alpha===0&&(f=!1),a=I.clamp(a,0,1),a=a===1?255:a*255|0;let d=(f?1:0)*fQe+a;c=I.clamp(c,0,1),c=c===1?255:c*255|0;let p=c,g=n[Kc.compressedAttribute1];g(r,d,p,o,s)}function C_e(e,t,n,i){let r=i._index,o=n[Kc.scaleByDistance],a=0,s=1,c=1,u=1,f=i.scaleByDistance;l(f)&&(a=f.near,s=f.nearValue,c=f.far,u=f.farValue,(s!==1||u!==1)&&(e._shaderScaleByDistance=!0)),o(r,a,s,c,u)}function v_e(e,t,n,i){let r=i._index,o=n[Kc.distanceDisplayConditionAndDisableDepthAndSplitDirection],a=0,s=Number.MAX_VALUE,c=i.distanceDisplayCondition;l(c)&&(a=c.near,s=c.far,a*=a,s*=s,e._shaderDistanceDisplayCondition=!0);let u=i.disableDepthTestDistance;u*=u,u>0&&(e._shaderDisableDepthDistance=!0,u===Number.POSITIVE_INFINITY&&(u=-1));let f=0,d=i.splitDirection;l(d)&&(f=d),o(r,a,s,u,f)}function dQe(e,t,n,i){b_e(e,t,n,i),x_e(e,t,n,i),T_e(e,t,n,i),C_e(e,t,n,i),v_e(e,t,n,i)}function W$(e,t,n,i,r,o){let a;i.mode===re.SCENE3D?(a=e._baseVolume,e._boundingVolumeDirty=!0):a=e._baseVolume2D;let s=[];for(let c=0;c<n;++c){let u=t[c],f=u.position,d=Ss._computeActualPosition(f,i,r);l(d)&&(u._setActualPosition(d),o?s.push(d):se.expand(a,d,a))}o&&se.fromPoints(s,a)}function hQe(e,t){let n=t.mode,i=e._pointPrimitives,r=e._pointPrimitivesToUpdate,o=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==re.SCENE3D&&!O.equals(o,e.modelMatrix)?(e._mode=n,O.clone(e.modelMatrix,o),e._createVertexArray=!0,(n===re.SCENE3D||n===re.SCENE2D||n===re.COLUMBUS_VIEW)&&W$(e,i,i.length,t,o,!0)):n===re.MORPHING?W$(e,i,i.length,t,o,!0):(n===re.SCENE2D||n===re.COLUMBUS_VIEW)&&W$(e,r,e._pointPrimitivesToUpdateIndex,t,o,!1)}function mQe(e,t,n){let r=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*e._maxPixelSize;n.radius+=r}var pQe=[];pd.prototype.update=function(e){if(X$(this),!this.show)return;this._maxTotalPointSize=Ft.maximumAliasedPointSize,hQe(this,e);let n=this._pointPrimitives.length,i=this._pointPrimitivesToUpdate,r=this._pointPrimitivesToUpdateIndex,o=this._propertiesChanged,a=this._createVertexArray,s,c=e.context,u=e.passes,f=u.pick;if(a||!f&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let E=0;E<Y$;++E)o[E]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=uQe(c,n,this._buffersUsage),s=this._vaf.writers;for(let E=0;E<n;++E){let w=this._pointPrimitives[E];w._dirty=!1,dQe(this,c,s,w)}this._vaf.commit()}this._pointPrimitivesToUpdateIndex=0}else if(r>0){let E=pQe;E.length=0,(o[q$]||o[aQe]||o[sQe])&&E.push(b_e),(o[p_e]||o[oQe])&&E.push(x_e),(o[rQe]||o[__e])&&E.push(T_e),o[g_e]&&E.push(C_e),(o[y_e]||o[cQe]||o[lQe])&&E.push(v_e);let w=E.length;if(s=this._vaf.writers,r/n>.1){for(let D=0;D<r;++D){let R=i[D];R._dirty=!1;for(let M=0;M<w;++M)E[M](this,c,s,R)}this._vaf.commit()}else{for(let D=0;D<r;++D){let R=i[D];R._dirty=!1;for(let M=0;M<w;++M)E[M](this,c,s,R);this._vaf.subCommit(R._index,1)}this._vaf.endSubCommits()}this._pointPrimitivesToUpdateIndex=0}if(r>n*1.5&&(i.length=n),!l(this._vaf)||!l(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,se.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let d,p=O.IDENTITY;e.mode===re.SCENE3D?(p=this.modelMatrix,d=se.clone(this._baseVolumeWC,this._boundingVolume)):d=se.clone(this._baseVolume2D,this._boundingVolume),mQe(this,e,d);let g=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,g&&(this._blendOption===Fi.OPAQUE||this._blendOption===Fi.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=je.fromCache({depthTest:{enabled:!0,func:ee.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===Fi.TRANSLUCENT||this._blendOption===Fi.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=je.fromCache({depthTest:{enabled:!0,func:ee.LEQUAL},depthMask:!1,blending:en.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 Ge({sources:[z3]}),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===Fi.OPAQUE_AND_TRANSLUCENT&&(y=new Ge({defines:["OPAQUE"],sources:[Gb]}),this._sp=Zt.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:Kc}),y=new Ge({defines:["TRANSLUCENT"],sources:[Gb]}),this._spTranslucent=Zt.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:Kc})),this._blendOption===Fi.OPAQUE&&(y=new Ge({sources:[Gb]}),this._sp=Zt.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:Kc})),this._blendOption===Fi.TRANSLUCENT&&(y=new Ge({sources:[Gb]}),this._spTranslucent=Zt.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:Kc})),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance);let A,b,x,T,C=e.commandList;if(u.render||f){let E=this._colorCommands,w=this._blendOption===Fi.OPAQUE,D=this._blendOption===Fi.OPAQUE_AND_TRANSLUCENT;A=this._vaf.va,b=A.length,E.length=b;let R=D?b*2:b;for(T=0;T<R;++T){let M=w||D&&T%2===0;x=E[T],l(x)||(x=E[T]=new nt),x.primitiveType=Re.POINTS,x.pass=M||!D?Pe.OPAQUE:Pe.TRANSLUCENT,x.owner=this;let N=D?Math.floor(T/2):T;x.boundingVolume=d,x.modelMatrix=p,x.shaderProgram=M?this._sp:this._spTranslucent,x.uniformMap=this._uniforms,x.vertexArray=A[N].va,x.renderState=M?this._rsOpaque:this._rsTranslucent,x.debugShowBoundingVolume=this.debugShowBoundingVolume,x.pickId="v_pickColor",C.push(x)}}};pd.prototype.isDestroyed=function(){return!1};pd.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._spTranslucent=this._spTranslucent&&this._spTranslucent.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),A_e(this._pointPrimitives),ue(this)};var ZP=pd;var E_e=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],K$=1,QP=8,Go=new Uint32Array(96),tD=class e{static from(t){if(!t||t.byteLength===void 0||t.buffer)throw new Error("Data must be an instance of ArrayBuffer or SharedArrayBuffer.");let[n,i]=new Uint8Array(t,0,2);if(n!==219)throw new Error("Data does not appear to be in a KDBush format.");let r=i>>4;if(r!==K$)throw new Error(`Got v${r} data when expected v${K$}.`);let o=E_e[i&15];if(!o)throw new Error("Unrecognized array type.");let[a]=new Uint16Array(t,2,1),[s]=new Uint32Array(t,4,1);return new e(s,a,o,void 0,t)}constructor(t,n=64,i=Float64Array,r=ArrayBuffer,o){if(isNaN(t)||t<0)throw new Error(`Unexpected 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 a=E_e.indexOf(this.ArrayType),s=t*2*this.ArrayType.BYTES_PER_ELEMENT,c=t*this.IndexArrayType.BYTES_PER_ELEMENT,u=(8-c%8)%8;if(a<0)throw new Error(`Unexpected typed array class: ${i}.`);if(o)this.data=o,this.ids=new this.IndexArrayType(o,QP,t),this.coords=new i(o,QP+c+u,t*2),this._pos=t*2,this._finished=!0;else{let f=this.data=new r(QP+s+c+u);this.ids=new this.IndexArrayType(f,QP,t),this.coords=new i(f,QP+c+u,t*2),this._pos=0,this._finished=!1,new Uint8Array(f,0,2).set([219,(K$<<4)+a]),new Uint16Array(f,2,1)[0]=n,new Uint32Array(f,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 J$(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,n,i,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:o,coords:a,nodeSize:s}=this;Go[0]=0,Go[1]=o.length-1,Go[2]=0;let c=3,u=[];for(;c>0;){let f=Go[--c],d=Go[--c],p=Go[--c];if(d-p<=s){for(let A=p;A<=d;A++){let b=a[2*A],x=a[2*A+1];b>=t&&b<=i&&x>=n&&x<=r&&u.push(o[A])}continue}let g=p+d>>1,m=a[2*g],y=a[2*g+1];m>=t&&m<=i&&y>=n&&y<=r&&u.push(o[g]),(f===0?t<=m:n<=y)&&(Go[c++]=p,Go[c++]=g-1,Go[c++]=1-f),(f===0?i>=m:r>=y)&&(Go[c++]=g+1,Go[c++]=d,Go[c++]=1-f)}return u}within(t,n,i){let r=[];return this.withinInto(t,n,i,r),r}withinInto(t,n,i,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:o,coords:a,nodeSize:s}=this;Go[0]=0,Go[1]=o.length-1,Go[2]=0;let c=3,u=0,f=i*i;for(;c>0;){let d=Go[--c],p=Go[--c],g=Go[--c];if(p-g<=s){for(let b=g;b<=p;b++)S_e(a[2*b],a[2*b+1],t,n)<=f&&(r[u++]=o[b]);continue}let m=g+p>>1,y=a[2*m],A=a[2*m+1];S_e(y,A,t,n)<=f&&(r[u++]=o[m]),(d===0?t-i<=y:n-i<=A)&&(Go[c++]=g,Go[c++]=m-1,Go[c++]=1-d),(d===0?t+i>=y:n+i>=A)&&(Go[c++]=m+1,Go[c++]=p,Go[c++]=1-d)}return u}};function J$(e,t,n,i,r,o){if(r-i<=n)return;let a=i+r>>1;w_e(e,t,a,i,r,o),J$(e,t,n,i,a-1,1-o),J$(e,t,n,a+1,r,1-o)}function w_e(e,t,n,i,r,o){for(;r>i;){if(r-i>600){let u=r-i+1,f=n-i+1,d=Math.log(u),p=.5*Math.exp(2*d/3),g=.5*Math.sqrt(d*p*(u-p)/u)*(f-u/2<0?-1:1),m=Math.max(i,Math.floor(n-f*p/u+g)),y=Math.min(r,Math.floor(n+(u-f)*p/u+g));w_e(e,t,n,m,y,o)}let a=t[2*n+o],s=i,c=r;for(eD(e,t,i,n),t[2*r+o]>a&&eD(e,t,i,r);s<c;){for(eD(e,t,s,c),s++,c--;t[2*s+o]<a;)s++;for(;t[2*c+o]>a;)c--}t[2*i+o]===a?eD(e,t,i,c):(c++,eD(e,t,c,r)),c<=n&&(i=c+1),n<=c&&(r=c-1)}}function eD(e,t,n,i){$$(e,n,i),$$(t,2*n,2*i),$$(t,2*n+1,2*i+1)}function $$(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function S_e(e,t,n,i){let r=e-n,o=t-i;return r*r+o*o}function vh(e){e=e??H.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 be,this.show=e.show??!0}function I_e(e,t){e.x-=t,e.y-=t,e.width+=t*2,e.height+=t*2}var gQe=new Je;function P_e(e,t,n,i,r){if(l(e._labelCollection)&&i._clusterLabels?r=Hb.getScreenSpaceBoundingBox(e,t,r):l(e._billboardCollection)&&i._clusterBillboards?r=Dr.getScreenSpaceBoundingBox(e,t,r):l(e._pointPrimitiveCollection)&&i._clusterPoints&&(r=Ss.getScreenSpaceBoundingBox(e,t,r)),I_e(r,n),i._clusterLabels&&!l(e._labelCollection)&&l(e.id)&&R_e(i,e.id.id)&&l(e.id._label)){let o=i._collectionIndicesByEntity[e.id.id].labelIndex,a=i._labelCollection.get(o),s=Hb.getScreenSpaceBoundingBox(a,t,gQe);I_e(s,n),r=Je.union(r,s,r)}return r}function _Qe(e,t){if(e.clusterShow=!0,!l(e._labelCollection)&&l(e.id)&&R_e(t,e.id.id)&&l(e.id._label)){let n=t._collectionIndicesByEntity[e.id.id].labelIndex,i=t._labelCollection.get(n);i.clusterShow=!0}}function D_e(e,t,n,i){let r={billboard:i._clusterBillboardCollection.add(),label:i._clusterLabelCollection.add(),point:i._clusterPointCollection.add()};r.billboard.show=!1,r.point.show=!1,r.label.show=!0,r.label.text=t.toLocaleString(),r.label.id=n,r.billboard.position=r.label.position=r.point.position=e,i._clusterEvent.raiseEvent(n,r)}function R_e(e,t){return l(e)&&l(e._collectionIndicesByEntity[t])&&l(e._collectionIndicesByEntity[t].labelIndex)}function Z$(e,t,n,i,r){if(!l(e))return;let o=e.length;for(let a=0;a<o;++a){let s=e.get(a);if(s.clusterShow=!1,!s.show||r._scene.mode===re.SCENE3D&&!i.isPointVisible(s.position))continue;let c=r._clusterLabels&&l(s._labelCollection),u=r._clusterBillboards&&l(s.id._billboard),f=r._clusterPoints&&l(s.id._point);if(c&&(f||u))continue;let d=s.computeScreenSpacePosition(n);l(d)&&t.push({index:a,collection:e,clustered:!1,coord:d})}}var yQe=new Je,AQe=new Je,bQe=new Je;function xQe(e){return function(t){if(l(t)&&t<.05||!e.enabled)return;let n=e._scene,i=e._labelCollection,r=e._billboardCollection,o=e._pointCollection;if(!l(i)&&!l(r)&&!l(o)||!e._clusterBillboards&&!e._clusterLabels&&!e._clusterPoints)return;let a=e._clusterLabelCollection,s=e._clusterBillboardCollection,c=e._clusterPointCollection;l(a)?a.removeAll():a=e._clusterLabelCollection=new Y0({scene:n}),l(s)?s.removeAll():s=e._clusterBillboardCollection=new md({scene:n}),l(c)?c.removeAll():c=e._clusterPointCollection=new ZP;let u=e._pixelRange,f=e._minimumClusterSize,d=e._previousClusters,p=[],g=e._previousHeight,m=n.camera.positionCartographic.height,y=n.ellipsoid,A=n.camera.positionWC,b=new vm(y,A),x=[];e._clusterLabels&&Z$(i,x,n,b,e),e._clusterBillboards&&Z$(r,x,n,b,e),e._clusterPoints&&Z$(o,x,n,b,e);let T,C,E,w,D,R,M,N,_,v,S,P;if(x.length>0){let L=new tD(x.length,64,Float64Array);for(let F=0;F<x.length;++F)L.add(x[F].coord.x,x[F].coord.y);if(L.finish(),m<g)for(E=d.length,T=0;T<E;++T){let F=d[T];if(!b.isPointVisible(F.position))continue;let V=Dr._computeScreenSpacePosition(O.IDENTITY,F.position,h.ZERO,k.ZERO,n);if(!l(V))continue;let z=1-m/g,j=F.width=F.width*z,B=F.height=F.height*z;j=Math.max(j,F.minimumWidth),B=Math.max(B,F.minimumHeight);let G=V.x-j*.5,W=V.y-B*.5,Q=V.x+j,q=V.y+B;for(D=L.range(G,W,Q,q),R=D.length,v=0,_=[],C=0;C<R;++C)M=D[C],N=x[M],N.clustered||(++v,S=N.collection,P=N.index,_.push(S.get(P).id));if(v>=f)for(D_e(F.position,v,_,e),p.push(F),C=0;C<R;++C)x[D[C]].clustered=!0}for(E=x.length,T=0;T<E;++T){let F=x[T];if(F.clustered)continue;F.clustered=!0,S=F.collection,P=F.index;let V=S.get(P);w=P_e(V,F.coord,u,e,yQe);let z=Je.clone(w,AQe);D=L.range(w.x,w.y,w.x+w.width,w.y+w.height),R=D.length;let j=h.clone(V.position);for(v=1,_=[V.id],C=0;C<R;++C)if(M=D[C],N=x[M],!N.clustered){let B=N.collection.get(N.index),G=P_e(B,N.coord,u,e,bQe);h.add(B.position,j,j),Je.union(z,G,z),++v,_.push(B.id)}if(v>=f){let B=h.multiplyByScalar(j,1/v,j);for(D_e(B,v,_,e),p.push({position:B,width:z.width,height:z.height,minimumWidth:w.width,minimumHeight:w.height}),C=0;C<R;++C)x[D[C]].clustered=!0}else _Qe(V,e)}}a.length===0&&(a.destroy(),e._clusterLabelCollection=void 0),s.length===0&&(s.destroy(),e._clusterBillboardCollection=void 0),c.length===0&&(c.destroy(),e._clusterPointCollection=void 0),e._previousClusters=p,e._previousHeight=m}}vh.prototype._initialize=function(e){this._scene=e;let t=xQe(this);this._cluster=t,this._removeEventListener=e.camera.changed.addEventListener(t)};Object.defineProperties(vh.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this._enabledDirty=e!==this._enabled,this._enabled=e}},pixelRange:{get:function(){return this._pixelRange},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._pixelRange,this._pixelRange=e}},minimumClusterSize:{get:function(){return this._minimumClusterSize},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._minimumClusterSize,this._minimumClusterSize=e}},clusterEvent:{get:function(){return this._clusterEvent}},clusterBillboards:{get:function(){return this._clusterBillboards},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterBillboards,this._clusterBillboards=e}},clusterLabels:{get:function(){return this._clusterLabels},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterLabels,this._clusterLabels=e}},clusterPoints:{get:function(){return this._clusterPoints},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterPoints,this._clusterPoints=e}},ready:{get:function(){return!this._enabledDirty&&!this._clusterDirty&&(!l(this._billboardCollection)||this._billboardCollection.ready)&&(!l(this._labelCollection)||this._labelCollection.ready)}}});function eJ(e,t,n,i){return function(r){let o=this[e];l(this._collectionIndicesByEntity)||(this._collectionIndicesByEntity={});let a=this._collectionIndicesByEntity[r.id];if(l(a)||(a=this._collectionIndicesByEntity[r.id]={billboardIndex:void 0,labelIndex:void 0,pointIndex:void 0}),l(o)&&l(a[i]))return o.get(a[i]);l(o)||(o=this[e]=new t({scene:this._scene}));let s,c,u=this[n];u.length>0?(s=u.shift(),c=o.get(s)):(c=o.add(),s=o.length-1),a[i]=s;let f=this;return Promise.resolve().then(function(){f._clusterDirty=!0}),c}}function tJ(e,t){let n=e._collectionIndicesByEntity[t];!l(n.billboardIndex)&&!l(n.labelIndex)&&!l(n.pointIndex)&&delete e._collectionIndicesByEntity[t]}vh.prototype.getLabel=eJ("_labelCollection",Y0,"_unusedLabelIndices","labelIndex");vh.prototype.removeLabel=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._labelCollection)||!l(t)||!l(t.labelIndex))return;let n=t.labelIndex;t.labelIndex=void 0,tJ(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};vh.prototype.getBillboard=eJ("_billboardCollection",md,"_unusedBillboardIndices","billboardIndex");vh.prototype.removeBillboard=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._billboardCollection)||!l(t)||!l(t.billboardIndex))return;let n=t.billboardIndex;t.billboardIndex=void 0,tJ(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};vh.prototype.getPoint=eJ("_pointCollection",ZP,"_unusedPointIndices","pointIndex");vh.prototype.removePoint=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._pointCollection)||!l(t)||!l(t.pointIndex))return;let n=t.pointIndex;t.pointIndex=void 0,tJ(this,e.id);let i=this._pointCollection.get(n);i.show=!1,i.id=void 0,this._unusedPointIndices.push(n),this._clusterDirty=!0};function Q$(e){if(!l(e))return;let t=e.length;for(let n=0;n<t;++n)e.get(n).clusterShow=!0}function TQe(e){e.enabled||(l(e._clusterLabelCollection)&&e._clusterLabelCollection.destroy(),l(e._clusterBillboardCollection)&&e._clusterBillboardCollection.destroy(),l(e._clusterPointCollection)&&e._clusterPointCollection.destroy(),e._clusterLabelCollection=void 0,e._clusterBillboardCollection=void 0,e._clusterPointCollection=void 0,Q$(e._labelCollection),Q$(e._billboardCollection),Q$(e._pointCollection))}vh.prototype.update=function(e){if(!this.show)return;let t,n=this._labelCollection;l(n)&&n.length>0&&!n.ready&&(t=e.commandList,e.commandList=[],n.update(e),e.commandList=t);let i=this._billboardCollection;l(i)&&i.length>0&&!i.ready&&(t=e.commandList,e.commandList=[],i.update(e),e.commandList=t),this._enabledDirty&&(this._enabledDirty=!1,TQe(this),this._clusterDirty=!0),this._clusterDirty&&(this._cluster(),this._clusterDirty=l(n)&&!n.ready||l(i)&&!i.ready),l(this._clusterLabelCollection)&&this._clusterLabelCollection.update(e),l(this._clusterBillboardCollection)&&this._clusterBillboardCollection.update(e),l(this._clusterPointCollection)&&this._clusterPointCollection.update(e),l(n)&&n.update(e),l(i)&&i.update(e),l(this._pointCollection)&&this._pointCollection.update(e)};vh.prototype.destroy=function(){l(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 gd=vh;function fy(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new be,this.setValue(e)}Object.defineProperties(fy.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}});fy.prototype.getValue=function(e,t){return this._hasClone?this._value.clone(t):this._value};fy.prototype.setValue=function(e){let t=this._value;if(t!==e){let n=l(e),i=n&&typeof e.clone=="function",r=n&&typeof e.equals=="function";(!r||!e.equals(t))&&(this._hasClone=i,this._hasEquals=r,this._value=i?e.clone(this._value):e,this._definitionChanged.raiseEvent(this))}};fy.prototype.equals=function(e){return this===e||e instanceof fy&&(!this._hasEquals&&this._value===e._value||this._hasEquals&&this._value.equals(e._value))};fy.prototype.valueOf=function(){return this._value};fy.prototype.toString=function(){return String(this._value)};var yi=fy;function CQe(e,t,n,i,r){return{configurable:i,get:function(){return this[t]},set:function(o){let a=this[t],s=this[n];l(s)&&(s(),this[n]=void 0),o!==void 0&&(!l(o)||!l(o.getValue))&&l(r)&&(o=r(o)),a!==o&&(this[t]=o,this._definitionChanged.raiseEvent(this,e,o,a)),l(o)&&l(o.definitionChanged)&&(this[n]=o.definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this,e,o,o)},this))}}}function vQe(e){return new yi(e)}function EQe(e,t,n){return CQe(e,`_${e.toString()}`,`_${e.toString()}Subscription`,t??!1,n??vQe)}var me=EQe;function nD(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._image=void 0,this._imageSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._alignedAxis=void 0,this._alignedAxisSubscription=void 0,this._sizeInMeters=void 0,this._sizeInMetersSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._imageSubRegion=void 0,this._imageSubRegionSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this._splitDirection=void 0,this._splitDirectionSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(nD.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),image:me("image"),scale:me("scale"),pixelOffset:me("pixelOffset"),eyeOffset:me("eyeOffset"),horizontalOrigin:me("horizontalOrigin"),verticalOrigin:me("verticalOrigin"),heightReference:me("heightReference"),color:me("color"),rotation:me("rotation"),alignedAxis:me("alignedAxis"),sizeInMeters:me("sizeInMeters"),width:me("width"),height:me("height"),scaleByDistance:me("scaleByDistance"),translucencyByDistance:me("translucencyByDistance"),pixelOffsetScaleByDistance:me("pixelOffsetScaleByDistance"),imageSubRegion:me("imageSubRegion"),distanceDisplayCondition:me("distanceDisplayCondition"),disableDepthTestDistance:me("disableDepthTestDistance"),splitDirection:me("splitDirection")});nD.prototype.clone=function(e){return l(e)?(e.show=this._show,e.image=this._image,e.scale=this._scale,e.pixelOffset=this._pixelOffset,e.eyeOffset=this._eyeOffset,e.horizontalOrigin=this._horizontalOrigin,e.verticalOrigin=this._verticalOrigin,e.heightReference=this._heightReference,e.color=this._color,e.rotation=this._rotation,e.alignedAxis=this._alignedAxis,e.sizeInMeters=this._sizeInMeters,e.width=this._width,e.height=this._height,e.scaleByDistance=this._scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.pixelOffsetScaleByDistance=this._pixelOffsetScaleByDistance,e.imageSubRegion=this._imageSubRegion,e.distanceDisplayCondition=this._distanceDisplayCondition,e.disableDepthTestDistance=this._disableDepthTestDistance,e.splitDirection=this._splitDirection,e):new nD(this)};nD.prototype.merge=function(e){this.show=this._show??e.show,this.image=this._image??e.image,this.scale=this._scale??e.scale,this.pixelOffset=this._pixelOffset??e.pixelOffset,this.eyeOffset=this._eyeOffset??e.eyeOffset,this.horizontalOrigin=this._horizontalOrigin??e.horizontalOrigin,this.verticalOrigin=this._verticalOrigin??e.verticalOrigin,this.heightReference=this._heightReference??e.heightReference,this.color=this._color??e.color,this.rotation=this._rotation??e.rotation,this.alignedAxis=this._alignedAxis??e.alignedAxis,this.sizeInMeters=this._sizeInMeters??e.sizeInMeters,this.width=this._width??e.width,this.height=this._height??e.height,this.scaleByDistance=this._scaleByDistance??e.scaleByDistance,this.translucencyByDistance=this._translucencyByDistance??e.translucencyByDistance,this.pixelOffsetScaleByDistance=this._pixelOffsetScaleByDistance??e.pixelOffsetScaleByDistance,this.imageSubRegion=this._imageSubRegion??e.imageSubRegion,this.distanceDisplayCondition=this._distanceDisplayCondition??e.distanceDisplayCondition,this.disableDepthTestDistance=this._disableDepthTestDistance??e.disableDepthTestDistance,this.splitDirection=this.splitDirection??e.splitDirection};var Pl=nD;function Ov(e){this._definitionChanged=new be,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(Ov.prototype,{isConstant:{get:function(){return X.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:me("color")});Ov.prototype.getType=function(e){return"Color"};var SQe=new K;Ov.prototype.getValue=function(e,t){return l(e)||(e=K.now(SQe)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,U.WHITE,t.color),t};Ov.prototype.equals=function(e){return this===e||e instanceof Ov&&X.equals(this._color,e._color)};var Yt=Ov;var wQe=new k(1,1),IQe=!1,PQe=U.WHITE;function Mv(e){e=e??H.EMPTY_OBJECT,this._definitionChanged=new be,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(Mv.prototype,{isConstant:{get:function(){return X.isConstant(this._image)&&X.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:me("image"),repeat:me("repeat"),color:me("color"),transparent:me("transparent")});Mv.prototype.getType=function(e){return"Image"};var DQe=new K;Mv.prototype.getValue=function(e,t){return l(e)||(e=K.now(DQe)),l(t)||(t={}),t.image=X.getValueOrUndefined(this._image,e),t.repeat=X.getValueOrClonedDefault(this._repeat,e,wQe,t.repeat),t.color=X.getValueOrClonedDefault(this._color,e,PQe,t.color),X.getValueOrDefault(this._transparent,e,IQe)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t};Mv.prototype.equals=function(e){return this===e||e instanceof Mv&&X.equals(this._image,e._image)&&X.equals(this._repeat,e._repeat)&&X.equals(this._color,e._color)&&X.equals(this._transparent,e._transparent)};var Wb=Mv;function RQe(e){if(e instanceof U)return new Yt(e);if(typeof e=="string"||e instanceof De||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement){let t=new Wb;return t.image=e,t}}function OQe(e,t){return me(e,t,RQe)}var oo=OQe;function iD(e){this._definitionChanged=new be,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??H.EMPTY_OBJECT)}Object.defineProperties(iD.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),dimensions:me("dimensions"),heightReference:me("heightReference"),fill:me("fill"),material:oo("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});iD.prototype.clone=function(e){return l(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 iD(this)};iD.prototype.merge=function(e){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 Lv=iD;function Nv(){pe.throwInstantiationError()}Object.defineProperties(Nv.prototype,{isConstant:{get:pe.throwInstantiationError},definitionChanged:{get:pe.throwInstantiationError},referenceFrame:{get:pe.throwInstantiationError}});Nv.prototype.getValue=pe.throwInstantiationError;Nv.prototype.getValueInReferenceFrame=pe.throwInstantiationError;Nv.prototype.equals=pe.throwInstantiationError;var O_e=new $;Nv.convertToReferenceFrame=function(e,t,n,i,r){if(!l(t))return t;if(l(r)||(r=new h),n===i)return h.clone(t,r);let o=mt.computeIcrfToCentralBodyFixedMatrix(e,O_e);if(n===Vi.INERTIAL)return $.multiplyByVector(o,t,r);if(n===Vi.FIXED)return $.multiplyByVector($.transpose(o,O_e),t,r)};var rp=Nv;function qb(e,t){this._definitionChanged=new be,this._value=h.clone(e),this._referenceFrame=t??Vi.FIXED}Object.defineProperties(qb.prototype,{isConstant:{get:function(){return!l(this._value)||this._referenceFrame===Vi.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var MQe=new K;qb.prototype.getValue=function(e,t){return l(e)||(e=K.now(MQe)),this.getValueInReferenceFrame(e,Vi.FIXED,t)};qb.prototype.setValue=function(e,t){let n=!1;h.equals(this._value,e)||(n=!0,this._value=h.clone(e)),l(t)&&this._referenceFrame!==t&&(n=!0,this._referenceFrame=t),n&&this._definitionChanged.raiseEvent(this)};qb.prototype.getValueInReferenceFrame=function(e,t,n){return rp.convertToReferenceFrame(e,this._value,this._referenceFrame,t,n)};qb.prototype.equals=function(e){return this===e||e instanceof qb&&h.equals(this._value,e._value)&&this._referenceFrame===e._referenceFrame};var _u=qb;function rD(e){this._definitionChanged=new be,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??H.EMPTY_OBJECT)}Object.defineProperties(rD.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),positions:me("positions"),width:me("width"),height:me("height"),heightReference:me("heightReference"),extrudedHeight:me("extrudedHeight"),extrudedHeightReference:me("extrudedHeightReference"),cornerType:me("cornerType"),granularity:me("granularity"),fill:me("fill"),material:oo("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition"),classificationType:me("classificationType"),zIndex:me("zIndex")});rD.prototype.clone=function(e){return l(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 rD(this)};rD.prototype.merge=function(e){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 Fv=rD;function LQe(e){return e}function NQe(e,t){return me(e,t,LQe)}var yu=NQe;function oD(e){this._definitionChanged=new be,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??H.EMPTY_OBJECT)}Object.defineProperties(oD.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),length:me("length"),topRadius:me("topRadius"),bottomRadius:me("bottomRadius"),heightReference:me("heightReference"),fill:me("fill"),material:oo("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),numberOfVerticalLines:me("numberOfVerticalLines"),slices:me("slices"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});oD.prototype.clone=function(e){return l(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 oD(this)};oD.prototype.merge=function(e){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 Bv=oD;function aD(e){this._definitionChanged=new be,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??H.EMPTY_OBJECT)}Object.defineProperties(aD.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),semiMajorAxis:me("semiMajorAxis"),semiMinorAxis:me("semiMinorAxis"),height:me("height"),heightReference:me("heightReference"),extrudedHeight:me("extrudedHeight"),extrudedHeightReference:me("extrudedHeightReference"),rotation:me("rotation"),stRotation:me("stRotation"),granularity:me("granularity"),fill:me("fill"),material:oo("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),numberOfVerticalLines:me("numberOfVerticalLines"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition"),classificationType:me("classificationType"),zIndex:me("zIndex")});aD.prototype.clone=function(e){return l(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 aD(this)};aD.prototype.merge=function(e){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 kv=aD;function sD(e){this._definitionChanged=new be,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??H.EMPTY_OBJECT)}Object.defineProperties(sD.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),radii:me("radii"),innerRadii:me("innerRadii"),minimumClock:me("minimumClock"),maximumClock:me("maximumClock"),minimumCone:me("minimumCone"),maximumCone:me("maximumCone"),heightReference:me("heightReference"),fill:me("fill"),material:oo("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),stackPartitions:me("stackPartitions"),slicePartitions:me("slicePartitions"),subdivisions:me("subdivisions"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});sD.prototype.clone=function(e){return l(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 sD(this)};sD.prototype.merge=function(e){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 zv=sD;function cD(e){this._definitionChanged=new be,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??H.EMPTY_OBJECT)}Object.defineProperties(cD.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),text:me("text"),font:me("font"),style:me("style"),scale:me("scale"),showBackground:me("showBackground"),backgroundColor:me("backgroundColor"),backgroundPadding:me("backgroundPadding"),pixelOffset:me("pixelOffset"),eyeOffset:me("eyeOffset"),horizontalOrigin:me("horizontalOrigin"),verticalOrigin:me("verticalOrigin"),heightReference:me("heightReference"),fillColor:me("fillColor"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),translucencyByDistance:me("translucencyByDistance"),pixelOffsetScaleByDistance:me("pixelOffsetScaleByDistance"),scaleByDistance:me("scaleByDistance"),distanceDisplayCondition:me("distanceDisplayCondition"),disableDepthTestDistance:me("disableDepthTestDistance")});cD.prototype.clone=function(e){return l(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 cD(this)};cD.prototype.merge=function(e){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 op=cD;var nJ=new Ib;function lD(e){e=e??H.EMPTY_OBJECT,this._definitionChanged=new be,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(lD.prototype,{isConstant:{get:function(){return X.isConstant(this._translation)&&X.isConstant(this._rotation)&&X.isConstant(this._scale)}},definitionChanged:{get:function(){return this._definitionChanged}},translation:me("translation"),rotation:me("rotation"),scale:me("scale")});var FQe=new K;lD.prototype.getValue=function(e,t){return l(e)||(e=K.now(FQe)),l(t)||(t=new Ib),t.translation=X.getValueOrClonedDefault(this._translation,e,nJ.translation,t.translation),t.rotation=X.getValueOrClonedDefault(this._rotation,e,nJ.rotation,t.rotation),t.scale=X.getValueOrClonedDefault(this._scale,e,nJ.scale,t.scale),t};lD.prototype.equals=function(e){return this===e||e instanceof lD&&X.equals(this._translation,e._translation)&&X.equals(this._rotation,e._rotation)&&X.equals(this._scale,e._scale)};var Uv=lD;function X0(e,t){this._propertyNames=[],this._definitionChanged=new be,l(e)&&this.merge(e,t)}Object.defineProperties(X0.prototype,{propertyNames:{get:function(){return this._propertyNames}},isConstant:{get:function(){let e=this._propertyNames;for(let t=0,n=e.length;t<n;t++)if(!X.isConstant(this[e[t]]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});X0.prototype.hasProperty=function(e){return this._propertyNames.indexOf(e)!==-1};function BQe(e){return new yi(e)}X0.prototype.addProperty=function(e,t,n){this._propertyNames.push(e),Object.defineProperty(this,e,me(e,!0,n??BQe)),l(t)&&(this[e]=t),this._definitionChanged.raiseEvent(this)};X0.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e],this._definitionChanged.raiseEvent(this)};var kQe=new K;X0.prototype.getValue=function(e,t){l(e)||(e=K.now(kQe)),l(t)||(t={});let n=this._propertyNames;for(let i=0,r=n.length;i<r;i++){let o=n[i];t[o]=X.getValueOrUndefined(this[o],e,t[o])}return t};X0.prototype.merge=function(e,t){let n=this._propertyNames,i=l(e._propertyNames)?e._propertyNames:Object.keys(e);for(let r=0,o=i.length;r<o;r++){let a=i[r],s=this[a],c=e[a];s===void 0&&n.indexOf(a)===-1&&this.addProperty(a,void 0,t),c!==void 0&&(s!==void 0?l(s)&&l(s.merge)&&s.merge(c):l(c)&&l(c.merge)&&l(c.clone)?this[a]=c.clone():this[a]=c)}};function zQe(e,t){let n=e._propertyNames,i=t._propertyNames,r=n.length;if(r!==i.length)return!1;for(let o=0;o<r;++o){let a=n[o];if(i.indexOf(a)===-1||!X.equals(e[a],t[a]))return!1}return!0}X0.prototype.equals=function(e){return this===e||e instanceof X0&&zQe(this,e)};var Au=X0;function M_e(e){return new Uv(e)}function UQe(e){return new Au(e,M_e)}function VQe(e){return new Au(e)}function jQe(e){return new Au(e)}function uD(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._hasVerticalExaggeration=void 0,this._hasVerticalExaggerationSubscription=void 0,this._enableVerticalExaggeration=void 0,this._enableVerticalExaggerationSubscription=void 0,this._minimumPixelSize=void 0,this._minimumPixelSizeSubscription=void 0,this._maximumScale=void 0,this._maximumScaleSubscription=void 0,this._incrementallyLoadTextures=void 0,this._incrementallyLoadTexturesSubscription=void 0,this._runAnimations=void 0,this._runAnimationsSubscription=void 0,this._clampAnimations=void 0,this._clampAnimationsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._silhouetteColor=void 0,this._silhouetteColorSubscription=void 0,this._silhouetteSize=void 0,this._silhouetteSizeSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._colorBlendMode=void 0,this._colorBlendModeSubscription=void 0,this._colorBlendAmount=void 0,this._colorBlendAmountSubscription=void 0,this._imageBasedLightingFactor=void 0,this._imageBasedLightingFactorSubscription=void 0,this._environmentMapOptions=void 0,this._environmentMapOptionsSubscription=void 0,this._lightColor=void 0,this._lightColorSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._nodeTransformations=void 0,this._nodeTransformationsSubscription=void 0,this._articulations=void 0,this._articulationsSubscription=void 0,this._clippingPlanes=void 0,this._clippingPlanesSubscription=void 0,this._customShader=void 0,this._customShaderSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(uD.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),uri:me("uri"),scale:me("scale"),enableVerticalExaggeration:me("enableVerticalExaggeration"),minimumPixelSize:me("minimumPixelSize"),maximumScale:me("maximumScale"),incrementallyLoadTextures:me("incrementallyLoadTextures"),runAnimations:me("runAnimations"),clampAnimations:me("clampAnimations"),shadows:me("shadows"),heightReference:me("heightReference"),silhouetteColor:me("silhouetteColor"),silhouetteSize:me("silhouetteSize"),color:me("color"),colorBlendMode:me("colorBlendMode"),colorBlendAmount:me("colorBlendAmount"),imageBasedLightingFactor:me("imageBasedLightingFactor"),environmentMapOptions:me("environmentMapOptions",void 0,jQe),lightColor:me("lightColor"),distanceDisplayCondition:me("distanceDisplayCondition"),nodeTransformations:me("nodeTransformations",void 0,UQe),articulations:me("articulations",void 0,VQe),clippingPlanes:me("clippingPlanes"),customShader:me("customShader")});uD.prototype.clone=function(e){return l(e)?(e.show=this.show,e.uri=this.uri,e.scale=this.scale,e.enableVerticalExaggeration=this.enableVerticalExaggeration,e.minimumPixelSize=this.minimumPixelSize,e.maximumScale=this.maximumScale,e.incrementallyLoadTextures=this.incrementallyLoadTextures,e.runAnimations=this.runAnimations,e.clampAnimations=this.clampAnimations,e.heightReference=this._heightReference,e.silhouetteColor=this.silhouetteColor,e.silhouetteSize=this.silhouetteSize,e.color=this.color,e.colorBlendMode=this.colorBlendMode,e.colorBlendAmount=this.colorBlendAmount,e.imageBasedLightingFactor=this.imageBasedLightingFactor,e.environmentMapOptions=this.environmentMapOptions,e.lightColor=this.lightColor,e.distanceDisplayCondition=this.distanceDisplayCondition,e.nodeTransformations=this.nodeTransformations,e.articulations=this.articulations,e.clippingPlanes=this.clippingPlanes,e.customShader=this.customShader,e):new uD(this)};uD.prototype.merge=function(e){this.show=this.show??e.show,this.uri=this.uri??e.uri,this.scale=this.scale??e.scale,this.enableVerticalExaggeration=this.enableVerticalExaggeration??e.enableVerticalExaggeration,this.minimumPixelSize=this.minimumPixelSize??e.minimumPixelSize,this.maximumScale=this.maximumScale??e.maximumScale,this.incrementallyLoadTextures=this.incrementallyLoadTextures??e.incrementallyLoadTextures,this.runAnimations=this.runAnimations??e.runAnimations,this.clampAnimations=this.clampAnimations??e.clampAnimations,this.shadows=this.shadows??e.shadows,this.heightReference=this.heightReference??e.heightReference,this.silhouetteColor=this.silhouetteColor??e.silhouetteColor,this.silhouetteSize=this.silhouetteSize??e.silhouetteSize,this.color=this.color??e.color,this.colorBlendMode=this.colorBlendMode??e.colorBlendMode,this.colorBlendAmount=this.colorBlendAmount??e.colorBlendAmount,this.imageBasedLightingFactor=this.imageBasedLightingFactor??e.imageBasedLightingFactor,this.environmentMapOptions=this.environmentMapOptions??e.environmentMapOptions,this.lightColor=this.lightColor??e.lightColor,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.clippingPlanes=this.clippingPlanes??e.clippingPlanes,this.customShader=this.customShader??e.customShader;let t=e.nodeTransformations;if(l(t)){let i=this.nodeTransformations;l(i)?i.merge(t):this.nodeTransformations=new Au(t,M_e)}let n=e.articulations;if(l(n)){let i=this.articulations;l(i)?i.merge(n):this.articulations=new Au(n)}};var dy=uD;function fD(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._maximumScreenSpaceError=void 0,this._maximumScreenSpaceErrorSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(fD.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),uri:me("uri"),maximumScreenSpaceError:me("maximumScreenSpaceError")});fD.prototype.clone=function(e){return l(e)?(e.show=this.show,e.uri=this.uri,e.maximumScreenSpaceError=this.maximumScreenSpaceError,e):new fD(this)};fD.prototype.merge=function(e){this.show=this.show??e.show,this.uri=this.uri??e.uri,this.maximumScreenSpaceError=this.maximumScreenSpaceError??e.maximumScreenSpaceError};var Vv=fD;function dD(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._leadTime=void 0,this._leadTimeSubscription=void 0,this._trailTime=void 0,this._trailTimeSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._resolution=void 0,this._resolutionSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._relativeTo=void 0,this._relativeToSubscription=void 0,this._materialMode=void 0,this._materialModeSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(dD.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),leadTime:me("leadTime"),trailTime:me("trailTime"),width:me("width"),resolution:me("resolution"),material:oo("material"),distanceDisplayCondition:me("distanceDisplayCondition"),relativeTo:me("relativeTo"),materialMode:me("materialMode")});dD.prototype.clone=function(e){return l(e)?(e.show=this.show,e.leadTime=this.leadTime,e.trailTime=this.trailTime,e.width=this.width,e.resolution=this.resolution,e.material=this.material,e.distanceDisplayCondition=this.distanceDisplayCondition,e.relativeTo=this.relativeTo,e.materialMode=this.materialMode,e):new dD(this)};dD.prototype.merge=function(e){this.show=this.show??e.show,this.leadTime=this.leadTime??e.leadTime,this.trailTime=this.trailTime??e.trailTime,this.width=this.width??e.width,this.resolution=this.resolution??e.resolution,this.material=this.material??e.material,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.relativeTo=this.relativeTo??e.relativeTo,this.materialMode=this.materialMode??e.materialMode};var hy=dD;function hD(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._plane=void 0,this._planeSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(hD.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),plane:me("plane"),dimensions:me("dimensions"),fill:me("fill"),material:oo("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});hD.prototype.clone=function(e){return l(e)?(e.show=this.show,e.plane=this.plane,e.dimensions=this.dimensions,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new hD(this)};hD.prototype.merge=function(e){this.show=this.show??e.show,this.plane=this.plane??e.plane,this.dimensions=this.dimensions??e.dimensions,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var V3=hD;function mD(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._pixelSize=void 0,this._pixelSizeSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this._splitDirection=void 0,this._splitDirectionSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(mD.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),pixelSize:me("pixelSize"),heightReference:me("heightReference"),color:me("color"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),scaleByDistance:me("scaleByDistance"),translucencyByDistance:me("translucencyByDistance"),distanceDisplayCondition:me("distanceDisplayCondition"),disableDepthTestDistance:me("disableDepthTestDistance"),splitDirection:me("splitDirection")});mD.prototype.clone=function(e){return l(e)?(e.show=this.show,e.pixelSize=this.pixelSize,e.heightReference=this.heightReference,e.color=this.color,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.scaleByDistance=this.scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.distanceDisplayCondition=this.distanceDisplayCondition,e.disableDepthTestDistance=this.disableDepthTestDistance,e.splitDirection=this.splitDirection,e):new mD(this)};mD.prototype.merge=function(e){this.show=this.show??e.show,this.pixelSize=this.pixelSize??e.pixelSize,this.heightReference=this.heightReference??e.heightReference,this.color=this.color??e.color,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.scaleByDistance=this.scaleByDistance??e.scaleByDistance,this.translucencyByDistance=this._translucencyByDistance??e.translucencyByDistance,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.disableDepthTestDistance=this.disableDepthTestDistance??e.disableDepthTestDistance,this.splitDirection=this.splitDirection??e.splitDirection};var jv=mD;function HQe(e){return Array.isArray(e)&&(e=new Vc(e)),new yi(e)}function pD(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._hierarchy=void 0,this._hierarchySubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._perPositionHeight=void 0,this._perPositionHeightSubscription=void 0,this._closeTop=void 0,this._closeTopSubscription=void 0,this._closeBottom=void 0,this._closeBottomSubscription=void 0,this._arcType=void 0,this._arcTypeSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this._textureCoordinates=void 0,this._textureCoordinatesSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(pD.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),hierarchy:me("hierarchy",void 0,HQe),height:me("height"),heightReference:me("heightReference"),extrudedHeight:me("extrudedHeight"),extrudedHeightReference:me("extrudedHeightReference"),stRotation:me("stRotation"),granularity:me("granularity"),fill:me("fill"),material:oo("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),perPositionHeight:me("perPositionHeight"),closeTop:me("closeTop"),closeBottom:me("closeBottom"),arcType:me("arcType"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition"),classificationType:me("classificationType"),zIndex:me("zIndex"),textureCoordinates:me("textureCoordinates")});pD.prototype.clone=function(e){return l(e)?(e.show=this.show,e.hierarchy=this.hierarchy,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.perPositionHeight=this.perPositionHeight,e.closeTop=this.closeTop,e.closeBottom=this.closeBottom,e.arcType=this.arcType,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e.textureCoordinates=this.textureCoordinates,e):new pD(this)};pD.prototype.merge=function(e){this.show=this.show??e.show,this.hierarchy=this.hierarchy??e.hierarchy,this.height=this.height??e.height,this.heightReference=this.heightReference??e.heightReference,this.extrudedHeight=this.extrudedHeight??e.extrudedHeight,this.extrudedHeightReference=this.extrudedHeightReference??e.extrudedHeightReference,this.stRotation=this.stRotation??e.stRotation,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.perPositionHeight=this.perPositionHeight??e.perPositionHeight,this.closeTop=this.closeTop??e.closeTop,this.closeBottom=this.closeBottom??e.closeBottom,this.arcType=this.arcType??e.arcType,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex,this.textureCoordinates=this.textureCoordinates??e.textureCoordinates};var ap=pD;function gD(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._depthFailMaterial=void 0,this._depthFailMaterialSubscription=void 0,this._arcType=void 0,this._arcTypeSubscription=void 0,this._clampToGround=void 0,this._clampToGroundSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(gD.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),positions:me("positions"),width:me("width"),granularity:me("granularity"),material:oo("material"),depthFailMaterial:oo("depthFailMaterial"),arcType:me("arcType"),clampToGround:me("clampToGround"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition"),classificationType:me("classificationType"),zIndex:me("zIndex")});gD.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.width=this.width,e.granularity=this.granularity,e.material=this.material,e.depthFailMaterial=this.depthFailMaterial,e.arcType=this.arcType,e.clampToGround=this.clampToGround,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new gD(this)};gD.prototype.merge=function(e){this.show=this.show??e.show,this.positions=this.positions??e.positions,this.width=this.width??e.width,this.granularity=this.granularity??e.granularity,this.material=this.material??e.material,this.depthFailMaterial=this.depthFailMaterial??e.depthFailMaterial,this.arcType=this.arcType??e.arcType,this.clampToGround=this.clampToGround??e.clampToGround,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex};var Dl=gD;function _D(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._shape=void 0,this._shapeSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubsription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(_D.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),positions:me("positions"),shape:me("shape"),cornerType:me("cornerType"),granularity:me("granularity"),fill:me("fill"),material:oo("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});_D.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.shape=this.shape,e.cornerType=this.cornerType,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new _D(this)};_D.prototype.merge=function(e){this.show=this.show??e.show,this.positions=this.positions??e.positions,this.shape=this.shape??e.shape,this.cornerType=this.cornerType??e.cornerType,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var Hv=_D;function yD(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._coordinates=void 0,this._coordinatesSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distancedisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(yD.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),coordinates:me("coordinates"),height:me("height"),heightReference:me("heightReference"),extrudedHeight:me("extrudedHeight"),extrudedHeightReference:me("extrudedHeightReference"),rotation:me("rotation"),stRotation:me("stRotation"),granularity:me("granularity"),fill:me("fill"),material:oo("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition"),classificationType:me("classificationType"),zIndex:me("zIndex")});yD.prototype.clone=function(e){return l(e)?(e.show=this.show,e.coordinates=this.coordinates,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.rotation=this.rotation,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new yD(this)};yD.prototype.merge=function(e){this.show=this.show??e.show,this.coordinates=this.coordinates??e.coordinates,this.height=this.height??e.height,this.heightReference=this.heightReference??e.heightReference,this.extrudedHeight=this.extrudedHeight??e.extrudedHeight,this.extrudedHeightReference=this.extrudedHeightReference??e.extrudedHeightReference,this.rotation=this.rotation??e.rotation,this.stRotation=this.stRotation??e.stRotation,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex};var sp=yD;function AD(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._minimumHeights=void 0,this._minimumHeightsSubscription=void 0,this._maximumHeights=void 0,this._maximumHeightsSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(AD.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),positions:me("positions"),minimumHeights:me("minimumHeights"),maximumHeights:me("maximumHeights"),granularity:me("granularity"),fill:me("fill"),material:oo("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});AD.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.minimumHeights=this.minimumHeights,e.maximumHeights=this.maximumHeights,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new AD(this)};AD.prototype.merge=function(e){this.show=this.show??e.show,this.positions=this.positions??e.positions,this.minimumHeights=this.minimumHeights??e.minimumHeights,this.maximumHeights=this.maximumHeights??e.maximumHeights,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var my=AD;var GQe=new de,iJ=[];function WQe(e){return new _u(e)}function qQe(e){return me(e,void 0,WQe)}function ws(e,t){return me(e,void 0,function(n){return n instanceof t?n:new t(n)})}function _d(e){e=e??H.EMPTY_OBJECT;let t=e.id;l(t)||(t=Kn()),this._availability=void 0,this._id=t,this._definitionChanged=new be,this._name=e.name,this._show=e.show??!0,this._trackingReferenceFrame=e.trackingReferenceFrame??$_.AUTODETECT,this._parent=void 0,this._propertyNames=["billboard","box","corridor","cylinder","description","ellipse","ellipsoid","label","model","tileset","orientation","path","plane","point","polygon","polyline","polylineVolume","position","properties","rectangle","viewFrom","wall",...iJ],this._billboard=void 0,this._billboardSubscription=void 0,this._box=void 0,this._boxSubscription=void 0,this._corridor=void 0,this._corridorSubscription=void 0,this._cylinder=void 0,this._cylinderSubscription=void 0,this._description=void 0,this._descriptionSubscription=void 0,this._ellipse=void 0,this._ellipseSubscription=void 0,this._ellipsoid=void 0,this._ellipsoidSubscription=void 0,this._label=void 0,this._labelSubscription=void 0,this._model=void 0,this._modelSubscription=void 0,this._tileset=void 0,this._tilesetSubscription=void 0,this._orientation=void 0,this._orientationSubscription=void 0,this._path=void 0,this._pathSubscription=void 0,this._plane=void 0,this._planeSubscription=void 0,this._point=void 0,this._pointSubscription=void 0,this._polygon=void 0,this._polygonSubscription=void 0,this._polyline=void 0,this._polylineSubscription=void 0,this._polylineVolume=void 0,this._polylineVolumeSubscription=void 0,this._position=void 0,this._positionSubscription=void 0,this._properties=void 0,this._propertiesSubscription=void 0,this._rectangle=void 0,this._rectangleSubscription=void 0,this._viewFrom=void 0,this._viewFromSubscription=void 0,this._wall=void 0,this._wallSubscription=void 0,this._children=[],this.entityCollection=void 0,this.parent=e.parent,this.merge(e)}function rJ(e,t,n){let i=t.length;for(let r=0;r<i;r++){let o=t[r],a=o._show;(!n&&a)!==(n&&a)&&rJ(o,o._children,n)}e._definitionChanged.raiseEvent(e,"isShowing",n,!n)}Object.defineProperties(_d.prototype,{availability:yu("availability"),id:{get:function(){return this._id}},definitionChanged:{get:function(){return this._definitionChanged}},name:yu("name"),show:{get:function(){return this._show},set:function(e){if(e===this._show)return;let t=this.isShowing;this._show=e;let n=this.isShowing;t!==n&&rJ(this,this._children,n),this._definitionChanged.raiseEvent(this,"show",e,!e)}},trackingReferenceFrame:yu("trackingReferenceFrame"),isShowing:{get:function(){return this._show&&(!l(this.entityCollection)||this.entityCollection.show)&&(!l(this._parent)||this._parent.isShowing)}},parent:{get:function(){return this._parent},set:function(e){let t=this._parent;if(t===e)return;let n=this.isShowing;if(l(t)){let r=t._children.indexOf(this);t._children.splice(r,1)}this._parent=e,l(e)&&e._children.push(this);let i=this.isShowing;n!==i&&rJ(this,this._children,i),this._definitionChanged.raiseEvent(this,"parent",e,t)}},propertyNames:{get:function(){return this._propertyNames}},billboard:ws("billboard",Pl),box:ws("box",Lv),corridor:ws("corridor",Fv),cylinder:ws("cylinder",Bv),description:me("description"),ellipse:ws("ellipse",kv),ellipsoid:ws("ellipsoid",zv),label:ws("label",op),model:ws("model",dy),tileset:ws("tileset",Vv),orientation:me("orientation"),path:ws("path",hy),plane:ws("plane",V3),point:ws("point",jv),polygon:ws("polygon",ap),polyline:ws("polyline",Dl),polylineVolume:ws("polylineVolume",Hv),properties:ws("properties",Au),position:qQe("position"),rectangle:ws("rectangle",sp),viewFrom:me("viewFrom"),wall:ws("wall",my)});_d.registerEntityType=function(e,t){Object.defineProperties(_d.prototype,{[e]:ws(e,t)}),iJ.includes(e)||iJ.push(e)};_d.prototype.isAvailable=function(e){let t=this._availability;return!l(t)||t.contains(e)};_d.prototype.addProperty=function(e){this._propertyNames.push(e),Object.defineProperty(this,e,yu(e,!0))};_d.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e]};_d.prototype.merge=function(e){this.name=this.name??e.name,this.availability=this.availability??e.availability;let t=this._propertyNames,n=l(e._propertyNames)?e._propertyNames:Object.keys(e),i=n.length;for(let r=0;r<i;r++){let o=n[r];if(o==="parent"||o==="name"||o==="availability"||o==="children")continue;let a=this[o],s=e[o];!l(a)&&t.indexOf(o)===-1&&this.addProperty(o),l(s)&&(l(a)?l(a.merge)&&a.merge(s):l(s.merge)&&l(s.clone)?this[o]=s.clone():this[o]=s)}};var L_e=new $,N_e=new h,F_e=new Fe;_d.prototype.computeModelMatrix=function(e,t){let n=X.getValueOrUndefined(this._position,e,N_e);if(!l(n))return;let i=X.getValueOrUndefined(this._orientation,e,F_e);return l(i)?t=O.fromRotationTranslation($.fromQuaternion(i,L_e),n,t):t=mt.eastNorthUpToFixedFrame(n,void 0,t),t};_d.prototype.computeModelMatrixForHeightReference=function(e,t,n,i,r){let o=X.getValueOrDefault(t,e,it.NONE),a=X.getValueOrUndefined(this._position,e,N_e);if(o===it.NONE||!l(a)||h.equalsEpsilon(a,h.ZERO,I.EPSILON8))return this.computeModelMatrix(e,r);let s=i.cartesianToCartographic(a,GQe);gu(o)?s.height=n:s.height+=n,a=i.cartographicToCartesian(s,a);let c=X.getValueOrUndefined(this._orientation,e,F_e);return l(c)?r=O.fromRotationTranslation($.fromQuaternion(c,L_e),a,r):r=mt.eastNorthUpToFixedFrame(a,void 0,r),r};_d.supportsMaterialsforEntitiesOnTerrain=function(e){return mu.supportsMaterials(e)};_d.supportsPolylinesOnTerrain=function(e){return tp.isSupported(e)};var $r=_d;var B_e={id:void 0};function bD(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 r=t.values.slice(0),o=n.values.slice(0),a=i.values.slice(0);t.removeAll(),n.removeAll(),i.removeAll(),e._collectionChanged.raiseEvent(e,r,o,a)}while(e._refire);e._firing=!1}}}function $c(e){this._owner=e,this._entities=new zt,this._addedEntities=new zt,this._removedEntities=new zt,this._changedEntities=new zt,this._suspendCount=0,this._collectionChanged=new be,this._id=Kn(),this._show=!0,this._firing=!1,this._refire=!1}$c.prototype.suspendEvents=function(){this._suspendCount++};$c.prototype.resumeEvents=function(){this._suspendCount--,bD(this)};Object.defineProperties($c.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(e===this._show)return;this.suspendEvents();let t,n=[],i=this._entities.values,r=i.length;for(t=0;t<r;t++)n.push(i[t].isShowing);for(this._show=e,t=0;t<r;t++){let o=n[t],a=i[t];o!==a.isShowing&&a.definitionChanged.raiseEvent(a,"isShowing",a.isShowing,o)}this.resumeEvents()}},owner:{get:function(){return this._owner}}});$c.prototype.computeAvailability=function(){let e=Qe.MAXIMUM_VALUE,t=Qe.MINIMUM_VALUE,n=this._entities.values;for(let i=0,r=n.length;i<r;i++){let a=n[i].availability;if(l(a)){let s=a.start,c=a.stop;K.lessThan(s,e)&&!s.equals(Qe.MINIMUM_VALUE)&&(e=s),K.greaterThan(c,t)&&!c.equals(Qe.MAXIMUM_VALUE)&&(t=c)}}return Qe.MAXIMUM_VALUE.equals(e)&&(e=Qe.MINIMUM_VALUE),Qe.MINIMUM_VALUE.equals(t)&&(t=Qe.MAXIMUM_VALUE),new Cn({start:e,stop:t})};$c.prototype.add=function(e){e instanceof $r||(e=new $r(e));let t=e.id,n=this._entities;if(n.contains(t))throw new pe(`An entity with id ${t} already exists in this collection.`);return e.entityCollection=this,n.set(t,e),this._removedEntities.remove(t)||this._addedEntities.set(t,e),e.definitionChanged.addEventListener($c.prototype._onEntityDefinitionChanged,this),bD(this),e};$c.prototype.remove=function(e){return l(e)?this.removeById(e.id):!1};$c.prototype.contains=function(e){return this._entities.get(e.id)===e};$c.prototype.removeById=function(e){if(!l(e))return!1;let n=this._entities.get(e);return this._entities.remove(e)?(this._addedEntities.remove(e)||(this._removedEntities.set(e,n),this._changedEntities.remove(e)),this._entities.remove(e),n.definitionChanged.removeEventListener($c.prototype._onEntityDefinitionChanged,this),bD(this),!0):!1};$c.prototype.removeAll=function(){let e=this._entities,t=e.length,n=e.values,i=this._addedEntities,r=this._removedEntities;for(let o=0;o<t;o++){let a=n[o],s=a.id,c=i.get(s);l(c)||(a.definitionChanged.removeEventListener($c.prototype._onEntityDefinitionChanged,this),r.set(s,a))}e.removeAll(),i.removeAll(),this._changedEntities.removeAll(),bD(this)};$c.prototype.getById=function(e){return this._entities.get(e)};$c.prototype.getOrCreateEntity=function(e){let t=this._entities.get(e);return l(t)||(B_e.id=e,t=new $r(B_e),this.add(t)),t};$c.prototype._onEntityDefinitionChanged=function(e){let t=e.id;this._addedEntities.contains(t)||this._changedEntities.set(t,e),bD(this)};var Qs=$c;function oJ(e){this._name=e,this._clock=void 0,this._changed=new be,this._error=new be,this._isLoading=!1,this._loading=new be,this._entityCollection=new Qs(this),this._entityCluster=new gd}Object.defineProperties(oJ.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){Ca.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){this._entityCluster=e}}});oJ.prototype.update=function(e){return!0};var j3=oJ;var H3=`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 G3=`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; // position in eye coordinates
|
|
v_normalEC = czm_normal * normal; // normal in eye coordinates
|
|
v_tangentEC = czm_normal * tangent; // tangent in eye coordinates
|
|
v_bitangentEC = czm_normal * bitangent; // bitangent in eye coordinates
|
|
v_st = st;
|
|
|
|
gl_Position = czm_modelViewProjectionRelativeToEye * p;
|
|
}
|
|
`;var W3=`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 q3=`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; // position in eye coordinates
|
|
v_normalEC = czm_normal * normal; // normal in eye coordinates
|
|
|
|
gl_Position = czm_modelViewProjectionRelativeToEye * p;
|
|
}
|
|
`;var Y3=`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 X3=`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; // position in eye coordinates
|
|
v_normalEC = czm_normal * normal; // normal in eye coordinates
|
|
v_st = st;
|
|
|
|
gl_Position = czm_modelViewProjectionRelativeToEye * p;
|
|
}
|
|
`;function Yb(e){e=e??H.EMPTY_OBJECT;let t=e.translucent??!0,n=e.closed??!1,i=e.materialSupport??Yb.MaterialSupport.TEXTURED;this.material=l(e.material)?e.material:ir.fromType(ir.ColorType),this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??i.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource??i.fragmentShaderSource,this._renderState=Sr.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(Yb.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}}});Yb.prototype.getFragmentShaderSource=Sr.prototype.getFragmentShaderSource;Yb.prototype.isTranslucent=Sr.prototype.isTranslucent;Yb.prototype.getRenderState=Sr.prototype.getRenderState;Yb.MaterialSupport={BASIC:Object.freeze({vertexFormat:Be.POSITION_AND_NORMAL,vertexShaderSource:q3,fragmentShaderSource:W3}),TEXTURED:Object.freeze({vertexFormat:Be.POSITION_NORMAL_AND_ST,vertexShaderSource:X3,fragmentShaderSource:Y3}),ALL:Object.freeze({vertexFormat:Be.ALL,vertexShaderSource:G3,fragmentShaderSource:H3})};var Ar=Yb;function Gv(e,t){this._primitives=e,this._orderedGroundPrimitives=t,this._dynamicUpdaters=new zt}Gv.prototype.add=function(e,t){this._dynamicUpdaters.set(t.id,t.createDynamicUpdater(this._primitives,this._orderedGroundPrimitives))};Gv.prototype.remove=function(e){let t=e.id,n=this._dynamicUpdaters.get(t);l(n)&&(this._dynamicUpdaters.remove(t),n.destroy())};Gv.prototype.update=function(e){let t=this._dynamicUpdaters.values;for(let n=0,i=t.length;n<i;n++)t[n].update(e);return!0};Gv.prototype.removeAllPrimitives=function(){let e=this._dynamicUpdaters.values;for(let t=0,n=e.length;t<n;t++)e[t].destroy();this._dynamicUpdaters.removeAll()};Gv.prototype.getBoundingSphere=function(e,t){return e=this._dynamicUpdaters.get(e.id),l(e)&&l(e.getBoundingSphere)?e.getBoundingSphere(t):It.FAILED};var Wv=Gv;function qv(){pe.throwInstantiationError()}Object.defineProperties(qv.prototype,{isConstant:{get:pe.throwInstantiationError},definitionChanged:{get:pe.throwInstantiationError}});qv.prototype.getType=pe.throwInstantiationError;qv.prototype.getValue=pe.throwInstantiationError;qv.prototype.equals=pe.throwInstantiationError;var YQe=new K;qv.getValue=function(e,t,n){let i;return l(e)||(e=K.now(YQe)),l(t)&&(i=t.getType(e),l(i))?((!l(n)||n.type!==i)&&(n=ir.fromType(i)),t.getValue(e,n.uniforms),n):((!l(n)||n.type!==ir.ColorType)&&(n=ir.fromType(ir.ColorType)),U.clone(U.WHITE,n.uniforms.color),n)};var xo=qv;function Xb(e,t,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}Xb.prototype._isHidden=function(e,t,n){return!e.isShowing||!e.isAvailable(n)||!X.getValueOrDefault(t.show,n,!0)};Xb.prototype._setOptions=pe.throwInstantiationError;Xb.prototype.update=function(e){let t=this._geometryUpdater,n=t._onTerrain,i=this._primitives,r=this._orderedGroundPrimitives;n?r.remove(this._primitive):(i.removeAndDestroy(this._primitive),i.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;let o=this._entity,a=o[this._geometryUpdater._geometryPropertyName];if(this._setOptions(o,a,e),this._isHidden(o,a,e))return;let s=this._geometryUpdater.shadowsProperty.getValue(e),c=this._options;if(!l(a.fill)||a.fill.getValue(e)){let u=t.fillMaterialProperty,f=u instanceof Yt,d,p=t._getIsClosed(c);if(f)d=new _n({closed:p,flat:n&&!t._supportsMaterialsforEntitiesOnTerrain});else{let g=xo.getValue(e,u,this._material);this._material=g,d=new Ar({material:g,translucent:g.isTranslucent(),closed:p})}if(n)c.vertexFormat=_n.VERTEX_FORMAT,this._primitive=r.add(new mu({geometryInstances:this._geometryUpdater.createFillGeometryInstance(e),appearance:d,asynchronous:!1,shadows:s,classificationType:this._geometryUpdater.classificationTypeProperty.getValue(e)}),X.getValueOrUndefined(this._geometryUpdater.zIndex,e));else{c.vertexFormat=d.vertexFormat;let g=this._geometryUpdater.createFillGeometryInstance(e);f&&(d.translucent=g.attributes.color.value[3]!==255),this._primitive=i.add(new Fn({geometryInstances:g,appearance:d,asynchronous:!1,shadows:s}))}}if(!n&&l(a.outline)&&a.outline.getValue(e)){let u=this._geometryUpdater.createOutlineGeometryInstance(e),f=X.getValueOrDefault(a.outlineWidth,e,1);this._outlinePrimitive=i.add(new Fn({geometryInstances:u,appearance:new _n({flat:!0,translucent:u.attributes.color.value[3]!==255,renderState:{lineWidth:t._scene.clampLineWidth(f)}}),asynchronous:!1,shadows:s}))}};Xb.prototype.getBoundingSphere=function(e){let t=this._entity,n=this._primitive,i=this._outlinePrimitive,r;return l(n)&&n.show&&n.ready&&(r=n.getGeometryInstanceAttributes(t),l(r)&&l(r.boundingSphere))?(se.clone(r.boundingSphere,e),It.DONE):l(i)&&i.show&&i.ready&&(r=i.getGeometryInstanceAttributes(t),l(r)&&l(r.boundingSphere))?(se.clone(r.boundingSphere,e),It.DONE):l(n)&&!n.ready||l(i)&&!i.ready?It.PENDING:It.FAILED};Xb.prototype.isDestroyed=function(){return!1};Xb.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),ue(this)};var wi=Xb;var XQe=new Yt(U.WHITE),KQe=new yi(!0),$Qe=new yi(!0),JQe=new yi(!1),ZQe=new yi(U.BLACK),QQe=new yi(Rn.DISABLED),eet=new yi(new jt),tet=new yi(Zn.BOTH);function Rl(e){let t=e.entity,n=e.geometryPropertyName;this._entity=t,this._scene=e.scene,this._fillEnabled=!1,this._isClosed=!1,this._onTerrain=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new be,this._showProperty=void 0,this._materialProperty=void 0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._classificationTypeProperty=void 0,this._options=e.geometryOptions,this._geometryPropertyName=n,this._id=`${n}-${t.id}`,this._observedPropertyNames=e.observedPropertyNames,this._supportsMaterialsforEntitiesOnTerrain=$r.supportsMaterialsforEntitiesOnTerrain(e.scene)}Object.defineProperties(Rl.prototype,{id:{get:function(){return this._id}},entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!l(this._entity.availability)&&X.isConstant(this._showProperty)&&X.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!l(this._entity.availability)&&X.isConstant(this._showProperty)&&X.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},classificationTypeProperty:{get:function(){return this._classificationTypeProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},onTerrain:{get:function(){return this._onTerrain}},geometryChanged:{get:function(){return this._geometryChanged}}});Rl.prototype.isOutlineVisible=function(e){let t=this._entity;return(this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e))??!1};Rl.prototype.isFilled=function(e){let t=this._entity;return(this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e))??!1};Rl.prototype.createFillGeometryInstance=pe.throwInstantiationError;Rl.prototype.createOutlineGeometryInstance=pe.throwInstantiationError;Rl.prototype.isDestroyed=function(){return!1};Rl.prototype.destroy=function(){ue(this)};Rl.prototype._isHidden=function(e,t){let n=t.show;return l(n)&&n.isConstant&&!n.getValue(Qe.MINIMUM_VALUE)};Rl.prototype._isOnTerrain=function(e,t){return!1};Rl.prototype._getIsClosed=function(e){return!0};Rl.prototype._isDynamic=pe.throwInstantiationError;Rl.prototype._setStaticOptions=pe.throwInstantiationError;Rl.prototype._onEntityPropertyChanged=function(e,t,n,i){if(this._observedPropertyNames.indexOf(t)===-1)return;let r=this._entity[this._geometryPropertyName];if(!l(r)){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}let o=r.fill,a=l(o)&&o.isConstant?o.getValue(Qe.MINIMUM_VALUE):!0,s=r.outline,c=l(s);if(c&&s.isConstant&&(c=s.getValue(Qe.MINIMUM_VALUE)),!a&&!c){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}let u=r.show;if(this._isHidden(e,r)){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}this._materialProperty=r.material??XQe,this._fillProperty=o??$Qe,this._showProperty=u??KQe,this._showOutlineProperty=r.outline??JQe,this._outlineColorProperty=c?r.outlineColor??ZQe:void 0,this._shadowsProperty=r.shadows??QQe,this._distanceDisplayConditionProperty=r.distanceDisplayCondition??eet,this._classificationTypeProperty=r.classificationType??tet,this._fillEnabled=a;let f=this._isOnTerrain(e,r)&&(this._supportsMaterialsforEntitiesOnTerrain||this._materialProperty instanceof Yt);if(c&&f&&(pt(pt.geometryOutlines),c=!1),this._onTerrain=f,this._outlineEnabled=c,this._isDynamic(e,r))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{this._setStaticOptions(e,r),this._isClosed=this._getIsClosed(this._options);let d=r.outlineWidth;this._outlineWidth=l(d)?d.getValue(Qe.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};Rl.prototype.createDynamicUpdater=function(e,t){return new this.constructor.DynamicGeometryUpdater(this,e,t)};var Ii=Rl;function Yv(e,t){this._callback=void 0,this._isConstant=void 0,this._definitionChanged=new be,this.setCallback(e,t)}Object.defineProperties(Yv.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}}});var net=new K;Yv.prototype.getValue=function(e,t){return l(e)||(e=K.now(net)),this._callback(e,t)};Yv.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};Yv.prototype.equals=function(e){return this===e||e instanceof Yv&&this._callback===e._callback&&this._isConstant===e._isConstant};var cp=Yv;var k_e=new h;function Xv(e,t,n,i){this._scene=e,this._heightReference=n,this._extrudedHeightReference=i,this._positionProperty=t,this._position=new h,this._cartographicPosition=new de,this._normal=new h,this._definitionChanged=new be,this._terrainHeight=0,this._removeCallbackFunc=void 0,this._removeEventListener=void 0,this._removeModeListener=void 0;let r=this;if(l(e.globe)&&(this._removeEventListener=e.terrainProviderChanged.addEventListener(function(){r._updateClamping()}),this._removeModeListener=e.morphComplete.addEventListener(function(){r._updateClamping()})),t.isConstant){let o=t.getValue(Qe.MINIMUM_VALUE,k_e);if(!l(o)||h.equals(o,h.ZERO)||!l(e.globe))return;this._position=h.clone(o,this._position),this._updateClamping(),this._normal=e.ellipsoid.geodeticSurfaceNormal(o,this._normal)}}Object.defineProperties(Xv.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}});Xv.prototype._updateClamping=function(){l(this._removeCallbackFunc)&&this._removeCallbackFunc();let e=this._scene,t=this._position;if(h.equals(t,h.ZERO)){this._terrainHeight=0;return}let i=e.ellipsoid.cartesianToCartographic(t,this._cartographicPosition),r=e.getHeight(i,this._heightReference);l(r)?this._terrainHeight=r:this._terrainHeight=0;let o=a=>{this._terrainHeight=a.height,this.definitionChanged.raiseEvent()};this._removeCallbackFunc=e.updateHeight(i,o,this._heightReference)};var iet=new K;Xv.prototype.getValue=function(e,t){l(e)||(e=K.now(iet));let n=X.getValueOrDefault(this._heightReference,e,it.NONE),i=X.getValueOrDefault(this._extrudedHeightReference,e,it.NONE);if(n===it.NONE&&!Rv(i))return this._position=h.clone(h.ZERO,this._position),h.clone(h.ZERO,t);if(this._positionProperty.isConstant)return h.multiplyByScalar(this._normal,this._terrainHeight,t);let r=this._scene,o=this._positionProperty.getValue(e,k_e);if(!l(o)||h.equals(o,h.ZERO)||!l(r.globe))return h.clone(h.ZERO,t);if(h.equalsEpsilon(this._position,o,I.EPSILON10))return h.multiplyByScalar(this._normal,this._terrainHeight,t);this._position=h.clone(o,this._position),this._updateClamping();let a=r.ellipsoid.geodeticSurfaceNormal(o,this._normal);return h.multiplyByScalar(a,this._terrainHeight,t)};Xv.prototype.isDestroyed=function(){return!1};Xv.prototype.destroy=function(){return l(this._removeEventListener)&&this._removeEventListener(),l(this._removeModeListener)&&this._removeModeListener(),l(this._removeCallbackFunc)&&this._removeCallbackFunc(),ue(this)};var Kv=Xv;function ret(e,t,n,i){if(Ii.prototype._onEntityPropertyChanged.call(this,e,t,n,i),this._observedPropertyNames.indexOf(t)===-1)return;let r=this._entity[this._geometryPropertyName];if(!l(r))return;l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let o=r.heightReference;if(l(o)){let a=new cp(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new Kv(this._scene,a,o)}}var py=ret;var z_e=h.ZERO,U_e=new h,oet=new h,V_e=new U;function aet(e){this.id=e,this.vertexFormat=void 0,this.dimensions=void 0,this.offsetAttribute=void 0}function nf(e,t){Ii.call(this,{entity:e,scene:t,geometryOptions:new aet(e),geometryPropertyName:"box",observedPropertyNames:["availability","position","orientation","box"]}),this._onEntityPropertyChanged(e,"box",e.box,void 0)}l(Object.create)&&(nf.prototype=Object.create(Ii.prototype),nf.prototype.constructor=nf);Object.defineProperties(nf.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});nf.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),r=this._distanceDisplayConditionProperty.getValue(e),o=Jn.fromDistanceDisplayCondition(r),a={show:i,distanceDisplayCondition:o,color:void 0,offset:void 0};if(this._materialProperty instanceof Yt){let s;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(s=this._materialProperty.color.getValue(e,V_e)),l(s)||(s=U.WHITE),a.color=Kt.fromColor(s)}return l(this._options.offsetAttribute)&&(a.offset=yr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,z_e,U_e))),new Bt({id:t,geometry:Nc.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:a})};nf.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,V_e),r=this._distanceDisplayConditionProperty.getValue(e),o={show:new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Kt.fromColor(i),distanceDisplayCondition:Jn.fromDistanceDisplayCondition(r),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=yr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,z_e,U_e))),new Bt({id:t,geometry:Pm.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:o})};nf.prototype._computeCenter=function(e,t){return X.getValueOrUndefined(this._entity.position,e,t)};nf.prototype._isHidden=function(e,t){return!l(t.dimensions)||!l(e.position)||Ii.prototype._isHidden.call(this,e,t)};nf.prototype._isDynamic=function(e,t){return!e.position.isConstant||!X.isConstant(e.orientation)||!t.dimensions.isConstant||!X.isConstant(t.outlineWidth)};nf.prototype._setStaticOptions=function(e,t){let n=X.getValueOrDefault(t.heightReference,Qe.MINIMUM_VALUE,it.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Yt?_n.VERTEX_FORMAT:Ar.MaterialSupport.TEXTURED.vertexFormat,i.dimensions=t.dimensions.getValue(Qe.MINIMUM_VALUE,i.dimensions),i.offsetAttribute=n!==it.NONE?mn.ALL:void 0};nf.prototype._onEntityPropertyChanged=py;nf.DynamicGeometryUpdater=$v;function $v(e,t,n){wi.call(this,e,t,n)}l(Object.create)&&($v.prototype=Object.create(wi.prototype),$v.prototype.constructor=$v);$v.prototype._isHidden=function(e,t,n){let i=X.getValueOrUndefined(e.position,n,oet),r=this._options.dimensions;return!l(i)||!l(r)||wi.prototype._isHidden.call(this,e,t,n)};$v.prototype._setOptions=function(e,t,n){let i=X.getValueOrDefault(t.heightReference,n,it.NONE),r=this._options;r.dimensions=X.getValueOrUndefined(t.dimensions,n,r.dimensions),r.offsetAttribute=i!==it.NONE?mn.ALL:void 0};var K3=nf;var set=new yi(0);function Ol(e){Ii.call(this,e),this._zIndex=0,this._terrainOffsetProperty=void 0}l(Object.create)&&(Ol.prototype=Object.create(Ii.prototype),Ol.prototype.constructor=Ol);Object.defineProperties(Ol.prototype,{zIndex:{get:function(){return this._zIndex}},terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Ol.prototype._isOnTerrain=function(e,t){return this._fillEnabled&&!l(t.height)&&!l(t.extrudedHeight)&&mu.isSupported(this._scene)};Ol.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight;return t===0||l(n)&&n!==t};Ol.prototype._computeCenter=pe.throwInstantiationError;Ol.prototype._onEntityPropertyChanged=function(e,t,n,i){if(Ii.prototype._onEntityPropertyChanged.call(this,e,t,n,i),this._observedPropertyNames.indexOf(t)===-1)return;let r=this._entity[this._geometryPropertyName];if(!l(r))return;l(r.zIndex)&&(l(r.height)||l(r.extrudedHeight))&&pt(pt.geometryZIndex),this._zIndex=r.zIndex??set,l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let o=r.heightReference,a=r.extrudedHeightReference;if(l(o)||l(a)){let s=new cp(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new Kv(this._scene,s,o,a)}};Ol.prototype.destroy=function(){l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0),Ii.prototype.destroy.call(this)};Ol.getGeometryHeight=function(e,t){if(!l(e)){t!==it.NONE&&pt(pt.geometryHeightReference);return}return gu(t)?0:e};Ol.getGeometryExtrudedHeight=function(e,t){if(!l(e)){t!==it.NONE&&pt(pt.geometryExtrudedHeightReference);return}return gu(t)?Ol.CLAMP_TO_GROUND:e};Ol.CLAMP_TO_GROUND="clamp";Ol.computeGeometryOffsetAttribute=function(e,t,n,i){(!l(e)||!l(t))&&(t=it.NONE),(!l(n)||!l(i))&&(i=it.NONE);let r=0;if(t!==it.NONE&&r++,i===it.RELATIVE_TO_GROUND&&r++,r===2)return mn.ALL;if(r===1)return mn.TOP};var ii=Ol;var j_e=new U,H_e=h.ZERO,G_e=new h,W_e=new ie;function cet(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.cornerType=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.offsetAttribute=void 0}function Eh(e,t){ii.call(this,{entity:e,scene:t,geometryOptions:new cet(e),geometryPropertyName:"corridor",observedPropertyNames:["availability","corridor"]}),this._onEntityPropertyChanged(e,"corridor",e.corridor,void 0)}l(Object.create)&&(Eh.prototype=Object.create(ii.prototype),Eh.prototype.constructor=Eh);Eh.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Jn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Yt){let r;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(r=this._materialProperty.color.getValue(e,j_e)),l(r)||(r=U.WHITE),i.color=Kt.fromColor(r)}return l(this._options.offsetAttribute)&&(i.offset=yr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,H_e,G_e))),new Bt({id:t,geometry:new OC(this._options),attributes:i})};Eh.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,j_e),r={show:new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Kt.fromColor(i),distanceDisplayCondition:Jn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=yr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,H_e,G_e))),new Bt({id:t,geometry:new AN(this._options),attributes:r})};Eh.prototype._computeCenter=function(e,t){let n=X.getValueOrUndefined(this._entity.corridor.positions,e);if(!(!l(n)||n.length===0))return h.clone(n[Math.floor(n.length/2)],t)};Eh.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.width)||Ii.prototype._isHidden.call(this,e,t)};Eh.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!X.isConstant(t.height)||!X.isConstant(t.extrudedHeight)||!X.isConstant(t.granularity)||!X.isConstant(t.width)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.cornerType)||!X.isConstant(t.zIndex)||this._onTerrain&&!X.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Yt)};Eh.prototype._setStaticOptions=function(e,t){let n=X.getValueOrUndefined(t.height,Qe.MINIMUM_VALUE),i=X.getValueOrDefault(t.heightReference,Qe.MINIMUM_VALUE,it.NONE),r=X.getValueOrUndefined(t.extrudedHeight,Qe.MINIMUM_VALUE),o=X.getValueOrDefault(t.extrudedHeightReference,Qe.MINIMUM_VALUE,it.NONE);l(r)&&!l(n)&&(n=0);let a=this._options;a.vertexFormat=this._materialProperty instanceof Yt?_n.VERTEX_FORMAT:Ar.MaterialSupport.TEXTURED.vertexFormat,a.positions=t.positions.getValue(Qe.MINIMUM_VALUE,a.positions),a.width=t.width.getValue(Qe.MINIMUM_VALUE),a.granularity=X.getValueOrUndefined(t.granularity,Qe.MINIMUM_VALUE),a.cornerType=X.getValueOrUndefined(t.cornerType,Qe.MINIMUM_VALUE),a.offsetAttribute=ii.computeGeometryOffsetAttribute(n,i,r,o),a.height=ii.getGeometryHeight(n,i),r=ii.getGeometryExtrudedHeight(r,o),r===ii.CLAMP_TO_GROUND&&(r=Oi.getMinimumMaximumHeights(OC.computeRectangle(a,W_e)).minimumTerrainHeight),a.extrudedHeight=r};Eh.DynamicGeometryUpdater=Jv;function Jv(e,t,n){wi.call(this,e,t,n)}l(Object.create)&&(Jv.prototype=Object.create(wi.prototype),Jv.prototype.constructor=Jv);Jv.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.positions)||!l(i.width)||wi.prototype._isHidden.call(this,e,t,n)};Jv.prototype._setOptions=function(e,t,n){let i=this._options,r=X.getValueOrUndefined(t.height,n),o=X.getValueOrDefault(t.heightReference,n,it.NONE),a=X.getValueOrUndefined(t.extrudedHeight,n),s=X.getValueOrDefault(t.extrudedHeightReference,n,it.NONE);l(a)&&!l(r)&&(r=0),i.positions=X.getValueOrUndefined(t.positions,n),i.width=X.getValueOrUndefined(t.width,n),i.granularity=X.getValueOrUndefined(t.granularity,n),i.cornerType=X.getValueOrUndefined(t.cornerType,n),i.offsetAttribute=ii.computeGeometryOffsetAttribute(r,o,a,s),i.height=ii.getGeometryHeight(r,o),a=ii.getGeometryExtrudedHeight(a,s),a===ii.CLAMP_TO_GROUND&&(a=Oi.getMinimumMaximumHeights(OC.computeRectangle(i,W_e)).minimumTerrainHeight),i.extrudedHeight=a};var $3=Eh;var q_e=h.ZERO,Y_e=new h,uet=new h,X_e=new U;function fet(e){this.id=e,this.vertexFormat=void 0,this.length=void 0,this.topRadius=void 0,this.bottomRadius=void 0,this.slices=void 0,this.numberOfVerticalLines=void 0,this.offsetAttribute=void 0}function rf(e,t){Ii.call(this,{entity:e,scene:t,geometryOptions:new fet(e),geometryPropertyName:"cylinder",observedPropertyNames:["availability","position","orientation","cylinder"]}),this._onEntityPropertyChanged(e,"cylinder",e.cylinder,void 0)}l(Object.create)&&(rf.prototype=Object.create(Ii.prototype),rf.prototype.constructor=rf);Object.defineProperties(rf.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});rf.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),r=this._distanceDisplayConditionProperty.getValue(e),o=Jn.fromDistanceDisplayCondition(r),a={show:i,distanceDisplayCondition:o,color:void 0,offset:void 0};if(this._materialProperty instanceof Yt){let s;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(s=this._materialProperty.color.getValue(e,X_e)),l(s)||(s=U.WHITE),a.color=Kt.fromColor(s)}return l(this._options.offsetAttribute)&&(a.offset=yr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,q_e,Y_e))),new Bt({id:t,geometry:new bN(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:a})};rf.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,X_e),r=this._distanceDisplayConditionProperty.getValue(e),o={show:new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Kt.fromColor(i),distanceDisplayCondition:Jn.fromDistanceDisplayCondition(r),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=yr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,q_e,Y_e))),new Bt({id:t,geometry:new xN(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:o})};rf.prototype._computeCenter=function(e,t){return X.getValueOrUndefined(this._entity.position,e,t)};rf.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.length)||!l(t.topRadius)||!l(t.bottomRadius)||Ii.prototype._isHidden.call(this,e,t)};rf.prototype._isDynamic=function(e,t){return!e.position.isConstant||!X.isConstant(e.orientation)||!t.length.isConstant||!t.topRadius.isConstant||!t.bottomRadius.isConstant||!X.isConstant(t.slices)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.numberOfVerticalLines)};rf.prototype._setStaticOptions=function(e,t){let n=X.getValueOrDefault(t.heightReference,Qe.MINIMUM_VALUE,it.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Yt?_n.VERTEX_FORMAT:Ar.MaterialSupport.TEXTURED.vertexFormat,i.length=t.length.getValue(Qe.MINIMUM_VALUE),i.topRadius=t.topRadius.getValue(Qe.MINIMUM_VALUE),i.bottomRadius=t.bottomRadius.getValue(Qe.MINIMUM_VALUE),i.slices=X.getValueOrUndefined(t.slices,Qe.MINIMUM_VALUE),i.numberOfVerticalLines=X.getValueOrUndefined(t.numberOfVerticalLines,Qe.MINIMUM_VALUE),i.offsetAttribute=n!==it.NONE?mn.ALL:void 0};rf.prototype._onEntityPropertyChanged=py;rf.DynamicGeometryUpdater=Zv;function Zv(e,t,n){wi.call(this,e,t,n)}l(Object.create)&&(Zv.prototype=Object.create(wi.prototype),Zv.prototype.constructor=Zv);Zv.prototype._isHidden=function(e,t,n){let i=this._options,r=X.getValueOrUndefined(e.position,n,uet);return!l(r)||!l(i.length)||!l(i.topRadius)||!l(i.bottomRadius)||wi.prototype._isHidden.call(this,e,t,n)};Zv.prototype._setOptions=function(e,t,n){let i=X.getValueOrDefault(t.heightReference,n,it.NONE),r=this._options;r.length=X.getValueOrUndefined(t.length,n),r.topRadius=X.getValueOrUndefined(t.topRadius,n),r.bottomRadius=X.getValueOrUndefined(t.bottomRadius,n),r.slices=X.getValueOrUndefined(t.slices,n),r.numberOfVerticalLines=X.getValueOrUndefined(t.numberOfVerticalLines,n),r.offsetAttribute=i!==it.NONE?mn.ALL:void 0};var J3=rf;var K_e=new U,$_e=h.ZERO,J_e=new h,Z_e=new ie;function det(e){this.id=e,this.vertexFormat=void 0,this.center=void 0,this.semiMajorAxis=void 0,this.semiMinorAxis=void 0,this.rotation=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.numberOfVerticalLines=void 0,this.offsetAttribute=void 0}function Sh(e,t){ii.call(this,{entity:e,scene:t,geometryOptions:new det(e),geometryPropertyName:"ellipse",observedPropertyNames:["availability","position","ellipse"]}),this._onEntityPropertyChanged(e,"ellipse",e.ellipse,void 0)}l(Object.create)&&(Sh.prototype=Object.create(ii.prototype),Sh.prototype.constructor=Sh);Sh.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Jn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Yt){let r;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(r=this._materialProperty.color.getValue(e,K_e)),l(r)||(r=U.WHITE),i.color=Kt.fromColor(r)}return l(this._options.offsetAttribute)&&(i.offset=yr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,$_e,J_e))),new Bt({id:t,geometry:new eu(this._options),attributes:i})};Sh.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,K_e),r=this._distanceDisplayConditionProperty.getValue(e),o={show:new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Kt.fromColor(i),distanceDisplayCondition:Jn.fromDistanceDisplayCondition(r),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=yr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,$_e,J_e))),new Bt({id:t,geometry:new Xf(this._options),attributes:o})};Sh.prototype._computeCenter=function(e,t){return X.getValueOrUndefined(this._entity.position,e,t)};Sh.prototype._isHidden=function(e,t){let n=e.position;return!l(n)||!l(t.semiMajorAxis)||!l(t.semiMinorAxis)||Ii.prototype._isHidden.call(this,e,t)};Sh.prototype._isDynamic=function(e,t){return!e.position.isConstant||!t.semiMajorAxis.isConstant||!t.semiMinorAxis.isConstant||!X.isConstant(t.rotation)||!X.isConstant(t.height)||!X.isConstant(t.extrudedHeight)||!X.isConstant(t.granularity)||!X.isConstant(t.stRotation)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.numberOfVerticalLines)||!X.isConstant(t.zIndex)||this._onTerrain&&!X.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Yt)};Sh.prototype._setStaticOptions=function(e,t){let n=X.getValueOrUndefined(t.height,Qe.MINIMUM_VALUE),i=X.getValueOrDefault(t.heightReference,Qe.MINIMUM_VALUE,it.NONE),r=X.getValueOrUndefined(t.extrudedHeight,Qe.MINIMUM_VALUE),o=X.getValueOrDefault(t.extrudedHeightReference,Qe.MINIMUM_VALUE,it.NONE);l(r)&&!l(n)&&(n=0);let a=this._options;a.vertexFormat=this._materialProperty instanceof Yt?_n.VERTEX_FORMAT:Ar.MaterialSupport.TEXTURED.vertexFormat,a.center=e.position.getValue(Qe.MINIMUM_VALUE,a.center),a.semiMajorAxis=t.semiMajorAxis.getValue(Qe.MINIMUM_VALUE,a.semiMajorAxis),a.semiMinorAxis=t.semiMinorAxis.getValue(Qe.MINIMUM_VALUE,a.semiMinorAxis),a.rotation=X.getValueOrUndefined(t.rotation,Qe.MINIMUM_VALUE),a.granularity=X.getValueOrUndefined(t.granularity,Qe.MINIMUM_VALUE),a.stRotation=X.getValueOrUndefined(t.stRotation,Qe.MINIMUM_VALUE),a.numberOfVerticalLines=X.getValueOrUndefined(t.numberOfVerticalLines,Qe.MINIMUM_VALUE),a.offsetAttribute=ii.computeGeometryOffsetAttribute(n,i,r,o),a.height=ii.getGeometryHeight(n,i),r=ii.getGeometryExtrudedHeight(r,o),r===ii.CLAMP_TO_GROUND&&(r=Oi.getMinimumMaximumHeights(eu.computeRectangle(a,Z_e)).minimumTerrainHeight),a.extrudedHeight=r};Sh.DynamicGeometryUpdater=Qv;function Qv(e,t,n){wi.call(this,e,t,n)}l(Object.create)&&(Qv.prototype=Object.create(wi.prototype),Qv.prototype.constructor=Qv);Qv.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.center)||!l(i.semiMajorAxis)||!l(i.semiMinorAxis)||wi.prototype._isHidden.call(this,e,t,n)};Qv.prototype._setOptions=function(e,t,n){let i=this._options,r=X.getValueOrUndefined(t.height,n),o=X.getValueOrDefault(t.heightReference,n,it.NONE),a=X.getValueOrUndefined(t.extrudedHeight,n),s=X.getValueOrDefault(t.extrudedHeightReference,n,it.NONE);l(a)&&!l(r)&&(r=0),i.center=X.getValueOrUndefined(e.position,n,i.center),i.semiMajorAxis=X.getValueOrUndefined(t.semiMajorAxis,n),i.semiMinorAxis=X.getValueOrUndefined(t.semiMinorAxis,n),i.rotation=X.getValueOrUndefined(t.rotation,n),i.granularity=X.getValueOrUndefined(t.granularity,n),i.stRotation=X.getValueOrUndefined(t.stRotation,n),i.numberOfVerticalLines=X.getValueOrUndefined(t.numberOfVerticalLines,n),i.offsetAttribute=ii.computeGeometryOffsetAttribute(r,o,a,s),i.height=ii.getGeometryHeight(r,o),a=ii.getGeometryExtrudedHeight(a,s),a===ii.CLAMP_TO_GROUND&&(a=Oi.getMinimumMaximumHeights(eu.computeRectangle(i,Z_e)).minimumTerrainHeight),i.extrudedHeight=a};var Z3=Sh;var het=new Yt(U.WHITE),aJ=h.ZERO,sJ=new h,met=new h,pet=new h,cJ=new U,get=new h(1,1,1);function _et(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 of(e,t){Ii.call(this,{entity:e,scene:t,geometryOptions:new _et(e),geometryPropertyName:"ellipsoid",observedPropertyNames:["availability","position","orientation","ellipsoid"]}),this._onEntityPropertyChanged(e,"ellipsoid",e.ellipsoid,void 0)}l(Object.create)&&(of.prototype=Object.create(Ii.prototype),of.prototype.constructor=of);Object.defineProperties(of.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});of.prototype.createFillGeometryInstance=function(e,t,n){let i=this._entity,r=i.isAvailable(e),o,a=new Dn(r&&i.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),c=Jn.fromDistanceDisplayCondition(s),u={show:a,distanceDisplayCondition:c,color:void 0,offset:void 0};if(this._materialProperty instanceof Yt){let f;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||r)&&(f=this._materialProperty.color.getValue(e,cJ)),l(f)||(f=U.WHITE),o=Kt.fromColor(f),u.color=o}return l(this._options.offsetAttribute)&&(u.offset=yr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,aJ,sJ))),new Bt({id:i,geometry:new Ks(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:u})};of.prototype.createOutlineGeometryInstance=function(e,t,n){let i=this._entity,r=i.isAvailable(e),o=X.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,cJ),a=this._distanceDisplayConditionProperty.getValue(e),s={show:new Dn(r&&i.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Kt.fromColor(o),distanceDisplayCondition:Jn.fromDistanceDisplayCondition(a),offset:void 0};return l(this._options.offsetAttribute)&&(s.offset=yr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,aJ,sJ))),new Bt({id:i,geometry:new Zf(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:s})};of.prototype._computeCenter=function(e,t){return X.getValueOrUndefined(this._entity.position,e,t)};of.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.radii)||Ii.prototype._isHidden.call(this,e,t)};of.prototype._isDynamic=function(e,t){return!e.position.isConstant||!X.isConstant(e.orientation)||!t.radii.isConstant||!X.isConstant(t.innerRadii)||!X.isConstant(t.stackPartitions)||!X.isConstant(t.slicePartitions)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.minimumClock)||!X.isConstant(t.maximumClock)||!X.isConstant(t.minimumCone)||!X.isConstant(t.maximumCone)||!X.isConstant(t.subdivisions)};of.prototype._setStaticOptions=function(e,t){let n=X.getValueOrDefault(t.heightReference,Qe.MINIMUM_VALUE,it.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Yt?_n.VERTEX_FORMAT:Ar.MaterialSupport.TEXTURED.vertexFormat,i.radii=t.radii.getValue(Qe.MINIMUM_VALUE,i.radii),i.innerRadii=X.getValueOrUndefined(t.innerRadii,i.radii),i.minimumClock=X.getValueOrUndefined(t.minimumClock,Qe.MINIMUM_VALUE),i.maximumClock=X.getValueOrUndefined(t.maximumClock,Qe.MINIMUM_VALUE),i.minimumCone=X.getValueOrUndefined(t.minimumCone,Qe.MINIMUM_VALUE),i.maximumCone=X.getValueOrUndefined(t.maximumCone,Qe.MINIMUM_VALUE),i.stackPartitions=X.getValueOrUndefined(t.stackPartitions,Qe.MINIMUM_VALUE),i.slicePartitions=X.getValueOrUndefined(t.slicePartitions,Qe.MINIMUM_VALUE),i.subdivisions=X.getValueOrUndefined(t.subdivisions,Qe.MINIMUM_VALUE),i.offsetAttribute=n!==it.NONE?mn.ALL:void 0};of.prototype._onEntityPropertyChanged=py;of.DynamicGeometryUpdater=xD;function xD(e,t,n){wi.call(this,e,t,n),this._scene=e._scene,this._modelMatrix=new O,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 h,this._material={}}l(Object.create)&&(xD.prototype=Object.create(wi.prototype),xD.prototype.constructor=xD);xD.prototype.update=function(e){let t=this._entity,n=t.ellipsoid;if(!t.isShowing||!t.isAvailable(e)||!X.getValueOrDefault(n.show,e,!0)){l(this._primitive)&&(this._primitive.show=!1),l(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let i=X.getValueOrUndefined(n.radii,e,met),r=l(i)?t.computeModelMatrixForHeightReference(e,n.heightReference,i.z*.5,this._scene.ellipsoid,this._modelMatrix):void 0;if(!l(r)||!l(i)){l(this._primitive)&&(this._primitive.show=!1),l(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let o=X.getValueOrDefault(n.fill,e,!0),a=X.getValueOrDefault(n.outline,e,!1),s=X.getValueOrClonedDefault(n.outlineColor,e,U.BLACK,cJ),c=xo.getValue(e,n.material??het,this._material),u=X.getValueOrUndefined(n.innerRadii,e,pet),f=X.getValueOrUndefined(n.minimumClock,e),d=X.getValueOrUndefined(n.maximumClock,e),p=X.getValueOrUndefined(n.minimumCone,e),g=X.getValueOrUndefined(n.maximumCone,e),m=X.getValueOrUndefined(n.stackPartitions,e),y=X.getValueOrUndefined(n.slicePartitions,e),A=X.getValueOrUndefined(n.subdivisions,e),b=X.getValueOrDefault(n.outlineWidth,e,1),x=X.getValueOrDefault(n.heightReference,e,it.NONE),T=x!==it.NONE?mn.ALL:void 0,C=this._scene.mode,E=C===re.SCENE3D&&x===it.NONE,w=this._options,D=this._geometryUpdater.shadowsProperty.getValue(e),M=this._geometryUpdater.distanceDisplayConditionProperty.getValue(e),N=X.getValueOrDefault(this._geometryUpdater.terrainOffsetProperty,e,aJ,sJ);if(!E||this._lastSceneMode!==C||!l(this._primitive)||w.stackPartitions!==m||w.slicePartitions!==y||l(u)&&!h.equals(w.innerRadii!==u)||w.minimumClock!==f||w.maximumClock!==d||w.minimumCone!==p||w.maximumCone!==g||w.subdivisions!==A||this._lastOutlineWidth!==b||w.offsetAttribute!==T){let v=this._primitives;v.removeAndDestroy(this._primitive),v.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0,this._lastSceneMode=C,this._lastOutlineWidth=b,w.stackPartitions=m,w.slicePartitions=y,w.subdivisions=A,w.offsetAttribute=T,w.radii=h.clone(E?get:i,w.radii),l(u)?E?w.innerRadii=h.fromElements(u.x/i.x,u.y/i.y,u.z/i.z,w.innerRadii):w.innerRadii=h.clone(u,w.innerRadii):w.innerRadii=void 0,w.minimumClock=f,w.maximumClock=d,w.minimumCone=p,w.maximumCone=g;let S=new Ar({material:c,translucent:c.isTranslucent(),closed:!0});w.vertexFormat=S.vertexFormat;let P=this._geometryUpdater.createFillGeometryInstance(e,E,this._modelMatrix);this._primitive=v.add(new Fn({geometryInstances:P,appearance:S,asynchronous:!1,shadows:D}));let L=this._geometryUpdater.createOutlineGeometryInstance(e,E,this._modelMatrix);this._outlinePrimitive=v.add(new Fn({geometryInstances:L,appearance:new _n({flat:!0,translucent:L.attributes.color.value[3]!==255,renderState:{lineWidth:this._geometryUpdater._scene.clampLineWidth(b)}}),asynchronous:!1,shadows:D})),this._lastShow=o,this._lastOutlineShow=a,this._lastOutlineColor=U.clone(s,this._lastOutlineColor),this._lastDistanceDisplayCondition=M,this._lastOffset=h.clone(N,this._lastOffset)}else if(this._primitive.ready){let v=this._primitive,S=this._outlinePrimitive;v.show=!0,S.show=!0,v.appearance.material=c;let P=this._attributes;l(P)||(P=v.getGeometryInstanceAttributes(t),this._attributes=P),o!==this._lastShow&&(P.show=Dn.toValue(o,P.show),this._lastShow=o);let L=this._outlineAttributes;l(L)||(L=S.getGeometryInstanceAttributes(t),this._outlineAttributes=L),a!==this._lastOutlineShow&&(L.show=Dn.toValue(a,L.show),this._lastOutlineShow=a),U.equals(s,this._lastOutlineColor)||(L.color=Kt.toValue(s,L.color),U.clone(s,this._lastOutlineColor)),jt.equals(M,this._lastDistanceDisplayCondition)||(P.distanceDisplayCondition=Jn.toValue(M,P.distanceDisplayCondition),L.distanceDisplayCondition=Jn.toValue(M,L.distanceDisplayCondition),jt.clone(M,this._lastDistanceDisplayCondition)),h.equals(N,this._lastOffset)||(P.offset=yr.toValue(N,P.offset),L.offset=yr.toValue(N,P.offset),h.clone(N,this._lastOffset))}E&&(i.x=Math.max(i.x,.001),i.y=Math.max(i.y,.001),i.z=Math.max(i.z,.001),r=O.multiplyByScale(r,i,r),this._primitive.modelMatrix=r,this._outlinePrimitive.modelMatrix=r)};var Q3=of;var yet=new h,Q_e=new U;function Aet(e){this.id=e,this.vertexFormat=void 0,this.plane=void 0,this.dimensions=void 0}function yd(e,t){Ii.call(this,{entity:e,scene:t,geometryOptions:new Aet(e),geometryPropertyName:"plane",observedPropertyNames:["availability","position","orientation","plane"]}),this._onEntityPropertyChanged(e,"plane",e.plane,void 0)}l(Object.create)&&(yd.prototype=Object.create(Ii.prototype),yd.prototype.constructor=yd);yd.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,r,o=new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),a=this._distanceDisplayConditionProperty.getValue(e),s=Jn.fromDistanceDisplayCondition(a);if(this._materialProperty instanceof Yt){let g;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(g=this._materialProperty.color.getValue(e,Q_e)),l(g)||(g=U.WHITE),r=Kt.fromColor(g),i={show:o,distanceDisplayCondition:s,color:r}}else i={show:o,distanceDisplayCondition:s};let c=t.plane,u=this._options,f=t.computeModelMatrix(e),d=X.getValueOrDefault(c.plane,e,u.plane),p=X.getValueOrUndefined(c.dimensions,e,u.dimensions);return u.plane=d,u.dimensions=p,f=lJ(d,p,f,f),new Bt({id:t,geometry:new KN(this._options),modelMatrix:f,attributes:i})};yd.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,Q_e),r=this._distanceDisplayConditionProperty.getValue(e),o=t.plane,a=this._options,s=t.computeModelMatrix(e),c=X.getValueOrDefault(o.plane,e,a.plane),u=X.getValueOrUndefined(o.dimensions,e,a.dimensions);return a.plane=c,a.dimensions=u,s=lJ(c,u,s,s),new Bt({id:t,geometry:new JN,modelMatrix:s,attributes:{show:new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Kt.fromColor(i),distanceDisplayCondition:Jn.fromDistanceDisplayCondition(r)}})};yd.prototype._isHidden=function(e,t){return!l(t.plane)||!l(t.dimensions)||!l(e.position)||Ii.prototype._isHidden.call(this,e,t)};yd.prototype._getIsClosed=function(e){return!1};yd.prototype._isDynamic=function(e,t){return!e.position.isConstant||!X.isConstant(e.orientation)||!t.plane.isConstant||!t.dimensions.isConstant||!X.isConstant(t.outlineWidth)};yd.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Yt,i=this._options;i.vertexFormat=n?_n.VERTEX_FORMAT:Ar.MaterialSupport.TEXTURED.vertexFormat,i.plane=t.plane.getValue(Qe.MINIMUM_VALUE,i.plane),i.dimensions=t.dimensions.getValue(Qe.MINIMUM_VALUE,i.dimensions)};yd.DynamicGeometryUpdater=eE;function eE(e,t,n){wi.call(this,e,t,n)}l(Object.create)&&(eE.prototype=Object.create(wi.prototype),eE.prototype.constructor=eE);eE.prototype._isHidden=function(e,t,n){let i=this._options,r=X.getValueOrUndefined(e.position,n,yet);return!l(r)||!l(i.plane)||!l(i.dimensions)||wi.prototype._isHidden.call(this,e,t,n)};eE.prototype._setOptions=function(e,t,n){let i=this._options;i.plane=X.getValueOrDefault(t.plane,n,i.plane),i.dimensions=X.getValueOrUndefined(t.dimensions,n,i.dimensions)};var bet=new h,xet=new h,Tet=new h,Cet=new h,vet=new $,Eet=new $,wet=new O;function lJ(e,t,n,i){let r=e.normal,o=e.distance,a=h.multiplyByScalar(r,-o,Tet),s=h.clone(h.UNIT_Z,xet);I.equalsEpsilon(Math.abs(h.dot(s,r)),1,I.EPSILON8)&&(s=h.clone(h.UNIT_Y,s));let c=h.cross(s,r,bet);s=h.cross(r,c,s),h.normalize(c,c),h.normalize(s,s);let u=vet;$.setColumn(u,0,c,u),$.setColumn(u,1,s,u),$.setColumn(u,2,r,u);let f=h.fromElements(t.x,t.y,1,Cet),d=$.multiplyByScale(u,f,Eet),p=O.fromRotationTranslation(d,a,wet);return O.multiplyTransformation(n,p,i)}yd.createPrimitiveMatrix=lJ;var ez=yd;var eye="Entity polygons cannot have both height and perPositionHeight. height will be ignored",tye="heightReference is not supported for entity polygons with perPositionHeight. heightReference will be ignored",nye=new U,iye=h.ZERO,rye=new h,oye=new ie,Iet=[],Pet=new k;function Det(e){this.id=e,this.vertexFormat=void 0,this.polygonHierarchy=void 0,this.perPositionHeight=void 0,this.closeTop=void 0,this.closeBottom=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.offsetAttribute=void 0,this.arcType=void 0,this.textureCoordinates=void 0}function af(e,t){ii.call(this,{entity:e,scene:t,geometryOptions:new Det(e),geometryPropertyName:"polygon",observedPropertyNames:["availability","polygon"]}),this._onEntityPropertyChanged(e,"polygon",e.polygon,void 0)}l(Object.create)&&(af.prototype=Object.create(ii.prototype),af.prototype.constructor=af);af.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,r={show:new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Jn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Yt){let a;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,nye)),l(a)||(a=U.WHITE),r.color=Kt.fromColor(a)}l(i.offsetAttribute)&&(r.offset=yr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,iye,rye)));let o;return i.perPositionHeight&&!l(i.extrudedHeight)?o=new uN(i):o=new U_(i),new Bt({id:t,geometry:o,attributes:r})};af.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,r=X.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,nye),o=this._distanceDisplayConditionProperty.getValue(e),a={show:new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Kt.fromColor(r),distanceDisplayCondition:Jn.fromDistanceDisplayCondition(o),offset:void 0};l(i.offsetAttribute)&&(a.offset=yr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,iye,rye)));let s;return i.perPositionHeight&&!l(i.extrudedHeight)?s=new dh(i):s=new eF(i),new Bt({id:t,geometry:s,attributes:a})};af.prototype._computeCenter=function(e,t){let n=X.getValueOrUndefined(this._entity.polygon.hierarchy,e);if(!l(n))return;let i=n.positions;if(i.length===0)return;let r=this._scene.ellipsoid,o=Fa.fromPoints(i,r),a=o.projectPointsOntoPlane(i,Iet),s=a.length,c=0,u=s-1,f=new k;for(let p=0;p<s;u=p++){let g=a[p],m=a[u],y=g.x*m.y-m.x*g.y,A=k.add(g,m,Pet);A=k.multiplyByScalar(A,y,A),f=k.add(f,A,f),c+=y}let d=1/(c*3);return f=k.multiplyByScalar(f,d,f),o.projectPointOntoEllipsoid(f,t)};af.prototype._isHidden=function(e,t){return!l(t.hierarchy)||Ii.prototype._isHidden.call(this,e,t)};af.prototype._isOnTerrain=function(e,t){let n=ii.prototype._isOnTerrain.call(this,e,t),i=t.perPositionHeight,r=l(i)&&(i.isConstant?i.getValue(Qe.MINIMUM_VALUE):!0);return n&&!r};af.prototype._isDynamic=function(e,t){return!t.hierarchy.isConstant||!X.isConstant(t.height)||!X.isConstant(t.extrudedHeight)||!X.isConstant(t.granularity)||!X.isConstant(t.stRotation)||!X.isConstant(t.textureCoordinates)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.perPositionHeight)||!X.isConstant(t.closeTop)||!X.isConstant(t.closeBottom)||!X.isConstant(t.zIndex)||!X.isConstant(t.arcType)||this._onTerrain&&!X.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Yt)};af.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Yt,i=this._options;i.vertexFormat=n?_n.VERTEX_FORMAT:Ar.MaterialSupport.TEXTURED.vertexFormat;let r=t.hierarchy.getValue(Qe.MINIMUM_VALUE),o=X.getValueOrUndefined(t.height,Qe.MINIMUM_VALUE),a=X.getValueOrDefault(t.heightReference,Qe.MINIMUM_VALUE,it.NONE),s=X.getValueOrUndefined(t.extrudedHeight,Qe.MINIMUM_VALUE),c=X.getValueOrDefault(t.extrudedHeightReference,Qe.MINIMUM_VALUE,it.NONE),u=X.getValueOrDefault(t.perPositionHeight,Qe.MINIMUM_VALUE,!1);o=ii.getGeometryHeight(o,a);let f;if(u?(l(o)&&(o=void 0,pt(eye)),a!==it.NONE&&u&&(o=void 0,pt(tye))):(l(s)&&!l(o)&&(o=0),f=ii.computeGeometryOffsetAttribute(o,a,s,c)),i.polygonHierarchy=r,i.granularity=X.getValueOrUndefined(t.granularity,Qe.MINIMUM_VALUE),i.stRotation=X.getValueOrUndefined(t.stRotation,Qe.MINIMUM_VALUE),i.perPositionHeight=u,i.closeTop=X.getValueOrDefault(t.closeTop,Qe.MINIMUM_VALUE,!0),i.closeBottom=X.getValueOrDefault(t.closeBottom,Qe.MINIMUM_VALUE,!0),i.offsetAttribute=f,i.height=o,i.arcType=X.getValueOrDefault(t.arcType,Qe.MINIMUM_VALUE,sn.GEODESIC),i.textureCoordinates=X.getValueOrUndefined(t.textureCoordinates,Qe.MINIMUM_VALUE),s=ii.getGeometryExtrudedHeight(s,c),s===ii.CLAMP_TO_GROUND){let d=U_.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,oye);s=Oi.getMinimumMaximumHeights(d).minimumTerrainHeight}i.extrudedHeight=s};af.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight,i=l(n)&&n!==t;return!e.perPositionHeight&&(!i&&t===0||i&&e.closeTop&&e.closeBottom)};af.DynamicGeometryUpdater=tE;function tE(e,t,n){wi.call(this,e,t,n)}l(Object.create)&&(tE.prototype=Object.create(wi.prototype),tE.prototype.constructor=tE);tE.prototype._isHidden=function(e,t,n){return!l(this._options.polygonHierarchy)||wi.prototype._isHidden.call(this,e,t,n)};tE.prototype._setOptions=function(e,t,n){let i=this._options;i.polygonHierarchy=X.getValueOrUndefined(t.hierarchy,n);let r=X.getValueOrUndefined(t.height,n),o=X.getValueOrDefault(t.heightReference,n,it.NONE),a=X.getValueOrDefault(t.extrudedHeightReference,n,it.NONE),s=X.getValueOrUndefined(t.extrudedHeight,n),c=X.getValueOrUndefined(t.perPositionHeight,n);r=ii.getGeometryHeight(r,a);let u;if(c?(l(r)&&(r=void 0,pt(eye)),o!==it.NONE&&c&&(r=void 0,pt(tye))):(l(s)&&!l(r)&&(r=0),u=ii.computeGeometryOffsetAttribute(r,o,s,a)),i.granularity=X.getValueOrUndefined(t.granularity,n),i.stRotation=X.getValueOrUndefined(t.stRotation,n),i.textureCoordinates=X.getValueOrUndefined(t.textureCoordinates,n),i.perPositionHeight=X.getValueOrUndefined(t.perPositionHeight,n),i.closeTop=X.getValueOrDefault(t.closeTop,n,!0),i.closeBottom=X.getValueOrDefault(t.closeBottom,n,!0),i.offsetAttribute=u,i.height=r,i.arcType=X.getValueOrDefault(t.arcType,n,sn.GEODESIC),s=ii.getGeometryExtrudedHeight(s,a),s===ii.CLAMP_TO_GROUND){let f=U_.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,oye);s=Oi.getMinimumMaximumHeights(f).minimumTerrainHeight}i.extrudedHeight=s};var tz=af;var aye=new U;function Ret(e){this.id=e,this.vertexFormat=void 0,this.polylinePositions=void 0,this.shapePositions=void 0,this.cornerType=void 0,this.granularity=void 0}function lp(e,t){Ii.call(this,{entity:e,scene:t,geometryOptions:new Ret(e),geometryPropertyName:"polylineVolume",observedPropertyNames:["availability","polylineVolume"]}),this._onEntityPropertyChanged(e,"polylineVolume",e.polylineVolume,void 0)}l(Object.create)&&(lp.prototype=Object.create(Ii.prototype),lp.prototype.constructor=lp);lp.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,r,o=new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),a=this._distanceDisplayConditionProperty.getValue(e),s=Jn.fromDistanceDisplayCondition(a);if(this._materialProperty instanceof Yt){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,aye)),l(c)||(c=U.WHITE),r=Kt.fromColor(c),i={show:o,distanceDisplayCondition:s,color:r}}else i={show:o,distanceDisplayCondition:s};return new Bt({id:t,geometry:new tF(this._options),attributes:i})};lp.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,aye),r=this._distanceDisplayConditionProperty.getValue(e);return new Bt({id:t,geometry:new nF(this._options),attributes:{show:new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Kt.fromColor(i),distanceDisplayCondition:Jn.fromDistanceDisplayCondition(r)}})};lp.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.shape)||Ii.prototype._isHidden.call(this,e,t)};lp.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!t.shape.isConstant||!X.isConstant(t.granularity)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.cornerType)};lp.prototype._setStaticOptions=function(e,t){let n=t.granularity,i=t.cornerType,r=this._options,o=this._materialProperty instanceof Yt;r.vertexFormat=o?_n.VERTEX_FORMAT:Ar.MaterialSupport.TEXTURED.vertexFormat,r.polylinePositions=t.positions.getValue(Qe.MINIMUM_VALUE,r.polylinePositions),r.shapePositions=t.shape.getValue(Qe.MINIMUM_VALUE,r.shape),r.granularity=l(n)?n.getValue(Qe.MINIMUM_VALUE):void 0,r.cornerType=l(i)?i.getValue(Qe.MINIMUM_VALUE):void 0};lp.DynamicGeometryUpdater=nE;function nE(e,t,n){wi.call(this,e,t,n)}l(Object.create)&&(nE.prototype=Object.create(wi.prototype),nE.prototype.constructor=nE);nE.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.polylinePositions)||!l(i.shapePositions)||wi.prototype._isHidden.call(this,e,t,n)};nE.prototype._setOptions=function(e,t,n){let i=this._options;i.polylinePositions=X.getValueOrUndefined(t.positions,n,i.polylinePositions),i.shapePositions=X.getValueOrUndefined(t.shape,n),i.granularity=X.getValueOrUndefined(t.granularity,n),i.cornerType=X.getValueOrUndefined(t.cornerType,n)};var nz=lp;var sye=new U,cye=h.ZERO,lye=new h,uye=new ie,Oet=new ie,Met=new de;function Let(e){this.id=e,this.vertexFormat=void 0,this.rectangle=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.rotation=void 0,this.offsetAttribute=void 0}function wh(e,t){ii.call(this,{entity:e,scene:t,geometryOptions:new Let(e),geometryPropertyName:"rectangle",observedPropertyNames:["availability","rectangle"]}),this._onEntityPropertyChanged(e,"rectangle",e.rectangle,void 0)}l(Object.create)&&(wh.prototype=Object.create(ii.prototype),wh.prototype.constructor=wh);wh.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Jn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Yt){let r;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(r=this._materialProperty.color.getValue(e,sye)),l(r)||(r=U.WHITE),i.color=Kt.fromColor(r)}return l(this._options.offsetAttribute)&&(i.offset=yr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,cye,lye))),new Bt({id:t,geometry:new ov(this._options),attributes:i})};wh.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,sye),r=this._distanceDisplayConditionProperty.getValue(e),o={show:new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Kt.fromColor(i),distanceDisplayCondition:Jn.fromDistanceDisplayCondition(r),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=yr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,cye,lye))),new Bt({id:t,geometry:new cv(this._options),attributes:o})};wh.prototype._computeCenter=function(e,t){let n=X.getValueOrUndefined(this._entity.rectangle.coordinates,e,Oet);if(!l(n))return;let i=ie.center(n,Met);return de.toCartesian(i,te.default,t)};wh.prototype._isHidden=function(e,t){return!l(t.coordinates)||Ii.prototype._isHidden.call(this,e,t)};wh.prototype._isDynamic=function(e,t){return!t.coordinates.isConstant||!X.isConstant(t.height)||!X.isConstant(t.extrudedHeight)||!X.isConstant(t.granularity)||!X.isConstant(t.stRotation)||!X.isConstant(t.rotation)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.zIndex)||this._onTerrain&&!X.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Yt)};wh.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Yt,i=X.getValueOrUndefined(t.height,Qe.MINIMUM_VALUE),r=X.getValueOrDefault(t.heightReference,Qe.MINIMUM_VALUE,it.NONE),o=X.getValueOrUndefined(t.extrudedHeight,Qe.MINIMUM_VALUE),a=X.getValueOrDefault(t.extrudedHeightReference,Qe.MINIMUM_VALUE,it.NONE);l(o)&&!l(i)&&(i=0);let s=this._options;s.vertexFormat=n?_n.VERTEX_FORMAT:Ar.MaterialSupport.TEXTURED.vertexFormat,s.rectangle=t.coordinates.getValue(Qe.MINIMUM_VALUE,s.rectangle),s.granularity=X.getValueOrUndefined(t.granularity,Qe.MINIMUM_VALUE),s.stRotation=X.getValueOrUndefined(t.stRotation,Qe.MINIMUM_VALUE),s.rotation=X.getValueOrUndefined(t.rotation,Qe.MINIMUM_VALUE),s.offsetAttribute=ii.computeGeometryOffsetAttribute(i,r,o,a),s.height=ii.getGeometryHeight(i,r),o=ii.getGeometryExtrudedHeight(o,a),o===ii.CLAMP_TO_GROUND&&(o=Oi.getMinimumMaximumHeights(ov.computeRectangle(s,uye)).minimumTerrainHeight),s.extrudedHeight=o};wh.DynamicGeometryUpdater=iE;function iE(e,t,n){wi.call(this,e,t,n)}l(Object.create)&&(iE.prototype=Object.create(wi.prototype),iE.prototype.constructor=iE);iE.prototype._isHidden=function(e,t,n){return!l(this._options.rectangle)||wi.prototype._isHidden.call(this,e,t,n)};iE.prototype._setOptions=function(e,t,n){let i=this._options,r=X.getValueOrUndefined(t.height,n),o=X.getValueOrDefault(t.heightReference,n,it.NONE),a=X.getValueOrUndefined(t.extrudedHeight,n),s=X.getValueOrDefault(t.extrudedHeightReference,n,it.NONE);l(a)&&!l(r)&&(r=0),i.rectangle=X.getValueOrUndefined(t.coordinates,n,i.rectangle),i.granularity=X.getValueOrUndefined(t.granularity,n),i.stRotation=X.getValueOrUndefined(t.stRotation,n),i.rotation=X.getValueOrUndefined(t.rotation,n),i.offsetAttribute=ii.computeGeometryOffsetAttribute(r,o,a,s),i.height=ii.getGeometryHeight(r,o),a=ii.getGeometryExtrudedHeight(a,s),a===ii.CLAMP_TO_GROUND&&(a=Oi.getMinimumMaximumHeights(ov.computeRectangle(i,uye)).minimumTerrainHeight),i.extrudedHeight=a};var iz=wh;var fye=new U;function Net(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.minimumHeights=void 0,this.maximumHeights=void 0,this.granularity=void 0}function Ih(e,t){Ii.call(this,{entity:e,scene:t,geometryOptions:new Net(e),geometryPropertyName:"wall",observedPropertyNames:["availability","wall"]}),this._onEntityPropertyChanged(e,"wall",e.wall,void 0)}l(Object.create)&&(Ih.prototype=Object.create(Ii.prototype),Ih.prototype.constructor=Ih);Ih.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,r,o=new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),a=this._distanceDisplayConditionProperty.getValue(e),s=Jn.fromDistanceDisplayCondition(a);if(this._materialProperty instanceof Yt){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,fye)),l(c)||(c=U.WHITE),r=Kt.fromColor(c),i={show:o,distanceDisplayCondition:s,color:r}}else i={show:o,distanceDisplayCondition:s};return new Bt({id:t,geometry:new Ak(this._options),attributes:i})};Ih.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,fye),r=this._distanceDisplayConditionProperty.getValue(e);return new Bt({id:t,geometry:new bk(this._options),attributes:{show:new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Kt.fromColor(i),distanceDisplayCondition:Jn.fromDistanceDisplayCondition(r)}})};Ih.prototype._isHidden=function(e,t){return!l(t.positions)||Ii.prototype._isHidden.call(this,e,t)};Ih.prototype._getIsClosed=function(e){return!1};Ih.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!X.isConstant(t.minimumHeights)||!X.isConstant(t.maximumHeights)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.granularity)};Ih.prototype._setStaticOptions=function(e,t){let n=t.minimumHeights,i=t.maximumHeights,r=t.granularity,o=this._materialProperty instanceof Yt,a=this._options;a.vertexFormat=o?_n.VERTEX_FORMAT:Ar.MaterialSupport.TEXTURED.vertexFormat,a.positions=t.positions.getValue(Qe.MINIMUM_VALUE,a.positions),a.minimumHeights=l(n)?n.getValue(Qe.MINIMUM_VALUE,a.minimumHeights):void 0,a.maximumHeights=l(i)?i.getValue(Qe.MINIMUM_VALUE,a.maximumHeights):void 0,a.granularity=l(r)?r.getValue(Qe.MINIMUM_VALUE):void 0};Ih.DynamicGeometryUpdater=rE;function rE(e,t,n){wi.call(this,e,t,n)}l(Object.create)&&(rE.prototype=Object.create(wi.prototype),rE.prototype.constructor=rE);rE.prototype._isHidden=function(e,t,n){return!l(this._options.positions)||wi.prototype._isHidden.call(this,e,t,n)};rE.prototype._setOptions=function(e,t,n){let i=this._options;i.positions=X.getValueOrUndefined(t.positions,n,i.positions),i.minimumHeights=X.getValueOrUndefined(t.minimumHeights,n,i.minimumHeights),i.maximumHeights=X.getValueOrUndefined(t.maximumHeights,n,i.maximumHeights),i.granularity=X.getValueOrUndefined(t.granularity,n)};var rz=Ih;var Kb=[K3,J3,$3,Z3,Q3,ez,tz,nz,iz,rz];function $b(e,t){this.entity=e,this.scene=t;let n=new Array(Kb.length),i=new be,r=new Fo;for(let o=0;o<n.length;o++){let a=new Kb[o](e,t);r.add(a.geometryChanged,s=>{i.raiseEvent(s)}),n[o]=a}this.updaters=n,this.geometryChanged=i,this.eventHelper=r,this._removeEntitySubscription=e.definitionChanged.addEventListener($b.prototype._onEntityPropertyChanged,this)}$b.prototype._onEntityPropertyChanged=function(e,t,n,i){let r=this.updaters;for(let o=0;o<r.length;o++)r[o]._onEntityPropertyChanged(e,t,n,i)};$b.prototype.forEach=function(e){let t=this.updaters;for(let n=0;n<t.length;n++)e(t[n])};$b.prototype.destroy=function(){this.eventHelper.removeAll();let e=this.updaters;for(let t=0;t<e.length;t++)e[t].destroy();this._removeEntitySubscription(),ue(this)};$b.registerUpdater=function(e){Kb.includes(e)||Kb.push(e)};$b.unregisterUpdater=function(e){if(Kb.includes(e)){let t=Kb.indexOf(e);Kb.splice(t,1)}};var oE=$b;var dye=new U,Fet=new jt,Bet=new jt,ket=h.ZERO,zet=new h;function Ph(e,t,n,i,r,o,a){this.translucent=t,this.appearanceType=n,this.depthFailAppearanceType=i,this.depthFailMaterialProperty=r,this.depthFailMaterial=void 0,this.closed=o,this.shadows=a,this.primitives=e,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new zt,this.updaters=new zt,this.updatersWithAttributes=new zt,this.attributes=new zt,this.subscriptions=new zt,this.showsUpdated=new zt,this.itemsToRemove=[],this.invalidated=!1;let s;l(r)&&(s=r.definitionChanged.addEventListener(Ph.prototype.onMaterialChanged,this)),this.removeMaterialSubscription=s}Ph.prototype.onMaterialChanged=function(){this.invalidated=!0};Ph.prototype.isMaterial=function(e){let t=this.depthFailMaterialProperty,n=e.depthFailMaterialProperty;return n===t?!0:l(t)?t.equals(n):!1};Ph.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),!e.hasConstantFill||!e.fillMaterialProperty.isConstant||!X.isConstant(e.distanceDisplayConditionProperty)||!X.isConstant(e.terrainOffsetProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(r,o,a,s){o==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};Ph.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 l(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};Ph.prototype.update=function(e){let t=!0,n=0,i=this.primitive,r=this.primitives,o;if(this.createPrimitive){let a=this.geometry.values;if(a.length>0){l(i)&&(l(this.oldPrimitive)?r.remove(i):this.oldPrimitive=i);let c;if(l(this.depthFailAppearanceType)){l(this.depthFailMaterialProperty)&&(this.depthFailMaterial=xo.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial));let f=this.depthFailAppearanceType;c=new f({material:this.depthFailMaterial,translucent:this.translucent,closed:this.closed})}let u=this.appearanceType;i=new Fn({show:!1,asynchronous:!0,geometryInstances:a.slice(),appearance:new u({translucent:this.translucent,closed:this.closed}),depthFailAppearance:c,shadows:this.shadows}),r.add(i),t=!1}else{l(i)&&(r.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(r.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(r.remove(this.oldPrimitive),this.oldPrimitive=void 0),l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Yt)&&(this.depthFailMaterial=xo.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let a=this.updatersWithAttributes.values,s=a.length,c=this.waitingOnCreate;for(o=0;o<s;o++){let u=a[o],f=this.geometry.get(u.id),d=this.attributes.get(f.id.id);if(l(d)||(d=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!u.fillMaterialProperty.isConstant||c){let A=u.fillMaterialProperty.color,b=X.getValueOrDefault(A,e,U.WHITE,dye);U.equals(d._lastColor,b)||(d._lastColor=U.clone(b,d._lastColor),d.color=Kt.toValue(b,d.color),(this.translucent&&d.color[3]===255||!this.translucent&&d.color[3]!==255)&&(this.itemsToRemove[n++]=u))}if(l(this.depthFailAppearanceType)&&u.depthFailMaterialProperty instanceof Yt&&(!u.depthFailMaterialProperty.isConstant||c)){let A=u.depthFailMaterialProperty.color,b=X.getValueOrDefault(A,e,U.WHITE,dye);U.equals(d._lastDepthFailColor,b)||(d._lastDepthFailColor=U.clone(b,d._lastDepthFailColor),d.depthFailColor=Kt.toValue(b,d.depthFailColor))}let p=u.entity.isShowing&&(u.hasConstantFill||u.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=Dn.toValue(p,d.show));let m=u.distanceDisplayConditionProperty;if(!X.isConstant(m)){let A=X.getValueOrDefault(m,e,Bet,Fet);jt.equals(A,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=jt.clone(A,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=Jn.toValue(A,d.distanceDisplayCondition))}let y=u.terrainOffsetProperty;if(!X.isConstant(y)){let A=X.getValueOrDefault(y,e,ket,zet);h.equals(A,d._lastOffset)||(d._lastOffset=h.clone(A,d._lastOffset),d.offset=yr.toValue(A,d.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};Ph.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=this.geometry.get(r.id),a=this.attributes.get(o.id.id);l(a)||(a=e.getGeometryInstanceAttributes(o.id),this.attributes.set(o.id.id,a));let s=r.entity.isShowing,c=a.show[0]===1;s!==c&&(a.show=Dn.toValue(s,a.show),o.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};Ph.prototype.contains=function(e){return this.updaters.contains(e.id)};Ph.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return It.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?It.FAILED:(i.boundingSphere.clone(t),It.DONE)};Ph.prototype.destroy=function(){let e=this.primitive,t=this.primitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),l(this.removeMaterialSubscription)&&this.removeMaterialSubscription()};function aE(e,t,n,i,r){this._solidItems=[],this._translucentItems=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=r}aE.prototype.add=function(e,t){let n,i,r=t.createFillGeometryInstance(e);r.attributes.color.value[3]===255?(n=this._solidItems,i=!1):(n=this._translucentItems,i=!0);let o=n.length;for(let s=0;s<o;s++){let c=n[s];if(c.isMaterial(t)){c.add(t,r);return}}let a=new Ph(this._primitives,i,this._appearanceType,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);a.add(t,r),n.push(a)};function hye(e,t){let n=e.length;for(let i=n-1;i>=0;i--){let r=e[i];if(r.remove(t))return r.updaters.length===0&&(e.splice(i,1),r.destroy()),!0}return!1}aE.prototype.remove=function(e){hye(this._solidItems,e)||hye(this._translucentItems,e)};function mye(e,t,n){let i=!1,r=t.length;for(let o=0;o<r;++o){let a=t[o],s=a.itemsToRemove,c=s.length;if(c>0)for(o=0;o<c;o++){let u=s[o];a.remove(u),e.add(n,u),i=!0}}return i}function oz(e,t,n,i){let r=t.length,o;for(o=r-1;o>=0;o--){let a=t[o];if(a.invalidated){t.splice(o,1);let s=a.updaters.values,c=s.length;for(let u=0;u<c;u++)e.add(n,s[u]);a.destroy()}}for(r=t.length,o=0;o<r;++o)i=t[o].update(n)&&i;return i}aE.prototype.update=function(e){let t=oz(this,this._solidItems,e,!0);t=oz(this,this._translucentItems,e,t)&&t;let n=mye(this,this._solidItems,e),i=mye(this,this._translucentItems,e);return(n||i)&&(t=oz(this,this._solidItems,e,t)&&t,t=oz(this,this._translucentItems,e,t)&&t),t};function pye(e,t,n){let i=e.length;for(let r=0;r<i;r++){let o=e[r];if(o.contains(t))return o.getBoundingSphere(t,n)}return It.FAILED}aE.prototype.getBoundingSphere=function(e,t){let n=pye(this._solidItems,e,t);return n===It.FAILED?pye(this._translucentItems,e,t):n};function gye(e){let t=e.length;for(let n=0;n<t;n++)e[n].destroy();e.length=0}aE.prototype.removeAllPrimitives=function(){gye(this._solidItems),gye(this._translucentItems)};var Dh=aE;var Uet=new jt,Vet=new jt,jet=h.ZERO,Het=new h;function Rh(e,t,n,i,r,o,a){this.primitives=e,this.appearanceType=t,this.materialProperty=n,this.depthFailAppearanceType=i,this.depthFailMaterialProperty=r,this.closed=o,this.shadows=a,this.updaters=new zt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new zt,this.material=void 0,this.depthFailMaterial=void 0,this.updatersWithAttributes=new zt,this.attributes=new zt,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(Rh.prototype.onMaterialChanged,this),this.subscriptions=new zt,this.showsUpdated=new zt}Rh.prototype.onMaterialChanged=function(){this.invalidated=!0};Rh.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty,i=this.depthFailMaterialProperty,r=e.depthFailMaterialProperty;if(n===t&&r===i)return!0;let o=l(t)&&t.equals(n);return o=(!l(i)&&!l(r)||l(i)&&i.equals(r))&&o,o};Rh.prototype.add=function(e,t){let n=t.id;if(this.updaters.set(n,t),this.geometry.set(n,t.createFillGeometryInstance(e)),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!X.isConstant(t.distanceDisplayConditionProperty)||!X.isConstant(t.terrainOffsetProperty))this.updatersWithAttributes.set(n,t);else{let i=this;this.subscriptions.set(n,t.entity.definitionChanged.addEventListener(function(r,o,a,s){o==="isShowing"&&i.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};Rh.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 l(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};var Get=new U;Rh.prototype.update=function(e){let t=!0,n=this.primitive,i=this.primitives,r=this.geometry.values,o;if(this.createPrimitive){if(r.length>0){l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=xo.getValue(e,this.materialProperty,this.material);let s;if(l(this.depthFailMaterialProperty)){this.depthFailMaterial=xo.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial);let u=this.depthFailAppearanceType;s=new u({material:this.depthFailMaterial,translucent:this.depthFailMaterial.isTranslucent(),closed:this.closed})}let c=this.appearanceType;n=new Fn({show:!1,asynchronous:!0,geometryInstances:r.slice(),appearance:new c({material:this.material,translucent:this.material.isTranslucent(),closed:this.closed}),depthFailAppearance:s,shadows:this.shadows}),i.add(n),t=!1}else{l(n)&&(i.remove(n),n=void 0);let s=this.oldPrimitive;l(s)&&(i.remove(s),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=xo.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material,l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Yt)&&(this.depthFailMaterial=xo.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let a=this.updatersWithAttributes.values,s=a.length;for(o=0;o<s;o++){let c=a[o],u=c.entity,f=this.geometry.get(c.id),d=this.attributes.get(f.id.id);if(l(d)||(d=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),l(this.depthFailAppearanceType)&&this.depthFailMaterialProperty instanceof Yt&&!c.depthFailMaterialProperty.isConstant){let A=c.depthFailMaterialProperty.color,b=X.getValueOrDefault(A,e,U.WHITE,Get);U.equals(d._lastDepthFailColor,b)||(d._lastDepthFailColor=U.clone(b,d._lastDepthFailColor),d.depthFailColor=Kt.toValue(b,d.depthFailColor))}let p=u.isShowing&&(c.hasConstantFill||c.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=Dn.toValue(p,d.show));let m=c.distanceDisplayConditionProperty;if(!X.isConstant(m)){let A=X.getValueOrDefault(m,e,Vet,Uet);jt.equals(A,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=jt.clone(A,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=Jn.toValue(A,d.distanceDisplayCondition))}let y=c.terrainOffsetProperty;if(!X.isConstant(y)){let A=X.getValueOrDefault(y,e,jet,Het);h.equals(A,d._lastOffset)||(d._lastOffset=h.clone(A,d._lastOffset),d.offset=yr.toValue(A,d.offset))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};Rh.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=r.entity,a=this.geometry.get(r.id),s=this.attributes.get(a.id.id);l(s)||(s=e.getGeometryInstanceAttributes(a.id),this.attributes.set(a.id.id,s));let c=o.isShowing,u=s.show[0]===1;c!==u&&(s.show=Dn.toValue(c,s.show),a.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};Rh.prototype.contains=function(e){return this.updaters.contains(e.id)};Rh.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return It.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?It.FAILED:(i.boundingSphere.clone(t),It.DONE)};Rh.prototype.destroy=function(){let e=this.primitive,t=this.primitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),this.removeMaterialSubscription()};function sE(e,t,n,i,r){this._items=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=r}sE.prototype.add=function(e,t){let n=this._items,i=n.length;for(let o=0;o<i;o++){let a=n[o];if(a.isMaterial(t)){a.add(e,t);return}}let r=new Rh(this._primitives,this._appearanceType,t.fillMaterialProperty,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);r.add(e,t),n.push(r)};sE.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0;i--){let r=t[i];if(r.remove(e)){r.updaters.length===0&&(t.splice(i,1),r.destroy());break}}};sE.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let o=n[t];if(o.invalidated){n.splice(t,1);let a=o.updaters.values,s=a.length;for(let c=0;c<s;c++)this.add(e,a[c]);o.destroy()}}let r=!0;for(t=0;t<n.length;t++)r=n[t].update(e)&&r;return r};sE.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let r=0;r<i;r++){let o=n[r];if(o.contains(e))return o.getBoundingSphere(e,t)}return It.FAILED};sE.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var Oh=sE;var Wet=new U,qet=new jt,Yet=new jt;function K0(e,t,n,i){this.primitives=e,this.zIndex=i,this.classificationType=t,this.color=n,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new zt,this.updaters=new zt,this.updatersWithAttributes=new zt,this.attributes=new zt,this.subscriptions=new zt,this.showsUpdated=new zt,this.itemsToRemove=[],this.isDirty=!1,this.rectangleCollisionCheck=new nv}K0.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};K0.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),this.rectangleCollisionCheck.insert(n,t.geometry.rectangle),!e.hasConstantFill||!e.fillMaterialProperty.isConstant||!X.isConstant(e.distanceDisplayConditionProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(r,o,a,s){o==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};K0.prototype.remove=function(e){let t=e.id,n=this.geometry.get(t);if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.rectangleCollisionCheck.remove(t,n.geometry.rectangle),this.updatersWithAttributes.remove(t);let i=this.subscriptions.get(t);return l(i)&&(i(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};K0.prototype.update=function(e){let t=!0,n=0,i=this.primitive,r=this.primitives,o;if(this.createPrimitive){let a=this.geometry.values;if(a.length>0)l(i)&&(l(this.oldPrimitive)?r.remove(i):this.oldPrimitive=i),i=new mu({show:!1,asynchronous:!0,geometryInstances:a.slice(),classificationType:this.classificationType}),r.add(i,this.zIndex),t=!1;else{l(i)&&(r.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(r.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(r.remove(this.oldPrimitive),this.oldPrimitive=void 0);let a=this.updatersWithAttributes.values,s=a.length,c=this.waitingOnCreate;for(o=0;o<s;o++){let u=a[o],f=this.geometry.get(u.id),d=this.attributes.get(f.id.id);if(l(d)||(d=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!u.fillMaterialProperty.isConstant||c){let y=u.fillMaterialProperty.color,A=X.getValueOrDefault(y,e,U.WHITE,Wet);U.equals(d._lastColor,A)||(d._lastColor=U.clone(A,d._lastColor),d.color=Kt.toValue(A,d.color))}let p=u.entity.isShowing&&(u.hasConstantFill||u.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=Dn.toValue(p,d.show));let m=u.distanceDisplayConditionProperty;if(!X.isConstant(m)){let y=X.getValueOrDefault(m,e,Yet,qet);jt.equals(y,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=jt.clone(y,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=Jn.toValue(y,d.distanceDisplayCondition))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};K0.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=this.geometry.get(r.id),a=this.attributes.get(o.id.id);l(a)||(a=e.getGeometryInstanceAttributes(o.id),this.attributes.set(o.id.id,a));let s=r.entity.isShowing,c=a.show[0]===1;s!==c&&(a.show=Dn.toValue(s,a.show),o.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};K0.prototype.contains=function(e){return this.updaters.contains(e.id)};K0.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return It.PENDING;let i=n.getBoundingSphere(e.entity);return l(i)?(i.clone(t),It.DONE):It.FAILED};K0.prototype.removeAllPrimitives=function(){let e=this.primitives,t=this.primitive;l(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());let n=this.oldPrimitive;l(n)&&(e.remove(n),this.oldPrimitive=void 0)};function cE(e,t){this._batches=[],this._primitives=e,this._classificationType=t}cE.prototype.add=function(e,t){let n=t.createFillGeometryInstance(e),i=this._batches,r=X.getValueOrDefault(t.zIndex,0),o,a=i.length;for(let s=0;s<a;++s){let c=i[s];if(c.zIndex===r&&!c.overlapping(n.geometry.rectangle)){o=c;break}}return l(o)||(o=new K0(this._primitives,this._classificationType,n.attributes.color.value,r),i.push(o)),o.add(t,n),o};cE.prototype.remove=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;++i)if(t[i].remove(e))return};cE.prototype.update=function(e){let t,n,i=!0,r=this._batches,o=r.length;for(t=0;t<o;++t)i=r[t].update(e)&&i;for(t=0;t<o;++t){let a=r[t],s=a.itemsToRemove,c=s.length;for(let u=0;u<c;u++){n=s[u],a.remove(n);let f=this.add(e,n);a.isDirty=!0,f.isDirty=!0}}for(t=o-1;t>=0;--t){let a=r[t];a.isDirty&&(i=r[t].update(e)&&i,a.isDirty=!1),a.geometry.length===0&&r.splice(t,1)}return i};cE.prototype.getBoundingSphere=function(e,t){let n=this._batches,i=n.length;for(let r=0;r<i;++r){let o=n[r];if(o.contains(e))return o.getBoundingSphere(e,t)}return It.FAILED};cE.prototype.removeAllPrimitives=function(){let e=this._batches,t=e.length;for(let n=0;n<t;++n)e[n].removeAllPrimitives()};var TD=cE;var Xet=new jt,Ket=new jt;function up(e,t,n,i,r,o){this.primitives=e,this.classificationType=t,this.appearanceType=n,this.materialProperty=i,this.updaters=new zt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new zt,this.material=void 0,this.updatersWithAttributes=new zt,this.attributes=new zt,this.subscriptions=new zt,this.showsUpdated=new zt,this.usingSphericalTextureCoordinates=r,this.zIndex=o,this.rectangleCollisionCheck=new nv}up.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};up.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof Yt&&t instanceof Yt?!0:l(t)&&t.equals(n)};up.prototype.add=function(e,t,n){let i=t.id;if(this.updaters.set(i,t),this.geometry.set(i,n),this.rectangleCollisionCheck.insert(i,n.geometry.rectangle),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!X.isConstant(t.distanceDisplayConditionProperty))this.updatersWithAttributes.set(i,t);else{let r=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(o,a,s,c){a==="isShowing"&&r.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};up.prototype.remove=function(e){let t=e.id,n=this.geometry.get(t);if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.rectangleCollisionCheck.remove(t,n.geometry.rectangle),this.updatersWithAttributes.remove(t);let i=this.subscriptions.get(t);return l(i)&&(i(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};up.prototype.update=function(e){let t=!0,n=this.primitive,i=this.primitives,r=this.geometry.values,o;if(this.createPrimitive){if(r.length>0){l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=xo.getValue(e,this.materialProperty,this.material);let s=this.appearanceType;n=new mu({show:!1,asynchronous:!0,geometryInstances:r.slice(),appearance:new s({material:this.material}),classificationType:this.classificationType}),i.add(n,this.zIndex),t=!1}else{l(n)&&(i.remove(n),n=void 0);let s=this.oldPrimitive;l(s)&&(i.remove(s),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=xo.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material;let a=this.updatersWithAttributes.values,s=a.length;for(o=0;o<s;o++){let c=a[o],u=c.entity,f=this.geometry.get(c.id),d=this.attributes.get(f.id.id);l(d)||(d=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d));let p=u.isShowing&&(c.hasConstantFill||c.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=Dn.toValue(p,d.show));let m=c.distanceDisplayConditionProperty;if(!X.isConstant(m)){let y=X.getValueOrDefault(m,e,Ket,Xet);jt.equals(y,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=jt.clone(y,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=Jn.toValue(y,d.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};up.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=r.entity,a=this.geometry.get(r.id),s=this.attributes.get(a.id.id);l(s)||(s=e.getGeometryInstanceAttributes(a.id),this.attributes.set(a.id.id,s));let c=o.isShowing,u=s.show[0]===1;c!==u&&(s.show=Dn.toValue(c,s.show),a.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};up.prototype.contains=function(e){return this.updaters.contains(e.id)};up.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return It.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?It.FAILED:(i.boundingSphere.clone(t),It.DONE)};up.prototype.destroy=function(){let e=this.primitive,t=this.primitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n)};function lE(e,t,n){this._items=[],this._primitives=e,this._classificationType=t,this._appearanceType=n}lE.prototype.add=function(e,t){let n=this._items,i=n.length,r=t.createFillGeometryInstance(e),o=fd.shouldUseSphericalCoordinates(r.geometry.rectangle),a=X.getValueOrDefault(t.zIndex,0);for(let c=0;c<i;++c){let u=n[c];if(u.isMaterial(t)&&u.usingSphericalTextureCoordinates===o&&u.zIndex===a&&!u.overlapping(r.geometry.rectangle)){u.add(e,t,r);return}}let s=new up(this._primitives,this._classificationType,this._appearanceType,t.fillMaterialProperty,o,a);s.add(e,t,r),n.push(s)};lE.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0&&!t[i].remove(e);i--);};lE.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let o=n[t];o.updaters.length===0&&(n.splice(t,1),o.destroy())}let r=!0;for(t=0;t<n.length;t++)r=n[t].update(e)&&r;return r};lE.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let r=0;r<i;r++){let o=n[r];if(o.contains(e))return o.getBoundingSphere(e,t)}return It.FAILED};lE.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var az=lE;var $et=new U,Jet=new jt,Zet=new jt,Qet=h.ZERO,ett=new h;function $0(e,t,n,i){this.translucent=t,this.width=n,this.shadows=i,this.primitives=e,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new zt,this.updaters=new zt,this.updatersWithAttributes=new zt,this.attributes=new zt,this.itemsToRemove=[],this.subscriptions=new zt,this.showsUpdated=new zt}$0.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),!e.hasConstantOutline||!e.outlineColorProperty.isConstant||!X.isConstant(e.distanceDisplayConditionProperty)||!X.isConstant(e.terrainOffsetProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(r,o,a,s){o==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};$0.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 l(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};$0.prototype.update=function(e){let t=!0,n=0,i=this.primitive,r=this.primitives,o;if(this.createPrimitive){let a=this.geometry.values;if(a.length>0)l(i)&&(l(this.oldPrimitive)?r.remove(i):this.oldPrimitive=i),i=new Fn({show:!1,asynchronous:!0,geometryInstances:a.slice(),appearance:new _n({flat:!0,translucent:this.translucent,renderState:{lineWidth:this.width}}),shadows:this.shadows}),r.add(i),t=!1;else{l(i)&&(r.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(r.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(r.remove(this.oldPrimitive),this.oldPrimitive=void 0);let a=this.updatersWithAttributes.values,s=a.length,c=this.waitingOnCreate;for(o=0;o<s;o++){let u=a[o],f=this.geometry.get(u.id),d=this.attributes.get(f.id.id);if(l(d)||(d=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!u.outlineColorProperty.isConstant||c){let A=u.outlineColorProperty,b=X.getValueOrDefault(A,e,U.WHITE,$et);U.equals(d._lastColor,b)||(d._lastColor=U.clone(b,d._lastColor),d.color=Kt.toValue(b,d.color),(this.translucent&&d.color[3]===255||!this.translucent&&d.color[3]!==255)&&(this.itemsToRemove[n++]=u))}let p=u.entity.isShowing&&(u.hasConstantOutline||u.isOutlineVisible(e)),g=d.show[0]===1;p!==g&&(d.show=Dn.toValue(p,d.show));let m=u.distanceDisplayConditionProperty;if(!X.isConstant(m)){let A=X.getValueOrDefault(m,e,Zet,Jet);jt.equals(A,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=jt.clone(A,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=Jn.toValue(A,d.distanceDisplayCondition))}let y=u.terrainOffsetProperty;if(!X.isConstant(y)){let A=X.getValueOrDefault(y,e,Qet,ett);h.equals(A,d._lastOffset)||(d._lastOffset=h.clone(A,d._lastOffset),d.offset=yr.toValue(A,d.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};$0.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=this.geometry.get(r.id),a=this.attributes.get(o.id.id);l(a)||(a=e.getGeometryInstanceAttributes(o.id),this.attributes.set(o.id.id,a));let s=r.entity.isShowing,c=a.show[0]===1;s!==c&&(a.show=Dn.toValue(s,a.show),o.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};$0.prototype.contains=function(e){return this.updaters.contains(e.id)};$0.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return It.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?It.FAILED:(i.boundingSphere.clone(t),It.DONE)};$0.prototype.removeAllPrimitives=function(){let e=this.primitives,t=this.primitive;l(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());let n=this.oldPrimitive;l(n)&&(e.remove(n),this.oldPrimitive=void 0)};function uE(e,t,n){this._primitives=e,this._scene=t,this._shadows=n,this._solidBatches=new zt,this._translucentBatches=new zt}uE.prototype.add=function(e,t){let n=t.createOutlineGeometryInstance(e),i=this._scene.clampLineWidth(t.outlineWidth),r,o;n.attributes.color.value[3]===255?(r=this._solidBatches,o=r.get(i),l(o)||(o=new $0(this._primitives,!1,i,this._shadows),r.set(i,o)),o.add(t,n)):(r=this._translucentBatches,o=r.get(i),l(o)||(o=new $0(this._primitives,!0,i,this._shadows),r.set(i,o)),o.add(t,n))};uE.prototype.remove=function(e){let t,n=this._solidBatches.values,i=n.length;for(t=0;t<i;t++)if(n[t].remove(e))return;let r=this._translucentBatches.values,o=r.length;for(t=0;t<o;t++)if(r[t].remove(e))return};uE.prototype.update=function(e){let t,n,i,r,o=this._solidBatches.values,a=o.length,s=this._translucentBatches.values,c=s.length,u,f=!0,d;do{for(d=!1,n=0;n<a;n++){r=o[n],f=r.update(e),u=r.itemsToRemove;let p=u.length;if(p>0)for(d=!0,t=0;t<p;t++)i=u[t],r.remove(i),this.add(e,i)}for(n=0;n<c;n++){r=s[n],f=r.update(e),u=r.itemsToRemove;let p=u.length;if(p>0)for(d=!0,t=0;t<p;t++)i=u[t],r.remove(i),this.add(e,i)}}while(d);return f};uE.prototype.getBoundingSphere=function(e,t){let n,i=this._solidBatches.values,r=i.length;for(n=0;n<r;n++){let s=i[n];if(s.contains(e))return s.getBoundingSphere(e,t)}let o=this._translucentBatches.values,a=o.length;for(n=0;n<a;n++){let s=o[n];if(s.contains(e))return s.getBoundingSphere(e,t)}return It.FAILED};uE.prototype.removeAllPrimitives=function(){let e,t=this._solidBatches.values,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._translucentBatches.values,r=i.length;for(e=0;e<r;e++)i[e].removeAllPrimitives()};var CD=uE;var ttt=[];function bu(e,t,n,i){n=n??e.primitives,i=i??e.groundPrimitives,this._scene=e,this._primitives=n,this._groundPrimitives=i,this._entityCollection=void 0,this._addedObjects=new zt,this._removedObjects=new zt,this._changedObjects=new zt;let r=Rn.NUMBER_OF_SHADOW_MODES;this._outlineBatches=new Array(r*2),this._closedColorBatches=new Array(r*2),this._closedMaterialBatches=new Array(r*2),this._openColorBatches=new Array(r*2),this._openMaterialBatches=new Array(r*2);let o=$r.supportsMaterialsforEntitiesOnTerrain(e);this._supportsMaterialsforEntitiesOnTerrain=o;let a;for(a=0;a<r;++a)this._outlineBatches[a]=new CD(n,e,a,!1),this._outlineBatches[r+a]=new CD(n,e,a,!0),this._closedColorBatches[a]=new Dh(n,_n,void 0,!0,a,!0),this._closedColorBatches[r+a]=new Dh(n,_n,void 0,!0,a,!1),this._closedMaterialBatches[a]=new Oh(n,Ar,void 0,!0,a,!0),this._closedMaterialBatches[r+a]=new Oh(n,Ar,void 0,!0,a,!1),this._openColorBatches[a]=new Dh(n,_n,void 0,!1,a,!0),this._openColorBatches[r+a]=new Dh(n,_n,void 0,!1,a,!1),this._openMaterialBatches[a]=new Oh(n,Ar,void 0,!1,a,!0),this._openMaterialBatches[r+a]=new Oh(n,Ar,void 0,!1,a,!1);let s=Zn.NUMBER_OF_CLASSIFICATION_TYPES,c=new Array(s),u=[];if(o)for(a=0;a<s;++a)u.push(new az(i,a,Ar)),c[a]=new TD(i,a);else for(a=0;a<s;++a)c[a]=new TD(i,a);this._groundColorBatches=c,this._groundMaterialBatches=u,this._dynamicBatch=new Wv(n,i),this._batches=this._outlineBatches.concat(this._closedColorBatches,this._closedMaterialBatches,this._openColorBatches,this._openMaterialBatches,this._groundColorBatches,this._groundMaterialBatches,this._dynamicBatch),this._subscriptions=new zt,this._updaterSets=new zt,this._entityCollection=t,t.collectionChanged.addEventListener(bu.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,ttt)}bu.registerUpdater=function(e){oE.registerUpdater(e)};bu.unregisterUpdater=function(e){oE.unregisterUpdater(e)};bu.prototype.update=function(e){let t=this._addedObjects,n=t.values,i=this._removedObjects,r=i.values,o=this._changedObjects,a=o.values,s,c,u,f,d=this;for(s=a.length-1;s>-1;s--)c=a[s],u=c.id,f=this._updaterSets.get(u),f.entity===c?f.forEach(function(y){d._removeUpdater(y),d._insertUpdaterIntoBatch(e,y)}):(r.push(c),n.push(c));for(s=r.length-1;s>-1;s--)c=r[s],u=c.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(s=n.length-1;s>-1;s--)c=n[s],u=c.id,f=new oE(c,this._scene),this._updaterSets.set(u,f),f.forEach(function(y){d._insertUpdaterIntoBatch(e,y)}),this._subscriptions.set(u,f.geometryChanged.addEventListener(bu._onGeometryChanged,this));t.removeAll(),i.removeAll(),o.removeAll();let p=!0,g=this._batches,m=g.length;for(s=0;s<m;s++)p=g[s].update(e)&&p;return p};var ntt=[],itt=new se;bu.prototype.getBoundingSphere=function(e,t){let n=ntt,i=itt,r=0,o,a=this._batches,s=a.length,c=e.id,u=this._updaterSets.get(c).updaters;for(let f=0;f<u.length;f++){let d=u[f];for(let p=0;p<s;p++){if(o=a[p].getBoundingSphere(d,i),o===It.PENDING)return It.PENDING;o===It.DONE&&(n[r]=se.clone(i,n[r]),r++)}}return r===0?It.FAILED:(n.length=r,se.fromBoundingSpheres(n,t),It.DONE)};bu.prototype.isDestroyed=function(){return!1};bu.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(bu.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();let e,t=this._batches,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._subscriptions.values;for(n=i.length,e=0;e<n;e++)i[e]();this._subscriptions.removeAll();let r=this._updaterSets.values;for(n=r.length,e=0;e<n;e++)r[e].destroy();return this._updaterSets.removeAll(),ue(this)};bu.prototype._removeUpdater=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;i++)t[i].remove(e)};bu.prototype._insertUpdaterIntoBatch=function(e,t){if(t.isDynamic){this._dynamicBatch.add(e,t);return}let n;(t.outlineEnabled||t.fillEnabled)&&(n=t.shadowsProperty.getValue(e));let i=Rn.NUMBER_OF_SHADOW_MODES;if(t.outlineEnabled&&(l(t.terrainOffsetProperty)?this._outlineBatches[i+n].add(e,t):this._outlineBatches[n].add(e,t)),t.fillEnabled)if(t.onTerrain){let r=t.classificationTypeProperty.getValue(e);t.fillMaterialProperty instanceof Yt?this._groundColorBatches[r].add(e,t):this._groundMaterialBatches[r].add(e,t)}else t.isClosed?t.fillMaterialProperty instanceof Yt?l(t.terrainOffsetProperty)?this._closedColorBatches[i+n].add(e,t):this._closedColorBatches[n].add(e,t):l(t.terrainOffsetProperty)?this._closedMaterialBatches[i+n].add(e,t):this._closedMaterialBatches[n].add(e,t):t.fillMaterialProperty instanceof Yt?l(t.terrainOffsetProperty)?this._openColorBatches[i+n].add(e,t):this._openColorBatches[n].add(e,t):l(t.terrainOffsetProperty)?this._openMaterialBatches[i+n].add(e,t):this._openMaterialBatches[n].add(e,t)};bu._onGeometryChanged=function(e){let t=this._removedObjects,n=this._changedObjects,i=e.entity,r=i.id;!l(t.get(r))&&!l(n.get(r))&&n.set(r,i)};bu.prototype._onCollectionChanged=function(e,t,n){let i=this._addedObjects,r=this._removedObjects,o=this._changedObjects,a,s,c;for(a=n.length-1;a>-1;a--)c=n[a],s=c.id,i.remove(s)||(r.set(s,c),o.remove(s));for(a=t.length-1;a>-1;a--)c=t[a],s=c.id,r.remove(s)?o.set(s,c):i.set(s,c)};var sz=bu;var rtt=1,ott="30px sans-serif",att=bo.FILL,stt=U.WHITE,ctt=U.BLACK,ltt=1,utt=!1,ftt=new U(.165,.165,.165,.8),dtt=new k(7,5),htt=k.ZERO,mtt=h.ZERO,ptt=it.NONE,gtt=ji.CENTER,_tt=Wn.CENTER,ytt=new h,Att=new U,btt=new U,xtt=new U,Ttt=new k,Ctt=new h,vtt=new k,Ett=new Wt,Stt=new Wt,wtt=new Wt,Itt=new jt;function _ye(e){this.entity=e,this.label=void 0,this.index=void 0}function gy(e,t){t.collectionChanged.addEventListener(gy.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new zt,this._onCollectionChanged(t,t.values,[],[])}gy.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,r=t.length;i<r;i++){let o=t[i],a=o.entity,s=a._label,c,u=o.label,f=a.isShowing&&a.isAvailable(e)&&X.getValueOrDefault(s._show,e,!0),d;if(f&&(d=X.getValueOrUndefined(a._position,e,ytt),c=X.getValueOrUndefined(s._text,e),f=l(d)&&l(c)),!f){uJ(o,a,n);continue}X.isConstant(a._position)||(n._clusterDirty=!0);let p=!1,g=X.getValueOrDefault(s._heightReference,e,ptt);l(u)||(u=n.getLabel(a),u.id=a,o.label=u,p=h.equals(u.position,d)&&u.heightReference===g),u.show=!0,u.position=d,u.text=c,u.scale=X.getValueOrDefault(s._scale,e,rtt),u.font=X.getValueOrDefault(s._font,e,ott),u.style=X.getValueOrDefault(s._style,e,att),u.fillColor=X.getValueOrDefault(s._fillColor,e,stt,Att),u.outlineColor=X.getValueOrDefault(s._outlineColor,e,ctt,btt),u.outlineWidth=X.getValueOrDefault(s._outlineWidth,e,ltt),u.showBackground=X.getValueOrDefault(s._showBackground,e,utt),u.backgroundColor=X.getValueOrDefault(s._backgroundColor,e,ftt,xtt),u.backgroundPadding=X.getValueOrDefault(s._backgroundPadding,e,dtt,Ttt),u.pixelOffset=X.getValueOrDefault(s._pixelOffset,e,htt,vtt),u.eyeOffset=X.getValueOrDefault(s._eyeOffset,e,mtt,Ctt),u.heightReference=g,u.horizontalOrigin=X.getValueOrDefault(s._horizontalOrigin,e,gtt),u.verticalOrigin=X.getValueOrDefault(s._verticalOrigin,e,_tt),u.translucencyByDistance=X.getValueOrUndefined(s._translucencyByDistance,e,Ett),u.pixelOffsetScaleByDistance=X.getValueOrUndefined(s._pixelOffsetScaleByDistance,e,Stt),u.scaleByDistance=X.getValueOrUndefined(s._scaleByDistance,e,wtt),u.distanceDisplayCondition=X.getValueOrUndefined(s._distanceDisplayCondition,e,Itt),u.disableDepthTestDistance=X.getValueOrUndefined(s._disableDepthTestDistance,e),p&&u._updateClamping()}return!0};gy.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!l(n.label))return It.FAILED;let i=n.label;return t.center=h.clone(i._clampedPosition??i.position,t.center),t.radius=0,It.DONE};gy.prototype.isDestroyed=function(){return!1};gy.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(gy.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeLabel(e[t]);return ue(this)};gy.prototype._onCollectionChanged=function(e,t,n,i){let r,o,a=this._items,s=this._cluster;for(r=t.length-1;r>-1;r--)o=t[r],l(o._label)&&l(o._position)&&a.set(o.id,new _ye(o));for(r=i.length-1;r>-1;r--)o=i[r],l(o._label)&&l(o._position)?a.contains(o.id)||a.set(o.id,new _ye(o)):(uJ(a.get(o.id),o,s),a.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],uJ(a.get(o.id),o,s),a.remove(o.id)};function uJ(e,t,n){l(e)&&(e.label=void 0,n.removeLabel(t))}var cz=gy;var fE={HIGHLIGHT:0,REPLACE:1,MIX:2};fE.getColorBlend=function(e,t){if(e===fE.HIGHLIGHT)return 0;if(e===fE.REPLACE)return 1;if(e===fE.MIX)return I.clamp(t,I.EPSILON4,1)};Object.freeze(fE);var Ml=fE;function dE(e,t){this._distance=t,this._normal=new yye(e,this),this.onChangeCallback=void 0,this.index=-1}Object.defineProperties(dE.prototype,{distance:{get:function(){return this._distance},set:function(e){l(this.onChangeCallback)&&e!==this._distance&&this.onChangeCallback(this.index),this._distance=e}},normal:{get:function(){return this._normal},set:function(e){l(this.onChangeCallback)&&!h.equals(this._normal._cartesian3,e)&&this.onChangeCallback(this.index),h.clone(e,this._normal._cartesian3)}}});dE.fromPlane=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance):t=new dE(e.normal,e.distance),t};dE.clone=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance,t):new dE(e.normal,e.distance)};function yye(e,t){this._clippingPlane=t,this._cartesian3=h.clone(e)}Object.defineProperties(yye.prototype,{x:{get:function(){return this._cartesian3.x},set:function(e){l(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){l(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){l(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.z&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.z=e}}});var ls=dE;function Jc(e){e=e??H.EMPTY_OBJECT,this._planes=[],this._dirtyIndex=-1,this._multipleDirtyPlanes=!1,this._enabled=e.enabled??!0,this.modelMatrix=O.clone(e.modelMatrix??O.IDENTITY),this.edgeColor=U.clone(e.edgeColor??U.WHITE),this.edgeWidth=e.edgeWidth??0,this.planeAdded=new be,this.planeRemoved=new be,this._owner=void 0;let t=e.unionClippingRegions??!1;this._unionClippingRegions=t,this._testIntersection=t?Cye:vye,this._uint8View=void 0,this._float32View=void 0,this._clippingPlanesTexture=void 0;let n=e.planes;if(l(n)){let i=n.length;for(let r=0;r<i;++r)this.add(n[r])}}function Cye(e){return e===Xt.OUTSIDE}function vye(e){return e===Xt.INSIDE}Object.defineProperties(Jc.prototype,{length:{get:function(){return this._planes.length}},unionClippingRegions:{get:function(){return this._unionClippingRegions},set:function(e){this._unionClippingRegions!==e&&(this._unionClippingRegions=e,this._testIntersection=e?Cye:vye)}},enabled:{get:function(){return this._enabled},set:function(e){this._enabled!==e&&(this._enabled=e)}},texture:{get:function(){return this._clippingPlanesTexture}},owner:{get:function(){return this._owner}},clippingPlanesState:{get:function(){return this._unionClippingRegions?this._planes.length:-this._planes.length}}});function Aye(e,t){e._multipleDirtyPlanes=e._multipleDirtyPlanes||e._dirtyIndex!==-1&&e._dirtyIndex!==t,e._dirtyIndex=t}Jc.prototype.add=function(e){let t=this._planes.length,n=this;e.onChangeCallback=function(i){Aye(n,i)},e.index=t,Aye(this,t),this._planes.push(e),this.planeAdded.raiseEvent(e,t)};Jc.prototype.get=function(e){return this._planes[e]};function Eye(e,t){let n=e.length;for(let i=0;i<n;++i)if(tn.equals(e[i],t))return i;return-1}Jc.prototype.contains=function(e){return Eye(this._planes,e)!==-1};Jc.prototype.remove=function(e){let t=this._planes,n=Eye(t,e);if(n===-1)return!1;e instanceof ls&&(e.onChangeCallback=void 0,e.index=-1);let i=t.length-1;for(let r=n;r<i;++r){let o=t[r+1];t[r]=o,o instanceof ls&&(o.index=r)}return this._multipleDirtyPlanes=!0,t.length=i,this.planeRemoved.raiseEvent(e,n),!0};Jc.prototype.removeAll=function(){let e=this._planes,t=e.length;for(let n=0;n<t;++n){let i=e[n];i instanceof ls&&(i.onChangeCallback=void 0,i.index=-1),this.planeRemoved.raiseEvent(i,n)}this._multipleDirtyPlanes=!0,this._planes=[]};var Ptt=new ae,Dtt=new ae;function bye(e,t,n){let i=e._uint8View,r=e._planes,o=0;for(let a=t;a<n;++a){let s=r[a],c=an.octEncodeToCartesian4(s.normal,Dtt);i[o]=c.x,i[o+1]=c.y,i[o+2]=c.z,i[o+3]=c.w;let u=ae.packFloat(s.distance,Ptt);i[o+4]=u.x,i[o+5]=u.y,i[o+6]=u.z,i[o+7]=u.w,o+=8}}function xye(e,t,n){let i=e._float32View,r=e._planes,o=0;for(let a=t;a<n;++a){let s=r[a],c=s.normal;i[o]=c.x,i[o+1]=c.y,i[o+2]=c.z,i[o+3]=s.distance,o+=4}}function Sye(e,t){let n=Ft.maximumTextureSize;return t.x=Math.min(e,n),t.y=Math.ceil(e/t.x),t}var Rtt=new k;Jc.prototype.update=function(e){let t=this._clippingPlanesTexture,n=e.context,i=Jc.useFloatTexture(n),r=i?this.length:this.length*2;if(l(t)){let a=t.width*t.height;(a<r||r<.25*a)&&(t.destroy(),t=void 0,this._clippingPlanesTexture=void 0)}if(this.length===0)return;if(!l(t)){let a=Sye(r,Rtt);a.y*=2,i?(t=new Et({context:n,width:a.x,height:a.y,pixelFormat:He.RGBA,pixelDatatype:ke.FLOAT,sampler:Ut.NEAREST,flipY:!1}),this._float32View=new Float32Array(a.x*a.y*4)):(t=new Et({context:n,width:a.x,height:a.y,pixelFormat:He.RGBA,pixelDatatype:ke.UNSIGNED_BYTE,sampler:Ut.NEAREST,flipY:!1}),this._uint8View=new Uint8Array(a.x*a.y*4)),this._clippingPlanesTexture=t,this._multipleDirtyPlanes=!0}let o=this._dirtyIndex;if(!(!this._multipleDirtyPlanes&&o===-1)){if(this._multipleDirtyPlanes)i?(xye(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._float32View}})):(bye(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._uint8View}}));else{let a,s;i?(s=Math.floor(o/t.width),a=Math.floor(o-s*t.width),xye(this,o,o+1),t.copyFrom({source:{width:1,height:1,arrayBufferView:this._float32View},xOffset:a,yOffset:s})):(s=Math.floor(o*2/t.width),a=Math.floor(o*2-s*t.width),bye(this,o,o+1),t.copyFrom({source:{width:2,height:1,arrayBufferView:this._uint8View},xOffset:a,yOffset:s}))}this._multipleDirtyPlanes=!1,this._dirtyIndex=-1}};var Ott=new O,Tye=new tn(h.UNIT_X,0);Jc.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._planes,i=n.length,r=this.modelMatrix;l(t)&&(r=O.multiply(t,r,Ott));let o=Xt.INSIDE;!this.unionClippingRegions&&i>0&&(o=Xt.OUTSIDE);for(let a=0;a<i;++a){let s=n[a];tn.transform(s,r,Tye);let c=e.intersectPlane(Tye);if(c===Xt.INTERSECTING)o=c;else if(this._testIntersection(c))return c}return o};Jc.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};Jc.useFloatTexture=function(e){return e.floatingPointTexture};Jc.getTextureResolution=function(e,t,n){let i=e.texture;if(l(i))return n.x=i.width,n.y=i.height,n;let r=Jc.useFloatTexture(t)?e.length:e.length*2,o=Sye(r,n);return o.y*=2,o};Jc.prototype.isDestroyed=function(){return!1};Jc.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),ue(this)};var va=Jc;function Jb(e){this._ellipsoid=e.ellipsoid??te.default,this._positions=Iye(e.positions),this._cachedPositions=void 0,this._cachedRectangle=void 0}function Iye(e){if(!l(e))return;let t=e.length,n=Array(t);for(let i=0;i<t;i++)n[i]=h.clone(e[i]);return n}function Mtt(e,t){if(!l(e)&&!l(t))return!0;if(l(e)!==l(t)||e.length!==t.length)return!1;let n=e.length;for(let i=0;i<n;i++){let r=e[i],o=t[i];if(!h.equals(r,o))return!1}return!0}Object.defineProperties(Jb.prototype,{length:{get:function(){return this._positions.length}},positions:{get:function(){return this._positions}},ellipsoid:{get:function(){return this._ellipsoid}}});Jb.clone=function(e,t){return l(t)?(t._ellipsoid=e.ellipsoid,t._positions.length=0,t._positions.push(...e.positions),t):new Jb({positions:e.positions,ellipsoid:e.ellipsoid})};Jb.equals=function(e,t){return e.ellipsoid.equals(t.ellipsoid)&&e.positions===t.positions};Jb.prototype.computeRectangle=function(e){if(Mtt(this._positions,this._cachedPositions))return ie.clone(this._cachedRectangle,e);let t=U_.computeRectangleFromPositions(this.positions,this.ellipsoid,void 0,e);return this._cachedPositions=Iye(this._positions),this._cachedRectangle=ie.clone(t),t};var Ltt=new ie,wye=new h;Jb.prototype.computeSphericalExtents=function(e){l(e)||(e=new ie);let t=this.computeRectangle(Ltt),n=de.toCartesian(ie.southwest(t),this.ellipsoid,wye),i=Math.sqrt(n.x*n.x+n.y*n.y),r=I.fastApproximateAtan2(i,n.z),o=I.fastApproximateAtan2(n.x,n.y);return e.south=r,e.west=o,n=de.toCartesian(ie.northeast(t),this.ellipsoid,wye),i=Math.sqrt(n.x*n.x+n.y*n.y),r=I.fastApproximateAtan2(i,n.z),o=I.fastApproximateAtan2(n.x,n.y),e.north=r,e.east=o,e};var vD=Jb;var lz=`in vec2 v_textureCoordinates;
|
|
|
|
uniform int u_polygonsLength;
|
|
uniform int u_extentsLength;
|
|
uniform highp sampler2D u_polygonTexture;
|
|
uniform highp sampler2D u_extentsTexture;
|
|
|
|
int getPolygonIndex(float dimension, vec2 coord) {
|
|
vec2 uv = coord.xy * dimension;
|
|
return int(floor(uv.y) * dimension + floor(uv.x));
|
|
}
|
|
|
|
vec2 getLookupUv(ivec2 dimensions, int i) {
|
|
int pixY = i / dimensions.x;
|
|
int pixX = i - (pixY * dimensions.x);
|
|
float pixelWidth = 1.0 / float(dimensions.x);
|
|
float pixelHeight = 1.0 / float(dimensions.y);
|
|
float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel
|
|
float v = (float(pixY) + 0.5) * pixelHeight;
|
|
return vec2(u, v);
|
|
}
|
|
|
|
vec4 getExtents(int i) {
|
|
return texture(u_extentsTexture, getLookupUv(textureSize(u_extentsTexture, 0), i));
|
|
}
|
|
|
|
ivec2 getPositionsLengthAndExtentsIndex(int i) {
|
|
vec2 uv = getLookupUv(textureSize(u_polygonTexture, 0), i);
|
|
vec4 value = texture(u_polygonTexture, uv);
|
|
return ivec2(int(value.x), int(value.y));
|
|
}
|
|
|
|
vec2 getPolygonPosition(int i) {
|
|
vec2 uv = getLookupUv(textureSize(u_polygonTexture, 0), i);
|
|
return texture(u_polygonTexture, uv).xy;
|
|
}
|
|
|
|
vec2 getCoordinates(vec2 textureCoordinates, vec4 extents) {
|
|
float latitude = mix(extents.x, extents.x + 1.0 / extents.z, textureCoordinates.y);
|
|
float longitude = mix(extents.y, extents.y + 1.0 / extents.w, textureCoordinates.x);
|
|
return vec2(latitude, longitude);
|
|
}
|
|
|
|
void main() {
|
|
int lastPolygonIndex = 0;
|
|
out_FragColor = vec4(1.0);
|
|
|
|
// Get the relevant region of the texture
|
|
float dimension = float(u_extentsLength);
|
|
if (u_extentsLength > 2) {
|
|
dimension = ceil(log2(float(u_extentsLength)));
|
|
}
|
|
int regionIndex = getPolygonIndex(dimension, v_textureCoordinates);
|
|
|
|
if (regionIndex >= u_extentsLength) {
|
|
return; // done (no polygons in this region)
|
|
}
|
|
|
|
for (int polygonIndex = 0; polygonIndex < u_polygonsLength; polygonIndex++) {
|
|
ivec2 positionsLengthAndExtents = getPositionsLengthAndExtentsIndex(lastPolygonIndex);
|
|
int positionsLength = positionsLengthAndExtents.x;
|
|
int polygonExtentsIndex = positionsLengthAndExtents.y;
|
|
lastPolygonIndex += 1;
|
|
|
|
// Read the individual polygon extent (2 pixels: south/west, latRange/lonRange)
|
|
vec2 extentsSouthWest = getPolygonPosition(lastPolygonIndex);
|
|
vec2 extentsRange = getPolygonPosition(lastPolygonIndex + 1);
|
|
vec4 polygonExtent = vec4(extentsSouthWest, extentsRange);
|
|
lastPolygonIndex += 2;
|
|
|
|
if (polygonExtentsIndex < regionIndex) {
|
|
lastPolygonIndex += positionsLength;
|
|
continue; // skip to next (TODO: could optimize further if we knew how many polygons to skip)
|
|
} else if (polygonExtentsIndex > regionIndex) {
|
|
break; // done (we know polygons are sorted by regionIndex)
|
|
}
|
|
|
|
// Only compute signed distance for the relevant part of the atlas
|
|
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); // current pixel position
|
|
|
|
// Only consider polygons whos boundingbox includes current pixel (with a slight padding)
|
|
float padding = 0.05; // 5% of polygon extents
|
|
float polygonNorth = polygonExtent.x + polygonExtent.z;
|
|
float polygonEast = polygonExtent.y + polygonExtent.w;
|
|
float latPadding = padding * polygonExtent.z; // padding as fraction of latitude range
|
|
float lonPadding = padding * polygonExtent.w; // padding as fraction of longitude range
|
|
if (p.x < polygonExtent.x - latPadding || p.x > polygonNorth + latPadding ||
|
|
p.y < polygonExtent.y - lonPadding || p.y > polygonEast + lonPadding) {
|
|
lastPolygonIndex += positionsLength;
|
|
continue; // skip to next
|
|
}
|
|
|
|
float s = 1.0;
|
|
|
|
// Check each edge for absolute distance.
|
|
// Cache the previous vertex to halve the texture reads per iteration.
|
|
vec2 prev = getPolygonPosition(lastPolygonIndex + positionsLength - 1);
|
|
for (int i = 0; i < positionsLength; i++) {
|
|
vec2 a = getPolygonPosition(lastPolygonIndex + i);
|
|
vec2 b = prev;
|
|
prev = a;
|
|
|
|
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);
|
|
|
|
// Inside / outside computation to determine sign
|
|
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;
|
|
}
|
|
}
|
|
|
|
// Normalize the range to [0,1]
|
|
vec4 result = (s * vec4(clipAmount * length(extents.zw))) / 2.0 + 0.5;
|
|
// In the case where we've iterated through multiple polygons, take the minimum
|
|
out_FragColor = min(out_FragColor, result);
|
|
|
|
lastPolygonIndex += positionsLength;
|
|
}
|
|
}`;function Ea(e){e=e??H.EMPTY_OBJECT,this._polygons=[],this._totalPositions=0,this.debugShowDistanceTexture=e.debugShowDistanceTexture??!1,this.enabled=e.enabled??!0,this.inverse=e.inverse??!1,this.quality=e.quality??1,this.polygonAdded=new be,this.polygonRemoved=new be,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(l(t)){let n=t.length;for(let i=0;i<n;++i)this._polygons.push(t[i])}}Object.defineProperties(Ea.prototype,{length:{get:function(){return this._polygons.length}},totalPositions:{get:function(){return this._totalPositions}},extentsTexture:{get:function(){return this._extentsTexture}},extentsCount:{get:function(){return this._extentsCount}},pixelsNeededForExtents:{get:function(){return this.length}},pixelsNeededForPolygonPositions:{get:function(){return this.totalPositions+3*this.length}},clippingTexture:{get:function(){return this._signedDistanceTexture}},owner:{get:function(){return this._owner}},clippingPolygonsState:{get:function(){return this.inverse?-this.extentsCount:this.extentsCount}}});Ea.prototype.add=function(e){let t=this._polygons.length;return this._polygons.push(e),this.polygonAdded.raiseEvent(e,t),e};Ea.prototype.get=function(e){return this._polygons[e]};Ea.prototype.contains=function(e){return this._polygons.some(t=>vD.equals(t,e))};Ea.prototype.remove=function(e){let t=this._polygons,n=t.findIndex(i=>vD.equals(i,e));return n===-1?!1:(t.splice(n,1),this.polygonRemoved.raiseEvent(e,n),!0)};function Ntt(e,t,n){let i=Math.max(e.height*t,0),r=Math.max(e.width*t,0),o=ie.clone(e,n);return o.south-=i,o.west-=r,o.north+=i,o.east+=r,o.south=Math.max(o.south,-Math.PI),o.west=Math.max(o.west,-Math.PI),o.north=Math.min(o.north,Math.PI),o.east=Math.min(o.east,Math.PI),o}function Ftt(e,t){let i=[],r=e.length;for(let s=0;s<r;++s){let c=Ntt(t[s],2.5),u=-1;for(let f=0;f<i.length;++f)if(l(ie.simpleIntersection(i[f].extent,c))){u=f;break}if(u===-1)i.push({extent:c,polygonIndices:[s]});else{let f=i[u];f.polygonIndices.push(s),ie.union(f.extent,c,f.extent);for(let d=0;d<i.length;++d)d!==u&&l(ie.simpleIntersection(i[d].extent,f.extent))&&(f.polygonIndices.push(...i[d].polygonIndices),ie.union(f.extent,i[d].extent,f.extent),i.splice(d,1),d<u&&u--,d=-1)}}let o=i.map(s=>s.extent),a=new Map;return i.forEach((s,c)=>s.polygonIndices.forEach(u=>a.set(u,c))),{extentsList:o,extentsIndexByPolygon:a}}Ea.prototype.removeAll=function(){let e=this._polygons,t=e.length;for(let n=0;n<t;++n){let i=e[n];this.polygonRemoved.raiseEvent(i,n)}this._polygons=[]};function Btt(e){let t=e._float32View,n=e._extentsFloat32View,i=e._polygons,r=i.map(f=>f.computeSphericalExtents()),{extentsList:o,extentsIndexByPolygon:a}=Ftt(i,r),s=Array.from(i.keys()).sort((f,d)=>a.get(f)-a.get(d)),c=0;for(let f of s){let d=i[f],p=d.length;t[c++]=p,t[c++]=a.get(f);let g=r[f];t[c++]=g.south,t[c++]=g.west,t[c++]=g.north-g.south,t[c++]=g.east-g.west;for(let m=0;m<p;++m){let y=d.positions[m],A=Math.hypot(y.x,y.y),b=I.fastApproximateAtan2(A,y.z),x=I.fastApproximateAtan2(y.x,y.y);t[c++]=b,t[c++]=x}}let u=0;for(let f of o){let d=1/(f.east-f.west),p=1/(f.north-f.south);n[u++]=f.south,n[u++]=f.west,n[u++]=p,n[u++]=d}e._extentsCount=o.length}var fJ=new k;Ea.prototype.update=function(e){let t=e.context;if(!Ea.isSupported(e))throw new oe("ClippingPolygonCollections are only supported for WebGL 2.");this.debugShowDistanceTexture&&l(this._signedDistanceTexture)&&(l(this.debugCommand)||(this.debugCommand=ktt(this._signedDistanceTexture,e.context)),e.commandList.push(this.debugCommand));let n=this._polygons.reduce((a,s)=>a+s.length,0);if(n===this.totalPositions||(this._totalPositions=n,this.length===0))return;l(this._signedDistanceComputeCommand)&&(this._signedDistanceComputeCommand.canceled=!0,this._signedDistanceComputeCommand=void 0);let i=this._polygonsTexture,r=this._extentsTexture,o=this._signedDistanceTexture;if(l(i)){let a=i.width*i.height;(a<this.pixelsNeededForPolygonPositions||this.pixelsNeededForPolygonPositions<.25*a)&&(i.destroy(),i=void 0,this._polygonsTexture=void 0)}if(!l(i)){let a=Ea.getTextureResolution(i,this.pixelsNeededForPolygonPositions,fJ);i=new Et({context:t,width:a.x,height:a.y,pixelFormat:He.RG,pixelDatatype:ke.FLOAT,sampler:Ut.NEAREST,flipY:!1}),this._float32View=new Float32Array(a.x*a.y*2),this._polygonsTexture=i}if(l(r)){let a=r.width*r.height;(a<this.pixelsNeededForExtents||this.pixelsNeededForExtents<.25*a)&&(r.destroy(),r=void 0,this._extentsTexture=void 0)}if(!l(r)){let a=Ea.getTextureResolution(r,this.pixelsNeededForExtents,fJ);r=new Et({context:t,width:a.x,height:a.y,pixelFormat:He.RGBA,pixelDatatype:ke.FLOAT,sampler:Ut.NEAREST,flipY:!1}),this._extentsFloat32View=new Float32Array(a.x*a.y*4),this._extentsTexture=r}if(Btt(this),r.copyFrom({source:{width:r.width,height:r.height,arrayBufferView:this._extentsFloat32View}}),i.copyFrom({source:{width:i.width,height:i.height,arrayBufferView:this._float32View}}),!l(o)){let a=Ea.getClippingDistanceTextureResolution(this,fJ);o=new Et({context:t,width:a.x,height:a.y,pixelFormat:t.webgl2?He.RED:He.LUMINANCE,pixelDatatype:ke.FLOAT,sampler:new Ut({wrapS:on.CLAMP_TO_EDGE,wrapT:on.CLAMP_TO_EDGE,minificationFilter:Gt.LINEAR,magnificationFilter:ni.LINEAR}),flipY:!1}),this._signedDistanceTexture=o}this._signedDistanceComputeCommand=ztt(this)};function ktt(e,t){let i=t.createViewportQuadCommand(`uniform highp sampler2D billboard_texture;
|
|
in vec2 v_textureCoordinates;
|
|
float getSignedDistance(vec2 uv, highp sampler2D clippingDistance) {
|
|
float signedDistance = texture(clippingDistance, uv).r;
|
|
return (signedDistance - 0.5) * 2.0;
|
|
}
|
|
void main()
|
|
{
|
|
float dist = texture(billboard_texture, v_textureCoordinates).r;
|
|
if (dist > 0.5) {
|
|
out_FragColor = vec4(dist, 0.0, 0.0, 1.0);
|
|
} else {
|
|
out_FragColor = vec4(0.0, dist, 0.0, 1.0);
|
|
}
|
|
}
|
|
`,{uniformMap:{billboard_texture:function(){return e}}});return i.pass=Pe.OVERLAY,i}Ea.prototype.queueCommands=function(e){l(this._signedDistanceComputeCommand)&&e.commandList.push(this._signedDistanceComputeCommand)};function ztt(e){let t=e._polygonsTexture,n=e._extentsTexture;return new lu({fragmentShaderSource:lz,outputTexture:e._signedDistanceTexture,uniformMap:{u_polygonsLength:function(){return e.length},u_extentsLength:function(){return e.extentsCount},u_extentsTexture:function(){return n},u_polygonTexture:function(){return t}},persists:!1,owner:e,postExecute:()=>{e._signedDistanceComputeCommand=void 0}})}var Pye=new ie,Utt=new ie,Vtt=new ie;Ea.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._polygons,i=n.length,r=Xt.OUTSIDE;this.inverse&&(r=Xt.INSIDE);let o=e.rectangle;if(!l(o)&&l(e.boundingVolume?.computeCorners)){let a=e.boundingVolume.computeCorners();o=ie.fromCartesianArray(a,t,Pye)}l(o)||(o=ie.fromBoundingSphere(e.boundingSphere,t,Pye));for(let a=0;a<i;++a){let c=n[a].computeRectangle(Vtt),u=ie.simpleIntersection(o,c,Utt);if(l(u))return Xt.INTERSECTING}return r};Ea.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};Ea.isSupported=function(e){return e?.context.webgl2};Ea.getTextureResolution=function(e,t,n){if(l(e))return n.x=e.width,n.y=e.height,n;let i=Ft.maximumTextureSize;return n.x=Math.min(t,i),n.y=Math.ceil(t/n.x),n.y*=2,n};Ea.getClippingDistanceTextureResolution=function(e,t){let n=e.signedDistanceTexture;if(l(n))return t.x=n.width,t.y=n.height,t;let i=e.quality,r=Math.max(128,Math.ceil(4096*i));return t.x=Math.min(Ft.maximumTextureSize,r),t.y=Math.min(Ft.maximumTextureSize,r),t};Ea.getClippingExtentsTextureResolution=function(e,t){let n=e.extentsTexture;return l(n)?(t.x=n.width,t.y=n.height,t):Ea.getTextureResolution(n,e.pixelsNeededForExtents,t)};Ea.prototype.isDestroyed=function(){return!1};Ea.prototype.destroy=function(){return l(this._signedDistanceComputeCommand)&&(this._signedDistanceComputeCommand.canceled=!0),this._polygonsTexture=this._polygonsTexture&&this._polygonsTexture.destroy(),this._extentsTexture=this._extentsTexture&&this._extentsTexture.destroy(),this._signedDistanceTexture=this._signedDistanceTexture&&this._signedDistanceTexture.destroy(),ue(this)};var fp=Ea;var hE={NONE:0,SCENE_LIGHT:1,SUNLIGHT:2};hE.fromGlobeFlags=function(e){return e.enableLighting&&e.dynamicAtmosphereLighting?e.dynamicAtmosphereLightingFromSun?hE.SUNLIGHT:hE.SCENE_LIGHT:hE.NONE};Object.freeze(hE);var _y=hE;function Dye(){this.lightIntensity=10,this.rayleighCoefficient=new h(55e-7,13e-6,284e-7),this.mieCoefficient=new h(21e-6,21e-6,21e-6),this.rayleighScaleHeight=1e4,this.mieScaleHeight=3200,this.mieAnisotropy=.9,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this.dynamicLighting=_y.NONE}Dye.requiresColorCorrect=function(e){return!(I.equalsEpsilon(e.hueShift,0,I.EPSILON7)&&I.equalsEpsilon(e.saturationShift,0,I.EPSILON7)&&I.equalsEpsilon(e.brightnessShift,0,I.EPSILON7))};var mE=Dye;var dp=`uniform vec3 u_radiiAndDynamicAtmosphereColor;
|
|
|
|
uniform float u_atmosphereLightIntensity;
|
|
uniform float u_atmosphereRayleighScaleHeight;
|
|
uniform float u_atmosphereMieScaleHeight;
|
|
uniform float u_atmosphereMieAnisotropy;
|
|
uniform vec3 u_atmosphereRayleighCoefficient;
|
|
uniform vec3 u_atmosphereMieCoefficient;
|
|
|
|
const float ATMOSPHERE_THICKNESS = 111e3; // The thickness of the atmosphere in meters.
|
|
const int PRIMARY_STEPS_MAX = 16; // Maximum number of times the ray from the camera to the world position (primary ray) is sampled.
|
|
const int LIGHT_STEPS_MAX = 4; // Maximum number of times the light is sampled from the light source's intersection with the atmosphere to a sample position on the primary ray.
|
|
|
|
/**
|
|
* This function computes the colors contributed by Rayliegh and Mie scattering on a given ray, as well as
|
|
* the transmittance value for the ray.
|
|
*
|
|
* @param {czm_ray} primaryRay The ray from the camera to the position.
|
|
* @param {float} primaryRayLength The length of the primary ray.
|
|
* @param {vec3} lightDirection The direction of the light to calculate the scattering from.
|
|
* @param {vec3} rayleighColor The variable the Rayleigh scattering will be written to.
|
|
* @param {vec3} mieColor The variable the Mie scattering will be written to.
|
|
* @param {float} opacity The variable the transmittance will be written to.
|
|
* @glslFunction
|
|
*/
|
|
void computeScattering(
|
|
czm_ray primaryRay,
|
|
float primaryRayLength,
|
|
vec3 lightDirection,
|
|
float atmosphereInnerRadius,
|
|
out vec3 rayleighColor,
|
|
out vec3 mieColor,
|
|
out float opacity
|
|
) {
|
|
|
|
// Initialize the default scattering amounts to 0.
|
|
rayleighColor = vec3(0.0);
|
|
mieColor = vec3(0.0);
|
|
opacity = 0.0;
|
|
|
|
float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS;
|
|
|
|
vec3 origin = vec3(0.0);
|
|
|
|
// Calculate intersection from the camera to the outer ring of the atmosphere.
|
|
czm_raySegment primaryRayAtmosphereIntersect = czm_raySphereIntersectionInterval(primaryRay, origin, atmosphereOuterRadius);
|
|
|
|
// Return empty colors if no intersection with the atmosphere geometry.
|
|
if (primaryRayAtmosphereIntersect == czm_emptyRaySegment) {
|
|
return;
|
|
}
|
|
|
|
// To deal with smaller values of PRIMARY_STEPS (e.g. 4)
|
|
// we implement a split strategy: sky or horizon.
|
|
// For performance reasons, instead of a if/else branch
|
|
// a soft choice is implemented through a weight 0.0 <= w_stop_gt_lprl <= 1.0
|
|
float x = 1e-7 * primaryRayAtmosphereIntersect.stop / length(primaryRayLength);
|
|
// Value close to 0.0: close to the horizon
|
|
// Value close to 1.0: above in the sky
|
|
float w_stop_gt_lprl = 0.5 * (1.0 + czm_approximateTanh(x));
|
|
|
|
// The ray should start from the first intersection with the outer atmopshere, or from the camera position, if it is inside the atmosphere.
|
|
float start_0 = primaryRayAtmosphereIntersect.start;
|
|
primaryRayAtmosphereIntersect.start = max(primaryRayAtmosphereIntersect.start, 0.0);
|
|
// The ray should end at the exit from the atmosphere or at the distance to the vertex, whichever is smaller.
|
|
primaryRayAtmosphereIntersect.stop = min(primaryRayAtmosphereIntersect.stop, length(primaryRayLength));
|
|
|
|
// For the number of ray steps, distinguish inside or outside atmosphere (outer space)
|
|
// (1) from outer space we have to use more ray steps to get a realistic rendering
|
|
// (2) within atmosphere we need fewer steps for faster rendering
|
|
float x_o_a = start_0 - ATMOSPHERE_THICKNESS; // ATMOSPHERE_THICKNESS used as an ad-hoc constant, no precise meaning here, only the order of magnitude matters
|
|
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); // Number of times the ray from the camera to the world position (primary ray) is sampled.
|
|
int LIGHT_STEPS = LIGHT_STEPS_MAX - int(w_inside_atmosphere * 2.0); // Number of times the light is sampled from the light source's intersection with the atmosphere to a sample position on the primary ray.
|
|
|
|
// Setup for sampling positions along the ray - starting from the intersection with the outer ring of the atmosphere.
|
|
float rayPositionLength = primaryRayAtmosphereIntersect.start;
|
|
// (1) Outside the atmosphere: constant rayStepLength
|
|
// (2) Inside atmosphere: variable rayStepLength to compensate the rough rendering of the smaller number of ray steps
|
|
float totalRayLength = primaryRayAtmosphereIntersect.stop - rayPositionLength;
|
|
float rayStepLengthIncrease = w_inside_atmosphere * ((1.0 - w_stop_gt_lprl) * totalRayLength / (float(PRIMARY_STEPS * (PRIMARY_STEPS + 1)) / 2.0));
|
|
float rayStepLength = max(1.0 - w_inside_atmosphere, w_stop_gt_lprl) * totalRayLength / max(7.0 * w_inside_atmosphere, float(PRIMARY_STEPS));
|
|
|
|
vec3 rayleighAccumulation = vec3(0.0);
|
|
vec3 mieAccumulation = vec3(0.0);
|
|
vec2 opticalDepth = vec2(0.0);
|
|
vec2 heightScale = vec2(u_atmosphereRayleighScaleHeight, u_atmosphereMieScaleHeight);
|
|
|
|
// Sample positions on the primary ray.
|
|
for (int i = 0; i < PRIMARY_STEPS_MAX; ++i) {
|
|
|
|
// The loop should be: for (int i = 0; i < PRIMARY_STEPS; ++i) {...} but WebGL1 cannot
|
|
// loop with non-constant condition, so it has to break early instead
|
|
if (i >= PRIMARY_STEPS) {
|
|
break;
|
|
}
|
|
|
|
// Calculate sample position along viewpoint ray.
|
|
vec3 samplePosition = primaryRay.origin + primaryRay.direction * (rayPositionLength + rayStepLength);
|
|
|
|
// Calculate height of sample position above ellipsoid.
|
|
float sampleHeight = length(samplePosition) - atmosphereInnerRadius;
|
|
|
|
// Calculate and accumulate density of particles at the sample position.
|
|
vec2 sampleDensity = exp(-sampleHeight / heightScale) * rayStepLength;
|
|
opticalDepth += sampleDensity;
|
|
|
|
// Generate ray from the sample position segment to the light source, up to the outer ring of the atmosphere.
|
|
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);
|
|
|
|
// Sample positions along the light ray, to accumulate incidence of light on the latest sample segment.
|
|
for (int j = 0; j < LIGHT_STEPS_MAX; ++j) {
|
|
|
|
// The loop should be: for (int j = 0; i < LIGHT_STEPS; ++j) {...} but WebGL1 cannot
|
|
// loop with non-constant condition, so it has to break early instead
|
|
if (j >= LIGHT_STEPS) {
|
|
break;
|
|
}
|
|
|
|
// Calculate sample position along light ray.
|
|
vec3 lightPosition = samplePosition + lightDirection * (lightPositionLength + lightStepLength * 0.5);
|
|
|
|
// Calculate height of the light sample position above ellipsoid.
|
|
float lightHeight = length(lightPosition) - atmosphereInnerRadius;
|
|
|
|
// Calculate density of photons at the light sample position.
|
|
lightOpticalDepth += exp(-lightHeight / heightScale) * lightStepLength;
|
|
|
|
// Increment distance on light ray.
|
|
lightPositionLength += lightStepLength;
|
|
}
|
|
|
|
// Compute attenuation via the primary ray and the light ray.
|
|
vec3 attenuation = exp(-((u_atmosphereMieCoefficient * (opticalDepth.y + lightOpticalDepth.y)) + (u_atmosphereRayleighCoefficient * (opticalDepth.x + lightOpticalDepth.x))));
|
|
|
|
// Accumulate the scattering.
|
|
rayleighAccumulation += sampleDensity.x * attenuation;
|
|
mieAccumulation += sampleDensity.y * attenuation;
|
|
|
|
// Increment distance on primary ray.
|
|
rayPositionLength += (rayStepLength += rayStepLengthIncrease);
|
|
}
|
|
|
|
// Compute the scattering amount.
|
|
rayleighColor = u_atmosphereRayleighCoefficient * rayleighAccumulation;
|
|
mieColor = u_atmosphereMieCoefficient * mieAccumulation;
|
|
|
|
// Compute the transmittance i.e. how much light is passing through the atmosphere.
|
|
opacity = length(exp(-((u_atmosphereMieCoefficient * opticalDepth.y) + (u_atmosphereRayleighCoefficient * opticalDepth.x))));
|
|
}
|
|
|
|
vec4 computeAtmosphereColor(
|
|
vec3 positionWC,
|
|
vec3 lightDirection,
|
|
vec3 rayleighColor,
|
|
vec3 mieColor,
|
|
float opacity
|
|
) {
|
|
// Setup the primary ray: from the camera position to the vertex position.
|
|
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;
|
|
|
|
// The Rayleigh phase function.
|
|
float rayleighPhase = 3.0 / (50.2654824574) * (1.0 + cosAngleSq);
|
|
// The Mie phase function.
|
|
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));
|
|
|
|
// The final color is generated by combining the effects of the Rayleigh and Mie scattering.
|
|
vec3 rayleigh = rayleighPhase * rayleighColor;
|
|
vec3 mie = miePhase * mieColor;
|
|
|
|
vec3 color = (rayleigh + mie) * u_atmosphereLightIntensity;
|
|
|
|
return vec4(color, opacity);
|
|
}
|
|
`;var uz=`uniform samplerCube u_radianceMap;
|
|
|
|
in vec2 v_textureCoordinates;
|
|
|
|
|
|
const float twoSqrtPi = 2.0 * sqrt(czm_pi);
|
|
|
|
// Coutesy of https://www.ppsloan.org/publications/StupidSH36.pdf
|
|
float computeShBasis(int index, vec3 s) {
|
|
if (index == 0) { // l = 0, m = 0
|
|
return 1.0 / twoSqrtPi;
|
|
}
|
|
|
|
if (index == 1) { // l = 1, m = -1
|
|
return -sqrt(3.0) * s.y / twoSqrtPi;
|
|
}
|
|
|
|
if (index == 2) { // l = 1, m = 0
|
|
return sqrt(3.0) * s.z / twoSqrtPi;
|
|
}
|
|
|
|
if (index == 3) { // l = 1, m = 1
|
|
return -sqrt(3.0) * s.x / twoSqrtPi;
|
|
}
|
|
|
|
if (index == 4) { // l = 2, m = -2
|
|
return sqrt(15.0) * s.y * s.x / twoSqrtPi;
|
|
}
|
|
|
|
if (index == 5) { // l = 2, m = -1
|
|
return -sqrt(15.0) * s.y * s.z / twoSqrtPi;
|
|
}
|
|
|
|
if (index == 6) { // l = 2, m = 0
|
|
return sqrt(5.0) * (3.0 * s.z * s.z - 1.0) / 2.0 / twoSqrtPi;
|
|
}
|
|
|
|
if (index == 7) { // l = 2, m = 1
|
|
return -sqrt(15.0) * s.x * s.z / twoSqrtPi;
|
|
}
|
|
|
|
if (index == 8) { // l = 2, m = 2
|
|
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));
|
|
}
|
|
|
|
// Sample count is relatively low for the sake of performance, but should still be enough to capture directionality needed for third-order harmonics
|
|
const int samples = 256;
|
|
const float solidAngle = 1.0 / float(samples);
|
|
|
|
void main() {
|
|
// Get the current coefficient based on the uv
|
|
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)));
|
|
|
|
// Generate the spherical harmonics basis from the direction
|
|
float Ylm = computeShBasis(coefficientIndex, direction);
|
|
|
|
vec3 lookupDirection = -direction.xyz;
|
|
lookupDirection.z = -lookupDirection.z;
|
|
|
|
vec4 color = czm_textureCube(u_radianceMap, lookupDirection, 0.0);
|
|
|
|
// Use the relevant function for this coefficient
|
|
out_FragColor += Ylm * color * solidAngle * sinTheta;
|
|
}
|
|
|
|
}
|
|
`;var fz=`precision highp float;
|
|
|
|
in vec2 v_textureCoordinates;
|
|
|
|
uniform vec3 u_faceDirection; // Current cubemap face
|
|
uniform vec3 u_positionWC;
|
|
uniform mat4 u_enuToFixedFrame;
|
|
uniform vec4 u_brightnessSaturationGammaIntensity;
|
|
uniform vec4 u_groundColor; // alpha component represent albedo
|
|
|
|
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);
|
|
|
|
// Scale the position to ensure the sky color is present, even when underground.
|
|
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);
|
|
|
|
// Compute sky color for each position on a sphere at radius centered around the provided position's origin
|
|
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;
|
|
// Flipping the X vector is a cheap way to get the inverse of czm_temeToPseudoFixed, since that's a rotation about Z.
|
|
lookupDirection.x = -lookupDirection.x;
|
|
lookupDirection = -normalize(czm_temeToPseudoFixed * lookupDirection);
|
|
lookupDirection.x = -lookupDirection.x;
|
|
|
|
// Values outside the atmopshere are rendered as black, when they should be treated as transparent
|
|
float skyAlpha = clamp((1.0 - ellipsoidHeight / atmosphereHeight) * atmopshereColor.a, 0.0, 1.0);
|
|
skyAlpha = czm_branchFreeTernary(length(atmopshereColor.rgb) <= czm_epsilon7, 0.0, skyAlpha); // Treat black as transparent
|
|
|
|
// Blend starmap with atmopshere scattering
|
|
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);
|
|
|
|
// Compute ground color based on amount of reflected light, then blend it with ground atmosphere based on height
|
|
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)); // Normally this would be in the ifdef above, but there is a precision issue with the atmopshere scattering transmittance (alpha). Having this line is a workaround for that issue, even when gamma is 1.0.
|
|
color.rgb = czm_gammaCorrect(color.rgb);
|
|
|
|
out_FragColor = color;
|
|
}
|
|
`;var dz=`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;
|
|
}
|
|
|
|
// Sample count is relatively low for the sake of performance, but should still be enough to prevent artifacting in lower roughnesses
|
|
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; // reflected vector
|
|
|
|
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 hz=`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 Ai(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??H.EMPTY_OBJECT;let t=Math.max(Math.floor(Math.min(e.mipmapLevels??7,Math.log2(Ft.maximumCubeMapSize))),0);this._mipmapLevels=t;let n=Math.max(t-1,0)*6;this._radianceMapComputeCommands=new Array(6),this._convolutionComputeCommands=new Array(n),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(n),this._radianceCubeMap=void 0,this._irradianceMapTexture=void 0,this._sphericalHarmonicCoefficients=Ai.DEFAULT_SPHERICAL_HARMONIC_COEFFICIENTS.slice(),this._lastTime=new K;let i=Math.max(Math.pow(2,t-1),1);this._textureDimensions=new k(i,i),this._radiiAndDynamicAtmosphereColor=new h,this._sceneEnvironmentMap=void 0,this._backgroundColor=void 0,this._owner=void 0,this.enabled=e.enabled??!0,this.shouldUpdate=!0,this.maximumSecondsDifference=e.maximumSecondsDifference??3600,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??Ai.AVERAGE_EARTH_GROUND_COLOR,this.groundAlbedo=e.groundAlbedo??.31}Object.defineProperties(Ai.prototype,{owner:{get:function(){return this._owner}},shouldRegenerateShaders:{get:function(){return this._shouldRegenerateShaders}},position:{get:function(){return this._position},set:function(e){h.equalsEpsilon(e,this._position,0,this.maximumPositionEpsilon)||(this._position=h.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}}});Ai._maximumComputeCommandCount=8;Ai._activeComputeCommandCount=0;Ai._nextFrameCommandQueue=[];Ai._queueCommand=(e,t)=>{if(Ai._activeComputeCommandCount>=Ai._maximumComputeCommandCount){Ai._nextFrameCommandQueue.push(e);return}t.commandList.push(e),Ai._activeComputeCommandCount++};Ai._updateCommandQueue=e=>{if(Ai._maximumComputeCommandCount=Math.log2(Ft.maximumCubeMapSize),Ai._nextFrameCommandQueue.length>0&&Ai._activeComputeCommandCount<Ai._maximumComputeCommandCount){let t=Ai._nextFrameCommandQueue.shift();for(;l(t)&&Ai._activeComputeCommandCount<Ai._maximumComputeCommandCount;){if(t.owner.isDestroyed()||t.canceled){t=Ai._nextFrameCommandQueue.shift();continue}e.commandList.push(t),Ai._activeComputeCommandCount++,t=Ai._nextFrameCommandQueue.shift()}l(t)&&Ai._nextFrameCommandQueue.push(t)}};Ai.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};Ai.prototype.reset=function(){let e=this._radianceMapComputeCommands.length;for(let t=0;t<e;++t)l(this._radianceMapComputeCommands[t])&&(this._radianceMapComputeCommands[t].canceled=!0),this._radianceMapComputeCommands[t]=void 0;e=this._convolutionComputeCommands.length;for(let t=0;t<e;++t)l(this._convolutionComputeCommands[t])&&(this._convolutionComputeCommands[t].canceled=!0),this._convolutionComputeCommands[t]=void 0;l(this._irradianceComputeCommand)&&(this._irradianceComputeCommand.canceled=!0,this._irradianceComputeCommand=void 0),this._radianceMapDirty=!0,this._radianceCommandsDirty=!0,this._convolutionsCommandsDirty=!1,this._irradianceCommandDirty=!1};var jtt=new h,Htt=new h;function Gtt(e,t){let n=e._position,i=t.atmosphere,r=t.mapProjection.ellipsoid,o=r.scaleToGeodeticSurface(n,Htt),a=1.025,s=jtt,c=l(o)?h.magnitude(o):r.maximumRadius;return s.x=c*a,s.y=c,s.z=i.dynamicLighting,!h.equalsEpsilon(e._radiiAndDynamicAtmosphereColor,s)||t.environmentMap!==e._sceneEnvironmentMap||t.backgroundColor!==e._backgroundColor?(h.clone(s,e._radiiAndDynamicAtmosphereColor),e._sceneEnvironmentMap=t.environmentMap,e._backgroundColor=t.backgroundColor,!0):!1}var Rye=new h,Wtt=new O,qtt=new ae,Ytt=new U;function Xtt(e,t){let n=t.context,i=e._textureDimensions;if(l(e._radianceCubeMap)||(e._radianceCubeMap=new aa({context:n,width:i.x,height:i.y,pixelDatatype:ke.UNSIGNED_BYTE,pixelFormat:He.RGBA})),e._radianceCommandsDirty){let r=e._radianceMapFS;l(r)||(r=new Ge({sources:[dp,fz]}),e._radianceMapFS=r),mE.requiresColorCorrect(t.atmosphere)&&r.defines.push("ATMOSPHERE_COLOR_CORRECT");let o=e._position,a=e._radiiAndDynamicAtmosphereColor,s=t.mapProjection.ellipsoid,c=mt.eastNorthUpToFixedFrame(o,s,Wtt),u=qtt;u.x=e.brightness,u.y=e.saturation,u.z=e.gamma,u.w=e.atmosphereScatteringIntensity,(e.brightness!==1||e.saturation!==1||e.gamma!==1)&&r.defines.push("ENVIRONMENT_COLOR_CORRECT");let f=0;for(let d of aa.faceNames()){let p=e._radianceMapTextures[f];l(p)&&!p.isDestroyed()&&p.destroy(),p=new Et({context:n,width:i.x,height:i.y,pixelDatatype:ke.UNSIGNED_BYTE,pixelFormat:He.RGBA}),e._radianceMapTextures[f]=p;let g=f,m=new lu({fragmentShaderSource:r,outputTexture:p,uniformMap:{u_radiiAndDynamicAtmosphereColor:()=>a,u_enuToFixedFrame:()=>c,u_faceDirection:()=>aa.getDirection(d,Rye),u_positionWC:()=>o,u_brightnessSaturationGammaIntensity:()=>u,u_groundColor:()=>e.groundColor.withAlpha(e.groundAlbedo,Ytt)},owner:e});m.postExecute=()=>{if(e.isDestroyed()||m.canceled){Ai._activeComputeCommandCount--;return}let y=e._radianceMapComputeCommands;y[g]=void 0;let A=new Ta({context:n,colorTextures:[e._radianceMapTextures[g]]});A._bind(),e._radianceCubeMap[d].copyFromFramebuffer(),A._unBind(),A.destroy(),Ai._activeComputeCommandCount--,y.some(l)||(e._convolutionsCommandsDirty=!0,e._shouldRegenerateShaders=!0)},e._radianceMapComputeCommands[f]=m,Ai._queueCommand(m,t),f++}e._radianceCommandsDirty=!1}}function Ktt(e,t){let n=e._radianceCubeMap;n.generateMipmap();let i=e._mipmapLevels,r=e._textureDimensions,o=r.x/2,a=r.y/2,s=t.context,c=0,u=()=>{let p=e._specularMapTextures.length;c>=p&&(e._irradianceCommandDirty=!0,i>1&&(n.sampler=new Ut({minificationFilter:Gt.LINEAR_MIPMAP_LINEAR}),e._shouldRegenerateShaders=!0,e._va.destroy(),e._va=void 0,e._convolveSP.destroy(),e._convolveSP=void 0))},f=(p,g,m,y,A)=>()=>{if(e.isDestroyed()||p.canceled){Ai._activeComputeCommandCount--;return}let b=e._convolutionComputeCommands;b[g]=void 0,n.copyFace(t,m,y,A),c++,Ai._activeComputeCommandCount--,m.destroy(),e._specularMapTextures[g]=void 0,u()},d=0;for(let p=1;p<i;++p){for(let g of aa.faceNames()){l(e._specularMapTextures[d])&&e._specularMapTextures[d].destroy();let m=e._specularMapTextures[d]=new Et({context:s,width:o,height:a,pixelDatatype:ke.UNSIGNED_BYTE,pixelFormat:He.RGBA}),y=e._va;l(y)||(y=aa.createVertexArray(s,g),e._va=y);let A=e._convolveSP;l(A)||(A=Zt.fromCache({context:s,vertexShaderSource:hz,fragmentShaderSource:dz,attributeLocations:{positions:0}}),e._convolveSP=A);let b=new lu({shaderProgram:A,vertexArray:y,outputTexture:m,persists:!0,owner:e,uniformMap:{u_roughness:()=>p/(i-1),u_radianceTexture:()=>n??s.defaultTexture,u_faceDirection:()=>aa.getDirection(g,Rye)}});b.postExecute=f(b,d,m,g,p),e._convolutionComputeCommands[d]=b,Ai._queueCommand(b,t),++d}o/=2,a/=2}u()}var Oye=new k(3,3);function $tt(e,t){let n=t.context,i=Oye,r=e._irradianceMapTexture;l(r)&&!r.isDestroyed()&&r.destroy(),r=new Et({context:n,width:i.x,height:i.y,pixelDatatype:ke.FLOAT,pixelFormat:He.RGBA}),e._irradianceMapTexture=r;let o=e._irradianceMapFS;l(o)||(o=new Ge({sources:[uz]}),e._irradianceMapFS=o);let a=new lu({fragmentShaderSource:o,outputTexture:r,owner:e,uniformMap:{u_radianceMap:()=>e._radianceCubeMap??n.defaultTexture}});a.postExecute=()=>{if(e.isDestroyed()||a.canceled){Ai._activeComputeCommandCount--;return}e._irradianceTextureDirty=!1,e._irradianceComputeCommand=void 0,e._sphericalHarmonicCoefficientsDirty=!0,e._irradianceMapFS=void 0,Ai._activeComputeCommandCount--},e._irradianceComputeCommand=a,Ai._queueCommand(a,t),e._irradianceTextureDirty=!0}function Jtt(e,t){let n=t.context;if(!l(e._irradianceMapTexture))return;let i=new Ta({context:n,colorTextures:[e._irradianceMapTexture],destroyAttachments:!1}),r=Oye,o=n.readPixels({x:0,y:0,width:r.x,height:r.y,framebuffer:i});for(let a=0;a<9;++a)e._sphericalHarmonicCoefficients[a]=h.unpack(o,a*4),h.multiplyByScalar(e._sphericalHarmonicCoefficients[a],e.atmosphereScatteringIntensity,e._sphericalHarmonicCoefficients[a]);i.destroy(),e._irradianceMapTexture.destroy(),e._irradianceMapTexture=void 0,e._shouldRegenerateShaders=!0}Ai.prototype.update=function(e){let t=e.mode;if(!(Ai.isDynamicUpdateSupported(e)&&this._mipmapLevels>=1)||!this.enabled||!this.shouldUpdate||!l(this._position)||t===re.MORPHING){this._shouldRegenerateShaders=!1;return}Ai._updateCommandQueue(e);let i=e.atmosphere.dynamicLighting,r=Gtt(this,e)||i===_y.SUNLIGHT&&!K.equalsEpsilon(e.time,this._lastTime,this.maximumSecondsDifference);if(this._shouldReset||r){this.reset(),this._shouldReset=!1,this._lastTime=K.clone(e.time,this._lastTime);return}if(this._radianceMapDirty&&(Xtt(this,e),this._radianceMapDirty=!1),this._convolutionsCommandsDirty&&(Ktt(this,e),this._convolutionsCommandsDirty=!1),this._irradianceCommandDirty&&($tt(this,e),this._irradianceCommandDirty=!1),this._irradianceTextureDirty){this._shouldRegenerateShaders=!1;return}if(this._sphericalHarmonicCoefficientsDirty){Jtt(this,e),this._sphericalHarmonicCoefficientsDirty=!1;return}this._shouldRegenerateShaders=!1};Ai.prototype.isDestroyed=function(){return!1};Ai.prototype.destroy=function(){let e=this._radianceMapComputeCommands.length;for(let t=0;t<e;++t)this._radianceMapComputeCommands[t]=void 0;e=this._convolutionComputeCommands.length;for(let t=0;t<e;++t)this._convolutionComputeCommands[t]=void 0;this._irradianceMapComputeCommand=void 0,e=this._radianceMapTextures.length;for(let t=0;t<e;++t)this._radianceMapTextures[t]=this._radianceMapTextures[t]&&!this._radianceMapTextures[t].isDestroyed()&&this._radianceMapTextures[t].destroy();e=this._specularMapTextures.length;for(let t=0;t<e;++t)this._specularMapTextures[t]=this._specularMapTextures[t]&&!this._specularMapTextures[t].isDestroyed()&&this._specularMapTextures[t].destroy();return this._radianceCubeMap=this._radianceCubeMap&&this._radianceCubeMap.destroy(),this._irradianceMapTexture=this._irradianceMapTexture&&!this._irradianceMapTexture.isDestroyed()&&this._irradianceMapTexture.destroy(),l(this._va)&&this._va.destroy(),l(this._convolveSP)&&this._convolveSP.destroy(),ue(this)};Ai.isDynamicUpdateSupported=function(e){let t=e.context;return t.halfFloatingPointTexture||t.colorBufferFloat};Ai.AVERAGE_EARTH_GROUND_COLOR=Object.freeze(U.fromCssColorString("#717145"));Ai.DEFAULT_SPHERICAL_HARMONIC_COEFFICIENTS=Object.freeze([Object.freeze(new h(.35449,.35449,.35449)),h.ZERO,h.ZERO,h.ZERO,h.ZERO,h.ZERO,h.ZERO,h.ZERO,h.ZERO]);var yy=Ai;var Mye={SURFACES_ONLY:0,SURFACES_AND_EDGES:1,EDGES_ONLY:2};Object.freeze(Mye);var Mh=Mye;var Lye={};function ED(e){this._count=e.count,this._properties=Xe(e.properties,!0)}ED.prototype.hasProperty=function(e){return qn.hasProperty(e,this._properties,Lye)};ED.prototype.getPropertyIds=function(e){return qn.getPropertyIds(this._properties,Lye,e)};ED.prototype.getProperty=function(e,t){let n=this._properties[t];if(l(n))return Xe(n[e],!0)};ED.prototype.setProperty=function(e,t,n){let i=this._properties[t];l(i)||(i=new Array(this._count),this._properties[t]=i),i[e]=Xe(n,!0)};var Ay=ED;function xc(e){e=e??H.EMPTY_OBJECT,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,this._texture=e.texture}Object.defineProperties(xc.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},count:{get:function(){return this._count}},class:{get:function(){if(l(this._metadataTable))return this._metadataTable.class}},properties:{get:function(){if(l(this._metadataTable))return this._metadataTable.properties}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},byteLength:{get:function(){let e=0;return l(this._metadataTable)&&(e+=this._metadataTable.byteLength),l(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e}},texture:{get:function(){return this._texture}}});xc.prototype.hasProperty=function(e,t){return!!(l(this._metadataTable)&&this._metadataTable.hasProperty(t)||l(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)||l(this._jsonMetadataTable)&&this._jsonMetadataTable.hasProperty(t))};xc.prototype.hasPropertyBySemantic=function(e,t){return l(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(t):!1};xc.prototype.propertyExists=function(e){return!!(l(this._metadataTable)&&this._metadataTable.hasProperty(e)||l(this._batchTableHierarchy)&&this._batchTableHierarchy.propertyExists(e)||l(this._jsonMetadataTable)&&this._jsonMetadataTable.hasProperty(e))};xc.prototype.propertyExistsBySemantic=function(e){return l(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(e):!1};var dJ=[];xc.prototype.getPropertyIds=function(e,t){if(t=l(t)?t:[],t.length=0,l(this._metadataTable)){let n=this._metadataTable.getPropertyIds(dJ);Xn(t,n)}if(l(this._batchTableHierarchy)){let n=this._batchTableHierarchy.getPropertyIds(e,dJ);Xn(t,n)}if(l(this._jsonMetadataTable)){let n=this._jsonMetadataTable.getPropertyIds(dJ);Xn(t,n)}return t};xc.prototype.getProperty=function(e,t){let n;if(l(this._metadataTable)&&(n=this._metadataTable.getProperty(e,t),l(n))||l(this._batchTableHierarchy)&&(n=this._batchTableHierarchy.getProperty(e,t),l(n))||l(this._jsonMetadataTable)&&(n=this._jsonMetadataTable.getProperty(e,t),l(n)))return n};xc.prototype.setProperty=function(e,t,n){l(this._metadataTable)&&this._metadataTable.setProperty(e,t,n)||l(this._batchTableHierarchy)&&this._batchTableHierarchy.setProperty(e,t,n)||(l(this._jsonMetadataTable)||(this._jsonMetadataTable=new Ay({count:this._count,properties:{}})),this._jsonMetadataTable.setProperty(e,t,n))};xc.prototype.getPropertyBySemantic=function(e,t){if(l(this._metadataTable))return this._metadataTable.getPropertyBySemantic(e,t)};xc.prototype.setPropertyBySemantic=function(e,t,n){return l(this._metadataTable)?this._metadataTable.setPropertyBySemantic(e,t,n):!1};xc.prototype.getPropertyTypedArray=function(e){if(l(this._metadataTable))return this._metadataTable.getPropertyTypedArray(e)};xc.prototype.getPropertyTypedArrayBySemantic=function(e){if(l(this._metadataTable))return this._metadataTable.getPropertyTypedArrayBySemantic(e)};xc.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return l(n)?n.isClass(e,t):!1};xc.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};xc.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(l(t))return t.getClassName(e)};xc.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),ue(this)};var xu=xc;function Nye(e){e=e??H.EMPTY_OBJECT;let t=e.property,n=e.classProperty,i=e.textures,r=l(t.channels)?t.channels:[0],o=t,a=Xu.createModelTextureReader({textureInfo:o,channels:Ztt(r),texture:i[o.index]});this._min=t.min,this._max=t.max;let s=t.offset,c=t.scale,u=n.hasValueTransform||l(s)||l(c);s=s??n.offset,c=c??n.scale,s=n.unpackVectorAndMatrixTypes(s),c=n.unpackVectorAndMatrixTypes(c),this._offset=s,this._scale=c,this._hasValueTransform=u,this._textureReader=a,this._classProperty=n,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(Nye.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}}});function Ztt(e){return e.map(function(t){return"rgba".charAt(t)}).join("")}var mz=Nye;function hJ(e){e=e??H.EMPTY_OBJECT;let t=e.propertyTexture,n=e.class,i=e.textures,r=t.extensions,o=t.extras,a={};if(l(t.properties))for(let s in t.properties)t.properties.hasOwnProperty(s)&&(a[s]=new mz({property:t.properties[s],classProperty:n.properties[s],textures:i}));this._name=e.name,this._id=e.id,this._class=n,this._properties=a,this._extras=o,this._extensions=r}Object.defineProperties(hJ.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}}});hJ.prototype.getProperty=function(e){return this._properties[e]};var by=hJ;function Fye(e){e=e??H.EMPTY_OBJECT;let t=e.property,n=e.classProperty;this._attribute=t.attribute,this._classProperty=n,this._min=t.min,this._max=t.max;let i=t.offset,r=t.scale,o=n.hasValueTransform||l(i)||l(r);i=i??n.offset,r=r??n.scale,i=n.unpackVectorAndMatrixTypes(i),r=n.unpackVectorAndMatrixTypes(r),this._offset=i,this._scale=r,this._hasValueTransform=o,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(Fye.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 pz=Fye;function mJ(e){e=e??H.EMPTY_OBJECT;let t=e.propertyAttribute,n=e.class,i={};if(l(t.properties))for(let r in t.properties)t.properties.hasOwnProperty(r)&&(i[r]=new pz({property:t.properties[r],classProperty:n.properties[r]}));this._name=e.name,this._id=e.id,this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(mJ.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}}});mJ.prototype.getProperty=function(e){return this._properties[e]};var pE=mJ;function gE(e){e=e??H.EMPTY_OBJECT,this._schema=e.schema;let t=e.propertyTables;this._propertyTableCount=l(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(gE.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(!l(this._propertyTables))return 0;let e=0,t=this._propertyTables.length;for(let n=0;n<t;n++)e+=this._propertyTables[n].byteLength;return e}}});gE.prototype.getPropertyTable=function(e){return this._propertyTables[e]};gE.prototype.getPropertyTexture=function(e){return this._propertyTextures[e]};gE.prototype.getPropertyAttribute=function(e){return this._propertyAttributes[e]};gE.prototype.destroy=function(){let e=this._propertyTables;for(let t=0;t<e.length;t++)e[t]=e[t]&&e[t].destroy();return ue(this)};var ec=gE;function Qtt(e){e=e??H.EMPTY_OBJECT;let t=e.extension,n=e.schema,i=[];if(l(t.propertyTables))for(let a=0;a<t.propertyTables.length;a++){let s=t.propertyTables[a],c=n.classes[s.class],u=ent(s,e.bufferViews,c,e.context),f=new oh({count:s.count,properties:s.properties,class:c,bufferViews:e.bufferViews});i.push(new xu({id:a,name:s.name,count:s.count,metadataTable:f,extras:s.extras,extensions:s.extensions,texture:u}))}let r=[];if(l(t.propertyTextures))for(let a=0;a<t.propertyTextures.length;a++){let s=t.propertyTextures[a];r.push(new by({id:a,name:s.name,propertyTexture:s,class:n.classes[s.class],textures:e.textures}))}let o=[];if(l(t.propertyAttributes))for(let a=0;a<t.propertyAttributes.length;a++){let s=t.propertyAttributes[a];o.push(new pE({id:a,name:s.name,class:n.classes[s.class],propertyAttribute:s}))}return new ec({schema:n,propertyTables:i,propertyTextures:r,propertyAttributes:o,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}var SD=4;function ent(e,t,n,i){let r=e.properties;if(!l(r))return;let o=e.count,a;try{a=tnt(r,t,n,o)}catch(f){console.warn(`Failed to create texture for property table "${e.name}": ${f.message}`);return}let s=a.length;if(s===0)return;if(o>Ft.maximumTextureSize||s>Ft.maximumTextureSize){pt("PropertyTableTextureExceedsMaximumSize",`Cannot create a texture for the property table "${e.name}" because it exceeds the maximum texture size of ${Ft.maximumTextureSize}.`);return}let c=int(a,o),u=new Ut({wrapS:on.CLAMP_TO_EDGE,wrapT:on.CLAMP_TO_EDGE,minificationFilter:Gt.NEAREST,magnificationFilter:ni.NEAREST});return Et.create({context:i,pixelFormat:He.RGBA,pixelDatatype:ke.UNSIGNED_BYTE,sampler:u,flipY:!1,source:{width:o,height:s,arrayBufferView:c}})}function tnt(e,t,n,i){let r=[],o=n.properties;for(let[a,s]of Object.entries(o)){if(!s.isGpuCompatible(SD))continue;let c=e[a],u=l(c)?t[c.values]:nnt(s,i),f=u.length,d=s.cpuBytesPerElement(),p=f/d;if(p!==i)throw new oe(`Property with ID: "${a}" has (${p}), which does not match number of features in the property table: (${i}).`);r.push({view:u,classProperty:s})}return r}function nnt(e,t){let n=e.noData,i=gt.getComponentCount(e.type),r=e.isArray?e.arrayLength:1;e.type===gt.ENUM&&(n=e.enumType.valuesByName[n]),i===1&&(n=[n]),r===1&&(n=[n]);let o=e.cpuBytesPerElement(),a=Mt.getSizeInBytes(e.valueType),s=new ArrayBuffer(o*t),c=new DataView(s),u=Mt.getDataViewAccessors(c,e.valueType);for(let f=0;f<t;f++)for(let d=0;d<r;d++)for(let p=0;p<i;p++){let g=d*i+p;u.set(o*f+g*a,n[d][p])}return new Uint8Array(s)}function int(e,t){let n=e.length,i=new Uint8Array(n*t*SD),r=new DataView(i.buffer,i.byteOffset,i.byteLength);for(let o=0;o<n;o++){let a=e[o],s=a.classProperty,c=o*t*SD,u=s.valueType,f=Mt.gpuComponentType(u);if(u!==f){ont(a,r,c);continue}rnt(a,i,c)}return i}function rnt(e,t,n){let i=e.view,r=e.classProperty.cpuBytesPerElement(),o=i.length/r;for(let a=0;a<o;a++){let s=a*r,c=n+a*SD;t.set(i.subarray(s,s+r),c)}}function ont(e,t,n){let i=e.classProperty,r=e.view,o=i.valueType,a=Mt.gpuComponentType(o),s=i.cpuBytesPerElement(),c=r.length/s,u=new DataView(r.buffer,r.byteOffset,r.byteLength),f=Mt.getDataViewAccessors(u,o),d=Mt.getDataViewAccessors(t,a),p=Mt.downcastFunction(o);for(let g=0;g<c;g++){let m=g*s,y=n+g*SD,A=f.get(m);d.set(y,p(A))}}var gz=Qtt;function ant(e){e=e??H.EMPTY_OBJECT;let t=e.extension,n=e.schema,i,r=[],o;if(l(t.featureTables))for(o=Object.keys(t.featureTables).sort(),i=0;i<o.length;i++){let s=o[i],c=t.featureTables[s],u=n.classes[c.class],f=new oh({count:c.count,properties:c.properties,class:u,bufferViews:e.bufferViews});r.push(new xu({id:s,count:c.count,metadataTable:f,extras:c.extras,extensions:c.extensions}))}let a=[];if(l(t.featureTextures))for(o=Object.keys(t.featureTextures).sort(),i=0;i<o.length;i++){let s=o[i],c=t.featureTextures[s];a.push(new by({id:s,propertyTexture:snt(c),class:n.classes[c.class],textures:e.textures}))}return new ec({schema:n,propertyTables:r,propertyTextures:a,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}function snt(e){let t={class:e.class,properties:{}},n=e.properties;for(let i in n)if(n.hasOwnProperty(i)){let r=n[i],o={channels:cnt(r.channels),extras:r.extras,extensions:r.extensions};t.properties[i]=Ot(r.texture,o,!0)}return t}function cnt(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]="rgba".indexOf(e[i]);return n}var _z=ant;var pJ=class extends er{constructor(t){super(),t=t??H.EMPTY_OBJECT;let{gltf:n,extension:i,extensionLegacy:r,gltfResource:o,baseResource:a,supportedImageFormats:s,frameState:c,cacheKey:u,asynchronous:f=!0}=t;this._gltfResource=o,this._baseResource=a,this._gltf=n,this._extension=i,this._extensionLegacy=r,this._supportedImageFormats=s,this._frameState=c,this._cacheKey=u,this._asynchronous=f,this._bufferViewLoaders=[],this._bufferViewIds=[],this._textureLoaders=[],this._textureIds=[],this._schemaLoader=void 0,this._structuralMetadata=void 0,this._state=At.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get structuralMetadata(){return this._structuralMetadata}load(){return l(this._promise)?this._promise:(this._state=At.LOADING,this._promise=lnt(this),this._promise)}process(t){if(this._state===At.READY)return!0;if(this._state!==At.LOADED)return!1;let n=this._textureLoaders,i=n.length,r=!0;for(let c=0;c<i;++c){let f=n[c].process(t);r=r&&f}if(!r)return!1;let o=this._schemaLoader.schema,a={};for(let c=0;c<this._bufferViewIds.length;++c){let u=this._bufferViewIds[c],f=this._bufferViewLoaders[c];if(!f.isDestroyed()){let d=new Uint8Array(f.typedArray);a[u]=d}}let s={};for(let c=0;c<this._textureIds.length;++c){let u=this._textureIds[c],f=n[c];f.isDestroyed()||(s[u]=f.texture)}return l(this._extension)?this._structuralMetadata=gz({extension:this._extension,schema:o,bufferViews:a,textures:s,context:t.context}):this._structuralMetadata=_z({extension:this._extensionLegacy,schema:o,bufferViews:a,textures:s}),Bye(this),this._state=At.READY,!0}unload(){Bye(this),xnt(this),l(this._schemaLoader)&&Ni.unload(this._schemaLoader),this._schemaLoader=void 0,l(this._structuralMetadata)&&this._structuralMetadata.destroy(),this._structuralMetadata=void 0}};async function lnt(e){try{let t=mnt(e),n=Ant(e),i=bnt(e);return await Promise.all([t,n,i]),e.isDestroyed()?void 0:(e._gltf=void 0,e._state=At.LOADED,e)}catch(t){if(e.isDestroyed())return;throw e.unload(),e._state=At.FAILED,e.getError("Failed to load structural metadata",t)}}function unt(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],r=i.values,o=i.arrayOffsets,a=i.stringOffsets;l(r)&&(t[r]=!0),l(o)&&(t[o]=!0),l(a)&&(t[a]=!0)}}function fnt(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],r=i.bufferView,o=i.arrayOffsetBufferView,a=i.stringOffsetBufferView;l(r)&&(t[r]=!0),l(o)&&(t[o]=!0),l(a)&&(t[a]=!0)}}function dnt(e){let t=e.propertyTables,n={};if(l(t))for(let i=0;i<t.length;i++){let r=t[i];unt(r.properties,n)}return n}function hnt(e){let t=e.featureTables,n={};if(l(t)){for(let i in t)if(t.hasOwnProperty(i)){let o=t[i].properties;l(o)&&fnt(o,n)}}return n}async function mnt(e){let t;l(e._extension)?t=dnt(e._extension):t=hnt(e._extensionLegacy);let n=[];for(let i in t)if(t.hasOwnProperty(i)){let r=Ni.getBufferViewLoader({gltf:e._gltf,bufferViewId:parseInt(i),gltfResource:e._gltfResource,baseResource:e._baseResource});e._bufferViewLoaders.push(r),e._bufferViewIds.push(i),n.push(r.load())}return Promise.all(n)}function pnt(e){let t={},n=e.propertyTextures;if(l(n))for(let i=0;i<n.length;i++){let o=n[i].properties;l(o)&&gnt(o,t)}return t}function gnt(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];t[i.index]=i}}function _nt(e){let t={},n=e.featureTextures;if(l(n)){for(let i in n)if(n.hasOwnProperty(i)){let o=n[i].properties;l(o)&&ynt(o,t)}}return t}function ynt(e,t){for(let n in e)if(e.hasOwnProperty(n)){let r=e[n].texture;t[r.index]=r}}function Ant(e){let t;l(e._extension)?t=pnt(e._extension):t=_nt(e._extensionLegacy);let n=e._gltf,i=e._gltfResource,r=e._baseResource,o=e._supportedImageFormats,a=e._frameState,s=e._asynchronous,c=[];for(let u in t)if(t.hasOwnProperty(u)){let f=Ni.getTextureLoader({gltf:n,textureInfo:t[u],gltfResource:i,baseResource:r,supportedImageFormats:o,frameState:a,asynchronous:s});e._textureLoaders.push(f),e._textureIds.push(u),c.push(f.load())}return Promise.all(c)}async function bnt(e){let t=e._extension??e._extensionLegacy,n;if(l(t.schemaUri)){let i=e._baseResource.getDerivedResource({url:t.schemaUri});n=Ni.getSchemaLoader({resource:i})}else n=Ni.getSchemaLoader({schema:t.schema});if(e._schemaLoader=n,await n.load(),!n.isDestroyed())return n.schema}function Bye(e){let t=e._bufferViewLoaders,n=t.length;for(let i=0;i<n;++i)Ni.unload(t[i]);e._bufferViewLoaders.length=0,e._bufferViewIds.length=0}function xnt(e){let t=e._textureLoaders,n=t.length;for(let i=0;i<n;++i)Ni.unload(t[i]);e._textureLoaders.length=0,e._textureIds.length=0}var yz=pJ;var Zb={TRANSLATION:"TRANSLATION",ROTATION:"ROTATION",SCALE:"SCALE",FEATURE_ID:"_FEATURE_ID"};Zb.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"TRANSLATION":return Zb.TRANSLATION;case"ROTATION":return Zb.ROTATION;case"SCALE":return Zb.SCALE;case"_FEATURE_ID":return Zb.FEATURE_ID}};Object.freeze(Zb);var Do=Zb;var Tnt=65534,Cnt=255;function Az(e){e=e??H.EMPTY_OBJECT;let t=e.triangleIndices,n=e.outlineIndices,i=e.originalVertexCount;this._triangleIndices=t,this._originalVertexCount=i,this._edges=new Uye(n,i),this._outlineCoordinatesTypedArray=void 0,this._extraVertices=[],vnt(this)}Object.defineProperties(Az.prototype,{updatedTriangleIndices:{get:function(){return this._triangleIndices}},outlineCoordinates:{get:function(){return this._outlineCoordinatesTypedArray}}});function vnt(e){let t=e._triangleIndices,n=e._edges,i=[],r=e._extraVertices,o=e._originalVertexCount,a={};for(let s=0;s<t.length;s+=3){let c=t[s],u=t[s+1],f=t[s+2],d=!1,p=d||n.hasEdge(c,u),g=d||n.hasEdge(u,f),m=d||n.hasEdge(f,c),y=kye(i,c,u,f,p,g,m);for(;l(y);){let A=a[y];if(!l(A)){A=o+r.length;let b=y;for(;b>=o;)b=r[b-o];r.push(b),a[y]=A}A>Tnt&&(t instanceof Uint16Array||t instanceof Uint8Array)?t=new Uint32Array(t):A>Cnt&&t instanceof Uint8Array&&(t=new Uint16Array(t)),y===c?(c=A,t[s]=A):y===u?(u=A,t[s+1]=A):(f=A,t[s+2]=A),y=kye(i,c,u,f,p,g,m)}}e._triangleIndices=t,e._outlineCoordinatesTypedArray=new Float32Array(i)}function kye(e,t,n,i,r,o,a){let s=a?1:0,c=r?1:0,u=0,f=gJ(e,t,s,c,u);if(f===0)return t;let d=0,p=r?1:0,g=o?1:0,m=gJ(e,n,d,p,g);if(m===0)return n;let y=a?1:0,A=0,b=o?1:0,x=gJ(e,i,y,A,b);if(x===0)return i;let T=f&m&x,C,E,w;if(T&1)C=0,E=1,w=2;else if(T&2)C=0,w=1,E=2;else if(T&4)E=0,C=1,w=2;else if(T&8)E=0,w=1,C=2;else if(T&16)w=0,C=1,E=2;else if(T&32)w=0,E=1,C=2;else{let N=_J(f),_=_J(m),v=_J(x);return N<_&&N<v?t:_<v?n:i}let D=t*3;e[D+C]=s,e[D+E]=c,e[D+w]=u;let R=n*3;e[R+C]=d,e[R+E]=p,e[R+w]=g;let M=i*3;e[M+C]=y,e[M+E]=A,e[M+w]=b}function gJ(e,t,n,i,r){let o=t*3,a=e[o],s=e[o+1],c=e[o+2];return l(a)?(a===n&&s===i&&c===r)<<0|(a===n&&s===r&&c===i)<<1|(a===i&&s===n&&c===r)<<2|(a===i&&s===r&&c===n)<<3|(a===r&&s===n&&c===i)<<4|(a===r&&s===i&&c===n)<<5:63}function _J(e){return(e&1)+(e>>1&1)+(e>>2&1)+(e>>3&1)+(e>>4&1)+(e>>5&1)}Az.prototype.updateAttribute=function(e){let t=this._extraVertices,n=e.length,i=n/this._originalVertexCount,r=t.length,o=e.constructor,a=new o(e.length+r*i);a.set(e);for(let s=0;s<r;s++){let c=t[s]*i,u=n+s*i;for(let f=0;f<i;f++)a[u+f]=a[c+f]}return a};Az.createTexture=function(e){let t=e.cache.modelOutliningCache;if(l(t)||(t=e.cache.modelOutliningCache={}),l(t.outlineTexture))return t.outlineTexture;let n=Math.min(4096,Ft.maximumTextureSize),i=n,r=zye(i),o=[];for(;i>1;)i>>=1,o.push(zye(i));let a=new Et({context:e,source:{arrayBufferView:r,mipLevels:o},width:n,height:1,pixelFormat:He.LUMINANCE,sampler:new Ut({wrapS:on.CLAMP_TO_EDGE,wrapT:on.CLAMP_TO_EDGE,minificationFilter:Gt.LINEAR_MIPMAP_LINEAR,magnificationFilter:ni.LINEAR})});return t.outlineTexture=a,a};function zye(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 Uye(e,t){this._originalVertexCount=t,this._edges=new Set;for(let n=0;n<e.length;n+=2){let i=e[n],r=e[n+1],o=Math.min(i,r),a=Math.max(i,r),s=o*this._originalVertexCount+a;this._edges.add(s)}}Uye.prototype.hasEdge=function(e,t){let n=Math.min(e,t),i=Math.max(e,t),r=n*this._originalVertexCount+i;return this._edges.has(r)};var _E=Az;function Vye(e){this.attribute=e,this.loadBuffer=!1,this.loadTypedArray=!1}function Ent(e){this.indices=e,this.loadBuffer=!1,this.loadTypedArray=!1}function bz(e){this.primitive=e,this.attributePlans=[],this.indicesPlan=void 0,this.needsOutlines=!1,this.outlineIndices=void 0,this.needsGaussianSplats=!1}bz.prototype.postProcess=function(e){this.needsOutlines&&(Snt(this),Pnt(this,e)),this.needsGaussianSplats&&Int(this,e)};function Snt(e){let t=e.primitive,n=t.indices,i=t.attributes[0].count,r=new _E({triangleIndices:n.typedArray,outlineIndices:e.outlineIndices,originalVertexCount:i});n.typedArray=r.updatedTriangleIndices,n.indexDatatype=Ve.fromTypedArray(n.typedArray);let o=wnt(r.outlineCoordinates),a=new Vye(o);a.loadBuffer=!0,a.loadTypedArray=!1,e.attributePlans.push(a),t.outlineCoordinates=a.attribute;let s=e.attributePlans,c=e.attributePlans.length;for(let u=0;u<c;u++){let f=s[u].attribute;f.typedArray=r.updateAttribute(f.typedArray)}}function wnt(e){let t=new Tn.Attribute;return t.name="_OUTLINE_COORDINATES",t.typedArray=e,t.componentDatatype=Y.FLOAT,t.type=Vt.VEC3,t.normalized=!1,t.count=e.length/3,t}function Int(e,t){let n=e.attributePlans,i=n.length;for(let r=0;r<i;r++){let o=n[r];o.loadBuffer=!1,o.loadTypedArray=!0}}function Pnt(e,t){Dnt(e.attributePlans,t),l(e.indicesPlan)&&Rnt(e.indicesPlan,t)}function Dnt(e,t){let n=e.length;for(let i=0;i<n;i++){let r=e[i],o=r.attribute,a=o.typedArray;if(r.loadBuffer){let s=Ze.createVertexBuffer({typedArray:a,context:t,usage:Oe.STATIC_DRAW});s.vertexArrayDestroyable=!1,o.buffer=s}r.loadTypedArray||(o.typedArray=void 0)}}function Rnt(e,t){let n=e.indices;if(e.loadBuffer){let i=Ze.createIndexBuffer({typedArray:n.typedArray,context:t,usage:Oe.STATIC_DRAW,indexDatatype:n.indexDatatype});n.buffer=i,i.vertexArrayDestroyable=!1}e.loadTypedArray||(n.typedArray=void 0)}bz.AttributeLoadPlan=Vye;bz.IndicesLoadPlan=Ent;var yE=bz;function Ont(e){e=e??H.EMPTY_OBJECT,this.webp=e.webp??!1,this.basis=e.basis??!1}var xz=Ont;function jye(e){this._position=e.position,this._adjustmentParams=e.adjustmentParams}Object.defineProperties(jye.prototype,{position:{get:function(){return this._position}},adjustmentParams:{get:function(){return this._adjustmentParams}}});var Tz=jye;function Hye(e){this._position=e.position,this._adjustmentParams=e.adjustmentParams,this._covarianceMatrix=e.covarianceMatrix}Object.defineProperties(Hye.prototype,{position:{get:function(){return this._position}},adjustmentParams:{get:function(){return this._adjustmentParams}},covarianceMatrix:{get:function(){return this._covarianceMatrix}}});var Cz=Hye;function Gye(e){this._groupFlags=e.groupFlags,this._rotationThetas=e.rotationThetas,this._params=e.params}Object.defineProperties(Gye.prototype,{groupFlags:{get:function(){return this._groupFlags}},rotationThetas:{get:function(){return this._rotationThetas}},params:{get:function(){return this._params}}});var vz=Gye;var Wye={Direct:"Direct",Indirect:"Indirect"};Object.freeze(Wye);var Qb=Wye;function qye(e){this._storageType=e.storageType,this._anchorPointsIndirect=e.anchorPointsIndirect,this._anchorPointsDirect=e.anchorPointsDirect,this._intraTileCorrelationGroups=e.intraTileCorrelationGroups,this._covarianceDirect=e.covarianceDirect}Object.defineProperties(qye.prototype,{storageType:{get:function(){return this._storageType}},anchorPointsIndirect:{get:function(){return this._anchorPointsIndirect}},anchorPointsDirect:{get:function(){return this._anchorPointsDirect}},intraTileCorrelationGroups:{get:function(){return this._intraTileCorrelationGroups}},covarianceDirect:{get:function(){return this._covarianceDirect}}});var wD=qye;function Yye(e){this._A=e.A,this._alpha=e.alpha,this._beta=e.beta,this._T=e.T}Object.defineProperties(Yye.prototype,{A:{get:function(){return this._A}},alpha:{get:function(){return this._alpha}},beta:{get:function(){return this._beta}},T:{get:function(){return this._T}}});var Ez=Yye;function AE(){}function Xye(e){return new $(e[0],e[1],e[3],e[1],e[2],e[4],e[3],e[4],e[5])}function Mnt(e){let t=h.fromArray(e.position,0,new h),n=h.fromArray(e.adjustmentParams,0,new h);return new Tz({position:t,adjustmentParams:n})}function Lnt(e){let t=h.fromArray(e.position,0,new h),n=h.fromArray(e.adjustmentParams,0,new h),i=Xye(e.covarianceMatrix);return new Cz({position:t,adjustmentParams:n,covarianceMatrix:i})}function Nnt(e){let t=e.groupFlags,n=h.fromArray(e.rotationThetas,0,new h),i=[];for(let o of e.params){let a=new Ez({A:o.A,alpha:o.alpha,beta:o.beta,T:o.T});i.push(a)}return new vz({groupFlags:t,rotationThetas:n,params:i})}AE.load=function(e){let t=e.storageType;if(t===Qb.Direct)return AE.loadDirect(e);if(t===Qb.Indirect)return AE.loadIndirect(e);throw new oe(`Invalid storage type in NGA_gpm_local - expected 'Direct' or 'Indirect', but found ${t}`)};AE.loadDirect=function(e){let t=[],n=e.anchorPointsDirect;for(let o of n){let a=Mnt(o);t.push(a)}let i=Xye(e.covarianceDirectUpperTriangle);return new wD({storageType:Qb.Direct,anchorPointsDirect:t,covarianceDirect:i})};AE.loadIndirect=function(e){let t=[],n=e.anchorPointsIndirect;for(let a of n){let s=Lnt(a);t.push(s)}let i=e.intraTileCorrelationGroups,r=[];for(let a of i){let s=Nnt(a);r.push(s)}return new wD({storageType:Qb.Indirect,anchorPointsIndirect:t,intraTileCorrelationGroups:r})};var Sz=AE;function Kye(e){this._traits=e.traits,this._noData=e.noData,this._offset=e.offset,this._scale=e.scale,this._index=e.index,this._texCoord=e.texCoord}Object.defineProperties(Kye.prototype,{traits:{get:function(){return this._traits}},noData:{get:function(){return this._noData}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},index:{get:function(){return this._index}},texCoord:{get:function(){return this._texCoord}}});var wz=Kye;function $ye(e){this._min=e.min,this._max=e.max,this._source=e.source}Object.defineProperties($ye.prototype,{min:{get:function(){return this._min}},max:{get:function(){return this._max}},source:{get:function(){return this._source}}});var Iz=$ye;function Jye(e){this._ppeTextures=e}Object.defineProperties(Jye.prototype,{ppeTextures:{get:function(){return this._ppeTextures}}});var Pz=Jye;function Wo(e){e=e??H.EMPTY_OBJECT;let t=e.gltf,n=e.extension,i=e.gltfResource,r=e.baseResource,o=e.supportedImageFormats,a=e.frameState,s=e.cacheKey,c=e.asynchronous??!0;this._gltfResource=i,this._baseResource=r,this._gltf=t,this._extension=n,this._supportedImageFormats=o,this._frameState=a,this._cacheKey=s,this._asynchronous=c,this._textureLoaders=[],this._textureIds=[],this._meshPrimitiveGpmLocal=void 0,this._structuralMetadata=void 0,this._state=At.UNLOADED,this._promise=void 0}l(Object.create)&&(Wo.prototype=Object.create(er.prototype),Wo.prototype.constructor=Wo);Object.defineProperties(Wo.prototype,{cacheKey:{get:function(){return this._cacheKey}},meshPrimitiveGpmLocal:{get:function(){return this._meshPrimitiveGpmLocal}},structuralMetadata:{get:function(){return this._structuralMetadata}}});Wo.prototype._loadResources=async function(){try{return await this._loadTextures(),this.isDestroyed()?void 0:(this._gltf=void 0,this._state=At.LOADED,this)}catch(e){if(this.isDestroyed())return;throw this.unload(),this._state=At.FAILED,this.getError("Failed to load GPM data",e)}};Wo.prototype.load=function(){return l(this._promise)?this._promise:(this._state=At.LOADING,this._promise=this._loadResources(this),this._promise)};function Fnt(e){let t={},n=e.ppeTextures;if(l(n))for(let i=0;i<n.length;i++){let r=n[i];t[r.index]=r}return t}Wo.prototype._loadTextures=function(){let e;l(this._extension)&&(e=Fnt(this._extension));let t=this._gltf,n=this._gltfResource,i=this._baseResource,r=this._supportedImageFormats,o=this._frameState,a=this._asynchronous,s=[];for(let c in e)if(e.hasOwnProperty(c)){let u=Ni.getTextureLoader({gltf:t,textureInfo:e[c],gltfResource:n,baseResource:i,supportedImageFormats:r,frameState:o,asynchronous:a});this._textureLoaders.push(u),this._textureIds.push(c),s.push(u.load())}return Promise.all(s)};Wo.ppeTexturesMetadataSchemaCache=new Map;Wo._createPpeTextureClassJson=function(e,t){let n=e.traits,i=n.source,r=e.offset??0,o=(e.scale??1)*255;return{name:`PPE texture class ${t}`,properties:{[i]:{name:"PPE",type:"SCALAR",componentType:"UINT8",normalized:!0,offset:r,scale:o,min:n.min,max:n.max}}}};Wo._obtainPpeTexturesMetadataSchema=function(e){let n=Wo._collectPpeTexturePropertyIdentifiers(e).toString(),i=Wo.ppeTexturesMetadataSchemaCache.get(n);if(l(i))return i;let o={id:`PPE_TEXTURE_SCHEMA_${Wo.ppeTexturesMetadataSchemaCache.size}`,classes:{}},a=e.ppeTextures;for(let s=0;s<a.length;s++){let c=a[s],u=`ppeTexture_${s}`,f=Wo._createPpeTextureClassJson(c,s);o.classes[u]=f}return i=Zl.fromJson(o),Wo.ppeTexturesMetadataSchemaCache.set(n,i),i};Wo._collectPpeTexturePropertyIdentifiers=function(e){let t=[],n=e.ppeTextures;for(let i=0;i<n.length;i++){let r=n[i],o=Wo._createPpeTextureClassJson(r,i),a=JSON.stringify(o);t.push(a)}return t};Wo._convertToStructuralMetadata=function(e,t){let n=[],i=Wo._obtainPpeTexturesMetadataSchema(e),r=e.ppeTextures;for(let a=0;a<r.length;a++){let s=r[a],c=`ppeTexture_${a}`,f=s.traits.source,d=i.classes[c],p={class:c,properties:{[f]:{index:s.index,texCoord:s.texCoord}}};n.push(new by({id:a,name:s.name,propertyTexture:p,class:d,textures:t}))}return new ec({schema:i,propertyTables:[],propertyTextures:n,propertyAttributes:[]})};Wo.prototype.process=function(e){if(this._state===At.READY)return!0;if(this._state!==At.LOADED)return!1;let t=this._textureLoaders,n=t.length,i=!0;for(let u=0;u<n;++u){let d=t[u].process(e);i=i&&d}if(!i)return!1;let r={};for(let u=0;u<this._textureIds.length;++u){let f=this._textureIds[u],d=t[u];d.isDestroyed()||(r[f]=d.texture)}let o=[],a=this._extension;if(l(a.ppeTextures)){let u=a.ppeTextures;for(let f of u){let d=f.traits,p=new Iz({min:d.min,max:d.max,source:d.source}),g=new wz({traits:p,noData:f.noData,offset:f.offset,scale:f.scale,index:f.index,texCoord:f.texCoord});o.push(g)}}let s=new Pz(o);this._meshPrimitiveGpmLocal=s;let c=Wo._convertToStructuralMetadata(s,r);return this._structuralMetadata=c,this._state=At.READY,!0};Wo.prototype._unloadTextures=function(){let e=this._textureLoaders,t=e.length;for(let n=0;n<t;++n)Ni.unload(e[n]);this._textureLoaders.length=0,this._textureIds.length=0};Wo.prototype.unload=function(){this._unloadTextures(),this._gltf=void 0,this._extension=void 0,this._structuralMetadata=void 0};var Dz=Wo;function Bnt(e){let n=(e.extensions??H.EMPTY_OBJECT).EXT_mesh_primitive_restart,i=e.primitives;if(!l(n))return i;let r=[];Xn(r,i);for(let o of n.primitiveGroups){let a=o.primitives[0];if(!l(a)||!i[a])return i;let s={...i[a],indices:o.indices};switch(s.mode){case ee.TRIANGLE_FAN:case ee.TRIANGLE_STRIP:case ee.LINE_STRIP:case ee.LINE_LOOP:break;default:return i}for(let c of o.primitives){let u=r[c];if(!l(u?.indices)||u.mode!==s.mode)return i;r[c]=void 0}r[a]=s}return r.filter(l)}var Rz=Bnt;var{Attribute:knt,Indices:znt,FeatureIdAttribute:Qye,FeatureIdTexture:eAe,FeatureIdImplicitRange:tAe,MorphTarget:Unt,Primitive:Vnt,Instances:jnt,Skin:Hnt,Node:Gnt,AnimatedPropertyType:Wnt,AnimationSampler:qnt,AnimationTarget:Ynt,AnimationChannel:Xnt,Animation:Knt,ArticulationStage:$nt,Articulation:Jnt,Asset:Znt,Scene:Qnt,Components:eit,MetallicRoughness:tit,SpecularGlossiness:nit,Specular:iit,Anisotropy:yJ,Clearcoat:AJ,PlanarFill:rit,LineStyle:oit,Material:ait,Vector:sit,Polygon:cit}=Tn,Jr={NOT_LOADED:0,LOADING:1,LOADED:2,PROCESSING:3,POST_PROCESSING:4,PROCESSED:5,READY:6,FAILED:7,UNLOADED:8},bJ=class extends er{constructor(t){super(),t=t??H.EMPTY_OBJECT;let{gltfResource:n,typedArray:i,releaseGltfJson:r=!1,asynchronous:o=!0,incrementallyLoadTextures:a=!0,upAxis:s=zi.Y,forwardAxis:c=zi.Z,loadAttributesAsTypedArray:u=!1,loadAttributesFor2D:f=!1,enablePick:d=!1,loadIndicesForWireframe:p=!1,loadPrimitiveOutline:g=!0,loadForClassification:m=!1,renameBatchIdSemantic:y=!1}=t,{baseResource:A=n.clone()}=t;this._gltfJson=t.gltfJson,this._gltfResource=n,this._baseResource=A,this._typedArray=i,this._releaseGltfJson=r,this._asynchronous=o,this._incrementallyLoadTextures=a,this._upAxis=s,this._forwardAxis=c,this._loadAttributesAsTypedArray=u,this._loadAttributesFor2D=f,this._enablePick=d,this._loadIndicesForWireframe=p,this._loadPrimitiveOutline=g,this._loadForClassification=m,this._renameBatchIdSemantic=y,this._sortedPropertyTableIds=void 0,this._sortedFeatureTextureIds=void 0,this._gltfJsonLoader=void 0,this._state=Jr.NOT_LOADED,this._textureState=Jr.NOT_LOADED,this._promise=void 0,this._processError=void 0,this._textureErrors=[],this._primitiveLoadPlans=[],this._loaderPromises=[],this._textureLoaders=[],this._texturesPromises=[],this._textureCallbacks=[],this._bufferViewLoaders=[],this._geometryLoaders=[],this._geometryCallbacks=[],this._structuralMetadataLoader=void 0,this._meshPrimitiveGpmLoader=void 0,this._loadResourcesPromise=void 0,this._resourcesLoaded=!1,this._texturesLoaded=!1,this._supportedImageFormats=void 0,this._postProcessBuffers=[],this._components=void 0}get cacheKey(){}get components(){return this._components}get gltfJson(){return l(this._gltfJsonLoader)?this._gltfJsonLoader.gltf:this._gltfJson}get incrementallyLoadTextures(){return this._incrementallyLoadTextures}get texturesLoaded(){return this._texturesLoaded}async load(){return l(this._promise)?this._promise:(this._promise=lit(this),this._promise)}_process(t){return this._state===Jr.READY?!0:(this._state===Jr.PROCESSING&&fit(this,t),this._resourcesLoaded&&this._state===Jr.POST_PROCESSING&&(dit(this,t.context),this._state=Jr.PROCESSED),this._resourcesLoaded&&this._state===Jr.PROCESSED?(Zye(this),this._typedArray=void 0,this._state=Jr.READY,!0):!1)}_processTextures(t){if(this._textureState===Jr.READY)return!0;if(this._textureState!==Jr.PROCESSING)return!1;let n=!0,i=this._textureLoaders;for(let r=0;r<i.length;++r){let o=i[r].process(t);o&&l(this._textureCallbacks[r])&&(this._textureCallbacks[r](),this._textureCallbacks[r]=void 0),n=n&&o}return n?(this._textureState=Jr.READY,this._texturesLoaded=!0,!0):!1}process(t){if(this._state===Jr.LOADED&&!l(this._loadResourcesPromise)&&(this._loadResourcesPromise=uit(this,t).then(()=>{this._resourcesLoaded=!0}).catch(o=>{this._processError=o})),l(this._processError)){this._state=Jr.FAILED;let o=this._processError;this._processError=void 0,Oz(this,o)}let n=this._textureErrors.pop();if(l(n)){let o=this.getError("Failed to load glTF texture",n);throw o.name="TextureError",o}if(this._state===Jr.FAILED)return!1;let i=!1;try{i=this._process(t)}catch(o){this._state=Jr.FAILED,Oz(this,o)}let r=!1;try{r=this._processTextures(t)}catch(o){this._textureState=Jr.FAILED,Oz(this,o)}return this._incrementallyLoadTextures?i:i&&r}isUnloaded(){return this._state===Jr.UNLOADED}unload(){l(this._gltfJsonLoader)&&!this._gltfJsonLoader.isDestroyed()&&Ni.unload(this._gltfJsonLoader),this._gltfJsonLoader=void 0,Crt(this),Zye(this),vrt(this),Ert(this),Srt(this),wrt(this),this._components=void 0,this._typedArray=void 0,this._state=Jr.UNLOADED}};async function lit(e){e._state=Jr.LOADING,e._textureState=Jr.LOADING;try{let t=Ni.getGltfJsonLoader({gltfResource:e._gltfResource,baseResource:e._baseResource,typedArray:e._typedArray,gltfJson:e._gltfJson});return e._gltfJsonLoader=t,await t.load(),e.isDestroyed()||e.isUnloaded()||t.isDestroyed()?void 0:(e._state=Jr.LOADED,e._textureState=Jr.LOADED,e)}catch(t){if(e.isDestroyed())return;e._state=Jr.FAILED,e._textureState=Jr.FAILED,Oz(e,t)}}async function uit(e,t){fn.supportsWebP.initialized||await fn.supportsWebP.initialize(),e._supportedImageFormats=new xz({webp:fn.supportsWebP(),basis:t.context.supportsBasis});let n=Trt(e,t);return e._state=Jr.PROCESSING,e._textureState=Jr.PROCESSING,l(e._gltfJsonLoader)&&e._releaseGltfJson&&(Ni.unload(e._gltfJsonLoader),e._gltfJsonLoader=void 0),n}function Oz(e,t){throw e.unload(),e.getError("Failed to load glTF",t)}function fit(e,t){let n=!0,i=e._geometryLoaders;for(let a=0;a<i.length;++a){let s=i[a].process(t);s&&l(e._geometryCallbacks[a])&&(e._geometryCallbacks[a](),e._geometryCallbacks[a]=void 0),n=n&&s}let r=e._structuralMetadataLoader;if(l(r)){let a=r.process(t);a&&(e._components.structuralMetadata=r.structuralMetadata),n=n&&a}let o=e._meshPrimitiveGpmLoader;if(l(o)){let a=o.process(t);a&&(l(e._components.structuralMetadata)&&pt("structural-metadata-gpm","The model defines both the 'EXT_structural_metadata' extension and the 'NGA_gpm_local' extension. The data from the 'EXT_structural_metadata' extension will be replaced with the data from the 'NGA_gpm_local' extension, and will no longer be available for styling and picking."),e._components.structuralMetadata=o.structuralMetadata),n=n&&a}n&&(e._state=Jr.POST_PROCESSING)}function dit(e,t){let n=e._primitiveLoadPlans;for(let i=0;i<n.length;i++){let r=n[i];r.postProcess(t),(r.needsOutlines||r.needsGaussianSplats)&&hit(e,r)}}function hit(e,t){let n=e._postProcessBuffers,i=t.primitive,r=i.outlineCoordinates;l(r)&&n.push(r.buffer);let o=i.attributes;for(let s=0;s<o.length;s++){let c=o[s];l(c.buffer)&&n.push(c.buffer)}let a=i.indices;l(a)&&l(a.buffer)&&n.push(a.buffer)}function mit(e,t,n,i,r,o,a,s,c){let u=e.gltfJson,d=u.accessors[t].bufferView;return Ni.getVertexBufferLoader({gltf:u,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:c,bufferViewId:d,primitive:i,draco:r,spz:o,attributeSemantic:n,accessorId:t,asynchronous:e._asynchronous,loadBuffer:a,loadTypedArray:s})}function pit(e,t,n,i,r,o,a){return Ni.getIndexBufferLoader({gltf:e.gltfJson,accessorId:t,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:a,primitive:n,draco:i,asynchronous:e._asynchronous,loadBuffer:r,loadTypedArray:o})}function nAe(e,t){let n=Ni.getBufferViewLoader({gltf:e.gltfJson,bufferViewId:t,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoaders.push(n),n}function xJ(e,t,n){let i=t.byteOffset,r=Yu(e,t),o=t.count,a=Hf(t.type),s=t.componentType,c=Y.getSizeInBytes(s),u=c*a,f=o*a;if(r===u)return n=new Uint8Array(n),Y.createArrayBufferView(s,n.buffer,n.byteOffset+i,f);let d=Y.createTypedArray(s,f),p=new DataView(n.buffer),g=new Array(a),m=p_(t.componentType);i=n.byteOffset+i;for(let y=0;y<o;++y){m(p,i,a,c,g);for(let A=0;A<a;++A)d[y*a+A]=g[A];i+=r}return d}function git(e,t){let n=e.type;if(n===Vt.SCALAR)return t.fill(0);let i=Vt.getMathType(n);return t.fill(i.clone(i.ZERO))}function _it(e,t,n,i){let r=e.type,o=e.count;if(r===Vt.SCALAR)for(let a=0;a<o;a++)n[a]=t[a];else if(r===Vt.VEC4&&i)for(let a=0;a<o;a++)n[a]=Fe.unpack(t,a*4);else{let a=Vt.getMathType(r),s=Vt.getNumberOfComponents(r);for(let c=0;c<o;c++)n[c]=a.unpack(t,c*s)}return n}async function yit(e,t,n,i,r){let{gltfJson:o}=e;if(await t.load(),e.isDestroyed())return;let a=xJ(o,n,t.typedArray);i=i??!1,_it(n,a,r,i)}function ID(e,t,n){let i=new Array(t.count),r=t.bufferView;if(l(r)){let o=nAe(e,r),a=yit(e,o,t,n,i);return e._loaderPromises.push(a),i}return git(t,i)}function Lh(e,t){let n=Y.createTypedArray(t.componentType,t.count*Vt.getNumberOfComponents(t.type));if(!l(t.bufferView))return n;let i=nAe(e,t.bufferView),{gltfJson:r}=e,o=i.load().then(()=>{if(e.isDestroyed())return;let a=xJ(r,t,i.typedArray);n.set(a)});return e._loaderPromises.push(o),n}function Tu(e,t){if(l(t))return e===Number?t[0]:e.unpack(t)}function Ait(e){return e===Number?0:new e}function bit(e){switch(e){case Y.BYTE:return 127;case Y.UNSIGNED_BYTE:return 255;case Y.SHORT:return 32767;case Y.UNSIGNED_SHORT:return 65535;default:return 1}}var xit={VEC2:new k(-1,-1),VEC3:new h(-1,-1,-1),VEC4:new ae(-1,-1,-1,-1)};function Tit(e,t){let n=bit(e.componentDatatype),i=xit[e.type],r=e.min;l(r)&&(r=t.divideByScalar(r,n,r),r=t.maximumByComponent(r,i,r));let o=e.max;l(o)&&(o=t.divideByScalar(o,n,o),o=t.maximumByComponent(o,i,o)),e.min=r,e.max=o}function Cit(e,t,n){let i=e.decodeMatrix,r=Tu(n,e.decodedMin),o=Tu(n,e.decodedMax);l(r)&&l(o)&&(t.min=r,t.max=o);let a=new Tn.Quantization;a.componentDatatype=t.componentDatatype,a.type=t.type,i.length===4?(a.quantizedVolumeOffset=i[2],a.quantizedVolumeStepSize=i[0]):i.length===9?(a.quantizedVolumeOffset=new k(i[6],i[7]),a.quantizedVolumeStepSize=new k(i[0],i[4])):i.length===16?(a.quantizedVolumeOffset=new h(i[12],i[13],i[14]),a.quantizedVolumeStepSize=new h(i[0],i[5],i[10])):i.length===25&&(a.quantizedVolumeOffset=new ae(i[20],i[21],i[22],i[23]),a.quantizedVolumeStepSize=new ae(i[0],i[6],i[12],i[18])),t.quantization=a}function vit(e,t,n,i,r){let o=e.accessors[t],a=Vt.getMathType(o.type),s=o.normalized??!1,c=new knt;c.name=n,c.semantic=i,c.setIndex=r,c.constant=Ait(a),c.componentDatatype=o.componentType,c.normalized=s,c.count=o.count,c.type=o.type,c.min=Tu(a,o.min),c.max=Tu(a,o.max),c.byteOffset=o.byteOffset,c.byteStride=Yu(e,o),Qi(o,"WEB3D_quantized_attributes")&&Cit(o.extensions.WEB3D_quantized_attributes,c,a);let u=c.semantic===ot.POSITION||c.semantic===ot.NORMAL||c.semantic===ot.TANGENT||c.semantic===ot.TEXCOORD||c.semantic===ot.FEATURE_ID||c.semantic===ot.SCALE||c.semantic===ot.ROTATION;return e.extensionsRequired?.includes("KHR_mesh_quantization")&&s&&u&&Tit(c,a),c}function iAe(e){let n=/^\w+_(\d+)$/.exec(e);if(n!==null)return parseInt(n[1])}var Eit={gltfSemantic:void 0,renamedSemantic:void 0,modelSemantic:void 0};function TJ(e,t,n){let i=n;e._renameBatchIdSemantic&&(n==="_BATCHID"||n==="BATCHID")&&(i="_FEATURE_ID_0");let r=t.fromGltfSemantic(i),o=Eit;return o.gltfSemantic=n,o.renamedSemantic=i,o.modelSemantic=r,o}function Sit(e){let t=e===ot.POSITION,n=e===ot.FEATURE_ID,i=e===ot.TEXCOORD;return t||n||i}function wit(e,t,n,i){if(e.byteOffset=0,e.byteStride=void 0,e.quantization=t.quantization,n&&(e.buffer=t.buffer),i){let r=l(t.quantization)?t.quantization.componentDatatype:e.componentDatatype;e.typedArray=Y.createArrayBufferView(r,t.typedArray.buffer)}}function Iit(e,t,n,i){if(e.byteOffset=0,e.byteStride=void 0,n&&(e.buffer=t.buffer),i&&l(t.typedArray)&&(e.typedArray=Y.createArrayBufferView(e.componentDatatype,t.typedArray.buffer)),e.semantic===ot.POSITION){let r=a=>{let s=1/0,c=-1/0,u=1/0,f=-1/0,d=1/0,p=-1/0;for(let g=0;g<a.length;g+=3){let m=a[g],y=a[g+1],A=a[g+2];s=Math.min(s,m),c=Math.max(c,m),u=Math.min(u,y),f=Math.max(f,y),d=Math.min(d,A),p=Math.max(p,A)}return[new h(s,u,d),new h(c,f,p)]},o=e.typedArray;[e.min,e.max]=r(o)}}function Pit(e,t,n,i,r,o){if(r&&(n.buffer=i.buffer),o){let a=i.typedArray;n.typedArray=xJ(e,t,a),r||(n.byteOffset=0,n.byteStride=void 0)}}function rAe(e,t,n,i,r,o,a,s,c){let u=e.gltfJson,f=u.accessors[t],d=f.bufferView,p=n.gltfSemantic,g=n.renamedSemantic,m=n.modelSemantic,y=l(m)?iAe(g):void 0,b=vit(u,t,p,m,y);if(!l(r)&&!l(d)&&!l(o))return b;let x=mit(e,t,p,i,r,o,a,s,c),T=e._geometryLoaders.length;e._geometryLoaders.push(x);let C=x.load();return e._loaderPromises.push(C),e._geometryCallbacks[T]=()=>{l(r)&&l(r.attributes)&&l(r.attributes[p])?wit(b,x,a,s):l(o)?Iit(b,x,a,s):Pit(u,f,b,x,a,s)},b}function oAe(e,t,n,i,r,o,a,s,c){let u=n.modelSemantic,f=u===ot.POSITION,d=u===ot.FEATURE_ID,p=f&&!a&&e._loadAttributesFor2D&&!c.scene3DOnly,g=f&&e._enablePick&&!c.context.webgl2,m=e._loadForClassification&&d,y=e._loadAttributesAsTypedArray,A=!y,b=y||p||g||m,C=rAe(e,t,n,i,r,o,s?!1:A,s?!0:b,c),E=new yE.AttributeLoadPlan(C);return E.loadBuffer=A,E.loadTypedArray=b,E}function Dit(e,t,n,i,r){let o=e.gltfJson.accessors,a=l(n.ROTATION),s=l(n.TRANSLATION)&&l(o[n.TRANSLATION].min)&&l(o[n.TRANSLATION].max),c=TJ(e,Do,i),u=c.modelSemantic,f=u===Do.TRANSLATION||u===Do.ROTATION||u===Do.SCALE,d=u===Do.TRANSLATION,p=e._loadAttributesAsTypedArray||a&&f||!r.context.instancedArrays,g=e._enablePick&&!r.context.webgl2,m=!p,y=e._loadAttributesFor2D&&!r.scene3DOnly;return rAe(e,t,c,void 0,void 0,void 0,m,p||d&&(!s||y||g),r)}function Rit(e,t,n,i,r,o){let a=e.gltfJson.accessors[t],s=a.bufferView,c=n.extensions??H.EMPTY_OBJECT,u=c.KHR_draco_mesh_compression,f=l(c.EXT_mesh_primitive_edge_visibility);if(!l(u)&&!l(s))return;let d=new znt;d.count=a.count;let p=e._loadAttributesAsTypedArray,g=(e._loadIndicesForWireframe||e._enablePick)&&!o.context.webgl2,m=e._loadForClassification&&i,A=!p,b=p||g||m||f,C=pit(e,t,n,u,r?!1:A,r?!0:b,o),E=e._geometryLoaders.length;e._geometryLoaders.push(C);let w=C.load();e._loaderPromises.push(w),e._geometryCallbacks[E]=()=>{d.indexDatatype=C.indexDatatype,d.buffer=C.buffer,d.typedArray=C.typedArray};let D=new yE.IndicesLoadPlan(d);return D.loadBuffer=A,D.loadTypedArray=b,D}function Ll(e,t,n,i){let r=e.gltfJson,o=Xu.getImageIdFromTexture({gltf:r,textureId:t.index,supportedImageFormats:e._supportedImageFormats});if(!l(o))return;let a=Ni.getTextureLoader({gltf:r,textureInfo:t,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:n,asynchronous:e._asynchronous}),s=Xu.createModelTextureReader({textureInfo:t}),c=e._textureLoaders.length;e._textureLoaders.push(a);let u=a.load().catch(f=>{if(!e.isDestroyed()){if(!e._incrementallyLoadTextures)throw f;e._textureState=Jr.FAILED,e._textureErrors.push(f)}});return e._texturesPromises.push(u),e._textureCallbacks[c]=()=>{s.texture=a.texture,l(i)&&(s.texture.sampler=i)},s}function Oit(e,t,n){let{diffuseTexture:i,specularGlossinessTexture:r,diffuseFactor:o,specularFactor:a,glossinessFactor:s}=t,c=new nit;return l(i)&&(c.diffuseTexture=Ll(e,i,n)),l(r)&&(c.specularGlossinessTexture=Ll(e,r,n)),c.diffuseFactor=Tu(ae,o),c.specularFactor=Tu(h,a),c.glossinessFactor=s,c}function Mit(e,t,n){let{baseColorTexture:i,metallicRoughnessTexture:r,baseColorFactor:o,metallicFactor:a,roughnessFactor:s}=t,c=new tit;return l(i)&&(c.baseColorTexture=Ll(e,i,n)),l(r)&&(c.metallicRoughnessTexture=Ll(e,r,n)),c.baseColorFactor=Tu(ae,o),c.metallicFactor=a,c.roughnessFactor=s,c}function Lit(e,t,n){let{specularFactor:i,specularTexture:r,specularColorFactor:o,specularColorTexture:a}=t,s=new iit;return l(r)&&(s.specularTexture=Ll(e,r,n)),l(a)&&(s.specularColorTexture=Ll(e,a,n)),s.specularFactor=i,s.specularColorFactor=Tu(h,o),s}function Nit(e,t,n){let{anisotropyStrength:i=yJ.DEFAULT_ANISOTROPY_STRENGTH,anisotropyRotation:r=yJ.DEFAULT_ANISOTROPY_ROTATION,anisotropyTexture:o}=t,a=new yJ;return l(o)&&(a.anisotropyTexture=Ll(e,o,n)),a.anisotropyStrength=i,a.anisotropyRotation=r,a}function Fit(e,t,n){let{clearcoatFactor:i=AJ.DEFAULT_CLEARCOAT_FACTOR,clearcoatTexture:r,clearcoatRoughnessFactor:o=AJ.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,clearcoatRoughnessTexture:a,clearcoatNormalTexture:s}=t,c=new AJ;return l(r)&&(c.clearcoatTexture=Ll(e,r,n)),l(a)&&(c.clearcoatRoughnessTexture=Ll(e,a,n)),l(s)&&(c.clearcoatNormalTexture=Ll(e,s,n)),c.clearcoatFactor=i,c.clearcoatRoughnessFactor=o,c}function Bit(e){return new rit(e)}function kit(e){if(!l(e))return;let t=new oit;if(l(e.width)){let n=e.width;n>0&&Math.floor(n)===n&&(t.width=n)}if(l(e.pattern)){let n=e.pattern;n>=0&&n<=65535&&Math.floor(n)===n&&(t.pattern=n)}if(!(!l(t.width)&&!l(t.pattern)))return t}function zit(e,t,n){let i=new ait,r=t.extensions??H.EMPTY_OBJECT,o=r.KHR_materials_pbrSpecularGlossiness,a=r.KHR_materials_specular,s=r.KHR_materials_anisotropy,c=r.KHR_materials_clearcoat,u=t.pbrMetallicRoughness,f=r.BENTLEY_materials_planar_fill;i.unlit=l(r.KHR_materials_unlit),l(o)?i.specularGlossiness=Oit(e,o,n):(l(u)&&(i.metallicRoughness=Mit(e,u,n)),l(a)&&!i.unlit&&(i.specular=Lit(e,a,n)),l(s)&&!i.unlit&&(i.anisotropy=Nit(e,s,n)),l(c)&&!i.unlit&&(i.clearcoat=Fit(e,c,n))),l(t.emissiveTexture)&&(i.emissiveTexture=Ll(e,t.emissiveTexture,n)),l(t.normalTexture)&&!e._loadForClassification&&(i.normalTexture=Ll(e,t.normalTexture,n)),l(t.occlusionTexture)&&(i.occlusionTexture=Ll(e,t.occlusionTexture,n)),i.emissiveFactor=Tu(h,t.emissiveFactor),i.alphaMode=t.alphaMode,i.alphaCutoff=t.alphaCutoff,i.doubleSided=t.doubleSided,l(f)&&(i.planarFill=Bit(f));let d=r.BENTLEY_materials_point_style;if(l(d)&&l(d.diameter)){let p=d.diameter;p>=1&&(i.pointDiameter=Math.floor(p))}return i.lineStyle=kit(r.BENTLEY_materials_line_style),i}function aAe(e,t){let n=new Qye;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 sAe(e,t,n,i){let r=new Qye,o=e.featureIds;return r.featureCount=n,r.propertyTableId=t,r.setIndex=iAe(o.attribute),r.positionalLabel=i,r}function cAe(e,t){let n=new tAe;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 lAe(e,t,n,i){let r=new tAe,o=e.featureIds;r.propertyTableId=t,r.featureCount=n,r.offset=o.constant??0;let a=o.divisor??0;return r.repeat=a===0?void 0:a,r.positionalLabel=i,r}function Uit(e,t,n,i){let r=new eAe;r.featureCount=t.featureCount,r.nullFeatureId=t.nullFeatureId,r.propertyTableId=t.propertyTable,r.label=t.label,r.positionalLabel=i;let o=t.texture;r.textureReader=Ll(e,o,n,Ut.NEAREST);let s=(l(o.channels)?o.channels:[0]).map(function(c){return"rgba".charAt(c)}).join("");return r.textureReader.channels=s,r}function Vit(e,t,n,i,r,o){let a=new eAe,s=t.featureIds,c=s.texture;return a.featureCount=r,a.propertyTableId=n,a.textureReader=Ll(e,c,i,Ut.NEAREST),a.textureReader.channels=s.channels,a.positionalLabel=o,a}function jit(e,t,n,i,r){let o=new Unt,a=void 0,s=void 0,c=void 0,u=!1;for(let f in t){if(!t.hasOwnProperty(f))continue;let d=t[f],p=TJ(e,ot,f),g=oAe(e,d,p,a,s,c,u,n,r);o.attributes.push(g.attribute),i.attributePlans.push(g)}return o}function Hit(e){let i=e?.KHR_gaussian_splatting?.extensions?.KHR_gaussian_splatting_compression_spz_2;if(l(i))return i}function uAe(e,t){if(!l(t))return;let n=e.gltfJson.materials;if(!l(n)||t<0||t>=n.length)return;let i=n[t];if(!l(i))return;let r=i.pbrMetallicRoughness??H.EMPTY_OBJECT,o=Tu(ae,r.baseColorFactor);return l(o)?o:new ae(1,1,1,1)}function Git(e){switch(e){case Y.UNSIGNED_BYTE:return 255;case Y.UNSIGNED_SHORT:return 65535;case Y.UNSIGNED_INT:return 4294967295;default:throw new oe("EXT_mesh_primitive_edge_visibility line strings indices must use unsigned scalar component types.")}}function Wit(e,t,n){if(!l(t)||t.length===0)return;let i=new Array(t.length);for(let r=0;r<t.length;r++){let o=t[r]??H.EMPTY_OBJECT,a=o.indices,s=e.gltfJson.accessors[a];if(!l(s))throw new oe("Edge visibility line string accessor not found!");let c=Lh(e,s),u=Git(s.componentType),f=l(o.material)?o.material:n;i[r]={indices:c,restartIndex:u,componentType:s.componentType,materialColor:uAe(e,f)}}return i}function qit(e,t){if(!l(t))return;let n={},i=t.visibility;if(l(i)){let r=e.gltfJson.accessors[i];if(!l(r))throw new oe("Edge visibility accessor not found!");n.visibility=Lh(e,r)}if(n.materialColor=uAe(e,t.material),l(t.silhouetteNormals)){let r=e.gltfJson.accessors[t.silhouetteNormals];l(r)&&(n.silhouetteNormals=Lh(e,r))}return l(t.lineStrings)&&(n.lineStrings=Wit(e,t.lineStrings,t.material)),n}function Yit(e,t,n,i){let r=new Vnt,o=new yE(r);e._primitiveLoadPlans.push(o);let a=t.material;l(a)&&(r.material=zit(e,e.gltfJson.materials[a],i));let s=t.extensions??H.EMPTY_OBJECT,c=s.EXT_mesh_polygon;l(c)&&(r.polygon=Kit(e,t,c));let u=s.CESIUM_mesh_vector;l(u)&&(r.vector=$it(e,u));let f=!1,d=s.CESIUM_primitive_outline;e._loadPrimitiveOutline&&l(d)&&(f=!0,o.needsOutlines=!0,o.outlineIndices=Xit(e,d,o)),r.edgeVisibility=qit(e,s.EXT_mesh_primitive_edge_visibility);let p=Hit(s);l(p)&&(f=!0,o.needsGaussianSplats=!0);let g=e._loadForClassification,m=s.KHR_draco_mesh_compression,y=!1,A=t.attributes;if(l(A))for(let M in A){if(!A.hasOwnProperty(M))continue;let N=A[M],_=TJ(e,ot,M),v=_.modelSemantic;if(g&&!Sit(v))continue;v===ot.FEATURE_ID&&(y=!0);let S=oAe(e,N,_,t,m,p,n,f,i);o.attributePlans.push(S),r.attributes.push(S.attribute)}let b=t.targets;if(l(b)&&!g)for(let M=0;M<b.length;++M)r.morphTargets.push(jit(e,b[M],f,o,i));let x=t.indices;if(l(x)){let M=Rit(e,x,t,y,f,i);l(M)&&(o.indicesPlan=M,r.indices=M.indices)}let T=s.EXT_structural_metadata,C=s.EXT_mesh_features,E=s.EXT_feature_metadata,w=l(E),D=s.NGA_gpm_local;l(C)?Jit(e,r,C,i):w&&Zit(e,r,E,i),l(T)?Qit(r,T):w&&ert(e,r,E),l(D)&&trt(r,D);let R=t.mode;if(g&&R!==Re.TRIANGLES)throw new oe("Only triangle meshes can be used for classification.");return r.primitiveType=R,r}function Xit(e,t){let n=t.indices,i=e.gltfJson.accessors[n];return ID(e,i,!1)}function Kit(e,t,n){let i=new cit,r=e.gltfJson.accessors;return i.count=n.count,t.mode===Re.LINE_LOOP?(i.loopIndices=Lh(e,r[t.indices]),i.loopIndicesOffsets=Lh(e,r[n.indicesOffsets]),i.triangleIndices=Lh(e,r[n.triangleIndices]),i.triangleIndicesOffsets=Lh(e,r[n.triangleIndicesOffsets])):t.mode===Re.TRIANGLES&&(i.loopIndices=Lh(e,r[n.loopIndices]),i.loopIndicesOffsets=Lh(e,r[n.loopIndicesOffsets]),i.triangleIndices=Lh(e,r[t.indices]),i.triangleIndicesOffsets=Lh(e,r[n.indicesOffsets])),i}function $it(e,t){if(!l(t))return;let n=new sit;n.vector=t.vector,n.count=t.count;let i=e.gltfJson.accessors;function r(o,a){if(l(o))return ID(e,i[o])}return n.polygonAttributeOffsets=r(t.polygonAttributeOffsets,"polygonAttributeOffsets"),n.polygonHoleCounts=r(t.polygonHoleCounts,"polygonHoleCounts"),n.polygonHoleOffsets=r(t.polygonHoleOffsets,"polygonHoleOffsets"),n.polygonIndicesOffsets=r(t.polygonIndicesOffsets,"polygonIndicesOffsets"),n}function Jit(e,t,n,i){let r;l(n)&&l(n.featureIds)?r=n.featureIds:r=[];for(let o=0;o<r.length;o++){let a=r[o],s=`featureId_${o}`,c;l(a.texture)?c=Uit(e,a,i,s):l(a.attribute)?c=aAe(a,s):c=cAe(a,s),t.featureIds.push(c)}}function Zit(e,t,n,i){let{featureTables:r}=e.gltfJson.extensions.EXT_feature_metadata,o=0,a=n.featureIdAttributes;if(l(a))for(let c=0;c<a.length;++c){let u=a[c],f=u.featureTable,d=e._sortedPropertyTableIds.indexOf(f),p=r[f].count,g=`featureId_${o}`;o++;let m;l(u.featureIds.attribute)?m=sAe(u,d,p,g):m=lAe(u,d,p,g),t.featureIds.push(m)}let s=n.featureIdTextures;if(l(s))for(let c=0;c<s.length;++c){let u=s[c],f=u.featureTable,d=e._sortedPropertyTableIds.indexOf(f),p=r[f].count,g=`featureId_${o}`;o++;let m=Vit(e,u,d,i,p,g);t.featureIds.push(m)}}function Qit(e,t){if(!l(t))return;let{propertyTextures:n,propertyAttributes:i}=t;l(n)&&(e.propertyTextureIds=n),l(i)&&(e.propertyAttributeIds=i)}function ert(e,t,n){l(n.featureTextures)&&(t.propertyTextureIds=n.featureTextures.map(function(i){return e._sortedFeatureTextureIds.indexOf(i)}))}function trt(e,t){let n=t.ppeTextures??[];for(let i=0;i<n.length;i++)e.propertyTextureIds.push(i)}function nrt(e,t,n){let i=t.EXT_mesh_gpu_instancing,r=new jnt,o=i.attributes;if(l(o))for(let u in o){if(!o.hasOwnProperty(u))continue;let f=o[u];r.attributes.push(Dit(e,f,o,u,n))}let a=i.extensions??H.EMPTY_OBJECT,s=t.EXT_instance_features,c=a.EXT_feature_metadata;return l(s)?irt(r,s):l(c)&&rrt(e.gltfJson,r,c,e._sortedPropertyTableIds),r}function irt(e,t){let n=t.featureIds;for(let i=0;i<n.length;i++){let r=n[i],o=`instanceFeatureId_${i}`,a;l(r.attribute)?a=aAe(r,o):a=cAe(r,o),e.featureIds.push(a)}}function rrt(e,t,n,i){let r=e.extensions.EXT_feature_metadata.featureTables,o=n.featureIdAttributes;if(l(o))for(let a=0;a<o.length;++a){let s=o[a],c=s.featureTable,u=i.indexOf(c),f=r[c].count,d=`instanceFeatureId_${a}`,p;l(s.featureIds.attribute)?p=sAe(s,u,f,d):p=lAe(s,u,f,d),t.featureIds.push(p)}}function ort(e,t,n){let i=new Gnt;i.name=t.name,i.matrix=Tu(O,t.matrix),i.translation=Tu(h,t.translation),i.rotation=Tu(Fe,t.rotation),i.scale=Tu(h,t.scale);let r=t.extensions??H.EMPTY_OBJECT,o=r.EXT_mesh_gpu_instancing,a=r.AGI_articulations,s=r.CESIUM_mesh_vector;if(l(o)){if(e._loadForClassification)throw new oe("Models with the EXT_mesh_gpu_instancing extension cannot be used for classification.");i.instances=nrt(e,r,n)}l(a)&&(i.articulationName=a.articulationName),l(s)&&(i.meshVector=s);let c=t.mesh;if(l(c)){let u=e.gltfJson.meshes[c],f=Rz(u);for(let g=0;g<f.length;++g)i.primitives.push(Yit(e,f[g],l(i.instances),n));let d=t.weights??u.weights,p=i.primitives[0].morphTargets;i.morphWeights=l(d)?d.slice():new Array(p.length).fill(0)}return i}function art(e,t){let n=e.gltfJson.nodes;if(!l(n))return[];let i=n.map(function(r,o){let a=ort(e,r,t);return a.index=o,a});for(let r=0;r<i.length;++r){let o=n[r].children;if(l(o))for(let a=0;a<o.length;++a)i[r].children.push(i[o[a]])}return i}function srt(e,t,n){let i=new Hnt,r=t.joints;i.joints=r.map(a=>n[a]);let o=t.inverseBindMatrices;if(l(o)){let a=e.gltfJson.accessors[o];i.inverseBindMatrices=ID(e,a)}else i.inverseBindMatrices=new Array(r.length).fill(O.IDENTITY);return i}function crt(e,t){let n=e.gltfJson.skins;if(e._loadForClassification||!l(n))return[];let i=n.map(function(o,a){let s=srt(e,o,t);return s.index=a,s}),r=e.gltfJson.nodes;for(let o=0;o<t.length;++o){let a=r[o].skin;l(a)&&(t[o].skin=i[a])}return i}async function lrt(e,t,n,i){let r=new yz({gltf:e.gltfJson,extension:t,extensionLegacy:n,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:i,asynchronous:e._asynchronous});return e._structuralMetadataLoader=r,r.load()}async function urt(e,t,n,i){let r=new Dz({gltf:t,extension:n,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:i,asynchronous:e._asynchronous});return e._meshPrimitiveGpmLoader=r,r.load()}function frt(e,t){let n=new qnt,i=e.gltfJson.accessors,r=i[t.input];n.input=ID(e,r);let o=t.interpolation;n.interpolation=Xm[o]??Xm.LINEAR;let a=i[t.output];return n.output=ID(e,a,!0),n}function drt(e,t){let n=new Ynt,i=e.node;if(!l(i))return;n.node=t[i];let r=e.path.toUpperCase();return n.path=Wnt[r],n}function hrt(e,t,n){let i=new Xnt,r=e.sampler;return i.sampler=t[r],i.target=drt(e.target,n),i}function mrt(e,t,n){let i=new Knt;i.name=t.name;let r=t.samplers.map(function(a,s){let c=frt(e,a);return c.index=s,c}),o=t.channels.map(function(a){return hrt(a,r,n)});return i.samplers=r,i.channels=o,i}function prt(e,t){let n=e.gltfJson.animations;return e._loadForClassification||!l(n)?[]:n.map(function(r,o){let a=mrt(e,r,t);return a.index=o,a})}function grt(e){let t=new $nt;t.name=e.name;let n=e.type.toUpperCase();return t.type=hl[n],t.minimumValue=e.minimumValue,t.maximumValue=e.maximumValue,t.initialValue=e.initialValue,t}function _rt(e){let t=new Jnt;return t.name=e.name,t.stages=e.stages.map(grt),t}function yrt(e){let n=(e.extensions??H.EMPTY_OBJECT).AGI_articulations?.articulations;return l(n)?n.map(_rt):[]}function Art(e){let t;return l(e.scenes)&&l(e.scene)&&(t=e.scenes[e.scene].nodes),t=t??e.nodes,t=l(t)?t:[],t}function brt(e,t){let n=new Qnt,i=Art(e);return n.nodes=i.map(function(r){return t[r]}),n}var xrt=new h;function Trt(e,t){let n=e.gltfJson,i=n.extensions??H.EMPTY_OBJECT,r=i.EXT_structural_metadata,o=i.EXT_feature_metadata,a=i.CESIUM_RTC;if(l(o)){let x=o.featureTables,T=o.featureTextures,C=l(x)?x:[],E=l(T)?T:[];e._sortedPropertyTableIds=Object.keys(C).sort(),e._sortedFeatureTextureIds=Object.keys(E).sort()}let s=art(e,t),c=crt(e,s),u=prt(e,s),f=yrt(n),d=brt(n,s),p=new eit,g=new Znt,m=n.asset.copyright;if(l(m)){let x=m.split(";").map(function(T){return new wt(T.trim())});g.credits=x}if(p.asset=g,p.scene=d,p.nodes=s,p.skins=c,p.animations=u,p.articulations=f,p.upAxis=e._upAxis,p.forwardAxis=e._forwardAxis,l(a)){let x=h.fromArray(a.center,0,xrt);p.transform=O.fromTranslation(x,p.transform)}if(e._components=p,l(r)||l(o)){let x=lrt(e,r,o,t);e._loaderPromises.push(x)}let y=i.NGA_gpm_local;if(l(y)){let x=Sz.load(y);e._components.extensions.NGA_gpm_local=x}let A=n.meshes;if(l(A))for(let x of A){let T=x.primitives;if(l(T))for(let C of T){let E=C.extensions;if(l(E)){let w=E.NGA_gpm_local;if(l(w)){let D=urt(e,n,w,t);e._loaderPromises.push(D)}}}}let b=[];return Xn(b,e._loaderPromises),e._incrementallyLoadTextures||Xn(b,e._texturesPromises),Promise.all(b)}function Crt(e){let t=e._textureLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Ni.unload(t[n]);e._textureLoaders.length=0}function Zye(e){let t=e._bufferViewLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Ni.unload(t[n]);e._bufferViewLoaders.length=0}function vrt(e){let t=e._geometryLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Ni.unload(t[n]);e._geometryLoaders.length=0}function Ert(e){let t=e._postProcessBuffers;for(let n=0;n<t.length;n++){let i=t[n];i.isDestroyed()||i.destroy()}t.length=0}function Srt(e){l(e._structuralMetadataLoader)&&!e._structuralMetadataLoader.isDestroyed()&&(e._structuralMetadataLoader.destroy(),e._structuralMetadataLoader=void 0)}function wrt(e){l(e._meshPrimitiveGpmLoader)&&!e._meshPrimitiveGpmLoader.isDestroyed()&&(e._meshPrimitiveGpmLoader.destroy(),e._meshPrimitiveGpmLoader=void 0)}var Ad=bJ;function ex(e){this._url=e,this._cubeMapBuffers=void 0,this._texture=void 0,this._maximumMipmapLevel=void 0,this._loading=!1,this._ready=!1,this._errorEvent=new be}Object.defineProperties(ex.prototype,{url:{get:function(){return this._url}},errorEvent:{get:function(){return this._errorEvent}},texture:{get:function(){return this._texture}},maximumMipmapLevel:{get:function(){return this._maximumMipmapLevel}},ready:{get:function(){return this._ready}}});ex.isSupported=function(e){return(e.colorBufferHalfFloat&&e.halfFloatingPointTexture||e.floatingPointTexture&&e.colorBufferFloat)&&e.supportsTextureLod};function CJ(e){e._cubeMapBuffers=void 0}ex.prototype.update=function(e){let{context:t}=e;if(!ex.isSupported(t))return;if(l(this._texture)){CJ(this);return}if(!l(this._texture)&&!this._loading){let f=t.textureCache.getTexture(this._url);l(f)&&(CJ(this),this._texture=f,this._maximumMipmapLevel=this._texture.maximumMipmapLevel,this._ready=!0)}let n=this._cubeMapBuffers;if(!l(n)&&!this._loading){let f=this;qu(this._url).then(function(d){f._cubeMapBuffers=d,f._loading=!1}).catch(function(d){f.isDestroyed()||f._errorEvent.raiseEvent(d)}),this._loading=!0}if(!l(this._cubeMapBuffers))return;let{pixelDatatype:i}=n[0].positiveX;l(i)||(i=t.halfFloatingPointTexture?ke.HALF_FLOAT:ke.FLOAT);let r=He.RGBA,o=n.length;this._maximumMipmapLevel=o-1;let a=n[0].positiveX.width,s=Math.log2(a)+1;if(o!==s){let f={};Object.values(aa.FaceName).forEach(d=>{f[d]=void 0});for(let d=o;d<s;d++)n.push(f)}let c=new Ut({minificationFilter:Gt.LINEAR_MIPMAP_LINEAR}),u=new aa({context:t,source:n[0],flipY:!1,pixelDatatype:i,pixelFormat:r,sampler:c});u.loadMipmaps(n.slice(1)),this._texture=u,this._texture.maximumMipmapLevel=this._maximumMipmapLevel,t.textureCache.addTexture(this._url,this._texture),this._ready=!0};ex.prototype.isDestroyed=function(){return!1};ex.prototype.destroy=function(){return CJ(this),this._texture=this._texture&&this._texture.destroy(),ue(this)};var hp=ex;function PD(e){e=e??H.EMPTY_OBJECT;let t=l(e.imageBasedLightingFactor)?k.clone(e.imageBasedLightingFactor):new k(1,1);this._imageBasedLightingFactor=t;let n=e.sphericalHarmonicCoefficients;this._sphericalHarmonicCoefficients=n,this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentCubeMap=void 0,this._specularEnvironmentCubeMapDirty=!0,this._specularEnvironmentMapLoaded=!1,this._previousSpecularEnvironmentMapLoaded=!1,this._useDefaultSpecularMaps=!1,this._useDefaultSphericalHarmonics=!1,this._shouldRegenerateShaders=!1,this._previousFrameNumber=void 0,this._previousFrameContext=void 0,this._previousImageBasedLightingFactor=k.clone(t),this._previousSphericalHarmonicCoefficients=n,this._removeErrorListener=void 0}Object.defineProperties(PD.prototype,{imageBasedLightingFactor:{get:function(){return this._imageBasedLightingFactor},set:function(e){this._previousImageBasedLightingFactor=k.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor),this._imageBasedLightingFactor=k.clone(e,this._imageBasedLightingFactor)}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients},set:function(e){this._previousSphericalHarmonicCoefficients=this._sphericalHarmonicCoefficients,this._sphericalHarmonicCoefficients=e}},specularEnvironmentMaps:{get:function(){return this._specularEnvironmentMaps},set:function(e){e!==this._specularEnvironmentMaps&&(this._specularEnvironmentCubeMapDirty=this._specularEnvironmentCubeMapDirty||e!==this._specularEnvironmentMaps,this._specularEnvironmentMapLoaded=!1),this._specularEnvironmentMaps=e}},enabled:{get:function(){return this._imageBasedLightingFactor.x>0||this._imageBasedLightingFactor.y>0}},shouldRegenerateShaders:{get:function(){return this._shouldRegenerateShaders}},specularEnvironmentCubeMap:{get:function(){return this._specularEnvironmentCubeMap}},useDefaultSphericalHarmonics:{get:function(){return this._useDefaultSphericalHarmonics}},useDefaultSpecularMaps:{get:function(){return this._useDefaultSpecularMaps}},useSpecularEnvironmentMaps:{get:function(){return l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.ready||this._useDefaultSpecularMaps}}});function Irt(e,t){if(hp.isSupported(t)){if(e._specularEnvironmentCubeMap=e._specularEnvironmentCubeMap&&e._specularEnvironmentCubeMap.destroy(),l(e._specularEnvironmentMaps)){let n=new hp(e._specularEnvironmentMaps);e._specularEnvironmentCubeMap=n,e._removeErrorListener=n.errorEvent.addEventListener(i=>{console.error(`Error loading specularEnvironmentMaps: ${i}`)})}e._shouldRegenerateShaders=!0}}PD.prototype.update=function(e){if(e.frameNumber===this._previousFrameNumber&&e.context===this._previousFrameContext)return;this._previousFrameNumber=e.frameNumber;let t=this._previousFrameContext=e.context;e.brdfLutGenerator.update(e),this._shouldRegenerateShaders=!1;let n=this._imageBasedLightingFactor,i=this._previousImageBasedLightingFactor;k.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=k.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor)),this._previousSphericalHarmonicCoefficients!==this._sphericalHarmonicCoefficients&&(this._shouldRegenerateShaders=this._shouldRegenerateShaders||l(this._previousSphericalHarmonicCoefficients)!==l(this._sphericalHarmonicCoefficients),this._previousSphericalHarmonicCoefficients=this._sphericalHarmonicCoefficients),this._shouldRegenerateShaders=this._shouldRegenerateShaders||this._previousSpecularEnvironmentMapLoaded!==this._specularEnvironmentMapLoaded,this._previousSpecularEnvironmentMapLoaded=this._specularEnvironmentMapLoaded,this._specularEnvironmentCubeMapDirty&&(Irt(this,t),this._specularEnvironmentCubeMapDirty=!1),l(this._specularEnvironmentCubeMap)&&(this._specularEnvironmentCubeMap.update(e),this._specularEnvironmentCubeMap.ready&&(this._specularEnvironmentMapLoaded=!0));let r=!l(this._specularEnvironmentCubeMap)&&l(e.specularEnvironmentMaps)&&!this._useDefaultSpecularMaps,o=!l(e.specularEnvironmentMaps)&&this._useDefaultSpecularMaps,a=!l(this._sphericalHarmonicCoefficients)&&l(e.sphericalHarmonicCoefficients)&&!this._useDefaultSphericalHarmonics,s=!l(e.sphericalHarmonicCoefficients)&&this._useDefaultSphericalHarmonics;this._shouldRegenerateShaders=this._shouldRegenerateShaders||r||o||a||s,this._useDefaultSpecularMaps=!l(this._specularEnvironmentCubeMap)&&l(e.specularEnvironmentMaps),this._useDefaultSphericalHarmonics=!l(this._sphericalHarmonicCoefficients)&&l(e.sphericalHarmonicCoefficients)};PD.prototype.isDestroyed=function(){return!1};PD.prototype.destroy=function(){return this._specularEnvironmentCubeMap=this._specularEnvironmentCubeMap&&this._specularEnvironmentCubeMap.destroy(),this._removeErrorListener=this._removeErrorListener&&this._removeErrorListener(),ue(this)};var bE=PD;var Mz=`uniform sampler2D u_pointCloud_colorGBuffer;
|
|
uniform sampler2D u_pointCloud_depthGBuffer;
|
|
uniform vec2 u_distanceAndEdlStrength;
|
|
in vec2 v_textureCoordinates;
|
|
|
|
vec2 neighborContribution(float log2Depth, vec2 offset)
|
|
{
|
|
float dist = u_distanceAndEdlStrength.x;
|
|
vec2 texCoordOrig = v_textureCoordinates + offset * dist;
|
|
vec2 texCoord0 = v_textureCoordinates + offset * floor(dist);
|
|
vec2 texCoord1 = v_textureCoordinates + offset * ceil(dist);
|
|
|
|
float depthOrLogDepth0 = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, texCoord0));
|
|
float depthOrLogDepth1 = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, texCoord1));
|
|
|
|
// ignore depth values that are the clear depth
|
|
if (depthOrLogDepth0 == 0.0 || depthOrLogDepth1 == 0.0) {
|
|
return vec2(0.0);
|
|
}
|
|
|
|
// interpolate the two adjacent depth values
|
|
float depthMix = mix(depthOrLogDepth0, depthOrLogDepth1, fract(dist));
|
|
vec4 eyeCoordinate = czm_windowToEyeCoordinates(texCoordOrig, depthMix);
|
|
return vec2(max(0.0, log2Depth - log2(-eyeCoordinate.z / eyeCoordinate.w)), 1.0);
|
|
}
|
|
|
|
void main()
|
|
{
|
|
float depthOrLogDepth = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, v_textureCoordinates));
|
|
|
|
vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, depthOrLogDepth);
|
|
eyeCoordinate /= eyeCoordinate.w;
|
|
|
|
float log2Depth = log2(-eyeCoordinate.z);
|
|
|
|
if (depthOrLogDepth == 0.0) // 0.0 is the clear value for the gbuffer
|
|
{
|
|
discard;
|
|
}
|
|
|
|
vec4 color = texture(u_pointCloud_colorGBuffer, v_textureCoordinates);
|
|
|
|
// sample from neighbors left, right, down, up
|
|
vec2 texelSize = 1.0 / czm_viewport.zw;
|
|
|
|
vec2 responseAndCount = vec2(0.0);
|
|
|
|
responseAndCount += neighborContribution(log2Depth, vec2(-texelSize.x, 0.0));
|
|
responseAndCount += neighborContribution(log2Depth, vec2(+texelSize.x, 0.0));
|
|
responseAndCount += neighborContribution(log2Depth, vec2(0.0, -texelSize.y));
|
|
responseAndCount += neighborContribution(log2Depth, vec2(0.0, +texelSize.y));
|
|
|
|
float response = responseAndCount.x / responseAndCount.y;
|
|
float strength = u_distanceAndEdlStrength.y;
|
|
float shade = exp(-response * 300.0 * strength);
|
|
color.rgb *= shade;
|
|
out_FragColor = vec4(color);
|
|
|
|
// Input and output depth are the same.
|
|
gl_FragDepth = depthOrLogDepth;
|
|
}
|
|
`;function xE(){this._framebuffer=new si({colorAttachmentsLength:2,depth:!0,supportsDepthTexture:!0}),this._drawCommand=void 0,this._clearCommand=void 0,this._strength=1,this._radius=1}Object.defineProperties(xE.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}},colorGBuffer:{get:function(){return this._framebuffer.getColorTexture(0)}},depthGBuffer:{get:function(){return this._framebuffer.getColorTexture(1)}}});function Prt(e){e._framebuffer.destroy(),e._drawCommand=void 0,e._clearCommand=void 0}var vJ=new k;function Drt(e,t){let n=new Ge({defines:["LOG_DEPTH_WRITE"],sources:[Mz]}),i={u_pointCloud_colorGBuffer:function(){return e.colorGBuffer},u_pointCloud_depthGBuffer:function(){return e.depthGBuffer},u_distanceAndEdlStrength:function(){return vJ.x=e._radius,vJ.y=e._strength,vJ}},r=je.fromCache({blending:en.ALPHA_BLEND,depthMask:!0,depthTest:{enabled:!0},stencilTest:qt.setCesium3DTileBit(),stencilMask:qt.CESIUM_3D_TILE_MASK});e._drawCommand=t.createViewportQuadCommand(n,{uniformMap:i,renderState:r,pass:Pe.CESIUM_3D_TILE,owner:e}),e._clearCommand=new ui({framebuffer:e.framebuffer,color:new U(0,0,0,0),depth:1,renderState:je.fromCache(),pass:Pe.CESIUM_3D_TILE,owner:e})}function Rrt(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i),Drt(e,t)}function fAe(e){return e.drawBuffers&&e.fragmentDepth}xE.isSupported=fAe;function Ort(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"EC");if(!l(n)){let i=t._attributeLocations,r=t.fragmentShaderSource.clone();r.sources.splice(0,0,`layout (location = 0) out vec4 out_FragData_0;
|
|
layout (location = 1) out vec4 out_FragData_1;`),r.sources=r.sources.map(function(o){return o=Ge.replaceMain(o,"czm_point_cloud_post_process_main"),o=o.replaceAll(/out_FragColor/g,"out_FragData_0"),o}),r.sources.push(`void main()
|
|
{
|
|
czm_point_cloud_post_process_main();
|
|
#ifdef LOG_DEPTH
|
|
czm_writeLogDepth();
|
|
out_FragData_1 = czm_packDepth(gl_FragDepth);
|
|
#else
|
|
out_FragData_1 = czm_packDepth(gl_FragCoord.z);
|
|
#endif
|
|
}`),n=e.shaderCache.createDerivedShaderProgram(t,"EC",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:r,attributeLocations:i})}return n}xE.prototype.update=function(e,t,n,i){if(!fAe(e.context))return;this._strength=n.eyeDomeLightingStrength,this._radius=n.eyeDomeLightingRadius*e.pixelRatio,Rrt(this,e.context);let r,o=e.commandList,a=o.length;for(r=t;r<a;++r){let u=o[r];if(u.primitiveType!==Re.POINTS||u.pass===Pe.TRANSLUCENT)continue;let f,d,p=u.derivedCommands.pointCloudProcessor;l(p)&&(f=p.command,d=p.originalShaderProgram),(!l(f)||u.dirty||d!==u.shaderProgram||f.framebuffer!==this.framebuffer)&&(f=nt.shallowClone(u,f),f.framebuffer=this.framebuffer,f.shaderProgram=Ort(e.context,u.shaderProgram),f.castShadows=!1,f.receiveShadows=!1,l(p)||(p={command:f,originalShaderProgram:u.shaderProgram},u.derivedCommands.pointCloudProcessor=p),p.originalShaderProgram=u.shaderProgram),o[r]=f}let s=this._clearCommand,c=this._drawCommand;c.boundingVolume=i,o.push(c),o.push(s)};xE.prototype.isDestroyed=function(){return!1};xE.prototype.destroy=function(){return Prt(this),ue(this)};var xy=xE;function dAe(e){let t=e??{};this.attenuation=t.attenuation??!1,this.geometricErrorScale=t.geometricErrorScale??1,this.maximumAttenuation=t.maximumAttenuation,this.baseResolution=t.baseResolution,this.eyeDomeLighting=t.eyeDomeLighting??!0,this.eyeDomeLightingStrength=t.eyeDomeLightingStrength??1,this.eyeDomeLightingRadius=t.eyeDomeLightingRadius??1,this.backFaceCulling=t.backFaceCulling??!1,this.normalShading=t.normalShading??!0}dAe.isSupported=function(e){return xy.isSupported(e.context)};var J0=dAe;var TE={};TE._deprecationWarning=qs;var Z0=Uint32Array.BYTES_PER_ELEMENT;TE.parse=function(e,t){let n=t??0;t=n;let i=new Uint8Array(e),r=new DataView(e);t+=Z0;let o=r.getUint32(t,!0);if(o!==1)throw new oe(`Only Batched 3D Model version 1 is supported. Version ${o} is not.`);t+=Z0;let a=r.getUint32(t,!0);t+=Z0;let s=r.getUint32(t,!0);t+=Z0;let c=r.getUint32(t,!0);t+=Z0;let u=r.getUint32(t,!0);t+=Z0;let f=r.getUint32(t,!0);t+=Z0;let d;u>=570425344?(t-=Z0*2,d=s,u=c,f=0,s=0,c=0,TE._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-=Z0,d=u,u=s,f=c,s=0,c=0,TE._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;s===0?p={BATCH_LENGTH:d??0}:(p=wo(i,t,s),t+=s);let g=new Uint8Array(e,t,c);t+=c;let m,y;u>0&&(m=wo(i,t,u),t+=u,f>0&&(y=new Uint8Array(e,t,f),y=new Uint8Array(y),t+=f));let A=n+a-t;if(A===0)throw new oe("glTF byte length must be greater than 0.");let b;return t%4===0?b=new Uint8Array(e,t,A):(TE._deprecationWarning("b3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),b=new Uint8Array(i.subarray(t,t+A))),{batchLength:d,featureTableJson:p,featureTableBinary:g,batchTableJson:m,batchTableBinary:y,gltf:b}};var Lz=TE;function DD(e,t){this.json=e,this.buffer=t,this._cachedTypedArrays={},this.featuresLength=0}function hAe(e,t,n,i,r,o){let a=e._cachedTypedArrays,s=a[t];return l(s)||(s=Y.createArrayBufferView(n,e.buffer.buffer,e.buffer.byteOffset+o,r*i),a[t]=s),s}function Mrt(e,t,n,i){let r=e._cachedTypedArrays,o=r[t];return l(o)||(o=Y.createTypedArray(n,i),r[t]=o),o}DD.prototype.getGlobalProperty=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(t=t??Y.UNSIGNED_INT,n=n??1,hAe(this,e,t,n,1,i.byteOffset)):i};DD.prototype.hasProperty=function(e){return l(this.json[e])};DD.prototype.getPropertyArray=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(l(i.componentType)&&(t=Y.fromName(i.componentType)),hAe(this,e,t,n,this.featuresLength,i.byteOffset)):Mrt(this,e,t,i)};DD.prototype.getProperty=function(e,t,n,i,r){let o=this.json[e];if(!l(o))return;let a=this.getPropertyArray(e,t,n);if(n===1)return a[i];for(let s=0;s<n;++s)r[s]=a[n*i+s];return r};var mp=DD;var Lrt={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Nrt={SCALAR:void 0,VEC2:k,VEC3:h,VEC4:ae,MAT2:Zi,MAT3:$,MAT4:O};function Frt(e){let t=e.componentType,n;typeof t=="string"?n=Y.fromName(t):n=t;let i=Lrt[e.type],r=Nrt[e.type];return{componentsPerAttribute:i,classType:r,createArrayBufferView:function(o,a,s){return Y.createArrayBufferView(n,o,a,i*s)}}}var Nh=Frt;function Zc(e){this._id=Kn();let t=e.featuresLength;this._showAlphaProperties=void 0,this._batchValues=void 0,this._batchValuesDirty=!1,this._batchTexture=void 0,this._defaultTexture=void 0,this._pickTexture=void 0,this._pickIds=[];let n,i;if(t>0){let r=Math.min(t,Ft.maximumTextureSize),o=Math.ceil(t/Ft.maximumTextureSize),a=1/r,s=a*.5,c=1/o,u=c*.5;n=new k(r,o),i=new ae(a,s,c,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(Zc.prototype,{translucentFeaturesLength:{get:function(){return this._translucentFeaturesLength}},byteLength:{get:function(){let e=0;return l(this._pickTexture)&&(e+=this._pickTexture.sizeInBytes),l(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}}});Zc.DEFAULT_COLOR_VALUE=U.WHITE;Zc.DEFAULT_SHOW_VALUE=!0;function mAe(e){let t=e._textureDimensions;return t.x*t.y*4}function pAe(e){if(!l(e._batchValues)){let t=mAe(e),n=new Uint8Array(t).fill(255);e._batchValues=n}return e._batchValues}function gAe(e){if(!l(e._showAlphaProperties)){let t=2*e._featuresLength,n=new Uint8Array(t).fill(255);e._showAlphaProperties=n}return e._showAlphaProperties}Zc.prototype.setShow=function(e,t){if(t&&!l(this._showAlphaProperties))return;let n=gAe(this),i=e*2,r=t?255:0;if(n[i]!==r){n[i]=r;let o=pAe(this),a=e*4+3;o[a]=t?n[i+1]:0,this._batchValuesDirty=!0}};Zc.prototype.setAllShow=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setShow(n,e)};Zc.prototype.getShow=function(e){if(!l(this._showAlphaProperties))return!0;let t=e*2;return this._showAlphaProperties[t]===255};var Brt=new Array(4);Zc.prototype.setColor=function(e,t){if(U.equals(t,Zc.DEFAULT_COLOR_VALUE)&&!l(this._batchValues))return;let n=t.toBytes(Brt),i=n[3],r=pAe(this),o=e*4,a=gAe(this),s=e*2;if(r[o]!==n[0]||r[o+1]!==n[1]||r[o+2]!==n[2]||a[s+1]!==i){r[o]=n[0],r[o+1]=n[1],r[o+2]=n[2];let c=a[s+1]!==255,u=a[s]!==0;r[o+3]=u?i:0,a[s+1]=i;let f=i!==255;f&&!c?++this._translucentFeaturesLength:!f&&c&&--this._translucentFeaturesLength,this._batchValuesDirty=!0,l(this._colorChangedCallback)&&this._colorChangedCallback(e,t)}};Zc.prototype.setAllColor=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setColor(n,e)};Zc.prototype.getColor=function(e,t){if(!l(this._batchValues))return U.clone(Zc.DEFAULT_COLOR_VALUE,t);let n=this._batchValues,i=e*4,r=this._showAlphaProperties,o=e*2;return U.fromBytes(n[i],n[i+1],n[i+2],r[o+1],t)};Zc.prototype.getPickColor=function(e){return this._pickIds[e]};function _Ae(e,t,n){let i=e._textureDimensions;return new Et({context:t,pixelFormat:He.RGBA,pixelDatatype:ke.UNSIGNED_BYTE,source:{width:i.x,height:i.y,arrayBufferView:n},flipY:!1,sampler:Ut.NEAREST})}function krt(e,t){let n=e._featuresLength;if(!l(e._pickTexture)&&n>0){let i=e._pickIds,r=mAe(e),o=new Uint8Array(r),a=e._owner,s=e._statistics;for(let c=0;c<n;++c){let u=t.createPickId(a.getFeature(c));i.push(u);let f=u.color,d=c*4;o[d]=U.floatToByte(f.red),o[d+1]=U.floatToByte(f.green),o[d+2]=U.floatToByte(f.blue),o[d+3]=U.floatToByte(f.alpha)}e._pickTexture=_Ae(e,t,o),l(s)&&(s.batchTableByteLength+=e._pickTexture.sizeInBytes)}}function zrt(e){let t=e._textureDimensions;e._batchTexture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}Zc.prototype.update=function(e,t){let n=t.context;this._defaultTexture=n.defaultTexture;let i=t.passes;(i.pick||i.postProcess)&&krt(this,n),this._batchValuesDirty&&(this._batchValuesDirty=!1,l(this._batchTexture)||(this._batchTexture=_Ae(this,n,this._batchValues),l(this._statistics)&&(this._statistics.batchTableByteLength+=this._batchTexture.sizeInBytes)),zrt(this))};Zc.prototype.isDestroyed=function(){return!1};Zc.prototype.destroy=function(){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),this._pickTexture=this._pickTexture&&this._pickTexture.destroy();let e=this._pickIds,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return ue(this)};var Cu=Zc;var yAe={HIGHLIGHT:0,REPLACE:1,MIX:2};Object.freeze(yAe);var sf=yAe;var EJ=Cu.DEFAULT_COLOR_VALUE,SJ=Cu.DEFAULT_SHOW_VALUE;function kr(e,t,n,i,r){this.featuresLength=t;let o;l(n)&&(o=n.extensions),this._extensions=o??{};let a=Urt(n);this._properties=a,this._batchTableHierarchy=Vrt(this,n,i);let s=bAe(t,a,i);this._binaryPropertiesByteLength=jrt(s),this._batchTableBinaryProperties=s,this._content=e,this._batchTexture=new Cu({featuresLength:t,colorChangedCallback:r,owner:e,statistics:e.tileset.statistics})}kr._deprecationWarning=qs;Object.defineProperties(kr.prototype,{batchTableByteLength:{get:function(){let e=this._binaryPropertiesByteLength;return l(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e+=this._batchTexture.byteLength,e}}});function Urt(e){let t={};if(!l(e))return t;for(let n in e)e.hasOwnProperty(n)&&n!=="HIERARCHY"&&n!=="extensions"&&n!=="extras"&&(t[n]=Xe(e[n],!0));return t}function Vrt(e,t,n){if(!l(t))return;let i=e._extensions["3DTILES_batch_table_hierarchy"],r=t.HIERARCHY;if(l(r)&&(kr._deprecationWarning("batchTableHierarchyExtension","The batch table HIERARCHY property has been moved to an extension. Use extensions.3DTILES_batch_table_hierarchy instead."),e._extensions["3DTILES_batch_table_hierarchy"]=r,i=r),!!l(i))return new CE({extension:i,binaryBody:n})}function bAe(e,t,n){let i;for(let r in t)if(t.hasOwnProperty(r)){let o=t[r],a=o.byteOffset;if(l(a)){let s=o.componentType,c=o.type;if(!l(s))throw new oe("componentType is required.");if(!l(c))throw new oe("type is required.");if(!l(n))throw new oe(`Property ${r} requires a batch table binary.`);let u=Nh(o),f=u.componentsPerAttribute,d=u.classType,p=u.createArrayBufferView(n.buffer,n.byteOffset+a,e);l(i)||(i={}),i[r]={typedArray:p,componentCount:f,type:d}}}return i}function jrt(e){if(!l(e))return 0;let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}kr.getBinaryProperties=function(e,t,n){return bAe(e,t,n)};kr.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};kr.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};kr.prototype.getShow=function(e){return this._batchTexture.getShow(e)};kr.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};kr.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};kr.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};kr.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};var Hrt=new U;kr.prototype.applyStyle=function(e){if(!l(e)){this.setAllColor(EJ),this.setAllShow(SJ);return}let t=this._content,n=this.featuresLength;for(let i=0;i<n;++i){let r=t.getFeature(i),o=l(e.color)?e.color.evaluateColor(r,Hrt)??EJ:EJ,a=l(e.show)?e.show.evaluate(r)??SJ:SJ;this.setColor(i,o),this.setShow(i,a)}};function Grt(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}function Wrt(e,t,n){let i=e.typedArray,r=e.componentCount;r===1?i[t]=n:e.type.pack(n,i,t*r)}kr.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return l(n)?n.isClass(e,t):!1};kr.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};kr.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(l(t))return t.getClassName(e)};kr.prototype.hasProperty=function(e,t){return l(this._properties[t])||l(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)};kr.prototype.hasPropertyBySemantic=function(){return!1};kr.prototype.getPropertyIds=function(e,t){t=l(t)?t:[],t.length=0;let n=Object.keys(this._properties);if(Xn(t,n),l(this._batchTableHierarchy)){let i=this._batchTableHierarchy.getPropertyIds(e,n);Xn(t,i)}return t};kr.prototype.getPropertyBySemantic=function(e,t){};kr.prototype.getProperty=function(e,t){if(l(this._batchTableBinaryProperties)){let i=this._batchTableBinaryProperties[t];if(l(i))return Grt(i,e)}let n=this._properties[t];if(l(n))return Xe(n[e],!0);if(l(this._batchTableHierarchy)){let i=this._batchTableHierarchy.getProperty(e,t);if(l(i))return i}};kr.prototype.setProperty=function(e,t,n){let i=this.featuresLength;if(l(this._batchTableBinaryProperties)){let o=this._batchTableBinaryProperties[t];if(l(o)){Wrt(o,e,n);return}}if(l(this._batchTableHierarchy)&&this._batchTableHierarchy.setProperty(e,t,n))return;let r=this._properties[t];l(r)||(this._properties[t]=new Array(i),r=this._properties[t]),r[e]=Xe(n,!0)};function qrt(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));
|
|
}
|
|
`}kr.prototype.getVertexShaderCallback=function(e,t,n){if(this.featuresLength===0)return;let i=this;return function(r){let o=xAe(r,n,!1),a;return Ft.maximumVertexTextureImageUnits>0?(a="",e&&(a+=`uniform bool tile_translucentCommand;
|
|
`),a+=`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&&(a+=` 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;
|
|
}
|
|
}
|
|
`),a+=` tile_featureColor = featureProperties;
|
|
tile_featureSt = st;
|
|
}`):a=`out vec2 tile_featureSt;
|
|
void main()
|
|
{
|
|
tile_color(vec4(1.0));
|
|
tile_featureSt = computeSt(${t});
|
|
}`,`${o}
|
|
${qrt(i)}${a}`}};function AAe(e,t){return e=Ge.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 Yrt(e,t){let n=`texture(${t}`,i=0,r=e.indexOf(n,i),o;for(;r>-1;){let a=0;for(let u=r;u<e.length;++u){let f=e.charAt(u);if(f==="(")++a;else if(f===")"&&(--a,a===0)){o=u+1;break}}let c=`tile_diffuse_final(${e.slice(r,o)}, tile_diffuse)`;e=e.slice(0,r)+c+e.slice(o),i=r+c.length,r=e.indexOf(n,i)}return e}function xAe(e,t,n){if(!l(t))return AAe(e,n);let i=new RegExp(`(uniform|attribute|in)\\s+(vec[34]|sampler2D)\\s+${t};`),r=e.match(i);if(!l(r))return AAe(e,n);let o=r[0],a=r[2];e=Ge.replaceMain(e,"tile_main"),e=e.replace(o,"");let s=`bool isWhite(vec3 color)
|
|
{
|
|
return all(greaterThan(color, vec3(1.0 - czm_epsilon3)));
|
|
}
|
|
vec4 tile_diffuse_final(vec4 sourceDiffuse, vec4 tileDiffuse)
|
|
{
|
|
vec4 blendDiffuse = mix(sourceDiffuse, tileDiffuse, tile_colorBlend);
|
|
vec4 diffuse = isWhite(tileDiffuse.rgb) ? sourceDiffuse : blendDiffuse;
|
|
return vec4(diffuse.rgb, sourceDiffuse.a);
|
|
}
|
|
`,c=` tile_featureColor = czm_gammaCorrect(tile_featureColor);
|
|
out_FragColor.a *= tile_featureColor.a;
|
|
float highlight = ceil(tile_colorBlend);
|
|
out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight);
|
|
`,u;if(a==="vec3"||a==="vec4"){let f=a==="vec3"?`vec4(${t}, 1.0)`:t,d=a==="vec3"?"tile_diffuse.xyz":"tile_diffuse";i=new RegExp(t,"g"),e=e.replace(i,d),u=` vec4 source = ${f};
|
|
tile_diffuse = tile_diffuse_final(source, tile_featureColor);
|
|
tile_main();
|
|
`}else a==="sampler2D"&&(e=Yrt(e,t),u=` tile_diffuse = tile_featureColor;
|
|
tile_main();
|
|
`);return e=`uniform float tile_colorBlend;
|
|
vec4 tile_diffuse = vec4(1.0);
|
|
${s}${o}
|
|
${e}
|
|
void tile_color(vec4 tile_featureColor)
|
|
{
|
|
${u}`,n&&(e+=c),e+=`}
|
|
`,e}kr.prototype.getFragmentShaderCallback=function(e,t,n){if(this.featuresLength!==0)return function(i){return i=xAe(i,t,!0),Ft.maximumVertexTextureImageUnits>0?(i+=`uniform sampler2D tile_pickTexture;
|
|
in vec2 tile_featureSt;
|
|
in vec4 tile_featureColor;
|
|
void main()
|
|
{
|
|
tile_color(tile_featureColor);
|
|
`,n&&(i+=` out_FragColor.rgb *= out_FragColor.a;
|
|
`),i+="}"):(e&&(i+=`uniform bool tile_translucentCommand;
|
|
`),i+=`uniform sampler2D tile_pickTexture;
|
|
uniform sampler2D tile_batchTexture;
|
|
in vec2 tile_featureSt;
|
|
void main()
|
|
{
|
|
vec4 featureProperties = texture(tile_batchTexture, tile_featureSt);
|
|
if (featureProperties.a == 0.0) {
|
|
discard;
|
|
}
|
|
`,e&&(i+=` bool isStyleTranslucent = (featureProperties.a != 1.0);
|
|
if (czm_pass == czm_passTranslucent)
|
|
{
|
|
if (!isStyleTranslucent && !tile_translucentCommand)
|
|
{
|
|
discard;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (isStyleTranslucent)
|
|
{
|
|
discard;
|
|
}
|
|
}
|
|
`),i+=` tile_color(featureProperties);
|
|
`,n&&(i+=` out_FragColor.rgb *= out_FragColor.a;
|
|
`),i+=`}
|
|
`),i}};function Xrt(e){let t=e._content.tileset,n=t.colorBlendMode,i=t.colorBlendAmount;if(n===sf.HIGHLIGHT)return 0;if(n===sf.REPLACE)return 1;if(n===sf.MIX)return I.clamp(i,I.EPSILON4,1)}kr.prototype.getUniformMapCallback=function(){if(this.featuresLength===0)return;let e=this;return function(t){return Ot(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 Xrt(e)},tile_pickTexture:function(){return e._batchTexture.pickTexture}})}};kr.prototype.getPickId=function(){return"texture(tile_pickTexture, tile_featureSt)"};var Ty={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};kr.prototype.addDerivedCommands=function(e,t){let n=e.commandList,i=n.length,r=this._content._tile,o=r._finalResolution,a=r.tileset,s=a.isSkippingLevelOfDetail&&a.hasMixedContent&&e.context.stencilBuffer,c=Krt(this);for(let u=t;u<i;++u){let f=n[u];if(f.pass===Pe.COMPUTE)continue;let d=f.derivedCommands.tileset;(!l(d)||f.dirty)&&(d={},f.derivedCommands.tileset=d,d.originalCommand=$rt(f),f.dirty=!1);let p=d.originalCommand;c!==Ty.ALL_OPAQUE&&f.pass!==Pe.TRANSLUCENT&&(l(d.translucent)||(d.translucent=Jrt(p))),c!==Ty.ALL_TRANSLUCENT&&f.pass!==Pe.TRANSLUCENT&&(l(d.opaque)||(d.opaque=Zrt(p)),s&&(o||(l(d.zback)||(d.zback=eot(e.context,p)),a._backfaceCommands.push(d.zback)),(!l(d.stencil)||r._selectionDepth!==not(d.stencil))&&(f.renderState.depthMask?d.stencil=tot(p,r._selectionDepth):d.stencil=d.opaque)));let g=s?d.stencil:d.opaque,m=d.translucent;f.pass!==Pe.TRANSLUCENT?(c===Ty.ALL_OPAQUE&&(n[u]=g),c===Ty.ALL_TRANSLUCENT&&(n[u]=m),c===Ty.OPAQUE_AND_TRANSLUCENT&&(n[u]=g,n.push(m))):n[u]=p}};function Krt(e){let t=e._batchTexture.translucentFeaturesLength;return t===0?Ty.ALL_OPAQUE:t===e.featuresLength?Ty.ALL_TRANSLUCENT:Ty.OPAQUE_AND_TRANSLUCENT}function $rt(e){let t=nt.shallowClone(e),n=t.pass===Pe.TRANSLUCENT;return t.uniformMap=l(t.uniformMap)?t.uniformMap:{},t.uniformMap.tile_translucentCommand=function(){return n},t}function Jrt(e){let t=nt.shallowClone(e);return t.pass=Pe.TRANSLUCENT,t.renderState=iot(e.renderState),t}function Zrt(e){let t=nt.shallowClone(e);return t.renderState=rot(e.renderState),t}function Qrt(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"zBackfaceLogDepth");if(!l(n)){let i=t.fragmentShaderSource.clone();i.defines=l(i.defines)?i.defines.slice(0):[],i.defines.push("POLYGON_OFFSET"),n=e.shaderCache.createDerivedShaderProgram(t,"zBackfaceLogDepth",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:i,attributeLocations:t._attributeLocations})}return n}function eot(e,t){let n=nt.shallowClone(t),i=Xe(n.renderState,!0);i.cull.enabled=!0,i.cull.face=Ui.FRONT,i.colorMask={red:!1,green:!1,blue:!1,alpha:!1},i.polygonOffset={enabled:!0,factor:5,units:5},i.stencilTest=qt.setCesium3DTileBit(),i.stencilMask=qt.CESIUM_3D_TILE_MASK,n.renderState=je.fromCache(i),n.castShadows=!1,n.receiveShadows=!1,n.uniformMap=Xe(t.uniformMap);let r=new k(5,5);return n.uniformMap.u_polygonOffset=function(){return r},n.shaderProgram=Qrt(e,t.shaderProgram),n}function tot(e,t){let n=nt.shallowClone(e),i=Xe(n.renderState,!0);return i.stencilTest.enabled=!0,i.stencilTest.mask=qt.SKIP_LOD_MASK,i.stencilTest.reference=qt.CESIUM_3D_TILE_MASK|t<<qt.SKIP_LOD_BIT_SHIFT,i.stencilTest.frontFunction=Qn.GREATER_OR_EQUAL,i.stencilTest.frontOperation.zPass=Pt.REPLACE,i.stencilTest.backFunction=Qn.GREATER_OR_EQUAL,i.stencilTest.backOperation.zPass=Pt.REPLACE,i.stencilMask=qt.CESIUM_3D_TILE_MASK|qt.SKIP_LOD_MASK,n.renderState=je.fromCache(i),n}function not(e){return(e.renderState.stencilTest.reference&qt.SKIP_LOD_MASK)>>>qt.SKIP_LOD_BIT_SHIFT}function iot(e){let t=Xe(e,!0);return t.cull.enabled=!1,t.depthTest.enabled=!0,t.depthMask=!1,t.blending=en.ALPHA_BLEND,t.stencilTest=qt.setCesium3DTileBit(),t.stencilMask=qt.CESIUM_3D_TILE_MASK,je.fromCache(t)}function rot(e){let t=Xe(e,!0);return t.stencilTest=qt.setCesium3DTileBit(),t.stencilMask=qt.CESIUM_3D_TILE_MASK,je.fromCache(t)}kr.prototype.update=function(e,t){this._batchTexture.update(e,t)};kr.prototype.isDestroyed=function(){return!1};kr.prototype.destroy=function(){return this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),ue(this)};var pp=kr;function Q0(e){this._classes=void 0,this._classIds=void 0,this._classIndexes=void 0,this._parentCounts=void 0,this._parentIndexes=void 0,this._parentIds=void 0,this._byteLength=0,oot(this,e.extension,e.binaryBody)}Object.defineProperties(Q0.prototype,{byteLength:{get:function(){return this._byteLength}}});function oot(e,t,n){let i,r,o,a=t.instancesLength,s=t.classes,c=t.classIds,u=t.parentCounts,f=t.parentIds,d=a,p=0;l(c.byteOffset)&&(c.componentType=c.componentType??Y.UNSIGNED_SHORT,c.type=Vt.SCALAR,o=Nh(c),c=o.createArrayBufferView(n.buffer,n.byteOffset+c.byteOffset,a),p+=c.byteLength);let g;if(l(u)){for(l(u.byteOffset)&&(u.componentType=u.componentType??Y.UNSIGNED_SHORT,u.type=Vt.SCALAR,o=Nh(u),u=o.createArrayBufferView(n.buffer,n.byteOffset+u.byteOffset,a),p+=u.byteLength),g=new Uint16Array(a),d=0,i=0;i<a;++i)g[i]=d,d+=u[i];p+=g.byteLength}l(f)&&l(f.byteOffset)&&(f.componentType=f.componentType??Y.UNSIGNED_SHORT,f.type=Vt.SCALAR,o=Nh(f),f=o.createArrayBufferView(n.buffer,n.byteOffset+f.byteOffset,d),p+=f.byteLength);let m=s.length;for(i=0;i<m;++i){let b=s[i].length,x=s[i].instances,T=pp.getBinaryProperties(b,x,n);p+=aot(T),s[i].instances=Ot(T,x)}let y=new Array(m).fill(0),A=new Uint16Array(a);for(i=0;i<a;++i)r=c[i],A[i]=y[r],++y[r];p+=A.byteLength,e._classes=s,e._classIds=c,e._classIndexes=A,e._parentCounts=u,e._parentIndexes=g,e._parentIds=f,e._byteLength=p}function aot(e){let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}var sot=[],cot=[],lot=0;function uot(e,t,n){let i=e._classIds,r=e._parentCounts,o=e._parentIds,a=e._parentIndexes,s=i.length,c=sot;c.length=Math.max(c.length,s);let u=++lot,f=cot;for(f.length=0,f.push(t);f.length>0;){if(t=f.pop(),c[t]===u)continue;c[t]=u;let d=n(e,t);if(l(d))return d;let p=r[t],g=a[t];for(let m=0;m<p;++m){let y=o[g+m];y!==t&&f.push(y)}}}function fot(e,t,n){let i=!0;for(;i;){let r=n(e,t);if(l(r))return r;let o=e._parentIds[t];i=o!==t,t=o}}function RD(e,t,n){let i=e._parentCounts,r=e._parentIds;if(l(r)){if(l(i))return uot(e,t,n)}else return n(e,t);return fot(e,t,n)}Q0.prototype.hasProperty=function(e,t){let n=RD(this,e,function(i,r){let o=i._classIds[r],a=i._classes[o].instances;if(l(a[t]))return!0});return l(n)};Q0.prototype.propertyExists=function(e){let t=this._classes,n=t.length;for(let i=0;i<n;++i){let r=t[i].instances;if(l(r[e]))return!0}return!1};Q0.prototype.getPropertyIds=function(e,t){return t=l(t)?t:[],t.length=0,RD(this,e,function(n,i){let r=n._classIds[i],o=n._classes[r].instances;for(let a in o)o.hasOwnProperty(a)&&t.indexOf(a)===-1&&t.push(a)}),t};Q0.prototype.getProperty=function(e,t){return RD(this,e,function(n,i){let r=n._classIds[i],o=n._classes[r],a=n._classIndexes[i],s=o.instances[t];if(l(s))return l(s.typedArray)?dot(s,a):Xe(s[a],!0)})};function dot(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}Q0.prototype.setProperty=function(e,t,n){let i=RD(this,e,function(r,o){let a=r._classIds[o],s=r._classes[a],c=r._classIndexes[o],u=s.instances[t];if(l(u))return l(u.typedArray)?hot(u,c,n):u[c]=Xe(n,!0),!0});return l(i)};function hot(e,t,n){let i=e.typedArray,r=e.componentCount;r===1?i[t]=n:e.type.pack(n,i,t*r)}Q0.prototype.isClass=function(e,t){let n=RD(this,e,function(i,r){let o=i._classIds[r];if(i._classes[o].name===t)return!0});return l(n)};Q0.prototype.getClassName=function(e){let t=this._classIds[e];return this._classes[t].name};var CE=Q0;function OD(e){let t=e.count,n=e.batchTable,i=e.binaryBody,r=e.parseAsPropertyAttributes??!1,o=e.customAttributeOutput,a=mot(n),s;l(a.jsonProperties)&&(s=new Ay({count:t,properties:a.jsonProperties}));let c;l(a.hierarchy)&&(c=new CE({extension:a.hierarchy,binaryBody:i}));let u=Nm.BATCH_TABLE_CLASS_NAME,f=a.binaryProperties,d,p,g;if(r){let A=got(t,u,f,i,o);g=A.transcodedSchema,p=[new pE({propertyAttribute:A.propertyAttributeJson,class:A.transcodedClass})]}else{let A=pot(t,u,f,i);g=A.transcodedSchema;let b=A.featureTableJson;d=new oh({count:b.count,properties:b.properties,class:A.transcodedClass,bufferViews:A.bufferViewsTypedArrays}),p=[]}let m=[];if(l(d)||l(s)||l(c)){let A=new xu({id:0,name:"Batch Table",count:t,metadataTable:d,jsonMetadataTable:s,batchTableHierarchy:c});m.push(A)}let y={schema:g,propertyTables:m,propertyAttributes:p,extensions:a.extensions,extras:a.extras};return new ec(y)}function mot(e){let t=e.HIERARCHY,n=e.extras,i=e.extensions,r;l(t)?(OD._deprecationWarning("batchTableHierarchyExtension","The batch table HIERARCHY property has been moved to an extension. Use extensions.3DTILES_batch_table_hierarchy instead."),r=t):l(i)&&(r=i["3DTILES_batch_table_hierarchy"]);let o,a={};for(let s in e){if(!e.hasOwnProperty(s)||s==="HIERARCHY"||s==="extensions"||s==="extras")continue;let c=e[s];Array.isArray(c)?(o=l(o)?o:{},o[s]=c):a[s]=c}return{binaryProperties:a,jsonProperties:o,hierarchy:r,extras:n,extensions:i}}function pot(e,t,n,i){let r={},o={},a={},s=0;for(let d in n){if(!n.hasOwnProperty(d))continue;if(!l(i))throw new oe(`Property ${d} requires a batch table binary.`);let p=n[d],g=Nh(p);o[d]={bufferView:s},r[d]=TAe(p),a[s]=g.createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e),s++}let c={classes:{}};c.classes[t]={properties:r};let u=Zl.fromJson(c);return{featureTableJson:{class:t,count:e,properties:o},bufferViewsTypedArrays:a,transcodedSchema:u,transcodedClass:u.classes[t]}}function got(e,t,n,i,r){let o={},a={},s=0;for(let d in n){if(!n.hasOwnProperty(d))continue;let p=n[d];if(!l(i)&&!l(p.typedArray))throw new oe(`Property ${d} requires a batch table binary.`);let g=_t.sanitizeGlslIdentifier(d);(g===""||o.hasOwnProperty(g))&&(g=`property_${s}`,s++);let m=TAe(p);m.name=d,o[g]=m;let y=g.toUpperCase();y.startsWith("_")||(y=`_${y}`);let A=p.typedArray;l(A)||(A=Nh(p).createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e));let b=new Tn.Attribute;b.name=y,b.count=e,b.type=p.type;let x=Y.fromTypedArray(A);(x===Y.INT||x===Y.UNSIGNED_INT||x===Y.DOUBLE)&&(OD._oneTimeWarning("Cast pnts property to floats",`Point cloud property "${y}" will be cast to a float array because INT, UNSIGNED_INT, and DOUBLE are not valid WebGL vertex attribute types. Some precision may be lost.`),A=new Float32Array(A)),b.componentDatatype=Y.fromTypedArray(A),b.typedArray=A,r.push(b),a[g]={attribute:y}}let c={classes:{}};c.classes[t]={properties:o};let u=Zl.fromJson(c);return{class:t,propertyAttributeJson:{properties:a},transcodedSchema:u,transcodedClass:u.classes[t]}}function TAe(e){let t=_ot(e.componentType);return{type:e.type,componentType:t}}function _ot(e){switch(e){case"BYTE":return"INT8";case"UNSIGNED_BYTE":return"UINT8";case"SHORT":return"INT16";case"UNSIGNED_SHORT":return"UINT16";case"INT":return"INT32";case"UNSIGNED_INT":return"UINT32";case"FLOAT":return"FLOAT32";case"DOUBLE":return"FLOAT64"}}OD._deprecationWarning=qs;OD._oneTimeWarning=pt;var Cy=OD;var tx={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,FAILED:4},yot=Tn.FeatureIdAttribute,wJ=class extends er{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.b3dmResource,i=t.baseResource,r=t.arrayBuffer,o=t.byteOffset??0,a=t.releaseGltfJson??!1,s=t.asynchronous??!0,c=t.incrementallyLoadTextures??!0,u=t.upAxis??zi.Y,f=t.forwardAxis??zi.X,d=t.loadAttributesAsTypedArray??!1,p=t.loadAttributesFor2D??!1,g=t.enablePick??!1,m=t.loadIndicesForWireframe??!1,y=t.loadPrimitiveOutline??!0,A=t.loadForClassification??!1;i=l(i)?i:n.clone(),this._b3dmResource=n,this._baseResource=i,this._arrayBuffer=r,this._byteOffset=o,this._releaseGltfJson=a,this._asynchronous=s,this._incrementallyLoadTextures=c,this._upAxis=u,this._forwardAxis=f,this._loadAttributesAsTypedArray=d,this._loadAttributesFor2D=p,this._enablePick=g,this._loadIndicesForWireframe=m,this._loadPrimitiveOutline=y,this._loadForClassification=A,this._state=tx.UNLOADED,this._promise=void 0,this._gltfLoader=void 0,this._batchLength=0,this._propertyTable=void 0,this._batchTable=void 0,this._components=void 0,this._transform=O.IDENTITY}get texturesLoaded(){return this._gltfLoader?.texturesLoaded}get cacheKey(){}get components(){return this._components}load(){if(l(this._promise))return this._promise;let t=Lz.parse(this._arrayBuffer,this._byteOffset),n=t.featureTableJson,i=t.featureTableBinary,r=t.batchTableJson,o=t.batchTableBinary,a=new mp(n,i),s=a.getGlobalProperty("BATCH_LENGTH");this._batchLength=s;let c=a.getGlobalProperty("RTC_CENTER",Y.FLOAT,3);l(c)&&(this._transform=O.fromTranslation(h.fromArray(c))),this._batchTable={json:r,binary:o};let u=new Ad({typedArray:t.gltf,upAxis:this._upAxis,forwardAxis:this._forwardAxis,gltfResource:this._b3dmResource,baseResource:this._baseResource,releaseGltfJson:this._releaseGltfJson,incrementallyLoadTextures:this._incrementallyLoadTextures,loadAttributesAsTypedArray:this._loadAttributesAsTypedArray,loadAttributesFor2D:this._loadAttributesFor2D,enablePick:this._enablePick,loadIndicesForWireframe:this._loadIndicesForWireframe,loadPrimitiveOutline:this._loadPrimitiveOutline,loadForClassification:this._loadForClassification,renameBatchIdSemantic:!0});this._gltfLoader=u,this._state=tx.LOADING;let f=this;return this._promise=u.load().then(function(){if(!f.isDestroyed())return f._state=tx.PROCESSING,f}).catch(function(d){if(!f.isDestroyed())return Aot(f,d)}),this._promise}process(t){if(this._state===tx.READY)return!0;if(this._state!==tx.PROCESSING||!this._gltfLoader.process(t))return!1;let i=this._gltfLoader.components;return i.transform=O.multiplyTransformation(this._transform,i.transform,i.transform),bot(this,i),this._components=i,this._arrayBuffer=void 0,this._state=tx.READY,!0}unload(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),this._components=void 0,this._arrayBuffer=void 0}};function Aot(e,t){return e.unload(),e._state=tx.FAILED,t=e.getError("Failed to load b3dm",t),Promise.reject(t)}function bot(e,t){let n=e._batchTable,i=e._batchLength;if(i===0)return;let r;if(l(n.json))r=Cy({count:i,batchTable:n.json,binaryBody:n.binary});else{let s=new xu({name:Nm.BATCH_TABLE_CLASS_NAME,count:i});r=new ec({schema:{},propertyTables:[s]})}let o=t.scene.nodes,a=o.length;for(let s=0;s<a;s++)CAe(o[s]);t.structuralMetadata=r}function CAe(e){let t=e.children.length;for(let i=0;i<t;i++)CAe(e.children[i]);let n=e.primitives.length;for(let i=0;i<n;i++){let r=e.primitives[i],o=_t.getAttributeBySemantic(r,ot.FEATURE_ID);if(l(o)){o.setIndex=0;let a=new yot;a.propertyTableId=0,a.setIndex=0,a.positionalLabel="featureId_0",r.featureIds.push(a)}}}var Nz=wJ;var IJ=class extends er{constructor(t){super(),t=t??H.EMPTY_OBJECT,this._geoJson=t.geoJson,this._components=void 0}get cacheKey(){}get components(){return this._components}load(){return Promise.resolve(this)}process(t){return l(this._components)||(this._components=Mot(this._geoJson,t),this._geoJson=void 0),!0}unload(){this._components=void 0}};function xot(){this.lines=void 0,this.points=void 0,this.properties=void 0}function Tot(){this.features=[]}function PJ(e){let t=e[0],n=e[1],i=e[2]??0;return new h(t,n,i)}function DJ(e){let t=e.length,n=new Array(t);for(let r=0;r<t;r++)n[r]=PJ(e[r]);return[n]}function Cot(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=DJ(e[i])[0];return n}function vAe(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=DJ(e[i])[0];return n}function vot(e){let t=e.length,n=[];for(let i=0;i<t;i++){let r=vAe(e[i]);Xn(n,r)}return n}function Eot(e){return[PJ(e)]}function Sot(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=PJ(e[i]);return n}var wot={LineString:DJ,MultiLineString:Cot,MultiPolygon:vot,Polygon:vAe,MultiPoint:Sot,Point:Eot},Iot={LineString:Re.LINES,MultiLineString:Re.LINES,MultiPolygon:Re.LINES,Polygon:Re.LINES,MultiPoint:Re.POINTS,Point:Re.POINTS};function EAe(e,t){if(!l(e.geometry))return;let n=e.geometry.type,i=wot[n],r=Iot[n],o=e.geometry.coordinates;if(!l(i)||!l(o))return;let a=new xot;r===Re.LINES?a.lines=i(o):r===Re.POINTS&&(a.points=i(o)),a.properties=e.properties,t.features.push(a)}function Pot(e,t){let n=e.features,i=n.length;for(let r=0;r<i;r++)EAe(n[r],t)}var Dot={FeatureCollection:Pot,Feature:EAe},Fz=new h;function Rot(e,t,n){let i=0,r=0,o=e.length;for(let M=0;M<o;M++){let N=e[M];if(l(N.lines)){let _=N.lines.length;for(let v=0;v<_;v++){let S=N.lines[v];i+=S.length,r+=(S.length-1)*2}}}let a=new Float32Array(i*3),s=new Float32Array(i),c=Ve.createTypedArray(i,r),u=Ve.fromTypedArray(c),f=new h(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),d=new h(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),p=0,g=0;for(let M=0;M<o;M++){let N=e[M];if(!l(N.lines))continue;let _=N.lines.length;for(let v=0;v<_;v++){let S=N.lines[v],P=S.length;for(let L=0;L<P;L++){let F=S[L],V=h.fromDegrees(F.x,F.y,F.z,te.WGS84,Fz),z=O.multiplyByPoint(t,V,Fz);h.minimumByComponent(f,z,f),h.maximumByComponent(d,z,d),h.pack(z,a,p*3),s[p]=M,L<P-1&&(c[g*2]=p,c[g*2+1]=p+1,g++),p++}}}let m=Ze.createVertexBuffer({typedArray:a,context:n.context,usage:Oe.STATIC_DRAW});m.vertexArrayDestroyable=!1;let y=Ze.createVertexBuffer({typedArray:s,context:n.context,usage:Oe.STATIC_DRAW});y.vertexArrayDestroyable=!1;let A=Ze.createIndexBuffer({typedArray:c,context:n.context,usage:Oe.STATIC_DRAW,indexDatatype:u});A.vertexArrayDestroyable=!1;let b=new Tn.Attribute;b.semantic=ot.POSITION,b.componentDatatype=Y.FLOAT,b.type=Vt.VEC3,b.count=i,b.min=f,b.max=d,b.buffer=m;let x=new Tn.Attribute;x.semantic=ot.FEATURE_ID,x.setIndex=0,x.componentDatatype=Y.FLOAT,x.type=Vt.SCALAR,x.count=i,x.buffer=y;let T=[b,x],C=new Tn.Material;C.unlit=!0;let E=new Tn.Indices;E.indexDatatype=u,E.count=c.length,E.buffer=A;let w=new Tn.FeatureIdAttribute;w.featureCount=o,w.propertyTableId=0,w.setIndex=0,w.positionalLabel="featureId_0";let D=[w],R=new Tn.Primitive;return R.attributes=T,R.indices=E,R.featureIds=D,R.primitiveType=Re.LINES,R.material=C,R}function Oot(e,t,n){let i=0,r=e.length;for(let T=0;T<r;T++){let C=e[T];l(C.points)&&(i+=C.points.length)}let o=new Float32Array(i*3),a=new Float32Array(i),s=new h(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),c=new h(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),u=0;for(let T=0;T<r;T++){let C=e[T];if(!l(C.points))continue;let E=C.points.length;for(let w=0;w<E;w++){let D=C.points[w],R=h.fromDegrees(D.x,D.y,D.z,te.WGS84,Fz),M=O.multiplyByPoint(t,R,Fz);h.minimumByComponent(s,M,s),h.maximumByComponent(c,M,c),h.pack(M,o,u*3),a[u]=T,u++}}let f=Ze.createVertexBuffer({typedArray:o,context:n.context,usage:Oe.STATIC_DRAW});f.vertexArrayDestroyable=!1;let d=Ze.createVertexBuffer({typedArray:a,context:n.context,usage:Oe.STATIC_DRAW});d.vertexArrayDestroyable=!1;let p=new Tn.Attribute;p.semantic=ot.POSITION,p.componentDatatype=Y.FLOAT,p.type=Vt.VEC3,p.count=i,p.min=s,p.max=c,p.buffer=f;let g=new Tn.Attribute;g.semantic=ot.FEATURE_ID,g.setIndex=0,g.componentDatatype=Y.FLOAT,g.type=Vt.SCALAR,g.count=i,g.buffer=d;let m=[p,g],y=new Tn.Material;y.unlit=!0;let A=new Tn.FeatureIdAttribute;A.featureCount=r,A.propertyTableId=0,A.setIndex=0,A.positionalLabel="featureId_0";let b=[A],x=new Tn.Primitive;return x.attributes=m,x.featureIds=b,x.primitiveType=Re.POINTS,x.material=y,x}function Mot(e,t){let n=new Tot,i=Dot[e.type];l(i)&&i(e,n);let r=n.features,o=r.length;if(o===0)throw new oe("GeoJSON must have at least one feature");let a={};for(let M=0;M<o;M++){let _=r[M].properties??H.EMPTY_OBJECT;for(let v in _)_.hasOwnProperty(v)&&(l(a[v])||(a[v]=new Array(o)))}for(let M=0;M<o;M++){let N=r[M];for(let _ in a)if(a.hasOwnProperty(_)){let v=N.properties[_]??"";a[_][M]=v}}let s=new Ay({count:o,properties:a}),u=[new xu({id:0,count:o,jsonMetadataTable:s})],f=Zl.fromJson({}),d=new ec({schema:f,propertyTables:u}),p=new h(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),g=new h(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),m=!1,y=!1;for(let M=0;M<o;M++){let N=r[M];if(l(N.lines)){m=!0;let _=N.lines.length;for(let v=0;v<_;v++){let S=N.lines[v],P=S.length;for(let L=0;L<P;L++)h.minimumByComponent(p,S[L],p),h.maximumByComponent(g,S[L],g)}}if(l(N.points)){y=!0;let _=N.points.length;for(let v=0;v<_;v++){let S=N.points[v];h.minimumByComponent(p,S,p),h.maximumByComponent(g,S,g)}}}let A=h.midpoint(p,g,new h),b=h.fromDegrees(A.x,A.y,A.z,te.WGS84,new h),x=mt.eastNorthUpToFixedFrame(b,te.WGS84,new O),T=O.inverseTransformation(x,new O),C=[];m&&C.push(Rot(r,T,t)),y&&C.push(Oot(r,T,t));let E=new Tn.Node;E.index=0,E.primitives=C;let w=[E],D=new Tn.Scene;D.nodes=w;let R=new Tn.Components;return R.scene=D,R.nodes=w,R.transform=x,R.structuralMetadata=d,R}var Bz=IJ;var kz={};kz._deprecationWarning=qs;var vy=Uint32Array.BYTES_PER_ELEMENT;kz.parse=function(e,t){let n=t??0;t=n;let i=new Uint8Array(e),r=new DataView(e);t+=vy;let o=r.getUint32(t,!0);if(o!==1)throw new oe(`Only Instanced 3D Model version 1 is supported. Version ${o} is not.`);t+=vy;let a=r.getUint32(t,!0);t+=vy;let s=r.getUint32(t,!0);if(s===0)throw new oe("featureTableJsonByteLength is zero, the feature table must be defined.");t+=vy;let c=r.getUint32(t,!0);t+=vy;let u=r.getUint32(t,!0);t+=vy;let f=r.getUint32(t,!0);t+=vy;let d=r.getUint32(t,!0);if(d!==1&&d!==0)throw new oe(`Only glTF format 0 (uri) or 1 (embedded) are supported. Format ${d} is not.`);t+=vy;let p=wo(i,t,s);t+=s;let g=new Uint8Array(e,t,c);t+=c;let m,y;u>0&&(m=wo(i,t,u),t+=u,f>0&&(y=new Uint8Array(e,t,f),y=new Uint8Array(y),t+=f));let A=n+a-t;if(A===0)throw new oe("glTF byte length must be greater than 0.");let b;return t%4===0?b=new Uint8Array(e,t,A):(kz._deprecationWarning("i3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),b=new Uint8Array(i.subarray(t,t+A))),{gltfFormat:d,featureTableJson:p,featureTableBinary:g,batchTableJson:m,batchTableBinary:y,gltf:b}};var zz=kz;var eg={NOT_LOADED:0,LOADING:1,PROCESSING:2,POST_PROCESSING:3,READY:4,FAILED:5,UNLOADED:6},Uz=Tn.Attribute,Lot=Tn.FeatureIdAttribute,wAe=Tn.Instances,RJ=class extends er{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.i3dmResource,i=t.arrayBuffer,r=t.baseResource,o=t.byteOffset??0,a=t.releaseGltfJson??!1,s=t.asynchronous??!0,c=t.incrementallyLoadTextures??!0,u=t.upAxis??zi.Y,f=t.forwardAxis??zi.X,d=t.loadAttributesAsTypedArray??!1,p=t.loadIndicesForWireframe??!1,g=t.loadPrimitiveOutline??!0,m=t.enablePick??!1;r=l(r)?r:n.clone(),this._i3dmResource=n,this._baseResource=r,this._arrayBuffer=i,this._byteOffset=o,this._releaseGltfJson=a,this._asynchronous=s,this._incrementallyLoadTextures=c,this._upAxis=u,this._forwardAxis=f,this._loadAttributesAsTypedArray=d,this._loadIndicesForWireframe=p,this._loadPrimitiveOutline=g,this._enablePick=m,this._state=eg.NOT_LOADED,this._promise=void 0,this._gltfLoader=void 0,this._buffers=[],this._components=void 0,this._transform=O.IDENTITY,this._batchTable=void 0,this._featureTable=void 0,this._instancesLength=0}get texturesLoaded(){return this._gltfLoader?.texturesLoaded}get cacheKey(){}get components(){return this._components}load(){if(l(this._promise))return this._promise;let t=zz.parse(this._arrayBuffer,this._byteOffset),n=t.featureTableJson,i=t.featureTableBinary,r=t.batchTableJson,o=t.batchTableBinary,a=t.gltfFormat,s=new mp(n,i);this._featureTable=s;let c=s.getGlobalProperty("INSTANCES_LENGTH");if(s.featuresLength=c,!l(c))throw new oe("Feature table global property: INSTANCES_LENGTH must be defined");this._instancesLength=c;let u=s.getGlobalProperty("RTC_CENTER",Y.FLOAT,3);l(u)&&(this._transform=O.fromTranslation(h.fromArray(u))),this._batchTable={json:r,binary:o};let f={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(a===0){let p=Wu(t.gltf);p=p.replace(/[\s\0]+$/,"");let g=this._baseResource.getDerivedResource({url:p});f.gltfResource=g,f.baseResource=g}else f.gltfResource=this._i3dmResource,f.typedArray=t.gltf;let d=new Ad(f);return this._gltfLoader=d,this._state=eg.LOADING,this._promise=d.load().then(()=>{if(!this.isDestroyed())return this._state=eg.PROCESSING,this}).catch(p=>{if(!this.isDestroyed())throw Not(this,p)}),this._promise}process(t){if(this._state===eg.READY)return!0;let n=this._gltfLoader,i=!1;if(this._state===eg.PROCESSING&&(i=n.process(t)),!i)return!1;let r=n.components;return r.transform=O.multiplyTransformation(this._transform,r.transform,r.transform),kot(this,r,t),Fot(this,r),this._components=r,this._arrayBuffer=void 0,this._state=eg.READY,!0}isUnloaded(){return this._state===eg.UNLOADED}unload(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),Hot(this),this._components=void 0,this._arrayBuffer=void 0,this._state=eg.UNLOADED}};function Not(e,t){return e.unload(),e._state=eg.FAILED,e.getError("Failed to load i3dm",t)}function Fot(e,t){let n=e._batchTable,i=e._instancesLength;if(i===0)return;let r;if(l(n.json))r=Cy({count:i,batchTable:n.json,binaryBody:n.binary});else{let o=new xu({name:Nm.BATCH_TABLE_CLASS_NAME,count:i});r=new ec({schema:{},propertyTables:[o]})}t.structuralMetadata=r}var Vz=new h,OJ=new Array(4),Bot=new O;function kot(e,t,n){let i,r=e._featureTable,o=e._instancesLength;if(o===0)return;let a=r.getGlobalProperty("RTC_CENTER",Y.FLOAT,3),s=r.getGlobalProperty("EAST_NORTH_UP"),c=r.hasProperty("NORMAL_UP")||r.hasProperty("NORMAL_UP_OCT32P")||s,u=r.hasProperty("SCALE")||r.hasProperty("SCALE_NON_UNIFORM"),f=Uot(r,o),d;c&&(d=new Float32Array(4*o));let p;u&&(p=new Float32Array(3*o));let g=new Float32Array(o),m=h.unpackArray(f),y,A=new h,b=new h,x=new h,T=new $,C=new Fe,E=new Array(4),w=new h,D=new Array(3),R=new O;if(!l(a)||h.equals(h.unpack(a),h.ZERO)){let z=se.fromPoints(m);for(i=0;i<m.length;i++)h.subtract(m[i],z.center,Vz),f[3*i+0]=Vz.x,f[3*i+1]=Vz.y,f[3*i+2]=Vz.z;let j=O.fromTranslation(z.center,Bot);t.transform=O.multiplyTransformation(j,t.transform,t.transform)}for(i=0;i<o;i++){y=h.clone(m[i]),l(a)&&h.add(y,h.unpack(a),y),c&&(Vot(r,s,i,C,y,b,A,x,T,R),Fe.pack(C,E,0),d[4*i+0]=E[0],d[4*i+1]=E[1],d[4*i+2]=E[2],d[4*i+3]=E[3]),u&&(jot(r,i,w),h.pack(w,D,0),p[3*i+0]=D[0],p[3*i+1]=D[1],p[3*i+2]=D[2]);let z=r.getProperty("BATCH_ID",Y.UNSIGNED_SHORT,1,i);l(z)||(z=i),g[i]=z}let M=new wAe;M.transformInWorldSpace=!0;let N=e._buffers,_=new Uz;if(_.name="Instance Translation",_.semantic=Do.TRANSLATION,_.componentDatatype=Y.FLOAT,_.type=Vt.VEC3,_.count=o,_.typedArray=f,!c){let z=Ze.createVertexBuffer({context:n.context,typedArray:f,usage:Oe.STATIC_DRAW});z.vertexArrayDestroyable=!1,N.push(z),_.buffer=z}if(M.attributes.push(_),c){let z=new Uz;z.name="Instance Rotation",z.semantic=Do.ROTATION,z.componentDatatype=Y.FLOAT,z.type=Vt.VEC4,z.count=o,z.typedArray=d,M.attributes.push(z)}if(u){let z=new Uz;if(z.name="Instance Scale",z.semantic=Do.SCALE,z.componentDatatype=Y.FLOAT,z.type=Vt.VEC3,z.count=o,c)z.typedArray=p;else{let j=Ze.createVertexBuffer({context:n.context,typedArray:p,usage:Oe.STATIC_DRAW});j.vertexArrayDestroyable=!1,N.push(j),z.buffer=j}M.attributes.push(z)}let v=new Uz;v.name="Instance Feature ID",v.setIndex=0,v.semantic=Do.FEATURE_ID,v.componentDatatype=Y.FLOAT,v.type=Vt.SCALAR,v.count=o;let S=Ze.createVertexBuffer({context:n.context,typedArray:g,usage:Oe.STATIC_DRAW});S.vertexArrayDestroyable=!1,N.push(S),v.buffer=S,M.attributes.push(v);let P=new Lot;P.propertyTableId=0,P.setIndex=0,P.positionalLabel="instanceFeatureId_0",M.featureIds.push(P);let L=t.nodes,F=L.length,V=!1;for(i=0;i<F;i++){let z=L[i];z.primitives.length>0&&(z.instances=V?zot(M):M,V=!0)}}function zot(e){let t=new wAe;t.transformInWorldSpace=e.transformInWorldSpace;let n=e.attributes,i=n.length;for(let r=0;r<i;r++){let o=Xe(n[r],!1);t.attributes.push(o)}return t.featureIds=e.featureIds,t}function Uot(e,t){if(e.hasProperty("POSITION"))return e.getPropertyArray("POSITION",Y.FLOAT,3);if(e.hasProperty("POSITION_QUANTIZED")){let n=e.getPropertyArray("POSITION_QUANTIZED",Y.UNSIGNED_SHORT,3),i=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",Y.FLOAT,3);if(!l(i))throw new oe("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");let r=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Y.FLOAT,3);if(!l(r))throw new oe("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let o=new Float32Array(n.length);for(let a=0;a<n.length/3;a++)for(let s=0;s<3;s++){let c=3*a+s;o[c]=n[c]/65535*r[s]+i[s]}return o}else throw new oe("Either POSITION or POSITION_QUANTIZED must be defined for each instance.")}var SAe=new Array(4);function Vot(e,t,n,i,r,o,a,s,c,u){let f=e.getProperty("NORMAL_UP",Y.FLOAT,3,n,OJ),d=e.getProperty("NORMAL_RIGHT",Y.FLOAT,3,n,SAe),p=!1;if(l(f)){if(!l(d))throw new oe("To define a custom orientation, both NORMAL_UP and NORMAL_RIGHT must be defined.");h.unpack(f,0,o),h.unpack(d,0,a),p=!0}else{let g=e.getProperty("NORMAL_UP_OCT32P",Y.UNSIGNED_SHORT,2,n,OJ),m=e.getProperty("NORMAL_RIGHT_OCT32P",Y.UNSIGNED_SHORT,2,n,SAe);if(l(g)){if(!l(m))throw new oe("To define a custom orientation with oct-encoded vectors, both NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P must be defined.");an.octDecodeInRange(g[0],g[1],65535,o),an.octDecodeInRange(m[0],m[1],65535,a),p=!0}else t?(mt.eastNorthUpToFixedFrame(r,te.WGS84,u),O.getMatrix3(u,c)):$.clone($.IDENTITY,c)}p&&(h.cross(a,o,s),h.normalize(s,s),$.setColumn(c,0,a,c),$.setColumn(c,1,o,c),$.setColumn(c,2,s,c)),Fe.fromRotationMatrix(c,i)}function jot(e,t,n){n=h.fromElements(1,1,1,n);let i=e.getProperty("SCALE",Y.FLOAT,1,t);l(i)&&h.multiplyByScalar(n,i,n);let r=e.getProperty("SCALE_NON_UNIFORM",Y.FLOAT,3,t,OJ);l(r)&&(n.x*=r[0],n.y*=r[1],n.z*=r[2])}function Hot(e){let t=e._buffers,n=t.length;for(let i=0;i<n;i++){let r=t[i];r.isDestroyed()||r.destroy()}t.length=0}var jz=RJ;var IAe={NONE:0,REPEAT:1,MIRRORED_REPEAT:2};Object.freeze(IAe);var cf=IAe;var PAe={STOPPED:0,ANIMATING:1};Object.freeze(PAe);var gp=PAe;var vE=Tn.AnimatedPropertyType;function MJ(e){e=e??H.EMPTY_OBJECT;let t=e.channel,n=e.runtimeAnimation,i=e.runtimeNode;this._channel=t,this._runtimeAnimation=n,this._runtimeNode=i,this._splines=[],this._path=void 0,Xot(this)}Object.defineProperties(MJ.prototype,{channel:{get:function(){return this._channel}},runtimeAnimation:{get:function(){return this._runtimeAnimation}},runtimeNode:{get:function(){return this._runtimeNode}},splines:{get:function(){return this._splines}}});function Got(e,t){let n=[],i=[],r=[],o=t.length;for(let a=0;a<o;a+=3)i.push(t[a]),n.push(t[a+1]),r.push(t[a+2]);return i.splice(0,1),r.length=r.length-1,new YA({times:e,points:n,inTangents:i,outTangents:r})}function DAe(e,t,n,i){if(e.length===1&&t.length===1)return new rN(t[0]);switch(n){case Xm.STEP:return new yF({times:e,points:t});case Xm.CUBICSPLINE:return Got(e,t);case Xm.LINEAR:return i===vE.ROTATION?new iF({times:e,points:t}):new qA({times:e,points:t})}}function Wot(e,t,n,i,r){let o=[];if(i===vE.WEIGHTS){let s=t.length/r,c,u;for(c=0;c<r;c++){let f=new Array(s),d=c;if(n===Xm.CUBICSPLINE)for(u=0;u<s;u+=3)f[u]=t[d],f[u+1]=t[d+r],f[u+2]=t[d+2*r],d+=r*3;else for(u=0;u<s;u++)f[u]=t[d],d+=r;o.push(DAe(e,f,n,i))}}else o.push(DAe(e,t,n,i));return o}var qot=new h,Yot=new Fe;function Xot(e){let t=e._channel,n=t.sampler,i=n.input,r=n.output,o=n.interpolation,s=t.target.path,c=e._runtimeNode,u=l(c.morphWeights)?c.morphWeights.length:1,f=Wot(i,r,o,s,u);e._splines=f,e._path=s}MJ.prototype.animate=function(e){let t=this._splines,n=this._path,i=this._runtimeAnimation.model,r=this._runtimeNode;if(n===vE.WEIGHTS){let o=r.morphWeights,a=o.length;for(let s=0;s<a;s++){let c=t[s],u=i.clampAnimations?c.clampTime(e):c.wrapTime(e);o[s]=c.evaluate(u)}}else{if(r.userAnimated)return;{let o=t[0],a=i.clampAnimations?o.clampTime(e):o.wrapTime(e);n===vE.TRANSLATION||n===vE.SCALE?r[n]=o.evaluate(a,qot):n===vE.ROTATION&&(r[n]=o.evaluate(a,Yot))}}};var Hz=MJ;function LJ(e,t,n){this._animation=t,this._name=t.name,this._runtimeChannels=void 0,this._startTime=K.clone(n.startTime),this._delay=n.delay??0,this._stopTime=K.clone(n.stopTime),this.removeOnStop=n.removeOnStop??!1,this._multiplier=n.multiplier??1,this._reverse=n.reverse??!1,this._loop=n.loop??cf.NONE,this._animationTime=n.animationTime,this._prevAnimationDelta=void 0,this.start=new be,this.update=new be,this.stop=new be,this._state=gp.STOPPED,this._computedStartTime=void 0,this._duration=void 0;let i=this;this._raiseStartEvent=function(){i.start.raiseEvent(e,i)},this._updateEventTime=0,this._raiseUpdateEvent=function(){i.update.raiseEvent(e,i,i._updateEventTime)},this._raiseStopEvent=function(){i.stop.raiseEvent(e,i)},this._model=e,this._localStartTime=void 0,this._localStopTime=void 0,Kot(this)}Object.defineProperties(LJ.prototype,{animation:{get:function(){return this._animation}},name:{get:function(){return this._name}},runtimeChannels:{get:function(){return this._runtimeChannels}},model:{get:function(){return this._model}},localStartTime:{get:function(){return this._localStartTime}},localStopTime:{get:function(){return this._localStopTime}},startTime:{get:function(){return this._startTime}},delay:{get:function(){return this._delay}},stopTime:{get:function(){return this._stopTime}},multiplier:{get:function(){return this._multiplier}},reverse:{get:function(){return this._reverse}},loop:{get:function(){return this._loop}},animationTime:{get:function(){return this._animationTime}}});function Kot(e){let t=Number.MAX_VALUE,n=-Number.MAX_VALUE,i=e._model.sceneGraph,o=e._animation.channels,a=o.length,s=[];for(let c=0;c<a;c++){let u=o[c],f=u.target;if(!l(f))continue;let d=f.node.index,p=i._runtimeNodes[d],g=new Hz({channel:u,runtimeAnimation:e,runtimeNode:p}),m=u.sampler.input;t=Math.min(t,m[0]),n=Math.max(n,m[m.length-1]),s.push(g)}e._runtimeChannels=s,e._localStartTime=t,e._localStopTime=n}LJ.prototype.animate=function(e){let t=this._runtimeChannels,n=t.length;for(let i=0;i<n;i++)t[i].animate(e)};var Gz=LJ;function tg(e){this.animationAdded=new be,this.animationRemoved=new be,this.animateWhilePaused=!1,this._model=e,this._runtimeAnimations=[],this._previousTime=void 0}Object.defineProperties(tg.prototype,{length:{get:function(){return this._runtimeAnimations.length}},model:{get:function(){return this._model}}});function NJ(e,t,n){let i=e._model,r=new Gz(i,t,n);return e._runtimeAnimations.push(r),e.animationAdded.raiseEvent(i,r),r}tg.prototype.add=function(e){e=e??H.EMPTY_OBJECT;let n=this._model.sceneGraph.components.animations,i=e.index;if(l(i))return NJ(this,n[i],e);let r=n.length;for(let o=0;o<r;++o)if(n[o].name===e.name){i=o;break}return NJ(this,n[i],e)};tg.prototype.addAll=function(e){e=e??H.EMPTY_OBJECT;let n=this._model.sceneGraph.components.animations,i=[],r=n.length;for(let o=0;o<r;++o){let a=NJ(this,n[o],e);i.push(a)}return i};tg.prototype.remove=function(e){if(!l(e))return!1;let t=this._runtimeAnimations,n=t.indexOf(e);return n!==-1?(t.splice(n,1),this.animationRemoved.raiseEvent(this._model,e),!0):!1};tg.prototype.removeAll=function(){let e=this._model,t=this._runtimeAnimations,n=t.length;this._runtimeAnimations.length=0;for(let i=0;i<n;++i)this.animationRemoved.raiseEvent(e,t[i])};tg.prototype.contains=function(e){return l(e)?this._runtimeAnimations.indexOf(e)!==-1:!1};tg.prototype.get=function(e){return this._runtimeAnimations[e]};var Wz=[];function $ot(e,t,n){return function(){e.animationRemoved.raiseEvent(t,n)}}tg.prototype.update=function(e){let t=this._runtimeAnimations,n=t.length;if(n===0)return this._previousTime=void 0,!1;if(!this.animateWhilePaused&&K.equals(e.time,this._previousTime))return!1;this._previousTime=K.clone(e.time,this._previousTime);let i=!1,r=e.time,o=this._model;for(let a=0;a<n;++a){let s=t[a];l(s._computedStartTime)||(s._computedStartTime=K.addSeconds(s.startTime??r,s.delay,new K)),l(s._duration)||(s._duration=s.localStopTime*(1/s.multiplier));let c=s._computedStartTime,u=s._duration,f=s.stopTime,d=K.lessThanOrEquals(c,r),p=l(f)&&K.greaterThan(r,f),g=0;if(u!==0){let A=K.secondsDifference(p?f:r,c);g=l(s._animationTime)?s._animationTime(u,A):A/u}let m=s.loop===cf.REPEAT||s.loop===cf.MIRRORED_REPEAT,y=(d||m&&!l(s.startTime))&&(g<=1||m)&&!p;if(g===s._prevAnimationDelta){let A=s._state===gp.STOPPED;if(y!==A)continue}if(s._prevAnimationDelta=g,y||s._state===gp.ANIMATING){if(y&&s._state===gp.STOPPED&&(s._state=gp.ANIMATING,s.start.numberOfListeners>0&&e.afterRender.push(s._raiseStartEvent)),s.loop===cf.REPEAT)g=g-Math.floor(g);else if(s.loop===cf.MIRRORED_REPEAT){let b=Math.floor(g),x=g-b;g=b%2===1?1-x:x}s.reverse&&(g=1-g);let A=g*u*s.multiplier;A=I.clamp(A,s.localStartTime,s.localStopTime),s.animate(A),s.update.numberOfListeners>0&&(s._updateEventTime=A,e.afterRender.push(s._raiseUpdateEvent)),i=!0,y||(s._state=gp.STOPPED,s.stop.numberOfListeners>0&&e.afterRender.push(s._raiseStopEvent),s.removeOnStop&&Wz.push(s))}}n=Wz.length;for(let a=0;a<n;++a){let s=Wz[a];t.splice(t.indexOf(s),1),e.afterRender.push($ot(this,o,s))}return Wz.length=0,i};var qz=tg;var FJ=class e{constructor(t,n){this._content=t,this._batchId=n,this._color=void 0}get show(){return this._content.batchTable.getShow(this._batchId)}set show(t){this._content.batchTable.setShow(this._batchId,t)}get color(){return l(this._color)||(this._color=new U),this._content.batchTable.getColor(this._batchId,this._color)}set color(t){this._content.batchTable.setColor(this._batchId,t)}get polylinePositions(){if(l(this._content.getPolylinePositions))return this._content.getPolylinePositions(this._batchId)}get content(){return this._content}get tileset(){return this._content.tileset}get primitive(){return this._content.tileset}get featureId(){return this._batchId}get pickId(){return this._content.batchTable.getPickColor(this._batchId)}hasProperty(t){return this._content.batchTable.hasProperty(this._batchId,t)}getPropertyIds(t){return this._content.batchTable.getPropertyIds(this._batchId,t)}getProperty(t){return this._content.batchTable.getProperty(this._batchId,t)}static getPropertyInherited(t,n,i,r=t.batchTable){if(l(r)){if(r.hasPropertyBySemantic(n,i))return r.getPropertyBySemantic(n,i);if(r.hasProperty(n,i))return r.getProperty(n,i)}let o=t.metadata;if(l(o)){if(o.hasPropertyBySemantic(i))return o.getPropertyBySemantic(i);if(o.hasProperty(i))return o.getProperty(i)}let a=t.tile,s=a.metadata;if(l(s)){if(s.hasPropertyBySemantic(i))return s.getPropertyBySemantic(i);if(s.hasProperty(i))return s.getProperty(i)}let c;if(l(a.implicitSubtree)&&(c=a.implicitSubtree.metadata),l(c)){if(c.hasPropertyBySemantic(i))return c.getPropertyBySemantic(i);if(c.hasProperty(i))return c.getProperty(i)}let u=l(t.group)?t.group.metadata:void 0;if(l(u)){if(u.hasPropertyBySemantic(i))return u.getPropertyBySemantic(i);if(u.hasProperty(i))return u.getProperty(i)}let f=t.tileset.metadata;if(l(f)){if(f.hasPropertyBySemantic(i))return f.getPropertyBySemantic(i);if(f.hasProperty(i))return f.getProperty(i)}}getPropertyInherited(t){return e.getPropertyInherited(this._content,this._batchId,t)}setProperty(t,n){this._content.batchTable.setProperty(this._batchId,t,n),this._content.featurePropertiesDirty=!0}isExactClass(t){return this._content.batchTable.isExactClass(this._batchId,t)}isClass(t){return this._content.batchTable.isClass(this._batchId,t)}getExactClassName(){return this._content.batchTable.getExactClassName(this._batchId)}},us=FJ;function nx(e){this._model=e.model,this._featureTable=e.featureTable,this._featureId=e.featureId,this._color=void 0}Object.defineProperties(nx.prototype,{show:{get:function(){return this._featureTable.getShow(this._featureId)},set:function(e){this._featureTable.setShow(this._featureId,e)}},color:{get:function(){return l(this._color)||(this._color=new U),this._featureTable.getColor(this._featureId,this._color)},set:function(e){this._featureTable.setColor(this._featureId,e)}},primitive:{get:function(){return this._model}},featureTable:{get:function(){return this._featureTable}},featureId:{get:function(){return this._featureId}}});nx.prototype.hasProperty=function(e){return this._featureTable.hasProperty(this._featureId,e)};nx.prototype.getProperty=function(e){return this._featureTable.getProperty(this._featureId,e)};nx.prototype.getPropertyInherited=function(e){return this._featureTable.hasPropertyBySemantic(this._featureId,e)?this._featureTable.getPropertyBySemantic(this._featureId,e):this._featureTable.getProperty(this._featureId,e)};nx.prototype.getPropertyIds=function(e){return this._featureTable.getPropertyIds(e)};nx.prototype.setProperty=function(e,t){return this._featureTable.setProperty(this._featureId,e,t)};var Yz=nx;var EE={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};EE.getStyleCommandsNeeded=function(e,t){return t===0?EE.ALL_OPAQUE:t===e?EE.ALL_TRANSLUCENT:EE.OPAQUE_AND_TRANSLUCENT};Object.freeze(EE);var _p=EE;var ng={GLTF:"GLTF",TILE_GLTF:"TILE_GLTF",TILE_B3DM:"B3DM",TILE_I3DM:"I3DM",TILE_PNTS:"PNTS",TILE_GEOJSON:"TILE_GEOJSON"};ng.is3DTiles=function(e){switch(e){case ng.TILE_GLTF:case ng.TILE_B3DM:case ng.TILE_I3DM:case ng.TILE_PNTS:case ng.TILE_GEOJSON:return!0;case ng.GLTF:return!1}};Object.freeze(ng);var qo=ng;function ca(e){let t=e.model,n=e.propertyTable;this._propertyTable=n,this._model=t,this._features=void 0,this._featuresLength=0,this._batchTexture=void 0,this._styleCommandsNeededDirty=!1,this._styleCommandsNeeded=_p.ALL_OPAQUE,Jot(this)}Object.defineProperties(ca.prototype,{batchTexture:{get:function(){return this._batchTexture}},featuresLength:{get:function(){return this._featuresLength}},batchTextureByteLength:{get:function(){return l(this._batchTexture)?this._batchTexture.byteLength:0}},styleCommandsNeededDirty:{get:function(){return this._styleCommandsNeededDirty}}});function Jot(e){let t=e._model,n=qo.is3DTiles(t.type),i=e._propertyTable.count;if(i===0)return;let r,o=new Array(i);if(n){let a=t.content;for(r=0;r<i;r++)o[r]=new us(a,r)}else for(r=0;r<i;r++)o[r]=new Yz({model:t,featureId:r,featureTable:e});e._features=o,e._featuresLength=i,e._batchTexture=new Cu({featuresLength:i,owner:e,statistics:n?t.content.tileset.statistics:void 0})}ca.prototype.update=function(e){this._styleCommandsNeededDirty=!1,this._batchTexture.update(void 0,e);let t=_p.getStyleCommandsNeeded(this._featuresLength,this._batchTexture.translucentFeaturesLength);this._styleCommandsNeeded!==t&&(this._styleCommandsNeededDirty=!0,this._styleCommandsNeeded=t)};ca.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};ca.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};ca.prototype.getShow=function(e){return this._batchTexture.getShow(e)};ca.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};ca.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};ca.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};ca.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};ca.prototype.getFeature=function(e){return this._features[e]};ca.prototype.hasProperty=function(e,t){return this._propertyTable.hasProperty(e,t)};ca.prototype.hasPropertyBySemantic=function(e,t){return this._propertyTable.hasPropertyBySemantic(e,t)};ca.prototype.getProperty=function(e,t){return this._propertyTable.getProperty(e,t)};ca.prototype.getPropertyBySemantic=function(e,t){return this._propertyTable.getPropertyBySemantic(e,t)};ca.prototype.getPropertyIds=function(e){return this._propertyTable.getPropertyIds(e)};ca.prototype.setProperty=function(e,t,n){return this._propertyTable.setProperty(e,t,n)};ca.prototype.isClass=function(e,t){return this._propertyTable.isClass(e,t)};ca.prototype.isExactClass=function(e,t){return this._propertyTable.isExactClass(e,t)};ca.prototype.getExactClassName=function(e){return this._propertyTable.getExactClassName(e)};var Zot=new U;ca.prototype.applyStyle=function(e){if(!l(e)){this.setAllColor(Cu.DEFAULT_COLOR_VALUE),this.setAllShow(Cu.DEFAULT_SHOW_VALUE);return}for(let t=0;t<this._featuresLength;t++){let n=this.getFeature(t),i=l(e.color)?e.color.evaluateColor(n,Zot)??Cu.DEFAULT_COLOR_VALUE:Cu.DEFAULT_COLOR_VALUE,r=l(e.show)?e.show.evaluate(n)??Cu.DEFAULT_SHOW_VALUE:Cu.DEFAULT_SHOW_VALUE;this.setColor(t,i),this.setShow(t,r)}};ca.prototype.isDestroyed=function(){return!1};ca.prototype.destroy=function(e){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),ue(this)};var Xz=ca;var RAe={name:"TilesetPipelineStage"};RAe.process=function(e,t,n){if(t.hasSkipLevelOfDetail(n)){e.shaderBuilder.addDefine("POLYGON_OFFSET",void 0,he.FRAGMENT);let o={u_polygonOffset:function(){return k.ZERO}};e.uniformMap=Ot(o,e.uniformMap),e.hasSkipLevelOfDetail=!0}let i=e.renderStateOptions;i.stencilTest=qt.setCesium3DTileBit(),i.stencilMask=qt.CESIUM_3D_TILE_MASK};var Kz=RAe;var $z=`// robust iterative solution without trig functions
|
|
// https://github.com/0xfaded/ellipse_demo/issues/1
|
|
// https://stackoverflow.com/questions/22959698/distance-from-given-point-to-given-ellipse
|
|
//
|
|
// This version uses only a single iteration for best performance. For fog
|
|
// rendering, the difference is negligible.
|
|
vec2 nearestPointOnEllipseFast(vec2 pos, vec2 radii) {
|
|
vec2 p = abs(pos);
|
|
vec2 inverseRadii = 1.0 / radii;
|
|
vec2 evoluteScale = (radii.x * radii.x - radii.y * radii.y) * vec2(1.0, -1.0) * inverseRadii;
|
|
|
|
// We describe the ellipse parametrically: v = radii * vec2(cos(t), sin(t))
|
|
// but store the cos and sin of t in a vec2 for efficiency.
|
|
// Initial guess: t = cos(pi/4)
|
|
vec2 tTrigs = vec2(0.70710678118);
|
|
vec2 v = radii * tTrigs;
|
|
|
|
// Find the evolute of the ellipse (center of curvature) at v.
|
|
vec2 evolute = evoluteScale * tTrigs * tTrigs * tTrigs;
|
|
// Find the (approximate) intersection of p - evolute with the ellipsoid.
|
|
vec2 q = normalize(p - evolute) * length(v - evolute);
|
|
// Update the estimate of t.
|
|
tTrigs = (q + evolute) * inverseRadii;
|
|
tTrigs = normalize(clamp(tTrigs, 0.0, 1.0));
|
|
v = radii * tTrigs;
|
|
|
|
return v * sign(pos);
|
|
}
|
|
|
|
vec3 computeEllipsoidPositionWC(vec3 positionMC) {
|
|
// Get the world-space position and project onto a meridian plane of
|
|
// the ellipsoid
|
|
vec3 positionWC = (czm_model * vec4(positionMC, 1.0)).xyz;
|
|
|
|
vec2 positionEllipse = vec2(length(positionWC.xy), positionWC.z);
|
|
vec2 nearestPoint = nearestPointOnEllipseFast(positionEllipse, czm_ellipsoidRadii.xz);
|
|
|
|
// Reconstruct a 3D point in world space
|
|
return vec3(nearestPoint.x * normalize(positionWC.xy), nearestPoint.y);
|
|
}
|
|
|
|
void applyFog(inout vec4 color, vec4 groundAtmosphereColor, vec3 lightDirection, float distanceToCamera) {
|
|
|
|
vec3 fogColor = groundAtmosphereColor.rgb;
|
|
|
|
// If there is dynamic lighting, apply that to the fog.
|
|
const float NONE = 0.0;
|
|
if (czm_atmosphereDynamicLighting != NONE) {
|
|
float darken = clamp(dot(normalize(czm_viewerPositionWC), lightDirection), czm_fogMinimumBrightness, 1.0);
|
|
fogColor *= darken;
|
|
}
|
|
|
|
// Tonemap if HDR rendering is disabled
|
|
#ifndef HDR
|
|
fogColor.rgb = czm_pbrNeutralTonemapping(fogColor.rgb);
|
|
fogColor.rgb = czm_inverseGamma(fogColor.rgb);
|
|
#endif
|
|
|
|
vec3 withFog = czm_fog(distanceToCamera, color.rgb, fogColor, czm_fogVisualDensityScalar);
|
|
color = vec4(withFog, color.a);
|
|
}
|
|
|
|
void atmosphereStage(inout vec4 color, in ProcessedAttributes attributes) {
|
|
vec3 rayleighColor;
|
|
vec3 mieColor;
|
|
float opacity;
|
|
|
|
vec3 positionWC;
|
|
vec3 lightDirection;
|
|
|
|
// When the camera is in space, compute the position per-fragment for
|
|
// more accurate ground atmosphere. All other cases will use
|
|
//
|
|
// The if condition will be added in https://github.com/CesiumGS/cesium/issues/11717
|
|
if (false) {
|
|
positionWC = computeEllipsoidPositionWC(attributes.positionMC);
|
|
lightDirection = czm_getDynamicAtmosphereLightDirection(positionWC, czm_atmosphereDynamicLighting);
|
|
|
|
// The fog color is derived from the ground atmosphere color
|
|
czm_computeGroundAtmosphereScattering(
|
|
positionWC,
|
|
lightDirection,
|
|
rayleighColor,
|
|
mieColor,
|
|
opacity
|
|
);
|
|
} else {
|
|
positionWC = attributes.positionWC;
|
|
lightDirection = czm_getDynamicAtmosphereLightDirection(positionWC, czm_atmosphereDynamicLighting);
|
|
rayleighColor = v_atmosphereRayleighColor;
|
|
mieColor = v_atmosphereMieColor;
|
|
opacity = v_atmosphereOpacity;
|
|
}
|
|
|
|
//color correct rayleigh and mie colors
|
|
const bool ignoreBlackPixels = true;
|
|
rayleighColor = czm_applyHSBShift(rayleighColor, czm_atmosphereHsbShift, ignoreBlackPixels);
|
|
mieColor = czm_applyHSBShift(mieColor, czm_atmosphereHsbShift, ignoreBlackPixels);
|
|
|
|
vec4 groundAtmosphereColor = czm_computeAtmosphereColor(positionWC, lightDirection, rayleighColor, mieColor, opacity);
|
|
|
|
if (u_isInFog) {
|
|
float distanceToCamera = length(attributes.positionEC);
|
|
applyFog(color, groundAtmosphereColor, lightDirection, distanceToCamera);
|
|
} else {
|
|
// Ground atmosphere
|
|
}
|
|
}
|
|
`;var Jz=`void atmosphereStage(ProcessedAttributes attributes) {
|
|
vec3 lightDirection = czm_getDynamicAtmosphereLightDirection(v_positionWC, czm_atmosphereDynamicLighting);
|
|
|
|
czm_computeGroundAtmosphereScattering(
|
|
// This assumes the geometry stage came before this.
|
|
v_positionWC,
|
|
lightDirection,
|
|
v_atmosphereRayleighColor,
|
|
v_atmosphereMieColor,
|
|
v_atmosphereOpacity
|
|
);
|
|
}
|
|
`;var OAe={name:"AtmospherePipelineStage"};OAe.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_ATMOSPHERE",void 0,he.BOTH),i.addDefine("COMPUTE_POSITION_WC_ATMOSPHERE",void 0,he.BOTH),i.addVarying("vec3","v_atmosphereRayleighColor"),i.addVarying("vec3","v_atmosphereMieColor"),i.addVarying("float","v_atmosphereOpacity"),i.addVertexLines([Jz]),i.addFragmentLines([$z]),i.addUniform("bool","u_isInFog",he.FRAGMENT),e.uniformMap.u_isInFog=function(){let r=h.distance(n.camera.positionWC,t.boundingSphere.center);return I.fog(r,n.fog.density)>I.EPSILON3}};var Zz=OAe;var Qz=`#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)
|
|
{
|
|
// see https://bruop.github.io/ibl/ at Single Scattering Results
|
|
// Roughness dependent fresnel, from Fdez-Aguera
|
|
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)
|
|
/**
|
|
* Compute the light contributions from environment maps and spherical harmonic coefficients.
|
|
* See Fdez-Aguera, https://www.jcgt.org/published/0008/01/03/paper.pdf, for explanation
|
|
* of the single- and multi-scattering terms.
|
|
*
|
|
* @param {vec3} viewDirectionEC Unit vector pointing from the fragment to the eye position.
|
|
* @param {vec3} normalEC The surface normal in eye coordinates.
|
|
* @param {czm_modelMaterial} The material properties.
|
|
* @return {vec3} The computed HDR color.
|
|
*/
|
|
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);
|
|
|
|
// see https://bruop.github.io/ibl/ at Single Scattering Results
|
|
// Roughness dependent fresnel, from Fdez-Aguera
|
|
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
|
|
// Bend normal to account for anisotropic distortion of specular reflection
|
|
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 MAe={name:"ImageBasedLightingPipelineStage"},Qot=new k;MAe.process=function(e,t,n){let i=t.imageBasedLighting,r=t.environmentMapManager,o=e.shaderBuilder,a;l(i.specularEnvironmentMaps)||(a=r.radianceCubeMap);let s=i.sphericalHarmonicCoefficients??r.sphericalHarmonicCoefficients;o.addDefine("USE_IBL_LIGHTING",void 0,he.FRAGMENT),o.addUniform("vec2","model_iblFactor",he.FRAGMENT),hp.isSupported(n.context)&&((i.useSphericalHarmonics||i.useSpecularEnvironmentMaps||i.enabled)&&o.addUniform("mat3","model_iblReferenceFrameMatrix",he.FRAGMENT),l(a)&&o.addDefine("COMPUTE_POSITION_WC_ATMOSPHERE",void 0,he.BOTH),l(s)&&l(s[0])?(o.addDefine("DIFFUSE_IBL",void 0,he.FRAGMENT),o.addDefine("CUSTOM_SPHERICAL_HARMONICS",void 0,he.FRAGMENT),o.addUniform("vec3","model_sphericalHarmonicCoefficients[9]",he.FRAGMENT)):i.useDefaultSphericalHarmonics&&o.addDefine("DIFFUSE_IBL",void 0,he.FRAGMENT),l(i.specularEnvironmentCubeMap)&&i.specularEnvironmentCubeMap.ready||l(a)?(o.addDefine("SPECULAR_IBL",void 0,he.FRAGMENT),o.addDefine("CUSTOM_SPECULAR_IBL",void 0,he.FRAGMENT),o.addUniform("samplerCube","model_specularEnvironmentMaps",he.FRAGMENT),o.addUniform("float","model_specularEnvironmentMapsMaximumLOD",he.FRAGMENT)):t.useDefaultSpecularMaps&&o.addDefine("SPECULAR_IBL",void 0,he.FRAGMENT)),o.addFragmentLines(Qz);let c={model_iblFactor:function(){return k.multiplyByScalar(i.imageBasedLightingFactor,r?.intensity||1,Qot)},model_iblReferenceFrameMatrix:function(){return t._iblReferenceFrameMatrix},model_sphericalHarmonicCoefficients:function(){return s},model_specularEnvironmentMaps:function(){return i.specularEnvironmentCubeMap.texture},model_specularEnvironmentMapsMaximumLOD:function(){return i.specularEnvironmentCubeMap.maximumMipmapLevel}};l(a)&&(c.model_specularEnvironmentMaps=function(){return a},c.model_specularEnvironmentMapsMaximumLOD=function(){return r.maximumMipmapLevel}),e.uniformMap=Ot(c,e.uniformMap)};var eU=MAe;var eat=I.EPSILON16;function kJ(e){e=e??H.EMPTY_OBJECT;let t=e.stage,n=e.runtimeArticulation;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(kJ.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){e=I.clamp(e,this.minimumValue,this.maximumValue),I.equalsEpsilon(this._currentValue,e,eat)||(this._currentValue=e,this.runtimeArticulation._dirty=!0)}}});var tat=new h,BJ=new $;kJ.prototype.applyStageToMatrix=function(e){let t=this.type,n=this.currentValue,i=tat,r;switch(t){case hl.XROTATE:r=$.fromRotationX(I.toRadians(n),BJ),e=O.multiplyByMatrix3(e,r,e);break;case hl.YROTATE:r=$.fromRotationY(I.toRadians(n),BJ),e=O.multiplyByMatrix3(e,r,e);break;case hl.ZROTATE:r=$.fromRotationZ(I.toRadians(n),BJ),e=O.multiplyByMatrix3(e,r,e);break;case hl.XTRANSLATE:i.x=n,i.y=0,i.z=0,e=O.multiplyByTranslation(e,i,e);break;case hl.YTRANSLATE:i.x=0,i.y=n,i.z=0,e=O.multiplyByTranslation(e,i,e);break;case hl.ZTRANSLATE:i.x=0,i.y=0,i.z=n,e=O.multiplyByTranslation(e,i,e);break;case hl.XSCALE:i.x=n,i.y=1,i.z=1,e=O.multiplyByScale(e,i,e);break;case hl.YSCALE:i.x=1,i.y=n,i.z=1,e=O.multiplyByScale(e,i,e);break;case hl.ZSCALE:i.x=1,i.y=1,i.z=n,e=O.multiplyByScale(e,i,e);break;case hl.UNIFORMSCALE:e=O.multiplyByUniformScale(e,n,e);break;default:break}return e};var tU=kJ;function nU(e){e=e??H.EMPTY_OBJECT;let t=e.articulation,n=e.sceneGraph;this._articulation=t,this._sceneGraph=n,this._name=t.name,this._runtimeStages=[],this._runtimeStagesByName={},this._runtimeNodes=[],this._dirty=!0,nat(this)}Object.defineProperties(nU.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 nat(e){let n=e.articulation.stages,i=n.length,r=e._runtimeStages,o=e._runtimeStagesByName;for(let a=0;a<i;a++){let s=n[a],c=new tU({stage:s,runtimeArticulation:e});r.push(c);let u=s.name;o[u]=c}}nU.prototype.setArticulationStage=function(e,t){let n=this._runtimeStagesByName[e];l(n)&&(n.currentValue=t)};var iat=new O,rat=new O;nU.prototype.apply=function(){if(!this._dirty)return;this._dirty=!1;let e=O.clone(O.IDENTITY,iat),t,n=this._runtimeStages,i=n.length;for(t=0;t<i;t++)e=n[t].applyStageToMatrix(e);let r=this._runtimeNodes,o=r.length;for(t=0;t<o;t++){let a=r[t],s=O.multiplyTransformation(a.originalTransform,e,rat);a.transform=s}};var iU=nU;var rU=`void modelColorStage(inout czm_modelMaterial material)
|
|
{
|
|
material.diffuse = mix(material.diffuse, model_color.rgb, model_colorBlend);
|
|
float highlight = ceil(model_colorBlend);
|
|
material.diffuse *= mix(model_color.rgb, vec3(1.0), highlight);
|
|
material.alpha *= model_color.a;
|
|
}
|
|
`;var SE={name:"ModelColorPipelineStage",COLOR_UNIFORM_NAME:"model_color",COLOR_BLEND_UNIFORM_NAME:"model_colorBlend"};SE.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_COLOR",void 0,he.FRAGMENT),i.addFragmentLines(rU);let r={},o=t.color;o.alpha===0&&!t.hasSilhouette(n)&&(e.renderStateOptions.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),o.alpha<1&&(e.alphaOptions.pass=Pe.TRANSLUCENT),i.addUniform("vec4",SE.COLOR_UNIFORM_NAME,he.FRAGMENT),r[SE.COLOR_UNIFORM_NAME]=function(){return t.color},i.addUniform("float",SE.COLOR_BLEND_UNIFORM_NAME,he.FRAGMENT),r[SE.COLOR_BLEND_UNIFORM_NAME]=function(){return Ml.getColorBlend(t.colorBlendMode,t.colorBlendAmount)},e.uniformMap=Ot(r,e.uniformMap)};var ix=SE;var oU=`#ifdef USE_CLIPPING_PLANES_FLOAT_TEXTURE
|
|
vec4 getClippingPlane(
|
|
highp sampler2D packedClippingPlanes,
|
|
int clippingPlaneNumber,
|
|
mat4 transform
|
|
) {
|
|
int pixY = clippingPlaneNumber / CLIPPING_PLANES_TEXTURE_WIDTH;
|
|
int pixX = clippingPlaneNumber - (pixY * CLIPPING_PLANES_TEXTURE_WIDTH);
|
|
float pixelWidth = 1.0 / float(CLIPPING_PLANES_TEXTURE_WIDTH);
|
|
float pixelHeight = 1.0 / float(CLIPPING_PLANES_TEXTURE_HEIGHT);
|
|
float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel
|
|
float v = (float(pixY) + 0.5) * pixelHeight;
|
|
vec4 plane = texture(packedClippingPlanes, vec2(u, v));
|
|
return czm_transformPlane(plane, transform);
|
|
}
|
|
#else
|
|
// Handle uint8 clipping texture instead
|
|
vec4 getClippingPlane(
|
|
highp sampler2D packedClippingPlanes,
|
|
int clippingPlaneNumber,
|
|
mat4 transform
|
|
) {
|
|
int clippingPlaneStartIndex = clippingPlaneNumber * 2; // clipping planes are two pixels each
|
|
int pixY = clippingPlaneStartIndex / CLIPPING_PLANES_TEXTURE_WIDTH;
|
|
int pixX = clippingPlaneStartIndex - (pixY * CLIPPING_PLANES_TEXTURE_WIDTH);
|
|
float pixelWidth = 1.0 / float(CLIPPING_PLANES_TEXTURE_WIDTH);
|
|
float pixelHeight = 1.0 / float(CLIPPING_PLANES_TEXTURE_HEIGHT);
|
|
float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel
|
|
float v = (float(pixY) + 0.5) * pixelHeight;
|
|
vec4 oct32 = texture(packedClippingPlanes, vec2(u, v)) * 255.0;
|
|
vec2 oct = vec2(oct32.x * 256.0 + oct32.y, oct32.z * 256.0 + oct32.w);
|
|
vec4 plane;
|
|
plane.xyz = czm_octDecode(oct, 65535.0);
|
|
plane.w = czm_unpackFloat(texture(packedClippingPlanes, vec2(u + pixelWidth, v)));
|
|
return czm_transformPlane(plane, transform);
|
|
}
|
|
#endif
|
|
|
|
float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) {
|
|
vec4 position = czm_windowToEyeCoordinates(fragCoord);
|
|
vec3 clipNormal = vec3(0.0);
|
|
vec3 clipPosition = vec3(0.0);
|
|
float pixelWidth = czm_metersPerPixel(position);
|
|
|
|
#ifdef UNION_CLIPPING_REGIONS
|
|
float clipAmount; // For union planes, we want to get the min distance. So we set the initial value to the first plane distance in the loop below.
|
|
#else
|
|
float clipAmount = 0.0;
|
|
bool clipped = true;
|
|
#endif
|
|
|
|
for (int i = 0; i < CLIPPING_PLANES_LENGTH; ++i) {
|
|
vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix);
|
|
clipNormal = clippingPlane.xyz;
|
|
clipPosition = -clippingPlane.w * clipNormal;
|
|
float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth;
|
|
|
|
#ifdef UNION_CLIPPING_REGIONS
|
|
clipAmount = czm_branchFreeTernary(i == 0, amount, min(amount, clipAmount));
|
|
if (amount <= 0.0) {
|
|
discard;
|
|
}
|
|
#else
|
|
clipAmount = max(amount, clipAmount);
|
|
clipped = clipped && (amount <= 0.0);
|
|
#endif
|
|
}
|
|
|
|
#ifndef UNION_CLIPPING_REGIONS
|
|
if (clipped) {
|
|
discard;
|
|
}
|
|
#endif
|
|
|
|
return clipAmount;
|
|
}
|
|
|
|
void modelClippingPlanesStage(inout vec4 color)
|
|
{
|
|
float clipDistance = clip(gl_FragCoord, model_clippingPlanes, model_clippingPlanesMatrix);
|
|
vec4 clippingPlanesEdgeColor = vec4(1.0);
|
|
clippingPlanesEdgeColor.rgb = model_clippingPlanesEdgeStyle.rgb;
|
|
float clippingPlanesEdgeWidth = model_clippingPlanesEdgeStyle.a;
|
|
|
|
if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth) {
|
|
color = clippingPlanesEdgeColor;
|
|
}
|
|
}
|
|
`;var LAe={name:"ModelClippingPlanesPipelineStage"},oat=new k,aat=new O,sat=new O;LAe.process=function(e,t,n){let i=t.clippingPlanes,r=n.context,o=e.shaderBuilder;o.addDefine("HAS_CLIPPING_PLANES",void 0,he.FRAGMENT),o.addDefine("CLIPPING_PLANES_LENGTH",i.length,he.FRAGMENT),i.unionClippingRegions&&o.addDefine("UNION_CLIPPING_REGIONS",void 0,he.FRAGMENT),va.useFloatTexture(r)&&o.addDefine("USE_CLIPPING_PLANES_FLOAT_TEXTURE",void 0,he.FRAGMENT);let a=va.getTextureResolution(i,r,oat);o.addDefine("CLIPPING_PLANES_TEXTURE_WIDTH",a.x,he.FRAGMENT),o.addDefine("CLIPPING_PLANES_TEXTURE_HEIGHT",a.y,he.FRAGMENT),o.addUniform("sampler2D","model_clippingPlanes",he.FRAGMENT),o.addUniform("vec4","model_clippingPlanesEdgeStyle",he.FRAGMENT),o.addUniform("mat4","model_clippingPlanesMatrix",he.FRAGMENT),o.addFragmentLines(oU);let s={model_clippingPlanes:function(){return i.texture},model_clippingPlanesEdgeStyle:function(){let c=U.clone(i.edgeColor);return c.alpha=i.edgeWidth,c},model_clippingPlanesMatrix:function(){let c=O.transpose(r.uniformState.inverseView3D,aat);return O.multiply(c,t._clippingPlanesMatrix,sat)}};e.uniformMap=Ot(s,e.uniformMap)};var aU=LAe;var sU=`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 cU=`void modelClippingPolygonsStage()
|
|
{
|
|
vec2 clippingPosition = v_clippingPosition;
|
|
int regionIndex = v_regionIndex;
|
|
czm_clipPolygons(model_clippingDistance, CLIPPING_POLYGON_REGIONS_LENGTH, clippingPosition, regionIndex);
|
|
}
|
|
`;var NAe={name:"ModelClippingPolygonsPipelineStage"};NAe.process=function(e,t,n){let i=t.clippingPolygons,r=e.shaderBuilder;r.addDefine("ENABLE_CLIPPING_POLYGONS",void 0,he.BOTH),i.inverse&&r.addDefine("CLIPPING_INVERSE",void 0,he.FRAGMENT),r.addDefine("CLIPPING_POLYGON_REGIONS_LENGTH",i.extentsCount,he.BOTH),r.addUniform("sampler2D","model_clippingDistance",he.FRAGMENT),r.addUniform("sampler2D","model_clippingExtents",he.VERTEX),r.addVarying("vec2","v_clippingPosition"),r.addVarying("int","v_regionIndex","flat"),r.addVertexLines(sU),r.addFragmentLines(cU);let o={model_clippingDistance:function(){return i.clippingTexture??n.context.defaultTexture},model_clippingExtents:function(){return i.extentsTexture??n.context.defaultTexture}};e.uniformMap=Ot(o,e.uniformMap)};var lU=NAe;function FAe(e,t){this._model=e,this._runtimeNode=t}Object.defineProperties(FAe.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){l(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 uU=FAe;var fU=`mat4 getInstancingTransform()
|
|
{
|
|
mat4 instancingTransform;
|
|
|
|
#ifdef HAS_INSTANCE_MATRICES
|
|
instancingTransform = mat4(
|
|
a_instancingTransformRow0.x, a_instancingTransformRow1.x, a_instancingTransformRow2.x, 0.0, // Column 1
|
|
a_instancingTransformRow0.y, a_instancingTransformRow1.y, a_instancingTransformRow2.y, 0.0, // Column 2
|
|
a_instancingTransformRow0.z, a_instancingTransformRow1.z, a_instancingTransformRow2.z, 0.0, // Column 3
|
|
a_instancingTransformRow0.w, a_instancingTransformRow1.w, a_instancingTransformRow2.w, 1.0 // Column 4
|
|
);
|
|
#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, // Column 1
|
|
a_instancingTransform2DRow0.y, a_instancingTransform2DRow1.y, a_instancingTransform2DRow2.y, 0.0, // Column 2
|
|
a_instancingTransform2DRow0.z, a_instancingTransform2DRow1.z, a_instancingTransform2DRow2.z, 0.0, // Column 3
|
|
a_instancingTransform2DRow0.w, a_instancingTransform2DRow1.w, a_instancingTransform2DRow2.w, 1.0 // Column 4
|
|
);
|
|
#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 dU=`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 hU=`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 mU=new O,cat=new O,lat=new O,kAe={name:"InstancingPipelineStage",_getInstanceTransformsAsMatrices:HAe,_transformsToTypedArray:UJ};kAe.process=function(e,t,n){let i=t.instances,r=i.attributes[0].count,o=e.shaderBuilder;o.addDefine("HAS_INSTANCING"),o.addVertexLines(fU);let a=e.model,s=a.sceneGraph,c=e.runtimeNode,u=n.mode!==re.SCENE3D&&!n.scene3DOnly&&a._projectTo2D,f=a._enablePick&&!n.context.webgl2,d=[];vat(e,n,i,d,u,f),wat(e,n,i,d);let p={};if(i.transformInWorldSpace?(o.addDefine("USE_LEGACY_INSTANCING",void 0,he.VERTEX),o.addUniform("mat4","u_instance_modifiedModelView",he.VERTEX),o.addUniform("mat4","u_instance_nodeTransform",he.VERTEX),p.u_instance_modifiedModelView=function(){let g=O.multiplyTransformation(a.modelMatrix,s.components.transform,mU);return u?O.multiplyTransformation(n.context.uniformState.view3D,g,mU):(n.mode!==re.SCENE3D&&(g=mt.basisTo2D(n.mapProjection,g,mU)),O.multiplyTransformation(n.context.uniformState.view,g,mU))},p.u_instance_nodeTransform=function(){return O.multiplyTransformation(s.axisCorrectionMatrix,c.computedTransform,cat)},o.addVertexLines(hU)):o.addVertexLines(dU),u){o.addDefine("USE_2D_INSTANCING",void 0,he.VERTEX),o.addUniform("mat4","u_modelView2D",he.VERTEX);let g=n.context,m=O.fromTranslation(c.instancingReferencePoint2D,new O);p.u_modelView2D=function(){return O.multiplyTransformation(g.uniformState.view,m,lat)}}e.uniformMap=Ot(p,e.uniformMap),e.instanceCount=r,Xn(e.attributes,d)};var MD=new O,uat=new h;function fat(e,t,n,i,r){let o=O.multiplyTransformation(t,e,MD);return o=O.multiplyTransformation(o,n,MD),r=mt.basisTo2D(i.mapProjection,o,r),r}function dat(e,t,n,i,r){let o=O.fromTranslation(e,MD),a=O.multiplyTransformation(t,o,MD);a=O.multiplyTransformation(a,n,MD);let s=O.getTranslation(a,uat);return r=cr.computeActualEllipsoidPosition(i,s,r),r}function zAe(e,t,n){let i=e.model,r=i.sceneGraph;e.runtimeNode.node.instances.transformInWorldSpace?(O.multiplyTransformation(i.modelMatrix,r.components.transform,t),O.multiplyTransformation(r.axisCorrectionMatrix,e.runtimeNode.computedTransform,n)):(t=O.clone(r.computedModelMatrix,t),O.multiplyTransformation(t,e.runtimeNode.computedTransform,t),O.clone(O.IDENTITY,n))}var UAe=new O,VAe=new O,hat=new O,mat=new h;function pat(e,t,n,i){let r=UAe,o=VAe;zAe(t,r,o);let s=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let u=0;u<c;u++){let f=e[u],d=fat(f,r,o,n,hat),p=O.getTranslation(d,mat),g=h.subtract(p,s,p);i[u]=O.setTranslation(d,g,i[u])}return i}function gat(e,t,n,i){let r=UAe,o=VAe;zAe(t,r,o);let s=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let u=0;u<c;u++){let f=e[u],d=dat(f,r,o,n,f);i[u]=h.subtract(d,s,i[u])}return i}var _at=new h,yat=new h;function jAe(e,t){let n=e.runtimeNode,i=e.model.sceneGraph.computedModelMatrix,r=O.multiplyByPoint(i,n.instancingTranslationMin,_at),o=cr.computeActualEllipsoidPosition(t,r,r),a=O.multiplyByPoint(i,n.instancingTranslationMax,yat),s=cr.computeActualEllipsoidPosition(t,a,a);n.instancingReferencePoint2D=h.lerp(o,s,.5,new h)}function UJ(e){let n=e.length,i=new Float32Array(n*12);for(let r=0;r<n;r++){let o=e[r],a=12*r;i[a+0]=o[0],i[a+1]=o[4],i[a+2]=o[8],i[a+3]=o[12],i[a+4]=o[1],i[a+5]=o[5],i[a+6]=o[9],i[a+7]=o[13],i[a+8]=o[2],i[a+9]=o[6],i[a+10]=o[10],i[a+11]=o[14]}return i}function Aat(e){let n=e.length,i=new Float32Array(n*3);for(let r=0;r<n;r++){let o=e[r],a=3*r;i[a+0]=o[0],i[a+1]=o[4],i[a+2]=o[8]}return i}var bat=new h,xat=new Fe,Tat=new h;function HAe(e,t,n){let i=new Array(t),r=_t.getAttributeBySemantic(e,Do.TRANSLATION),o=_t.getAttributeBySemantic(e,Do.ROTATION),a=_t.getAttributeBySemantic(e,Do.SCALE),s=new h(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),c=new h(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),u=l(r),f=l(o),d=l(a),p=u?r.typedArray:new Float32Array(t*3),g=f?o.typedArray:new Float32Array(t*4);f&&o.normalized&&(g=an.dequantize(g,o.componentDatatype,o.type,t));let m;d?m=a.typedArray:(m=new Float32Array(t*3),m.fill(1));for(let A=0;A<t;A++){let b=new h(p[A*3],p[A*3+1],p[A*3+2],bat);h.maximumByComponent(s,b,s),h.minimumByComponent(c,b,c);let x=new Fe(g[A*4],g[A*4+1],g[A*4+2],f?g[A*4+3]:1,xat),T=new h(m[A*3],m[A*3+1],m[A*3+2],Tat),C=O.fromTranslationQuaternionRotationScale(b,x,T,new O);i[A]=C}let y=n.runtimeNode;return y.instancingTranslationMin=c,y.instancingTranslationMax=s,u&&(r.typedArray=void 0),f&&(o.typedArray=void 0),d&&(a.typedArray=void 0),i}function Cat(e,t,n){let i=new Array(t),r=e.typedArray,o=new h(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),a=new h(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);for(let c=0;c<t;c++){let u=new h(r[c*3],r[c*3+1],r[c*3+2]);i[c]=u,h.minimumByComponent(o,u,o),h.maximumByComponent(a,u,a)}let s=n.runtimeNode;return s.instancingTranslationMin=o,s.instancingTranslationMax=a,e.typedArray=void 0,i}function VJ(e,t){let n=Ze.createVertexBuffer({context:t.context,typedArray:e,usage:Oe.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}function vat(e,t,n,i,r,o){let a=_t.getAttributeBySemantic(n,Do.ROTATION);l(a)||o?Eat(e,n,i,t,r,o):Sat(e,n,i,t,r)}function Eat(e,t,n,i,r,o){let a=e.shaderBuilder,s=t.attributes[0].count,c=e.model,u=e.runtimeNode;a.addDefine("HAS_INSTANCE_MATRICES");let f="Transform",d,p=u.instancingTransformsBuffer;if(!l(p)){d=HAe(t,s,e);let A=UJ(d);p=VJ(A,i),c._modelResources.push(p),o&&(u.transformsTypedArray=A),u.instancingTransformsBuffer=p}if(BAe(e,p,n,f),!r)return;let g=Xe(i);g.mode=re.COLUMBUS_VIEW,jAe(e,g);let m=u.instancingTransformsBuffer2D;if(!l(m)){let A=pat(d,e,g,d),b=UJ(A);m=VJ(b,i),c._modelResources.push(m),u.instancingTransformsBuffer2D=m}BAe(e,m,n,"Transform2D")}function Sat(e,t,n,i,r,o){let a=e.shaderBuilder,s=e.runtimeNode,c=_t.getAttributeBySemantic(t,Do.TRANSLATION),u=_t.getAttributeBySemantic(t,Do.SCALE);if(l(u)&&(a.addDefine("HAS_INSTANCE_SCALE"),zJ(e,u.buffer,u.byteOffset,u.byteStride,n,"Scale")),!l(c))return;let f,d=c.typedArray;if(l(d)?f=Cat(c,c.count,e):l(s.instancingTranslationMin)||(s.instancingTranslationMin=c.min,s.instancingTranslationMax=c.max),a.addDefine("HAS_INSTANCE_TRANSLATION"),zJ(e,c.buffer,c.byteOffset,c.byteStride,n,"Translation"),!r&&!o)return;let g=Xe(i);g.mode=re.COLUMBUS_VIEW,jAe(e,g);let m=s.instancingTranslationBuffer2D;if(!l(m)){let x=gat(f,e,g,f),T=Aat(x);o&&(s.transformsTypedArray=T),m=VJ(T,i),e.model._modelResources.push(m),s.instancingTranslationBuffer2D=m}if(!r)return;zJ(e,m,0,void 0,n,"Translation2D")}function BAe(e,t,n,i){let o=Y.getSizeInBytes(Y.FLOAT),a=o*12,s=[{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:Y.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:a,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:Y.FLOAT,normalize:!1,offsetInBytes:o*4,strideInBytes:a,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:Y.FLOAT,normalize:!1,offsetInBytes:o*8,strideInBytes:a,instanceDivisor:1}],c=e.shaderBuilder;c.addAttribute("vec4",`a_instancing${i}Row0`),c.addAttribute("vec4",`a_instancing${i}Row1`),c.addAttribute("vec4",`a_instancing${i}Row2`),Xn(n,s)}function zJ(e,t,n,i,r,o){r.push({index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:3,componentDatatype:Y.FLOAT,normalize:!1,offsetInBytes:n,strideInBytes:i,instanceDivisor:1}),e.shaderBuilder.addAttribute("vec3",`a_instance${o}`)}function wat(e,t,n,i){let r=n.attributes,o=e.shaderBuilder;for(let a=0;a<r.length;a++){let s=r[a];s.semantic===Do.FEATURE_ID&&(s.setIndex>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=s.setIndex+1),i.push({index:e.attributeIndex++,vertexBuffer:s.buffer,componentsPerAttribute:Vt.getNumberOfComponents(s.type),componentDatatype:s.componentDatatype,normalize:!1,offsetInBytes:s.byteOffset,strideInBytes:s.byteStride,instanceDivisor:1}),o.addAttribute("float",`a_instanceFeatureId_${s.setIndex}`))}}var pU=kAe;var jJ={};jJ.name="ModelMatrixUpdateStage";jJ.update=function(e,t,n){let i=n.mode!==re.SCENE3D;if(!(i&&t._model._projectTo2D)&&e._transformDirty){let r=i?t._computedModelMatrix2D:t._computedModelMatrix;GAe(e,t,r,e.transformToRoot),e._transformDirty=!1}};function Iat(e,t,n){e.modelMatrix=O.multiplyTransformation(t,n,e.modelMatrix),e.cullFace=_t.getCullFace(e.modelMatrix,e.primitiveType)}function GAe(e,t,n,i){let r;i=O.multiplyTransformation(i,e.transform,new O),e.updateComputedTransform();let o=e.runtimePrimitives.length;for(r=0;r<o;r++){let s=e.runtimePrimitives[r];Iat(s.drawCommand,n,i)}let a=e.children.length;for(r=0;r<a;r++){let s=t._runtimeNodes[e.children[r]];s._transformToRoot=O.clone(i,s._transformToRoot),GAe(s,t,n,i),s._transformDirty=!1}}var gU=jJ;var WAe={name:"NodeStatisticsPipelineStage",_countInstancingAttributes:qAe,_countGeneratedBuffers:YAe};WAe.process=function(e,t,n){let i=e.model.statistics,r=t.instances,o=e.runtimeNode;qAe(i,r),YAe(i,o)};function qAe(e,t){if(!l(t))return;let n=t.attributes,i=n.length;for(let r=0;r<i;r++){let o=n[r];l(o.buffer)&&e.addBuffer(o.buffer,!1)}}function YAe(e,t){l(t.instancingTransformsBuffer)&&e.addBuffer(t.instancingTransformsBuffer,!1),l(t.instancingTransformsBuffer2D)&&e.addBuffer(t.instancingTransformsBuffer2D,!1),l(t.instancingTranslationBuffer2D)&&e.addBuffer(t.instancingTranslationBuffer2D,!1)}var _U=WAe;function wE(e){e=e??H.EMPTY_OBJECT;let t=e.node,n=e.transform,i=e.transformToRoot,r=e.sceneGraph,o=e.children;this._node=t,this._name=t.name,this._id=t.index,this._sceneGraph=r,this._children=o,this._originalTransform=O.clone(n,this._originalTransform),this._transform=O.clone(n,this._transform),this._transformToRoot=O.clone(i,this._transformToRoot),this._computedTransform=new O,this._transformDirty=!1,this._transformParameters=void 0,this._morphWeights=[],this._runtimeSkin=void 0,this._computedJointMatrices=[],this.show=!0,this.userAnimated=!1,this.pipelineStages=[],this.runtimePrimitives=[],this.updateStages=[],this.instancingTranslationMin=void 0,this.instancingTranslationMax=void 0,this.instancingTransformsBuffer=void 0,this.instancingTransformsBuffer2D=void 0,this.instancingTranslationBuffer2D=void 0,this.instancingReferencePoint2D=void 0,Pat(this)}Object.defineProperties(wE.prototype,{node:{get:function(){return this._node}},sceneGraph:{get:function(){return this._sceneGraph}},children:{get:function(){return this._children}},transform:{get:function(){return this._transform},set:function(e){this._transformDirty=!0,this._transform=O.clone(e,this._transform)}},transformToRoot:{get:function(){return this._transformToRoot}},computedTransform:{get:function(){return this._computedTransform}},originalTransform:{get:function(){return this._originalTransform}},translation:{get:function(){return l(this._transformParameters)?this._transformParameters.translation:void 0},set:function(e){let t=this._transformParameters,n=t.translation;h.equals(n,e)||(t.translation=h.clone(e,t.translation),HJ(this,t))}},rotation:{get:function(){return l(this._transformParameters)?this._transformParameters.rotation:void 0},set:function(e){let t=this._transformParameters,n=t.rotation;Fe.equals(n,e)||(t.rotation=Fe.clone(e,t.rotation),HJ(this,t))}},scale:{get:function(){return l(this._transformParameters)?this._transformParameters.scale:void 0},set:function(e){let t=this._transformParameters,n=t.scale;h.equals(n,e)||(t.scale=h.clone(e,t.scale),HJ(this,t))}},morphWeights:{get:function(){return this._morphWeights},set:function(e){let t=e.length;for(let n=0;n<t;n++)this._morphWeights[n]=e[n]}},runtimeSkin:{get:function(){return this._runtimeSkin}},computedJointMatrices:{get:function(){return this._computedJointMatrices}}});function Pat(e){let t=e.transform,n=e.transformToRoot,i=e._computedTransform;e._computedTransform=O.multiply(n,t,i);let r=e.node;l(r.matrix)||(e._transformParameters=new Ib(r.translation,r.rotation,r.scale)),l(r.morphWeights)&&(e._morphWeights=r.morphWeights.slice());let o=r.articulationName;if(l(o)){let c=e.sceneGraph._runtimeArticulations[o];l(c)&&c.runtimeNodes.push(e)}}function HJ(e,t){e._transformDirty=!0,e._transform=O.fromTranslationRotationScale(t,e._transform)}wE.prototype.getChild=function(e){return this.sceneGraph._runtimeNodes[this.children[e]]};wE.prototype.configurePipeline=function(){let e=this.node,t=this.pipelineStages;t.length=0;let n=this.updateStages;n.length=0,l(e.instances)&&t.push(pU),t.push(_U),n.push(gU)};wE.prototype.updateComputedTransform=function(){this._computedTransform=O.multiply(this._transformToRoot,this._transform,this._computedTransform)};wE.prototype.updateJointMatrices=function(){let e=this._runtimeSkin;if(!l(e))return;e.updateJointMatrices();let t=this._computedJointMatrices,n=e.jointMatrices,i=n.length;for(let r=0;r<i;r++){l(t[r])||(t[r]=new O);let o=O.multiplyTransformation(this.transformToRoot,this.transform,t[r]),a=O.inverseTransformation(o,t[r]);t[r]=O.multiplyTransformation(a,n[r],t[r])}};var yU=wE;var XAe={name:"AlphaPipelineStage"};XAe.process=function(e,t,n){let i=e.alphaOptions,r=e.model;i.pass=i.pass??r.opaquePass;let o=e.renderStateOptions;i.pass===Pe.TRANSLUCENT&&(o.cull.enabled=!1,o.depthMask=!1,o.blending=en.ALPHA_BLEND);let a=e.shaderBuilder,s=e.uniformMap;l(i.alphaCutoff)&&(a.addDefine("ALPHA_MODE_MASK",void 0,he.FRAGMENT),a.addUniform("float","u_alphaCutoff",he.FRAGMENT),s.u_alphaCutoff=function(){return i.alphaCutoff})};var AU=XAe;var KAe={name:"BatchTexturePipelineStage"};KAe.process=function(e,t,n){let i=e.shaderBuilder,r={},o=e.model,a=o.featureTables[o.featureTableId],s=a.featuresLength;i.addUniform("int","model_featuresLength"),r.model_featuresLength=function(){return s};let c=a.batchTexture;i.addUniform("sampler2D","model_batchTexture"),r.model_batchTexture=function(){return c.batchTexture??c.defaultTexture},i.addUniform("vec4","model_textureStep"),r.model_textureStep=function(){return c.textureStep},c.textureDimensions.y>1&&(i.addDefine("MULTILINE_BATCH_TEXTURE"),i.addUniform("vec2","model_textureDimensions"),r.model_textureDimensions=function(){return c.textureDimensions}),e.uniformMap=Ot(r,e.uniformMap)};var bU=KAe;var $Ae={name:"ClassificationPipelineStage"};$Ae.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_CLASSIFICATION",void 0,he.BOTH);let r=e.runtimePrimitive;l(r.batchLengths)||Dat(t,r)};function Dat(e,t){let n=_t.getAttributeBySemantic(e,ot.POSITION);if(!l(n))throw new oe("Primitives must have a position attribute to be used for classification.");let i,r=e.indices,o=l(r);o&&(i=r.typedArray,r.typedArray=void 0);let a=o?r.count:n.count,s=_t.getAttributeBySemantic(e,ot.FEATURE_ID,0);if(!l(s)){t.batchLengths=[a],t.batchOffsets=[0];return}let c=s.typedArray;s.typedArray=void 0;let u=[],f=[0],d=o?i[0]:0,p=c[d],g=0;for(let y=1;y<a;y++){let A=o?i[y]:y,b=c[A];if(b!==p){let x=y-g,T=y;u.push(x),f.push(T),g=T,p=b}}let m=a-g;u.push(m),t.batchLengths=u,t.batchOffsets=f}var xU=$Ae;var TU=`void filterByPassType(inout vec3 positionMC, vec4 featureColor)
|
|
{
|
|
bool styleTranslucent = (featureColor.a != 1.0);
|
|
// Only render translucent features in the translucent pass (if the style or the original command has translucency).
|
|
if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent)
|
|
{
|
|
// If the model has a translucent silhouette, it needs to render during the silhouette color command,
|
|
// (i.e. the command where model_silhouettePass = true), even if the model isn't translucent.
|
|
#ifdef HAS_SILHOUETTE
|
|
positionMC *= float(model_silhouettePass);
|
|
#else
|
|
positionMC *= 0.0;
|
|
#endif
|
|
}
|
|
// If the current pass is not the translucent pass and the style is not translucent, don't render the feature.
|
|
else if (czm_pass != czm_passTranslucent && styleTranslucent)
|
|
{
|
|
positionMC *= 0.0;
|
|
}
|
|
}
|
|
|
|
void cpuStylingStage(inout vec3 positionMC, inout SelectedFeature feature)
|
|
{
|
|
float show = ceil(feature.color.a);
|
|
positionMC *= show;
|
|
|
|
#if defined(HAS_SELECTED_FEATURE_ID_ATTRIBUTE) && !defined(HAS_CLASSIFICATION)
|
|
filterByPassType(positionMC, feature.color);
|
|
#endif
|
|
}
|
|
`;var CU=`void filterByPassType(vec4 featureColor)
|
|
{
|
|
bool styleTranslucent = (featureColor.a != 1.0);
|
|
// Only render translucent features in the translucent pass (if the style or the original command has translucency).
|
|
if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent)
|
|
{
|
|
// If the model has a translucent silhouette, it needs to render during the silhouette color command,
|
|
// (i.e. the command where model_silhouettePass = true), even if the model isn't translucent.
|
|
#ifdef HAS_SILHOUETTE
|
|
if(!model_silhouettePass) {
|
|
discard;
|
|
}
|
|
#else
|
|
discard;
|
|
#endif
|
|
}
|
|
// If the current pass is not the translucent pass and the style is not translucent, don't render the feature.
|
|
else if (czm_pass != czm_passTranslucent && styleTranslucent)
|
|
{
|
|
discard;
|
|
}
|
|
}
|
|
|
|
void cpuStylingStage(inout czm_modelMaterial material, SelectedFeature feature)
|
|
{
|
|
vec4 featureColor = feature.color;
|
|
if (featureColor.a == 0.0)
|
|
{
|
|
discard;
|
|
}
|
|
|
|
// If a feature ID vertex attribute is used, the pass type filter is applied in the vertex shader.
|
|
// So, we only apply in in the fragment shader if the feature ID texture is used.
|
|
#if defined(HAS_SELECTED_FEATURE_ID_TEXTURE) && !defined(HAS_CLASSIFICATION)
|
|
filterByPassType(featureColor);
|
|
#endif
|
|
|
|
featureColor = czm_gammaCorrect(featureColor);
|
|
|
|
// Classification models compute the diffuse differently.
|
|
#ifdef HAS_CLASSIFICATION
|
|
material.diffuse = featureColor.rgb * featureColor.a;
|
|
#else
|
|
float highlight = ceil(model_colorBlend);
|
|
material.diffuse *= mix(featureColor.rgb, vec3(1.0), highlight);
|
|
#endif
|
|
|
|
material.alpha *= featureColor.a;
|
|
}
|
|
`;var JAe={name:"CPUStylingPipelineStage"};JAe.process=function(e,t,n){let i=e.model,r=e.shaderBuilder;r.addVertexLines(TU),r.addFragmentLines(CU),r.addDefine("USE_CPU_STYLING",void 0,he.BOTH),l(i.color)||(r.addUniform("float",ix.COLOR_BLEND_UNIFORM_NAME,he.FRAGMENT),e.uniformMap[ix.COLOR_BLEND_UNIFORM_NAME]=function(){return Ml.getColorBlend(i.colorBlendMode,i.colorBlendAmount)}),r.addUniform("bool","model_commandTranslucent",he.BOTH),e.uniformMap.model_commandTranslucent=function(){return e.alphaOptions.pass===Pe.TRANSLUCENT}};var vU=JAe;var GJ={MODIFY_MATERIAL:"MODIFY_MATERIAL",REPLACE_MATERIAL:"REPLACE_MATERIAL"};GJ.getDefineName=function(e){return`CUSTOM_SHADER_${e}`};Object.freeze(GJ);var Ey=GJ;var EU=`void customShaderStage(
|
|
inout czm_modelVertexOutput vsOutput,
|
|
inout ProcessedAttributes attributes,
|
|
FeatureIds featureIds,
|
|
Metadata metadata,
|
|
MetadataClass metadataClass,
|
|
MetadataStatistics metadataStatistics
|
|
) {
|
|
// VertexInput and initializeInputStruct() are dynamically generated in JS,
|
|
// see CustomShaderPipelineStage.js
|
|
VertexInput vsInput;
|
|
initializeInputStruct(vsInput, attributes);
|
|
vsInput.featureIds = featureIds;
|
|
vsInput.metadata = metadata;
|
|
vsInput.metadataClass = metadataClass;
|
|
vsInput.metadataStatistics = metadataStatistics;
|
|
vertexMain(vsInput, vsOutput);
|
|
attributes.positionMC = vsOutput.positionMC;
|
|
}
|
|
`;var SU=`void customShaderStage(
|
|
inout czm_modelMaterial material,
|
|
ProcessedAttributes attributes,
|
|
FeatureIds featureIds,
|
|
Metadata metadata,
|
|
MetadataClass metadataClass,
|
|
MetadataStatistics metadataStatistics
|
|
) {
|
|
// FragmentInput and initializeInputStruct() are dynamically generated in JS,
|
|
// see CustomShaderPipelineStage.js
|
|
FragmentInput fsInput;
|
|
initializeInputStruct(fsInput, attributes);
|
|
fsInput.featureIds = featureIds;
|
|
fsInput.metadata = metadata;
|
|
fsInput.metadataClass = metadataClass;
|
|
fsInput.metadataStatistics = metadataStatistics;
|
|
fragmentMain(fsInput, material);
|
|
}
|
|
`;var wU=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) {
|
|
initializeFeatureIds(featureIds, attributes);
|
|
initializeFeatureIdAliases(featureIds);
|
|
}
|
|
`;var IU=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes)
|
|
{
|
|
initializeFeatureIds(featureIds, attributes);
|
|
initializeFeatureIdAliases(featureIds);
|
|
setFeatureIdVaryings();
|
|
}
|
|
`;var rr={name:"FeatureIdPipelineStage",STRUCT_ID_FEATURE_IDS_VS:"FeatureIdsVS",STRUCT_ID_FEATURE_IDS_FS:"FeatureIdsFS",STRUCT_NAME_FEATURE_IDS:"FeatureIds",FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS:"initializeFeatureIdsVS",FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS:"initializeFeatureIdsFS",FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS:"initializeFeatureIdAliasesVS",FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS:"initializeFeatureIdAliasesFS",FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS:"void initializeFeatureIds(out FeatureIds featureIds, ProcessedAttributes attributes)",FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES:"void initializeFeatureIdAliases(inout FeatureIds featureIds)",FUNCTION_ID_SET_FEATURE_ID_VARYINGS:"setFeatureIdVaryings",FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS:"void setFeatureIdVaryings()"};rr.process=function(e,t,n){let i=e.shaderBuilder;Rat(i);let r=e.runtimeNode.node.instances;l(r)&&Oat(e,r,n),Mat(e,t,n),i.addVertexLines(IU),i.addFragmentLines(wU)};function Rat(e){e.addStruct(rr.STRUCT_ID_FEATURE_IDS_VS,rr.STRUCT_NAME_FEATURE_IDS,he.VERTEX),e.addStruct(rr.STRUCT_ID_FEATURE_IDS_FS,rr.STRUCT_NAME_FEATURE_IDS,he.FRAGMENT),e.addFunction(rr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,rr.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,he.VERTEX),e.addFunction(rr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,rr.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,he.FRAGMENT),e.addFunction(rr.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,rr.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,he.VERTEX),e.addFunction(rr.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,rr.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,he.FRAGMENT),e.addFunction(rr.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,rr.FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS,he.VERTEX)}function Oat(e,t,n){let i=t.featureIds,r=t.attributes[0].count;for(let o=0;o<i.length;o++){let a=i[o],s=a.positionalLabel;a instanceof Tn.FeatureIdAttribute?Lat(e,a,s):ZAe(e,a,s,r,1,n);let c=a.label;l(c)&&QAe(e,s,c,he.BOTH)}}function Mat(e,t,n){let i=t.featureIds,o=_t.getAttributeBySemantic(t,ot.POSITION).count;for(let a=0;a<i.length;a++){let s=i[a],c=s.positionalLabel,u=he.BOTH;s instanceof Tn.FeatureIdAttribute?Nat(e,s,c):s instanceof Tn.FeatureIdImplicitRange?ZAe(e,s,c,o,void 0,n):(Fat(e,s,c,a,n),u=he.FRAGMENT);let f=s.label;l(f)&&QAe(e,c,f,u)}}function Lat(e,t,n){let i=e.shaderBuilder;i.addStructField(rr.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(rr.STRUCT_ID_FEATURE_IDS_FS,"int",n);let r=t.setIndex,o=n.replace(/_\d+$/,"_"),a=`a_${o}${r}`,s=`v_${o}${r}`,c=`featureIds.${n} = int(czm_round(${a}));`,u=`featureIds.${n} = int(czm_round(${s}));`;i.addFunctionLines(rr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[c]),i.addFunctionLines(rr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[u]),i.addVarying("float",s),i.addFunctionLines(rr.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${s} = ${a};`])}function Nat(e,t,n){let i=e.shaderBuilder;i.addStructField(rr.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(rr.STRUCT_ID_FEATURE_IDS_FS,"int",n);let r=t.setIndex,o=n.replace(/_\d+$/,"_"),a=[`featureIds.${n} = int(czm_round(attributes.${o}${r}));`];i.addFunctionLines(rr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,a),i.addFunctionLines(rr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,a)}function ZAe(e,t,n,i,r,o){Bat(e,t,i,r,o);let a=e.shaderBuilder,s=`a_implicit_${n}`;a.addAttribute("float",s);let c=`v_implicit_${n}`;a.addVarying("float",c),a.addStructField(rr.STRUCT_ID_FEATURE_IDS_VS,"int",n),a.addStructField(rr.STRUCT_ID_FEATURE_IDS_FS,"int",n),a.addFunctionLines(rr.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${c} = ${s};`]),a.addFunctionLines(rr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[`featureIds.${n} = int(czm_round(${s}));`]),a.addFunctionLines(rr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[`featureIds.${n} = int(czm_round(${c}));`])}function Fat(e,t,n,i,r){let o=`u_featureIdTexture_${i}`,a=e.uniformMap,s=t.textureReader;a[o]=function(){return s.texture??r.context.defaultTexture};let c=s.channels,u=e.shaderBuilder;u.addStructField(rr.STRUCT_ID_FEATURE_IDS_FS,"int",n),u.addUniform("sampler2D",o,he.FRAGMENT);let d=`v_texCoord_${s.texCoord}`,p=d,g=s.transform;if(l(g)&&!$.equals(g,$.IDENTITY)){let A=`${o}Transform`;u.addUniform("mat3",A,he.FRAGMENT),a[A]=function(){return g},p=`vec2(${A} * vec3(${d}, 1.0))`}let m=`texture(${o}, ${p}).${c}`,y=`featureIds.${n} = czm_unpackUint(${m});`;u.addFunctionLines(rr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[y])}function QAe(e,t,n,i){let r=e.shaderBuilder,o=he.includesVertexShader(i);o&&r.addStructField(rr.STRUCT_ID_FEATURE_IDS_VS,"int",n),r.addStructField(rr.STRUCT_ID_FEATURE_IDS_FS,"int",n);let a=[`featureIds.${n} = featureIds.${t};`];o&&r.addFunctionLines(rr.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,a),r.addFunctionLines(rr.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,a)}function Bat(e,t,n,i,r){let o=e.model,a,s;if(l(t.repeat)){let u=kat(t,n);a=Ze.createVertexBuffer({context:r.context,typedArray:u,usage:Oe.STATIC_DRAW}),a.vertexArrayDestroyable=!1,o._pipelineResources.push(a),o.statistics.addBuffer(a,!1)}else s=[t.offset];let c={index:e.attributeIndex++,instanceDivisor:i,value:s,vertexBuffer:a,normalize:!1,componentsPerAttribute:1,componentDatatype:Y.FLOAT,strideInBytes:Y.getSizeInBytes(Y.FLOAT),offsetInBytes:0};e.attributes.push(c)}function kat(e,t){let n=e.offset,i=e.repeat,r=new Float32Array(t);for(let o=0;o<t;o++)r[o]=n+Math.floor(o/i);return r}var rx=rr;var PU=`void metadataStage(
|
|
FeatureIds featureIds,
|
|
out Metadata metadata,
|
|
out MetadataClass metadataClass,
|
|
out MetadataStatistics metadataStatistics,
|
|
ProcessedAttributes attributes
|
|
)
|
|
{
|
|
initializeMetadata(featureIds, metadata, metadataClass, metadataStatistics, attributes);
|
|
}
|
|
`;var DU=`void metadataStage(
|
|
FeatureIds featureIds,
|
|
out Metadata metadata,
|
|
out MetadataClass metadataClass,
|
|
out MetadataStatistics metadataStatistics,
|
|
ProcessedAttributes attributes
|
|
)
|
|
{
|
|
initializeMetadata(featureIds, metadata, metadataClass, metadataStatistics, attributes);
|
|
setMetadataVaryings();
|
|
}
|
|
`;var Ci={name:"MetadataPipelineStage",STRUCT_ID_METADATA_VS:"MetadataVS",STRUCT_ID_METADATA_FS:"MetadataFS",STRUCT_NAME_METADATA:"Metadata",STRUCT_ID_METADATA_CLASS_VS:"MetadataClassVS",STRUCT_ID_METADATA_CLASS_FS:"MetadataClassFS",STRUCT_NAME_METADATA_CLASS:"MetadataClass",STRUCT_ID_METADATA_STATISTICS_VS:"MetadataStatisticsVS",STRUCT_ID_METADATA_STATISTICS_FS:"MetadataStatisticsFS",STRUCT_NAME_METADATA_STATISTICS:"MetadataStatistics",FUNCTION_ID_INITIALIZE_METADATA_VS:"initializeMetadataVS",FUNCTION_ID_INITIALIZE_METADATA_FS:"initializeMetadataFS",FUNCTION_SIGNATURE_INITIALIZE_METADATA:"void initializeMetadata(FeatureIds featureIds, out Metadata metadata, out MetadataClass metadataClass, out MetadataStatistics metadataStatistics, ProcessedAttributes attributes)",FUNCTION_ID_SET_METADATA_VARYINGS:"setMetadataVaryings",FUNCTION_SIGNATURE_SET_METADATA_VARYINGS:"void setMetadataVaryings()",METADATA_CLASS_FIELDS:[{specName:"noData",shaderName:"noData"},{specName:"default",shaderName:"defaultValue"},{specName:"min",shaderName:"minValue"},{specName:"max",shaderName:"maxValue"}],METADATA_STATISTICS_FIELDS:[{specName:"min",shaderName:"minValue"},{specName:"max",shaderName:"maxValue"},{specName:"mean",shaderName:"mean",type:"float"},{specName:"median",shaderName:"median"},{specName:"standardDeviation",shaderName:"standardDeviation",type:"float"},{specName:"variance",shaderName:"variance",type:"float"},{specName:"sum",shaderName:"sum"}]};Ci.process=function(e,t,n){let{shaderBuilder:i,model:r}=e,{structuralMetadata:o={},content:a}=r,s=a?.tileset.metadataExtension?.statistics,c=n.context.webgl2,u=ist(r,t),f=zat(o.propertyAttributes,t,s),d=Vat(o.propertyTextures,s),p=Gat(o.propertyTables,t,e,s,u),g=f.concat(d).concat(p);Yat(i,g),$at(i),i.addVertexLines(DU),i.addFragmentLines(PU);for(let m=0;m<f.length;m++){let y=f[m];Jat(e,y)}for(let m=0;m<d.length;m++){let y=d[m];Qat(e,y,c)}for(let m=0;m<p.length;m++){let y=p[m];tst(e,y,c)}};function zat(e,t,n){return l(e)?e.flatMap(i=>Uat(i,t,n)):[]}function Uat(e,t,n){let{getAttributeByName:i,getAttributeInfo:r,sanitizeGlslIdentifier:o}=_t,a=e.class.id,s=n?.classes[a],c=Object.entries(e.properties),u=new Array(c.length);for(let f=0;f<c.length;f++){let[d,p]=c[f],g=i(t,p.attribute),{glslType:m,variableName:y}=r(g);u[f]={metadataVariable:o(d),property:p,classProperty:p.classProperty,type:p.classProperty.type,glslType:m,variableName:y,propertyStatistics:s?.properties[d],shaderDestination:he.BOTH}}return u}function Vat(e,t){return l(e)?e.flatMap(n=>jat(n,t)):[]}function jat(e,t){let{sanitizeGlslIdentifier:n}=_t,i=e.class.id,r=t?.classes[i],o=Object.entries(e.properties).filter(([s,c])=>{let u=c.textureReader.channels.length;return c.classProperty.isGpuCompatible(u)}),a=new Array(o.length);for(let s=0;s<o.length;s++){let[c,u]=o[s];a[s]={metadataVariable:n(c),property:u,classProperty:u.classProperty,type:u.classProperty.type,glslType:u.classProperty.getGlslType(),propertyStatistics:r?.properties[c],shaderDestination:he.FRAGMENT}}return a}var Hat=4;function Gat(e,t,n,i,r){if(!l(e))return[];let o=qat(n,t);return e.filter(a=>l(a.class)&&o.has(String(a.id))).flatMap(a=>Wat(a,o,i,r))}function Wat(e,t,n,i){let{sanitizeGlslIdentifier:r}=_t,o=e.class,a=n?.classes[o.id],s=t.get(String(e.id))??{},c=s.shaderDestination??he.BOTH,u=e.properties,f=o.properties,d=[],p=0;for(let[g,m]of Object.entries(f)){if(!m.isGpuCompatible(Hat))continue;let y=u[g],A=he.intersection(ast(g,i),c);if(A===he.NONE){p++;continue}d.push({metadataVariable:r(g),property:y,classProperty:m,type:m.type,glslType:m.getGlslType(),propertyStatistics:a?.properties[g],shaderDestination:A,propertyTable:e,featureIdVariableName:s.variableName,propertyInfoIndex:p}),p++}return d}function qat(e,t){let n=new Map;function i(s,c){let u=s?.propertyTableId;if(!l(u))return;let f=String(u),d={variableName:s.positionalLabel,shaderDestination:c},p=n.get(f);l(p)&&console.warn(`Multiple feature ID sets reference the same property table ${u} in primitive. Only one will be used.`),n.set(f,d)}let r=t?.featureIds??[];for(let s=0;s<r.length;s++){let c=r[s],u=l(c?.textureReader);i(c,u?he.FRAGMENT:he.BOTH)}let a=e.runtimeNode?.node?.instances?.featureIds??[];for(let s=0;s<a.length;s++){let c=a[s];i(c,he.BOTH)}return n}function Yat(e,t){let n=new Set,i=new Set;for(let s=0;s<t.length;s++){let{type:c,glslType:u,propertyStatistics:f}=t[s];n.add(u),l(f)&&c!==gt.ENUM&&i.add(u)}let r=Ci.METADATA_CLASS_FIELDS;for(let s of n){let c=`${s}MetadataClass`;a(c,s,r)}let o=Ci.METADATA_STATISTICS_FIELDS;for(let s of i){let c=`${s}MetadataStatistics`;a(c,s,o)}function a(s,c,u){e.addStruct(s,s,he.BOTH);for(let f=0;f<u.length;f++){let{shaderName:d}=u[f],p=u[f].type==="float"?Kat(c):c;e.addStructField(s,p,d)}}}var Xat={int:"float",ivec2:"vec2",ivec3:"vec3",ivec4:"vec4"};function Kat(e){let t=Xat[e];return l(t)?t:e}function $at(e){e.addStruct(Ci.STRUCT_ID_METADATA_VS,Ci.STRUCT_NAME_METADATA,he.VERTEX),e.addStruct(Ci.STRUCT_ID_METADATA_FS,Ci.STRUCT_NAME_METADATA,he.FRAGMENT),e.addStruct(Ci.STRUCT_ID_METADATA_CLASS_VS,Ci.STRUCT_NAME_METADATA_CLASS,he.VERTEX),e.addStruct(Ci.STRUCT_ID_METADATA_CLASS_FS,Ci.STRUCT_NAME_METADATA_CLASS,he.FRAGMENT),e.addStruct(Ci.STRUCT_ID_METADATA_STATISTICS_VS,Ci.STRUCT_NAME_METADATA_STATISTICS,he.VERTEX),e.addStruct(Ci.STRUCT_ID_METADATA_STATISTICS_FS,Ci.STRUCT_NAME_METADATA_STATISTICS,he.FRAGMENT),e.addFunction(Ci.FUNCTION_ID_INITIALIZE_METADATA_VS,Ci.FUNCTION_SIGNATURE_INITIALIZE_METADATA,he.VERTEX),e.addFunction(Ci.FUNCTION_ID_INITIALIZE_METADATA_FS,Ci.FUNCTION_SIGNATURE_INITIALIZE_METADATA,he.FRAGMENT),e.addFunction(Ci.FUNCTION_ID_SET_METADATA_VARYINGS,Ci.FUNCTION_SIGNATURE_SET_METADATA_VARYINGS,he.VERTEX)}function Jat(e,t){Zat(e,t),WJ(e.shaderBuilder,t),qJ(e.shaderBuilder,t)}function Zat(e,t){let{shaderBuilder:n}=e,{metadataVariable:i,property:r,glslType:o}=t,a=YJ({valueExpression:`attributes.${t.variableName}`,renderResources:e,glslType:o,metadataVariable:i,shaderDestination:he.BOTH,property:r});n.addStructField(Ci.STRUCT_ID_METADATA_VS,o,i),n.addStructField(Ci.STRUCT_ID_METADATA_FS,o,i);let s=`metadata.${i} = ${a};`;n.addFunctionLines(Ci.FUNCTION_ID_INITIALIZE_METADATA_VS,[s]),n.addFunctionLines(Ci.FUNCTION_ID_INITIALIZE_METADATA_FS,[s])}function Qat(e,t,n){est(e,t,n),WJ(e.shaderBuilder,t),qJ(e.shaderBuilder,t)}function est(e,t,n){let{shaderBuilder:i,uniformMap:r}=e,{metadataVariable:o,glslType:a,property:s}=t,{texCoord:c,channels:u,index:f,texture:d,transform:p}=s.textureReader,g=`u_propertyTexture_${f}`,m=[];r.hasOwnProperty(g)||(i.addUniform("sampler2D",g,he.FRAGMENT),r[g]=()=>d),i.addStructField(Ci.STRUCT_ID_METADATA_FS,a,o);let y=`attributes.texCoord_${c}`,A=y;if(l(p)&&!$.equals(p,$.IDENTITY)){let w=`${g}Transform`;i.addUniform("mat3",w,he.FRAGMENT),r[w]=function(){return p},A=`vec2(${w} * vec3(${y}, 1.0))`}let b=`texture(${g}, ${A}).${u}`,x=s.classProperty,T;n?T=x.unpackTextureInShader(b,u,o,m):T=x.unpackTextureInShaderWebGL1(b);let C=YJ({valueExpression:T,renderResources:e,glslType:a,metadataVariable:o,shaderDestination:he.FRAGMENT,property:s}),E=`metadata.${o} = ${C};`;m.push(E),i.addFunctionLines(Ci.FUNCTION_ID_INITIALIZE_METADATA_FS,m)}function WJ(e,t){let n=t.classProperty,{metadataVariable:i,glslType:r,shaderDestination:o}=t,a=ebe(Ci.METADATA_CLASS_FIELDS,n,`metadataClass.${i}`,r),s=`${r}MetadataClass`;e.addStructField(Ci.STRUCT_ID_METADATA_CLASS_FS,s,i),e.addFunctionLines(Ci.FUNCTION_ID_INITIALIZE_METADATA_FS,a),he.includesVertexShader(o)&&(e.addStructField(Ci.STRUCT_ID_METADATA_CLASS_VS,s,i),e.addFunctionLines(Ci.FUNCTION_ID_INITIALIZE_METADATA_VS,a))}function qJ(e,t){let{propertyStatistics:n}=t;if(!l(n))return;let{metadataVariable:i,type:r,glslType:o}=t;if(r===gt.ENUM)return;let a=Ci.METADATA_STATISTICS_FIELDS,s=`metadataStatistics.${i}`,c=ebe(a,n,s,o),u=`${o}MetadataStatistics`;e.addStructField(Ci.STRUCT_ID_METADATA_STATISTICS_FS,u,i),e.addFunctionLines(Ci.FUNCTION_ID_INITIALIZE_METADATA_FS,c),he.includesVertexShader(t.shaderDestination)&&(e.addStructField(Ci.STRUCT_ID_METADATA_STATISTICS_VS,u,i),e.addFunctionLines(Ci.FUNCTION_ID_INITIALIZE_METADATA_VS,c))}function tst(e,t,n){nst(e,t,n),WJ(e.shaderBuilder,t),qJ(e.shaderBuilder,t)}function nst(e,t,n){let{shaderBuilder:i,uniformMap:r}=e,{metadataVariable:o,glslType:a,property:s,featureIdVariableName:c,propertyTable:u,propertyInfoIndex:f}=t;if(!n){pt("PropertyTableCustomShader","Property table support for custom shaders requires WebGL2.");return}if(!l(c)||!l(u.texture))return;let d=`u_propertyTableTexture_${u.id}`,p=[];r.hasOwnProperty(d)||(i.addUniform("sampler2D",d,he.BOTH),r[d]=()=>u.texture);let g=t.shaderDestination;he.includesVertexShader(g)&&i.addStructField(Ci.STRUCT_ID_METADATA_VS,a,o),he.includesFragmentShader(g)&&i.addStructField(Ci.STRUCT_ID_METADATA_FS,a,o);let y=`ivec2(${`featureIds.${c}`}, ${f})`,A=`texelFetch(${d}, ${y}, 0)`,b=t.classProperty,x=b.unpackTextureInShader(A,"rgba",o,p),T=YJ({valueExpression:x,renderResources:e,glslType:a,metadataVariable:o,shaderDestination:g,property:s??b}),C=`metadata.${o} = ${T};`;p.push(C),he.includesVertexShader(g)&&i.addFunctionLines(Ci.FUNCTION_ID_INITIALIZE_METADATA_VS,p),he.includesFragmentShader(g)&&i.addFunctionLines(Ci.FUNCTION_ID_INITIALIZE_METADATA_FS,p)}function ebe(e,t,n,i){function r(o){let a=t[o.specName];if(l(a))return`${n}.${o.shaderName} = ${i}(${a});`}return l(t)?e.map(r).filter(l):[]}function YJ(e){let{valueExpression:t,property:n}=e;if(!n.hasValueTransform)return t;let i=e.metadataVariable,r=`u_${i}_offset`,o=`u_${i}_scale`,{shaderBuilder:a,uniformMap:s}=e.renderResources,{glslType:c,shaderDestination:u}=e;a.addUniform(c,r,u),a.addUniform(c,o,u);let{offset:f,scale:d}=n;return s[r]=()=>f,s[o]=()=>d,`czm_valueTransform(${r}, ${o}, ${t})`}function ist(e,t){let n=new Set,i=new Set;return rst(e,n,i),ost(e,t,n,i),{usedInVertex:n,usedInFragment:i}}function rst(e,t,n){let i=e.customShader;if(!l(i))return;let r=i.usedVariablesFragment?.metadataSet??{};for(let a in r)r.hasOwnProperty(a)&&n.add(a);let o=i.usedVariablesVertex?.metadataSet??{};for(let a in o)o.hasOwnProperty(a)&&t.add(a)}function ost(e,t,n,i){let r=e.style;if(!(l(r)&&t.primitiveType===Re.POINTS))return;let a=r.color?.getVariables?.()??[];for(let u of a)n.add(u),i.add(u);let s=r.show?.getVariables?.()??[];for(let u of s)n.add(u),i.add(u);let c=r.pointSize?.getVariables?.()??[];for(let u of c)n.add(u)}function ast(e,t){let n=t.usedInFragment.has(e)?he.FRAGMENT:he.NONE,i=t.usedInVertex.has(e)?he.VERTEX:he.NONE;return he.union(n,i)}var Fh=Ci;var tbe={INHERIT:0,OPAQUE:1,TRANSLUCENT:2};Object.freeze(tbe);var ox=tbe;var Is={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:pt};Is.process=function(e,t,n){let{shaderBuilder:i,model:r,alphaOptions:o}=e,{customShader:a}=r,{lightingModel:s,translucencyMode:c}=a;l(s)&&(e.lightingOptions.lightingModel=s),c===ox.TRANSLUCENT?o.pass=Pe.TRANSLUCENT:c===ox.OPAQUE&&(o.pass=void 0);let u=mst(a,t,e);if(!u.customShaderEnabled)return;if(yst(i,a,u),u.shouldComputePositionWC&&i.addDefine("COMPUTE_POSITION_WC_CUSTOM_SHADER",void 0,he.BOTH),l(a.vertexShaderText)&&i.addDefine("HAS_CUSTOM_VERTEX_SHADER",void 0,he.VERTEX),l(a.fragmentShaderText)){i.addDefine("HAS_CUSTOM_FRAGMENT_SHADER",void 0,he.FRAGMENT);let p=Ey.getDefineName(a.mode);i.addDefine(p,void 0,he.FRAGMENT)}let f=a.uniforms;for(let p in f)if(f.hasOwnProperty(p)){let g=f[p];i.addUniform(g.type,p)}let d=a.varyings;for(let p in d)if(d.hasOwnProperty(p)){let g=d[p];i.addVarying(g,p)}e.uniformMap=Ot(e.uniformMap,a.uniformMap)};function sst(e){let t={};for(let n=0;n<e.length;n++){let i=_t.getAttributeInfo(e[n]);t[i.variableName]=i}return t}var cst={position:"vec3",normal:"vec3",tangent:"vec3",bitangent:"vec3",texCoord:"vec2",color:"vec4",joints:"ivec4",weights:"vec4"},lst={position:"vec3(0.0)",normal:"vec3(0.0, 0.0, 1.0)",tangent:"vec3(1.0, 0.0, 0.0)",bitangent:"vec3(0.0, 1.0, 0.0)",texCoord:"vec2(0.0)",color:"vec4(1.0)",joints:"ivec4(0)",weights:"vec4(0.0)"};function nbe(e){let t=e.replace(/_[0-9]+$/,"");t=t.replace(/(MC|EC)$/,"");let n=cst[t],i=lst[t];if(l(n))return{attributeField:[n,e],value:i}}function ust(e,t,n){if(!l(e.vertexShaderText))return{enabled:!1};let i=e.usedVariablesVertex;if(!obe(i.metadataSet,n))return{enabled:!1};let r=i.attributeSet,o=ibe(t,r,!1),a=rbe(t,r,!1),s,c=[],u=[];for(let f in o){if(!o.hasOwnProperty(f))continue;let p=[o[f].glslType,f];c.push(p),s=`vsInput.attributes.${f} = attributes.${f};`,u.push(s)}for(let f=0;f<a.length;f++){let d=a[f],p=nbe(d);if(!l(p))return Is._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveVS",`Primitive is missing attribute ${d}, disabling custom vertex shader`),{enabled:!1};c.push(p.attributeField),s=`vsInput.attributes.${d} = ${p.value};`,u.push(s)}return{enabled:!0,attributeFields:c,initializationLines:u}}function fst(e){let t=[],n=[],i=e.usedVariablesFragment.attributeSet;return i.hasOwnProperty("positionWC")&&(t.push(["vec3","positionWC"]),n.push("fsInput.attributes.positionWC = attributes.positionWC;")),i.hasOwnProperty("positionEC")&&(t.push(["vec3","positionEC"]),n.push("fsInput.attributes.positionEC = attributes.positionEC;")),{attributeFields:t,initializationLines:n}}function dst(e,t,n){if(!l(e.fragmentShaderText))return{enabled:!1};let i=e.usedVariablesFragment;if(!obe(i.metadataSet,n))return{enabled:!1};let r=i.attributeSet,o=ibe(t,r,!0),a=rbe(t,r,!0),s,c=[],u=[];for(let d in o){if(!o.hasOwnProperty(d))continue;let g=[o[d].glslType,d];c.push(g),s=`fsInput.attributes.${d} = attributes.${d};`,u.push(s)}for(let d=0;d<a.length;d++){let p=a[d],g=nbe(p);if(!l(g))return Is._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveFS",`Primitive is missing attribute ${p}, disabling custom fragment shader.`),{enabled:!1};c.push(g.attributeField),s=`fsInput.attributes.${p} = ${g.value};`,u.push(s)}let f=fst(e);return{enabled:!0,attributeFields:c.concat(f.attributeFields),initializationLines:f.initializationLines.concat(u)}}var hst={positionWC:!0,positionEC:!0};function ibe(e,t,n){let i={};for(let r in e){if(!e.hasOwnProperty(r))continue;let o=e[r],a=r;n&&r==="normalMC"?a="normalEC":n&&r==="tangentMC"&&(a="tangentEC",o.glslType="vec3"),t.hasOwnProperty(a)&&(i[a]=o)}return i}function rbe(e,t,n){let i=[];for(let r in t){if(!t.hasOwnProperty(r)||hst.hasOwnProperty(r))continue;let o=r;n&&r==="normalEC"?o="normalMC":n&&r==="tangentEC"&&(o="tangentMC"),e.hasOwnProperty(o)||i.push(r)}return i}function mst(e,t,n){let i=sst(t.attributes),r=Ast(t,n.model.structuralMetadata),o=ust(e,i,r),a=dst(e,i,r),c=e.usedVariablesFragment.attributeSet.hasOwnProperty("positionWC")&&a.enabled;return{vertexLines:o,fragmentLines:a,customShaderEnabled:o.enabled||a.enabled,shouldComputePositionWC:c}}function pst(e,t){let n=Is.STRUCT_ID_ATTRIBUTES_VS;e.addStruct(n,Is.STRUCT_NAME_ATTRIBUTES,he.VERTEX);let{attributeFields:i,initializationLines:r}=t;for(let a=0;a<i.length;a++){let[s,c]=i[a];e.addStructField(n,s,c)}n=Is.STRUCT_ID_VERTEX_INPUT,e.addStruct(n,Is.STRUCT_NAME_VERTEX_INPUT,he.VERTEX),e.addStructField(n,Is.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,rx.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,Fh.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,Fh.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,Fh.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let o=Is.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS;e.addFunction(o,Is.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS,he.VERTEX),e.addFunctionLines(o,r)}function gst(e,t){let n=Is.STRUCT_ID_ATTRIBUTES_FS;e.addStruct(n,Is.STRUCT_NAME_ATTRIBUTES,he.FRAGMENT);let{attributeFields:i,initializationLines:r}=t;for(let a=0;a<i.length;a++){let[s,c]=i[a];e.addStructField(n,s,c)}n=Is.STRUCT_ID_FRAGMENT_INPUT,e.addStruct(n,Is.STRUCT_NAME_FRAGMENT_INPUT,he.FRAGMENT),e.addStructField(n,Is.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,rx.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,Fh.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,Fh.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,Fh.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let o=Is.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS;e.addFunction(o,Is.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS,he.FRAGMENT),e.addFunctionLines(o,r)}var _st=[];function yst(e,t,n){let{vertexLines:i,fragmentLines:r}=n,o=_st;i.enabled&&(pst(e,i),o.length=0,o.push("#line 0",t.vertexShaderText,EU),e.addVertexLines(o)),r.enabled&&(gst(e,r),o.length=0,o.push("#line 0",t.fragmentShaderText,SU),e.addFragmentLines(o))}function Ast(e,t){if(!l(t))return new Set;let n=e.propertyTextureIds,i=e.propertyAttributeIds,r=l(e.featureIds)?e.featureIds.map(s=>s.propertyTableId):[],o=new Set;function a(s,c){for(let u of s){let d=c[u].class.properties;Object.keys(d).forEach(p=>o.add(p))}}return a(n,t.propertyTextures),a(i,t.propertyAttributes),a(r,t.propertyTables),o}function obe(e,t){for(let n in e)if(e.hasOwnProperty(n)&&!t.has(n))return Is._oneTimeWarning("CustomShaderPipelineStage.checkMetadataCompatibility",`A custom shader uses metadata property "${n}" which is not present for all primitives in the tileset. Disabling the custom shader for these primitives.`),!1;return!0}var RU=Is;var LD={name:"DequantizationPipelineStage",FUNCTION_ID_DEQUANTIZATION_STAGE_VS:"dequantizationStage",FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS:"void dequantizationStage(inout ProcessedAttributes attributes)"};LD.process=function(e,t,n){let i=e.shaderBuilder,r=e.model,o=l(r.classificationType);i.addDefine("USE_DEQUANTIZATION",void 0,he.VERTEX),i.addFunction(LD.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,LD.FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS,he.VERTEX);let a=t.attributes;for(let s=0;s<a.length;s++){let c=a[s],u=c.quantization;if(!l(u))continue;let f=c.semantic===ot.POSITION,d=c.semantic===ot.TEXCOORD;if(o&&!f&&!d)continue;let p=_t.getAttributeInfo(c);xst(i,p),bst(e,p)}};function bst(e,t){let n=e.shaderBuilder,i=e.uniformMap,r=t.variableName,o=t.attribute.quantization;if(o.octEncoded){let a=`model_normalizationRange_${r}`;n.addUniform("float",a,he.VERTEX),i[a]=function(){return o.normalizationRange}}else{let a=`model_quantizedVolumeOffset_${r}`,s=`model_quantizedVolumeStepSize_${r}`,c=t.glslType;n.addUniform(c,a,he.VERTEX),n.addUniform(c,s,he.VERTEX);let u=o.quantizedVolumeOffset,f=o.quantizedVolumeStepSize;/^color_\d+$/.test(r)&&(u=abe(u,0),f=abe(f,1)),i[a]=function(){return u},i[s]=function(){return f}}}function abe(e,t){return e instanceof ae?e:new ae(e.x,e.y,e.z,t)}function xst(e,t){let n=t.variableName,i=t.attribute.quantization,r;i.octEncoded?r=Tst(n,i):r=Cst(n),e.addFunctionLines(LD.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,[r])}function Tst(e,t){let n=`attributes.${e}`,i=`a_quantized_${e}`,r=`model_normalizationRange_${e}`,o=t.octEncodedZXY?".zxy":".xyz";return`${n} = czm_octDecode(${i}, ${r})${o};`}function Cst(e){let t=`attributes.${e}`,n=`a_quantized_${e}`,i=`model_quantizedVolumeOffset_${e}`,r=`model_quantizedVolumeStepSize_${e}`;return`${t} = ${i} + ${n} * ${r};`}var OU=LD;var MU=`void edgeDetectionStage(inout vec4 color, inout FeatureIds featureIds) {
|
|
if (u_isEdgePass) {
|
|
return;
|
|
}
|
|
|
|
vec2 screenCoord = gl_FragCoord.xy / czm_viewport.zw;
|
|
|
|
vec4 edgeColor = texture(czm_edgeColorTexture, screenCoord);
|
|
vec4 edgeId = texture(czm_edgeIdTexture, screenCoord);
|
|
|
|
// Packed window-space depth from edge pass (0..1)
|
|
float edgeDepthWin = czm_unpackDepth(texture(czm_edgeDepthTexture, screenCoord));
|
|
|
|
// Near / far for current frustum
|
|
float n = czm_currentFrustum.x;
|
|
float f = czm_currentFrustum.y;
|
|
|
|
// geometry depth in eye coordinate
|
|
vec4 geomEC = czm_windowToEyeCoordinates(gl_FragCoord);
|
|
float geomDepthLinear = -geomEC.z;
|
|
|
|
// Convert edge depth to linear depth
|
|
float z_ndc_edge = edgeDepthWin * 2.0 - 1.0;
|
|
float edgeDepthLinear = (2.0 * n * f) / (f + n - z_ndc_edge * (f - n));
|
|
|
|
float d = abs(edgeDepthLinear - geomDepthLinear);
|
|
|
|
// Adaptive epsilon using linear depth fwidth for robustness
|
|
float pixelStepLinear = fwidth(geomDepthLinear);
|
|
float rel = geomDepthLinear * 0.0005;
|
|
float eps = max(n * 1e-4, max(pixelStepLinear * 1.5, rel));
|
|
|
|
// If Edge isn't behind any geometry and the pixel has edge data
|
|
if (d < eps && edgeId.r > 0.0) {
|
|
#ifdef HAS_EDGE_FEATURE_ID
|
|
float edgeFeatureId = edgeId.g;
|
|
float currentFeatureId = float(featureIds.featureId_0);
|
|
#endif
|
|
float globeDepth = czm_unpackDepth(texture(czm_globeDepthTexture, screenCoord));
|
|
// Background / sky / globe: always show edge
|
|
bool isBackground = geomDepthLinear > globeDepth;
|
|
bool drawEdge = isBackground;
|
|
|
|
#ifdef HAS_EDGE_FEATURE_ID
|
|
bool hasEdgeFeature = edgeFeatureId > 0.0;
|
|
bool hasCurrentFeature = currentFeatureId > 0.0;
|
|
bool featuresMatch = edgeFeatureId == currentFeatureId;
|
|
|
|
drawEdge = drawEdge || !hasEdgeFeature || !hasCurrentFeature || featuresMatch;
|
|
#else
|
|
drawEdge = true;
|
|
#endif
|
|
|
|
if (drawEdge) {
|
|
color = edgeColor;
|
|
}
|
|
}
|
|
}
|
|
`;var sbe={name:"EdgeDetectionPipelineStage"};sbe.process=function(e){e.shaderBuilder.addFragmentLines([MU])};var LU=sbe;var NU=`// CESIUM_REDIRECTED_COLOR_OUTPUT flag is used to avoid color attachment conflicts
|
|
// when shaders are processed by different rendering pipelines (e.g., OIT).
|
|
// Only declare MRT outputs when not in a derived shader context.
|
|
#if defined(HAS_EDGE_VISIBILITY_MRT) && !defined(CESIUM_REDIRECTED_COLOR_OUTPUT)
|
|
layout(location = 1) out vec4 out_id; // edge id / metadata
|
|
layout(location = 2) out vec4 out_edgeDepth; // packed depth
|
|
#endif
|
|
|
|
void edgeVisibilityStage(inout vec4 color, inout FeatureIds featureIds)
|
|
{
|
|
#ifdef HAS_EDGE_VISIBILITY
|
|
|
|
if (!u_isEdgePass) {
|
|
return;
|
|
}
|
|
|
|
float edgeTypeInt = v_edgeType * 255.0;
|
|
|
|
if (edgeTypeInt < 0.5) {
|
|
discard;
|
|
}
|
|
|
|
if (edgeTypeInt > 0.5 && edgeTypeInt < 1.5) { // silhouette candidate
|
|
// Silhouette check done in vertex shader
|
|
// v_shouldDiscard will be > 0.5 if this edge should be discarded
|
|
if (v_shouldDiscard > 0.5) {
|
|
discard;
|
|
}
|
|
}
|
|
|
|
vec4 finalColor = color;
|
|
#ifdef HAS_EDGE_COLOR_ATTRIBUTE
|
|
if (v_edgeColor.a >= 0.0) {
|
|
finalColor = v_edgeColor;
|
|
}
|
|
#endif
|
|
|
|
#ifdef HAS_LINE_PATTERN
|
|
// Pattern is 16-bit, each bit represents visibility at that position
|
|
const float maskLength = 16.0;
|
|
|
|
// Get the relative position within the dash from 0 to 1
|
|
float dashPosition = fract(v_lineCoord / maskLength);
|
|
// Figure out the mask index
|
|
float maskIndex = floor(dashPosition * maskLength);
|
|
// Test the bit mask
|
|
float maskTest = floor(u_linePattern / pow(2.0, maskIndex));
|
|
|
|
// If bit is 0 (gap), discard the fragment (use < 1.0 for better numerical stability)
|
|
if (mod(maskTest, 2.0) < 1.0) {
|
|
discard;
|
|
}
|
|
#endif
|
|
color = finalColor;
|
|
|
|
#if defined(HAS_EDGE_VISIBILITY_MRT) && !defined(CESIUM_REDIRECTED_COLOR_OUTPUT)
|
|
// Write edge metadata
|
|
out_id = vec4(0.0);
|
|
out_id.r = edgeTypeInt; // Edge type (0-3)
|
|
#ifdef HAS_EDGE_FEATURE_ID
|
|
out_id.g = float(featureIds.featureId_0); // Feature ID if available
|
|
#else
|
|
out_id.g = 0.0;
|
|
#endif
|
|
// Pack depth into separate MRT attachment
|
|
out_edgeDepth = czm_packDepth(gl_FragCoord.z);
|
|
#endif
|
|
#endif
|
|
}`;var FU=`#ifdef HAS_EDGE_VISIBILITY
|
|
void edgeVisibilityStageVS() {
|
|
if (!u_isEdgePass) {
|
|
return;
|
|
}
|
|
|
|
v_edgeType = a_edgeType;
|
|
v_faceNormalAView = czm_normal * a_faceNormalA;
|
|
v_faceNormalBView = czm_normal * a_faceNormalB;
|
|
v_edgeOffset = a_edgeOffset;
|
|
|
|
// Silhouette detection: check both endpoints of the edge
|
|
v_shouldDiscard = 0.0;
|
|
float edgeTypeInt = a_edgeType * 255.0;
|
|
if (edgeTypeInt > 0.5 && edgeTypeInt < 1.5) {
|
|
vec3 normalA = normalize(v_faceNormalAView);
|
|
vec3 normalB = normalize(v_faceNormalBView);
|
|
const float perpTol = 2.5e-4;
|
|
|
|
// Check at current vertex (first endpoint)
|
|
vec4 currentPosEC = czm_modelView * vec4(v_positionMC, 1.0);
|
|
vec3 toEye1 = normalize(-currentPosEC.xyz);
|
|
float dotA1 = dot(normalA, toEye1);
|
|
float dotB1 = dot(normalB, toEye1);
|
|
|
|
// Check at other vertex (second endpoint)
|
|
vec4 otherPosEC = czm_modelView * vec4(a_edgeOtherPos, 1.0);
|
|
vec3 toEye2 = normalize(-otherPosEC.xyz);
|
|
float dotA2 = dot(normalA, toEye2);
|
|
float dotB2 = dot(normalB, toEye2);
|
|
|
|
// Discard if EITHER endpoint is non-silhouette
|
|
if (dotA1 * dotB1 > perpTol || dotA2 * dotB2 > perpTol) {
|
|
v_shouldDiscard = 1.0;
|
|
}
|
|
}
|
|
|
|
#ifdef HAS_EDGE_FEATURE_ID
|
|
v_featureId_0 = a_edgeFeatureId;
|
|
#endif
|
|
|
|
#ifdef HAS_EDGE_COLOR_ATTRIBUTE
|
|
v_edgeColor = a_edgeColor;
|
|
#endif
|
|
|
|
#ifdef HAS_LINE_PATTERN
|
|
#ifdef HAS_EDGE_CUMULATIVE_DISTANCE
|
|
v_lineCoord = a_edgeCumulativeDistance * u_pixelsPerWorld;
|
|
#else
|
|
vec4 currentClip = czm_modelViewProjection * vec4(v_positionMC, 1.0);
|
|
vec2 currentScreen = ((currentClip.xy / currentClip.w) * 0.5 + 0.5) * czm_viewport.zw;
|
|
|
|
vec4 otherClip = czm_modelViewProjection * vec4(a_edgeOtherPos, 1.0);
|
|
vec2 otherScreen = ((otherClip.xy / otherClip.w) * 0.5 + 0.5) * czm_viewport.zw;
|
|
vec2 windowDir = otherScreen - currentScreen;
|
|
|
|
const float textureCoordinateBase = 8192.0;
|
|
if (abs(windowDir.x) > abs(windowDir.y)) {
|
|
v_lineCoord = textureCoordinateBase + currentScreen.x;
|
|
} else {
|
|
v_lineCoord = textureCoordinateBase + currentScreen.y;
|
|
}
|
|
#endif
|
|
#endif
|
|
|
|
// Expand vertex to form quad
|
|
vec4 posClip = gl_Position;
|
|
|
|
if (length(a_edgeOtherPos) > 0.0 && abs(a_edgeOffset) > 0.0) {
|
|
vec4 currentClip = posClip;
|
|
vec4 otherClip = czm_modelViewProjection * vec4(a_edgeOtherPos, 1.0);
|
|
|
|
vec2 currentNDC = currentClip.xy / currentClip.w;
|
|
vec2 otherNDC = otherClip.xy / otherClip.w;
|
|
|
|
vec2 edgeDirNDC = otherNDC - currentNDC;
|
|
|
|
// Ensure consistent edge direction
|
|
if (edgeDirNDC.x < 0.0 || (abs(edgeDirNDC.x) < 0.001 && edgeDirNDC.y < 0.0)) {
|
|
edgeDirNDC = -edgeDirNDC;
|
|
}
|
|
|
|
edgeDirNDC = normalize(edgeDirNDC);
|
|
vec2 perpNDC = vec2(-edgeDirNDC.y, edgeDirNDC.x);
|
|
|
|
// Convert line width from pixels to clip space
|
|
float lineWidthPixels = u_lineWidth;
|
|
vec2 viewportSize = czm_viewport.zw;
|
|
vec2 clipPerPixel = (2.0 / viewportSize) * currentClip.w;
|
|
vec2 offsetClip = perpNDC * lineWidthPixels * clipPerPixel * 0.5 * a_edgeOffset;
|
|
|
|
posClip.xy += offsetClip;
|
|
}
|
|
|
|
gl_Position = posClip;
|
|
}
|
|
#endif
|
|
`;var XJ=class e{static readAttributeAsTypedArray(t){let n=e.readAttributeAsRawCompactTypedArray(t),i=t.normalized,r=t.quantization;if(!l(r)&&!i)return n;let o=t.type,a=t.count,s=n;return i&&(s=an.dequantize(n,t.componentDatatype,o,a)),l(r)?e.dequantize(s,a,o,r):s}static readAttributeAsRawCompactTypedArray(t){let n=t.type,i=t.count,r=Vt.getNumberOfComponents(n),o=i*r,a=t.componentDatatype,s=t.quantization;l(s)&&(a=s.componentDatatype);let c=t.buffer,u=t.byteOffset,f=t.byteStride,d=Y.getSizeInBytes(a),p=r*d,g=!l(f)||f===p;if(l(t.typedArray))return t.typedArray;if(g){let E=Y.createTypedArray(a,o);return c.getBufferData(E,u),E}let y=new Uint8Array(c.sizeInBytes);c.getBufferData(y);let A=Y.createTypedArray(a,o),b=f??p,x=new DataView(y.buffer,y.byteOffset,y.byteLength),T=new Array(r),C=e.createComponentsReader(a);for(let E=0;E<i;++E){let w=u+E*b;C(x,w,r,T);for(let D=0;D<r;++D)A[E*r+D]=T[D]}return A}static dequantize(t,n,i,r){if(r.octEncoded){let s=e.octDecode(t,n,r.normalizationRange,void 0);return r.octEncodedZXY&&e.convertZxyToXyz(s,s),s}let o=r.quantizedVolumeStepSize,a=r.quantizedVolumeOffset;if(i===Vt.SCALAR)return e.dequantize1D(t,n,o,a,void 0);if(i===Vt.VEC2)return e.dequantize2D(t,n,o,a,void 0);if(i===Vt.VEC3)return e.dequantize3D(t,n,o,a,void 0);if(i===Vt.VEC4)return e.dequantize4D(t,n,o,a,void 0);throw new pe(`Element type for dequantization must be SCALAR, VEC2, VEC3, or VEC4, but is ${i}`)}static octDecode(t,n,i,r){l(r)||(r=new Float32Array(t.length));let o=new h;for(let a=0;a<n;a++)h.unpack(t,a*3,o),an.octDecodeInRange(o.x,o.y,i,o),h.pack(o,r,a*3);return r}static convertZxyToXyz(t,n,i){l(i)||(i=new Float32Array(t.length));let r=0;for(let o=0;o<n;o++,r+=3){let a=t[r+0],s=t[r+1],c=t[r+2];i[r+0]=s,i[r+1]=c,i[r+2]=a}return i}static dequantize1D(t,n,i,r,o){l(o)||(o=new Float32Array(t.length));for(let a=0;a<n;a++){let c=t[a]*i+r;o[a]=c}return o}static dequantize2D(t,n,i,r,o){l(o)||(o=new Float32Array(t.length));let a=new k;for(let s=0;s<n;s++)k.unpack(t,s*2,a),k.multiplyComponents(a,i,a),k.add(a,r,a),k.pack(a,o,s*2);return o}static dequantize3D(t,n,i,r,o){l(o)||(o=new Float32Array(t.length));let a=new h;for(let s=0;s<n;s++)h.unpack(t,s*3,a),h.multiplyComponents(a,i,a),h.add(a,r,a),h.pack(a,o,s*3);return o}static dequantize4D(t,n,i,r,o){l(o)||(o=new Float32Array(t.length));let a=new ae;for(let s=0;s<n;s++)ae.unpack(t,s*4,a),ae.multiplyComponents(a,i,a),ae.add(a,r,a),ae.pack(a,o,s*4);return o}static createComponentsReader(t){let n=e.createComponentReader(t),i=Y.getSizeInBytes(t);return function(r,o,a,s){let c=o;for(let u=0;u<a;++u)s[u]=n(r,c),c+=i}}static createComponentReader(t){switch(t){case Y.BYTE:return function(n,i){return n.getInt8(i)};case Y.UNSIGNED_BYTE:return function(n,i){return n.getUint8(i)};case Y.SHORT:return function(n,i){return n.getInt16(i,!0)};case Y.UNSIGNED_SHORT:return function(n,i){return n.getUint16(i,!0)};case Y.INT:return function(n,i){return n.getInt32(i,!0)};case Y.UNSIGNED_INT:return function(n,i){return n.getUint32(i,!0)};case Y.FLOAT:return function(n,i){return n.getFloat32(i,!0)};case Y.DOUBLE:return function(n,i){return n.getFloat64(i,!0)}}throw new pe(`The componentType must be a valid ComponentDatatype, but is ${t}`)}static transform3D(t,n,i){l(i)||(i=new Float32Array(t.length));let r=new h,o=t.length/3;for(let a=0;a<o;a++)h.unpack(t,a*3,r),O.multiplyByPoint(n,r,r),h.pack(r,i,a*3);return i}static readImplicitRangeAsTypedArray(t,n){let i=n.attributes[0]?.count??0,r=t.offset,o=t.repeat,a=new Float32Array(i);if(l(o))for(let s=0;s<i;s++)a[s]=r+Math.floor(s/o);else a.fill(r);return a}static readIndicesAsTypedArray(t){let n=t.typedArray;if(l(n))return n;let i=t.buffer,r=t.count,o=t.indexDatatype,a=e.createIndexTypedArray(o,r);return i.getBufferData(a),a}static readIndicesAsTriangleIndicesTypedArray(t,n){let i=e.readIndicesAsTypedArray(t);if(n===Re.TRIANGLES)return i;if(n===Re.TRIANGLE_STRIP)return e.convertTriangleStripToTriangleIndices(i);if(n===Re.TRIANGLE_FAN)return e.convertTriangleFanToTriangleIndices(i);throw new pe(`The primitiveType must be TRIANGLES (${Re.TRIANGLES}, TRIANGLE_STRIP (${Re.TRIANGLE_STRIP}, or TRIANGLE_FAN (${Re.TRIANGLE_FAN}, but is ${n}`)}static convertTriangleStripToTriangleIndices(t){let n=t.constructor((t.length-2)*3);for(let i=0;i<t.length-2;i++)i%2===1?(n[i*3+0]=t[i+0],n[i*3+1]=t[i+2],n[i*3+2]=t[i+1]):(n[i*3+0]=t[i+0],n[i*3+1]=t[i+1],n[i*3+2]=t[i+2]);return n}static convertTriangleFanToTriangleIndices(t){let n=t.constructor((t.length-2)*3);for(let i=0;i<t.length-2;i++)n[i*3+0]=t[i+0],n[i*3+1]=t[i+1],n[i*3+2]=t[i+2];return n}static createIndexTypedArray(t,n){switch(t){case Ve.UNSIGNED_BYTE:return new Uint8Array(n);case Ve.UNSIGNED_SHORT:return new Uint16Array(n);case Ve.UNSIGNED_INT:return new Uint32Array(n)}throw new pe(`The indexDatatype must be UNSIGNED_BYTE (${Ve.UNSIGNED_BYTE}, UNSIGNED_SHORT (${Ve.UNSIGNED_SHORT}, or UNSIGNED_INT (${Ve.UNSIGNED_INT}, but is ${t}`)}static forEachPrimitive(t,n,i){let r=n?.mapProjection,o=n?.instanceFeatureIdLabel,a=t.sceneGraph;if(!l(a))return;let s={nodeComputedTransform:new O,modelMatrix:new O,computedModelMatrix:new O},c=a._runtimeNodes,u=c.length;for(let f=0;f<u;f++){let d=c[f],p=e.computeNodeTransforms(d,a,t,s),g=p.computedModelMatrix;l(r)&&(g=mt.basisTo2D(r,g,g));let m=e.computeInstanceTransforms(d,g,p.nodeComputedTransform,p.modelMatrix),y=l(o)?e.computeInstanceFeatureIds(d,o):void 0,A=[];for(let x=0;x<m.length;x++)A.push({transform:m[x],featureId:l(y)?y[x]:void 0});let b=d.runtimePrimitives.length;for(let x=0;x<b;x++){let T=d.runtimePrimitives[x];i(T,T.primitive,A,g)}}}static computeNodeTransforms(t,n,i,r){let o=t.node,a=O.clone(t.computedTransform,r.nodeComputedTransform),s=O.clone(n.computedModelMatrix,r.modelMatrix),c=o.instances;l(c)&&c.transformInWorldSpace&&(s=O.multiplyTransformation(i.modelMatrix,n.components.transform,s),a=O.multiplyTransformation(n.axisCorrectionMatrix,t.computedTransform,a));let u=O.multiplyTransformation(s,a,r.computedModelMatrix);return r.computedModelMatrix=u,r.nodeComputedTransform=a,r.modelMatrix=s,r}static computeInstanceTransforms(t,n,i,r){let o=[],s=t.node.instances;if(l(s)){let c=s.attributes[0].count,u=s.attributes[0].componentDatatype,f=12,d=t.transformsTypedArray;if(!l(d)){let p=t.instancingTransformsBuffer;l(p)&&(d=Y.createTypedArray(u,c*f),p.getBufferData(d))}l(d)?e.computeInstanceTransformsFromTypedArray(d,c,o):e.computeInstanceTransformsFromAttributes(s,c,o);for(let p=0;p<o.length;p++){let g=o[p];s.transformInWorldSpace?(O.multiplyTransformation(g,i,g),O.multiplyTransformation(r,g,g)):O.multiplyTransformation(n,g,g)}}return o.length===0&&o.push(n),o}static computeInstanceFeatureIds(t,n){let r=t.node.instances;if(!l(r))return;let o=_t.getFeatureIdsByLabel(r.featureIds,n);if(!l(o))return;let a;if("setIndex"in o){let c=_t.getAttributeBySemantic(r,ot.FEATURE_ID,o.setIndex);l(c)&&(a=e.readAttributeAsTypedArray(c))}if("offset"in o&&(a=e.readImplicitRangeAsTypedArray(o,r)),!l(a))return;let s=new Array(a.length);for(let c=0;c<a.length;c++)s[c]=a[c];return s}static computeInstanceTransformsFromTypedArray(t,n,i){for(let o=0;o<n;o++){let a=o*12,s=new O(t[a],t[a+1],t[a+2],t[a+3],t[a+4],t[a+5],t[a+6],t[a+7],t[a+8],t[a+9],t[a+10],t[a+11],0,0,0,1);i.push(s)}}static computeInstanceTransformsFromAttributes(t,n,i){let r=_t.getAttributeBySemantic(t,Do.TRANSLATION),o=_t.getAttributeBySemantic(t,Do.ROTATION),a=_t.getAttributeBySemantic(t,Do.SCALE),s=l(r),c=l(o),u=l(a);if(!s&&!c&&!u)return;let f,d,p;s&&(f=e.readAttributeAsRawCompactTypedArray(r)),c&&(d=e.readAttributeAsRawCompactTypedArray(o)),u&&(p=e.readAttributeAsRawCompactTypedArray(a));for(let g=0;g<n;g++){let m=s?new h(f[g*3],f[g*3+1],f[g*3+2]):h.ZERO,y=c?new Fe(d[g*4],d[g*4+1],d[g*4+2],d[g*4+3]):Fe.IDENTITY,A=u?new h(p[g*3],p[g*3+1],p[g*3+2]):h.ONE,b=O.fromTranslationQuaternionRotationScale(m,y,A,new O);i.push(b)}}},Ps=XJ;var IE=Object.freeze({HIDDEN:0,SILHOUETTE:1,HARD:2,REPEATED_HARD:3}),cbe={name:"EdgeVisibilityPipelineStage"};cbe.process=function(e,t,n){if(!l(t.edgeVisibility))return;n.edgeVisibilityRequested=!0;let i=e.shaderBuilder;i.addDefine("HAS_EDGE_VISIBILITY",void 0,he.BOTH),i.addDefine("HAS_EDGE_VISIBILITY_MRT",void 0,he.FRAGMENT),i.addFragmentLines(NU),i.addVertexLines(FU),i.addUniform("bool","u_isEdgePass",he.BOTH);let r=t.material,o=l(r)?r.lineStyle:void 0;(!l(o)||!l(o.width))&&i.addUniform("float","u_lineWidth",he.VERTEX);let a=i.addAttribute("float","a_edgeType");i.addVarying("float","v_edgeType","flat");let s=i.addAttribute("float","a_edgeFeatureId"),c=i.addAttribute("vec3","a_faceNormalA"),u=i.addAttribute("vec3","a_faceNormalB");i.addVarying("vec3","v_faceNormalAView","flat"),i.addVarying("vec3","v_faceNormalBView","flat"),i.addVarying("float","v_shouldDiscard","flat");let f=i.addAttribute("vec3","a_edgeOtherPos"),d=i.addAttribute("float","a_edgeOffset");i.addVarying("float","v_edgeOffset");let p=Est(t);if(!l(p)||!l(p.edgeIndices)||p.edgeIndices.length===0)return;let g=e.runtimePrimitive.primitive,m=Sst(g),A=p.edgeData.some(function(R){return l(R.color)})||l(m),b;A&&(b=i.addAttribute("vec4","a_edgeColor"),i.addVarying("vec4","v_edgeColor","flat"),i.addDefine("HAS_EDGE_COLOR_ATTRIBUTE",void 0,he.BOTH));let x,T,C=_t.getAttributeBySemantic(t,"BENTLEY_materials_line_style:CUMULATIVE_DISTANCE");l(C)&&(x=C,T=i.addAttribute("float","a_edgeCumulativeDistance"),i.addDefine("HAS_EDGE_CUMULATIVE_DISTANCE",void 0,he.VERTEX));let E=vst(p.edgeIndices,p.edgeData,t.edgeVisibility),w=wst(p.edgeIndices,p.edgeData,e,n.context,a,c,u,s,b,f,d,m,t.edgeVisibility,E,x,T);if(!l(w))return;w.hasEdgeFeatureIds&&i.addDefine("HAS_EDGE_FEATURE_ID",void 0,he.BOTH),e.uniformMap.u_isEdgePass=function(){return!1},l(e.uniformMap.u_lineWidth)||(e.uniformMap.u_lineWidth=function(){return 1}),l(x)&&(l(e.uniformMap.u_pixelsPerWorld)||(e.uniformMap.u_pixelsPerWorld=function(){return 1}));let D=l(o)&&l(o.width)?o.width*n.pixelRatio:void 0;e.edgeGeometry={vertexArray:w.vertexArray,indexCount:w.indexCount,primitiveType:Re.TRIANGLES,pass:Pe.CESIUM_3D_TILE_EDGES,lineWidth:D}};function vst(e,t,n){let i=e.length/2,r=new Float32Array(i*6),o=n.silhouetteNormals;if(!l(o))return r;let a=o.length/3,s=new Float32Array(o.length),c=new h;for(let u=0;u<a;u++)c.x=o[u*3],c.y=o[u*3+1],c.z=o[u*3+2],h.magnitudeSquared(c)>0?h.normalize(c,c):(c.x=0,c.y=0,c.z=1),s[u*3]=c.x,s[u*3+1]=c.y,s[u*3+2]=c.z;for(let u=0;u<i;u++){let{edgeType:f,silhouetteEdgeIndex:d}=t[u];if(f!==IE.SILHOUETTE||d<0)continue;let p=d*2;if((p+1)*3+2>=s.length)continue;let g=p*3,m=(p+1)*3,y=u*6;r[y]=s[g],r[y+1]=s[g+1],r[y+2]=s[g+2],r[y+3]=s[m],r[y+4]=s[m+1],r[y+5]=s[m+2]}return r}function Est(e){let t=e.edgeVisibility;if(!l(t))return[];let n=t.visibility,i=e.indices,r=t.lineStrings,o=e.attributes,a=l(o)&&o.length>0?o[0].count:0,s=l(n)&&l(i)&&l(i.typedArray)&&i.typedArray.length>0,c=l(r)&&r.length>0;if(!s&&!c)return[];let u=s?i.typedArray:void 0,f=[],d=[],p=new Set,g=0,m=t.materialColor;if(s){let y=0,A=u.length,b=n;for(let x=0;x+2<A;x+=3){let T=u[x],C=u[x+1],E=u[x+2];for(let w=0;w<3;w++){let D,R;w===0?(D=T,R=C):w===1?(D=C,R=E):(D=E,R=T);let M=Math.floor(y/4),N=y%4*2;if(y++,M>=b.length)break;let v=b[M]>>N&3;if(v===IE.HIDDEN)continue;let S=Math.min(D,R),P=Math.max(D,R),L=`${S},${P}`;if(p.has(L))continue;p.add(L),f.push(D,R);let F=-1;v===IE.SILHOUETTE&&(F=g,g++),d.push({edgeType:v===IE.REPEATED_HARD?IE.HARD:v,silhouetteEdgeIndex:F,color:m})}}}if(c)for(let y=0;y<r.length;y++){let A=r[y];if(!l(A)||!l(A.indices))continue;let b=A.indices;if(!l(b)||b.length<2)continue;let x=A.restartIndex,T=l(A.materialColor)?A.materialColor:m,C;for(let E=0;E<b.length;E++){let w=b[E];if(l(x)&&w===x){C=void 0;continue}if(!l(C)){C=w;continue}let D=C,R=w;if(C=w,D===R||a>0&&(D<0||D>=a||R<0||R>=a))continue;let M=Math.min(D,R),N=Math.max(D,R),_=`${M},${N}`;p.has(_)||(p.add(_),f.push(D,R),d.push({edgeType:IE.HARD,silhouetteEdgeIndex:-1,color:l(T)?T:void 0}))}}return{edgeIndices:f,edgeData:d,silhouetteEdgeCount:g}}function Sst(e){if(!l(e))return;let t=_t.getAttributeBySemantic(e,ot.COLOR);if(!l(t))return;let n=Vt.getNumberOfComponents(t.type);if(n!==3&&n!==4)return;let i=t.typedArray;if(l(i)||(i=Ps.readAttributeAsTypedArray(t)),!l(i))return;let r=t.count;if(!l(r)||r===0||i.length<r*n)return;let o=i instanceof Float32Array||i instanceof Float64Array,a=i instanceof Uint8Array,s=i instanceof Uint16Array;if(!o&&!a&&!s)return;let c=new Float32Array(r*4),u=function(f){let d;return o?d=f:a?d=f/255:s&&(d=f/65535),Math.min(Math.max(d,0),1)};for(let f=0;f<r;f++){let d=f*n,p=f*4;c[p]=u(i[d]),c[p+1]=u(i[d+1]),c[p+2]=u(i[d+2]),n===4?c[p+3]=u(i[d+3]):c[p+3]=1}return{colors:c,count:r}}function wst(e,t,n,i,r,o,a,s,c,u,f,d,p,g,m,y){if(!l(e)||e.length===0)return;let A=t.length,x=A*4,T=0,C=_t.getAttributeBySemantic(n.runtimePrimitive.primitive,ot.POSITION),E=l(C.typedArray)?C.typedArray:Ps.readAttributeAsTypedArray(C),w=new Float32Array(x*3),D=new Float32Array(x),R=new Float32Array(x*3),M=new Float32Array(x*3),N=new Float32Array(x*3),_=new Float32Array(x),v=l(m),S=v?new Float32Array(x):void 0,P;v&&(P=l(m.typedArray)?m.typedArray:Ps.readAttributeAsTypedArray(m));let L=l(c),F=L?new Float32Array(x*4):void 0,V=l(d)?d.colors:void 0,z=l(d)?d.count:0;function j(Ke){if(!L)return;let we=Ke*4;F[we]=0,F[we+1]=0,F[we+2]=0,F[we+3]=-1}function B(Ke,we){if(!L)return;let We=Ke*4,Ct=l(we.x)?we.x:we[0],ct=l(we.y)?we.y:we[1],dn=l(we.z)?we.z:we[2],Ht=l(we.w)?we.w:l(we[3])?we[3]:1;F[We]=Ct,F[We+1]=ct,F[We+2]=dn,F[We+3]=Ht}function G(Ke,we){if(!L)return;if(we>=z){j(Ke);return}let We=we*4,Ct=Ke*4;F[Ct]=V[We],F[Ct+1]=V[We+1],F[Ct+2]=V[We+2],F[Ct+3]=V[We+3]}for(let Ke=0;Ke<A;Ke++){let we=e[Ke*2],We=e[Ke*2+1],ct=t[Ke].edgeType/255,dn=E[we*3],Ht=E[we*3+1],bt=E[we*3+2],Dt=E[We*3],In=E[We*3+1],rt=E[We*3+2],dt=Ke*4;w[dt*3]=dn,w[dt*3+1]=Ht,w[dt*3+2]=bt,N[dt*3]=Dt,N[dt*3+1]=In,N[dt*3+2]=rt,_[dt]=-1,D[dt]=ct,w[(dt+1)*3]=dn,w[(dt+1)*3+1]=Ht,w[(dt+1)*3+2]=bt,N[(dt+1)*3]=Dt,N[(dt+1)*3+1]=In,N[(dt+1)*3+2]=rt,_[dt+1]=1,D[dt+1]=ct,w[(dt+2)*3]=Dt,w[(dt+2)*3+1]=In,w[(dt+2)*3+2]=rt,N[(dt+2)*3]=dn,N[(dt+2)*3+1]=Ht,N[(dt+2)*3+2]=bt,_[dt+2]=1,D[dt+2]=ct,w[(dt+3)*3]=Dt,w[(dt+3)*3+1]=In,w[(dt+3)*3+2]=rt,N[(dt+3)*3]=dn,N[(dt+3)*3+1]=Ht,N[(dt+3)*3+2]=bt,_[dt+3]=-1,D[dt+3]=ct;let vi=t[Ke].color;if(l(vi))for(let vn=0;vn<4;vn++)B(dt+vn,vi);else if(l(V))for(let vn=0;vn<4;vn++)G(dt+vn,we);else for(let vn=0;vn<4;vn++)j(dt+vn);if(v){let vn=P[we],ti=P[We];S[dt]=vn,S[dt+1]=vn,S[dt+2]=ti,S[dt+3]=ti}let wn=Ke*6,Mi=g[wn],lr=g[wn+1],Li=g[wn+2],Wi=g[wn+3],ri=g[wn+4],ei=g[wn+5];for(let vn=0;vn<4;vn++)R[(dt+vn)*3]=Mi,R[(dt+vn)*3+1]=lr,R[(dt+vn)*3+2]=Li,M[(dt+vn)*3]=Wi,M[(dt+vn)*3+1]=ri,M[(dt+vn)*3+2]=ei}let W=Ze.createVertexBuffer({context:i,typedArray:w,usage:Oe.STATIC_DRAW}),Q=Ze.createVertexBuffer({context:i,typedArray:D,usage:Oe.STATIC_DRAW}),q=Ze.createVertexBuffer({context:i,typedArray:R,usage:Oe.STATIC_DRAW}),J=Ze.createVertexBuffer({context:i,typedArray:M,usage:Oe.STATIC_DRAW}),Z=Ze.createVertexBuffer({context:i,typedArray:N,usage:Oe.STATIC_DRAW}),ce=Ze.createVertexBuffer({context:i,typedArray:_,usage:Oe.STATIC_DRAW}),Ae=L?Ze.createVertexBuffer({context:i,typedArray:F,usage:Oe.STATIC_DRAW}):void 0,le=v?Ze.createVertexBuffer({context:i,typedArray:S,usage:Oe.STATIC_DRAW}):void 0,ye=A*2*3,ve=x>65534,Ie=ve?new Uint32Array(ye):new Uint16Array(ye);for(let Ke=0;Ke<A;Ke++){let we=Ke*4,We=Ke*6;Ie[We]=we,Ie[We+1]=we+1,Ie[We+2]=we+2,Ie[We+3]=we,Ie[We+4]=we+2,Ie[We+5]=we+3}let Le=Ze.createIndexBuffer({context:i,typedArray:Ie,usage:Oe.STATIC_DRAW,indexDatatype:ve?Ve.UNSIGNED_INT:Ve.UNSIGNED_SHORT}),$e=[{index:T,vertexBuffer:W,componentsPerAttribute:3,componentDatatype:Y.FLOAT,normalize:!1},{index:r,vertexBuffer:Q,componentsPerAttribute:1,componentDatatype:Y.FLOAT,normalize:!1},{index:o,vertexBuffer:q,componentsPerAttribute:3,componentDatatype:Y.FLOAT,normalize:!1},{index:a,vertexBuffer:J,componentsPerAttribute:3,componentDatatype:Y.FLOAT,normalize:!1},{index:u,vertexBuffer:Z,componentsPerAttribute:3,componentDatatype:Y.FLOAT,normalize:!1},{index:f,vertexBuffer:ce,componentsPerAttribute:1,componentDatatype:Y.FLOAT,normalize:!1}];L&&$e.push({index:c,vertexBuffer:Ae,componentsPerAttribute:4,componentDatatype:Y.FLOAT,normalize:!1}),v&&$e.push({index:y,vertexBuffer:le,componentsPerAttribute:1,componentDatatype:Y.FLOAT,normalize:!1});let Ye=n.runtimePrimitive.primitive;if(l(Ye.featureIds)&&Ye.featureIds.length>0){let Ke=Ye.featureIds[0];if(l(Ke.setIndex)){let we=Ye.attributes.find(We=>We.semantic===ot.FEATURE_ID&&We.setIndex===Ke.setIndex);if(l(we)){let We=l(we.typedArray)?we.typedArray:Ps.readAttributeAsTypedArray(we),Ct=new Float32Array(x);for(let dn=0;dn<A;dn++){let Ht=e[dn*2],bt=Ht<We.length?We[Ht]:0;for(let Dt=0;Dt<4;Dt++)Ct[dn*4+Dt]=bt}let ct=Ze.createVertexBuffer({context:i,typedArray:Ct,usage:Oe.STATIC_DRAW});$e.push({index:s,vertexBuffer:ct,componentsPerAttribute:1,componentDatatype:Y.FLOAT,normalize:!1})}}}return{vertexArray:new Vn({context:i,attributes:$e,indexBuffer:Le}),indexCount:ye,hasEdgeFeatureIds:l(Ye.featureIds)&&Ye.featureIds.length>0}}var BU=cbe;var kU=`void geometryStage(out ProcessedAttributes attributes)
|
|
{
|
|
attributes.positionMC = v_positionMC;
|
|
attributes.positionEC = v_positionEC;
|
|
|
|
#if defined(COMPUTE_POSITION_WC_CUSTOM_SHADER) || defined(COMPUTE_POSITION_WC_STYLE) || defined(COMPUTE_POSITION_WC_ATMOSPHERE)
|
|
attributes.positionWC = v_positionWC;
|
|
#endif
|
|
|
|
#ifdef HAS_NORMALS
|
|
// renormalize after interpolation
|
|
attributes.normalEC = normalize(v_normalEC);
|
|
#endif
|
|
|
|
#ifdef HAS_TANGENTS
|
|
attributes.tangentEC = normalize(v_tangentEC);
|
|
#endif
|
|
|
|
#ifdef HAS_BITANGENTS
|
|
attributes.bitangentEC = normalize(v_bitangentEC);
|
|
#endif
|
|
|
|
// Everything else is dynamically generated in GeometryPipelineStage
|
|
setDynamicVaryings(attributes);
|
|
}
|
|
`;var zU=`vec4 geometryStage(inout ProcessedAttributes attributes, mat4 modelView, mat3 normal)
|
|
{
|
|
vec4 computedPosition;
|
|
|
|
// Compute positions in different coordinate systems
|
|
vec3 positionMC = attributes.positionMC;
|
|
v_positionMC = positionMC;
|
|
v_positionEC = (modelView * vec4(positionMC, 1.0)).xyz;
|
|
|
|
#if defined(USE_2D_POSITIONS) || defined(USE_2D_INSTANCING)
|
|
vec3 position2D = attributes.position2D;
|
|
vec3 positionEC = (u_modelView2D * vec4(position2D, 1.0)).xyz;
|
|
computedPosition = czm_projection * vec4(positionEC, 1.0);
|
|
#else
|
|
computedPosition = czm_projection * vec4(v_positionEC, 1.0);
|
|
#endif
|
|
|
|
// Sometimes the custom shader and/or style needs this
|
|
#if defined(COMPUTE_POSITION_WC_CUSTOM_SHADER) || defined(COMPUTE_POSITION_WC_STYLE) || defined(COMPUTE_POSITION_WC_ATMOSPHERE) || defined(ENABLE_CLIPPING_POLYGONS)
|
|
// Note that this is a 32-bit position which may result in jitter on small
|
|
// scales.
|
|
v_positionWC = (czm_model * vec4(positionMC, 1.0)).xyz;
|
|
#endif
|
|
|
|
#ifdef HAS_NORMALS
|
|
v_normalEC = normalize(normal * attributes.normalMC);
|
|
#endif
|
|
|
|
#ifdef HAS_TANGENTS
|
|
v_tangentEC = normalize(normal * attributes.tangentMC);
|
|
#endif
|
|
|
|
#ifdef HAS_BITANGENTS
|
|
v_bitangentEC = normalize(normal * attributes.bitangentMC);
|
|
#endif
|
|
|
|
// All other varyings need to be dynamically generated in
|
|
// GeometryPipelineStage
|
|
setDynamicVaryings(attributes);
|
|
|
|
return computedPosition;
|
|
}
|
|
`;var ND=`vec2 computeSt(float featureId)
|
|
{
|
|
float stepX = model_textureStep.x;
|
|
float centerX = model_textureStep.y;
|
|
|
|
#ifdef MULTILINE_BATCH_TEXTURE
|
|
float stepY = model_textureStep.z;
|
|
float centerY = model_textureStep.w;
|
|
|
|
float xId = mod(featureId, model_textureDimensions.x);
|
|
float yId = floor(featureId / model_textureDimensions.x);
|
|
|
|
return vec2(centerX + (xId * stepX), centerY + (yId * stepY));
|
|
#else
|
|
return vec2(centerX + (featureId * stepX), 0.5);
|
|
#endif
|
|
}
|
|
|
|
void selectedFeatureIdStage(out SelectedFeature feature, FeatureIds featureIds)
|
|
{
|
|
int featureId = featureIds.SELECTED_FEATURE_ID;
|
|
|
|
|
|
if (featureId < model_featuresLength)
|
|
{
|
|
vec2 featureSt = computeSt(float(featureId));
|
|
|
|
feature.id = featureId;
|
|
feature.st = featureSt;
|
|
feature.color = texture(model_batchTexture, featureSt);
|
|
}
|
|
// Floating point comparisons can be unreliable in GLSL, so we
|
|
// increment the feature ID to make sure it's always greater
|
|
// then the model_featuresLength - a condition we check for in the
|
|
// pick ID, to avoid sampling the pick texture if the feature ID is
|
|
// greater than the number of features.
|
|
else
|
|
{
|
|
feature.id = model_featuresLength + 1;
|
|
feature.st = vec2(0.0);
|
|
feature.color = vec4(1.0);
|
|
}
|
|
|
|
#ifdef HAS_NULL_FEATURE_ID
|
|
if (featureId == model_nullFeatureId) {
|
|
feature.id = featureId;
|
|
feature.st = vec2(0.0);
|
|
feature.color = vec4(1.0);
|
|
}
|
|
#endif
|
|
}
|
|
`;var FD={name:"SelectedFeatureIdPipelineStage",STRUCT_ID_SELECTED_FEATURE:"SelectedFeature",STRUCT_NAME_SELECTED_FEATURE:"SelectedFeature"};FD.process=function(e,t,n){let i=e.shaderBuilder;e.hasPropertyTable=!0;let r=e.model,o=e.runtimeNode.node,a=Ist(r,o,t),s=a.shaderDestination;i.addDefine("HAS_SELECTED_FEATURE_ID",void 0,s),i.addDefine("SELECTED_FEATURE_ID",a.variableName,s),i.addDefine(a.featureIdDefine,void 0,s),Pst(i);let c=a.featureIds.nullFeatureId,u=e.uniformMap;l(c)&&(i.addDefine("HAS_NULL_FEATURE_ID",void 0,s),i.addUniform("int","model_nullFeatureId",s),u.model_nullFeatureId=function(){return c}),a.shaderDestination===he.BOTH&&i.addVertexLines(ND),i.addFragmentLines(ND)};function lbe(e){return e instanceof Tn.FeatureIdTexture?"HAS_SELECTED_FEATURE_ID_TEXTURE":"HAS_SELECTED_FEATURE_ID_ATTRIBUTE"}function ube(e){return e instanceof Tn.FeatureIdTexture?he.FRAGMENT:he.BOTH}function Ist(e,t,n){let i,r;return l(t.instances)&&(r=_t.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),l(r))?(i=r.label??r.positionalLabel,{featureIds:r,variableName:i,shaderDestination:ube(r),featureIdDefine:lbe(r)}):(r=_t.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),i=r.label??r.positionalLabel,{featureIds:r,variableName:i,shaderDestination:ube(r),featureIdDefine:lbe(r)})}function Pst(e){e.addStructField(FD.STRUCT_ID_SELECTED_FEATURE,"int","id"),e.addStructField(FD.STRUCT_ID_SELECTED_FEATURE,"vec2","st"),e.addStructField(FD.STRUCT_ID_SELECTED_FEATURE,"vec4","color")}var ax=FD;var Ds={name:"GeometryPipelineStage",STRUCT_ID_PROCESSED_ATTRIBUTES_VS:"ProcessedAttributesVS",STRUCT_ID_PROCESSED_ATTRIBUTES_FS:"ProcessedAttributesFS",STRUCT_NAME_PROCESSED_ATTRIBUTES:"ProcessedAttributes",FUNCTION_ID_INITIALIZE_ATTRIBUTES:"initializeAttributes",FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES:"void initializeAttributes(out ProcessedAttributes attributes)",FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS:"setDynamicVaryingsVS",FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS:"setDynamicVaryingsFS",FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS:"void setDynamicVaryings(inout ProcessedAttributes attributes)"};Ds.process=function(e,t,n){let{shaderBuilder:i,model:r}=e;i.addStruct(Ds.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"ProcessedAttributes",he.VERTEX),i.addStruct(Ds.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"ProcessedAttributes",he.FRAGMENT),i.addStruct(ax.STRUCT_ID_SELECTED_FEATURE,ax.STRUCT_NAME_SELECTED_FEATURE,he.BOTH),i.addFunction(Ds.FUNCTION_ID_INITIALIZE_ATTRIBUTES,Ds.FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES,he.VERTEX),i.addVarying("vec3","v_positionWC"),i.addVarying("vec3","v_positionEC"),i.addStructField(Ds.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionWC"),i.addStructField(Ds.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionEC"),i.addFunction(Ds.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,Ds.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,he.VERTEX),i.addFunction(Ds.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,Ds.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,he.FRAGMENT),r.type===qo.TILE_PNTS&&i.addDefine("HAS_SRGB_COLOR",void 0,he.FRAGMENT);let o=n.mode!==re.SCENE3D&&!n.scene3DOnly&&r._projectTo2D,a=l(e.runtimeNode.node.instances),s=o&&!a,c=t.attributes.length;for(let u=0;u<c;u++){let f=t.attributes[u],d=Vt.getAttributeLocationCount(f.type),p=f.semantic===ot.POSITION,g;d>1?(g=e.attributeIndex,e.attributeIndex+=d):p&&!s?g=0:g=e.attributeIndex++;let m=!p&&t.primitiveType===Re.POINTS&&n.context.webgl2?"flat":void 0;Dst(e,f,g,d,o,a,m)}zst(i,t.attributes),t.primitiveType===Re.POINTS&&i.addDefine("PRIMITIVE_TYPE_POINTS"),i.addVertexLines(zU),i.addFragmentLines(kU)};function Dst(e,t,n,i,r,o,a){let s=e.shaderBuilder,c=_t.getAttributeInfo(t),u=r&&!o;i>1?Mst(e,t,n,i):Ost(e,t,n,u),Nst(s,c,u),Lst(s,c,a),l(t.semantic)&&Rst(s,t),Fst(s,c,r),Bst(s,c,u),kst(s,c)}function Rst(e,t){let{semantic:n,setIndex:i}=t;switch(n){case ot.NORMAL:e.addDefine("HAS_NORMALS");break;case ot.TANGENT:e.addDefine("HAS_TANGENTS");break;case ot.FEATURE_ID:e.addDefine(`HAS${n}_${i}`);break;case ot.TEXCOORD:case ot.COLOR:e.addDefine(`HAS_${n}_${i}`)}}function Ost(e,t,n,i){let{quantization:r,semantic:o,setIndex:a}=t,{type:s,componentDatatype:c}=l(r)?r:t;o===ot.FEATURE_ID&&a>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=a+1);let u=o===ot.POSITION,f=u?0:n,d=Vt.getNumberOfComponents(s),p={index:f,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,count:t.count,componentsPerAttribute:d,componentDatatype:c,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:d,componentDatatype:Y.FLOAT,offsetInBytes:0,strideInBytes:void 0,normalize:t.normalized};e.attributes.push(m)}function Mst(e,t,n,i){let{quantization:r,normalized:o}=t,{type:a,componentDatatype:s}=l(r)?r:t,u=Vt.getNumberOfComponents(a)/i,f=Y.getSizeInBytes(s),d=u*f,p=t.byteStride;for(let g=0;g<i;g++){let m=t.byteOffset+g*d,y={index:n+g,vertexBuffer:t.buffer,componentsPerAttribute:u,componentDatatype:s,offsetInBytes:m,strideInBytes:p,normalize:o};e.attributes.push(y)}}function Lst(e,t,n){let i=t.variableName,r=`v_${i}`,o;i==="normalMC"?(r="v_normalEC",o=t.glslType):i==="tangentMC"?(o="vec3",r="v_tangentEC"):o=t.glslType,e.addVarying(o,r,n)}function Nst(e,t,n){let i=t.attribute.semantic,r=t.variableName,o,a;t.isQuantized?(o=`a_quantized_${r}`,a=t.quantizedGlslType):(o=`a_${r}`,a=t.glslType);let s=i===ot.POSITION;s?e.setPositionAttribute(a,o):e.addAttribute(a,o),s&&n&&e.addAttribute("vec3","a_position2D")}function Fst(e,t,n){let i=Ds.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,r=Ds.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,{variableName:o,glslType:a}=t;o==="tangentMC"?(e.addStructField(i,"vec3","tangentMC"),e.addStructField(i,"float","tangentSignMC"),e.addStructField(r,"vec3","tangentEC")):o==="normalMC"?(e.addStructField(i,"vec3","normalMC"),e.addStructField(r,"vec3","normalEC")):(e.addStructField(i,a,o),e.addStructField(r,a,o)),o==="positionMC"&&n&&e.addStructField(i,"vec3","position2D")}function Bst(e,t,n){let i=Ds.FUNCTION_ID_INITIALIZE_ATTRIBUTES,r=t.variableName;if(r==="positionMC"&&n&&e.addFunctionLines(i,["attributes.position2D = a_position2D;"]),t.isQuantized)return;let a=[];r==="tangentMC"?(a.push("attributes.tangentMC = a_tangentMC.xyz;"),a.push("attributes.tangentSignMC = a_tangentMC.w;")):a.push(`attributes.${r} = a_${r};`),e.addFunctionLines(i,a)}function kst(e,t){let{semantic:n,setIndex:i}=t.attribute;if(l(n)&&!l(i))return;let r=Ds.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,o=t.variableName,a=`v_${o} = attributes.${o};`;e.addFunctionLines(r,[a]),r=Ds.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,a=`attributes.${o} = v_${o};`,e.addFunctionLines(r,[a])}function zst(e,t){let n=!1,i=!1;for(let r=0;r<t.length;r++){let o=t[r];o.semantic===ot.NORMAL?n=!0:o.semantic===ot.TANGENT&&(i=!0)}!n||!i||(e.addDefine("HAS_BITANGENTS"),e.addVarying("vec3","v_bitangentEC"),e.addStructField(Ds.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"vec3","bitangentMC"),e.addStructField(Ds.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","bitangentEC"))}var UU=Ds;var KJ,fbe="AAPTa7BPWL4PoZRFPJ2CM2YRclg..ub1vMOBXctC7ozMMKNnmx3ZwVTsDJAXo2GLomQ2CZjuOc2HLr1-CryeuRo9ZsV65cuZ9xN1yFKeLTu7Cxld7B97aI28os_NnuC9nvWde_l4G1DTApSHmhrVoZfKgO0bqOrsDfvvSgO-cdkUEvBASNX_4Lb9tB5fEY7lbYaWdOOWBXyZylR9il0-biB248V6HdDT1kgkSwz9esfKialRTLgxJx8AFM9is--UXK0CLvZn6JUU44PZSFuMyAT1_rgxsirsZ",PE={};PE.defaultAccessToken=fbe;PE.defaultWorldImageryServer=new De({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"});PE.defaultWorldHillshadeServer=new De({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"});PE.defaultWorldOceanServer=new De({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer"});PE.getDefaultTokenCredit=function(e){if(e===fbe){if(!l(KJ)){let t='<b> This application is using a default ArcGIS access token. Please assign <i>Cesium.ArcGisMapService.defaultAccessToken</i> with an API key from your ArcGIS Developer account before using the ArcGIS tile services. You can sign up for a free ArcGIS Developer account at <a href="https://developers.arcgis.com/">https://developers.arcgis.com/</a>.</b>';KJ=new wt(t,!0)}return KJ}};var bd=PE;function $J(e){e=e??H.EMPTY_OBJECT,this._pixelsToCheck=e.pixelsToCheck,this._missingImagePixels=void 0,this._missingImageByteLength=void 0,this._isReady=!1;let t=De.createIfNeeded(e.missingImageUrl),n=this;function i(o){l(o.blob)&&(n._missingImageByteLength=o.blob.size);let a=ym(o);if(e.disableCheckIfAllPixelsAreTransparent){let s=!0,c=o.width,u=e.pixelsToCheck;for(let f=0,d=u.length;s&&f<d;++f){let p=u[f],g=p.x*4+p.y*c;a[g+3]>0&&(s=!1)}s&&(a=void 0)}n._missingImagePixels=a,n._isReady=!0}function r(){n._missingImagePixels=void 0,n._isReady=!0}t.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}).then(i).catch(r)}$J.prototype.isReady=function(){return this._isReady};$J.prototype.shouldDiscardImage=function(e){let t=this._pixelsToCheck,n=this._missingImagePixels;if(!l(n)||l(e.blob)&&e.blob.size!==this._missingImageByteLength)return!1;let i=ym(e),r=e.width;for(let o=0,a=t.length;o<a;++o){let s=t[o],c=s.x*4+s.y*r;for(let u=0;u<4;++u){let f=c+u;if(i[f]!==n[f])return!1}}return!0};var VU=$J;function JJ(){this.name=void 0,this.description=void 0,this.position=void 0,this.data=void 0,this.imageryLayer=void 0}JJ.prototype.configureNameFromProperties=function(e){let t=10,n;for(let i in e)if(e.hasOwnProperty(i)&&e[i]){let r=i.toLowerCase();t>1&&r==="name"?(t=1,n=i):t>2&&r==="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)}l(n)&&(this.name=e[n])};JJ.prototype.configureDescriptionFromProperties=function(e){function t(n){let i='<table class="cesium-infoBox-defaultTable">';for(let r in n)if(n.hasOwnProperty(r)){let o=n[r];l(o)&&(typeof o=="object"?i+=`<tr><td>${r}</td><td>${t(o)}</td></tr>`:i+=`<tr><td>${r}</td><td>${o}</td></tr>`)}return i+="</table>",i}this.description=t(e)};var yp=JJ;function DE(){pe.throwInstantiationError()}Object.defineProperties(DE.prototype,{rectangle:{get:pe.throwInstantiationError},tileWidth:{get:pe.throwInstantiationError},tileHeight:{get:pe.throwInstantiationError},maximumLevel:{get:pe.throwInstantiationError},minimumLevel:{get:pe.throwInstantiationError},tilingScheme:{get:pe.throwInstantiationError},tileDiscardPolicy:{get:pe.throwInstantiationError},errorEvent:{get:pe.throwInstantiationError},credit:{get:pe.throwInstantiationError},proxy:{get:pe.throwInstantiationError},hasAlphaChannel:{get:pe.throwInstantiationError}});DE.prototype.getTileCredits=function(e,t,n){pe.throwInstantiationError()};DE.prototype.requestImage=function(e,t,n,i){pe.throwInstantiationError()};DE.prototype.pickFeatures=function(e,t,n,i,r){pe.throwInstantiationError()};var Ust=/\.ktx2$/i;DE.loadImage=function(e,t){let n=De.createIfNeeded(t);return Ust.test(n.url)?qu(n):l(e)&&l(e.tileDiscardPolicy)?n.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):n.fetchImage({preferImageBitmap:!0,flipY:!0})};var xd=DE;var dbe={SATELLITE:1,OCEANS:2,HILLSHADE:3};Object.freeze(dbe);var Ap=dbe;function hbe(e){this.useTiles=e.usePreCachedTilesIfAvailable??!0;let t=e.ellipsoid;this.tilingScheme=e.tilingScheme??new $i({ellipsoid:t}),this.rectangle=e.rectangle??this.tilingScheme.rectangle,this.ellipsoid=t;let n=e.credit;typeof n=="string"&&(n=new wt(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}hbe.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&&!l(this.tileDiscardPolicy)&&(e._tileDiscardPolicy=new VU({missingImageUrl:mbe(e,0,0,this.maximumLevel).url,pixelsToCheck:[new k(0,0),new k(200,20),new k(20,200),new k(80,110),new k(160,130)],disableCheckIfAllPixelsAreTransparent:!0}))};function Vst(e,t){let n=e.tileInfo;if(!l(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 So({ellipsoid:t.ellipsoid});else if(e.tileInfo.spatialReference.wkid===4326)t.tilingScheme=new $i({ellipsoid:t.ellipsoid});else{let i=`Tile spatial reference WKID ${e.tileInfo.spatialReference.wkid} is not supported.`;throw new oe(i)}if(t.maximumLevel=e.tileInfo.lods.length-1,l(e.fullExtent)){if(l(e.fullExtent.spatialReference)&&l(e.fullExtent.spatialReference.wkid))if(e.fullExtent.spatialReference.wkid===102100||e.fullExtent.spatialReference.wkid===102113){let i=new _i,r=e.fullExtent,o=i.unproject(new h(Math.max(r.xmin,-t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.max(r.ymin,-t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0)),a=i.unproject(new h(Math.min(r.xmax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.min(r.ymax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0));t.rectangle=new ie(o.longitude,o.latitude,a.longitude,a.latitude)}else if(e.fullExtent.spatialReference.wkid===4326)t.rectangle=ie.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 oe(i)}}else t.rectangle=t.tilingScheme.rectangle;t.useTiles=!0}l(e.copyrightText)&&e.copyrightText.length>0&&(l(t.credit)?t.tileCredits=[new wt(e.copyrightText)]:t.credit=new wt(e.copyrightText))}function jst(e,t){let n=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(n+=`: ${t.message}`),new oe(n)}async function Hst(e,t){let n=e.getDerivedResource({queryParameters:{f:"json"}});try{let i=await n.fetchJson();Vst(i,t)}catch(i){jst(e,i)}}function bp(e){e=e??H.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 $i({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,this.enablePickFeatures=e.enablePickFeatures??!0,this._errorEvent=new be}bp.fromBasemapType=async function(e,t){t=t??H.EMPTY_OBJECT;let n,i,r;switch(e){case Ap.SATELLITE:{n=t.token??bd.defaultAccessToken,i=De.createIfNeeded(bd.defaultWorldImageryServer),i.appendForwardSlash();let o=bd.getDefaultTokenCredit(n);l(o)&&(r=wt.clone(o))}break;case Ap.OCEANS:{n=t.token??bd.defaultAccessToken,i=De.createIfNeeded(bd.defaultWorldOceanServer),i.appendForwardSlash();let o=bd.getDefaultTokenCredit(n);l(o)&&(r=wt.clone(o))}break;case Ap.HILLSHADE:{n=t.token??bd.defaultAccessToken,i=De.createIfNeeded(bd.defaultWorldHillshadeServer),i.appendForwardSlash();let o=bd.getDefaultTokenCredit(n);l(o)&&(r=wt.clone(o))}break;default:}return bp.fromUrl(i,{...t,token:n,credit:r,usePreCachedTilesIfAvailable:!0})};function mbe(e,t,n,i,r){let o;if(e._useTiles)o=e._resource.getDerivedResource({url:`tile/${i}/${n}/${t}`,request:r});else{let a=e._tilingScheme.tileXYToNativeRectangle(t,n,i),c={bbox:`${a.west},${a.south},${a.east},${a.north}`,size:`${e._tileWidth},${e._tileHeight}`,format:"png32",transparent:!0,f:"image"};e._tilingScheme.projection instanceof ki?(c.bboxSR=4326,c.imageSR=4326):(c.bboxSR=3857,c.imageSR=3857),e.layers&&(c.layers=`show:${e.layers}`),o=e._resource.getDerivedResource({url:"export",request:r,queryParameters:c})}return o}Object.defineProperties(bp.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}}});bp.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT;let n=De.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&n.setQueryParameters({token:t.token});let i=new bp(t);i._resource=n;let r=new hbe(t);return(t.usePreCachedTilesIfAvailable??!0)&&await Hst(n,r),r.build(i),i};bp.prototype.getTileCredits=function(e,t,n){return this._tileCredits};bp.prototype.requestImage=function(e,t,n,i){return xd.loadImage(this,mbe(this,e,t,n,i))};bp.prototype.pickFeatures=function(e,t,n,i,r){if(!this.enablePickFeatures)return;let o=this._tilingScheme.tileXYToNativeRectangle(e,t,n),a,s,c;if(this._tilingScheme.projection instanceof ki)a=I.toDegrees(i),s=I.toDegrees(r),c="4326";else{let p=this._tilingScheme.projection.project(new de(i,r,0));a=p.x,s=p.y,c="3857"}let u="visible";l(this._layers)&&(u+=`:${this._layers}`);let f={f:"json",tolerance:2,geometryType:"esriGeometryPoint",geometry:`${a},${s}`,mapExtent:`${o.west},${o.south},${o.east},${o.north}`,imageDisplay:`${this._tileWidth},${this._tileHeight},96`,sr:c,layers:u};return this._resource.getDerivedResource({url:"identify",queryParameters:f}).fetchJson().then(function(p){let g=[],m=p.results;if(!l(m))return g;for(let y=0;y<m.length;++y){let A=m[y],b=new yp;if(b.data=A,b.name=A.value,b.properties=A.attributes,b.configureDescriptionFromProperties(A.attributes),A.geometryType==="esriGeometryPoint"&&A.geometry){let x=A.geometry.spatialReference&&A.geometry.spatialReference.wkid?A.geometry.spatialReference.wkid:4326;if(x===4326||x===4283)b.position=de.fromDegrees(A.geometry.x,A.geometry.y,A.geometry.z);else if(x===102100||x===900913||x===3857){let T=new _i;b.position=T.unproject(new h(A.geometry.x,A.geometry.y,A.geometry.z))}}g.push(b)}return g})};bp._metadataCache={};var Sy=bp;var pbe={AERIAL:"Aerial",AERIAL_WITH_LABELS:"AerialWithLabels",AERIAL_WITH_LABELS_ON_DEMAND:"AerialWithLabelsOnDemand",ROAD:"Road",ROAD_ON_DEMAND:"RoadOnDemand",CANVAS_DARK:"CanvasDark",CANVAS_LIGHT:"CanvasLight",CANVAS_GRAY:"CanvasGray",ORDNANCE_SURVEY:"OrdnanceSurvey",COLLINS_BART:"CollinsBart"};Object.freeze(pbe);var BD=pbe;function kD(e){}kD.prototype.isReady=function(){return!0};kD.prototype.shouldDiscardImage=function(e){return kD.EMPTY_IMAGE===e};var jU;Object.defineProperties(kD,{EMPTY_IMAGE:{get:function(){return l(jU)||(jU=new Image,jU.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),jU}}});var zD=kD;function gbe(e){this.tileWidth=void 0,this.tileHeight=void 0,this.maximumLevel=void 0,this.imageUrlSubdomains=void 0,this.imageUrlTemplate=void 0,this.attributionList=void 0}gbe.prototype.build=function(e){e._tileWidth=this.tileWidth,e._tileHeight=this.tileHeight,e._maximumLevel=this.maximumLevel,e._imageUrlSubdomains=this.imageUrlSubdomains,e._imageUrlTemplate=this.imageUrlTemplate;let t=e._attributionList=this.attributionList;t||(t=[]),e._attributionList=t;for(let n=0,i=t.length;n<i;++n){let r=t[n];if(r.credit instanceof wt)break;r.credit=new wt(r.attribution);let o=r.coverageAreas;for(let a=0,s=r.coverageAreas.length;a<s;++a){let c=o[a],u=c.bbox;c.bbox=new ie(I.toRadians(u[1]),I.toRadians(u[0]),I.toRadians(u[3]),I.toRadians(u[2]))}}};function Gst(e,t){if(e.resourceSets.length!==1)throw new oe("metadata does not specify one resource in resourceSets");let n=e.resourceSets[0].resources[0];t.tileWidth=n.imageWidth,t.tileHeight=n.imageHeight,t.maximumLevel=n.zoomMax-1,t.imageUrlSubdomains=n.imageUrlSubdomains,t.imageUrlTemplate=n.imageUrl;let i=n.imageryProviders;l(n.imageryProviders)&&(i=n.imageryProviders.filter(r=>r.coverageAreas?.some(o=>l(o.bbox)))),t.attributionList=i}function Wst(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i+=`: ${t.message}`),qr.reportError(void 0,n,l(n)?n._errorEvent:void 0,i,void 0,void 0,void 0,t),new oe(i)}async function qst(e,t,n){let i=e.url,r=fs._metadataCache[i];l(r)||(r=e.fetchJson(),fs._metadataCache[i]=r);try{let o=await r;return Gst(o,t)}catch(o){Wst(e,o,n)}}function fs(e){e=e??H.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??BD.AERIAL,this._mapLayer=e.mapLayer,this._culture=e.culture??"",this._key=e.key,this._tileDiscardPolicy=e.tileDiscardPolicy,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new zD),this._proxy=e.proxy,this._credit=new wt(`<a href="https://www.microsoft.com/en-us/maps/bing-maps/product"><img src="${fs.logoUrl}" title="Bing Imagery"/></a>`),this._tilingScheme=new So({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 be}Object.defineProperties(fs.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 l(this.mapLayer)}}});fs.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT;let n=t.tileProtocol;l(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??BD.AERIAL,r=De.createIfNeeded(e);r.appendForwardSlash();let o={incl:"ImageryProviders",key:t.key,uriScheme:n};l(t.mapLayer)&&(o.mapLayer=t.mapLayer),l(t.culture)&&(o.culture=t.culture);let a=r.getDerivedResource({url:`REST/v1/Imagery/Metadata/${i}`,queryParameters:o}),s=new fs(t);s._resource=r;let c=new gbe(t);return await qst(a,c),c.build(s),s};var Yst=new ie;fs.prototype.getTileCredits=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(e,t,n,Yst);return $st(this._attributionList,n,i)};fs.prototype.requestImage=function(e,t,n,i){let r=xd.loadImage(this,Xst(this,e,t,n,i));if(l(r))return r.catch(function(o){return l(o.blob)&&o.blob.size===0?zD.EMPTY_IMAGE:Promise.reject(o)})};fs.prototype.pickFeatures=function(e,t,n,i,r){};fs.tileXYToQuadKey=function(e,t,n){let i="";for(let r=n;r>=0;--r){let o=1<<r,a=0;(e&o)!==0&&(a|=1),(t&o)!==0&&(a|=2),i+=a}return i};fs.quadKeyToTileXY=function(e){let t=0,n=0,i=e.length-1;for(let r=i;r>=0;--r){let o=1<<r,a=+e[i-r];(a&1)!==0&&(t|=o),(a&2)!==0&&(n|=o)}return{x:t,y:n,level:i}};fs._logoUrl=void 0;Object.defineProperties(fs,{logoUrl:{get:function(){return l(fs._logoUrl)||(fs._logoUrl=$t("Assets/Images/bing_maps_credit.png")),fs._logoUrl},set:function(e){fs._logoUrl=e}}});function Xst(e,t,n,i,r){let o=e._imageUrlTemplate,a=e._imageUrlSubdomains,s=(t+n+i)%a.length;return e._resource.getDerivedResource({url:o,request:r,templateValues:{quadkey:fs.tileXYToQuadKey(t,n,i),subdomain:a[s],culture:e._culture},queryParameters:{n:"z"}})}var Kst=new ie;function $st(e,t,n){++t;let i=[];for(let r=0,o=e.length;r<o;++r){let a=e[r],s=a.coverageAreas,c=!1;for(let u=0,f=a.coverageAreas.length;!c&&u<f;++u){let d=s[u];if(t>=d.zoomMin&&t<=d.zoomMax){let p=ie.intersection(n,d.bbox,Kst);l(p)&&(c=!0)}}c&&i.push(a.credit)}return i}fs._metadataCache={};var HU=fs;var _be=/{[^}]+}/g,ybe={x:ect,y:nct,z:oct,s:act,reverseX:tct,reverseY:ict,reverseZ:rct,westDegrees:sct,southDegrees:cct,eastDegrees:lct,northDegrees:uct,westProjected:fct,southProjected:dct,eastProjected:hct,northProjected:mct,width:pct,height:gct},Jst=Ot(ybe,{i:_ct,j:yct,reverseI:Act,reverseJ:bct,longitudeDegrees:Tct,latitudeDegrees:Cct,longitudeProjected:vct,latitudeProjected:Ect,format:wct});function UD(e){e=e??H.EMPTY_OBJECT,this._errorEvent=new be;let t=De.createIfNeeded(e.url),n=De.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():l(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 So({ellipsoid:e.ellipsoid}),this._rectangle=e.rectangle??this._tilingScheme.rectangle,this._rectangle=ie.intersection(this._rectangle,this._tilingScheme.rectangle),this._tileDiscardPolicy=e.tileDiscardPolicy;let r=e.credit;typeof r=="string"&&(r=new wt(r)),this._credit=r,this._hasAlphaChannel=e.hasAlphaChannel??!0;let o=e.customTags,a=Ot(ybe,o),s=Ot(Jst,o);this._tags=a,this._pickFeaturesTags=s,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(UD.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}}});UD.prototype.getTileCredits=function(e,t,n){};UD.prototype.requestImage=function(e,t,n,i){return xd.loadImage(this,Zst(this,e,t,n,i))};UD.prototype.pickFeatures=function(e,t,n,i,r){if(!this.enablePickFeatures||!l(this._pickFeaturesResource)||this._getFeatureInfoFormats.length===0)return;let o=0,a=this;function s(u,f){return u.callback(f)}function c(){if(o>=a._getFeatureInfoFormats.length)return Promise.resolve([]);let u=a._getFeatureInfoFormats[o],f=Qst(a,e,t,n,i,r,u.format);return++o,u.type==="json"?f.fetchJson().then(u.callback).catch(c):u.type==="xml"?f.fetchXML().then(u.callback).catch(c):u.type==="text"||u.type==="html"?f.fetchText().then(u.callback).catch(c):f.fetch({responseType:u.format}).then(s.bind(void 0,u)).catch(c)}return c()};var GU=!1,lf=new ie,WU=!1,VD=new ie;function Zst(e,t,n,i,r){GU=!1,WU=!1;let o=e._resource,a=o.getUrlComponent(!0),s=e._tags,c={},u=a.match(_be);return l(u)&&u.forEach(function(f){let d=f.substring(1,f.length-1);l(s[d])&&(c[d]=s[d](e,t,n,i))}),o.getDerivedResource({request:r,templateValues:c})}var ZJ=!1,OE=new k,QJ=!1;function Qst(e,t,n,i,r,o,a){GU=!1,WU=!1,ZJ=!1,QJ=!1;let s=e._pickFeaturesResource,c=s.getUrlComponent(!0),u=e._pickFeaturesTags,f={},d=c.match(_be);return l(d)&&d.forEach(function(p){let g=p.substring(1,p.length-1);l(u[g])&&(f[g]=u[g](e,t,n,i,r,o,a))}),s.getDerivedResource({templateValues:f})}function ME(e,t,n){if(e&&e.urlSchemeZeroPadding&&e.urlSchemeZeroPadding.hasOwnProperty(t)){let i=e.urlSchemeZeroPadding[t];if(typeof i=="string"){let r=i.length;r>1&&(n=n.length>=r?n:new Array(r-n.toString().length+1).join("0")+n)}}return n}function ect(e,t,n,i){return ME(e,"{x}",t)}function tct(e,t,n,i){let r=e.tilingScheme.getNumberOfXTilesAtLevel(i)-t-1;return ME(e,"{reverseX}",r)}function nct(e,t,n,i){return ME(e,"{y}",n)}function ict(e,t,n,i){let r=e.tilingScheme.getNumberOfYTilesAtLevel(i)-n-1;return ME(e,"{reverseY}",r)}function rct(e,t,n,i){let r=e.maximumLevel,o=l(r)&&i<r?r-i-1:i;return ME(e,"{reverseZ}",o)}function oct(e,t,n,i){return ME(e,"{z}",i)}function act(e,t,n,i){let r=(t+n+i)%e._subdomains.length;return e._subdomains[r]}function qU(e,t,n,i){GU||(e.tilingScheme.tileXYToRectangle(t,n,i,lf),lf.west=I.toDegrees(lf.west),lf.south=I.toDegrees(lf.south),lf.east=I.toDegrees(lf.east),lf.north=I.toDegrees(lf.north),GU=!0)}function sct(e,t,n,i){return qU(e,t,n,i),lf.west}function cct(e,t,n,i){return qU(e,t,n,i),lf.south}function lct(e,t,n,i){return qU(e,t,n,i),lf.east}function uct(e,t,n,i){return qU(e,t,n,i),lf.north}function YU(e,t,n,i){WU||(e.tilingScheme.tileXYToNativeRectangle(t,n,i,VD),WU=!0)}function fct(e,t,n,i){return YU(e,t,n,i),VD.west}function dct(e,t,n,i){return YU(e,t,n,i),VD.south}function hct(e,t,n,i){return YU(e,t,n,i),VD.east}function mct(e,t,n,i){return YU(e,t,n,i),VD.north}function pct(e,t,n,i){return e.tileWidth}function gct(e,t,n,i){return e.tileHeight}function _ct(e,t,n,i,r,o,a){return XU(e,t,n,i,r,o),OE.x}function yct(e,t,n,i,r,o,a){return XU(e,t,n,i,r,o),OE.y}function Act(e,t,n,i,r,o,a){return XU(e,t,n,i,r,o),e.tileWidth-OE.x-1}function bct(e,t,n,i,r,o,a){return XU(e,t,n,i,r,o),e.tileHeight-OE.y-1}var xct=new ie,RE=new h;function XU(e,t,n,i,r,o,a){if(ZJ)return;eZ(e,t,n,i,r,o);let s=RE,c=e.tilingScheme.tileXYToNativeRectangle(t,n,i,xct);OE.x=e.tileWidth*(s.x-c.west)/c.width|0,OE.y=e.tileHeight*(c.north-s.y)/c.height|0,ZJ=!0}function Tct(e,t,n,i,r,o,a){return I.toDegrees(r)}function Cct(e,t,n,i,r,o,a){return I.toDegrees(o)}function vct(e,t,n,i,r,o,a){return eZ(e,t,n,i,r,o),RE.x}function Ect(e,t,n,i,r,o,a){return eZ(e,t,n,i,r,o),RE.y}var Sct=new de;function eZ(e,t,n,i,r,o,a){if(!QJ){if(e.tilingScheme.projection instanceof ki)RE.x=I.toDegrees(r),RE.y=I.toDegrees(o);else{let s=Sct;s.longitude=r,s.latitude=o,e.tilingScheme.projection.project(s,RE)}QJ=!0}}function wct(e,t,n,i,r,o,a){return a}var Sa=UD;function Td(e){Sa.call(this,e)}Td._requestMetadata=async function(e,t,n,i){try{let r=await n.fetchXML();return Td._metadataSuccess(r,e,t,n,i)}catch(r){if(r instanceof l0)return Td._metadataFailure(e,t);throw r}};Td.fromUrl=async function(e,t){let n=De.createIfNeeded(e);n.appendForwardSlash();let i=n,r=n.getDerivedResource({url:"tilemapresource.xml"});t=t??H.EMPTY_OBJECT;let o=await Td._requestMetadata(t,i,r);return new Td(o)};l(Object.create)&&(Td.prototype=Object.create(Sa.prototype),Td.prototype.constructor=Td);function Abe(e,t){return e.west<t.rectangle.west&&(e.west=t.rectangle.west),e.east>t.rectangle.east&&(e.east=t.rectangle.east),e.south<t.rectangle.south&&(e.south=t.rectangle.south),e.north>t.rectangle.north&&(e.north=t.rectangle.north),e}function bbe(e,t,n){let i=e.positionToTileXY(ie.southwest(t),n),r=e.positionToTileXY(ie.northeast(t),n);return(Math.abs(r.x-i.x)+1)*(Math.abs(r.y-i.y)+1)>4?0:n}Td._metadataSuccess=function(e,t,n,i,r){let o=/tileformat/i,a=/tileset/i,s=/tilesets/i,c=/boundingbox/i,u,f,d,p=[],g=e.childNodes[0].childNodes;for(let R=0;R<g.length;R++)if(o.test(g.item(R).nodeName))u=g.item(R);else if(s.test(g.item(R).nodeName)){d=g.item(R);let M=g.item(R).childNodes;for(let N=0;N<M.length;N++)a.test(M.item(N).nodeName)&&p.push(M.item(N))}else c.test(g.item(R).nodeName)&&(f=g.item(R));let m;if(!l(d)||!l(f))throw m=`Unable to find expected tilesets or bbox attributes in ${i.url}.`,l(r)&&qr.reportError(void 0,r,r.errorEvent,m),new oe(m);let y=t.fileExtension??u.getAttribute("extension"),A=t.tileWidth??parseInt(u.getAttribute("width"),10),b=t.tileHeight??parseInt(u.getAttribute("height"),10),x=t.minimumLevel??parseInt(p[0].getAttribute("order"),10),T=t.maximumLevel??parseInt(p[p.length-1].getAttribute("order"),10),C=d.getAttribute("profile"),E=t.tilingScheme;if(!l(E))if(C==="geodetic"||C==="global-geodetic")E=new $i({ellipsoid:t.ellipsoid});else if(C==="mercator"||C==="global-mercator")E=new So({ellipsoid:t.ellipsoid});else throw m=`${i.url} specifies an unsupported profile attribute, ${C}.`,l(r)&&qr.reportError(void 0,r,r.errorEvent,m),new oe(m);let w=ie.clone(t.rectangle);if(!l(w)){let R,M,N,_;t.flipXY??!1?(N=new k(parseFloat(f.getAttribute("miny")),parseFloat(f.getAttribute("minx"))),_=new k(parseFloat(f.getAttribute("maxy")),parseFloat(f.getAttribute("maxx")))):(N=new k(parseFloat(f.getAttribute("minx")),parseFloat(f.getAttribute("miny"))),_=new k(parseFloat(f.getAttribute("maxx")),parseFloat(f.getAttribute("maxy"))));let S=C==="geodetic"||C==="mercator";if(E.projection instanceof ki||S)R=de.fromDegrees(N.x,N.y),M=de.fromDegrees(_.x,_.y);else{let P=E.projection;R=P.unproject(N),M=P.unproject(_)}w=new ie(R.longitude,R.latitude,M.longitude,M.latitude)}return w=Abe(w,E),x=bbe(E,w,x),{url:n.getDerivedResource({url:`{z}/{x}/{reverseY}.${y}`}),tilingScheme:E,rectangle:w,tileWidth:A,tileHeight:b,minimumLevel:x,maximumLevel:T,tileDiscardPolicy:t.tileDiscardPolicy,credit:t.credit}};Td._metadataFailure=function(e,t){let n=e.fileExtension??"png",i=e.tileWidth??256,r=e.tileHeight??256,o=e.maximumLevel,a=l(e.tilingScheme)?e.tilingScheme:new So({ellipsoid:e.ellipsoid}),s=e.rectangle??a.rectangle;s=Abe(s,a);let c=bbe(a,s,e.minimumLevel);return{url:t.getDerivedResource({url:`{z}/{x}/{reverseY}.${n}`}),tilingScheme:a,rectangle:s,tileWidth:i,tileHeight:r,minimumLevel:c,maximumLevel:o,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit}};var sx=Td;function xbe(e){this.channel=e.channel,this.ellipsoid=e.ellipsoid,this.tilingScheme=void 0,this.version=void 0}xbe.prototype.build=function(e){e._channel=this.channel,e._version=this.version,e._tilingScheme=this.tilingScheme};function Ict(e,t){let n;try{n=JSON.parse(e)}catch{n=JSON.parse(e.replace(/([\[\{,])[\n\r ]*([A-Za-z0-9]+)[\n\r ]*:/g,'$1"$2":'))}let i;for(let r=0;r<n.layers.length;r++)if(n.layers[r].id===t.channel){i=n.layers[r];break}if(!l(i)){let r=`Could not find layer with channel (id) of ${t.channel}.`;throw new oe(r)}if(!l(i.version)){let r=`Could not find a version in channel (id) ${t.channel}.`;throw new oe(r)}if(t.version=i.version,l(n.projection)&&n.projection==="flat")t.tilingScheme=new $i({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ie(-Math.PI,-Math.PI,Math.PI,Math.PI),ellipsoid:t.ellipsoid});else if(!l(n.projection)||n.projection==="mercator")t.tilingScheme=new So({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:t.ellipsoid});else{let r=`Unsupported projection ${n.projection}.`;throw new oe(r)}return!0}function Pct(e,t,n){let i=`An error occurred while accessing ${t.url}.`;throw l(e)&&l(e.message)&&(i+=`: ${e.message}`),qr.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new oe(i)}async function Dct(e,t,n){try{let i=await e.fetchText();Ict(i,t)}catch(i){Pct(i,e,n)}}function vu(e){e=e??{},this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=1.9,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._channel=e.channel,this._requestType="ImageryMaps",this._credit=new wt(`<a href="http://www.google.com/enterprise/mapsearth/products/earthenterprise.html"><img src="${vu.logoUrl}" title="Google Imagery"/></a>`),this._tilingScheme=void 0,this._version=void 0,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=e.maximumLevel,this._errorEvent=new be}Object.defineProperties(vu.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}}});vu.fromUrl=async function(e,t,n){n=n??{};let i=n.path??"/default_map",r=De.createIfNeeded(e).getDerivedResource({url:i[0]==="/"?i.substring(1):i});r.appendForwardSlash();let o=r.getDerivedResource({url:"query",queryParameters:{request:"Json",vars:"geeServerDefs",is2d:"t"}}),a=new xbe(n);a.channel=t,await Dct(o,a);let s=new vu(n);return a.build(s),s._resource=r,s._url=e,s._path=i,s};vu.prototype.getTileCredits=function(e,t,n){};vu.prototype.requestImage=function(e,t,n,i){let r=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 xd.loadImage(this,r)};vu.prototype.pickFeatures=function(e,t,n,i,r){};vu._logoUrl=void 0;Object.defineProperties(vu,{logoUrl:{get:function(){return l(vu._logoUrl)||(vu._logoUrl=$t("Assets/Images/google_earth_credit.png")),vu._logoUrl},set:function(e){vu._logoUrl=e}}});var KU=vu;var Rct=/\/$/,Tbe=new wt('© <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 LE(e){e=e??H.EMPTY_OBJECT;let t=e.mapId,n=e.accessToken;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=De.createIfNeeded(e.url??"https://{s}.tiles.mapbox.com/v4/");this._mapId=t,this._accessToken=n;let r=e.format??"png";/\./.test(r)||(r=`.${r}`),this._format=r;let o=i.getUrlComponent();Rct.test(o)||(o+="/"),o+=`${t}/{z}/{x}/{y}${this._format}`,i.url=o,i.setQueryParameters({access_token:n});let a;l(e.credit)?(a=e.credit,typeof a=="string"&&(a=new wt(a))):a=Tbe,this._resource=i,this._imageryProvider=new Sa({url:i,credit:a,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(LE.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}}});LE.prototype.getTileCredits=function(e,t,n){};LE.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};LE.prototype.pickFeatures=function(e,t,n,i,r){return this._imageryProvider.pickFeatures(e,t,n,i,r)};LE._defaultCredit=Tbe;var $U=LE;function cx(e){e=e??H.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??ie.MAX_VALUE,n=new $i({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 be;let i=e.credit;typeof i=="string"&&(i=new wt(i)),this._credit=i;let r=De.createIfNeeded(e.url);this._resource=r,this._tileWidth=e.tileWidth,this._tileHeight=e.tileHeight}Object.defineProperties(cx.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 Oct(e,t,n,i){let r=`Failed to load image ${e.url}`;l(t)&&l(t.message)&&(r+=`: ${t.message}`);let o=qr.reportError(i,n,l(n)?n._errorEvent:void 0,r,0,0,0,t);if(o.retry)return tZ(e,n,o);throw l(n)&&(n._hasError=!0),new oe(r)}async function tZ(e,t,n){try{return await xd.loadImage(null,e)}catch(i){return Oct(e,i,t,n)}}cx.fromUrl=async function(e,t){let n=De.createIfNeeded(e),i=await tZ(n);t=t??H.EMPTY_OBJECT;let r=new cx({...t,url:e,tileWidth:i.width,tileHeight:i.height});return r._image=i,r};cx.prototype.getTileCredits=function(e,t,n){};cx.prototype.requestImage=async function(e,t,n,i){if(!this._hasError&&!l(this._image)){let r=await tZ(this._resource,this);return this._image=r,qr.reportSuccess(this._errorEvent),r}return this._image};cx.prototype.pickFeatures=function(e,t,n,i,r){};var JU=cx;function Mct(e,t,n){this.type=e,l(t)||(e==="json"?t="application/json":e==="xml"?t="text/xml":e==="html"?t="text/html":e==="text"&&(t="text/plain")),this.format=t,l(n)||(e==="json"?n=Lct:e==="xml"?n=kct:(e==="html"||e==="text")&&(n=Cbe)),this.callback=n}function Lct(e){let t=[],n=e.features;for(let i=0;i<n.length;++i){let r=n[i],o=new yp;if(o.data=r,o.properties=r.properties,o.configureNameFromProperties(r.properties),o.configureDescriptionFromProperties(r.properties),l(r.geometry)&&r.geometry.type==="Point"){let a=r.geometry.coordinates[0],s=r.geometry.coordinates[1];o.position=de.fromDegrees(a,s)}t.push(o)}return t}var nZ="http://www.mapinfo.com/mxp",Nct="http://www.esri.com/wms",Fct="http://www.opengis.net/wfs",Bct="http://www.opengis.net/gml";function kct(e){let t=e.documentElement;if(t.localName==="MultiFeatureCollection"&&t.namespaceURI===nZ)return zct(e);if(t.localName==="FeatureInfoResponse"&&t.namespaceURI===Nct)return Uct(e);if(t.localName==="FeatureCollection"&&t.namespaceURI===Fct)return Vct(e);if(t.localName==="ServiceExceptionReport")throw new oe(new XMLSerializer().serializeToString(t));return t.localName==="msGMLOutput"?jct(e):Hct(e)}function zct(e){let t=[],i=e.documentElement.getElementsByTagNameNS(nZ,"Feature");for(let r=0;r<i.length;++r){let o=i[r],a={},s=o.getElementsByTagNameNS(nZ,"Val");for(let u=0;u<s.length;++u){let f=s[u];if(f.hasAttribute("ref")){let d=f.getAttribute("ref"),p=f.textContent.trim();a[d]=p}}let c=new yp;c.data=o,c.properties=a,c.configureNameFromProperties(a),c.configureDescriptionFromProperties(a),t.push(c)}return t}function Uct(e){let t=e.documentElement,n=[],i,r=t.getElementsByTagNameNS("*","FIELDS");if(r.length>0)for(let o=0;o<r.length;++o){let a=r[o];i={};let s=a.attributes;for(let c=0;c<s.length;++c){let u=s[c];i[u.name]=u.value}n.push(ZU(a,i))}else{let o=t.getElementsByTagNameNS("*","FeatureInfo");for(let a=0;a<o.length;++a){let s=o[a];i={};let c=s.childNodes;for(let u=0;u<c.length;++u){let f=c[u];f.nodeType===Node.ELEMENT_NODE&&(i[f.localName]=f.textContent)}n.push(ZU(s,i))}}return n}function Vct(e){let t=[],i=e.documentElement.getElementsByTagNameNS(Bct,"featureMember");for(let r=0;r<i.length;++r){let o=i[r],a={};iZ(o,a),t.push(ZU(o,a))}return t}function jct(e){let t=[],n,i=e.documentElement.childNodes;for(let o=0;o<i.length;o++)if(i[o].nodeType===Node.ELEMENT_NODE){n=i[o];break}if(!l(n))throw new oe("Unable to find first child of the feature info xml document");let r=n.childNodes;for(let o=0;o<r.length;++o){let a=r[o];if(a.nodeType===Node.ELEMENT_NODE){let s={};iZ(a,s),t.push(ZU(a,s))}}return t}function iZ(e,t){let n=!0;for(let i=0;i<e.childNodes.length;++i){let r=e.childNodes[i];r.nodeType===Node.ELEMENT_NODE&&(n=!1),!(r.localName==="Point"||r.localName==="LineString"||r.localName==="Polygon"||r.localName==="boundedBy")&&r.hasChildNodes()&&iZ(r,t)&&(t[r.localName]=r.textContent)}return n}function ZU(e,t){let n=new yp;return n.data=e,n.properties=t,n.configureNameFromProperties(t),n.configureDescriptionFromProperties(t),n}function Hct(e){let t=new XMLSerializer().serializeToString(e),n=document.createElement("div"),i=document.createElement("pre");i.textContent=t,n.appendChild(i);let r=new yp;return r.data=e,r.description=n.innerHTML,[r]}var Gct=/<body>\s*<\/body>/im,Wct=/<ServiceExceptionReport([\s\S]*)<\/ServiceExceptionReport>/im,qct=/<title>([\s\S]*)<\/title>/im;function Cbe(e){if(Gct.test(e)||Wct.test(e))return;let t,n=qct.exec(e);n&&n.length>1&&(t=n[1]);let i=new yp;return i.name=t,i.description=e,i.data=e,[i]}var xp=Mct;function jD(e){e=e??H.EMPTY_OBJECT,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(jD.prototype,{clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._clockOnTick(e),this._reloadFunction())}},times:{get:function(){return this._times},set:function(e){this._times!==e&&(this._times=e,this._clockOnTick(this._clock),this._reloadFunction())}},currentInterval:{get:function(){return this._times.get(this._currentIntervalIndex)}}});jD.prototype.getFromCache=function(e,t,n,i){let r=vbe(e,t,n),o,a=this._tileCache[this._currentIntervalIndex];if(l(a)&&l(a[r])){let s=a[r];o=s.promise.catch(function(c){throw i.state=s.request.state,c}),delete a[r]}return o};jD.prototype.checkApproachingInterval=function(e,t,n,i){let r=vbe(e,t,n),o=this._tilesRequestedForInterval,a=Ebe(this),s={key:r,priorityFunction:i.priorityFunction};(!l(a)||!Sbe(this,s,a))&&o.push(s),o.length>=512&&o.splice(0,256)};jD.prototype._clockOnTick=function(e){let t=e.currentTime,i=this._times.indexOf(t),r=this._currentIntervalIndex;if(i!==r){let a=this._tileCache[r];for(let s in a)a.hasOwnProperty(s)&&a[s].request.cancel();delete this._tileCache[r],this._tilesRequestedForInterval=[],this._currentIntervalIndex=i,this._reloadFunction();return}let o=Ebe(this);if(l(o)){let a=this._tilesRequestedForInterval,s=!0;for(;s&&a.length!==0;){let c=a.pop();s=Sbe(this,c,o),s||a.push(c)}}};function vbe(e,t,n){return`${e}-${t}-${n}`}function Yct(e){let t=e.split("-");if(t.length===3)return{x:Number(t[0]),y:Number(t[1]),level:Number(t[2])}}function Ebe(e){let t=e._times;if(!l(t))return;let n=e._clock,i=n.currentTime,r=n.canAnimate&&n.shouldAnimate,o=n.multiplier;if(!r&&o!==0)return;let a,s=t.indexOf(i);if(s<0)return;let c=t.get(s);return o>0?(a=K.secondsDifference(c.stop,i),++s):(a=K.secondsDifference(c.start,i),--s),a/=o,s>=0&&a<=5?t.get(s):void 0}function Sbe(e,t,n){let i=e._times.indexOf(n.start),r=e._tileCache,o=r[i];l(o)||(o=r[i]={});let a=t.key;if(l(o[a]))return!0;let s=Yct(a),c=new Eo({throttle:!1,throttleByServer:!0,type:Za.IMAGERY,priorityFunction:t.priorityFunction}),u=e._requestImageFunction(s.x,s.y,s.level,c,n);return l(u)?(o[a]={promise:u,request:c},!0):!1}var NE=jD;var Xct=[3034,3035,3042,3043,3044],Kct=[4471,4559];function Bh(e){if(e=e??H.EMPTY_OBJECT,l(e.times)&&!l(e.clock))throw new pe("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=De.createIfNeeded(e.url),n=De.createIfNeeded(this._getFeatureInfoUrl);t.setQueryParameters(Bh.DefaultParameters,!0),n.setQueryParameters(Bh.GetFeatureInfoDefaultParameters,!0),l(e.parameters)&&t.setQueryParameters(wbe(e.parameters)),l(e.getFeatureInfoParameters)&&n.setQueryParameters(wbe(e.getFeatureInfoParameters));let i=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new NE({clock:e.clock,times:e.times,requestImageFunction:function(a,s,c,u,f){return Ibe(i,a,s,c,u,f)},reloadFunction:function(){l(i._reload)&&i._reload()}}));let r={};if(r.layers=e.layers,r.bbox="{westProjected},{southProjected},{eastProjected},{northProjected}",r.width="{width}",r.height="{height}",parseFloat(t.queryParameters.version)>=1.3){r.crs=e.crs??(e.tilingScheme&&e.tilingScheme.projection instanceof _i?"EPSG:3857":"CRS:84");let a=r.crs.split(":");if(a[0]==="EPSG"&&a.length===2){let s=Number(a[1]);(s>=4e3&&s<5e3&&!Kct.includes(s)||Xct.includes(s))&&(r.bbox="{southProjected},{westProjected},{northProjected},{eastProjected}")}}else r.srs=e.srs??(e.tilingScheme&&e.tilingScheme.projection instanceof _i?"EPSG:3857":"EPSG:4326");t.setQueryParameters(r,!0),n.setQueryParameters(r,!0);let o={query_layers:e.layers,info_format:"{format}"};parseFloat(n.queryParameters.version)>=1.3?(o.i="{i}",o.j="{j}"):(o.x="{i}",o.y="{j}"),n.setQueryParameters(o,!0),this._resource=t,this._pickFeaturesResource=n,this._layers=e.layers,this._tileProvider=new Sa({url:t,pickFeaturesUrl:n,tilingScheme:e.tilingScheme??new $i({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??Bh.DefaultGetFeatureInfoFormats,enablePickFeatures:e.enablePickFeatures})}function Ibe(e,t,n,i,r,o){let a=l(o)?o.data:void 0,s=e._tileProvider;return l(a)&&s._resource.setQueryParameters(a),s.requestImage(t,n,i,r)}function $ct(e,t,n,i,r,o,a){let s=l(a)?a.data:void 0,c=e._tileProvider;return l(s)&&c._pickFeaturesResource.setQueryParameters(s),c.pickFeatures(t,n,i,r,o)}Object.defineProperties(Bh.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}}});Bh.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)};Bh.prototype.requestImage=function(e,t,n,i){let r,o=this._timeDynamicImagery,a;return l(o)&&(a=o.currentInterval,r=o.getFromCache(e,t,n,i)),l(r)||(r=Ibe(this,e,t,n,i,a)),l(r)&&l(o)&&o.checkApproachingInterval(e,t,n,i),r};Bh.prototype.pickFeatures=function(e,t,n,i,r){let o=this._timeDynamicImagery,a=l(o)?o.currentInterval:void 0;return $ct(this,e,t,n,i,r,a)};Bh.DefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"});Bh.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"});Bh.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new xp("json","application/json")),Object.freeze(new xp("xml","text/xml")),Object.freeze(new xp("text","text/html"))]);function wbe(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var QU=Bh;function uf(e){e=e??H.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._getFeatureInfoUrl=e.getFeatureInfoUrl??e.url;let t=De.createIfNeeded(e.url),n=De.createIfNeeded(this._getFeatureInfoUrl),i=e.style,r=e.tileMatrixSetID,o=t.url,a=e.format??"image/jpeg",s=o.match(/{/g);if(!l(s)||s.length===1&&/{s}/.test(o)?(t.setQueryParameters(uf.DefaultParameters,!0),this._useKvp=!0):(t.setTemplateValues(uf.DefaultParameters,!0),this._useKvp=!1),this._useKvp){n.setQueryParameters(uf.GetFeatureInfoDefaultParameters,!0),l(e.getFeatureInfoParameters)&&n.setQueryParameters(Pbe(e.getFeatureInfoParameters));let f={infoformat:"{format}",i:"{i}",j:"{j}"};n.setQueryParameters(f,!0)}else n.setTemplateValues(uf.GetFeatureInfoDefaultParameters,!0),l(e.getFeatureInfoParameters)&&n.setTemplateValues(Pbe(e.getFeatureInfoParameters));this._resource=t,this._tileMatrixLabels=e.tileMatrixLabels,this._format=a,this._dimensions=e.dimensions,this._tilematrixset=r;let c={};c.tilematrix="{TileMatrix}",c.layer=e.layer,c.style=i,c.tilerow="{TileRow}",c.tilecol="{TileCol}",c.tilematrixset=r,this._useKvp?(t.setQueryParameters(c,!0),t.setQueryParameters({format:a},!0),n.setQueryParameters({format:a},!0),n.setQueryParameters(c,!0)):(c.Style=i,t.setTemplateValues(c),t.setTemplateValues({format:a}),n.setTemplateValues(c));let u=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new NE({clock:e.clock,times:e.times,requestImageFunction:function(f,d,p,g,m){return Dbe(u,f,d,p,g,m)},reloadFunction:function(){l(u._reload)&&u._reload()}})),this._errorEvent=new be,this._tileProvider=new Sa({url:t,pickFeaturesUrl:n,tilingScheme:e.tilingScheme??new So({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??uf.DefaultGetFeatureInfoFormats,enablePickFeatures:e.enablePickFeatures??(this._useKvp||l(e.getFeatureInfoUrl)),customTags:Zct(this)})}function Dbe(e,t,n,i,r,o){let a=e._tileProvider;return Rbe(e,a._resource,o),a.requestImage(t,n,i,r)}function Jct(e,t,n,i,r,o,a){let s=e._tileProvider;return Rbe(e,s._pickFeaturesResource,a),s.pickFeatures(t,n,i,r,o)}Object.defineProperties(uf.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},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}},format:{get:function(){return this._format}},credit:{get:function(){return this._tileProvider.credit}},hasAlphaChannel:{get:function(){return!0}},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}},dimensions:{get:function(){return this._dimensions},set:function(e){this._dimensions!==e&&(this._dimensions=e,l(this._reload)&&this._reload())}},getFeatureInfoUrl:{get:function(){return this._getFeatureInfoUrl}}});uf.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)};uf.prototype.requestImage=function(e,t,n,i){let r,o=this._timeDynamicImagery,a;return l(o)&&(a=o.currentInterval,r=o.getFromCache(e,t,n,i)),l(r)||(r=Dbe(this,e,t,n,i,a)),l(r)&&l(o)&&o.checkApproachingInterval(e,t,n,i),r};uf.prototype.pickFeatures=function(e,t,n,i,r){let o=this._timeDynamicImagery,a=l(o)?o.currentInterval:void 0;return Jct(this,e,t,n,i,r,a)};uf.DefaultParameters=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetTile"});uf.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetFeatureInfo"});uf.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new xp("json","application/json")),Object.freeze(new xp("xml","text/xml")),Object.freeze(new xp("text","text/html"))]);function Rbe(e,t,n){let i=e._dimensions,r=l(n)?n.data:void 0;if(!e._useKvp)l(i)&&t.setTemplateValues(i),l(r)&&t.setTemplateValues(r);else{let o={};l(i)&&(o=Ot(o,i)),l(r)&&(o=Ot(o,r)),t.setQueryParameters(o)}}function Zct(e){function t(n){let i=e._tileMatrixLabels;return l(i)?i[n]:n.toString()}return{TileMatrix:function(n,i,r,o){return t(o)},tilematrix:function(n,i,r,o){return t(o)},TileRow:function(n,i,r){return r.toString()},tilerow:function(n,i,r){return r.toString()},TileCol:function(n,i,r){return i.toString()},tilecol:function(n,i,r){return i.toString()},TileMatrixSet:function(n){return e._tilematrixset},tilematrixset:function(n){return e._tilematrixset}}}function Pbe(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var eV=uf;var Obe=/\/$/;function ig(e){e=e??H.EMPTY_OBJECT,this._maximumLevel=e.maximumLevel??22,this._minimumLevel=e.minimumLevel??0,this._session=e.session,this._key=e.key,this._tileWidth=e.tileWidth,this._tileHeight=e.tileHeight;let t=e.url instanceof ga?e.url:De.createIfNeeded(e.url??xs.mapTilesApiEndpoint),n=t.getUrlComponent();Obe.test(n)||(n+="/");let i=`${n}v1/2dtiles/{z}/{x}/{y}`;this._viewportUrl=`${n}tile/v1/viewport`,t.url=i,t.setQueryParameters({session:encodeURIComponent(e.session),key:encodeURIComponent(e.key)}),this._resource=t.clone();let r;l(e.credit)&&(r=e.credit,typeof r=="string"&&(r=new wt(r)));let o=new Sa({url:t,credit:r,tileWidth:e.tileWidth,tileHeight:e.tileHeight,ellipsoid:e.ellipsoid,rectangle:e.rectangle,maximumLevel:this._maximumLevel,minimumLevel:this._minimumLevel});o._resource=t,this._imageryProvider=o,this._tileCredits=t.credits,this._attributionsByLevel=void 0}Object.defineProperties(ig.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}}});ig.fromIonAssetId=async function(e){e=e??{},e.mapType=e.mapType??"satellite",e.language=e.language??"en_US",e.region=e.region??"US";let t=e.overlayLayerType,n=Mbe(e),i=ga._createEndpointResource(e.assetId,{queryParameters:{options:JSON.stringify(n)}}),r={language:e.language,region:e.region,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle,credit:e.credit},o=await i.fetchJson(),a=o.options.url;return delete o.options.url,o.options={...o.options,...r},rZ(a,o,i)};ig.fromUrl=async function(e){e=e??{},e.mapType=e.mapType??"satellite",e.language=e.language??"en_US",e.region=e.region??"US",e.url=e.url??xs.mapTilesApiEndpoint,e.key=e.key??xs.defaultApiKey;let t=e.overlayLayerType,n=await elt(e);return new ig({...n,...e,credit:e.credit??xs.getDefaultCredit()})};ig.prototype.getTileCredits=function(e,t,n){if(!l(this._attributionsByLevel)||!l(this._tileCredits))return;let r=this._attributionsByLevel.get(n);return l(this._tileCredits)?this._tileCredits.concat(r):r};ig.prototype.requestImage=function(e,t,n,i){let r=this._imageryProvider.requestImage(e,t,n,i);if(l(r))return l(this._attributionsByLevel)?r:Promise.all([r,this.getViewportCredits()]).then(o=>o[0])};ig.prototype.pickFeatures=function(e,t,n,i,r){};ig.prototype.getViewportCredits=async function(){let e=this._maximumLevel,t=[];for(let r=0;r<e+1;r++)t.push(Qct(this._resource,this._viewportUrl,r));let n=await Promise.all(t),i=new Map;for(let r=0;r<e+1;r++){let o=[],a=n[r];if(a){let s=new wt(a);o.push(s)}i.set(r,o)}return this._attributionsByLevel=i,i};async function Qct(e,t,n){return(await e.getDerivedResource({url:t,queryParameters:{zoom:n,north:90,south:-90,east:180,west:-180},data:JSON.stringify(H.EMPTY_OBJECT)}).fetchJson()).copyright}function Mbe(e){let{mapType:t,overlayLayerType:n,styles:i}=e,r={mapType:t,overlay:!1};return t==="terrain"&&!l(n)&&(r.layerTypes=["layerRoadmap"]),l(n)&&(r.mapType="satellite",r.overlay=!0,r.layerTypes=[n]),l(i)&&(r.styles=i),r}async function elt(e){let{language:t,region:n,key:i,url:r}=e,o=Mbe(e),a=r.url??r;Obe.test(a)||(a+="/");let s=await De.post({url:`${a}v1/createSession`,queryParameters:{key:i},data:JSON.stringify({...o,language:t,region:n})});return JSON.parse(s)}var tV=ig;var tlt=/\/$/;function FE(e){e=e??{};let t=e.tilesetId??"microsoft.imagery";this._maximumLevel=e.maximumLevel??22,this._minimumLevel=e.minimumLevel??0,this._subscriptionKey=e.subscriptionKey??e["subscription-key"],this._tilesetId=e.tilesetId;let n=e.url instanceof ga?e.url:De.createIfNeeded(e.url??"https://atlas.microsoft.com/"),i=n.getUrlComponent();tlt.test(i)||(i+="/");let r=`${i}map/tile`;this._viewportUrl=`${i}map/attribution`,n.url=r,n.setQueryParameters({"api-version":"2024-04-01",tilesetId:t,"subscription-key":this._subscriptionKey,zoom:"{z}",x:"{x}",y:"{y}"}),this._resource=n;let o;l(e.credit)&&(o=e.credit,typeof o=="string"&&(o=new wt(o)));let a=new Sa({...e,maximumLevel:this._maximumLevel,minimumLevel:this._minimumLevel,url:n,credit:o});a._resource=n,this._imageryProvider=a,this._tileCredits=n.credits,this._attributionsByLevel=void 0}Object.defineProperties(FE.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}}});FE.prototype.getTileCredits=function(e,t,n){if(!l(this._attributionsByLevel)||!l(this._tileCredits))return;let r=this._attributionsByLevel.get(n);return l(this._tileCredits)?this._tileCredits.concat(r):r};FE.prototype.requestImage=function(e,t,n,i){let r=this._imageryProvider.requestImage(e,t,n,i);if(l(r))return l(this._attributionsByLevel)?r:Promise.all([r,this.getViewportCredits()]).then(o=>o[0])};FE.prototype.pickFeatures=function(e,t,n,i,r){};FE.prototype.getViewportCredits=async function(){let e=this._maximumLevel,t=[];for(let r=0;r<e+1;r++)t.push(nlt(this._resource,this._viewportUrl,this._subscriptionKey,this._tilesetId,r));let n=await Promise.all(t),i=new Map;for(let r=0;r<e+1;r++){let o=[],a=n[r].join(",");if(a){let s=new wt(a);o.push(s)}i.set(r,o)}return this._attributionsByLevel=i,i};async function nlt(e,t,n,i,r){return(await e.getDerivedResource({url:t,queryParameters:{zoom:r,bounds:"-180,-90,180,90"},data:JSON.stringify(H.EMPTY_OBJECT)}).fetchJson()).copyrights}var nV=FE;var ilt=async(e,t,n)=>sx.fromUrl(new ga(t,n)),rlt=async(e,{options:t})=>Sy.fromUrl(e,t),olt=async(e,{options:t})=>HU.fromUrl(e,t),alt=async(e,{options:t})=>{let n=t.channel;return delete t.channel,KU.fromUrl(e,n,t)},slt=async(e,{options:t})=>new $U({url:e,...t}),clt=async(e,{options:t})=>JU.fromUrl(e,t),llt=async(e,{options:t})=>sx.fromUrl(e,t),ult=async(e,{options:t})=>new Sa({url:e,...t}),flt=async(e,{options:t})=>new QU({url:e,...t}),dlt=async(e,{options:t})=>new eV({url:e,...t}),rZ=async(e,t,n)=>{delete t.externalType,t.url=e;let i=new ga(t,n),r=(o,a)=>{delete a.externalType,a.url=e;let{options:s}=a;o.setQueryParameters({session:s.session,key:s.key})};return i.refreshCallback=r,new tV({...t.options,url:i})},hlt=async(e,t,n)=>{delete t.externalType,t.url=e;let i=new ga(t,n),r=(o,a)=>{delete a.externalType,a.url=e;let{options:s}=a;o.setQueryParameters({"subscription-key":s["subscription-key"]})};return i.refreshCallback=r,new nV({...t.options,url:i})},mlt={ARCGIS_MAPSERVER:rlt,BING:olt,GOOGLE_EARTH:alt,MAPBOX:slt,SINGLE_TILE:clt,TMS:llt,URL_TEMPLATE:ult,WMS:flt,WMTS:dlt,GOOGLE_2D_MAPS:rZ,AZURE_MAPS:hlt,defaultFactoryCallback:ilt},HD=Object.freeze(mlt);function Tp(){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 be}Object.defineProperties(Tp.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(){}}});Tp.fromAssetId=async function(e,t){t=t??H.EMPTY_OBJECT;let n=ga._createEndpointResource(e,t),i=e.toString()+t.accessToken+t.server,r=Tp._endpointCache[i];l(r)||(r=n.fetchJson(),Tp._endpointCache[i]=r);let o=await r;if(o.type!=="IMAGERY")throw new oe(`Cesium ion asset ${e} is not an imagery asset.`);let a=o.externalType,s=HD.defaultFactoryCallback;o=Xe(o,!0),o.options=o.options??{};let c=o.options?.url;if(delete t.url,l(a)&&(s=HD[a],!l(s)))throw new oe(`Unrecognized Cesium ion imagery type: ${a}`);let u=await s(c,o,n),f=new Tp(t);return u.errorEvent.addEventListener(function(d){d.provider=f,f._errorEvent.raiseEvent(d)}),f._tileCredits=ga.getCreditsFromEndpoint(o,n),f._imageryProvider=u,f};Tp.prototype.getTileCredits=function(e,t,n){let i=this._imageryProvider.getTileCredits(e,t,n);return l(i)?this._tileCredits.concat(i):this._tileCredits};Tp.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};Tp.prototype.pickFeatures=function(e,t,n,i,r){return this._imageryProvider.pickFeatures(e,t,n,i,r)};Tp._endpointCache={};var Eu=Tp;var Lbe={AERIAL:2,AERIAL_WITH_LABELS:3,ROAD:4};Object.freeze(Lbe);var wy=Lbe;function plt(e){e=e??H.EMPTY_OBJECT;let t=e.style??wy.AERIAL;return Eu.fromAssetId(t)}var Iy=plt;var iV=`uniform sampler2D u_texture;
|
|
|
|
in vec2 v_textureCoordinates;
|
|
|
|
void main()
|
|
{
|
|
out_FragColor = texture(u_texture, v_textureCoordinates);
|
|
}
|
|
`;var rV=`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 Nbe={UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7};Object.freeze(Nbe);var jn=Nbe;function BE(e,t,n,i,r){if(this.imageryLayer=e,this.x=t,this.y=n,this.level=i,this.request=void 0,i!==0){let o=t/2|0,a=n/2|0,s=i-1;this.parent=e.getImageryFromCache(o,a,s)}this.state=jn.UNLOADED,this.imageUrl=void 0,this.image=void 0,this.texture=void 0,this.textureWebMercator=void 0,this.credits=void 0,this.referenceCount=0,!l(r)&&e.ready&&(r=e.imageryProvider.tilingScheme.tileXYToRectangle(t,n,i)),this.rectangle=r}BE.createPlaceholder=function(e){let t=new BE(e,0,0,0);return t.addReference(),t.state=jn.PLACEHOLDER,t};BE.prototype.addReference=function(){++this.referenceCount};BE.prototype.releaseReference=function(){return--this.referenceCount,this.referenceCount===0?(this.imageryLayer.removeImageryFromCache(this),l(this.parent)&&this.parent.releaseReference(),l(this.image)&&l(this.image.destroy)&&this.image.destroy(),l(this.texture)&&this.texture.destroy(),l(this.textureWebMercator)&&this.texture!==this.textureWebMercator&&this.textureWebMercator.destroy(),ue(this),0):this.referenceCount};BE.prototype.processStateMachine=function(e,t,n){this.state===jn.UNLOADED&&!n&&(this.state=jn.TRANSITIONING,this.imageryLayer._requestImagery(this)),this.state===jn.RECEIVED&&(this.state=jn.TRANSITIONING,this.imageryLayer._createTexture(e.context,this));let i=this.state===jn.READY&&t&&!this.texture;(this.state===jn.TEXTURE_LOADED||i)&&(this.state=jn.TRANSITIONING,this.imageryLayer._reprojectTexture(e,this,t))};var GD=BE;function oZ(e,t,n){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=n}oZ.prototype.freeResources=function(){l(this.readyImagery)&&this.readyImagery.releaseReference(),l(this.loadingImagery)&&this.loadingImagery.releaseReference()};oZ.prototype.processStateMachine=function(e,t,n){let i=this.loadingImagery,r=i.imageryLayer;if(i.processStateMachine(t,!this.useWebMercatorT,n),i.state===jn.READY)return l(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=this.loadingImagery,this.loadingImagery=void 0,this.textureTranslationAndScale=r._calculateTextureTranslationAndScale(e,this),!0;let o=i.parent,a;for(;l(o)&&(o.state!==jn.READY||!this.useWebMercatorT&&!l(o.texture));)o.state!==jn.FAILED&&o.state!==jn.INVALID&&(a=a||o),o=o.parent;return this.readyImagery!==o&&(l(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=o,l(o)&&(o.addReference(),this.textureTranslationAndScale=r._calculateTextureTranslationAndScale(e,this))),i.state===jn.FAILED||i.state===jn.INVALID?l(a)?(a.processStateMachine(t,!this.useWebMercatorT,n),!1):!0:!1};var WD=oZ;function Bi(e,t){this._imageryProvider=e,this._readyEvent=new be,this._errorEvent=new be,t=t??H.EMPTY_OBJECT,e=e??H.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??Bi.DEFAULT_BRIGHTNESS,this.contrast=t.contrast??e._defaultContrast??Bi.DEFAULT_CONTRAST,this.hue=t.hue??e._defaultHue??Bi.DEFAULT_HUE,this.saturation=t.saturation??e._defaultSaturation??Bi.DEFAULT_SATURATION,this.gamma=t.gamma??e._defaultGamma??Bi.DEFAULT_GAMMA,this.splitDirection=t.splitDirection??Bi.DEFAULT_SPLIT,this.minificationFilter=t.minificationFilter??e._defaultMinificationFilter??Bi.DEFAULT_MINIFICATION_FILTER,this.magnificationFilter=t.magnificationFilter??e._defaultMagnificationFilter??Bi.DEFAULT_MAGNIFICATION_FILTER,this.show=t.show??!0,this._minimumTerrainLevel=t.minimumTerrainLevel,this._maximumTerrainLevel=t.maximumTerrainLevel,this._rectangle=t.rectangle??ie.MAX_VALUE,this._maximumAnisotropy=t.maximumAnisotropy,this._imageryCache={},this._skeletonPlaceholder=new WD(GD.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??Bi.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD}Object.defineProperties(Bi.prototype,{imageryProvider:{get:function(){return this._imageryProvider}},ready:{get:function(){return l(this._imageryProvider)}},errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},rectangle:{get:function(){return this._rectangle}}});Bi.DEFAULT_BRIGHTNESS=1;Bi.DEFAULT_CONTRAST=1;Bi.DEFAULT_HUE=0;Bi.DEFAULT_SATURATION=1;Bi.DEFAULT_GAMMA=1;Bi.DEFAULT_SPLIT=jo.NONE;Bi.DEFAULT_MINIFICATION_FILTER=Gt.LINEAR;Bi.DEFAULT_MAGNIFICATION_FILTER=ni.LINEAR;Bi.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD=.004;Bi.fromProviderAsync=function(e,t){let n=new Bi(void 0,t);return blt(n,Promise.resolve(e)),n};Bi.fromWorldImagery=function(e){return e=e??H.EMPTY_OBJECT,Bi.fromProviderAsync(Iy({style:e.style}),e)};Bi.prototype.isBaseLayer=function(){return this._isBaseLayer};Bi.prototype.isDestroyed=function(){return!1};Bi.prototype.destroy=function(){return ue(this)};var kbe=new ie,Fbe=new ie,aZ=new ie,zbe=new ie;Bi.prototype.getImageryRectangle=function(){let e=this._imageryProvider,t=this._rectangle;return ie.intersection(e.rectangle,t)};Bi.prototype._createTileImagerySkeletons=function(e,t,n){let i=e.data;if(!l(t)||l(this._minimumTerrainLevel)&&e.level<this._minimumTerrainLevel||l(this._maximumTerrainLevel)&&e.level>this._maximumTerrainLevel)return!1;l(n)||(n=i.imagery.length);let r=this._imageryProvider;if(!this.ready)return this._skeletonPlaceholder.loadingImagery.addReference(),i.imagery.splice(n,0,this._skeletonPlaceholder),!0;let o=r.tilingScheme.projection instanceof _i&&e.rectangle.north<_i.MaximumLatitude&&e.rectangle.south>-_i.MaximumLatitude,a=ie.intersection(r.rectangle,this._rectangle,kbe),s=ie.intersection(e.rectangle,a,Fbe);if(!l(s)){if(!this.isBaseLayer())return!1;let S=a,P=e.rectangle;s=Fbe,P.south>=S.north?s.north=s.south=S.north:P.north<=S.south?s.north=s.south=S.south:(s.south=Math.max(P.south,S.south),s.north=Math.min(P.north,S.north)),P.west>=S.east?s.west=s.east=S.east:P.east<=S.west?s.west=s.east=S.west:(s.west=Math.max(P.west,S.west),s.east=Math.min(P.east,S.east))}let c=0;s.south>0?c=s.south:s.north<0&&(c=s.north);let f=1*t.getLevelMaximumGeometricError(e.level),d=ylt(this,f,c);d=Math.max(0,d);let p=r.maximumLevel;if(d>p&&(d=p),l(r.minimumLevel)){let S=r.minimumLevel;d<S&&(d=S)}let g=r.tilingScheme,m=g.positionToTileXY(ie.northwest(s),d),y=g.positionToTileXY(ie.southeast(s),d),A=e.rectangle.width/512,b=e.rectangle.height/512,x=g.tileXYToRectangle(m.x,m.y,d);Math.abs(x.south-e.rectangle.north)<b&&m.y<y.y&&++m.y,Math.abs(x.east-e.rectangle.west)<A&&m.x<y.x&&++m.x;let T=g.tileXYToRectangle(y.x,y.y,d);Math.abs(T.north-e.rectangle.south)<b&&y.y>m.y&&--y.y,Math.abs(T.west-e.rectangle.east)<A&&y.x>m.x&&--y.x;let C=ie.clone(e.rectangle,zbe),E=g.tileXYToRectangle(m.x,m.y,d),w=ie.intersection(E,a,aZ),D;o?(g.rectangleToNativeRectangle(C,C),g.rectangleToNativeRectangle(E,E),g.rectangleToNativeRectangle(w,w),g.rectangleToNativeRectangle(a,a),D=g.tileXYToNativeRectangle.bind(g),A=C.width/512,b=C.height/512):D=g.tileXYToRectangle.bind(g);let R,M=0,N=1,_;!this.isBaseLayer()&&Math.abs(w.west-C.west)>=A&&(M=Math.min(1,(w.west-C.west)/C.width)),!this.isBaseLayer()&&Math.abs(w.north-C.north)>=b&&(N=Math.max(0,(w.north-C.south)/C.height));let v=N;for(let S=m.x;S<=y.x;S++)if(R=M,E=D(S,m.y,d),w=ie.simpleIntersection(E,a,aZ),!!l(w)){M=Math.min(1,(w.east-C.west)/C.width),S===y.x&&(this.isBaseLayer()||Math.abs(w.east-C.east)<A)&&(M=1),N=v;for(let P=m.y;P<=y.y;P++){if(_=N,E=D(S,P,d),w=ie.simpleIntersection(E,a,aZ),!l(w))continue;N=Math.max(0,(w.south-C.south)/C.height),P===y.y&&(this.isBaseLayer()||Math.abs(w.south-C.south)<b)&&(N=0);let L=new ae(R,N,M,_),F=this.getImageryFromCache(S,P,d);i.imagery.splice(n,0,new WD(F,L,o)),++n}}return!0};Bi.prototype._calculateTextureTranslationAndScale=function(e,t){let n=t.readyImagery.rectangle,i=e.rectangle;if(t.useWebMercatorT){let c=t.readyImagery.imageryLayer.imageryProvider.tilingScheme;n=c.rectangleToNativeRectangle(n,kbe),i=c.rectangleToNativeRectangle(i,zbe)}let r=i.width,o=i.height,a=r/n.width,s=o/n.height;return new ae(a*(i.west-n.west)/r,s*(i.south-n.south)/o,a,s)};Bi.prototype._requestImagery=function(e){let t=this._imageryProvider,n=this;function i(a){if(!l(a))return r();e.image=a,e.state=jn.RECEIVED,e.request=void 0,qr.reportSuccess(n._requestImageError)}function r(a){if(e.request.state===Ti.CANCELLED){e.state=jn.UNLOADED,e.request=void 0;return}e.state=jn.FAILED,e.request=void 0;let s=`Failed to obtain image tile X: ${e.x} Y: ${e.y} Level: ${e.level}.`;n._requestImageError=qr.reportError(n._requestImageError,t,t.errorEvent,s,e.x,e.y,e.level,a),n._requestImageError.retry&&o()}function o(){let a=new Eo({throttle:!1,throttleByServer:!0,type:Za.IMAGERY});e.request=a,e.state=jn.TRANSITIONING;let s=t.requestImage(e.x,e.y,e.level,a);if(!l(s)){e.state=jn.UNLOADED,e.request=void 0;return}l(t.getTileCredits)&&(e.credits=t.getTileCredits(e.x,e.y,e.level)),s.then(function(c){i(c)}).catch(function(c){r(c)})}o()};Bi.prototype._createTextureWebGL=function(e,t){let n=new Ut({minificationFilter:this.minificationFilter,magnificationFilter:this.magnificationFilter}),i=t.image;return l(i.internalFormat)?new Et({context:e,pixelFormat:i.internalFormat,width:i.width,height:i.height,source:{arrayBufferView:i.bufferView},sampler:n}):new Et({context:e,source:i,pixelFormat:this._imageryProvider.hasAlphaChannel?He.RGBA:He.RGB,sampler:n})};Bi.prototype._createTexture=function(e,t){let n=this._imageryProvider,i=t.image;if(l(n.tileDiscardPolicy)){let o=n.tileDiscardPolicy;if(l(o)){if(!o.isReady()){t.state=jn.RECEIVED;return}if(o.shouldDiscardImage(i)){t.state=jn.INVALID;return}}}let r=this._createTextureWebGL(e,t);n.tilingScheme.projection instanceof _i?t.textureWebMercator=r:t.texture=r,t.image=void 0,t.state=jn.TEXTURE_LOADED};function Bbe(e,t,n){return`${e}:${t}:${n}`}Bi.prototype._finalizeReprojectTexture=function(e,t){let n=this.minificationFilter,i=this.magnificationFilter;if(n===Gt.LINEAR&&i===ni.LINEAR&&!He.isCompressedFormat(t.pixelFormat)&&I.isPowerOfTwo(t.width)&&I.isPowerOfTwo(t.height)){n=Gt.LINEAR_MIPMAP_LINEAR;let o=Ft.maximumTextureFilterAnisotropy,a=Math.min(o,this._maximumAnisotropy??o),s=Bbe(n,i,a),c=e.cache.imageryLayerMipmapSamplers;l(c)||(c={},e.cache.imageryLayerMipmapSamplers=c);let u=c[s];l(u)||(u=c[s]=new Ut({wrapS:on.CLAMP_TO_EDGE,wrapT:on.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i,maximumAnisotropy:a})),t.generateMipmap(sh.NICEST),t.sampler=u}else{let o=Bbe(n,i,0),a=e.cache.imageryLayerNonMipmapSamplers;l(a)||(a={},e.cache.imageryLayerNonMipmapSamplers=a);let s=a[o];l(s)||(s=a[o]=new Ut({wrapS:on.CLAMP_TO_EDGE,wrapT:on.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i})),t.sampler=s}};Bi.prototype._reprojectTexture=function(e,t,n){let i=t.textureWebMercator||t.texture,r=t.rectangle,o=e.context;if(n=n??!0,n&&!(this._imageryProvider.tilingScheme.projection instanceof ki)&&r.width/i.width>1e-5){let a=this;t.addReference();let s=new lu({persists:!0,owner:this,preExecute:function(c){_lt(c,o,i,t.rectangle)},postExecute:function(c){t.texture=c,a._finalizeReprojectTexture(o,c),t.state=jn.READY,t.releaseReference()},canceled:function(){t.state=jn.TEXTURE_LOADED,t.releaseReference()}});this._reprojectComputeCommands.push(s)}else n&&(t.texture=i),this._finalizeReprojectTexture(o,i),t.state=jn.READY};Bi.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};Bi.prototype.cancelReprojections=function(){this._reprojectComputeCommands.forEach(function(e){l(e.canceled)&&e.canceled()}),this._reprojectComputeCommands.length=0};Bi.prototype.getImageryFromCache=function(e,t,n,i){let r=Ube(e,t,n),o=this._imageryCache[r];return l(o)||(o=new GD(this,e,t,n,i),this._imageryCache[r]=o),o.addReference(),o};Bi.prototype.removeImageryFromCache=function(e){let t=Ube(e.x,e.y,e.level);delete this._imageryCache[t]};function Ube(e,t,n){return JSON.stringify([e,t,n])}var oV={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new k,texture:void 0},glt=fn.supportsTypedArrays()?new Float32Array(128):void 0;function _lt(e,t,n,i){let r=t.cache.imageryLayer_reproject;if(!l(r)){r=t.cache.imageryLayer_reproject={vertexArray:void 0,shaderProgram:void 0,sampler:void 0,destroy:function(){l(this.framebuffer)&&this.framebuffer.destroy(),l(this.vertexArray)&&this.vertexArray.destroy(),l(this.shaderProgram)&&this.shaderProgram.destroy()}};let A=new Float32Array(256),b=0;for(let w=0;w<64;++w){let D=w/63;A[b++]=0,A[b++]=D,A[b++]=1,A[b++]=D}let x={position:0,webMercatorT:1},T=Vr.getRegularGridIndices(2,64),C=Ze.createIndexBuffer({context:t,typedArray:T,usage:Oe.STATIC_DRAW,indexDatatype:Ve.UNSIGNED_SHORT});r.vertexArray=new Vn({context:t,attributes:[{index:x.position,vertexBuffer:Ze.createVertexBuffer({context:t,typedArray:A,usage:Oe.STATIC_DRAW}),componentsPerAttribute:2},{index:x.webMercatorT,vertexBuffer:Ze.createVertexBuffer({context:t,sizeInBytes:512,usage:Oe.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:C});let E=new Ge({sources:[rV]});r.shaderProgram=Zt.fromCache({context:t,vertexShaderSource:E,fragmentShaderSource:iV,attributeLocations:x}),r.sampler=new Ut({wrapS:on.CLAMP_TO_EDGE,wrapT:on.CLAMP_TO_EDGE,minificationFilter:Gt.LINEAR,magnificationFilter:ni.LINEAR})}n.sampler=r.sampler;let o=n.width,a=n.height;oV.textureDimensions.x=o,oV.textureDimensions.y=a,oV.texture=n;let s=Math.sin(i.south),c=.5*Math.log((1+s)/(1-s));s=Math.sin(i.north);let f=1/(.5*Math.log((1+s)/(1-s))-c),d=new Et({context:t,width:o,height:a,pixelFormat:n.pixelFormat,pixelDatatype:n.pixelDatatype,preMultiplyAlpha:n.preMultiplyAlpha});I.isPowerOfTwo(o)&&I.isPowerOfTwo(a)&&d.generateMipmap(sh.NICEST);let p=i.south,g=i.north,m=glt,y=0;for(let A=0;A<64;++A){let b=A/63,x=I.lerp(p,g,b);s=Math.sin(x);let C=(.5*Math.log((1+s)/(1-s))-c)*f;m[y++]=C,m[y++]=C}r.vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(m),e.shaderProgram=r.shaderProgram,e.outputTexture=d,e.uniformMap=oV,e.vertexArray=r.vertexArray}function ylt(e,t,n){let i=e._imageryProvider,r=i.tilingScheme,o=r.ellipsoid,a=e._imageryProvider.tilingScheme.projection instanceof ki?1:Math.cos(n),s=r.rectangle,u=o.maximumRadius*s.width*a/(i.tileWidth*r.getNumberOfXTilesAtLevel(0))/t,f=Math.log(u)/Math.log(2);return Math.round(f)|0}function Alt(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function blt(e,t){let n;try{if(n=await Promise.resolve(t),e.isDestroyed())return;e._imageryProvider=n,e._readyEvent.raiseEvent(n)}catch(i){Alt(e._errorEvent,i)}}var wa=Bi;var sZ=class{constructor(){this.alpha=!1,this.brightness=!1,this.contrast=!1,this.hue=!1,this.saturation=!1,this.gamma=!1,this.colorToAlpha=!1}},aV=sZ;var cZ=class{constructor(t,n,i,r){this._minX=t??0,this._minY=n??0,this._maxX=i??0,this._maxY=r??0}get minX(){return this._minX}set minX(t){this._minX=t}get minY(){return this._minY}set minY(t){this._minY=t}get maxX(){return this._maxX}set maxX(t){this._maxX=t}get maxY(){return this._maxY}set maxY(t){this._maxY=t}contains(t,n){return t>=this.minX&&t<this.maxX&&n>=this.minY&&n<this.maxY}containsExclusive(t,n){return t>this.minX&&t<this.maxX&&n>this.minY&&n<this.maxY}containsInclusive(t,n){return t>=this.minX&&t<=this.maxX&&n>=this.minY&&n<=this.maxY}},qD=cZ;var xlt=new ie,Vbe=new ie,Tlt=new ie,Clt=new ie,vlt=new ie,Elt=new ie,lZ=class e{constructor(t,n,i,r,o){this._x=t,this._y=n,this._level=i,this._textureCoordinateRectangle=r,this._imagery=o}get x(){return this._x}get y(){return this._y}get level(){return this._level}get textureCoordinateRectangle(){return this._textureCoordinateRectangle}get imagery(){return this._imagery}static createImageryCoverages(t,n,i){if(!n.show)return[];let r=n.imageryProvider,o=e._clampImageryLevel(r,i),a=ie.intersection(r.rectangle,n.rectangle,xlt),s=r.tilingScheme,c=e._computeImageryRange(t,a,s,o),u=Clt;s.rectangleToNativeRectangle(t,u);let f=vlt;s.rectangleToNativeRectangle(a,f);let d=(g,m,y)=>{let A=s.tileXYToRectangle(g,m,y),b=ie.intersection(A,a,Tlt);if(!l(b))return;let x=Elt;return s.rectangleToNativeRectangle(b,x),x};return e._computeImageryCoverages(n,c,o,u,d)}static _clampImageryLevel(t,n){let i=t.minimumLevel??0,r=t.maximumLevel??Number.POSITIVE_INFINITY,o=Math.min(r-1,Math.max(i,n));return Math.floor(o)}static _computeImageryRange(t,n,i,r){let o=e._computeOverlappedRectangle(t,n),a=i.positionToTileXY(ie.northwest(o),r),s=i.positionToTileXY(ie.southeast(o),r),c=new qD;c.minX=a.x,c.minY=a.y,c.maxX=s.x,c.maxY=s.y;let u=t.width/512,f=t.height/512,d=i.tileXYToRectangle(c.minX,c.minY,r);Math.abs(d.south-t.north)<f&&c.minY<c.maxY&&++c.minY,Math.abs(d.east-t.west)<u&&c.minX<c.maxX&&++c.minX;let m=i.tileXYToRectangle(c.maxX,c.maxY,r);return Math.abs(m.north-t.south)<f&&c.maxY>c.minY&&--c.maxY,Math.abs(m.west-t.east)<u&&c.maxX>c.minX&&--c.maxX,c}static _clampRectangle(t,n,i){return l(i)||(i=new ie),t.south>=n.north?i.north=i.south=n.north:t.north<=n.south?i.north=i.south=n.south:(i.south=Math.max(t.south,n.south),i.north=Math.min(t.north,n.north)),t.west>=n.east?i.west=i.east=n.east:t.east<=n.west?i.west=i.east=n.west:(i.west=Math.max(t.west,n.west),i.east=Math.min(t.east,n.east)),i}static _computeOverlappedRectangle(t,n){let i=ie.intersection(t,n,Vbe);return l(i)?i:e._clampRectangle(t,n,Vbe)}static _computeImageryCoverages(t,n,i,r,o){let a=[];for(let s=n.minX;s<=n.maxX;s++){let c=o(s,n.maxY,i);if(l(c))for(let u=n.minY;u<=n.maxY;u++){let f=o(s,u,i);if(!l(f))continue;let d=e._localizeToCartesianRectangle(f,r,void 0),p=t.getImageryFromCache(s,u,i),g=new e(s,u,i,d,p);a.push(g)}}return a}static _localizeToCartesianRectangle(t,n,i){l(i)||(i=new qD);let r=1/n.width,o=1/n.height;return i.minX=(t.west-n.west)*r,i.minY=(t.south-n.south)*o,i.maxX=(t.east-n.west)*r,i.maxY=(t.north-n.south)*o,i}},YD=lZ;var uZ=class e{static createTextureCoordinatesForMappedPositions(t,n){let i=t.cartographicPositions,r=t.cartographicBoundingRectangle,o=t.numPositions;return e._createTextureCoordinates(i,o,r,n)}static _createTextureCoordinates(t,n,i,r){let o=new Je;Je.fromRectangle(i,r,o);let a=e.createProjectedPositions(t,r),s=e.computeTexCoords(a,o);return e.createTypedArrayFromCartesians2(n,s)}static createTextureCoordinatesAttributeForMappedPositions(t,n){let i=e.createTextureCoordinatesForMappedPositions(t,n);return e.createTexCoordAttribute(i)}static createCartographicPositions(t,n,i){let r=Ps.readAttributeAsTypedArray(t),o=t.type,a=Vt.getNumberOfComponents(o),s=e.createIterableCartesian3FromTypedArray(r,a),c=e.transformCartesians3(s,n);return e.transformToCartographic(c,i)}static createIterableCartesian3FromTypedArray(t,n){let i=new h,r=t.length/n;return{[Symbol.iterator]:function*(){for(let a=0;a<r;a++)i.x=t[a*n+0],i.y=t[a*n+1],i.z=t[a*n+2],yield i}}}static map(t,n){return{[Symbol.iterator]:function*(){for(let r of t)yield n(r)}}}static computeCartographicBoundingRectangle(t,n){l(n)||(n=new ie);let i=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY;for(let s of t)i=Math.max(i,s.latitude),r=Math.min(r,s.latitude),o=Math.max(o,s.longitude),a=Math.min(a,s.longitude);return n.north=i,n.south=r,n.east=o,n.west=a,n}static transformCartesians3(t,n){let i=new h;return e.map(t,o=>(O.multiplyByPoint(n,o,i),i))}static transformToCartographic(t,n){let i=new de;return e.map(t,o=>(n.cartesianToCartographic(o,i),i))}static createProjectedPositions(t,n){let i=new h;return e.map(t,o=>(n.project(o,i),i))}static computeTexCoords(t,n){let i=new k,r=1/n.width,o=1/n.height;return e.map(t,s=>{let c=(s.x-n.x)*r,u=(s.y-n.y)*o,f=Math.min(Math.max(c,0),1),d=Math.min(Math.max(u,0),1);return i.x=f,i.y=d,i})}static createTypedArrayFromCartesians2(t,n){let i=new Float32Array(t*2),r=0;for(let o of n)i[r*2+0]=o.x,i[r*2+1]=o.y,r++;return i}static createTexCoordAttribute(t){return{name:"Imagery Texture Coordinates",semantic:ot.TEXCOORD,setIndex:0,componentDatatype:Y.FLOAT,type:Vt.VEC2,normalized:!1,count:t.length/2,min:void 0,max:void 0,constant:new k(0,0),quantization:void 0,typedArray:t,byteOffset:0,byteStride:void 0}}},kE=uZ;var fZ=class{constructor(t,n,i,r){this._cartographicPositions=t,this._numPositions=n,this._cartographicBoundingRectangle=i,this._ellipsoid=r}get cartographicPositions(){return this._cartographicPositions}get numPositions(){return this._numPositions}get cartographicBoundingRectangle(){return this._cartographicBoundingRectangle}get ellipsoid(){return this._ellipsoid}},sV=fZ;var dZ=class e{constructor(t,n,i){this._model=t,this._runtimeNode=n,this._runtimePrimitive=i,this._mappedPositionsPerEllipsoid=void 0,this._mappedPositionsModelMatrix=new O,this._lastImageryLayersModificationCounter=0,this._imageryTexCoordAttributesPerProjection=void 0,this._currentImageryLayers=void 0,this._coveragesPerLayer=void 0,this._allImageriesReady=!1}coveragesForImageryLayer(t){let r=this._model.imageryLayers.indexOf(t);if(r===-1)throw new pe("Imagery layer is not part of the model");let o=this._coveragesPerLayer;if(!l(o))throw new pe("The coveragesPerLayer have not been computed yet");return o[r]}update(t){let n=this._model,o=n.content.tileset.imageryLayersModificationCounter;this._lastImageryLayersModificationCounter!==o&&(delete this._mappedPositionsPerEllipsoid,this._lastImageryLayersModificationCounter=o),this._mappedPositionsNeedUpdate&&(n.resetDrawCommands(),this._mappedPositionsPerEllipsoid=this._computeMappedPositionsPerEllipsoid(),this._deleteCoveragesPerLayer(),this._destroyImageryTexCoordAttributes()),l(this._imageryTexCoordAttributesPerProjection)||(this._imageryTexCoordAttributesPerProjection=this._computeImageryTexCoordsAttributesPerProjection(),this._uploadImageryTexCoordAttributes(t.context)),l(this._coveragesPerLayer)||(this._computeCoveragesPerLayer(),this._allImageriesReady=!1),this._allImageriesReady||this._updateImageries(t)}_deleteCoveragesPerLayer(){let t=this._coveragesPerLayer;if(!l(t))return;let n=this._currentImageryLayers,i=t.length;for(let r=0;r<i;r++){let o=n[r],a=t[r];this._deleteCoverages(o,a)}delete this._currentImageryLayers,delete this._coveragesPerLayer}_deleteCoverages(t,n){if(t.isDestroyed())return;let i=n.length;for(let r=0;r<i;r++)n[r].imagery.releaseReference()}_uploadImageryTexCoordAttributes(t){let n=this._imageryTexCoordAttributesPerProjection;if(!l(n))return;let i=n.length;for(let r=0;r<i;r++){let o=n[r],a=Ze.createVertexBuffer({context:t,typedArray:o.typedArray,usage:Oe.STATIC_DRAW});a.vertexArrayDestroyable=!1,o.buffer=a}}_destroyImageryTexCoordAttributes(){let t=this._imageryTexCoordAttributesPerProjection;if(!l(t))return;let n=t.length;for(let i=0;i<n;i++){let r=t[i];l(r)&&(l(r.buffer)&&(r.buffer.isDestroyed()||r.buffer.destroy()),t[i]=void 0)}delete this._imageryTexCoordAttributesPerProjection}get _mappedPositionsNeedUpdate(){if(!l(this._mappedPositionsPerEllipsoid))return!0;let t=this._model,n=this._mappedPositionsModelMatrix;return!O.equals(t.modelMatrix,n)}_computeMappedPositionsPerEllipsoid(){let t=this._model,n=this._runtimeNode,i=this._runtimePrimitive,r=e._obtainPrimitivePositionAttribute(i.primitive),o=r.count,a=e._computePrimitivePositionTransform(t,n,void 0),s=[],c=e._computeUniqueEllipsoids(t.imageryLayers),u=c.length;for(let f=0;f<u;f++){let d=c[f],p=kE.createCartographicPositions(r,a,d),g=kE.computeCartographicBoundingRectangle(p),m=new sV(p,o,g,d);s.push(m)}return O.clone(t.modelMatrix,this._mappedPositionsModelMatrix),s}static _computeUniqueEllipsoids(t){let n=new Set,i=t.length;for(let r=0;r<i;r++){let o=t.get(r),a=e._getEllipsoid(o);n.add(a)}return[...n]}_computeImageryTexCoordsAttributesPerProjection(){let n=this._model.imageryLayers,i=e._extractProjections(n),r=[...new Set(i)];return this._createImageryTexCoordAttributes(r)}static _extractProjections(t){let n=[],i=t.length;for(let r=0;r<i;r++){let o=t.get(r),a=e._getProjection(o);n.push(a)}return n}static _getProjection(t){return t.imageryProvider.tilingScheme.projection}_createImageryTexCoordAttributes(t){let n=[],i=t.length;for(let r=0;r<i;r++){let o=t[r],a=o.ellipsoid,s=this.mappedPositionsForEllipsoid(a),c=kE.createTextureCoordinatesAttributeForMappedPositions(s,o);n.push(c)}return n}_computeCoveragesPerLayer(){let t=[],n=[],r=this._model.imageryLayers,o=r.length;for(let a=0;a<o;a++){let s=r.get(a),c=this._computeCoverage(s);t.push(c),n.push(s)}this._coveragesPerLayer=t,this._currentImageryLayers=n}_computeCoverage(t){let i=this.mappedPositionsForImageryLayer(t).cartographicBoundingRectangle,r=this._computeImageryLevel(t,i);return YD.createImageryCoverages(i,t,r)}_computeImageryLevel(t,n){let i=t.imageryProvider,o=i.tilingScheme.rectangle,a=1,s=n.width,c=o.width;n.height>n.width&&(s=n.height,c=o.height);let u=Math.log2(a*c/s);return YD._clampImageryLevel(i,u)}_updateImageries(t){let n=this._model,i=this._coveragesPerLayer,r=i.length,o=!0;for(let a=0;a<r;a++){let s=i[a],c=s.length;for(let u=0;u<c;u++){let d=s[u].imagery;d.state===jn.READY||d.state===jn.FAILED||d.state===jn.INVALID||(o=!1,d.processStateMachine(t,!1,!1))}}o&&n.resetDrawCommands(),this._allImageriesReady=o}mappedPositionsForImageryLayer(t){let n=e._getEllipsoid(t);return this.mappedPositionsForEllipsoid(n)}mappedPositionsForEllipsoid(t){let n=this._mappedPositionsPerEllipsoid;if(!l(n))throw new pe("The mappedPositions have not been computed yet");let i=n.length;for(let r=0;r<i;r++){let o=n[r];if(o.ellipsoid===t)return o}throw new pe(`Could not find mapped positions for ellipsoid ${t}`)}imageryTexCoordAttributesPerProjection(){let t=this._imageryTexCoordAttributesPerProjection;if(!l(t))throw new pe("The imagery texture coordinate attributes have not been computed yet");return this._imageryTexCoordAttributesPerProjection}get ready(){let t=this._coveragesPerLayer;return l(t)?this._allImageriesReady:!1}isDestroyed(){return!1}destroy(){if(!this.isDestroyed())return this._deleteCoveragesPerLayer(),this._destroyImageryTexCoordAttributes(),ue(this)}static _computePrimitivePositionTransform(t,n,i){l(i)||(i=new O);let r=t.sceneGraph;return O.clone(O.IDENTITY,i),O.multiply(i,t.modelMatrix,i),O.multiply(i,r.components.transform,i),O.multiply(i,r.axisCorrectionMatrix,i),O.multiply(i,n.computedTransform,i),i}static _obtainPrimitivePositionAttribute(t){let n=_t.getAttributeBySemantic(t,"POSITION");if(!l(n))throw new pe("The primitive does not have a POSITION attribute");return n}static _getEllipsoid(t){return t.imageryProvider.tilingScheme.projection.ellipsoid}},zE=dZ;var hZ=class{constructor(t,n,i,r,o){this.imageryLayer=t,this.texture=n,this.textureTranslationAndScale=i,this.textureCoordinateRectangle=r,this.imageryTexCoordAttributeSetIndex=o}},cV=hZ;var Slt=!1,wlt=new ie,Ilt=new ie,mZ=class e{static process(t,n,i){let r=t.model,o=n.modelPrimitiveImagery;if(!l(o)||!o.ready)return;let a=r.imageryLayers,s=zE._extractProjections(a),c=[...new Set(s)],u=e._computeIndexMapping(s,c),f=e._createImageryInputs(a,o,u);if(f.length===0)return;f.length>10&&(pt("imagery-texture-units",`Warning: Draped imagery requires ${f.length} texture units, truncating`),f.length=10),e._addImageryTexCoordAttributesToRenderResources(o,t);let d=[];for(let p=0;p<a.length;p++)d.push(a.get(p));e._processImageryInputs(d,t,f,c.length)}static _addImageryTexCoordAttributesToRenderResources(t,n){let i=t.imageryTexCoordAttributesPerProjection();for(let r of i)e._addImageryTexCoordAttributeToRenderResources(r,n)}static _addImageryTexCoordAttributeToRenderResources(t,n){let i=Vt.getNumberOfComponents(t.type),r={index:n.attributeIndex++,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,count:t.count,componentsPerAttribute:i,componentDatatype:t.componentDatatype,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};n.attributes.push(r)}static _processImageryInputs(t,n,i,r){let o=n.shaderBuilder,a=e._computeImageryFlags(t),s=i.length;o.addDefine("HAS_IMAGERY"),o.addDefine(`IMAGERY_TEXTURE_UNITS ${s}`),e._addAttributes(o,r),e._defineUniforms(o,a),e._buildSampleAndBlendFunction(o,a),e._createMainImageryShader(o,i,a);let c=n.uniformMap,u=e._createImageryUniforms(i);e._setImageryUniforms(c,u)}static _addAttributes(t,n){for(let o=0;o<n;o++)t.addAttribute("vec2",`a_imagery_texCoord_${o}`),t.addVarying("vec2",`v_imagery_texCoord_${o}`);let i="initializeImageryAttributes",r=`void ${i}()`;t.addFunction(i,r,he.VERTEX);for(let o=0;o<n;o++)t.addFunctionLines(i,[`v_imagery_texCoord_${o} = a_imagery_texCoord_${o};`])}static _computeImageryFlags(t){let n=new aV;for(let i=0;i<t.length;i++){let r=t[i];n.alpha|=r.alpha!==1,n.brightness|=r.brightness!==wa.DEFAULT_BRIGHTNESS,n.contrast|=r.contrast!==wa.DEFAULT_CONTRAST,n.hue|=r.hue!==wa.DEFAULT_HUE,n.saturation|=r.saturation!==wa.DEFAULT_SATURATION,n.gamma|=r.gamma!==wa.DEFAULT_GAMMA;let o=l(r.colorToAlpha)&&r.colorToAlphaThreshold>0;n.colorToAlpha|=o}return n}static _defineUniforms(t,n){t.addUniform("sampler2D","u_imageryTextures[IMAGERY_TEXTURE_UNITS]",he.FRAGMENT),t.addUniform("vec4","u_imageryTextureCoordinateRectangle[IMAGERY_TEXTURE_UNITS]",he.FRAGMENT),t.addUniform("vec4","u_imageryTextureTranslationAndScale[IMAGERY_TEXTURE_UNITS]",he.FRAGMENT),n.alpha&&t.addUniform("float","u_imageryTextureAlpha[IMAGERY_TEXTURE_UNITS]",he.FRAGMENT),n.brightness&&t.addUniform("float","u_imageryTextureBrightness[IMAGERY_TEXTURE_UNITS]",he.FRAGMENT),n.contrast&&t.addUniform("float","u_imageryTextureContrast[IMAGERY_TEXTURE_UNITS]",he.FRAGMENT),n.hue&&t.addUniform("float","u_imageryTextureHue[IMAGERY_TEXTURE_UNITS]",he.FRAGMENT),n.saturation&&t.addUniform("float","u_imageryTextureSaturation[IMAGERY_TEXTURE_UNITS]",he.FRAGMENT),n.gamma&&t.addUniform("float","u_imageryTextureOneOverGamma[IMAGERY_TEXTURE_UNITS]",he.FRAGMENT),n.colorToAlpha&&t.addUniform("vec4","u_imageryTextureColorToAlpha[IMAGERY_TEXTURE_UNITS]",he.FRAGMENT)}static _createSampleAndBlendFunctionSignature(t){let n="sampleAndBlend",i=[];i.push("vec4 previousColor"),i.push("sampler2D textureToSample"),i.push("vec2 textureCoordinates"),i.push("vec4 textureCoordinateRectangle"),i.push("vec4 textureCoordinateTranslationAndScale"),t.alpha&&i.push("float textureAlpha"),t.brightness&&i.push("float textureBrightness"),t.contrast&&i.push("float textureContrast"),t.hue&&i.push("float textureHue"),t.saturation&&i.push("float textureSaturation"),t.gamma&&i.push("float textureOneOverGamma"),t.colorToAlpha&&i.push("vec4 colorToAlpha");let r=i.join(", ");return`vec4 ${n}(${r})`}static _buildSampleAndBlendFunction(t,n){let i="sampleAndBlend",r=e._createSampleAndBlendFunctionSignature(n);t.addFunction(i,r,he.FRAGMENT),t.addFunctionLines(i,["float effectiveAlpha = 1.0;"]),n.alpha&&t.addFunctionLines(i,["effectiveAlpha = textureAlpha;"]),t.addFunctionLines(i,["if (textureCoordinates.x < textureCoordinateRectangle.x) effectiveAlpha = 0.0;","if (textureCoordinates.x > textureCoordinateRectangle.z) effectiveAlpha = 0.0;","if (textureCoordinates.y < textureCoordinateRectangle.y) effectiveAlpha = 0.0;","if (textureCoordinates.y > textureCoordinateRectangle.w) effectiveAlpha = 0.0;","vec2 translation = textureCoordinateTranslationAndScale.xy;","vec2 scale = textureCoordinateTranslationAndScale.zw;","vec2 effectiveTextureCoordinates = textureCoordinates * scale + translation;","vec4 value = texture(textureToSample, effectiveTextureCoordinates);","value = czm_srgbToLinear(value);","vec3 color = value.rgb;","float alpha = value.a;"]),n.colorToAlpha&&t.addFunctionLines(i,["vec3 colorDiff = abs(color.rgb - colorToAlpha.rgb);","colorDiff.r = czm_maximumComponent(colorDiff);","alpha = czm_branchFreeTernary(colorDiff.r < colorToAlpha.a, 0.0, alpha);"]),n.gamma?t.addFunctionLines(i,["color = pow(color, vec3(textureOneOverGamma));"]):t.addFunctionLines(i,["vec4 tempColor = czm_gammaCorrect(vec4(color, alpha));","color = tempColor.rgb;","alpha = tempColor.a;"]),n.brightness&&t.addFunctionLines(i,["color = mix(vec3(0.0), color, textureBrightness);"]),n.contrast&&t.addFunctionLines(i,["color = mix(vec3(0.5), color, textureContrast);"]),n.hue&&t.addFunctionLines(i,["color = czm_hue(color, textureHue);"]),n.saturation&&t.addFunctionLines(i,["color = czm_saturation(color, textureSaturation);"]),t.addFunctionLines(i,["float sourceAlpha = alpha * effectiveAlpha;","float outAlpha = mix(previousColor.a, 1.0, sourceAlpha);","outAlpha += sign(outAlpha) - 1.0;","vec3 outColor = mix(previousColor.rgb * previousColor.a, color, sourceAlpha) / outAlpha;","vec4 result = vec4(outColor, max(outAlpha, 0.0));"]),Slt&&t.addFunctionLines(i,["if (abs(textureCoordinates.x - textureCoordinateRectangle.x) < (1.0/256.0) || "," abs(textureCoordinates.x - textureCoordinateRectangle.z) < (1.0/256.0) || "," abs(textureCoordinates.y - textureCoordinateRectangle.y) < (1.0/256.0) || "," abs(textureCoordinates.y - textureCoordinateRectangle.w) < (1.0/256.0))","{"," result = vec4(1.0, 0.0, 0.0, effectiveAlpha);","}"]),t.addFunctionLines(i,["return result;"])}static _createSampleAndBlendCallArguments(t,n,i){let r=`v_imagery_texCoord_${n}`,o=[];return o.push("blendedBaseColor"),o.push(`u_imageryTextures[${i}]`),o.push(`${r}`),o.push(`u_imageryTextureCoordinateRectangle[${i}]`),o.push(`u_imageryTextureTranslationAndScale[${i}]`),t.alpha&&o.push(`u_imageryTextureAlpha[${i}]`),t.brightness&&o.push(`u_imageryTextureBrightness[${i}]`),t.contrast&&o.push(`u_imageryTextureContrast[${i}]`),t.hue&&o.push(`u_imageryTextureHue[${i}]`),t.saturation&&o.push(`u_imageryTextureSaturation[${i}]`),t.gamma&&o.push(`u_imageryTextureOneOverGamma[${i}]`),t.colorToAlpha&&o.push(`u_imageryTextureColorToAlpha[${i}]`),o.join(", ")}static _createMainImageryShader(t,n,i){let r="blendBaseColorWithImagery";t.addFunction(r,"vec4 blendBaseColorWithImagery(vec4 baseColorWithAlpha)",he.FRAGMENT),t.addFunctionLines(r,["vec4 blendedBaseColor = baseColorWithAlpha;"]);for(let o=0;o<n.length;o++){let s=n[o].imageryTexCoordAttributeSetIndex,c=e._createSampleAndBlendCallArguments(i,s,o);t.addFunctionLines(r,[`blendedBaseColor = sampleAndBlend(${c});`])}t.addFunctionLines(r,["return blendedBaseColor;"])}static _createImageryUniforms(t){let n=t.length,i={};i.imageryTextures=Array(n),i.imageryTextureCoordinateRectangle=Array(n),i.imageryTextureTranslationAndScale=Array(n),i.imageryTextureAlpha=Array(n),i.imageryTextureBrightness=Array(n),i.imageryTextureContrast=Array(n),i.imageryTextureHue=Array(n),i.imageryTextureSaturation=Array(n),i.imageryTextureOneOverGamma=Array(n),i.imageryTextureColorToAlpha=Array(n);for(let r=0;r<n;r++){let o=t[r],a=o.imageryLayer,s=o.texture,c=o.textureCoordinateRectangle,u=o.textureTranslationAndScale;i.imageryTextures[r]=s,i.imageryTextureTranslationAndScale[r]=u,i.imageryTextureCoordinateRectangle[r]=c,i.imageryTextureAlpha[r]=a.alpha,i.imageryTextureBrightness[r]=a.brightness,i.imageryTextureContrast[r]=a.contrast,i.imageryTextureHue[r]=a.hue,i.imageryTextureSaturation[r]=a.saturation,i.imageryTextureOneOverGamma[r]=1/a.gamma;let f=i.imageryTextureColorToAlpha[r];if(l(f)||(f=new ae,i.imageryTextureColorToAlpha[r]=f),l(a.colorToAlpha)&&a.colorToAlphaThreshold>0){let p=a.colorToAlpha;f.x=p.red,f.y=p.green,f.z=p.blue,f.w=a.colorToAlphaThreshold}else f.w=-1}return i}static _setImageryUniforms(t,n){for(let i in n)if(n.hasOwnProperty(i)){let r=`u_${i}`;t[r]=function(){return n[i]}}}static _createImageryInputs(t,n,i){let r=[];for(let o=0;o<t.length;o++){let a=t.get(o);if(!a.show)continue;let s=i[o],u=n.mappedPositionsForImageryLayer(a).cartographicBoundingRectangle,f=n.coveragesForImageryLayer(a);for(let d=0;d<f.length;d++){let p=f[d],g=e._createImageryInput(a,p,u,s);l(g)&&r.push(g)}}return r}static _createImageryInput(t,n,i,r){let o=n.imagery;if(o.state===jn.FAILED||o.state===jn.INVALID)return;let a=o.textureWebMercator;if(!l(a)&&(a=o.texture,!l(a))){o.state===jn.READY&&console.log(`Imagery at ${n.x}, ${n.y} (level ${n.level}) does not have any texture - state ${o.state}`);return}let s=e._computeTextureTranslationAndScale(t,i,o.rectangle),c=n.textureCoordinateRectangle,u=new ae(c.minX,c.minY,c.maxX,c.maxY);return new cV(t,a,s,u,r)}static _computeTextureTranslationAndScale(t,n,i){let r=t.imageryProvider.tilingScheme,o=r.rectangleToNativeRectangle(n,wlt),a=r.rectangleToNativeRectangle(i,Ilt);return e._computeTextureTranslationAndScaleFromNative(o,a)}static _computeTextureTranslationAndScaleFromNative(t,n){let i=1/n.width,r=1/n.height,o=t.west-n.west,a=t.south-n.south,s=o*i,c=a*r,u=t.width*i,f=t.height*r;return new ae(s,c,u,f)}static _computeIndexMapping(t,n){let i=[],r=t.length;for(let o=0;o<r;o++){let a=t[o],s=n.indexOf(a);i.push(s)}return i}},lV=mZ;var uV=`#ifdef USE_IBL_LIGHTING
|
|
vec3 computeIBL(vec3 position, vec3 normal, vec3 lightDirection, vec3 lightColorHdr, czm_modelMaterial material)
|
|
{
|
|
#if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL)
|
|
// Environment maps were provided, use them for IBL
|
|
vec3 viewDirection = -normalize(position);
|
|
vec3 iblColor = textureIBL(viewDirection, normal, material);
|
|
return iblColor;
|
|
#endif
|
|
|
|
return vec3(0.0);
|
|
}
|
|
#endif
|
|
|
|
#ifdef USE_CLEARCOAT
|
|
vec3 addClearcoatReflection(vec3 baseLayerColor, vec3 position, vec3 lightDirection, vec3 lightColorHdr, czm_modelMaterial material)
|
|
{
|
|
vec3 viewDirection = -normalize(position);
|
|
vec3 halfwayDirection = normalize(viewDirection + lightDirection);
|
|
vec3 normal = material.clearcoatNormal;
|
|
float NdotL = clamp(dot(normal, lightDirection), 0.001, 1.0);
|
|
|
|
// clearcoatF0 = vec3(pow((ior - 1.0) / (ior + 1.0), 2.0)), but without KHR_materials_ior, ior is a constant 1.5.
|
|
vec3 f0 = vec3(0.04);
|
|
vec3 f90 = vec3(1.0);
|
|
// Note: clearcoat Fresnel computed with dot(n, v) instead of dot(v, h).
|
|
// This is to make it energy conserving with a simple layering function.
|
|
float NdotV = clamp(dot(normal, viewDirection), 0.0, 1.0);
|
|
vec3 F = fresnelSchlick2(f0, f90, NdotV);
|
|
|
|
// compute specular reflection from direct lighting
|
|
float roughness = material.clearcoatRoughness;
|
|
float alphaRoughness = roughness * roughness;
|
|
float directStrength = computeDirectSpecularStrength(normal, lightDirection, viewDirection, halfwayDirection, alphaRoughness);
|
|
vec3 directReflection = F * directStrength * NdotL;
|
|
vec3 color = lightColorHdr * directReflection;
|
|
|
|
#ifdef SPECULAR_IBL
|
|
// Find the direction in which to sample the environment map
|
|
vec3 reflectMC = normalize(model_iblReferenceFrameMatrix * reflect(-viewDirection, normal));
|
|
vec3 iblColor = computeSpecularIBL(reflectMC, NdotV, f0, roughness);
|
|
color += iblColor * material.occlusion;
|
|
#endif
|
|
|
|
float clearcoatFactor = material.clearcoatFactor;
|
|
vec3 clearcoatColor = color * clearcoatFactor;
|
|
|
|
// Dim base layer based on transmission loss through clearcoat
|
|
return baseLayerColor * (1.0 - clearcoatFactor * F) + clearcoatColor;
|
|
}
|
|
#endif
|
|
|
|
#if defined(LIGHTING_PBR) && defined(HAS_NORMALS)
|
|
vec3 computePbrLighting(in czm_modelMaterial material, in vec3 position)
|
|
{
|
|
#ifdef USE_CUSTOM_LIGHT_COLOR
|
|
vec3 lightColorHdr = model_lightColorHdr;
|
|
#else
|
|
vec3 lightColorHdr = czm_lightColorHdr;
|
|
#endif
|
|
|
|
vec3 viewDirection = -normalize(position);
|
|
vec3 normal = material.normalEC;
|
|
vec3 lightDirection = normalize(czm_lightDirectionEC);
|
|
|
|
vec3 directLighting = czm_pbrLighting(viewDirection, normal, lightDirection, material);
|
|
vec3 directColor = lightColorHdr * directLighting;
|
|
|
|
// Accumulate colors from base layer
|
|
vec3 color = directColor + material.emissive;
|
|
#ifdef USE_IBL_LIGHTING
|
|
color += computeIBL(position, normal, lightDirection, lightColorHdr, material);
|
|
#endif
|
|
|
|
#ifdef USE_CLEARCOAT
|
|
color = addClearcoatReflection(color, position, lightDirection, lightColorHdr, material);
|
|
#endif
|
|
|
|
return color;
|
|
}
|
|
#endif
|
|
|
|
/**
|
|
* Compute the material color under the current lighting conditions.
|
|
* All other material properties are passed through so further stages
|
|
* have access to them.
|
|
*
|
|
* @param {czm_modelMaterial} material The material properties from {@MaterialStageFS}
|
|
* @param {ProcessedAttributes} attributes
|
|
*/
|
|
void lightingStage(inout czm_modelMaterial material, ProcessedAttributes attributes)
|
|
{
|
|
#ifdef LIGHTING_PBR
|
|
#ifdef HAS_NORMALS
|
|
vec3 color = computePbrLighting(material, attributes.positionEC);
|
|
#else
|
|
vec3 color = material.diffuse * material.occlusion + material.emissive;
|
|
#endif
|
|
// In HDR mode, the frame buffer is in linear color space. The
|
|
// post-processing stages (see PostProcessStageCollection) will handle
|
|
// tonemapping. However, if HDR is not enabled, we must tonemap else large
|
|
// values may be clamped to 1.0
|
|
#ifndef HDR
|
|
color = czm_pbrNeutralTonemapping(color);
|
|
#endif
|
|
#else // unlit
|
|
vec3 color = material.diffuse;
|
|
#endif
|
|
|
|
#ifdef HAS_POINT_CLOUD_COLOR_STYLE
|
|
// The colors resulting from point cloud styles are adjusted differently.
|
|
color = czm_gammaCorrect(color);
|
|
#elif !defined(HDR)
|
|
// If HDR is not enabled, the frame buffer stores sRGB colors rather than
|
|
// linear colors so the linear value must be converted.
|
|
color = czm_linearToSrgb(color);
|
|
#endif
|
|
|
|
material.diffuse = color;
|
|
}
|
|
`;var jbe={UNLIT:0,PBR:1};Object.freeze(jbe);var rg=jbe;var Hbe={name:"LightingPipelineStage"};Hbe.process=function(e,t){let{model:n,lightingOptions:i,shaderBuilder:r}=e;if(l(n.lightColor)){r.addDefine("USE_CUSTOM_LIGHT_COLOR",void 0,he.FRAGMENT),r.addUniform("vec3","model_lightColorHdr",he.FRAGMENT);let a=e.uniformMap;a.model_lightColorHdr=function(){return n.lightColor}}let{lightingModel:o}=i;o===rg.PBR?r.addDefine("LIGHTING_PBR",void 0,he.FRAGMENT):r.addDefine("LIGHTING_UNLIT",void 0,he.FRAGMENT),r.addFragmentLines(uV)};var fV=Hbe;var dV=`// If the style color is white, it implies the feature has not been styled.
|
|
bool isDefaultStyleColor(vec3 color)
|
|
{
|
|
return all(greaterThan(color, vec3(1.0 - czm_epsilon3)));
|
|
}
|
|
|
|
vec3 blend(vec3 sourceColor, vec3 styleColor, float styleColorBlend)
|
|
{
|
|
vec3 blendColor = mix(sourceColor, styleColor, styleColorBlend);
|
|
vec3 color = isDefaultStyleColor(styleColor.rgb) ? sourceColor : blendColor;
|
|
return color;
|
|
}
|
|
|
|
#ifdef HAS_NORMAL_TEXTURE
|
|
vec2 getNormalTexCoords()
|
|
{
|
|
vec2 texCoord = TEXCOORD_NORMAL;
|
|
#ifdef HAS_NORMAL_TEXTURE_TRANSFORM
|
|
texCoord = czm_computeTextureTransform(texCoord, u_normalTextureTransform);
|
|
#endif
|
|
return texCoord;
|
|
}
|
|
#endif
|
|
|
|
#if defined(HAS_NORMAL_TEXTURE) || defined(HAS_CLEARCOAT_NORMAL_TEXTURE)
|
|
vec3 computeTangent(in vec3 position, in vec2 normalTexCoords)
|
|
{
|
|
vec2 tex_dx = dFdx(normalTexCoords);
|
|
vec2 tex_dy = dFdy(normalTexCoords);
|
|
float determinant = tex_dx.x * tex_dy.y - tex_dy.x * tex_dx.y;
|
|
vec3 tangent = tex_dy.t * dFdx(position) - tex_dx.t * dFdy(position);
|
|
return tangent / determinant;
|
|
}
|
|
#endif
|
|
|
|
#ifdef USE_ANISOTROPY
|
|
struct NormalInfo {
|
|
vec3 tangent;
|
|
vec3 bitangent;
|
|
vec3 normal;
|
|
vec3 geometryNormal;
|
|
};
|
|
|
|
NormalInfo getNormalInfo(ProcessedAttributes attributes)
|
|
{
|
|
vec3 geometryNormal = attributes.normalEC;
|
|
#ifdef HAS_NORMAL_TEXTURE
|
|
vec2 normalTexCoords = getNormalTexCoords();
|
|
#endif
|
|
|
|
#ifdef HAS_BITANGENTS
|
|
vec3 tangent = attributes.tangentEC;
|
|
vec3 bitangent = attributes.bitangentEC;
|
|
#else // Assume HAS_NORMAL_TEXTURE
|
|
vec3 tangent = computeTangent(attributes.positionEC, normalTexCoords);
|
|
tangent = normalize(tangent - geometryNormal * dot(geometryNormal, tangent));
|
|
vec3 bitangent = normalize(cross(geometryNormal, tangent));
|
|
#endif
|
|
|
|
#ifdef HAS_NORMAL_TEXTURE
|
|
mat3 tbn = mat3(tangent, bitangent, geometryNormal);
|
|
|
|
vec3 normalSample;
|
|
#if defined(HAS_NORMAL_CONSTANT_LOD) && defined(HAS_CONSTANT_LOD)
|
|
#ifdef HAS_NORMAL_TEXTURE_TRANSFORM
|
|
normalSample = constantLodTextureLookup(u_normalTexture, u_normalTextureConstantLodParams, u_normalTextureTransform).rgb;
|
|
#else
|
|
normalSample = constantLodTextureLookup(u_normalTexture, u_normalTextureConstantLodParams).rgb;
|
|
#endif
|
|
#else
|
|
normalSample = texture(u_normalTexture, normalTexCoords).rgb;
|
|
#endif
|
|
|
|
normalSample = 2.0 * normalSample - 1.0;
|
|
#ifdef HAS_NORMAL_TEXTURE_SCALE
|
|
normalSample.xy *= u_normalTextureScale;
|
|
#endif
|
|
vec3 normal = normalize(tbn * normalSample);
|
|
#else
|
|
vec3 normal = geometryNormal;
|
|
#endif
|
|
|
|
#ifdef HAS_DOUBLE_SIDED_MATERIAL
|
|
if (czm_backFacing()) {
|
|
tangent *= -1.0;
|
|
bitangent *= -1.0;
|
|
normal *= -1.0;
|
|
geometryNormal *= -1.0;
|
|
}
|
|
#endif
|
|
|
|
NormalInfo normalInfo;
|
|
normalInfo.tangent = tangent;
|
|
normalInfo.bitangent = bitangent;
|
|
normalInfo.normal = normal;
|
|
normalInfo.geometryNormal = geometryNormal;
|
|
|
|
return normalInfo;
|
|
}
|
|
#endif
|
|
|
|
#if defined(HAS_NORMAL_TEXTURE) && !defined(HAS_WIREFRAME)
|
|
vec3 getNormalFromTexture(ProcessedAttributes attributes, vec3 geometryNormal)
|
|
{
|
|
vec2 normalTexCoords = getNormalTexCoords();
|
|
|
|
// If HAS_BITANGENTS is set, then HAS_TANGENTS is also set
|
|
#ifdef HAS_BITANGENTS
|
|
vec3 t = attributes.tangentEC;
|
|
vec3 b = attributes.bitangentEC;
|
|
#else
|
|
vec3 t = computeTangent(attributes.positionEC, normalTexCoords);
|
|
t = normalize(t - geometryNormal * dot(geometryNormal, t));
|
|
vec3 b = normalize(cross(geometryNormal, t));
|
|
#endif
|
|
|
|
mat3 tbn = mat3(t, b, geometryNormal);
|
|
|
|
vec3 normalSample;
|
|
#if defined(HAS_NORMAL_CONSTANT_LOD) && defined(HAS_CONSTANT_LOD)
|
|
#ifdef HAS_NORMAL_TEXTURE_TRANSFORM
|
|
normalSample = constantLodTextureLookup(u_normalTexture, u_normalTextureConstantLodParams, u_normalTextureTransform).rgb;
|
|
#else
|
|
normalSample = constantLodTextureLookup(u_normalTexture, u_normalTextureConstantLodParams).rgb;
|
|
#endif
|
|
#else
|
|
normalSample = texture(u_normalTexture, normalTexCoords).rgb;
|
|
#endif
|
|
|
|
normalSample = 2.0 * normalSample - 1.0;
|
|
#ifdef HAS_NORMAL_TEXTURE_SCALE
|
|
normalSample.xy *= u_normalTextureScale;
|
|
#endif
|
|
return normalize(tbn * normalSample);
|
|
}
|
|
#endif
|
|
|
|
#ifdef HAS_CLEARCOAT_NORMAL_TEXTURE
|
|
vec3 getClearcoatNormalFromTexture(ProcessedAttributes attributes, vec3 geometryNormal)
|
|
{
|
|
vec2 normalTexCoords = TEXCOORD_CLEARCOAT_NORMAL;
|
|
#ifdef HAS_CLEARCOAT_NORMAL_TEXTURE_TRANSFORM
|
|
normalTexCoords = vec2(u_clearcoatNormalTextureTransform * vec3(normalTexCoords, 1.0));
|
|
#endif
|
|
|
|
// If HAS_BITANGENTS is set, then HAS_TANGENTS is also set
|
|
#ifdef HAS_BITANGENTS
|
|
vec3 t = attributes.tangentEC;
|
|
vec3 b = attributes.bitangentEC;
|
|
#else
|
|
vec3 t = computeTangent(attributes.positionEC, normalTexCoords);
|
|
t = normalize(t - geometryNormal * dot(geometryNormal, t));
|
|
vec3 b = normalize(cross(geometryNormal, t));
|
|
#endif
|
|
|
|
mat3 tbn = mat3(t, b, geometryNormal);
|
|
vec3 normalSample = texture(u_clearcoatNormalTexture, normalTexCoords).rgb;
|
|
normalSample = 2.0 * normalSample - 1.0;
|
|
#ifdef HAS_CLEARCOAT_NORMAL_TEXTURE_SCALE
|
|
normalSample.xy *= u_clearcoatNormalTextureScale;
|
|
#endif
|
|
return normalize(tbn * normalSample);
|
|
}
|
|
#endif
|
|
|
|
#ifdef HAS_NORMALS
|
|
vec3 computeNormal(ProcessedAttributes attributes)
|
|
{
|
|
// Geometry normal. This is already normalized
|
|
vec3 normal = attributes.normalEC;
|
|
|
|
#if defined(HAS_NORMAL_TEXTURE) && !defined(HAS_WIREFRAME)
|
|
normal = getNormalFromTexture(attributes, normal);
|
|
#endif
|
|
|
|
#ifdef HAS_DOUBLE_SIDED_MATERIAL
|
|
if (czm_backFacing()) {
|
|
normal = -normal;
|
|
}
|
|
#endif
|
|
|
|
return normal;
|
|
}
|
|
#endif
|
|
|
|
#ifdef HAS_BASE_COLOR_TEXTURE
|
|
vec4 getBaseColorFromTexture()
|
|
{
|
|
vec2 baseColorTexCoords = TEXCOORD_BASE_COLOR;
|
|
#ifdef HAS_BASE_COLOR_TEXTURE_TRANSFORM
|
|
baseColorTexCoords = czm_computeTextureTransform(baseColorTexCoords, u_baseColorTextureTransform);
|
|
#endif
|
|
|
|
vec4 baseColorWithAlpha;
|
|
#if defined(HAS_BASE_COLOR_CONSTANT_LOD) && defined(HAS_CONSTANT_LOD)
|
|
#ifdef HAS_BASE_COLOR_TEXTURE_TRANSFORM
|
|
baseColorWithAlpha = czm_srgbToLinear(constantLodTextureLookup(u_baseColorTexture, u_baseColorTextureConstantLodParams, u_baseColorTextureTransform));
|
|
#else
|
|
baseColorWithAlpha = czm_srgbToLinear(constantLodTextureLookup(u_baseColorTexture, u_baseColorTextureConstantLodParams));
|
|
#endif
|
|
#else
|
|
baseColorWithAlpha = czm_srgbToLinear(texture(u_baseColorTexture, baseColorTexCoords));
|
|
#endif
|
|
|
|
#ifdef HAS_BASE_COLOR_FACTOR
|
|
baseColorWithAlpha *= u_baseColorFactor;
|
|
#endif
|
|
|
|
return baseColorWithAlpha;
|
|
}
|
|
#endif
|
|
|
|
#ifdef HAS_EMISSIVE_TEXTURE
|
|
vec3 getEmissiveFromTexture()
|
|
{
|
|
vec2 emissiveTexCoords = TEXCOORD_EMISSIVE;
|
|
#ifdef HAS_EMISSIVE_TEXTURE_TRANSFORM
|
|
emissiveTexCoords = czm_computeTextureTransform(emissiveTexCoords, u_emissiveTextureTransform);
|
|
#endif
|
|
|
|
vec3 emissive = czm_srgbToLinear(texture(u_emissiveTexture, emissiveTexCoords).rgb);
|
|
#ifdef HAS_EMISSIVE_FACTOR
|
|
emissive *= u_emissiveFactor;
|
|
#endif
|
|
|
|
return emissive;
|
|
}
|
|
#endif
|
|
|
|
#if defined(LIGHTING_PBR) && defined(USE_SPECULAR_GLOSSINESS)
|
|
void setSpecularGlossiness(inout czm_modelMaterial material)
|
|
{
|
|
#ifdef HAS_SPECULAR_GLOSSINESS_TEXTURE
|
|
vec2 specularGlossinessTexCoords = TEXCOORD_SPECULAR_GLOSSINESS;
|
|
#ifdef HAS_SPECULAR_GLOSSINESS_TEXTURE_TRANSFORM
|
|
specularGlossinessTexCoords = czm_computeTextureTransform(specularGlossinessTexCoords, u_specularGlossinessTextureTransform);
|
|
#endif
|
|
|
|
vec4 specularGlossiness = czm_srgbToLinear(texture(u_specularGlossinessTexture, specularGlossinessTexCoords));
|
|
vec3 specular = specularGlossiness.rgb;
|
|
float glossiness = specularGlossiness.a;
|
|
#ifdef HAS_LEGACY_SPECULAR_FACTOR
|
|
specular *= u_legacySpecularFactor;
|
|
#endif
|
|
|
|
#ifdef HAS_GLOSSINESS_FACTOR
|
|
glossiness *= u_glossinessFactor;
|
|
#endif
|
|
#else
|
|
#ifdef HAS_LEGACY_SPECULAR_FACTOR
|
|
vec3 specular = clamp(u_legacySpecularFactor, vec3(0.0), vec3(1.0));
|
|
#else
|
|
vec3 specular = vec3(1.0);
|
|
#endif
|
|
|
|
#ifdef HAS_GLOSSINESS_FACTOR
|
|
float glossiness = clamp(u_glossinessFactor, 0.0, 1.0);
|
|
#else
|
|
float glossiness = 1.0;
|
|
#endif
|
|
#endif
|
|
|
|
#ifdef HAS_DIFFUSE_TEXTURE
|
|
vec2 diffuseTexCoords = TEXCOORD_DIFFUSE;
|
|
#ifdef HAS_DIFFUSE_TEXTURE_TRANSFORM
|
|
diffuseTexCoords = czm_computeTextureTransform(diffuseTexCoords, u_diffuseTextureTransform);
|
|
#endif
|
|
|
|
vec4 diffuse = czm_srgbToLinear(texture(u_diffuseTexture, diffuseTexCoords));
|
|
#ifdef HAS_DIFFUSE_FACTOR
|
|
diffuse *= u_diffuseFactor;
|
|
#endif
|
|
#elif defined(HAS_DIFFUSE_FACTOR)
|
|
vec4 diffuse = clamp(u_diffuseFactor, vec4(0.0), vec4(1.0));
|
|
#else
|
|
vec4 diffuse = vec4(1.0);
|
|
#endif
|
|
|
|
material.diffuse = diffuse.rgb * (1.0 - czm_maximumComponent(specular));
|
|
// the specular glossiness extension's alpha overrides anything set
|
|
// by the base material.
|
|
material.alpha = diffuse.a;
|
|
|
|
material.specular = specular;
|
|
|
|
// glossiness is the opposite of roughness, but easier for artists to use.
|
|
material.roughness = 1.0 - glossiness;
|
|
}
|
|
#elif defined(LIGHTING_PBR)
|
|
float setMetallicRoughness(inout czm_modelMaterial material)
|
|
{
|
|
#ifdef HAS_METALLIC_ROUGHNESS_TEXTURE
|
|
vec2 metallicRoughnessTexCoords = TEXCOORD_METALLIC_ROUGHNESS;
|
|
#ifdef HAS_METALLIC_ROUGHNESS_TEXTURE_TRANSFORM
|
|
metallicRoughnessTexCoords = czm_computeTextureTransform(metallicRoughnessTexCoords, u_metallicRoughnessTextureTransform);
|
|
#endif
|
|
|
|
vec3 metallicRoughness = texture(u_metallicRoughnessTexture, metallicRoughnessTexCoords).rgb;
|
|
float metalness = clamp(metallicRoughness.b, 0.0, 1.0);
|
|
float roughness = clamp(metallicRoughness.g, 0.0, 1.0);
|
|
#ifdef HAS_METALLIC_FACTOR
|
|
metalness = clamp(metalness * u_metallicFactor, 0.0, 1.0);
|
|
#endif
|
|
|
|
#ifdef HAS_ROUGHNESS_FACTOR
|
|
roughness = clamp(roughness * u_roughnessFactor, 0.0, 1.0);
|
|
#endif
|
|
#else
|
|
#ifdef HAS_METALLIC_FACTOR
|
|
float metalness = clamp(u_metallicFactor, 0.0, 1.0);
|
|
#else
|
|
float metalness = 1.0;
|
|
#endif
|
|
|
|
#ifdef HAS_ROUGHNESS_FACTOR
|
|
float roughness = clamp(u_roughnessFactor, 0.0, 1.0);
|
|
#else
|
|
float roughness = 1.0;
|
|
#endif
|
|
#endif
|
|
|
|
// dielectrics use f0 = 0.04, metals use albedo as f0
|
|
const vec3 REFLECTANCE_DIELECTRIC = vec3(0.04);
|
|
vec3 f0 = mix(REFLECTANCE_DIELECTRIC, material.baseColor.rgb, metalness);
|
|
|
|
material.specular = f0;
|
|
|
|
// diffuse only applies to dielectrics.
|
|
material.diffuse = mix(material.baseColor.rgb, vec3(0.0), metalness);
|
|
|
|
// This is perceptual roughness. The square of this value is used for direct lighting
|
|
material.roughness = roughness;
|
|
|
|
return metalness;
|
|
}
|
|
#ifdef USE_SPECULAR
|
|
void setSpecular(inout czm_modelMaterial material, in float metalness)
|
|
{
|
|
#ifdef HAS_SPECULAR_TEXTURE
|
|
vec2 specularTexCoords = TEXCOORD_SPECULAR;
|
|
#ifdef HAS_SPECULAR_TEXTURE_TRANSFORM
|
|
specularTexCoords = czm_computeTextureTransform(specularTexCoords, u_specularTextureTransform);
|
|
#endif
|
|
float specularWeight = texture(u_specularTexture, specularTexCoords).a;
|
|
#ifdef HAS_SPECULAR_FACTOR
|
|
specularWeight *= u_specularFactor;
|
|
#endif
|
|
#else
|
|
#ifdef HAS_SPECULAR_FACTOR
|
|
float specularWeight = u_specularFactor;
|
|
#else
|
|
float specularWeight = 1.0;
|
|
#endif
|
|
#endif
|
|
|
|
#ifdef HAS_SPECULAR_COLOR_TEXTURE
|
|
vec2 specularColorTexCoords = TEXCOORD_SPECULAR_COLOR;
|
|
#ifdef HAS_SPECULAR_COLOR_TEXTURE_TRANSFORM
|
|
specularColorTexCoords = czm_computeTextureTransform(specularColorTexCoords, u_specularColorTextureTransform);
|
|
#endif
|
|
vec3 specularColorSample = texture(u_specularColorTexture, specularColorTexCoords).rgb;
|
|
vec3 specularColorFactor = czm_srgbToLinear(specularColorSample);
|
|
#ifdef HAS_SPECULAR_COLOR_FACTOR
|
|
specularColorFactor *= u_specularColorFactor;
|
|
#endif
|
|
#else
|
|
#ifdef HAS_SPECULAR_COLOR_FACTOR
|
|
vec3 specularColorFactor = u_specularColorFactor;
|
|
#else
|
|
vec3 specularColorFactor = vec3(1.0);
|
|
#endif
|
|
#endif
|
|
material.specularWeight = specularWeight;
|
|
vec3 f0 = material.specular;
|
|
vec3 dielectricSpecularF0 = min(f0 * specularColorFactor, vec3(1.0));
|
|
material.specular = mix(dielectricSpecularF0, material.baseColor.rgb, metalness);
|
|
}
|
|
#endif
|
|
#ifdef USE_ANISOTROPY
|
|
void setAnisotropy(inout czm_modelMaterial material, in NormalInfo normalInfo)
|
|
{
|
|
mat2 rotation = mat2(u_anisotropy.xy, -u_anisotropy.y, u_anisotropy.x);
|
|
float anisotropyStrength = u_anisotropy.z;
|
|
|
|
vec2 direction = vec2(1.0, 0.0);
|
|
#ifdef HAS_ANISOTROPY_TEXTURE
|
|
vec2 anisotropyTexCoords = TEXCOORD_ANISOTROPY;
|
|
#ifdef HAS_ANISOTROPY_TEXTURE_TRANSFORM
|
|
anisotropyTexCoords = czm_computeTextureTransform(anisotropyTexCoords, u_anisotropyTextureTransform);
|
|
#endif
|
|
vec3 anisotropySample = texture(u_anisotropyTexture, anisotropyTexCoords).rgb;
|
|
direction = anisotropySample.rg * 2.0 - vec2(1.0);
|
|
anisotropyStrength *= anisotropySample.b;
|
|
#endif
|
|
|
|
direction = rotation * direction;
|
|
mat3 tbn = mat3(normalInfo.tangent, normalInfo.bitangent, normalInfo.normal);
|
|
vec3 anisotropicT = tbn * normalize(vec3(direction, 0.0));
|
|
vec3 anisotropicB = cross(normalInfo.geometryNormal, anisotropicT);
|
|
|
|
material.anisotropicT = anisotropicT;
|
|
material.anisotropicB = anisotropicB;
|
|
material.anisotropyStrength = anisotropyStrength;
|
|
}
|
|
#endif
|
|
#ifdef USE_CLEARCOAT
|
|
void setClearcoat(inout czm_modelMaterial material, in ProcessedAttributes attributes)
|
|
{
|
|
#ifdef HAS_CLEARCOAT_TEXTURE
|
|
vec2 clearcoatTexCoords = TEXCOORD_CLEARCOAT;
|
|
#ifdef HAS_CLEARCOAT_TEXTURE_TRANSFORM
|
|
clearcoatTexCoords = czm_computeTextureTransform(clearcoatTexCoords, u_clearcoatTextureTransform);
|
|
#endif
|
|
float clearcoatFactor = texture(u_clearcoatTexture, clearcoatTexCoords).r;
|
|
#ifdef HAS_CLEARCOAT_FACTOR
|
|
clearcoatFactor *= u_clearcoatFactor;
|
|
#endif
|
|
#else
|
|
#ifdef HAS_CLEARCOAT_FACTOR
|
|
float clearcoatFactor = u_clearcoatFactor;
|
|
#else
|
|
// PERFORMANCE_IDEA: this case should turn the whole extension off
|
|
float clearcoatFactor = 0.0;
|
|
#endif
|
|
#endif
|
|
|
|
#ifdef HAS_CLEARCOAT_ROUGHNESS_TEXTURE
|
|
vec2 clearcoatRoughnessTexCoords = TEXCOORD_CLEARCOAT_ROUGHNESS;
|
|
#ifdef HAS_CLEARCOAT_ROUGHNESS_TEXTURE_TRANSFORM
|
|
clearcoatRoughnessTexCoords = czm_computeTextureTransform(clearcoatRoughnessTexCoords, u_clearcoatRoughnessTextureTransform);
|
|
#endif
|
|
float clearcoatRoughness = texture(u_clearcoatRoughnessTexture, clearcoatRoughnessTexCoords).g;
|
|
#ifdef HAS_CLEARCOAT_ROUGHNESS_FACTOR
|
|
clearcoatRoughness *= u_clearcoatRoughnessFactor;
|
|
#endif
|
|
#else
|
|
#ifdef HAS_CLEARCOAT_ROUGHNESS_FACTOR
|
|
float clearcoatRoughness = u_clearcoatRoughnessFactor;
|
|
#else
|
|
float clearcoatRoughness = 0.0;
|
|
#endif
|
|
#endif
|
|
|
|
material.clearcoatFactor = clearcoatFactor;
|
|
// This is perceptual roughness. The square of this value is used for direct lighting
|
|
material.clearcoatRoughness = clearcoatRoughness;
|
|
#ifdef HAS_CLEARCOAT_NORMAL_TEXTURE
|
|
material.clearcoatNormal = getClearcoatNormalFromTexture(attributes, attributes.normalEC);
|
|
#else
|
|
material.clearcoatNormal = attributes.normalEC;
|
|
#endif
|
|
}
|
|
#endif
|
|
#endif
|
|
|
|
void materialStage(inout czm_modelMaterial material, ProcessedAttributes attributes, SelectedFeature feature)
|
|
{
|
|
#ifdef USE_ANISOTROPY
|
|
NormalInfo normalInfo = getNormalInfo(attributes);
|
|
material.normalEC = normalInfo.normal;
|
|
#elif defined(HAS_NORMALS)
|
|
material.normalEC = computeNormal(attributes);
|
|
#endif
|
|
|
|
vec4 baseColorWithAlpha = vec4(1.0);
|
|
// Regardless of whether we use PBR, set a base color.
|
|
// HAS_BACKGROUND_FILL (from BENTLEY_materials_planar_fill) overrides with
|
|
// the view's background color to create an invisible masking polygon.
|
|
// The background color is in sRGB, so convert to linear to match the
|
|
// material pipeline's expected color space.
|
|
#ifdef HAS_BACKGROUND_FILL
|
|
baseColorWithAlpha = czm_srgbToLinear(czm_backgroundColor);
|
|
#elif defined(HAS_BASE_COLOR_TEXTURE)
|
|
baseColorWithAlpha = getBaseColorFromTexture();
|
|
#elif defined(HAS_BASE_COLOR_FACTOR)
|
|
baseColorWithAlpha = u_baseColorFactor;
|
|
#endif
|
|
|
|
#ifdef HAS_IMAGERY
|
|
baseColorWithAlpha = blendBaseColorWithImagery(baseColorWithAlpha);
|
|
#endif // HAS_IMAGERY
|
|
|
|
#ifdef HAS_POINT_CLOUD_COLOR_STYLE
|
|
baseColorWithAlpha = v_pointCloudColor;
|
|
#elif defined(HAS_COLOR_0)
|
|
vec4 color = attributes.color_0;
|
|
// .pnts files store colors in the sRGB color space
|
|
#ifdef HAS_SRGB_COLOR
|
|
color = czm_srgbToLinear(color);
|
|
#endif
|
|
baseColorWithAlpha *= color;
|
|
#endif
|
|
|
|
#ifdef USE_CPU_STYLING
|
|
baseColorWithAlpha.rgb = blend(baseColorWithAlpha.rgb, feature.color.rgb, model_colorBlend);
|
|
#endif
|
|
material.baseColor = baseColorWithAlpha;
|
|
material.diffuse = baseColorWithAlpha.rgb;
|
|
material.alpha = baseColorWithAlpha.a;
|
|
|
|
#ifdef HAS_OCCLUSION_TEXTURE
|
|
vec2 occlusionTexCoords = TEXCOORD_OCCLUSION;
|
|
#ifdef HAS_OCCLUSION_TEXTURE_TRANSFORM
|
|
occlusionTexCoords = czm_computeTextureTransform(occlusionTexCoords, u_occlusionTextureTransform);
|
|
#endif
|
|
material.occlusion = texture(u_occlusionTexture, occlusionTexCoords).r;
|
|
#endif
|
|
|
|
#ifdef HAS_EMISSIVE_TEXTURE
|
|
material.emissive = getEmissiveFromTexture();
|
|
#elif defined(HAS_EMISSIVE_FACTOR)
|
|
material.emissive = u_emissiveFactor;
|
|
#endif
|
|
|
|
#if defined(LIGHTING_PBR) && defined(USE_SPECULAR_GLOSSINESS)
|
|
setSpecularGlossiness(material);
|
|
#elif defined(LIGHTING_PBR)
|
|
float metalness = setMetallicRoughness(material);
|
|
#ifdef USE_SPECULAR
|
|
setSpecular(material, metalness);
|
|
#endif
|
|
#ifdef USE_ANISOTROPY
|
|
setAnisotropy(material, normalInfo);
|
|
#endif
|
|
#ifdef USE_CLEARCOAT
|
|
setClearcoat(material, attributes);
|
|
#endif
|
|
#endif
|
|
}
|
|
`;var hV=`#ifdef HAS_CONSTANT_LOD
|
|
// Extract model scale to compensate for minimumPixelSize scaling
|
|
float modelScaleX = length(czm_model[0].xyz);
|
|
float modelScaleY = length(czm_model[1].xyz);
|
|
float modelScaleZ = length(czm_model[2].xyz);
|
|
float modelScale = (modelScaleX + modelScaleY + modelScaleZ) / 3.0;
|
|
|
|
// Transform model position through ENU but as direction only (w=0) to avoid position-dependent rotation
|
|
vec3 enuDir = (u_constantLodWorldToEnu * czm_model * vec4(v_positionMC, 0.0)).xyz;
|
|
v_constantLodUvCustom.xy = (enuDir.yx + u_constantLodOffset) / modelScale;
|
|
v_constantLodUvCustom.z = u_constantLodDistance / modelScale;
|
|
#endif`;var mV=`#ifdef HAS_CONSTANT_LOD
|
|
|
|
vec4 constantLodTextureLookup(sampler2D textureSampler, vec3 constantLodParams) {
|
|
bool atMaxClamp = v_constantLodUvCustom.z >= constantLodParams.y;
|
|
bool atMinClamp = v_constantLodUvCustom.z <= constantLodParams.x;
|
|
bool atClampBoundary = atMaxClamp || atMinClamp;
|
|
|
|
float effectiveDistance = atMaxClamp ? constantLodParams.y :
|
|
(atMinClamp ? constantLodParams.x : v_constantLodUvCustom.z);
|
|
|
|
float logDepth = log2(effectiveDistance);
|
|
logDepth = clamp(logDepth, -10.0, 20.0);
|
|
|
|
float f = fract(logDepth);
|
|
float p = floor(logDepth);
|
|
|
|
if (atClampBoundary) {
|
|
float clampedP = ceil(logDepth);
|
|
vec2 tc = v_constantLodUvCustom.xy / pow(2.0, clampedP) * constantLodParams.z;
|
|
return texture(textureSampler, tc);
|
|
}
|
|
|
|
vec2 tc1 = v_constantLodUvCustom.xy / pow(2.0, p) * constantLodParams.z;
|
|
vec2 tc2 = v_constantLodUvCustom.xy / pow(2.0, p + 1.0) * constantLodParams.z;
|
|
return mix(texture(textureSampler, tc1), texture(textureSampler, tc2), f);
|
|
}
|
|
|
|
vec4 constantLodTextureLookup(sampler2D textureSampler, vec3 constantLodParams, mat3 textureTransform) {
|
|
bool atMaxClamp = v_constantLodUvCustom.z >= constantLodParams.y;
|
|
bool atMinClamp = v_constantLodUvCustom.z <= constantLodParams.x;
|
|
bool atClampBoundary = atMaxClamp || atMinClamp;
|
|
|
|
float effectiveDistance = atMaxClamp ? constantLodParams.y :
|
|
(atMinClamp ? constantLodParams.x : v_constantLodUvCustom.z);
|
|
|
|
float logDepth = log2(effectiveDistance);
|
|
logDepth = clamp(logDepth, -10.0, 20.0);
|
|
|
|
float f = fract(logDepth);
|
|
float p = floor(logDepth);
|
|
|
|
if (atClampBoundary) {
|
|
float clampedP = ceil(logDepth);
|
|
vec2 tc = v_constantLodUvCustom.xy / pow(2.0, clampedP) * constantLodParams.z;
|
|
// Apply texture transform to the final texture coordinates
|
|
tc = czm_computeTextureTransform(tc, textureTransform);
|
|
return texture(textureSampler, tc);
|
|
}
|
|
|
|
vec2 tc1 = v_constantLodUvCustom.xy / pow(2.0, p) * constantLodParams.z;
|
|
vec2 tc2 = v_constantLodUvCustom.xy / pow(2.0, p + 1.0) * constantLodParams.z;
|
|
|
|
// Apply texture transform to both LOD texture coordinates before mixing
|
|
tc1 = czm_computeTextureTransform(tc1, textureTransform);
|
|
tc2 = czm_computeTextureTransform(tc2, textureTransform);
|
|
|
|
return mix(texture(textureSampler, tc1), texture(textureSampler, tc2), f);
|
|
}
|
|
|
|
#endif
|
|
`;var{Material:Plt,MetallicRoughness:pZ,SpecularGlossiness:gZ,Specular:Gbe,Clearcoat:Wbe}=Tn,qbe={name:"MaterialPipelineStage",_processTexture:Su,_processTextureTransform:Ybe};qbe.process=function(e,t,n){let i=t.material,{model:r,uniformMap:o,shaderBuilder:a}=e;l(o.u_constantLodDistance)||(o.u_constantLodDistance=function(){let x=r.boundingSphere,T=n.camera;if(l(x)&&l(T)){let C=h.distance(T.positionWC,x.center);return Math.max(C,.1)}return 1});let s=l(r.classificationType),c=s,{defaultTexture:u,defaultNormalTexture:f,defaultEmissiveTexture:d}=n.context;Llt(i,o,a,u,f,d,c,e),l(i.specularGlossiness)?Nlt(i.specularGlossiness,o,a,u,c,e):(l(i.specular)&&_t.supportedExtensions.KHR_materials_specular&&Flt(i.specular,o,a,u,c),l(i.anisotropy)&&_t.supportedExtensions.KHR_materials_anisotropy&&klt(i.anisotropy,o,a,u,c),l(i.clearcoat)&&_t.supportedExtensions.KHR_materials_clearcoat&&zlt(i.clearcoat,o,a,u,c),Ult(i.metallicRoughness,o,a,u,c,e));let p=_t.getAttributeBySemantic(t,ot.NORMAL),g=l(r.pointCloudShading)&&!r.pointCloudShading.normalShading;l(i.planarFill)&&Dlt(i.planarFill,t,e,n);let m=l(i.planarFill)&&i.planarFill.backgroundFill,y=e.lightingOptions;i.unlit||!p||s||g||m?y.lightingModel=rg.UNLIT:y.lightingModel=rg.PBR;let A=r.backFaceCulling&&!i.doubleSided;e.renderStateOptions.cull.enabled=A;let b=e.alphaOptions;i.alphaMode===C0.BLEND?b.pass=Pe.TRANSLUCENT:i.alphaMode===C0.MASK&&(b.alphaCutoff=i.alphaCutoff),l(i.pointDiameter)&&(a.addDefine("HAS_POINT_DIAMETER",void 0,he.BOTH),a.addUniform("float","u_pointDiameter",he.VERTEX),o.u_pointDiameter=function(){return i.pointDiameter*n.pixelRatio}),l(i.lineStyle)&&Olt(i.lineStyle,t,n,o,a),a.addFragmentLines(dV),i.doubleSided&&a.addDefine("HAS_DOUBLE_SIDED_MATERIAL",void 0,he.BOTH)};function Dlt(e,t,n,i){let{uniformMap:r,shaderBuilder:o}=n;if(i.planarFillRequested=!0,o.addDefine("HAS_PLANAR_FILL_DEPTH",void 0,he.FRAGMENT),e.backgroundFill&&o.addDefine("HAS_BACKGROUND_FILL",void 0,he.FRAGMENT),!(l(t.featureIds)&&t.featureIds.length>0))return;let s=t.featureIds[0].positionalLabel;o.addDefine("PLANAR_FILL_FEATURE_ID",s,he.FRAGMENT),e.behind?o.addDefine("HAS_PLANAR_FILL_BEHIND",void 0,he.FRAGMENT):(n.planarFillIdPass=!0,o.addDefine("HAS_PLANAR_FILL_ID_PASS",void 0,he.FRAGMENT),o.addUniform("bool","u_isPlanarFillIdPass",he.FRAGMENT),r.u_isPlanarFillIdPass=function(){return!1})}function Rlt(e,t,n,i,r,o){let a=n.constantLod;if(!l(a)||!l(o))return;let s=`HAS_${r}_CONSTANT_LOD`;if(e.addDefine(s,void 0,he.BOTH),!l(t.u_constantLodOffset)){e.addDefine("HAS_CONSTANT_LOD",void 0,he.BOTH),e.addVarying("vec3","v_constantLodUvCustom"),e.addUniform("vec2","u_constantLodOffset",he.VERTEX),e.addUniform("float","u_constantLodDistance",he.VERTEX),e.addUniform("mat4","u_constantLodWorldToEnu",he.VERTEX),e.addFragmentLines(mV);let u=hV.split(`
|
|
`).filter(f=>!f.trim().startsWith("//")||f.includes("#"));e.addFunctionLines("setDynamicVaryingsVS",u)}let c=`${i}ConstantLodParams`;if(e.addUniform("vec3",c,he.FRAGMENT),t[c]=function(){return new h(a.minClampDistance,a.maxClampDistance,a.repetitions)},!l(t.u_constantLodOffset)){t.u_constantLodOffset=function(){return a.offset};let u=O.clone(O.IDENTITY),f=!1;t.u_constantLodWorldToEnu=function(){if(!f){let d=o.model.boundingSphere;if(l(d)){let p=d.center,g=mt.eastNorthUpToFixedFrame(p);O.inverse(g,u),f=!0}}return f?u:O.IDENTITY}}}function Olt(e,t,n,i,r){let{width:o,pattern:a}=e;l(o)&&(r.addUniform("float","u_lineWidth",he.VERTEX),i.u_lineWidth=function(){return o*n.pixelRatio}),l(a)&&(r.addDefine("HAS_LINE_PATTERN",void 0,he.BOTH),r.addUniform("float","u_linePattern",he.FRAGMENT),r.addVarying("float","v_lineCoord"),i.u_linePattern=function(){return a});let s=_t.getAttributeBySemantic(t,ot.CUMULATIVE_DISTANCE);if(l(a)&&l(s)&&(t.primitiveType===Re.LINES||t.primitiveType===Re.TRIANGLE_STRIP)){r.addDefine("HAS_LINE_CUMULATIVE_DISTANCE",void 0,he.VERTEX),s.normalized&&r.addDefine("LINE_CUM_DIST_NORMALIZED",void 0,he.VERTEX),r.addUniform("float","u_cumulativeDistanceMax",he.VERTEX),r.addUniform("float","u_pixelsPerWorld",he.VERTEX);let c=l(s.max)?s.max:1;i.u_cumulativeDistanceMax=function(){return c},i.u_pixelsPerWorld=function(){let f=n.camera.frustum,d=1,p;return l(f.right)&&l(f.left)?p=f.right-f.left:l(f.width)&&(p=f.width),l(p)&&p>0&&(d=n.context.drawingBufferWidth/p),d};let u=_t.getAttributeInfo(s).variableName;r.addVertexLines(`
|
|
#ifdef HAS_LINE_CUMULATIVE_DISTANCE
|
|
void lineStyleStageVS(in ProcessedAttributes attributes)
|
|
{
|
|
float cumDist = attributes.${u};
|
|
#ifdef LINE_CUM_DIST_NORMALIZED
|
|
cumDist *= u_cumulativeDistanceMax;
|
|
#endif
|
|
const float textureCoordinateBase = 8192.0;
|
|
v_lineCoord = textureCoordinateBase + cumDist * u_pixelsPerWorld;
|
|
}
|
|
#endif
|
|
`)}else l(a)&&r.addVertexLines(`
|
|
#ifdef HAS_LINE_PATTERN
|
|
void lineStyleStageVS(in ProcessedAttributes attributes)
|
|
{
|
|
vec4 posClip = gl_Position;
|
|
vec2 screenPos = ((posClip.xy / posClip.w) * 0.5 + 0.5) * czm_viewport.zw;
|
|
|
|
const float textureCoordinateBase = 8192.0;
|
|
if (czm_viewport.z > czm_viewport.w) {
|
|
v_lineCoord = textureCoordinateBase + screenPos.x;
|
|
} else {
|
|
v_lineCoord = textureCoordinateBase + screenPos.y;
|
|
}
|
|
}
|
|
#endif
|
|
`)}function Ybe(e,t,n,i,r){let o=`HAS_${r}_TEXTURE_TRANSFORM`;e.addDefine(o,void 0,he.FRAGMENT);let a=`${i}Transform`;e.addUniform("mat3",a,he.FRAGMENT),t[a]=function(){return n.transform}}function Mlt(e,t,n,i,r){let o=`HAS_${r}_TEXTURE_SCALE`;e.addDefine(o,void 0,he.FRAGMENT);let a=`${i}Scale`;e.addUniform("float",a,he.FRAGMENT),t[a]=function(){return n.scale}}function Su(e,t,n,i,r,o,a){e.addUniform("sampler2D",i,he.FRAGMENT),t[i]=function(){return n.texture??o};let s=`HAS_${r}_TEXTURE`;e.addDefine(s,void 0,he.FRAGMENT);let u=`v_texCoord_${n.texCoord}`,f=`TEXCOORD_${r}`;e.addDefine(f,u,he.FRAGMENT);let d=n.transform;l(d)&&!$.equals(d,$.IDENTITY)&&Ybe(e,t,n,i,r);let{scale:p}=n;l(p)&&p!==1&&Mlt(e,t,n,i,r),Rlt(e,t,n,i,r,a)}function Llt(e,t,n,i,r,o,a,s){let{emissiveFactor:c,emissiveTexture:u,normalTexture:f,occlusionTexture:d}=e;l(c)&&!h.equals(c,Plt.DEFAULT_EMISSIVE_FACTOR)&&(n.addUniform("vec3","u_emissiveFactor",he.FRAGMENT),t.u_emissiveFactor=function(){return e.emissiveFactor},n.addDefine("HAS_EMISSIVE_FACTOR",void 0,he.FRAGMENT),l(u)&&!a&&Su(n,t,u,"u_emissiveTexture","EMISSIVE",o));let p;if(l(e.metallicRoughness)&&l(e.metallicRoughness.baseColorTexture)&&l(e.metallicRoughness.baseColorTexture.constantLod)?p=e.metallicRoughness.baseColorTexture.constantLod:l(e.specularGlossiness)&&l(e.specularGlossiness.diffuseTexture)&&l(e.specularGlossiness.diffuseTexture.constantLod)&&(p=e.specularGlossiness.diffuseTexture.constantLod),l(f)&&!a){let g=f;l(f.constantLod)&&l(p)&&(g=Object.create(Object.getPrototypeOf(f)),Object.assign(g,f),g.constantLod=p),Su(n,t,g,"u_normalTexture","NORMAL",r,s)}l(d)&&!a&&Su(n,t,d,"u_occlusionTexture","OCCLUSION",i)}function Nlt(e,t,n,i,r,o){let{diffuseTexture:a,diffuseFactor:s,specularGlossinessTexture:c,specularFactor:u,glossinessFactor:f}=e;n.addDefine("USE_SPECULAR_GLOSSINESS",void 0,he.FRAGMENT),l(a)&&!r&&Su(n,t,a,"u_diffuseTexture","DIFFUSE",i,o),l(s)&&!ae.equals(s,gZ.DEFAULT_DIFFUSE_FACTOR)&&(n.addUniform("vec4","u_diffuseFactor",he.FRAGMENT),t.u_diffuseFactor=function(){return e.diffuseFactor},n.addDefine("HAS_DIFFUSE_FACTOR",void 0,he.FRAGMENT)),l(c)&&!r&&Su(n,t,c,"u_specularGlossinessTexture","SPECULAR_GLOSSINESS",i),l(u)&&!h.equals(u,gZ.DEFAULT_SPECULAR_FACTOR)&&(n.addUniform("vec3","u_legacySpecularFactor",he.FRAGMENT),t.u_legacySpecularFactor=function(){return e.specularFactor},n.addDefine("HAS_LEGACY_SPECULAR_FACTOR",void 0,he.FRAGMENT)),l(f)&&f!==gZ.DEFAULT_GLOSSINESS_FACTOR&&(n.addUniform("float","u_glossinessFactor",he.FRAGMENT),t.u_glossinessFactor=function(){return e.glossinessFactor},n.addDefine("HAS_GLOSSINESS_FACTOR",void 0,he.FRAGMENT))}function Flt(e,t,n,i,r){let{specularTexture:o,specularFactor:a,specularColorTexture:s,specularColorFactor:c}=e;n.addDefine("USE_SPECULAR",void 0,he.FRAGMENT),l(o)&&!r&&Su(n,t,o,"u_specularTexture","SPECULAR",i),l(a)&&a!==Gbe.DEFAULT_SPECULAR_FACTOR&&(n.addUniform("float","u_specularFactor",he.FRAGMENT),t.u_specularFactor=function(){return e.specularFactor},n.addDefine("HAS_SPECULAR_FACTOR",void 0,he.FRAGMENT)),l(s)&&!r&&Su(n,t,s,"u_specularColorTexture","SPECULAR_COLOR",i),l(c)&&!h.equals(c,Gbe.DEFAULT_SPECULAR_COLOR_FACTOR)&&(n.addUniform("vec3","u_specularColorFactor",he.FRAGMENT),t.u_specularColorFactor=function(){return e.specularColorFactor},n.addDefine("HAS_SPECULAR_COLOR_FACTOR",void 0,he.FRAGMENT))}var Blt=new h;function klt(e,t,n,i,r){let{anisotropyStrength:o,anisotropyRotation:a,anisotropyTexture:s}=e;n.addDefine("USE_ANISOTROPY",void 0,he.FRAGMENT),l(s)&&!r&&Su(n,t,s,"u_anisotropyTexture","ANISOTROPY",i);let c=Math.cos(a),u=Math.sin(a);n.addUniform("vec3","u_anisotropy",he.FRAGMENT),t.u_anisotropy=function(){return h.fromElements(c,u,o,Blt)}}function zlt(e,t,n,i,r){let{clearcoatFactor:o,clearcoatTexture:a,clearcoatRoughnessFactor:s,clearcoatRoughnessTexture:c,clearcoatNormalTexture:u}=e;n.addDefine("USE_CLEARCOAT",void 0,he.FRAGMENT),l(o)&&o!==Wbe.DEFAULT_CLEARCOAT_FACTOR&&(n.addUniform("float","u_clearcoatFactor",he.FRAGMENT),t.u_clearcoatFactor=function(){return e.clearcoatFactor},n.addDefine("HAS_CLEARCOAT_FACTOR",void 0,he.FRAGMENT)),l(a)&&!r&&Su(n,t,a,"u_clearcoatTexture","CLEARCOAT",i),l(s)&&o!==Wbe.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_clearcoatRoughnessFactor",he.FRAGMENT),t.u_clearcoatRoughnessFactor=function(){return e.clearcoatRoughnessFactor},n.addDefine("HAS_CLEARCOAT_ROUGHNESS_FACTOR",void 0,he.FRAGMENT)),l(c)&&!r&&Su(n,t,c,"u_clearcoatRoughnessTexture","CLEARCOAT_ROUGHNESS",i),l(u)&&!r&&Su(n,t,u,"u_clearcoatNormalTexture","CLEARCOAT_NORMAL",i)}function Ult(e,t,n,i,r,o){n.addDefine("USE_METALLIC_ROUGHNESS",void 0,he.FRAGMENT);let a=e.baseColorTexture;l(a)&&!r&&Su(n,t,a,"u_baseColorTexture","BASE_COLOR",i,o);let s=e.baseColorFactor;l(s)&&!ae.equals(s,pZ.DEFAULT_BASE_COLOR_FACTOR)&&(n.addUniform("vec4","u_baseColorFactor",he.FRAGMENT),t.u_baseColorFactor=function(){return e.baseColorFactor},n.addDefine("HAS_BASE_COLOR_FACTOR",void 0,he.FRAGMENT));let c=e.metallicRoughnessTexture;l(c)&&!r&&Su(n,t,c,"u_metallicRoughnessTexture","METALLIC_ROUGHNESS",i);let u=e.metallicFactor;l(u)&&u!==pZ.DEFAULT_METALLIC_FACTOR&&(n.addUniform("float","u_metallicFactor",he.FRAGMENT),t.u_metallicFactor=function(){return e.metallicFactor},n.addDefine("HAS_METALLIC_FACTOR",void 0,he.FRAGMENT));let f=e.roughnessFactor;l(f)&&f!==pZ.DEFAULT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_roughnessFactor",he.FRAGMENT),t.u_roughnessFactor=function(){return e.roughnessFactor},n.addDefine("HAS_ROUGHNESS_FACTOR",void 0,he.FRAGMENT))}var pV=qbe;var Nl={name:"MetadataPickingPipelineStage",METADATA_PICKING_ENABLED:"METADATA_PICKING_ENABLED",METADATA_PICKING_VALUE_TYPE:"METADATA_PICKING_VALUE_TYPE",METADATA_PICKING_VALUE_STRING:"METADATA_PICKING_VALUE_STRING",METADATA_PICKING_VALUE_COMPONENT_X:"METADATA_PICKING_VALUE_COMPONENT_X",METADATA_PICKING_VALUE_COMPONENT_Y:"METADATA_PICKING_VALUE_COMPONENT_Y",METADATA_PICKING_VALUE_COMPONENT_Z:"METADATA_PICKING_VALUE_COMPONENT_Z",METADATA_PICKING_VALUE_COMPONENT_W:"METADATA_PICKING_VALUE_COMPONENT_W"};Nl.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine(Nl.METADATA_PICKING_VALUE_TYPE,"float",he.FRAGMENT),i.addDefine(Nl.METADATA_PICKING_VALUE_STRING,"0.0",he.FRAGMENT),i.addDefine(Nl.METADATA_PICKING_VALUE_COMPONENT_X,"0.0",he.FRAGMENT),i.addDefine(Nl.METADATA_PICKING_VALUE_COMPONENT_Y,"0.0",he.FRAGMENT),i.addDefine(Nl.METADATA_PICKING_VALUE_COMPONENT_Z,"0.0",he.FRAGMENT),i.addDefine(Nl.METADATA_PICKING_VALUE_COMPONENT_W,"0.0",he.FRAGMENT),i.addFunction("metadataPickingStage","void metadataPickingStage(Metadata metadata, MetadataClass metadataClass, inout vec4 metadataValues)",he.FRAGMENT),i.addFunctionLines("metadataPickingStage",[`${Nl.METADATA_PICKING_VALUE_TYPE} value = ${Nl.METADATA_PICKING_VALUE_TYPE}(${Nl.METADATA_PICKING_VALUE_STRING});`,`metadataValues.x = ${Nl.METADATA_PICKING_VALUE_COMPONENT_X};`,`metadataValues.y = ${Nl.METADATA_PICKING_VALUE_COMPONENT_Y};`,`metadataValues.z = ${Nl.METADATA_PICKING_VALUE_COMPONENT_Z};`,`metadataValues.w = ${Nl.METADATA_PICKING_VALUE_COMPONENT_W};`],he.FRAGMENT)};var Cd=Nl;var gV=`void morphTargetsStage(inout ProcessedAttributes attributes)
|
|
{
|
|
vec3 positionMC = attributes.positionMC;
|
|
attributes.positionMC = getMorphedPosition(positionMC);
|
|
|
|
#ifdef HAS_NORMALS
|
|
vec3 normalMC = attributes.normalMC;
|
|
attributes.normalMC = getMorphedNormal(normalMC);
|
|
#endif
|
|
|
|
#ifdef HAS_TANGENTS
|
|
vec3 tangentMC = attributes.tangentMC;
|
|
attributes.tangentMC = getMorphedTangent(tangentMC);
|
|
#endif
|
|
}`;var Tc={name:"MorphTargetsPipelineStage",FUNCTION_ID_GET_MORPHED_POSITION:"getMorphedPosition",FUNCTION_SIGNATURE_GET_MORPHED_POSITION:"vec3 getMorphedPosition(in vec3 position)",FUNCTION_ID_GET_MORPHED_NORMAL:"getMorphedNormal",FUNCTION_SIGNATURE_GET_MORPHED_NORMAL:"vec3 getMorphedNormal(in vec3 normal)",FUNCTION_ID_GET_MORPHED_TANGENT:"getMorphedTangent",FUNCTION_SIGNATURE_GET_MORPHED_TANGENT:"vec3 getMorphedTangent(in vec3 tangent)"};Tc.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_MORPH_TARGETS",void 0,he.VERTEX),qlt(n);let i=t.morphTargets.length;for(let s=0;s<i;s++){let c=t.morphTargets[s].attributes,u=c.length;for(let f=0;f<u;f++){let d=c[f],p=d.semantic;p!==ot.POSITION&&p!==ot.NORMAL&&p!==ot.TANGENT||(jlt(e,d,e.attributeIndex,s),e.attributeIndex++)}}Ylt(n);let o=e.runtimeNode.morphWeights.length;n.addUniform("float",`u_morphWeights[${o}]`,he.VERTEX),n.addVertexLines(gV);let a={u_morphWeights:function(){return e.runtimeNode.morphWeights}};e.uniformMap=Ot(a,e.uniformMap)};var Vlt={attributeString:void 0,functionId:void 0};function jlt(e,t,n,i){let r=e.shaderBuilder;Hlt(e,t,n);let o=Glt(t,Vlt);Wlt(r,o,i)}function Hlt(e,t,n){let i={index:n,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,componentsPerAttribute:Vt.getNumberOfComponents(t.type),componentDatatype:t.componentDatatype,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};e.attributes.push(i)}function Glt(e,t){switch(e.semantic){case ot.POSITION:t.attributeString="Position",t.functionId=Tc.FUNCTION_ID_GET_MORPHED_POSITION;break;case ot.NORMAL:t.attributeString="Normal",t.functionId=Tc.FUNCTION_ID_GET_MORPHED_NORMAL;break;case ot.TANGENT:t.attributeString="Tangent",t.functionId=Tc.FUNCTION_ID_GET_MORPHED_TANGENT;break;default:break}return t}function Wlt(e,t,n){let i=t.attributeString,r=`a_target${i}_${n}`,o=`morphed${i} += u_morphWeights[${n}] * a_target${i}_${n};`;e.addAttribute("vec3",r),e.addFunctionLines(t.functionId,[o])}function qlt(e){e.addFunction(Tc.FUNCTION_ID_GET_MORPHED_POSITION,Tc.FUNCTION_SIGNATURE_GET_MORPHED_POSITION,he.VERTEX),e.addFunctionLines(Tc.FUNCTION_ID_GET_MORPHED_POSITION,["vec3 morphedPosition = position;"]),e.addFunction(Tc.FUNCTION_ID_GET_MORPHED_NORMAL,Tc.FUNCTION_SIGNATURE_GET_MORPHED_NORMAL,he.VERTEX),e.addFunctionLines(Tc.FUNCTION_ID_GET_MORPHED_NORMAL,["vec3 morphedNormal = normal;"]),e.addFunction(Tc.FUNCTION_ID_GET_MORPHED_TANGENT,Tc.FUNCTION_SIGNATURE_GET_MORPHED_TANGENT,he.VERTEX),e.addFunctionLines(Tc.FUNCTION_ID_GET_MORPHED_TANGENT,["vec3 morphedTangent = tangent;"])}function Ylt(e){e.addFunctionLines(Tc.FUNCTION_ID_GET_MORPHED_POSITION,["return morphedPosition;"]),e.addFunctionLines(Tc.FUNCTION_ID_GET_MORPHED_NORMAL,["return morphedNormal;"]),e.addFunctionLines(Tc.FUNCTION_ID_GET_MORPHED_TANGENT,["return morphedTangent;"])}var _V=Tc;var Xbe={name:"PickingPipelineStage"};function _Z(e){return`vec4(rgba8UnormToUint32(${e}), isEdge ? 1.0 : 0.0, -v_positionEC.z, 0.0)`}Xbe.process=function(e,t,n){let i=n.context,r=e.runtimeNode,o=e.shaderBuilder,a=e.model,s=r.node.instances;if(e.hasPropertyTable)Xlt(e,t,s,i);else if(l(s))Klt(e,i);else{let c=Kbe(e),u=i.createPickId(c);a._pipelineResources.push(u),a._pickIds.push(u),o.addUniform("vec4","czm_pickColor",he.FRAGMENT);let f=e.uniformMap;f.czm_pickColor=function(){return u.color},e.pickId="czm_pickColor",e.snapId=_Z(e.pickId)}};function Kbe(e,t){let n=e.model;if(l(n.pickObject))return n.pickObject;let i={model:n,node:e.runtimeNode,primitive:e.runtimePrimitive},r;if(qo.is3DTiles(n.type)){let o=n.content;r={content:o,primitive:o.tileset,detail:i}}else r={primitive:n,detail:i};return r.id=n.id,l(t)&&(r.instanceId=t),r}function Xlt(e,t,n){let i=e.model,r,o,a=i.featureIdLabel,s=i.instanceFeatureIdLabel;l(i.featureTableId)?r=i.featureTableId:l(n)?(o=_t.getFeatureIdsByLabel(n.featureIds,s),r=o.propertyTableId):(o=_t.getFeatureIdsByLabel(t.featureIds,a),r=o.propertyTableId);let c=i.featureTables[r];e.shaderBuilder.addUniform("sampler2D","model_pickTexture",he.FRAGMENT);let f=c.batchTexture;e.uniformMap.model_pickTexture=function(){return f.pickTexture??f.defaultTexture},e.pickId="((selectedFeature.id < int(model_featuresLength)) ? texture(model_pickTexture, selectedFeature.st) : vec4(0.0))",e.snapId=_Z(e.pickId)}function Klt(e,t){let n=e.instanceCount,i=new Array(n),r=new Uint8Array(n*4),o=e.model,a=o._pipelineResources;for(let d=0;d<n;d++){let p=Kbe(e,d),g=t.createPickId(p);a.push(g),i[d]=g;let m=g.color;r[d*4+0]=U.floatToByte(m.red),r[d*4+1]=U.floatToByte(m.green),r[d*4+2]=U.floatToByte(m.blue),r[d*4+3]=U.floatToByte(m.alpha)}o._pickIds=i;let s=Ze.createVertexBuffer({context:t,typedArray:r,usage:Oe.STATIC_DRAW});s.vertexArrayDestroyable=!1,o.statistics.addBuffer(s,!1),a.push(s);let u={index:e.attributeIndex++,vertexBuffer:s,componentsPerAttribute:4,componentDatatype:Y.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0,instanceDivisor:1};e.attributes.push(u);let f=e.shaderBuilder;f.addDefine("USE_PICKING",void 0,he.BOTH),f.addAttribute("vec4","a_pickColor"),f.addVarying("vec4","v_pickColor"),e.pickId="v_pickColor",e.snapId=_Z(e.pickId)}var yV=Xbe;var $be={ADD:0,REPLACE:1};Object.freeze($be);var To=$be;var AV=`float getPointSizeFromAttenuation(vec3 positionEC) {
|
|
// Variables are packed into a single vector to minimize gl.uniformXXX() calls
|
|
float pointSize = model_pointCloudParameters.x;
|
|
float geometricError = model_pointCloudParameters.y;
|
|
float depthMultiplier = model_pointCloudParameters.z;
|
|
|
|
float depth = -positionEC.z;
|
|
return min((geometricError / depth) * depthMultiplier, pointSize);
|
|
}
|
|
|
|
#ifdef HAS_POINT_CLOUD_SHOW_STYLE
|
|
float pointCloudShowStylingStage(in ProcessedAttributes attributes, in Metadata metadata) {
|
|
float tiles3d_tileset_time = model_pointCloudParameters.w;
|
|
return float(getShowFromStyle(attributes, metadata, tiles3d_tileset_time));
|
|
}
|
|
#endif
|
|
|
|
#ifdef HAS_POINT_CLOUD_COLOR_STYLE
|
|
vec4 pointCloudColorStylingStage(in ProcessedAttributes attributes, in Metadata metadata) {
|
|
float tiles3d_tileset_time = model_pointCloudParameters.w;
|
|
return getColorFromStyle(attributes, metadata, tiles3d_tileset_time);
|
|
}
|
|
#endif
|
|
|
|
#ifdef HAS_POINT_CLOUD_POINT_SIZE_STYLE
|
|
float pointCloudPointSizeStylingStage(in ProcessedAttributes attributes, in Metadata metadata) {
|
|
float tiles3d_tileset_time = model_pointCloudParameters.w;
|
|
return float(getPointSizeFromStyle(attributes, metadata, tiles3d_tileset_time));
|
|
}
|
|
#elif defined(HAS_POINT_CLOUD_ATTENUATION)
|
|
float pointCloudPointSizeStylingStage(in ProcessedAttributes attributes, in Metadata metadata) {
|
|
return getPointSizeFromAttenuation(v_positionEC);
|
|
}
|
|
#endif
|
|
|
|
#ifdef HAS_POINT_CLOUD_BACK_FACE_CULLING
|
|
float pointCloudBackFaceCullingStage() {
|
|
#if defined(HAS_NORMALS) && !defined(HAS_DOUBLE_SIDED_MATERIAL)
|
|
// This needs to be computed in eye coordinates so we can't use attributes.normalMC
|
|
return step(-v_normalEC.z, 0.0);
|
|
#else
|
|
return 1.0;
|
|
#endif
|
|
}
|
|
#endif
|
|
`;var $lt=new ae,Zbe={name:"PointCloudStylingPipelineStage"};Zbe.process=function(e,t,n){let i=e.shaderBuilder,r=e.model,o=r.style,a=r.structuralMetadata,s=l(a)?a.propertyAttributes:void 0,c=l(r.featureTableId)&&r.featureTables[r.featureTableId].featuresLength>0,u=!l(s)&&c;if(l(o)&&!u){let y=eut(s),A=tut(o,y);nut(i,A);let x=iut(A).indexOf("normalMC")>=0,T=_t.getAttributeBySemantic(t,ot.NORMAL);if(x&&!T)throw new oe("Style references the NORMAL semantic but the point cloud does not have normals");i.addDefine("COMPUTE_POSITION_WC_STYLE",void 0,he.VERTEX),A.styleTranslucent&&(e.alphaOptions.pass=Pe.TRANSLUCENT)}let f=r.pointCloudShading;f.attenuation&&i.addDefine("HAS_POINT_CLOUD_ATTENUATION",void 0,he.VERTEX),f.backFaceCulling&&i.addDefine("HAS_POINT_CLOUD_BACK_FACE_CULLING",void 0,he.VERTEX);let d,p,g;qo.is3DTiles(r.type)&&(p=!0,d=r.content,g=d.tile.refine===To.ADD),i.addUniform("vec4","model_pointCloudParameters",he.VERTEX),i.addVertexLines(AV);let m=e.uniformMap;m.model_pointCloudParameters=function(){let y=$lt,A=1;p&&(A=g?5:d.tileset.memoryAdjustedScreenSpaceError),y.x=f.maximumAttenuation??A,y.x*=n.pixelRatio;let b=Jlt(e,t,f,d);y.y=b*f.geometricErrorScale;let x=n.context,T=n.camera.frustum,C;return n.mode===re.SCENE2D||T instanceof pn?C=Number.POSITIVE_INFINITY:C=x.drawingBufferHeight/n.camera.frustum.sseDenominator,y.z=C,p&&(y.w=d.tileset.timeSinceLoad),y}};var Jbe=new h;function Jlt(e,t,n,i){if(l(i)){let f=i.tile.geometricError;if(f>0)return f}if(l(n.baseResolution))return n.baseResolution;let r=_t.getAttributeBySemantic(t,ot.POSITION),o=r.count,a=e.runtimeNode.transform,s=h.subtract(r.max,r.min,Jbe);s=O.multiplyByPointAsVector(a,s,Jbe);let c=s.x*s.y*s.z;return I.cbrt(c/o)}var Zlt={colorStyleFunction:void 0,showStyleFunction:void 0,pointSizeStyleFunction:void 0,styleTranslucent:!1},Qlt={POSITION:"attributes.positionMC",POSITION_ABSOLUTE:"v_positionWC",COLOR:"attributes.color_0",NORMAL:"attributes.normalMC"};function eut(e){let t=Xe(Qlt);if(!l(e))return t;for(let n=0;n<e.length;n++){let r=e[n].properties;for(let o in r)r.hasOwnProperty(o)&&(t[o]=`metadata.${o}`)}return t}var yZ="ProcessedAttributes attributes, Metadata metadata, float tiles3d_tileset_time";function tut(e,t){let n=Zlt,i={translucent:!1};return n.colorStyleFunction=e.getColorShaderFunction(`getColorFromStyle(${yZ})`,t,i),n.showStyleFunction=e.getShowShaderFunction(`getShowFromStyle(${yZ})`,t,i),n.pointSizeStyleFunction=e.getPointSizeShaderFunction(`getPointSizeFromStyle(${yZ})`,t,i),n.styleTranslucent=l(n.colorStyleFunction)&&i.translucent,n}function nut(e,t){let n=t.colorStyleFunction;l(n)&&(e.addDefine("HAS_POINT_CLOUD_COLOR_STYLE",void 0,he.BOTH),e.addVertexLines(n),e.addVarying("vec4","v_pointCloudColor"));let i=t.showStyleFunction;l(i)&&(e.addDefine("HAS_POINT_CLOUD_SHOW_STYLE",void 0,he.BOTH),e.addVertexLines(i),e.addVarying("float","v_pointCloudShow"));let r=t.pointSizeStyleFunction;l(r)&&(e.addDefine("HAS_POINT_CLOUD_POINT_SIZE_STYLE",void 0,he.VERTEX),e.addVertexLines(r))}function AZ(e,t){let n=/attributes\.(\w+)/g,i=n.exec(e);for(;i!==null;){let r=i[1];t.indexOf(r)===-1&&t.push(r),i=n.exec(e)}}function iut(e){let t=e.colorStyleFunction,n=e.showStyleFunction,i=e.pointSizeStyleFunction,r=[];return l(t)&&AZ(t,r),l(n)&&AZ(n,r),l(i)&&AZ(i,r),r}var bV=Zbe;var xV=`void primitiveOutlineStage() {
|
|
v_outlineCoordinates = a_outlineCoordinates;
|
|
}
|
|
`;var TV=`void primitiveOutlineStage(inout czm_modelMaterial material) {
|
|
if (!model_showOutline) {
|
|
return;
|
|
}
|
|
|
|
float outlineX =
|
|
texture(model_outlineTexture, vec2(v_outlineCoordinates.x, 0.5)).r;
|
|
float outlineY =
|
|
texture(model_outlineTexture, vec2(v_outlineCoordinates.y, 0.5)).r;
|
|
float outlineZ =
|
|
texture(model_outlineTexture, vec2(v_outlineCoordinates.z, 0.5)).r;
|
|
float outlineness = max(outlineX, max(outlineY, outlineZ));
|
|
|
|
material.diffuse = mix(material.diffuse, model_outlineColor.rgb, model_outlineColor.a * outlineness);
|
|
}
|
|
`;var Qbe={name:"PrimitiveOutlinePipelineStage"};Qbe.process=function(e,t,n){let i=e.shaderBuilder,r=e.uniformMap;i.addDefine("HAS_PRIMITIVE_OUTLINE",void 0,he.BOTH),i.addAttribute("vec3","a_outlineCoordinates"),i.addVarying("vec3","v_outlineCoordinates");let o=t.outlineCoordinates,a={index:e.attributeIndex++,vertexBuffer:o.buffer,componentsPerAttribute:Vt.getNumberOfComponents(o.type),componentDatatype:o.componentDatatype,offsetInBytes:o.byteOffset,strideInBytes:o.byteStride,normalize:o.normalized};e.attributes.push(a),i.addUniform("sampler2D","model_outlineTexture",he.FRAGMENT);let s=_E.createTexture(n.context);r.model_outlineTexture=function(){return s};let c=e.model;i.addUniform("vec4","model_outlineColor",he.FRAGMENT),r.model_outlineColor=function(){return c.outlineColor},i.addUniform("bool","model_showOutline",he.FRAGMENT),r.model_showOutline=function(){return c.showOutline},i.addVertexLines(xV),i.addFragmentLines(TV)};var CV=Qbe;var exe={name:"PrimitiveStatisticsPipelineStage",_countGeometry:txe,_count2DPositions:nxe,_countMorphTargetAttributes:ixe,_countMaterialTextures:rxe,_countFeatureIdTextures:oxe,_countBinaryMetadata:axe};exe.process=function(e,t,n){let i=e.model,r=i.statistics;txe(r,t),nxe(r,e.runtimePrimitive),ixe(r,t),rxe(r,t.material),oxe(r,t.featureIds),axe(r,i)};function txe(e,t){let n=l(t.indices)?t.indices.count:_t.getAttributeBySemantic(t,"POSITION").count,i=t.primitiveType;i===Re.POINTS?e.pointsLength+=n:Re.isTriangles(i)&&(e.trianglesLength+=rut(i,n));let r=t.attributes,o=r.length;for(let c=0;c<o;c++){let u=r[c];if(l(u.buffer)){let f=l(u.typedArray);e.addBuffer(u.buffer,f)}}let a=t.outlineCoordinates;l(a)&&l(a.buffer)&&e.addBuffer(a.buffer,!1);let s=t.indices;if(l(s)&&l(s.buffer)){let c=l(s.typedArray);e.addBuffer(s.buffer,c)}}function rut(e,t){switch(e){case Re.TRIANGLES:return t/3;case Re.TRIANGLE_STRIP:case Re.TRIANGLE_FAN:return Math.max(t-2,0);default:return 0}}function nxe(e,t){let n=t.positionBuffer2D;l(n)&&e.addBuffer(n,!0)}function ixe(e,t){let n=t.morphTargets;if(!l(n))return;let i=!1,r=n.length;for(let o=0;o<r;o++){let a=n[o].attributes,s=a.length;for(let c=0;c<s;c++){let u=a[c];l(u.buffer)&&e.addBuffer(u.buffer,i)}}}function rxe(e,t){let n=out(t),i=n.length;for(let r=0;r<i;r++){let o=n[r];l(o)&&l(o.texture)&&e.addTexture(o.texture)}}function out(e){let t=e.metallicRoughness,n=[e.emissiveTexture,e.normalTexture,e.occlusionTexture,t.baseColorTexture,t.metallicRoughnessTexture],i=e.specularGlossiness;return l(i)&&(n.push(i.diffuseTexture),n.push(i.specularGlossinessTexture)),n}function oxe(e,t){let n=t.length;for(let i=0;i<n;i++){let r=t[i];if(r instanceof Tn.FeatureIdTexture){let o=r.textureReader;l(o.texture)&&e.addTexture(o.texture)}}}function axe(e,t){let n=t.structuralMetadata;l(n)&&(aut(e,n),e.propertyTablesByteLength+=n.propertyTablesByteLength);let i=t.featureTables;if(!l(i))return;let r=i.length;for(let o=0;o<r;o++){let a=i[o];e.addBatchTexture(a.batchTexture)}}function aut(e,t){let n=t.propertyTextures;if(!l(n))return;let i=n.length;for(let r=0;r<i;r++){let a=n[r].properties;for(let s in a)if(a.hasOwnProperty(s)){let u=a[s].textureReader;l(u.texture)&&e.addTexture(u.texture)}}}var vV=exe;var sut=new O,cut=new O,sxe={name:"SceneMode2DPipelineStage"};sxe.process=function(e,t,n){let i=_t.getAttributeBySemantic(t,ot.POSITION),r=e.shaderBuilder,o=e.model,a=o.sceneGraph.computedModelMatrix,s=e.runtimeNode.computedTransform,c=O.multiplyTransformation(a,s,sut),u=fut(e,c,n),f=e.runtimePrimitive;f.boundingSphere2D=u;let d=e.runtimeNode.node.instances;if(l(d))return;if(l(i.typedArray)){let y=mut(i,c,u,n);f.positionBuffer2D=y,o._modelResources.push(y),i.typedArray=void 0}r.addDefine("USE_2D_POSITIONS",void 0,he.VERTEX),r.addUniform("mat4","u_modelView2D",he.VERTEX);let p=O.fromTranslation(u.center,new O),g=n.context,m={u_modelView2D:function(){return O.multiplyTransformation(g.uniformState.view,p,cut)}};e.uniformMap=Ot(m,e.uniformMap)};var lut=new h,uut=new h;function fut(e,t,n){let i=O.multiplyByPoint(t,e.positionMin,lut),r=cr.computeActualEllipsoidPosition(n,i,i),o=O.multiplyByPoint(t,e.positionMax,uut),a=cr.computeActualEllipsoidPosition(n,o,o);return se.fromCornerPoints(r,a,new se)}var cxe=new h;function dut(e,t){let n=e.length,i=new Float32Array(n),r=t.quantizedVolumeOffset,o=t.quantizedVolumeStepSize;for(let a=0;a<n;a+=3){let s=h.fromArray(e,a,cxe),c=h.multiplyComponents(s,o,s),u=h.add(c,r,c);i[a]=u.x,i[a+1]=u.y,i[a+2]=u.z}return i}function hut(e,t,n,i){let r;l(e.quantization)?r=dut(e.typedArray,e.quantization):r=e.typedArray.slice();let o=e.byteOffset/Float32Array.BYTES_PER_ELEMENT,a=r.length,s=l(e.byteStride)?e.byteStride/Float32Array.BYTES_PER_ELEMENT:3;for(let c=o;c<a;c+=s){let u=h.fromArray(r,c,cxe);if(isNaN(u.x)||isNaN(u.y)||isNaN(u.z))continue;let f=O.multiplyByPoint(t,u,u),d=cr.computeActualEllipsoidPosition(i,f,f),p=h.subtract(d,n,d);r[c]=p.x,r[c+1]=p.y,r[c+2]=p.z}return r}function mut(e,t,n,i){let r=Xe(i);r.mode=re.COLUMBUS_VIEW;let o=n.center,a=hut(e,t,o,r),s=Ze.createVertexBuffer({context:i.context,typedArray:a,usage:Oe.STATIC_DRAW});return s.vertexArrayDestroyable=!1,s}var EV=sxe;var SV=`void skinningStage(inout ProcessedAttributes attributes)
|
|
{
|
|
mat4 skinningMatrix = getSkinningMatrix();
|
|
mat3 skinningMatrixMat3 = mat3(skinningMatrix);
|
|
|
|
vec4 positionMC = vec4(attributes.positionMC, 1.0);
|
|
attributes.positionMC = vec3(skinningMatrix * positionMC);
|
|
|
|
#ifdef HAS_NORMALS
|
|
vec3 normalMC = attributes.normalMC;
|
|
attributes.normalMC = skinningMatrixMat3 * normalMC;
|
|
#endif
|
|
|
|
#ifdef HAS_TANGENTS
|
|
vec3 tangentMC = attributes.tangentMC;
|
|
attributes.tangentMC = skinningMatrixMat3 * tangentMC;
|
|
#endif
|
|
}`;var lx={name:"SkinningPipelineStage",FUNCTION_ID_GET_SKINNING_MATRIX:"getSkinningMatrix",FUNCTION_SIGNATURE_GET_SKINNING_MATRIX:"mat4 getSkinningMatrix()"};lx.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_SKINNING",void 0,he.VERTEX),gut(n,t);let i=e.runtimeNode,r=i.computedJointMatrices;n.addUniform("mat4",`u_jointMatrices[${r.length}]`,he.VERTEX),n.addVertexLines(SV);let o={u_jointMatrices:function(){return i.computedJointMatrices}};e.uniformMap=Ot(o,e.uniformMap)};function put(e){let t=-1,n=e.attributes,i=n.length;for(let r=0;r<i;r++){let o=n[r];(o.semantic===ot.JOINTS||o.semantic===ot.WEIGHTS)&&(t=Math.max(t,o.setIndex))}return t}function gut(e,t){e.addFunction(lx.FUNCTION_ID_GET_SKINNING_MATRIX,lx.FUNCTION_SIGNATURE_GET_SKINNING_MATRIX,he.VERTEX),e.addFunctionLines(lx.FUNCTION_ID_GET_SKINNING_MATRIX,["mat4 skinnedMatrix = mat4(0);"]);let i,r,o=["x","y","z","w"],a=put(t);for(i=0;i<=a;i++)for(r=0;r<=3;r++){let c=o[r],u=`skinnedMatrix += a_weights_${i}.${c} * u_jointMatrices[int(a_joints_${i}.${c})];`;e.addFunctionLines(lx.FUNCTION_ID_GET_SKINNING_MATRIX,[u])}e.addFunctionLines(lx.FUNCTION_ID_GET_SKINNING_MATRIX,["return skinnedMatrix;"])}var wV=lx;var IV=`void verticalExaggerationStage(
|
|
inout ProcessedAttributes attributes
|
|
) {
|
|
// Compute the distance from the camera to the local center of curvature.
|
|
vec4 vertexPositionENU = czm_modelToEnu * vec4(attributes.positionMC, 1.0);
|
|
vec2 vertexAzimuth = normalize(vertexPositionENU.xy);
|
|
// Curvature = 1 / radius of curvature.
|
|
float azimuthalCurvature = dot(vertexAzimuth * vertexAzimuth, czm_eyeEllipsoidCurvature);
|
|
float eyeToCenter = 1.0 / azimuthalCurvature + czm_eyeHeight;
|
|
|
|
// Compute the approximate ellipsoid normal at the vertex position.
|
|
// Uses a circular approximation for the Earth curvature along the geodesic.
|
|
vec3 vertexPositionEC = (czm_modelView * vec4(attributes.positionMC, 1.0)).xyz;
|
|
vec3 centerToVertex = eyeToCenter * czm_eyeEllipsoidNormalEC + vertexPositionEC;
|
|
vec3 vertexNormal = normalize(centerToVertex);
|
|
|
|
// Estimate the (sine of the) angle between the camera direction and the vertex normal
|
|
float verticalDistance = dot(vertexPositionEC, czm_eyeEllipsoidNormalEC);
|
|
float horizontalDistance = length(vertexPositionEC - verticalDistance * czm_eyeEllipsoidNormalEC);
|
|
float sinTheta = horizontalDistance / (eyeToCenter + verticalDistance);
|
|
bool isSmallAngle = clamp(sinTheta, 0.0, 0.05) == sinTheta;
|
|
|
|
// Approximate the change in height above the ellipsoid, from camera to vertex position.
|
|
float exactVersine = 1.0 - dot(czm_eyeEllipsoidNormalEC, vertexNormal);
|
|
float smallAngleVersine = 0.5 * sinTheta * sinTheta;
|
|
float versine = isSmallAngle ? smallAngleVersine : exactVersine;
|
|
float dHeight = dot(vertexPositionEC, vertexNormal) - eyeToCenter * versine;
|
|
float vertexHeight = czm_eyeHeight + dHeight;
|
|
|
|
// Transform the approximate vertex normal to model coordinates.
|
|
vec3 vertexNormalMC = (czm_inverseModelView * vec4(vertexNormal, 0.0)).xyz;
|
|
vertexNormalMC = normalize(vertexNormalMC);
|
|
|
|
// Compute the exaggeration and apply it along the approximate vertex normal.
|
|
float stretch = u_verticalExaggerationAndRelativeHeight.x;
|
|
float shift = u_verticalExaggerationAndRelativeHeight.y;
|
|
float exaggeration = (vertexHeight - shift) * (stretch - 1.0);
|
|
attributes.positionMC += exaggeration * vertexNormalMC;
|
|
}
|
|
`;var lxe={name:"VerticalExaggerationPipelineStage"},_ut=new k;lxe.process=function(e,t,n){let{shaderBuilder:i,uniformMap:r}=e;i.addVertexLines(IV),i.addDefine("HAS_VERTICAL_EXAGGERATION",void 0,he.VERTEX),i.addUniform("vec2","u_verticalExaggerationAndRelativeHeight",he.VERTEX),r.u_verticalExaggerationAndRelativeHeight=function(){return k.fromElements(n.verticalExaggeration,n.verticalExaggerationRelativeHeight,_ut)}};var PV=lxe;var uxe={name:"WireframePipelineStage"};uxe.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_WIREFRAME",void 0,he.FRAGMENT);let r=e.model,o=yut(t,e.indices,n);r._pipelineResources.push(o),e.wireframeIndexBuffer=o,r.statistics.addBuffer(o,!1);let s=e.primitiveType,c=e.count;e.primitiveType=Re.LINES,e.count=FP.getWireframeIndicesCount(s,c)};function yut(e,t,n){let r=_t.getAttributeBySemantic(e,ot.POSITION).count,o=n.context.webgl2,a;if(l(t)){let f=t.buffer,d=t.count;l(f)&&o?(a=f.sizeInBytes===d?new Uint8Array(d):Ve.createTypedArray(r,d),f.getBufferData(a)):a=t.typedArray}let s=e.primitiveType,c=FP.createWireframeIndices(s,r,a),u=Ve.fromSizeInBytes(c.BYTES_PER_ELEMENT);return Ze.createIndexBuffer({context:n.context,typedArray:c,usage:Oe.STATIC_DRAW,indexDatatype:u})}var DV=uxe;function fxe(e){e=e??H.EMPTY_OBJECT;let t=e.primitive,n=e.node,i=e.model;this.primitive=t,this.node=n,this.model=i,this.pipelineStages=[],this.drawCommand=void 0,this.boundingSphere=void 0,this.boundingSphere2D=void 0,this.positionBuffer2D=void 0,this.batchLengths=void 0,this.batchOffsets=void 0,this.updateStages=[]}fxe.prototype.configurePipeline=function(e){let t=this.pipelineStages;t.length=0;let n=this.primitive,i=this.node,r=this.model,o=r.customShader,a=r.style,s=e.context.webgl2,u=e.mode!==re.SCENE3D&&!e.scene3DOnly&&r._projectTo2D,f=e.verticalExaggeration!==1&&r.hasVerticalExaggeration,d=l(n.morphTargets)&&n.morphTargets.length>0,p=l(i.skin),g=l(r.imageryLayers)&&r.imageryLayers.length>0,m=l(o),A=!(m&&l(o.fragmentShaderText))||o.mode!==Ey.REPLACE_MATERIAL,b=_t.hasQuantizedAttributes(n.attributes),x=r.debugWireframe&&Re.isTriangles(n.primitiveType)&&(r._enableDebugWireframe||s),T=r.pointCloudShading,C=l(T)&&T.attenuation,E=l(T)&&T.backFaceCulling,w=n.primitiveType===Re.POINTS&&(l(a)||C||E),D=r._enableShowOutline&&l(n.outlineCoordinates),R=l(n.edgeVisibility),M=Aut(r,i,n),N=l(r.classificationType);u&&t.push(EV),t.push(UU),x&&t.push(DV),N&&t.push(xU),d&&t.push(_V),p&&t.push(wV),w&&t.push(bV),b&&t.push(OU),g&&(D?pt("outlines-and-draping","Primitive outlines disable imagery draping"):t.push(lV)),A&&t.push(pV),t.push(rx),t.push(Fh),t.push(Cd),M.hasPropertyTable&&(t.push(ax),t.push(bU),t.push(vU)),f&&t.push(PV),m&&t.push(RU),t.push(fV),r.allowPicking&&t.push(yV),D&&t.push(CV),R&&(e.edgeVisibilityRequested=!0,t.push(BU),t.push(LU)),t.push(AU),t.push(vV)};function Aut(e,t,n){let i;return l(t.instances)&&(i=_t.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),l(i))?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:(i=_t.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),l(i)?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:{hasFeatureIds:!1,hasPropertyTable:!1})}var RV=fxe;function bZ(e){e=e??H.EMPTY_OBJECT,this._sceneGraph=e.sceneGraph;let t=e.skin;this._skin=t,this._inverseBindMatrices=void 0,this._joints=[],this._jointMatrices=[],but(this)}Object.defineProperties(bZ.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 but(e){let t=e.skin,n=t.inverseBindMatrices;e._inverseBindMatrices=n;let i=t.joints,r=i.length,o=e.sceneGraph._runtimeNodes,a=e.joints,s=e._jointMatrices;for(let c=0;c<r;c++){let u=i[c].index,f=o[u];a.push(f);let d=n[c],p=dxe(f,d,new O);s.push(p)}}function dxe(e,t,n){let i=O.multiplyTransformation(e.transformToRoot,e.transform,n);return n=O.multiplyTransformation(i,t,n),n}bZ.prototype.updateJointMatrices=function(){let e=this._jointMatrices,t=e.length;for(let n=0;n<t;n++){let i=this.joints[n],r=this.inverseBindMatrices[n];e[n]=dxe(i,r,e[n])}};var OV=bZ;function xut(){this.pass=void 0,this.alphaCutoff=void 0}var UE=xut;function Tut(e){this.shaderBuilder=new ry,this.model=e,this.uniformMap={},this.alphaOptions=new UE,this.renderStateOptions=je.getState(je.fromCache({depthTest:{enabled:!0,func:Ac.LESS_OR_EQUAL}})),this.hasSilhouette=!1,this.hasSkipLevelOfDetail=!1,this.nodeRenderResources=[]}var MV=Tut;var LV=`void silhouetteStage(inout vec4 color) {
|
|
if(model_silhouettePass) {
|
|
color = czm_gammaCorrect(model_silhouetteColor);
|
|
}
|
|
}`;var NV=`void silhouetteStage(in ProcessedAttributes attributes, inout vec4 positionClip) {
|
|
#ifdef HAS_NORMALS
|
|
if(model_silhouettePass) {
|
|
vec3 normal = normalize(czm_normal3D * attributes.normalMC);
|
|
normal.x *= czm_projection[0][0];
|
|
normal.y *= czm_projection[1][1];
|
|
positionClip.xy += normal.xy * positionClip.w * model_silhouetteSize * czm_pixelRatio / czm_viewport.z;
|
|
}
|
|
#endif
|
|
}
|
|
`;var FV={name:"ModelSilhouettePipelineStage"};FV.silhouettesLength=0;FV.process=function(e,t,n){l(t._silhouetteId)||(t._silhouetteId=++FV.silhouettesLength);let i=e.shaderBuilder;i.addDefine("HAS_SILHOUETTE",void 0,he.BOTH),i.addVertexLines(NV),i.addFragmentLines(LV),i.addUniform("vec4","model_silhouetteColor",he.FRAGMENT),i.addUniform("float","model_silhouetteSize",he.VERTEX),i.addUniform("bool","model_silhouettePass",he.BOTH);let r={model_silhouetteColor:function(){return t.silhouetteColor},model_silhouetteSize:function(){return t.silhouetteSize},model_silhouettePass:function(){return!1}};e.uniformMap=Ot(r,e.uniformMap),e.hasSilhouette=!0};var BV=FV;var kV=`void modelSplitterStage()
|
|
{
|
|
// Don't split when rendering the shadow map, because it is rendered from
|
|
// the perspective of a totally different camera.
|
|
#ifndef SHADOW_MAP
|
|
if (model_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard;
|
|
if (model_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard;
|
|
#endif
|
|
}
|
|
`;var zV={name:"ModelSplitterPipelineStage",SPLIT_DIRECTION_UNIFORM_NAME:"model_splitDirection"};zV.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_SPLITTER",void 0,he.FRAGMENT),i.addFragmentLines(kV);let r={};i.addUniform("float",zV.SPLIT_DIRECTION_UNIFORM_NAME,he.FRAGMENT),r[zV.SPLIT_DIRECTION_UNIFORM_NAME]=function(){return t.splitDirection},e.uniformMap=Ot(r,e.uniformMap)};var UV=zV;function Cut(e,t){this.model=e.model,this.shaderBuilder=e.shaderBuilder.clone(),this.uniformMap=Xe(e.uniformMap),this.alphaOptions=Xe(e.alphaOptions),this.renderStateOptions=Xe(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,this.primitiveRenderResources=[]}var VV=Cut;function vut(e){e=e??H.EMPTY_OBJECT,this.lightingModel=e.lightingModel??rg.UNLIT}var jV=vut;function Eut(e,t){this.model=e.model,this.runtimeNode=e.runtimeNode,this.attributes=e.attributes.slice(),this.attributeIndex=e.attributeIndex,this.featureIdVertexAttributeSetIndex=e.featureIdVertexAttributeSetIndex,this.uniformMap=Xe(e.uniformMap),this.alphaOptions=Xe(e.alphaOptions),this.renderStateOptions=Xe(e.renderStateOptions,!0),this.hasSilhouette=e.hasSilhouette,this.hasSkipLevelOfDetail=e.hasSkipLevelOfDetail,this.planarFillIdPass=!1,this.shaderBuilder=e.shaderBuilder.clone(),this.instanceCount=e.instanceCount,this.runtimePrimitive=t;let n=t.primitive;this.count=l(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=h.clone(i.min,new h),this.positionMax=h.clone(i.max,new h),this.boundingSphere=se.fromCornerPoints(this.positionMin,this.positionMax,new se),this.lightingOptions=new jV,this.pickId=void 0,this.snapId=void 0}var HV=Eut;function TZ(e){e=e??H.EMPTY_OBJECT;let t=e.command,n=e.primitiveRenderResources,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 r=i.classificationType;this._classificationType=r,this._classifiesTerrain=r!==Zn.CESIUM_3D_TILE,this._classifies3DTiles=r!==Zn.TERRAIN,this._useDebugWireframe=i._enableDebugWireframe&&i.debugWireframe,this._pickId=n.pickId,this._commandListTerrain=[],this._commandList3DTiles=[],this._commandListIgnoreShow=[],this._commandListDebugWireframe=[],this._commandListTerrainPicking=[],this._commandList3DTilesPicking=[],Put(this)}function Sut(e){return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:e,frontOperation:{fail:Pt.KEEP,zFail:Pt.DECREMENT_WRAP,zPass:Pt.KEEP},backFunction:e,backOperation:{fail:Pt.KEEP,zFail:Pt.INCREMENT_WRAP,zPass:Pt.KEEP},reference:qt.CESIUM_3D_TILE_MASK,mask:qt.CESIUM_3D_TILE_MASK},stencilMask:qt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:Ac.LESS_OR_EQUAL},depthMask:!1}}var wut={stencilTest:{enabled:!0,frontFunction:Qn.NOT_EQUAL,frontOperation:{fail:Pt.ZERO,zFail:Pt.ZERO,zPass:Pt.ZERO},backFunction:Qn.NOT_EQUAL,backOperation:{fail:Pt.ZERO,zFail:Pt.ZERO,zPass:Pt.ZERO},reference:0,mask:qt.CLASSIFICATION_MASK},stencilMask:qt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:en.PRE_MULTIPLIED_ALPHA_BLEND},Iut={stencilTest:{enabled:!0,frontFunction:Qn.NOT_EQUAL,frontOperation:{fail:Pt.ZERO,zFail:Pt.ZERO,zPass:Pt.ZERO},backFunction:Qn.NOT_EQUAL,backOperation:{fail:Pt.ZERO,zFail:Pt.ZERO,zPass:Pt.ZERO},reference:0,mask:qt.CLASSIFICATION_MASK},stencilMask:qt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1},pxe=[];function Put(e){let t=e._command,n=pxe;if(e._useDebugWireframe){t.pass=Pe.OPAQUE,n.length=0,n.push(t),e._commandListDebugWireframe=XD(e,n,e._commandListDebugWireframe);let o=e._commandListDebugWireframe,a=o.length;for(let s=0;s<a;s++){let c=o[s];c.count*=2,c.offset*=2}return}let r=e.model.allowPicking;if(e._classifiesTerrain){let o=Pe.TERRAIN_CLASSIFICATION,a=xZ(t,o),s=hxe(t,o);n.length=0,n.push(a,s),e._commandListTerrain=XD(e,n,e._commandListTerrain),r&&(e._commandListTerrainPicking=mxe(e,n,e._commandListTerrainPicking))}if(e._classifies3DTiles){let o=Pe.CESIUM_3D_TILE_CLASSIFICATION,a=xZ(t,o),s=hxe(t,o);n.length=0,n.push(a,s),e._commandList3DTiles=XD(e,n,e._commandList3DTiles),r&&(e._commandList3DTilesPicking=mxe(e,n,e._commandList3DTilesPicking))}}function XD(e,t,n){let i=e._runtimePrimitive,r=i.batchLengths,o=i.batchOffsets,a=r.length,s=t.length;for(let c=0;c<a;c++){let u=r[c],f=o[c];for(let d=0;d<s;d++){let p=t[d],g=nt.shallowClone(p);g.count=u,g.offset=f,n.push(g)}}return n}function xZ(e,t){let n=nt.shallowClone(e);n.cull=!1,n.pass=t;let i=t===Pe.TERRAIN_CLASSIFICATION?Qn.ALWAYS:Qn.EQUAL,r=Sut(i);return n.renderState=je.fromCache(r),n}function hxe(e,t){let n=nt.shallowClone(e);return n.cull=!1,n.pass=t,n.renderState=je.fromCache(wut),n}var Dut=[];function mxe(e,t,n){let i=je.fromCache(Iut),r=t[0],o=t[1],a=nt.shallowClone(r);a.cull=!0,a.pickOnly=!0;let s=nt.shallowClone(o);s.cull=!0,s.pickOnly=!0,s.renderState=i,s.pickId=e._pickId;let c=Dut;return c.length=0,c.push(a,s),XD(e,c,n)}Object.defineProperties(TZ.prototype,{command:{get:function(){return this._command}},runtimePrimitive:{get:function(){return this._runtimePrimitive}},batchLengths:{get:function(){return this._runtimePrimitive.batchLengths}},batchOffsets:{get:function(){return this._runtimePrimitive.batchOffsets}},model:{get:function(){return this._model}},classificationType:{get:function(){return this._classificationType}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=O.clone(e,this._modelMatrix);let t=this._runtimePrimitive.boundingSphere;this._boundingVolume=se.transform(t,this._modelMatrix,this._boundingVolume)}},boundingVolume:{get:function(){return this._boundingVolume}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace=e}}});TZ.prototype.pushCommands=function(e,t){let n=e.passes;if(n.render){if(this._useDebugWireframe){Xn(t,this._commandListDebugWireframe);return}if(this._classifiesTerrain&&Xn(t,this._commandListTerrain),this._classifies3DTiles&&Xn(t,this._commandList3DTiles),e.invertClassification&&this._classifies3DTiles){if(this._commandListIgnoreShow.length===0){let r=Pe.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,o=xZ(this._command,r),a=pxe;a.length=0,a.push(o),this._commandListIgnoreShow=XD(this,a,this._commandListIgnoreShow)}Xn(t,this._commandListIgnoreShow)}}return n.pick&&(this._classifiesTerrain&&Xn(t,this._commandListTerrainPicking),this._classifies3DTiles&&Xn(t,this._commandList3DTilesPicking)),t};var GV=TZ;function VE(e){e=e??H.EMPTY_OBJECT;let t=e.command,n=e.primitiveRenderResources,i=n.model;this._model=i;let r=n.runtimePrimitive;this._runtimePrimitive=r,this._primitiveRenderResources=n;let o=t.pass===Pe.TRANSLUCENT,s=!r.primitive.material.doubleSided&&!o,c=n.hasSilhouette,u=!o&&!c,f=n.hasSkipLevelOfDetail&&!o,d=c,p=l(n.edgeGeometry);this._command=t,this._modelMatrix=O.clone(t.modelMatrix),this._boundingVolume=se.clone(t.boundingVolume),this._modelMatrix2D=new O,this._boundingVolume2D=new se,this._modelMatrix2DDirty=!1,this._backFaceCulling=t.renderState.cull.enabled,this._cullFace=t.renderState.cull.face,this._shadows=i.shadows,this._debugShowBoundingVolume=t.debugShowBoundingVolume,this._usesBackFaceCulling=s,this._needsTranslucentCommand=u,this._needsSkipLevelOfDetailCommands=f,this._needsSilhouetteCommands=d,this._needsEdgeCommands=p,this._needsPlanarFillIdCommand=n.planarFillIdPass,this._originalCommand=void 0,this._translucentCommand=void 0,this._skipLodBackfaceCommand=void 0,this._skipLodStencilCommand=void 0,this._silhouetteModelCommand=void 0,this._silhouetteColorCommand=void 0,this._edgeCommand=void 0,this._edgeSnapCommand=void 0,this._planarFillIdCommand=void 0,this._derivedCommands=[],this._has2DCommands=!1,Rut(this)}function vd(e){this.command=e.command,this.updateShadows=e.updateShadows,this.updateBackFaceCulling=e.updateBackFaceCulling,this.updateCullFace=e.updateCullFace,this.updateDebugShowBoundingVolume=e.updateDebugShowBoundingVolume,this.is2D=e.is2D??!1,this.derivedCommand2D=void 0}vd.clone=function(e){return new vd({command:e.command,updateShadows:e.updateShadows,updateBackFaceCulling:e.updateBackFaceCulling,updateCullFace:e.updateCullFace,updateDebugShowBoundingVolume:e.updateDebugShowBoundingVolume,is2D:e.is2D,derivedCommand2D:e.derivedCommand2D})};function Rut(e){let t=e._command;t.modelMatrix=e._modelMatrix,t.boundingVolume=e._boundingVolume;let n=e._model,i=e._usesBackFaceCulling,r=e._derivedCommands;if(e._originalCommand=new vd({command:t,updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0,is2D:!1}),r.push(e._originalCommand),e._needsTranslucentCommand&&(e._translucentCommand=new vd({command:kut(t),updateShadows:!0,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!0}),r.push(e._translucentCommand)),e._needsSkipLevelOfDetailCommands&&(e._skipLodBackfaceCommand=new vd({command:Wut(t),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:i,updateDebugShowBoundingVolume:!1}),e._skipLodStencilCommand=new vd({command:qut(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),r.push(e._skipLodBackfaceCommand),r.push(e._skipLodStencilCommand)),e._needsSilhouetteCommands&&(e._silhouetteModelCommand=new vd({command:zut(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),e._silhouetteColorCommand=new vd({command:Uut(t,n),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),r.push(e._silhouetteModelCommand),r.push(e._silhouetteColorCommand)),e._needsEdgeCommands){let o=e._primitiveRenderResources,a=o.edgeGeometry,s=l(a.lineWidth)?a.lineWidth:1,c=1;e._edgeCommand=new vd({command:gxe(t,o,s),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),e._edgeSnapCommand=new vd({command:gxe(t,o,c),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),r.push(e._edgeCommand),r.push(e._edgeSnapCommand)}e._needsPlanarFillIdCommand&&(e._planarFillIdCommand=new vd({command:Vut(t),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),r.push(e._planarFillIdCommand))}Object.defineProperties(VE.prototype,{command:{get:function(){return this._command}},runtimePrimitive:{get:function(){return this._runtimePrimitive}},model:{get:function(){return this._model}},primitiveType:{get:function(){return this._command.primitiveType}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=O.clone(e,this._modelMatrix),this._modelMatrix2DDirty=!0,this._boundingVolume=se.transform(this.runtimePrimitive.boundingSphere,this._modelMatrix,this._boundingVolume)}},boundingVolume:{get:function(){return this._boundingVolume}},shadows:{get:function(){return this._shadows},set:function(e){this._shadows=e,Mut(this)}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){this._backFaceCulling!==e&&(this._backFaceCulling=e,Lut(this))}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace!==e&&(this._cullFace=e,Nut(this))}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolume=e,Fut(this))}}});function Out(e,t){let n=e._modelMatrix;e._modelMatrix2D=O.clone(n,e._modelMatrix2D),e._modelMatrix2D[13]-=I.sign(n[13])*2*I.PI*t.mapProjection.ellipsoid.maximumRadius,e._boundingVolume2D=se.transform(e.runtimePrimitive.boundingSphere,e._modelMatrix2D,e._boundingVolume2D)}function Mut(e){let t=e.shadows,n=Rn.castShadows(t),i=Rn.receiveShadows(t),r=e._derivedCommands;for(let o=0;o<r.length;++o){let a=r[o];if(a.updateShadows){let s=a.command;s.castShadows=n,s.receiveShadows=i}}}function Lut(e){let t=e.backFaceCulling,n=e._derivedCommands;for(let i=0;i<n.length;++i){let r=n[i];if(r.updateBackFaceCulling){let o=r.command,a=Xe(o.renderState,!0);a.cull.enabled=t,o.renderState=je.fromCache(a)}}}function Nut(e){let t=e.cullFace,n=e._derivedCommands;for(let i=0;i<n.length;++i){let r=n[i];if(r.updateCullFace){let o=r.command,a=Xe(o.renderState,!0);a.cull.face=t,o.renderState=je.fromCache(a)}}}function Fut(e){let t=e.debugShowBoundingVolume,n=e._derivedCommands;for(let i=0;i<n.length;++i){let r=n[i];if(r.updateDebugShowBoundingVolume){let o=r.command;o.debugShowBoundingVolume=t}}}VE.prototype.pushCommands=function(e,t){let n=WV(this,e);n&&!this._has2DCommands&&(But(this),this._has2DCommands=!0,this._modelMatrix2DDirty=!0),this._modelMatrix2DDirty&&(Out(this,e),this._modelMatrix2DDirty=!1);let i=this.model.styleCommandsNeeded;if(!(this._needsTranslucentCommand&&l(i)&&(i!==_p.ALL_OPAQUE&&Cp(t,this._translucentCommand,n),i===_p.ALL_TRANSLUCENT))){if(this._needsSkipLevelOfDetailCommands){let{tileset:r,tile:o}=this._model.content;if(r.hasMixedContent){o._finalResolution||Cp(r._backfaceCommands,this._skipLodBackfaceCommand,n),jut(this,o,n),Cp(t,this._skipLodStencilCommand,n);return}}if(this._needsSilhouetteCommands){Cp(t,this._silhouetteModelCommand,n);return}return this._model.edgeDisplayMode===Mh.EDGES_ONLY&&this._needsEdgeCommands||Cp(t,this._originalCommand,n),t}};VE.prototype.pushSilhouetteCommands=function(e,t){let n=WV(this,e);return Cp(t,this._silhouetteColorCommand,n),t};VE.prototype.pushEdgeCommands=function(e,t){if(!l(this._edgeCommand))return t;let n=this._model.edgeDisplayMode,i=e.passes,r=WV(this,e);if(i.snap){let a=this._edgeSnapCommand;return a.command.pass=Pe.CESIUM_3D_TILE_EDGES_DIRECT,l(a.derivedCommand2D)&&(a.derivedCommand2D.command.pass=Pe.CESIUM_3D_TILE_EDGES_DIRECT),Cp(t,a,r),t}if(i.pick){if(n!==Mh.EDGES_ONLY)return t;let a=this._edgeCommand;return a.command.pass=Pe.CESIUM_3D_TILE_EDGES_DIRECT,l(a.derivedCommand2D)&&(a.derivedCommand2D.command.pass=Pe.CESIUM_3D_TILE_EDGES_DIRECT),Cp(t,a,r),t}if(n===Mh.SURFACES_ONLY)return t;let o=n===Mh.EDGES_ONLY?Pe.CESIUM_3D_TILE_EDGES_DIRECT:Pe.CESIUM_3D_TILE_EDGES;return this._edgeCommand.command.pass=o,l(this._edgeCommand.derivedCommand2D)&&(this._edgeCommand.derivedCommand2D.command.pass=o),Cp(t,this._edgeCommand,r),t};VE.prototype.pushPlanarFillIdCommands=function(e,t){if(!l(this._planarFillIdCommand))return t;let n=WV(this,e);return Cp(t,this._planarFillIdCommand,n),t};function Cp(e,t,n){e.push(t.command),n&&e.push(t.derivedCommand2D.command)}function WV(e,t){if(t.mode!==re.SCENE2D||e.model._projectTo2D)return!1;let i=e.model.sceneGraph._boundingSphere2D,r=i.center.y-i.radius,o=i.center.y+i.radius,a=t.mapProjection.ellipsoid.maximumRadius*I.PI;return r<a&&o>a||r<-a&&o>-a}function og(e,t){if(!l(t))return;let n=vd.clone(t),i=nt.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 But(e){og(e,e._originalCommand),og(e,e._translucentCommand),og(e,e._skipLodBackfaceCommand),og(e,e._skipLodStencilCommand),og(e,e._silhouetteModelCommand),og(e,e._silhouetteColorCommand),og(e,e._edgeCommand),og(e,e._edgeSnapCommand),og(e,e._planarFillIdCommand)}function kut(e){let t=nt.shallowClone(e);t.pass=Pe.TRANSLUCENT;let n=Xe(e.renderState,!0);return n.cull.enabled=!1,n.depthMask=!1,n.blending=en.ALPHA_BLEND,t.renderState=je.fromCache(n),t}function zut(e,t){let n=t._silhouetteId%255,i=nt.shallowClone(e),r=Xe(e.renderState,!0);return r.stencilTest={enabled:!0,frontFunction:ee.ALWAYS,backFunction:ee.ALWAYS,reference:n,mask:-1,frontOperation:{fail:ee.KEEP,zFail:ee.KEEP,zPass:ee.REPLACE},backOperation:{fail:ee.KEEP,zFail:ee.KEEP,zPass:ee.REPLACE}},t.isInvisible()&&(r.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),i.renderState=je.fromCache(r),i}function Uut(e,t){let n=t._silhouetteId%255,i=nt.shallowClone(e),r=Xe(e.renderState,!0);r.cull.enabled=!1,(e.pass===Pe.TRANSLUCENT||t.silhouetteColor.alpha<1)&&(i.pass=Pe.TRANSLUCENT,r.depthMask=!1,r.blending=en.ALPHA_BLEND),r.stencilTest={enabled:!0,frontFunction:ee.NOTEQUAL,backFunction:ee.NOTEQUAL,reference:n,mask:-1,frontOperation:{fail:ee.KEEP,zFail:ee.KEEP,zPass:ee.KEEP},backOperation:{fail:ee.KEEP,zFail:ee.KEEP,zPass:ee.KEEP}};let a=Xe(e.uniformMap);return a.model_silhouettePass=function(){return!0},i.renderState=je.fromCache(r),i.uniformMap=a,i.castShadows=!1,i.receiveShadows=!1,i}function gxe(e,t,n){let i=t.edgeGeometry,r=nt.shallowClone(e);r.vertexArray=i.vertexArray,r.primitiveType=i.primitiveType,r.count=i.indexCount,l(i.shaderProgram)&&(r.shaderProgram=i.shaderProgram),r.pass=i.pass;let o=Xe(e.uniformMap);return o.u_isEdgePass=function(){return!0},o.u_lineWidth=function(){return n},r.uniformMap=o,r.castShadows=!1,r.receiveShadows=!1,r}function Vut(e){let t=nt.shallowClone(e);t.pass=Pe.CESIUM_3D_TILE_PLANAR_FILL_ID,t.castShadows=!1,t.receiveShadows=!1;let n=Xe(e.renderState,!0);n.blending.enabled=!1,t.renderState=je.fromCache(n);let i=Xe(e.uniformMap);return i.u_isPlanarFillIdPass=function(){return!0},t.uniformMap=i,t}function jut(e,t,n){let i=e._skipLodStencilCommand,r=i.command,o=t._selectionDepth,a=Hut(r);if(o!==a){let s=Gut(o),c=Xe(r.renderState,!0);c.stencilTest.reference=s,r.renderState=je.fromCache(c),n&&(i.derivedCommand2D.renderState=c)}}function Hut(e){return(e.renderState.stencilTest.reference&qt.SKIP_LOD_MASK)>>>qt.SKIP_LOD_BIT_SHIFT}function Gut(e){return qt.CESIUM_3D_TILE_MASK|e<<qt.SKIP_LOD_BIT_SHIFT}function Wut(e){let t=nt.shallowClone(e),n=Xe(e.renderState,!0);n.cull.enabled=!0,n.cull.face=Ui.FRONT,n.colorMask={red:!1,green:!1,blue:!1,alpha:!1},n.polygonOffset={enabled:!0,factor:5,units:5};let i=Xe(t.uniformMap),r=new k(5,5);return i.u_polygonOffset=function(){return r},t.renderState=je.fromCache(n),t.uniformMap=i,t.castShadows=!1,t.receiveShadows=!1,t}function qut(e){let t=nt.shallowClone(e),n=Xe(e.renderState,!0),{stencilTest:i}=n;return i.enabled=!0,i.mask=qt.SKIP_LOD_MASK,i.reference=qt.CESIUM_3D_TILE_MASK,i.frontFunction=Qn.GREATER_OR_EQUAL,i.frontOperation.zPass=Pt.REPLACE,i.backFunction=Qn.GREATER_OR_EQUAL,i.backOperation.zPass=Pt.REPLACE,n.stencilMask=qt.CESIUM_3D_TILE_MASK|qt.SKIP_LOD_MASK,t.renderState=je.fromCache(n),t}var qV=VE;var YV=`precision highp float;
|
|
|
|
czm_modelVertexOutput defaultVertexOutput(vec3 positionMC) {
|
|
czm_modelVertexOutput vsOutput;
|
|
vsOutput.positionMC = positionMC;
|
|
vsOutput.pointSize = 1.0;
|
|
return vsOutput;
|
|
}
|
|
|
|
void main()
|
|
{
|
|
// Initialize the attributes struct with all
|
|
// attributes except quantized ones.
|
|
ProcessedAttributes attributes;
|
|
initializeAttributes(attributes);
|
|
|
|
#ifdef HAS_IMAGERY
|
|
initializeImageryAttributes();
|
|
#endif
|
|
|
|
// Dequantize the quantized ones and add them to the
|
|
// attributes struct.
|
|
#ifdef USE_DEQUANTIZATION
|
|
dequantizationStage(attributes);
|
|
#endif
|
|
|
|
#ifdef HAS_MORPH_TARGETS
|
|
morphTargetsStage(attributes);
|
|
#endif
|
|
|
|
#ifdef HAS_SKINNING
|
|
skinningStage(attributes);
|
|
#endif
|
|
|
|
#ifdef HAS_PRIMITIVE_OUTLINE
|
|
primitiveOutlineStage();
|
|
#endif
|
|
|
|
// Compute the bitangent according to the formula in the glTF spec.
|
|
// Normal and tangents can be affected by morphing and skinning, so
|
|
// the bitangent should not be computed until their values are finalized.
|
|
#ifdef HAS_BITANGENTS
|
|
attributes.bitangentMC = normalize(cross(attributes.normalMC, attributes.tangentMC) * attributes.tangentSignMC);
|
|
#endif
|
|
|
|
FeatureIds featureIds;
|
|
featureIdStage(featureIds, attributes);
|
|
|
|
#ifdef HAS_SELECTED_FEATURE_ID
|
|
SelectedFeature feature;
|
|
selectedFeatureIdStage(feature, featureIds);
|
|
// Handle any show properties that come from the style.
|
|
cpuStylingStage(attributes.positionMC, feature);
|
|
#endif
|
|
|
|
#if defined(USE_2D_POSITIONS) || defined(USE_2D_INSTANCING)
|
|
// The scene mode 2D pipeline stage and instancing stage add a different
|
|
// model view matrix to accurately project the model to 2D. However, the
|
|
// output positions and normals should be transformed by the 3D matrices
|
|
// to keep the data the same for the fragment shader.
|
|
mat4 modelView = czm_modelView3D;
|
|
mat3 normal = czm_normal3D;
|
|
#else
|
|
// These are used for individual model projection because they will
|
|
// automatically change based on the scene mode.
|
|
mat4 modelView = czm_modelView;
|
|
mat3 normal = czm_normal;
|
|
#endif
|
|
|
|
// Update the position for this instance in place
|
|
#ifdef HAS_INSTANCING
|
|
|
|
// The legacy instance stage is used when rendering i3dm models that
|
|
// encode instances transforms in world space, as opposed to glTF models
|
|
// that use EXT_mesh_gpu_instancing, where instance transforms are encoded
|
|
// in object space.
|
|
#ifdef USE_LEGACY_INSTANCING
|
|
mat4 instanceModelView;
|
|
mat3 instanceModelViewInverseTranspose;
|
|
|
|
legacyInstancingStage(attributes, instanceModelView, instanceModelViewInverseTranspose);
|
|
|
|
modelView = instanceModelView;
|
|
normal = instanceModelViewInverseTranspose;
|
|
#else
|
|
instancingStage(attributes);
|
|
#endif
|
|
|
|
#ifdef USE_PICKING
|
|
v_pickColor = a_pickColor;
|
|
#endif
|
|
|
|
#endif
|
|
|
|
Metadata metadata;
|
|
MetadataClass metadataClass;
|
|
MetadataStatistics metadataStatistics;
|
|
metadataStage(featureIds, metadata, metadataClass, metadataStatistics, attributes);
|
|
|
|
#ifdef HAS_VERTICAL_EXAGGERATION
|
|
verticalExaggerationStage(attributes);
|
|
#endif
|
|
|
|
#ifdef HAS_CUSTOM_VERTEX_SHADER
|
|
czm_modelVertexOutput vsOutput = defaultVertexOutput(attributes.positionMC);
|
|
customShaderStage(vsOutput, attributes, featureIds, metadata, metadataClass, metadataStatistics);
|
|
#endif
|
|
|
|
// Compute the final position in each coordinate system needed.
|
|
// This returns the value that will be assigned to gl_Position.
|
|
vec4 positionClip = geometryStage(attributes, modelView, normal);
|
|
|
|
#if defined(HAS_LINE_CUMULATIVE_DISTANCE) || defined(HAS_LINE_PATTERN)
|
|
lineStyleStageVS(attributes);
|
|
#endif
|
|
|
|
// This must go after the geometry stage as it needs v_positionWC
|
|
#ifdef HAS_ATMOSPHERE
|
|
atmosphereStage(attributes);
|
|
#endif
|
|
|
|
#ifdef ENABLE_CLIPPING_POLYGONS
|
|
modelClippingPolygonsStage(attributes);
|
|
#endif
|
|
|
|
#ifdef HAS_SILHOUETTE
|
|
silhouetteStage(attributes, positionClip);
|
|
#endif
|
|
|
|
#ifdef HAS_POINT_CLOUD_SHOW_STYLE
|
|
float show = pointCloudShowStylingStage(attributes, metadata);
|
|
#else
|
|
float show = 1.0;
|
|
#endif
|
|
|
|
#ifdef HAS_POINT_CLOUD_BACK_FACE_CULLING
|
|
show *= pointCloudBackFaceCullingStage();
|
|
#endif
|
|
|
|
#ifdef HAS_POINT_CLOUD_COLOR_STYLE
|
|
v_pointCloudColor = pointCloudColorStylingStage(attributes, metadata);
|
|
#endif
|
|
|
|
#ifdef PRIMITIVE_TYPE_POINTS
|
|
#ifdef HAS_CUSTOM_VERTEX_SHADER
|
|
gl_PointSize = vsOutput.pointSize;
|
|
#elif defined(HAS_POINT_CLOUD_POINT_SIZE_STYLE) || defined(HAS_POINT_CLOUD_ATTENUATION)
|
|
gl_PointSize = pointCloudPointSizeStylingStage(attributes, metadata);
|
|
#elif defined(HAS_POINT_DIAMETER)
|
|
gl_PointSize = u_pointDiameter;
|
|
#else
|
|
gl_PointSize = 1.0;
|
|
#endif
|
|
|
|
gl_PointSize *= show;
|
|
#endif
|
|
|
|
// Important NOT to compute gl_Position = show * positionClip or we hit:
|
|
// https://github.com/CesiumGS/cesium/issues/11270
|
|
//
|
|
// We will discard points with v_pointCloudShow == 0 in the fragment shader.
|
|
gl_Position = positionClip;
|
|
|
|
#ifdef HAS_EDGE_VISIBILITY
|
|
edgeVisibilityStageVS();
|
|
#endif
|
|
|
|
#ifdef HAS_POINT_CLOUD_SHOW_STYLE
|
|
v_pointCloudShow = show;
|
|
#endif
|
|
}
|
|
`;var XV=`
|
|
precision highp float;
|
|
|
|
// \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
// BENTLEY_materials_planar_fill constants
|
|
//
|
|
// These factors scale gl_FragDepth AFTER czm_writeLogDepth has run, so
|
|
// they are proportional offsets in log-depth space. The corresponding
|
|
// eye-space offset therefore varies with the fragment's distance from
|
|
// the camera (growing with distance). This is the intended behavior: it
|
|
// matches the proportional depth comparison tolerance used by the edge
|
|
// visibility system, so fills and edges stay consistently ordered at all
|
|
// viewing distances.
|
|
// \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
// Depth pull factor for all planar fills: scales log depth by 0.9995,
|
|
// i.e. a 0.05% pull toward the camera in log-depth space.
|
|
const float PLANAR_DEPTH_PULL = 0.9995;
|
|
// Depth push factor for behind fills: scales log depth by 1.0002, i.e. a
|
|
// 0.02% push away from the camera in log-depth space, so behind fills sit
|
|
// behind same-object siblings.
|
|
const float BEHIND_DEPTH_PUSH = 1.0002;
|
|
// Tolerance for comparing feature IDs stored as floats (integer equality).
|
|
const float FEATURE_ID_TOLERANCE = 0.5;
|
|
// Offset added to feature IDs so 0 means "no planar fill" in the texture.
|
|
const float FEATURE_ID_OFFSET = 1.0;
|
|
|
|
czm_modelMaterial defaultModelMaterial()
|
|
{
|
|
czm_modelMaterial material;
|
|
material.diffuse = vec3(0.0);
|
|
material.specular = vec3(1.0);
|
|
material.roughness = 1.0;
|
|
material.occlusion = 1.0;
|
|
material.normalEC = vec3(0.0, 0.0, 1.0);
|
|
material.emissive = vec3(0.0);
|
|
material.alpha = 1.0;
|
|
return material;
|
|
}
|
|
|
|
vec4 handleAlpha(vec3 color, float alpha)
|
|
{
|
|
#ifdef ALPHA_MODE_MASK
|
|
if (alpha < u_alphaCutoff) {
|
|
discard;
|
|
}
|
|
#endif
|
|
|
|
return vec4(color, alpha);
|
|
}
|
|
|
|
void lineStyleStage()
|
|
{
|
|
#if defined(HAS_LINE_PATTERN) && !defined(HAS_EDGE_VISIBILITY)
|
|
const float maskLength = 16.0;
|
|
float dashPosition = fract(v_lineCoord / maskLength);
|
|
float maskIndex = floor(dashPosition * maskLength);
|
|
float maskTest = floor(u_linePattern / pow(2.0, maskIndex));
|
|
if (mod(maskTest, 2.0) < 1.0) {
|
|
discard;
|
|
}
|
|
#endif
|
|
}
|
|
|
|
SelectedFeature selectedFeature;
|
|
|
|
// Set by edge-pass fragments below; consumed by the snapId expression built
|
|
// in PickingPipelineStage (see Scene#snap).
|
|
bool isEdge = false;
|
|
|
|
void main()
|
|
{
|
|
#if defined(PRIMITIVE_TYPE_POINTS) && defined(HAS_POINT_DIAMETER)
|
|
// Render points as circles
|
|
float distanceToCenter = length(gl_PointCoord - vec2(0.5));
|
|
if (distanceToCenter > 0.5) {
|
|
discard;
|
|
}
|
|
#endif
|
|
|
|
#ifdef HAS_POINT_CLOUD_SHOW_STYLE
|
|
if (v_pointCloudShow == 0.0)
|
|
{
|
|
discard;
|
|
}
|
|
#endif
|
|
|
|
#ifdef HAS_MODEL_SPLITTER
|
|
modelSplitterStage();
|
|
#endif
|
|
|
|
czm_modelMaterial material = defaultModelMaterial();
|
|
|
|
ProcessedAttributes attributes;
|
|
geometryStage(attributes);
|
|
|
|
FeatureIds featureIds;
|
|
featureIdStage(featureIds, attributes);
|
|
|
|
// \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
// BENTLEY_materials_planar_fill: Feature-ID pre-pass output.
|
|
//
|
|
// When HAS_PLANAR_FILL_ID_PASS is defined this command is being rendered
|
|
// into the planar fill ID framebuffer. Non-behind planar geometry writes
|
|
// its feature ID + 1 into the R channel (0 = no feature) and returns.
|
|
// No material / lighting / post-process stages are needed.
|
|
// \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
#ifdef HAS_PLANAR_FILL_ID_PASS
|
|
if (u_isPlanarFillIdPass) {
|
|
float fid = float(featureIds.PLANAR_FILL_FEATURE_ID) + FEATURE_ID_OFFSET;
|
|
out_FragColor = vec4(fid, 0.0, 0.0, 1.0);
|
|
// Still need to write log depth so the depth buffer is correct.
|
|
#ifdef LOG_DEPTH
|
|
czm_writeLogDepth();
|
|
#endif
|
|
return;
|
|
}
|
|
#endif
|
|
|
|
Metadata metadata;
|
|
MetadataClass metadataClass;
|
|
MetadataStatistics metadataStatistics;
|
|
metadataStage(featureIds, metadata, metadataClass, metadataStatistics, attributes);
|
|
|
|
//========================================================================
|
|
// When not picking metadata START
|
|
#ifndef METADATA_PICKING_ENABLED
|
|
|
|
#ifdef HAS_SELECTED_FEATURE_ID
|
|
selectedFeatureIdStage(selectedFeature, featureIds);
|
|
#endif
|
|
|
|
#ifndef CUSTOM_SHADER_REPLACE_MATERIAL
|
|
materialStage(material, attributes, selectedFeature);
|
|
#endif
|
|
|
|
#ifdef HAS_CUSTOM_FRAGMENT_SHADER
|
|
customShaderStage(material, attributes, featureIds, metadata, metadataClass, metadataStatistics);
|
|
#endif
|
|
|
|
lightingStage(material, attributes);
|
|
|
|
#ifdef HAS_SELECTED_FEATURE_ID
|
|
cpuStylingStage(material, selectedFeature);
|
|
#endif
|
|
|
|
#ifdef HAS_MODEL_COLOR
|
|
modelColorStage(material);
|
|
#endif
|
|
|
|
#ifdef HAS_PRIMITIVE_OUTLINE
|
|
primitiveOutlineStage(material);
|
|
#endif
|
|
|
|
vec4 color = handleAlpha(material.diffuse, material.alpha);
|
|
|
|
// When not picking metadata END
|
|
//========================================================================
|
|
#else
|
|
//========================================================================
|
|
// When picking metadata START
|
|
|
|
vec4 metadataValues = vec4(0.0, 0.0, 0.0, 0.0);
|
|
metadataPickingStage(metadata, metadataClass, metadataValues);
|
|
vec4 color = metadataValues;
|
|
|
|
#endif
|
|
// When picking metadata END
|
|
//========================================================================
|
|
|
|
lineStyleStage();
|
|
|
|
#ifdef HAS_CLIPPING_PLANES
|
|
modelClippingPlanesStage(color);
|
|
#endif
|
|
|
|
#ifdef ENABLE_CLIPPING_POLYGONS
|
|
modelClippingPolygonsStage();
|
|
#endif
|
|
|
|
//========================================================================
|
|
// When not picking metadata START
|
|
#ifndef METADATA_PICKING_ENABLED
|
|
|
|
#if defined(HAS_SILHOUETTE) && defined(HAS_NORMALS)
|
|
silhouetteStage(color);
|
|
#endif
|
|
|
|
#ifdef HAS_ATMOSPHERE
|
|
atmosphereStage(color, attributes);
|
|
#endif
|
|
|
|
#ifdef HAS_EDGE_VISIBILITY
|
|
edgeVisibilityStage(color, featureIds);
|
|
edgeDetectionStage(color, featureIds);
|
|
// Edge-pass fragments rasterize the edge band itself. Flag them so the
|
|
// snap payload (see Scene#snap) can distinguish edges from surfaces;
|
|
// surface fragments leave isEdge false.
|
|
if (u_isEdgePass) {
|
|
isEdge = true;
|
|
}
|
|
#endif
|
|
|
|
#endif
|
|
// When not picking metadata END
|
|
//========================================================================
|
|
|
|
out_FragColor = color;
|
|
|
|
// \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
// Explicit log-depth write.
|
|
//
|
|
// DerivedCommand.getLogDepthShaderProgram auto-wraps only when the raw
|
|
// source does NOT already mention czm_writeLogDepth. We mention it
|
|
// above in the HAS_PLANAR_FILL_ID_PASS block, so we must also handle
|
|
// the normal code path ourselves. The LOG_DEPTH define is injected by
|
|
// that same auto-wrapper, so this block is active exactly when needed.
|
|
// \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
#ifdef LOG_DEPTH
|
|
czm_writeLogDepth();
|
|
#endif
|
|
|
|
// \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
// BENTLEY_materials_planar_fill: Proportional depth adjustment.
|
|
//
|
|
// Per the spec, planar primitives must render in front of non-planar
|
|
// geometry. We use proportional depth scaling (similar to edge visibility)
|
|
// which scales naturally with logarithmic depth at all viewing distances.
|
|
//
|
|
// \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
#ifdef HAS_PLANAR_FILL_DEPTH
|
|
gl_FragDepth *= PLANAR_DEPTH_PULL;
|
|
#endif
|
|
|
|
// \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
// BENTLEY_materials_planar_fill: Behind fill depth adjustment.
|
|
//
|
|
// After the proportional depth pull has been applied, sample the planar
|
|
// fill ID texture. If the pixel already belongs to the same feature,
|
|
// apply a small proportional push so this "behind" fill sits behind its
|
|
// non-behind sibling. If the pixel has no stored feature, the base pull
|
|
// still keeps us in front of non-planar geometry.
|
|
//
|
|
// \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
#ifdef HAS_PLANAR_FILL_BEHIND
|
|
{
|
|
vec2 screenCoord = gl_FragCoord.xy / czm_viewport.zw;
|
|
float storedEncoded = texture(czm_planarFillIdTexture, screenCoord).r;
|
|
float storedFeatureId = storedEncoded - FEATURE_ID_OFFSET;
|
|
float myFeatureId = float(featureIds.PLANAR_FILL_FEATURE_ID);
|
|
|
|
// storedFeatureId < 0 means "no planar fill at this pixel".
|
|
if (storedFeatureId >= 0.0 && abs(storedFeatureId - myFeatureId) < FEATURE_ID_TOLERANCE) {
|
|
// Proportional push: multiply by >1 to move away from camera.
|
|
// Net effect: PLANAR_DEPTH_PULL * BEHIND_DEPTH_PUSH \u2248 0.9997,
|
|
// still in front of non-planar but behind same-feature non-behind fills.
|
|
gl_FragDepth *= BEHIND_DEPTH_PUSH;
|
|
}
|
|
}
|
|
#endif
|
|
}
|
|
|
|
`;function _xe(){}_xe.buildModelDrawCommand=function(e,t){let n=e.shaderBuilder,i=Yut(e,n,t),r=Xut(e,i,t),o=e.model;return l(o.classificationType)?new GV({primitiveRenderResources:e,command:r}):new qV({primitiveRenderResources:e,command:r})};function Yut(e,t,n){t.addVertexLines(YV),t.addFragmentLines(XV);let i=e.model,r=t.buildShaderProgram(n.context);return i._pipelineResources.push(r),r}function Xut(e,t,n){let i=Kut(e),r=new Vn({context:n.context,indexBuffer:i,attributes:e.attributes}),o=e.model;o._pipelineResources.push(r);let a=e.alphaOptions.pass,s=o.sceneGraph,c=n.mode===re.SCENE3D,u,f;if(!c&&!n.scene3DOnly&&o._projectTo2D)u=O.multiplyTransformation(s._computedModelMatrix,e.runtimeNode.computedTransform,new O),f=e.runtimePrimitive.boundingSphere2D;else{let x=c?s._computedModelMatrix:s._computedModelMatrix2D;u=O.multiplyTransformation(x,e.runtimeNode.computedTransform,new O),f=se.transform(e.boundingSphere,u)}let d=Xe(je.fromCache(e.renderStateOptions),!0);d.cull.face=_t.getCullFace(u,e.primitiveType),d=je.fromCache(d);let p=l(o.classificationType),g=p?!1:Rn.castShadows(o.shadows),m=p?!1:Rn.receiveShadows(o.shadows),y=p?void 0:e.pickId,A=p?void 0:e.snapId;return new nt({boundingVolume:f,modelMatrix:u,uniformMap:e.uniformMap,renderState:d,vertexArray:r,shaderProgram:t,cull:o.cull,pass:a,count:e.count,owner:o,pickId:y,snapId:A,pickMetadataAllowed:!0,instanceCount:e.instanceCount,primitiveType:e.primitiveType,debugShowBoundingVolume:o.debugShowBoundingVolume,castShadows:g,receiveShadows:m})}function Kut(e){let t=e.wireframeIndexBuffer;if(l(t))return t;let n=e.indices;if(l(n))return n.buffer}var KV=_xe;function Qc(e){e=e??H.EMPTY_OBJECT;let t=e.modelComponents;this._model=e.model,this._components=t,this._pipelineStages=[],this._updateStages=[],this._runtimeNodes=[],this._rootNodes=[],this._skinnedNodes=[],this._runtimeSkins=[],this.modelPipelineStages=[],this._boundingSphere=void 0,this._boundingSphere2D=void 0,this._computedModelMatrix=O.clone(O.IDENTITY),this._computedModelMatrix2D=O.clone(O.IDENTITY),this._axisCorrectionMatrix=_t.getAxisCorrectionMatrix(t.upAxis,t.forwardAxis,new O),this._runtimeArticulations={},$ut(this)}Object.defineProperties(Qc.prototype,{components:{get:function(){return this._components}},computedModelMatrix:{get:function(){return this._computedModelMatrix}},axisCorrectionMatrix:{get:function(){return this._axisCorrectionMatrix}},boundingSphere:{get:function(){return this._boundingSphere}}});function $ut(e){let t=e._components,n=t.scene,r=e._model.modelMatrix;yxe(e,r);let o=t.articulations,a=o.length,s=e._runtimeArticulations;for(let x=0;x<a;x++){let T=o[x],C=new iU({articulation:T,sceneGraph:e}),E=C.name;s[E]=C}let c=t.nodes,u=c.length;e._runtimeNodes=new Array(u);let d=n.nodes.length,p=O.IDENTITY;for(let x=0;x<d;x++){let T=n.nodes[x],C=Axe(e,T,p);e._rootNodes.push(C)}let g=t.skins,m=e._runtimeSkins,y=g.length;for(let x=0;x<y;x++){let T=g[x];m.push(new OV({skin:T,sceneGraph:e}))}let A=e._skinnedNodes,b=A.length;for(let x=0;x<b;x++){let T=A[x],C=e._runtimeNodes[T],w=c[T].skin.index;C._runtimeSkin=m[w],C.updateJointMatrices()}e.applyArticulations()}function yxe(e,t){let n=e._components,i=e._model;e._computedModelMatrix=O.multiplyTransformation(t,n.transform,e._computedModelMatrix),e._computedModelMatrix=O.multiplyTransformation(e._computedModelMatrix,e._axisCorrectionMatrix,e._computedModelMatrix),e._computedModelMatrix=O.multiplyByUniformScale(e._computedModelMatrix,i.computedScale,e._computedModelMatrix)}var Jut=new h;function Zut(e,t){let n=e._computedModelMatrix,i=O.getTranslation(n,Jut);if(!h.equals(i,h.ZERO))e._computedModelMatrix2D=mt.basisTo2D(t.mapProjection,n,e._computedModelMatrix2D);else{let r=e.boundingSphere.center,o=mt.ellipsoidTo2DModelMatrix(t.mapProjection,r,e._computedModelMatrix2D);e._computedModelMatrix2D=O.multiply(o,n,e._computedModelMatrix2D)}e._boundingSphere2D=se.transform(e._boundingSphere,e._computedModelMatrix2D,e._boundingSphere2D)}function Axe(e,t,n){let i=[],r=_t.getNodeTransform(t),o=t.children.length;for(let f=0;f<o;f++){let d=t.children[f],p=O.multiplyTransformation(n,r,new O),g=Axe(e,d,p);i.push(g)}let a=new yU({node:t,transform:r,transformToRoot:n,children:i,sceneGraph:e}),s=t.primitives.length;for(let f=0;f<s;f++)a.runtimePrimitives.push(new RV({primitive:t.primitives[f],node:t,model:e._model}));let c=t.index;e._runtimeNodes[c]=a,l(t.skin)&&e._skinnedNodes.push(c);let u=t.name;if(l(u)){let f=e._model,d=new uU(f,a);f._nodesByName[u]=d}return c}var Qut=new h,eft=new h,tft=new h,nft=new h;Qc.prototype.buildDrawCommands=function(e){let t=this.buildRenderResources(e);this.computeBoundingVolumes(t),this.createDrawCommands(t,e)};Qc.prototype.buildRenderResources=function(e){let t=this._model,n=new MV(t);t.statistics.clear(),this.configurePipeline(e);let i=this.modelPipelineStages;for(let r=0;r<i.length;r++)i[r].process(n,t,e);for(let r=0;r<this._runtimeNodes.length;r++){let o=this._runtimeNodes[r];if(!l(o))continue;o.configurePipeline();let a=o.pipelineStages,s=new VV(n,o);n.nodeRenderResources[r]=s;for(let c=0;c<a.length;c++)a[c].process(s,o.node,e);for(let c=0;c<o.runtimePrimitives.length;c++){let u=o.runtimePrimitives[c];u.configurePipeline(e);let f=u.pipelineStages,d=new HV(s,u);s.primitiveRenderResources[c]=d;for(let p=0;p<f.length;p++)f[p].process(d,u.primitive,e)}}return n};Qc.prototype.computeBoundingVolumes=function(e){let t=this._model,n=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Qut),i=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,eft);for(let r=0;r<this._runtimeNodes.length;r++){let o=this._runtimeNodes[r];if(!l(o))continue;let a=e.nodeRenderResources[r],s=o.computedTransform;for(let c=0;c<o.runtimePrimitives.length;c++){let u=o.runtimePrimitives[c],f=a.primitiveRenderResources[c];u.boundingSphere=se.clone(f.boundingSphere,new se);let d=O.multiplyByPoint(s,f.positionMin,tft),p=O.multiplyByPoint(s,f.positionMax,nft);h.minimumByComponent(n,d,n),h.maximumByComponent(i,p,i)}}this._boundingSphere=se.fromCornerPoints(n,i,new se),this._boundingSphere=se.transformWithoutScale(this._boundingSphere,this._axisCorrectionMatrix,this._boundingSphere),this._boundingSphere=se.transform(this._boundingSphere,this._components.transform,this._boundingSphere),t._boundingSphere=se.transform(this._boundingSphere,t.modelMatrix,t._boundingSphere),t._initialRadius=t._boundingSphere.radius,t._boundingSphere.radius*=t._clampedScale};Qc.prototype.createDrawCommands=function(e,t){for(let n=0;n<this._runtimeNodes.length;n++){let i=this._runtimeNodes[n];if(!l(i))continue;let r=e.nodeRenderResources[n];for(let o=0;o<i.runtimePrimitives.length;o++){let a=i.runtimePrimitives[o],s=r.primitiveRenderResources[o],c=KV.buildModelDrawCommand(s,t);a.drawCommand=c}}};Qc.prototype.configurePipeline=function(e){let t=this.modelPipelineStages;t.length=0;let n=this._model,i=e.fog.enabled&&e.fog.renderable;l(n.color)&&t.push(ix),!l(n.classificationType)&&(n.imageBasedLighting.enabled&&t.push(eU),n.isClippingEnabled()&&t.push(aU),n.isClippingPolygonsEnabled()&&t.push(lU),n.hasSilhouette(e)&&t.push(BV),l(n.splitDirection)&&n.splitDirection!==jo.NONE&&t.push(UV),qo.is3DTiles(n.type)&&t.push(Kz),i&&t.push(Zz))};Qc.prototype.update=function(e,t){let n,i,r;for(n=0;n<this._runtimeNodes.length;n++){let o=this._runtimeNodes[n];if(!l(o))continue;for(i=0;i<o.updateStages.length;i++)o.updateStages[i].update(o,this,e);let a=e.mode!==re.SCENE3D&&this._model._projectTo2D;for(t&&!a&&this.updateJointMatrices(),i=0;i<o.runtimePrimitives.length;i++){let s=o.runtimePrimitives[i];for(r=0;r<s.updateStages.length;r++)s.updateStages[r].update(s,this)}}};Qc.prototype.updateModelMatrix=function(e,t){yxe(this,e),t.mode!==re.SCENE3D&&Zut(this,t);let n=this._rootNodes;for(let i=0;i<n.length;i++){let r=this._runtimeNodes[n[i]];r._transformDirty=!0}};Qc.prototype.updateJointMatrices=function(){let e=this._skinnedNodes,t=e.length;for(let n=0;n<t;n++){let i=e[n];this._runtimeNodes[i].updateJointMatrices()}};function bxe(e,t,n,i,r){if(n&&!t.show)return;let o=t.children.length;for(let c=0;c<o;c++){let u=t.getChild(c);bxe(e,u,n,i,r)}let a=t.runtimePrimitives,s=a.length;for(let c=0;c<s;c++){let u=a[c];i(u,r)}}function $V(e,t,n,i){let r=e._rootNodes,o=r.length;for(let a=0;a<o;a++){let s=r[a],c=e._runtimeNodes[s];bxe(e,c,t,n,i)}}var ift={backFaceCulling:void 0};Qc.prototype.updateBackFaceCulling=function(e){let t=ift;t.backFaceCulling=e,$V(this,!1,rft,t)};function rft(e,t){let n=e.drawCommand;n.backFaceCulling=t.backFaceCulling}var oft={shadowMode:void 0};Qc.prototype.updateShadows=function(e){let t=oft;t.shadowMode=e,$V(this,!1,aft,t)};function aft(e,t){let n=e.drawCommand;n.shadows=t.shadowMode}var sft={debugShowBoundingVolume:void 0};Qc.prototype.updateShowBoundingVolume=function(e){let t=sft;t.debugShowBoundingVolume=e,$V(this,!1,cft,t)};function cft(e,t){let n=e.drawCommand;n.debugShowBoundingVolume=t.debugShowBoundingVolume}var xxe=[],Txe=[],Cxe=[],lft={frameState:void 0,hasSilhouette:void 0};Qc.prototype.pushDrawCommands=function(e){let t=xxe;t.length=0;let n=Txe;n.length=0;let i=Cxe;i.length=0;let r=lft;r.hasSilhouette=this._model.hasSilhouette(e),r.frameState=e,$V(this,!0,uft,r),Xn(e.commandList,t),Xn(e.commandList,n),Xn(e.commandList,i)};function uft(e,t){let n=t.frameState,i=t.hasSilhouette,r=n.passes,o=xxe,a=Txe,s=Cxe,c=e.drawCommand;c.pushCommands(n,n.commandList);let u=e.primitive.material;l(u)&&l(u.planarFill)&&(n.planarFillRequested=!0),i&&!r.pick&&c.pushSilhouetteCommands(n,o),l(c.pushEdgeCommands)&&c.pushEdgeCommands(n,a),l(c.pushPlanarFillIdCommands)&&c.pushPlanarFillIdCommands(n,s)}Qc.prototype.setArticulationStage=function(e,t){let n=e.split(" ");if(n.length!==2)return;let i=n[0],r=n[1],o=this._runtimeArticulations[i];l(o)&&o.setArticulationStage(r,t)};Qc.prototype.applyArticulations=function(){let e=this._runtimeArticulations;for(let t in e)e.hasOwnProperty(t)&&e[t].apply()};var JV=Qc;function Py(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdByteLengths={},this._batchTextureIdMap=new zt}Object.defineProperties(Py.prototype,{batchTexturesByteLength:{get:function(){let e=this._batchTextureIdMap.length,t=this._batchTextureIdMap.values,n=0;for(let i=0;i<e;i++)n+=t[i].byteLength;return n}}});Py.prototype.clear=function(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdByteLengths={},this._batchTextureIdMap.removeAll()};Py.prototype.addBuffer=function(e,t){if(!this._bufferIdSet.hasOwnProperty(e._id)){let n=t?2:1;this.geometryByteLength+=e.sizeInBytes*n}this._bufferIdSet[e._id]=!0};Py.prototype.addTexture=function(e){this._textureIdByteLengths.hasOwnProperty(e._id)||(this.texturesByteLength+=e.sizeInBytes,this._textureIdByteLengths[e._id]=e.sizeInBytes)};Py.prototype.getTextureIds=function(){return Object.keys(this._textureIdByteLengths)};Py.prototype.getTextureByteLengthById=function(e){return this._textureIdByteLengths[e]};Py.prototype.addBatchTexture=function(e){this._batchTextureIdMap.contains(e._id)||this._batchTextureIdMap.set(e._id,e)};var ZV=Py;var wxe=La($O(),1);var vxe={},ux=Uint32Array.BYTES_PER_ELEMENT;vxe.parse=function(e,t){t=t??0;let n=new Uint8Array(e),i=new DataView(e);t+=ux;let r=i.getUint32(t,!0);if(r!==1)throw new oe(`Only Point Cloud tile version 1 is supported. Version ${r} is not.`);t+=ux,t+=ux;let o=i.getUint32(t,!0);if(o===0)throw new oe("Feature table must have a byte length greater than zero");t+=ux;let a=i.getUint32(t,!0);t+=ux;let s=i.getUint32(t,!0);t+=ux;let c=i.getUint32(t,!0);t+=ux;let u=wo(n,t,o);t+=o;let f=new Uint8Array(e,t,a);t+=a;let d,p;s>0&&(d=wo(n,t,s),Object.keys(d).length===0&&(d=void 0),t+=s,c>0&&(p=new Uint8Array(e,t,c),p=new Uint8Array(p)));let g=new mp(u,f),m=g.getGlobalProperty("POINTS_LENGTH");if(g.featuresLength=m,!l(m))throw new oe("Feature table global property: POINTS_LENGTH must be defined");let y=g.getGlobalProperty("RTC_CENTER",Y.FLOAT,3);l(y)&&(y=h.unpack(y));let A=dft(g,d);if(A.rtcCenter=y,A.pointsLength=m,!A.hasPositions){let b=hft(g);A.positions=b,A.hasPositions=A.hasPositions||l(b)}if(!A.hasPositions)throw new oe("Either POSITION or POSITION_QUANTIZED must be defined.");if(!A.hasNormals){let b=pft(g);A.normals=b,A.hasNormals=A.hasNormals||l(b)}if(!A.hasColors){let b=mft(g);A.colors=b,A.hasColors=A.hasColors||l(b),A.hasConstantColor=l(A.constantColor),A.isTranslucent=l(b)&&b.isTranslucent}if(!A.hasBatchIds){let b=gft(g);A.batchIds=b,A.hasBatchIds=A.hasBatchIds||l(b)}if(A.hasBatchIds){let b=g.getGlobalProperty("BATCH_LENGTH");if(!l(b))throw new oe("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");A.batchLength=b}return(l(d)||l(p))&&(A.batchTableJson=d,A.batchTableBinary=p),fft(A),A};function fft(e){let t=e.batchTableJson;if(!l(t))return;let n=e.batchTableBinary;if(l(n))return;let i=Object.keys(e.draco?.batchTableProperties??{}),r=[];for(let o of Object.keys(t)){let s=t[o].byteOffset;l(s)&&(i.includes(o)||r.push(o))}for(let o of r)pt("PntsParser-invalidBinaryBodyReference",`The point cloud data contained a binary property ${o} that could not be resolved - skipping`),delete t[o]}function dft(e,t){let n=e.json,i,r,o,a=l(n.extensions)?n.extensions["3DTILES_draco_point_compression"]:void 0,s=l(t)&&l(t.extensions)?t.extensions["3DTILES_draco_point_compression"]:void 0;l(s)&&(o=s.properties);let c,u,f,d,p;if(l(a)){r=a.properties;let m=a.byteOffset,y=a.byteLength;if(!l(r)||!l(m)||!l(y))throw new oe("Draco properties, byteOffset, and byteLength must be defined");i=e.buffer.slice(m,m+y),c=l(r.POSITION),u=l(r.RGB)||l(r.RGBA),f=l(r.NORMAL),d=l(r.BATCH_ID),p=l(r.RGBA)}let g;return l(i)&&(g={buffer:i,featureTableProperties:r,batchTableProperties:o,properties:Ot(r,o),dequantizeInShader:!0}),{draco:g,hasPositions:c,hasColors:u,isTranslucent:p,hasNormals:f,hasBatchIds:d}}function hft(e){let t=e.json,n;if(l(t.POSITION))return n=e.getPropertyArray("POSITION",Y.FLOAT,3),{name:ot.POSITION,semantic:ot.POSITION,typedArray:n,isQuantized:!1,componentDatatype:Y.FLOAT,type:Vt.VEC3};if(l(t.POSITION_QUANTIZED)){n=e.getPropertyArray("POSITION_QUANTIZED",Y.UNSIGNED_SHORT,3);let i=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Y.FLOAT,3);if(!l(i))throw new oe("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let r=65535,o=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",Y.FLOAT,3);if(!l(o))throw new oe("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");return{name:ot.POSITION,semantic:ot.POSITION,typedArray:n,isQuantized:!0,componentDatatype:Y.FLOAT,type:Vt.VEC3,quantizedRange:r,quantizedVolumeOffset:h.unpack(o),quantizedVolumeScale:h.unpack(i),quantizedComponentDatatype:Y.UNSIGNED_SHORT,quantizedType:Vt.VEC3}}}function mft(e){let t=e.json,n;if(l(t.RGBA))return n=e.getPropertyArray("RGBA",Y.UNSIGNED_BYTE,4),{name:ot.COLOR,semantic:ot.COLOR,setIndex:0,typedArray:n,componentDatatype:Y.UNSIGNED_BYTE,type:Vt.VEC4,normalized:!0,isRGB565:!1,isTranslucent:!0};if(l(t.RGB))return n=e.getPropertyArray("RGB",Y.UNSIGNED_BYTE,3),{name:"COLOR",semantic:ot.COLOR,setIndex:0,typedArray:n,componentDatatype:Y.UNSIGNED_BYTE,type:Vt.VEC3,normalized:!0,isRGB565:!1,isTranslucent:!1};if(l(t.RGB565))return n=e.getPropertyArray("RGB565",Y.UNSIGNED_SHORT,1),{name:"COLOR",semantic:ot.COLOR,setIndex:0,typedArray:n,componentDatatype:Y.FLOAT,type:Vt.VEC3,normalized:!1,isRGB565:!0,isTranslucent:!1};if(l(t.CONSTANT_RGBA)){let i=e.getGlobalProperty("CONSTANT_RGBA",Y.UNSIGNED_BYTE,4),r=i[3],o=U.fromBytes(i[0],i[1],i[2],r),a=r<255;return{name:ot.COLOR,semantic:ot.COLOR,setIndex:0,constantColor:o,componentDatatype:Y.FLOAT,type:Vt.VEC4,isQuantized:!1,isTranslucent:a}}}function pft(e){let t=e.json,n;if(l(t.NORMAL))return n=e.getPropertyArray("NORMAL",Y.FLOAT,3),{name:ot.NORMAL,semantic:ot.NORMAL,typedArray:n,octEncoded:!1,octEncodedZXY:!1,componentDatatype:Y.FLOAT,type:Vt.VEC3};if(l(t.NORMAL_OCT16P))return n=e.getPropertyArray("NORMAL_OCT16P",Y.UNSIGNED_BYTE,2),{name:ot.NORMAL,semantic:ot.NORMAL,typedArray:n,octEncoded:!0,octEncodedZXY:!1,quantizedRange:(1<<8)-1,quantizedType:Vt.VEC2,quantizedComponentDatatype:Y.UNSIGNED_BYTE,componentDatatype:Y.FLOAT,type:Vt.VEC3}}function gft(e){let t=e.json;if(l(t.BATCH_ID)){let n=e.getPropertyArray("BATCH_ID",Y.UNSIGNED_SHORT,1);return{name:ot.FEATURE_ID,semantic:ot.FEATURE_ID,setIndex:0,typedArray:n,componentDatatype:Y.fromTypedArray(n),type:Vt.SCALAR}}}var jE=vxe;var _ft=Tn.Components,yft=Tn.Scene,Aft=Tn.Node,bft=Tn.Primitive,xft=Tn.Attribute,Exe=Tn.Quantization,Tft=Tn.FeatureIdAttribute,Cft=Tn.Material,vft=Tn.MetallicRoughness,CZ=class extends er{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.arrayBuffer,i=t.byteOffset??0;this._arrayBuffer=n,this._byteOffset=i,this._loadAttributesFor2D=t.loadAttributesFor2D??!1,this._parsedContent=void 0,this._decodePromise=void 0,this._decodedAttributes=void 0,this._promise=void 0,this._error=void 0,this._state=At.UNLOADED,this._buffers=[],this._components=void 0,this._transform=O.IDENTITY}get cacheKey(){}get components(){return this._components}get transform(){return this._transform}load(){if(l(this._promise))return this._promise;this._parsedContent=jE.parse(this._arrayBuffer,this._byteOffset),this._state=At.PROCESSING,this._promise=Promise.resolve(this)}process(t){if(l(this._error)){let n=this._error;throw this._error=void 0,n}if(this._state===At.READY)return!0;if(this._state===At.PROCESSING){if(l(this._decodePromise))return!1;this._decodePromise=Eft(this,t.context)}return!1}unload(){let t=this._buffers;for(let n=0;n<t.length;n++)t[n].destroy();t.length=0,this._components=void 0,this._parsedContent=void 0,this._arrayBuffer=void 0}};function Eft(e,t){let i=e._parsedContent.draco,r;if(l(i)?r=h_.decodePointCloud(i,t):r=Promise.resolve(),!!l(r))return e._decodePromise=r,r.then(function(o){if(!e.isDestroyed())return l(o)&&Sft(e,i,o),Bft(e,t),e._state=At.READY,e}).catch(function(o){e.unload(),e._state=At.FAILED;let a="Failed to load Draco pnts";e._error=e.getError(a,o)})}function Sft(e,t,n){e._state=At.READY;let i=e._parsedContent,r;if(l(n.POSITION)){if(r={name:"POSITION",semantic:ot.POSITION,typedArray:n.POSITION.array,componentDatatype:Y.FLOAT,type:Vt.VEC3,isQuantized:!1},l(n.POSITION.data.quantization)){let s=n.POSITION.data.quantization,c=s.range,u=h.fromElements(c,c,c),f=h.unpack(s.minValues),d=(1<<s.quantizationBits)-1;r.isQuantized=!0,r.quantizedRange=d,r.quantizedVolumeOffset=f,r.quantizedVolumeScale=u,r.quantizedComponentDatatype=d<=255?Y.UNSIGNED_BYTE:Y.UNSIGNED_SHORT,r.quantizedType=Vt.VEC3}i.positions=r}if(l(n.NORMAL)){if(r={name:"NORMAL",semantic:ot.NORMAL,typedArray:n.NORMAL.array,componentDatatype:Y.FLOAT,type:Vt.VEC3,isQuantized:!1,octEncoded:!1,octEncodedZXY:!1},l(n.NORMAL.data.quantization)){let s=(1<<n.NORMAL.data.quantization.quantizationBits)-1;r.quantizedRange=s,r.octEncoded=!0,r.octEncodedZXY=!0,r.quantizedComponentDatatype=Y.UNSIGNED_BYTE,r.quantizedType=Vt.VEC2}i.normals=r}if(l(n.RGBA)?i.colors={name:"COLOR",semantic:ot.COLOR,setIndex:0,typedArray:n.RGBA.array,componentDatatype:Y.UNSIGNED_BYTE,type:Vt.VEC4,normalized:!0,isTranslucent:!0}:l(n.RGB)&&(i.colors={name:"COLOR",semantic:ot.COLOR,setIndex:0,typedArray:n.RGB.array,componentDatatype:Y.UNSIGNED_BYTE,type:Vt.VEC3,normalized:!0,isTranslucent:!1}),l(n.BATCH_ID)){let s=n.BATCH_ID.array;i.batchIds={name:"_FEATURE_ID",semantic:ot.FEATURE_ID,setIndex:0,typedArray:s,componentDatatype:Y.fromTypedArray(s),type:Vt.SCALAR}}let o=i.batchTableJson,a=t.batchTableProperties;for(let s in a)if(a.hasOwnProperty(s)){let c=n[s];l(o)||(o={}),i.hasDracoBatchTable=!0;let u=c.data;o[s]={byteOffset:u.byteOffset,type:wft(u.componentsPerAttribute),componentType:Ift(u.componentDatatype),typedArray:c.array}}i.batchTableJson=o}function wft(e){switch(e){case 1:return"SCALAR";case 2:return"VEC2";case 3:return"VEC3";case 4:return"VEC4"}}function Ift(e){switch(e){case ee.BYTE:return"BYTE";case ee.UNSIGNED_BYTE:return"UNSIGNED_BYTE";case ee.SHORT:return"SHORT";case ee.UNSIGNED_SHORT:return"UNSIGNED_SHORT";case ee.INT:return"INT";case ee.UNSIGNED_INT:return"UNSIGNED_INT";case ee.DOUBLE:return"DOUBLE";case ee.FLOAT:return"FLOAT"}}function KD(e,t,n){let i=t.typedArray,r;if(t.octEncoded&&(r=new Exe,r.octEncoded=t.octEncoded,r.octEncodedZXY=t.octEncodedZXY,r.normalizationRange=t.quantizedRange,r.type=t.quantizedType,r.componentDatatype=t.quantizedComponentDatatype),t.isQuantized){r=new Exe;let s=t.quantizedRange;r.normalizationRange=s,r.quantizedVolumeOffset=h.ZERO;let c=t.quantizedVolumeScale;r.quantizedVolumeDimensions=c,r.quantizedVolumeStepSize=h.divideByScalar(c,s,new h),r.componentDatatype=t.quantizedComponentDatatype,r.type=t.quantizedType}let o=new xft;if(o.name=t.name,o.semantic=t.semantic,o.setIndex=t.setIndex,o.componentDatatype=t.componentDatatype,o.type=t.type,o.normalized=t.normalized??!1,o.min=t.min,o.max=t.max,o.quantization=r,t.isRGB565&&(i=an.decodeRGB565(i)),l(t.constantColor)){let s=new Array(4);o.constant=U.pack(t.constantColor,s)}else{let s=Ze.createVertexBuffer({typedArray:i,context:n,usage:Oe.STATIC_DRAW});s.vertexArrayDestroyable=!1,e._buffers.push(s),o.buffer=s}let a=e._loadAttributesFor2D;return o.semantic===ot.POSITION&&a&&(o.typedArray=i),o}var Sxe,QV;function Pft(e){if(!l(QV)){Sxe=new wxe.default(0),QV=new Array(e);for(let t=0;t<e;++t)QV[t]=Sxe.random()}return QV}var Dft=new h,Rft=new h,Oft=new h;function Mft(e){let t=e.typedArray,n=20,i=t.length/3,r=Math.min(i,n),o=Pft(n),a=Number.MAX_VALUE,s=-Number.MAX_VALUE,c=h.fromElements(a,a,a,Dft),u=h.fromElements(s,s,s,Rft),f,d,p;if(e.isQuantized)c=h.ZERO,u=e.quantizedVolumeScale;else for(f=0;f<r;++f)d=Math.floor(o[f]*i),p=h.unpack(t,d*3,Oft),h.minimumByComponent(c,p,c),h.maximumByComponent(u,p,u);e.min=h.clone(c),e.max=h.clone(u)}var Lft={name:ot.COLOR,semantic:ot.COLOR,setIndex:0,constantColor:U.DARKGRAY,componentDatatype:Y.FLOAT,type:Vt.VEC4,isQuantized:!1,isTranslucent:!1};function Nft(e,t,n){let i=[],r,o=t.positions;return l(o)&&(Mft(o),r=KD(e,o,n),r.count=t.pointsLength,i.push(r)),l(t.normals)&&(r=KD(e,t.normals,n),r.count=t.pointsLength,i.push(r)),l(t.colors)?(r=KD(e,t.colors,n),r.count=t.pointsLength,i.push(r)):(r=KD(e,Lft,n),r.count=t.pointsLength,i.push(r)),l(t.batchIds)&&(r=KD(e,t.batchIds,n),r.count=t.pointsLength,i.push(r)),i}function Fft(e,t){let n=e.batchLength,i=e.pointsLength,r=e.batchTableJson,o=e.batchTableBinary,a=!l(e.batchIds);return l(o)||l(r)||e.hasDracoBatchTable?Cy({count:n??i,batchTable:r,binaryBody:o,parseAsPropertyAttributes:a,customAttributeOutput:t}):new ec({schema:{},propertyTables:[]})}function Bft(e,t){let n=e._parsedContent,i=new vft;i.metallicFactor=0,i.roughnessFactor=.9;let r=new Cft;r.metallicRoughness=i;let o=n.colors;l(o)&&o.isTranslucent&&(r.alphaMode=C0.BLEND);let a=!l(n.normals);r.unlit=a;let s=new bft;if(s.attributes=Nft(e,n,t),s.primitiveType=Re.POINTS,s.material=r,l(n.batchIds)){let g=new Tft;g.propertyTableId=0,g.setIndex=0,g.positionalLabel="featureId_0",s.featureIds.push(g)}let c=new Aft;c.index=0,c.primitives=[s];let u=new yft;u.nodes=[c],u.upAxis=zi.Z,u.forwardAxis=zi.X;let f=new _ft;f.scene=u,f.nodes=[c];let d=[];f.structuralMetadata=Fft(n,d),d.length>0&&kft(e,s,d,t),l(n.rtcCenter)&&(f.transform=O.multiplyByTranslation(f.transform,n.rtcCenter,f.transform));let p=n.positions;l(p)&&p.isQuantized&&(f.transform=O.multiplyByTranslation(f.transform,p.quantizedVolumeOffset,f.transform)),e._components=f,e._parsedContent=void 0,e._arrayBuffer=void 0}function kft(e,t,n,i){let r=t.attributes,o=n.length;for(let a=0;a<o;a++){let s=n[a],c=Ze.createVertexBuffer({typedArray:s.typedArray,context:i,usage:Oe.STATIC_DRAW});c.vertexArrayDestroyable=!1,e._buffers.push(c),s.buffer=c,s.typedArray=void 0,r.push(s)}t.propertyAttributeIds=[0]}var e4=CZ;var Ixe=new h,Pxe=new h,Dxe=new h,zft=new h,Uft=new h,Vft=new h,jft=new de,Hft=new se;function vZ(e,t,n,i){let r=t*n;return i.x=e[r],i.y=e[r+1],i.z=e[r+2],i}function $D(e,t,n,i,r,o,a){if(!e._ready||n.mode===re.MORPHING)return;let s=Number.MAX_VALUE;o=o??te.default,i=i??1,r=r??0;let c=n.mode!==re.SCENE3D?n.mapProjection:void 0;if(Ps.forEachPrimitive(e,{mapProjection:c},function(u,f,d,p){if(l(u.boundingSphere)&&d.length===1){let x=se.transform(u.boundingSphere,p,Hft),T=ci.raySphere(t,x);if(!l(T))return}if(!l(f.indices))return;let g,m,y=_t.getAttributeBySemantic(f,ot.POSITION);l(y)&&(m=Vt.getNumberOfComponents(y.type),g=Ps.readAttributeAsTypedArray(y));let A;if(l(f.indices)&&(A=Ps.readIndicesAsTypedArray(f.indices)),!l(A)||!l(g))return;let b=A.length;for(let x=0;x<b;x+=3){let T=A[x],C=A[x+1],E=A[x+2];vZ(g,T,m,Ixe),vZ(g,C,m,Pxe),vZ(g,E,m,Dxe);for(let w of d){let D=O.multiplyByPoint(w.transform,Ixe,zft),R=O.multiplyByPoint(w.transform,Pxe,Uft),M=O.multiplyByPoint(w.transform,Dxe,Vft);i!==1&&(pr.getPosition(D,o,i,r,D),pr.getPosition(R,o,i,r,R),pr.getPosition(M,o,i,r,M));let N=ci.rayTriangleParametric(t,D,R,M,e.backFaceCulling??!0);l(N)&&N<s&&N>=0&&(s=N)}}}),s!==Number.MAX_VALUE){if(a=hn.getPoint(t,s,a),n.mode!==re.SCENE3D){h.fromElements(a.y,a.z,a.x,a);let u=n.mapProjection,f=u.ellipsoid,d=u.unproject(a,jft);f.cartographicToCartesian(d,a)}return a}}var EZ=class{constructor(t){this.show=t.show,this.alpha=t.alpha,this.brightness=t.brightness,this.contrast=t.contrast,this.hue=t.hue,this.saturation=t.saturation,this.gamma=t.gamma,this.colorToAlpha=t.colorToAlpha}},t4=EZ;var SZ=class{constructor(t){this._model=t,this._modelPrimitiveImageries=void 0,this._imageryConfigurations=[]}update(t){if(!this._hasImagery){this._deleteModelPrimitiveImageries();return}this._allImageryLayersReady&&(l(this._modelPrimitiveImageries)||(this._modelPrimitiveImageries=this._createModelPrimitiveImageries()),this._updateModelPrimitiveImageries(t),this._checkForModifiedImageryConfigurations())}_createModelPrimitiveImageries(){let t=this._model,n=this._collectRuntimeNodesAndPrimitives(),i=[],r=n.length;for(let o=0;o<r;o++){let a=n[o],s=a.runtimeNode,c=a.runtimePrimitive,u=new zE(t,s,c);c.primitive.modelPrimitiveImagery=u,i.push(u)}return i}_collectRuntimeNodesAndPrimitives(){let i=this._model.sceneGraph._runtimeNodes,r=[];for(let o=0;o<i.length;o++){let a=i[o];if(l(a))for(let s=0;s<a.runtimePrimitives.length;s++){let c=a.runtimePrimitives[s];r.push({runtimeNode:a,runtimePrimitive:c})}}return r}_updateModelPrimitiveImageries(t){if(!l(this._modelPrimitiveImageries))throw new pe("The modelPrimitiveImageries have not been created");let n=this._modelPrimitiveImageries,i=n.length;for(let r=0;r<i;r++)n[r].update(t)}_deleteModelPrimitiveImageries(){let t=this._modelPrimitiveImageries;if(!l(t))return;let n=t.length;for(let i=0;i<n;i++)t[i].destroy();delete this._modelPrimitiveImageries,this._model.resetDrawCommands()}get ready(){return this._hasImagery?!(!this._allImageryLayersReady||!this._allModelPrimitiveImageriesReady):!0}get _hasImagery(){let n=this._model.imageryLayers;return l(n)&&n.length>0}get _allImageryLayersReady(){if(!this._hasImagery)return!0;let t=this._model.imageryLayers,n=t.length;for(let i=0;i<n;i++)if(!t.get(i).ready)return!1;return!0}get _allModelPrimitiveImageriesReady(){let t=this._modelPrimitiveImageries;if(!l(t))return!1;let n=t.length;for(let i=0;i<n;i++)if(!t[i].ready)return!1;return!0}_checkForModifiedImageryConfigurations(){this._imageryConfigurationsModified()&&(this._updateImageryConfigurations(),this._model.resetDrawCommands())}_imageryConfigurationsModified(){let n=this._model.imageryLayers,i=this._imageryConfigurations;if(n.length!==i.length)return!0;for(let r=0;r<n.length;r++){let o=n.get(r),a=i[r];if(o.show!==a.show||o.alpha!==a.alpha||o.brightness!==a.brightness||o.contrast!==a.contrast||o.hue!==a.hue||o.saturation!==a.saturation||o.gamma!==a.gamma||o.colorToAlpha!==a.colorToAlpha)return!0}return!1}_updateImageryConfigurations(){let n=this._model.imageryLayers,i=this._imageryConfigurations;i.length=n.length;for(let r=0;r<n.length;r++){let o=n.get(r);i[r]=new t4(o)}}isDestroyed(){return!1}destroy(){if(!this.isDestroyed())return this._deleteModelPrimitiveImageries(),ue(this)}},n4=SZ;function wr(e){e=e??H.EMPTY_OBJECT,this._loader=e.loader,this._resource=e.resource,this.type=e.type??qo.GLTF,this.modelMatrix=O.clone(e.modelMatrix??O.IDENTITY),this._modelMatrix=O.clone(this.modelMatrix),this._scale=e.scale??1,this._minimumPixelSize=e.minimumPixelSize??0,this._maximumScale=e.maximumScale,this._clampedScale=l(this._maximumScale)?Math.min(this._scale,this._maximumScale):this._scale,this._computedScale=this._clampedScale,this._updateModelMatrix=!1,this.referenceMatrix=void 0,this._iblReferenceFrameMatrix=$.clone($.IDENTITY),this._clippingPlanesMatrix=O.clone(O.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 qz(this),this._clampAnimations=e.clampAnimations??!0,this._userAnimationDirty=!1,this._id=e.id,this._idDirty=!1,this._color=U.clone(e.color),this._colorBlendMode=e.colorBlendMode??Ml.HIGHLIGHT,this._colorBlendAmount=e.colorBlendAmount??.5;let t=e.silhouetteColor??U.RED;this._silhouetteColor=U.clone(t),this._silhouetteSize=e.silhouetteSize??0,this._silhouetteDirty=!1,this._silhouetteId=void 0,this._cull=e.cull??!0,this._opaquePass=e.opaquePass??Pe.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 se,this._initialRadius=void 0,this._heightReference=e.heightReference??it.NONE,this._heightDirty=this._heightReference!==it.NONE,this._removeUpdateHeightCallback=void 0,this._enableVerticalExaggeration=e.enableVerticalExaggeration??!0,this._hasVerticalExaggeration=!1,this._clampedModelMatrix=void 0;let r=e.scene;l(r)&&l(r.terrainProviderChanged)&&(this._terrainProviderChangedCallback=r.terrainProviderChanged.addEventListener(()=>{this._heightDirty=!0})),this._scene=r,this._distanceDisplayCondition=e.distanceDisplayCondition;let o=new J0(e.pointCloudShading);this._pointCloudShading=o,this._attenuation=o.attenuation,this._pointCloudBackFaceCulling=o.backFaceCulling;let a=e.clippingPlanes;l(a)&&a.owner===void 0?va.setOwner(a,this,"_clippingPlanes"):this._clippingPlanes=a,this._clippingPlanesState=0;let s=e.clippingPolygons;l(s)&&s.owner===void 0?fp.setOwner(s,this,"_clippingPolygons"):this._clippingPolygons=s,this._clippingPolygonsState=0,this._modelImagery=new n4(this),this._lightColor=h.clone(e.lightColor),this._imageBasedLighting=l(e.imageBasedLighting)?e.imageBasedLighting:new bE,this._shouldDestroyImageBasedLighting=!l(e.imageBasedLighting),this._environmentMapManager=void 0;let c=new yy(e.environmentMapOptions);yy.setOwner(c,this,"_environmentMapManager"),this._backFaceCulling=e.backFaceCulling??!0,this._backFaceCullingDirty=!1,this._shadows=e.shadows??Rn.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._edgeDisplayMode=e.edgeDisplayMode??Mh.SURFACES_ONLY,this._debugWireframe===!0&&this._enableDebugWireframe===!1&&this.type===qo.GLTF&&pt("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 wt(u)),this._credits=[],this._credit=u,this._resourceCredits=[],this._gltfCredits=[],this._showCreditsOnScreen=e.showCreditsOnScreen??!1,this._showCreditsOnScreenDirty=!0,this._splitDirection=e.splitDirection??jo.NONE,this._enableShowOutline=e.enableShowOutline??!0,this.showOutline=e.showOutline??!0,this.outlineColor=e.outlineColor??U.BLACK,this._classificationType=e.classificationType,this._statistics=new ZV,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 be,this._readyEvent=new be,this._texturesReadyEvent=new be,this._sceneGraph=void 0,this._nodesByName={},this.pickObject=e.pickObject}function wZ(e,t){if(e._errorEvent.numberOfListeners>0){e._errorEvent.raiseEvent(t);return}console.log(t)}function Gft(e,t){let n=e._featureTables,i=t.propertyTables,r=i.length;for(let o=0;o<r;o++){let a=i[o],s=new Xz({model:e,propertyTable:a});n.push(s)}return n}function Wft(e,t){let n=t._featureIdLabel,i=t._instanceFeatureIdLabel,r,o,a,s;for(r=0;r<e.nodes.length;r++)if(s=e.nodes[r],l(s.instances)&&(a=_t.getFeatureIdsByLabel(s.instances.featureIds,i),l(a)&&l(a.propertyTableId)))return a.propertyTableId;for(r=0;r<e.nodes.length;r++)for(s=e.nodes[r],o=0;o<s.primitives.length;o++){let c=s.primitives[o],u=_t.getFeatureIdsByLabel(c.featureIds,n);if(l(u))return u.propertyTableId}if(t._featureTables.length===1)return 0}function DZ(e,t){if(!l(e)&&!l(t))return!1;if(l(e)!==l(t))return!0;let n=e.alpha,i=t.alpha;return Math.floor(n)!==Math.floor(i)||Math.ceil(n)!==Math.ceil(i)}Object.defineProperties(wr.prototype,{ready:{get:function(){return this._ready}},errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},incrementallyLoadTextures:{get:function(){return this._loader.incrementallyLoadTextures??!1}},texturesReadyEvent:{get:function(){return this._texturesReadyEvent}},loader:{get:function(){return this._loader}},statistics:{get:function(){return this._statistics}},activeAnimations:{get:function(){return this._activeAnimations}},clampAnimations:{get:function(){return this._clampAnimations},set:function(e){this._clampAnimations=e}},cull:{get:function(){return this._cull}},opaquePass:{get:function(){return this._opaquePass}},pointCloudShading:{get:function(){return this._pointCloudShading},set:function(e){e!==this._pointCloudShading&&this.resetDrawCommands(),this._pointCloudShading=e}},customShader:{get:function(){return this._customShader},set:function(e){e!==this._customShader&&this.resetDrawCommands(),this._customShader=e}},sceneGraph:{get:function(){return this._sceneGraph}},content:{get:function(){return this._content}},heightReference:{get:function(){return this._heightReference},set:function(e){e!==this._heightReference&&(this._heightDirty=!0),this._heightReference=e}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=jt.clone(e,this._distanceDisplayCondition)}},structuralMetadata:{get:function(){return this._sceneGraph.components.structuralMetadata}},featureTableId:{get:function(){return this._featureTableId},set:function(e){this._featureTableId=e}},featureTables:{get:function(){return this._featureTables},set:function(e){this._featureTables=e}},id:{get:function(){return this._id},set:function(e){e!==this._id&&(this._idDirty=!0),this._id=e}},allowPicking:{get:function(){return this._allowPicking}},style:{get:function(){return this._style},set:function(e){this._style=e,this._styleDirty=!0}},color:{get:function(){return this._color},set:function(e){DZ(e,this._color)&&this.resetDrawCommands(),this._color=U.clone(e,this._color)}},colorBlendMode:{get:function(){return this._colorBlendMode},set:function(e){this._colorBlendMode=e}},colorBlendAmount:{get:function(){return this._colorBlendAmount},set:function(e){this._colorBlendAmount=e}},silhouetteColor:{get:function(){return this._silhouetteColor},set:function(e){if(!U.equals(e,this._silhouetteColor)){let t=DZ(e,this._silhouetteColor);this._silhouetteDirty=this._silhouetteDirty||t}this._silhouetteColor=U.clone(e,this._silhouetteColor)}},silhouetteSize:{get:function(){return this._silhouetteSize},set:function(e){if(e!==this._silhouetteSize){let t=this._silhouetteSize,n=e>0&&t===0||e===0&&t>0;this._silhouetteDirty=this._silhouetteDirty||n,this._backFaceCullingDirty=this._backFaceCullingDirty||n}this._silhouetteSize=e}},boundingSphere:{get:function(){let e=l(this._clampedModelMatrix)?this._clampedModelMatrix:this.modelMatrix;return Mxe(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===qo.GLTF&&pt("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltfAsync, otherwise debugWireframe will be ignored.")}},edgeDisplayMode:{get:function(){return this._edgeDisplayMode},set:function(e){this._edgeDisplayMode=e}},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}`),e!==this._featureIdLabel&&(this._featureTableIdDirty=!0),this._featureIdLabel=e}},instanceFeatureIdLabel:{get:function(){return this._instanceFeatureIdLabel},set:function(e){typeof e=="number"&&(e=`instanceFeatureId_${e}`),e!==this._instanceFeatureIdLabel&&(this._featureTableIdDirty=!0),this._instanceFeatureIdLabel=e}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){e!==this._clippingPlanes&&(va.setOwner(e,this,"_clippingPlanes"),this.resetDrawCommands())}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){e!==this._clippingPolygons&&(fp.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}},imageryLayers:{get:function(){if(l(this._content)){let e=this._content.tileset;if(l(e))return e.imageryLayers}}},lightColor:{get:function(){return this._lightColor},set:function(e){l(e)!==l(this._lightColor)&&this.resetDrawCommands(),this._lightColor=h.clone(e,this._lightColor)}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(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){e!==this.environmentMapManager&&(yy.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}}});wr.prototype.getNode=function(e){return this._nodesByName[e]};wr.prototype.setArticulationStage=function(e,t){this._sceneGraph.setArticulationStage(e,t)};wr.prototype.applyArticulations=function(){this._sceneGraph.applyArticulations()};wr.prototype.getExtension=function(e){return this._loader.components.extensions[e]};wr.prototype.makeStyleDirty=function(){this._styleDirty=!0};wr.prototype.resetDrawCommands=function(){this._drawCommandsBuilt=!1};var qft=new O,Yft=new $,Xft=new O;wr.prototype.update=function(e){let t=!1;try{t=Kft(this,e)}catch(i){if(!this._loader.incrementallyLoadTextures&&i.name==="TextureError")wZ(this,i);else{let r=_t.getError("model",this._resource,i);wZ(this,r)}}if($ft(this,e),Jft(this,e),Zft(this,e),!this._resourcesLoaded&&t){this._resourcesLoaded=!0;let i=this._loader.components;if(!l(i)){if(this._loader.isUnloaded())return;let a=_t.getError("model",this._resource,new oe("Failed to load model."));wZ(a),this._rejectLoad=this._rejectLoad&&this._rejectLoad(a)}let r=i.structuralMetadata;l(r)&&r.propertyTableCount>0&&Gft(this,r);let o=new JV({model:this,modelComponents:i});this._sceneGraph=o,this._gltfCredits=o.components.asset.credits}if(!this._resourcesLoaded||e.mode===re.MORPHING)return;let n=this._modelImagery;if(n.update(e),!(!n.ready&&!(this._content?.tileset?._asynchronouslyLoadImagery??!1))){if(Qft(this),edt(this),tdt(this,e),ndt(this),idt(this,e),rdt(this,e),odt(this,e),adt(this,e),sdt(this,e),cdt(this,e),ldt(this,e),this._defaultTexture=e.context.defaultTexture,udt(this,e),fdt(this,e),ddt(this),hdt(this,e),_dt(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)),pdt(this),ydt(this,e),Adt(this),bdt(this,e)}};function Kft(e,t){return!e._resourcesLoaded||e._loader.incrementallyLoadTextures&&!e._texturesLoaded?(t.afterRender.push(()=>!0),e._loader.process(t)):!0}function $ft(e,t){l(e._customShader)&&e._customShader.update(t)}function Jft(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=!l(e._imageBasedLighting.sphericalHarmonicCoefficients)||!l(e._imageBasedLighting.specularEnvironmentMaps),n.update(t),n.shouldRegenerateShaders&&e.resetDrawCommands())}function Zft(e,t){e._imageBasedLighting.update(t),e._imageBasedLighting.shouldRegenerateShaders&&e.resetDrawCommands()}function Qft(e){if(!e._featureTableIdDirty)return;e._featureTableIdDirty=!1;let t=e._sceneGraph.components,n=t.structuralMetadata;l(n)&&n.propertyTableCount>0&&(e.featureTableId=Wft(t,e),e._styleDirty=!0,e.resetDrawCommands())}function edt(e){e._styleDirty&&(e.applyStyle(e._style),e._styleDirty=!1)}function tdt(e,t){let n=e._featureTables,i=n.length,r=!1;for(let o=0;o<i;o++)n[o].update(t),n[o].styleCommandsNeededDirty&&(r=!0);r&&Oxe(e)}function Oxe(e){let t=e.featureTables[e.featureTableId];e._styleCommandsNeeded=_p.getStyleCommandsNeeded(t.featuresLength,t.batchTexture.translucentFeaturesLength)}function ndt(e){let t=e.pointCloudShading;t.attenuation!==e._attenuation&&(e.resetDrawCommands(),e._attenuation=t.attenuation),t.backFaceCulling!==e._pointCloudBackFaceCulling&&(e.resetDrawCommands(),e._pointCloudBackFaceCulling=t.backFaceCulling)}function idt(e,t){e._silhouetteDirty&&(Lxe(t)&&e.resetDrawCommands(),e._silhouetteDirty=!1)}function rdt(e,t){let n=e.hasSkipLevelOfDetail(t);n!==e._skipLevelOfDetail&&(e.resetDrawCommands(),e._skipLevelOfDetail=n)}function odt(e,t){let n=0;e.isClippingEnabled()&&(e._clippingPlanes.owner===e&&e._clippingPlanes.update(t),n=e._clippingPlanes.clippingPlanesState),n!==e._clippingPlanesState&&(e.resetDrawCommands(),e._clippingPlanesState=n)}function adt(e,t){let n=0;e.isClippingPolygonsEnabled()&&(e._clippingPolygons.owner===e&&(e._clippingPolygons.update(t),e._clippingPolygons.queueCommands(t)),n=e._clippingPolygons.clippingPolygonsState),n!==e._clippingPolygonsState&&(e.resetDrawCommands(),e._clippingPolygonsState=n)}function sdt(e,t){t.mode!==e._sceneMode&&(e._projectTo2D?e.resetDrawCommands():e._updateModelMatrix=!0,e._sceneMode=t.mode)}function cdt(e,t){let n=t.fog.enabled&&t.fog.renderable;n!==e._fogRenderable&&(e.resetDrawCommands(),e._fogRenderable=n)}function ldt(e,t){if(e.enableVerticalExaggeration){let n=t.verticalExaggeration!==1;e.hasVerticalExaggeration!==n&&(e.resetDrawCommands(),e._hasVerticalExaggeration=n)}else e.hasVerticalExaggeration&&(e.resetDrawCommands(),e._hasVerticalExaggeration=!1)}function udt(e,t){e._drawCommandsBuilt||(e.destroyPipelineResources(),e._sceneGraph.buildDrawCommands(t),e._drawCommandsBuilt=!0)}function fdt(e,t){O.equals(e.modelMatrix,e._modelMatrix)||(e._updateModelMatrix=!0,e._modelMatrix=O.clone(e.modelMatrix,e._modelMatrix))}var Dy=new h,IZ=new de;function ddt(e){if(!e._updateModelMatrix&&!e._heightDirty&&e._minimumPixelSize===0)return;l(e._removeUpdateHeightCallback)&&(e._removeUpdateHeightCallback(),e._removeUpdateHeightCallback=void 0);let t=e._scene;if(!l(t)||e.heightReference===it.NONE){e._clampedModelMatrix=void 0;return}let n=t.ellipsoid??te.default,i=e.modelMatrix;Dy.x=i[12],Dy.y=i[13],Dy.z=i[14];let r=n.cartesianToCartographic(Dy);l(e._clampedModelMatrix)||(e._clampedModelMatrix=O.clone(i,new O)),e._removeUpdateHeightCallback=t.updateHeight(r,Rxe(e,n,r),e.heightReference);let o=t.getHeight(r,e.heightReference);if(l(o)){let a=Rxe(e,n,r);de.clone(r,IZ),IZ.height=o,a(IZ)}e._heightDirty=!1,e._updateModelMatrix=!0}function hdt(e,t){if(!e._updateModelMatrix&&e._minimumPixelSize===0)return;let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;Mxe(e,n),mdt(e,n,t)}function Mxe(e,t){e._clampedScale=l(e._maximumScale)?Math.min(e._scale,e._maximumScale):e._scale,e._boundingSphere.center=h.multiplyByScalar(e._sceneGraph.boundingSphere.center,e._clampedScale,e._boundingSphere.center),e._boundingSphere.radius=e._initialRadius*e._clampedScale,e._boundingSphere=se.transform(e._boundingSphere,t,e._boundingSphere)}function mdt(e,t,n){let i=e.scale;if(e.minimumPixelSize!==0&&!e._projectTo2D){let r=n.context,o=Math.max(r.drawingBufferWidth,r.drawingBufferHeight);O.getTranslation(t,Dy),e._sceneMode!==re.SCENE3D&&cr.computeActualEllipsoidPosition(n,Dy,Dy);let a=e._boundingSphere.radius,s=xdt(Dy,a,n),c=1/s;Math.min(c*(2*a),o)<e.minimumPixelSize&&(i=e.minimumPixelSize*s/(2*e._initialRadius))}e._computedScale=l(e.maximumScale)?Math.min(e.maximumScale,i):i}function pdt(e){if(!e._idDirty)return;e._idDirty=!1;let t=e._id,n=e._pickIds,i=n.length;for(let r=0;r<i;++r)n[r].object.id=t}var gdt=new $(1,0,0,0,0,1,0,-1,0);function _dt(e,t){let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix,i=e.referenceMatrix??n,r=t.context,o=Yft,a=qft;if(a=O.multiply(r.uniformState.view3D,i,a),o=O.getRotation(a,o),o=$.transpose(o,o),e._iblReferenceFrameMatrix=$.multiply(gdt,o,e._iblReferenceFrameMatrix),e.isClippingEnabled()){let s=O.multiply(i,e._clippingPlanes.modelMatrix,Xft);e._clippingPlanesMatrix=O.inverseTranspose(s,e._clippingPlanesMatrix)}}function ydt(e,t){let n=e._sceneGraph;if(e._updateModelMatrix||e._minimumPixelSize!==0){let r=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;n.updateModelMatrix(r,t),e._updateModelMatrix=!1}e._backFaceCullingDirty&&(n.updateBackFaceCulling(e._backFaceCulling),e._backFaceCullingDirty=!1),e._shadowsDirty&&(n.updateShadows(e._shadows),e._shadowsDirty=!1),e._debugShowBoundingVolumeDirty&&(n.updateShowBoundingVolume(e._debugShowBoundingVolume),e._debugShowBoundingVolumeDirty=!1);let i=!1;l(e.classificationType)||(i=e._userAnimationDirty||e._activeAnimations.update(t)),n.update(t,i),e._userAnimationDirty=!1}function Adt(e){if(!e._showCreditsOnScreenDirty)return;e._showCreditsOnScreenDirty=!1,e._credits.length=0;let t=e._showCreditsOnScreen;if(l(e._credit)){let a=wt.clone(e._credit);a.showOnScreen=a.showOnScreen||t,e._credits.push(a)}let n=e._resourceCredits,i=n.length;for(let a=0;a<i;a++){let s=wt.clone(n[a]);s.showOnScreen=s.showOnScreen||t,e._credits.push(s)}let r=e._gltfCredits,o=r.length;for(let a=0;a<o;a++){let s=wt.clone(r[a]);s.showOnScreen=s.showOnScreen||t,e._credits.push(s)}}function bdt(e,t){let n=Cdt(e,t),i=e.isInvisible(),r=e.hasSilhouette(t),o=e._show&&e._computedScale!==0&&n&&(!i||r),a=t.passes,s=a.render||a.pick&&e.allowPicking;o&&!e._ignoreCommands&&s&&(vdt(e,t),e._sceneGraph.pushDrawCommands(t))}var PZ=new se;function xdt(e,t,n){return PZ.center=e,PZ.radius=t,n.camera.getPixelSize(PZ,n.context.drawingBufferWidth,n.context.drawingBufferHeight)}var i4=new h;function Rxe(e,t,n){return function(i){Rv(e.heightReference)&&(i.height+=n.height),t.cartographicToCartesian(i,i4);let r=e._clampedModelMatrix;O.clone(e.modelMatrix,r),r[12]=i4.x,r[13]=i4.y,r[14]=i4.z,e._heightDirty=!0}}var Tdt=new h;function Cdt(e,t){let n=e.distanceDisplayCondition;if(!l(n))return!0;let i=n.near*n.near,r=n.far*n.far,o;if(t.mode===re.SCENE2D){let s=(t.camera.frustum.right-t.camera.frustum.left)*.5;o=s*s}else{let a=O.getTranslation(e.modelMatrix,Tdt);cr.computeActualEllipsoidPosition(t,a,a),o=h.distanceSquared(a,t.camera.positionWC)}return o>=i&&o<=r}function vdt(e,t){let n=t.creditDisplay,i=e._credits,r=i.length;for(let o=0;o<r;o++)n.addCreditToNextFrame(i[o])}wr.prototype.isTranslucent=function(){let e=this.color;return l(e)&&e.alpha>0&&e.alpha<1};wr.prototype.isInvisible=function(){let e=this.color;return l(e)&&e.alpha===0};function Lxe(e){return e.context.stencilBuffer}wr.prototype.hasSilhouette=function(e){return Lxe(e)&&this._silhouetteSize>0&&this._silhouetteColor.alpha>0&&!l(this._classificationType)};wr.prototype.hasSkipLevelOfDetail=function(e){if(!qo.is3DTiles(this.type))return!1;let t=e.context.stencilBuffer,n=this._content.tileset;return t&&n.isSkippingLevelOfDetail};wr.prototype.isClippingEnabled=function(){let e=this._clippingPlanes;return l(e)&&e.enabled&&e.length!==0};wr.prototype.pick=function(e,t,n,i,r){return $D(this,e,t,n,i,r)};wr.prototype.isClippingPolygonsEnabled=function(){let e=this._clippingPolygons;return l(e)&&e.enabled&&e.length!==0};wr.prototype.isDestroyed=function(){return!1};wr.prototype.destroy=function(){let e=this._loader;l(e)&&e.destroy();let t=this._featureTables;if(l(t)){let o=t.length;for(let a=0;a<o;a++)t[a].destroy()}this.destroyPipelineResources(),this.destroyModelResources(),l(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),l(this._terrainProviderChangedCallback)&&(this._terrainProviderChangedCallback(),this._terrainProviderChangedCallback=void 0);let n=this._clippingPlanes;l(n)&&!n.isDestroyed()&&n.owner===this&&n.destroy(),this._clippingPlanes=void 0;let i=this._clippingPolygons;l(i)&&!i.isDestroyed()&&i.owner===this&&i.destroy(),this._clippingPolygons=void 0,this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0;let r=this._environmentMapManager;!r.isDestroyed()&&r.owner===this&&r.destroy(),this._environmentMapManager=void 0,ue(this)};wr.prototype.destroyPipelineResources=function(){let e=this._pipelineResources;for(let t=0;t<e.length;t++)e[t].destroy();this._pipelineResources.length=0,this._pickIds.length=0};wr.prototype.destroyModelResources=function(){let e=this._modelResources;for(let t=0;t<e.length;t++)e[t].destroy();this._modelResources.length=0};wr.fromGltfAsync=async function(e){e=e??H.EMPTY_OBJECT;let t=e.url??e.gltf,n={releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,enablePick:e.enablePick,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline,loadForClassification:l(e.classificationType)},i=e.basePath??"",r=De.createIfNeeded(i);l(t.asset)?(n.gltfJson=t,n.baseResource=r,n.gltfResource=r):t instanceof Uint8Array?(n.typedArray=t,n.baseResource=r,n.gltfResource=r):n.gltfResource=De.createIfNeeded(t);let o=new Ad(n),s=l(e.content)?qo.TILE_GLTF:qo.GLTF,c=n.gltfResource,u=JD(o,s,e);u.resource=c,u.environmentMapOptions=e.environmentMapOptions;try{await o.load()}catch(g){throw o.destroy(),_t.getError("model",c,g)}let f=e.gltfCallback;l(f)&&f(o.gltfJson);let d=new wr(u),p=d._resource.credits;if(l(p)){let g=p.length;for(let m=0;m<g;m++)d._resourceCredits.push(wt.clone(p[m]))}return d};wr.fromB3dm=async function(e){let t={b3dmResource:e.resource,arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,enablePick:e.enablePick,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline,loadForClassification:l(e.classificationType)},n=new Nz(t);try{await n.load();let i=JD(n,qo.TILE_B3DM,e);return new wr(i)}catch(i){throw n.destroy(),i}};wr.fromPnts=async function(e){let t={arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,loadAttributesFor2D:e.projectTo2D},n=new e4(t);try{await n.load();let i=JD(n,qo.TILE_PNTS,e);return new wr(i)}catch(i){throw n.destroy(),i}};wr.fromI3dm=async function(e){let t={i3dmResource:e.resource,arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,enablePick:e.enablePick,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline},n=new jz(t);try{await n.load();let i=JD(n,qo.TILE_I3DM,e);return new wr(i)}catch(i){throw n.destroy(),i}};wr.fromGeoJson=async function(e){let t={geoJson:e.geoJson},n=new Bz(t),i=JD(n,qo.TILE_GEOJSON,e);return new wr(i)};var Edt=new U;wr.prototype.applyColorAndShow=function(e){let t=U.clone(this._color,Edt),n=l(e)&&l(e.color),i=l(e)&&l(e.show);this._color=n?e.color.evaluateColor(void 0,this._color):U.clone(U.WHITE,this._color),this._show=i?e.show.evaluate(void 0):!0,DZ(t,this._color)&&this.resetDrawCommands()};wr.prototype.applyStyle=function(e){let t=this.type===qo.TILE_PNTS,n=l(this.featureTableId)&&this.featureTables[this.featureTableId].featuresLength>0,i=l(this.structuralMetadata)?this.structuralMetadata.propertyAttributes:void 0,r=l(i)&&l(i[0]);if(t&&(!n||r)){this.resetDrawCommands();return}n?(this.featureTables[this.featureTableId].applyStyle(e),Oxe(this,e)):(this.applyColorAndShow(e),this._styleCommandsNeeded=void 0)};function JD(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,edgeDisplayMode:n.edgeDisplayMode,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 Ed=wr;var Sdt=1,wdt=!0,Idt=0,Pdt=!0,Ddt=!0,Rdt=Rn.ENABLED,Odt=it.NONE,Mdt=U.RED,Ldt=0,Ndt=U.WHITE,Fdt=Ml.HIGHLIGHT,Bdt=.5,kdt=new k(1,1),Nxe={maximumPositionEpsilon:Number.POSITIVE_INFINITY},zdt=new O,Udt=new O,Fxe=new U,Bxe=new Array(4),Vdt=new h;function Ry(e,t){t.collectionChanged.addEventListener(Ry.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._modelHash={},this._entitiesToVisualize=new zt,this._onCollectionChanged(t,t.values,[],[])}async function jdt(e,t,n,i,r){let o=e._primitives,a=e._modelHash;try{let s=await Ed.fromGltfAsync({url:n,incrementallyLoadTextures:i,scene:e._scene,environmentMapOptions:r});if(e.isDestroyed()||!l(a[t.id]))return;s.id=t,o.add(s),a[t.id].modelPrimitive=s,s.errorEvent.addEventListener(c=>{l(a[t.id])&&(console.log(c),c.name!=="TextureError"&&s.incrementallyLoadTextures&&(a[t.id].loadFailed=!0))})}catch(s){if(e.isDestroyed()||!l(a[t.id]))return;console.log(s),a[t.id].loadFailed=!0}}Ry.prototype.update=function(e){let t=this._entitiesToVisualize.values,n=this._modelHash,i=this._primitives;for(let r=0,o=t.length;r<o;r++){let a=t[r],s=a._model,c,u=n[a.id],f=a.isShowing&&a.isAvailable(e)&&X.getValueOrDefault(s._show,e,!0),d;if(f&&(d=a.computeModelMatrix(e,zdt),c=De.createIfNeeded(X.getValueOrUndefined(s._uri,e)),f=l(d)&&l(c)),!f){l(u)&&u.modelPrimitive&&(u.modelPrimitive.show=!1);continue}if(!l(u)||c.url!==u.url){l(u?.modelPrimitive)&&(i.removeAndDestroy(u.modelPrimitive),delete n[a.id]),u={modelPrimitive:void 0,url:c.url,animationsRunning:!1,nodeTransformationsScratch:{},articulationsScratch:{},loadFailed:!1,modelUpdated:!1,environmentMapOptionsScratch:{...Nxe}},n[a.id]=u;let m=X.getValueOrDefault(s._incrementallyLoadTextures,e,Pdt),y=X.getValueOrDefault(s._environmentMapOptions,e,Nxe,u.environmentMapOptionsScratch);jdt(this,a,c,m,y)}let p=u.modelPrimitive;if(!l(p))continue;p.show=!0,p.scale=X.getValueOrDefault(s._scale,e,Sdt),p.enableVerticalExaggeration=X.getValueOrDefault(s._enableVerticalExaggeration,e,wdt),p.minimumPixelSize=X.getValueOrDefault(s._minimumPixelSize,e,Idt),p.maximumScale=X.getValueOrUndefined(s._maximumScale,e),p.modelMatrix=O.clone(d,p.modelMatrix),p.shadows=X.getValueOrDefault(s._shadows,e,Rdt),p.heightReference=X.getValueOrDefault(s._heightReference,e,Odt),p.distanceDisplayCondition=X.getValueOrUndefined(s._distanceDisplayCondition,e),p.silhouetteColor=X.getValueOrDefault(s._silhouetteColor,e,Mdt,Fxe),p.silhouetteSize=X.getValueOrDefault(s._silhouetteSize,e,Ldt),p.color=X.getValueOrDefault(s._color,e,Ndt,Fxe),p.colorBlendMode=X.getValueOrDefault(s._colorBlendMode,e,Fdt),p.colorBlendAmount=X.getValueOrDefault(s._colorBlendAmount,e,Bdt),p.clippingPlanes=X.getValueOrUndefined(s._clippingPlanes,e),p.clampAnimations=X.getValueOrDefault(s._clampAnimations,e,Ddt),p.imageBasedLighting.imageBasedLightingFactor=X.getValueOrDefault(s._imageBasedLightingFactor,e,kdt);let g=X.getValueOrUndefined(s._lightColor,e);if(l(g)&&(U.pack(g,Bxe,0),g=h.unpack(Bxe,0,Vdt)),p.lightColor=g,p.customShader=X.getValueOrUndefined(s._customShader,e),n[a.id].modelUpdated=!0,p.ready){let m=X.getValueOrDefault(s._runAnimations,e,!0);u.animationsRunning!==m&&(m?p.activeAnimations.addAll({loop:cf.REPEAT}):p.activeAnimations.removeAll(),u.animationsRunning=m);let y=X.getValueOrUndefined(s._nodeTransformations,e,u.nodeTransformationsScratch);if(l(y)){let x=Object.keys(y);for(let T=0,C=x.length;T<C;++T){let E=x[T],w=y[E];if(!l(w))continue;let D=p.getNode(E);if(!l(D))continue;let R=O.fromTranslationRotationScale(w,Udt);D.matrix=O.multiply(D.originalMatrix,R,R)}}let A=!1,b=X.getValueOrUndefined(s._articulations,e,u.articulationsScratch);if(l(b)){let x=Object.keys(b);for(let T=0,C=x.length;T<C;++T){let E=x[T],w=b[E];l(w)&&(A=!0,p.setArticulationStage(E,w))}}A&&p.applyArticulations()}}return!0};Ry.prototype.isDestroyed=function(){return!1};Ry.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Ry.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._modelHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)RZ(this,e[i],t,n);return ue(this)};var r4=new h,Hdt=new de;Ry.prototype.getBoundingSphere=function(e,t){let n=this._modelHash[e.id];if(!l(n))return It.FAILED;if(n.loadFailed)return It.FAILED;let i=n.modelPrimitive;if(!l(i)||!i.show)return It.PENDING;if(!i.ready||!n.modelUpdated)return It.PENDING;let r=this._scene,o=r.ellipsoid??te.default;if(i.heightReference!==it.NONE){let s=i.modelMatrix;r4.x=s[12],r4.y=s[13],r4.z=s[14];let c=o.cartesianToCartographic(r4,Hdt),u=r.getHeight(c,i.heightReference);return l(u)&&(gu(i.heightReference)?c.height=u:c.height+=u),se.clone(i.boundingSphere,t),t.center=o.cartographicToCartesian(c),It.DONE}return se.clone(i.boundingSphere,t),It.DONE};Ry.prototype._onCollectionChanged=function(e,t,n,i){let r,o,a=this._entitiesToVisualize,s=this._modelHash,c=this._primitives;for(r=t.length-1;r>-1;r--)o=t[r],l(o._model)&&l(o._position)&&a.set(o.id,o);for(r=i.length-1;r>-1;r--)o=i[r],l(o._model)&&l(o._position)?(Gdt(o,s),a.set(o.id,o)):(RZ(this,o,s,c),a.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],RZ(this,o,s,c),a.remove(o.id)};function RZ(e,t,n,i){let r=n[t.id];l(r)&&(i.removeAndDestroy(r.modelPrimitive),delete n[t.id])}function Gdt(e,t){let n=t[e.id];l(n)&&(n.nodeTransformationsScratch={},n.articulationsScratch={})}var o4=Ry;function kxe(e){e=e??H.EMPTY_OBJECT,this._metadata=e.metadata}Object.defineProperties(kxe.prototype,{metadata:{get:function(){return this._metadata}}});var HE=kxe;var OZ=class e{constructor(t,n,i,r){this._tileset=t,this._tile=n,this._resource=i,l(r)||(r=[]),this._contents=r,this._metadata=void 0,this._group=void 0,this._ready=!1}get featurePropertiesDirty(){let t=this._contents,n=t.length;for(let i=0;i<n;++i)if(t[i].featurePropertiesDirty)return!0;return!1}set featurePropertiesDirty(t){let n=this._contents,i=n.length;for(let r=0;r<i;++r)n[r].featurePropertiesDirty=t}get featuresLength(){return 0}get pointsLength(){return 0}get trianglesLength(){return 0}get geometryByteLength(){return 0}get texturesByteLength(){return 0}get batchTableByteLength(){return 0}get innerContents(){return this._contents}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get metadata(){return this._metadata}set metadata(t){this._metadata=t;let n=this._contents,i=n.length;for(let r=0;r<i;++r)n[r].metadata=t}get batchTable(){}get group(){return this._group}set group(t){this._group=t;let n=this._contents,i=n.length;for(let r=0;r<i;++r)n[r].group=t}static async fromTileType(t,n,i,r,o,a){o=o??0;let s=new Uint8Array(r),c=new DataView(r);o+=ZD;let u=c.getUint32(o,!0);if(u!==1)throw new oe(`Only Composite Tile version 1 is supported. Version ${u} is not.`);o+=ZD,o+=ZD;let f=c.getUint32(o,!0);o+=ZD;let d=i.queryParameters.compositeIndex;l(d)?d=`${d}_`:d="";let p=[];p.length=f;for(let y=0;y<f;++y){let A=Om(s,o),b=c.getUint32(o+ZD*2,!0),x=a[A],T=`${d}${y}`,C=i.getDerivedResource({queryParameters:{compositeIndex:T}});if(l(x))p[y]=Promise.resolve(x(t,n,C,r,o));else throw new oe(`Unknown tile content type, ${A}, inside Composite tile`);o+=b}let g=await Promise.all(p);return new e(t,n,i,g)}hasProperty(t,n){return!1}getFeature(t){}applyDebugSettings(t,n){let i=this._contents,r=i.length;for(let o=0;o<r;++o)i[o].applyDebugSettings(t,n)}applyStyle(t){let n=this._contents,i=n.length;for(let r=0;r<i;++r)n[r].applyStyle(t)}update(t,n){let i=this._contents,r=i.length,o=!0;for(let a=0;a<r;++a)i[a].update(t,n),o=o&&i[a].ready;!this._ready&&o&&(this._ready=!0)}pick(t,n,i){if(!this._ready)return;let r,o=Number.POSITIVE_INFINITY,a=this._contents,s=a.length;for(let c=0;c<s;++c){let u=a[c].pick(t,n,i);if(!l(u))continue;let f=h.distance(t.origin,u);f<o&&(r=u,o=f)}if(l(r))return i}isDestroyed(){return!1}destroy(){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].destroy();return ue(this)}},ZD=Uint32Array.BYTES_PER_ELEMENT,a4=OZ;function Wdt(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}var ag=Wdt;var QD=`in vec3 position;
|
|
in float a_batchId;
|
|
|
|
uniform mat4 u_modifiedModelViewProjection;
|
|
|
|
void main()
|
|
{
|
|
gl_Position = czm_depthClamp(u_modifiedModelViewProjection * vec4(position, 1.0));
|
|
}
|
|
`;var MZ=class{add(t,n,i){if(typeof arguments[0]!="string")for(let r in arguments[0])this.add(r,arguments[0][r],arguments[1]);else(Array.isArray(t)?t:[t]).forEach(function(r){this[r]=this[r]||[],n&&this[r][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)})}},LZ=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)})}},wu=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,r;for(;this.index<this.expr.length;)if(i=this.code,i===e.SEMCOL_CODE||i===e.COMMA_CODE)this.index++;else if(r=this.gobbleExpression())n.push(r);else if(this.index<this.expr.length){if(i===t)break;this.throwError('Unexpected "'+this.char+'"')}return n}gobbleExpression(){let t=this.searchHook("gobble-expression")||this.gobbleBinaryExpression();return this.gobbleSpaces(),this.runHook("after-expression",t)}gobbleBinaryOp(){this.gobbleSpaces();let t=this.expr.substr(this.index,e.max_binop_len),n=t.length;for(;n>0;){if(e.binary_ops.hasOwnProperty(t)&&(!e.isIdentifierStart(this.code)||this.index+t.length<this.expr.length&&!e.isIdentifierPart(this.expr.charCodeAt(this.index+t.length))))return this.index+=n,t;t=t.substr(0,--n)}return!1}gobbleBinaryExpression(){let t,n,i,r,o,a,s,c,u;if(a=this.gobbleToken(),!a||(n=this.gobbleBinaryOp(),!n))return a;for(o={value:n,prec:e.binaryPrecedence(n),right_a:e.right_associative.has(n)},s=this.gobbleToken(),s||this.throwError("Expected expression after "+n),r=[a,o,s];n=this.gobbleBinaryOp();){if(i=e.binaryPrecedence(n),i===0){this.index-=n.length;break}o={value:n,prec:i,right_a:e.right_associative.has(n)},u=n;let f=d=>o.right_a&&d.right_a?i>d.prec:i<=d.prec;for(;r.length>2&&f(r[r.length-2]);)s=r.pop(),n=r.pop().value,a=r.pop(),t={type:e.BINARY_EXP,operator:n,left:a,right:s},r.push(t);t=this.gobbleToken(),t||this.throwError("Expected expression after "+u),r.push(o,t)}for(c=r.length-1,t=r[c];c>1;)t={type:e.BINARY_EXP,operator:r[c-1].value,left:r[c-2],right:t},c-=2;return t}gobbleToken(){let t,n,i,r;if(this.gobbleSpaces(),r=this.searchHook("gobble-token"),r)return this.runHook("after-token",r);if(t=this.code,e.isDecimalDigit(t)||t===e.PERIOD_CODE)return this.gobbleNumericLiteral();if(t===e.SQUOTE_CODE||t===e.DQUOTE_CODE)r=this.gobbleStringLiteral();else if(t===e.OBRACK_CODE)r=this.gobbleArray();else{for(n=this.expr.substr(this.index,e.max_unop_len),i=n.length;i>0;){if(e.unary_ops.hasOwnProperty(n)&&(!e.isIdentifierStart(this.code)||this.index+n.length<this.expr.length&&!e.isIdentifierPart(this.expr.charCodeAt(this.index+n.length)))){this.index+=i;let o=this.gobbleToken();return o||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:e.UNARY_EXP,operator:n,argument:o,prefix:!0})}n=n.substr(0,--i)}e.isIdentifierStart(t)?(r=this.gobbleIdentifier(),e.literals.hasOwnProperty(r.name)?r={type:e.LITERAL,value:e.literals[r.name],raw:r.name}:r.name===e.this_str&&(r={type:e.THIS_EXP})):t===e.OPAREN_CODE&&(r=this.gobbleGroup())}return r?(r=this.gobbleTokenProperty(r),this.runHook("after-token",r)):this.runHook("after-token",!1)}gobbleTokenProperty(t){this.gobbleSpaces();let n=this.code;for(;n===e.PERIOD_CODE||n===e.OBRACK_CODE||n===e.OPAREN_CODE||n===e.QUMARK_CODE;){let i;if(n===e.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==e.PERIOD_CODE)break;i=!0,this.index+=2,this.gobbleSpaces(),n=this.code}this.index++,n===e.OBRACK_CODE?(t={type:e.MEMBER_EXP,computed:!0,object:t,property:this.gobbleExpression()},t.property||this.throwError('Unexpected "'+this.char+'"'),this.gobbleSpaces(),n=this.code,n!==e.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):n===e.OPAREN_CODE?t={type:e.CALL_EXP,arguments:this.gobbleArguments(e.CPAREN_CODE),callee:t}:(n===e.PERIOD_CODE||i)&&(i&&this.index--,this.gobbleSpaces(),t={type:e.MEMBER_EXP,computed:!1,object:t,property:this.gobbleIdentifier()}),i&&(t.optional=!0),this.gobbleSpaces(),n=this.code}return t}gobbleNumericLiteral(){let t="",n,i;for(;e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(this.code===e.PERIOD_CODE)for(t+=this.expr.charAt(this.index++);e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(n=this.char,n==="e"||n==="E"){for(t+=this.expr.charAt(this.index++),n=this.char,(n==="+"||n==="-")&&(t+=this.expr.charAt(this.index++));e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);e.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+t+this.char+")")}return i=this.code,e.isIdentifierStart(i)?this.throwError("Variable names cannot start with a number ("+t+this.char+")"):(i===e.PERIOD_CODE||t.length===1&&t.charCodeAt(0)===e.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:e.LITERAL,value:parseFloat(t),raw:t}}gobbleStringLiteral(){let t="",n=this.index,i=this.expr.charAt(this.index++),r=!1;for(;this.index<this.expr.length;){let o=this.expr.charAt(this.index++);if(o===i){r=!0;break}else if(o==="\\")switch(o=this.expr.charAt(this.index++),o){case"n":t+=`
|
|
`;break;case"r":t+="\r";break;case"t":t+=" ";break;case"b":t+="\b";break;case"f":t+="\f";break;case"v":t+="\v";break;default:t+=o}else t+=o}return r||this.throwError('Unclosed quote after "'+t+'"'),{type:e.LITERAL,value:t,raw:this.expr.substring(n,this.index)}}gobbleIdentifier(){let t=this.code,n=this.index;for(e.isIdentifierStart(t)?this.index++:this.throwError("Unexpected "+this.char);this.index<this.expr.length&&(t=this.code,e.isIdentifierPart(t));)this.index++;return{type:e.IDENTIFIER,name:this.expr.slice(n,this.index)}}gobbleArguments(t){let n=[],i=!1,r=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let o=this.code;if(o===t){i=!0,this.index++,t===e.CPAREN_CODE&&r&&r>=n.length&&this.throwError("Unexpected token "+String.fromCharCode(t));break}else if(o===e.COMMA_CODE){if(this.index++,r++,r!==n.length){if(t===e.CPAREN_CODE)this.throwError("Unexpected token ,");else if(t===e.CBRACK_CODE)for(let a=n.length;a<r;a++)n.push(null)}}else if(n.length!==r&&r!==0)this.throwError("Expected comma");else{let a=this.gobbleExpression();(!a||a.type===e.COMPOUND)&&this.throwError("Expected comma"),n.push(a)}}return i||this.throwError("Expected "+String.fromCharCode(t)),n}gobbleGroup(){this.index++;let t=this.gobbleExpressions(e.CPAREN_CODE);if(this.code===e.CPAREN_CODE)return this.index++,t.length===1?t[0]:t.length?{type:e.SEQUENCE_EXP,expressions:t}:!1;this.throwError("Unclosed (")}gobbleArray(){return this.index++,{type:e.ARRAY_EXP,elements:this.gobbleArguments(e.CBRACK_CODE)}}},qdt=new MZ;Object.assign(wu,{hooks:qdt,plugins:new LZ(wu),COMPOUND:"Compound",SEQUENCE_EXP:"SequenceExpression",IDENTIFIER:"Identifier",MEMBER_EXP:"MemberExpression",LITERAL:"Literal",THIS_EXP:"ThisExpression",CALL_EXP:"CallExpression",UNARY_EXP:"UnaryExpression",BINARY_EXP:"BinaryExpression",ARRAY_EXP:"ArrayExpression",TAB_CODE:9,LF_CODE:10,CR_CODE:13,SPACE_CODE:32,PERIOD_CODE:46,COMMA_CODE:44,SQUOTE_CODE:39,DQUOTE_CODE:34,OPAREN_CODE:40,CPAREN_CODE:41,OBRACK_CODE:91,CBRACK_CODE:93,QUMARK_CODE:63,SEMCOL_CODE:59,COLON_CODE:58,unary_ops:{"-":1,"!":1,"~":1,"+":1},binary_ops:{"||":1,"??":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10,"**":11},right_associative:new Set(["**"]),additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"});wu.max_unop_len=wu.getMaxKeyLen(wu.unary_ops);wu.max_binop_len=wu.getMaxKeyLen(wu.binary_ops);var Oy=e=>new wu(e).parse(),Ydt=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(wu).filter(e=>!Ydt.includes(e)&&Oy[e]===void 0).forEach(e=>{Oy[e]=wu[e]});Oy.Jsep=wu;var Xdt="ConditionalExpression",Kdt={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,r=this.gobbleExpression();if(r||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;let o=this.gobbleExpression();if(o||this.throwError("Expected expression"),n.node={type:Xdt,test:i,consequent:r,alternate:o},i.operator&&e.binary_ops[i.operator]<=.9){let a=i;for(;a.right.operator&&e.binary_ops[a.right.operator]<=.9;)a=a.right;n.node.test=a.right,a.right=n.node,n.node=i}}else this.throwError("Expected :")}})}};Oy.plugins.register(Kdt);var zxe={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};Object.freeze(zxe);var Rt=zxe;function kh(e,t){this._expression=e,e=cht(e,t),e=uht(lht(e)),Oy.addBinaryOp("=~",0),Oy.addBinaryOp("!~",0);let n;try{n=Oy(e)}catch(i){throw new oe(i)}this._runtimeAst=Hi(this,n)}Object.defineProperties(kh.prototype,{expression:{get:function(){return this._expression}}});var kn={arrayIndex:0,arrayArray:[[]],cartesian2Index:0,cartesian3Index:0,cartesian4Index:0,cartesian2Array:[new k],cartesian3Array:[new h],cartesian4Array:[new ae],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 k),this.cartesian2Array[this.cartesian2Index++]},getCartesian3:function(){return this.cartesian3Index>=this.cartesian3Array.length&&this.cartesian3Array.push(new h),this.cartesian3Array[this.cartesian3Index++]},getCartesian4:function(){return this.cartesian4Index>=this.cartesian4Array.length&&this.cartesian4Array.push(new ae),this.cartesian4Array[this.cartesian4Index++]}};kh.prototype.evaluate=function(e,t){kn.reset();let n=this._runtimeAst.evaluate(e);return t instanceof U&&n instanceof ae?U.fromCartesian4(n,t):n instanceof k||n instanceof h||n instanceof ae?n.clone(t):n};kh.prototype.evaluateColor=function(e,t){kn.reset();let n=this._runtimeAst.evaluate(e);return U.fromCartesian4(n,t)};kh.prototype.getShaderFunction=function(e,t,n,i){let r=this.getShaderExpression(t,n);return r=`${i} ${e}
|
|
{
|
|
return ${r};
|
|
}
|
|
`,r};kh.prototype.getShaderExpression=function(e,t){return this._runtimeAst.getShaderExpression(e,t)};kh.prototype.getVariables=function(){let e=[];return this._runtimeAst.getVariables(e),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var $dt=["!","-","+"],Uxe=["+","-","*","/","%","===","!==",">",">=","<","<=","&&","||","!~","=~"],e1=/\${(.*?)}/g,Jdt=/\\/g,Zdt="@#%",Qdt=/@#%/g,l4=new U,u4={abs:Rs(Math.abs),sqrt:Rs(Math.sqrt),cos:Rs(Math.cos),sin:Rs(Math.sin),tan:Rs(Math.tan),acos:Rs(Math.acos),asin:Rs(Math.asin),atan:Rs(Math.atan),radians:Rs(I.toRadians),degrees:Rs(I.toDegrees),sign:Rs(I.sign),floor:Rs(Math.floor),ceil:Rs(Math.ceil),round:Rs(Math.round),exp:Rs(Math.exp),exp2:Rs(tht),log:Rs(Math.log),log2:Rs(nht),fract:Rs(eht),length:iht,normalize:rht},f4={atan2:s4(Math.atan2,!1),pow:s4(Math.pow,!1),min:s4(Math.min,!0),max:s4(Math.max,!0),distance:oht,dot:aht,cross:sht},BZ={clamp:Vxe(I.clamp,!0),mix:Vxe(I.lerp,!0)};function eht(e){return e-Math.floor(e)}function tht(e){return Math.pow(2,e)}function nht(e){return I.log2(e)}function Rs(e){return function(t,n){if(typeof n=="number")return e(n);if(n instanceof k)return k.fromElements(e(n.x),e(n.y),kn.getCartesian2());if(n instanceof h)return h.fromElements(e(n.x),e(n.y),e(n.z),kn.getCartesian3());if(n instanceof ae)return ae.fromElements(e(n.x),e(n.y),e(n.z),e(n.w),kn.getCartesian4());throw new oe(`Function "${t}" requires a vector or number argument. Argument is ${n}.`)}}function s4(e,t){return function(n,i,r){if(t&&typeof r=="number"){if(typeof i=="number")return e(i,r);if(i instanceof k)return k.fromElements(e(i.x,r),e(i.y,r),kn.getCartesian2());if(i instanceof h)return h.fromElements(e(i.x,r),e(i.y,r),e(i.z,r),kn.getCartesian3());if(i instanceof ae)return ae.fromElements(e(i.x,r),e(i.y,r),e(i.z,r),e(i.w,r),kn.getCartesian4())}if(typeof i=="number"&&typeof r=="number")return e(i,r);if(i instanceof k&&r instanceof k)return k.fromElements(e(i.x,r.x),e(i.y,r.y),kn.getCartesian2());if(i instanceof h&&r instanceof h)return h.fromElements(e(i.x,r.x),e(i.y,r.y),e(i.z,r.z),kn.getCartesian3());if(i instanceof ae&&r instanceof ae)return ae.fromElements(e(i.x,r.x),e(i.y,r.y),e(i.z,r.z),e(i.w,r.w),kn.getCartesian4());throw new oe(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i} and ${r}.`)}}function Vxe(e,t){return function(n,i,r,o){if(t&&typeof o=="number"){if(typeof i=="number"&&typeof r=="number")return e(i,r,o);if(i instanceof k&&r instanceof k)return k.fromElements(e(i.x,r.x,o),e(i.y,r.y,o),kn.getCartesian2());if(i instanceof h&&r instanceof h)return h.fromElements(e(i.x,r.x,o),e(i.y,r.y,o),e(i.z,r.z,o),kn.getCartesian3());if(i instanceof ae&&r instanceof ae)return ae.fromElements(e(i.x,r.x,o),e(i.y,r.y,o),e(i.z,r.z,o),e(i.w,r.w,o),kn.getCartesian4())}if(typeof i=="number"&&typeof r=="number"&&typeof o=="number")return e(i,r,o);if(i instanceof k&&r instanceof k&&o instanceof k)return k.fromElements(e(i.x,r.x,o.x),e(i.y,r.y,o.y),kn.getCartesian2());if(i instanceof h&&r instanceof h&&o instanceof h)return h.fromElements(e(i.x,r.x,o.x),e(i.y,r.y,o.y),e(i.z,r.z,o.z),kn.getCartesian3());if(i instanceof ae&&r instanceof ae&&o instanceof ae)return ae.fromElements(e(i.x,r.x,o.x),e(i.y,r.y,o.y),e(i.z,r.z,o.z),e(i.w,r.w,o.w),kn.getCartesian4());throw new oe(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i}, ${r}, and ${o}.`)}}function iht(e,t){if(typeof t=="number")return Math.abs(t);if(t instanceof k)return k.magnitude(t);if(t instanceof h)return h.magnitude(t);if(t instanceof ae)return ae.magnitude(t);throw new oe(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function rht(e,t){if(typeof t=="number")return 1;if(t instanceof k)return k.normalize(t,kn.getCartesian2());if(t instanceof h)return h.normalize(t,kn.getCartesian3());if(t instanceof ae)return ae.normalize(t,kn.getCartesian4());throw new oe(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function oht(e,t,n){if(typeof t=="number"&&typeof n=="number")return Math.abs(t-n);if(t instanceof k&&n instanceof k)return k.distance(t,n);if(t instanceof h&&n instanceof h)return h.distance(t,n);if(t instanceof ae&&n instanceof ae)return ae.distance(t,n);throw new oe(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function aht(e,t,n){if(typeof t=="number"&&typeof n=="number")return t*n;if(t instanceof k&&n instanceof k)return k.dot(t,n);if(t instanceof h&&n instanceof h)return h.dot(t,n);if(t instanceof ae&&n instanceof ae)return ae.dot(t,n);throw new oe(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function sht(e,t,n){if(t instanceof h&&n instanceof h)return h.cross(t,n,kn.getCartesian3());throw new oe(`Function "${e}" requires vec3 arguments. Arguments are ${t} and ${n}.`)}function Nt(e,t,n,i,r){this._type=e,this._value=t,this._left=n,this._right=i,this._test=r,this.evaluate=void 0,bht(this)}function cht(e,t){if(!l(t))return e;for(let n in t)if(t.hasOwnProperty(n)){let i=new RegExp(`\\$\\{${n}\\}`,"g"),r=`(${t[n]})`;l(r)&&(e=e.replace(i,r))}return e}function lht(e){return e.replace(Jdt,Zdt)}function FZ(e){return e.replace(Qdt,"\\")}function uht(e){let t=e,n="",i=t.indexOf("${");for(;i>=0;){let r=t.indexOf("'"),o=t.indexOf('"'),a;if(r>=0&&r<i)a=t.indexOf("'",r+1),n+=t.substr(0,a+1),t=t.substr(a+1),i=t.indexOf("${");else if(o>=0&&o<i)a=t.indexOf('"',o+1),n+=t.substr(0,a+1),t=t.substr(a+1),i=t.indexOf("${");else{n+=t.substr(0,i);let s=t.indexOf("}");if(s<0)throw new oe("Unmatched {.");n+=`czm_${t.substr(i+2,s-(i+2))}`,t=t.substr(s+1),i=t.indexOf("${")}}return n+=t,n}function fht(e){let t=typeof e.value;if(e.value===null)return new Nt(Rt.LITERAL_NULL,null);if(t==="boolean")return new Nt(Rt.LITERAL_BOOLEAN,e.value);if(t==="number")return new Nt(Rt.LITERAL_NUMBER,e.value);if(t==="string")return e.value.indexOf("${")>=0?new Nt(Rt.VARIABLE_IN_STRING,e.value):new Nt(Rt.LITERAL_STRING,FZ(e.value))}function dht(e,t){let n=t.arguments,i=n.length,r,o,a,s;if(t.callee.type==="MemberExpression"){r=t.callee.property.name;let c=t.callee.object;if(r==="test"||r==="exec"){if(!l(c.callee)||c.callee.name!=="regExp")throw new oe(`${r} is not a function.`);return i===0?r==="test"?new Nt(Rt.LITERAL_BOOLEAN,!1):new Nt(Rt.LITERAL_NULL,null):(a=Hi(e,c),s=Hi(e,n[0]),new Nt(Rt.FUNCTION_CALL,r,a,s))}else if(r==="toString")return o=Hi(e,c),new Nt(Rt.FUNCTION_CALL,r,o);throw new oe(`Unexpected function call "${r}".`)}if(r=t.callee.name,r==="color"){if(i===0)return new Nt(Rt.LITERAL_COLOR,r);if(o=Hi(e,n[0]),l(n[1])){let c=Hi(e,n[1]);return new Nt(Rt.LITERAL_COLOR,r,[o,c])}return new Nt(Rt.LITERAL_COLOR,r,[o])}else if(r==="rgb"||r==="hsl"){if(i<3)throw new oe(`${r} requires three arguments.`);return o=[Hi(e,n[0]),Hi(e,n[1]),Hi(e,n[2])],new Nt(Rt.LITERAL_COLOR,r,o)}else if(r==="rgba"||r==="hsla"){if(i<4)throw new oe(`${r} requires four arguments.`);return o=[Hi(e,n[0]),Hi(e,n[1]),Hi(e,n[2]),Hi(e,n[3])],new Nt(Rt.LITERAL_COLOR,r,o)}else if(r==="vec2"||r==="vec3"||r==="vec4"){o=new Array(i);for(let c=0;c<i;++c)o[c]=Hi(e,n[c]);return new Nt(Rt.LITERAL_VECTOR,r,o)}else{if(r==="isNaN"||r==="isFinite")return i===0?r==="isNaN"?new Nt(Rt.LITERAL_BOOLEAN,!0):new Nt(Rt.LITERAL_BOOLEAN,!1):(o=Hi(e,n[0]),new Nt(Rt.UNARY,r,o));if(r==="isExactClass"||r==="isClass"){if(i<1||i>1)throw new oe(`${r} requires exactly one argument.`);return o=Hi(e,n[0]),new Nt(Rt.UNARY,r,o)}else if(r==="getExactClassName"){if(i>0)throw new oe(`${r} does not take any argument.`);return new Nt(Rt.UNARY,r)}else if(l(u4[r])){if(i!==1)throw new oe(`${r} requires exactly one argument.`);return o=Hi(e,n[0]),new Nt(Rt.UNARY,r,o)}else if(l(f4[r])){if(i!==2)throw new oe(`${r} requires exactly two arguments.`);return a=Hi(e,n[0]),s=Hi(e,n[1]),new Nt(Rt.BINARY,r,a,s)}else if(l(BZ[r])){if(i!==3)throw new oe(`${r} requires exactly three arguments.`);a=Hi(e,n[0]),s=Hi(e,n[1]);let c=Hi(e,n[2]);return new Nt(Rt.TERNARY,r,a,s,c)}else{if(r==="Boolean")return i===0?new Nt(Rt.LITERAL_BOOLEAN,!1):(o=Hi(e,n[0]),new Nt(Rt.UNARY,r,o));if(r==="Number")return i===0?new Nt(Rt.LITERAL_NUMBER,0):(o=Hi(e,n[0]),new Nt(Rt.UNARY,r,o));if(r==="String")return i===0?new Nt(Rt.LITERAL_STRING,""):(o=Hi(e,n[0]),new Nt(Rt.UNARY,r,o));if(r==="regExp")return hht(e,t)}}throw new oe(`Unexpected function call "${r}".`)}function hht(e,t){let n=t.arguments;if(n.length===0)return new Nt(Rt.LITERAL_REGEX,new RegExp);let i=Hi(e,n[0]),r;if(n.length>1){let o=Hi(e,n[1]);if(NZ(i)&&NZ(o)){try{r=new RegExp(FZ(String(i._value)),o._value)}catch(a){throw new oe(a)}return new Nt(Rt.LITERAL_REGEX,r)}return new Nt(Rt.REGEX,i,o)}if(NZ(i)){try{r=new RegExp(FZ(String(i._value)))}catch(o){throw new oe(o)}return new Nt(Rt.LITERAL_REGEX,r)}return new Nt(Rt.REGEX,i)}function mht(e){if(yht(e.name)){let t=Aht(e.name);return t.substr(0,8)==="tiles3d_"?new Nt(Rt.BUILTIN_VARIABLE,t):new Nt(Rt.VARIABLE,t)}else{if(e.name==="NaN")return new Nt(Rt.LITERAL_NUMBER,NaN);if(e.name==="Infinity")return new Nt(Rt.LITERAL_NUMBER,1/0);if(e.name==="undefined")return new Nt(Rt.LITERAL_UNDEFINED,void 0)}throw new oe(`${e.name} is not defined.`)}function pht(e){let t=e.property.name;if(t==="PI")return new Nt(Rt.LITERAL_NUMBER,Math.PI);if(t==="E")return new Nt(Rt.LITERAL_NUMBER,Math.E)}function ght(e){if(e.property.name==="POSITIVE_INFINITY")return new Nt(Rt.LITERAL_NUMBER,Number.POSITIVE_INFINITY)}function _ht(e,t){if(t.object.name==="Math")return pht(t);if(t.object.name==="Number")return ght(t);let n,i=Hi(e,t.object);return t.computed?(n=Hi(e,t.property),new Nt(Rt.MEMBER,"brackets",i,n)):(n=new Nt(Rt.LITERAL_STRING,t.property.name),new Nt(Rt.MEMBER,"dot",i,n))}function NZ(e){return e._type>=Rt.LITERAL_NULL}function yht(e){return e.substr(0,4)==="czm_"}function Aht(e){return e.substr(4)}function Hi(e,t){let n,i,r,o;if(t.type==="Literal")n=fht(t);else if(t.type==="CallExpression")n=dht(e,t);else if(t.type==="Identifier")n=mht(t);else if(t.type==="UnaryExpression"){i=t.operator;let a=Hi(e,t.argument);if($dt.indexOf(i)>-1)n=new Nt(Rt.UNARY,i,a);else throw new oe(`Unexpected operator "${i}".`)}else if(t.type==="BinaryExpression")if(i=t.operator,r=Hi(e,t.left),o=Hi(e,t.right),Uxe.indexOf(i)>-1)n=new Nt(Rt.BINARY,i,r,o);else throw new oe(`Unexpected operator "${i}".`);else if(t.type==="LogicalExpression")i=t.operator,r=Hi(e,t.left),o=Hi(e,t.right),Uxe.indexOf(i)>-1&&(n=new Nt(Rt.BINARY,i,r,o));else if(t.type==="ConditionalExpression"){let a=Hi(e,t.test);r=Hi(e,t.consequent),o=Hi(e,t.alternate),n=new Nt(Rt.CONDITIONAL,"?",r,o,a)}else if(t.type==="MemberExpression")n=_ht(e,t);else if(t.type==="ArrayExpression"){let a=[];for(let s=0;s<t.elements.length;s++)a[s]=Hi(e,t.elements[s]);n=new Nt(Rt.ARRAY,a)}else throw t.type==="Compound"?new oe("Provide exactly one expression."):new oe("Cannot parse expression.");return n}function bht(e){e._type===Rt.CONDITIONAL?e.evaluate=e._evaluateConditional:e._type===Rt.FUNCTION_CALL?e._value==="test"?e.evaluate=e._evaluateRegExpTest:e._value==="exec"?e.evaluate=e._evaluateRegExpExec:e._value==="toString"&&(e.evaluate=e._evaluateToString):e._type===Rt.UNARY?e._value==="!"?e.evaluate=e._evaluateNot:e._value==="-"?e.evaluate=e._evaluateNegative:e._value==="+"?e.evaluate=e._evaluatePositive:e._value==="isNaN"?e.evaluate=e._evaluateNaN:e._value==="isFinite"?e.evaluate=e._evaluateIsFinite:e._value==="isExactClass"?e.evaluate=e._evaluateIsExactClass:e._value==="isClass"?e.evaluate=e._evaluateIsClass:e._value==="getExactClassName"?e.evaluate=e._evaluateGetExactClassName:e._value==="Boolean"?e.evaluate=e._evaluateBooleanConversion:e._value==="Number"?e.evaluate=e._evaluateNumberConversion:e._value==="String"?e.evaluate=e._evaluateStringConversion:l(u4[e._value])&&(e.evaluate=Tht(e._value)):e._type===Rt.BINARY?e._value==="+"?e.evaluate=e._evaluatePlus:e._value==="-"?e.evaluate=e._evaluateMinus:e._value==="*"?e.evaluate=e._evaluateTimes:e._value==="/"?e.evaluate=e._evaluateDivide:e._value==="%"?e.evaluate=e._evaluateMod:e._value==="==="?e.evaluate=e._evaluateEqualsStrict:e._value==="!=="?e.evaluate=e._evaluateNotEqualsStrict:e._value==="<"?e.evaluate=e._evaluateLessThan:e._value==="<="?e.evaluate=e._evaluateLessThanOrEquals:e._value===">"?e.evaluate=e._evaluateGreaterThan:e._value===">="?e.evaluate=e._evaluateGreaterThanOrEquals:e._value==="&&"?e.evaluate=e._evaluateAnd:e._value==="||"?e.evaluate=e._evaluateOr:e._value==="=~"?e.evaluate=e._evaluateRegExpMatch:e._value==="!~"?e.evaluate=e._evaluateRegExpNotMatch:l(f4[e._value])&&(e.evaluate=Cht(e._value)):e._type===Rt.TERNARY?e.evaluate=vht(e._value):e._type===Rt.MEMBER?e._value==="brackets"?e.evaluate=e._evaluateMemberBrackets:e.evaluate=e._evaluateMemberDot:e._type===Rt.ARRAY?e.evaluate=e._evaluateArray:e._type===Rt.VARIABLE?e.evaluate=e._evaluateVariable:e._type===Rt.VARIABLE_IN_STRING?e.evaluate=e._evaluateVariableString:e._type===Rt.LITERAL_COLOR?e.evaluate=e._evaluateLiteralColor:e._type===Rt.LITERAL_VECTOR?e.evaluate=e._evaluateLiteralVector:e._type===Rt.LITERAL_STRING?e.evaluate=e._evaluateLiteralString:e._type===Rt.REGEX?e.evaluate=e._evaluateRegExp:e._type===Rt.BUILTIN_VARIABLE?e._value==="tiles3d_tileset_time"&&(e.evaluate=xht):e.evaluate=e._evaluateLiteral}function xht(e){return l(e)?e.content.tileset.timeSinceLoad:0}function Tht(e){let t=u4[e];return function(n){let i=this._left.evaluate(n);return t(e,i)}}function Cht(e){let t=f4[e];return function(n){let i=this._left.evaluate(n),r=this._right.evaluate(n);return t(e,i,r)}}function vht(e){let t=BZ[e];return function(n){let i=this._left.evaluate(n),r=this._right.evaluate(n),o=this._test.evaluate(n);return t(e,i,r,o)}}function d4(e,t){if(l(e))return e.getPropertyInherited(t)}Nt.prototype._evaluateLiteral=function(){return this._value};Nt.prototype._evaluateLiteralColor=function(e){let t=l4,n=this._left;if(this._value==="color")l(n)?n.length>1?(U.fromCssColorString(n[0].evaluate(e),t),t.alpha=n[1].evaluate(e)):U.fromCssColorString(n[0].evaluate(e),t):U.fromBytes(255,255,255,255,t);else if(this._value==="rgb")U.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;U.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),i,t)}else this._value==="hsl"?U.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),1,t):this._value==="hsla"&&U.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),n[3].evaluate(e),t);return ae.fromColor(t,kn.getCartesian4())};Nt.prototype._evaluateLiteralVector=function(e){let t=kn.getArray(),n=this._value,i=this._left,r=i.length;for(let s=0;s<r;++s){let c=i[s].evaluate(e);if(typeof c=="number")t.push(c);else if(c instanceof k)t.push(c.x,c.y);else if(c instanceof h)t.push(c.x,c.y,c.z);else if(c instanceof ae)t.push(c.x,c.y,c.z,c.w);else throw new oe(`${n} argument must be a vector or number. Argument is ${c}.`)}let o=t.length,a=parseInt(n.charAt(3));if(o===0)throw new oe(`Invalid ${n} constructor. No valid arguments.`);if(o<a&&o>1)throw new oe(`Invalid ${n} constructor. Not enough arguments.`);if(o>a&&r>1)throw new oe(`Invalid ${n} constructor. Too many arguments.`);if(o===1){let s=t[0];t.push(s,s,s)}if(n==="vec2")return k.fromArray(t,0,kn.getCartesian2());if(n==="vec3")return h.fromArray(t,0,kn.getCartesian3());if(n==="vec4")return ae.fromArray(t,0,kn.getCartesian4())};Nt.prototype._evaluateLiteralString=function(){return this._value};Nt.prototype._evaluateVariableString=function(e){let t=this._value,n=e1.exec(t);for(;n!==null;){let i=n[0],r=n[1],o=d4(e,r);l(o)||(o=""),t=t.replace(i,o),e1.lastIndex+=o.length-i.length,n=e1.exec(t)}return t};Nt.prototype._evaluateVariable=function(e){return d4(e,this._value)};function fx(e){return e._value==="feature"}Nt.prototype._evaluateMemberDot=function(e){if(fx(this._left))return d4(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof k||t instanceof h||t instanceof ae){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]};Nt.prototype._evaluateMemberBrackets=function(e){if(fx(this._left))return d4(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof k||t instanceof h||t instanceof ae){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]};Nt.prototype._evaluateArray=function(e){let t=[];for(let n=0;n<this._value.length;n++)t[n]=this._value[n].evaluate(e);return t};Nt.prototype._evaluateNot=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new oe(`Operator "!" requires a boolean argument. Argument is ${t}.`);return!t};Nt.prototype._evaluateNegative=function(e){let t=this._left.evaluate(e);if(t instanceof k)return k.negate(t,kn.getCartesian2());if(t instanceof h)return h.negate(t,kn.getCartesian3());if(t instanceof ae)return ae.negate(t,kn.getCartesian4());if(typeof t=="number")return-t;throw new oe(`Operator "-" requires a vector or number argument. Argument is ${t}.`)};Nt.prototype._evaluatePositive=function(e){let t=this._left.evaluate(e);if(!(t instanceof k||t instanceof h||t instanceof ae||typeof t=="number"))throw new oe(`Operator "+" requires a vector or number argument. Argument is ${t}.`);return t};Nt.prototype._evaluateLessThan=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new oe(`Operator "<" requires number arguments. Arguments are ${t} and ${n}.`);return t<n};Nt.prototype._evaluateLessThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new oe(`Operator "<=" requires number arguments. Arguments are ${t} and ${n}.`);return t<=n};Nt.prototype._evaluateGreaterThan=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new oe(`Operator ">" requires number arguments. Arguments are ${t} and ${n}.`);return t>n};Nt.prototype._evaluateGreaterThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new oe(`Operator ">=" requires number arguments. Arguments are ${t} and ${n}.`);return t>=n};Nt.prototype._evaluateOr=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new oe(`Operator "||" requires boolean arguments. First argument is ${t}.`);if(t)return!0;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new oe(`Operator "||" requires boolean arguments. Second argument is ${n}.`);return t||n};Nt.prototype._evaluateAnd=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new oe(`Operator "&&" requires boolean arguments. First argument is ${t}.`);if(!t)return!1;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new oe(`Operator "&&" requires boolean arguments. Second argument is ${n}.`);return t&&n};Nt.prototype._evaluatePlus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof k&&t instanceof k)return k.add(t,n,kn.getCartesian2());if(n instanceof h&&t instanceof h)return h.add(t,n,kn.getCartesian3());if(n instanceof ae&&t instanceof ae)return ae.add(t,n,kn.getCartesian4());if(typeof t=="string"||typeof n=="string")return t+n;if(typeof t=="number"&&typeof n=="number")return t+n;throw new oe(`Operator "+" requires vector or number arguments of matching types, or at least one string argument. Arguments are ${t} and ${n}.`)};Nt.prototype._evaluateMinus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof k&&t instanceof k)return k.subtract(t,n,kn.getCartesian2());if(n instanceof h&&t instanceof h)return h.subtract(t,n,kn.getCartesian3());if(n instanceof ae&&t instanceof ae)return ae.subtract(t,n,kn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t-n;throw new oe(`Operator "-" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};Nt.prototype._evaluateTimes=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof k&&t instanceof k)return k.multiplyComponents(t,n,kn.getCartesian2());if(n instanceof k&&typeof t=="number")return k.multiplyByScalar(n,t,kn.getCartesian2());if(t instanceof k&&typeof n=="number")return k.multiplyByScalar(t,n,kn.getCartesian2());if(n instanceof h&&t instanceof h)return h.multiplyComponents(t,n,kn.getCartesian3());if(n instanceof h&&typeof t=="number")return h.multiplyByScalar(n,t,kn.getCartesian3());if(t instanceof h&&typeof n=="number")return h.multiplyByScalar(t,n,kn.getCartesian3());if(n instanceof ae&&t instanceof ae)return ae.multiplyComponents(t,n,kn.getCartesian4());if(n instanceof ae&&typeof t=="number")return ae.multiplyByScalar(n,t,kn.getCartesian4());if(t instanceof ae&&typeof n=="number")return ae.multiplyByScalar(t,n,kn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t*n;throw new oe(`Operator "*" requires vector or number arguments. If both arguments are vectors they must be matching types. Arguments are ${t} and ${n}.`)};Nt.prototype._evaluateDivide=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof k&&t instanceof k)return k.divideComponents(t,n,kn.getCartesian2());if(t instanceof k&&typeof n=="number")return k.divideByScalar(t,n,kn.getCartesian2());if(n instanceof h&&t instanceof h)return h.divideComponents(t,n,kn.getCartesian3());if(t instanceof h&&typeof n=="number")return h.divideByScalar(t,n,kn.getCartesian3());if(n instanceof ae&&t instanceof ae)return ae.divideComponents(t,n,kn.getCartesian4());if(t instanceof ae&&typeof n=="number")return ae.divideByScalar(t,n,kn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t/n;throw new oe(`Operator "/" requires vector or number arguments of matching types, or a number as the second argument. Arguments are ${t} and ${n}.`)};Nt.prototype._evaluateMod=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof k&&t instanceof k)return k.fromElements(t.x%n.x,t.y%n.y,kn.getCartesian2());if(n instanceof h&&t instanceof h)return h.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,kn.getCartesian3());if(n instanceof ae&&t instanceof ae)return ae.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,t.w%n.w,kn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t%n;throw new oe(`Operator "%" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};Nt.prototype._evaluateEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof k&&t instanceof k||n instanceof h&&t instanceof h||n instanceof ae&&t instanceof ae?t.equals(n):t===n};Nt.prototype._evaluateNotEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof k&&t instanceof k||n instanceof h&&t instanceof h||n instanceof ae&&t instanceof ae?!t.equals(n):t!==n};Nt.prototype._evaluateConditional=function(e){let t=this._test.evaluate(e);if(typeof t!="boolean")throw new oe(`Conditional argument of conditional expression must be a boolean. Argument is ${t}.`);return t?this._left.evaluate(e):this._right.evaluate(e)};Nt.prototype._evaluateNaN=function(e){return isNaN(this._left.evaluate(e))};Nt.prototype._evaluateIsFinite=function(e){return isFinite(this._left.evaluate(e))};Nt.prototype._evaluateIsExactClass=function(e){return l(e)?e.isExactClass(this._left.evaluate(e)):!1};Nt.prototype._evaluateIsClass=function(e){return l(e)?e.isClass(this._left.evaluate(e)):!1};Nt.prototype._evaluateGetExactClassName=function(e){if(l(e))return e.getExactClassName()};Nt.prototype._evaluateBooleanConversion=function(e){return!!this._left.evaluate(e)};Nt.prototype._evaluateNumberConversion=function(e){return Number(this._left.evaluate(e))};Nt.prototype._evaluateStringConversion=function(e){return String(this._left.evaluate(e))};Nt.prototype._evaluateRegExp=function(e){let t=this._value.evaluate(e),n="";l(this._left)&&(n=this._left.evaluate(e));let i;try{i=new RegExp(t,n)}catch(r){throw new oe(r)}return i};Nt.prototype._evaluateRegExpTest=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new oe(`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)};Nt.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 oe(`Operator "=~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};Nt.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 oe(`Operator "!~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};Nt.prototype._evaluateRegExpExec=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new oe(`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 l(i)?i[1]:null};Nt.prototype._evaluateToString=function(e){let t=this._left.evaluate(e);if(t instanceof RegExp||t instanceof k||t instanceof h||t instanceof ae)return String(t);throw new oe(`Unexpected function call "${this._value}".`)};function jxe(e){let t=e._left,n=t.length;for(let s=0;s<n;++s)if(t[s]._type!==Rt.LITERAL_NUMBER)return;let i=t[0]._value,r=t[1]._value,o=t[2]._value,a=n===4?t[3]._value:1;return U.fromHsl(i,r,o,a,l4)}function Hxe(e){let t=e._left,n=t.length;for(let r=0;r<n;++r)if(t[r]._type!==Rt.LITERAL_NUMBER)return;let i=l4;return i.red=t[0]._value/255,i.green=t[1]._value/255,i.blue=t[2]._value/255,i.alpha=n===4?t[3]._value:1,i}function My(e){return e%1===0?e.toFixed(1):e.toString()}function Eht(e){let t=My(e.red),n=My(e.green),i=My(e.blue);return`vec3(${t}, ${n}, ${i})`}function c4(e){let t=My(e.red),n=My(e.green),i=My(e.blue),r=My(e.alpha);return`vec4(${t}, ${n}, ${i}, ${r})`}function Gxe(e,t,n,i){let r=e.length,o=new Array(r);for(let a=0;a<r;++a)o[a]=e[a].getShaderExpression(t,n,i);return o}function Wxe(e,t){return l(t[e])?t[e]:kh.NULL_SENTINEL}kh.NULL_SENTINEL="czm_infinity";Nt.prototype.getShaderExpression=function(e,t,n){let i,r,o,a,s=this._type,c=this._value;l(this._left)&&(Array.isArray(this._left)?r=Gxe(this._left,e,t,this):r=this._left.getShaderExpression(e,t,this)),l(this._right)&&(o=this._right.getShaderExpression(e,t,this)),l(this._test)&&(a=this._test.getShaderExpression(e,t,this)),Array.isArray(this._value)&&(c=Gxe(this._value,e,t,this));let u,f,d;switch(s){case Rt.VARIABLE:return fx(this)?void 0:Wxe(c,e);case Rt.UNARY:if(c==="Boolean")return`bool(${r})`;if(c==="Number")return`float(${r})`;if(c==="round")return`floor(${r} + 0.5)`;if(l(u4[c]))return`${c}(${r})`;if(c==="isNaN")return`(${r} != ${r})`;if(c==="isFinite")return`(abs(${r}) < czm_infinity)`;if(c==="String"||c==="isExactClass"||c==="isClass"||c==="getExactClassName")throw new oe(`Error generating style shader: "${c}" is not supported.`);return c+r;case Rt.BINARY:return c==="%"?`mod(${r}, ${o})`:c==="==="?`(${r} == ${o})`:c==="!=="?`(${r} != ${o})`:c==="atan2"?`atan(${r}, ${o})`:l(f4[c])?`${c}(${r}, ${o})`:`(${r} ${c} ${o})`;case Rt.TERNARY:if(l(BZ[c]))return`${c}(${r}, ${o}, ${a})`;break;case Rt.CONDITIONAL:return`(${a} ? ${r} : ${o})`;case Rt.MEMBER:return fx(this._left)?Wxe(o,e):o==="r"||o==="x"||o==="0.0"?`${r}[0]`:o==="g"||o==="y"||o==="1.0"?`${r}[1]`:o==="b"||o==="z"||o==="2.0"?`${r}[2]`:o==="a"||o==="w"||o==="3.0"?`${r}[3]`:`${r}[int(${o})]`;case Rt.FUNCTION_CALL:throw new oe(`Error generating style shader: "${c}" is not supported.`);case Rt.ARRAY:if(c.length===4)return`vec4(${c[0]}, ${c[1]}, ${c[2]}, ${c[3]})`;if(c.length===3)return`vec3(${c[0]}, ${c[1]}, ${c[2]})`;if(c.length===2)return`vec2(${c[0]}, ${c[1]})`;throw new oe("Error generating style shader: Invalid array length. Array length should be 2, 3, or 4.");case Rt.REGEX:throw new oe("Error generating style shader: Regular expressions are not supported.");case Rt.VARIABLE_IN_STRING:throw new oe("Error generating style shader: Converting a variable to a string is not supported.");case Rt.LITERAL_NULL:return kh.NULL_SENTINEL;case Rt.LITERAL_BOOLEAN:return c?"true":"false";case Rt.LITERAL_NUMBER:return My(c);case Rt.LITERAL_STRING:if(l(n)&&n._type===Rt.MEMBER&&(c==="r"||c==="g"||c==="b"||c==="a"||c==="x"||c==="y"||c==="z"||c==="w"||fx(n._left)))return c;if(i=U.fromCssColorString(c,l4),l(i))return Eht(i);throw new oe("Error generating style shader: String literals are not supported.");case Rt.LITERAL_COLOR:if(u=r,c==="color"){if(l(u)){if(u.length>1){let p=u[0],g=u[1];return g!=="1.0"&&(t.translucent=!0),`vec4(${p}, ${g})`}}else return"vec4(1.0)";return`vec4(${u[0]}, 1.0)`}else{if(c==="rgb")return i=Hxe(this),l(i)?c4(i):`vec4(${u[0]} / 255.0, ${u[1]} / 255.0, ${u[2]} / 255.0, 1.0)`;if(c==="rgba")return u[3]!=="1.0"&&(t.translucent=!0),i=Hxe(this),l(i)?c4(i):`vec4(${u[0]} / 255.0, ${u[1]} / 255.0, ${u[2]} / 255.0, ${u[3]})`;if(c==="hsl")return i=jxe(this),l(i)?c4(i):`vec4(czm_HSLToRGB(vec3(${u[0]}, ${u[1]}, ${u[2]})), 1.0)`;if(c==="hsla")return i=jxe(this),l(i)?(i.alpha!==1&&(t.translucent=!0),c4(i)):(u[3]!=="1.0"&&(t.translucent=!0),`vec4(czm_HSLToRGB(vec3(${u[0]}, ${u[1]}, ${u[2]})), ${u[3]})`)}break;case Rt.LITERAL_VECTOR:f=r.length,d=`${c}(`;for(let p=0;p<f;++p)d+=r[p],p<f-1&&(d+=", ");return d+=")",d;case Rt.LITERAL_REGEX:throw new oe("Error generating style shader: Regular expressions are not supported.");case Rt.LITERAL_UNDEFINED:return kh.NULL_SENTINEL;case Rt.BUILTIN_VARIABLE:if(c==="tiles3d_tileset_time")return c}};Nt.prototype.getVariables=function(e,t){let n,i,r,o=this._type,a=this._value;if(l(this._left))if(Array.isArray(this._left))for(n=this._left,i=n.length,r=0;r<i;++r)n[r].getVariables(e,this);else this._left.getVariables(e,this);if(l(this._right)&&this._right.getVariables(e,this),l(this._test)&&this._test.getVariables(e,this),Array.isArray(this._value))for(n=this._value,i=n.length,r=0;r<i;++r)n[r].getVariables(e,this);let s;switch(o){case Rt.VARIABLE:fx(this)||e.push(a);break;case Rt.VARIABLE_IN_STRING:for(s=e1.exec(a);s!==null;)e.push(s[1]),s=e1.exec(a);break;case Rt.LITERAL_STRING:l(t)&&t._type===Rt.MEMBER&&fx(t._left)&&e.push(a);break}};var zh=kh;function sg(e){e=e??H.EMPTY_OBJECT,this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._positions=e.positions,this._vertexBatchIds=e.vertexBatchIds,this._indices=e.indices,this._indexCounts=e.indexCounts,this._indexOffsets=e.indexOffsets,this._batchedIndices=e.batchedIndices,this._boundingVolume=e.boundingVolume,this._boundingVolumes=e.boundingVolumes,this._center=e.center??h.ZERO,this._va=void 0,this._sp=void 0,this._spStencil=void 0,this._spPick=void 0,this._uniformMap=void 0,this._vaSwap=void 0,this._rsStencilDepthPass=void 0,this._rsStencilDepthPass3DTiles=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._rsWireframe=void 0,this._commands=[],this._commandsIgnoreShow=[],this._pickCommands=[],this._constantColor=U.clone(U.WHITE),this._highlightColor=this._constantColor,this._batchDirty=!0,this._pickCommandsDirty=!0,this._framesSinceLastRebatch=0,this._updatingAllCommands=!1,this._trianglesLength=this._indices.length/3,this._geometryByteLength=this._indices.byteLength+this._positions.byteLength+this._vertexBatchIds.byteLength,this.debugWireframe=!1,this._debugWireframe=this.debugWireframe,this._wireframeDirty=!1,this.forceRebatch=!1,this.classificationType=e.classificationType??Zn.BOTH,this._vertexShaderSource=e._vertexShaderSource,this._fragmentShaderSource=e._fragmentShaderSource,this._attributeLocations=e._attributeLocations,this._uniformMap=e._uniformMap,this._pickId=e._pickId,this._modelMatrix=e._modelMatrix,this._boundingSphere=e._boundingSphere,this._batchIdLookUp={};let t=this._batchIds.length;for(let n=0;n<t;++n){let i=this._batchIds[n];this._batchIdLookUp[i]=n}}Object.defineProperties(sg.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}}});var Sht={position:0,a_batchId:1};function wht(e,t){if(l(e._va))return;let n=Ze.createVertexBuffer({context:t,typedArray:e._positions,usage:Oe.STATIC_DRAW}),i=Ze.createVertexBuffer({context:t,typedArray:e._vertexBatchIds,usage:Oe.STATIC_DRAW}),r=Ze.createIndexBuffer({context:t,typedArray:e._indices,usage:Oe.DYNAMIC_DRAW,indexDatatype:e._indices.BYTES_PER_ELEMENT===2?Ve.UNSIGNED_SHORT:Ve.UNSIGNED_INT}),o=[{index:0,vertexBuffer:n,componentDatatype:Y.fromTypedArray(e._positions),componentsPerAttribute:3},{index:1,vertexBuffer:i,componentDatatype:Y.fromTypedArray(e._vertexBatchIds),componentsPerAttribute:1}];e._va=new Vn({context:t,attributes:o,indexBuffer:r}),t.webgl2&&(e._vaSwap=new Vn({context:t,attributes:o,indexBuffer:Ze.createIndexBuffer({context:t,sizeInBytes:r.sizeInBytes,usage:Oe.DYNAMIC_DRAW,indexDatatype:r.indexDatatype})})),e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0}function Iht(e,t){if(l(e._sp))return;let n=e._batchTable,i=e._attributeLocations??Sht,r=e._pickId,o=e._vertexShaderSource,a=e._fragmentShaderSource;if(l(o)){e._sp=Zt.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:i}),e._spStencil=e._sp,a=Ge.replaceMain(a,"czm_non_pick_main"),a=`${a}void main()
|
|
{
|
|
czm_non_pick_main();
|
|
out_FragColor = ${r};
|
|
}
|
|
`,e._spPick=Zt.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:i});return}let s=n.getVertexShaderCallback(!1,"a_batchId",void 0)(QD),c=n.getFragmentShaderCallback(!1,void 0,!0)(kb);r=n.getPickId();let u=new Ge({sources:[s]}),f=new Ge({defines:["VECTOR_TILE"],sources:[c]});e._sp=Zt.fromCache({context:t,vertexShaderSource:u,fragmentShaderSource:f,attributeLocations:i}),u=new Ge({sources:[QD]}),f=new Ge({defines:["VECTOR_TILE"],sources:[kb]}),e._spStencil=Zt.fromCache({context:t,vertexShaderSource:u,fragmentShaderSource:f,attributeLocations:i}),c=Ge.replaceMain(c,"czm_non_pick_main"),c=`${c}
|
|
void main()
|
|
{
|
|
czm_non_pick_main();
|
|
out_FragColor = ${r};
|
|
}
|
|
`;let d=new Ge({sources:[s]}),p=new Ge({defines:["VECTOR_TILE"],sources:[c]});e._spPick=Zt.fromCache({context:t,vertexShaderSource:d,fragmentShaderSource:p,attributeLocations:i})}function qxe(e){let t=e?Qn.EQUAL:Qn.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:t,frontOperation:{fail:Pt.KEEP,zFail:Pt.DECREMENT_WRAP,zPass:Pt.KEEP},backFunction:t,backOperation:{fail:Pt.KEEP,zFail:Pt.INCREMENT_WRAP,zPass:Pt.KEEP},reference:qt.CESIUM_3D_TILE_MASK,mask:qt.CESIUM_3D_TILE_MASK},stencilMask:qt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:Ac.LESS_OR_EQUAL},depthMask:!1}}var Pht={stencilTest:{enabled:!0,frontFunction:Qn.NOT_EQUAL,frontOperation:{fail:Pt.ZERO,zFail:Pt.ZERO,zPass:Pt.ZERO},backFunction:Qn.NOT_EQUAL,backOperation:{fail:Pt.ZERO,zFail:Pt.ZERO,zPass:Pt.ZERO},reference:0,mask:qt.CLASSIFICATION_MASK},stencilMask:qt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:en.PRE_MULTIPLIED_ALPHA_BLEND},Dht={stencilTest:{enabled:!0,frontFunction:Qn.NOT_EQUAL,frontOperation:{fail:Pt.ZERO,zFail:Pt.ZERO,zPass:Pt.ZERO},backFunction:Qn.NOT_EQUAL,backOperation:{fail:Pt.ZERO,zFail:Pt.ZERO,zPass:Pt.ZERO},reference:0,mask:qt.CLASSIFICATION_MASK},stencilMask:qt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function Rht(e){l(e._rsStencilDepthPass)||(e._rsStencilDepthPass=je.fromCache(qxe(!1)),e._rsStencilDepthPass3DTiles=je.fromCache(qxe(!0)),e._rsColorPass=je.fromCache(Pht),e._rsPickPass=je.fromCache(Dht))}var dx=new O,Yxe=new h;function Oht(e,t){if(l(e._uniformMap))return;let n={u_modifiedModelViewProjection:function(){let i=t.uniformState.view,r=t.uniformState.projection;return O.clone(i,dx),O.multiplyByPoint(dx,e._center,Yxe),O.setTranslation(dx,Yxe,dx),O.multiply(r,dx,dx),dx},u_highlightColor:function(){return e._highlightColor}};e._uniformMap=e._batchTable.getUniformMapCallback()(n)}function kZ(e,t,n,i,r,o,a){let s=e.constructor.BYTES_PER_ELEMENT,c=o.length;for(let u=0;u<c;++u){let f=o[u],d=a[f],p=i[d],g=r[d],m=new e.constructor(e.buffer,s*p,g);t.set(m,n),i[d]=n,n+=g}return n}function Mht(e,t){let n=e._indices,i=e._indexOffsets,r=e._indexCounts,o=e._batchIdLookUp,a=new n.constructor(n.length),s=t.pop(),c=[s],u=kZ(n,a,0,i,r,s.batchIds,o);for(s.offset=0,s.count=u;t.length>0;){let f=t.pop();if(U.equals(f.color,s.color))u=kZ(n,a,u,i,r,f.batchIds,o),s.batchIds=s.batchIds.concat(f.batchIds),s.count=u-s.offset;else{let d=u;u=kZ(n,a,u,i,r,f.batchIds,o),f.offset=d,f.count=u-d,c.push(f),s=f}}e._va.indexBuffer.copyFromArrayView(a),e._indices=a,e._batchedIndices=c}function zZ(e,t,n,i,r,o,a){let s=e.bytesPerIndex,c=o.length;for(let u=0;u<c;++u){let f=o[u],d=a[f],p=i[d],g=r[d];t.copyFromBuffer(e,p*s,n*s,g*s),i[d]=n,n+=g}return n}function Lht(e,t){let n=e._indexOffsets,i=e._indexCounts,r=e._batchIdLookUp,o=t.pop(),a=[o],s=e._va.indexBuffer,c=e._vaSwap.indexBuffer,u=zZ(s,c,0,n,i,o.batchIds,r);for(o.offset=0,o.count=u;t.length>0;){let d=t.pop();if(U.equals(d.color,o.color))u=zZ(s,c,u,n,i,d.batchIds,r),o.batchIds=o.batchIds.concat(d.batchIds),o.count=u-o.offset;else{let p=u;u=zZ(s,c,u,n,i,d.batchIds,r),d.offset=p,d.count=u-p,a.push(d),o=d}}let f=e._va;e._va=e._vaSwap,e._vaSwap=f,e._batchedIndices=a}function Nht(e,t){return t.color.toRgba()-e.color.toRgba()}function Fht(e,t){if(!e._batchDirty)return!1;let n=e._batchedIndices,i=n.length,r=!1,o={};for(let a=0;a<i;++a){let c=n[a].color.toRgba();if(l(o[c])){r=!0;break}else o[c]=!0}if(!r)return e._batchDirty=!1,!1;if(r&&!e.forceRebatch&&e._framesSinceLastRebatch<120){++e._framesSinceLastRebatch;return}return n.sort(Nht),t.webgl2?Lht(e,n):Mht(e,n),e._framesSinceLastRebatch=0,e._batchDirty=!1,e._pickCommandsDirty=!0,e._wireframeDirty=!0,!0}function Bht(e,t){let n=Fht(e,t),i=e._commands,r=e._batchedIndices,o=r.length,a=o*2;if(l(i)&&!n&&i.length===a)return;i.length=a;let s=e._va,c=e._sp,u=e._modelMatrix??O.IDENTITY,f=e._uniformMap,d=e._boundingVolume;for(let p=0;p<o;++p){let g=r[p].offset,m=r[p].count,y=i[p*2];l(y)||(y=i[p*2]=new nt({owner:e})),y.vertexArray=s,y.modelMatrix=u,y.offset=g,y.count=m,y.renderState=e._rsStencilDepthPass,y.shaderProgram=c,y.uniformMap=f,y.boundingVolume=d,y.cull=!1,y.pass=Pe.TERRAIN_CLASSIFICATION;let A=nt.shallowClone(y,y.derivedCommands.tileset);A.renderState=e._rsStencilDepthPass3DTiles,A.pass=Pe.CESIUM_3D_TILE_CLASSIFICATION,y.derivedCommands.tileset=A;let b=i[p*2+1];l(b)||(b=i[p*2+1]=new nt({owner:e})),b.vertexArray=s,b.modelMatrix=u,b.offset=g,b.count=m,b.renderState=e._rsColorPass,b.shaderProgram=c,b.uniformMap=f,b.boundingVolume=d,b.cull=!1,b.pass=Pe.TERRAIN_CLASSIFICATION;let x=nt.shallowClone(b,b.derivedCommands.tileset);x.pass=Pe.CESIUM_3D_TILE_CLASSIFICATION,b.derivedCommands.tileset=x}e._commandsDirty=!0}function kht(e,t){if(e.classificationType===Zn.TERRAIN||!t.invertClassification||l(e._commandsIgnoreShow)&&!e._commandsDirty)return;let n=e._commands,i=e._commandsIgnoreShow,r=e._spStencil,o=n.length,a=i.length=o/2,s=0;for(let c=0;c<a;++c){let u=i[c]=nt.shallowClone(n[s],i[c]);u.shaderProgram=r,u.pass=Pe.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,s+=2}e._commandsDirty=!1}function zht(e){if(!e._pickCommandsDirty)return;let t=e._indexOffsets.length,n=e._pickCommands;n.length=t*2;let i=e._va,r=e._spStencil,o=e._spPick,a=e._modelMatrix??O.IDENTITY,s=e._uniformMap;for(let c=0;c<t;++c){let u=e._indexOffsets[c],f=e._indexCounts[c],d=l(e._boundingVolumes)?e._boundingVolumes[c]:e.boundingVolume,p=n[c*2];l(p)||(p=n[c*2]=new nt({owner:e,pickOnly:!0})),p.vertexArray=i,p.modelMatrix=a,p.offset=u,p.count=f,p.renderState=e._rsStencilDepthPass,p.shaderProgram=r,p.uniformMap=s,p.boundingVolume=d,p.pass=Pe.TERRAIN_CLASSIFICATION;let g=nt.shallowClone(p,p.derivedCommands.tileset);g.renderState=e._rsStencilDepthPass3DTiles,g.pass=Pe.CESIUM_3D_TILE_CLASSIFICATION,p.derivedCommands.tileset=g;let m=n[c*2+1];l(m)||(m=n[c*2+1]=new nt({owner:e,pickOnly:!0})),m.vertexArray=i,m.modelMatrix=a,m.offset=u,m.count=f,m.renderState=e._rsPickPass,m.shaderProgram=o,m.uniformMap=s,m.boundingVolume=d,m.pass=Pe.TERRAIN_CLASSIFICATION;let y=nt.shallowClone(m,m.derivedCommands.tileset);y.pass=Pe.CESIUM_3D_TILE_CLASSIFICATION,m.derivedCommands.tileset=y}e._pickCommandsDirty=!1}sg.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r];t[o]=new us(e,o)}};sg.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function Uht(e,t){e._updatingAllCommands=!0;let n=e._batchIds,i=n.length,r;for(r=0;r<i;++r){let a=n[r],s=t[a];s.show=!0,s.color=U.WHITE}let o=e._batchedIndices;for(i=o.length,r=0;r<i;++r)o[r].color=U.clone(U.WHITE);e._updatingAllCommands=!1,e._batchDirty=!0}var Vht=new U,jht=U.WHITE,Hht=!0,Ght=/\$/;sg.prototype.applyStyle=function(e,t){if(!l(e)){Uht(this,t);return}let n=e.color,i=n instanceof zh&&!Ght.test(n.expression);this._updatingAllCommands=i;let r=this._batchIds,o=r.length,a;for(a=0;a<o;++a){let s=r[a],c=t[s];c.color=l(e.color)?e.color.evaluateColor(c,Vht):jht,c.show=l(e.show)?e.show.evaluate(c):Hht}if(i){let s=this._batchedIndices;for(o=s.length,a=0;a<o;++a)s[a].color=U.clone(U.WHITE);this._updatingAllCommands=!1,this._batchDirty=!0}};sg.prototype.updateCommands=function(e,t){if(this._updatingAllCommands)return;let n=this._batchIdLookUp,i=n[e];if(!l(i))return;let r=this._indexOffsets,o=this._indexCounts,a=r[i],s=o[i],c=this._batchedIndices,u=c.length,f;for(f=0;f<u;++f){let y=c[f].offset,A=c[f].count;if(a>=y&&a<y+A)break}c.push(new ag({color:U.clone(t),offset:a,count:s,batchIds:[e]}));let d=[],p=[],g=c[f].batchIds,m=g.length;for(let y=0;y<m;++y){let A=g[y];if(A===e)continue;let b=n[A];r[b]<a?d.push(A):p.push(A)}p.length!==0&&c.push(new ag({color:U.clone(c[f].color),offset:a+s,count:c[f].offset+c[f].count-(a+s),batchIds:p})),d.length!==0?(c[f].count=a-c[f].offset,c[f].batchIds=d):c.splice(f,1),this._batchDirty=!0};function Xxe(e,t,n,i){let r=e.classificationType,o=r!==Zn.CESIUM_3D_TILE,a=r!==Zn.TERRAIN,s=t.commandList,c=n.length,u,f;for(f=0;f<c;++f)o&&(u=n[f],u.pass=Pe.TERRAIN_CLASSIFICATION,s.push(u)),a&&(u=n[f].derivedCommands.tileset,u.pass=Pe.CESIUM_3D_TILE_CLASSIFICATION,s.push(u));if(!(!t.invertClassification||!l(i)))for(c=i.length,f=0;f<c;++f)s.push(i[f])}function Wht(e,t){let n=e.commandList,i=t.length;for(let r=0;r<i;r+=2){let o=t[r+1];o.pass=Pe.OPAQUE,n.push(o)}}function qht(e){let t=e.debugWireframe===e._debugWireframe;if(t=t&&!(e.debugWireframe&&e._wireframeDirty),t)return;l(e._rsWireframe)||(e._rsWireframe=je.fromCache({}));let n,i;e.debugWireframe?(n=e._rsWireframe,i=Re.LINES):(n=e._rsColorPass,i=Re.TRIANGLES);let r=e._commands,o=r.length;for(let a=0;a<o;a+=2){let s=r[a+1];s.renderState=n,s.primitiveType=i}e._debugWireframe=e.debugWireframe,e._wireframeDirty=!1}sg.prototype.update=function(e){let t=e.context;wht(this,t),Iht(this,t),Rht(this),Oht(this,t);let n=e.passes;n.render&&(Bht(this,t),kht(this,e),qht(this),this._debugWireframe?Wht(e,this._commands):Xxe(this,e,this._commands,this._commandsIgnoreShow)),n.pick&&(zht(this),Xxe(this,e,this._pickCommands))};sg.prototype.isDestroyed=function(){return!1};sg.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaSwap=this._vaSwap&&this._vaSwap.destroy(),ue(this)};var GE=sg;function ff(e){this._boxes=e.boxes,this._boxBatchIds=e.boxBatchIds,this._cylinders=e.cylinders,this._cylinderBatchIds=e.cylinderBatchIds,this._ellipsoids=e.ellipsoids,this._ellipsoidBatchIds=e.ellipsoidBatchIds,this._spheres=e.spheres,this._sphereBatchIds=e.sphereBatchIds,this._modelMatrix=e.modelMatrix,this._batchTable=e.batchTable,this._boundingVolume=e.boundingVolume,this._center=e.center,l(this._center)||(l(this._boundingVolume)?this._center=h.clone(this._boundingVolume.center):this._center=h.clone(h.ZERO)),this._boundingVolumes=void 0,this._batchedIndices=void 0,this._indices=void 0,this._indexOffsets=void 0,this._indexCounts=void 0,this._positions=void 0,this._vertexBatchIds=void 0,this._batchIds=void 0,this._batchTableColors=void 0,this._packedBuffer=void 0,this._ready=!1,this._promise=void 0,this._error=void 0,this._verticesPromise=void 0,this._primitive=void 0,this.debugWireframe=!1,this.forceRebatch=!1,this.classificationType=Zn.BOTH}Object.defineProperties(ff.prototype,{trianglesLength:{get:function(){return l(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return l(this._primitive)?this._primitive.geometryByteLength:0}},ready:{get:function(){return this._ready}}});ff.packedBoxLength=O.packedLength+h.packedLength;ff.packedCylinderLength=O.packedLength+2;ff.packedEllipsoidLength=O.packedLength+h.packedLength;ff.packedSphereLength=h.packedLength+1;function Yht(e){let t=new Float64Array(O.packedLength+h.packedLength),n=0;return h.pack(e._center,t,n),n+=h.packedLength,O.pack(e._modelMatrix,t,n),t}function Xht(e,t){let n=0,i=t[n++],r=t[n++],o=e._boundingVolumes=new Array(r);for(let c=0;c<r;++c)o[c]=se.unpack(t,n),n+=se.packedLength;let a=t[n++],s=e._batchedIndices=new Array(a);for(let c=0;c<a;++c){let u=U.unpack(t,n);n+=U.packedLength;let f=t[n++],d=t[n++],p=t[n++],g=new Array(p);for(let m=0;m<p;++m)g[m]=t[n++];s[c]=new ag({color:u,offset:f,count:d,batchIds:g})}return i}var Kht=new Yn("createVectorTileGeometries",5),$ht=new U;function Jht(e){if(!l(e._primitive)&&!l(e._verticesPromise)){let t=e._boxes,n=e._boxBatchIds,i=e._cylinders,r=e._cylinderBatchIds,o=e._ellipsoids,a=e._ellipsoidBatchIds,s=e._spheres,c=e._sphereBatchIds,u=e._batchTableColors,f=e._packedBuffer;if(!l(u)){let m=0;l(e._boxes)&&(t=e._boxes=t.slice(),n=e._boxBatchIds=n.slice(),m+=n.length),l(e._cylinders)&&(i=e._cylinders=i.slice(),r=e._cylinderBatchIds=r.slice(),m+=r.length),l(e._ellipsoids)&&(o=e._ellipsoids=o.slice(),a=e._ellipsoidBatchIds=a.slice(),m+=a.length),l(e._spheres)&&(s=e._sphere=s.slice(),c=e._sphereBatchIds=c.slice(),m+=c.length),u=e._batchTableColors=new Uint32Array(m);let y=e._batchTable;for(let A=0;A<m;++A){let b=y.getColor(A,$ht);u[A]=b.toRgba()}f=e._packedBuffer=Yht(e)}let d=[];l(t)&&d.push(t.buffer,n.buffer),l(i)&&d.push(i.buffer,r.buffer),l(o)&&d.push(o.buffer,a.buffer),l(s)&&d.push(s.buffer,c.buffer),d.push(u.buffer,f.buffer);let p={boxes:l(t)?t.buffer:void 0,boxBatchIds:l(t)?n.buffer:void 0,cylinders:l(i)?i.buffer:void 0,cylinderBatchIds:l(i)?r.buffer:void 0,ellipsoids:l(o)?o.buffer:void 0,ellipsoidBatchIds:l(o)?a.buffer:void 0,spheres:l(s)?s.buffer:void 0,sphereBatchIds:l(s)?c.buffer:void 0,batchTableColors:u.buffer,packedBuffer:f.buffer},g=e._verticesPromise=Kht.scheduleTask(p,d);return l(g)?g.then(function(m){if(e.isDestroyed())return;let y=new Float64Array(m.packedBuffer);Xht(e,y)===2?e._indices=new Uint16Array(m.indices):e._indices=new Uint32Array(m.indices),e._indexOffsets=new Uint32Array(m.indexOffsets),e._indexCounts=new Uint32Array(m.indexCounts),e._positions=new Float32Array(m.positions),e._vertexBatchIds=new Uint16Array(m.vertexBatchIds),e._batchIds=new Uint16Array(m.batchIds),Zht(e),e._ready=!0}).catch(m=>{e.isDestroyed()||(e._error=m)}):void 0}}function Zht(e){l(e._primitive)||(e._primitive=new GE({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)}ff.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};ff.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};ff.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};ff.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};ff.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=Jht(this)),l(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)};ff.prototype.isDestroyed=function(){return!1};ff.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};var Ly=ff;var UZ=class{constructor(t,n,i,r,o){this._tileset=t,this._tile=n,this._resource=i,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,tmt(this,r,o)}get featuresLength(){return l(this._batchTable)?this._batchTable.featuresLength:0}get pointsLength(){return 0}get trianglesLength(){return l(this._geometries)?this._geometries.trianglesLength:0}get geometryByteLength(){return l(this._geometries)?this._geometries.geometryByteLength:0}get texturesByteLength(){return 0}get batchTableByteLength(){return l(this._batchTable)?this._batchTable.batchTableByteLength:0}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get batchTable(){return this._batchTable}get group(){return this._group}set group(t){this._group=t}hasProperty(t,n){return this._batchTable.hasProperty(t,n)}getFeature(t){return Kxe(this),this._features[t]}applyDebugSettings(t,n){l(this._geometries)&&this._geometries.applyDebugSettings(t,n)}applyStyle(t){Kxe(this),l(this._geometries)&&this._geometries.applyStyle(t,this._features)}update(t,n){l(this._geometries)&&(this._geometries.classificationType=this._tileset.classificationType,this._geometries.debugWireframe=this._tileset.debugWireframe,this._geometries.update(n)),l(this._batchTable)&&this._geometries.ready&&(this._batchTable.update(t,n),this._ready=!0)}pick(t,n,i){}isDestroyed(){return!1}destroy(){return this._geometries=this._geometries&&this._geometries.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),ue(this)}};function Qht(e){return function(t,n){l(e._geometries)&&e._geometries.updateCommands(t,n)}}function emt(e,t){let n,i,r,o,a,s=e.BOXES_LENGTH??0,c=e.CYLINDERS_LENGTH??0,u=e.ELLIPSOIDS_LENGTH??0,f=e.SPHERES_LENGTH??0;if(s>0&&l(e.BOX_BATCH_IDS)){let m=t.byteOffset+e.BOX_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,m,s)}if(c>0&&l(e.CYLINDER_BATCH_IDS)){let m=t.byteOffset+e.CYLINDER_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,m,c)}if(u>0&&l(e.ELLIPSOID_BATCH_IDS)){let m=t.byteOffset+e.ELLIPSOID_BATCH_IDS.byteOffset;r=new Uint16Array(t.buffer,m,u)}if(f>0&&l(e.SPHERE_BATCH_IDS)){let m=t.byteOffset+e.SPHERE_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,m,f)}let d=l(n)||l(i)||l(r)||l(o),p=s>0&&!l(n)||c>0&&!l(i)||u>0&&!l(r)||f>0&&!l(o);if(d&&p)throw new oe("If one group of batch ids is defined, then all batch ids must be defined");if(!l(n)&&!l(i)&&!l(r)&&!l(o)){let m=0;if(!l(n)&&s>0)for(n=new Uint16Array(s),a=0;a<s;++a)n[a]=m++;if(!l(i)&&c>0)for(i=new Uint16Array(c),a=0;a<c;++a)i[a]=m++;if(!l(r)&&u>0)for(r=new Uint16Array(u),a=0;a<u;++a)r[a]=m++;if(!l(o)&&f>0)for(o=new Uint16Array(f),a=0;a<f;++a)o[a]=m++}return{boxes:n,cylinders:i,ellipsoids:r,spheres:o}}var hx=Uint32Array.BYTES_PER_ELEMENT;function tmt(e,t,n){n=n??0;let i=new Uint8Array(t),r=new DataView(t);n+=hx;let o=r.getUint32(n,!0);if(o!==1)throw new oe(`Only Geometry tile version 1 is supported. Version ${o} is not.`);n+=hx;let a=r.getUint32(n,!0);if(n+=hx,a===0){e._ready=!0;return}let s=r.getUint32(n,!0);if(n+=hx,s===0)throw new oe("Feature table must have a byte length greater than zero");let c=r.getUint32(n,!0);n+=hx;let u=r.getUint32(n,!0);n+=hx;let f=r.getUint32(n,!0);n+=hx;let d=wo(i,n,s);n+=s;let p=new Uint8Array(t,n,c);n+=c;let g,m;u>0&&(g=wo(i,n,u),n+=u,f>0&&(m=new Uint8Array(t,n,f),m=new Uint8Array(m)));let y=d.BOXES_LENGTH??0,A=d.CYLINDERS_LENGTH??0,b=d.ELLIPSOIDS_LENGTH??0,x=d.SPHERES_LENGTH??0,T=y+A+b+x,C=new pp(e,T,g,m,Qht(e));if(e._batchTable=C,T===0)return;let E=e.tile.computedTransform,w;l(d.RTC_CENTER)&&(w=h.unpack(d.RTC_CENTER),O.multiplyByPoint(E,w,w));let D=emt(d,p);if(y>0||A>0||b>0||x>0){let R,M,N,_;if(y>0){let v=p.byteOffset+d.BOXES.byteOffset;R=new Float32Array(p.buffer,v,Ly.packedBoxLength*y)}if(A>0){let v=p.byteOffset+d.CYLINDERS.byteOffset;M=new Float32Array(p.buffer,v,Ly.packedCylinderLength*A)}if(b>0){let v=p.byteOffset+d.ELLIPSOIDS.byteOffset;N=new Float32Array(p.buffer,v,Ly.packedEllipsoidLength*b)}if(x>0){let v=p.byteOffset+d.SPHERES.byteOffset;_=new Float32Array(p.buffer,v,Ly.packedSphereLength*x)}return e._geometries=new Ly({boxes:R,boxBatchIds:D.boxes,cylinders:M,cylinderBatchIds:D.cylinders,ellipsoids:N,ellipsoidBatchIds:D.ellipsoids,spheres:_,sphereBatchIds:D.spheres,center:w,modelMatrix:E,batchTable:C,boundingVolume:e.tile.boundingVolume.boundingVolume}),e}return Promise.resolve(e)}function Kxe(e){let t=e.featuresLength;if(!l(e._features)&&t>0){let n=new Array(t);l(e._geometries)&&e._geometries.createFeatures(e,n),e._features=n}}var h4=UZ;var Ny={};Ny.parseAllBoundingVolumeSemantics=function(e,t){return{boundingVolume:Ny.parseBoundingVolumeSemantic(e,t),minimumHeight:Ny._parseMinimumHeight(e,t),maximumHeight:Ny._parseMaximumHeight(e,t)}};Ny.parseBoundingVolumeSemantic=function(e,t){let n=`${e}_BOUNDING_BOX`,i=t.getPropertyBySemantic(n);if(l(i))return{box:i};let r=`${e}_BOUNDING_REGION`,o=t.getPropertyBySemantic(r);if(l(o))return{region:o};let a=`${e}_BOUNDING_SPHERE`,s=t.getPropertyBySemantic(a);if(l(s))return{sphere:s}};Ny._parseMinimumHeight=function(e,t){let n=`${e}_MINIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};Ny._parseMaximumHeight=function(e,t){let n=`${e}_MAXIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};var mx=Ny;var WE=class e{constructor(t,n,i){let r=n.implicitTileset,o=n.implicitCoordinates;this._implicitTileset=r,this._implicitCoordinates=o,this._implicitSubtree=void 0,this._tileset=t,this._tile=n,this._resource=i,this._metadata=void 0,this.featurePropertiesDirty=!1,this._group=void 0;let a=o.getTemplateValues(),s=r.subtreeUriTemplate.getDerivedResource({templateValues:a});this._url=s.getUrlComponent(!0),this._ready=!1}get featuresLength(){return 0}get pointsLength(){return 0}get trianglesLength(){return 0}get geometryByteLength(){return 0}get texturesByteLength(){return 0}get batchTableByteLength(){return 0}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._url}get metadata(){}set metadata(t){}get batchTable(){}get group(){return this._group}set group(t){this._group=t}static async fromSubtreeJson(t,n,i,r,o,a){a=a??0;let s;l(o)&&(s=new Uint8Array(o,a));let c=n.implicitTileset,u=n.implicitCoordinates,f=await y_.fromSubtreeJson(i,r,s,c,u),d=new e(t,n,i);return d._implicitSubtree=f,nmt(d,f),d._ready=!0,d}hasProperty(t,n){return!1}getFeature(t){}applyDebugSettings(t,n){}applyStyle(t){}update(t,n){}pick(t,n,i){}isDestroyed(){return!1}destroy(){return this._implicitSubtree=this._implicitSubtree&&this._implicitSubtree.destroy(),ue(this)}};function nmt(e,t){let n=e._tile,i=e._implicitCoordinates.childIndex,r=rmt(e,t,n,i),o=e._tileset.statistics;n.children.push(r.rootTile),o.numberOfTilesTotal++;let a=imt(e,t,r.bottomRow);for(let s=0;s<a.length;s++){let c=a[s],u=c.tile,f=hmt(e,u,c.childIndex);u.children.push(f),o.numberOfTilesTotal++}}function imt(e,t,n){let i=[],r=e._implicitTileset.branchingFactor;for(let o=0;o<n.length;o++){let a=n[o];if(l(a))for(let s=0;s<r;s++){let c=o*r+s;t.childSubtreeIsAvailableAtIndex(c)&&i.push({tile:a,childIndex:s})}}return i}function rmt(e,t,n,i){let a=$xe(e,t,n,i,0,!0),s=e._tileset.statistics,c=[a],u=[],f=e._implicitTileset;for(let d=1;d<f.subtreeLevels;d++){let p=t.getLevelOffset(d),g=f.branchingFactor*c.length;for(let m=0;m<g;m++){let y=p+m;if(!t.tileIsAvailableAtIndex(y)){u.push(void 0);continue}let A=t.getParentMortonIndex(m),b=c[A],x=m%f.branchingFactor,T=$xe(e,t,b,x,y);b.children.push(T),s.numberOfTilesTotal++,u.push(T)}c=u,u=[]}return{rootTile:a,bottomRow:c}}function Jxe(e,t,n){let i=ch.TILE_GEOMETRIC_ERROR;return l(e)&&e.hasPropertyBySemantic(i)?e.getPropertyBySemantic(i):t.geometricError/Math.pow(2,n.level)}function $xe(e,t,n,i,r,o){let a=e._implicitTileset,s;o??!1?s=n.implicitCoordinates:s=n.implicitCoordinates.getChildCoordinates(i);let c,u;l(t.tilePropertyTableJson)&&(c=t.getTileMetadataView(s),u=mx.parseAllBoundingVolumeSemantics("TILE",c));let d=t.contentPropertyTableJsons.length,p=!1;for(let E=0;E<d;E++)if(t.contentIsAvailableAtCoordinates(s,E)){p=!0;break}let g=smt(a,s,i,o,n,u),m=[];for(let E=0;E<a.contentCount;E++){if(!t.contentIsAvailableAtIndex(r,E))continue;let R={uri:a.contentUriTemplates[E].getDerivedResource({templateValues:s.getTemplateValues()}).url},M;if(t.contentPropertyTableJsons.length>0){let _=t.getContentMetadataView(s,E);M=mx.parseAllBoundingVolumeSemantics("CONTENT",_)}let N=cmt(g,M);l(N)&&(R.boundingVolume=N),m.push(Ot(R,a.contentHeaders[E]))}let y=Jxe(c,a,s),A={boundingVolume:g,geometricError:y,refine:a.refine,contents:m},b=!0,x=Xe(a.tileHeader,b);delete x.boundingVolume,delete x.transform,delete x.metadata;let T=Ot(A,x,b),C=nTe(e,a.baseResource,T,n);return C.implicitCoordinates=s,C.implicitSubtree=t,C.metadata=c,C.hasImplicitContentMetadata=p,C}function m4(e,t){return l(e)&&l(t)&&(l(t.minimumHeight)||l(t.maximumHeight))&&(Qi(e,"3DTILES_bounding_volume_S2")||l(e.region))}function jZ(e,t){l(t)&&(Qi(e,"3DTILES_bounding_volume_S2")?amt(e.extensions["3DTILES_bounding_volume_S2"],t.minimumHeight,t.maximumHeight):l(e.region)&&omt(e.region,t.minimumHeight,t.maximumHeight))}function omt(e,t,n){l(t)&&(e[4]=t),l(n)&&(e[5]=n)}function amt(e,t,n){l(t)&&(e.minimumHeight=t),l(n)&&(e.maximumHeight=n)}function smt(e,t,n,i,r,o){let a;return!l(o)||!l(o.boundingVolume)||!m4(o.boundingVolume,o)&&m4(e.boundingVolume,o)?a=Zxe(e,t,n,i??!1,r):a=o.boundingVolume,jZ(a,o),a}function cmt(e,t){let n;return l(t)&&(n=t.boundingVolume),m4(n,t)?jZ(n,t):m4(e,t)&&(n=Xe(e,!0),jZ(n,t)),n}function Zxe(e,t,n,i,r){let o=e.boundingVolume;return Qi(o,"3DTILES_bounding_volume_S2")?Qxe(i,r,n,t.level,t.x,t.y,t.z):l(o.region)?{region:tTe(o.region,t.level,t.x,t.y,t.z)}:{box:eTe(o.box,t.level,t.x,t.y,t.z)}}function Qxe(e,t,n,i,r,o,a){let s=t._boundingVolume;if(e)return{extensions:{"3DTILES_bounding_volume_S2":{token:q_.getTokenFromId(s.s2Cell._cellId),minimumHeight:s.minimumHeight,maximumHeight:s.maximumHeight}}};let c=Number(t._boundingVolume.s2Cell._cellId>>BigInt(61)),u=c%2===0?cP.encode2D(i,r,o):cP.encode2D(i,o,r),f=q_.fromFacePositionLevel(c,BigInt(u),i),d,p;if(l(a)){let g=(s.maximumHeight+s.minimumHeight)/2;d=n<4?s.minimumHeight:g,p=n<4?g:s.maximumHeight}else d=s.minimumHeight,p=s.maximumHeight;return{extensions:{"3DTILES_bounding_volume_S2":{token:q_.getTokenFromId(f._cellId),minimumHeight:d,maximumHeight:p}}}}var lmt=new h,umt=new h,VZ=new h,fmt=new $;function eTe(e,t,n,i,r){if(t===0)return e;let o=h.unpack(e,0,umt),a=$.unpack(e,3,fmt),s=Math.pow(2,-t),c=-1+(2*n+1)*s,u=-1+(2*i+1)*s,f=0,d=h.fromElements(s,s,1,lmt);l(r)&&(f=-1+(2*r+1)*s,d.z=s);let p=h.fromElements(c,u,f,VZ);p=$.multiplyByVector(a,p,VZ),p=h.add(p,o,VZ);let g=$.clone(a);g=$.multiplyByScale(g,d,g);let m=new Array(12);return h.pack(p,m),$.pack(g,m,3),m}var dmt=new ie;function tTe(e,t,n,i,r){if(t===0)return e.slice();let o=ie.unpack(e,0,dmt),a=e[4],s=e[5],c=Math.pow(2,-t),u=c*o.width,f=I.negativePiToPi(o.west+n*u),d=I.negativePiToPi(f+u),p=c*o.height,g=I.negativePiToPi(o.south+i*p),m=I.negativePiToPi(g+p),y=a,A=s;if(l(r)){let b=c*(s-a);y+=r*b,A=y+b}return[f,g,d,m,y,A]}function hmt(e,t,n){let i=e._implicitTileset,r=t.implicitCoordinates.getChildCoordinates(n),o=Zxe(i,r,n,!1,t),a=Jxe(void 0,i,r),s=i.subtreeUriTemplate.getDerivedResource({templateValues:r.getTemplateValues()}).url,c={boundingVolume:o,geometricError:a,refine:i.refine,contents:[{uri:s}]},u=nTe(e,i.baseResource,c,t);return u.implicitTileset=i,u.implicitCoordinates=r,u}function nTe(e,t,n,i){let r=e._tile.constructor;return new r(e._tileset,t,n,i)}WE._deriveBoundingBox=eTe;WE._deriveBoundingRegion=tTe;WE._deriveBoundingVolumeS2=Qxe;var t1=WE;var HZ=class e{constructor(t,n,i){this._tileset=t,this._tile=n,this._resource=i,this._model=void 0,this._metadata=void 0,this._group=void 0,this._ready=!1}get featuresLength(){let t=this._model,n=t.featureTables,i=t.featureTableId;return l(n)&&l(n[i])?n[i].featuresLength:0}get pointsLength(){return this._model.statistics.pointsLength}get trianglesLength(){return this._model.statistics.trianglesLength}get geometryByteLength(){return this._model.statistics.geometryByteLength}get texturesByteLength(){return this._model.statistics.texturesByteLength}get batchTableByteLength(){let t=this._model.statistics;return t.propertyTablesByteLength+t.batchTexturesByteLength}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get batchTable(){let t=this._model,n=t.featureTables,i=t.featureTableId;if(l(n)&&l(n[i]))return n[i]}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get group(){return this._group}set group(t){this._group=t}getTextureIds(){return this._model.statistics.getTextureIds()}getTextureByteLengthById(t){return this._model.statistics.getTextureByteLengthById(t)}getExtension(t){return this._model.getExtension(t)}getFeature(t){let n=this._model,i=n.featureTableId;return n.featureTables[i].getFeature(t)}hasProperty(t,n){let i=this._model,r=i.featureTableId;return l(r)?i.featureTables[r].hasProperty(t,n):!1}applyDebugSettings(t,n){n=t?n:U.WHITE,this.featuresLength===0?this._model.color=n:l(this.batchTable)&&this.batchTable.setAllColor(n)}applyStyle(t){this._model.style=t}update(t,n){let i=this._model,r=this._tile;i.colorBlendAmount=t.colorBlendAmount,i.colorBlendMode=t.colorBlendMode,i.modelMatrix=r.computedTransform,i.customShader=t.customShader,i.featureIdLabel=t.featureIdLabel,i.instanceFeatureIdLabel=t.instanceFeatureIdLabel,i.lightColor=t.lightColor,i.imageBasedLighting=t.imageBasedLighting,i.backFaceCulling=t.backFaceCulling,i.shadows=t.shadows,i.showCreditsOnScreen=t.showCreditsOnScreen,i.splitDirection=t.splitDirection,i.debugWireframe=t.debugWireframe,i.edgeDisplayMode=t.edgeDisplayMode,i.showOutline=t.showOutline,i.outlineColor=t.outlineColor,i.pointCloudShading=t.pointCloudShading;let o=t.clippingPlanes;i.referenceMatrix=t.clippingPlanesOriginMatrix,l(o)&&r.clippingPlanesDirty&&(i._clippingPlanes=o.enabled&&r._isClipped?o:void 0);let a=t.environmentMapManager;i.environmentMapManager!==o&&(i._environmentMapManager=a),l(o)&&l(i._clippingPlanes)&&i._clippingPlanes!==o&&(i._clippingPlanes=o,i._clippingPlanesState=0);let s=t.clippingPolygons;l(s)&&r.clippingPolygonsDirty&&(i._clippingPolygons=s.enabled&&r._isClippedByPolygon?s:void 0),l(s)&&l(i._clippingPolygons)&&i._clippingPolygons!==s&&(i._clippingPolygons=s,i._clippingPolygonsState=0),i.update(n),!this._ready&&i.ready&&(i.activeAnimations.addAll({loop:cf.REPEAT}),this._ready=!0)}isDestroyed(){return!1}destroy(){return this._model=this._model&&this._model.destroy(),ue(this)}static async fromGltf(t,n,i,r){let o=new e(t,n,i),s=n1(t,n,o,{gltf:r,basePath:i}),c=t.vectorClassificationOnly?void 0:t.classificationType;s.classificationType=c;let u=await Ed.fromGltfAsync(s);return o._model=u,o}static async fromB3dm(t,n,i,r,o){let a=new e(t,n,i),c=n1(t,n,a,{arrayBuffer:r,byteOffset:o,resource:i}),u=t.vectorClassificationOnly?void 0:t.classificationType;c.classificationType=u;let f=await Ed.fromB3dm(c);return a._model=f,a}static async fromI3dm(t,n,i,r,o){let a=new e(t,n,i),c=n1(t,n,a,{arrayBuffer:r,byteOffset:o,resource:i}),u=await Ed.fromI3dm(c);return a._model=u,a}static async fromPnts(t,n,i,r,o){let a=new e(t,n,i),c=n1(t,n,a,{arrayBuffer:r,byteOffset:o,resource:i}),u=await Ed.fromPnts(c);return a._model=u,a}static async fromGeoJson(t,n,i,r){let o=new e(t,n,i),s=n1(t,n,o,{geoJson:r,resource:i}),c=await Ed.fromGeoJson(s);return o._model=c,o}pick(t,n,i){if(!l(this._model)||!this._ready)return;let r=n.verticalExaggeration,o=n.verticalExaggerationRelativeHeight;return this._model.pick(t,n,r,o,te.WGS84,i)}};function n1(e,t,n,i){let r={cull:!1,releaseGltfJson:!0,opaquePass:Pe.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 Ot(i,r)}var Sd=HZ;var GZ=class e{constructor(t,n,i){this._tileset=t,this._tile=n,this._resource=i,this.featurePropertiesDirty=!1,this._metadata=void 0,this._group=void 0,this._ready=!1}get featuresLength(){return 0}get pointsLength(){return 0}get trianglesLength(){return 0}get geometryByteLength(){return 0}get texturesByteLength(){return 0}get batchTableByteLength(){return 0}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get batchTable(){}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get group(){return this._group}set group(t){this._group=t}static fromJson(t,n,i,r){let o=new e(t,n,i);return o._tileset.loadTileset(o._resource,r,o._tile),o._ready=!0,o}hasProperty(t,n){return!1}getFeature(t){}applyDebugSettings(t,n){}applyStyle(t){}update(t,n){}pick(t,n,i){}isDestroyed(){return!1}destroy(){return ue(this)}},p4=GZ;function mmt(e,t,n,i,r){return function(){let o=document.createElement("canvas"),a=r+2*i;o.height=o.width=a;let s=o.getContext("2d");return s.clearRect(0,0,a,a),i!==0&&(s.beginPath(),s.arc(a/2,a/2,a/2,0,2*Math.PI,!0),s.closePath(),s.fillStyle=n,s.fill(),e<1&&(s.save(),s.globalCompositeOperation="destination-out",s.beginPath(),s.arc(a/2,a/2,r/2,0,2*Math.PI,!0),s.closePath(),s.fillStyle="black",s.fill(),s.restore())),s.beginPath(),s.arc(a/2,a/2,r/2,0,2*Math.PI,!0),s.closePath(),s.fillStyle=t,s.fill(),o}}var qE=mmt;var pmt=new de,Uh=class{constructor(t,n,i,r,o){this._content=t,this._billboard=i,this._label=r,this._polyline=o,this._batchId=n,this._billboardImage=void 0,this._billboardColor=void 0,this._billboardOutlineColor=void 0,this._billboardOutlineWidth=void 0,this._billboardSize=void 0,this._pointSize=void 0,this._color=void 0,this._pointSize=void 0,this._pointOutlineColor=void 0,this._pointOutlineWidth=void 0,this._heightOffset=void 0,this._pickIds=new Array(3),YE(this)}get show(){return this._label.show}set show(t){this._label.show=t,this._billboard.show=t,this._polyline.show=t}get color(){return this._color}set color(t){this._color=U.clone(t,this._color),YE(this)}get pointSize(){return this._pointSize}set pointSize(t){this._pointSize=t,YE(this)}get pointOutlineColor(){return this._pointOutlineColor}set pointOutlineColor(t){this._pointOutlineColor=U.clone(t,this._pointOutlineColor),YE(this)}get pointOutlineWidth(){return this._pointOutlineWidth}set pointOutlineWidth(t){this._pointOutlineWidth=t,YE(this)}get labelColor(){return this._label.fillColor}set labelColor(t){this._label.fillColor=t,this._polyline.show=this._label.show&&t.alpha>0}get labelOutlineColor(){return this._label.outlineColor}set labelOutlineColor(t){this._label.outlineColor=t}get labelOutlineWidth(){return this._label.outlineWidth}set labelOutlineWidth(t){this._label.outlineWidth=t}get font(){return this._label.font}set font(t){this._label.font=t}get labelStyle(){return this._label.style}set labelStyle(t){this._label.style=t}get labelText(){return this._label.text}set labelText(t){l(t)||(t=""),this._label.text=t}get backgroundColor(){return this._label.backgroundColor}set backgroundColor(t){this._label.backgroundColor=t}get backgroundPadding(){return this._label.backgroundPadding}set backgroundPadding(t){this._label.backgroundPadding=t}get backgroundEnabled(){return this._label.showBackground}set backgroundEnabled(t){this._label.showBackground=t}get scaleByDistance(){return this._label.scaleByDistance}set scaleByDistance(t){this._label.scaleByDistance=t,this._billboard.scaleByDistance=t}get translucencyByDistance(){return this._label.translucencyByDistance}set translucencyByDistance(t){this._label.translucencyByDistance=t,this._billboard.translucencyByDistance=t}get distanceDisplayCondition(){return this._label.distanceDisplayCondition}set distanceDisplayCondition(t){this._label.distanceDisplayCondition=t,this._polyline.distanceDisplayCondition=t,this._billboard.distanceDisplayCondition=t}get heightOffset(){return this._heightOffset}set heightOffset(t){let n=this._heightOffset??0,i=this._content.tileset.ellipsoid,r=i.cartesianToCartographic(this._billboard.position,pmt);r.height=r.height-n+t;let o=i.cartographicToCartesian(r);this._billboard.position=o,this._label.position=this._billboard.position,this._polyline.positions=[this._polyline.positions[0],o],this._heightOffset=t}get anchorLineEnabled(){return this._polyline.show}set anchorLineEnabled(t){this._polyline.show=t}get anchorLineColor(){return this._polyline.material.uniforms.color}set anchorLineColor(t){this._polyline.material.uniforms.color=U.clone(t,this._polyline.material.uniforms.color)}get image(){return this._billboardImage}set image(t){let n=this._billboardImage!==t;this._billboardImage=t,n&&YE(this)}get disableDepthTestDistance(){return this._label.disableDepthTestDistance}set disableDepthTestDistance(t){this._label.disableDepthTestDistance=t,this._billboard.disableDepthTestDistance=t}get horizontalOrigin(){return this._billboard.horizontalOrigin}set horizontalOrigin(t){this._billboard.horizontalOrigin=t}get verticalOrigin(){return this._billboard.verticalOrigin}set verticalOrigin(t){this._billboard.verticalOrigin=t}get labelHorizontalOrigin(){return this._label.horizontalOrigin}set labelHorizontalOrigin(t){this._label.horizontalOrigin=t}get labelVerticalOrigin(){return this._label.verticalOrigin}set labelVerticalOrigin(t){this._label.verticalOrigin=t}get content(){return this._content}get tileset(){return this._content.tileset}get primitive(){return this._content.tileset}get pickIds(){let t=this._pickIds;return t[0]=this._billboard.pickId,t[1]=this._label.pickId,t[2]=this._polyline.pickId,t}hasProperty(t){return this._content.batchTable.hasProperty(this._batchId,t)}getPropertyIds(t){return this._content.batchTable.getPropertyIds(this._batchId,t)}getProperty(t){return this._content.batchTable.getProperty(this._batchId,t)}getPropertyInherited(t){return us.getPropertyInherited(this._content,this._batchId,t)}setProperty(t,n){this._content.batchTable.setProperty(this._batchId,t,n),this._content.featurePropertiesDirty=!0}isExactClass(t){return this._content.batchTable.isExactClass(this._batchId,t)}isClass(t){return this._content.batchTable.isClass(this._batchId,t)}getExactClassName(){return this._content.batchTable.getExactClassName(this._batchId)}};at(Uh,"defaultColor",U.WHITE),at(Uh,"defaultPointOutlineColor",U.BLACK),at(Uh,"defaultPointOutlineWidth",0),at(Uh,"defaultPointSize",8);function YE(e){let t=e._billboard;if(l(e._billboardImage)&&e._billboardImage!==t.image){t.image=e._billboardImage;return}if(l(e._billboardImage))return;let n=e._color??Uh.defaultColor,i=e._pointOutlineColor??Uh.defaultPointOutlineColor,r=e._pointOutlineWidth??Uh.defaultPointOutlineWidth,o=e._pointSize??Uh.defaultPointSize,a=e._billboardColor,s=e._billboardOutlineColor,c=e._billboardOutlineWidth,u=e._billboardSize;if(U.equals(n,a)&&U.equals(i,s)&&r===c&&o===u)return;e._billboardColor=U.clone(n,e._billboardColor),e._billboardOutlineColor=U.clone(i,e._billboardOutlineColor),e._billboardOutlineWidth=r,e._billboardSize=o;let f=n.alpha,d=n.toCssColorString(),p=i.toCssColorString(),g=JSON.stringify([d,o,p,r]);t.setImage(g,qE(f,d,p,r,o))}var Fy=Uh;var g4=`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;
|
|
}
|
|
`;function df(e,t){e=e??H.EMPTY_OBJECT,this._show=e.show??!0,this._width=e.width??1,this._loop=e.loop??!1,this._distanceDisplayCondition=e.distanceDisplayCondition,this._material=e.material,l(this._material)||(this._material=ir.fromType(ir.ColorType,{color:new U(1,1,1,1)}));let n=e.positions;l(n)||(n=[]),this._positions=n,this._actualPositions=Pr(n,h.equalsEpsilon),this._loop&&this._actualPositions.length>2&&(this._actualPositions===this._positions&&(this._actualPositions=n.slice()),this._actualPositions.push(h.clone(this._actualPositions[0]))),this._length=this._actualPositions.length,this._id=e.id;let i;l(t)&&(i=O.clone(t.modelMatrix)),this._modelMatrix=i,this._segments=nr.wrapLongitude(this._actualPositions,i),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(rTe),this._polylineCollection=t,this._dirty=!1,this._pickId=void 0,this._boundingVolume=se.fromPoints(this._actualPositions),this._boundingVolumeWC=se.transform(this._boundingVolume,this._modelMatrix),this._boundingVolume2D=new se}var iTe=df.POSITION_INDEX=0,gmt=df.SHOW_INDEX=1,_mt=df.WIDTH_INDEX=2,ymt=df.MATERIAL_INDEX=3,i1=df.POSITION_SIZE_INDEX=4,Amt=df.DISTANCE_DISPLAY_CONDITION=5,rTe=df.NUMBER_OF_PROPERTIES=6;function cg(e,t){++e._propertiesChanged[t];let n=e._polylineCollection;l(n)&&(n._updatePolyline(e,t),e._dirty=!0)}Object.defineProperties(df.prototype,{show:{get:function(){return this._show},set:function(e){e!==this._show&&(this._show=e,cg(this,gmt))}},positions:{get:function(){return this._positions},set:function(e){let t=Pr(e,h.equalsEpsilon);this._loop&&t.length>2&&(t===e&&(t=e.slice()),t.push(h.clone(t[0]))),(this._actualPositions.length!==t.length||this._actualPositions.length!==this._length)&&cg(this,i1),this._positions=e,this._actualPositions=t,this._length=t.length,this._boundingVolume=se.fromPoints(this._actualPositions,this._boundingVolume),this._boundingVolumeWC=se.transform(this._boundingVolume,this._modelMatrix,this._boundingVolumeWC),cg(this,iTe),this.update()}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,cg(this,ymt))}},width:{get:function(){return this._width},set:function(e){let t=this._width;e!==t&&(this._width=e,cg(this,_mt))}},loop:{get:function(){return this._loop},set:function(e){if(e!==this._loop){let t=this._actualPositions;e?t.length>2&&!h.equals(t[0],t[t.length-1])&&(t.length===this._positions.length&&(this._actualPositions=t=this._positions.slice()),t.push(h.clone(t[0]))):t.length>2&&h.equals(t[0],t[t.length-1])&&(t.length-1===this._positions.length?this._actualPositions=this._positions:t.pop()),this._loop=e,cg(this,i1)}}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},isDestroyed:{get:function(){return!l(this._polylineCollection)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){jt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=jt.clone(e,this._distanceDisplayCondition),cg(this,Amt))}}});df.prototype.update=function(){let e=O.IDENTITY;l(this._polylineCollection)&&(e=this._polylineCollection.modelMatrix);let t=this._segments.positions.length,n=this._segments.lengths,i=this._propertiesChanged[iTe]>0||this._propertiesChanged[i1]>0;if((!O.equals(e,this._modelMatrix)||i)&&(this._segments=nr.wrapLongitude(this._actualPositions,e),this._boundingVolumeWC=se.transform(this._boundingVolume,e,this._boundingVolumeWC)),this._modelMatrix=O.clone(e,this._modelMatrix),this._segments.positions.length!==t)cg(this,i1);else{let r=n.length;for(let o=0;o<r;++o)if(n[o]!==this._segments.lengths[o]){cg(this,i1);break}}};df.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._polylineCollection,id:this._id})),this._pickId};df.prototype._clean=function(){this._dirty=!1;let e=this._propertiesChanged;for(let t=0;t<rTe-1;++t)e[t]=0};df.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._material=this._material&&this._material.destroy(),this._polylineCollection=void 0};var Vh=df;var bmt=Vh.SHOW_INDEX,xmt=Vh.WIDTH_INDEX,qZ=Vh.POSITION_INDEX,Tmt=Vh.MATERIAL_INDEX,oTe=Vh.POSITION_SIZE_INDEX,Cmt=Vh.DISTANCE_DISPLAY_CONDITION,dTe=Vh.NUMBER_OF_PROPERTIES,Iu={texCoordExpandAndBatchIndex:0,position3DHigh:1,position3DLow:2,position2DHigh:3,position2DLow:4,prevPosition3DHigh:5,prevPosition3DLow:6,prevPosition2DHigh:7,prevPosition2DLow:8,nextPosition3DHigh:9,nextPosition3DLow:10,nextPosition2DHigh:11,nextPosition2DLow:12};function jh(e){e=e??H.EMPTY_OBJECT,this.show=e.show??!0,this.modelMatrix=O.clone(e.modelMatrix??O.IDENTITY),this._modelMatrix=O.clone(O.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this._opaqueRS=void 0,this._translucentRS=void 0,this._colorCommands=[],this._polylinesUpdated=!1,this._polylinesRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(dTe),this._polylines=[],this._polylineBuckets={},this._positionBufferUsage={bufferUsage:Oe.STATIC_DRAW,frameCount:0},this._mode=void 0,this._polylinesToUpdate=[],this._vertexArrays=[],this._positionBuffer=void 0,this._texCoordExpandAndBatchIndexBuffer=void 0,this._batchTable=void 0,this._createBatchTable=!1,this._useHighlightColor=!1,this._highlightColor=U.clone(U.WHITE);let t=this;this._uniformMap={u_highlightColor:function(){return t._highlightColor}}}Object.defineProperties(jh.prototype,{length:{get:function(){return YZ(this),this._polylines.length}}});jh.prototype.add=function(e){let t=new Vh(e,this);return t._index=this._polylines.length,this._polylines.push(t),this._createVertexArray=!0,this._createBatchTable=!0,t};jh.prototype.remove=function(e){if(this.contains(e)){if(this._polylinesRemoved=!0,this._createVertexArray=!0,this._createBatchTable=!0,l(e._bucket)){let t=e._bucket;t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy()}return e._destroy(),!0}return!1};jh.prototype.removeAll=function(){XZ(this),_Te(this),this._polylineBuckets={},this._polylinesRemoved=!1,this._polylines.length=0,this._polylinesToUpdate.length=0,this._createVertexArray=!0};jh.prototype.contains=function(e){return l(e)&&e._polylineCollection===this};jh.prototype.get=function(e){return YZ(this),this._polylines[e]};function vmt(e,t){l(e._batchTable)&&e._batchTable.destroy();let n=[{functionName:"batchTable_getWidthAndShow",componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:2},{functionName:"batchTable_getPickColor",componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0},{functionName:"batchTable_getCenterHigh",componentDatatype:Y.FLOAT,componentsPerAttribute:3},{functionName:"batchTable_getCenterLowAndRadius",componentDatatype:Y.FLOAT,componentsPerAttribute:4},{functionName:"batchTable_getDistanceDisplayCondition",componentDatatype:Y.FLOAT,componentsPerAttribute:2}];e._batchTable=new Iv(t,n,e._polylines.length)}var hTe=new Sn,mTe=new ae,pTe=new k;jh.prototype.update=function(e){if(YZ(this),this._polylines.length===0||!this.show)return;Dmt(this,e);let t=e.context,n=e.mapProjection,i,r=this._propertiesChanged;if(this._createBatchTable){if(Ft.maximumVertexTextureImageUnits===0)throw new oe("Vertex texture fetch support is required to render polylines. The maximum number of vertex texture image units must be greater than zero.");vmt(this,t),this._createBatchTable=!1}if(this._createVertexArray||Smt(this))cTe(this,t,n);else if(this._polylinesUpdated){let c=this._polylinesToUpdate;if(this._mode!==re.SCENE3D){let u=c.length;for(let f=0;f<u;++f)i=c[f],i.update()}if(r[oTe]||r[Tmt])cTe(this,t,n);else{let u=c.length,f=this._polylineBuckets;for(let d=0;d<u;++d){i=c[d],r=i._propertiesChanged;let p=i._bucket,g=0;for(let m in f)if(f.hasOwnProperty(m)){if(f[m]===p){r[qZ]&&p.writeUpdate(g,i,this._positionBuffer,n);break}g+=f[m].lengthOfPositions}if((r[bmt]||r[xmt])&&this._batchTable.setBatchedAttribute(i._index,0,new k(i._width,i._show)),this._batchTable.attributes.length>2){if(r[qZ]||r[oTe]){let m=e.mode===re.SCENE2D?i._boundingVolume2D:i._boundingVolumeWC,y=Sn.fromCartesian(m.center,hTe),A=ae.fromElements(y.low.x,y.low.y,y.low.z,m.radius,mTe);this._batchTable.setBatchedAttribute(i._index,2,y.high),this._batchTable.setBatchedAttribute(i._index,3,A)}if(r[Cmt]){let m=pTe;m.x=0,m.y=Number.MAX_VALUE;let y=i.distanceDisplayCondition;l(y)&&(m.x=y.near,m.y=y.far),this._batchTable.setBatchedAttribute(i._index,4,m)}}i._clean()}}c.length=0,this._polylinesUpdated=!1}r=this._propertiesChanged;for(let c=0;c<dTe;++c)r[c]=0;let o=O.IDENTITY;e.mode===re.SCENE3D&&(o=this.modelMatrix);let a=e.passes,s=e.morphTime!==0;if((!l(this._opaqueRS)||this._opaqueRS.depthTest.enabled!==s)&&(this._opaqueRS=je.fromCache({depthMask:s,depthTest:{enabled:s}})),(!l(this._translucentRS)||this._translucentRS.depthTest.enabled!==s)&&(this._translucentRS=je.fromCache({blending:en.ALPHA_BLEND,depthMask:!s,depthTest:{enabled:s}})),this._batchTable.update(e),a.render||a.pick){let c=this._colorCommands;Emt(this,e,c,o)}};var r1=new se,aTe=new se;function Emt(e,t,n,i){let r=t.context,o=t.commandList,a=n.length,s=0,c=!0,u=e._vertexArrays,f=e.debugShowBoundingVolume,p=e._batchTable.getUniformMapCallback(),g=u.length;for(let m=0;m<g;++m){let y=u[m],A=y.buckets,b=A.length;for(let x=0;x<b;++x){let T=A[x],C=T.offset,E=T.bucket.shaderProgram,w=T.bucket.polylines,D=w.length,R,M,N=0,_,v;for(let S=0;S<D;++S){let P=w[S],L=Imt(P._material);if(L!==R){if(l(R)&&N>0){let j=M.isTranslucent();s>=a?(_=new nt({owner:e}),n.push(_)):_=n[s],++s,v=Ot(p(M._uniforms),e._uniformMap),_.boundingVolume=se.clone(r1,_.boundingVolume),_.modelMatrix=i,_.shaderProgram=E,_.vertexArray=y.va,_.renderState=j?e._translucentRS:e._opaqueRS,_.pass=j?Pe.TRANSLUCENT:Pe.OPAQUE,_.debugShowBoundingVolume=f,_.pickId="v_pickColor",_.uniformMap=v,_.count=N,_.offset=C,C+=N,N=0,c=!0,o.push(_)}M=P._material,M.update(r),R=L}let F=P._locatorBuckets,V=F.length;for(let j=0;j<V;++j){let B=F[j];B.locator===T&&(N+=B.count)}let z;t.mode===re.SCENE3D?z=P._boundingVolumeWC:t.mode===re.COLUMBUS_VIEW?z=P._boundingVolume2D:t.mode===re.SCENE2D?l(P._boundingVolume2D)&&(z=se.clone(P._boundingVolume2D,aTe),z.center.x=0):l(P._boundingVolumeWC)&&l(P._boundingVolume2D)&&(z=se.union(P._boundingVolumeWC,P._boundingVolume2D,aTe)),c?(c=!1,se.clone(z,r1)):se.union(z,r1,r1)}l(R)&&N>0&&(s>=a?(_=new nt({owner:e}),n.push(_)):_=n[s],++s,v=Ot(p(M._uniforms),e._uniformMap),_.boundingVolume=se.clone(r1,_.boundingVolume),_.modelMatrix=i,_.shaderProgram=E,_.vertexArray=y.va,_.renderState=M.isTranslucent()?e._translucentRS:e._opaqueRS,_.pass=M.isTranslucent()?Pe.TRANSLUCENT:Pe.OPAQUE,_.debugShowBoundingVolume=f,_.pickId="v_pickColor",_.uniformMap=v,_.count=N,_.offset=C,c=!0,o.push(_)),R=void 0}}n.length=s}jh.prototype.isDestroyed=function(){return!1};jh.prototype.destroy=function(){return gTe(this),XZ(this),_Te(this),this._batchTable=this._batchTable&&this._batchTable.destroy(),ue(this)};function Smt(e){let t=!1,n=e._propertiesChanged,i=e._positionBufferUsage;return n[qZ]?(i.bufferUsage!==Oe.STREAM_DRAW&&(t=!0,i.bufferUsage=Oe.STREAM_DRAW),i.frameCount=100):i.bufferUsage!==Oe.STATIC_DRAW&&(i.frameCount===0?(t=!0,i.bufferUsage=Oe.STATIC_DRAW):i.frameCount--),t}var sTe=[0,0,0];function cTe(e,t,n){e._createVertexArray=!1,XZ(e),gTe(e),Pmt(e);let i=[[]],r,o=e._batchTable,a=e._useHighlightColor,s=[0],c=0,u=[[]],f=0,d=e._polylineBuckets,p,g;for(p in d)d.hasOwnProperty(p)&&(g=d[p],g.updateShader(t,o,a),f+=g.lengthOfPositions);if(f>0){let m=e._mode,y=new Float32Array(6*f*3),A=new Float32Array(f*4),b,x=0,T=0,C=0;for(p in d)if(d.hasOwnProperty(p)){g=d[p],g.write(y,A,x,T,C,o,t,n),m===re.MORPHING&&(l(b)||(b=new Float32Array(6*f*3)),g.writeForMorph(b,x));let v=g.lengthOfPositions;x+=6*v*3,T+=v*4,C+=v*4,c=g.updateIndices(i,s,u,c)}let E=e._positionBufferUsage.bufferUsage,w=Oe.STATIC_DRAW;e._positionBuffer=Ze.createVertexBuffer({context:t,typedArray:y,usage:E});let D;l(b)&&(D=Ze.createVertexBuffer({context:t,typedArray:b,usage:E})),e._texCoordExpandAndBatchIndexBuffer=Ze.createVertexBuffer({context:t,typedArray:A,usage:w});let R=3*Float32Array.BYTES_PER_ELEMENT,M=4*Float32Array.BYTES_PER_ELEMENT,N=0,_=i.length;for(let v=0;v<_;++v)if(r=i[v],r.length>0){let S=new Uint16Array(r),P=Ze.createIndexBuffer({context:t,typedArray:S,usage:Oe.STATIC_DRAW,indexDatatype:Ve.UNSIGNED_SHORT});N+=s[v];let L=6*(v*(R*I.SIXTY_FOUR_KILOBYTES)-N*R),F=R+L,V=R+F,z=R+V,j=R+z,B=R+j,G=v*(M*I.SIXTY_FOUR_KILOBYTES)-N*M,W=[{index:Iu.position3DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:L,strideInBytes:6*R},{index:Iu.position3DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:F,strideInBytes:6*R},{index:Iu.position2DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:L,strideInBytes:6*R},{index:Iu.position2DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:F,strideInBytes:6*R},{index:Iu.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:V,strideInBytes:6*R},{index:Iu.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:z,strideInBytes:6*R},{index:Iu.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:V,strideInBytes:6*R},{index:Iu.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:z,strideInBytes:6*R},{index:Iu.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:j,strideInBytes:6*R},{index:Iu.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:B,strideInBytes:6*R},{index:Iu.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:j,strideInBytes:6*R},{index:Iu.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:B,strideInBytes:6*R},{index:Iu.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:Y.FLOAT,vertexBuffer:e._texCoordExpandAndBatchIndexBuffer,offsetInBytes:G}],Q,q,J,Z;m===re.SCENE3D?(q=e._positionBuffer,Q="vertexBuffer",J=sTe,Z="value"):m===re.SCENE2D||m===re.COLUMBUS_VIEW?(q=sTe,Q="value",J=e._positionBuffer,Z="vertexBuffer"):(q=D,Q="vertexBuffer",J=e._positionBuffer,Z="vertexBuffer"),W[0][Q]=q,W[1][Q]=q,W[2][Z]=J,W[3][Z]=J,W[4][Q]=q,W[5][Q]=q,W[6][Z]=J,W[7][Z]=J,W[8][Q]=q,W[9][Q]=q,W[10][Z]=J,W[11][Z]=J;let ce=new Vn({context:t,attributes:W,indexBuffer:P});e._vertexArrays.push({va:ce,buckets:u[v]})}}}function wmt(e,t){return t instanceof Et?t.id:t}var _4=[];function Imt(e){let t=ir._uniformList[e.type],n=t.length;_4.length=2*n;let i=0;for(let r=0;r<n;++r){let o=t[r];_4[i]=o,_4[i+1]=e._uniforms[o](),i+=2}return`${e.type}:${JSON.stringify(_4,wmt)}`}function Pmt(e){let t=e._mode,n=e._modelMatrix,i=e._polylineBuckets={},r=e._polylines,o=r.length;for(let a=0;a<o;++a){let s=r[a];if(s._actualPositions.length>1){s.update();let c=s.material,u=i[c.type];l(u)||(u=i[c.type]=new vp(c,t,n)),u.addPolyline(s)}}}function Dmt(e,t){let n=t.mode;(e._mode!==n||!O.equals(e._modelMatrix,e.modelMatrix))&&(e._mode=n,e._modelMatrix=O.clone(e.modelMatrix),e._createVertexArray=!0)}function YZ(e){if(e._polylinesRemoved){e._polylinesRemoved=!1;let t=[],n=[],i=0,r,o=e._polylines.length;for(let a=0;a<o;++a)r=e._polylines[a],r.isDestroyed||(r._index=i++,n.push(r),t.push(r));e._polylines=t,e._polylinesToUpdate=n}}function XZ(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)if(!t[i].isDestroyed){let r=t[i]._bucket;l(r)&&(r.shaderProgram=r.shaderProgram&&r.shaderProgram.destroy())}}function gTe(e){let t=e._vertexArrays.length;for(let n=0;n<t;++n)e._vertexArrays[n].va.destroy();e._vertexArrays.length=0}jh.prototype._updatePolyline=function(e,t){this._polylinesUpdated=!0,e._dirty||this._polylinesToUpdate.push(e),++this._propertiesChanged[t]};function _Te(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)t[i].isDestroyed||t[i]._destroy()}function WZ(e,t,n){this.count=e,this.offset=t,this.bucket=n}function vp(e,t,n){this.polylines=[],this.lengthOfPositions=0,this.material=e,this.shaderProgram=void 0,this.mode=t,this.modelMatrix=n}vp.prototype.addPolyline=function(e){this.polylines.push(e),e._actualLength=this.getPolylinePositionsLength(e),this.lengthOfPositions+=e._actualLength,e._bucket=this};vp.prototype.updateShader=function(e,t,n){if(l(this.shaderProgram))return;let i=["DISTANCE_DISPLAY_CONDITION"];n&&i.push("VECTOR_TILE"),this.material.shaderSource.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&i.push("POLYLINE_DASH"),i.push("CLIP_POLYLINE");let r=new Ge({defines:i,sources:[`in vec4 v_pickColor;
|
|
`,this.material.shaderSource,wv]}),o=t.getVertexShaderCallback()(g4),a=new Ge({defines:i,sources:[cu,o]});this.shaderProgram=Zt.fromCache({context:e,vertexShaderSource:a,fragmentShaderSource:r,attributeLocations:Iu})};function yTe(e){return h.dot(h.UNIT_X,e._boundingVolume.center)<0||e._boundingVolume.intersectPlane(tn.ORIGIN_ZX_PLANE)===Xt.INTERSECTING}vp.prototype.getPolylinePositionsLength=function(e){let t;if(this.mode===re.SCENE3D||!yTe(e))return t=e._actualPositions.length,t*4-4;let n=0,i=e._segments.lengths;t=i.length;for(let r=0;r<t;++r)n+=i[r]*4-4;return n};var ds=new h,wd=new h,Id=new h,y4=new h,Rmt=new ae,Omt=new k;vp.prototype.write=function(e,t,n,i,r,o,a,s){let c=this.mode,u=s.ellipsoid.maximumRadius*I.PI,f=this.polylines,d=f.length;for(let p=0;p<d;++p){let g=f[p],m=g.width,y=g.show&&m>0,A=g._index,b=this.getSegments(g,s),x=b.positions,T=b.lengths,C=x.length,E=g.getPickId(a).color,w=0,D=0,R;for(let V=0;V<C;++V){V===0?g._loop?R=x[C-2]:(R=y4,h.subtract(x[0],x[1],R),h.add(x[0],R,R)):R=x[V-1],h.clone(R,wd),h.clone(x[V],ds),V===C-1?g._loop?R=x[1]:(R=y4,h.subtract(x[C-1],x[C-2],R),h.add(x[C-1],R,R)):R=x[V+1],h.clone(R,Id);let z=T[w];V===D+z&&(D+=z,++w);let j=V-D===0,B=V===D+T[w]-1;c===re.SCENE2D&&(wd.z=0,ds.z=0,Id.z=0),(c===re.SCENE2D||c===re.MORPHING)&&(j||B)&&u-Math.abs(ds.x)<1&&((ds.x<0&&wd.x>0||ds.x>0&&wd.x<0)&&h.clone(ds,wd),(ds.x<0&&Id.x>0||ds.x>0&&Id.x<0)&&h.clone(ds,Id));let G=j?2:0,W=B?2:4;for(let Q=G;Q<W;++Q){Sn.writeElements(ds,e,n),Sn.writeElements(wd,e,n+6),Sn.writeElements(Id,e,n+12);let q=Q-2<0?-1:1;t[r]=V/(C-1),t[r+1]=2*(Q%2)-1,t[r+2]=q,t[r+3]=A,n+=18,r+=4}}let M=Rmt;M.x=U.floatToByte(E.red),M.y=U.floatToByte(E.green),M.z=U.floatToByte(E.blue),M.w=U.floatToByte(E.alpha);let N=Omt;N.x=m,N.y=y?1:0;let _=c===re.SCENE2D?g._boundingVolume2D:g._boundingVolumeWC,v=Sn.fromCartesian(_.center,hTe),S=v.high,P=ae.fromElements(v.low.x,v.low.y,v.low.z,_.radius,mTe),L=pTe;L.x=0,L.y=Number.MAX_VALUE;let F=g.distanceDisplayCondition;l(F)&&(L.x=F.near,L.y=F.far),o.setBatchedAttribute(A,0,N),o.setBatchedAttribute(A,1,M),o.attributes.length>2&&(o.setBatchedAttribute(A,2,S),o.setBatchedAttribute(A,3,P),o.setBatchedAttribute(A,4,L))}};var Mmt=new h,Lmt=new h,Nmt=new h,lTe=new h;vp.prototype.writeForMorph=function(e,t){let n=this.modelMatrix,i=this.polylines,r=i.length;for(let o=0;o<r;++o){let a=i[o],s=a._segments.positions,c=a._segments.lengths,u=s.length,f=0,d=0;for(let p=0;p<u;++p){let g;p===0?a._loop?g=s[u-2]:(g=lTe,h.subtract(s[0],s[1],g),h.add(s[0],g,g)):g=s[p-1],g=O.multiplyByPoint(n,g,Lmt);let m=O.multiplyByPoint(n,s[p],Mmt),y;p===u-1?a._loop?y=s[1]:(y=lTe,h.subtract(s[u-1],s[u-2],y),h.add(s[u-1],y,y)):y=s[p+1],y=O.multiplyByPoint(n,y,Nmt);let A=c[f];p===d+A&&(d+=A,++f);let b=p-d===0,x=p===d+c[f]-1,T=b?2:0,C=x?2:4;for(let E=T;E<C;++E)Sn.writeElements(m,e,t),Sn.writeElements(g,e,t+6),Sn.writeElements(y,e,t+12),t+=18}}};var Fmt=new Array(1);vp.prototype.updateIndices=function(e,t,n,i){let r=n.length-1,o=new WZ(0,i,this);n[r].push(o);let a=0,s=e[e.length-1],c=0;s.length>0&&(c=s[s.length-1]+1);let u=this.polylines,f=u.length;for(let d=0;d<f;++d){let p=u[d];p._locatorBuckets=[];let g;if(this.mode===re.SCENE3D){g=Fmt;let y=p._actualPositions.length;if(y>0)g[0]=y;else continue}else g=p._segments.lengths;let m=g.length;if(m>0){let y=0;for(let A=0;A<m;++A){let b=g[A]-1;for(let x=0;x<b;++x)c+4>I.SIXTY_FOUR_KILOBYTES&&(p._locatorBuckets.push({locator:o,count:y}),y=0,t.push(4),s=[],e.push(s),c=0,o.count=a,a=0,i=0,o=new WZ(0,0,this),n[++r]=[o]),s.push(c,c+2,c+1),s.push(c+1,c+2,c+3),y+=6,a+=6,i+=6,c+=4}p._locatorBuckets.push({locator:o,count:y}),c+4>I.SIXTY_FOUR_KILOBYTES&&(t.push(0),s=[],e.push(s),c=0,o.count=a,i=0,a=0,o=new WZ(0,0,this),n[++r]=[o])}p._clean()}return o.count=a,i};vp.prototype.getPolylineStartIndex=function(e){let t=this.polylines,n=0,i=t.length;for(let r=0;r<i;++r){let o=t[r];if(o===e)break;n+=o._actualLength}return n};var XE={positions:void 0,lengths:void 0},uTe=new Array(1),Bmt=new h,kmt=new de;vp.prototype.getSegments=function(e,t){let n=e._actualPositions;if(this.mode===re.SCENE3D)return uTe[0]=n.length,XE.positions=n,XE.lengths=uTe,XE;yTe(e)&&(n=e._segments.positions);let i=t.ellipsoid,r=[],o=this.modelMatrix,a=n.length,s,c=Bmt;for(let u=0;u<a;++u)s=n[u],c=O.multiplyByPoint(o,s,c),r.push(t.project(i.cartesianToCartographic(c,kmt)));if(r.length>0){e._boundingVolume2D=se.fromPoints(r,e._boundingVolume2D);let u=e._boundingVolume2D.center;e._boundingVolume2D.center=new h(u.z,u.x,u.y)}return XE.positions=r,XE.lengths=e._segments.lengths,XE};var fTe;vp.prototype.writeUpdate=function(e,t,n,i){let r=this.mode,o=i.ellipsoid.maximumRadius*I.PI,a=t._actualLength;if(a){e+=this.getPolylineStartIndex(t);let s=fTe,c=6*a*3;!l(s)||s.length<c?s=fTe=new Float32Array(c):s.length>c&&(s=new Float32Array(s.buffer,0,c));let u=this.getSegments(t,i),f=u.positions,d=u.lengths,p=0,g=0,m=0,y;a=f.length;for(let A=0;A<a;++A){A===0?t._loop?y=f[a-2]:(y=y4,h.subtract(f[0],f[1],y),h.add(f[0],y,y)):y=f[A-1],h.clone(y,wd),h.clone(f[A],ds),A===a-1?t._loop?y=f[1]:(y=y4,h.subtract(f[a-1],f[a-2],y),h.add(f[a-1],y,y)):y=f[A+1],h.clone(y,Id);let b=d[g];A===m+b&&(m+=b,++g);let x=A-m===0,T=A===m+d[g]-1;r===re.SCENE2D&&(wd.z=0,ds.z=0,Id.z=0),(r===re.SCENE2D||r===re.MORPHING)&&(x||T)&&o-Math.abs(ds.x)<1&&((ds.x<0&&wd.x>0||ds.x>0&&wd.x<0)&&h.clone(ds,wd),(ds.x<0&&Id.x>0||ds.x>0&&Id.x<0)&&h.clone(ds,Id));let C=x?2:0,E=T?2:4;for(let w=C;w<E;++w)Sn.writeElements(ds,s,p),Sn.writeElements(wd,s,p+6),Sn.writeElements(Id,s,p+12),p+=18}n.copyFromArrayView(s,18*Float32Array.BYTES_PER_ELEMENT*e)}};var Ep=jh;function By(e){this._positions=e.positions,this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._rectangle=e.rectangle,this._minHeight=e.minimumHeight,this._maxHeight=e.maximumHeight,this._heightReference=e.heightReference,this._billboardCollection=new md({batchTable:e.batchTable,scene:e.scene}),this._labelCollection=new Y0({batchTable:e.batchTable,scene:e.scene}),this._polylineCollection=new Ep,this._polylineCollection._useHighlightColor=!0,this._packedBuffer=void 0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(By.prototype,{ready:{get:function(){return this._ready}},pointsLength:{get:function(){return this._billboardCollection.length}},texturesByteLength:{get:function(){let e=this._billboardCollection.sizeInBytes,t=this._labelCollection.sizeInBytes;return e+t}}});function zmt(e,t){let n=e._rectangle,i=e._minHeight,r=e._maxHeight,o=2+ie.packedLength+te.packedLength,a=new Float64Array(o),s=0;return a[s++]=i,a[s++]=r,ie.pack(n,a,s),s+=ie.packedLength,te.pack(t,a,s),a}var Umt=new Yn("createVectorTilePoints",5),Vmt=new h;function jmt(e,t){let n=e._positions,i=e._packedBuffer;l(i)||(n=e._positions=n.slice(),e._batchIds=e._batchIds.slice(),i=e._packedBuffer=zmt(e,t));let r=[n.buffer,i.buffer],o={positions:n.buffer,packedBuffer:i.buffer},a=Umt.scheduleTask(o,r);if(l(a))return a.then(s=>{if(e.isDestroyed())return;e._positions=new Float64Array(s.positions);let c=e._billboardCollection,u=e._labelCollection,f=e._polylineCollection;n=e._positions;let d=e._batchIds,p=n.length/3,g=e._heightReference??it.NONE;for(let m=0;m<p;++m){let y=d[m],A=h.unpack(n,m*3,Vmt),b=c.add();b.position=A,b._batchIndex=y,b.heightReference=g;let x=u.add();x.text=" ",x.position=A,x._batchIndex=y,x.heightReference=g;let T=f.add();T.positions=[h.clone(A),h.clone(A)]}e._positions=void 0,e._packedBuffer=void 0,e._ready=!0}).catch(s=>{e.isDestroyed()||(e._error=s)})}By.prototype.createFeatures=function(e,t){let n=this._billboardCollection,i=this._labelCollection,r=this._polylineCollection,o=this._batchIds,a=o.length;for(let s=0;s<a;++s){let c=o[s],u=n.get(s),f=i.get(s),d=r.get(s);t[c]=new Fy(e,c,u,f,d)}};By.prototype.applyDebugSettings=function(e,t){e?(U.clone(t,this._billboardCollection._highlightColor),U.clone(t,this._labelCollection._highlightColor),U.clone(t,this._polylineCollection._highlightColor)):(U.clone(U.WHITE,this._billboardCollection._highlightColor),U.clone(U.WHITE,this._labelCollection._highlightColor),U.clone(U.WHITE,this._polylineCollection._highlightColor))};function Hmt(e,t){let n=e._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],a=t[o];a.show=!0,a.pointSize=Fy.defaultPointSize,a.color=Fy.defaultColor,a.pointOutlineColor=Fy.defaultPointOutlineColor,a.pointOutlineWidth=Fy.defaultPointOutlineWidth,a.labelColor=U.WHITE,a.labelOutlineColor=U.WHITE,a.labelOutlineWidth=1,a.font="30px sans-serif",a.labelStyle=bo.FILL,a.labelText=void 0,a.backgroundColor=new U(.165,.165,.165,.8),a.backgroundPadding=new k(7,5),a.backgroundEnabled=!1,a.scaleByDistance=void 0,a.translucencyByDistance=void 0,a.distanceDisplayCondition=void 0,a.heightOffset=0,a.anchorLineEnabled=!1,a.anchorLineColor=U.WHITE,a.image=void 0,a.disableDepthTestDistance=0,a.horizontalOrigin=ji.CENTER,a.verticalOrigin=Wn.CENTER,a.labelHorizontalOrigin=ji.RIGHT,a.labelVerticalOrigin=Wn.BASELINE}}var Gmt=new U,Wmt=new U,qmt=new U,Ymt=new U,Xmt=new U,Kmt=new U,o1=new Wt,a1=new Wt,KZ=new jt;By.prototype.applyStyle=function(e,t){if(!l(e)){Hmt(this,t);return}let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],a=t[o];if(l(e.show)&&(a.show=e.show.evaluate(a)),l(e.pointSize)&&(a.pointSize=e.pointSize.evaluate(a)),l(e.color)&&(a.color=e.color.evaluateColor(a,Gmt)),l(e.pointOutlineColor)&&(a.pointOutlineColor=e.pointOutlineColor.evaluateColor(a,Wmt)),l(e.pointOutlineWidth)&&(a.pointOutlineWidth=e.pointOutlineWidth.evaluate(a)),l(e.labelColor)&&(a.labelColor=e.labelColor.evaluateColor(a,qmt)),l(e.labelOutlineColor)&&(a.labelOutlineColor=e.labelOutlineColor.evaluateColor(a,Ymt)),l(e.labelOutlineWidth)&&(a.labelOutlineWidth=e.labelOutlineWidth.evaluate(a)),l(e.font)&&(a.font=e.font.evaluate(a)),l(e.labelStyle)&&(a.labelStyle=e.labelStyle.evaluate(a)),l(e.labelText)?a.labelText=e.labelText.evaluate(a):a.labelText=void 0,l(e.backgroundColor)&&(a.backgroundColor=e.backgroundColor.evaluateColor(a,Xmt)),l(e.backgroundPadding)&&(a.backgroundPadding=e.backgroundPadding.evaluate(a)),l(e.backgroundEnabled)&&(a.backgroundEnabled=e.backgroundEnabled.evaluate(a)),l(e.scaleByDistance)){let s=e.scaleByDistance.evaluate(a);l(s)?(o1.near=s.x,o1.nearValue=s.y,o1.far=s.z,o1.farValue=s.w,a.scaleByDistance=o1):a.scaleByDistance=void 0}else a.scaleByDistance=void 0;if(l(e.translucencyByDistance)){let s=e.translucencyByDistance.evaluate(a);l(s)?(a1.near=s.x,a1.nearValue=s.y,a1.far=s.z,a1.farValue=s.w,a.translucencyByDistance=a1):a.translucencyByDistance=void 0}else a.translucencyByDistance=void 0;if(l(e.distanceDisplayCondition)){let s=e.distanceDisplayCondition.evaluate(a);l(s)?(KZ.near=s.x,KZ.far=s.y,a.distanceDisplayCondition=KZ):a.distanceDisplayCondition=void 0}else a.distanceDisplayCondition=void 0;l(e.heightOffset)&&(a.heightOffset=e.heightOffset.evaluate(a)),l(e.anchorLineEnabled)&&(a.anchorLineEnabled=e.anchorLineEnabled.evaluate(a)),l(e.anchorLineColor)&&(a.anchorLineColor=e.anchorLineColor.evaluateColor(a,Kmt)),l(e.image)?a.image=e.image.evaluate(a):a.image=void 0,l(e.disableDepthTestDistance)&&(a.disableDepthTestDistance=e.disableDepthTestDistance.evaluate(a)),l(e.horizontalOrigin)&&(a.horizontalOrigin=e.horizontalOrigin.evaluate(a)),l(e.verticalOrigin)&&(a.verticalOrigin=e.verticalOrigin.evaluate(a)),l(e.labelHorizontalOrigin)&&(a.labelHorizontalOrigin=e.labelHorizontalOrigin.evaluate(a)),l(e.labelVerticalOrigin)&&(a.labelVerticalOrigin=e.labelVerticalOrigin.evaluate(a))}};By.prototype.update=function(e){if(!this._ready&&(l(this._promise)||(this._promise=jmt(this,e.mapProjection.ellipsoid)),l(this._error))){let t=this._error;throw this._error=void 0,t}this._polylineCollection.update(e),this._billboardCollection.update(e),this._labelCollection.update(e)};By.prototype.isDestroyed=function(){return!1};By.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._polylineCollection=this._polylineCollection&&this._polylineCollection.destroy(),ue(this)};var A4=By;function lg(e){this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._positions=e.positions,this._counts=e.counts,this._indices=e.indices,this._indexCounts=e.indexCounts,this._indexOffsets=void 0,this._batchTableColors=void 0,this._packedBuffer=void 0,this._batchedPositions=void 0,this._transferrableBatchIds=void 0,this._vertexBatchIds=void 0,this._ellipsoid=e.ellipsoid??te.WGS84,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._polygonMinimumHeights=e.polygonMinimumHeights,this._polygonMaximumHeights=e.polygonMaximumHeights,this._center=e.center??h.ZERO,this._rectangle=e.rectangle,this._center=void 0,this._boundingVolume=e.boundingVolume,this._boundingVolumes=void 0,this._batchedIndices=void 0,this._ready=!1,this._promise=void 0,this._error=void 0,this._primitive=void 0,this.debugWireframe=!1,this.forceRebatch=!1,this.classificationType=Zn.BOTH}Object.defineProperties(lg.prototype,{trianglesLength:{get:function(){return l(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return l(this._primitive)?this._primitive.geometryByteLength:0}},ready:{get:function(){return this._ready}}});function $mt(e){let t=new Float64Array(3+h.packedLength+te.packedLength+ie.packedLength),n=0;return t[n++]=e._indices.BYTES_PER_ELEMENT,t[n++]=e._minimumHeight,t[n++]=e._maximumHeight,h.pack(e._center,t,n),n+=h.packedLength,te.pack(e._ellipsoid,t,n),n+=te.packedLength,ie.pack(e._rectangle,t,n),t}function Jmt(e,t){let n=1,i=t[n++],r=e._boundingVolumes=new Array(i);for(let s=0;s<i;++s)r[s]=Jt.unpack(t,n),n+=Jt.packedLength;let o=t[n++],a=e._batchedIndices=new Array(o);for(let s=0;s<o;++s){let c=U.unpack(t,n);n+=U.packedLength;let u=t[n++],f=t[n++],d=t[n++],p=new Array(d);for(let g=0;g<d;++g)p[g]=t[n++];a[s]=new ag({color:c,offset:u,count:f,batchIds:p})}}var Zmt=new Yn("createVectorTilePolygons",5),Qmt=new U;function ept(e){if(l(e._primitive))return;let t=e._positions,n=e._counts,i=e._indexCounts,r=e._indices,o=e._transferrableBatchIds,a=e._batchTableColors,s=e._packedBuffer;if(!l(a)){t=e._positions=e._positions.slice(),n=e._counts=e._counts.slice(),i=e._indexCounts=e._indexCounts.slice(),r=e._indices=e._indices.slice(),e._center=e._ellipsoid.cartographicToCartesian(ie.center(e._rectangle)),o=e._transferrableBatchIds=new Uint32Array(e._batchIds),a=e._batchTableColors=new Uint32Array(o.length);let g=e._batchTable,m=a.length;for(let y=0;y<m;++y){let A=g.getColor(y,Qmt);a[y]=A.toRgba()}s=e._packedBuffer=$mt(e)}let c=[t.buffer,n.buffer,i.buffer,r.buffer,o.buffer,a.buffer,s.buffer],u={packedBuffer:s.buffer,positions:t.buffer,counts:n.buffer,indexCounts:i.buffer,indices:r.buffer,batchIds:o.buffer,batchTableColors:a.buffer},f=e._polygonMinimumHeights,d=e._polygonMaximumHeights;l(f)&&l(d)&&(f=f.slice(),d=d.slice(),c.push(f.buffer,d.buffer),u.minimumHeights=f,u.maximumHeights=d);let p=Zmt.scheduleTask(u,c);if(l(p))return p.then(g=>{if(e.isDestroyed())return;e._positions=void 0,e._counts=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0;let m=new Float64Array(g.packedBuffer),y=m[0];Jmt(e,m),e._indices=Ve.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),tpt(e),e._ready=!0}).catch(g=>{e.isDestroyed()||(e._error=g)})}function tpt(e){l(e._primitive)||(e._primitive=new GE({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)}lg.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};lg.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};lg.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};lg.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};lg.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=ept(this)),l(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)};lg.prototype.isDestroyed=function(){return!1};lg.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};var b4=lg;var x4=`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 Hh(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=e.ellipsoid??te.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=U.clone(U.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(Hh.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function npt(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,r=e._ellipsoid,o=e._center,a=2+ie.packedLength+te.packedLength+h.packedLength,s=new Float64Array(a),c=0;return s[c++]=n,s[c++]=i,ie.pack(t,s,c),c+=ie.packedLength,te.pack(r,s,c),c+=te.packedLength,h.pack(o,s,c),s}var ipt=new Yn("createVectorTilePolylines",5),KE={previousPosition:0,currentPosition:1,nextPosition:2,expandAndWidth:3,a_batchId:4};function rpt(e,t){if(l(e._va))return;let n=e._positions,i=e._widths,r=e._counts,o=e._transferrableBatchIds,a=e._packedBuffer;l(a)||(n=e._positions=n.slice(),i=e._widths=i.slice(),r=e._counts=r.slice(),o=e._transferrableBatchIds=e._batchIds.slice(),a=e._packedBuffer=npt(e));let s=[n.buffer,i.buffer,r.buffer,o.buffer,a.buffer],c={positions:n.buffer,widths:i.buffer,counts:r.buffer,batchIds:o.buffer,packedBuffer:a.buffer,keepDecodedPositions:e._keepDecodedPositions},u=ipt.scheduleTask(c,s);if(l(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 d=f.indexDatatype;e._indices=d===Ve.UNSIGNED_SHORT?new Uint16Array(f.indices):new Uint32Array(f.indices),opt(e,t),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)})}function opt(e,t){if(!l(e._va)){let n=e._currentPositions,i=e._previousPositions,r=e._nextPositions,o=e._expandAndWidth,a=e._vertexBatchIds,s=e._indices,c=i.byteLength+n.byteLength+r.byteLength;c+=o.byteLength+a.byteLength+s.byteLength,e._trianglesLength=s.length/3,e._geometryByteLength=c;let u=Ze.createVertexBuffer({context:t,typedArray:i,usage:Oe.STATIC_DRAW}),f=Ze.createVertexBuffer({context:t,typedArray:n,usage:Oe.STATIC_DRAW}),d=Ze.createVertexBuffer({context:t,typedArray:r,usage:Oe.STATIC_DRAW}),p=Ze.createVertexBuffer({context:t,typedArray:o,usage:Oe.STATIC_DRAW}),g=Ze.createVertexBuffer({context:t,typedArray:a,usage:Oe.STATIC_DRAW}),m=Ze.createIndexBuffer({context:t,typedArray:s,usage:Oe.STATIC_DRAW,indexDatatype:s.BYTES_PER_ELEMENT===2?Ve.UNSIGNED_SHORT:Ve.UNSIGNED_INT}),y=[{index:KE.previousPosition,vertexBuffer:u,componentDatatype:Y.FLOAT,componentsPerAttribute:3},{index:KE.currentPosition,vertexBuffer:f,componentDatatype:Y.FLOAT,componentsPerAttribute:3},{index:KE.nextPosition,vertexBuffer:d,componentDatatype:Y.FLOAT,componentsPerAttribute:3},{index:KE.expandAndWidth,vertexBuffer:p,componentDatatype:Y.FLOAT,componentsPerAttribute:2},{index:KE.a_batchId,vertexBuffer:g,componentDatatype:Y.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new Vn({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 s1=new O,ATe=new h;function apt(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return O.clone(n,s1),O.multiplyByPoint(s1,e._center,ATe),O.setTranslation(s1,ATe,s1),s1},u_highlightColor:function(){return e._highlightColor}})}function spt(e){if(l(e._rs))return;let t={enabled:!0,factor:-5,units:-5};e._rs=je.fromCache({blending:en.ALPHA_BLEND,depthMask:!1,depthTest:{enabled:!0},polygonOffset:t})}var cpt=`uniform vec4 u_highlightColor;
|
|
void main()
|
|
{
|
|
out_FragColor = u_highlightColor;
|
|
}
|
|
`;function lpt(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(x4),r=n.getFragmentShaderCallback(!1,void 0,!1)(cpt),o=new Ge({defines:["VECTOR_TILE","CLIP_POLYLINE"],sources:[cu,i]}),a=new Ge({defines:["VECTOR_TILE"],sources:[r]});e._sp=Zt.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:KE})}function upt(e,t){if(!l(e._command)){let n=e._batchTable.getUniformMapCallback()(e._uniformMap);e._command=new nt({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:n,boundingVolume:e._boundingVolume,pass:Pe.TRANSLUCENT,pickId:e._batchTable.getPickId()})}t.commandList.push(e._command)}Hh.getPolylinePositions=function(e,t){let n=e._batchIds,i=e._decodedPositions,r=e._decodedPositionOffsets;if(!l(n)||!l(i))return;let o,a,s=n.length,c=0,u=0;for(o=0;o<s;++o)n[o]===t&&(c+=r[o+1]-r[o]);if(c===0)return;let f=new Float64Array(c*3);for(o=0;o<s;++o)if(n[o]===t){let d=r[o],p=r[o+1]-d;for(a=0;a<p;++a){let g=(d+a)*3;f[u++]=i[g],f[u++]=i[g+1],f[u++]=i[g+2]}}return f};Hh.prototype.getPositions=function(e){return Hh.getPolylinePositions(this,e)};Hh.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r];t[o]=new us(e,o)}};Hh.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function fpt(e,t){let n=e._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],a=t[o];a.show=!0,a.color=U.WHITE}}var dpt=new U,hpt=U.WHITE,mpt=!0;Hh.prototype.applyStyle=function(e,t){if(!l(e)){fpt(this,t);return}let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],a=t[o];a.color=l(e.color)?e.color.evaluateColor(a,dpt):hpt,a.show=l(e.show)?e.show.evaluate(a):mpt}};Hh.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=rpt(this,t)),l(this._error)){let i=this._error;throw this._error=void 0,i}return}apt(this,t),lpt(this,t),spt(this);let n=e.passes;(n.render||n.pick)&&upt(this,e)};Hh.prototype.isDestroyed=function(){return!1};Hh.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),ue(this)};var $E=Hh;var T4=`in vec3 startEllipsoidNormal;
|
|
in vec3 endEllipsoidNormal;
|
|
in vec4 startPositionAndHeight;
|
|
in vec4 endPositionAndHeight;
|
|
in vec4 startFaceNormalAndVertexCorner;
|
|
in vec4 endFaceNormalAndHalfWidth;
|
|
in float a_batchId;
|
|
|
|
uniform mat4 u_modifiedModelView;
|
|
uniform vec2 u_minimumMaximumVectorHeights;
|
|
|
|
out vec4 v_startPlaneEC;
|
|
out vec4 v_endPlaneEC;
|
|
out vec4 v_rightPlaneEC;
|
|
out float v_halfWidth;
|
|
out vec3 v_volumeUpEC;
|
|
|
|
void main()
|
|
{
|
|
// vertex corner IDs
|
|
// 3-----------7
|
|
// /| left /|
|
|
// / | 1 / |
|
|
// 2-----------6 5 end
|
|
// | / | /
|
|
// start |/ right |/
|
|
// 0-----------4
|
|
//
|
|
float isEnd = floor(startFaceNormalAndVertexCorner.w * 0.251); // 0 for front, 1 for end
|
|
float isTop = floor(startFaceNormalAndVertexCorner.w * mix(0.51, 0.19, isEnd)); // 0 for bottom, 1 for top
|
|
|
|
vec3 forward = endPositionAndHeight.xyz - startPositionAndHeight.xyz;
|
|
vec3 right = normalize(cross(forward, startEllipsoidNormal));
|
|
|
|
vec4 position = vec4(startPositionAndHeight.xyz, 1.0);
|
|
position.xyz += forward * isEnd;
|
|
|
|
v_volumeUpEC = czm_normal * normalize(cross(right, forward));
|
|
|
|
// Push for volume height
|
|
float offset;
|
|
vec3 ellipsoidNormal = mix(startEllipsoidNormal, endEllipsoidNormal, isEnd);
|
|
|
|
// offset height to create volume
|
|
offset = mix(startPositionAndHeight.w, endPositionAndHeight.w, isEnd);
|
|
offset = mix(u_minimumMaximumVectorHeights.y, u_minimumMaximumVectorHeights.x, isTop) - offset;
|
|
position.xyz += offset * ellipsoidNormal;
|
|
|
|
// move from RTC to EC
|
|
position = u_modifiedModelView * position;
|
|
right = czm_normal * right;
|
|
|
|
// Push for width in a direction that is in the start or end plane and in a plane with right
|
|
// N = normalEC ("right-facing" direction for push)
|
|
// R = right
|
|
// p = angle between N and R
|
|
// w = distance to push along R if R == N
|
|
// d = distance to push along N
|
|
//
|
|
// N R
|
|
// { p| } * cos(p) = dot(N, R) = w / d
|
|
// d | |w * d = w / dot(N, R)
|
|
// { | }
|
|
// o---------- polyline segment ---->
|
|
//
|
|
vec3 scratchNormal = mix(-startFaceNormalAndVertexCorner.xyz, endFaceNormalAndHalfWidth.xyz, isEnd);
|
|
scratchNormal = cross(scratchNormal, mix(startEllipsoidNormal, endEllipsoidNormal, isEnd));
|
|
vec3 miterPushNormal = czm_normal * normalize(scratchNormal);
|
|
|
|
offset = 2.0 * endFaceNormalAndHalfWidth.w * max(0.0, czm_metersPerPixel(position)); // offset = widthEC
|
|
offset = offset / dot(miterPushNormal, right);
|
|
position.xyz += miterPushNormal * (offset * sign(0.5 - mod(startFaceNormalAndVertexCorner.w, 2.0)));
|
|
|
|
gl_Position = czm_depthClamp(czm_projection * position);
|
|
|
|
position = u_modifiedModelView * vec4(startPositionAndHeight.xyz, 1.0);
|
|
vec3 startNormalEC = czm_normal * startFaceNormalAndVertexCorner.xyz;
|
|
v_startPlaneEC = vec4(startNormalEC, -dot(startNormalEC, position.xyz));
|
|
v_rightPlaneEC = vec4(right, -dot(right, position.xyz));
|
|
|
|
position = u_modifiedModelView * vec4(endPositionAndHeight.xyz, 1.0);
|
|
vec3 endNormalEC = czm_normal * endFaceNormalAndHalfWidth.xyz;
|
|
v_endPlaneEC = vec4(endNormalEC, -dot(endNormalEC, position.xyz));
|
|
v_halfWidth = endFaceNormalAndHalfWidth.w;
|
|
}
|
|
`;var C4=`in vec4 v_startPlaneEC;
|
|
in vec4 v_endPlaneEC;
|
|
in vec4 v_rightPlaneEC;
|
|
in float v_halfWidth;
|
|
in vec3 v_volumeUpEC;
|
|
|
|
uniform vec4 u_highlightColor;
|
|
void main()
|
|
{
|
|
float logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw)));
|
|
|
|
// Discard for sky
|
|
if (logDepthOrDepth == 0.0) {
|
|
#ifdef DEBUG_SHOW_VOLUME
|
|
out_FragColor = vec4(0.0, 0.0, 1.0, 0.5);
|
|
return;
|
|
#else // DEBUG_SHOW_VOLUME
|
|
discard;
|
|
#endif // DEBUG_SHOW_VOLUME
|
|
}
|
|
|
|
vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);
|
|
eyeCoordinate /= eyeCoordinate.w;
|
|
|
|
float halfMaxWidth = v_halfWidth * czm_metersPerPixel(eyeCoordinate);
|
|
|
|
// Expand halfMaxWidth if direction to camera is almost perpendicular with the volume's up direction
|
|
halfMaxWidth += halfMaxWidth * (1.0 - dot(-normalize(eyeCoordinate.xyz), v_volumeUpEC));
|
|
|
|
// Check distance of the eye coordinate against the right-facing plane
|
|
float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz);
|
|
|
|
// Check eye coordinate against the mitering planes
|
|
float distanceFromStart = czm_planeDistance(v_startPlaneEC, eyeCoordinate.xyz);
|
|
float distanceFromEnd = czm_planeDistance(v_endPlaneEC, eyeCoordinate.xyz);
|
|
|
|
if (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) {
|
|
#ifdef DEBUG_SHOW_VOLUME
|
|
out_FragColor = vec4(logDepthOrDepth, 0.0, 0.0, 0.5);
|
|
return;
|
|
#else // DEBUG_SHOW_VOLUME
|
|
discard;
|
|
#endif // DEBUG_SHOW_VOLUME
|
|
}
|
|
out_FragColor = u_highlightColor;
|
|
|
|
czm_writeDepthClamp();
|
|
}
|
|
`;function ug(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=e.ellipsoid??te.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 k(Oi._defaultMinTerrainHeight,Oi._defaultMaxTerrainHeight),this._boundingVolume=Jt.fromRectangle(e.rectangle,Oi._defaultMinTerrainHeight,Oi._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=U.clone(U.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(ug.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function ppt(e,t,n){let i=Oi.getMinimumMaximumHeights(t,n),r=i.minimumTerrainHeight,o=i.maximumTerrainHeight,a=e._minimumMaximumVectorHeights;a.x=r,a.y=o;let s=e._boundingVolume,c=e._rectangle;Jt.fromRectangle(c,r,o,n,s)}function gpt(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,r=e._ellipsoid,o=e._center,a=2+ie.packedLength+te.packedLength+h.packedLength,s=new Float64Array(a),c=0;return s[c++]=n,s[c++]=i,ie.pack(t,s,c),c+=ie.packedLength,te.pack(r,s,c),c+=te.packedLength,h.pack(o,s,c),s}var _pt=new Yn("createVectorTileClampedPolylines"),ky={startEllipsoidNormal:0,endEllipsoidNormal:1,startPositionAndHeight:2,endPositionAndHeight:3,startFaceNormalAndVertexCorner:4,endFaceNormalAndHalfWidth:5,a_batchId:6};function ypt(e,t){if(l(e._va))return;let n=e._positions,i=e._widths,r=e._counts,o=e._transferrableBatchIds,a=e._packedBuffer;l(a)||(n=e._positions=n.slice(),i=e._widths=i.slice(),r=e._counts=r.slice(),o=e._transferrableBatchIds=e._batchIds.slice(),a=e._packedBuffer=gpt(e));let s=[n.buffer,i.buffer,r.buffer,o.buffer,a.buffer],c={positions:n.buffer,widths:i.buffer,counts:r.buffer,batchIds:o.buffer,packedBuffer:a.buffer,keepDecodedPositions:e._keepDecodedPositions},u=_pt.scheduleTask(c,s);if(l(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 d=f.indexDatatype;e._indices=d===Ve.UNSIGNED_SHORT?new Uint16Array(f.indices):new Uint32Array(f.indices),Apt(e,t),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)})}function Apt(e,t){if(!l(e._va)){let n=e._startEllipsoidNormals,i=e._endEllipsoidNormals,r=e._startPositionAndHeights,o=e._endPositionAndHeights,a=e._startFaceNormalAndVertexCornerIds,s=e._endFaceNormalAndHalfWidths,c=e._vertexBatchIds,u=e._indices,f=n.byteLength+i.byteLength;f+=r.byteLength+o.byteLength,f+=a.byteLength+s.byteLength,f+=c.byteLength+u.byteLength,e._trianglesLength=u.length/3,e._geometryByteLength=f;let d=Ze.createVertexBuffer({context:t,typedArray:n,usage:Oe.STATIC_DRAW}),p=Ze.createVertexBuffer({context:t,typedArray:i,usage:Oe.STATIC_DRAW}),g=Ze.createVertexBuffer({context:t,typedArray:r,usage:Oe.STATIC_DRAW}),m=Ze.createVertexBuffer({context:t,typedArray:o,usage:Oe.STATIC_DRAW}),y=Ze.createVertexBuffer({context:t,typedArray:a,usage:Oe.STATIC_DRAW}),A=Ze.createVertexBuffer({context:t,typedArray:s,usage:Oe.STATIC_DRAW}),b=Ze.createVertexBuffer({context:t,typedArray:c,usage:Oe.STATIC_DRAW}),x=Ze.createIndexBuffer({context:t,typedArray:u,usage:Oe.STATIC_DRAW,indexDatatype:u.BYTES_PER_ELEMENT===2?Ve.UNSIGNED_SHORT:Ve.UNSIGNED_INT}),T=[{index:ky.startEllipsoidNormal,vertexBuffer:d,componentDatatype:Y.FLOAT,componentsPerAttribute:3},{index:ky.endEllipsoidNormal,vertexBuffer:p,componentDatatype:Y.FLOAT,componentsPerAttribute:3},{index:ky.startPositionAndHeight,vertexBuffer:g,componentDatatype:Y.FLOAT,componentsPerAttribute:4},{index:ky.endPositionAndHeight,vertexBuffer:m,componentDatatype:Y.FLOAT,componentsPerAttribute:4},{index:ky.startFaceNormalAndVertexCorner,vertexBuffer:y,componentDatatype:Y.FLOAT,componentsPerAttribute:4},{index:ky.endFaceNormalAndHalfWidth,vertexBuffer:A,componentDatatype:Y.FLOAT,componentsPerAttribute:4},{index:ky.a_batchId,vertexBuffer:b,componentDatatype:Y.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new Vn({context:t,attributes:T,indexBuffer:x}),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 c1=new O,bTe=new h;function bpt(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return O.clone(n,c1),O.multiplyByPoint(c1,e._center,bTe),O.setTranslation(c1,bTe,c1),c1},u_highlightColor:function(){return e._highlightColor},u_minimumMaximumVectorHeights:function(){return e._minimumMaximumVectorHeights}})}function xTe(e){return je.fromCache({cull:{enabled:!0,face:Ui.FRONT},blending:en.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:Qn.EQUAL,frontOperation:{fail:Pt.KEEP,zFail:Pt.KEEP,zPass:Pt.KEEP},backFunction:Qn.EQUAL,backOperation:{fail:Pt.KEEP,zFail:Pt.KEEP,zPass:Pt.KEEP},reference:qt.CESIUM_3D_TILE_MASK,mask:qt.CESIUM_3D_TILE_MASK}})}function xpt(e){l(e._rs)||(e._rs=xTe(!1),e._rs3DTiles=xTe(!0))}function Tpt(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(T4),r=n.getFragmentShaderCallback(!1,void 0,!0)(C4),o=new Ge({defines:["VECTOR_TILE","CLIP_POLYLINE"],sources:[cu,i]}),a=new Ge({defines:["VECTOR_TILE"],sources:[r]});e._sp=Zt.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:ky})}function Cpt(e,t){let n=e._command;if(!l(e._command)){let r=e._batchTable.getUniformMapCallback()(e._uniformMap);n=e._command=new nt({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:r,boundingVolume:e._boundingVolume,pass:Pe.TERRAIN_CLASSIFICATION,pickId:e._batchTable.getPickId()});let o=nt.shallowClone(n,n.derivedCommands.tileset);o.renderState=e._rs3DTiles,o.pass=Pe.CESIUM_3D_TILE_CLASSIFICATION,n.derivedCommands.tileset=o}let i=e._classificationType;(i===Zn.TERRAIN||i===Zn.BOTH)&&t.commandList.push(n),(i===Zn.CESIUM_3D_TILE||i===Zn.BOTH)&&t.commandList.push(n.derivedCommands.tileset)}ug.prototype.getPositions=function(e){return $E.getPolylinePositions(this,e)};ug.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r];t[o]=new us(e,o)}};ug.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function vpt(e,t){let n=e._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],a=t[o];a.show=!0,a.color=U.WHITE}}var Ept=new U,Spt=U.WHITE,wpt=!0;ug.prototype.applyStyle=function(e,t){if(!l(e)){vpt(this,t);return}let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],a=t[o];a.color=l(e.color)?e.color.evaluateColor(a,Ept):Spt,a.show=l(e.show)?e.show.evaluate(a):wpt}};function Ipt(e){return Oi.initialize().then(function(){ppt(e,e._rectangle,e._ellipsoid)}).catch(t=>{e.isDestroyed()||(e._error=t)})}ug.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=Ipt(this).then(ypt(this,t))),l(this._error)){let i=this._error;throw this._error=void 0,i}return}bpt(this,t),Tpt(this,t),xpt(this);let n=e.passes;(n.render||n.pick)&&Cpt(this,e)};ug.prototype.isDestroyed=function(){return!1};ug.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),ue(this)};var v4=ug;var JZ=class{constructor(t,n,i,r,o){this._tileset=t,this._tile=n,this._resource=i,this._polygons=void 0,this._polylines=void 0,this._points=void 0,this._metadata=void 0,this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,this._group=void 0,this._ready=!1,Mpt(this,r,o)}get featuresLength(){return l(this._batchTable)?this._batchTable.featuresLength:0}get pointsLength(){return l(this._points)?this._points.pointsLength:0}get trianglesLength(){let t=0;return l(this._polygons)&&(t+=this._polygons.trianglesLength),l(this._polylines)&&(t+=this._polylines.trianglesLength),t}get geometryByteLength(){let t=0;return l(this._polygons)&&(t+=this._polygons.geometryByteLength),l(this._polylines)&&(t+=this._polylines.geometryByteLength),t}get texturesByteLength(){return l(this._points)?this._points.texturesByteLength:0}get batchTableByteLength(){return l(this._batchTable)?this._batchTable.batchTableByteLength:0}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get batchTable(){return this._batchTable}get group(){return this._group}set group(t){this._group=t}hasProperty(t,n){return this._batchTable.hasProperty(t,n)}getFeature(t){return l(this._features)||$Z(this),this._features[t]}applyDebugSettings(t,n){l(this._polygons)&&this._polygons.applyDebugSettings(t,n),l(this._polylines)&&this._polylines.applyDebugSettings(t,n),l(this._points)&&this._points.applyDebugSettings(t,n)}applyStyle(t){l(this._features)||$Z(this),l(this._polygons)&&this._polygons.applyStyle(t,this._features),l(this._polylines)&&this._polylines.applyStyle(t,this._features),l(this._points)&&this._points.applyStyle(t,this._features)}update(t,n){let i=!0;l(this._polygons)&&(this._polygons.classificationType=this._tileset.classificationType,this._polygons.debugWireframe=this._tileset.debugWireframe,this._polygons.update(n),i=i&&this._polygons.ready),l(this._polylines)&&(this._polylines.update(n),i=i&&this._polylines.ready),l(this._points)&&(this._points.update(n),i=i&&this._points.ready),l(this._batchTable)&&i&&(l(this._features)||$Z(this),this._batchTable.update(t,n),this._ready=!0)}pick(t,n,i){}getPolylinePositions(t){let n=this._polylines;if(l(n))return n.getPositions(t)}isDestroyed(){return!1}destroy(){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(),ue(this)}};function Ppt(e){return function(t,n){l(e._polygons)&&e._polygons.updateCommands(t,n)}}function Dpt(e,t){let n,i,r,o,a=e.POLYGONS_LENGTH??0,s=e.POLYLINES_LENGTH??0,c=e.POINTS_LENGTH??0;if(a>0&&l(e.POLYGON_BATCH_IDS)){let p=t.byteOffset+e.POLYGON_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,p,a)}if(s>0&&l(e.POLYLINE_BATCH_IDS)){let p=t.byteOffset+e.POLYLINE_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,p,s)}if(c>0&&l(e.POINT_BATCH_IDS)){let p=t.byteOffset+e.POINT_BATCH_IDS.byteOffset;r=new Uint16Array(t.buffer,p,c)}let u=l(n)||l(i)||l(r),f=a>0&&!l(n)||s>0&&!l(i)||c>0&&!l(r);if(u&&f)throw new oe("If one group of batch ids is defined, then all batch ids must be defined");if(!l(n)&&!l(i)&&!l(r)){let p=0;if(!l(n)&&a>0)for(n=new Uint16Array(a),o=0;o<a;++o)n[o]=p++;if(!l(i)&&s>0)for(i=new Uint16Array(s),o=0;o<s;++o)i[o]=p++;if(!l(r)&&c>0)for(r=new Uint16Array(c),o=0;o<c;++o)r[o]=p++}return{polygons:n,polylines:i,points:r}}var Gh=Uint32Array.BYTES_PER_ELEMENT;function Rpt(e){return new $E(e)}function Opt(e){return new v4(e)}function Mpt(e,t,n){n=n??0;let i=new Uint8Array(t),r=new DataView(t);n+=Gh;let o=r.getUint32(n,!0);if(o!==1)throw new oe(`Only Vector tile version 1 is supported. Version ${o} is not.`);n+=Gh;let a=r.getUint32(n,!0);if(n+=Gh,a===0){e._ready=!0;return}let s=r.getUint32(n,!0);if(n+=Gh,s===0)throw new oe("Feature table must have a byte length greater than zero");let c=r.getUint32(n,!0);n+=Gh;let u=r.getUint32(n,!0);n+=Gh;let f=r.getUint32(n,!0);n+=Gh;let d=r.getUint32(n,!0);n+=Gh;let p=r.getUint32(n,!0);n+=Gh;let g=r.getUint32(n,!0);n+=Gh,n+=Gh;let m=wo(i,n,s);n+=s;let y=new Uint8Array(t,n,c);n+=c;let A,b;u>0&&(A=wo(i,n,u),n+=u,f>0&&(b=new Uint8Array(t,n,f),b=new Uint8Array(b),n+=f));let x=m.POLYGONS_LENGTH??0,T=m.POLYLINES_LENGTH??0,C=m.POINTS_LENGTH??0,E=x+T+C,w=new pp(e,E,A,b,Ppt(e));if(e._batchTable=w,E===0)return;let D=new mp(m,y),R=D.getGlobalProperty("REGION");if(!l(R))throw new oe("Feature table global property: REGION must be defined");let M=ie.unpack(R),N=R[4],_=R[5],v=e._tile.computedTransform,S=D.getGlobalProperty("RTC_CENTER",Y.FLOAT,3);l(S)?(S=h.unpack(S),O.multiplyByPoint(v,S,S)):(S=ie.center(M),S.height=I.lerp(N,_,.5),S=te.WGS84.cartographicToCartesian(S));let P=Dpt(m,y);if(n+=(4-n%4)%4,x>0){D.featuresLength=x;let F=D.getPropertyArray("POLYGON_COUNTS",Y.UNSIGNED_INT,1)??D.getPropertyArray("POLYGON_COUNT",Y.UNSIGNED_INT,1);if(!l(F))throw new oe("Feature table property: POLYGON_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let V=D.getPropertyArray("POLYGON_INDEX_COUNTS",Y.UNSIGNED_INT,1)??D.getPropertyArray("POLYGON_INDEX_COUNT",Y.UNSIGNED_INT,1);if(!l(V))throw new oe("Feature table property: POLYGON_INDEX_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let z=F.reduce(function(q,J){return q+J*2},0),j=V.reduce(function(q,J){return q+J},0),B=new Uint32Array(t,n,j);n+=d;let G=new Uint16Array(t,n,z);n+=p;let W,Q;l(m.POLYGON_MINIMUM_HEIGHTS)&&l(m.POLYGON_MAXIMUM_HEIGHTS)&&(W=D.getPropertyArray("POLYGON_MINIMUM_HEIGHTS",Y.FLOAT,1),Q=D.getPropertyArray("POLYGON_MAXIMUM_HEIGHTS",Y.FLOAT,1)),e._polygons=new b4({positions:G,counts:F,indexCounts:V,indices:B,minimumHeight:N,maximumHeight:_,polygonMinimumHeights:W,polygonMaximumHeights:Q,center:S,rectangle:M,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:w,batchIds:P.polygons,modelMatrix:v})}let L=e._tileset;if(T>0){D.featuresLength=T;let F=D.getPropertyArray("POLYLINE_COUNTS",Y.UNSIGNED_INT,1)??D.getPropertyArray("POLYLINE_COUNT",Y.UNSIGNED_INT,1);if(!l(F))throw new oe("Feature table property: POLYLINE_COUNTS must be defined when POLYLINES_LENGTH is greater than 0");let V=D.getPropertyArray("POLYLINE_WIDTHS",Y.UNSIGNED_SHORT,1);if(!l(V)){V=new Uint16Array(T);for(let W=0;W<T;++W)V[W]=2}let z=F.reduce(function(W,Q){return W+Q*3},0),j=new Uint16Array(t,n,z);n+=g;let B=L.examineVectorLinesFunction;if(l(B)){let W=vk(new Uint16Array(j),M,N,_,te.WGS84);Lpt(W,F,P.polylines,w,e.url,B)}let G=Rpt;l(L.classificationType)&&(G=Opt),e._polylines=G({positions:j,widths:V,counts:F,batchIds:P.polylines,minimumHeight:N,maximumHeight:_,center:S,rectangle:M,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:w,classificationType:L.classificationType,keepDecodedPositions:L.vectorKeepDecodedPositions})}if(C>0){let F=new Uint16Array(t,n,C*3);e._points=new A4({positions:F,batchIds:P.points,minimumHeight:N,maximumHeight:_,rectangle:M,batchTable:w,heightReference:L.heightReference,scene:L.scene})}}function $Z(e){let t=e.featuresLength;if(!l(e._features)&&t>0){let n=new Array(t);l(e._polygons)&&e._polygons.createFeatures(e,n),l(e._polylines)&&e._polylines.createFeatures(e,n),l(e._points)&&e._points.createFeatures(e,n),e._features=n}}function Lpt(e,t,n,i,r,o){let a=t.length,s=0;for(let c=0;c<a;c++){let u=t[c]*3,f=e.slice(s,s+u);s+=u,o(f,n[c],r,i)}}var E4=JZ;var{ERR_CAPACITY:bbi}=as.Error,Npt=new h,S4=class S4 extends ra{constructor(){super(...arguments);at(this,"_collection",null)}static clone(n,i){return super.clone(n,i),i.setPosition(n.getPosition(Npt)),i}get vertexOffset(){return this._getUint32(S4.Layout.POSITION_OFFSET_U32)}get vertexCount(){return 1}getPosition(n){let i=this._collection._positionView;return h.fromArray(i,this.vertexOffset*3,n)}setPosition(n){let i=this._collection,r=this.vertexOffset;i._positionView[r*3]=n.x,i._positionView[r*3+1]=n.y,i._positionView[r*3+2]=n.z,this._dirty=!0,i._makeDirtyBoundingVolume()}toJSON(){return{...super.toJSON(),position:h.pack(this.getPosition(),[])}}};at(S4,"Layout",{...ra.Layout,POSITION_OFFSET_U32:ra.Layout.__BYTE_LENGTH,__BYTE_LENGTH:ra.Layout.__BYTE_LENGTH+4});var ZZ=S4,el=ZZ;var w4=`#ifdef USE_FLOAT64
|
|
in vec3 positionHigh;
|
|
in vec3 positionLow;
|
|
#else
|
|
in vec3 position;
|
|
#endif
|
|
in vec4 pickColor;
|
|
in vec4 showPixelSizeColorAlpha;
|
|
in vec3 outlineWidthColorAlpha;
|
|
|
|
out vec4 v_pickColor;
|
|
out vec4 v_color;
|
|
out vec4 v_outlineColor;
|
|
out float v_innerRadiusFrac;
|
|
|
|
void main()
|
|
{
|
|
// Unpack attributes.
|
|
float show = showPixelSizeColorAlpha.x;
|
|
float pixelSize = showPixelSizeColorAlpha.y;
|
|
vec4 color = czm_decodeRGB8(showPixelSizeColorAlpha.z);
|
|
float alpha = showPixelSizeColorAlpha.w;
|
|
float outlineWidth = outlineWidthColorAlpha.x;
|
|
vec4 outlineColor = czm_decodeRGB8(outlineWidthColorAlpha.y);
|
|
float outlineAlpha = outlineWidthColorAlpha.z;
|
|
|
|
///////////////////////////////////////////////////////////////////////////
|
|
|
|
float innerRadius = 0.5 * pixelSize * czm_pixelRatio;
|
|
float outerRadius = (0.5 * pixelSize + outlineWidth) * czm_pixelRatio;
|
|
|
|
///////////////////////////////////////////////////////////////////////////
|
|
|
|
#ifdef USE_FLOAT64
|
|
vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);
|
|
vec4 positionEC = czm_modelViewRelativeToEye * p;
|
|
#else
|
|
vec4 positionEC = czm_modelView * vec4(position, 1.0);
|
|
#endif
|
|
|
|
///////////////////////////////////////////////////////////////////////////
|
|
|
|
gl_Position = czm_projection * positionEC;
|
|
czm_vertexLogDepth();
|
|
|
|
v_pickColor = pickColor / 255.0;
|
|
|
|
v_color = color;
|
|
v_color.a *= alpha * show;
|
|
|
|
v_outlineColor = outlineColor;
|
|
v_outlineColor.a *= outlineAlpha * show;
|
|
|
|
v_innerRadiusFrac = innerRadius / outerRadius;
|
|
|
|
gl_PointSize = 2.0 * outerRadius * show;
|
|
gl_Position *= show;
|
|
}
|
|
`;var I4=`in vec4 v_pickColor;
|
|
in vec4 v_color;
|
|
in vec4 v_outlineColor;
|
|
in float v_innerRadiusFrac;
|
|
|
|
void main()
|
|
{
|
|
// Distance between fragment and point center, 0 to 0.5.
|
|
float distanceToCenter = length(gl_PointCoord - vec2(0.5));
|
|
float delta = fwidth(distanceToCenter);
|
|
|
|
float outerLimit = 0.5;
|
|
float innerLimit = 0.5 * v_innerRadiusFrac;
|
|
|
|
float outerAlpha = 1.0 - smoothstep(max(0.0, outerLimit - delta), outerLimit, distanceToCenter);
|
|
float innerAlpha = 1.0 - smoothstep(innerLimit - delta, innerLimit, distanceToCenter);
|
|
|
|
vec4 color = vec4(mix(v_outlineColor.rgb, v_color.rgb, innerAlpha), outerAlpha);
|
|
color.a *= mix(v_outlineColor.a, v_color.a, innerAlpha);
|
|
|
|
if (color.a < 0.005) // matches 0/255 and 1/255
|
|
{
|
|
discard;
|
|
}
|
|
|
|
out_FragColor = czm_gammaCorrect(color);
|
|
czm_writeLogDepth();
|
|
}
|
|
`;var l1=class l1 extends su{constructor(t=H.EMPTY_OBJECT){super(t),this.size=t.size??1}static pack(t,n,i){super.pack(t,n,i),n.setUint8(this.Layout.SIZE_U8+i,t.size)}static unpack(t,n,i){return super.unpack(t,n,i),i.size=t.getUint8(this.Layout.SIZE_U8+n),i}toJSON(){return{...super.toJSON(),size:this.size}}};at(l1,"Layout",{...su.Layout,SIZE_U8:su.Layout.__BYTE_LENGTH,__BYTE_LENGTH:su.Layout.__BYTE_LENGTH+4}),at(l1,"DEFAULT_MATERIAL",Object.freeze(new l1));var QZ=l1,Sp=QZ;var eQ={positionHigh:0,positionLow:1,pickColor:2,showSizeColorAlpha:3,outlineWidthColorAlpha:4},TTe={position:0,pickColor:1,showSizeColorAlpha:2,outlineWidthColorAlpha:3},px=new el,Wh=new Sp,u1=new U,CTe=new h,tQ=new Sn;function Fpt(e,t,n){let i=t.context;n=n||{destroy:Bpt};let r=e._positionDatatype===Y.DOUBLE,o=r?eQ:TTe;if(!l(n.attributeArrays)){let s=e.primitiveCountMax;n.attributeArrays={...r?{positionHigh:new Float32Array(s*3),positionLow:new Float32Array(s*3)}:{position:e._positionView},pickColor:new Uint8Array(s*4),showSizeColorAlpha:new Float32Array(s*4),outlineWidthColorAlpha:new Float32Array(s*3)}}if(e._dirtyCount>0){let{attributeArrays:s}=n,c=s.positionHigh,u=s.positionLow,f=s.pickColor,d=s.showSizeColorAlpha,p=s.outlineWidthColorAlpha,{_dirtyOffset:g,_dirtyCount:m}=e;for(let y=g,A=g+m;y<A;y++)e.get(y,px),px._dirty&&(r&&(px.getPosition(CTe),Sn.fromCartesian(CTe,tQ),h.pack(tQ.high,c,y*3),h.pack(tQ.low,u,y*3)),px.getMaterial(Wh),U.fromRgba(px._pickId,u1),f[y*4]=U.floatToByte(u1.red),f[y*4+1]=U.floatToByte(u1.green),f[y*4+2]=U.floatToByte(u1.blue),f[y*4+3]=U.floatToByte(u1.alpha),d[y*4]=px.show?1:0,d[y*4+1]=Wh.size,d[y*4+2]=an.encodeRGB8(Wh.color),d[y*4+3]=Wh.color.alpha,p[y*3]=Wh.outlineWidth,p[y*3+1]=an.encodeRGB8(Wh.outlineWidth>0?Wh.outlineColor:Wh.color),p[y*3+2]=Wh.outlineWidth>0?Wh.outlineColor.alpha:Wh.color.alpha,px._dirty=!1)}if(l(n.vertexArray)){if(e._dirtyCount>0){for(let s in o)if(Object.hasOwn(o,s)){let c=s;n.vertexArray.copyAttributeFromRange(o[c],n.attributeArrays[c],e._dirtyOffset,e._dirtyCount)}}}else{let{attributeArrays:s}=n;n.vertexArray=new Vn({context:i,attributes:[...r?[{index:eQ.positionHigh,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:Ze.createVertexBuffer({typedArray:s.positionHigh,context:i,usage:Oe.STATIC_DRAW})},{index:eQ.positionLow,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:Ze.createVertexBuffer({typedArray:s.positionLow,context:i,usage:Oe.STATIC_DRAW})}]:[{index:TTe.position,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:Ze.createVertexBuffer({typedArray:e._positionView,context:i,usage:Oe.STATIC_DRAW})}],{index:o.pickColor,componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:4,vertexBuffer:Ze.createVertexBuffer({typedArray:s.pickColor,context:i,usage:Oe.STATIC_DRAW})},{index:o.showSizeColorAlpha,componentDatatype:Y.FLOAT,componentsPerAttribute:4,vertexBuffer:Ze.createVertexBuffer({typedArray:s.showSizeColorAlpha,context:i,usage:Oe.STATIC_DRAW})},{index:o.outlineWidthColorAlpha,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:Ze.createVertexBuffer({typedArray:s.outlineWidthColorAlpha,context:i,usage:Oe.STATIC_DRAW})}]})}l(n.renderState)||(n.renderState=je.fromCache({blending:e._blendOption===Fi.OPAQUE?en.DISABLED:en.ALPHA_BLEND,depthTest:{enabled:!0}})),l(n.shaderProgram)||(n.shaderProgram=Zt.fromCache({context:i,vertexShaderSource:new Ge({sources:[w4],defines:r?["USE_FLOAT64"]:[]}),fragmentShaderSource:new Ge({sources:[I4]}),attributeLocations:o})),l(n.command)||(n.command=new nt({vertexArray:n.vertexArray,renderState:n.renderState,shaderProgram:n.shaderProgram,primitiveType:Re.POINTS,pass:e._blendOption===Fi.OPAQUE?Pe.OPAQUE:Pe.TRANSLUCENT,pickId:e._allowPicking?"v_pickColor":void 0,owner:e,count:e.primitiveCount,modelMatrix:e.modelMatrix,boundingVolume:e.boundingVolume,debugShowBoundingVolume:e.debugShowBoundingVolume}));let a=n.command;return a.count!==e.primitiveCount&&(a.count=e.primitiveCount),a.debugShowBoundingVolume!==e.debugShowBoundingVolume&&(a.debugShowBoundingVolume=e.debugShowBoundingVolume),t.commandList.push(a),e._makeClean(),n}function Bpt(){let e=this;l(e.vertexArray)&&e.vertexArray.destroy(),l(e.shaderProgram)&&e.shaderProgram.destroy(),l(e.renderState)&&je.removeFromCache(e.renderState)}var P4=Fpt;var nQ=class e extends as{constructor(t=H.EMPTY_OBJECT){super({...t,vertexCountMax:t.primitiveCountMax})}_getCollectionClass(){return e}_getPrimitiveClass(){return el}_getMaterialClass(){return Sp}static _cloneEmpty(t){return new e({primitiveCountMax:t.primitiveCountMax,positionDatatype:t.positionDatatype,positionNormalized:t.positionNormalized})}add(t,n=new el){return super.add(t,n),n._setUint32(el.Layout.POSITION_OFFSET_U32,this._positionCount++),n.setPosition(t.position??h.ZERO),n}update(t){super.update(t);let n=t.passes;this.show&&(n.render||n.pick)&&(this._renderContext=P4(this,t,this._renderContext))}},hf=nQ;function JE(e,t){this._conditionsExpression=Xe(e,!0),this._conditions=e.conditions,this._runtimeConditions=void 0,zpt(this,t)}Object.defineProperties(JE.prototype,{conditionsExpression:{get:function(){return this._conditionsExpression}}});function kpt(e,t){this.condition=e,this.expression=t}function zpt(e,t){let n=[],i=e._conditions;if(!l(i))return;let r=i.length;for(let o=0;o<r;++o){let a=i[o],s=String(a[0]),c=String(a[1]);n.push(new kpt(new zh(s,t),new zh(c,t)))}e._runtimeConditions=n}JE.prototype.evaluate=function(e,t){let n=this._runtimeConditions;if(!l(n))return;let i=n.length;for(let r=0;r<i;++r){let o=n[r];if(o.condition.evaluate(e))return o.expression.evaluate(e,t)}};JE.prototype.evaluateColor=function(e,t){let n=this._runtimeConditions;if(!l(n))return;let i=n.length;for(let r=0;r<i;++r){let o=n[r];if(o.condition.evaluate(e))return o.expression.evaluateColor(e,t)}};JE.prototype.getShaderFunction=function(e,t,n,i){let r=this._runtimeConditions;if(!l(r)||r.length===0)return;let o="",a=r.length;for(let s=0;s<a;++s){let c=r[s],u=c.condition.getShaderExpression(t,n),f=c.expression.getShaderExpression(t,n);o+=` ${s===0?"if":"else if"} (${u})
|
|
{
|
|
return ${f};
|
|
}
|
|
`}return o=`${i} ${e}
|
|
{
|
|
${o} return ${i}(1.0);
|
|
}
|
|
`,o};JE.prototype.getVariables=function(){let e=[],t=this._runtimeConditions;if(!l(t)||t.length===0)return e;let n=t.length;for(let i=0;i<n;++i){let r=t[i];Xn(e,r.condition.getVariables()),Xn(e,r.expression.getVariables())}return e=e.filter(function(i,r,o){return o.indexOf(i)===r}),e};var D4=JE;function zy(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._lineWidth=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,Upt(this,e)}function Upt(e,t){t=Xe(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,e.lineWidth=t.lineWidth;let n={};if(l(t.meta)){let i=t.defines,r=t.meta??H.EMPTY_OBJECT;for(let o in r)r.hasOwnProperty(o)&&(n[o]=new zh(r[o],i))}e._meta=n,e._ready=!0}function ao(e,t){let n=(e._style??H.EMPTY_OBJECT).defines;if(l(t)){if(typeof t=="boolean"||typeof t=="number")return new zh(String(t));if(typeof t=="string")return new zh(t,n);if(l(t.conditions))return new D4(t,n)}else return;return t}function so(e){if(l(e)){if(l(e.expression))return e.expression;if(l(e.conditionsExpression))return Xe(e.conditionsExpression,!0)}else return;return e}Object.defineProperties(zy.prototype,{style:{get:function(){return this._style}},show:{get:function(){return this._show},set:function(e){this._show=ao(this,e),this._style.show=so(this._show),this._showShaderFunctionReady=!1}},color:{get:function(){return this._color},set:function(e){this._color=ao(this,e),this._style.color=so(this._color),this._colorShaderFunctionReady=!1}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=ao(this,e),this._style.pointSize=so(this._pointSize),this._pointSizeShaderFunctionReady=!1}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=ao(this,e),this._style.pointOutlineColor=so(this._pointOutlineColor)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=ao(this,e),this._style.pointOutlineWidth=so(this._pointOutlineWidth)}},labelColor:{get:function(){return this._labelColor},set:function(e){this._labelColor=ao(this,e),this._style.labelColor=so(this._labelColor)}},labelOutlineColor:{get:function(){return this._labelOutlineColor},set:function(e){this._labelOutlineColor=ao(this,e),this._style.labelOutlineColor=so(this._labelOutlineColor)}},labelOutlineWidth:{get:function(){return this._labelOutlineWidth},set:function(e){this._labelOutlineWidth=ao(this,e),this._style.labelOutlineWidth=so(this._labelOutlineWidth)}},font:{get:function(){return this._font},set:function(e){this._font=ao(this,e),this._style.font=so(this._font)}},labelStyle:{get:function(){return this._labelStyle},set:function(e){this._labelStyle=ao(this,e),this._style.labelStyle=so(this._labelStyle)}},labelText:{get:function(){return this._labelText},set:function(e){this._labelText=ao(this,e),this._style.labelText=so(this._labelText)}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){this._backgroundColor=ao(this,e),this._style.backgroundColor=so(this._backgroundColor)}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){this._backgroundPadding=ao(this,e),this._style.backgroundPadding=so(this._backgroundPadding)}},backgroundEnabled:{get:function(){return this._backgroundEnabled},set:function(e){this._backgroundEnabled=ao(this,e),this._style.backgroundEnabled=so(this._backgroundEnabled)}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){this._scaleByDistance=ao(this,e),this._style.scaleByDistance=so(this._scaleByDistance)}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){this._translucencyByDistance=ao(this,e),this._style.translucencyByDistance=so(this._translucencyByDistance)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=ao(this,e),this._style.distanceDisplayCondition=so(this._distanceDisplayCondition)}},heightOffset:{get:function(){return this._heightOffset},set:function(e){this._heightOffset=ao(this,e),this._style.heightOffset=so(this._heightOffset)}},anchorLineEnabled:{get:function(){return this._anchorLineEnabled},set:function(e){this._anchorLineEnabled=ao(this,e),this._style.anchorLineEnabled=so(this._anchorLineEnabled)}},anchorLineColor:{get:function(){return this._anchorLineColor},set:function(e){this._anchorLineColor=ao(this,e),this._style.anchorLineColor=so(this._anchorLineColor)}},image:{get:function(){return this._image},set:function(e){this._image=ao(this,e),this._style.image=so(this._image)}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance=ao(this,e),this._style.disableDepthTestDistance=so(this._disableDepthTestDistance)}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin=ao(this,e),this._style.horizontalOrigin=so(this._horizontalOrigin)}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin=ao(this,e),this._style.verticalOrigin=so(this._verticalOrigin)}},labelHorizontalOrigin:{get:function(){return this._labelHorizontalOrigin},set:function(e){this._labelHorizontalOrigin=ao(this,e),this._style.labelHorizontalOrigin=so(this._labelHorizontalOrigin)}},labelVerticalOrigin:{get:function(){return this._labelVerticalOrigin},set:function(e){this._labelVerticalOrigin=ao(this,e),this._style.labelVerticalOrigin=so(this._labelVerticalOrigin)}},lineWidth:{get:function(){return this._lineWidth},set:function(e){this._lineWidth=ao(this,e),this._style.lineWidth=so(this._lineWidth)}},meta:{get:function(){return this._meta},set:function(e){this._meta=e}}});zy.fromUrl=function(e){return De.createIfNeeded(e).fetchJson(e).then(function(n){return new zy(n)})};zy.prototype.getColorShaderFunction=function(e,t,n){return this._colorShaderFunctionReady?(n.translucent=this._colorShaderTranslucent,this._colorShaderFunction):(this._colorShaderFunctionReady=!0,l(this.color)&&l(this.color.getShaderFunction)?this._colorShaderFunction=this.color.getShaderFunction(e,t,n,"vec4"):this._colorShaderFunction=void 0,this._colorShaderTranslucent=n.translucent,this._colorShaderFunction)};zy.prototype.getShowShaderFunction=function(e,t,n){return this._showShaderFunctionReady?this._showShaderFunction:(this._showShaderFunctionReady=!0,l(this.show)&&l(this.show.getShaderFunction)?this._showShaderFunction=this.show.getShaderFunction(e,t,n,"bool"):this._showShaderFunction=void 0,this._showShaderFunction)};zy.prototype.getPointSizeShaderFunction=function(e,t,n){return this._pointSizeShaderFunctionReady?this._pointSizeShaderFunction:(this._pointSizeShaderFunctionReady=!0,l(this.pointSize)&&l(this.pointSize.getShaderFunction)?this._pointSizeShaderFunction=this.pointSize.getShaderFunction(e,t,n,"float"):this._pointSizeShaderFunction=void 0,this._pointSizeShaderFunction)};zy.prototype.getVariables=function(){let e=[];return l(this.color)&&l(this.color.getVariables)&&Xn(e,this.color.getVariables()),l(this.show)&&l(this.show.getVariables)&&Xn(e,this.show.getVariables()),l(this.pointSize)&&l(this.pointSize.getVariables)&&Xn(e,this.pointSize.getVariables()),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var Uy=zy;var vTe=new el,ETe=new Cs,STe=new oa,Vpt=new Sp,jpt=new cd,Hpt=new sd,iQ=class{constructor(t,n,i=0){at(this,"_color",new U);at(this,"_outlineColor",new U);this._content=t,this._batchId=n,this._batchTableId=i,this._primitivesByCollection=new Map}addPrimitiveByCollection(t,n){let i=this._primitivesByCollection.get(t);i||(i=[],this._primitivesByCollection.set(t,i)),i.push(n)}get show(){for(let t of this._iteratePrimitives())if(t.show)return!0;return!1}set show(t){for(let n of this._iteratePrimitives())n.show=t}get color(){for(let t of this._iterateMaterials())return U.clone(t.color,this._color);return U.clone(U.WHITE,this._color)}set color(t){for(let n of this._iterateMaterials())U.clone(t,n.color)}get pointSize(){for(let t of this._iteratePointMaterials())return t.size;return 1}set pointSize(t){for(let n of this._iteratePointMaterials())n.size=t}get pointOutlineColor(){for(let t of this._iteratePointMaterials())return U.clone(t.outlineColor,this._outlineColor);return U.clone(U.WHITE,this._outlineColor)}set pointOutlineColor(t){for(let n of this._iteratePointMaterials())U.clone(t,n.outlineColor)}get pointOutlineWidth(){for(let t of this._iteratePointMaterials())return t.outlineWidth;return 0}set pointOutlineWidth(t){for(let n of this._iteratePointMaterials())n.outlineWidth=t}get lineWidth(){for(let t of this._iteratePolylineMaterials())return t.width;return 1}set lineWidth(t){for(let n of this._iteratePolylineMaterials())n.width=t}get lineOutlineColor(){for(let t of this._iteratePolylineMaterials())return U.clone(t.outlineColor,this._outlineColor);return U.clone(U.WHITE,this._outlineColor)}set lineOutlineColor(t){for(let n of this._iteratePolylineMaterials())U.clone(t,n.outlineColor)}get lineOutlineWidth(){for(let t of this._iteratePolylineMaterials())return t.outlineWidth;return 0}set lineOutlineWidth(t){for(let n of this._iteratePolylineMaterials())n.outlineWidth=t}get polygonOutlineColor(){for(let t of this._iteratePolygonMaterials())return U.clone(t.outlineColor,this._outlineColor);return U.clone(U.WHITE,this._outlineColor)}set polygonOutlineColor(t){for(let n of this._iteratePolygonMaterials())U.clone(t,n.outlineColor)}get polygonOutlineWidth(){for(let t of this._iteratePolygonMaterials())return t.outlineWidth;return 0}set polygonOutlineWidth(t){for(let n of this._iteratePolygonMaterials())n.outlineWidth=t}get content(){return this._content}get tileset(){return this._content.tileset}get primitive(){return this._content.tileset}get featureId(){return this._batchId}get _batchTable(){return this._content.batchTables[this._batchTableId]}get pickIds(){let t=[];for(let n of this._iteratePrimitives())t.push(n._pickId);return t}hasProperty(t){return l(this._batchTable)?this._batchTable.hasProperty(this._batchId,t):!1}getPropertyIds(t){return l(this._batchTable)?this._batchTable.getPropertyIds(this._batchId,t):[]}getProperty(t){if(l(this._batchTable))return this._batchTable.getProperty(this._batchId,t)}getPropertyInherited(t){return us.getPropertyInherited(this._content,this._batchId,t,this._batchTable)}setProperty(t,n){throw new pe("Not implemented")}isExactClass(t){return l(this._batchTable)?this._batchTable.isExactClass(this._batchId,t):!1}isClass(t){return l(this._batchTable)?this._batchTable.isClass(this._batchId,t):!1}getExactClassName(){if(l(this._batchTable))return this._batchTable.getExactClassName(this._batchId)}*_iteratePrimitives(){yield*this._iteratePrimitivesWith(hf,vTe),yield*this._iteratePrimitivesWith(vl,ETe),yield*this._iteratePrimitivesWith(Cl,STe)}*_iteratePrimitivesWith(t,n){let i=this._content._collections;for(let r=0;r<i.length;r++){let o=i[r],a=this._primitivesByCollection.get(r);if(a&&o instanceof t)for(let s of a)o.get(s,n),yield n}}*_iterateMaterials(){yield*this._iteratePointMaterials(),yield*this._iteratePolylineMaterials(),yield*this._iteratePolygonMaterials()}*_iteratePointMaterials(){yield*this._iterateMaterialsWith(hf,vTe,Vpt)}*_iteratePolylineMaterials(){yield*this._iterateMaterialsWith(vl,ETe,jpt)}*_iteratePolygonMaterials(){yield*this._iterateMaterialsWith(Cl,STe,Hpt)}*_iterateMaterialsWith(t,n,i){for(let r of this._iteratePrimitivesWith(t,n))r.getMaterial(i),yield i,r.setMaterial(i)}},ZE=iQ;var wTe=new h,Gpt=new el,Wpt=new Cs,PTe=new oa;function qpt(e,t){let n=t.scene.nodes,i={collections:[],collectionLocalMatrices:[],collectionFeatureTableIds:new Map,featuresByTableId:new Map};for(let r=0;r<n.length;r++)DTe(e,n[r],O.IDENTITY,i);return i}function R4(e){let t=e.BYTES_PER_ELEMENT*8;return Math.pow(2,t)-1}function Ypt(e){let t={pointPrimitiveCount:0,pointVertexCount:0,polylinePrimitiveCount:0,polylineVertexCount:0,polygonPrimitiveCount:0,polygonVertexCount:0,polygonHoleCount:0,polygonTriangleCount:0},n=e.vector,i=e.polygon,r=e.primitiveType,a=_t.getAttributeBySemantic(e,ot.POSITION).count,s=e.indices?Ps.readIndicesAsTypedArray(e.indices):void 0;if(r===Re.POINTS)t.pointPrimitiveCount+=a,t.pointVertexCount+=a;else if(r===Re.LINE_STRIP){let c=n?n.count:ITe(s);t.polylinePrimitiveCount+=c,t.polylineVertexCount+=s.length-c+1}else if(r===Re.TRIANGLES||r===Re.LINE_LOOP)if(n){t.polygonPrimitiveCount+=n.count,t.polygonVertexCount+=a,t.polygonTriangleCount+=s.length/3;let c=n.polygonHoleCounts;if(c)for(let u=0;u<c.length;u++)t.polygonHoleCount+=c[u]}else{let c=ITe(i.loopIndices);t.polygonPrimitiveCount+=i.count,t.polygonVertexCount+=i.loopIndices.length-c+1,t.polygonTriangleCount+=i.triangleIndices.length,t.polygonHoleCount+=c-i.count}else throw new oe(`Unexpected primitive type: ${r}`);return t}function ITe(e){let t=R4(e),n=0;for(let i=0;i<e.length;i++)e[i]===t&&i+1<e.length&&n++;return n+1}function Xpt(e,t,n,i,r){let o=_t.getAttributeBySemantic(t,ot.POSITION),a=o.typedArray??(n.positionNormalized?Ps.readAttributeAsRawCompactTypedArray(o):Ps.readAttributeAsTypedArray(o)),s=t.indices?Ps.readIndicesAsTypedArray(t.indices):void 0,c=Kpt(e,t,r);n instanceof hf?$pt(n,i,a,s,c):n instanceof vl?Jpt(n,i,a,s,c):n instanceof Cl&&(l(t.vector)?Zpt(n,i,a,s,c,t.vector):Qpt(n,i,a,c,t.polygon))}function Kpt(e,t,n){let i=e.tileset.featureIdLabel,r=_t.getFeatureIdsByLabel(t.featureIds,i);if(!(r instanceof Tn.FeatureIdAttribute))return()=>{};let o=_t.getAttributeBySemantic(t,ot.FEATURE_ID,r.setIndex),a=o.typedArray??Ps.readAttributeAsTypedArray(o);for(let s=0;s<a.length;s++){let c=a[s];if(!n.has(c)){let u=new ZE(e,c,r.propertyTableId);n.set(c,u)}}return function(c){let u=a[c];if(u!==r.nullFeatureId)return n.get(u)}}function $pt(e,t,n,i,r){let o=n.length/3;for(let a=0,s=i?i.length:o;a<s;a++){let c=i?i[a]:a;h.fromArray(n,c*3,wTe);let u=r(c);u&&u.addPrimitiveByCollection(t,a),e.add({position:wTe,pickObject:u,featureId:u?.featureId},Gpt)}}function Jpt(e,t,n,i,r){let o=R4(i),a=0,s=0,c=0;for(let u=0;u<i.length;u++){if(i[u]===o?s=u-a:u+1===i.length&&(s=u+1-a),s===0)continue;let d=a+s,p=i.subarray(a,d),g=RTe(n,p,3),m=r(i[a]);m&&m.addPrimitiveByCollection(t,c),e.add({positions:g,pickObject:m,featureId:m?.featureId},Wpt),a=u+1,s=0,c++}}function Zpt(e,t,n,i,r,o){let a=o.polygonAttributeOffsets,s=o.polygonIndicesOffsets,c=o.polygonHoleCounts,u=o.polygonHoleOffsets,f=n.length/3,d=a.length;for(let p=0;p<d;p++){let g=a[p],m=p+1<d?a[p+1]:f,y=n.subarray(g*3,m*3),A;if(l(c)&&c[p]>0){let E=c[p];A=u.slice(p,p+E);for(let w=0;w<E;w++)A[w]-=g}let b=s[p],x=p+1<d?s[p+1]:i.length,T=i.slice(b,x);for(let E=0;E<T.length;E++)T[E]-=g;let C=r(g);C&&C.addPrimitiveByCollection(t,p),e.add({positions:y,triangles:T,holes:A,pickObject:C,featureId:C?.featureId},PTe)}}function Qpt(e,t,n,i,r){let o=r.loopIndices.constructor,a=new o(r.loopIndices.length),s=R4(r.loopIndices);for(let c=0;c<r.count;c++){let u=c+1===r.count,f=r.loopIndicesOffsets[c],d=u?r.loopIndices.length:r.loopIndicesOffsets[c+1],p=r.loopIndices.subarray(f,d),g=RTe(n,p,3,a),m=[];for(let x=0;x<p.length;x++){let T=x+1===p.length;p[x]===s&&!T&&m.push(x)}let y=new o(m),A;if(l(r.triangleIndices)){let x=r.triangleIndicesOffsets[c],T=u?r.triangleIndices.length:r.triangleIndicesOffsets[c+1];A=r.triangleIndices.subarray(x,T);for(let C=0;C<A.length;C++)A[C]=a[A[C]]}else throw new Error("Runtime triangulation not yet supported.");let b=i(p[0]);b&&b.addPrimitiveByCollection(t,c),e.add({positions:g,triangles:A,holes:y,pickObject:b,featureId:b?.featureId},PTe)}}function DTe(e,t,n,i){let r=_t.getNodeTransform(t),o=O.multiplyTransformation(n,r,new O),a=t.primitives;for(let c=0;c<a.length;c++){let u=a[c],f=u.primitiveType,d,p=Ypt(u),g=_t.getAttributeBySemantic(u,ot.POSITION),m=g.normalized??!1,y=g.componentDatatype;f===Re.POINTS?d=new hf({primitiveCountMax:p.pointPrimitiveCount,allowPicking:!0,positionNormalized:m,positionDatatype:y}):f===Re.LINE_STRIP?d=new vl({primitiveCountMax:p.polylinePrimitiveCount,vertexCountMax:p.polylineVertexCount,allowPicking:!0,positionNormalized:m,positionDatatype:y}):(f===Re.TRIANGLES||f===Re.LINE_LOOP)&&(d=new Cl({primitiveCountMax:p.polygonPrimitiveCount,vertexCountMax:p.polygonVertexCount,holeCountMax:p.polygonHoleCount,triangleCountMax:p.polygonTriangleCount,allowPicking:!0,positionNormalized:m,positionDatatype:y}));let b=u.featureIds?.[0]?.propertyTableId;i.featuresByTableId.has(b)||i.featuresByTableId.set(b,new Map),i.collections.push(d),i.collectionLocalMatrices.push(O.clone(o)),i.collectionFeatureTableIds.set(d,b),Xpt(e,u,d,i.collections.length-1,i.featuresByTableId.get(b))}let s=t.children;for(let c=0;c<s.length;c++)DTe(e,s[c],o,i)}function RTe(e,t,n,i){let r=R4(t),o=0;for(let u=0;u<t.length;u++)t[u]!==r&&o++;let a=e.constructor,s=new a(o*n),c=0;for(let u=0;u<t.length;u++){let f=t[u];if(i&&(i[f]=f===r?r:c),f!==r){for(let d=0;d<n;d++)s[c*n+d]=e[f*n+d];c++}}return s}var O4=qpt;var M4=new el,L4=new Cs,N4=new oa,f1=new Sp,rQ=new cd,OTe=new sd,MTe=new O,oQ=class e{constructor(t,n,i){this._tileset=t,this._tile=n,this._resource=i,this._model=void 0,this._collections=[],this._collectionLocalMatrices=[],this._collectionFeatureTableIds=new Map,this._featuresByTableId=new Map,this._metadata=void 0,this._group=void 0,this.featurePropertiesDirty=!1,this._ready=!1,this._modelMatrix=O.clone(O.IDENTITY)}get featuresLength(){return this.batchTables.reduce((t,n)=>t+n.featuresLength,0)}get pointsLength(){return this._collections.filter(t=>t instanceof hf).reduce((t,n)=>t+n.primitiveCount,0)}get trianglesLength(){return this._collections.reduce((t,n)=>n instanceof Cl?t+n.triangleCount:n instanceof vl?t+(n.vertexCount-n.primitiveCount)*2:t,0)}get geometryByteLength(){return this._collections.reduce((t,n)=>t+n.byteLength,0)}get texturesByteLength(){return 0}get batchTableByteLength(){return this.batchTables.reduce((t,n)=>t+n.batchTableByteLength,0)}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get batchTables(){return this._model._featureTables}get batchTable(){throw new pe("Deprecated: Use `content.batchTables`.")}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get group(){return this._group}set group(t){this._group=t}getFeature(t,n){return this._featuresByTableId.get(n)?.get(t)}hasProperty(t,n,i){let r=this.getFeature(t,i);return r?r.hasProperty(n):!1}applyDebugSettings(t,n){let i=t?`color("${n.toCssHexString()}", 1.0)`:'color("white", 1.0)';this.applyStyle(new Uy({color:i}))}applyStyle(t){let n=o=>o instanceof hf,i=o=>o instanceof vl,r=o=>o instanceof Cl;for(let o of this._collections.filter(n)){let a=this._collectionFeatureTableIds.get(o);for(let s=0,c=o.primitiveCount;s<c;s++){o.get(s,M4);let u=this.getFeature(M4.featureId,a);l(t.show)&&(M4.show=t.show.evaluate(u)),l(t.color)&&t.color.evaluate(u,f1.color),l(t.pointSize)&&(f1.size=t.pointSize.evaluate(u)),l(t.pointOutlineWidth)&&(f1.outlineWidth=t.pointOutlineWidth.evaluate(u)),l(t.pointOutlineColor)&&t.pointOutlineColor.evaluate(u,f1.outlineColor),M4.setMaterial(f1)}}for(let o of this._collections.filter(i)){let a=this._collectionFeatureTableIds.get(o);for(let s=0,c=o.primitiveCount;s<c;s++){o.get(s,L4);let u=this.getFeature(L4.featureId,a);l(t.show)&&(L4.show=t.show.evaluate(u)),l(t.color)&&t.color.evaluate(u,rQ.color),l(t.lineWidth)&&(rQ.width=t.lineWidth.evaluate(u)),L4.setMaterial(rQ)}}for(let o of this._collections.filter(r)){let a=this._collectionFeatureTableIds.get(o);for(let s=0,c=o.primitiveCount;s<c;s++){o.get(s,N4);let u=this.getFeature(N4.featureId,a);l(t.show)&&(N4.show=t.show.evaluate(u)),l(t.color)&&t.color.evaluate(u,OTe.color),N4.setMaterial(OTe)}}}update(t,n){let i=this._tileset,r=i._scene?.vectorProvider;if(l(this._model)&&!this._ready){let a=this._model;a.modelMatrix=this._tile.computedTransform,a.update(n),a.ready&&(t0t(this),this._ready=!0)}O.multiplyTransformation(this._tile.computedTransform,this._modelMatrix,MTe);let o=l(r)&&this._tile._selectedFrame===n.frameNumber;for(let a=0;a<this._collections.length;a++){let s=this._collections[a];O.multiplyTransformation(MTe,this._collectionLocalMatrices[a],s.modelMatrix),gu(i._heightReference)?o&&r.markSelected(s,n.frameNumber):s.update(n)}}pick(t,n,i){}isDestroyed(){return!1}destroy(){let t=this._tileset._scene?.vectorProvider;this._model?.destroy(),this._model=void 0;for(let n of this._collections)t?.remove(n),n.destroy();return this._collections.length=0,ue(this)}static async fromGltf(t,n,i,r){let o=new e(t,n,i),a=e0t(t,n,o,r),s=await Ed.fromGltfAsync(a);return s.show=!1,o._model=s,o}};function e0t(e,t,n,i){return{gltf:i,basePath:n._resource,cull:!1,releaseGltfJson:!0,opaquePass:Pe.CESIUM_3D_TILE,modelMatrix:t.computedTransform,upAxis:e._modelUpAxis,forwardAxis:e._modelForwardAxis,incrementallyLoadTextures:!1,content:n,featureIdLabel:e.featureIdLabel,instanceFeatureIdLabel:e.instanceFeatureIdLabel,projectTo2D:e._projectTo2D,enablePick:e._enablePick,enableDebugWireframe:e._enableDebugWireframe,enableShowOutline:!1}}function t0t(e){let t=e._model.sceneGraph.components,n=_t.getAxisCorrectionMatrix(t.upAxis,t.forwardAxis,new O);O.multiplyTransformation(t.transform,n,e._modelMatrix);let i=O4(e,t);e._collections=i.collections,e._collectionLocalMatrices=i.collectionLocalMatrices,e._collectionFeatureTableIds=i.collectionFeatureTableIds,e._featuresByTableId=i.featuresByTableId}var gx=oQ;function tc(){}tc._maxSortingConcurrency=Math.max(fn.hardwareConcurrency-1,1);tc._sorterTaskProcessor=void 0;tc._taskProcessorReady=!1;tc._error=void 0;tc._getSorterTaskProcessor=function(){if(!l(tc._sorterTaskProcessor)){let e=new Yn("gaussianSplatSorter",tc._maxSortingConcurrency);e.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/wasm_splats_bg.wasm"}).then(function(t){t?tc._taskProcessorReady=!0:tc._error=new oe("Gaussian splat sorter could not be initialized.")}).catch(t=>{tc._error=t}),tc._sorterTaskProcessor=e}return tc._sorterTaskProcessor};tc.radixSortIndexes=function(e){let t=tc._getSorterTaskProcessor();if(l(tc._error))throw tc._error;if(tc._taskProcessorReady)return t.scheduleTask(e,[e.primitive.positions.buffer])};var QE=tc;function nc(){}nc._maxSortingConcurrency=Math.max(fn.hardwareConcurrency-1,1);nc._textureTaskProcessor=void 0;nc._taskProcessorReady=!1;nc._error=void 0;nc._getTextureTaskProcessor=function(){if(!l(nc._textureTaskProcessor)){let e=new Yn("gaussianSplatTextureGenerator",nc._maxSortingConcurrency);e.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/wasm_splats_bg.wasm"}).then(function(t){t?nc._taskProcessorReady=!0:nc._error=new oe("Gaussian splat sorter could not be initialized.")}).catch(t=>{nc._error=t}),nc._textureTaskProcessor=e}return nc._textureTaskProcessor};nc.generateFromAttributes=function(e){let t=nc._getTextureTaskProcessor();if(l(nc._error))throw nc._error;if(!nc._taskProcessorReady)return;let{attributes:n}=e;return t.scheduleTask(e,[n.positions.buffer,n.scales.buffer,n.rotations.buffer,n.colors.buffer])};var F4=nc;function n0t(e){let t=new ry;this.shaderBuilder=t,this.uniformMap={},this.renderStateOptions=je.getState(je.fromCache({depthTest:{enabled:!0,func:Ac.LESS_OR_EQUAL}})),this.alphaOptions=new UE,this.hasSkipLevelOfDetail=!1,e._useLogDepth&&t.addDefine("LOG_DEPTH_READ_ONLY",void 0,he.FRAGMENT)}var B4=n0t;var k4=`//
|
|
// Vertex shader for Gaussian splats.
|
|
|
|
// The splats are rendered as quads in view space. Splat attributes are loaded from a texture with precomputed 3D covariance.
|
|
|
|
// Passes local quad coordinates and color to the fragment shader for Gaussian evaluation.
|
|
//
|
|
// Discards splats outside the view frustum or with negligible screen size.
|
|
//
|
|
#if defined(HAS_SPHERICAL_HARMONICS)
|
|
const uint coefficientCount[3] = uint[3](3u,8u,15u);
|
|
const float SH_C1 = 0.48860251;
|
|
const float SH_C2[5] = float[5](
|
|
1.092548430,
|
|
-1.09254843,
|
|
0.315391565,
|
|
-1.09254843,
|
|
0.546274215
|
|
);
|
|
|
|
const float SH_C3[7] = float[7](
|
|
-0.59004358,
|
|
2.890611442,
|
|
-0.45704579,
|
|
0.373176332,
|
|
-0.45704579,
|
|
1.445305721,
|
|
-0.59004358
|
|
);
|
|
|
|
//Retrieve SH coefficient. Currently RG32UI format
|
|
uvec2 loadSHCoeff(uint splatID, int index) {
|
|
ivec2 shTexSize = textureSize(u_sphericalHarmonicsTexture, 0);
|
|
uint dims = coefficientCount[uint(u_sphericalHarmonicsDegree)-1u];
|
|
uint splatsPerRow = uint(shTexSize.x) / dims;
|
|
uint shIndex = (splatID%splatsPerRow) * dims + uint(index);
|
|
ivec2 shPosCoord = ivec2(shIndex, splatID / splatsPerRow);
|
|
return texelFetch(u_sphericalHarmonicsTexture, shPosCoord, 0).rg;
|
|
}
|
|
|
|
//Unpack RG32UI half float coefficients to vec3
|
|
vec3 halfToVec3(uvec2 packed) {
|
|
return vec3(unpackHalf2x16(packed.x), unpackHalf2x16(packed.y).x);
|
|
}
|
|
|
|
vec3 loadAndExpandSHCoeff(uint splatID, int index) {
|
|
uvec2 coeff = loadSHCoeff(splatID, index);
|
|
return halfToVec3(coeff);
|
|
}
|
|
|
|
vec3 evaluateSH(uint splatID, vec3 viewDir) {
|
|
vec3 result = vec3(0.0);
|
|
int coeffIndex = 0;
|
|
float x = viewDir.x, y = viewDir.y, z = viewDir.z;
|
|
|
|
if (u_sphericalHarmonicsDegree >= 1.) {
|
|
vec3 sh1 = loadAndExpandSHCoeff(splatID, coeffIndex++);
|
|
vec3 sh2 = loadAndExpandSHCoeff(splatID, coeffIndex++);
|
|
vec3 sh3 = loadAndExpandSHCoeff(splatID, coeffIndex++);
|
|
result += -SH_C1 * y * sh1 + SH_C1 * z * sh2 - SH_C1 * x * sh3;
|
|
|
|
if (u_sphericalHarmonicsDegree >= 2.) {
|
|
float xx = x * x;
|
|
float yy = y * y;
|
|
float zz = z * z;
|
|
float xy = x * y;
|
|
float yz = y * z;
|
|
float xz = x * z;
|
|
|
|
vec3 sh4 = loadAndExpandSHCoeff(splatID, coeffIndex++);
|
|
vec3 sh5 = loadAndExpandSHCoeff(splatID, coeffIndex++);
|
|
vec3 sh6 = loadAndExpandSHCoeff(splatID, coeffIndex++);
|
|
vec3 sh7 = loadAndExpandSHCoeff(splatID, coeffIndex++);
|
|
vec3 sh8 = loadAndExpandSHCoeff(splatID, coeffIndex++);
|
|
result += SH_C2[0] * xy * sh4 +
|
|
SH_C2[1] * yz * sh5 +
|
|
SH_C2[2] * (2.0f * zz - xx - yy) * sh6 +
|
|
SH_C2[3] * xz * sh7 +
|
|
SH_C2[4] * (xx - yy) * sh8;
|
|
|
|
if (u_sphericalHarmonicsDegree >= 3.) {
|
|
vec3 sh9 = loadAndExpandSHCoeff(splatID, coeffIndex++);
|
|
vec3 sh10 = loadAndExpandSHCoeff(splatID, coeffIndex++);
|
|
vec3 sh11 = loadAndExpandSHCoeff(splatID, coeffIndex++);
|
|
vec3 sh12 = loadAndExpandSHCoeff(splatID, coeffIndex++);
|
|
vec3 sh13 = loadAndExpandSHCoeff(splatID, coeffIndex++);
|
|
vec3 sh14 = loadAndExpandSHCoeff(splatID, coeffIndex++);
|
|
vec3 sh15 = loadAndExpandSHCoeff(splatID, coeffIndex++);
|
|
result += SH_C3[0] * y * (3.0f * xx - yy) * sh9 +
|
|
SH_C3[1] * xy * z * sh10 +
|
|
SH_C3[2] * y * (4.0f * zz - xx - yy) * sh11 +
|
|
SH_C3[3] * z * (2.0f * zz - 3.0f * xx - 3.0f * yy) * sh12 +
|
|
SH_C3[4] * x * (4.0f * zz - xx - yy) * sh13 +
|
|
SH_C3[5] * z * (xx - yy) * sh14 +
|
|
SH_C3[6] * x * (xx - 3.0f * yy) * sh15;
|
|
}
|
|
}
|
|
}
|
|
return result;
|
|
}
|
|
#endif
|
|
|
|
// Transforms and projects splat covariance into screen space and extracts the major and minor axes of the Gaussian ellipsoid
|
|
// which is used to calculate the vertex position in clip space.
|
|
vec4 calcCovVectors(vec3 viewPos, mat3 Vrk) {
|
|
vec4 t = vec4(viewPos, 1.0);
|
|
vec2 focal = vec2(czm_projection[0][0] * czm_viewport.z, czm_projection[1][1] * czm_viewport.w);
|
|
|
|
vec2 J1 = focal / t.z;
|
|
vec2 J2 = -focal * vec2(t.x, t.y) / (t.z * t.z);
|
|
mat3 J = mat3(
|
|
J1.x, 0.0, J2.x,
|
|
0.0, J1.y, J2.y,
|
|
0.0, 0.0, 0.0
|
|
);
|
|
|
|
mat3 R = mat3(czm_modelView);
|
|
|
|
//transform our covariance into view space
|
|
//ensures orientation is correct
|
|
mat3 Vrk_view = R * Vrk * transpose(R);
|
|
mat3 cov = transpose(J) * Vrk_view * J;
|
|
|
|
float diagonal1 = cov[0][0] + .3;
|
|
float offDiagonal = cov[0][1];
|
|
float diagonal2 = cov[1][1] + .3;
|
|
|
|
float mid = 0.5 * (diagonal1 + diagonal2);
|
|
float radius = length(vec2((diagonal1 - diagonal2) * 0.5, offDiagonal));
|
|
float lambda1 = mid + radius;
|
|
float lambda2 = max(mid - radius, 0.1);
|
|
|
|
vec2 diagonalVector = normalize(vec2(offDiagonal, lambda1 - diagonal1));
|
|
|
|
return vec4(
|
|
min(sqrt(2.0 * lambda1), 1024.0) * diagonalVector,
|
|
min(sqrt(2.0 * lambda2), 1024.0) * vec2(diagonalVector.y, -diagonalVector.x)
|
|
);
|
|
}
|
|
|
|
highp vec4 discardVec = vec4(0.0, 0.0, 2.0, 1.0);
|
|
|
|
void main() {
|
|
uint texIdx = uint(a_splatIndex);
|
|
// u_splatRowMask and u_splatRowShift encode the row width of the splat
|
|
// attribute texture. The texture width is always maximumTextureSize, which
|
|
// varies by GPU, so these are passed as uniforms rather than constants.
|
|
// rowMask = maximumTextureSize/2 - 1
|
|
// rowShift = log2(maximumTextureSize/2)
|
|
uint rowMask = uint(u_splatRowMask);
|
|
uint rowShift = uint(u_splatRowShift);
|
|
ivec2 posCoord = ivec2(int((texIdx & rowMask) << 1), int(texIdx >> rowShift));
|
|
vec4 splatPosition = vec4( uintBitsToFloat(uvec4(texelFetch(u_splatAttributeTexture, posCoord, 0))) );
|
|
|
|
vec4 splatViewPos = czm_modelView * vec4(splatPosition.xyz, 1.0);
|
|
vec4 clipPosition = czm_projection * splatViewPos;
|
|
|
|
float clip = 1.2 * clipPosition.w;
|
|
if (clipPosition.z < -clip || clipPosition.x < -clip || clipPosition.x > clip ||
|
|
clipPosition.y < -clip || clipPosition.y > clip) {
|
|
gl_Position = vec4(0.0, 0.0, 2.0, 1.0);
|
|
return;
|
|
}
|
|
|
|
ivec2 covCoord = ivec2(int(((texIdx & rowMask) << 1) | 1u), int(texIdx >> rowShift));
|
|
uvec4 covariance = uvec4(texelFetch(u_splatAttributeTexture, covCoord, 0));
|
|
|
|
gl_Position = clipPosition;
|
|
|
|
vec2 u1 = unpackHalf2x16(covariance.x) ;
|
|
vec2 u2 = unpackHalf2x16(covariance.y);
|
|
vec2 u3 = unpackHalf2x16(covariance.z);
|
|
mat3 Vrk = mat3(u1.x, u1.y, u2.x, u1.y, u2.y, u3.x, u2.x, u3.x, u3.y);
|
|
|
|
vec4 covVectors = calcCovVectors(splatViewPos.xyz, Vrk);
|
|
|
|
if (dot(covVectors.xy, covVectors.xy) < 4.0 && dot(covVectors.zw, covVectors.zw) < 4.0) {
|
|
gl_Position = discardVec;
|
|
return;
|
|
}
|
|
|
|
vec2 corner = vec2((gl_VertexID << 1) & 2, gl_VertexID & 2) - 1.;
|
|
|
|
gl_Position += vec4((corner.x * covVectors.xy + corner.y * covVectors.zw) / czm_viewport.zw * gl_Position.w, 0, 0);
|
|
gl_Position.z = clamp(gl_Position.z, -abs(gl_Position.w), abs(gl_Position.w));
|
|
|
|
v_vertPos = corner ;
|
|
v_splatColor = vec4(covariance.w & 0xffu, (covariance.w >> 8) & 0xffu, (covariance.w >> 16) & 0xffu, (covariance.w >> 24) & 0xffu) / 255.0;
|
|
#if defined(HAS_SPHERICAL_HARMONICS)
|
|
vec4 splatWC = czm_inverseView * splatViewPos;
|
|
vec3 viewDirModel = normalize(u_inverseModelRotation * (splatWC.xyz - u_cameraPositionWC.xyz));
|
|
|
|
v_splatColor.rgb += evaluateSH(texIdx, viewDirModel).rgb;
|
|
#endif
|
|
v_splitDirection = u_splitDirection;
|
|
}`;var z4=`//
|
|
// Fragment shader for Gaussian splats.
|
|
// Renders a Gaussian splat within a quad, discarding fragments outside the unit circle.
|
|
// Applies an approximate Gaussian falloff based on distance from the center and outputs
|
|
// a color modulated by the alpha and Gaussian weight.
|
|
//
|
|
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 A = -dot(v_vertPos, v_vertPos);
|
|
if (A < -4.) {
|
|
discard;
|
|
}
|
|
|
|
float B = exp(A * 4.) * v_splatColor.a ;
|
|
out_FragColor = vec4(v_splatColor.rgb * B , B);
|
|
}
|
|
`;var _x=new O,zTe=new O,d1=new O,bi=new $,h1=new Fe,i0t=new h,r0t=new Fe,o0t=new h,a0t=1e-12,U4=1e-5,aQ=1e-7,Os={IDLE:0,WAITING:1,SORTING:2,SORTED:3,ERROR:4},Ia={BUILDING:"BUILDING",TEXTURE_PENDING:"TEXTURE_PENDING",TEXTURE_READY:"TEXTURE_READY",SORTING:"SORTING",READY:"READY"},s0t=2,c0t=30,l0t=3,u0t=.008726646259971648,f0t=1;function d0t(e,t){let n=e._lastSteadySortFrameNumber>=0?t.frameNumber-e._lastSteadySortFrameNumber:Number.POSITIVE_INFINITY;if(e._lastSteadySortFrameNumber>=0&&n<l0t)return!1;let i=t.camera;return l(i)?!e._hasLastSteadySortCameraPosition||!e._hasLastSteadySortCameraDirection||h.distance(i.positionWC,e._lastSteadySortCameraPosition)>=f0t?!0:h.angleBetween(i.directionWC,e._lastSteadySortCameraDirection)>=u0t:!1}function LTe(e,t){e._lastSteadySortFrameNumber=t.frameNumber;let n=t.camera;l(n)&&(h.clone(n.positionWC,e._lastSteadySortCameraPosition),e._hasLastSteadySortCameraPosition=!0,h.clone(n.directionWC,e._lastSteadySortCameraDirection),e._hasLastSteadySortCameraDirection=!0)}function h0t(e,t){let n=e._selectedTileSet;if(!l(n)||n.size!==t.length)return!0;for(let i=0;i<t.length;i++)if(!n.has(t[i]))return!0;return!1}function NTe(e,t){return l(t)&&t.requestId===e._sortRequestId&&t.dataGeneration===e._splatDataGeneration}function sQ(e){l(e)&&(l(e.gaussianSplatTexture)&&(e.gaussianSplatTexture.destroy(),e.gaussianSplatTexture=void 0),l(e.sphericalHarmonicsTexture)&&(e.sphericalHarmonicsTexture.destroy(),e.sphericalHarmonicsTexture=void 0))}function FTe(e,t,n){if(!l(t))return;e._retiredTextures.push({texture:t,frameNumber:n})}function m0t(e,t){let n=e._retiredTextures;if(!l(n)||n.length===0)return;let i=[];for(let r=0;r<n.length;r++){let o=n[r];t-o.frameNumber>0?o.texture.destroy():i.push(o)}e._retiredTextures=i}function p0t(e,t){let n=e?.[t];return l(n)?n.buffer:void 0}function g0t(e,t,n,i){let r=e._aggregateScratchBuffers[t];l(r)||(r=[],e._aggregateScratchBuffers[t]=r);let o=p0t(e._snapshot,t);for(let s=0;s<r.length;s++){let c=r[s];if(c.length>=i&&c.buffer!==o)return c}let a=Y.createTypedArray(n,i);return r.push(a),a}function _0t(e,t){return e.length===t?e:e.subarray(0,t)}function y0t(e,t,n){if(!l(t.indexes)||t.state!==Ia.READY)throw new pe("Committing snapshot before it is READY.");let i=n.frameNumber,r=e._snapshot,o=l(r)?r.gaussianSplatTexture:e.gaussianSplatTexture;l(o)&&o!==t.gaussianSplatTexture&&FTe(e,o,i);let a=l(r)?r.sphericalHarmonicsTexture:e.sphericalHarmonicsTexture;l(a)&&a!==t.sphericalHarmonicsTexture&&FTe(e,a,i),e._snapshot=t,e._positions=t.positions,e._rotations=t.rotations,e._scales=t.scales,e._colors=t.colors,e._shData=t.shData,e._sphericalHarmonicsDegree=t.sphericalHarmonicsDegree,e._numSplats=t.numSplats,e._indexes=t.indexes,e.gaussianSplatTexture=t.gaussianSplatTexture,e.sphericalHarmonicsTexture=t.sphericalHarmonicsTexture,e._lastTextureWidth=t.lastTextureWidth,e._lastTextureHeight=t.lastTextureHeight,e._splatRowMask=t.splatRowMask,e._splatRowShift=t.splatRowShift,e._splatBudgetSSEScale=t.splatBudgetSSEScale??1,e._hasGaussianSplatTexture=l(t.gaussianSplatTexture),e._needsGaussianSplatTexture=!1,e._gaussianSplatTexturePending=!1,e._vertexArray=void 0,e._vertexArrayLen=-1,e._drawCommand=void 0,e._sorterPromise=void 0,e._activeSort=void 0,e._sorterState=Os.IDLE,e._dirty=!1}async function A0t(e,t,n,i){try{let r=await i,o=Ft.maximumTextureSize,a=o,s=Math.ceil(n.numSplats/(o/2)),c=Math.log2(o/2),u=o/2-1;if(s>o){let g=n.numSplats;s=o;let m=a/2;if(n.numSplats=o*m,n.positions=n.positions.subarray(0,n.numSplats*3),n.rotations=n.rotations.subarray(0,n.numSplats*4),n.scales=n.scales.subarray(0,n.numSplats*3),n.colors=n.colors.subarray(0,n.numSplats*4),l(n.shData)){let y=n.shData.length/g;n.shData=n.shData.subarray(0,Math.floor(n.numSplats*y))}n.splatBudgetSSEScale=g/n.numSplats,console.warn(`[GaussianSplat][HARD CAP] ${g} splats exceed the maximum texture capacity (${o}\xD7${m} = ${n.numSplats} splats at width=${a}). Rendering only the first ${n.numSplats} splats to avoid a WebGL crash. Increasing maximumScreenSpaceError by ${n.splatBudgetSSEScale.toFixed(2)}x next frame.`)}else n.splatBudgetSSEScale=1;let f=a*s*4,d;f<=r.data.length?d=r.data.subarray(0,f):(d=new Uint32Array(f),d.set(r.data));let p={width:a,height:s,data:d};if(n.splatRowMask=u,n.splatRowShift=c,e._pendingSnapshot!==n){n.state=Ia.BUILDING;return}if(!l(n.gaussianSplatTexture))n.gaussianSplatTexture=kTe(t.context,p);else if(n.lastTextureHeight!==p.height||n.lastTextureWidth!==p.width){let g=n.gaussianSplatTexture;n.gaussianSplatTexture=kTe(t.context,p),g.destroy()}else n.gaussianSplatTexture.copyFrom({source:{width:p.width,height:p.height,arrayBufferView:p.data}});if(n.lastTextureHeight=p.height,n.lastTextureWidth=p.width,l(n.shData)&&n.sphericalHarmonicsDegree>0){let g=n.sphericalHarmonicsTexture,m=Ft.maximumTextureSize,y=n.shCoefficientCount/3,A=Math.floor(m/y),b=A*(y*2),x=Math.ceil(n.numSplats/A);if(x>m)console.warn(`[GaussianSplat][SHTexture] ${n.numSplats} splats require SH height ${x} > maxTex ${m}. Disabling spherical harmonics for this snapshot (color-only fallback).`),n.sphericalHarmonicsDegree=0,l(g)&&g.destroy(),n.sphericalHarmonicsTexture=void 0;else{let T=new Uint32Array(m*x*2),C=0;for(let E=0;C<n.shData.length;E+=m*2)T.set(n.shData.subarray(C,C+b),E),C+=b;n.sphericalHarmonicsTexture=x0t(t.context,{data:T,width:m,height:x}),l(g)&&g.destroy()}}n.state=Ia.TEXTURE_READY}catch(r){console.error("Error generating Gaussian splat texture:",r),n.state=Ia.BUILDING}}async function b0t(e,t,n,i){try{let r=await i;if(!l(n)||n.snapshot!==e._pendingSnapshot)return;let o=n.expectedCount,a=o,s=r?.length;if(o!==a||s!==o){e._pendingSortPromise=void 0,e._pendingSort=void 0,n.snapshot.state===Ia.SORTING&&(n.snapshot.state=Ia.TEXTURE_READY);return}let c=n.snapshot;c.indexes=r,c.state=Ia.READY,e._pendingSortPromise=void 0,e._pendingSort=void 0,y0t(e,c,t),e._pendingSnapshot=void 0,Fl.buildGSplatDrawCommand(e,t)}catch(r){if(!l(n)||n.snapshot!==e._pendingSnapshot)return;e._pendingSortPromise=void 0,e._pendingSort=void 0,n.snapshot.state===Ia.SORTING&&(n.snapshot.state=Ia.TEXTURE_READY),e._sorterState=Os.ERROR,e._sorterError=r}}async function BTe(e,t,n){try{let i=await n,r=NTe(e,t),o=t?.expectedCount,a=o,s=i?.length;if(!r||(o!==a||s!==o)){r&&(e._sorterPromise=void 0,e._sorterState=Os.IDLE);return}e._indexes=i,e._sorterState=Os.SORTED}catch(i){if(!NTe(e,t))return;e._sorterState=Os.ERROR,e._sorterError=i}}function x0t(e,t){return new Et({context:e,source:{width:t.width,height:t.height,arrayBufferView:t.data},preMultiplyAlpha:!1,skipColorSpaceConversion:!0,pixelFormat:He.RG_INTEGER,pixelDatatype:ke.UNSIGNED_INT,flipY:!1,sampler:Ut.NEAREST})}function kTe(e,t){return new Et({context:e,source:{width:t.width,height:t.height,arrayBufferView:t.data},preMultiplyAlpha:!1,skipColorSpaceConversion:!0,pixelFormat:He.RGBA_INTEGER,pixelDatatype:ke.UNSIGNED_INT,flipY:!1,sampler:Ut.NEAREST})}function Fl(e){e=e??H.EMPTY_OBJECT,this._positions=void 0,this._rotations=void 0,this._scales=void 0,this._colors=void 0,this._indexes=void 0,this._numSplats=0,this._needsGaussianSplatTexture=!0,this._snapshot=void 0,this._pendingSnapshot=void 0,this._retiredTextures=[],this._aggregateScratchBuffers={positions:[],scales:[],rotations:[],colors:[]},this._scratchAggregateShBuffer=void 0,this._selectedTilesStableFrames=0,this._needsSnapshotRebuild=!1,this._snapshotRebuildStallFrames=0,this._prevViewMatrix=new O,this._debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.gaussianSplatTexture=void 0,this.sphericalHarmonicsTexture=void 0,this._lastTextureWidth=0,this._lastTextureHeight=0,this._vertexArray=void 0,this._vertexArrayLen=-1,this._splitDirection=jo.NONE,this._dirty=!1,this._tileset=e.tileset,this._baseTilesetUpdate=this._tileset.update,this._tileset.update=this._wrappedUpdate.bind(this),this._tileset.tileLoad.addEventListener(this.onTileLoad,this),this._tileset.tileVisible.addEventListener(this.onTileVisible,this),this.selectedTileLength=0,this._selectedTileSet=new Set,this._ready=!1,this._hasGaussianSplatTexture=!1,this._gaussianSplatTexturePending=!1,this._drawCommand=void 0,this._drawCommandModelMatrix=new O,this._rootTransform=void 0,this._axisCorrectionMatrix=_t.getAxisCorrectionMatrix(zi.Y,zi.X,new O),this._shInverseRotation=new $,this._isDestroyed=!1,this._sorterState=Os.IDLE,this._sorterPromise=void 0,this._splatDataGeneration=0,this._sortRequestId=0,this._activeSort=void 0,this._pendingSortPromise=void 0,this._pendingSort=void 0,this._lastSteadySortFrameNumber=-1,this._lastSteadySortCameraPosition=new h,this._hasLastSteadySortCameraPosition=!1,this._lastSteadySortCameraDirection=new h,this._hasLastSteadySortCameraDirection=!1,this._sorterError=void 0,this._splatRowMask=0,this._splatRowShift=0,this._splatBudgetSSEScale=1}Object.defineProperties(Fl.prototype,{ready:{get:function(){return this._ready}},isStable:{get:function(){return!this._dirty&&(!l(this._pendingSnapshot)||this._pendingSnapshot.state===Ia.READY)}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,this._dirty=!0)}}});Fl.prototype._wrappedUpdate=function(e){let t=this._tileset;if(this._splatBudgetSSEScale!==1){let n=t.maximumScreenSpaceError;t.maximumScreenSpaceError*=this._splatBudgetSSEScale,this._baseTilesetUpdate.call(t,e),t.maximumScreenSpaceError=n}else this._baseTilesetUpdate.call(t,e);this.update(e)};Fl.prototype.destroy=function(){if(this._positions=void 0,this._rotations=void 0,this._scales=void 0,this._colors=void 0,this._indexes=void 0,sQ(this._pendingSnapshot),sQ(this._snapshot),l(this._retiredTextures))for(let t=0;t<this._retiredTextures.length;t++)this._retiredTextures[t].texture.destroy();this._retiredTextures=[],this._pendingSnapshot=void 0,this._snapshot=void 0,this._aggregateScratchBuffers=void 0,this.gaussianSplatTexture=void 0,this.sphericalHarmonicsTexture=void 0;let e=this._drawCommand;return l(e)&&(e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy()),l(this._vertexArray)&&(this._vertexArray.destroy(),this._vertexArray=void 0),this._tileset.update=this._baseTilesetUpdate.bind(this._tileset),ue(this)};Fl.prototype.isDestroyed=function(){return this._isDestroyed};Fl.prototype.onTileLoad=function(e){this._dirty=!0};Fl.prototype.onTileVisible=function(e){};Fl.transformTile=function(e){let t=e.computedTransform,n=e.content.gltfPrimitive,i=e.tileset.gaussianSplatPrimitive;i._rootTransform===void 0&&(i._rootTransform=mt.eastNorthUpToFixedFrame(e.tileset.boundingSphere.center));let r=i._rootTransform,o=O.multiplyTransformation(t,i._axisCorrectionMatrix,_x);O.multiplyTransformation(o,e.content.worldTransform,o);let a=O.inverse(r,zTe),s=O.multiplyTransformation(a,o,_x),c=e.content._lastSplatTransform;if(e.content._transformed&&l(c)&&O.equalsEpsilon(s,c,a0t))return;let u=e.content.positions,f=e.content.rotations,d=e.content.scales,p=Math.sqrt(s[0]*s[0]+s[1]*s[1]+s[2]*s[2]),g=Math.sqrt(s[4]*s[4]+s[5]*s[5]+s[6]*s[6]),m=Math.sqrt(s[8]*s[8]+s[9]*s[9]+s[10]*s[10]);bi[0]=s[0]/p,bi[1]=s[1]/p,bi[2]=s[2]/p,bi[3]=s[4]/g,bi[4]=s[5]/g,bi[5]=s[6]/g,bi[6]=s[8]/m,bi[7]=s[9]/m,bi[8]=s[10]/m;let y=bi[0]*bi[3]+bi[1]*bi[4]+bi[2]*bi[5],A=bi[0]*bi[6]+bi[1]*bi[7]+bi[2]*bi[8],b=bi[3]*bi[6]+bi[4]*bi[7]+bi[5]*bi[8],x=Math.abs(p-1)<=aQ&&Math.abs(g-1)<=aQ&&Math.abs(m-1)<=aQ,T=Math.abs(y)<=U4&&Math.abs(A)<=U4&&Math.abs(b)<=U4,C=bi[0]*(bi[4]*bi[8]-bi[5]*bi[7])-bi[3]*(bi[1]*bi[8]-bi[2]*bi[7])+bi[6]*(bi[1]*bi[5]-bi[2]*bi[4]),E=x&&T&&Math.abs(C-1)<=U4;Fe.fromRotationMatrix(bi,h1),Fe.normalize(h1,h1);let w=_t.getAttributeBySemantic(n,ot.POSITION).typedArray,D=_t.getAttributeBySemantic(n,ot.ROTATION).typedArray,R=_t.getAttributeBySemantic(n,ot.SCALE).typedArray,M=i0t,N=r0t,_=o0t;for(let v=0;v<w.length/3;++v)M.x=w[v*3],M.y=w[v*3+1],M.z=w[v*3+2],N.x=D[v*4],N.y=D[v*4+1],N.z=D[v*4+2],N.w=D[v*4+3],_.x=R[v*3],_.y=R[v*3+1],_.z=R[v*3+2],E?(O.multiplyByPoint(s,M,M),Fe.multiply(h1,N,N),Fe.normalize(N,N)):(O.fromTranslationQuaternionRotationScale(M,N,_,d1),O.multiplyTransformation(s,d1,d1),O.getTranslation(d1,M),O.getScale(d1,_),Fe.multiply(h1,N,N),Fe.normalize(N,N)),u[v*3]=M.x,u[v*3+1]=M.y,u[v*3+2]=M.z,f[v*4]=N.x,f[v*4+1]=N.y,f[v*4+2]=N.z,f[v*4+3]=N.w,d[v*3]=_.x,d[v*3+1]=_.y,d[v*3+2]=_.z;e.content._lastSplatTransform=O.clone(s,e.content._lastSplatTransform),e.content._transformed=!0};Fl.generateSplatTexture=function(e,t,n){if(!l(n)||n.state!==Ia.BUILDING)return;n.state=Ia.TEXTURE_PENDING;let i=F4.generateFromAttributes({attributes:{positions:new Float32Array(n.positions),scales:new Float32Array(n.scales),rotations:new Float32Array(n.rotations),colors:new Uint8Array(n.colors)},count:n.numSplats});if(!l(i)){n.state=Ia.BUILDING;return}A0t(e,t,n,i)};Fl.buildGSplatDrawCommand=function(e,t){let n=e._tileset,i=new B4(e),{shaderBuilder:r}=i,o=i.renderStateOptions;o.cull.enabled=!1,o.depthMask=!1,o.depthTest.enabled=!0,o.blending=en.PRE_MULTIPLIED_ALPHA_BLEND,i.alphaOptions.pass=Pe.GAUSSIAN_SPLATS,r.addAttribute("vec2","a_screenQuadPosition"),r.addAttribute("float","a_splatIndex"),r.addVarying("vec4","v_splatColor"),r.addVarying("vec2","v_vertPos"),r.addUniform("float","u_splitDirection",he.VERTEX),r.addVarying("float","v_splitDirection"),r.addUniform("highp usampler2D","u_splatAttributeTexture",he.VERTEX),r.addUniform("float","u_sphericalHarmonicsDegree",he.VERTEX),r.addUniform("float","u_splatScale",he.VERTEX),r.addUniform("vec3","u_cameraPositionWC",he.VERTEX),r.addUniform("mat3","u_inverseModelRotation",he.VERTEX);let a=i.uniformMap;r.addUniform("int","u_splatRowMask",he.VERTEX),r.addUniform("int","u_splatRowShift",he.VERTEX);let s=e.gaussianSplatTexture;a.u_splatAttributeTexture=function(){return s},a.u_splatRowMask=function(){return e._splatRowMask},a.u_splatRowShift=function(){return e._splatRowShift},e._sphericalHarmonicsDegree>0&&(r.addDefine("HAS_SPHERICAL_HARMONICS","1",he.VERTEX),r.addUniform("highp usampler2D","u_sphericalHarmonicsTexture",he.VERTEX),a.u_sphericalHarmonicsTexture=function(){return e.sphericalHarmonicsTexture}),a.u_sphericalHarmonicsDegree=function(){return e._sphericalHarmonicsDegree},a.u_cameraPositionWC=function(){return h.clone(t.camera.positionWC)},a.u_inverseModelRotation=function(){return e._shInverseRotation},a.u_splitDirection=function(){return e.splitDirection};let c=l(e._indexes)?e._indexes.length:e._numSplats;i.instanceCount=c,i.count=4,i.primitiveType=Re.TRIANGLE_STRIP,r.addVertexLines(k4),r.addFragmentLines(z4);let u=r.buildShaderProgram(t.context),f=Xe(je.fromCache(i.renderStateOptions),!0);f.cull.face=_t.getCullFace(n.modelMatrix,Re.TRIANGLE_STRIP),f=je.fromCache(f);let d={screenQuadPosition:0,splatIndex:2},p=new Tn.Attribute;if(p.name="_SPLAT_INDEXES",p.typedArray=e._indexes,p.componentDatatype=Y.UNSIGNED_INT,p.type=Vt.SCALAR,p.normalized=!1,p.count=i.instanceCount,p.constant=0,p.instanceDivisor=1,!l(e._vertexArray)||e._indexes.length>e._vertexArrayLen){let b=new Tt({attributes:{screenQuadPosition:new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1],name:"_SCREEN_QUAD_POS",variableName:"screenQuadPosition"}),splatIndex:{...p,variableName:"splatIndex"}},primitiveType:Re.TRIANGLE_STRIP});e._vertexArray=Vn.fromGeometry({context:t.context,geometry:b,attributeLocations:d,bufferUsage:Oe.DYNAMIC_DRAW,interleave:!1})}else e._vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(e._indexes);e._vertexArrayLen=e._indexes.length;let m=O.clone(e._rootTransform,e._drawCommandModelMatrix),y=e._vertexArray,A=new nt({boundingVolume:n.boundingSphere,modelMatrix:m,uniformMap:a,renderState:f,vertexArray:y,shaderProgram:u,cull:o.cull.enabled,pass:Pe.GAUSSIAN_SPLATS,count:i.count,owner:e,instanceCount:i.instanceCount,primitiveType:Re.TRIANGLE_STRIP,debugShowBoundingVolume:n.debugShowBoundingVolume,castShadows:!1,receiveShadows:!1});e._drawCommand=A};Fl.prototype.update=function(e){let t=this._tileset;if(m0t(this,e.frameNumber),!t.show)return;if(this._drawCommand&&e.commandList.push(this._drawCommand),t._modelMatrixChanged){this._dirty=!0;return}let n=l(this._rootTransform);if(e.passes.pick===!0)return;this.splitDirection!==t.splitDirection&&(this.splitDirection=t.splitDirection);let i=e.camera;if(l(i)){if(this._sorterState===Os.IDLE){let r=t._selectedTiles.length!==0&&h0t(this,t._selectedTiles);t._selectedTiles.length===0?(this._selectedTilesStableFrames=0,this._needsSnapshotRebuild=!1,this._snapshotRebuildStallFrames=0):r?this._selectedTilesStableFrames=0:this._selectedTilesStableFrames++,(r||this._dirty)&&(this._needsSnapshotRebuild=!0);let o=this._selectedTilesStableFrames>=s0t,a=!l(this._snapshot)&&!l(this._pendingSnapshot)&&!l(this._drawCommand);this._needsSnapshotRebuild&&t._selectedTiles.length!==0?this._snapshotRebuildStallFrames++:this._snapshotRebuildStallFrames=0;let s=o||a||this._snapshotRebuildStallFrames>=c0t;if(!(this._dirty||this._needsSnapshotRebuild||r||l(this._pendingSnapshot)||l(this._pendingSortPromise)||!l(this._drawCommand))&&O.equals(i.viewMatrix,this._prevViewMatrix))return;if(t._selectedTiles.length!==0&&this._needsSnapshotRebuild&&s){this._splatDataGeneration++,this._activeSort=void 0,this._sorterPromise=void 0,this._sorterState=Os.IDLE,this._pendingSortPromise=void 0,this._pendingSort=void 0,l(this._pendingSnapshot)&&sQ(this._pendingSnapshot);let u=t._selectedTiles;this._rootTransform=mt.eastNorthUpToFixedFrame(t.boundingSphere.center);{let C=u[0],E=O.multiplyTransformation(C.computedTransform,this._axisCorrectionMatrix,zTe);O.multiplyTransformation(E,C.content.worldTransform??O.IDENTITY,E),O.getRotation(O.inverse(E,E),this._shInverseRotation)}for(let C of u)Fl.transformTile(C);let f=u.reduce((C,E)=>C+E.content.pointsLength,0),d=(C,E,w,D)=>{let R,M=0,N=0;for(let _ of u){let v=w(_.content),S=l(D)?D:Vt.getNumberOfComponents(v.type),P=l(v.typedArray)?v.typedArray:v;N+=P.length,l(R)||(R=g0t(this,C,E,f*S))}if(!l(R))return Y.createTypedArray(E,0);for(let _ of u){let v=_.content,S=w(v),P=l(S.typedArray)?S.typedArray:S;R.set(P,M),M+=P.length}return _0t(R,N)},p=()=>{let C=0;for(let R of u)if(R.content.sphericalHarmonicsDegree>0){switch(R.content.sphericalHarmonicsDegree){case 1:C=9;break;case 2:C=24;break;case 3:C=45;break}break}if(C===0)return;let E=f*(C*(2/3));(!l(this._scratchAggregateShBuffer)||this._scratchAggregateShBuffer.length<E)&&(this._scratchAggregateShBuffer=new Uint32Array(E));let w=this._scratchAggregateShBuffer,D=0;for(let R of u){let M=R.content.packedSphericalHarmonicsData;R.content.sphericalHarmonicsDegree>0&&(w.set(M,D),D+=M.length)}return D<w.length?w.subarray(0,D):w},g=d("positions",Y.FLOAT,C=>C.positions,3),m=d("scales",Y.FLOAT,C=>C.scales,3),y=d("rotations",Y.FLOAT,C=>C.rotations,4),A=d("colors",Y.UNSIGNED_BYTE,C=>_t.getAttributeBySemantic(C.gltfPrimitive,ot.COLOR)),b=u[0].content.sphericalHarmonicsDegree,x=b>0?u[0].content.sphericalHarmonicsCoefficientCount:0,T=p();this._pendingSnapshot={generation:this._splatDataGeneration,positions:g,rotations:y,scales:m,colors:A,shData:T,sphericalHarmonicsDegree:b,shCoefficientCount:x,numSplats:f,indexes:void 0,gaussianSplatTexture:void 0,sphericalHarmonicsTexture:void 0,lastTextureWidth:0,lastTextureHeight:0,splatRowMask:0,splatRowShift:0,state:Ia.BUILDING},this.selectedTileLength=t._selectedTiles.length,this._selectedTileSet=new Set(t._selectedTiles),this._dirty=!1,this._needsSnapshotRebuild=!1,this._snapshotRebuildStallFrames=0}if(l(this._pendingSnapshot)){let u=this._pendingSnapshot;if(u.state===Ia.BUILDING){Fl.generateSplatTexture(this,e,u);return}if(u.state===Ia.TEXTURE_PENDING||u.state===Ia.TEXTURE_READY&&!l(u.gaussianSplatTexture)||!n)return;if(O.clone(i.viewMatrix,this._prevViewMatrix),O.multiply(i.viewMatrix,this._rootTransform,_x),u.state===Ia.TEXTURE_READY&&!l(this._pendingSortPromise)){let f=++this._sortRequestId,d=this._splatDataGeneration;this._pendingSort={requestId:f,dataGeneration:d,expectedCount:u.numSplats,snapshot:u};let p=QE.radixSortIndexes({primitive:{positions:new Float32Array(u.positions),modelView:Float32Array.from(_x),count:u.numSplats},sortType:"Index"});if(!l(p)){this._pendingSortPromise=void 0,this._pendingSort=void 0,u.state=Ia.TEXTURE_READY;return}this._pendingSortPromise=p,u.state=Ia.SORTING;let g=this._pendingSort;b0t(this,e,g,p);return}if(!l(this._pendingSortPromise)){u.state===Ia.SORTING&&(u.state=Ia.TEXTURE_READY);return}return}if(this._numSplats===0||!n)return;if(O.clone(i.viewMatrix,this._prevViewMatrix),O.multiply(i.viewMatrix,this._rootTransform,_x),!l(this._sorterPromise)){if(!d0t(this,e))return;let u=++this._sortRequestId,f=this._splatDataGeneration,d=this._numSplats;this._activeSort={requestId:u,dataGeneration:f,expectedCount:d};let p=QE.radixSortIndexes({primitive:{positions:new Float32Array(this._positions),modelView:Float32Array.from(_x),count:this._numSplats},sortType:"Index"});if(this._sorterPromise=p,l(p)){LTe(this,e);let g=this._activeSort;this._sorterState=Os.SORTING,BTe(this,g,p);return}}if(!l(this._sorterPromise)){this._sorterState=Os.WAITING;return}this._sorterState=Os.SORTING;return}else if(this._sorterState===Os.WAITING){if(!l(this._sorterPromise)){let r=++this._sortRequestId,o=this._splatDataGeneration,a=this._numSplats;this._activeSort={requestId:r,dataGeneration:o,expectedCount:a};let s=QE.radixSortIndexes({primitive:{positions:new Float32Array(this._positions),modelView:Float32Array.from(_x),count:this._numSplats},sortType:"Index"});if(this._sorterPromise=s,l(s)){LTe(this,e);let c=this._activeSort;this._sorterState=Os.SORTING,BTe(this,c,s);return}}if(!l(this._sorterPromise)){this._sorterState=Os.WAITING;return}this._sorterState=Os.SORTING;return}else{if(this._sorterState===Os.SORTING)return;if(this._sorterState===Os.SORTED)Fl.buildGSplatDrawCommand(this,e),this._sorterState=Os.IDLE,this._dirty=!1,this._sorterPromise=void 0,this._activeSort=void 0;else if(this._sorterState===Os.ERROR)throw this._sorterError}this._dirty=!1}};var V4=Fl;var lQ=class e{constructor(t,n,i,r){this._tileset=n,this._tile=i,this._resource=r,this._loader=t,l(this._tileset.gaussianSplatPrimitive)||(this._tileset.gaussianSplatPrimitive=new V4({tileset:this._tileset})),this._positions=void 0,this._rotations=void 0,this._scales=void 0,this.gltfPrimitive=void 0,this.worldTransform=void 0,this.featurePropertiesDirty=!1,this._metadata=void 0,this._group=void 0,this._ready=!1,this._transformed=!1,this._sphericalHarmonicsDegree=0,this._sphericalHarmonicsCoefficientCount=0,this._packedSphericalHarmonicsData=void 0,this._lastSplatTransform=void 0}static tilesetRequiresGaussianSplattingExt(t){let n=!1;return t.isGltfExtensionRequired instanceof Function&&(n=t.isGltfExtensionRequired("KHR_gaussian_splatting")&&t.isGltfExtensionRequired("KHR_gaussian_splatting_compression_spz_2"),t.isGltfExtensionRequired("KHR_spz_gaussian_splats_compression")&&qs("KHR_spz_gaussian_splats_compression",`Support for the original KHR_spz_gaussian_splats_compression extension has been removed in favor of the up to date KHR_gaussian_splatting and KHR_gaussian_splatting_compression_spz_2 extensions
|
|
|
|
Please retile your tileset with the KHR_gaussian_splatting and KHR_gaussian_splatting_compression_spz_2 extensions.`)),n}get featuresLength(){return 0}get pointsLength(){return this.gltfPrimitive.attributes[0].count}get trianglesLength(){return 0}get geometryByteLength(){return 0}get texturesByteLength(){let t=this._tileset?.gaussianSplatPrimitive;if(!l(t))return 0;let n=t.gaussianSplatTexture,i=t.selectedTileLength;return!l(n)||i===0?0:n.sizeInBytes/i}get batchTableByteLength(){return 0}get innerContents(){}get ready(){return this._ready}get transformed(){return this._transformed}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get batchTable(){}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get group(){return this._group}set group(t){this._group=t}get positions(){return this._positions}get rotations(){return this._rotations}get scales(){return this._scales}get sphericalHarmonicsCoefficientCount(){return this._sphericalHarmonicsCoefficientCount}get sphericalHarmonicsDegree(){return this._sphericalHarmonicsDegree}get packedSphericalHarmonicsData(){return this._packedSphericalHarmonicsData}static async fromGltf(t,n,i,r){let o=i,a=De.createIfNeeded(o),s={releaseGltfJson:!1,upAxis:zi.Y,forwardAxis:zi.Z};l(r.asset)?(s.gltfJson=r,s.baseResource=a,s.gltfResource=a):r instanceof Uint8Array?(s.typedArray=r,s.baseResource=a,s.gltfResource=a):s.gltfResource=De.createIfNeeded(r);let c=new Ad(s);try{await c.load()}catch(u){throw c.destroy(),new oe(`Failed to load glTF: ${u.message}`)}return new e(c,t,n,i)}update(t,n){let i=this._loader;if(!this._ready){if(n.afterRender.push(()=>!0),!l(i)){this._ready=!0;return}if(this._resourcesLoaded){this.gltfPrimitive=i.components.scene.nodes[0].primitives[0],this.worldTransform=i.components.scene.nodes[0].matrix,this._ready=!0,this._positions=_t.getAttributeBySemantic(this.gltfPrimitive,ot.POSITION).typedArray.slice(),this._rotations=_t.getAttributeBySemantic(this.gltfPrimitive,ot.ROTATION).typedArray.slice(),this._scales=_t.getAttributeBySemantic(this.gltfPrimitive,ot.SCALE).typedArray.slice();let{l:r,n:o}=C0t(this.gltfPrimitive.attributes);this._sphericalHarmonicsDegree=r,this._sphericalHarmonicsCoefficientCount=o,this._packedSphericalHarmonicsData=w0t(this);return}this._resourcesLoaded=i.process(n)}}hasProperty(t,n){return!1}getFeature(t){}applyDebugSettings(t,n){}applyStyle(t){}pick(t,n,i){}isDestroyed(){return this.isDestroyed}destroy(){return this.splatPrimitive=void 0,this._tile=void 0,this._tileset=void 0,this._resource=void 0,this._ready=!1,this._group=void 0,this._metadata=void 0,this._resourcesLoaded=!1,this._lastSplatTransform=void 0,l(this._loader)&&(this._loader.destroy(),this._loader=void 0),ue(this)}};function T0t(e){return`${e.startsWith("KHR_gaussian_splatting:")?"KHR_gaussian_splatting:":"_"}SH_DEGREE_`}function C0t(e){switch(e.filter(n=>n.name.includes("SH_DEGREE_")).length){default:case 0:return{l:0,n:0};case 3:return{l:1,n:9};case 8:return{l:2,n:24};case 15:return{l:3,n:45}}}var UTe=new ArrayBuffer(4),v0t=new Float32Array(UTe),E0t=new Uint32Array(UTe);function cQ(e){v0t[0]=e;let t=E0t[0],n=t>>31&1,i=t>>23&255,r=t&8388607,o;if(i===255)o=n<<15|31744|(r?512:0);else if(i===0)o=n<<15;else{let a=i-127+15;a>=31?o=n<<15|31744:a<=0?o=n<<15:o=n<<15|a<<10|r>>>13}return o}function S0t(e){let t=T0t(e),n="_COEF_",i=t.length,r=e.indexOf(n,i),o=parseInt(e.slice(i,r),10),a=parseInt(e.slice(r+n.length),10);return{l:o,n:a}}function w0t(e){let t=e.sphericalHarmonicsDegree,n=e.sphericalHarmonicsCoefficientCount,i=e.pointsLength*(n*(2/3)),r=new Uint32Array(i),o=e.gltfPrimitive.attributes.filter(u=>u.name.includes("SH_DEGREE_")),a=0,s=[0,9,24];switch(t){case 1:a=9;break;case 2:a=24;break;case 3:a=45;break}o.sort((u,f)=>u.name<f.name?-1:u.name>f.name?1:0);let c=a*(2/3);for(let u=0;u<o.length;u++){let{l:f,n:d}=S0t(o[u].name);for(let p=0;p<e.pointsLength;p++){let g=s[f-1]*2/3,m=p*c+g+d*2,y=p*3;r[m]=cQ(o[u].typedArray[y])|cQ(o[u].typedArray[y+1])<<16,r[m+1]=cQ(o[u].typedArray[y+2])}}return r}var yx=lQ;var VTe={b3dm:function(e,t,n,i,r){return Sd.fromB3dm(e,t,n,i,r)},pnts:function(e,t,n,i,r){return Sd.fromPnts(e,t,n,i,r)},i3dm:function(e,t,n,i,r){return Sd.fromI3dm(e,t,n,i,r)},cmpt:function(e,t,n,i,r){return a4.fromTileType(e,t,n,i,r,VTe)},externalTileset:function(e,t,n,i){return p4.fromJson(e,t,n,i)},geom:function(e,t,n,i,r){return new h4(e,t,n,i,r)},vctr:function(e,t,n,i,r){return new E4(e,t,n,i,r)},subt:function(e,t,n,i,r){return t1.fromSubtreeJson(e,t,n,void 0,i,r)},subtreeJson:function(e,t,n,i){return t1.fromSubtreeJson(e,t,n,i)},glb:function(e,t,n,i,r){if(i.byteLength<12)throw new oe("Invalid glb content");let s=new DataView(i,r).getUint32(8,!0),c=new Uint8Array(i,r,s);return yx.tilesetRequiresGaussianSplattingExt(e)?yx.fromGltf(e,t,n,c):e.hasExtension("3DTILES_content_gltf_vector")||e.isGltfExtensionUsed("CESIUM_mesh_vector")?gx.fromGltf(e,t,n,c):Sd.fromGltf(e,t,n,c)},gltf:function(e,t,n,i){return yx.tilesetRequiresGaussianSplattingExt(e)?yx.fromGltf(e,t,n,i):e.hasExtension("3DTILES_content_gltf_vector")||e.isGltfExtensionUsed("CESIUM_mesh_vector")?gx.fromGltf(e,t,n,i):Sd.fromGltf(e,t,n,i)},geoJson:function(e,t,n,i){return Sd.fromGeoJson(e,t,n,i)}},eS=VTe;var jTe={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5};Object.freeze(jTe);var co=jTe;var Pd={BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",COMPOSITE:"cmpt",POINT_CLOUD:"pnts",VECTOR:"vctr",GEOMETRY:"geom",GLTF:"gltf",GLTF_BINARY:"glb",IMPLICIT_SUBTREE:"subt",IMPLICIT_SUBTREE_JSON:"subtreeJson",EXTERNAL_TILESET:"externalTileset",MULTIPLE_CONTENT:"multipleContent",GEOJSON:"geoJson",VOXEL_BINARY:"voxl",VOXEL_JSON:"voxelJson"};Pd.isBinaryFormat=function(e){switch(e){case Pd.BATCHED_3D_MODEL:case Pd.INSTANCED_3D_MODEL:case Pd.COMPOSITE:case Pd.POINT_CLOUD:case Pd.VECTOR:case Pd.GEOMETRY:case Pd.IMPLICIT_SUBTREE:case Pd.VOXEL_BINARY:case Pd.GLTF_BINARY:return!0;default:return!1}};Object.freeze(Pd);var Ms=Pd;var HTe={NOT_COMPUTED:-1,USE_OPTIMIZATION:1,SKIP_OPTIMIZATION:0};Object.freeze(HTe);var qh=HTe;var hs={RENDER:0,PICK:1,SHADOW:2,PRELOAD:3,PRELOAD_FLIGHT:4,REQUEST_RENDER_MODE_DEFER_CHECK:5,MOST_DETAILED_PRELOAD:6,MOST_DETAILED_PICK:7,NUMBER_OF_PASSES:8},fg=new Array(hs.NUMBER_OF_PASSES);fg[hs.RENDER]=Object.freeze({pass:hs.RENDER,isRender:!0,requestTiles:!0,ignoreCommands:!1});fg[hs.PICK]=Object.freeze({pass:hs.PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});fg[hs.SHADOW]=Object.freeze({pass:hs.SHADOW,isRender:!1,requestTiles:!0,ignoreCommands:!1});fg[hs.PRELOAD]=Object.freeze({pass:hs.PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});fg[hs.PRELOAD_FLIGHT]=Object.freeze({pass:hs.PRELOAD_FLIGHT,isRender:!1,requestTiles:!0,ignoreCommands:!0});fg[hs.REQUEST_RENDER_MODE_DEFER_CHECK]=Object.freeze({pass:hs.REQUEST_RENDER_MODE_DEFER_CHECK,isRender:!1,requestTiles:!0,ignoreCommands:!0});fg[hs.MOST_DETAILED_PRELOAD]=Object.freeze({pass:hs.MOST_DETAILED_PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});fg[hs.MOST_DETAILED_PICK]=Object.freeze({pass:hs.MOST_DETAILED_PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});hs.getPassOptions=function(e){return fg[e]};Object.freeze(hs);var lo=hs;var uQ=class{constructor(t,n){this._tileset=t,this._tile=n,this.featurePropertiesDirty=!1}get featuresLength(){return 0}get pointsLength(){return 0}get trianglesLength(){return 0}get geometryByteLength(){return 0}get texturesByteLength(){return 0}get batchTableByteLength(){return 0}get innerContents(){}get ready(){return!0}get tileset(){return this._tileset}get tile(){return this._tile}get url(){}get metadata(){}set metadata(t){}get batchTable(){}get group(){}set group(t){}hasProperty(t,n){return!1}getFeature(t){}applyDebugSettings(t,n){}applyStyle(t){}update(t,n){}pick(t,n,i){}isDestroyed(){return!1}destroy(){return ue(this)}},dg=uQ;function hg(e){e=e??H.EMPTY_OBJECT;let t=e.content,n=e.class;this._class=n,this._properties=t.properties,this._extensions=t.extensions,this._extras=t.extras}Object.defineProperties(hg.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});hg.prototype.hasProperty=function(e){return qn.hasProperty(e,this._properties,this._class)};hg.prototype.hasPropertyBySemantic=function(e){return qn.hasPropertyBySemantic(e,this._properties,this._class)};hg.prototype.getPropertyIds=function(e){return qn.getPropertyIds(this._properties,this._class,e)};hg.prototype.getProperty=function(e){return qn.getProperty(e,this._properties,this._class)};hg.prototype.setProperty=function(e,t){return qn.setProperty(e,t,this._properties,this._class)};hg.prototype.getPropertyBySemantic=function(e){return qn.getPropertyBySemantic(e,this._properties,this._class)};hg.prototype.setPropertyBySemantic=function(e,t){return qn.setPropertyBySemantic(e,t,this._properties,this._class)};var j4=hg;function fQ(e,t){let n=Qi(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){fQ._oneTimeWarning("findContentMetadata-missing-root-schema","Could not find a metadata schema for content metadata. For tilesets that contain external tilesets, make sure the schema is added to the root tileset.json.");return}let i=e.schema.classes??H.EMPTY_OBJECT;if(l(n.class)){let r=i[n.class];return new j4({content:n,class:r})}}fQ._oneTimeWarning=pt;var tS=fQ;function I0t(e,t){let n=e.metadataExtension;if(!l(n))return;let i=n.groups,r=Qi(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"].group:t.group;if(typeof r=="number")return i[r];let o=n.groupIds.findIndex(function(a){return a===r});return o>=0?i[o]:void 0}var nS=I0t;function mg(e){e=e??H.EMPTY_OBJECT;let t=e.tile,n=e.class;this._class=n,this._properties=t.properties,this._extensions=t.extensions,this._extras=t.extras}Object.defineProperties(mg.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});mg.prototype.hasProperty=function(e){return qn.hasProperty(e,this._properties,this._class)};mg.prototype.hasPropertyBySemantic=function(e){return qn.hasPropertyBySemantic(e,this._properties,this._class)};mg.prototype.getPropertyIds=function(e){return qn.getPropertyIds(this._properties,this._class,e)};mg.prototype.getProperty=function(e){return qn.getProperty(e,this._properties,this._class)};mg.prototype.setProperty=function(e,t){return qn.setProperty(e,t,this._properties,this._class)};mg.prototype.getPropertyBySemantic=function(e){return qn.getPropertyBySemantic(e,this._properties,this._class)};mg.prototype.setPropertyBySemantic=function(e,t){return qn.setPropertyBySemantic(e,t,this._properties,this._class)};var H4=mg;function dQ(e,t){let n=Qi(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){dQ._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??H.EMPTY_OBJECT;if(l(n.class)){let r=i[n.class];return new H4({tile:n,class:r})}}dQ._oneTimeWarning=pt;var G4=dQ;function P0t(e){let t=new Uint8Array(e),n=Om(t);if(n==="glTF"&&(n="glb"),Ms.isBinaryFormat(n))return{contentType:n,binaryPayload:t};let i=D0t(t);if(l(i.root))return{contentType:Ms.EXTERNAL_TILESET,jsonPayload:i};if(l(i.asset))return{contentType:Ms.GLTF,jsonPayload:i};if(l(i.tileAvailability))return{contentType:Ms.IMPLICIT_SUBTREE_JSON,jsonPayload:i};if(l(i.type))return{contentType:Ms.GEOJSON,jsonPayload:i};if(l(i.voxelTable))return{contentType:Ms.VOXEL_JSON,jsonPayload:i};throw new oe("Invalid tile content.")}function D0t(e){let t;try{t=wo(e)}catch{throw new oe("Invalid tile content.")}return t}var Vy=P0t;var hQ=class{constructor(t,n,i,r){this._tileset=t,this._tile=n,this._tilesetResource=i,this._contents=[],this._contentsCreated=!1;let o=l(r.contents)?r.contents:r.content;this._innerContentHeaders=o,this._requestsInFlight=0,this._cancelCount=0,this._externalTilesetCount=0;let a=this._innerContentHeaders.length;this._arrayFetchPromises=new Array(a),this._requests=new Array(a),this._ready=!1,this._innerContentResources=new Array(a),this._serverKeys=new Array(a);for(let s=0;s<a;s++){let c=i.getDerivedResource({url:o[s].uri}),u=fl.getServerKey(c.getUrlComponent());this._innerContentResources[s]=c,this._serverKeys[s]=u}}get featurePropertiesDirty(){let t=this._contents,n=t.length;for(let i=0;i<n;++i)if(t[i].featurePropertiesDirty)return!0;return!1}set featurePropertiesDirty(t){let n=this._contents,i=n.length;for(let r=0;r<i;++r)n[r].featurePropertiesDirty=t}get featuresLength(){return 0}get pointsLength(){return 0}get trianglesLength(){return 0}get geometryByteLength(){return 0}get texturesByteLength(){return 0}get batchTableByteLength(){return 0}get innerContents(){return this._contents}get ready(){return this._contentsCreated?this._ready:!1}get tileset(){return this._tileset}get tile(){return this._tile}get url(){}get metadata(){}set metadata(t){}get batchTable(){}get group(){}set group(t){}get innerContentUrls(){return this._innerContentHeaders.map(function(t){return t.uri})}requestInnerContents(){if(!R0t(this._serverKeys)){this.tileset.statistics.numberOfAttemptedRequests+=this._serverKeys.length;return}let t=this._innerContentHeaders;mQ(this,t.length);let n=this._cancelCount;for(let i=0;i<t.length;i++)this._arrayFetchPromises[i]=O0t(this,i,n,this._tile._contentState);return M0t(this)}cancelRequests(){for(let t=0;t<this._requests.length;t++){let n=this._requests[t];l(n)&&n.cancel()}}hasProperty(t,n){return!1}getFeature(t){}applyDebugSettings(t,n){let i=this._contents,r=i.length;for(let o=0;o<r;++o)i[o].applyDebugSettings(t,n)}applyStyle(t){let n=this._contents,i=n.length;for(let r=0;r<i;++r)n[r].applyStyle(t)}update(t,n){let i=this._contents,r=i.length,o=!0;for(let a=0;a<r;++a)i[a].update(t,n),o=o&&i[a].ready;!this._ready&&o&&(this._ready=!0)}pick(t,n,i){if(!this._ready)return;let r,o=Number.POSITIVE_INFINITY,a=this._contents,s=a.length;for(let c=0;c<s;++c){let u=a[c].pick(t,n,i);if(!l(u))continue;let f=h.distance(t.origin,u);f<o&&(r=u,o=f)}if(l(r))return i}isDestroyed(){return!1}destroy(){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].destroy();return ue(this)}};function mQ(e,t){e._requestsInFlight+=t,e.tileset.statistics.numberOfPendingRequests+=t}function GTe(e,t){e._cancelCount++,e._tile._contentState=t;let n=e.tileset.statistics;n.numberOfPendingRequests-=e._requestsInFlight,n.numberOfAttemptedRequests+=e._requestsInFlight,e._requestsInFlight=0;let i=e._innerContentHeaders.length;e._arrayFetchPromises=new Array(i)}function R0t(e){let t={};for(let n=0;n<e.length;n++){let i=e[n];l(t[i])?t[i]++:t[i]=1}for(let n in t)if(t.hasOwnProperty(n)&&!fl.serverHasOpenSlots(n,t[n]))return!1;return fl.heapHasOpenSlots(e.length)}function O0t(e,t,n,i){let r=e._innerContentResources[t].clone(),o=e.tile,a=function(){return o._priority},s=e._serverKeys[t],c=new Eo({throttle:!0,throttleByServer:!0,type:Za.TILES3D,priorityFunction:a,serverKey:s});r.request=c,e._requests[t]=c;let u=r.fetchArrayBuffer();if(l(u))return u.then(function(f){if(!(n<e._cancelCount)){if(r.request.cancelled||r.request.state===Ti.CANCELLED){GTe(e,i);return}return mQ(e,-1),f}}).catch(function(f){if(!(n<e._cancelCount)){if(r.request.cancelled||r.request.state===Ti.CANCELLED){GTe(e,i);return}mQ(e,-1),WTe(e,t,f)}})}async function M0t(e){let t=e._cancelCount,n=await Promise.all(e._arrayFetchPromises);if(t<e._cancelCount)return;let i=n.map((o,a)=>L0t(e,o,a)),r=await Promise.all(i);if(e._contentsCreated=!0,e._contents=r.filter(l),e._externalTilesetCount===e._contents.length){let o=e._tile;o.hasRenderableContent=!1}return r}async function L0t(e,t,n){if(l(t))try{let i=Vy(t),r=e._tileset,o=e._innerContentResources[n],a=e._tile;i.contentType===Ms.EXTERNAL_TILESET&&(e._externalTilesetCount++,a.hasTilesetContent=!0),e._disableSkipLevelOfDetail=e._disableSkipLevelOfDetail||i.contentType===Ms.GEOMETRY||i.contentType===Ms.VECTOR;let s,c=eS[i.contentType];l(i.binaryPayload)?s=await Promise.resolve(c(r,a,o,i.binaryPayload.buffer,0)):s=await Promise.resolve(c(r,a,o,i.jsonPayload));let u=e._innerContentHeaders[n];if(a.hasImplicitContentMetadata){let d=a.implicitSubtree,p=a.implicitCoordinates;s.metadata=d.getContentMetadataView(p,n)}else a.hasImplicitContent||(s.metadata=tS(r,u));let f=nS(r,u);return l(f)&&(s.group=new HE({metadata:f})),s}catch(i){WTe(e,n,i)}}function WTe(e,t,n){let i=e._tileset,r=e._innerContentResources[t].url,o=l(n.message)?n.message:n.toString();i.tileFailed.numberOfListeners>0?i.tileFailed.raiseEvent({url:r,message:o}):(console.log(`A content failed to load: ${r}`),console.log(`Error: ${o}`))}var W4=hQ;function rS(e){this.rectangle=ie.clone(e.rectangle),this.minimumHeight=e.minimumHeight??0,this.maximumHeight=e.maximumHeight??0,this.southwestCornerCartesian=new h,this.northeastCornerCartesian=new h,this.westNormal=new h,this.southNormal=new h,this.eastNormal=new h,this.northNormal=new h;let t=e.ellipsoid??te.WGS84;z0t(this,e.rectangle,t),this._orientedBoundingBox=void 0,this._boundingSphere=void 0,(e.computeBoundingVolumes??!0)&&this.computeBoundingVolumes(t)}Object.defineProperties(rS.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});rS.prototype.computeBoundingVolumes=function(e){this._orientedBoundingBox=Jt.fromRectangle(this.rectangle,this.minimumHeight,this.maximumHeight,e),this._boundingSphere=se.fromOrientedBoundingBox(this._orientedBoundingBox)};var qTe=new h,q4=new h,YTe=new h,N0t=new h,F0t=new h,B0t=new h,k0t=new h,Dd=new de,XTe=new tn(h.UNIT_X,0),iS=new hn;function z0t(e,t,n){n.cartographicToCartesian(ie.southwest(t),e.southwestCornerCartesian),n.cartographicToCartesian(ie.northeast(t),e.northeastCornerCartesian),Dd.longitude=t.west,Dd.latitude=(t.south+t.north)*.5,Dd.height=0;let i=n.cartographicToCartesian(Dd,B0t),r=h.cross(i,h.UNIT_Z,N0t);h.normalize(r,e.westNormal),Dd.longitude=t.east;let o=n.cartographicToCartesian(Dd,k0t),a=h.cross(h.UNIT_Z,o,qTe);h.normalize(a,e.eastNormal);let s=h.subtract(i,o,qTe);h.magnitude(s)===0&&(s=h.clone(r,s));let c=h.normalize(s,F0t),u=t.south,f;if(u>0){Dd.longitude=(t.west+t.east)*.5,Dd.latitude=u;let y=n.cartographicToCartesian(Dd,iS.origin);h.clone(c,iS.direction);let A=tn.fromPointNormal(e.southwestCornerCartesian,e.westNormal,XTe);ci.rayPlane(iS,A,e.southwestCornerCartesian),f=n.geodeticSurfaceNormal(y,q4)}else f=n.geodeticSurfaceNormalCartographic(ie.southeast(t),q4);let d=h.cross(f,s,YTe);h.normalize(d,e.southNormal);let p=t.north,g;if(p<0){Dd.longitude=(t.west+t.east)*.5,Dd.latitude=p;let y=n.cartographicToCartesian(Dd,iS.origin);h.negate(c,iS.direction);let A=tn.fromPointNormal(e.northeastCornerCartesian,e.eastNormal,XTe);ci.rayPlane(iS,A,e.northeastCornerCartesian),g=n.geodeticSurfaceNormal(y,q4)}else g=n.geodeticSurfaceNormalCartographic(ie.northwest(t),q4);let m=h.cross(s,g,YTe);h.normalize(m,e.northNormal)}var U0t=new h,V0t=new h,j0t=new h(0,-1,0),H0t=new h(0,0,-1),KTe=new h;function G0t(e,t){let n=t.camera,i=n.positionWC,r=n.positionCartographic,o=0;if(!ie.contains(e.rectangle,r)){let u=e.southwestCornerCartesian,f=e.northeastCornerCartesian,d=e.westNormal,p=e.southNormal,g=e.eastNormal,m=e.northNormal;t.mode!==re.SCENE3D&&(u=t.mapProjection.project(ie.southwest(e.rectangle),U0t),u.z=u.y,u.y=u.x,u.x=0,f=t.mapProjection.project(ie.northeast(e.rectangle),V0t),f.z=f.y,f.y=f.x,f.x=0,d=j0t,g=h.UNIT_Y,p=H0t,m=h.UNIT_Z);let y=h.subtract(i,u,KTe),A=h.dot(y,d),b=h.dot(y,p),x=h.subtract(i,f,KTe),T=h.dot(x,g),C=h.dot(x,m);A>0?o+=A*A:T>0&&(o+=T*T),b>0?o+=b*b:C>0&&(o+=C*C)}let a,s,c;if(t.mode===re.SCENE3D?(a=r.height,s=e.minimumHeight,c=e.maximumHeight):(a=i.x,s=0,c=0),a>c){let u=a-c;o+=u*u}else if(a<s){let u=s-a;o+=u*u}return Math.sqrt(o)}rS.prototype.distanceToCamera=function(e){let t=G0t(this,e);if(e.mode===re.SCENE3D&&l(this._orientedBoundingBox)){let n=Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC));return Math.max(t,n)}return t};rS.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};rS.prototype.createDebugVolume=function(e){let t=O.clone(O.IDENTITY),n=new cv({rectangle:this.rectangle,height:this.minimumHeight,extrudedHeight:this.maximumHeight}),i=new Bt({geometry:n,id:"outline",modelMatrix:t,attributes:{color:Kt.fromColor(e)}});return new Fn({geometryInstances:i,appearance:new _n({translucent:!1,flat:!0}),asynchronous:!1})};var Rd=rS;var Y4=new de;function m1(e){let t=q_.fromToken(e.token),n=e.minimumHeight??0,i=e.maximumHeight??0,r=e.ellipsoid??te.WGS84;this.s2Cell=t,this.minimumHeight=n,this.maximumHeight=i,this.ellipsoid=r;let o=Q0t(t,n,i,r);this._boundingPlanes=o;let a=igt(o);this._vertices=a,this._edgeNormals=new Array(6),this._edgeNormals[0]=TQ(o[0],a.slice(0,4));let s;for(s=0;s<4;s++)this._edgeNormals[0][s]=h.negate(this._edgeNormals[0][s],this._edgeNormals[0][s]);for(this._edgeNormals[1]=TQ(o[1],a.slice(4,8)),s=0;s<4;s++)this._edgeNormals[2+s]=TQ(o[2+s],[a[s%4],a[(s+1)%4],a[4+(s+1)%4],a[4+s]]);for(this._planeVertices=[this._vertices.slice(0,4),this._vertices.slice(4,8)],s=0;s<4;s++)this._planeVertices.push([this._vertices[s%4],this._vertices[(s+1)%4],this._vertices[4+(s+1)%4],this._vertices[4+s]]);let c=t.getCenter();Y4=r.cartesianToCartographic(c,Y4),Y4.height=(i+n)/2,this.center=r.cartographicToCartesian(Y4,c),this._boundingSphere=se.fromPoints(a)}var W0t=new h,q0t=new de,Y0t=new h,X0t=new de,K0t=new h,$0t=new h,J0t=new h,Z0t=new h;function Q0t(e,t,n,i){let r=new Array(6),o=e.getCenter(),a=i.geodeticSurfaceNormal(o,W0t),s=i.cartesianToCartographic(o,q0t);s.height=n;let c=i.cartographicToCartesian(s,Y0t),u=tn.fromPointNormal(c,a);r[0]=u;let f=0,d,p=[],g,m;for(d=0;d<4;d++){g=e.getVertex(d),p[d]=g,m=i.cartesianToCartographic(g,X0t),m.height=t;let A=tn.getPointDistance(u,i.cartographicToCartesian(m,K0t));A<f&&(f=A)}let y=tn.clone(u);for(y.normal=h.negate(y.normal,y.normal),y.distance=y.distance*-1+f,r[1]=y,d=0;d<4;d++){g=p[d];let A=p[(d+1)%4],b=i.geodeticSurfaceNormal(g,$0t),x=h.subtract(A,g,Z0t),T=h.cross(x,b,J0t);T=h.normalize(T,T),r[2+d]=tn.fromPointNormal(g,T)}return r}var Ax=new h,bx=new h,xx=new h,pQ=new h,gQ=new h,_Q=new h,egt=new h,tgt=new h,ngt=new h,yQ=new h,AQ=new h,bQ=new h,jy=new h,wp=new $;function $Te(e,t,n){Ax=e.normal,bx=t.normal,xx=n.normal,pQ=h.multiplyByScalar(e.normal,-e.distance,pQ),gQ=h.multiplyByScalar(t.normal,-t.distance,gQ),_Q=h.multiplyByScalar(n.normal,-n.distance,_Q),yQ=h.multiplyByScalar(h.cross(bx,xx,egt),h.dot(pQ,Ax),yQ),AQ=h.multiplyByScalar(h.cross(xx,Ax,tgt),h.dot(gQ,bx),AQ),bQ=h.multiplyByScalar(h.cross(Ax,bx,ngt),h.dot(_Q,xx),bQ),wp[0]=Ax.x,wp[1]=bx.x,wp[2]=xx.x,wp[3]=Ax.y,wp[4]=bx.y,wp[5]=xx.y,wp[6]=Ax.z,wp[7]=bx.z,wp[8]=xx.z;let i=$.determinant(wp);return jy=h.add(yQ,AQ,jy),jy=h.add(jy,bQ,jy),new h(jy.x/i,jy.y/i,jy.z/i)}function igt(e){let t=new Array(8);for(let n=0;n<4;n++)t[n]=$Te(e[0],e[2+(n+3)%4],e[2+n%4]),t[n+4]=$Te(e[1],e[2+(n+3)%4],e[2+n%4]);return t}var xQ=new h,oS=new h;function TQ(e,t){let n=[];for(let i=0;i<4;i++)xQ=h.subtract(t[(i+1)%4],t[i],xQ),oS=h.cross(e.normal,xQ,oS),oS=h.normalize(oS,oS),n[i]=h.clone(oS);return n}Object.defineProperties(m1.prototype,{boundingVolume:{get:function(){return this}},boundingSphere:{get:function(){return this._boundingSphere}}});var CQ=new h;m1.prototype.distanceToCamera=function(e){let t=e.camera.positionWC,n=[],i=[],r;tn.getPointDistance(this._boundingPlanes[0],t)>0?(n.push(0),i.push(this._planeVertices[0]),r=this._edgeNormals[0]):tn.getPointDistance(this._boundingPlanes[1],t)>0&&(n.push(1),i.push(this._planeVertices[1]),r=this._edgeNormals[1]);let o,a;for(o=0;o<4;o++)a=2+o,tn.getPointDistance(this._boundingPlanes[a],t)>0&&(n.push(a),i.push(this._planeVertices[a]),r=this._edgeNormals[a]);if(n.length===0)return 0;let s,c;if(n.length===1)return c=this._boundingPlanes[n[0]],s=vQ(tn.projectPointOntoPlane(c,t,CQ),i[0],c,r),h.distance(s,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 s=JTe(t,p[0],p[1]),h.distance(s,t)}let f=Number.MAX_VALUE,d;for(o=0;o<2;o++)c=this._boundingPlanes[n[o]],s=vQ(tn.projectPointOntoPlane(c,t,CQ),i[o],c,this._edgeNormals[n[o]]),d=h.distanceSquared(s,t),d<f&&(f=d);return Math.sqrt(f)}else if(n.length>3)return s=vQ(tn.projectPointOntoPlane(this._boundingPlanes[1],t,CQ),this._planeVertices[1],this._boundingPlanes[1],this._edgeNormals[1]),h.distance(s,t);let u=n[1]===2&&n[2]===5?0:1;return n[0]===0?h.distance(t,this._vertices[(n[1]-2+u)%4]):h.distance(t,this._vertices[4+(n[1]-2+u)%4])};var rgt=new h,ogt=new h;function JTe(e,t,n){let i=h.subtract(n,t,rgt),r=h.subtract(e,t,ogt),o=h.dot(i,r);if(o<=0)return t;let a=h.dot(i,i);return o>=a?n:(o=o/a,new h((1-o)*t.x+o*n.x,(1-o)*t.y+o*n.y,(1-o)*t.z+o*n.z))}var agt=new tn(h.UNIT_X,0);function vQ(e,t,n,i){let r=Number.MAX_VALUE,o,a,s;for(let c=0;c<t.length;c++){let u=tn.fromPointNormal(t[c],i[c],agt);tn.getPointDistance(u,e)<0||(s=JTe(e,t[c],t[(c+1)%4]),o=h.distance(e,s),o<r&&(r=o,a=s))}return l(a)?a:e}m1.prototype.intersectPlane=function(e){let t=0,n=0;for(let i=0;i<this._vertices.length;i++)h.dot(e.normal,this._vertices[i])+e.distance<0?n++:t++;return t===this._vertices.length?Xt.INSIDE:n===this._vertices.length?Xt.OUTSIDE:Xt.INTERSECTING};m1.prototype.createDebugVolume=function(e){let t=O.clone(O.IDENTITY),n=new dh({polygonHierarchy:{positions:this._planeVertices[0]}}),i=dh.createGeometry(n),r=new Bt({geometry:i,id:"outline",modelMatrix:t,attributes:{color:Kt.fromColor(e)}}),o=new dh({polygonHierarchy:{positions:this._planeVertices[1]}}),a=dh.createGeometry(o),s=new Bt({geometry:a,id:"outline",modelMatrix:t,attributes:{color:Kt.fromColor(e)}}),c=[];for(let u=0;u<4;u++){let f=new dh({polygonHierarchy:{positions:this._planeVertices[2+u]}}),d=dh.createGeometry(f);c[u]=new Bt({geometry:d,id:"outline",modelMatrix:t,attributes:{color:Kt.fromColor(e)}})}return new Fn({geometryInstances:[c[0],c[1],c[2],c[3],s,r],appearance:new _n({translucent:!1,flat:!0}),asynchronous:!1})};var X4=m1;function aS(e,t){t===0&&(t=I.EPSILON7),this._boundingSphere=new se(e,t)}Object.defineProperties(aS.prototype,{center:{get:function(){return this._boundingSphere.center}},radius:{get:function(){return this._boundingSphere.radius}},boundingVolume:{get:function(){return this._boundingSphere}},boundingSphere:{get:function(){return this._boundingSphere}}});aS.prototype.distanceToCamera=function(e){let t=this._boundingSphere;return Math.max(0,h.distance(t.center,e.camera.positionWC)-t.radius)};aS.prototype.intersectPlane=function(e){return se.intersectPlane(this._boundingSphere,e)};aS.prototype.update=function(e,t){h.clone(e,this._boundingSphere.center),this._boundingSphere.radius=t};aS.prototype.createDebugVolume=function(e){let t=new K_({radius:this.radius}),n=O.fromTranslation(this.center,O.clone(O.IDENTITY)),i=new Bt({geometry:t,id:"outline",modelMatrix:n,attributes:{color:Kt.fromColor(e)}});return new Fn({geometryInstances:i,appearance:new _n({translucent:!1,flat:!0}),asynchronous:!1})};var Hy=aS;var sgt=new h,cgt=new h,lgt=new h,ugt=new h;function Tx(e,t,n){n=h.cross(e,t,n);let i=h.magnitude(n);return h.multiplyByScalar(n,I.EPSILON7/i,n)}function EQ(e,t){let n=h.normalize(e,ugt),i=h.equalsEpsilon(n,h.UNIT_X,I.EPSILON6)?h.UNIT_Y:h.UNIT_X;return Tx(e,i,t)}function ZTe(e){let t=$.getColumn(e,0,sgt),n=$.getColumn(e,1,cgt),i=$.getColumn(e,2,lgt),r=h.equals(t,h.ZERO),o=h.equals(n,h.ZERO),a=h.equals(i,h.ZERO);return!r&&!o&&!a?e:r&&o&&a?(e[0]=I.EPSILON7,e[4]=I.EPSILON7,e[8]=I.EPSILON7,e):(r&&!o&&!a?t=Tx(n,i,t):!r&&o&&!a?n=Tx(t,i,n):!r&&!o&&a?i=Tx(n,t,i):r?o?a||(t=EQ(i,t),n=Tx(i,t,n)):(t=EQ(n,t),i=Tx(n,t,i)):(n=EQ(t,n),i=Tx(n,t,i)),$.setColumn(e,0,t,e),$.setColumn(e,1,n,e),$.setColumn(e,2,i,e),e)}function sS(e,t){t=ZTe(t),this._orientedBoundingBox=new Jt(e,t),this._boundingSphere=se.fromOrientedBoundingBox(this._orientedBoundingBox)}Object.defineProperties(sS.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});sS.prototype.distanceToCamera=function(e){return Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC))};sS.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};sS.prototype.update=function(e,t){h.clone(e,this._orientedBoundingBox.center),t=ZTe(t),$.clone(t,this._orientedBoundingBox.halfAxes),se.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere)};sS.prototype.createDebugVolume=function(e){let t=new Pm({minimum:new h(-1,-1,-1),maximum:new h(1,1,1)}),n=O.fromRotationTranslation(this.boundingVolume.halfAxes,this.boundingVolume.center),i=new Bt({geometry:t,id:"outline",modelMatrix:n,attributes:{color:Kt.fromColor(e)}});return new Fn({geometryInstances:i,appearance:new _n({translucent:!1,flat:!0}),asynchronous:!1})};var mf=sS;function uo(e,t,n,i){this._tileset=e,this._header=n;let r=l(n.contents),o=r&&n.contents.length>1||Qi(n,"3DTILES_multiple_contents"),a=r&&!o?n.contents[0]:n.content;this._contentHeader=a,this.transform=l(n.transform)?O.unpack(n.transform):O.clone(O.IDENTITY);let s=l(i)?i.computedTransform:e.modelMatrix,c=O.multiply(s,this.transform,new O),u=l(i)?i._initialTransform:O.IDENTITY;this._initialTransform=O.multiply(u,this.transform,new O),this.computedTransform=c,this.metadata=G4(e,n),this._verticalExaggeration=1,this._verticalExaggerationRelativeHeight=0,this._boundingVolume=this.createBoundingVolume(n.boundingVolume,c),this._boundingVolume2D=void 0;let f;l(a)&&l(a.boundingVolume)&&(f=this.createBoundingVolume(a.boundingVolume,c)),this._contentBoundingVolume=f,this._contentBoundingVolume2D=void 0;let d;l(n.viewerRequestVolume)&&(d=this.createBoundingVolume(n.viewerRequestVolume,c)),this._viewerRequestVolume=d,this.geometricError=n.geometricError,this._geometricError=n.geometricError,l(this._geometricError)||(this._geometricError=l(i)?i._geometricError:e._geometricError,uo._deprecationWarning("geometricErrorUndefined","Required property geometricError is undefined for this tile. Using parent's geometric error instead.")),this.updateGeometricErrorScale();let p;l(n.refine)?((n.refine==="replace"||n.refine==="add")&&uo._deprecationWarning("lowercase-refine",`This tile uses a lowercase refine "${n.refine}". Instead use "${n.refine.toUpperCase()}".`),p=n.refine.toUpperCase()==="REPLACE"?To.REPLACE:To.ADD):l(i)?p=i.refine:p=To.REPLACE,this.refine=p,this.children=[],this.parent=i;let g,m=!1,y,A,b;if(t=De.createIfNeeded(t),o)y=co.UNLOADED,A=t.clone();else if(l(a)){let E=a.uri;l(a.url)&&(uo._deprecationWarning("contentUrl",'This tileset JSON uses the "content.url" property which has been deprecated. Use "content.uri" instead.'),E=a.url),E===""?(uo._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 dg(e,this),m=!0,y=co.READY):(y=co.UNLOADED,A=t.getDerivedResource({url:E}),b=fl.getServerKey(A.getUrlComponent()))}else g=new dg(e,this),m=!0,y=co.READY;this._content=g,this._contentResource=A,this._contentState=y,this._expiredContent=void 0,this._serverKey=b,this.hasEmptyContent=m,this.hasTilesetContent=!1,this.hasImplicitContent=!1,this.hasRenderableContent=!m,this.hasImplicitContentMetadata=!1,this.hasMultipleContents=o,this.cacheNode=void 0;let x=n.expire,T,C;l(x)&&(T=x.duration,l(x.date)&&(C=K.fromIso8601(x.date))),this.expireDuration=T,this.expireDate=C,this.lastStyleTime=0,this._optimChildrenWithinParent=qh.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=U.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 K,this._commandsLength=0,this._color=void 0,this._colorDirty=!1,this._request=void 0}uo._deprecationWarning=qs;Object.defineProperties(uo.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 l(this._color)||(this._color=new U),U.clone(this._color)},set:function(e){this._color=U.clone(e,this._color),this._colorDirty=!0}},contentAvailable:{get:function(){return this.contentReady&&this.hasRenderableContent||l(this._expiredContent)&&!this.contentFailed}},contentReady:{get:function(){return this._contentState===co.READY}},contentUnloaded:{get:function(){return this._contentState===co.UNLOADED}},hasUnloadedRenderableContent:{get:function(){return this.hasRenderableContent&&this.contentUnloaded}},contentExpired:{get:function(){return this._contentState===co.EXPIRED}},contentFailed:{get:function(){return this._contentState===co.FAILED}},commandsLength:{get:function(){return this._commandsLength}}});var Gy=new h;function fgt(e,t){let{tileset:n,boundingSphere:i}=e,{radius:r,center:o}=i,{camera:a}=t,s=h.multiplyByScalar(a.directionWC,e._centerZDepth,Gy),c=h.add(a.positionWC,s,Gy),u=h.subtract(c,o,Gy);if(h.magnitude(u)>r){let C=h.normalize(u,Gy),E=h.multiplyByScalar(C,r,Gy),w=h.add(o,E,Gy),D=h.subtract(w,a.positionWC,Gy),R=h.normalize(D,Gy);e._foveatedFactor=1-Math.abs(h.dot(a.directionWC,R))}else e._foveatedFactor=0;let p=e.refine===To.REPLACE,g=n.isSkippingLevelOfDetail;if(p&&!g||!n.foveatedScreenSpaceError||n.foveatedConeSize===1||e._priorityProgressiveResolution&&p&&g||n._pass===lo.PRELOAD_FLIGHT||n._pass===lo.PRELOAD)return!1;let m=1-Math.cos(a.frustum.fov*.5),y=n.foveatedConeSize*m;if(e._foveatedFactor<=y)return!1;let A=m-y,b=I.clamp((e._foveatedFactor-y)/A,0,1),x=n.foveatedInterpolationCallback(n.foveatedMinimumScreenSpaceErrorRelaxation,n.memoryAdjustedScreenSpaceError,b),T=e._screenSpaceError===0&&l(e.parent)?e.parent._screenSpaceError*.5:e._screenSpaceError;return n.memoryAdjustedScreenSpaceError-x<=T}var rCe=new K;uo.prototype.getScreenSpaceError=function(e,t,n){let i=this._tileset,r=n??1,o=l(this.parent)?this.parent.geometricError:i._scaledGeometricError,a=t?o:this.geometricError;if(a===0)return 0;let{camera:s,context:c}=e,u=s.frustum,f=c.drawingBufferWidth,d=c.drawingBufferHeight*r,p;if(e.mode===re.SCENE2D||u instanceof pn){let g=u.offCenterFrustum;l(g)&&(u=g);let m=Math.max(u.top-u.bottom,u.right-u.left)/Math.max(f,d);p=a/m}else{let g=Math.max(this._distanceToCamera,I.EPSILON7),m=u.sseDenominator;if(p=a*d/(g*m),i.dynamicScreenSpaceError){let y=i._dynamicScreenSpaceErrorComputedDensity,A=i.dynamicScreenSpaceErrorFactor,b=I.fog(g,y)*A;p-=b}}return p/=e.pixelRatio,p};function dgt(e,t){if(e.progressiveResolutionHeightFraction<=0||e.progressiveResolutionHeightFraction>.5)return!1;let n=e.memoryAdjustedScreenSpaceError,i=t._screenSpaceErrorProgressiveResolution>n;t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1;let r=t.parent,o=t._screenSpaceErrorProgressiveResolution<=n,a=l(r)&&r._screenSpaceErrorProgressiveResolution>n;return o&&a&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!0,i=!0),i}function hgt(e,t){let n=t.parent,r=l(n)&&(!e.isSkippingLevelOfDetail||t._screenSpaceError===0||n.hasTilesetContent||n.hasImplicitContent)?n._screenSpaceError:t._screenSpaceError;return e.root._screenSpaceError-r}uo.prototype.updateVisibility=function(e){let{parent:t,tileset:n}=this;if(this._updatedVisibilityFrame===n._updatedVisibilityFrame)return;let i=l(t)?t.computedTransform:n.modelMatrix,r=l(t)?t._visibilityPlaneMask:is.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,r),this._visible=this._visibilityPlaneMask!==is.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._priorityReverseScreenSpaceError=hgt(n,this),this._priorityProgressiveResolution=dgt(n,this),this.priorityDeferred=fgt(this,e),this._updatedVisibilityFrame=n._updatedVisibilityFrame};uo.prototype.updateExpiration=function(){if(l(this.expireDate)&&this.contentReady&&!this.hasEmptyContent&&!this.hasMultipleContents){let e=K.now(rCe);K.lessThan(this.expireDate,e)&&(this._contentState=co.EXPIRED,this._expiredContent=this._content)}};function mgt(e){if(!l(e.expireDuration))return;let t=K.now(rCe);K.addSeconds(t,e.expireDuration,t),l(e.expireDate)?K.lessThan(e.expireDate,t)&&K.clone(t,e.expireDate):e.expireDate=K.clone(t)}function pgt(e){return function(){return e._priority}}uo.prototype.requestContent=function(){if(!this.hasEmptyContent)return this.hasMultipleContents?ggt(this):ygt(this)};function ggt(e){let t=e._content,n=e._tileset;if(!l(t)){let r=Qi(e._header,"3DTILES_multiple_contents")?e._header.extensions["3DTILES_multiple_contents"]:e._header;t=new W4(n,e,e._contentResource.clone(),r),e._content=t}let i=t.requestInnerContents();if(l(i))return e._contentState=co.LOADING,i.then(r=>{if(!e.isDestroyed()&&l(r))return e._contentState=co.PROCESSING,t}).catch(r=>{if(!e.isDestroyed())throw e._contentState=co.FAILED,r})}async function _gt(e,t,n,i,r){let o=e._contentState;e._contentState=co.LOADING,++t.statistics.numberOfPendingRequests;let a;try{a=await r}catch(s){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;if(n.cancelled||n.state===Ti.CANCELLED){e._contentState=o,++t.statistics.numberOfAttemptedRequests;return}if(oCe(e,s))return i&&(e.expireDate=void 0),e._content=new dg(t,e),QTe(e),e._contentState=co.PROCESSING,e._content;throw e._contentState=co.FAILED,s}if(e.isDestroyed()){--t.statistics.numberOfPendingRequests;return}if(n.cancelled||n.state===Ti.CANCELLED){e._contentState=o,--t.statistics.numberOfPendingRequests,++t.statistics.numberOfAttemptedRequests;return}try{let s=await Agt(e,a);return--t.statistics.numberOfPendingRequests,e.isDestroyed()?void 0:(i&&(e.expireDate=void 0),e._content=s,s instanceof dg&&QTe(e),e._contentState=co.PROCESSING,s)}catch(s){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;throw e._contentState=co.FAILED,s}}function ygt(e){let t=e._contentResource.clone(),n=e.contentExpired;n&&t.setQueryParameters({expired:e.expireDate.toString()});let i=new Eo({throttle:!0,throttleByServer:!0,type:Za.TILES3D,priorityFunction:pgt(e),serverKey:e._serverKey});e._request=i,t.request=i;let r=e._tileset,o=t.fetchArrayBuffer();if(!l(o)){++r.statistics.numberOfAttemptedRequests;return}return _gt(e,r,i,n,o)}function oCe(e,t){let i=e._tileset?._runtimeContentCodec?.missingTilePolicy;return!l(i)||!l(t.statusCode)?!1:i.statusCodes.includes(t.statusCode)}function QTe(e){e.hasEmptyContent=!0,e.hasRenderableContent=!1}uo._isEmptyTile=oCe;async function Agt(e,t){let n=e._tileset,i=n?._runtimeContentCodec;if(l(i)&&typeof i.createContent=="function"){let u=await Promise.resolve(i.createContent(n,e,e._contentResource,t));return e.isDestroyed()?void 0:u}let r=Vy(t);n._disableSkipLevelOfDetail=n._disableSkipLevelOfDetail||r.contentType===Ms.GEOMETRY||r.contentType===Ms.VECTOR,(r.contentType===Ms.IMPLICIT_SUBTREE||r.contentType===Ms.IMPLICIT_SUBTREE_JSON)&&(e.hasImplicitContent=!0,e.hasRenderableContent=!1),r.contentType===Ms.EXTERNAL_TILESET&&(e.hasTilesetContent=!0,e.hasRenderableContent=!1);let o,a=eS[r.contentType];if(e.isDestroyed())return;l(r.binaryPayload)?o=await Promise.resolve(a(n,e,e._contentResource,r.binaryPayload.buffer,0)):o=await Promise.resolve(a(n,e,e._contentResource,r.jsonPayload));let s=e._contentHeader;if(e.hasImplicitContentMetadata){let u=e.implicitSubtree,f=e.implicitCoordinates;o.metadata=u.getContentMetadataView(f,0)}else e.hasImplicitContent||(o.metadata=tS(n,s));let c=nS(n,s);return l(c)&&(o.group=new HE({metadata:c})),o}uo.prototype.cancelRequests=function(){this.hasMultipleContents?this._content.cancelRequests():this._request.cancel()};uo.prototype.unloadContent=function(){this.hasRenderableContent&&(this._content=this._content&&this._content.destroy(),this._contentState=co.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 aCe=new se;function wQ(e,t){if(t.mode!==re.SCENE3D&&!l(e._boundingVolume2D)){let n=e._boundingVolume.boundingSphere,i=se.projectTo2D(n,t.mapProjection,aCe);e._boundingVolume2D=new Hy(i.center,i.radius)}return t.mode!==re.SCENE3D?e._boundingVolume2D:e._boundingVolume}function bgt(e,t){if(t.mode!==re.SCENE3D&&!l(e._contentBoundingVolume2D)){let n=e._contentBoundingVolume.boundingSphere,i=se.projectTo2D(n,t.mapProjection,aCe);e._contentBoundingVolume2D=new Hy(i.center,i.radius)}return t.mode!==re.SCENE3D?e._contentBoundingVolume2D:e._contentBoundingVolume}uo.prototype.visibility=function(e,t){let n=e.cullingVolume,i=wQ(this,e),r=this._tileset,o=r.clippingPlanes;if(l(o)&&o.enabled){let s=o.computeIntersectionWithBoundingVolume(i,r.clippingPlanesOriginMatrix);if(this._isClipped=s!==Xt.INSIDE,s===Xt.OUTSIDE)return is.MASK_OUTSIDE}let a=r.clippingPolygons;if(l(a)&&a.enabled){let s=a.computeIntersectionWithBoundingVolume(i);this._isClippedByPolygon=s!==Xt.OUTSIDE}return n.computeVisibilityWithPlaneMask(i,t)};uo.prototype.contentVisibility=function(e){if(!l(this._contentBoundingVolume))return Xt.INSIDE;if(this._visibilityPlaneMask===is.MASK_INSIDE)return Xt.INSIDE;let t=e.cullingVolume,n=bgt(this,e),i=this._tileset,r=i.clippingPlanes;if(l(r)&&r.enabled){let a=r.computeIntersectionWithBoundingVolume(n,i.clippingPlanesOriginMatrix);if(this._isClipped=a!==Xt.INSIDE,a===Xt.OUTSIDE)return Xt.OUTSIDE}let o=i.clippingPolygons;if(l(o)&&o.enabled){let a=o.computeIntersectionWithBoundingVolume(n);if(this._isClippedByPolygon=a!==Xt.OUTSIDE,a===Xt.INSIDE)return Xt.OUTSIDE}return t.computeVisibility(n)};uo.prototype.distanceToTile=function(e){return wQ(this,e).distanceToCamera(e)};var xgt=new h;uo.prototype.distanceToTileCenter=function(e){let n=wQ(this,e).boundingVolume,i=h.subtract(n.center,e.camera.positionWC,xgt);return h.dot(e.camera.directionWC,i)};uo.prototype.insideViewerRequestVolume=function(e){let t=this._viewerRequestVolume;return!l(t)||t.distanceToCamera(e)===0};var sCe=new $,cCe=new h,Tgt=new $,IQ=new h,lCe=new ie,uCe=new Jt,SQ=new O;function Cgt(e,t,n){let i=h.fromElements(e[0],e[1],e[2],IQ),r=$.fromArray(e,3,Tgt);i=O.multiplyByPoint(t,i,i);let o=O.getMatrix3(t,sCe);return r=$.multiply(o,r,r),l(n)?(n.update(i,r),n):new mf(i,r)}function eCe(e,t,n,i){let r=ie.unpack(e,0,lCe),o=e[4],a=e[5],s=Jt.fromRectangle(r,o,a,te.WGS84,uCe),c=s.center,u=s.halfAxes;t=O.multiplyTransformation(t,O.inverseTransformation(n,SQ),SQ),c=O.multiplyByPoint(t,c,c);let f=O.getMatrix3(t,sCe);return u=$.multiply(f,u,u),l(i)&&i instanceof mf?(i.update(c,u),i):new mf(c,u)}function vgt(e,t,n,i){if(!O.equalsEpsilon(t,n,I.EPSILON8))return i instanceof mf?eCe(e,t,n,i):eCe(e,t,n,void 0);let r=ie.unpack(e,0,lCe);return i instanceof Rd?(i.rectangle=ie.clone(r,i.rectangle),i.minimumHeight=e[4],i.maximumHeight=e[5],i.computeBoundingVolumes(te.WGS84),i):new Rd({rectangle:r,minimumHeight:e[4],maximumHeight:e[5]})}function Egt(e,t,n){let i=h.fromElements(e[0],e[1],e[2],IQ),r=e[3];i=O.multiplyByPoint(t,i,i);let o=O.getScale(t,cCe),a=h.maximumComponent(o);return r*=a,l(n)?(n.update(i,r),n):new Hy(i,r)}uo.prototype.createBoundingVolume=function(e,t,n){let i=this.metadata,r;if(l(i)&&(r=mx.parseBoundingVolumeSemantic("TILE",i)),l(r)&&(e=r),!l(e))throw new oe("boundingVolume must be defined");if(Qi(e,"3DTILES_bounding_volume_S2"))return new X4(e.extensions["3DTILES_bounding_volume_S2"]);let{box:o,region:a,sphere:s}=e;if(l(o)){let c=Cgt(o,t,n);return this._verticalExaggeration!==1&&tCe(c,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c}if(l(a)){let c=vgt(a,t,this._initialTransform,n);return this._verticalExaggeration===1||(c instanceof mf?tCe(c,this._verticalExaggeration,this._verticalExaggerationRelativeHeight):(c.minimumHeight=pr.getHeight(c.minimumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c.maximumHeight=pr.getHeight(c.maximumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c.computeBoundingVolumes(te.WGS84))),c}if(l(s)){let c=Egt(s,t,n);if(this._verticalExaggeration!==1){let u=pr.getPosition(c.center,te.WGS84,this._verticalExaggeration,this._verticalExaggerationRelativeHeight,IQ),f=c.radius*this._verticalExaggeration;c.update(u,f)}return c}throw new oe("boundingVolume must contain a sphere, region, or box")};var Sgt=h.unpackArray(new Array(24).fill(0));function tCe(e,t,n){let i=e.boundingVolume.computeCorners(Sgt).map(o=>pr.getPosition(o,te.WGS84,t,n,o)),r=Jt.fromPoints(i,uCe);e.update(r.center,r.halfAxes)}uo.prototype.updateTransform=function(e,t){e=e??O.IDENTITY;let n=O.multiplyTransformation(e,this.transform,SQ),i=!O.equals(n,this.computedTransform),r=l(t)&&(this._verticalExaggeration!==t.verticalExaggeration||this._verticalExaggerationRelativeHeight!==t.verticalExaggerationRelativeHeight);if(!i&&!r)return;i&&O.clone(n,this.computedTransform),r&&(this._verticalExaggeration=t.verticalExaggeration,this._verticalExaggerationRelativeHeight=t.verticalExaggerationRelativeHeight);let o=this._header,a=this._contentHeader;this._boundingVolume=this.createBoundingVolume(o.boundingVolume,this.computedTransform,this._boundingVolume),l(this._contentBoundingVolume)&&(this._contentBoundingVolume=this.createBoundingVolume(a.boundingVolume,this.computedTransform,this._contentBoundingVolume)),l(this._viewerRequestVolume)&&(this._viewerRequestVolume=this.createBoundingVolume(o.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()};uo.prototype.updateGeometricErrorScale=function(){let e=O.getScale(this.computedTransform,cCe),t=h.maximumComponent(e);if(this.geometricError=this._geometricError*t,!l(this.parent)){let n=this._tileset;n._scaledGeometricError=n._geometricError*t}};function wgt(e,t,n,i){if(!i.isRender)return;let r=l(e._contentHeader)&&l(e._contentHeader.boundingVolume),o=t.debugShowBoundingVolume||t.debugShowContentBoundingVolume&&!r;if(o){let c;e._finalResolution?e.hasRenderableContent?c=U.WHITE:c=U.DARKGRAY:c=U.YELLOW,l(e._debugBoundingVolume)||(e._debugBoundingVolume=e._boundingVolume.createDebugVolume(c)),e._debugBoundingVolume.update(n);let u=e._debugBoundingVolume.getGeometryInstanceAttributes("outline");u.color=Kt.toValue(c,u.color)}else!o&&l(e._debugBoundingVolume)&&(e._debugBoundingVolume=e._debugBoundingVolume.destroy());t.debugShowContentBoundingVolume&&r?(l(e._debugContentBoundingVolume)||(e._debugContentBoundingVolume=e._contentBoundingVolume.createDebugVolume(U.BLUE)),e._debugContentBoundingVolume.update(n)):!t.debugShowContentBoundingVolume&&l(e._debugContentBoundingVolume)&&(e._debugContentBoundingVolume=e._debugContentBoundingVolume.destroy()),t.debugShowViewerRequestVolume&&l(e._viewerRequestVolume)?(l(e._debugViewerRequestVolume)||(e._debugViewerRequestVolume=e._viewerRequestVolume.createDebugVolume(U.YELLOW)),e._debugViewerRequestVolume.update(n)):!t.debugShowViewerRequestVolume&&l(e._debugViewerRequestVolume)&&(e._debugViewerRequestVolume=e._debugViewerRequestVolume.destroy());let a=t.debugColorizeTiles&&!e._debugColorizeTiles||l(t._heatmap.tilePropertyName),s=!t.debugColorizeTiles&&e._debugColorizeTiles;a?(t._heatmap.colorize(e,n),e._debugColorizeTiles=!0,e.color=e._debugColor):s&&(e._debugColorizeTiles=!1,e.color=U.WHITE),e._colorDirty&&(e._colorDirty=!1,e._content.applyDebugSettings(!0,e._color)),s&&t.makeStyleDirty()}function Igt(e,t,n){let i=e._expiredContent;if(!e.hasMultipleContents&&l(i)){if(!e.contentReady){try{i.update(t,n)}catch{}return}e._expiredContent.destroy(),e._expiredContent=void 0}if(l(e.content))try{e.content.update(t,n)}catch(r){throw e._contentState=co.FAILED,r}}function Pgt(e,t){let n=t.clippingPlanes,i=0;l(n)&&e._isClipped&&n.enabled&&(i=n.clippingPlanesState),i!==e._clippingPlanesState&&(e._clippingPlanesState=i,e.clippingPlanesDirty=!0)}function Dgt(e,t){let n=t.clippingPolygons,i=0;l(n)&&e._isClippedByPolygon&&n.enabled&&(i=n.clippingPolygonsState),i!==e._clippingPolygonsState&&(e._clippingPolygonsState=i,e.clippingPolygonsDirty=!0)}uo.prototype.update=function(e,t,n){let{commandList:i}=t,r=i.length;Pgt(this,e),Dgt(this,e),wgt(this,e,t,n),Igt(this,e,t);let o=i.length;this._commandsLength=o-r;for(let a=r;a<o;++a){let s=i[a],c=s.pass===Pe.TRANSLUCENT;s.depthForTranslucentClassification=c}this.clippingPlanesDirty=!1,this.clippingPolygonsDirty=!1};var nCe=[];uo.prototype.process=function(e,t){!this.contentExpired&&!this.contentReady&&this._content.ready&&(mgt(this),this._selectedFrame=0,this.lastStyleTime=0,K.now(this._loadTimestamp),this._contentState=co.READY,!this.hasTilesetContent&&!this.hasImplicitContent&&(e._statistics.incrementLoadCounts(this.content),++e._statistics.numberOfTilesWithContentReady,++e._statistics.numberOfLoadedTilesTotal,e._cache.add(this)));let n=t.commandList;t.commandList=nCe;try{this._content.update(e,t)}catch(i){throw this._contentState=co.FAILED,i}nCe.length=0,t.commandList=n};function iCe(e,t,n){let i=e*Math.pow(10,t);return parseInt(i)*Math.pow(10,n)}function K4(e,t,n){return Math.max(I.normalize(e,t,n)-I.EPSILON7,0)}uo.prototype.updatePriority=function(){let e=this.tileset,t=e.preferLeaves,n=e._minimumPriority,i=e._maximumPriority,r=4,o=1,a=0,s=r,c=a+s,u=r,f=c+u,d=o,p=Math.pow(10,f),g=f+d,m=o,y=Math.pow(10,g),A=g+m,b=Math.pow(10,A),x=K4(this._depth,n.depth,i.depth);x=t?1-x:x;let C=!e.isSkippingLevelOfDetail&&this.refine===To.REPLACE?K4(this._priorityHolder._distanceToCamera,n.distance,i.distance):K4(this._priorityReverseScreenSpaceError,n.reverseScreenSpaceError,i.reverseScreenSpaceError),E=iCe(C,s,a),w=this._priorityProgressiveResolution?0:p,D=K4(this._priorityHolder._foveatedFactor,n.foveatedFactor,i.foveatedFactor),R=iCe(D,u,c),M=this.priorityDeferred?y:0,N=e._pass===lo.PRELOAD_FLIGHT?0:b;this._priority=x+E+w+R+M+N};uo.prototype.isDestroyed=function(){return!1};uo.prototype.destroy=function(){return this._content=this._content&&this._content.destroy(),this._expiredContent=this._expiredContent&&!this._expiredContent.isDestroyed()&&this._expiredContent.destroy(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy(),ue(this)};var Yh=uo;function pg(e){e=e??H.EMPTY_OBJECT;let t=e.id,n=e.group,i=e.class,r=l(n.properties)?n.properties:{};this._class=i,this._properties=r,this._id=t,this._extras=n.extras,this._extensions=n.extensions}Object.defineProperties(pg.prototype,{class:{get:function(){return this._class}},id:{get:function(){return this._id}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});pg.prototype.hasProperty=function(e){return qn.hasProperty(e,this._properties,this._class)};pg.prototype.hasPropertyBySemantic=function(e){return qn.hasPropertyBySemantic(e,this._properties,this._class)};pg.prototype.getPropertyIds=function(e){return qn.getPropertyIds(this._properties,this._class,e)};pg.prototype.getProperty=function(e){return qn.getProperty(e,this._properties,this._class)};pg.prototype.setProperty=function(e,t){return qn.setProperty(e,t,this._properties,this._class)};pg.prototype.getPropertyBySemantic=function(e){return qn.getPropertyBySemantic(e,this._properties,this._class)};pg.prototype.setPropertyBySemantic=function(e,t){return qn.setPropertyBySemantic(e,t,this._properties,this._class)};var p1=pg;function gg(e){e=e??H.EMPTY_OBJECT;let t=e.tileset,n=e.class,i=l(t.properties)?t.properties:{};this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(gg.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});gg.prototype.hasProperty=function(e){return qn.hasProperty(e,this._properties,this._class)};gg.prototype.hasPropertyBySemantic=function(e){return qn.hasPropertyBySemantic(e,this._properties,this._class)};gg.prototype.getPropertyIds=function(e){return qn.getPropertyIds(this._properties,this._class,e)};gg.prototype.getProperty=function(e){return qn.getProperty(e,this._properties,this._class)};gg.prototype.setProperty=function(e,t){return qn.setProperty(e,t,this._properties,this._class)};gg.prototype.getPropertyBySemantic=function(e){return qn.getPropertyBySemantic(e,this._properties,this._class)};gg.prototype.setPropertyBySemantic=function(e,t){return qn.setPropertyBySemantic(e,t,this._properties,this._class)};var $4=gg;function fCe(e){e=e??H.EMPTY_OBJECT;let t=e.metadataJson,n=e.schema,i=t.metadata??t.tileset,r;l(i)&&(r=new $4({tileset:i,class:n.classes[i.class]}));let o=[],a=[],s=t.groups;if(Array.isArray(s)){let c=s.length;for(let u=0;u<c;u++){let f=s[u];a.push(new p1({group:f,class:n.classes[f.class]}))}}else if(l(s)){o=Object.keys(s).sort();let c=o.length;for(let u=0;u<c;u++){let f=o[u];if(s.hasOwnProperty(f)){let d=s[f];a.push(new p1({id:f,group:s[f],class:n.classes[d.class]}))}}}this._schema=n,this._groups=a,this._groupIds=o,this._tileset=r,this._statistics=t.statistics,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(fCe.prototype,{schema:{get:function(){return this._schema}},groups:{get:function(){return this._groups}},groupIds:{get:function(){return this._groupIds}},tileset:{get:function(){return this._tileset}},statistics:{get:function(){return this._statistics}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var cS=fCe;var dCe={},Rgt=new h;dCe.checkChildrenWithinParent=function(e){let t=e.children,n=t.length,i=e.boundingVolume;if(i instanceof mf||i instanceof Rd){let r=i._orientedBoundingBox;e._optimChildrenWithinParent=qh.USE_OPTIMIZATION;for(let o=0;o<n;++o){let s=t[o].boundingVolume;if(!(s instanceof mf||s instanceof Rd)){e._optimChildrenWithinParent=qh.SKIP_OPTIMIZATION;break}let c=s._orientedBoundingBox,u=h.subtract(c.center,r.center,Rgt),f=h.magnitude(u);h.divideByScalar(u,f,u);let d=Math.abs(r.halfAxes[0]*u.x)+Math.abs(r.halfAxes[1]*u.y)+Math.abs(r.halfAxes[2]*u.z)+Math.abs(r.halfAxes[3]*u.x)+Math.abs(r.halfAxes[4]*u.y)+Math.abs(r.halfAxes[5]*u.z)+Math.abs(r.halfAxes[6]*u.x)+Math.abs(r.halfAxes[7]*u.y)+Math.abs(r.halfAxes[8]*u.z),p=Math.abs(c.halfAxes[0]*u.x)+Math.abs(c.halfAxes[1]*u.y)+Math.abs(c.halfAxes[2]*u.z)+Math.abs(c.halfAxes[3]*u.x)+Math.abs(c.halfAxes[4]*u.y)+Math.abs(c.halfAxes[5]*u.z)+Math.abs(c.halfAxes[6]*u.x)+Math.abs(c.halfAxes[7]*u.y)+Math.abs(c.halfAxes[8]*u.z);if(d<=p+f){e._optimChildrenWithinParent=qh.SKIP_OPTIMIZATION;break}}}return e._optimChildrenWithinParent===qh.USE_OPTIMIZATION};var J4=dCe;function Cx(){this._list=new TN,this._sentinel=this._list.add(),this._trimTiles=!1}Cx.prototype.reset=function(){this._list.splice(this._list.tail,this._sentinel)};Cx.prototype.touch=function(e){let t=e.cacheNode;l(t)&&this._list.splice(this._sentinel,t)};Cx.prototype.add=function(e){l(e.cacheNode)||(e.cacheNode=this._list.add(e))};Cx.prototype.unloadTile=function(e,t,n){let i=t.cacheNode;l(i)&&(this._list.remove(i),t.cacheNode=void 0,n(e,t))};Cx.prototype.unloadTiles=function(e,t){let n=this._trimTiles;this._trimTiles=!1;let i=this._list,r=this._sentinel,o=i.head;for(;o!==r&&(e.totalMemoryUsageInBytes>e.cacheBytes||n);){let a=o.item;o=o.next,this.unloadTile(e,a,t)}};Cx.prototype.trim=function(){this._trimTiles=!0};var Z4=Cx;function Q4(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 DQ(e,t){let n;return t==="_loadTimestamp"?n=K.toDate(e).getTime():n=e,n}Q4.prototype.setReferenceMinimumMaximum=function(e,t,n){this._referenceMinimum[n]=DQ(e,n),this._referenceMaximum[n]=DQ(t,n)};function Ogt(e,t){let n=e.tilePropertyName;if(l(n)){let i=DQ(t[n],n);return l(i)?(e._maximum=Math.max(i,e._maximum),e._minimum=Math.min(i,e._minimum),i):(e.tilePropertyName=void 0,i)}}var PQ=[new U(.1,.1,.1,1),new U(.153,.278,.878,1),new U(.827,.231,.49,1),new U(.827,.188,.22,1),new U(1,.592,.259,1),new U(1,.843,0,1)];Q4.prototype.colorize=function(e,t){let n=this.tilePropertyName;if(!l(n)||!e.contentAvailable||e._selectedFrame!==t.frameNumber)return;let i=Ogt(this,e),r=this._previousMinimum,o=this._previousMaximum;if(r===Number.MAX_VALUE||o===-Number.MAX_VALUE)return;let a=o-r+I.EPSILON7,c=I.clamp(i-r,0,a)/a,u=PQ.length-1,f=c*u,d=Math.floor(f),p=Math.ceil(f),g=f-d,m=PQ[d],y=PQ[p],A=U.clone(U.WHITE);A.red=I.lerp(m.red,y.red,g),A.green=I.lerp(m.green,y.green,g),A.blue=I.lerp(m.blue,y.blue,g),e._debugColor=A};Q4.prototype.resetMinimumMaximum=function(){let e=this.tilePropertyName;if(l(e)){let t=this._referenceMinimum[e],n=this._referenceMaximum[e],i=l(t)&&l(n);this._previousMinimum=i?t:this._minimum,this._previousMaximum=i?n:this._maximum,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE}};var e8=Q4;function lS(){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}lS.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};lS.prototype.incrementSelectionCounts=function(e){this.numberOfFeaturesSelected+=e.featuresLength,this.numberOfPointsSelected+=e.pointsLength,this.numberOfTrianglesSelected+=e.trianglesLength;let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)this.incrementSelectionCounts(t[i])}};lS.prototype.incrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded+=e.featuresLength,this.numberOfPointsLoaded+=e.pointsLength,this.geometryByteLength+=e.geometryByteLength,this.batchTableByteLength+=e.batchTableByteLength,!(e instanceof Sd))this.texturesByteLength+=e.texturesByteLength;else{let n=e.getTextureIds();for(let i of n){let r=this.texturesReferenceCounterById[i]??0;if(r===0){let o=e.getTextureByteLengthById(i);this.texturesByteLength+=o}this.texturesReferenceCounterById[i]=r+1}}let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)this.incrementLoadCounts(t[i])}};lS.prototype.decrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded-=e.featuresLength,this.numberOfPointsLoaded-=e.pointsLength,this.geometryByteLength-=e.geometryByteLength,this.batchTableByteLength-=e.batchTableByteLength,!(e instanceof Sd))this.texturesByteLength-=e.texturesByteLength;else{let n=e.getTextureIds();for(let i of n){let r=this.texturesReferenceCounterById[i];if(r===1){delete this.texturesReferenceCounterById[i];let o=e.getTextureByteLengthById(i);this.texturesByteLength-=o}else this.texturesReferenceCounterById[i]=r-1}}let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)this.decrementLoadCounts(t[i])}};lS.clone=function(e,t){t.selected=e.selected,t.visited=e.visited,t.numberOfCommands=e.numberOfCommands,t.numberOfAttemptedRequests=e.numberOfAttemptedRequests,t.numberOfPendingRequests=e.numberOfPendingRequests,t.numberOfTilesProcessing=e.numberOfTilesProcessing,t.numberOfTilesWithContentReady=e.numberOfTilesWithContentReady,t.numberOfTilesTotal=e.numberOfTilesTotal,t.numberOfFeaturesSelected=e.numberOfFeaturesSelected,t.numberOfFeaturesLoaded=e.numberOfFeaturesLoaded,t.numberOfPointsSelected=e.numberOfPointsSelected,t.numberOfPointsLoaded=e.numberOfPointsLoaded,t.numberOfTrianglesSelected=e.numberOfTrianglesSelected,t.numberOfTilesStyled=e.numberOfTilesStyled,t.numberOfFeaturesStyled=e.numberOfFeaturesStyled,t.numberOfTilesCulledWithChildrenUnion=e.numberOfTilesCulledWithChildrenUnion,t.geometryByteLength=e.geometryByteLength,t.texturesByteLength=e.texturesByteLength,t.texturesReferenceCounterById={...e.texturesReferenceCounterById},t.batchTableByteLength=e.batchTableByteLength};var Ip=lS;function g1(){this._style=void 0,this._styleDirty=!1,this._lastStyleTime=0}Object.defineProperties(g1.prototype,{style:{get:function(){return this._style},set:function(e){e!==this._style&&(this._style=e,this._styleDirty=!0)}}});g1.prototype.makeDirty=function(){this._styleDirty=!0};g1.prototype.resetDirty=function(){this._styleDirty=!1};g1.prototype.applyStyle=function(e){if(!l(e.root)||l(this._style)&&!this._style._ready)return;let t=this._styleDirty;t&&++this._lastStyleTime;let n=this._lastStyleTime,i=e._statistics,r=t?e._selectedTiles:e._selectedTilesToStyle,o=r.length;for(let a=0;a<o;++a){let s=r[a];if(s.lastStyleTime!==n){let c=s.content;s.lastStyleTime=n,c.applyStyle(this._style),i.numberOfFeaturesStyled+=c.featuresLength,++i.numberOfTilesStyled}}};var t8=g1;function _g(){}_g.selectTiles=function(e,t){pe.throwInstantiationError()};_g.sortChildrenByDistanceToCamera=function(e,t){return t._distanceToCamera===0&&e._distanceToCamera===0?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera};_g.canTraverse=function(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:e._screenSpaceError>e.tileset.memoryAdjustedScreenSpaceError};_g.selectTile=function(e,t){if(e.contentVisibility(t)===Xt.OUTSIDE)return;e._wasSelectedLastFrame=!0;let{content:n,tileset:i}=e;n.featurePropertiesDirty?(n.featurePropertiesDirty=!1,e.lastStyleTime=0,i._selectedTilesToStyle.push(e)):e._selectedFrame<t.frameNumber-1&&(i._selectedTilesToStyle.push(e),e._wasSelectedLastFrame=!1),e._selectedFrame=t.frameNumber,i._selectedTiles.push(e)};_g.visitTile=function(e,t){++e.tileset._statistics.visited,e._visitedFrame=t.frameNumber};_g.touchTile=function(e,t){e._touchedFrame!==t.frameNumber&&(e.tileset._cache.touch(e),e._touchedFrame=t.frameNumber)};_g.loadTile=function(e,t){let{tileset:n}=e;if(e._requestedFrame===t.frameNumber||!e.hasUnloadedRenderableContent&&!e.contentExpired||!Mgt(e,t))return;let i=t.camera.timeSinceMoved<n.foveatedTimeDelay;e.priorityDeferred&&i||(e._requestedFrame=t.frameNumber,n._requestedTiles.push(e))};function Mgt(e,t){let{tileset:n}=e;if(!n._cullRequestsWhileMoving)return!0;let{positionWCDeltaMagnitude:i,positionWCDeltaMagnitudeLastFrame:r}=t.camera,o=i!==0?i:r,a=Math.max(e.boundingSphere.radius*2,1);return n.cullRequestsWhileMovingMultiplier*o/a<1}_g.updateTile=function(e,t){hCe(e,t),e.updateExpiration(),e._wasMinPriorityChild=!1,e._priorityHolder=e,Fgt(e),e._shouldSelect=!1,e._finalResolution=!0};function hCe(e,t){if(e.updateVisibility(t),!e.isVisible)return;let n=e.children.length>0;if((e.hasTilesetContent||e.hasImplicitContent)&&n){let o=e.children[0];hCe(o,t),e._visible=o._visible;return}if(Lgt(e,t)){e._visible=!1;return}let i=e.refine===To.REPLACE,r=e._optimChildrenWithinParent===qh.USE_OPTIMIZATION;if(i&&r&&n&&!Ngt(e,t)){++e.tileset._statistics.numberOfTilesCulledWithChildrenUnion,e._visible=!1;return}}function Lgt(e,t){let{parent:n,tileset:i}=e;return!l(n)||n.hasTilesetContent||n.hasImplicitContent||n.refine!==To.ADD?!1:e.getScreenSpaceError(t,!0)<=i.memoryAdjustedScreenSpaceError}function Ngt(e,t){let n=!1,i=e.children;for(let r=0;r<i.length;++r){let o=i[r];o.updateVisibility(t),n=n||o.isVisible}return n}function Fgt(e){let t=e.tileset._minimumPriority,n=e.tileset._maximumPriority,i=e._priorityHolder;n.distance=Math.max(i._distanceToCamera,n.distance),t.distance=Math.min(i._distanceToCamera,t.distance),n.depth=Math.max(e._depth,n.depth),t.depth=Math.min(e._depth,t.depth),n.foveatedFactor=Math.max(i._foveatedFactor,n.foveatedFactor),t.foveatedFactor=Math.min(i._foveatedFactor,t.foveatedFactor),n.reverseScreenSpaceError=Math.max(e._priorityReverseScreenSpaceError,n.reverseScreenSpaceError),t.reverseScreenSpaceError=Math.min(e._priorityReverseScreenSpaceError,t.reverseScreenSpaceError)}var ic=_g;function mCe(){}var _1={stack:new au,stackMaximumLength:0};mCe.selectTiles=function(e,t){e._selectedTiles.length=0,e._requestedTiles.length=0,e.hasMixedContent=!1;let n=!0,i=e.root;if(i.updateVisibility(t),!i.isVisible)return n;let{touchTile:r,visitTile:o}=ic,a=_1.stack;for(a.push(i);a.length>0;){_1.stackMaximumLength=Math.max(_1.stackMaximumLength,a.length);let s=a.pop(),c=s.refine===To.ADD,u=s.refine===To.REPLACE,f=Bgt(s);f&&kgt(s,a,t),(c||u&&!f)&&(zgt(e,s),r(s,t),Ugt(s,t),s.hasRenderableContent&&!s.contentAvailable&&(n=!1)),o(s,t)}return _1.stack.trim(_1.stackMaximumLength),n};function Bgt(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:(e.hasEmptyContent,!0)}function kgt(e,t,n){let{children:i}=e;for(let r=0;r<i.length;++r){let o=i[r];o.updateVisibility(n),o.isVisible&&t.push(o)}}function zgt(e,t){(t.hasUnloadedRenderableContent||t.contentExpired)&&(t._priority=0,e._requestedTiles.push(t))}function Ugt(e,t){e.contentAvailable&&e.contentVisibility(t)!==Xt.OUTSIDE&&e.tileset._selectedTiles.push(e)}var n8=mCe;function pCe(){}var y1={stack:new au,stackMaximumLength:0},A1={stack:new au,stackMaximumLength:0};pCe.selectTiles=function(e,t){if(e._requestedTiles.length=0,e.debugFreezeFrame)return;e._selectedTiles.length=0,e._selectedTilesToStyle.length=0,e._emptyTiles.length=0,e.hasMixedContent=!1;let n=e.root;if(ic.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;jgt(n,t),y1.stack.trim(y1.stackMaximumLength),A1.stack.trim(A1.stackMaximumLength);let i=e._requestedTiles;for(let r=0;r<i.length;++r)i[r].updatePriority()};function RQ(e,t){e.contentAvailable&&ic.selectTile(e,t)}function Vgt(e,t,n){let i=e.refine===To.REPLACE,{tileset:r,children:o}=e,{updateTile:a,loadTile:s,touchTile:c}=ic;for(let m=0;m<o.length;++m)a(o[m],n);o.sort(ic.sortChildrenByDistanceToCamera);let u=i&&e.hasRenderableContent,f=!0,d=!1,p=-1,g=Number.MAX_VALUE;for(let m=0;m<o.length;++m){let y=o[m];if(y.isVisible?(t.push(y),y._foveatedFactor<g&&(p=m,g=y._foveatedFactor),d=!0):(u||r.loadSiblings)&&(y._foveatedFactor<g&&(p=m,g=y._foveatedFactor),s(y,n),c(y,n)),u){let A;y._inRequestVolume?y.hasRenderableContent?A=y.contentAvailable:A=Hgt(y,n):A=!1,f=f&&A}}if(d||(f=!1),p!==-1&&i){let m=o[p];m._wasMinPriorityChild=!0;let y=(e._wasMinPriorityChild||e===r.root)&&g<=e._priorityHolder._foveatedFactor?e._priorityHolder:e;y._foveatedFactor=Math.min(m._foveatedFactor,y._foveatedFactor),y._distanceToCamera=Math.min(m._distanceToCamera,y._distanceToCamera);for(let A=0;A<o.length;++A)o[A]._priorityHolder=y}return f}function jgt(e,t){let{tileset:n}=e,{canTraverse:i,loadTile:r,visitTile:o,touchTile:a}=ic,s=y1.stack;for(s.push(e);s.length>0;){y1.stackMaximumLength=Math.max(y1.stackMaximumLength,s.length);let c=s.pop(),u=c.parent,f=!l(u)||u._refines;c._refines=i(c)?Vgt(c,s,t)&&f:!1;let d=!c._refines&&f;c.hasRenderableContent?c.refine===To.ADD?(RQ(c,t),r(c,t)):c.refine===To.REPLACE&&(r(c,t),d&&RQ(c,t)):(n._emptyTiles.push(c),r(c,t),d&&RQ(c,t)),o(c,t),a(c,t)}}function Hgt(e,t){let{canTraverse:n,updateTile:i,loadTile:r,touchTile:o}=ic,a=!0,s=A1.stack;for(s.push(e);s.length>0;){A1.stackMaximumLength=Math.max(A1.stackMaximumLength,s.length);let c=s.pop(),u=c.children,f=u.length,d=!c.hasRenderableContent&&n(c);if(!d&&!c.contentAvailable&&(a=!1),i(c,t),c.isVisible||(r(c,t),o(c,t)),d)for(let p=0;p<f;++p){let g=u[p];s.push(g)}}return e.hasEmptyContent||a}var i8=pCe;function gCe(){}var b1={stack:new au,stackMaximumLength:0},x1={stack:new au,stackMaximumLength:0},yg={stack:new au,stackMaximumLength:0,ancestorStack:new au,ancestorStackMaximumLength:0},Ggt=2;gCe.selectTiles=function(e,t){if(e._requestedTiles.length=0,e.debugFreezeFrame)return;e._selectedTiles.length=0,e._selectedTilesToStyle.length=0,e._emptyTiles.length=0,e.hasMixedContent=!1;let n=e.root;if(ic.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;$gt(n,t),Jgt(n,t),b1.stack.trim(b1.stackMaximumLength),x1.stack.trim(x1.stackMaximumLength),yg.stack.trim(yg.stackMaximumLength),yg.ancestorStack.trim(yg.ancestorStackMaximumLength);let i=e._requestedTiles;for(let r=0;r<i.length;++r)i[r].updatePriority()};function Wgt(e,t){let{updateTile:n,touchTile:i,selectTile:r}=ic,o=x1.stack;for(o.push(e);o.length>0;){x1.stackMaximumLength=Math.max(x1.stackMaximumLength,o.length);let s=o.pop().children;for(let c=0;c<s.length;++c){let u=s[c];u.isVisible&&(u.contentAvailable?(n(u,t),i(u,t),r(u,t)):u._depth-e._depth<Ggt&&o.push(u))}}}function r8(e,t){let n=e.contentAvailable?e:e._ancestorWithContentAvailable;l(n)?n._shouldSelect=!0:Wgt(e,t)}function qgt(e,t){e._ancestorWithContent=void 0,e._ancestorWithContentAvailable=void 0;let{parent:n}=e;if(!l(n))return;let i=!n.hasUnloadedRenderableContent||n._requestedFrame===t.frameNumber;e._ancestorWithContent=i?n:n._ancestorWithContent,e._ancestorWithContentAvailable=n.contentAvailable?n:n._ancestorWithContentAvailable}function Ygt(e,t){let n=t._ancestorWithContent;return!e.immediatelyLoadDesiredLevelOfDetail&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf||l(n)&&t._screenSpaceError<n._screenSpaceError/e.skipScreenSpaceErrorFactor&&t._depth>n._depth+e.skipLevels)}function Xgt(e,t,n){let{tileset:i,children:r}=e,{updateTile:o,loadTile:a,touchTile:s}=ic;for(let u=0;u<r.length;++u)o(r[u],n);r.sort(ic.sortChildrenByDistanceToCamera);let c=!1;for(let u=0;u<r.length;++u){let f=r[u];f.isVisible?(t.push(f),c=!0):i.loadSiblings&&(a(f,n),s(f,n))}return c}function Kgt(e,t){let{tileset:n}=e;return n.immediatelyLoadDesiredLevelOfDetail?!1:l(e._ancestorWithContent)?e._screenSpaceError===0?e.parent._screenSpaceError>t:e._screenSpaceError>t:!0}function $gt(e,t){let{tileset:n}=e,i=n.immediatelyLoadDesiredLevelOfDetail?Number.MAX_VALUE:Math.max(n.baseScreenSpaceError,n.memoryAdjustedScreenSpaceError),{canTraverse:r,loadTile:o,visitTile:a,touchTile:s}=ic,c=b1.stack;for(c.push(e);c.length>0;){b1.stackMaximumLength=Math.max(b1.stackMaximumLength,c.length);let u=c.pop();qgt(u,t);let f=u.parent,d=!l(f)||f._refines;u._refines=r(u)?Xgt(u,c,t)&&d:!1;let p=!u._refines&&d;u.hasRenderableContent?u.refine===To.ADD?(r8(u,t),o(u,t)):u.refine===To.REPLACE&&(Kgt(u,i)?(o(u,t),p&&r8(u,t)):p?(r8(u,t),o(u,t)):Ygt(n,u)&&o(u,t)):(n._emptyTiles.push(u),o(u,t),p&&r8(u,t)),a(u,t),s(u,t)}}function Jgt(e,t){let{selectTile:n,canTraverse:i}=ic,{stack:r,ancestorStack:o}=yg,a;for(r.push(e);r.length>0||o.length>0;){if(yg.stackMaximumLength=Math.max(yg.stackMaximumLength,r.length),yg.ancestorStackMaximumLength=Math.max(yg.ancestorStackMaximumLength,o.length),o.length>0){let u=o.peek();if(u._stackLength===r.length){o.pop(),u!==a&&(u._finalResolution=!1),n(u,t);continue}}let s=r.pop();if(!l(s))continue;let c=i(s);if(s._shouldSelect)if(s.refine===To.ADD)n(s,t);else{if(s._selectionDepth=o.length,s._selectionDepth>0&&(s.tileset.hasMixedContent=!0),a=s,!c){n(s,t);continue}o.push(s),s._stackLength=r.length}if(c){let u=s.children;for(let f=0;f<u.length;++f){let d=u[f];d.isVisible&&r.push(d)}}}}var o8=gCe;function ms(){this._layers=[],this.layerAdded=new be,this.layerRemoved=new be,this.layerMoved=new be,this.layerShownOrHidden=new be}Object.defineProperties(ms.prototype,{length:{get:function(){return this._layers.length}}});ms.prototype.add=function(e,t){l(t)?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()})};ms.prototype.addImageryProvider=function(e,t){let n=new wa(e);return this.add(n,t),n};ms.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};ms.prototype.removeAll=function(e){e=e??!0;let t=this._layers;for(let n=0,i=t.length;n<i;n++){let r=t[n];this.layerRemoved.raiseEvent(r,n),e&&r.destroy()}this._layers=[]};ms.prototype.contains=function(e){return this.indexOf(e)!==-1};ms.prototype.indexOf=function(e){return this._layers.indexOf(e)};ms.prototype.get=function(e){return this._layers[e]};function a8(e,t){return e.indexOf(t)}function _Ce(e,t,n){let i=e._layers;if(t=I.clamp(t,0,i.length-1),n=I.clamp(n,0,i.length-1),t===n)return;let r=i[t];i[t]=i[n],i[n]=r,e._update(),e.layerMoved.raiseEvent(r,n,t)}ms.prototype.raise=function(e){let t=a8(this._layers,e);_Ce(this,t,t+1)};ms.prototype.lower=function(e){let t=a8(this._layers,e);_Ce(this,t,t-1)};ms.prototype.raiseToTop=function(e){let t=a8(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))};ms.prototype.lowerToBottom=function(e){let t=a8(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 yCe=new ie;function ACe(e,t,n,i){let r=e.globe._surface._tilesToRender,o;for(let s=0;!l(o)&&s<r.length;++s){let c=r[s];ie.contains(c.rectangle,t)&&(o=c)}if(!l(o))return;let a=o.data.imagery;for(let s=a.length-1;s>=0;--s){let c=a[s],u=c.readyImagery;if(!l(u)||!u.imageryLayer.ready)continue;let f=u.imageryLayer.imageryProvider;if(n&&!l(f.pickFeatures)||!ie.contains(u.rectangle,t))continue;let d=yCe,p=1/1024;d.west=I.lerp(o.rectangle.west,o.rectangle.east,c.textureCoordinateRectangle.x-p),d.east=I.lerp(o.rectangle.west,o.rectangle.east,c.textureCoordinateRectangle.z+p),d.south=I.lerp(o.rectangle.south,o.rectangle.north,c.textureCoordinateRectangle.y-p),d.north=I.lerp(o.rectangle.south,o.rectangle.north,c.textureCoordinateRectangle.w+p),ie.contains(d,t)&&i(u)}}ms.prototype.pickImageryLayers=function(e,t){let n=t.globe.pick(e,t);if(!l(n))return;let i=t.ellipsoid.cartesianToCartographic(n),r=[];if(ACe(t,i,!1,function(o){r.push(o.imageryLayer)}),r.length!==0)return r};var Zgt=new ie,Qgt=new ie,OQ=new k,MQ=new k,e_t=new de,t_t=new de;function n_t(e,t,n,i){let r=n.imageryProvider.tilingScheme,o=r.rectangleToNativeRectangle(e,Zgt),a=1/1024,s=Qgt;s.west=I.lerp(o.west,o.east,t.minX-a),s.east=I.lerp(o.west,o.east,t.maxX+a),s.south=I.lerp(o.south,o.north,t.minY-a),s.north=I.lerp(o.south,o.north,t.maxY+a),l(i)||(i=new ie);let c=r.projection;if(c instanceof ki)return i.west=I.toRadians(s.west),i.south=I.toRadians(s.south),i.east=I.toRadians(s.east),i.north=I.toRadians(s.north),i;OQ.x=s.west,OQ.y=s.south,MQ.x=s.east,MQ.y=s.north;let u=c.unproject(OQ,e_t),f=c.unproject(MQ,t_t);return i.west=u.longitude,i.south=u.latitude,i.east=f.longitude,i.north=f.latitude,i}function i_t(e,t,n){let i=e._modelImagery;if(!l(i))return;let r=i._modelPrimitiveImageries;if(l(r))for(let o=0;o<r.length;o++){let a=r[o],s=a._coveragesPerLayer;if(l(s))for(let c=s.length-1;c>=0;--c){let u=s[c];for(let f=0;f<u.length;f++){let d=u[f],p=d.imagery,g=p.imageryLayer,m=g.imageryProvider;if(!l(m.pickFeatures)||!l(p)||p.state!==jn.READY||!ie.contains(p.rectangle,t))continue;let A=a.mappedPositionsForImageryLayer(g).cartographicBoundingRectangle,b=n_t(A,d.textureCoordinateRectangle,g,yCe);ie.contains(b,t)&&n(p)}}}}ms.prototype.pickImageryLayerFeatures=function(e,t){let n;l(t.globe)&&(n=t.globe.pick(e,t));let i;if(!l(n)){let c=t.pickFromRay(e);if(!l(c)||(n=c.position,!l(n)))return;l(c.object)&&l(c.object.detail)&&(i=c.object.detail.model)}let r=t.ellipsoid.cartesianToCartographic(n),o=[],a=[];function s(c){if(!c.imageryLayer.ready)return;let f=c.imageryLayer.imageryProvider.pickFeatures(c.x,c.y,c.level,r.longitude,r.latitude);l(f)&&(o.push(f),a.push(c.imageryLayer))}if(l(t.globe)&&ACe(t,r,!0,function(c){s(c)}),l(i)&&i_t(i,r,function(c){s(c)}),o.length!==0)return Promise.all(o).then(function(c){let u=[];for(let f=0;f<c.length;++f){let d=c[f],p=a[f];if(l(d)&&d.length>0)for(let g=0;g<d.length;++g){let m=d[g];m.imageryLayer=p,l(m.position)||(m.position=r),u.push(m)}}return u})};ms.prototype.queueReprojectionCommands=function(e){let t=this._layers;for(let n=0,i=t.length;n<i;++n)t[n].queueReprojectionCommands(e)};ms.prototype.cancelReprojections=function(){let e=this._layers;for(let t=0,n=e.length;t<n;++t)e[t].cancelReprojections()};ms.prototype.isDestroyed=function(){return!1};ms.prototype.destroy=function(){return this.removeAll(!0),ue(this)};ms.prototype._update=function(){let e=!0,t=this._layers,n,i,r,o;for(r=0,o=t.length;r<o;++r)i=t[r],i._layerIndex=r,i.show?(i._isBaseLayer=e,e=!1):i._isBaseLayer=!1,i.show!==i._show&&(l(i._show)&&(l(n)||(n=[]),n.push(i)),i._show=i.show);if(l(n))for(r=0,o=n.length;r<o;++r)i=n[r],this.layerShownOrHidden.raiseEvent(i,i._layerIndex,i.show)};var uS=ms;function Zr(e){e=e??H.EMPTY_OBJECT,this._url=void 0,this._basePath=void 0,this._root=void 0,this._resource=void 0,this._asset=void 0,this._properties=void 0,this._geometricError=void 0,this._scaledGeometricError=void 0,this._extensionsUsed=void 0,this._extensions=void 0,this._modelUpAxis=void 0,this._modelForwardAxis=void 0,this._cache=new Z4,this._processingQueue=[],this._selectedTiles=[],this._emptyTiles=[],this._requestedTiles=[],this._selectedTilesToStyle=[],this._loadTimestamp=void 0,this._timeSinceLoad=0,this._updatedVisibilityFrame=0,this._updatedModelMatrixFrame=0,this._modelMatrixChanged=!1,this._previousModelMatrix=void 0,this._extras=void 0,this._credits=void 0,this._showCreditsOnScreen=e.showCreditsOnScreen??!1,this._cullWithChildrenBounds=e.cullWithChildrenBounds??!0,this._allTilesAdditive=!0,this._hasMixedContent=!1,this._stencilClearCommand=void 0,this._backfaceCommands=new au,this._maximumScreenSpaceError=e.maximumScreenSpaceError??16,this._memoryAdjustedScreenSpaceError=this._maximumScreenSpaceError,this._cacheBytes=e.cacheBytes??512*1024*1024;let t=e.maximumCacheOverflowBytes??512*1024*1024;this._maximumCacheOverflowBytes=t,this._styleEngine=new t8,this._styleApplied=!1,this._modelMatrix=l(e.modelMatrix)?O.clone(e.modelMatrix):O.clone(O.IDENTITY),this._addHeightCallbacks=[],this._statistics=new Ip,this._statisticsLast=new Ip,this._statisticsPerPass=new Array(lo.NUMBER_OF_PASSES);for(let r=0;r<lo.NUMBER_OF_PASSES;++r)this._statisticsPerPass[r]=new Ip;this._requestedTilesInFlight=[],this._maximumPriority={foveatedFactor:-Number.MAX_VALUE,depth:-Number.MAX_VALUE,distance:-Number.MAX_VALUE,reverseScreenSpaceError:-Number.MAX_VALUE},this._minimumPriority={foveatedFactor:Number.MAX_VALUE,depth:Number.MAX_VALUE,distance:Number.MAX_VALUE,reverseScreenSpaceError:Number.MAX_VALUE},this._heatmap=new e8(e.debugHeatmapTilePropertyName),this.cullRequestsWhileMoving=e.cullRequestsWhileMoving??!0,this._cullRequestsWhileMoving=!1,this.cullRequestsWhileMovingMultiplier=e.cullRequestsWhileMovingMultiplier??60,this.progressiveResolutionHeightFraction=I.clamp(e.progressiveResolutionHeightFraction??.3,0,.5),this.preferLeaves=e.preferLeaves??!1,this._tilesLoaded=!1,this._initialTilesLoaded=!1,this._tileDebugLabels=void 0,this._classificationType=e.classificationType,this._heightReference=e.heightReference,this._scene=e.scene,this._ellipsoid=e.ellipsoid??te.WGS84,this._initialClippingPlanesOriginMatrix=O.IDENTITY,this._clippingPlanesOriginMatrix=void 0,this._clippingPlanesOriginMatrixDirty=!0,this._vectorClassificationOnly=e.vectorClassificationOnly??!1,this._vectorKeepDecodedPositions=e.vectorKeepDecodedPositions??!1,this._imageryLayers=new uS(this),this._imageryLayersModificationCounter=0,this._imageryLayersListener=()=>{this._imageryLayersModificationCounter++},this.imageryLayers.layerAdded.addEventListener(this._imageryLayersListener),this.imageryLayers.layerRemoved.addEventListener(this._imageryLayersListener),this.imageryLayers.layerMoved.addEventListener(this._imageryLayersListener),this.imageryLayers.layerShownOrHidden.addEventListener(this._imageryLayersListener),this._asynchronouslyLoadImagery=e.asynchronouslyLoadImagery??!1,this.preloadWhenHidden=e.preloadWhenHidden??!1,this.preloadFlightDestinations=e.preloadFlightDestinations??!0,this._pass=void 0,this.dynamicScreenSpaceError=e.dynamicScreenSpaceError??!0,this.foveatedScreenSpaceError=e.foveatedScreenSpaceError??!0,this._foveatedConeSize=e.foveatedConeSize??.1,this._foveatedMinimumScreenSpaceErrorRelaxation=e.foveatedMinimumScreenSpaceErrorRelaxation??0,this.foveatedInterpolationCallback=e.foveatedInterpolationCallback??I.lerp,this.foveatedTimeDelay=e.foveatedTimeDelay??.2,this.dynamicScreenSpaceErrorDensity=e.dynamicScreenSpaceErrorDensity??2e-4,this.dynamicScreenSpaceErrorFactor=e.dynamicScreenSpaceErrorFactor??24,this.dynamicScreenSpaceErrorHeightFalloff=e.dynamicScreenSpaceErrorHeightFalloff??.25,this._dynamicScreenSpaceErrorComputedDensity=0,this.shadows=e.shadows??Rn.ENABLED,this.show=e.show??!0,this.colorBlendMode=sf.HIGHLIGHT,this.colorBlendAmount=.5,this._pointCloudShading=new J0(e.pointCloudShading),this._pointCloudEyeDomeLighting=new xy,this.loadProgress=new be,this.allTilesLoaded=new be,this.initialTilesLoaded=new be,this.tileLoad=new be,this.tileUnload=new be,this.tileFailed=new be,this.tileVisible=new be,this.skipLevelOfDetail=e.skipLevelOfDetail??!1,this._disableSkipLevelOfDetail=!1,this._runtimeContentCodec=void 0,this.baseScreenSpaceError=e.baseScreenSpaceError??1024,this.skipScreenSpaceErrorFactor=e.skipScreenSpaceErrorFactor??16,this.skipLevels=e.skipLevels??1,this.immediatelyLoadDesiredLevelOfDetail=e.immediatelyLoadDesiredLevelOfDetail??!1,this.loadSiblings=e.loadSiblings??!1,this._clippingPlanes=void 0,l(e.clippingPlanes)&&va.setOwner(e.clippingPlanes,this,"_clippingPlanes"),this._clippingPolygons=void 0,l(e.clippingPolygons)&&fp.setOwner(e.clippingPolygons,this,"_clippingPolygons"),l(e.imageBasedLighting)?(this._imageBasedLighting=e.imageBasedLighting,this._shouldDestroyImageBasedLighting=!1):(this._imageBasedLighting=new bE,this._shouldDestroyImageBasedLighting=!0),this._environmentMapManager=new yy(e.environmentMapOptions),this.lightColor=e.lightColor,this.backFaceCulling=e.backFaceCulling??!0,this._enableShowOutline=e.enableShowOutline??!0,this.showOutline=e.showOutline??!0,this.outlineColor=e.outlineColor??U.BLACK,this.splitDirection=e.splitDirection??jo.NONE,this.enableCollision=e.enableCollision??!1,this._projectTo2D=e.projectTo2D??!1,this._enablePick=e.enablePick??!1,this.debugFreezeFrame=e.debugFreezeFrame??!1,this.debugColorizeTiles=e.debugColorizeTiles??!1,this._enableDebugWireframe=e.enableDebugWireframe??!1,this.debugWireframe=e.debugWireframe??!1,this.debugWireframe===!0&&this._enableDebugWireframe===!1&&pt("tileset-debug-wireframe-ignored","enableDebugWireframe must be set to true in the Cesium3DTileset constructor, otherwise debugWireframe will be ignored."),this.edgeDisplayMode=e.edgeDisplayMode??Mh.SURFACES_ONLY,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowContentBoundingVolume=e.debugShowContentBoundingVolume??!1,this.debugShowViewerRequestVolume=e.debugShowViewerRequestVolume??!1,this._tileDebugLabels=void 0,this.debugPickedTileLabelOnly=!1,this.debugPickedTile=void 0,this.debugPickPosition=void 0,this.debugShowGeometricError=e.debugShowGeometricError??!1,this.debugShowRenderingStatistics=e.debugShowRenderingStatistics??!1,this.debugShowMemoryUsage=e.debugShowMemoryUsage??!1,this.debugShowUrl=e.debugShowUrl??!1,this.examineVectorLinesFunction=void 0,this._metadataExtension=void 0,this._customShader=e.customShader;let n=e.featureIdLabel??"featureId_0";typeof n=="number"&&(n=`featureId_${n}`),this._featureIdLabel=n;let i=e.instanceFeatureIdLabel??"instanceFeatureId_0";typeof i=="number"&&(i=`instanceFeatureId_${i}`),this._instanceFeatureIdLabel=i}Object.defineProperties(Zr.prototype,{isCesium3DTileset:{get:function(){return!0}},asset:{get:function(){return this._asset}},extensions:{get:function(){return this._extensions}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){va.setOwner(e,this,"_clippingPlanes")}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){fp.setOwner(e,this,"_clippingPolygons")}},imageryLayers:{get:function(){return this._imageryLayers}},imageryLayersModificationCounter:{get:function(){return this._imageryLayersModificationCounter}},asynchronouslyLoadImagery:{get:function(){return this._asynchronouslyLoadImagery}},properties:{get:function(){return this._properties}},tilesLoaded:{get:function(){return this._tilesLoaded}},resource:{get:function(){return this._resource}},basePath:{get:function(){return qs("Cesium3DTileset.basePath","Cesium3DTileset.basePath has been deprecated. All tiles are relative to the url of the tileset JSON file that contains them. Use the url property instead."),this._basePath}},style:{get:function(){return this._styleEngine.style},set:function(e){this._styleEngine.style=e}},customShader:{get:function(){return this._customShader},set:function(e){this._customShader=e}},hasMixedContent:{get:function(){return this._hasMixedContent},set:function(e){this._hasMixedContent=e}},isSkippingLevelOfDetail:{get:function(){return this.skipLevelOfDetail&&!l(this._classificationType)&&!this._disableSkipLevelOfDetail&&!this._allTilesAdditive}},metadataExtension:{get:function(){return this._metadataExtension}},metadata:{get:function(){if(l(this._metadataExtension))return this._metadataExtension.tileset}},schema:{get:function(){if(l(this._metadataExtension))return this._metadataExtension.schema}},maximumScreenSpaceError:{get:function(){return this._maximumScreenSpaceError},set:function(e){this._maximumScreenSpaceError=e,this._memoryAdjustedScreenSpaceError=e}},cacheBytes:{get:function(){return this._cacheBytes},set:function(e){this._cacheBytes=e}},maximumCacheOverflowBytes:{get:function(){return this._maximumCacheOverflowBytes},set:function(e){this._maximumCacheOverflowBytes=e}},memoryAdjustedScreenSpaceError:{get:function(){return this._memoryAdjustedScreenSpaceError}},pointCloudShading:{get:function(){return this._pointCloudShading},set:function(e){this._pointCloudShading=e}},root:{get:function(){return this._root}},boundingSphere:{get:function(){return this._root.updateTransform(this._modelMatrix),this._root.boundingSphere}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=O.clone(e,this._modelMatrix)}},timeSinceLoad:{get:function(){return this._timeSinceLoad}},totalMemoryUsageInBytes:{get:function(){let e=this._statistics;return e.texturesByteLength+e.geometryByteLength+e.batchTableByteLength}},clippingPlanesOriginMatrix:{get:function(){return l(this._clippingPlanesOriginMatrix)?(this._clippingPlanesOriginMatrixDirty&&(O.multiply(this.root.computedTransform,this._initialClippingPlanesOriginMatrix,this._clippingPlanesOriginMatrix),this._clippingPlanesOriginMatrixDirty=!1),this._clippingPlanesOriginMatrix):O.IDENTITY}},styleEngine:{get:function(){return this._styleEngine}},statistics:{get:function(){return this._statistics}},classificationType:{get:function(){return this._classificationType}},heightReference:{get:function(){return this._heightReference}},scene:{get:function(){return this._scene}},ellipsoid:{get:function(){return this._ellipsoid}},foveatedConeSize:{get:function(){return this._foveatedConeSize},set:function(e){this._foveatedConeSize=e}},foveatedMinimumScreenSpaceErrorRelaxation:{get:function(){return this._foveatedMinimumScreenSpaceErrorRelaxation},set:function(e){this._foveatedMinimumScreenSpaceErrorRelaxation=e}},extras:{get:function(){return this._extras}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){e!==this._imageBasedLighting&&(this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=e,this._shouldDestroyImageBasedLighting=!1)}},environmentMapManager:{get:function(){return this._environmentMapManager}},vectorClassificationOnly:{get:function(){return this._vectorClassificationOnly}},vectorKeepDecodedPositions:{get:function(){return this._vectorKeepDecodedPositions}},showCreditsOnScreen:{get:function(){return this._showCreditsOnScreen},set:function(e){this._showCreditsOnScreen=e,wCe(this)}},featureIdLabel:{get:function(){return this._featureIdLabel},set:function(e){typeof e=="number"&&(e=`featureId_${e}`),this._featureIdLabel=e}},instanceFeatureIdLabel:{get:function(){return this._instanceFeatureIdLabel},set:function(e){typeof e=="number"&&(e=`instanceFeatureId_${e}`),this._instanceFeatureIdLabel=e}}});Zr.fromIonAssetId=async function(e,t){let n=await ga.fromAssetId(e);return Zr.fromUrl(n,t)};Zr.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT;let n=De.createIfNeeded(e),i;n.extension==="json"?i=n.getBaseUri(!0):n.isDataUri&&(i="");let r=await Zr.loadJson(n),o=await r_t(n,r),a=new Zr(t);a._resource=n,a._url=n.url,a._basePath=i,a._metadataExtension=o,a._geometricError=r.geometricError,a._scaledGeometricError=r.geometricError;let s=r.asset;a._asset=s,a._extras=r.extras,wCe(a);let c=l(r.asset.gltfUpAxis)?zi.fromName(r.asset.gltfUpAxis):zi.Y,u=t.modelUpAxis??c,f=t.modelForwardAxis??zi.X;a._properties=r.properties,a._extensionsUsed=r.extensionsUsed,a._extensions=r.extensions,a._modelUpAxis=u,a._modelForwardAxis=f,a._root=a.loadTileset(n,r);let p=a._root.createBoundingVolume(r.root.boundingVolume,O.IDENTITY).boundingSphere.center,g=a._ellipsoid.cartesianToCartographic(p);return l(g)&&g.height>Oi._defaultMinTerrainHeight&&(a._initialClippingPlanesOriginMatrix=mt.eastNorthUpToFixedFrame(p)),a._clippingPlanesOriginMatrix=O.clone(a._initialClippingPlanesOriginMatrix),a};Zr.loadJson=function(e){return De.createIfNeeded(e).fetchJson()};Zr.prototype.makeStyleDirty=function(){this._styleEngine.makeDirty()};Zr.prototype.loadTileset=function(e,t,n){let i=t.asset;if(!l(i))throw new oe("Tileset must have an asset property.");if(i.version!=="0.0"&&i.version!=="1.0"&&i.version!=="1.1")throw new oe("The tileset must be 3D Tiles version 0.0, 1.0, or 1.1");l(t.extensionsRequired)&&Zr.checkSupportedExtensions(t.extensionsRequired);let r=this._statistics,o=i.tilesetVersion;l(o)&&(this._basePath+=`?v=${o}`,e=e.clone(),e.setQueryParameters({v:o}));let a=bCe(this,e,t.root,n);l(n)&&(n.children.push(a),a._depth=n._depth+1);let s=[];for(s.push(a);s.length>0;){let c=s.pop();++r.numberOfTilesTotal,this._allTilesAdditive=this._allTilesAdditive&&c.refine===To.ADD;let u=c._header.children;if(l(u))for(let f=0;f<u.length;++f){let d=u[f],p=bCe(this,e,d,c);c.children.push(p),p._depth=c._depth+1,s.push(p)}this._cullWithChildrenBounds&&J4.checkChildrenWithinParent(c)}return a};function bCe(e,t,n,i){if(!(l(n.implicitTiling)||Qi(n,"3DTILES_implicit_tiling")))return new Yh(e,t,n,i);let o=e.schema,a=new E0(t,n,o),s=new v0({subdivisionScheme:a.subdivisionScheme,subtreeLevels:a.subtreeLevels,level:0,x:0,y:0,z:0}),c=a.subtreeUriTemplate.getDerivedResource({templateValues:s.getTemplateValues()}).url,f=Xe(n,!0);f.contents=[{uri:c}],delete f.content,delete f.extensions;let d=new Yh(e,t,f,i);return d.implicitTileset=a,d.implicitCoordinates=s,d}async function r_t(e,t){let n=Qi(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t,i;if(l(n.schemaUri))e=e.getDerivedResource({url:n.schemaUri}),i=Ni.getSchemaLoader({resource:e});else if(l(n.schema))i=Ni.getSchemaLoader({schema:n.schema});else return;await i.load();let r=new cS({schema:i.schema,metadataJson:n});return Ni.unload(i),r}var xCe=new h,o_t=new de,a_t=new O,s_t=new h,c_t=new h,l_t=new h,u_t=new h;function f_t(e,t){let n,i,r,o,a,s=t.camera,c=e._root,u=c.contentBoundingVolume;if(u instanceof Rd)n=h.normalize(s.positionWC,xCe),i=s.directionWC,r=s.positionCartographic.height,o=u.minimumHeight,a=u.maximumHeight;else{let y=O.inverseTransformation(c.computedTransform,a_t),A=t.mapProjection.ellipsoid,b=u.boundingVolume,x=O.multiplyByPoint(y,b.center,s_t);if(h.magnitude(x)>A.minimumRadius){let T=de.fromCartesian(x,A,o_t);n=h.normalize(s.positionWC,xCe),i=s.directionWC,r=s.positionCartographic.height,o=0,a=T.height*2}else{let T=O.multiplyByPoint(y,s.positionWC,c_t);if(n=h.UNIT_Z,i=O.multiplyByPointAsVector(y,s.directionWC,l_t),i=h.normalize(i,i),r=T.z,u instanceof mf){let C=$.getColumn(b.halfAxes,2,u_t),E=h.magnitude(C);o=x.z-E,a=x.z+E}else if(u instanceof Hy){let C=b.radius;o=x.z-C,a=x.z+C}}}let f=e.dynamicScreenSpaceErrorHeightFalloff,d=o+(a-o)*f,p=a,g=I.clamp((r-d)/(p-d),0,1),m=1-Math.abs(h.dot(i,n));m=m*(1-g),e._dynamicScreenSpaceErrorComputedDensity=e.dynamicScreenSpaceErrorDensity*m}function d_t(e,t){if(t.hasEmptyContent)return;let{statistics:n}=e,i=t.contentExpired,r=t.requestContent();l(r)&&(r.then(o=>{!l(o)||t.isDestroyed()||e.isDestroyed()||(e._processingQueue.push(t),++n.numberOfTilesProcessing)}).catch(o=>{vCe(o,e,t)}),i&&(t.hasTilesetContent||t.hasImplicitContent?S_t(e,t):(n.decrementLoadCounts(t.content),--n.numberOfTilesWithContentReady)),e._requestedTilesInFlight.push(t))}function CCe(e,t){return e._priority-t._priority}Zr.prototype.postPassesUpdate=function(e){l(this._root)&&(h_t(this,e),I_t(this,e),this._cache.unloadTiles(this,SCe),this._styleApplied&&this._styleEngine.resetDirty(),this._styleApplied=!1)};Zr.prototype.prePassesUpdate=function(e){if(!l(this._root))return;b_t(this,e);let t=this._clippingPlanes;this._clippingPlanesOriginMatrixDirty=!0,l(t)&&t.enabled&&t.update(e);let n=this._clippingPolygons;l(n)&&n.enabled&&n.update(e),l(this._loadTimestamp)||(this._loadTimestamp=K.clone(e.time)),this._timeSinceLoad=Math.max(K.secondsDifference(e.time,this._loadTimestamp)*1e3,0),this.dynamicScreenSpaceError&&f_t(this,e),e.newFrame&&this._cache.reset()};function h_t(e,t){let n=e._requestedTilesInFlight,i=0;for(let r=0;r<n.length;++r){let o=n[r],a=t.frameNumber-o._touchedFrame>=1;if(o._contentState!==co.LOADING){++i;continue}else if(a){o.cancelRequests(),++i;continue}i>0&&(n[r-i]=o)}n.length-=i}function m_t(e){let t=e._requestedTiles;t.sort(CCe);for(let n=0;n<t.length;++n)d_t(e,t[n])}function vCe(e,t,n){if(t.isDestroyed())return;let i;n.isDestroyed()||(i=n._contentResource.url);let r=l(e.message)?e.message:e.toString();t.tileFailed.numberOfListeners>0?t.tileFailed.raiseEvent({url:i,message:r}):(console.log(`A 3D tile failed to load: ${i}`),console.log(`Error: ${r}`),console.log(e.stack))}function p_t(e){let t=e._processingQueue,n=0;for(let i=0;i<t.length;++i){let r=t[i];if(r.isDestroyed()||r._contentState!==co.PROCESSING){++n;continue}n>0&&(t[i-n]=r)}t.length-=n}var g_t=new de,__t=new de,y_t=new h;function A_t(e,t,n){if(!e.enableCollision||!e.show)return;let i=e._addHeightCallbacks,r=t.boundingSphere;for(let o of i){if(o.invoked||t._wasSelectedLastFrame)continue;let a=o.ellipsoid,s=de.clone(o.positionCartographic,g_t),c=de.fromCartesian(r.center,a,__t);l(c)&&(s.height=c.height);let u=de.toCartesian(s,a,y_t);h.distance(u,r.center)<=r.radius&&(o.invoked=!0,n.afterRender.push(()=>{l(o.callback)&&o.callback(),o.invoked=!1}))}}function b_t(e,t){p_t(e);let n=e._processingQueue,{cacheBytes:i,maximumCacheOverflowBytes:r,statistics:o}=e,a=i+r,s=!1;for(let c=0;c<n.length;++c){if(e.totalMemoryUsageInBytes>a){s=!0;break}let u=n[c];try{u.process(e,t),u.contentReady&&(--o.numberOfTilesProcessing,e.tileLoad.raiseEvent(u))}catch(f){--o.numberOfTilesProcessing,vCe(f,e,u)}}e.totalMemoryUsageInBytes<i?T_t(e):s&&n.length>0&&x_t(e)}function x_t(e){e._memoryAdjustedScreenSpaceError*=1.02;let t=e._processingQueue;for(let n=0;n<t.length;++n)t[n].updatePriority();t.sort(CCe)}function T_t(e){e._memoryAdjustedScreenSpaceError=Math.max(e.memoryAdjustedScreenSpaceError/1.02,e.maximumScreenSpaceError)}var s8=new h,C_t={maximumFractionDigits:3};function TCe(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,C_t):Math.round(t).toLocaleString()}function LQ(e){let{halfAxes:t,radius:n,center:i}=e.boundingVolume.boundingVolume,r=h.clone(i,s8);if(l(t))r.x+=.75*(t[0]+t[3]+t[6]),r.y+=.75*(t[1]+t[4]+t[7]),r.z+=.75*(t[2]+t[5]+t[8]);else if(l(n)){let o=h.normalize(i,s8);o=h.multiplyByScalar(o,.75*n,s8),r=h.add(o,i,s8)}return r}function NQ(e,t,n){let i="",r=0;if(t.debugShowGeometricError&&(i+=`
|
|
Geometric error: ${e.geometricError}`,r++),t.debugShowRenderingStatistics&&(i+=`
|
|
Commands: ${e.commandsLength}`,r++,e.content.pointsLength>0&&(i+=`
|
|
Points: ${e.content.pointsLength}`,r++),e.content.trianglesLength>0&&(i+=`
|
|
Triangles: ${e.content.trianglesLength}`,r++),i+=`
|
|
Features: ${e.content.featuresLength}`,r++),t.debugShowMemoryUsage&&(i+=`
|
|
Texture Memory: ${TCe(e.content.texturesByteLength)}`,i+=`
|
|
Geometry Memory: ${TCe(e.content.geometryByteLength)}`,r+=2),t.debugShowUrl)if(e.hasMultipleContents){i+=`
|
|
Urls:`;let a=e.content.innerContentUrls;for(let s=0;s<a.length;s++)i+=`
|
|
- ${a[s]}`;r+=a.length}else i+=`
|
|
Url: ${e._contentHeader.uri}`,r++;let o={text:i.substring(1),position:n,font:`${19-r}px sans-serif`,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY};return t._tileDebugLabels.add(o)}function v_t(e,t){let n=e._selectedTiles,i=n.length,r=e._emptyTiles,o=r.length;if(e._tileDebugLabels.removeAll(),e.debugPickedTileLabelOnly){if(l(e.debugPickedTile)){let a=l(e.debugPickPosition)?e.debugPickPosition:LQ(e.debugPickedTile),s=NQ(e.debugPickedTile,e,a);s.pixelOffset=new k(15,-15)}}else{for(let a=0;a<i;++a){let s=n[a];NQ(s,e,LQ(s))}for(let a=0;a<o;++a){let s=r[a];(s.hasTilesetContent||s.hasImplicitContent)&&NQ(s,e,LQ(s))}}e._tileDebugLabels.update(t)}function E_t(e,t,n){e._styleEngine.applyStyle(e),e._styleApplied=!0;let{commandList:i,context:r}=t,o=i.length,a=e._selectedTiles,s=e.isSkippingLevelOfDetail&&e._hasMixedContent&&r.stencilBuffer&&a.length>0;e._backfaceCommands.length=0,s&&(l(e._stencilClearCommand)||(e._stencilClearCommand=new ui({stencil:0,pass:Pe.CESIUM_3D_TILE,renderState:je.fromCache({stencilMask:qt.SKIP_LOD_MASK})})),i.push(e._stencilClearCommand));let{statistics:c,tileVisible:u}=e,f=n.isRender,d=i.length;for(let m=0;m<a.length;++m){let y=a[m];f&&u.raiseEvent(y),A_t(e,y,t),y.update(e,t,n),c.incrementSelectionCounts(y.content),++c.selected}let p=e._emptyTiles;for(let m=0;m<p.length;++m)p[m].update(e,t,n);let g=i.length-d;if(e._backfaceCommands.trim(),s){let m=e._backfaceCommands.values,y=m.length;i.length+=y;for(let A=g-1;A>=0;--A)i[d+y+A]=i[d+A];for(let A=0;A<y;++A)i[d+A]=m[A]}g=i.length-o,c.numberOfCommands=g,f&&(e.pointCloudShading.attenuation&&e.pointCloudShading.eyeDomeLighting&&g>0&&e._pointCloudEyeDomeLighting.update(t,o,e.pointCloudShading,e.boundingSphere),e.debugShowGeometricError||e.debugShowRenderingStatistics||e.debugShowMemoryUsage||e.debugShowUrl?(l(e._tileDebugLabels)||(e._tileDebugLabels=new Y0),v_t(e,t)):e._tileDebugLabels=e._tileDebugLabels&&e._tileDebugLabels.destroy())}var ECe=[];function S_t(e,t){let n=t,i=ECe;for(i.push(t);i.length>0;){t=i.pop();let r=t.children;for(let o=0;o<r.length;++o)i.push(r[o]);t!==n&&(w_t(e,t),--e._statistics.numberOfTilesTotal)}n.children=[]}function SCe(e,t){e.tileUnload.raiseEvent(t),e._statistics.decrementLoadCounts(t.content),--e._statistics.numberOfTilesWithContentReady,t.unloadContent()}function w_t(e,t){e._cache.unloadTile(e,t,SCe),t.destroy()}Zr.prototype.trimLoadedTiles=function(){this._cache.trim()};function I_t(e,t){let n=e._statistics,i=e._statisticsLast,r=n.numberOfPendingRequests,o=n.numberOfTilesProcessing,a=i.numberOfPendingRequests,s=i.numberOfTilesProcessing;Ip.clone(n,i);let c=r!==a||o!==s;c&&t.afterRender.push(function(){return e.loadProgress.raiseEvent(r,o),!0}),e._tilesLoaded=n.numberOfPendingRequests===0&&n.numberOfTilesProcessing===0&&n.numberOfAttemptedRequests===0,c&&e._tilesLoaded&&(t.afterRender.push(function(){return e.allTilesLoaded.raiseEvent(),!0}),e._initialTilesLoaded||(e._initialTilesLoaded=!0,t.afterRender.push(function(){return e.initialTilesLoaded.raiseEvent(),!0})))}function P_t(e){e._heatmap.resetMinimumMaximum(),e._minimumPriority.depth=Number.MAX_VALUE,e._maximumPriority.depth=-Number.MAX_VALUE,e._minimumPriority.foveatedFactor=Number.MAX_VALUE,e._maximumPriority.foveatedFactor=-Number.MAX_VALUE,e._minimumPriority.distance=Number.MAX_VALUE,e._maximumPriority.distance=-Number.MAX_VALUE,e._minimumPriority.reverseScreenSpaceError=Number.MAX_VALUE,e._maximumPriority.reverseScreenSpaceError=-Number.MAX_VALUE}function D_t(e,t){t.frameNumber===e._updatedModelMatrixFrame&&l(e._previousModelMatrix)||(e._updatedModelMatrixFrame=t.frameNumber,e._modelMatrixChanged=!O.equals(e.modelMatrix,e._previousModelMatrix),e._modelMatrixChanged&&(e._previousModelMatrix=O.clone(e.modelMatrix,e._previousModelMatrix)))}function R_t(e,t,n,i){if(t.mode===re.MORPHING||!l(e._root))return!1;let r=e._statistics;r.clear(),++e._updatedVisibilityFrame,P_t(e),D_t(e,t),e._cullRequestsWhileMoving=e.cullRequestsWhileMoving&&!e._modelMatrixChanged;let o=e.getTraversal(i).selectTiles(e,t);if(i.requestTiles&&m_t(e),E_t(e,t,i),Ip.clone(r,n),i.isRender){let a=e._credits;if(l(a)&&r.selected!==0)for(let s=0;s<a.length;++s){let c=a[s];t.creditDisplay.addCreditToNextFrame(c)}}return o}function wCe(e){let t=e._credits;l(t)||(t=[]),t.length=0,l(e.resource.credits)&&e.resource.credits.forEach(i=>{t.push(wt.clone(i))});let n=e.asset.extras;if(l(n)&&l(n.cesium)&&l(n.cesium.credits)){let i=n.cesium.credits;for(let r=0;r<i.length;++r){let o=i[r];t.push(new wt(o.html))}}t.forEach(i=>i.showOnScreen=i.showOnScreen||e._showCreditsOnScreen),e._credits=t}Zr.prototype.getTraversal=function(e){let{pass:t}=e;return t===lo.MOST_DETAILED_PRELOAD||t===lo.MOST_DETAILED_PICK?n8:this.isSkippingLevelOfDetail?o8:i8};Zr.prototype.update=function(e){this.updateForPass(e,e.tilesetPassState)};Zr.prototype.updateForPass=function(e,t){this.imageryLayers._update();let n=t.pass;if(n===lo.PRELOAD&&(!this.preloadWhenHidden||this.show)||n===lo.PRELOAD_FLIGHT&&(!this.preloadFlightDestinations||!this.show&&!this.preloadWhenHidden)||n===lo.REQUEST_RENDER_MODE_DEFER_CHECK&&(!this._cullRequestsWhileMoving&&this.foveatedTimeDelay<=0||!this.show))return;let i=e.commandList,r=e.camera,o=e.cullingVolume;t.ready=!1;let a=lo.getPassOptions(n),s=a.ignoreCommands,c=t.commandList??i,u=c.length;if(e.commandList=c,e.camera=t.camera??r,e.cullingVolume=t.cullingVolume??o,a.isRender){let p=this._environmentMapManager;l(this._root)&&(p.position=this.boundingSphere.center),p.update(e)}let f=this._clippingPolygons;l(f)&&f.enabled&&f.queueCommands(e);let d=this._statisticsPerPass[n];(this.show||s)&&(this._pass=n,t.ready=R_t(this,e,d,a)),s&&(c.length=u),e.commandList=i,e.camera=r,e.cullingVolume=o};Zr.prototype.hasExtension=function(e){return l(this._extensionsUsed)?this._extensionsUsed.indexOf(e)>-1:!1};Zr.prototype.isDestroyed=function(){return!1};Zr.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(),l(this._root)){let e=ECe;for(e.push(this._root);e.length>0;){let t=e.pop();t.destroy();let n=t.children;for(let i=0;i<n.length;++i)e.push(n[i])}}return this._root=void 0,this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0,this._environmentMapManager.isDestroyed()||this._environmentMapManager.destroy(),this._environmentMapManager=void 0,this._imageryLayers.isDestroyed()||(this.imageryLayers.layerAdded.removeEventListener(this._imageryLayersListener),this.imageryLayers.layerRemoved.removeEventListener(this._imageryLayersListener),this.imageryLayers.layerMoved.removeEventListener(this._imageryLayersListener),this.imageryLayers.layerShownOrHidden.removeEventListener(this._imageryLayersListener),this._imageryLayers.destroy()),this._imageryLayers=void 0,ue(this)};Zr.supportedExtensions={"3DTILES_metadata":!0,"3DTILES_implicit_tiling":!0,"3DTILES_content_gltf":!0,"3DTILES_content_gltf_vector":!0,"3DTILES_multiple_contents":!0,"3DTILES_bounding_volume_S2":!0,"3DTILES_batch_table_hierarchy":!0,"3DTILES_draco_point_compression":!0,MAXAR_content_geojson:!0};Zr.checkSupportedExtensions=function(e){for(let t=0;t<e.length;t++)if(!Zr.supportedExtensions[e[t]])throw new oe(`Unsupported 3D Tiles Extension: ${e[t]}`)};var O_t=new hn,M_t=new h,L_t=new de;Zr.prototype.getHeight=function(e,t){let n=t.ellipsoid;l(n)||(n=te.WGS84);let i=O_t,r=n.cartographicToCartesian(e,i.direction);h.normalize(i.direction,i.direction),i.direction=h.normalize(r,i.direction),i.direction=h.negate(r,i.direction),i.origin=h.multiplyByScalar(i.direction,-2*n.maximumRadius,i.origin);let o=this.pick(i,t.frameState,M_t);if(l(o))return n.cartesianToCartographic(o,L_t)?.height};Zr.prototype.updateHeight=function(e,t,n){n=n??te.WGS84;let i={positionCartographic:e,ellipsoid:n,callback:t,invoked:!1},r=()=>{let o=this._addHeightCallbacks,a=o.length;for(let s=0;s<a;++s)if(o[s]===i){o.splice(s,1);break}i.callback&&(i.callback=void 0)};return this._addHeightCallbacks.push(i),r};var N_t=new $o,F_t=new h;Zr.prototype.pick=function(e,t,n){if(!t.context.webgl2&&!this._enablePick)return;let i=this._selectedTiles,r=i.length,o=[];for(let c=0;c<r;++c){let u=i[c],f=ci.raySphere(e,u.contentBoundingVolume.boundingSphere,N_t);!l(f)||!l(u.content)||o.push(u)}let a=o.length;o.sort((c,u)=>{let f=se.distanceSquaredTo(c.contentBoundingVolume.boundingSphere,e.origin),d=se.distanceSquaredTo(u.contentBoundingVolume.boundingSphere,e.origin);return f-d});let s;for(let c=0;c<a;++c){let f=o[c].content.pick(e,t,F_t);if(l(f))return s=h.clone(f,n),s}};Zr.prototype.isGltfExtensionUsed=function(e){if(this.hasExtension("3DTILES_content_gltf")){if(!l(this.extensions))return!1;let t=this.extensions["3DTILES_content_gltf"]?.extensionsUsed;return l(t)?t.indexOf(e)>-1:!1}return!1};Zr.prototype.isGltfExtensionRequired=function(e){if(this.isGltfExtensionUsed(e)){let t=this.extensions["3DTILES_content_gltf"].extensionsRequired;return l(t)?t.indexOf(e)>-1:!1}return!1};var Yo=Zr;var B_t=new O;function Wy(e,t){t.collectionChanged.addEventListener(Wy.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._tilesetHash={},this._entitiesToVisualize=new zt,this._onCollectionChanged(t,t.values,[],[])}Wy.prototype.update=function(e){let t=this._entitiesToVisualize.values,n=this._tilesetHash,i=this._primitives;for(let r=0,o=t.length;r<o;r++){let a=t[r],s=a._tileset,c,u=n[a.id],f=a.isShowing&&a.isAvailable(e)&&X.getValueOrDefault(s._show,e,!0),d;f&&(d=a.computeModelMatrix(e,B_t),c=De.createIfNeeded(X.getValueOrUndefined(s._uri,e)));let p=l(u)?u.tilesetPrimitive:void 0;if(!f){l(p)&&(p.show=!1);continue}(!l(u)||c.url!==u.url)&&(l(p)&&i.removeAndDestroy(p),delete n[a.id],k_t(c,n,a,i)),l(p)&&(p.show=!0,l(d)&&(p.modelMatrix=d),p.maximumScreenSpaceError=X.getValueOrDefault(s.maximumScreenSpaceError,e,p.maximumScreenSpaceError))}return!0};Wy.prototype.isDestroyed=function(){return!1};Wy.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Wy.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._tilesetHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)FQ(this,e[i],t,n);return ue(this)};Wy.prototype.getBoundingSphere=function(e,t){let n=this._tilesetHash[e.id];if(!l(n)||n.loadFail)return It.FAILED;let i=n.tilesetPrimitive;return l(i)?i.show?(se.clone(i.boundingSphere,t),It.DONE):It.FAILED:It.PENDING};Wy.prototype._onCollectionChanged=function(e,t,n,i){let r,o,a=this._entitiesToVisualize,s=this._tilesetHash,c=this._primitives;for(r=t.length-1;r>-1;r--)o=t[r],l(o._tileset)&&a.set(o.id,o);for(r=i.length-1;r>-1;r--)o=i[r],l(o._tileset)?a.set(o.id,o):(FQ(this,o,s,c),a.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],FQ(this,o,s,c),a.remove(o.id)};function FQ(e,t,n,i){let r=n[t.id];l(r)&&(l(r.tilesetPrimitive)&&i.removeAndDestroy(r.tilesetPrimitive),delete n[t.id])}async function k_t(e,t,n,i){t[n.id]={url:e.url,loadFail:!1};try{let r=await Yo.fromUrl(e);if(r.id=n,i.add(r),!l(t[n.id]))return;t[n.id].tilesetPrimitive=r}catch(r){console.error(r),t[n.id].loadFail=!0}}var c8=Wy;function vx(e,t,n){this._callback=void 0,this._isConstant=void 0,this._referenceFrame=n??Vi.FIXED,this._definitionChanged=new be,this.setCallback(e,t)}Object.defineProperties(vx.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var z_t=new K;vx.prototype.getValue=function(e,t){return l(e)||(e=K.now(z_t)),this.getValueInReferenceFrame(e,Vi.FIXED,t)};vx.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};vx.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._callback(e,n);return rp.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};vx.prototype.equals=function(e){return this===e||e instanceof vx&&this._callback===e._callback&&this._isConstant===e._isConstant&&this._referenceFrame===e._referenceFrame};var l8=vx;function U_t(e,t,n,i){function r(){n.raiseEvent(e)}let o=[];t.removeAll();let a=i.length;for(let s=0;s<a;s++){let c=i.get(s);l(c.data)&&o.indexOf(c.data)===-1&&t.add(c.data.definitionChanged,r)}}function Ex(){this._eventHelper=new Fo,this._definitionChanged=new be,this._intervals=new xa,this._intervals.changedEvent.addEventListener(Ex.prototype._intervalsChanged,this)}Object.defineProperties(Ex.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var V_t=new K;Ex.prototype.getValue=function(e,t){l(e)||(e=K.now(V_t));let n=this._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};Ex.prototype.equals=function(e){return this===e||e instanceof Ex&&this._intervals.equals(e._intervals,X.equals)};Ex.prototype._intervalsChanged=function(){U_t(this,this._eventHelper,this._definitionChanged,this._intervals),this._definitionChanged.raiseEvent(this)};var Bl=Ex;function qy(e){this._referenceFrame=e??Vi.FIXED,this._definitionChanged=new be,this._composite=new Bl,this._composite.definitionChanged.addEventListener(qy.prototype._raiseDefinitionChanged,this)}Object.defineProperties(qy.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite.intervals}},referenceFrame:{get:function(){return this._referenceFrame},set:function(e){this._referenceFrame=e}}});var j_t=new K;qy.prototype.getValue=function(e,t){return l(e)||(e=K.now(j_t)),this.getValueInReferenceFrame(e,Vi.FIXED,t)};qy.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(i))return i.getValueInReferenceFrame(e,t,n)};qy.prototype.equals=function(e){return this===e||e instanceof qy&&this._referenceFrame===e._referenceFrame&&this._composite.equals(e._composite,X.equals)};qy.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var Cc=qy;var ICe={WHOLE:0,PORTIONS:1};Object.freeze(ICe);var Ag=ICe;function Sx(e){let t=e._targetProperty;if(!l(t)){let n=e._targetEntity;if(!l(n)){if(n=e._targetCollection.getById(e._targetId),!l(n)){e._targetEntity=e._targetProperty=void 0;return}n.definitionChanged.addEventListener(pf.prototype._onTargetEntityDefinitionChanged,e),e._targetEntity=n}let i=e._targetPropertyNames;t=e._targetEntity;for(let r=0,o=i.length;r<o&&l(t);++r)t=t[i[r]];e._targetProperty=t}return t}function pf(e,t,n){this._targetCollection=e,this._targetId=t,this._targetPropertyNames=n,this._targetProperty=void 0,this._targetEntity=void 0,this._definitionChanged=new be,e.collectionChanged.addEventListener(pf.prototype._onCollectionChanged,this)}Object.defineProperties(pf.prototype,{isConstant:{get:function(){return X.isConstant(Sx(this))}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){let e=Sx(this);return l(e)?e.referenceFrame:void 0}},targetId:{get:function(){return this._targetId}},targetCollection:{get:function(){return this._targetCollection}},targetPropertyNames:{get:function(){return this._targetPropertyNames}},resolvedProperty:{get:function(){return Sx(this)}}});pf.fromString=function(e,t){let n,i=[],r=!0,o=!1,a="";for(let s=0;s<t.length;++s){let c=t.charAt(s);o?(a+=c,o=!1):c==="\\"?o=!0:r&&c==="#"?(n=a,r=!1,a=""):!r&&c==="."?(i.push(a),a=""):a+=c}return i.push(a),new pf(e,n,i)};var H_t=new K;pf.prototype.getValue=function(e,t){let n=Sx(this);return l(e)||(e=K.now(H_t)),l(n)?n.getValue(e,t):void 0};pf.prototype.getValueInReferenceFrame=function(e,t,n){let i=Sx(this);return l(i)?i.getValueInReferenceFrame(e,t,n):void 0};pf.prototype.getType=function(e){let t=Sx(this);return l(t)?t.getType(e):void 0};pf.prototype.equals=function(e){if(this===e)return!0;let t=this._targetPropertyNames,n=e._targetPropertyNames;if(this._targetCollection!==e._targetCollection||this._targetId!==e._targetId||t.length!==n.length)return!1;let i=this._targetPropertyNames.length;for(let r=0;r<i;r++)if(t[r]!==n[r])return!1;return!0};pf.prototype._onTargetEntityDefinitionChanged=function(e,t,n,i){l(this._targetProperty)&&this._targetPropertyNames[0]===t&&(this._targetProperty=void 0,this._definitionChanged.raiseEvent(this))};pf.prototype._onCollectionChanged=function(e,t,n){let i=this._targetEntity;l(i)&&n.indexOf(i)!==-1?(i.definitionChanged.removeEventListener(pf.prototype._onTargetEntityDefinitionChanged,this),this._targetEntity=this._targetProperty=void 0):l(i)||(i=Sx(this),l(i)&&this._definitionChanged.raiseEvent(this))};var Yy=pf;var PCe={packedLength:1,pack:function(e,t,n){n=n??0,t[n]=e},unpack:function(e,t,n){return t=t??0,e[t]}};function DCe(e,t,n){let i,r=e.length,o=n.length,a=r+o;if(e.length=a,r!==t){let s=r-1;for(i=a-1;i>=t;i--)e[i]=e[s--]}for(i=0;i<o;i++)e[t++]=n[i]}function RCe(e,t){return e instanceof K?e:typeof e=="string"?K.fromIso8601(e):K.addSeconds(t,e,new K)}var BQ=[],kQ=[];function u8(e,t,n,i,r){let o=0,a,s,c,u,f,d;for(;o<i.length;){f=RCe(i[o],e),c=Cr(t,f,K.compare);let p=0,g=0;if(c<0){for(c=~c,u=c*r,s=void 0,d=t[c];o<i.length&&(f=RCe(i[o],e),!(l(s)&&K.compare(s,f)>=0||l(d)&&K.compare(f,d)>=0));){for(BQ[p++]=f,o=o+1,a=0;a<r;a++)kQ[g++]=i[o],o=o+1;s=f}p>0&&(kQ.length=g,DCe(n,u,kQ),BQ.length=p,DCe(t,c,BQ))}else{for(a=0;a<r;a++)o++,n[c*r+a]=i[o];o++}}}function Od(e,t){let n=e;n===Number&&(n=PCe);let i=n.packedLength,r=n.packedInterpolationLength??i,o=0,a;if(l(t)){let s=t.length;a=new Array(s);for(let c=0;c<s;c++){let u=t[c];u===Number&&(u=PCe);let f=u.packedLength;i+=f,r+=u.packedInterpolationLength??f,a[c]=u}o=s}this._type=e,this._innerType=n,this._interpolationDegree=1,this._interpolationAlgorithm=qC,this._numberOfPoints=0,this._times=[],this._values=[],this._xTable=[],this._yTable=[],this._packedLength=i,this._packedInterpolationLength=r,this._updateTableLength=!0,this._interpolationResult=new Array(r),this._definitionChanged=new be,this._derivativeTypes=t,this._innerDerivativeTypes=a,this._inputOrder=o,this._forwardExtrapolationType=Qf.NONE,this._forwardExtrapolationDuration=0,this._backwardExtrapolationType=Qf.NONE,this._backwardExtrapolationDuration=0}Object.defineProperties(Od.prototype,{isConstant:{get:function(){return this._values.length===0}},definitionChanged:{get:function(){return this._definitionChanged}},type:{get:function(){return this._type}},derivativeTypes:{get:function(){return this._derivativeTypes}},interpolationDegree:{get:function(){return this._interpolationDegree}},interpolationAlgorithm:{get:function(){return this._interpolationAlgorithm}},forwardExtrapolationType:{get:function(){return this._forwardExtrapolationType},set:function(e){this._forwardExtrapolationType!==e&&(this._forwardExtrapolationType=e,this._definitionChanged.raiseEvent(this))}},forwardExtrapolationDuration:{get:function(){return this._forwardExtrapolationDuration},set:function(e){this._forwardExtrapolationDuration!==e&&(this._forwardExtrapolationDuration=e,this._definitionChanged.raiseEvent(this))}},backwardExtrapolationType:{get:function(){return this._backwardExtrapolationType},set:function(e){this._backwardExtrapolationType!==e&&(this._backwardExtrapolationType=e,this._definitionChanged.raiseEvent(this))}},backwardExtrapolationDuration:{get:function(){return this._backwardExtrapolationDuration},set:function(e){this._backwardExtrapolationDuration!==e&&(this._backwardExtrapolationDuration=e,this._definitionChanged.raiseEvent(this))}}});var G_t=new K;Od.prototype.getValue=function(e,t){l(e)||(e=K.now(G_t));let n=this._times,i=n.length;if(i===0)return;let r,o=this._innerType,a=this._values,s=Cr(n,e,K.compare);if(s<0){if(s=~s,s===0){let C=n[s];if(r=this._backwardExtrapolationDuration,this._backwardExtrapolationType===Qf.NONE||r!==0&&K.secondsDifference(C,e)>r)return;if(this._backwardExtrapolationType===Qf.HOLD)return o.unpack(a,0,t)}if(s>=i){s=i-1;let C=n[s];if(r=this._forwardExtrapolationDuration,this._forwardExtrapolationType===Qf.NONE||r!==0&&K.secondsDifference(e,C)>r)return;if(this._forwardExtrapolationType===Qf.HOLD)return s=i-1,o.unpack(a,s*o.packedLength,t)}let c=this._xTable,u=this._yTable,f=this._interpolationAlgorithm,d=this._packedInterpolationLength,p=this._inputOrder;if(this._updateTableLength){this._updateTableLength=!1;let C=Math.min(f.getRequiredDataPoints(this._interpolationDegree,p),i);C!==this._numberOfPoints&&(this._numberOfPoints=C,c.length=C,u.length=C*d)}let g=this._numberOfPoints-1;if(g<1)return;let m=0,y=i-1;if(y-m+1>=g+1){let C=s-(g/2|0)-1;C<m&&(C=m);let E=C+g;E>y&&(E=y,C=E-g,C<m&&(C=m)),m=C,y=E}let b=y-m+1;for(let C=0;C<b;++C)c[C]=K.secondsDifference(n[m+C],n[y]);if(l(o.convertPackedArrayForInterpolation))o.convertPackedArrayForInterpolation(a,m,y,u);else{let C=0,E=this._packedLength,w=m*E,D=(y+1)*E;for(;w<D;)u[C]=a[w],w++,C++}let x=K.secondsDifference(e,n[y]),T;if(p===0||!l(f.interpolate))T=f.interpolateOrderZero(x,c,u,d,this._interpolationResult);else{let C=Math.floor(d/(p+1));T=f.interpolate(x,c,u,C,p,p,this._interpolationResult)}return l(o.unpackInterpolationResult)?o.unpackInterpolationResult(T,a,m,y,t):o.unpack(T,0,t)}return o.unpack(a,s*this._packedLength,t)};Od.prototype.setInterpolationOptions=function(e){if(!l(e))return;let t=!1,n=e.interpolationAlgorithm,i=e.interpolationDegree;l(n)&&this._interpolationAlgorithm!==n&&(this._interpolationAlgorithm=n,t=!0),l(i)&&this._interpolationDegree!==i&&(this._interpolationDegree=i,t=!0),t&&(this._updateTableLength=!0,this._definitionChanged.raiseEvent(this))};Od.prototype.addSample=function(e,t,n){let i=this._innerDerivativeTypes,r=l(i),o=this._innerType,a=[];if(a.push(e),o.pack(t,a,a.length),r){let s=i.length;for(let c=0;c<s;c++)i[c].pack(n[c],a,a.length)}u8(void 0,this._times,this._values,a,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};Od.prototype.addSamples=function(e,t,n){let i=this._innerDerivativeTypes,r=l(i),o=this._innerType,a=e.length,s=[];for(let c=0;c<a;c++)if(s.push(e[c]),o.pack(t[c],s,s.length),r){let u=n[c],f=i.length;for(let d=0;d<f;d++)i[d].pack(u[d],s,s.length)}u8(void 0,this._times,this._values,s,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};Od.prototype.getSample=function(e){let t=this._times,n=t.length;if(l(n))return e<0&&(e+=n),t[e]};Od.prototype.addSamplesPackedArray=function(e,t){u8(t,this._times,this._values,e,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};Od.prototype.removeSample=function(e){let t=Cr(this._times,e,K.compare);return t<0?!1:(OCe(this,t,1),!0)};function OCe(e,t,n){let i=e._packedLength;e._times.splice(t,n),e._values.splice(t*i,n*i),e._updateTableLength=!0,e._definitionChanged.raiseEvent(e)}Od.prototype.removeSamples=function(e){let t=this._times,n=Cr(t,e.start,K.compare);n<0?n=~n:e.isStartIncluded||++n;let i=Cr(t,e.stop,K.compare);i<0?i=~i:e.isStopIncluded&&++i,OCe(this,n,i-n)};Od.prototype.equals=function(e){if(this===e)return!0;if(!l(e)||this._type!==e._type||this._interpolationDegree!==e._interpolationDegree||this._interpolationAlgorithm!==e._interpolationAlgorithm)return!1;let t=this._derivativeTypes,n=l(t),i=e._derivativeTypes,r=l(i);if(n!==r)return!1;let o,a;if(n){if(a=t.length,a!==i.length)return!1;for(o=0;o<a;o++)if(t[o]!==i[o])return!1}let s=this._times,c=e._times;if(a=s.length,a!==c.length)return!1;for(o=0;o<a;o++)if(!K.equals(s[o],c[o]))return!1;let u=this._values,f=e._values;for(a=u.length,o=0;o<a;o++)if(u[o]!==f[o])return!1;return!0};Od._mergeNewSamples=u8;var Md=Od;function Ld(e,t){t=t??0;let n;if(t>0){n=new Array(t);for(let i=0;i<t;i++)n[i]=h}this._numberOfDerivatives=t,this._property=new Md(h,n),this._definitionChanged=new be,this._referenceFrame=e??Vi.FIXED,this._property._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)}Object.defineProperties(Ld.prototype,{isConstant:{get:function(){return this._property.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}},interpolationDegree:{get:function(){return this._property.interpolationDegree}},interpolationAlgorithm:{get:function(){return this._property.interpolationAlgorithm}},numberOfDerivatives:{get:function(){return this._numberOfDerivatives}},forwardExtrapolationType:{get:function(){return this._property.forwardExtrapolationType},set:function(e){this._property.forwardExtrapolationType=e}},forwardExtrapolationDuration:{get:function(){return this._property.forwardExtrapolationDuration},set:function(e){this._property.forwardExtrapolationDuration=e}},backwardExtrapolationType:{get:function(){return this._property.backwardExtrapolationType},set:function(e){this._property.backwardExtrapolationType=e}},backwardExtrapolationDuration:{get:function(){return this._property.backwardExtrapolationDuration},set:function(e){this._property.backwardExtrapolationDuration=e}}});var W_t=new K;Ld.prototype.getValue=function(e,t){return l(e)||(e=K.now(W_t)),this.getValueInReferenceFrame(e,Vi.FIXED,t)};Ld.prototype.getValueInReferenceFrame=function(e,t,n){if(n=this._property.getValue(e,n),l(n))return rp.convertToReferenceFrame(e,n,this._referenceFrame,t,n)};Ld.prototype.setInterpolationOptions=function(e){this._property.setInterpolationOptions(e)};Ld.prototype.addSample=function(e,t,n){let i=this._numberOfDerivatives;this._property.addSample(e,t,n)};Ld.prototype.addSamples=function(e,t,n){this._property.addSamples(e,t,n)};Ld.prototype.addSamplesPackedArray=function(e,t){this._property.addSamplesPackedArray(e,t)};Ld.prototype.removeSample=function(e){return this._property.removeSample(e)};Ld.prototype.removeSamples=function(e){this._property.removeSamples(e)};Ld.prototype.equals=function(e){return this===e||e instanceof Ld&&X.equals(this._property,e._property)&&this._referenceFrame===e._referenceFrame};var vc=Ld;function Xy(e){this._definitionChanged=new be,this._value=void 0,this._removeSubscription=void 0,this.setValue(e)}Object.defineProperties(Xy.prototype,{isConstant:{get:function(){return X.isConstant(this._value)}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return l(this._value)?this._value.referenceFrame:Vi.FIXED}}});var q_t=new K;Xy.prototype.getValue=function(e,t){return l(e)||(e=K.now(q_t)),this.getValueInReferenceFrame(e,Vi.FIXED,t)};Xy.prototype.setValue=function(e){this._value!==e&&(this._value=e,l(this._removeSubscription)&&(this._removeSubscription(),this._removeSubscription=void 0),l(e)&&(this._removeSubscription=e.definitionChanged.addEventListener(this._raiseDefinitionChanged,this)),this._definitionChanged.raiseEvent(this))};Xy.prototype.getValueInReferenceFrame=function(e,t,n){if(l(this._value))return n=this._value.getValueInReferenceFrame(e,t,n),l(n)?te.default.scaleToGeodeticSurface(n,n):void 0};Xy.prototype.equals=function(e){return this===e||e instanceof Xy&&this._value===e._value};Xy.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var bg=Xy;function Ky(e){this._definitionChanged=new be,this._intervals=new xa,this._intervals.changedEvent.addEventListener(Ky.prototype._intervalsChanged,this),this._referenceFrame=e??Vi.FIXED}Object.defineProperties(Ky.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 Y_t=new K;Ky.prototype.getValue=function(e,t){return l(e)||(e=K.now(Y_t)),this.getValueInReferenceFrame(e,Vi.FIXED,t)};Ky.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._intervals.findDataForIntervalContainingDate(e);if(l(i))return rp.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};Ky.prototype.equals=function(e){return this===e||e instanceof Ky&&this._intervals.equals(e._intervals,X.equals)&&this._referenceFrame===e._referenceFrame};Ky.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var $y=Ky;var MCe=new $,LCe=new $,NCe=new $,X_t=new h,FCe=new h,K_t=new h,$_t=new h,f8=new Fe,d8=new O,h8=new $;function C1(e,t,n,i,r){if(!(!l(t)||!l(n))){if(h.subtract(t,n,r),l(i.orientation))i.orientation.getValue(e,f8)&&(Fe.conjugate(f8,f8),$.fromQuaternion(f8,h8),$.multiplyByVector(h8,r,r));else if(l(VQ(e,i.position,d8)))O.inverse(d8,d8),O.getRotation(d8,h8),$.multiplyByVector(h8,r,r);else return;return r}}function VQ(e,t,n){let i=t.getValue(e,X_t);if(l(i)){let r=K.addSeconds(e,.01,new K),o=t.getValue(r,FCe);if(l(o)&&!h.equalsEpsilon(i,o,I.EPSILON16)){let a=mt.computeFixedToIcrfMatrix(e,MCe),s=mt.computeFixedToIcrfMatrix(r,LCe),c;!l(a)||!l(s)?(c=mt.computeTemeToPseudoFixedMatrix(e,NCe),a=$.transpose(c,MCe),s=mt.computeTemeToPseudoFixedMatrix(r,LCe),$.transpose(s,s)):c=$.transpose(a,NCe);let u=K_t;h.normalize(i,u),h.normalize(o,o),$.multiplyByVector(a,u,u),$.multiplyByVector(s,o,o);let f=h.cross(u,o,$_t);if(!h.equalsEpsilon(f,h.ZERO,I.EPSILON16)){let d=h.cross(f,u,FCe);return $.multiplyByVector(c,d,d),$.multiplyByVector(c,f,f),$.multiplyByVector(c,u,u),h.normalize(d,d),h.normalize(f,f),h.normalize(u,u),l(n)||(n=new O),n[0]=d.x,n[1]=d.y,n[2]=d.z,n[3]=0,n[4]=f.x,n[5]=f.y,n[6]=f.z,n[7]=0,n[8]=u.x,n[9]=u.y,n[10]=u.z,n[11]=0,n[12]=i.x,n[13]=i.y,n[14]=i.z,n[15]=1,n}}}}var BCe=60,HCe=1,GCe=new Cn,zQ=new Cn,UQ=new Cn;function kCe(e){this.entity=e,this.polyline=void 0,this.segmentPolylines=[],this.index=void 0,this.updater=void 0}var m8=new h;function J_t(e,t,n,i,r,o,a,s,c){let u,f,d=!1;o instanceof $r&&(u=o,f=u.position,o=Vi.FIXED,d=!0);let p=s,g,m;g=e.getValueInReferenceFrame(t,o,c[p]),d?(m=f.getValueInReferenceFrame(t,o,m8),g=C1(t,g,m,u,g),l(g)&&(c[p++]=g)):l(g)&&(c[p++]=g);let y=!l(r)||K.lessThanOrEquals(r,t)||K.greaterThanOrEquals(r,n),A=0,b=i.length,x=i[A],T=n,C=!1,E,w,D;for(;A<b;){if(!y&&K.greaterThanOrEquals(x,r)&&(g=e.getValueInReferenceFrame(r,o,c[p]),d?(m=f.getValueInReferenceFrame(r,o,m8),l(g)&&l(m)&&(g=C1(r,g,m,u,g),l(g)&&(c[p++]=g))):l(g)&&(c[p++]=g),y=!0),K.greaterThan(x,t)&&K.lessThan(x,T)&&!x.equals(r)&&(g=e.getValueInReferenceFrame(x,o,c[p]),d?(m=f.getValueInReferenceFrame(x,o,m8),l(g)&&l(m)&&(g=C1(x,g,m,u,g),l(g)&&(c[p++]=g))):l(g)&&(c[p++]=g)),A<b-1){if(a>0&&!C){let R=i[A+1],M=K.secondsDifference(R,x);C=M>a,C&&(E=Math.ceil(M/a),w=0,D=M/Math.max(E,2),E=Math.max(E-1,1))}if(C&&w<E){x=K.addSeconds(x,D,new K),w++;continue}}C=!1,A++,x=i[A]}return g=e.getValueInReferenceFrame(n,o,c[p]),d?(m=f.getValueInReferenceFrame(n,o,m8),l(g)&&l(m)&&(g=C1(n,g,m,u,g),l(g)&&(c[p++]=g))):l(g)&&(c[p++]=g),p}function Z_t(e,t,n,i,r,o,a,s){let c,u=0,f=a,d=t,p=!l(i)||K.lessThanOrEquals(i,t)||K.greaterThanOrEquals(i,n);for(;K.lessThan(d,n);)!p&&K.greaterThanOrEquals(d,i)&&(p=!0,c=e.getValueInReferenceFrame(i,r,s[f]),l(c)&&(s[f]=c,f++)),c=e.getValueInReferenceFrame(d,r,s[f]),l(c)&&(s[f]=c,f++),u++,d=K.addSeconds(t,o*u,new K);return c=e.getValueInReferenceFrame(n,r,s[f]),l(c)&&(s[f]=c,f++),f}function Q_t(e,t,n,i,r,o,a,s){let c,u=0,f=a,d=t,p=Math.max(o,60),g=!l(i)||K.lessThanOrEquals(i,t)||K.greaterThanOrEquals(i,n);for(;K.lessThan(d,n);)!g&&K.greaterThanOrEquals(d,i)&&(g=!0,c=e.getValueInReferenceFrame(i,r,s[f]),l(c)&&(s[f]=c,f++)),c=e.getValueInReferenceFrame(d,r,s[f]),l(c)&&(s[f]=c,f++),u++,d=K.addSeconds(t,p*u,new K);return c=e.getValueInReferenceFrame(n,r,s[f]),l(c)&&(s[f]=c,f++),f}function eyt(e,t,n,i,r,o,a,s){UQ.start=t,UQ.stop=n;let c=a,u=e.intervals;for(let f=0;f<u.length;f++){let d=u.get(f);if(!Cn.intersect(d,UQ,GCe).isEmpty){let p=d.start;d.isStartIncluded||(d.isStopIncluded?p=d.stop:p=K.addSeconds(d.start,K.secondsDifference(d.stop,d.start)/2,new K));let g=e.getValueInReferenceFrame(p,r,s[c]);l(g)&&(s[c]=g,c++)}}return c}function tyt(e,t,n,i,r,o,a,s){let c=e.getValueInReferenceFrame(t,r,s[a]);return l(c)&&(s[a++]=c),a}function nyt(e,t,n,i,r,o,a,s){zQ.start=t,zQ.stop=n;let c=a,u=e.intervals;for(let f=0;f<u.length;f++){let d=u.get(f);if(!Cn.intersect(d,zQ,GCe).isEmpty){let p=d.start,g=d.stop,m=t;K.greaterThan(p,m)&&(m=p);let y=n;K.lessThan(g,y)&&(y=g),c=WCe(d.data,m,y,i,r,o,c,s)}}return c}function WCe(e,t,n,i,r,o,a,s){for(;e instanceof Yy;)e=e.resolvedProperty;if(e instanceof vc){let c=e._property._times;a=J_t(e,t,n,c,i,r,o,a,s)}else e instanceof l8?a=Z_t(e,t,n,i,r,o,a,s):e instanceof Cc?a=nyt(e,t,n,i,r,o,a,s):e instanceof $y?a=eyt(e,t,n,i,r,o,a,s):e instanceof _u||e instanceof bg&&X.isConstant(e)?a=tyt(e,t,n,i,r,o,a,s):a=Q_t(e,t,n,i,r,o,a,s);return a}function jQ(e,t,n,i,r,o,a){l(a)||(a=[]);let s=WCe(e,t,n,i,r,o,0,a);return a.length=s,a}var zCe=new $,UCe=new Fe,VCe=new $,T1=new Cn,p8=new Cn,wx=new Cn;function iyt(e){let t=[];if(!l(e))return t;for(let n in e){if(n[0]!=="_"||n==="_definitionChanged"||n.endsWith("Subscription"))continue;let i=e[n];l(i)&&typeof i.getValue=="function"&&!X.isConstant(i)&&t.push(i)}return t}function jCe(e,t,n,i,r,o,a,s,c,u,f){e.sort(K.compare),e=Pr(e,K.equalsEpsilon);let d=f;for(let p=0;p<e.length-1;p++){let g=e[p],m=e[p+1];if(!K.lessThan(g,m))continue;let y=K.addSeconds(g,K.secondsDifference(m,g)/2,new K),A=jQ(t,g,m,n,c,s,[]);if(A.length<2)continue;let b=o.segmentPolylines[d];l(b)||(b=a.add(),b.id=r,o.segmentPolylines[d]=b),b.show=!0,b.positions=A,b.material=xo.getValue(y,u,b.material),b.width=X.getValueOrDefault(i._width,n,HCe),d++}return d}function v1(e,t){this._unusedIndexes=[],this._polylineCollection=new Ep,this._scene=e,this._referenceFrame=t,e.primitives.add(this._polylineCollection)}v1.prototype.update=function(e){let t=this._referenceFrame;if(t===Vi.INERTIAL){let n=mt.computeIcrfToFixedMatrix(e,zCe);l(n)||(n=mt.computeTemeToPseudoFixedMatrix(e,zCe)),O.fromRotationTranslation(n,h.ZERO,this._polylineCollection.modelMatrix)}else if(t instanceof $r){let n=t.position.getValue(e);l(t.orientation)?l(t.orientation.getValue(e,UCe))&&($.fromQuaternion(UCe,VCe),O.fromRotationTranslation(VCe,n,this._polylineCollection.modelMatrix)):VQ(e,t.position,this._polylineCollection.modelMatrix)}};v1.prototype.updateObject=function(e,t){let n=t.entity,i=n._path,r=n._position,o,a,s=i._show,c=t.polyline,u=n.isShowing&&n.isAvailable(e)&&(!l(s)||s.getValue(e));if(u){let m=X.getValueOrUndefined(i._leadTime,e),y=X.getValueOrUndefined(i._trailTime,e),A=n._availability,b=l(A),x=l(m),T=l(y);if(u=b||x&&T,u){if(T&&(o=K.addSeconds(e,-y,new K)),x&&(a=K.addSeconds(e,m,new K)),b){let C=A.start,E=A.stop;(!T||K.greaterThan(C,o))&&(o=C),(!x||K.lessThan(E,a))&&(a=E)}u=K.lessThan(o,a)}}if(!u){l(c)&&(this._unusedIndexes.push(t.index),t.polyline=void 0,c.show=!1,t.index=void 0);for(let m=0;m<t.segmentPolylines.length;m++)t.segmentPolylines[m].show=!1;return}if(!l(c)){let m=this._unusedIndexes;if(m.length>0){let A=m.pop();c=this._polylineCollection.get(A),t.index=A}else t.index=this._polylineCollection.length,c=this._polylineCollection.add();c.id=n,t.polyline=c}let f=X.getValueOrDefault(i._resolution,e,BCe),d=jQ(r,o,a,e,this._referenceFrame,f,c.positions.slice());if(d.length<2){c.show=!1;for(let m=0;m<t.segmentPolylines.length;m++)t.segmentPolylines[m].show=!1;return}c.show=!0,c.positions=d,c.material=xo.getValue(e,i.material,c.material);let p=X.getValueOrUndefined(i.materialMode,e),g=i.material;if(p===Ag.PORTIONS&&!g.isConstant){l(c)&&(c.show=!1);let m=f>0?f:BCe,y=g.intervals,A=0;if(l(y)){T1.start=o,T1.stop=a,T1.isStartIncluded=!0,T1.isStopIncluded=!0;for(let b=0;b<y.length;b++){let x=y.get(b);if(!Cn.intersect(x,T1,p8))continue;let T=p8.start,C=p8.stop;if(K.greaterThanOrEquals(T,C))continue;let E=iyt(x.data),w=[K.clone(T),K.clone(C)];for(let D=0;D<E.length;D++){let R=E[D],M=R.intervals;if(l(M))for(let N=0;N<M.length;N++){let _=M.get(N);Cn.intersect(_,p8,wx)&&(K.greaterThan(wx.start,T)&&K.lessThan(wx.start,C)&&w.push(K.clone(wx.start)),K.greaterThan(wx.stop,T)&&K.lessThan(wx.stop,C)&&w.push(K.clone(wx.stop)))}else if(!X.isConstant(R)){let N=K.clone(T);for(;K.lessThan(N,C);)w.push(K.clone(N)),N=K.addSeconds(N,m,new K)}}A=jCe(w,r,e,i,n,t,this._polylineCollection,m,this._referenceFrame,x.data,A)}}else{let b=[K.clone(o),K.clone(a)],x=K.addSeconds(o,m,new K);for(;K.lessThan(x,a);)b.push(K.clone(x)),x=K.addSeconds(x,m,new K);A=jCe(b,r,e,i,n,t,this._polylineCollection,m,this._referenceFrame,i.material,A)}for(let b=A;b<t.segmentPolylines.length;b++)l(t.segmentPolylines[b])&&(t.segmentPolylines[b].show=!1)}else for(let m=0;m<t.segmentPolylines.length;m++)t.segmentPolylines[m].show=!1;c.width=X.getValueOrDefault(i._width,e,HCe),c.distanceDisplayCondition=X.getValueOrUndefined(i._distanceDisplayCondition,e,c.distanceDisplayCondition)};v1.prototype.removeObject=function(e){let t=e.polyline;l(t)&&(this._unusedIndexes.push(e.index),e.polyline=void 0,t.show=!1,t.id=void 0,e.index=void 0);for(let n=0;n<e.segmentPolylines.length;n++)e.segmentPolylines[n].show=!1;e.segmentPolylines.length=0};v1.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),ue(this)};function Pp(e,t){t.collectionChanged.addEventListener(Pp.prototype._onCollectionChanged,this),this._scene=e,this._updaters={},this._entityCollection=t,this._items=new zt,this._onCollectionChanged(t,t.values,[],[])}Pp.prototype.update=function(e){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&&l(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,r=n.length;i<r;i++){let o=n[i],a=o.entity,s=a._position,c=a._path,u=o.updater,f=!1,d=Vi.FIXED,p=d.toString();if(this._scene.mode===re.SCENE3D){let m=X.getValueOrUndefined(c.relativeTo,e);l(m)?m==="FIXED"?(d=Vi.FIXED,p=d.toString()):m==="INERTIAL"?(d=Vi.INERTIAL,p=d.toString()):(f=!0,d=this._entityCollection.getById(m),p=m):(d=s.referenceFrame,p=d.toString())}let g=this._updaters[p];if(u===g&&l(g)){g.updateObject(e,o);continue}l(u)&&u.removeObject(o),!(f&&!l(d))&&(l(g)||(g=new v1(this._scene,d),g.update(e),this._updaters[p]=g),o.updater=g,l(g)&&g.updateObject(e,o))}return!0};Pp.prototype.isDestroyed=function(){return!1};Pp.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Pp.prototype._onCollectionChanged,this);let e=this._updaters;for(let t in e)e.hasOwnProperty(t)&&e[t].destroy();return ue(this)};Pp.prototype._onCollectionChanged=function(e,t,n,i){let r,o,a,s=this._items;for(r=t.length-1;r>-1;r--)o=t[r],l(o._path)&&l(o._position)&&s.set(o.id,new kCe(o));for(r=i.length-1;r>-1;r--)o=i[r],l(o._path)&&l(o._position)?s.contains(o.id)||s.set(o.id,new kCe(o)):(a=s.get(o.id),l(a)&&(l(a.updater)&&a.updater.removeObject(a),s.remove(o.id)));for(r=n.length-1;r>-1;r--)o=n[r],a=s.get(o.id),l(a)&&(l(a.updater)&&a.updater.removeObject(a),s.remove(o.id))};Pp._subSample=jQ;Pp._computeVvlhTransform=VQ;Pp._transformToEntityFrame=C1;var g8=Pp;var qCe=U.WHITE,YCe=U.BLACK,XCe=0,KCe=1,$Ce=0,JCe=jo.NONE,ZCe=new U,ryt=new h,QCe=new U,eve=new Wt,tve=new Wt,nve=new jt;function ive(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 Jy(e,t){t.collectionChanged.addEventListener(Jy.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new zt,this._onCollectionChanged(t,t.values,[],[])}Jy.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,r=t.length;i<r;i++){let o=t[i],a=o.entity,s=a._point,c=o.pointPrimitive,u=o.billboard,f=X.getValueOrDefault(s._heightReference,e,it.NONE),d=a.isShowing&&a.isAvailable(e)&&X.getValueOrDefault(s._show,e,!0),p;if(d&&(p=X.getValueOrUndefined(a._position,e,ryt),d=l(p)),!d){E1(o,a,n);continue}X.isConstant(a._position)||(n._clusterDirty=!0);let g=!1,m=!1;if(f!==it.NONE&&!l(u)?(l(c)&&(E1(o,a,n),c=void 0),u=n.getBillboard(a),u.id=a,u.image=void 0,o.billboard=u,g=!0,m=h.equals(u.position,p)&&u.heightReference===f):f===it.NONE&&!l(c)&&(l(u)&&(E1(o,a,n),u=void 0),c=n.getPoint(a),c.id=a,o.pointPrimitive=c),l(c))c.show=!0,c.position=p,c.scaleByDistance=X.getValueOrUndefined(s._scaleByDistance,e,eve),c.translucencyByDistance=X.getValueOrUndefined(s._translucencyByDistance,e,tve),c.color=X.getValueOrDefault(s._color,e,qCe,ZCe),c.outlineColor=X.getValueOrDefault(s._outlineColor,e,YCe,QCe),c.outlineWidth=X.getValueOrDefault(s._outlineWidth,e,XCe),c.pixelSize=X.getValueOrDefault(s._pixelSize,e,KCe),c.distanceDisplayCondition=X.getValueOrUndefined(s._distanceDisplayCondition,e,nve),c.disableDepthTestDistance=X.getValueOrDefault(s._disableDepthTestDistance,e,$Ce),c.splitDirection=X.getValueOrDefault(s._splitDirection,e,JCe);else if(l(u)){u.show=!0,u.position=p,u.scaleByDistance=X.getValueOrUndefined(s._scaleByDistance,e,eve),u.translucencyByDistance=X.getValueOrUndefined(s._translucencyByDistance,e,tve),u.distanceDisplayCondition=X.getValueOrUndefined(s._distanceDisplayCondition,e,nve),u.disableDepthTestDistance=X.getValueOrDefault(s._disableDepthTestDistance,e,$Ce),u.splitDirection=X.getValueOrDefault(s._splitDirection,e,JCe),u.heightReference=f;let y=X.getValueOrDefault(s._color,e,qCe,ZCe),A=X.getValueOrDefault(s._outlineColor,e,YCe,QCe),b=Math.round(X.getValueOrDefault(s._outlineWidth,e,XCe)),x=Math.max(1,Math.round(X.getValueOrDefault(s._pixelSize,e,KCe)));if(b>0?(u.scale=1,g=g||b!==o.outlineWidth||x!==o.pixelSize||!U.equals(y,o.color)||!U.equals(A,o.outlineColor)):(u.scale=x/50,x=50,g=g||b!==o.outlineWidth||!U.equals(y,o.color)||!U.equals(A,o.outlineColor)),g){o.color=U.clone(y,o.color),o.outlineColor=U.clone(A,o.outlineColor),o.pixelSize=x,o.outlineWidth=b;let T=y.alpha,C=y.toCssColorString(),E=A.toCssColorString(),w=JSON.stringify([C,x,E,b]);u.setImage(w,qE(T,C,E,b,x))}m&&u._updateClamping()}}return!0};Jy.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!(l(n.pointPrimitive)||l(n.billboard)))return It.FAILED;if(l(n.pointPrimitive))t.center=h.clone(n.pointPrimitive.position,t.center);else{let i=n.billboard;if(!l(i._clampedPosition))return It.PENDING;t.center=h.clone(i._clampedPosition,t.center)}return t.radius=0,It.DONE};Jy.prototype.isDestroyed=function(){return!1};Jy.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Jy.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removePoint(e[t]);return ue(this)};Jy.prototype._onCollectionChanged=function(e,t,n,i){let r,o,a=this._items,s=this._cluster;for(r=t.length-1;r>-1;r--)o=t[r],l(o._point)&&l(o._position)&&a.set(o.id,new ive(o));for(r=i.length-1;r>-1;r--)o=i[r],l(o._point)&&l(o._position)?a.contains(o.id)||a.set(o.id,new ive(o)):(E1(a.get(o.id),o,s),a.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],E1(a.get(o.id),o,s),a.remove(o.id)};function E1(e,t,n){if(l(e)){let i=e.pointPrimitive;if(l(i)){e.pointPrimitive=void 0,n.removePoint(t);return}let r=e.billboard;l(r)&&(e.billboard=void 0,n.removeBillboard(t))}}var _8=Jy;var oyt=new yi(0),y8={},rve=new U,ayt=new Yt(U.WHITE),syt=new yi(!0),cyt=new yi(Rn.DISABLED),lyt=new yi(new jt),uyt=new yi(Zn.BOTH);function fyt(){this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function dyt(){this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function Xh(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(Xh.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._geometryChanged=new be,this._showProperty=void 0,this._materialProperty=void 0,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._classificationTypeProperty=void 0,this._depthFailMaterialProperty=void 0,this._geometryOptions=new fyt,this._groundGeometryOptions=new dyt,this._id=`polyline-${e.id}`,this._clampToGround=!1,this._supportsPolylinesOnTerrain=$r.supportsPolylinesOnTerrain(t),this._zIndex=0,this._onEntityPropertyChanged(e,"polyline",e.polyline,void 0)}Object.defineProperties(Xh.prototype,{id:{get:function(){return this._id}},entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!l(this._entity.availability)&&X.isConstant(this._showProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},depthFailMaterialProperty:{get:function(){return this._depthFailMaterialProperty}},outlineEnabled:{value:!1},hasConstantOutline:{value:!0},outlineColorProperty:{value:void 0},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},classificationTypeProperty:{get:function(){return this._classificationTypeProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!1},geometryChanged:{get:function(){return this._geometryChanged}},arcType:{get:function(){return this._arcType}},clampToGround:{get:function(){return this._clampToGround&&this._supportsPolylinesOnTerrain}},zIndex:{get:function(){return this._zIndex}}});Xh.prototype.isOutlineVisible=function(e){return!1};Xh.prototype.isFilled=function(e){let t=this._entity;return(this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e))??!1};Xh.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new Dn(n&&t.isShowing&&this._showProperty.getValue(e)),r=this._distanceDisplayConditionProperty.getValue(e),o=Jn.fromDistanceDisplayCondition(r),a={show:i,distanceDisplayCondition:o},s;return this._materialProperty instanceof Yt&&(l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(s=this._materialProperty.color.getValue(e,rve)),l(s)||(s=U.WHITE),a.color=Kt.fromColor(s)),this.clampToGround?new Bt({id:t,geometry:new HC(this._groundGeometryOptions),attributes:a}):(l(this._depthFailMaterialProperty)&&this._depthFailMaterialProperty instanceof Yt&&(l(this._depthFailMaterialProperty.color)&&(this._depthFailMaterialProperty.color.isConstant||n)&&(s=this._depthFailMaterialProperty.color.getValue(e,rve)),l(s)||(s=U.WHITE),a.depthFailColor=Kt.fromColor(s)),new Bt({id:t,geometry:new V_(this._geometryOptions),attributes:a}))};Xh.prototype.createOutlineGeometryInstance=function(e){};Xh.prototype.isDestroyed=function(){return!1};Xh.prototype.destroy=function(){this._entitySubscription(),ue(this)};Xh.prototype._onEntityPropertyChanged=function(e,t,n,i){if(!(t==="availability"||t==="polyline"))return;let r=this._entity.polyline;if(!l(r)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let o=r.positions,a=r.show;if(l(a)&&a.isConstant&&!a.getValue(Qe.MINIMUM_VALUE)||!l(o)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let s=r.zIndex,c=r.material??ayt,u=c instanceof Yt;this._materialProperty=c,this._depthFailMaterialProperty=r.depthFailMaterial,this._showProperty=a??syt,this._shadowsProperty=r.shadows??cyt,this._distanceDisplayConditionProperty=r.distanceDisplayCondition??lyt,this._classificationTypeProperty=r.classificationType??uyt,this._fillEnabled=!0,this._zIndex=s??oyt;let f=r.width,d=r.arcType,p=r.clampToGround,g=r.granularity;if(!o.isConstant||!X.isConstant(f)||!X.isConstant(d)||!X.isConstant(g)||!X.isConstant(p)||!X.isConstant(s))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{let m=this._geometryOptions,y=o.getValue(Qe.MINIMUM_VALUE,m.positions);if(!l(y)||y.length<2){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let A;u&&(!l(this._depthFailMaterialProperty)||this._depthFailMaterialProperty instanceof Yt)?A=Ua.VERTEX_FORMAT:A=yc.VERTEX_FORMAT,m.vertexFormat=A,m.positions=y,m.width=l(f)?f.getValue(Qe.MINIMUM_VALUE):void 0,m.arcType=l(d)?d.getValue(Qe.MINIMUM_VALUE):void 0,m.granularity=l(g)?g.getValue(Qe.MINIMUM_VALUE):void 0;let b=this._groundGeometryOptions;b.positions=y,b.width=m.width,b.arcType=m.arcType,b.granularity=m.granularity,this._clampToGround=l(p)?p.getValue(Qe.MINIMUM_VALUE):!1,!this._clampToGround&&l(s)&&pt("Entity polylines must have clampToGround: true when using zIndex. zIndex will be ignored."),this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};Xh.prototype.createDynamicUpdater=function(e,t){return new S1(e,t,this)};var fS={positions:void 0,granularity:void 0,height:void 0,ellipsoid:void 0};function S1(e,t,n){this._line=void 0,this._primitives=e,this._groundPrimitives=t,this._groundPolylinePrimitive=void 0,this._material=void 0,this._geometryUpdater=n,this._positions=[]}function ove(e){if(l(e._line))return e._line;let t=e._primitives,n=e._geometryUpdater._scene.id+t._guid,i=y8[n];!l(i)||i.isDestroyed()?(i=new Ep,y8[n]=i,t.add(i)):t.contains(i)||t.add(i);let r=i.add();return r.id=e._geometryUpdater._entity,e._line=r,r}S1.prototype.update=function(e){let t=this._geometryUpdater,n=t._entity,i=n.polyline,r=i.positions,o=X.getValueOrUndefined(r,e,this._positions);t._clampToGround=X.getValueOrDefault(i._clampToGround,e,!1),t._groundGeometryOptions.positions=o,t._groundGeometryOptions.width=X.getValueOrDefault(i._width,e,1),t._groundGeometryOptions.arcType=X.getValueOrDefault(i._arcType,e,sn.GEODESIC),t._groundGeometryOptions.granularity=X.getValueOrDefault(i._granularity,e,9999);let a=this._groundPrimitives;if(l(this._groundPolylinePrimitive)&&(a.remove(this._groundPolylinePrimitive),this._groundPolylinePrimitive=void 0),t.clampToGround){if(!n.isShowing||!n.isAvailable(e)||!X.getValueOrDefault(i._show,e,!0)||!l(o)||o.length<2)return;let d=t.fillMaterialProperty,p;if(d instanceof Yt)p=new Ua;else{let g=xo.getValue(e,d,this._material);p=new yc({material:g,translucent:g.isTranslucent()}),this._material=g}this._groundPolylinePrimitive=a.add(new tp({geometryInstances:t.createFillGeometryInstance(e),appearance:p,classificationType:t.classificationTypeProperty.getValue(e),asynchronous:!1}),X.getValueOrUndefined(t.zIndex,e)),l(this._line)&&(this._line.show=!1);return}let s=ove(this);if(!n.isShowing||!n.isAvailable(e)||!X.getValueOrDefault(i._show,e,!0)){s.show=!1;return}if(!l(o)||o.length<2){s.show=!1;return}let c=sn.GEODESIC;c=X.getValueOrDefault(i._arcType,e,c);let u=t._scene.globe,f=t._scene.ellipsoid;c!==sn.NONE&&l(u)&&(fS.ellipsoid=f,fS.positions=o,fS.granularity=X.getValueOrUndefined(i._granularity,e),fS.height=nr.extractHeights(o,f),c===sn.GEODESIC?o=nr.generateCartesianArc(fS):o=nr.generateCartesianRhumbArc(fS)),s.show=!0,s.positions=o.slice(),s.material=xo.getValue(e,t.fillMaterialProperty,s.material),s.width=X.getValueOrDefault(i._width,e,1),s.distanceDisplayCondition=X.getValueOrUndefined(i._distanceDisplayCondition,e,s.distanceDisplayCondition)};S1.prototype.getBoundingSphere=function(e){if(this._geometryUpdater.clampToGround){let t=this._groundPolylinePrimitive;if(l(t)&&t.show&&t.ready){let n=t.getGeometryInstanceAttributes(this._geometryUpdater._entity);if(l(n)&&l(n.boundingSphere))return se.clone(n.boundingSphere,e),It.DONE}return l(t)&&!t.ready?It.PENDING:It.DONE}else{let t=ove(this);if(t.show&&t.positions.length>0)return se.fromPoints(t.positions,e),It.DONE}return It.FAILED};S1.prototype.isDestroyed=function(){return!1};S1.prototype.destroy=function(){let t=this._geometryUpdater._scene.id+this._primitives._guid,n=y8[t];l(n)&&(n.remove(this._line),n.length===0&&(this._primitives.removeAndDestroy(n),delete y8[t])),l(this._groundPolylinePrimitive)&&this._groundPrimitives.remove(this._groundPolylinePrimitive),ue(this)};var A8=Xh;var hyt=new U,myt=new jt,pyt=new jt;function Kh(e,t,n,i,r){let o;n instanceof Yt?o=Ua:o=yc,this.orderedGroundPrimitives=e,this.classificationType=t,this.appearanceType=o,this.materialProperty=n,this.updaters=new zt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new zt,this.material=void 0,this.updatersWithAttributes=new zt,this.attributes=new zt,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(Kh.prototype.onMaterialChanged,this),this.subscriptions=new zt,this.showsUpdated=new zt,this.zIndex=i,this._asynchronous=r}Kh.prototype.onMaterialChanged=function(){this.invalidated=!0};Kh.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof Yt&&t instanceof Yt?!0:l(t)&&t.equals(n)};Kh.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||!X.isConstant(t.distanceDisplayConditionProperty))this.updatersWithAttributes.set(i,t);else{let r=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(o,a,s,c){a==="isShowing"&&r.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};Kh.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 l(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};Kh.prototype.update=function(e){let t=!0,n=this.primitive,i=this.orderedGroundPrimitives,r=this.geometry.values,o;if(this.createPrimitive){if(r.length>0){l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n);let s=this.appearanceType;n=new tp({show:!1,asynchronous:this._asynchronous,geometryInstances:r.slice(),appearance:new s,classificationType:this.classificationType}),this.appearanceType===yc&&(this.material=xo.getValue(e,this.materialProperty,this.material),n.appearance.material=this.material),i.add(n,this.zIndex),t=!1}else{l(n)&&(i.remove(n),n=void 0);let s=this.oldPrimitive;l(s)&&(i.remove(s),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.appearanceType===yc&&(this.material=xo.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material);let a=this.updatersWithAttributes.values,s=a.length;for(o=0;o<s;o++){let c=a[o],u=c.entity,f=this.geometry.get(c.id),d=this.attributes.get(f.id.id);if(l(d)||(d=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!c.fillMaterialProperty.isConstant){let y=c.fillMaterialProperty.color,A=X.getValueOrDefault(y,e,U.WHITE,hyt);U.equals(d._lastColor,A)||(d._lastColor=U.clone(A,d._lastColor),d.color=Kt.toValue(A,d.color))}let p=u.isShowing&&(c.hasConstantFill||c.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=Dn.toValue(p,d.show));let m=c.distanceDisplayConditionProperty;if(!X.isConstant(m)){let y=X.getValueOrDefault(m,e,pyt,myt);jt.equals(y,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=jt.clone(y,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=Jn.toValue(y,d.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};Kh.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=r.entity,a=this.geometry.get(r.id),s=this.attributes.get(a.id.id);l(s)||(s=e.getGeometryInstanceAttributes(a.id),this.attributes.set(a.id.id,s));let c=o.isShowing,u=s.show[0]===1;c!==u&&(s.show=Dn.toValue(c,s.show),a.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};Kh.prototype.contains=function(e){return this.updaters.contains(e.id)};Kh.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return It.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?It.FAILED:(i.boundingSphere.clone(t),It.DONE)};Kh.prototype.destroy=function(){let e=this.primitive,t=this.orderedGroundPrimitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),this.removeMaterialSubscription()};function dS(e,t,n){this._items=[],this._orderedGroundPrimitives=e,this._classificationType=t,this._asynchronous=n??!0}dS.prototype.add=function(e,t){let n=this._items,i=n.length,r=t.createFillGeometryInstance(e),o=X.getValueOrDefault(t.zIndex,0);for(let s=0;s<i;++s){let c=n[s];if(c.isMaterial(t)&&c.zIndex===o){c.add(e,t,r);return}}let a=new Kh(this._orderedGroundPrimitives,this._classificationType,t.fillMaterialProperty,o,this._asynchronous);a.add(e,t,r),n.push(a)};dS.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0;i--){let r=t[i];if(r.remove(e)){r.updaters.length===0&&(t.splice(i,1),r.destroy());break}}};dS.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let o=n[t];if(o.invalidated){n.splice(t,1);let a=o.updaters.values,s=a.length;for(let c=0;c<s;c++)this.add(e,a[c]);o.destroy()}}let r=!0;for(t=0;t<n.length;t++)r=n[t].update(e)&&r;return r};dS.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let r=0;r<i;r++){let o=n[r];if(o.contains(e))return o.getBoundingSphere(e,t)}return It.FAILED};dS.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var b8=dS;var gyt=[];function ave(e,t){let n=e._batches,i=n.length;for(let r=0;r<i;r++)n[r].remove(t)}function sve(e,t,n){if(n.isDynamic){e._dynamicBatch.add(t,n);return}if(n.clampToGround&&n.fillEnabled){let a=n.classificationTypeProperty.getValue(t);e._groundBatches[a].add(t,n);return}let i;n.fillEnabled&&(i=n.shadowsProperty.getValue(t));let r=0;l(n.depthFailMaterialProperty)&&(r=n.depthFailMaterialProperty instanceof Yt?1:2);let o;l(i)&&(o=i+r*Rn.NUMBER_OF_SHADOW_MODES),n.fillEnabled&&(n.fillMaterialProperty instanceof Yt?e._colorBatches[o].add(t,n):e._materialBatches[o].add(t,n))}function Dp(e,t,n,i){i=i??e.groundPrimitives,n=n??e.primitives,this._scene=e,this._primitives=n,this._entityCollection=void 0,this._addedObjects=new zt,this._removedObjects=new zt,this._changedObjects=new zt;let r,o=Rn.NUMBER_OF_SHADOW_MODES;for(this._colorBatches=new Array(o*3),this._materialBatches=new Array(o*3),r=0;r<o;++r)this._colorBatches[r]=new Dh(n,Ua,void 0,!1,r),this._materialBatches[r]=new Oh(n,yc,void 0,!1,r),this._colorBatches[r+o]=new Dh(n,Ua,Ua,!1,r),this._materialBatches[r+o]=new Oh(n,yc,Ua,!1,r),this._colorBatches[r+o*2]=new Dh(n,Ua,yc,!1,r),this._materialBatches[r+o*2]=new Oh(n,yc,yc,!1,r);this._dynamicBatch=new Wv(n,i);let a=Zn.NUMBER_OF_CLASSIFICATION_TYPES;for(this._groundBatches=new Array(a),r=0;r<a;++r)this._groundBatches[r]=new b8(i,r);this._batches=this._colorBatches.concat(this._materialBatches,this._dynamicBatch,this._groundBatches),this._subscriptions=new zt,this._updaters=new zt,this._entityCollection=t,t.collectionChanged.addEventListener(Dp.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,gyt)}Dp.prototype.update=function(e){let t=this._addedObjects,n=t.values,i=this._removedObjects,r=i.values,o=this._changedObjects,a=o.values,s,c,u,f;for(s=a.length-1;s>-1;s--)c=a[s],u=c.id,f=this._updaters.get(u),f.entity===c?(ave(this,f),sve(this,e,f)):(r.push(c),n.push(c));for(s=r.length-1;s>-1;s--)c=r[s],u=c.id,f=this._updaters.get(u),ave(this,f),f.destroy(),this._updaters.remove(u),this._subscriptions.get(u)(),this._subscriptions.remove(u);for(s=n.length-1;s>-1;s--)c=n[s],u=c.id,f=new A8(c,this._scene),this._updaters.set(u,f),sve(this,e,f),this._subscriptions.set(u,f.geometryChanged.addEventListener(Dp._onGeometryChanged,this));t.removeAll(),i.removeAll(),o.removeAll();let d=!0,p=this._batches,g=p.length;for(s=0;s<g;s++)d=p[s].update(e)&&d;return d};var _yt=[],yyt=new se;Dp.prototype.getBoundingSphere=function(e,t){let n=_yt,i=yyt,r=0,o,a=this._batches,s=a.length,c=this._updaters.get(e.id);for(let u=0;u<s;u++){if(o=a[u].getBoundingSphere(c,i),o===It.PENDING)return It.PENDING;o===It.DONE&&(n[r]=se.clone(i,n[r]),r++)}return r===0?It.FAILED:(n.length=r,se.fromBoundingSpheres(n,t),It.DONE)};Dp.prototype.isDestroyed=function(){return!1};Dp.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Dp.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();let e,t=this._batches,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._subscriptions.values;for(n=i.length,e=0;e<n;e++)i[e]();return this._subscriptions.removeAll(),ue(this)};Dp._onGeometryChanged=function(e){let t=this._removedObjects,n=this._changedObjects,i=e.entity,r=i.id;!l(t.get(r))&&!l(n.get(r))&&n.set(r,i)};Dp.prototype._onCollectionChanged=function(e,t,n){let i=this._addedObjects,r=this._removedObjects,o=this._changedObjects,a,s,c;for(a=n.length-1;a>-1;a--)c=n[a],s=c.id,i.remove(s)||(r.set(s,c),o.remove(s));for(a=t.length-1;a>-1;a--)c=t[a],s=c.id,r.remove(s)?o.set(s,c):i.set(s,c)};var x8=Dp;function Pu(e){mu.initializeTerrainHeights(),tp.initializeTerrainHeights();let t=e.scene,n=e.dataSourceCollection;this._eventHelper=new Fo,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??Pu.defaultVisualizersCallback;let i=!1,r=new pu,o=new pu;n.length>0&&(t.primitives.add(r),t.groundPrimitives.add(o),i=!0),this._primitives=r,this._groundPrimitives=o;for(let u=0,f=n.length;u<f;u++)this._onDataSourceAdded(n,n.get(u));let a=new j3;this._onDataSourceAdded(void 0,a),this._defaultDataSource=a;let s,c;if(!i){let u=this,f=function(){t.primitives.add(r),t.groundPrimitives.add(o),s(),c(),u._removeDefaultDataSourceListener=void 0,u._removeDataSourceCollectionListener=void 0};s=a.entities.collectionChanged.addEventListener(f),c=n.dataSourceAdded.addEventListener(f)}this._removeDefaultDataSourceListener=s,this._removeDataSourceCollectionListener=c,this._ready=!1}var hS=[];Pu.registerVisualizer=function(e){hS.includes(e)||hS.push(e)};Pu.unregisterVisualizer=function(e){if(hS.includes(e)){let t=hS.indexOf(e);hS.splice(t,1)}};Pu.defaultVisualizersCallback=function(e,t,n){let i=n.entities;return[new D3(t,i),new sz(e,i,n._primitives,n._groundPrimitives),new cz(t,i),new o4(e,i),new c8(e,i),new _8(t,i),new g8(e,i),new x8(e,i,n._primitives,n._groundPrimitives),...hS.map(r=>new r(e,i))]};Object.defineProperties(Pu.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}}});Pu.prototype.isDestroyed=function(){return!1};Pu.prototype.destroy=function(){this._eventHelper.removeAll();let e=this._dataSourceCollection;for(let t=0,n=e.length;t<n;++t)this._onDataSourceRemoved(this._dataSourceCollection,e.get(t));return this._onDataSourceRemoved(void 0,this._defaultDataSource),l(this._removeDefaultDataSourceListener)?(this._removeDefaultDataSourceListener(),this._removeDataSourceCollectionListener()):(this._scene.primitives.remove(this._primitives),this._scene.groundPrimitives.remove(this._groundPrimitives)),ue(this)};Pu.prototype.update=function(e){if(!Oi.initialized)return this._ready=!1,!1;let t=!0,n,i,r,o,a=this._dataSourceCollection,s=a.length;for(n=0;n<s;n++){let c=a.get(n);for(l(c.update)&&(t=c.update(e)&&t),r=c._visualizers,o=r.length,i=0;i<o;i++)t=r[i].update(e)&&t}for(r=this._defaultDataSource._visualizers,o=r.length,i=0;i<o;i++)t=r[i].update(e)&&t;return!this._ready&&t&&this._scene.requestRender(),this._ready=this._ready||t,t};Pu.prototype._postRender=function(){let e=this._scene.frameState,t=this._dataSourceCollection,n=t.length;for(let i=0;i<n;i++){let r=t.get(i),o=r.credit;l(o)&&e.creditDisplay.addCreditToNextFrame(o);let a=r._resourceCredits;if(l(a)){let s=a.length;for(let c=0;c<s;c++)e.creditDisplay.addCreditToNextFrame(a[c])}}};var Ayt=[],byt=new se;Pu.prototype.getBoundingSphere=function(e,t,n){if(!this._ready)return It.PENDING;let i,r,o=this._defaultDataSource;if(!o.entities.contains(e)){o=void 0;let p=this._dataSourceCollection;for(r=p.length,i=0;i<r;i++){let g=p.get(i);if(g.entities.contains(e)){o=g;break}}}if(!l(o))return It.FAILED;let a=Ayt,s=byt,c=0,u,f=o._visualizers,d=f.length;for(i=0;i<d;i++){let p=f[i];if(l(p.getBoundingSphere)){if(u=f[i].getBoundingSphere(e,s),!t&&u===It.PENDING)return It.PENDING;u===It.DONE&&(a[c]=se.clone(s,a[c]),c++)}}return c===0?It.FAILED:(a.length=c,se.fromBoundingSpheres(a,n),It.DONE)};Pu.prototype._onDataSourceAdded=function(e,t){let n=this._scene,i=this._primitives,r=this._groundPrimitives,o=i.add(new pu),a=r.add(new P3);t._primitives=o,t._groundPrimitives=a;let s=t.clustering;s._initialize(n),o.add(s),t._visualizers=this._visualizersCallback(n,s,t)};Pu.prototype._onDataSourceRemoved=function(e,t){let n=this._primitives,i=this._groundPrimitives,r=t._primitives,o=t._groundPrimitives,a=t.clustering;r.remove(a);let s=t._visualizers,c=s.length;for(let u=0;u<c;u++)s[u].destroy();n.remove(r),i.remove(o),t._visualizers=void 0};Pu.prototype._onDataSourceMoved=function(e,t,n){let i=this._primitives,r=this._groundPrimitives,o=e._primitives,a=e._groundPrimitives;t===n+1?(i.raise(o),r.raise(a)):t===n-1?(i.lower(o),r.lower(a)):t===0?(i.lowerToBottom(o),r.lowerToBottom(a),i.raise(o),r.raise(a)):(i.raiseToTop(o),r.raiseToTop(a))};var T8=Pu;function mS(e,t){this._position=void 0,this._subscription=void 0,this._definitionChanged=new be,this._normalize=t??!0,this.position=e}Object.defineProperties(mS.prototype,{isConstant:{get:function(){return X.isConstant(this._position)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._position},set:function(e){let t=this._position;t!==e&&(l(t)&&this._subscription(),this._position=e,l(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 xyt=new h,cve=new h,lve=new K,Tyt=new K,HQ=1/60;mS.prototype.getValue=function(e,t){return this._getValue(e,t)};mS.prototype._getValue=function(e,t,n){l(e)||(e=K.now(Tyt)),l(t)||(t=new h);let i=this._position;if(X.isConstant(i))return this._normalize?void 0:h.clone(h.ZERO,t);let r=i.getValue(e,xyt),o=i.getValue(K.addSeconds(e,HQ,lve),cve);if(!l(r)||!l(o)&&(o=r,r=i.getValue(K.addSeconds(e,-HQ,lve),cve),!l(r)))return;if(h.equals(r,o))return this._normalize?void 0:h.clone(h.ZERO,t);l(n)&&r.clone(n);let a=h.subtract(o,r,t);return this._normalize?h.normalize(a,t):h.divideByScalar(a,HQ,t)};mS.prototype.equals=function(e){return this===e||e instanceof mS&&X.equals(this._position,e._position)};var Zy=mS;var uve=new $,fve=new $,dve=new $,Cyt=new O,C8=new h,hve=new h,GQ=new h,WQ=new h,mve=new h,pve=new h,vyt=new Fe,Eyt=new h,Syt=new $,pS=new K,wyt=1.25;function Iyt(e,t,n,i,r,o,a,s,c,u){let f=e.scene.mode,d=r.getValue(c,e._lastCartesian);if(l(d)){let p=!1,g=!1,m,y,A;if(f===re.SCENE3D){K.addSeconds(c,.001,pS);let D=r.getValue(pS,C8);if(l(D)||(K.addSeconds(c,-.001,pS),D=r.getValue(pS,C8),g=!0),l(D)){let R=mt.computeFixedToIcrfMatrix(c,uve),M=mt.computeFixedToIcrfMatrix(pS,fve),N;!l(R)||!l(M)?(N=mt.computeTemeToPseudoFixedMatrix(c,dve),R=$.transpose(N,uve),M=mt.computeTemeToPseudoFixedMatrix(pS,fve),$.transpose(M,M)):N=$.transpose(R,dve);let _=$.multiplyByVector(R,d,mve),v=$.multiplyByVector(M,D,pve);h.subtract(_,v,WQ);let S=h.magnitude(WQ)*1e3,P=I.GRAVITATIONALPARAMETER,L=-P/(S*S-2*P/h.magnitude(_));L<0||L>wyt*u.maximumRadius?(m=hve,h.normalize(d,m),h.negate(m,m),A=h.clone(h.UNIT_Z,GQ),y=h.cross(A,m,C8),h.magnitude(y)>I.EPSILON7&&(h.normalize(m,m),h.normalize(y,y),A=h.cross(m,y,GQ),h.normalize(A,A),p=!0)):h.equalsEpsilon(d,D,I.EPSILON7)||(A=hve,h.normalize(_,A),h.normalize(v,v),y=h.cross(A,v,GQ),g&&(y=h.multiplyByScalar(y,-1,y)),h.equalsEpsilon(y,h.ZERO,I.EPSILON7)||(m=h.cross(y,A,C8),$.multiplyByVector(N,m,m),$.multiplyByVector(N,y,y),$.multiplyByVector(N,A,A),h.normalize(m,m),h.normalize(y,y),h.normalize(A,A),p=!0))}}l(e.boundingSphere)&&(d=e.boundingSphere.center);let b,x,T;i&&(b=h.clone(t.position,WQ),x=h.clone(t.direction,mve),T=h.clone(t.up,pve));let C=Cyt,E;l(a)&&(E=a.getValue(c,vyt));let w=o.getValue(c,Eyt);if(s===$_.INERTIAL&&l(E))O.fromTranslationQuaternionRotationScale(d,E,h.ONE,C);else if(s===$_.VELOCITY&&l(w)){let D=mt.rotationMatrixFromPositionVelocity(d,w,u,Syt);O.fromRotationTranslation(D,d,C)}else s===$_.ENU||!p?mt.eastNorthUpToFixedFrame(d,u,C):(C[0]=m.x,C[1]=m.y,C[2]=m.z,C[3]=0,C[4]=y.x,C[5]=y.y,C[6]=y.z,C[7]=0,C[8]=A.x,C[9]=A.y,C[10]=A.z,C[11]=0,C[12]=d.x,C[13]=d.y,C[14]=d.z,C[15]=0);t._setTransform(C),i&&(h.clone(b,t.position),h.clone(x,t.direction),h.clone(T,t.up),h.cross(x,T,t.right))}if(n){let p=f===re.SCENE2D||h.equals(e._offset3D,h.ZERO)?void 0:e._offset3D;t.lookAtTransform(t.transform,p)}}function w1(e,t,n){this.entity=e,this.scene=t,this.ellipsoid=n??te.default,this.boundingSphere=void 0,this._lastEntity=void 0,this._mode=void 0,this._lastCartesian=new h,this._defaultOffset3D=void 0,this._velocityProperty=new Zy(e.position,!0),this._offset3D=new h}Object.defineProperties(w1,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(e){this._defaultOffset3D=h.clone(e,new h)}}});w1.defaultOffset3D=new h(-14e3,3500,3500);var v8=new ph,Pyt=new h;w1.prototype.update=function(e,t){let n=this.scene,i=this.ellipsoid,r=n.mode;if(r===re.MORPHING)return;let o=this.entity,a=o.trackingReferenceFrame,s=o.position;if(!l(s))return;let c=this._velocityProperty,u=o.orientation,f=o!==this._lastEntity,d=r!==this._mode,p=n.camera,g=f||d,m=!0;if(f){let y=o.viewFrom,A=l(y);if(!A&&l(t)){v8.pitch=-I.PI_OVER_FOUR,v8.range=0;let b=s.getValue(e,Pyt);if(l(b)){let x=2-1/Math.max(1,h.magnitude(b)/i.maximumRadius);v8.pitch*=x}p.viewBoundingSphere(t,v8),this.boundingSphere=t,g=!1,m=!1}else(!A||!l(y.getValue(e,this._offset3D)))&&h.clone(w1._defaultOffset3D,this._offset3D)}else!d&&this._mode!==re.SCENE2D&&h.clone(p.position,this._offset3D);this._lastEntity=o,this._mode=r,Iyt(this,p,g,m,s,c,u,a,e,i)};var E8=w1;function Dyt(e){return typeof e=="string"&&(e=document.getElementById(e)),e}var zn=Dyt;async function qQ(e,t){let n=t.terrainProvider,i=t.mapProjection,r=i.ellipsoid,o,a=t.camera.getRectangleCameraCoordinates(e);if(t.mode===re.SCENE3D?o=r.cartesianToCartographic(a):o=i.unproject(a),!l(n))return o;let s=n.availability;if(!l(s)||t.mode===re.SCENE2D)return o;let c=[ie.center(e),ie.southeast(e),ie.southwest(e),ie.northeast(e),ie.northwest(e)],u=await qQ._sampleTerrainMostDetailed(n,c),f=!1,d=u.reduce(function(g,m){return l(m.height)?(f=!0,Math.max(m.height,g)):g},-Number.MAX_VALUE),p=o;return f&&(p.height+=d),p}qQ._sampleTerrainMostDetailed=yv;var gS=qQ;var S8=`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
|
|
|
|
// Based on colorCorrect
|
|
// The colorCorrect flag can only be true when tileProvider.hue/saturation/brightnessShift
|
|
// are nonzero AND when (applyFog || showGroundAtmosphere) in the tile provider
|
|
// - The tileProvider.hue/saturation/brightnessShift are just passed through
|
|
// from the Globe hue/saturation/brightness, like atmosphereBrightnessShift
|
|
// - The applyFog depends on enableFog, and some tile distance from the viewer
|
|
// - The showGroundAtmosphere is a flag that is passed through from the Globe,
|
|
// and is true by default when the ellipsoid is WGS84
|
|
#ifdef COLOR_CORRECT
|
|
uniform vec3 u_hsbShift; // Hue, saturation, brightness
|
|
#endif
|
|
|
|
// Based on highlightFillTile
|
|
// This is set for terrain tiles when they are "fill" tiles, and
|
|
// the terrainProvider.fillHighlightColor was set to a value with
|
|
// nonzero alpha
|
|
#ifdef HIGHLIGHT_FILL_TILE
|
|
uniform vec4 u_fillHighlightColor;
|
|
#endif
|
|
|
|
// Based on translucent
|
|
// This is set depending on the GlobeTranslucencyState
|
|
#ifdef TRANSLUCENT
|
|
uniform vec4 u_frontFaceAlphaByDistance;
|
|
uniform vec4 u_backFaceAlphaByDistance;
|
|
uniform vec4 u_translucencyRectangle;
|
|
#endif
|
|
|
|
// Based on showUndergroundColor
|
|
// This is set when GlobeSurfaceTileProvider.isUndergroundVisible
|
|
// returns true, AND the tileProvider.undergroundColor had a value with
|
|
// nonzero alpha, and the tileProvider.undergroundColorAlphaByDistance
|
|
// was in the right range
|
|
#ifdef UNDERGROUND_COLOR
|
|
uniform vec4 u_undergroundColor;
|
|
uniform vec4 u_undergroundColorAlphaByDistance;
|
|
#endif
|
|
|
|
// Based on enableLighting && hasVertexNormals
|
|
// The enableLighting flag is passed in directly from the Globe.
|
|
// The hasVertexNormals flag is from the tileProvider
|
|
#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)
|
|
{
|
|
// This crazy step stuff sets the alpha to 0.0 if this following condition is true:
|
|
// tileTextureCoordinates.s < textureCoordinateRectangle.s ||
|
|
// tileTextureCoordinates.s > textureCoordinateRectangle.p ||
|
|
// tileTextureCoordinates.t < textureCoordinateRectangle.t ||
|
|
// tileTextureCoordinates.t > textureCoordinateRectangle.q
|
|
// In other words, the alpha is zero if the fragment is outside the rectangle
|
|
// covered by this texture. Would an actual 'if' yield better performance?
|
|
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;
|
|
// Split to the left
|
|
if (split < 0.0 && gl_FragCoord.x > splitPosition) {
|
|
alpha = 0.0;
|
|
}
|
|
// Split to the right
|
|
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;
|
|
|
|
// When rendering imagery for a tile in multiple passes,
|
|
// some GPU/WebGL implementation combinations will not blend fragments in
|
|
// additional passes correctly if their computation includes an unmasked
|
|
// divide-by-zero operation,
|
|
// even if it's not in the output or if the output has alpha zero.
|
|
//
|
|
// For example, without sanitization for outAlpha,
|
|
// this renders without artifacts:
|
|
// if (outAlpha == 0.0) { outColor = vec3(0.0); }
|
|
//
|
|
// but using czm_branchFreeTernary will cause portions of the tile that are
|
|
// alpha-zero in the additional pass to render as black instead of blending
|
|
// with the previous pass:
|
|
// outColor = czm_branchFreeTernary(outAlpha == 0.0, vec3(0.0), outColor);
|
|
//
|
|
// So instead, sanitize against divide-by-zero,
|
|
// store this state on the sign of outAlpha, and correct on return.
|
|
|
|
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)); // normalized surface normal in model coordinates
|
|
vec3 normalEC = czm_normal3D * normalMC; // normalized surface normal in eye coordinates
|
|
#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
|
|
|
|
// The clamp below works around an apparent bug in Chrome Canary v23.0.1241.0
|
|
// where the fragment shader sees textures coordinates < 0.0 and > 1.0 for the
|
|
// fragments on the edges of tiles even though the vertex shader is outputting
|
|
// coordinates strictly in the 0-1 range.
|
|
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;
|
|
|
|
// When the camera is far away (camera distance > nightFadeOutDistance), the scattering is computed in the fragment shader.
|
|
// Otherwise, the scattering is computed in the vertex shader.
|
|
#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);
|
|
|
|
// Fog is applied to tiles selected for fog, close to the Earth.
|
|
#ifdef FOG
|
|
vec3 fogColor = groundAtmosphereColor.rgb;
|
|
|
|
// If there is lighting, apply that to the fog.
|
|
#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
|
|
// Apply ground atmosphere. This happens when the camera is far away from the earth.
|
|
|
|
// The transmittance is based on optical depth i.e. the length of segment of the ray inside the atmosphere.
|
|
// This value is larger near the "circumference", as it is further away from the camera. We use it to
|
|
// brighten up that area of the ground atmosphere.
|
|
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 HAS_VECTOR_LAYER
|
|
finalColor = vectorPolygonRender(v_textureCoordinates.xy, finalColor);
|
|
finalColor = vectorPolylineRender(v_textureCoordinates.xy, 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);
|
|
}
|
|
|
|
// Based on water rendering by Jonas Wagner:
|
|
// http://29a.ch/2012/7/19/webgl-terrain-rendering-water-fog
|
|
|
|
// low altitude wave settings
|
|
const float oceanFrequencyLowAltitude = 825000.0;
|
|
const float oceanAnimationSpeedLowAltitude = 0.004;
|
|
const float oceanOneOverAmplitudeLowAltitude = 1.0 / 2.0;
|
|
const float oceanSpecularIntensity = 0.5;
|
|
|
|
// high altitude wave settings
|
|
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);
|
|
|
|
// The double normalize below works around a bug in Firefox on Android devices.
|
|
vec3 normalizedPositionToEyeEC = normalize(normalize(positionToEyeEC));
|
|
|
|
// Fade out the waves as the camera moves far from the surface.
|
|
float waveIntensity = waveFade(70000.0, 1000000.0, positionToEyeECLength);
|
|
|
|
#ifdef SHOW_OCEAN_WAVES
|
|
// high altitude 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);
|
|
|
|
// low altitude waves
|
|
time = czm_frameNumber * oceanAnimationSpeedLowAltitude;
|
|
noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyLowAltitude, time, 0.0);
|
|
vec3 normalTangentSpaceLowAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeLowAltitude);
|
|
|
|
// blend the 2 wave layers based on distance to surface
|
|
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);
|
|
|
|
// fade out the normal perturbation as we move farther from the water surface
|
|
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);
|
|
|
|
// Use diffuse light to highlight the waves
|
|
float diffuseIntensity = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * maskValue;
|
|
vec3 diffuseHighlight = waveHighlightColor * diffuseIntensity * (1.0 - fade);
|
|
|
|
#ifdef SHOW_OCEAN_WAVES
|
|
// Where diffuse light is low or non-existent, use wave highlights based solely on
|
|
// the wave bumpiness and no particular light direction.
|
|
float tsPerturbationRatio = normalTangentSpace.z;
|
|
vec3 nonDiffuseHighlight = mix(waveHighlightColor * 5.0 * (1.0 - tsPerturbationRatio), vec3(0.0), diffuseIntensity);
|
|
#else
|
|
vec3 nonDiffuseHighlight = vec3(0.0);
|
|
#endif
|
|
|
|
// Add specular highlights in 3D, and in all modes when zoomed in.
|
|
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 w8=`#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;
|
|
|
|
// Uniforms for 2D Mercator projection
|
|
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
|
|
|
|
// These functions are generated at runtime.
|
|
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)
|
|
{
|
|
// The width of a tile at level 11, in radians and assuming a single root tile, is
|
|
// 2.0 * czm_pi / pow(2.0, 11.0)
|
|
// We want to just linearly interpolate the 2D position from the texture coordinates
|
|
// when we're at this level or higher. The constant below is the expression
|
|
// above evaluated and then rounded up at the 4th significant digit.
|
|
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)
|
|
{
|
|
// We do not do RTC while morphing, so there is potential for jitter.
|
|
// This is unlikely to be noticeable, though.
|
|
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);
|
|
vec4 morphPositionEC = czm_modelView * morphPosition;
|
|
return czm_projection * morphPositionEC;
|
|
}
|
|
|
|
#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) || defined(APPLY_MATERIAL)
|
|
float webMercatorT = textureCoordinates.y;
|
|
float encodedNormal = compressed0.w;
|
|
#else
|
|
float webMercatorT = textureCoordinates.y;
|
|
float encodedNormal = 0.0;
|
|
#endif
|
|
|
|
#else
|
|
// A single float per element
|
|
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;
|
|
|
|
// stop from going through center of earth
|
|
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; // position in model coordinates
|
|
|
|
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 I1=`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 I8=`uniform highp sampler2D u_vectorSegmentTexture;
|
|
uniform highp sampler2D u_vectorWidthTexture;
|
|
uniform highp sampler2D u_vectorColorTexture;
|
|
uniform highp sampler2D u_vectorSegmentPrimitiveIndicesTexture;
|
|
uniform highp sampler2D u_vectorGridCellIndicesTexture;
|
|
uniform highp sampler2D u_vectorPolygonEdgeTexture;
|
|
uniform highp sampler2D u_vectorPolygonEdgePrimitiveIndicesTexture;
|
|
uniform highp sampler2D u_vectorPolygonGridCellIndicesTexture;
|
|
|
|
// UV-space offset from the closest point on the segment to p.
|
|
vec2 vectorOffsetToLine(vec2 p, vec4 line)
|
|
{
|
|
vec2 a = line.xy;
|
|
vec2 b = line.zw;
|
|
vec2 ab = b - a;
|
|
float abLengthSquared = dot(ab, ab);
|
|
if (abLengthSquared < 1.0e-8)
|
|
{
|
|
return p - a;
|
|
}
|
|
float t = clamp(dot(p - a, ab) / abLengthSquared, 0.0, 1.0);
|
|
return p - (a + t * ab);
|
|
}
|
|
|
|
ivec2 vectorIndexToUv(int index, ivec2 size)
|
|
{
|
|
int v = index / size.x;
|
|
int u = index - v * size.x;
|
|
return ivec2(u, v);
|
|
}
|
|
|
|
// Drape clamped vector polylines onto the terrain surface. The fragment's
|
|
// tile UV picks a grid cell, then only that cell's line segments (packed in
|
|
// tile-local UV space) are tested for proximity. Within the line width, the
|
|
// vector color is alpha-composited over the terrain (no discard).
|
|
vec4 vectorPolylineRender(vec2 vectorUv, vec4 baseColor)
|
|
{
|
|
// A tile without polylines binds a 1x1 placeholder; a real grid header
|
|
// [gridWidth, gridHeight, ...] is at least 3 texels.
|
|
ivec2 headerSize = textureSize(u_vectorGridCellIndicesTexture, 0);
|
|
if (headerSize.x * headerSize.y < 3)
|
|
{
|
|
return baseColor;
|
|
}
|
|
|
|
// Inverse UV-per-pixel Jacobian: measures line distance in screen pixels so
|
|
// width stays constant under anisotropic (oblique) foreshortening.
|
|
mat2 screenFromUv = inverse(mat2(dFdx(vectorUv), dFdy(vectorUv)));
|
|
int gridWidth = int(texelFetch(u_vectorGridCellIndicesTexture, vectorIndexToUv(0, headerSize), 0).r);
|
|
int gridHeight = int(texelFetch(u_vectorGridCellIndicesTexture, vectorIndexToUv(1, headerSize), 0).r);
|
|
int cellX = clamp(int(vectorUv.x * float(gridWidth)), 0, gridWidth - 1);
|
|
int cellY = clamp(int(vectorUv.y * float(gridHeight)), 0, gridHeight - 1);
|
|
int cellIndex = cellX + cellY * gridWidth;
|
|
|
|
// Cell end offsets follow the two gridWidth/gridHeight texels, so cell
|
|
// N's end is at texel N + 2. A cell's start is the previous cell's end
|
|
// (texel N + 1); cell 0's start is implicitly 0.
|
|
int indexEnd = int(texelFetch(u_vectorGridCellIndicesTexture, vectorIndexToUv(cellIndex + 2, headerSize), 0).r);
|
|
int indexStart = cellIndex == 0
|
|
? 0
|
|
: int(texelFetch(u_vectorGridCellIndicesTexture, vectorIndexToUv(cellIndex + 1, headerSize), 0).r);
|
|
|
|
ivec2 segmentTextureSize = textureSize(u_vectorSegmentTexture, 0);
|
|
ivec2 primitiveTextureSize = textureSize(u_vectorWidthTexture, 0);
|
|
|
|
for (int i = indexStart; i < indexEnd; i++)
|
|
{
|
|
ivec2 segmentUv = vectorIndexToUv(i, segmentTextureSize);
|
|
vec4 segment = texelFetch(u_vectorSegmentTexture, segmentUv, 0);
|
|
|
|
int primitiveIndex = int(texelFetch(u_vectorSegmentPrimitiveIndicesTexture, segmentUv, 0).r);
|
|
ivec2 primitiveUv = vectorIndexToUv(primitiveIndex, primitiveTextureSize);
|
|
|
|
float lineWidth = texelFetch(u_vectorWidthTexture, primitiveUv, 0).r * 255.0;
|
|
|
|
vec2 offsetUv = vectorOffsetToLine(vectorUv, segment);
|
|
if (length(screenFromUv * offsetUv) < lineWidth)
|
|
{
|
|
// Alpha-composite vector over terrain.
|
|
vec4 vectorColor = texelFetch(u_vectorColorTexture, primitiveUv, 0);
|
|
baseColor = vectorColor * vec4(vectorColor.aaa, 1.0) + baseColor * (1.0 - vectorColor.a);
|
|
break;
|
|
}
|
|
}
|
|
|
|
return baseColor;
|
|
}
|
|
|
|
// Composites a polygon's fill over baseColor when the pixel is inside it. A
|
|
// negative index (empty cell or first iteration) or an outside pixel is a
|
|
// no-op.
|
|
vec4 vectorCompositePolygonFill(vec4 baseColor, int primitiveIndex, bool inside, ivec2 primitiveTextureSize)
|
|
{
|
|
if (!inside || primitiveIndex < 0)
|
|
{
|
|
return baseColor;
|
|
}
|
|
|
|
ivec2 primitiveUv = vectorIndexToUv(primitiveIndex, primitiveTextureSize);
|
|
vec4 fillColor = texelFetch(u_vectorColorTexture, primitiveUv, 0);
|
|
return fillColor * vec4(fillColor.aaa, 1.0) + baseColor * (1.0 - fillColor.a);
|
|
}
|
|
|
|
// True if a horizontal +x ray from p crosses the edge. The half-open interval
|
|
// (> vs <=) counts a ray through a shared vertex exactly once.
|
|
bool vectorEdgeCrossesRay(vec4 edge, vec2 p)
|
|
{
|
|
if ((edge.y > p.y) == (edge.w > p.y))
|
|
{
|
|
return false;
|
|
}
|
|
|
|
float t = (p.y - edge.y) / (edge.w - edge.y);
|
|
float xIntersect = edge.x + t * (edge.z - edge.x);
|
|
return p.x < xIntersect;
|
|
}
|
|
|
|
// Drape clamped vector polygon fills onto the terrain surface. The fragment's
|
|
// tile UV picks a grid cell whose edges were clipped to the cell on the CPU,
|
|
// forming closed loops, so an even-odd horizontal ray cast within the cell
|
|
// decides coverage. Edges arrive grouped by primitive; each covering
|
|
// primitive's fill color is alpha-composited in primitive order (no discard).
|
|
vec4 vectorPolygonRender(vec2 vectorUv, vec4 baseColor)
|
|
{
|
|
// A tile without polygons binds a 1x1 placeholder; a real grid header
|
|
// [gridWidth, gridHeight, ...] is at least 3 texels.
|
|
ivec2 headerSize = textureSize(u_vectorPolygonGridCellIndicesTexture, 0);
|
|
if (headerSize.x * headerSize.y < 3)
|
|
{
|
|
return baseColor;
|
|
}
|
|
|
|
int gridWidth = int(texelFetch(u_vectorPolygonGridCellIndicesTexture, vectorIndexToUv(0, headerSize), 0).r);
|
|
int gridHeight = int(texelFetch(u_vectorPolygonGridCellIndicesTexture, vectorIndexToUv(1, headerSize), 0).r);
|
|
int cellX = clamp(int(vectorUv.x * float(gridWidth)), 0, gridWidth - 1);
|
|
int cellY = clamp(int(vectorUv.y * float(gridHeight)), 0, gridHeight - 1);
|
|
int cellIndex = cellX + cellY * gridWidth;
|
|
|
|
// Cell end offsets follow the two gridWidth/gridHeight texels, so cell
|
|
// N's end is at texel N + 2. A cell's start is the previous cell's end
|
|
// (texel N + 1); cell 0's start is implicitly 0.
|
|
int indexEnd = int(texelFetch(u_vectorPolygonGridCellIndicesTexture, vectorIndexToUv(cellIndex + 2, headerSize), 0).r);
|
|
int indexStart = cellIndex == 0
|
|
? 0
|
|
: int(texelFetch(u_vectorPolygonGridCellIndicesTexture, vectorIndexToUv(cellIndex + 1, headerSize), 0).r);
|
|
|
|
ivec2 edgeTextureSize = textureSize(u_vectorPolygonEdgeTexture, 0);
|
|
ivec2 primitiveTextureSize = textureSize(u_vectorColorTexture, 0);
|
|
|
|
int currentPrimitive = -1;
|
|
bool inside = false;
|
|
|
|
for (int i = indexStart; i < indexEnd; i++)
|
|
{
|
|
ivec2 edgeUv = vectorIndexToUv(i, edgeTextureSize);
|
|
vec4 edge = texelFetch(u_vectorPolygonEdgeTexture, edgeUv, 0);
|
|
int primitiveIndex = int(texelFetch(u_vectorPolygonEdgePrimitiveIndicesTexture, edgeUv, 0).r);
|
|
|
|
// A new primitive means the previous group is complete: composite it,
|
|
// then start counting the new one fresh.
|
|
if (primitiveIndex != currentPrimitive)
|
|
{
|
|
baseColor = vectorCompositePolygonFill(baseColor, currentPrimitive, inside, primitiveTextureSize);
|
|
currentPrimitive = primitiveIndex;
|
|
inside = false;
|
|
}
|
|
|
|
if (vectorEdgeCrossesRay(edge, vectorUv))
|
|
{
|
|
inside = !inside;
|
|
}
|
|
}
|
|
|
|
// The last primitive group has no trailing edge to trigger its composite.
|
|
baseColor = vectorCompositePolygonFill(baseColor, currentPrimitive, inside, primitiveTextureSize);
|
|
|
|
return baseColor;
|
|
}
|
|
`;var Ryt=new k;function Oyt(e,t){let n=e.unionClippingRegions,i=e.length,r=va.useFloatTexture(t),o=va.getTextureResolution(e,t,Ryt),a=o.x,s=o.y,c=r?Nyt(a,s):Fyt(a,s);return c+=`
|
|
`,c+=n?Myt(i):Lyt(i),c}function Myt(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix)
|
|
{
|
|
vec4 position = czm_windowToEyeCoordinates(fragCoord);
|
|
vec3 clipNormal = vec3(0.0);
|
|
vec3 clipPosition = vec3(0.0);
|
|
float clipAmount;
|
|
float pixelWidth = czm_metersPerPixel(position);
|
|
bool breakAndDiscard = false;
|
|
for (int i = 0; i < ${e}; ++i)
|
|
{
|
|
vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix);
|
|
clipNormal = clippingPlane.xyz;
|
|
clipPosition = -clippingPlane.w * clipNormal;
|
|
float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth;
|
|
clipAmount = czm_branchFreeTernary(i == 0, amount, min(amount, clipAmount));
|
|
if (amount <= 0.0)
|
|
{
|
|
breakAndDiscard = true;
|
|
// HLSL compiler bug if we discard here: https://bugs.chromium.org/p/angleproject/issues/detail?id=1945#c6
|
|
break;
|
|
}
|
|
}
|
|
if (breakAndDiscard) {
|
|
discard;
|
|
}
|
|
return clipAmount;
|
|
}
|
|
`}function Lyt(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix)
|
|
{
|
|
bool clipped = true;
|
|
vec4 position = czm_windowToEyeCoordinates(fragCoord);
|
|
vec3 clipNormal = vec3(0.0);
|
|
vec3 clipPosition = vec3(0.0);
|
|
float clipAmount = 0.0;
|
|
float pixelWidth = czm_metersPerPixel(position);
|
|
for (int i = 0; i < ${e}; ++i)
|
|
{
|
|
vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix);
|
|
clipNormal = clippingPlane.xyz;
|
|
clipPosition = -clippingPlane.w * clipNormal;
|
|
float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth;
|
|
clipAmount = max(amount, clipAmount);
|
|
clipped = clipped && (amount <= 0.0);
|
|
}
|
|
if (clipped)
|
|
{
|
|
discard;
|
|
}
|
|
return clipAmount;
|
|
}
|
|
`}function Nyt(e,t){let n=1/e,i=1/t,r=`${n}`;r.indexOf(".")===-1&&(r+=".0");let o=`${i}`;return o.indexOf(".")===-1&&(o+=".0"),`vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform)
|
|
{
|
|
int pixY = clippingPlaneNumber / ${e};
|
|
int pixX = clippingPlaneNumber - (pixY * ${e});
|
|
// Sample from center of pixel
|
|
float u = (float(pixX) + 0.5) * ${r};
|
|
float v = (float(pixY) + 0.5) * ${o};
|
|
vec4 plane = texture(packedClippingPlanes, vec2(u, v));
|
|
return czm_transformPlane(plane, transform);
|
|
}
|
|
`}function Fyt(e,t){let n=1/e,i=1/t,r=`${n}`;r.indexOf(".")===-1&&(r+=".0");let o=`${i}`;return o.indexOf(".")===-1&&(o+=".0"),`vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform)
|
|
{
|
|
int clippingPlaneStartIndex = clippingPlaneNumber * 2;
|
|
int pixY = clippingPlaneStartIndex / ${e};
|
|
int pixX = clippingPlaneStartIndex - (pixY * ${e});
|
|
// Sample from center of pixel
|
|
float u = (float(pixX) + 0.5) * ${r};
|
|
float v = (float(pixY) + 0.5) * ${o};
|
|
vec4 oct32 = texture(packedClippingPlanes, vec2(u, v)) * 255.0;
|
|
vec2 oct = vec2(oct32.x * 256.0 + oct32.y, oct32.z * 256.0 + oct32.w);
|
|
vec4 plane;
|
|
plane.xyz = czm_octDecode(oct, 65535.0);
|
|
plane.w = czm_unpackFloat(texture(packedClippingPlanes, vec2(u + ${r}, v)));
|
|
return czm_transformPlane(plane, transform);
|
|
}
|
|
`}var _S=Oyt;var YQ=class{constructor(t,n,i,r,o,a){this.numberOfDayTextures=t,this.flags=n,this.material=i,this.shaderProgram=r,this.clippingShaderState=o,this.clippingPolygonShaderState=a}},XQ=class{constructor(){this.baseVertexShaderSource=void 0,this.baseFragmentShaderSource=void 0,this._shadersByTexturesFlags=[],this.material=void 0}getShaderProgram(t){let n=t.frameState,i=t.surfaceTile,r=t.numberOfDayTextures,o=t.applyBrightness,a=t.applyContrast,s=t.applyHue,c=t.applySaturation,u=t.applyGamma,f=t.applyAlpha,d=t.applyDayNightAlpha,p=t.applySplit,g=t.hasWaterMask,m=t.showReflectiveOcean,y=t.showOceanWaves,A=t.enableLighting,b=t.dynamicAtmosphereLighting,x=t.dynamicAtmosphereLightingFromSun,T=t.showGroundAtmosphere,C=t.perFragmentGroundAtmosphere,E=t.hasVertexNormals,w=t.useWebMercatorProjection,D=t.enableFog,R=t.enableClippingPlanes,M=t.clippingPlanes,N=t.enableClippingPolygons,_=t.clippingPolygons,v=t.clippedByBoundaries,S=t.hasImageryLayerCutout,P=t.colorCorrect,L=t.highlightFillTile,F=t.colorToAlpha,V=t.hasGeodeticSurfaceNormals,z=t.hasExaggeration,j=t.showUndergroundColor,B=t.translucent,W=i.vectorData?.show,Q=0,q="",Z=i.renderedMesh.encoding;Z.quantization===js.BITS12&&(Q=1,q="QUANTIZATION_BITS12");let Ae=0,le="";v&&(Ae=1,le="TILE_LIMIT_RECTANGLE");let Ce=0,ye="";S&&(Ce=1,ye="APPLY_IMAGERY_CUTOUT");let ve=n.mode,Ie=((ve|+o<<2|+a<<3|+s<<4|+c<<5|+u<<6|+f<<7|+g<<8|+m<<9|+y<<10|+A<<11|+b<<12|+x<<13|+T<<14|+C<<15|+E<<16|+w<<17|+D<<18|Q<<19|+p<<20|+R<<21|+N<<22|Ae<<23|Ce<<24|+P<<25|+L<<26|+F<<27|+V<<28|+z<<29|+j<<30|+B<<31)>>>0)+(d?4294967296:0)+(W?8589934592:0),Le=0;l(M)&&M.length>0&&(Le=R?M.clippingPlanesState:0);let $e=0;l(_)&&_.length>0&&($e=N?_.clippingPolygonsState:0);let Ye=i.surfaceShader;if(l(Ye)&&Ye.numberOfDayTextures===r&&Ye.flags===Ie&&Ye.material===this.material&&Ye.clippingShaderState===Le&&Ye.clippingPolygonShaderState===$e)return Ye.shaderProgram;let yt=this._shadersByTexturesFlags[r];if(l(yt)||(yt=this._shadersByTexturesFlags[r]=[]),Ye=yt[Ie],!l(Ye)||Ye.material!==this.material||Ye.clippingShaderState!==Le||Ye.clippingPolygonShaderState!==$e){let Ke=this.baseVertexShaderSource.clone(),we=this.baseFragmentShaderSource.clone();Le!==0&&we.sources.unshift(_S(M,n.context)),$e!==0&&(we.sources.unshift(kyt(n.context)),Ke.sources.unshift(zyt(n.context))),Ke.defines.push(q),we.defines.push(`TEXTURE_UNITS ${r}`,le,ye),o&&we.defines.push("APPLY_BRIGHTNESS"),a&&we.defines.push("APPLY_CONTRAST"),s&&we.defines.push("APPLY_HUE"),c&&we.defines.push("APPLY_SATURATION"),u&&we.defines.push("APPLY_GAMMA"),f&&we.defines.push("APPLY_ALPHA"),d&&we.defines.push("APPLY_DAY_NIGHT_ALPHA"),g&&we.defines.push("HAS_WATER_MASK"),m&&(we.defines.push("SHOW_REFLECTIVE_OCEAN"),Ke.defines.push("SHOW_REFLECTIVE_OCEAN")),y&&we.defines.push("SHOW_OCEAN_WAVES"),F&&we.defines.push("APPLY_COLOR_TO_ALPHA"),j&&(Ke.defines.push("UNDERGROUND_COLOR"),we.defines.push("UNDERGROUND_COLOR")),B&&(Ke.defines.push("TRANSLUCENT"),we.defines.push("TRANSLUCENT")),A&&(E?(Ke.defines.push("ENABLE_VERTEX_LIGHTING"),we.defines.push("ENABLE_VERTEX_LIGHTING")):(Ke.defines.push("ENABLE_DAYNIGHT_SHADING"),we.defines.push("ENABLE_DAYNIGHT_SHADING"))),b&&(Ke.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),we.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),x&&(Ke.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"),we.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"))),T&&(Ke.defines.push("GROUND_ATMOSPHERE"),we.defines.push("GROUND_ATMOSPHERE"),C&&(Ke.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"),we.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"))),Ke.defines.push("INCLUDE_WEB_MERCATOR_Y"),we.defines.push("INCLUDE_WEB_MERCATOR_Y"),D&&(Ke.defines.push("FOG"),we.defines.push("FOG")),p&&we.defines.push("APPLY_SPLIT"),R&&we.defines.push("ENABLE_CLIPPING_PLANES"),N&&(we.defines.push("ENABLE_CLIPPING_POLYGONS"),Ke.defines.push("ENABLE_CLIPPING_POLYGONS"),_.inverse&&we.defines.push("CLIPPING_INVERSE"),we.defines.push(`CLIPPING_POLYGON_REGIONS_LENGTH ${_.extentsCount}`),Ke.defines.push(`CLIPPING_POLYGON_REGIONS_LENGTH ${_.extentsCount}`)),P&&we.defines.push("COLOR_CORRECT"),L&&we.defines.push("HIGHLIGHT_FILL_TILE"),V&&Ke.defines.push("GEODETIC_SURFACE_NORMALS"),z&&Ke.defines.push("EXAGGERATION"),W&&(Ke.defines.push("HAS_VECTOR_LAYER"),we.defines.push("HAS_VECTOR_LAYER"),we.sources.unshift(I8));let We=` vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend)
|
|
{
|
|
vec4 color = initialColor;
|
|
`;S&&(We+=` vec4 cutoutAndColorResult;
|
|
bool texelUnclipped;
|
|
`);for(let ct=0;ct<r;++ct)S?We+=` cutoutAndColorResult = u_dayTextureCutoutRectangles[${ct}];
|
|
texelUnclipped = v_textureCoordinates.x < cutoutAndColorResult.x || cutoutAndColorResult.z < v_textureCoordinates.x || v_textureCoordinates.y < cutoutAndColorResult.y || cutoutAndColorResult.w < v_textureCoordinates.y;
|
|
cutoutAndColorResult = sampleAndBlend(
|
|
`:We+=` color = sampleAndBlend(
|
|
`,We+=` color,
|
|
u_dayTextures[${ct}],
|
|
u_dayTextureUseWebMercatorT[${ct}] ? textureCoordinates.xz : textureCoordinates.xy,
|
|
u_dayTextureTexCoordsRectangle[${ct}],
|
|
u_dayTextureTranslationAndScale[${ct}],
|
|
${f?`u_dayTextureAlpha[${ct}]`:"1.0"},
|
|
${d?`u_dayTextureNightAlpha[${ct}]`:"1.0"},
|
|
${d?`u_dayTextureDayAlpha[${ct}]`:"1.0"},
|
|
${o?`u_dayTextureBrightness[${ct}]`:"0.0"},
|
|
${a?`u_dayTextureContrast[${ct}]`:"0.0"},
|
|
${s?`u_dayTextureHue[${ct}]`:"0.0"},
|
|
${c?`u_dayTextureSaturation[${ct}]`:"0.0"},
|
|
${u?`u_dayTextureOneOverGamma[${ct}]`:"0.0"},
|
|
${p?`u_dayTextureSplit[${ct}]`:"0.0"},
|
|
${F?`u_colorsToAlpha[${ct}]`:"vec4(0.0)"},
|
|
nightBlend);
|
|
`,S&&(We+=` color = czm_branchFreeTernary(texelUnclipped, cutoutAndColorResult, color);
|
|
`);We+=` return color;
|
|
}`,we.sources.push(We),Ke.sources.push(Byt(ve)),Ke.sources.push(Uyt(w));let Ct=Zt.fromCache({context:n.context,vertexShaderSource:Ke,fragmentShaderSource:we,attributeLocations:Z.getAttributeLocations()});Ye=yt[Ie]=new YQ(r,Ie,this.material,Ct,Le,$e)}return i.surfaceShader=Ye,Ye.shaderProgram}destroy(){let t,n,i=this._shadersByTexturesFlags;for(let r in i)if(i.hasOwnProperty(r)){let o=i[r];if(!l(o))continue;for(t in o)o.hasOwnProperty(t)&&(n=o[t],l(n)&&n.shaderProgram.destroy())}return ue(this)}};function Byt(e){let t="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPosition3DMode(position, height, textureCoordinates); }",n="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionColumbusViewMode(position, height, textureCoordinates); }",i="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionMorphingMode(position, height, textureCoordinates); }",r;switch(e){case re.SCENE3D:r=t;break;case re.SCENE2D:case re.COLUMBUS_VIEW:r=n;break;case re.MORPHING:r=i;break}return r}function kyt(e){return e.webgl2?`void clipPolygons(highp sampler2D clippingDistance, int regionsLength, vec2 clippingPosition, int regionIndex) {
|
|
czm_clipPolygons(clippingDistance, regionsLength, clippingPosition, regionIndex);
|
|
}`:`void clipPolygons(highp sampler2D clippingDistance, int regionsLength, vec2 clippingPosition, int regionIndex) {
|
|
}`}function zyt(e){return e.webgl2?`vec4 unpackClippingExtents(highp sampler2D extentsTexture, int index) {
|
|
return czm_unpackClippingExtents(extentsTexture, index);
|
|
}`:`vec4 unpackClippingExtents(highp sampler2D extentsTexture, int index) {
|
|
return vec4();
|
|
}`}function Uyt(e){return e?"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }":"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }"}var P8=XQ;var gve={START:0,LOADING:1,DONE:2,FAILED:3};Object.freeze(gve);var rc=gve;var _ve={FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6};Object.freeze(_ve);var Or=_ve;var Rp=class e{constructor(){at(this,"request");this.imagery=[],this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new ae(0,0,1,1),this.terrainData=void 0,this.vectorData=void 0,this.vertexArray=void 0,this.tileBoundingRegion=void 0,this.occludeePointInScaledSpace=new h,this.boundingVolumeSourceTile=void 0,this.boundingVolumeIsFromMesh=!1,this.terrainState=Or.UNLOADED,this.mesh=void 0,this.fill=void 0,this.pickBoundingSphere=new se,this.surfaceShader=void 0,this.isClipped=!0,this.clippedByBoundaries=!1}get eligibleForUnloading(){let t=this.terrainState,i=!(t===Or.RECEIVING||t===Or.TRANSFORMING),r=this.imagery;for(let o=0,a=r.length;i&&o<a;++o){let s=r[o];i=!l(s.loadingImagery)||s.loadingImagery.state!==jn.TRANSITIONING}return i}get renderedMesh(){if(l(this.vertexArray))return this.mesh;if(l(this.fill))return this.fill.mesh}pick(t,n,i,r,o){if(!l(this.renderedMesh))return;let a=this.renderedMesh.pick(t,r,n,i);return h.clone(a,o)}freeResources(){l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0),l(this.vectorData)&&(Tl.freeResources(this.vectorData),this.vectorData=void 0),this.terrainData=void 0,this.terrainState=Or.UNLOADED,this.mesh=void 0,this.fill=this.fill&&this.fill.destroy();let t=this.imagery;for(let n=0,i=t.length;n<i;++n)t[n].freeResources();this.imagery.length=0,this.freeVertexArray()}freeVertexArray(){e._freeVertexArray(this.vertexArray),this.vertexArray=void 0,e._freeVertexArray(this.wireframeVertexArray),this.wireframeVertexArray=void 0}static initialize(t,n,i,r){l(t.data)||(t.data=new e),t.state===rc.START&&(Vyt(t,n,i,r),t.state=rc.LOADING)}static processStateMachine(t,n,i,r,o,a,s,c){e.initialize(t,i,r,o);let u=t.data;if(t.state===rc.LOADING&&jyt(t,n,i,r,o,a,s),c)return;let f=t.renderable;t.renderable=l(u.vertexArray);let d=u.terrainState===Or.READY;t.upsampledFromParent=l(u.terrainData)&&u.terrainData.wasCreatedByUpsampling();let p=u.processImagery(t,i,n);if(d&&p){let g=t._loadedCallbacks,m={};for(let y in g)g.hasOwnProperty(y)&&(g[y](t)||(m[y]=g[y]));t._loadedCallbacks=m,t.state=rc.DONE}f&&(t.renderable=!0)}processImagery(t,n,i,r){let o=t.data,a=t.upsampledFromParent,s=!1,c=!0,u=o.imagery,f,d;for(f=0,d=u.length;f<d;++f){let p=u[f];if(!l(p.loadingImagery)){a=!1;continue}if(p.loadingImagery.state===jn.PLACEHOLDER){let m=p.loadingImagery.imageryLayer;if(m.ready){p.freeResources(),u.splice(f,1),m._createTileImagerySkeletons(t,n,f),--f,d=u.length;continue}else a=!1}let g=p.processStateMachine(t,i,r);c=c&&g,s=s||g||l(p.readyImagery),a=a&&l(p.loadingImagery)&&(p.loadingImagery.state===jn.FAILED||p.loadingImagery.state===jn.INVALID)}return t.upsampledFromParent=a,t.renderable=t.renderable&&(s||c),c}addGeodeticSurfaceNormals(t,n){yve(this,!0,t,n)}removeGeodeticSurfaceNormals(t){yve(this,!1,void 0,t)}updateExaggeration(t,n,i){let r=this,o=r.renderedMesh;if(o===void 0)return;let a=n.verticalExaggeration,s=n.verticalExaggerationRelativeHeight,c=a!==1,u=o.encoding,f=u.exaggeration!==a,d=u.exaggerationRelativeHeight!==s;if(f||d){if(f)if(c&&!u.hasGeodeticSurfaceNormals){let g=t.tilingScheme.ellipsoid;r.addGeodeticSurfaceNormals(g,n)}else!c&&u.hasGeodeticSurfaceNormals&&r.removeGeodeticSurfaceNormals(n);if(u.exaggeration=a,u.exaggerationRelativeHeight=s,i!==void 0){i._tileToUpdateHeights.push(t);let g=t.customData;for(let m of g)m.level=-1}o.updateExaggeration(a,s)}}updateSceneMode(t){let i=this.renderedMesh;i!==void 0&&i.updateSceneMode(t)}static _createVertexArrayForMesh(t,n){let i=n.vertices,r=Ze.createVertexBuffer({context:t,typedArray:i,usage:Oe.STATIC_DRAW}),o=n.encoding.getAttributes(r),a=n.indices.indexBuffers||{},s=a[t.id];if(!l(s)||s.isDestroyed()){let c=n.indices;s=Ze.createIndexBuffer({context:t,typedArray:c,usage:Oe.STATIC_DRAW,indexDatatype:Ve.fromSizeInBytes(c.BYTES_PER_ELEMENT)}),s.vertexArrayDestroyable=!1,s.referenceCount=1,a[t.id]=s,n.indices.indexBuffers=a}else++s.referenceCount;return new Vn({context:t,attributes:o,indexBuffer:s})}static _freeVertexArray(t){if(l(t)){let n=t.indexBuffer;t.isDestroyed()||t.destroy(),l(n)&&!n.isDestroyed()&&l(n.referenceCount)&&(--n.referenceCount,n.referenceCount===0&&n.destroy())}}_findAncestorTileWithTerrainData(t){let n=t.parent;for(;l(n)&&(!l(n.data)||!l(n.data.terrainData)||n.data.terrainData.wasCreatedByUpsampling());)n=n.parent;return n}_computeWaterMaskTranslationAndScale(t,n,i){let r=n.rectangle,o=t.rectangle,a=o.width,s=o.height,c=a/r.width,u=s/r.height;return i.x=c*(o.west-r.west)/a,i.y=u*(o.south-r.south)/s,i.z=c,i.w=u,i}};function yve(e,t,n,i){let r=e.renderedMesh,o=r.vertices,a=r.encoding,s=o.length/a.stride,c=po.clone(a);c.hasGeodeticSurfaceNormals=t,c=po.clone(c);let u=c.stride,f=new Float32Array(s*u);t?a.addGeodeticSurfaceNormals(o,f,n):a.removeGeodeticSurfaceNormals(o,f),r.vertices=f,r.stride=u,r!==e.mesh?(Rp._freeVertexArray(e.fill.vertexArray),e.fill.vertexArray=Rp._createVertexArrayForMesh(i.context,r)):(Rp._freeVertexArray(e.vertexArray),e.vertexArray=Rp._createVertexArrayForMesh(i.context,r)),Rp._freeVertexArray(e.wireframeVertexArray),e.wireframeVertexArray=void 0}function Vyt(e,t,n,i){let r=t.getTileDataAvailable(e.x,e.y,e.level);if(!l(r)&&l(e.parent)){let a=e.parent,s=a.data;l(s)&&l(s.terrainData)&&(r=s.terrainData.isChildAvailable(a.x,a.y,e.x,e.y))}let o=e.data;r===!1&&(o.terrainState=Or.FAILED);for(let a=0,s=i.length;a<s;++a){let c=i.get(a);c.show&&c._createTileImagerySkeletons(e,t)}}function jyt(e,t,n,i,r,o,a){let s=e.data,c=e.parent;if(s.terrainState===Or.FAILED&&c!==void 0){let u=c.data;u!==void 0&&u.terrainData!==void 0&&u.terrainData.canUpsample!==!1||Rp.processStateMachine(c,t,n,i,r,o,a,!0)}if(s.terrainState===Or.FAILED&&Hyt(s,e,t,n,e.x,e.y,e.level),s.terrainState===Or.UNLOADED&&Gyt(s,n,e.x,e.y,e.level),s.terrainState===Or.RECEIVED&&qyt(s,t,n,e.x,e.y,e.level),s.terrainState===Or.TRANSFORMED&&(Yyt(s,t.context,n,e.x,e.y,e.level,a),s.updateExaggeration(e,t,o)),s.terrainState>=Or.RECEIVED&&s.waterMaskTexture===void 0&&n.hasWaterMask)if(s.terrainData.waterMask!==void 0)Kyt(t.context,s);else{let f=s._findAncestorTileWithTerrainData(e),d=f?.data;l(f)&&l(d.waterMaskTexture)&&(s.waterMaskTexture=d.waterMaskTexture,++s.waterMaskTexture.referenceCount,s._computeWaterMaskTranslationAndScale(e,f,s.waterMaskTranslationAndScale))}}function Hyt(e,t,n,i,r,o,a){let s=t.parent;if(!s){t.state=rc.FAILED;return}let u=s.data.terrainData,f=s.x,d=s.y,p=s.level;if(!l(u))return;let g=u.upsample(i.tilingScheme,f,d,p,r,o,a);l(g)&&(e.terrainState=Or.RECEIVING,Promise.resolve(g).then(function(m){l(m)&&(e.terrainData=m,e.terrainState=Or.RECEIVED)}).catch(function(){e.terrainState=Or.FAILED}))}function Gyt(e,t,n,i,r){function o(c){if(!l(c)){e.terrainState=Or.UNLOADED,e.request=void 0;return}e.terrainData=c,e.terrainState=Or.RECEIVED,e.request=void 0}function a(c){if(e.request.state===Ti.CANCELLED){e.terrainData=void 0,e.terrainState=Or.UNLOADED,e.request=void 0;return}e.terrainState=Or.FAILED,e.request=void 0;let u=`Failed to obtain terrain tile X: ${n} Y: ${i} Level: ${r}. Error message: "${c}"`;t._requestError=qr.reportError(t._requestError,t,t.errorEvent,u,n,i,r),t._requestError.retry&&s()}function s(){let c=new Eo({throttle:!1,throttleByServer:!0,type:Za.TERRAIN});e.request=c;let u=t.requestTileGeometry(n,i,r,c);l(u)?(e.terrainState=Or.RECEIVING,Promise.resolve(u).then(function(f){o(f)}).catch(function(f){a(f)})):(e.terrainState=Or.UNLOADED,e.request=void 0)}s()}var Wyt={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0,throttle:!0};function qyt(e,t,n,i,r,o){let a=n.tilingScheme,s=Wyt;s.tilingScheme=a,s.x=i,s.y=r,s.level=o,s.exaggeration=t.verticalExaggeration,s.exaggerationRelativeHeight=t.verticalExaggerationRelativeHeight,s.throttle=!0;let u=e.terrainData.createMesh(s);l(u)&&(e.terrainState=Or.TRANSFORMING,Promise.resolve(u).then(function(f){e.mesh=f,e.terrainState=Or.TRANSFORMED}).catch(function(){e.terrainState=Or.FAILED}))}function Yyt(e,t,n,i,r,o,a){e.vertexArray=Rp._createVertexArrayForMesh(t,e.mesh),e.terrainState=Or.READY,e.fill=e.fill&&e.fill.destroy(a)}function Xyt(e){let t=e.cache.tile_waterMaskData;if(!l(t)){let n=Et.create({context:e,pixelFormat:He.LUMINANCE,pixelDatatype:ke.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}});n.referenceCount=1;let i=new Ut({wrapS:on.CLAMP_TO_EDGE,wrapT:on.CLAMP_TO_EDGE,minificationFilter:Gt.LINEAR,magnificationFilter:ni.LINEAR});t={allWaterTexture:n,sampler:i,destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function Kyt(e,t){let n=t.terrainData.waterMask,i=Xyt(e),r,o=n.length;if(n instanceof ImageBitmap)r=Et.create({context:e,source:n,sampler:i.sampler,flipY:!1,skipColorSpaceConversion:!0});else if(o===1)if(n[0]!==0)r=i.allWaterTexture;else return;else{let a=Math.sqrt(o);r=Et.create({context:e,pixelFormat:He.LUMINANCE,pixelDatatype:ke.UNSIGNED_BYTE,source:{width:a,height:a,arrayBufferView:n},sampler:i.sampler,flipY:!1}),r.referenceCount=0}++r.referenceCount,t.waterMaskTexture=r,ae.fromElements(0,0,1,1,t.waterMaskTranslationAndScale)}var $h=Rp;var Ave={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>=Ave.RENDERED_AND_KICKED},originalResult:function(e){return e&3},kick:function(e){return e|4}},fi=Ave;function AS(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 ae}AS.prototype.update=function(e,t,n){this.changedThisFrame&&(Sve(e,t,this.tile,n),this.changedThisFrame=!1)};AS.prototype.destroy=function(e){this._destroyVertexArray(e),l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0)};AS.prototype._destroyVertexArray=function(e){l(this.vertexArray)&&(l(e)?e.push(this.vertexArray):$h._freeVertexArray(this.vertexArray),this.vertexArray=void 0)};var $yt=new fb;AS.updateFillTiles=function(e,t,n,i){let r=e._quadtree,o=r._levelZeroTiles,a=r._lastSelectionFrameNumber,s=$yt;s.clear();for(let u=0;u<t.length;++u){let f=t[u];l(f.data.vertexArray)&&s.enqueue(t[u])}let c=s.dequeue();for(;c!==void 0;){let u=c.findTileToWest(o),f=c.findTileToSouth(o),d=c.findTileToEast(o),p=c.findTileToNorth(o);ps(e,n,c,u,a,Pn.EAST,!1,s,i),ps(e,n,c,f,a,Pn.NORTH,!1,s,i),ps(e,n,c,d,a,Pn.WEST,!1,s,i),ps(e,n,c,p,a,Pn.SOUTH,!1,s,i);let g=u.findTileToNorth(o),m=u.findTileToSouth(o),y=d.findTileToNorth(o),A=d.findTileToSouth(o);ps(e,n,c,g,a,Pn.SOUTHEAST,!1,s,i),ps(e,n,c,y,a,Pn.SOUTHWEST,!1,s,i),ps(e,n,c,m,a,Pn.NORTHEAST,!1,s,i),ps(e,n,c,A,a,Pn.NORTHWEST,!1,s,i),c=s.dequeue()}};function ps(e,t,n,i,r,o,a,s,c){if(i===void 0)return;let u=i;for(;u&&(u._lastSelectionResultFrame!==r||fi.wasKicked(u._lastSelectionResult)||fi.originalResult(u._lastSelectionResult)===fi.CULLED);){if(a)return;let f=u.parent;if(o>=Pn.NORTHWEST&&f!==void 0)switch(o){case Pn.NORTHWEST:u=u===f.northwestChild?f:void 0;break;case Pn.NORTHEAST:u=u===f.northeastChild?f:void 0;break;case Pn.SOUTHWEST:u=u===f.southwestChild?f:void 0;break;case Pn.SOUTHEAST:u=u===f.southeastChild?f:void 0;break}else u=f}if(u!==void 0){if(u._lastSelectionResult===fi.RENDERED){if(l(u.data.vertexArray))return;Jyt(e,t,n,u,o,r,s,c);return}if(fi.originalResult(i._lastSelectionResult)!==fi.CULLED)switch(o){case Pn.WEST:ps(e,t,n,i.northwestChild,r,o,!0,s,c),ps(e,t,n,i.southwestChild,r,o,!0,s,c);break;case Pn.EAST:ps(e,t,n,i.southeastChild,r,o,!0,s,c),ps(e,t,n,i.northeastChild,r,o,!0,s,c);break;case Pn.SOUTH:ps(e,t,n,i.southwestChild,r,o,!0,s,c),ps(e,t,n,i.southeastChild,r,o,!0,s,c);break;case Pn.NORTH:ps(e,t,n,i.northeastChild,r,o,!0,s,c),ps(e,t,n,i.northwestChild,r,o,!0,s,c);break;case Pn.NORTHWEST:ps(e,t,n,i.northwestChild,r,o,!0,s,c);break;case Pn.NORTHEAST:ps(e,t,n,i.northeastChild,r,o,!0,s,c);break;case Pn.SOUTHWEST:ps(e,t,n,i.southwestChild,r,o,!0,s,c);break;case Pn.SOUTHEAST:ps(e,t,n,i.southeastChild,r,o,!0,s,c);break;default:throw new pe("Invalid edge")}}}function Jyt(e,t,n,i,r,o,a,s){let c=i.data;if(c.fill===void 0)c.fill=new AS(i);else if(c.fill.visitedFrame===o)return;c.fill.enqueuedFrame!==o&&(c.fill.enqueuedFrame=o,c.fill.changedThisFrame=!1,a.enqueue(i)),Zyt(e,t,n,i,r,s)}function Zyt(e,t,n,i,r,o){let a=i.data.fill,s,c=n.data.fill;l(c)?(c.visitedFrame=t.frameNumber,c.changedThisFrame&&(Sve(e,t,n,o),c.changedThisFrame=!1),s=n.data.fill.mesh):s=n.data.mesh;let u,f;switch(r){case Pn.WEST:u=a.westMeshes,f=a.westTiles;break;case Pn.SOUTH:u=a.southMeshes,f=a.southTiles;break;case Pn.EAST:u=a.eastMeshes,f=a.eastTiles;break;case Pn.NORTH:u=a.northMeshes,f=a.northTiles;break;case Pn.NORTHWEST:a.changedThisFrame=a.changedThisFrame||a.northwestMesh!==s,a.northwestMesh=s,a.northwestTile=n;return;case Pn.NORTHEAST:a.changedThisFrame=a.changedThisFrame||a.northeastMesh!==s,a.northeastMesh=s,a.northeastTile=n;return;case Pn.SOUTHWEST:a.changedThisFrame=a.changedThisFrame||a.southwestMesh!==s,a.southwestMesh=s,a.southwestTile=n;return;case Pn.SOUTHEAST:a.changedThisFrame=a.changedThisFrame||a.southeastMesh!==s,a.southeastMesh=s,a.southeastTile=n;return}if(n.level<=i.level){a.changedThisFrame=a.changedThisFrame||u[0]!==s||u.length!==1,u[0]=s,f[0]=n,u.length=1,f.length=1;return}let d,p,g,m,y=n.rectangle,A,b=i.rectangle;switch(r){case Pn.WEST:for(A=(b.north-b.south)*I.EPSILON5,d=0;d<f.length&&(g=f[d],m=g.rectangle,!I.greaterThan(y.north,m.south,A));++d);for(p=d;p<f.length&&(g=f[p],m=g.rectangle,!I.greaterThanOrEquals(y.south,m.north,A));++p);break;case Pn.SOUTH:for(A=(b.east-b.west)*I.EPSILON5,d=0;d<f.length&&(g=f[d],m=g.rectangle,!I.lessThan(y.west,m.east,A));++d);for(p=d;p<f.length&&(g=f[p],m=g.rectangle,!I.lessThanOrEquals(y.east,m.west,A));++p);break;case Pn.EAST:for(A=(b.north-b.south)*I.EPSILON5,d=0;d<f.length&&(g=f[d],m=g.rectangle,!I.lessThan(y.south,m.north,A));++d);for(p=d;p<f.length&&(g=f[p],m=g.rectangle,!I.lessThanOrEquals(y.north,m.south,A));++p);break;case Pn.NORTH:for(A=(b.east-b.west)*I.EPSILON5,d=0;d<f.length&&(g=f[d],m=g.rectangle,!I.greaterThan(y.east,m.west,A));++d);for(p=d;p<f.length&&(g=f[p],m=g.rectangle,!I.greaterThanOrEquals(y.west,m.east,A));++p);break}p-d===1?(a.changedThisFrame=a.changedThisFrame||u[d]!==s,u[d]=s,f[d]=n):(a.changedThisFrame=!0,u.splice(d,p-d,s),f.splice(d,p-d,n))}var Ix=new de,Qyt=new de,yS=new h,ZQ=new h,KQ=new k,$Q=new k,gf=new k;function F8(){this.height=0,this.encodedNormal=new k}function D8(e,t,n,i,r,o,a,s,c){if(l(r))return r;let u;if(l(o)&&l(a))u=(o.height+a.height)*.5;else if(l(o))u=o.height;else if(l(a))u=a.height;else if(l(s))u=s.height;else{let d=e.tile.data.tileBoundingRegion,p=0,g=0;l(d)&&(p=d.minimumHeight,g=d.maximumHeight),u=(p+g)*.5}return wve(e,t,n,i,u,c),c}var eAt={minimumHeight:0,maximumHeight:0},tAt=new h,bve=new F8,xve=new F8,Tve=new F8,Cve=new F8,nAt=typeof Uint8Array<"u"?new Uint8Array(81):void 0,iAt={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0};function Sve(e,t,n,i){$h.initialize(n,e.terrainProvider,e.vectorProvider,e._imageryLayers);let r=n.data,o=r.fill,a=n.rectangle,s=t.verticalExaggeration,c=t.verticalExaggerationRelativeHeight,u=s!==1,f=n.tilingScheme.ellipsoid,d=O8(o,f,0,1,o.northwestTile,o.northwestMesh,o.northTiles,o.northMeshes,o.westTiles,o.westMeshes,Tve),p=O8(o,f,0,0,o.southwestTile,o.southwestMesh,o.westTiles,o.westMeshes,o.southTiles,o.southMeshes,bve),g=O8(o,f,1,0,o.southeastTile,o.southeastMesh,o.southTiles,o.southMeshes,o.eastTiles,o.eastMeshes,xve),m=O8(o,f,1,1,o.northeastTile,o.northeastMesh,o.eastTiles,o.eastMeshes,o.northTiles,o.northMeshes,Cve);d=D8(o,f,0,1,d,p,m,g,Tve),p=D8(o,f,0,0,p,d,g,m,bve),g=D8(o,f,1,1,g,p,m,d,xve),m=D8(o,f,1,1,m,g,d,p,Cve);let y=p.height,A=g.height,b=d.height,x=m.height,T=Math.min(y,A,b,x),C=Math.max(y,A,b,x),E=(T+C)*.5,w,D,R=e.getLevelMaximumGeometricError(n.level),M=f.maximumRadius-R,N=Math.acos(M/f.maximumRadius)*4;if(N*=1.5,a.width>N&&C-T<=R){let S=new Lc({width:9,height:9,buffer:nAt,structure:{heightOffset:C}}),P=iAt;P.tilingScheme=n.tilingScheme,P.x=n.x,P.y=n.y,P.level=n.level,P.exaggeration=s,P.exaggerationRelativeHeight=c,o.mesh=S._createMeshSync(P)}else{let S=u,P=ie.center(a,Qyt);P.height=E;let L=f.cartographicToCartesian(P,tAt),F=new po(L,void 0,void 0,void 0,void 0,!0,!0,S,s,c),V=5,z;for(z=o.westMeshes,w=0,D=z.length;w<D;++w)V+=z[w].eastIndicesNorthToSouth.length;for(z=o.southMeshes,w=0,D=z.length;w<D;++w)V+=z[w].northIndicesWestToEast.length;for(z=o.eastMeshes,w=0,D=z.length;w<D;++w)V+=z[w].westIndicesSouthToNorth.length;for(z=o.northMeshes,w=0,D=z.length;w<D;++w)V+=z[w].southIndicesEastToWest.length;let j=eAt;j.minimumHeight=T,j.maximumHeight=C;let B=F.stride,G=new Float32Array(V*B),W=0,Q=W;W=R8(f,a,F,G,W,0,1,d.height,d.encodedNormal,1,j),W=L8(o,f,F,G,W,o.westTiles,o.westMeshes,Pn.EAST,j);let q=W;W=R8(f,a,F,G,W,0,0,p.height,p.encodedNormal,0,j),W=L8(o,f,F,G,W,o.southTiles,o.southMeshes,Pn.NORTH,j);let J=W;W=R8(f,a,F,G,W,1,0,g.height,g.encodedNormal,0,j),W=L8(o,f,F,G,W,o.eastTiles,o.eastMeshes,Pn.WEST,j);let Z=W;W=R8(f,a,F,G,W,1,1,m.height,m.encodedNormal,1,j),W=L8(o,f,F,G,W,o.northTiles,o.northMeshes,Pn.SOUTH,j),T=j.minimumHeight,C=j.maximumHeight;let ce=Jt.fromRectangle(a,T,C,n.tilingScheme.ellipsoid),Ae=_i.geodeticLatitudeToMercatorAngle(a.south),le=1/(_i.geodeticLatitudeToMercatorAngle(a.north)-Ae),Ce=(_i.geodeticLatitudeToMercatorAngle(P.latitude)-Ae)*le,ye=f.geodeticSurfaceNormalCartographic(Ix,ZQ),ve=an.octEncode(ye,KQ),Ie=W;F.encode(G,W*B,ce.center,k.fromElements(.5,.5,gf),E,ve,Ce,ye),++W;let Le=W,$e=Le<256?1:2,Ye=(Le-1)*3,yt=Ye*$e,Ke=(G.length-Le*B)*Float32Array.BYTES_PER_ELEMENT,we;if(Ke>=yt){let bt=Le*B*Float32Array.BYTES_PER_ELEMENT;we=Le<256?new Uint8Array(G.buffer,bt,Ye):new Uint16Array(G.buffer,bt,Ye)}else we=Le<256?new Uint8Array(Ye):new Uint16Array(Ye);G=new Float32Array(G.buffer,0,Le*B);let We=0;for(w=0;w<Le-2;++w)we[We++]=Ie,we[We++]=w,we[We++]=w+1;we[We++]=Ie,we[We++]=w,we[We]=0;let Ct=[];for(w=q;w>=Q;--w)Ct.push(w);let ct=[];for(w=J;w>=q;--w)ct.push(w);let dn=[];for(w=Z;w>=J;--w)dn.push(w);let Ht=[];for(Ht.push(0),w=Ie-1;w>=Z;--w)Ht.push(w);o.mesh=new mc(F.center,G,we,Ye,Le,T,C,a,se.fromOrientedBoundingBox(ce),uAt(e,ce.center,a,T,C),F.stride,ce,F,Ct,ct,dn,Ht)}let _=t.context;o._destroyVertexArray(i),o.vertexArray=$h._createVertexArrayForMesh(_,o.mesh),r.processImagery(n,e.terrainProvider,t,!0);let v=o.waterMaskTexture;if(o.waterMaskTexture=void 0,e.terrainProvider.hasWaterMask){let S=r._findAncestorTileWithTerrainData(n);l(S)&&l(S.data.waterMaskTexture)&&(o.waterMaskTexture=S.data.waterMaskTexture,++o.waterMaskTexture.referenceCount,r._computeWaterMaskTranslationAndScale(n,S,o.waterMaskTranslationAndScale))}l(v)&&(--v.referenceCount,v.referenceCount===0&&v.destroy())}function R8(e,t,n,i,r,o,a,s,c,u,f){let d=Ix;d.longitude=I.lerp(t.west,t.east,o),d.latitude=I.lerp(t.south,t.north,a),d.height=s;let p=e.cartographicToCartesian(d,yS),g;n.hasGeodeticSurfaceNormals&&(g=e.geodeticSurfaceNormal(p,ZQ));let m=$Q;return m.x=o,m.y=a,n.encode(i,r*n.stride,p,m,s,c,u,g),f.minimumHeight=Math.min(f.minimumHeight,s),f.maximumHeight=Math.max(f.maximumHeight,s),r+1}var N8=new ie;function P1(e,t,n,i){let r=e.rectangle,o=t.rectangle;t.x===0&&n.x===1&&e.x===e.tilingScheme.getNumberOfXTilesAtLevel(e.level)-1?(r=ie.clone(e.rectangle,N8),r.west-=I.TWO_PI,r.east-=I.TWO_PI):e.x===0&&n.x===0&&t.x===t.tilingScheme.getNumberOfXTilesAtLevel(t.level)-1&&(r=ie.clone(e.rectangle,N8),r.west+=I.TWO_PI,r.east+=I.TWO_PI);let a=r.east-r.west,s=(o.west-r.west)/a,c=(o.east-r.west)/a,u=r.north-r.south,f=(o.south-r.south)/u,d=(o.north-r.south)/u,p=(n.x-s)/(c-s),g=(n.y-f)/(d-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 rAt=new k;function JQ(e,t,n,i,r){let o=e.encoding,a=e.vertices;if(r.height=o.decodeHeight(a,t),o.hasVertexNormals)o.getOctEncodedNormal(a,t,r.encodedNormal);else{let s=r.encodedNormal;s.x=0,s.y=0}}var oAt=new k,aAt=new h;function sAt(e,t,n,i,r,o,a,s,c,u){let f=i.encoding,d=i.vertices,p=P1(t,n,f.decodeTextureCoordinates(d,r,gf),gf),g=P1(t,n,f.decodeTextureCoordinates(d,o,$Q),$Q),m;c?m=(a-p.x)/(g.x-p.x):m=(s-p.y)/(g.y-p.y);let y=f.decodeHeight(d,r),A=f.decodeHeight(d,o),b=n.rectangle;Ix.longitude=I.lerp(b.west,b.east,a),Ix.latitude=I.lerp(b.south,b.north,s),u.height=Ix.height=I.lerp(y,A,m);let x;if(f.hasVertexNormals){let T=f.getOctEncodedNormal(d,r,rAt),C=f.getOctEncodedNormal(d,o,oAt),E=an.octDecode(T.x,T.y,yS),w=an.octDecode(C.x,C.y,aAt);x=h.lerp(E,w,m,yS),h.normalize(x,x),an.octEncode(x,u.encodedNormal)}else x=e.geodeticSurfaceNormalCartographic(Ix,yS),an.octEncode(x,u.encodedNormal)}function wve(e,t,n,i,r,o){o.height=r;let a=t.geodeticSurfaceNormalCartographic(Ix,yS);an.octEncode(a,o.encodedNormal)}function O8(e,t,n,i,r,o,a,s,c,u,f){if(Eve(e,t,s,a,!1,n,i,f)||Eve(e,t,u,c,!0,n,i,f))return f;let p;if(QQ(r,o))return n===0?i===0?p=o.eastIndicesNorthToSouth[0]:p=o.southIndicesEastToWest[0]:i===0?p=o.northIndicesWestToEast[0]:p=o.westIndicesSouthToNorth[0],JQ(o,p,n,i,f),f;let g;if(n===0?i===0?g=M8(e.westMeshes,e.westTiles,Pn.EAST,e.southMeshes,e.southTiles,Pn.NORTH,n,i):g=M8(e.northMeshes,e.northTiles,Pn.SOUTH,e.westMeshes,e.westTiles,Pn.EAST,n,i):i===0?g=M8(e.southMeshes,e.southTiles,Pn.NORTH,e.eastMeshes,e.eastTiles,Pn.WEST,n,i):g=M8(e.eastMeshes,e.eastTiles,Pn.WEST,e.northMeshes,e.northTiles,Pn.SOUTH,n,i),l(g))return wve(e,t,n,i,g,f),f}function M8(e,t,n,i,r,o,a,s){let c=vve(e,t,!1,n,a,s),u=vve(i,r,!0,o,a,s);return l(c)&&l(u)?(c+u)*.5:l(c)?c:u}function L8(e,t,n,i,r,o,a,s,c){for(let u=0;u<o.length;++u)r=cAt(e,t,n,i,r,o[u],a[u],s,c);return r}function cAt(e,t,n,i,r,o,a,s,c){let u;s===Pn.EAST&&e.tile.x===0?(u=ie.clone(o.rectangle,N8),u.west-=I.TWO_PI,u.east-=I.TWO_PI):s===Pn.WEST&&o.x===0&&(u=ie.clone(o.rectangle,N8),u.west+=I.TWO_PI,u.east+=I.TWO_PI);let f=e.tile.rectangle,d,p;r>0&&(n.decodeTextureCoordinates(i,r-1,gf),d=gf.x,p=gf.y);let g,m;switch(s){case Pn.WEST:g=a.westIndicesSouthToNorth,m=!1;break;case Pn.NORTH:g=a.northIndicesWestToEast,m=!0;break;case Pn.EAST:g=a.eastIndicesNorthToSouth,m=!1;break;case Pn.SOUTH:g=a.southIndicesEastToWest,m=!0;break}let y=o,A=e.tile,b=a.encoding,x=a.vertices,T=n.stride,C,E;b.hasWebMercatorT&&(C=_i.geodeticLatitudeToMercatorAngle(f.south),E=1/(_i.geodeticLatitudeToMercatorAngle(f.north)-C));for(let w=0;w<g.length;++w){let D=g[w],R=b.decodeTextureCoordinates(x,D,gf);P1(y,A,R,R);let M=R.x,N=R.y,_=m?M:N;if(_<0||_>1||Math.abs(M-d)<I.EPSILON5&&Math.abs(N-p)<I.EPSILON5)continue;let v=Math.abs(M)<I.EPSILON5||Math.abs(M-1)<I.EPSILON5,S=Math.abs(N)<I.EPSILON5||Math.abs(N-1)<I.EPSILON5;if(v&&S)continue;let P=b.decodePosition(x,D,yS),L=b.decodeHeight(x,D),F;b.hasVertexNormals?F=b.getOctEncodedNormal(x,D,KQ):(F=KQ,F.x=0,F.y=0);let V=N;if(b.hasWebMercatorT){let j=I.lerp(f.south,f.north,N);V=(_i.geodeticLatitudeToMercatorAngle(j)-C)*E}let z;n.hasGeodeticSurfaceNormals&&(z=t.geodeticSurfaceNormal(P,ZQ)),n.encode(i,r*T,P,R,L,F,V,z),c.minimumHeight=Math.min(c.minimumHeight,L),c.maximumHeight=Math.max(c.maximumHeight,L),++r}return r}function vve(e,t,n,i,r,o){let a,s,c;n?(a=0,s=e.length,c=1):(a=e.length-1,s=-1,c=-1);for(let u=a;u!==s;u+=c){let f=e[u],d=t[u];if(!QQ(d,f))continue;let p;switch(i){case Pn.WEST:p=f.westIndicesSouthToNorth;break;case Pn.SOUTH:p=f.southIndicesEastToWest;break;case Pn.EAST:p=f.eastIndicesNorthToSouth;break;case Pn.NORTH:p=f.northIndicesWestToEast;break}let g=p[n?0:p.length-1];if(l(g))return f.encoding.decodeHeight(f.vertices,g)}}function QQ(e,t){return l(t)&&(!l(e.data.fill)||!e.data.fill.changedThisFrame)}function Eve(e,t,n,i,r,o,a,s){let c,u,f,d,p,g=i[r?0:n.length-1],m=n[r?0:n.length-1];if(QQ(g,m)&&(o===0?a===0?(c=r?m.northIndicesWestToEast:m.eastIndicesNorthToSouth,u=r,f=r):(c=r?m.eastIndicesNorthToSouth:m.southIndicesEastToWest,u=!r,f=!1):a===0?(c=r?m.westIndicesSouthToNorth:m.northIndicesWestToEast,u=!r,f=!0):(c=r?m.southIndicesEastToWest:m.westIndicesSouthToNorth,u=r,f=!r),c.length>0)){d=r?0:c.length-1,p=c[d],m.encoding.decodeTextureCoordinates(m.vertices,p,gf);let y=P1(g,e.tile,gf,gf);if(y.x===o&&y.y===a)return JQ(m,p,o,a,s),!0;if(d=Cr(c,u?o:a,function(A,b){m.encoding.decodeTextureCoordinates(m.vertices,A,gf);let x=P1(g,e.tile,gf,gf);return f?u?x.x-o:x.y-a:u?o-x.x:a-x.y}),d<0){if(d=~d,d>0&&d<c.length)return sAt(t,g,e.tile,m,c[d-1],c[d],o,a,u,s),!0}else return JQ(m,c[d],o,a,s),!0}return!1}var lAt=[new h,new h,new h,new h];function uAt(e,t,n,i,r,o){let a=e.quadtree._occluders.ellipsoid,s=a.ellipsoid,c=lAt;return h.fromRadians(n.west,n.south,r,s,c[0]),h.fromRadians(n.east,n.south,r,s,c[1]),h.fromRadians(n.west,n.north,r,s,c[2]),h.fromRadians(n.east,n.north,r,s,c[3]),a.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,o)}var D1=AS;var eee=class e{constructor(t){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=Rn.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=t.terrainProvider,this._vectorProvider=t.vectorProvider,this._imageryLayers=t.imageryLayers,this._surfaceShaderSet=t.surfaceShaderSet,this._renderState=void 0,this._blendRenderState=void 0,this._disableCullingRenderState=void 0,this._disableCullingBlendRenderState=void 0,this._errorEvent=new be,this._removeLayerAddedListener=this._imageryLayers.layerAdded.addEventListener(e.prototype._onLayerAdded,this),this._removeLayerRemovedListener=this._imageryLayers.layerRemoved.addEventListener(e.prototype._onLayerRemoved,this),this._removeLayerMovedListener=this._imageryLayers.layerMoved.addEventListener(e.prototype._onLayerMoved,this),this._removeLayerShownListener=this._imageryLayers.layerShownOrHidden.addEventListener(e.prototype._onLayerShownOrHidden,this),this._imageryLayersUpdatedEvent=new be,this._layerOrderChanged=!1,this._tilesToRenderByTextureCount=[],this._drawCommands=[],this._uniformMaps=[],this._usedDrawCommands=0,this._vertexArraysToDestroy=[],this._debug={wireframe:!1,boundingSphereTile:void 0,tilesRendered:0,texturesRendered:0},this._baseColor=void 0,this._firstPassInitialColor=void 0,this.baseColor=new U(0,0,.5,1),this._clippingPlanes=void 0,this._clippingPolygons=void 0,this.cartographicLimitRectangle=ie.clone(ie.MAX_VALUE),this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1,this._oldVerticalExaggeration=void 0,this._oldVerticalExaggerationRelativeHeight=void 0,this._oldSceneMode=re.SCENE3D}get baseColor(){return this._baseColor}set baseColor(t){this._baseColor=t,this._firstPassInitialColor=ae.fromColor(t,this._firstPassInitialColor)}get quadtree(){return this._quadtree}set quadtree(t){this._quadtree=t}get tilingScheme(){if(l(this._terrainProvider))return this._terrainProvider.tilingScheme}get errorEvent(){return this._errorEvent}get imageryLayersUpdatedEvent(){return this._imageryLayersUpdatedEvent}get terrainProvider(){return this._terrainProvider}set terrainProvider(t){this._terrainProvider!==t&&(this._terrainProvider=t,l(this._quadtree)&&this._quadtree.invalidateAllTiles())}get vectorProvider(){return this._vectorProvider}get clippingPlanes(){return this._clippingPlanes}set clippingPlanes(t){va.setOwner(t,this,"_clippingPlanes")}get clippingPolygons(){return this._clippingPolygons}set clippingPolygons(t){fp.setOwner(t,this,"_clippingPolygons")}update(t){this._imageryLayers._update()}initialize(t){this._imageryLayers.queueReprojectionCommands(t),this._layerOrderChanged&&(this._layerOrderChanged=!1,this._quadtree.forEachLoadedTile(function(o){o.data.imagery.sort(fAt)}));let n=this._vectorProvider;n.update(),this._quadtree.forEachRenderedTile(o=>{let a=o.data;l(a.vectorData)?a.vectorData=n.updateTileData(o.x,o.y,o.level,t.context,a.vectorData):a.vectorData=n.requestTileData(o.x,o.y,o.level,t.context)}),n.makeClean(),dAt(this,t);let i=this._vertexArraysToDestroy,r=i.length;for(let o=0;o<r;++o)$h._freeVertexArray(i[o]);i.length=0}beginUpdate(t){let n=this._tilesToRenderByTextureCount;for(let o=0,a=n.length;o<a;++o){let s=n[o];l(s)&&(s.length=0)}let i=this._clippingPlanes;l(i)&&i.enabled&&i.update(t);let r=this._clippingPolygons;l(r)&&r.enabled&&(r.update(t),r.queueCommands(t)),this._usedDrawCommands=0,this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1}endUpdate(t){if(!l(this._renderState)){this._renderState=je.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:Ac.LESS}}),this._blendRenderState=je.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:Ac.LESS_OR_EQUAL},blending:en.ALPHA_BLEND});let c=Xe(this._renderState,!0);c.cull.enabled=!1,this._disableCullingRenderState=je.fromCache(c),c=Xe(this._blendRenderState,!0),c.cull.enabled=!1,this._disableCullingBlendRenderState=je.fromCache(c)}this._hasFillTilesThisFrame&&this._hasLoadedTilesThisFrame&&D1.updateFillTiles(this,this._quadtree._tilesToRender,t,this._vertexArraysToDestroy);let n=this.quadtree,i=t.verticalExaggeration,r=t.verticalExaggerationRelativeHeight,o=this._oldVerticalExaggeration!==i||this._oldVerticalExaggerationRelativeHeight!==r;this._oldVerticalExaggeration=i,this._oldVerticalExaggerationRelativeHeight=r,o&&n.forEachLoadedTile(function(c){c.data.updateExaggeration(c,t,n)});let a=this._oldSceneMode!==t.mode;this._oldSceneMode=t.mode,a&&n.forEachLoadedTile(function(c){c.data.updateSceneMode(t.mode)});let s=this._tilesToRenderByTextureCount;for(let c=0,u=s.length;c<u;++c){let f=s[c];if(l(f))for(let d=0,p=f.length;d<p;++d){let g=f[d],y=g.data.tileBoundingRegion;FAt(this,g,t),t.minimumTerrainHeight=Math.min(t.minimumTerrainHeight,y.minimumHeight)}}}updateForPick(t){let n=this._drawCommands;for(let i=0,r=this._usedDrawCommands;i<r;++i)Ove(n[i],t)}cancelReprojections(){this._imageryLayers.cancelReprojections()}getLevelMaximumGeometricError(t){return l(this._terrainProvider)?this._terrainProvider.getLevelMaximumGeometricError(t):0}loadTile(t,n){let i=n.data,r=!0,o;l(i)&&(r=i.boundingVolumeSourceTile!==n||n._lastSelectionResult===fi.CULLED_BUT_NEEDED,o=i.terrainState),$h.processStateMachine(n,t,this.terrainProvider,this.vectorProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,r),i=n.data,r&&o!==i.terrainState&&this.computeTileVisibility(n,t,this.quadtree.occluders)!==Bo.NONE&&i.boundingVolumeSourceTile===n&&(r=!1,$h.processStateMachine(n,t,this.terrainProvider,this.vectorProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,r))}computeTileVisibility(t,n,i){let r=this.computeDistanceToTile(t,n);t._distance=r;let o=Lve(this,n);if(n.fog.enabled&&!o&&I.fog(r,n.fog.density)>=1)return Bo.NONE;let a=t.data,s=a.tileBoundingRegion;if(a.boundingVolumeSourceTile===void 0)return Bo.PARTIAL;let c=n.cullingVolume,u=s.boundingVolume;l(u)||(u=s.boundingSphere),a.clippedByBoundaries=!1;let f=k8(t.rectangle,this.cartographicLimitRectangle),d=ie.simpleIntersection(f,t.rectangle,Mve);if(!l(d))return Bo.NONE;if(ie.equals(d,t.rectangle)||(a.clippedByBoundaries=!0),n.mode!==re.SCENE3D&&(u=hAt,se.fromRectangleWithHeights2D(t.rectangle,n.mapProjection,s.minimumHeight,s.maximumHeight,u),h.fromElements(u.center.z,u.center.x,u.center.y,u.center),n.mode===re.MORPHING&&l(a.renderedMesh)&&(u=se.union(s.boundingSphere,u,u))),!l(u))return Bo.PARTIAL;let p=this._clippingPlanes;if(l(p)&&p.enabled){let b=p.computeIntersectionWithBoundingVolume(u);if(t.isClipped=b!==Xt.INSIDE,b===Xt.OUTSIDE)return Bo.NONE}let g=this._clippingPolygons;if(l(g)&&g.enabled){let b=g.computeIntersectionWithBoundingVolume(s);t.isClipped=b!==Xt.OUTSIDE}let m,y=c.computeVisibility(u);if(y===Xt.OUTSIDE?m=Bo.NONE:y===Xt.INTERSECTING?m=Bo.PARTIAL:y===Xt.INSIDE&&(m=Bo.FULL),m===Bo.NONE)return m;let A=n.mode===re.SCENE3D&&n.camera.frustum instanceof pn;if(n.mode===re.SCENE3D&&!A&&l(i)&&!o){let b=a.occludeePointInScaledSpace;return!l(b)||i.ellipsoid.isScaledSpacePointVisiblePossiblyUnderEllipsoid(b,s.minimumHeight)?m:Bo.NONE}return m}canRefine(t){let n=t.data;return l(n.terrainData)?!0:this.terrainProvider.getTileDataAvailable(t.x*2,t.y*2,t.level+1)!==void 0}canRenderWithoutLosingDetail(t){let n=t.data,i=gAt;i.length=this._imageryLayers.length;let r=!1,o=!1,a;l(n)&&(r=n.terrainState===Or.READY,o=!0,a=n.imagery);let s,c;for(s=0,c=i.length;s<c;++s)i[s]=o;if(l(a))for(s=0,c=a.length;s<c;++s){let d=a[s],p=d.loadingImagery,g=!l(p)||p.state===jn.FAILED||p.state===jn.INVALID,m=(d.loadingImagery||d.readyImagery).imageryLayer._layerIndex;i[m]=g&&i[m]}let u=this.quadtree._lastSelectionFrameNumber,f=_At;for(f.length=0,f.push(t.southwestChild,t.southeastChild,t.northwestChild,t.northeastChild);f.length>0;){let d=f.pop(),p=d._lastSelectionResultFrame===u?d._lastSelectionResult:fi.NONE;if(p===fi.RENDERED){let g=d.data;if(!l(g))continue;if(!r&&d.data.terrainState===Or.READY)return!1;let m=d.data.imagery;for(s=0,c=m.length;s<c;++s){let y=m[s],A=y.loadingImagery,b=!l(A)||A.state===jn.FAILED||A.state===jn.INVALID,x=(y.loadingImagery||y.readyImagery).imageryLayer._layerIndex;if(b&&!i[x])return!1}}else p===fi.REFINED&&f.push(d.southwestChild,d.southeastChild,d.northwestChild,d.northeastChild)}return!0}computeTileLoadPriority(t,n){let i=t.data;if(i===void 0)return 0;let r=i.tileBoundingRegion.boundingVolume;if(r===void 0)return 0;let o=n.camera.positionWC,a=n.camera.directionWC,s=h.subtract(r.center,o,yAt),c=h.magnitude(s);return c<I.EPSILON5?0:(h.divideByScalar(s,c,s),(1-h.dot(s,a))*t._distance)}showTileThisFrame(t,n){let i=0,r=t.data,o=r.imagery;for(let c=0,u=o.length;c<u;++c){let f=o[c];l(f.readyImagery)&&f.readyImagery.imageryLayer.alpha!==0&&++i}let a=this._tilesToRenderByTextureCount[i];l(a)||(a=[],this._tilesToRenderByTextureCount[i]=a),a.push(t),l(r.vertexArray)?this._hasLoadedTilesThisFrame=!0:this._hasFillTilesThisFrame=!0;let s=this._debug;++s.tilesRendered,s.texturesRendered+=i}computeDistanceToTile(t,n){SAt(t,this,n);let i=t.data;if(i.boundingVolumeSourceTile===void 0)return 9999999999;let o=i.tileBoundingRegion,a=o.minimumHeight,s=o.maximumHeight;if(i.boundingVolumeSourceTile!==t){let u=n.camera.positionCartographic.height,f=Math.abs(u-a),d=Math.abs(u-s);f>d?(o.minimumHeight=a,o.maximumHeight=a):(o.minimumHeight=s,o.maximumHeight=s)}let c=o.distanceToCamera(n);return o.minimumHeight=a,o.maximumHeight=s,c}isDestroyed(){return!1}destroy(){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(),ue(this)}_onLayerAdded(t,n){if(!this.isDestroyed()&&t.show){let i=this._terrainProvider,r=this,o=this._imageryLayersUpdatedEvent,a=function(){t._imageryCache={},r._quadtree.forEachLoadedTile(function(s){if(l(s._loadedCallbacks[t._layerIndex]))return;let c,u=s.data.imagery,f=u.length,d=-1,p=0;for(c=0;c<f;++c){let m=u[c];if((m.readyImagery??m.loadingImagery).imageryLayer===t)d===-1&&(d=c),++p;else if(d!==-1)break}if(d===-1)return;let g=d+p;t._createTileImagerySkeletons(s,i,g)&&(s._loadedCallbacks[t._layerIndex]=wAt(p,t,i),s.state=rc.LOADING)})};if(t.ready){let s=t.imageryProvider;s._reload=a}this._quadtree.forEachLoadedTile(function(s){t._createTileImagerySkeletons(s,i)&&(s.state=rc.LOADING,s.level!==0&&(s._lastSelectionResultFrame!==r.quadtree._lastSelectionFrameNumber||s._lastSelectionResult!==fi.RENDERED)&&(s.renderable=!1))}),this._layerOrderChanged=!0,o.raiseEvent()}}_onLayerRemoved(t,n){this._quadtree.forEachLoadedTile(function(i){let r=i.data.imagery,o=-1,a=0;for(let s=0,c=r.length;s<c;++s){let u=r[s],f=u.loadingImagery;if(l(f)||(f=u.readyImagery),f.imageryLayer===t)o===-1&&(o=s),u.freeResources(),++a;else if(o!==-1)break}o!==-1&&r.splice(o,a)}),l(t.imageryProvider)&&(t.imageryProvider._reload=void 0),this._imageryLayersUpdatedEvent.raiseEvent()}_onLayerMoved(t,n,i){this._layerOrderChanged=!0,this._imageryLayersUpdatedEvent.raiseEvent()}_onLayerShownOrHidden(t,n,i){i?this._onLayerAdded(t,n):this._onLayerRemoved(t,n)}};function fAt(e,t){let n=e.loadingImagery;l(n)||(n=e.readyImagery);let i=t.loadingImagery;return l(i)||(i=t.readyImagery),n.imageryLayer._layerIndex-i.imageryLayer._layerIndex}function dAt(e,t){let n=t.creditDisplay,i=e._terrainProvider;l(i)&&l(i.credit)&&n.addCreditToNextFrame(i.credit);let r=e._imageryLayers;for(let o=0,a=r.length;o<a;++o){let s=r.get(o);s.ready&&s.show&&l(s.imageryProvider.credit)&&n.addCreditToNextFrame(s.imageryProvider.credit)}}function Ove(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)}var hAt=new se,Mve=new ie,mAt=new ie,pAt=new de;function k8(e,t){if(t.west<t.east)return t;let n=ie.clone(t,mAt);return ie.center(e,pAt).longitude>0?n.east=I.PI:n.west=-I.PI,n}function Lve(e,t){if(t.cameraUnderground||t.globeTranslucencyState.translucent)return!0;if(e.backFaceCulling)return!1;let n=e._clippingPlanes;if(l(n)&&n.enabled)return!0;let i=e._clippingPolygons;return!!(l(i)&&i.enabled||!ie.equals(e.cartographicLimitRectangle,ie.MAX_VALUE))}var gAt=[],_At=[],yAt=new h,Ive=new O,B8=new O,AAt=new ae,bAt=new ae,xAt=new ae,TAt=new h,Pve=new h,CAt=new h,vAt=new h,EAt=[new h,new h,new h,new h];function Dve(e,t,n,i,r,o){let a=e.quadtree._occluders.ellipsoid,s=a.ellipsoid,c=EAt;return h.fromRadians(n.west,n.south,r,s,c[0]),h.fromRadians(n.east,n.south,r,s,c[1]),h.fromRadians(n.west,n.north,r,s,c[2]),h.fromRadians(n.east,n.north,r,s,c[3]),a.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,o)}function SAt(e,t,n){let i=e.data;i===void 0&&(i=e.data=new $h);let r=e.tilingScheme.ellipsoid;i.tileBoundingRegion===void 0&&(i.tileBoundingRegion=new Rd({computeBoundingVolumes:!1,rectangle:e.rectangle,ellipsoid:r,minimumHeight:0,maximumHeight:0}));let o=i.tileBoundingRegion,a=o.minimumHeight,s=o.maximumHeight,c=!1,u=e,f=i.mesh,d=i.terrainData;if(f!==void 0&&f.minimumHeight!==void 0&&f.maximumHeight!==void 0)o.minimumHeight=f.minimumHeight,o.maximumHeight=f.maximumHeight,c=!0;else if(d!==void 0&&d._minimumHeight!==void 0&&d._maximumHeight!==void 0)o.minimumHeight=d._minimumHeight,o.maximumHeight=d._maximumHeight;else{o.minimumHeight=Number.NaN,o.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){o.minimumHeight=m.minimumHeight,o.maximumHeight=m.maximumHeight;break}else if(y!==void 0&&y._minimumHeight!==void 0&&y._maximumHeight!==void 0){o.minimumHeight=y._minimumHeight,o.maximumHeight=y._maximumHeight;break}}p=p.parent}u=p}if(u!==void 0){let p=n.verticalExaggeration,g=n.verticalExaggerationRelativeHeight;if(p!==1&&(c=!1,o.minimumHeight=pr.getHeight(o.minimumHeight,p,g),o.maximumHeight=pr.getHeight(o.maximumHeight,p,g)),c)i.boundingVolumeIsFromMesh||(o._orientedBoundingBox=Jt.clone(f.orientedBoundingBox,o._orientedBoundingBox),o._boundingSphere=se.clone(f.boundingSphere3D,o._boundingSphere),i.occludeePointInScaledSpace=h.clone(f.occludeePointInScaledSpace,i.occludeePointInScaledSpace),l(i.occludeePointInScaledSpace)||(i.occludeePointInScaledSpace=Dve(t,o._orientedBoundingBox.center,e.rectangle,o.minimumHeight,o.maximumHeight,i.occludeePointInScaledSpace)));else{let y=o._orientedBoundingBox===void 0||o._boundingSphere===void 0;(o.minimumHeight!==a||o.maximumHeight!==s||y)&&(o.computeBoundingVolumes(r),i.occludeePointInScaledSpace=Dve(t,o._orientedBoundingBox.center,e.rectangle,o.minimumHeight,o.maximumHeight,i.occludeePointInScaledSpace))}i.boundingVolumeSourceTile=u,i.boundingVolumeIsFromMesh=c}else i.boundingVolumeSourceTile=void 0,i.boundingVolumeIsFromMesh=!1}function wAt(e,t,n){return function(i){let r,o,a=-1,s=i.data.imagery,c=s.length,u;for(u=0;u<c;++u)if(r=s[u],o=r.readyImagery??r.loadingImagery,o.imageryLayer===t){a=u;break}if(a!==-1){let f=a+e;if(r=s[f],o=l(r)?r.readyImagery??r.loadingImagery:void 0,!l(o)||o.imageryLayer!==t)return!t._createTileImagerySkeletons(i,n,f);for(u=a;u<f;++u)s[u].freeResources();s.splice(a,e)}return!0}}var IAt=new O,PAt=new O;function Rve(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,r=O.multiplyByPoint(i,this.properties.rtc,Pve);return O.setTranslation(i,r,Ive),Ive},u_modifiedModelViewProjection:function(){let i=e.context.uniformState.view,r=e.context.uniformState.projection,o=O.multiplyByPoint(i,this.properties.rtc,Pve);return O.setTranslation(i,o,B8),O.multiply(r,B8,B8),B8},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 l(i)&&l(i.texture)?i.texture:e.context.defaultTexture},u_cartographicLimitRectangle:function(){return this.properties.localizedCartographicLimitRectangle},u_clippingPlanesMatrix:function(){let i=t._clippingPlanes,r=l(i)?O.multiply(e.context.uniformState.view,i.modelMatrix,IAt):O.IDENTITY;return O.inverseTranspose(r,PAt)},u_clippingPlanesEdgeStyle:function(){let i=this.properties.clippingPlanesEdgeColor;return i.alpha=this.properties.clippingPlanesEdgeWidth,i},u_clippingDistance:function(){let i=t._clippingPolygons.clippingTexture;return l(i)?i:e.context.defaultTexture},u_clippingExtents:function(){let i=t._clippingPolygons.extentsTexture;return l(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},u_vectorSegmentTexture:function(){return this.properties.vectorSegmentTexture??e.context.defaultTexture},u_vectorWidthTexture:function(){return this.properties.vectorWidthTexture??e.context.defaultTexture},u_vectorColorTexture:function(){return this.properties.vectorColorTexture??e.context.defaultTexture},u_vectorSegmentPrimitiveIndicesTexture:function(){return this.properties.vectorSegmentPrimitiveIndicesTexture??e.context.defaultTexture},u_vectorGridCellIndicesTexture:function(){return this.properties.vectorGridCellIndicesTexture??e.context.defaultTexture},u_vectorPolygonEdgeTexture:function(){return this.properties.vectorPolygonEdgeTexture??e.context.defaultTexture},u_vectorPolygonEdgePrimitiveIndicesTexture:function(){return this.properties.vectorPolygonEdgePrimitiveIndicesTexture??e.context.defaultTexture},u_vectorPolygonGridCellIndicesTexture:function(){return this.properties.vectorPolygonGridCellIndicesTexture??e.context.defaultTexture},properties:{initialColor:new ae(0,0,.5,1),fillHighlightColor:new U(0,0,0,0),zoomedOutOceanSpecularIntensity:.5,oceanNormalMap:void 0,lightingFadeDistance:new k(65e5,9e6),nightFadeDistance:new k(1e7,4e7),atmosphereLightIntensity:10,atmosphereRayleighCoefficient:new h(55e-7,13e-6,284e-7),atmosphereMieCoefficient:new h(21e-6,21e-6,21e-6),atmosphereRayleighScaleHeight:1e4,atmosphereMieScaleHeight:3200,atmosphereMieAnisotropy:.9,hsbShift:new h,center3D:void 0,rtc:new h,modifiedModelView:new O,tileRectangle:new ae,verticalExaggerationAndRelativeHeight:new k(1,0),dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsRectangle:[],dayTextureUseWebMercatorT:[],dayTextureAlpha:[],dayTextureNightAlpha:[],dayTextureDayAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayTextureSplit:[],dayTextureCutoutRectangles:[],dayIntensity:0,colorsToAlpha:[],southAndNorthLatitude:new k,southMercatorYAndOneOverHeight:new k,waterMask:void 0,waterMaskTranslationAndScale:new ae,minMaxHeight:new k,scaleAndBias:new O,clippingPlanesEdgeColor:U.clone(U.WHITE),clippingPlanesEdgeWidth:0,localizedCartographicLimitRectangle:new ae,frontFaceAlphaByDistance:new ae,backFaceAlphaByDistance:new ae,localizedTranslucencyRectangle:new ae,undergroundColor:U.clone(U.TRANSPARENT),undergroundColorAlphaByDistance:new ae,lambertDiffuseMultiplier:0,vertexShadowDarkness:0,vectorSegmentTexture:void 0,vectorWidthTexture:void 0,vectorColorTexture:void 0,vectorSegmentPrimitiveIndicesTexture:void 0,vectorGridCellIndicesTexture:void 0,vectorPolygonEdgeTexture:void 0,vectorPolygonEdgePrimitiveIndicesTexture:void 0,vectorPolygonGridCellIndicesTexture:void 0}};return l(t.materialUniformMap)?Ot(n,t.materialUniformMap):n}function DAt(e,t){let n=t.data,i,r;if(l(n.vertexArray)?(i=n.mesh,r=n.vertexArray):l(n.fill)&&l(n.fill.vertexArray)&&(i=n.fill.mesh,r=n.fill.vertexArray),!(!l(i)||!l(r))){if(l(n.wireframeVertexArray)){if(n.wireframeVertexArray.mesh===i)return;n.wireframeVertexArray.destroy(),n.wireframeVertexArray=void 0}n.wireframeVertexArray=RAt(e,r,i),n.wireframeVertexArray.mesh=i}}function RAt(e,t,n){let r={indices:n.indices,primitiveType:Re.TRIANGLES};Gn.toWireframe(r);let o=r.indices,a=Ze.createIndexBuffer({context:e,typedArray:o,usage:Oe.STATIC_DRAW,indexDatatype:Ve.fromSizeInBytes(o.BYTES_PER_ELEMENT)});return new Vn({context:e,attributes:t._attributes,indexBuffer:a})}var Nve,Fve,z8;(function(){let e=new Bt({geometry:Pm.fromDimensions({dimensions:new h(2,2,2)})}),t=new Bt({geometry:new K_({radius:1})}),n=new O,i,r;function o(a){return new Fn({geometryInstances:a,appearance:new _n({translucent:!1,flat:!0}),asynchronous:!1})}Nve=function(a,s){return a===i||(z8(),i=a,n=O.fromRotationTranslation(a.halfAxes,a.center,n),e.modelMatrix=n,e.attributes.color=Kt.fromColor(s),r=o(e)),r},Fve=function(a,s){return a===i||(z8(),i=a,n=O.fromTranslation(a.center,n),n=O.multiplyByUniformScale(n,a.radius,n),t.modelMatrix=n,t.attributes.color=Kt.fromColor(s),r=o(t)),r},z8=function(){l(r)&&(r.destroy(),r=void 0,i=void 0)}})();var OAt=new ae(0,0,0,0),MAt={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},LAt=U.TRANSPARENT,NAt=new Wt;function FAt(e,t,n){let i=t.data;l(i.vertexArray)||(i.fill===void 0&&(i.fill=new D1(t)),i.fill.update(e,n));let r=n.creditDisplay,o=i.terrainData;if(l(o)&&l(o.credits)){let bt=o.credits;for(let Dt=0,In=bt.length;Dt<In;++Dt)r.addCreditToNextFrame(bt[Dt])}let a=Ft.maximumTextureImageUnits,s=i.waterMaskTexture,c=i.waterMaskTranslationAndScale;!l(s)&&l(i.fill)&&(s=i.fill.waterMaskTexture,c=i.fill.waterMaskTranslationAndScale);let u=n.cameraUnderground,f=n.globeTranslucencyState,d=f.translucent,p=f.frontFaceAlphaByDistance,g=f.backFaceAlphaByDistance,m=f.rectangle,y=e.undergroundColor??LAt,A=e.undergroundColorAlphaByDistance??NAt,b=Lve(e,n)&&n.mode===re.SCENE3D&&y.alpha>0&&(A.nearValue>0||A.farValue>0),x=e.lambertDiffuseMultiplier,T=e.vertexShadowDarkness,C=e.hasWaterMask&&l(s),E=C&&e.showWaterEffect,w=e.oceanNormalMap,D=E&&l(w),R=e.terrainProvider,M=l(R)&&e.terrainProvider.hasVertexNormals,N=n.fog.enabled&&n.fog.renderable&&!u,_=e.showGroundAtmosphere&&n.mode===re.SCENE3D,v=Rn.castShadows(e.shadows)&&!d,S=Rn.receiveShadows(e.shadows)&&!d,P=e.hueShift,L=e.saturationShift,F=e.brightnessShift,V=!(I.equalsEpsilon(P,0,I.EPSILON7)&&I.equalsEpsilon(L,0,I.EPSILON7)&&I.equalsEpsilon(F,0,I.EPSILON7)),z=!1;if(_){let bt=h.magnitude(n.camera.positionWC),Dt=e.nightFadeOutDistance;z=bt>Dt}C&&--a,D&&--a,l(n.shadowState)&&n.shadowState.shadowsEnabled&&--a,l(e.clippingPlanes)&&e.clippingPlanes.enabled&&--a,l(e.clippingPolygons)&&e.clippingPolygons.enabled&&(--a,--a),a-=f.numberOfTextureUniforms;let j=i.renderedMesh,B=j.center,G=j.encoding,W=i.tileBoundingRegion,Q=n.verticalExaggeration,q=n.verticalExaggerationRelativeHeight,J=Q!==1,Z=G.hasGeodeticSurfaceNormals,ce=AAt,Ae=0,le=0,Ce=0,ye=0,ve=!1;if(n.mode!==re.SCENE3D){let bt=n.mapProjection,Dt=bt.project(ie.southwest(t.rectangle),CAt),In=bt.project(ie.northeast(t.rectangle),vAt);if(ce.x=Dt.x,ce.y=Dt.y,ce.z=In.x,ce.w=In.y,n.mode!==re.MORPHING&&(B=TAt,B.x=0,B.y=(ce.z+ce.x)*.5,B.z=(ce.w+ce.y)*.5,ce.x-=B.y,ce.y-=B.z,ce.z-=B.y,ce.w-=B.z),n.mode===re.SCENE2D&&G.quantization===js.BITS12){let rt=1/(Math.pow(2,12)-1)*.5,dt=(ce.z-ce.x)*rt,vi=(ce.w-ce.y)*rt;ce.x-=dt,ce.y-=vi,ce.z+=dt,ce.w+=vi}bt instanceof _i&&(Ae=t.rectangle.south,le=t.rectangle.north,Ce=_i.geodeticLatitudeToMercatorAngle(Ae),ye=1/(_i.geodeticLatitudeToMercatorAngle(le)-Ce),ve=!0)}let Ie=MAt;Ie.frameState=n,Ie.surfaceTile=i,Ie.hasWaterMask=C,Ie.showReflectiveOcean=E,Ie.showOceanWaves=D,Ie.enableLighting=e.enableLighting,Ie.dynamicAtmosphereLighting=e.dynamicAtmosphereLighting,Ie.dynamicAtmosphereLightingFromSun=e.dynamicAtmosphereLightingFromSun,Ie.showGroundAtmosphere=_,Ie.atmosphereLightIntensity=e.atmosphereLightIntensity,Ie.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,Ie.atmosphereMieCoefficient=e.atmosphereMieCoefficient,Ie.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,Ie.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,Ie.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,Ie.perFragmentGroundAtmosphere=z,Ie.hasVertexNormals=M,Ie.useWebMercatorProjection=ve,Ie.clippedByBoundaries=i.clippedByBoundaries,Ie.hasGeodeticSurfaceNormals=Z,Ie.hasExaggeration=J;let Le=i.imagery,$e=0,Ye=Le.length,yt=e.showSkirts&&!u&&!d,Ke=e.backFaceCulling&&!u&&!d,we=Ke?e._renderState:e._disableCullingRenderState,We=Ke?e._blendRenderState:e._disableCullingBlendRenderState,Ct=we,ct=e._firstPassInitialColor,dn=n.context;if(l(e._debug.boundingSphereTile)||z8(),e._materialUniformMap!==e.materialUniformMap){e._materialUniformMap=e.materialUniformMap;let bt=e._drawCommands.length;for(let Dt=0;Dt<bt;++Dt)e._uniformMaps[Dt]=Rve(n,e)}do{let bt=0,Dt,In;if(e._drawCommands.length<=e._usedDrawCommands?(Dt=new nt,Dt.owner=t,Dt.cull=!1,Dt.boundingVolume=new se,Dt.orientedBoundingBox=void 0,In=Rve(n,e),e._drawCommands.push(Dt),e._uniformMaps.push(In)):(Dt=e._drawCommands[e._usedDrawCommands],In=e._uniformMaps[e._usedDrawCommands]),Dt.owner=t,++e._usedDrawCommands,t===e._debug.boundingSphereTile){let vo=W.boundingVolume,ys=W.boundingSphere;l(vo)?Nve(vo,U.RED).update(n):l(ys)&&Fve(ys,U.RED).update(n)}let rt=In.properties;ae.clone(ct,rt.initialColor),rt.oceanNormalMap=w,rt.lightingFadeDistance.x=e.lightingFadeOutDistance,rt.lightingFadeDistance.y=e.lightingFadeInDistance,rt.nightFadeDistance.x=e.nightFadeOutDistance,rt.nightFadeDistance.y=e.nightFadeInDistance,rt.atmosphereLightIntensity=e.atmosphereLightIntensity,rt.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,rt.atmosphereMieCoefficient=e.atmosphereMieCoefficient,rt.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,rt.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,rt.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,rt.zoomedOutOceanSpecularIntensity=e.zoomedOutOceanSpecularIntensity;let dt=u?g:p,vi=u?p:g;l(dt)&&(ae.fromElements(dt.near,dt.nearValue,dt.far,dt.farValue,rt.frontFaceAlphaByDistance),ae.fromElements(vi.near,vi.nearValue,vi.far,vi.farValue,rt.backFaceAlphaByDistance)),ae.fromElements(A.near,A.nearValue,A.far,A.farValue,rt.undergroundColorAlphaByDistance),U.clone(y,rt.undergroundColor),rt.lambertDiffuseMultiplier=x,rt.vertexShadowDarkness=T;let wn=!l(i.vertexArray)&&l(e.fillHighlightColor)&&e.fillHighlightColor.alpha>0;wn&&U.clone(e.fillHighlightColor,rt.fillHighlightColor),rt.verticalExaggerationAndRelativeHeight.x=Q,rt.verticalExaggerationAndRelativeHeight.y=q,rt.center3D=j.center,h.clone(B,rt.rtc),ae.clone(ce,rt.tileRectangle),rt.southAndNorthLatitude.x=Ae,rt.southAndNorthLatitude.y=le,rt.southMercatorYAndOneOverHeight.x=Ce,rt.southMercatorYAndOneOverHeight.y=ye;let Mi=bAt,lr=k8(t.rectangle,e.cartographicLimitRectangle),Li=xAt,Wi=k8(t.rectangle,m);h.fromElements(P,L,F,rt.hsbShift);let ri=t.rectangle,ei=1/ri.width,vn=1/ri.height;Mi.x=(lr.west-ri.west)*ei,Mi.y=(lr.south-ri.south)*vn,Mi.z=(lr.east-ri.west)*ei,Mi.w=(lr.north-ri.south)*vn,ae.clone(Mi,rt.localizedCartographicLimitRectangle),Li.x=(Wi.west-ri.west)*ei,Li.y=(Wi.south-ri.south)*vn,Li.z=(Wi.east-ri.west)*ei,Li.w=(Wi.north-ri.south)*vn,ae.clone(Li,rt.localizedTranslucencyRectangle);let ti=N&&I.fog(t._distance,n.fog.density)>I.EPSILON3;V=V&&(ti||_);let xr=!1,fa=!1,Ma=!1,Xa=!1,Ka=!1,Qr=!1,mi=!1,eo=!1,Di=!1,Mo=!1;for(;bt<a&&$e<Ye;){let vo=Le[$e],ys=vo.readyImagery;if(++$e,!l(ys)||ys.imageryLayer.alpha===0)continue;let Kg=vo.useWebMercatorT?ys.textureWebMercator:ys.texture,oi=ys.imageryLayer;l(vo.textureTranslationAndScale)||(vo.textureTranslationAndScale=oi._calculateTextureTranslationAndScale(t,vo)),rt.dayTextures[bt]=Kg,rt.dayTextureTranslationAndScale[bt]=vo.textureTranslationAndScale,rt.dayTextureTexCoordsRectangle[bt]=vo.textureCoordinateRectangle,rt.dayTextureUseWebMercatorT[bt]=vo.useWebMercatorT,rt.dayTextureAlpha[bt]=oi.alpha,Qr=Qr||rt.dayTextureAlpha[bt]!==1,rt.dayTextureNightAlpha[bt]=oi.nightAlpha,mi=mi||rt.dayTextureNightAlpha[bt]!==1,rt.dayTextureDayAlpha[bt]=oi.dayAlpha,mi=mi||rt.dayTextureDayAlpha[bt]!==1,rt.dayTextureBrightness[bt]=oi.brightness,xr=xr||rt.dayTextureBrightness[bt]!==wa.DEFAULT_BRIGHTNESS,rt.dayTextureContrast[bt]=oi.contrast,fa=fa||rt.dayTextureContrast[bt]!==wa.DEFAULT_CONTRAST,rt.dayTextureHue[bt]=oi.hue,Ma=Ma||rt.dayTextureHue[bt]!==wa.DEFAULT_HUE,rt.dayTextureSaturation[bt]=oi.saturation,Xa=Xa||rt.dayTextureSaturation[bt]!==wa.DEFAULT_SATURATION,rt.dayTextureOneOverGamma[bt]=1/oi.gamma,Ka=Ka||rt.dayTextureOneOverGamma[bt]!==1/wa.DEFAULT_GAMMA,rt.dayTextureSplit[bt]=oi.splitDirection,eo=eo||rt.dayTextureSplit[bt]!==0;let Fs=rt.dayTextureCutoutRectangles[bt];if(l(Fs)||(Fs=rt.dayTextureCutoutRectangles[bt]=new ae),ae.clone(ae.ZERO,Fs),l(oi.cutoutRectangle)){let ha=k8(ri,oi.cutoutRectangle),Nf=ie.simpleIntersection(ha,ri,Mve);Di=l(Nf)||Di,Fs.x=(ha.west-ri.west)*ei,Fs.y=(ha.south-ri.south)*vn,Fs.z=(ha.east-ri.west)*ei,Fs.w=(ha.north-ri.south)*vn}let Bs=rt.colorsToAlpha[bt];l(Bs)||(Bs=rt.colorsToAlpha[bt]=new ae);let $a=l(oi.colorToAlpha)&&oi.colorToAlphaThreshold>0;if(Mo=Mo||$a,$a){let ha=oi.colorToAlpha;Bs.x=ha.red,Bs.y=ha.green,Bs.z=ha.blue,Bs.w=oi.colorToAlphaThreshold}else Bs.w=-1;if(l(ys.credits)){let ha=ys.credits;for(let Nf=0,LA=ha.length;Nf<LA;++Nf)r.addCreditToNextFrame(ha[Nf])}++bt}rt.dayTextures.length=bt,rt.waterMask=s,ae.clone(c,rt.waterMaskTranslationAndScale),rt.minMaxHeight.x=G.minimumHeight,rt.minMaxHeight.y=G.maximumHeight,O.clone(G.matrix,rt.scaleAndBias);let Ri=e._clippingPlanes,Tr=l(Ri)&&Ri.enabled&&t.isClipped;Tr&&(rt.clippingPlanesEdgeColor=U.clone(Ri.edgeColor,rt.clippingPlanesEdgeColor),rt.clippingPlanesEdgeWidth=Ri.edgeWidth);let da=i.vectorData;l(da)&&(rt.vectorSegmentTexture=da.polylineSegmentTexture,rt.vectorWidthTexture=da.widthTexture,rt.vectorColorTexture=da.colorTexture,rt.vectorSegmentPrimitiveIndicesTexture=da.polylineSegmentPrimitiveIndicesTexture,rt.vectorGridCellIndicesTexture=da.polylineGridCellIndicesTexture,rt.vectorPolygonEdgeTexture=da.polygonEdgeTexture,rt.vectorPolygonEdgePrimitiveIndicesTexture=da.polygonEdgePrimitiveIndicesTexture,rt.vectorPolygonGridCellIndicesTexture=da.polygonGridCellIndicesTexture);let Co=e._clippingPolygons,Mf=l(Co)&&Co.enabled&&Co.length>0&&t.isClipped;Ie.numberOfDayTextures=bt,Ie.applyBrightness=xr,Ie.applyContrast=fa,Ie.applyHue=Ma,Ie.applySaturation=Xa,Ie.applyGamma=Ka,Ie.applyAlpha=Qr,Ie.applyDayNightAlpha=mi,Ie.applySplit=eo,Ie.enableFog=ti,Ie.enableClippingPlanes=Tr,Ie.clippingPlanes=Ri,Ie.enableClippingPolygons=Mf,Ie.clippingPolygons=Co,Ie.hasImageryLayerCutout=Di,Ie.colorCorrect=V,Ie.highlightFillTile=wn,Ie.colorToAlpha=Mo,Ie.showUndergroundColor=b,Ie.translucent=d;let Lf=i.renderedMesh.indices.length;yt||(Lf=i.renderedMesh.indexCountWithoutSkirts),Dt.shaderProgram=e._surfaceShaderSet.getShaderProgram(Ie),Dt.castShadows=v,Dt.receiveShadows=S,Dt.renderState=Ct,Dt.primitiveType=Re.TRIANGLES,Dt.vertexArray=i.vertexArray||i.fill.vertexArray,Dt.count=Lf,Dt.uniformMap=In,Dt.pass=Pe.GLOBE,e._debug.wireframe&&(DAt(dn,t),l(i.wireframeVertexArray)&&(Dt.vertexArray=i.wireframeVertexArray,Dt.primitiveType=Re.LINES,Dt.count=Lf*2));let lc=Dt.boundingVolume,Xg=Dt.orientedBoundingBox;n.mode!==re.SCENE3D?(se.fromRectangleWithHeights2D(t.rectangle,n.mapProjection,W.minimumHeight,W.maximumHeight,lc),h.fromElements(lc.center.z,lc.center.x,lc.center.y,lc.center),n.mode===re.MORPHING&&se.union(W.boundingSphere,lc,lc)):(Dt.boundingVolume=se.clone(W.boundingSphere,lc),Dt.orientedBoundingBox=Jt.clone(W.boundingVolume,Xg)),Dt.dirty=!0,d&&f.updateDerivedCommands(Dt,n),Ove(Dt,n),Ct=We,ct=OAt}while($e<Ye)}var U8=eee;function Bve(){this._enabled=!1,this._frontFaceAlpha=1,this._frontFaceAlphaByDistance=void 0,this._backFaceAlpha=1,this._backFaceAlphaByDistance=void 0,this._rectangle=ie.clone(ie.MAX_VALUE)}Object.defineProperties(Bve.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this._enabled=e}},frontFaceAlpha:{get:function(){return this._frontFaceAlpha},set:function(e){this._frontFaceAlpha=e}},frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance},set:function(e){this._frontFaceAlphaByDistance=Wt.clone(e,this._frontFaceAlphaByDistance)}},backFaceAlpha:{get:function(){return this._backFaceAlpha},set:function(e){this._backFaceAlpha=e}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance},set:function(e){this._backFaceAlphaByDistance=Wt.clone(e,this._backFaceAlphaByDistance)}},rectangle:{get:function(){return this._rectangle},set:function(e){l(e)||(e=ie.clone(ie.MAX_VALUE)),ie.clone(e,this._rectangle)}}});var V8=Bve;var tee=class{constructor(t){this._ellipsoid=new vm(t.ellipsoid,h.ZERO)}get ellipsoid(){return this._ellipsoid}},j8=tee;var nee=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)}get size(){return this.cache.size}clear(){this.cache.clear()}},BAt=1e3,iee=class e{constructor(t){this._tilingScheme=t.tilingScheme,this._x=t.x,this._y=t.y,this._level=t.level,this._parent=t.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=new Set,this._customDataIterator=void 0,this._addedCustomData=[],this._removedCustomData=[],this._lastSelectionResult=fi.NONE,this._lastSelectionResultFrame=void 0,this._loadedCallbacks={},this._positionCache=new nee(BAt),this.state=rc.START,this.renderable=!1,this.upsampledFromParent=!1,this.data=void 0}static createLevelZeroTiles(t){let n=t.getNumberOfXTilesAtLevel(0),i=t.getNumberOfYTilesAtLevel(0),r=new Array(n*i),o=0;for(let a=0;a<i;++a)for(let s=0;s<n;++s)r[o++]=new e({tilingScheme:t,x:s,y:a,level:0});return r}_getCacheKey(t,n){return zAt(t.longitude,t.latitude,this._rectangle,n)}getPositionCacheEntry(t,n){return this._positionCache.get(this._getCacheKey(t,n))}setPositionCacheEntry(t,n,i){this._positionCache.set(this._getCacheKey(t,n),i)}clearPositionCache(){this._positionCache.size>0&&this._positionCache.clear()}updateCustomData(){let t=this._addedCustomData,n=this._removedCustomData;if(t.length===0&&n.length===0)return;let i=this.customData;for(let r=0;r<t.length;++r){let o=t[r];i.add(o),kve(this,o.positionCartographic)._addedCustomData.push(o)}this._addedCustomData.length=0;for(let r=0;r<n.length;++r){let o=n[r];i.has(o)&&i.delete(o),kve(this,o.positionCartographic)._removedCustomData.push(o)}this._removedCustomData.length=0}get tilingScheme(){return this._tilingScheme}get x(){return this._x}get y(){return this._y}get level(){return this._level}get parent(){return this._parent}get rectangle(){return this._rectangle}get children(){return[this.northwestChild,this.northeastChild,this.southwestChild,this.southeastChild]}get southwestChild(){return l(this._southwestChild)||(this._southwestChild=new e({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2+1,level:this.level+1,parent:this})),this._southwestChild}get southeastChild(){return l(this._southeastChild)||(this._southeastChild=new e({tilingScheme:this.tilingScheme,x:this.x*2+1,y:this.y*2+1,level:this.level+1,parent:this})),this._southeastChild}get northwestChild(){return l(this._northwestChild)||(this._northwestChild=new e({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2,level:this.level+1,parent:this})),this._northwestChild}get northeastChild(){return l(this._northeastChild)||(this._northeastChild=new e({tilingScheme:this.tilingScheme,x:this.x*2+1,y:this.y*2,level:this.level+1,parent:this})),this._northeastChild}get customData(){return this._customData}get needsLoading(){return this.state<rc.DONE}get eligibleForUnloading(){let t=!0;return l(this.data)&&(t=this.data.eligibleForUnloading,l(t)||(t=!0)),t}findLevelZeroTile(t,n,i){let r=this.tilingScheme.getNumberOfXTilesAtLevel(0);if(n<0?n+=r:n>=r&&(n-=r),!(i<0||i>=this.tilingScheme.getNumberOfYTilesAtLevel(0)))return t.filter(function(o){return o.x===n&&o.y===i})[0]}findTileToWest(t){let n=this.parent;if(n===void 0)return this.findLevelZeroTile(t,this.x-1,this.y);if(n.southeastChild===this)return n.southwestChild;if(n.northeastChild===this)return n.northwestChild;let i=n.findTileToWest(t);if(i!==void 0)return n.southwestChild===this?i.southeastChild:i.northeastChild}findTileToEast(t){let n=this.parent;if(n===void 0)return this.findLevelZeroTile(t,this.x+1,this.y);if(n.southwestChild===this)return n.southeastChild;if(n.northwestChild===this)return n.northeastChild;let i=n.findTileToEast(t);if(i!==void 0)return n.southeastChild===this?i.southwestChild:i.northwestChild}findTileToSouth(t){let n=this.parent;if(n===void 0)return this.findLevelZeroTile(t,this.x,this.y+1);if(n.northwestChild===this)return n.southwestChild;if(n.northeastChild===this)return n.southeastChild;let i=n.findTileToSouth(t);if(i!==void 0)return n.southwestChild===this?i.northwestChild:i.northeastChild}findTileToNorth(t){let n=this.parent;if(n===void 0)return this.findLevelZeroTile(t,this.x,this.y-1);if(n.southwestChild===this)return n.northwestChild;if(n.southeastChild===this)return n.northeastChild;let i=n.findTileToNorth(t);if(i!==void 0)return n.northwestChild===this?i.southwestChild:i.southeastChild}freeResources(){this.clearPositionCache(),this.state=rc.START,this.renderable=!1,this.upsampledFromParent=!1;let t=this.data;l(t)&&l(t.freeResources)&&t.freeResources(),H8(this._southwestChild),this._southwestChild=void 0,H8(this._southeastChild),this._southeastChild=void 0,H8(this._northwestChild),this._northwestChild=void 0,H8(this._northeastChild),this._northeastChild=void 0}},kAt=256;function zAt(e,t,n,i){let r=n.width/kAt*i,o=Math.floor(e/r)*r,a=Math.floor(t/r)*r;return`${o.toFixed(10)},${a.toFixed(10)}`}var UAt=new de;function kve(e,t){let n=e.northwestChild.rectangle,i=ie.southeast(n,UAt),r=t.longitude>=i.longitude?1:0;switch((t.latitude<i.latitude?1:0)*2+r){case 0:return e.northwestChild;case 1:return e.northeastChild;case 2:return e.southwestChild;default:return e.southeastChild}}function H8(e){l(e)&&e.freeResources()}var G8=iee;function W8(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}W8.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head};W8.prototype.trimTiles=function(e){let t=this.tail,n=!0;for(;n&&l(this._lastBeforeStartOfFrame)&&this.count>e&&l(t);){n=t!==this._lastBeforeStartOfFrame;let i=t.replacementPrevious;t.eligibleForUnloading&&(t.freeResources(),zve(this,t)),t=i}};function zve(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}W8.prototype.markTileRendered=function(e){let t=this.head;if(t===e){e===this._lastBeforeStartOfFrame&&(this._lastBeforeStartOfFrame=e.replacementNext);return}if(++this.count,!l(t)){e.replacementPrevious=void 0,e.replacementNext=void 0,this.head=e,this.tail=e;return}(l(e.replacementPrevious)||l(e.replacementNext))&&zve(this,e),e.replacementPrevious=void 0,e.replacementNext=t,t.replacementPrevious=e,this.head=e};var q8=W8;function Nd(e){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._tilesRenderedThisFrame=new Set,this._tilesToRender=[],this._tileLoadQueueHigh=[],this._tileLoadQueueMedium=[],this._tileLoadQueueLow=[],this._tileReplacementQueue=new q8,this._levelZeroTiles=void 0,this._loadQueueTimeSlice=5,this._tilesInvalidated=!1,this._addHeightCallbacks=[],this._removeHeightCallbacks=[],this._tileToUpdateHeights=[],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 j8({ellipsoid:n}),this._tileLoadProgressEvent=new be,this._lastTileLoadQueueLength=0,this._lastSelectionFrameNumber=void 0}Object.defineProperties(Nd.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}},occluders:{get:function(){return this._occluders}}});Nd.prototype.invalidateAllTiles=function(){this._tilesInvalidated=!0};function VAt(e){let t=e._tileReplacementQueue;t.head=void 0,t.tail=void 0,t.count=0,Vve(e);let n=e._levelZeroTiles;if(l(n))for(let i=0;i<n.length;++i){let o=n[i].customData;for(let a of o)a.level=0,e._addHeightCallbacks.push(a);n[i].freeResources()}e._levelZeroTiles=void 0,e._tileProvider.cancelReprojections()}Nd.prototype.forEachLoadedTile=function(e){let t=this._tileReplacementQueue.head;for(;l(t);)t.state!==rc.START&&e(t),t=t.replacementNext};Nd.prototype.forEachRenderedTile=function(e){let t=this._tilesRenderedThisFrame;for(let n of t)e(n)};Nd.prototype.updateHeight=function(e,t){let n=this,i={positionOnEllipsoidSurface:void 0,positionCartographic:e,level:-1,callback:t};return i.removeFunc=function(){let r=n._addHeightCallbacks,o=r.length;for(let a=0;a<o;++a)if(r[a]===i){r.splice(a,1);break}n._removeHeightCallbacks.push(i),i.callback&&(i.callback=void 0)},n._addHeightCallbacks.push(i),i.removeFunc};Nd.prototype.update=function(e){l(this._tileProvider.update)&&this._tileProvider.update(e)};function Vve(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}Nd.prototype.beginFrame=function(e){e.passes.render&&(this._tilesInvalidated&&(VAt(this),this._tilesInvalidated=!1),this._tileProvider.initialize(e),Vve(this),!this._debug.suspendLodUpdate&&(this._tileReplacementQueue.markStartOfRenderFrame(),this._tilesRenderedThisFrame.clear()))};Nd.prototype.render=function(e){let t=e.passes,n=this._tileProvider;t.render&&(n.beginUpdate(e),WAt(this,e),tbt(this,e),n.endUpdate(e)),t.pick&&this._tilesToRender.length>0&&n.updateForPick(e)};function jAt(e,t){let n=e._tileLoadQueueHigh.length+e._tileLoadQueueMedium.length+e._tileLoadQueueLow.length;if(n!==e._lastTileLoadQueueLength||e._tilesInvalidated){let r=be.prototype.raiseEvent.bind(e._tileLoadProgressEvent,n);t.afterRender.push(()=>(r(),!0)),e._lastTileLoadQueueLength=n}let i=e._debug;i.enableDebugOutput&&!i.suspendLodUpdate&&(i.maxDepth=e._tilesToRender.reduce(function(r,o){return Math.max(r,o.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))}Nd.prototype.endFrame=function(e){!e.passes.render||e.mode===re.MORPHING||(JAt(this,e),ebt(this,e),jAt(this,e))};Nd.prototype.isDestroyed=function(){return!1};Nd.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var O1,Uve=new de;function HAt(e,t){let n=ie.center(e.rectangle,Uve),i=n.longitude-O1.longitude,r=n.latitude-O1.latitude;n=ie.center(t.rectangle,Uve);let o=n.longitude-O1.longitude,a=n.latitude-O1.latitude;return i*i+r*r-(o*o+a*a)}var GAt=new h,R1=[];function WAt(e,t){let n=e._debug;if(n.suspendLodUpdate)return;let i=e._tilesToRender;i.length=0;let r=e._tileProvider;if(!l(e._levelZeroTiles)){let d=r.tilingScheme;if(l(d)){let p=r.tilingScheme;e._levelZeroTiles=G8.createLevelZeroTiles(p);let g=e._levelZeroTiles.length;if(R1.length<g){R1=new Array(g);for(let m=0;m<g;++m)R1[m]===void 0&&(R1[m]=new M1)}}else return}e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;let o=e._levelZeroTiles,a=o.length>1?e._occluders:void 0;O1=t.camera.positionCartographic,o.sort(HAt);let s=e._addHeightCallbacks,c=e._removeHeightCallbacks;s.forEach(d=>{let p=o.find(g=>ie.contains(g.rectangle,d.positionCartographic));p&&p._addedCustomData.push(d)}),c.forEach(d=>{let p=o.find(g=>ie.contains(g.rectangle,d.positionCartographic));p&&p._removedCustomData.push(d)}),o.forEach(d=>d.updateCustomData()),s.length=0,c.length=0;let u=t.camera;e._cameraPositionCartographic=u.positionCartographic;let f=O.getTranslation(u.transform,GAt);e._cameraReferenceFrameOriginCartographic=e.tileProvider.tilingScheme.ellipsoid.cartesianToCartographic(f,e._cameraReferenceFrameOriginCartographic);for(let d=0;d<o.length;++d){let p=o[d];e._tileReplacementQueue.markTileRendered(p),p.renderable?Ec(e,p,r,t,a,!1,R1[d]):(xg(e,e._tileLoadQueueHigh,p,t),++n.tilesWaitingForChildren)}e._lastSelectionFrameNumber=t.frameNumber}function xg(e,t,n,i){n.needsLoading&&(e.tileProvider.computeTileLoadPriority!==void 0&&(n._loadPriority=e.tileProvider.computeTileLoadPriority(n,i)),t.push(n))}function M1(){this.allAreRenderable=!0,this.anyWereRenderedLastFrame=!1,this.notYetRenderableCount=0}function jve(){this.southwest=new M1,this.southeast=new M1,this.northwest=new M1,this.northeast=new M1}jve.prototype.combine=function(e){let t=this.southwest,n=this.southeast,i=this.northwest,r=this.northeast;e.allAreRenderable=t.allAreRenderable&&n.allAreRenderable&&i.allAreRenderable&&r.allAreRenderable,e.anyWereRenderedLastFrame=t.anyWereRenderedLastFrame||n.anyWereRenderedLastFrame||i.anyWereRenderedLastFrame||r.anyWereRenderedLastFrame,e.notYetRenderableCount=t.notYetRenderableCount+n.notYetRenderableCount+i.notYetRenderableCount+r.notYetRenderableCount};var oee=new Array(31);for(let e=0;e<oee.length;++e)oee[e]=new jve;function qAt(e,t,n,i,r){let o=e._debug;++o.tilesVisited,e._tileReplacementQueue.markTileRendered(n),n.updateCustomData(),n.level>o.maxDepthVisited&&(o.maxDepthVisited=n.level);let a=KAt(e,t,n)<e.maximumScreenSpaceError,s=n.southwestChild,c=n.southeastChild,u=n.northwestChild,f=n.northeastChild,d=e._lastSelectionFrameNumber,p=n._lastSelectionResultFrame===d?n._lastSelectionResult:fi.NONE,g=e.tileProvider;if(a||i){let m=fi.originalResult(p)===fi.RENDERED,y=fi.originalResult(p)===fi.CULLED||p===fi.NONE,A=n.state===rc.DONE,b=m||y||A;if(b||l(g.canRenderWithoutLosingDetail)&&(b=g.canRenderWithoutLosingDetail(n)),b){a&&xg(e,e._tileLoadQueueMedium,n,t),Y8(e,n),r.allAreRenderable=n.renderable,r.anyWereRenderedLastFrame=p===fi.RENDERED,r.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=fi.RENDERED,r.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}i=!0,a&&xg(e,e._tileLoadQueueHigh,n,t)}if(g.canRefine(n)){if(s.upsampledFromParent&&c.upsampledFromParent&&u.upsampledFromParent&&f.upsampledFromParent){Y8(e,n),xg(e,e._tileLoadQueueMedium,n,t),e._tileReplacementQueue.markTileRendered(s),e._tileReplacementQueue.markTileRendered(c),e._tileReplacementQueue.markTileRendered(u),e._tileReplacementQueue.markTileRendered(f),r.allAreRenderable=n.renderable,r.anyWereRenderedLastFrame=p===fi.RENDERED,r.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=fi.RENDERED,r.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=fi.REFINED;let y=e._tilesToRender.length,A=e._tileLoadQueueLow.length,b=e._tileLoadQueueMedium.length,x=e._tileLoadQueueHigh.length,T=e._tileToUpdateHeights.length;if(YAt(e,s,c,u,f,t,i,r),y!==e._tilesToRender.length){let C=r.allAreRenderable,E=r.anyWereRenderedLastFrame,w=r.notYetRenderableCount,D=!1;if(!C&&!E){let R=e._tilesToRender;for(let N=y;N<R.length;++N){let _=R[N];for(;_!==void 0&&_._lastSelectionResult!==fi.KICKED&&_!==n;)_._lastSelectionResult=fi.kick(_._lastSelectionResult),_=_.parent}e._tilesToRender.length=y,e._tileToUpdateHeights.length=T,Y8(e,n),n._lastSelectionResult=fi.RENDERED;let M=p===fi.RENDERED;!M&&w>e.loadingDescendantLimit&&(e._tileLoadQueueLow.length=A,e._tileLoadQueueMedium.length=b,e._tileLoadQueueHigh.length=x,xg(e,e._tileLoadQueueMedium,n,t),r.notYetRenderableCount=n.renderable?0:1,D=!0),r.allAreRenderable=n.renderable,r.anyWereRenderedLastFrame=M,M||e._tileToUpdateHeights.push(n),++o.tilesWaitingForChildren}e.preloadAncestors&&!D&&xg(e,e._tileLoadQueueLow,n,t)}return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=fi.RENDERED,Y8(e,n),xg(e,e._tileLoadQueueHigh,n,t),r.allAreRenderable=n.renderable,r.anyWereRenderedLastFrame=p===fi.RENDERED,r.notYetRenderableCount=n.renderable?0:1}function YAt(e,t,n,i,r,o,a,s){let c=o.camera.positionCartographic,u=e._tileProvider,f=e._occluders,d=oee[t.level],p=d.southwest,g=d.southeast,m=d.northwest,y=d.northeast;c.longitude<t.rectangle.east?c.latitude<t.rectangle.north?(Ec(e,t,u,o,f,a,p),Ec(e,n,u,o,f,a,g),Ec(e,i,u,o,f,a,m),Ec(e,r,u,o,f,a,y)):(Ec(e,i,u,o,f,a,m),Ec(e,t,u,o,f,a,p),Ec(e,r,u,o,f,a,y),Ec(e,n,u,o,f,a,g)):c.latitude<t.rectangle.north?(Ec(e,n,u,o,f,a,g),Ec(e,t,u,o,f,a,p),Ec(e,r,u,o,f,a,y),Ec(e,i,u,o,f,a,m)):(Ec(e,r,u,o,f,a,y),Ec(e,i,u,o,f,a,m),Ec(e,n,u,o,f,a,g),Ec(e,t,u,o,f,a,p)),d.combine(s)}function XAt(e,t){let n=t.rectangle;return l(e._cameraPositionCartographic)&&ie.contains(n,e._cameraPositionCartographic)||l(e._cameraReferenceFrameOriginCartographic)&&ie.contains(n,e._cameraReferenceFrameOriginCartographic)}function Ec(e,t,n,i,r,o,a){if(n.computeTileVisibility(t,i,r)!==Bo.NONE)return qAt(e,i,t,o,a);if(++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t),a.allAreRenderable=!0,a.anyWereRenderedLastFrame=!1,a.notYetRenderableCount=0,XAt(e,t)){(!l(t.data)||!l(t.data.vertexArray))&&xg(e,e._tileLoadQueueMedium,t,i);let s=e._lastSelectionFrameNumber,c=t._lastSelectionResultFrame===s?t._lastSelectionResult:fi.NONE;c!==fi.CULLED_BUT_NEEDED&&c!==fi.RENDERED&&e._tileToUpdateHeights.push(t),t._lastSelectionResult=fi.CULLED_BUT_NEEDED}else e.preloadSiblings||t.level===0?(xg(e,e._tileLoadQueueLow,t,i),t._lastSelectionResult=fi.CULLED):t._lastSelectionResult=fi.CULLED;t._lastSelectionResultFrame=i.frameNumber}function KAt(e,t,n){if(t.mode===re.SCENE2D||t.camera.frustum instanceof pn||t.camera.frustum instanceof Aa)return $At(e,t,n);let i=e._tileProvider.getLevelMaximumGeometricError(n.level),r=n._distance,o=t.context.drawingBufferHeight,a=t.camera.frustum.sseDenominator,s=i*o/(r*a);return t.fog.enabled&&(s-=I.fog(r,t.fog.density)*t.fog.sse),s/=t.pixelRatio,s}function $At(e,t,n){let r=t.camera.frustum,o=r.offCenterFrustum;l(o)&&(r=o);let a=t.context,s=a.drawingBufferWidth,c=a.drawingBufferHeight,u=e._tileProvider.getLevelMaximumGeometricError(n.level),f=Math.max(r.top-r.bottom,r.right-r.left)/Math.max(s,c),d=u/f;return t.fog.enabled&&t.mode!==re.SCENE2D&&(d-=I.fog(n._distance,t.fog.density)*t.fog.sse),d/=t.pixelRatio,d}function Y8(e,t){e._tilesToRender.push(t),e._tilesRenderedThisFrame.add(t)}function JAt(e,t){let n=e._tileLoadQueueHigh,i=e._tileLoadQueueMedium,r=e._tileLoadQueueLow;if(n.length===0&&i.length===0&&r.length===0)return;e._tileReplacementQueue.trimTiles(e.tileCacheSize);let o=An()+e._loadQueueTimeSlice,a=e._tileProvider,s=ree(e,t,a,o,n,!1);s=ree(e,t,a,o,i,s),ree(e,t,a,o,r,s)}function ZAt(e,t){return e._loadPriority-t._loadPriority}function ree(e,t,n,i,r,o){n.computeTileLoadPriority!==void 0&&r.sort(ZAt);for(let a=0,s=r.length;a<s&&(An()<i||!o);++a){let c=r[a];e._tileReplacementQueue.markTileRendered(c),n.loadTile(t,c),o=!0}return o}var bS=new hn,X8=new de,Qy=new h,QAt=[];function ebt(e,t){if(!l(e.tileProvider.tilingScheme))return;let n=QAt;n.length=0;let i=e._tileToUpdateHeights,r=An(),o=e._updateHeightsTimeSlice,a=r+o,s=t.mode,c=t.mapProjection,u=e.tileProvider.tilingScheme.ellipsoid,f;for(;i.length>0;){let d=i[0];if(!l(d.data)||!l(d.data.mesh)){let A=d._lastSelectionResultFrame===e._lastSelectionFrameNumber?d._lastSelectionResult:fi.NONE;(A===fi.RENDERED||A===fi.CULLED_BUT_NEEDED)&&n.push(d),d.clearPositionCache(),i.shift();continue}let p=d.customData;l(d._customDataIterator)||(d._customDataIterator=p.values());let g=d._customDataIterator,m=!1,y;for(;!(y=g.next()).done;){let A=y.value,b=d.data.terrainData,x=l(b)&&b.wasCreatedByUpsampling();if(d.level>A.level&&!x){let T,C=d.getPositionCacheEntry(A.positionCartographic,e.maximumScreenSpaceError);if(l(C))T=C;else{if(l(A.positionOnEllipsoidSurface)||(A.positionOnEllipsoidSurface=h.fromRadians(A.positionCartographic.longitude,A.positionCartographic.latitude,0,u)),s===re.SCENE3D){let E=u.geodeticSurfaceNormal(A.positionOnEllipsoidSurface,bS.direction),w=u.getSurfaceNormalIntersectionWithZAxis(A.positionOnEllipsoidSurface,11500,bS.origin);if(!l(w)){let D=0;l(d.data.tileBoundingRegion)&&(D=d.data.tileBoundingRegion.minimumHeight);let R=Math.min(D,-11500),M=h.multiplyByScalar(E,Math.abs(R)+1,Qy);h.subtract(A.positionOnEllipsoidSurface,M,bS.origin)}}else de.clone(A.positionCartographic,X8),X8.height=-11500,c.project(X8,Qy),h.fromElements(Qy.z,Qy.x,Qy.y,Qy),h.clone(Qy,bS.origin),h.clone(h.UNIT_X,bS.direction);T=d.data.pick(bS,s,c,!1,Qy),l(T)&&d.setPositionCacheEntry(A.positionCartographic,e.maximumScreenSpaceError,h.clone(T))}if(l(T)){if(l(A.callback)){let E=u.cartesianToCartographic(T,X8);A.callback(E)}A.level=d.level}}if(An()>=a){m=!0;break}}if(m){d._customDataIterator=g;break}else d._customDataIterator=void 0,i.shift()}for(f=0;f<n.length;f++)i.push(n[f])}function tbt(e,t){let n=e._tileProvider,i=e._tilesToRender;for(let r=0,o=i.length;r<o;++r){let a=i[r];n.showTileThisFrame(a,t)}}var K8=Nd;function Jh(e){e=e??te.default;let t=new B0({ellipsoid:e}),n=new uS,i=new _k({tilingScheme:t.tilingScheme});this._ellipsoid=e,this._imageryLayerCollection=n,this._surfaceShaderSet=new P8,this._material=void 0,this._surface=new K8({tileProvider:new U8({terrainProvider:t,imageryLayers:n,surfaceShaderSet:this._surfaceShaderSet,vectorProvider:i})}),this._terrainProvider=t,this._terrainProviderChanged=new be,this._vectorProvider=i,this._undergroundColor=U.clone(U.BLACK),this._undergroundColorAlphaByDistance=new Wt(e.maximumRadius/1e3,0,e.maximumRadius/5,1),this._translucency=new V8,see(this),this.show=!0,this._oceanNormalMapResourceDirty=!0,this._oceanNormalMapResource=new De({url:$t("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=te.WGS84.equals(e),this.atmosphereLightIntensity=10,this.atmosphereRayleighCoefficient=new h(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new h(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.lightingFadeOutDistance=I.PI_OVER_TWO*e.minimumRadius,this.lightingFadeInDistance=I.PI*e.minimumRadius,this.nightFadeOutDistance=I.PI_OVER_TWO*e.minimumRadius,this.nightFadeInDistance=5*I.PI_OVER_TWO*e.minimumRadius,this.showWaterEffect=!0,this.depthTestAgainstTerrain=!1,this.shadows=Rn.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(Jh.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 l(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){l(e)||(e=ie.clone(ie.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,l(e)&&(this._vectorProvider.tilingScheme=e.tilingScheme),this._terrainProviderChanged.raiseEvent(e),l(this._material)&&see(this))}},terrainProviderChanged:{get:function(){return this._terrainProviderChanged}},vectorProvider:{get:function(){return this._vectorProvider}},tileLoadProgressEvent:{get:function(){return this._surface.tileLoadProgressEvent}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,see(this))}},undergroundColor:{get:function(){return this._undergroundColor},set:function(e){this._undergroundColor=U.clone(e,this._undergroundColor)}},undergroundColorAlphaByDistance:{get:function(){return this._undergroundColorAlphaByDistance},set:function(e){this._undergroundColorAlphaByDistance=Wt.clone(e,this._undergroundColorAlphaByDistance)}},translucency:{get:function(){return this._translucency}}});function see(e){let t=[],n=l(e._material)&&(l(e._material.shaderSource.match(/slope/))||l(e._material.shaderSource.match("normalEC"))),i=[dp,I1];l(e._material)&&(!n||e._terrainProvider.hasVertexNormals)?(i.push(e._material.shaderSource),t.push("APPLY_MATERIAL"),e._surface._tileProvider.materialUniformMap=e._material._uniforms):e._surface._tileProvider.materialUniformMap=void 0,i.push(S8),e._surfaceShaderSet.baseVertexShaderSource=new Ge({sources:[dp,I1,w8],defines:t}),e._surfaceShaderSet.baseFragmentShaderSource=new Ge({sources:i,defines:t}),e._surfaceShaderSet.material=e._material}function nbt(e){return function(t,n){let i=se.distanceSquaredTo(t.pickBoundingSphere,e),r=se.distanceSquaredTo(n.pickBoundingSphere,e);return i-r}}var ibt=[],rbt={start:0,stop:0};Jh.prototype.pickWorldCoordinates=function(e,t,n,i){n=n??!0;let r=t.mode,o=t.mapProjection,a=ibt;a.length=0;for(let u of this._surface._tilesRenderedThisFrame){let f=u.data;if(!l(f))continue;let d=f.pickBoundingSphere;if(r!==re.SCENE3D)f.pickBoundingSphere=d=se.fromRectangleWithHeights2D(u.rectangle,o,f.tileBoundingRegion.minimumHeight,f.tileBoundingRegion.maximumHeight,d),h.fromElements(d.center.z,d.center.x,d.center.y,d.center);else if(l(f.renderedMesh))se.clone(f.tileBoundingRegion.boundingSphere,d);else continue;let p=ci.raySphere(e,d,rbt);l(p)&&a.push(f)}a.sort(nbt(e.origin));let s,c=a.length;for(let u=0;u<c&&(s=a[u].pick(e,t.mode,t.mapProjection,n,i),!l(s));++u);return s};var obt=new de;Jh.prototype.pick=function(e,t,n){if(n=this.pickWorldCoordinates(e,t,!0,n),l(n)&&t.mode!==re.SCENE3D){n=h.fromElements(n.y,n.z,n.x,n);let i=t.mapProjection.unproject(n,obt);n=this._ellipsoid.cartographicToCartesian(i,n)}return n};var abt=new h,Hve=new h,sbt=new de,cbt=new hn;function aee(e,t){return l(e)&&ie.contains(e.rectangle,t)?e:void 0}Jh.prototype.getHeight=function(e){let t=this._surface._levelZeroTiles;if(!l(t))return;let n,i,r=t.length;for(i=0;i<r&&(n=t[i],!ie.contains(n.rectangle,e));++i);if(i>=r)return;let o=n;for(;l(n);)n=aee(n._southwestChild,e)||aee(n._southeastChild,e)||aee(n._northwestChild,e)||n._northeastChild,l(n)&&l(n.data)&&l(n.data.renderedMesh)&&(o=n);if(n=o,!l(n)||!l(n.data)||!l(n.data.renderedMesh))return;let a=this._surface._tileProvider.tilingScheme.projection,s=this._surface._tileProvider.tilingScheme.ellipsoid,c=h.fromRadians(e.longitude,e.latitude,0,s,abt),u=cbt,f=s.geodeticSurfaceNormal(c,u.direction),d=s.getSurfaceNormalIntersectionWithZAxis(c,11500,u.origin);if(!l(d)){let g;l(n.data.tileBoundingRegion)&&(g=n.data.tileBoundingRegion.minimumHeight);let m=Math.min(g??0,-11500),y=h.multiplyByScalar(f,Math.abs(m)+1,Hve);h.subtract(c,y,u.origin)}let p=n.data.pick(u,re.SCENE3D,a,!1,Hve);if(l(p))return s.cartesianToCartographic(p,sbt).height};Jh.prototype.update=function(e){this.show&&e.passes.render&&this._surface.update(e)};Jh.prototype.beginFrame=function(e){let t=this._surface,n=t.tileProvider,i=this.terrainProvider,r=l(i)&&i.hasWaterMask&&i.hasWaterMask;if(r&&this._oceanNormalMapResourceDirty){this._oceanNormalMapResourceDirty=!1;let s=this._oceanNormalMapResource,c=s.url;if(l(c)){let u=this;s.fetchImage().then(function(f){c===u._oceanNormalMapResource.url&&(u._oceanNormalMap=u._oceanNormalMap&&u._oceanNormalMap.destroy(),u._oceanNormalMap=new Et({context:e.context,source:f}))})}else this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy()}let o=e.passes,a=e.mode;o.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=a===re.SCENE3D?this._zoomedOutOceanSpecularIntensity:0,n.hasWaterMask=r,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))};Jh.prototype.render=function(e){this.show&&(l(this._material)&&this._material.update(e.context),this._surface.render(e))};Jh.prototype.endFrame=function(e){this.show&&e.passes.render&&this._surface.endFrame(e)};Jh.prototype.isDestroyed=function(){return!1};Jh.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(),ue(this)};var $8=Jh;var L1=`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; // normalized surface normal (always facing the viewer) in model coordinates
|
|
vec3 normalEC = normalize(czm_normal * normalMC); // normalized surface normal in eye coordinates
|
|
|
|
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()
|
|
{
|
|
// PERFORMANCE_TODO: When dynamic branching is available, compute ratio of maximum and minimum radii
|
|
// in the vertex shader. Only when it is larger than some constant, march along the ray.
|
|
// Otherwise perform one intersection test which will be the common case.
|
|
|
|
// Test if the ray intersects a sphere with the ellipsoid's maximum radius.
|
|
// For very oblate ellipsoids, using the ellipsoid's radii for an intersection test
|
|
// may cause false negatives. This will discard fragments before marching the ray forward.
|
|
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;
|
|
}
|
|
|
|
// March ray forward to intersection with larger sphere and find
|
|
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;
|
|
}
|
|
|
|
// If the viewer is outside, compute outsideFaceColor, with normals facing outward.
|
|
vec4 outsideFaceColor = (intersection.start != 0.0) ? computeEllipsoidColor(ray, intersection.start, 1.0) : vec4(0.0);
|
|
|
|
// If the viewer either is inside or can see inside, compute insideFaceColor, with normals facing inward.
|
|
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 N1=`in vec3 position;
|
|
|
|
uniform vec3 u_radii;
|
|
|
|
out vec3 v_positionEC;
|
|
|
|
void main()
|
|
{
|
|
// In the vertex data, the cube goes from (-1.0, -1.0, -1.0) to (1.0, 1.0, 1.0) in model coordinates.
|
|
// Scale to consider the radii. We could also do this once on the CPU when using the BoxGeometry,
|
|
// but doing it here allows us to change the radii without rewriting the vertex data, and
|
|
// allows all ellipsoids to reuse the same vertex data.
|
|
vec4 p = vec4(u_radii * position, 1.0);
|
|
|
|
vec4 pEC = czm_modelView * p;
|
|
v_positionEC = pEC.xyz; // position in eye coordinates
|
|
gl_Position = czm_projection * pEC;
|
|
// With multi-frustum, when the ellipsoid primitive is positioned on the intersection of two frustums
|
|
// and close to terrain, the terrain (writes depth) in the closest frustum can overwrite part of the
|
|
// ellipsoid (does not write depth) that was rendered in the farther frustum.
|
|
//
|
|
// Here, we clamp the depth in the vertex shader to avoid being overwritten; however, this creates
|
|
// artifacts since some fragments can be alpha blended twice. This is solved by only rendering
|
|
// the ellipsoid in the closest frustum to the viewer.
|
|
gl_Position.z = clamp(gl_Position.z, czm_depthRange.near, czm_depthRange.far);
|
|
|
|
czm_vertexLogDepth();
|
|
}
|
|
`;var cee={position:0};function J8(e){e=e??H.EMPTY_OBJECT,this.center=h.clone(e.center??h.ZERO),this._center=new h,this.radii=h.clone(e.radii),this._radii=new h,this._oneOverEllipsoidRadiiSquared=new h,this._boundingSphere=new se,this.modelMatrix=O.clone(e.modelMatrix??O.IDENTITY),this._modelMatrix=new O,this._computedModelMatrix=new O,this.show=e.show??!0,this.material=e.material??ir.fromType(ir.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 nt({owner:e._owner??this}),this._pickCommand=new nt({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 lbt(e){let t=e.cache.ellipsoidPrimitive_vertexArray;if(l(t))return t;let n=Nc.createGeometry(Nc.fromDimensions({dimensions:new h(2,2,2),vertexFormat:Be.POSITION_ONLY}));return t=Vn.fromGeometry({context:e,geometry:n,attributeLocations:cee,bufferUsage:Oe.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=t,t}J8.prototype.update=function(e){if(!this.show||e.mode!==re.SCENE3D||!l(this.center)||!l(this.radii))return;let t=e.context,n=this.material.isTranslucent(),i=this._translucent!==n;(!l(this._rs)||i)&&(this._translucent=n,this._rs=je.fromCache({cull:{enabled:!0,face:Ui.FRONT},depthTest:{enabled:this._depthTestEnabled},depthMask:!n&&t.fragmentDepth,blending:n?en.ALPHA_BLEND:void 0})),l(this._va)||(this._va=lbt(t));let r=!1,o=this.radii;if(!h.equals(this._radii,o)){h.clone(o,this._radii);let y=this._oneOverEllipsoidRadiiSquared;y.x=1/(o.x*o.x),y.y=1/(o.y*o.y),y.z=1/(o.z*o.z),r=!0}(!O.equals(this.modelMatrix,this._modelMatrix)||!h.equals(this.center,this._center))&&(O.clone(this.modelMatrix,this._modelMatrix),h.clone(this.center,this._center),O.multiplyByTranslation(this.modelMatrix,this.center,this._computedModelMatrix),r=!0),r&&(h.clone(h.ZERO,this._boundingSphere.center),this._boundingSphere.radius=h.maximumComponent(o),se.transform(this._boundingSphere,this._computedModelMatrix,this._boundingSphere));let a=this._material!==this.material;this._material=this.material,this._material.update(t);let s=this.onlySunLighting!==this._onlySunLighting;this._onlySunLighting=this.onlySunLighting;let c=e.useLogDepth,u=this._useLogDepth!==c;this._useLogDepth=c;let f=this._colorCommand,d,p;(a||s||i||u)&&(d=new Ge({sources:[N1]}),p=new Ge({sources:[this.material.shaderSource,L1]}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(d.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._sp=Zt.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:d,fragmentShaderSource:p,attributeLocations:cee}),f.vertexArray=this._va,f.renderState=this._rs,f.shaderProgram=this._sp,f.uniformMap=Ot(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?Pe.TRANSLUCENT:Pe.OPAQUE,g.push(f)),m.pick){let y=this._pickCommand;(!l(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})),(a||s||!l(this._pickSP)||u)&&(d=new Ge({sources:[N1]}),p=new Ge({sources:[this.material.shaderSource,L1],pickColorQualifier:"uniform"}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(d.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._pickSP=Zt.replaceCache({context:t,shaderProgram:this._pickSP,vertexShaderSource:d,fragmentShaderSource:p,attributeLocations:cee}),y.vertexArray=this._va,y.renderState=this._rs,y.shaderProgram=this._pickSP,y.uniformMap=Ot(Ot(this._uniforms,this._pickUniforms),this.material._uniforms),y.executeInClosestFrustum=n),y.boundingVolume=this._boundingSphere,y.modelMatrix=this._computedModelMatrix,y.pass=n?Pe.TRANSLUCENT:Pe.OPAQUE,g.push(y)}};J8.prototype.isDestroyed=function(){return!1};J8.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(),ue(this)};var Z8=J8;function F1(e){e=e??H.EMPTY_OBJECT;let t=e.textureUrl;l(t)||(t=$t("Assets/Textures/moonSmall.jpg")),this.show=e.show??!0,this.textureUrl=t,this._ellipsoid=e.ellipsoid??te.MOON,this.onlySunLighting=e.onlySunLighting??!0,this._ellipsoidPrimitive=new Z8({radii:this.ellipsoid.radii,material:ir.fromType(ir.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new zN}Object.defineProperties(F1.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var Q8=new $,ubt=new $,fbt=new h,ej=[];F1.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;l(mt.computeIcrfToFixedMatrix(n,Q8))||mt.computeTemeToPseudoFixedMatrix(n,Q8);let i=this._axes.evaluate(n,ubt);$.transpose(i,i),$.multiply(Q8,i,i);let r=Sb.computeMoonPositionInEarthInertialFrame(n,fbt);$.multiplyByVector(Q8,r,r),O.fromRotationTranslation(i,r,t.modelMatrix);let o=e.commandList;return e.commandList=ej,ej.length=0,t.update(e),e.commandList=o,ej.length===1?ej[0]:void 0};F1.prototype.isDestroyed=function(){return!1};F1.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),ue(this)};var tj=F1;var nj=`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;
|
|
}
|
|
|
|
/**
|
|
* Estimate the geometric self-shadowing of the microfacets in a surface,
|
|
* using the Smith Joint GGX visibility function.
|
|
* Note: Vis = G / (4 * NdotL * NdotV)
|
|
* see Eric Heitz. 2014. Understanding the Masking-Shadowing Function in Microfacet-Based BRDFs. Journal of Computer Graphics Techniques, 3
|
|
* see Real-Time Rendering. Page 331 to 336.
|
|
* see https://google.github.io/filament/Filament.md.html#materialsystem/specularbrdf/geometricshadowing(specularg)
|
|
*
|
|
* @param {float} alphaRoughness The roughness of the material, expressed as the square of perceptual roughness.
|
|
* @param {float} NdotL The cosine of the angle between the surface normal and the direction to the light source.
|
|
* @param {float} NdotV The cosine of the angle between the surface normal and the direction to the camera.
|
|
*/
|
|
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; // 2.0 if NdotL = NdotV = 1.0
|
|
if (GGX > 0.0)
|
|
{
|
|
return 0.5 / GGX; // 1/4 if NdotL = NdotV = 1.0
|
|
}
|
|
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);
|
|
}
|
|
`;function B1(){this._colorTexture=void 0,this._drawCommand=void 0}Object.defineProperties(B1.prototype,{colorTexture:{get:function(){return this._colorTexture}}});function dbt(e,t,n){let i=t.createViewportQuadCommand(nj,{framebuffer:n,renderState:je.fromCache({viewport:new Je(0,0,256,256)})});e._drawCommand=i}B1.prototype.update=function(e){if(!l(this._colorTexture)){let t=e.context,n=new Et({context:t,width:256,height:256,pixelFormat:He.RGBA,pixelDatatype:ke.UNSIGNED_BYTE,sampler:Ut.NEAREST});this._colorTexture=n;let i=new Ta({context:t,colorTextures:[n],destroyAttachments:!1});dbt(this,t,i),this._drawCommand.execute(t),i.destroy(),this._drawCommand.shaderProgram=this._drawCommand.shaderProgram&&this._drawCommand.shaderProgram.destroy()}};B1.prototype.isDestroyed=function(){return!1};B1.prototype.destroy=function(){return this._colorTexture=this._colorTexture&&this._colorTexture.destroy(),ue(this)};var ij=B1;var Yve={};function hbt(e,t,n){let i,r,o;if(e instanceof Yi){let a=Math.tan(.5*e.fovy);return i=e.near,r=e.near*a,o=e.aspectRatio*r,Math.max(t*i/o,n*i/r)}else if(e instanceof ru)return i=e.near,r=e.top,o=e.right,Math.max(t*i/o,n*i/r);return Math.max(t,n)}var mbt=new h,Gve=new h;function Xve(e,t,n,i){if(l(i)&&n(.5)>i){let r=n(0),o=n(1),a=n(.5),s=a-r,c=a-o;return function(u){let f=n(u);if(u<=.5){let p=(f-r)/s;return I.lerp(e,-I.PI_OVER_TWO,p)}let d=(f-o)/c;return I.lerp(-I.PI_OVER_TWO,t,1-d)}}return function(r){return I.lerp(e,t,r)}}function uee(e,t,n,i,r){let o=r,a=Math.max(n,i);if(!l(o)){let s=e.position,c=t,u=e.up,f=e.right,d=e.frustum,p=h.subtract(s,c,mbt),g=h.magnitude(h.multiplyByScalar(u,h.dot(p,u),Gve)),m=h.magnitude(h.multiplyByScalar(f,h.dot(p,f),Gve));o=Math.min(hbt(d,g,m)*.2,1e9)}if(a<o){let u=-Math.pow((o-n)*1e6,.125),f=Math.pow((o-i)*1e6,1/8);return function(d){let p=d*(f-u)+u;return-Math.pow(p,8)/1e6+o}}return function(s){return I.lerp(n,i,s)}}function k1(e,t){return I.equalsEpsilon(e,I.TWO_PI,I.EPSILON11)&&(e=0),t>e+Math.PI?e+=I.TWO_PI:t<e-Math.PI&&(e-=I.TWO_PI),e}var Kve=new h;function pbt(e,t,n,i,r,o,a,s){let c=e.camera,u=h.clone(c.position,Kve),f=c.pitch,d=k1(c.heading,i),p=k1(c.roll,o),g=uee(c,n,u.z,n.z,a),m=Xve(f,r,g,s);function y(A){let b=A.time/t;c.setView({orientation:{heading:I.lerp(d,i,b),pitch:m(b),roll:I.lerp(p,o,b)}}),k.lerp(u,n,b,c.position),c.position.z=g(b)}return y}function gbt(e,t){e.longitude<t.longitude?e.longitude+=I.TWO_PI:t.longitude+=I.TWO_PI}function _bt(e,t){let n=e.longitude-t.longitude;n<-I.PI?e.longitude+=I.TWO_PI:n>I.PI&&(t.longitude+=I.TWO_PI)}var ybt=new de,Abt=new de;function bbt(e,t,n,i,r,o,a,s,c,u){let f=e.camera,p=e.mapProjection.ellipsoid,g=de.clone(f.positionCartographic,ybt),m=f.pitch,y=k1(f.heading,i),A=k1(f.roll,o),b=p.cartesianToCartographic(n,Abt);g.longitude=I.zeroToTwoPi(g.longitude),b.longitude=I.zeroToTwoPi(b.longitude);let x=!1;if(l(s)){let w=I.zeroToTwoPi(s),D=Math.min(g.longitude,b.longitude),R=Math.max(g.longitude,b.longitude),M=w>=D&&w<=R;if(l(c)){let N=Math.abs(g.longitude-b.longitude),_=I.TWO_PI-N;(M?N:_)<(M?_:N)*c&&!M&&(x=!0)}else M||(x=!0)}x?gbt(g,b):_bt(g,b);let T=uee(f,n,g.height,b.height,a),C=Xve(m,r,T,u);function E(){let w=g.longitude,D=b.longitude,R=g.latitude,M=b.latitude;return function(_){let v=_.time/t,S=h.fromRadians(I.lerp(w,D,v),I.lerp(R,M,v),T(v),p);f.setView({destination:S,orientation:{heading:I.lerp(y,i,v),pitch:C(v),roll:I.lerp(A,o,v)}})}}return E()}function xbt(e,t,n,i,r,o,a){let s=e.camera,c=h.clone(s.position,Kve),u=k1(s.heading,i),f=s.frustum.right-s.frustum.left,d=uee(s,n,f,n.z,a);function p(g){let m=g.time/t;s.setView({orientation:{heading:I.lerp(u,i,m)}}),k.lerp(c,n,m,s.position);let y=d(m),A=s.frustum,b=A.top/A.right,x=(y-(A.right-A.left))*.5;A.right+=x,A.left-=x,A.top=b*A.right,A.bottom=-A.top}return p}var Wve=new de,Tbt=new h;function lee(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function qve(e,t){function n(){typeof t=="function"&&t(),e.enableInputs=!0}return n}Yve.createTween=function(e,t){t=t??H.EMPTY_OBJECT;let n=t.destination,i=e.mode;if(i===re.MORPHING)return lee();let r=t.convert??!0,o=e.mapProjection,a=o.ellipsoid,s=t.maximumHeight,c=t.flyOverLongitude,u=t.flyOverLongitudeWeight,f=t.pitchAdjustHeight,d=t.easingFunction;r&&i!==re.SCENE3D&&(a.cartesianToCartographic(n,Wve),n=o.project(Wve,Tbt));let p=e.camera,g=t.endTransform;l(g)&&p._setTransform(g);let m=t.duration;l(m)||(m=Math.ceil(h.distance(p.position,n)/1e6)+2,m=Math.min(m,3));let y=t.heading??0,A=t.pitch??-I.PI_OVER_TWO,b=t.roll??0,x=e.screenSpaceCameraController;x.enableInputs=!1;let T=qve(x,t.complete),C=qve(x,t.cancel),E=p.frustum,w=e.mode===re.SCENE2D;if(w=w&&k.equalsEpsilon(p.position,n,I.EPSILON6),w=w&&I.equalsEpsilon(Math.max(E.right-E.left,E.top-E.bottom),n.z,I.EPSILON6),w=w||e.mode!==re.SCENE2D&&h.equalsEpsilon(n,p.position,I.EPSILON10),w=w&&I.equalsEpsilon(I.negativePiToPi(y),I.negativePiToPi(p.heading),I.EPSILON10)&&I.equalsEpsilon(I.negativePiToPi(A),I.negativePiToPi(p.pitch),I.EPSILON10)&&I.equalsEpsilon(I.negativePiToPi(b),I.negativePiToPi(p.roll),I.EPSILON10),w)return lee(T,C);let D=new Array(4);if(D[re.SCENE2D]=xbt,D[re.SCENE3D]=bbt,D[re.COLUMBUS_VIEW]=pbt,m<=0)return lee(function(){D[i](e,1,n,y,A,b,s,c,u,f)({time:1}),typeof T=="function"&&T()},C);let R=D[i](e,m,n,y,A,b,s,c,u,f);if(!l(d)){let M=p.positionCartographic.height,N=i===re.SCENE3D?a.cartesianToCartographic(n).height:n.z;M>N&&M>11500?d=ya.CUBIC_OUT:d=ya.QUINTIC_IN_OUT}return{duration:m,easingFunction:d,startObject:{time:0},stopObject:{time:m},update:R,complete:T,cancel:C}};var rj=Yve;var $ve={ROTATE:0,INFINITE_SCROLL:1};Object.freeze($ve);var Du=$ve;function rn(e){this._scene=e,this._transform=O.clone(O.IDENTITY),this._invTransform=O.clone(O.IDENTITY),this._actualTransform=O.clone(O.IDENTITY),this._actualInvTransform=O.clone(O.IDENTITY),this._transformChanged=!1,this.position=new h,this._position=new h,this._positionWC=new h,this._positionCartographic=new de,this._oldPositionWC=void 0,this.positionWCDeltaMagnitude=0,this.positionWCDeltaMagnitudeLastFrame=0,this.timeSinceMoved=0,this._lastMovedTimestamp=0,this.direction=new h,this._direction=new h,this._directionWC=new h,this.up=new h,this._up=new h,this._upWC=new h,this.right=new h,this._right=new h,this._rightWC=new h,this.frustum=new Yi,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=I.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 be,this._moveEnd=new be,this._changed=new be,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 O,this._invViewMatrix=new O,sEe(this),this._mode=re.SCENE3D,this._modeChanged=!0;let t=e.mapProjection;this._projection=t,this._maxCoord=t.project(new de(Math.PI,I.PI_OVER_TWO)),this._max2Dfrustum=void 0,AEe(this,rn.DEFAULT_VIEW_RECTANGLE,this.position,!0);let n=h.magnitude(this.position);n+=n*rn.DEFAULT_VIEW_FACTOR,h.normalize(this.position,this.position),h.multiplyByScalar(this.position,n,this.position)}rn.TRANSFORM_2D=new O(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);rn.TRANSFORM_2D_INVERSE=O.inverseTransformation(rn.TRANSFORM_2D,new O);rn.DEFAULT_VIEW_RECTANGLE=ie.fromDegrees(-95,-20,-70,90);rn.DEFAULT_VIEW_FACTOR=.5;rn.DEFAULT_OFFSET=new ph(0,-I.PI_OVER_FOUR,0);function sEe(e){O.computeView(e._position,e._direction,e._up,e._right,e._viewMatrix),O.multiply(e._viewMatrix,e._actualInvTransform,e._viewMatrix),O.inverseTransformation(e._viewMatrix,e._invViewMatrix)}function Cbt(e){if(!l(e._oldPositionWC))e._oldPositionWC=h.clone(e.positionWC,e._oldPositionWC);else{e.positionWCDeltaMagnitudeLastFrame=e.positionWCDeltaMagnitude;let t=h.subtract(e.positionWC,e._oldPositionWC,e._oldPositionWC);e.positionWCDeltaMagnitude=h.magnitude(t),e._oldPositionWC=h.clone(e.positionWC,e._oldPositionWC),e.positionWCDeltaMagnitude>0?(e.timeSinceMoved=0,e._lastMovedTimestamp=An()):e.timeSinceMoved=Math.max(An()-e._lastMovedTimestamp,0)/1e3}}rn.prototype.canPreloadFlight=function(){return l(this._currentFlight)&&this._mode!==re.SCENE2D};rn.prototype._updateCameraChanged=function(){let e=this;if(Cbt(e),e._changed.numberOfListeners===0)return;let t=e.percentageChanged,n=e.heading;l(e._changedHeading)||(e._changedHeading=n);let i=Math.abs(e._changedHeading-n)%I.TWO_PI;i=i>I.PI?I.TWO_PI-i:i;let r=i/Math.PI;r>t&&(e._changedHeading=n);let o=e.roll;l(e._changedRoll)||(e._changedRoll=o);let a=Math.abs(e._changedRoll-o)%I.TWO_PI;a=a>I.PI?I.TWO_PI-a:a;let s=a/Math.PI;if(s>t&&(e._changedRoll=o),(s>t||r>t)&&e._changed.raiseEvent(Math.max(s,r)),e._mode===re.SCENE2D){if(!l(e._changedFrustum)){e._changedPosition=h.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone();return}let p=e.position,g=e._changedPosition,m=e.frustum,y=e._changedFrustum,A=p.x+m.left,b=p.x+m.right,x=g.x+y.left,T=g.x+y.right,C=p.y+m.bottom,E=p.y+m.top,w=g.y+y.bottom,D=g.y+y.top,R=Math.max(A,x),M=Math.min(b,T),N=Math.max(C,w),_=Math.min(E,D),v;if(R>=M||N>=E)v=1;else{let S=y;A<x&&b>T&&C<w&&E>D&&(S=m),v=1-(M-R)*(_-N)/((S.right-S.left)*(S.top-S.bottom))}v>t&&(e._changed.raiseEvent(v),e._changedPosition=h.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone(e._changedFrustum));return}if(!l(e._changedDirection)){e._changedPosition=h.clone(e.positionWC,e._changedPosition),e._changedDirection=h.clone(e.directionWC,e._changedDirection);return}let c=I.acosClamped(h.dot(e.directionWC,e._changedDirection)),u;l(e.frustum.fovy)?u=c/(e.frustum.fovy*.5):u=c;let d=h.distance(e.positionWC,e._changedPosition)/e.positionCartographic.height;(u>t||d>t)&&(e._changed.raiseEvent(Math.max(u,d)),e._changedPosition=h.clone(e.positionWC,e._changedPosition),e._changedDirection=h.clone(e.directionWC,e._changedDirection))};function vbt(e){mt.basisTo2D(e._projection,e._transform,e._actualTransform)}var Ebt=new de,Sbt=new h,oj=new h,wbt=new ae,Ibt=new ae,Pbt=new ae,Dbt=new ae,Rbt=new ae;function Obt(e){let t=e._projection,n=t.ellipsoid,i=O.getColumn(e._transform,3,wbt),r=n.cartesianToCartographic(i,Ebt),o=t.project(r,Sbt),a=Ibt;a.x=o.z,a.y=o.x,a.z=o.y,a.w=1;let s=ae.clone(ae.UNIT_X,Rbt),c=ae.add(O.getColumn(e._transform,0,oj),i,oj);n.cartesianToCartographic(c,r),t.project(r,o);let u=Pbt;u.x=o.z,u.y=o.x,u.z=o.y,u.w=0,h.subtract(u,a,u),u.x=0;let f=Dbt;if(h.magnitudeSquared(u)>I.EPSILON10)h.cross(s,u,f);else{let d=ae.add(O.getColumn(e._transform,1,oj),i,oj);n.cartesianToCartographic(d,r),t.project(r,o),f.x=o.z,f.y=o.x,f.z=o.y,f.w=0,h.subtract(f,a,f),f.x=0,h.magnitudeSquared(f)<I.EPSILON10&&(ae.clone(ae.UNIT_Y,u),ae.clone(ae.UNIT_Z,f))}h.cross(f,s,u),h.normalize(u,u),h.cross(s,u,f),h.normalize(f,f),O.setColumn(e._actualTransform,0,u,e._actualTransform),O.setColumn(e._actualTransform,1,f,e._actualTransform),O.setColumn(e._actualTransform,2,s,e._actualTransform),O.setColumn(e._actualTransform,3,a,e._actualTransform)}var fee=new h;function nl(e){let t=e._mode,n=!1,i=0;t===re.SCENE2D&&(i=e.frustum.right-e.frustum.left,n=i!==e._positionCartographic.height);let r=e._position,o=!h.equals(r,e.position)||n;o&&(r=h.clone(e.position,e._position));let a=e._direction,s=!h.equals(a,e.direction);s&&(h.normalize(e.direction,e.direction),a=h.clone(e.direction,e._direction));let c=e._up,u=!h.equals(c,e.up);u&&(h.normalize(e.up,e.up),c=h.clone(e.up,e._up));let f=e._right,d=!h.equals(f,e.right);d&&(h.normalize(e.right,e.right),f=h.clone(e.right,e._right));let p=e._transformChanged||e._modeChanged;e._transformChanged=!1,p&&(O.inverseTransformation(e._transform,e._invTransform),e._mode===re.COLUMBUS_VIEW||e._mode===re.SCENE2D?O.equals(O.IDENTITY,e._transform)?O.clone(rn.TRANSFORM_2D,e._actualTransform):e._mode===re.COLUMBUS_VIEW?vbt(e):Obt(e):O.clone(e._transform,e._actualTransform),O.inverseTransformation(e._actualTransform,e._actualInvTransform),e._modeChanged=!1);let g=e._actualTransform;if(o||p)if(e._positionWC=O.multiplyByPoint(g,r,e._positionWC),t===re.SCENE3D||t===re.MORPHING)e._positionCartographic=e._projection.ellipsoid.cartesianToCartographic(e._positionWC,e._positionCartographic);else{let m=fee;m.x=e._positionWC.y,m.y=e._positionWC.z,m.z=e._positionWC.x,t===re.SCENE2D&&(m.z=i),e._projection.unproject(m,e._positionCartographic)}if(s||u||d){let m=h.dot(a,h.cross(c,f,fee));if(Math.abs(1-m)>I.EPSILON2){let y=1/h.magnitudeSquared(c),A=h.dot(c,a)*y,b=h.multiplyByScalar(a,A,fee);c=h.normalize(h.subtract(c,b,e._up),e._up),h.clone(c,e.up),f=h.cross(a,c,e._right),h.clone(f,e.right)}}(s||p)&&(e._directionWC=O.multiplyByPointAsVector(g,a,e._directionWC),h.normalize(e._directionWC,e._directionWC)),(u||p)&&(e._upWC=O.multiplyByPointAsVector(g,c,e._upWC),h.normalize(e._upWC,e._upWC)),(d||p)&&(e._rightWC=O.multiplyByPointAsVector(g,f,e._rightWC),h.normalize(e._rightWC,e._rightWC)),(o||s||u||d||p)&&sEe(e)}function cEe(e,t){let n;return I.equalsEpsilon(Math.abs(e.z),1,I.EPSILON3)?n=Math.atan2(t.y,t.x)-I.PI_OVER_TWO:n=Math.atan2(e.y,e.x)-I.PI_OVER_TWO,I.TWO_PI-I.zeroToTwoPi(n)}function lEe(e){return I.PI_OVER_TWO-I.acosClamped(e.z)}function uEe(e,t,n){let i=0;return I.equalsEpsilon(Math.abs(e.z),1,I.EPSILON3)||(i=Math.atan2(-n.z,t.z),i=I.zeroToTwoPi(i+I.TWO_PI)),i}var cj=new O,lj=new O;Object.defineProperties(rn.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return nl(this),this._invTransform}},viewMatrix:{get:function(){return nl(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return nl(this),this._invViewMatrix}},positionCartographic:{get:function(){return nl(this),this._positionCartographic}},positionWC:{get:function(){return nl(this),this._positionWC}},directionWC:{get:function(){return nl(this),this._directionWC}},upWC:{get:function(){return nl(this),this._upWC}},rightWC:{get:function(){return nl(this),this._rightWC}},heading:{get:function(){if(this._mode!==re.MORPHING){let e=this._projection.ellipsoid,t=O.clone(this._transform,cj),n=mt.eastNorthUpToFixedFrame(this.positionWC,e,lj);this._setTransform(n);let i=cEe(this.direction,this.up);return this._setTransform(t),i}}},pitch:{get:function(){if(this._mode!==re.MORPHING){let e=this._projection.ellipsoid,t=O.clone(this._transform,cj),n=mt.eastNorthUpToFixedFrame(this.positionWC,e,lj);this._setTransform(n);let i=lEe(this.direction);return this._setTransform(t),i}}},roll:{get:function(){if(this._mode!==re.MORPHING){let e=this._projection.ellipsoid,t=O.clone(this._transform,cj),n=mt.eastNorthUpToFixedFrame(this.positionWC,e,lj);this._setTransform(n);let i=uEe(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}}});rn.prototype.update=function(e){let t=!1;if(e!==this._mode&&(this._mode=e,this._modeChanged=e!==re.MORPHING,t=this._mode===re.SCENE2D),t){let n=this._max2Dfrustum=this.frustum.clone(),i=2,r=n.top/n.right;n.right=this._maxCoord.x*i,n.left=-n.right,n.top=r*n.right,n.bottom=-n.top}this._mode===re.SCENE2D&&mEe(this,this.position)};var Mbt=new h,Lbt=new h,Nbt=new h;rn.prototype._setTransform=function(e){let t=h.clone(this.positionWC,Mbt),n=h.clone(this.upWC,Lbt),i=h.clone(this.directionWC,Nbt);O.clone(e,this._transform),this._transformChanged=!0,nl(this);let r=this._actualInvTransform;O.multiplyByPoint(r,t,this.position),O.multiplyByPointAsVector(r,i,this.direction),O.multiplyByPointAsVector(r,n,this.up),h.cross(this.direction,this.up,this.right),nl(this)};var Fbt=new k,Bbt=new hn,kbt=new h,zbt=new h;function fEe(e){if(!O.equals(O.IDENTITY,e.transform))return h.magnitude(e.position);let t=e._scene,n=t.globe,i=Fbt;i.x=t.drawingBufferWidth/t.pixelRatio/2,i.y=t.drawingBufferHeight/t.pixelRatio/2;let r;if(l(n)){let s=e.getPickRay(i,Bbt);r=n.pickWorldCoordinates(s,t,!0,kbt)}let o;t.pickPositionSupported&&(o=t.pickPositionWorldCoordinates(i,zbt));let a;if(l(r)||l(o)){let s=l(o)?h.distance(o,e.positionWC):Number.POSITIVE_INFINITY,c=l(r)?h.distance(r,e.positionWC):Number.POSITIVE_INFINITY;a=Math.min(s,c)}else a=Math.max(e.positionCartographic.height,0);return a}rn.prototype._adjustOrthographicFrustum=function(e){this.frustum instanceof pn&&(!e&&this._positionCartographic.height<15e4||(this.frustum.width=fEe(this)))};var uj=new h,gee=new O,Ubt=new O,_ee=new Fe,yee=new $,dEe=new de;function Vbt(e,t,n){let i=O.clone(e.transform,gee),r=mt.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,Ubt);e._setTransform(r),h.clone(h.ZERO,e.position),n.heading=n.heading-I.PI_OVER_TWO;let o=Fe.fromHeadingPitchRoll(n,_ee),a=$.fromQuaternion(o,yee);$.getColumn(a,0,e.direction),$.getColumn(a,2,e.up),h.cross(e.direction,e.up,e.right),e._setTransform(i),e._adjustOrthographicFrustum(!0)}function jbt(e,t,n,i){let r=O.clone(e.transform,gee);if(e._setTransform(O.IDENTITY),!h.equals(t,e.positionWC)){if(i){let s=e._projection,c=s.ellipsoid.cartesianToCartographic(t,dEe);t=s.project(c,uj)}h.clone(t,e.position)}n.heading=n.heading-I.PI_OVER_TWO;let o=Fe.fromHeadingPitchRoll(n,_ee),a=$.fromQuaternion(o,yee);$.getColumn(a,0,e.direction),$.getColumn(a,2,e.up),h.cross(e.direction,e.up,e.right),e._setTransform(r),e._adjustOrthographicFrustum(!0)}function Hbt(e,t,n,i){let r=O.clone(e.transform,gee);if(e._setTransform(O.IDENTITY),!h.equals(t,e.positionWC)){if(i){let c=e._projection,u=c.ellipsoid.cartesianToCartographic(t,dEe);t=c.project(u,uj)}k.clone(t,e.position);let o=-t.z*.5,a=-o,s=e.frustum;if(a>o){let c=s.top/s.right;s.right=a,s.left=o,s.top=s.right*c,s.bottom=-s.top}}if(e._scene.mapMode2D===Du.ROTATE){n.heading=n.heading-I.PI_OVER_TWO,n.pitch=-I.PI_OVER_TWO,n.roll=0;let o=Fe.fromHeadingPitchRoll(n,_ee),a=$.fromQuaternion(o,yee);$.getColumn(a,2,e.up),h.cross(e.direction,e.up,e.right)}e._setTransform(r)}var Gbt=new h,Wbt=new h,qbt=new h;function hEe(e,t,n,i){let r=h.clone(n.direction,Gbt),o=h.clone(n.up,Wbt);if(e._scene.mode===re.SCENE3D){let s=e._projection.ellipsoid,c=mt.eastNorthUpToFixedFrame(t,s,cj),u=O.inverseTransformation(c,lj);O.multiplyByPointAsVector(u,r,r),O.multiplyByPointAsVector(u,o,o)}let a=h.cross(r,o,qbt);return i.heading=cEe(r,o),i.pitch=lEe(r),i.roll=uEe(r,o,a),i}var pee={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},xS=new Oc;rn.prototype.setView=function(e){e=e??H.EMPTY_OBJECT;let t=e.orientation??H.EMPTY_OBJECT,n=this._mode;if(n===re.MORPHING)return;l(e.endTransform)&&this._setTransform(e.endTransform);let i=e.convert??!0,r=e.destination??h.clone(this.positionWC,uj);l(r)&&l(r.west)&&(r=this.getRectangleCameraCoordinates(r,uj),i=!1),l(t.direction)&&(t=hEe(this,r,t,pee.orientation)),xS.heading=t.heading??0,xS.pitch=t.pitch??-I.PI_OVER_TWO,xS.roll=t.roll??0,n===re.SCENE3D?Vbt(this,r,xS):n===re.SCENE2D?Hbt(this,r,xS,i):jbt(this,r,xS,i)};var Ybt=new h;rn.prototype.flyHome=function(e){let t=this._mode;if(t===re.MORPHING&&this._scene.completeMorph(),t===re.SCENE2D)this.flyTo({destination:rn.DEFAULT_VIEW_RECTANGLE,duration:e,endTransform:O.IDENTITY});else if(t===re.SCENE3D){let n=this.getRectangleCameraCoordinates(rn.DEFAULT_VIEW_RECTANGLE),i=h.magnitude(n);i+=i*rn.DEFAULT_VIEW_FACTOR,h.normalize(n,n),h.multiplyByScalar(n,i,n),this.flyTo({destination:n,duration:e,endTransform:O.IDENTITY})}else if(t===re.COLUMBUS_VIEW){let n=this._projection.ellipsoid.maximumRadius,i=new h(0,-1,1);i=h.multiplyByScalar(h.normalize(i,i),5*n,i),this.flyTo({destination:i,duration:e,orientation:{heading:0,pitch:-Math.acos(h.normalize(i,Ybt).z),roll:0},endTransform:O.IDENTITY,convert:!1})}};rn.prototype.worldToCameraCoordinates=function(e,t){return l(t)||(t=new ae),nl(this),O.multiplyByVector(this._actualInvTransform,e,t)};rn.prototype.worldToCameraCoordinatesPoint=function(e,t){return l(t)||(t=new h),nl(this),O.multiplyByPoint(this._actualInvTransform,e,t)};rn.prototype.worldToCameraCoordinatesVector=function(e,t){return l(t)||(t=new h),nl(this),O.multiplyByPointAsVector(this._actualInvTransform,e,t)};rn.prototype.cameraToWorldCoordinates=function(e,t){return l(t)||(t=new ae),nl(this),O.multiplyByVector(this._actualTransform,e,t)};rn.prototype.cameraToWorldCoordinatesPoint=function(e,t){return l(t)||(t=new h),nl(this),O.multiplyByPoint(this._actualTransform,e,t)};rn.prototype.cameraToWorldCoordinatesVector=function(e,t){return l(t)||(t=new h),nl(this),O.multiplyByPointAsVector(this._actualTransform,e,t)};function mEe(e,t){let n=e._scene.mapMode2D===Du.ROTATE,i=e._maxCoord.x,r=e._maxCoord.y,o,a;n?(a=i,o=-a):(a=t.x-i*2,o=t.x+i*2),t.x>i&&(t.x=a),t.x<-i&&(t.x=o),t.y>r&&(t.y=r),t.y<-r&&(t.y=-r)}var Jve=new h;rn.prototype.move=function(e,t){let n=this.position;h.multiplyByScalar(e,t,Jve),h.add(n,Jve,n),this._mode===re.SCENE2D&&mEe(this,n),this._adjustOrthographicFrustum(!0)};rn.prototype.moveForward=function(e){e=e??this.defaultMoveAmount,this._mode===re.SCENE2D?fj(this,e):this.move(this.direction,e)};rn.prototype.moveBackward=function(e){e=e??this.defaultMoveAmount,this._mode===re.SCENE2D?fj(this,-e):this.move(this.direction,-e)};rn.prototype.moveUp=function(e){e=e??this.defaultMoveAmount,this.move(this.up,e)};rn.prototype.moveDown=function(e){e=e??this.defaultMoveAmount,this.move(this.up,-e)};rn.prototype.moveRight=function(e){e=e??this.defaultMoveAmount,this.move(this.right,e)};rn.prototype.moveLeft=function(e){e=e??this.defaultMoveAmount,this.move(this.right,-e)};rn.prototype.lookLeft=function(e){e=e??this.defaultLookAmount,this._mode!==re.SCENE2D&&this.look(this.up,-e)};rn.prototype.lookRight=function(e){e=e??this.defaultLookAmount,this._mode!==re.SCENE2D&&this.look(this.up,e)};rn.prototype.lookUp=function(e){e=e??this.defaultLookAmount,this._mode!==re.SCENE2D&&this.look(this.right,-e)};rn.prototype.lookDown=function(e){e=e??this.defaultLookAmount,this._mode!==re.SCENE2D&&this.look(this.right,e)};var Xbt=new Fe,Kbt=new $;rn.prototype.look=function(e,t){let n=t??this.defaultLookAmount,i=Fe.fromAxisAngle(e,-n,Xbt),r=$.fromQuaternion(i,Kbt),o=this.direction,a=this.up,s=this.right;$.multiplyByVector(r,o,o),$.multiplyByVector(r,a,a),$.multiplyByVector(r,s,s)};rn.prototype.twistLeft=function(e){e=e??this.defaultLookAmount,this.look(this.direction,e)};rn.prototype.twistRight=function(e){e=e??this.defaultLookAmount,this.look(this.direction,-e)};var $bt=new Fe,Jbt=new $;rn.prototype.rotate=function(e,t){let n=t??this.defaultRotateAmount,i=Fe.fromAxisAngle(e,-n,$bt),r=$.fromQuaternion(i,Jbt);$.multiplyByVector(r,this.position,this.position),$.multiplyByVector(r,this.direction,this.direction),$.multiplyByVector(r,this.up,this.up),h.cross(this.direction,this.up,this.right),h.cross(this.right,this.direction,this.up),this._adjustOrthographicFrustum(!1)};rn.prototype.rotateDown=function(e){e=e??this.defaultRotateAmount,pEe(this,e)};rn.prototype.rotateUp=function(e){e=e??this.defaultRotateAmount,pEe(this,-e)};var Zbt=new h,Qbt=new h,ext=new h,Zve=new h;function pEe(e,t){let n=e.position;if(l(e.constrainedAxis)&&!h.equalsEpsilon(e.position,h.ZERO,I.EPSILON2)){let i=h.normalize(n,Zbt),r=h.equalsEpsilon(i,e.constrainedAxis,I.EPSILON2),o=h.equalsEpsilon(i,h.negate(e.constrainedAxis,Zve),I.EPSILON2);if(!r&&!o){let a=h.normalize(e.constrainedAxis,Qbt),s=h.dot(i,a),c=I.acosClamped(s);t>0&&t>c&&(t=c-I.EPSILON4),s=h.dot(i,h.negate(a,Zve)),c=I.acosClamped(s),t<0&&-t>c&&(t=-c+I.EPSILON4);let u=h.cross(a,i,ext);e.rotate(u,t)}else(r&&t<0||o&&t>0)&&e.rotate(e.right,t)}else e.rotate(e.right,t)}rn.prototype.rotateRight=function(e){e=e??this.defaultRotateAmount,gEe(this,-e)};rn.prototype.rotateLeft=function(e){e=e??this.defaultRotateAmount,gEe(this,e)};function gEe(e,t){l(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function fj(e,t){let n=e.frustum,i;if(t=t*.5,Math.abs(n.top)+Math.abs(n.bottom)>Math.abs(n.left)+Math.abs(n.right)){let r=n.top-t,o=n.bottom+t,a=e._maxCoord.y;e._scene.mapMode2D===Du.ROTATE&&(a*=e.maximumZoomFactor),o>a&&(o=a,r=-a),r<=o&&(r=1,o=-1),i=n.right/n.top,n.top=r,n.bottom=o,n.right=n.top*i,n.left=-n.right}else{let r=n.right-t,o=n.left+t,a=e._maxCoord.x;e._scene.mapMode2D===Du.ROTATE&&(a*=e.maximumZoomFactor),r>a&&(r=a,o=-a),r<=o&&(r=1,o=-1),i=n.top/n.right,n.right=r,n.left=o,n.top=n.right*i,n.bottom=-n.top}}function _Ee(e,t){e.move(e.direction,t)}rn.prototype.zoomIn=function(e){e=e??this.defaultZoomAmount,this._mode===re.SCENE2D?fj(this,e):_Ee(this,e)};rn.prototype.zoomOut=function(e){e=e??this.defaultZoomAmount,this._mode===re.SCENE2D?fj(this,-e):_Ee(this,-e)};rn.prototype.getMagnitude=function(){if(this._mode===re.SCENE3D)return h.magnitude(this.position);if(this._mode===re.COLUMBUS_VIEW)return Math.abs(this.position.z);if(this._mode===re.SCENE2D)return Math.max(this.frustum.right-this.frustum.left,this.frustum.top-this.frustum.bottom)};var txt=new O;rn.prototype.lookAt=function(e,t){let i=this._scene.ellipsoid??te.default,r=mt.eastNorthUpToFixedFrame(e,i,txt);this.lookAtTransform(r,t)};var nxt=new h,ixt=new Fe,rxt=new Fe,oxt=new $;function yEe(e,t,n,i){t=I.clamp(t,-I.PI_OVER_TWO,I.PI_OVER_TWO),e=I.zeroToTwoPi(e)-I.PI_OVER_TWO;let r=Fe.fromAxisAngle(h.UNIT_Y,-t,ixt),o=Fe.fromAxisAngle(h.UNIT_Z,-e,rxt),a=Fe.multiply(o,r,o),s=$.fromQuaternion(a,oxt),c=h.clone(h.UNIT_X,i);return $.multiplyByVector(s,c,c),h.negate(c,c),h.multiplyByScalar(c,n,c),c}rn.prototype.lookAtTransform=function(e,t){if(this._setTransform(e),!l(t))return;let n;if(l(t.heading)?n=yEe(t.heading,t.pitch,t.range,nxt):n=t,this._mode===re.SCENE2D){k.clone(k.ZERO,this.position),h.negate(n,this.up),this.up.z=0,h.magnitudeSquared(this.up)<I.EPSILON10&&h.clone(h.UNIT_Y,this.up),h.normalize(this.up,this.up),this._setTransform(O.IDENTITY),h.negate(h.UNIT_Z,this.direction),h.cross(this.direction,this.up,this.right),h.normalize(this.right,this.right);let i=this.frustum,r=i.top/i.right;i.right=h.magnitude(n)*.5,i.left=-i.right,i.top=r*i.right,i.bottom=-i.top,this._setTransform(e);return}h.clone(n,this.position),h.negate(this.position,this.direction),h.normalize(this.direction,this.direction),h.cross(this.direction,h.UNIT_Z,this.right),h.magnitudeSquared(this.right)<I.EPSILON10&&h.clone(h.UNIT_X,this.right),h.normalize(this.right,this.right),h.cross(this.right,this.direction,this.up),h.normalize(this.up,this.up),this._adjustOrthographicFrustum(!0)};var axt=new O,Qve=new h,sxt=new h,eEe=new h;rn.prototype.lookAtWorldPosition=function(e,t=te.default){let n=O.clone(this._transform,axt);this._setTransform(O.IDENTITY);let i=h.subtract(e,this.positionWC,Qve);h.magnitudeSquared(i)<I.EPSILON8&&(i=h.clone(this.directionWC,Qve)),i=h.normalize(i,this.direction);let r=t.geodeticSurfaceNormal(e,sxt),o=h.cross(i,r,eEe);h.magnitudeSquared(o)<I.EPSILON8&&(o=h.clone(this.rightWC,eEe)),h.normalize(o,this.right);let a=h.cross(o,i,this.up);h.normalize(a,this.up),this._setTransform(n)};var z1=new de,cxt=new de,lxt=new h,uxt=new h,fxt=new h,dxt=new h,hxt=new h,mxt=new h,pxt=new h,dee=new h,gxt={direction:new h,right:new h,up:new h},tEe;function tl(e,t,n,i){return Math.abs(h.dot(t,n))/i-h.dot(e,n)}function AEe(e,t,n,i){let r=e._projection.ellipsoid,o=i?e:gxt,{north:a,south:s,west:c}=t,{east:u}=t;c>u&&(u+=I.TWO_PI);let f=(c+u)*.5,d;if(s<-I.PI_OVER_TWO+I.RADIANS_PER_DEGREE&&a>I.PI_OVER_TWO-I.RADIANS_PER_DEGREE)d=0;else{let M=z1;M.longitude=f,M.latitude=a,M.height=0;let N=cxt;N.longitude=f,N.latitude=s,N.height=0;let _=tEe;(!l(_)||_.ellipsoid!==r)&&(tEe=_=new E_(void 0,void 0,r)),_.setEndPoints(M,N),d=_.interpolateUsingFraction(.5,z1).latitude}let p=z1;p.longitude=f,p.latitude=d,p.height=0;let g=r.cartographicToCartesian(p,pxt),m=z1;m.longitude=u,m.latitude=a;let y=r.cartographicToCartesian(m,lxt);m.longitude=c;let A=r.cartographicToCartesian(m,fxt);m.longitude=f;let b=r.cartographicToCartesian(m,hxt);m.latitude=s;let x=r.cartographicToCartesian(m,mxt);m.longitude=u;let T=r.cartographicToCartesian(m,dxt);m.longitude=c;let C=r.cartographicToCartesian(m,uxt);h.subtract(A,g,A),h.subtract(T,g,T),h.subtract(y,g,y),h.subtract(C,g,C),h.subtract(b,g,b),h.subtract(x,g,x);let E=r.geodeticSurfaceNormal(g,o.direction);h.negate(E,E);let w=h.cross(E,h.UNIT_Z,o.right);h.normalize(w,w);let D=h.cross(w,E,o.up),R;if(e.frustum instanceof pn){let M=Math.max(h.distance(y,A),h.distance(T,C)),N=Math.max(h.distance(y,T),h.distance(A,C)),_,v,S=e.frustum._offCenterFrustum,P=S.right/S.top,L=N*P;M>L?(_=M,v=_/P):(v=N,_=L),R=Math.max(_,v)}else{let M=Math.tan(e.frustum.fovy*.5),N=e.frustum.aspectRatio*M;if(R=Math.max(tl(E,D,A,M),tl(E,D,T,M),tl(E,D,y,M),tl(E,D,C,M),tl(E,D,b,M),tl(E,D,x,M),tl(E,w,A,N),tl(E,w,T,N),tl(E,w,y,N),tl(E,w,C,N),tl(E,w,b,N),tl(E,w,x,N)),s<0&&a>0){let _=z1;_.longitude=c,_.latitude=0,_.height=0;let v=r.cartographicToCartesian(_,dee);h.subtract(v,g,v),R=Math.max(R,tl(E,D,v,M),tl(E,w,v,N)),_.longitude=u,v=r.cartographicToCartesian(_,dee),h.subtract(v,g,v),R=Math.max(R,tl(E,D,v,M),tl(E,w,v,N))}}return h.add(g,h.multiplyByScalar(E,-R,dee),n)}var _xt=new de,yxt=new h,Axt=new h;function bxt(e,t,n){let i=e._projection;t.west>t.east&&(t=ie.MAX_VALUE);let r=e._actualTransform,o=e._actualInvTransform,a=_xt;a.longitude=t.east,a.latitude=t.north;let s=i.project(a,yxt);O.multiplyByPoint(r,s,s),O.multiplyByPoint(o,s,s),a.longitude=t.west,a.latitude=t.south;let c=i.project(a,Axt);if(O.multiplyByPoint(r,c,c),O.multiplyByPoint(o,c,c),n.x=(s.x-c.x)*.5+c.x,n.y=(s.y-c.y)*.5+c.y,l(e.frustum.fovy)){let u=Math.tan(e.frustum.fovy*.5),f=e.frustum.aspectRatio*u;n.z=Math.max((s.x-c.x)/f,(s.y-c.y)/u)*.5}else{let u=s.x-c.x,f=s.y-c.y;n.z=Math.max(u,f)}return n}var xxt=new de,Txt=new h,Cxt=new h;function vxt(e,t,n){let i=e._projection,r=t.east;t.west>t.east&&(e._scene.mapMode2D===Du.INFINITE_SCROLL?r+=I.TWO_PI:(t=ie.MAX_VALUE,r=t.east));let o=xxt;o.longitude=r,o.latitude=t.north;let a=i.project(o,Txt);o.longitude=t.west,o.latitude=t.south;let s=i.project(o,Cxt),c=Math.abs(a.x-s.x)*.5,u=Math.abs(a.y-s.y)*.5,f,d,p=e.frustum.right/e.frustum.top,g=u*p;return c>g?(f=c,d=f/p):(d=u,f=g),u=Math.max(2*f,2*d),n.x=(a.x-s.x)*.5+s.x,n.y=(a.y-s.y)*.5+s.y,o=i.unproject(n,o),o.height=u,n=i.project(o,n),n}rn.prototype.getRectangleCameraCoordinates=function(e,t){let n=this._mode;if(l(t)||(t=new h),n===re.SCENE3D)return AEe(this,e,t);if(n===re.COLUMBUS_VIEW)return bxt(this,e,t);if(n===re.SCENE2D)return vxt(this,e,t)};var Ext=new hn;function Sxt(e,t,n,i){n=n??te.default;let r=e.getPickRay(t,Ext),o=ci.rayEllipsoid(r,n);if(!o)return;let a=o.start>0?o.start:o.stop;return hn.getPoint(r,a,i)}var wxt=new hn;function Ixt(e,t,n,i){let o=e.getPickRay(t,wxt).origin;o=h.fromElements(o.y,o.z,0,o);let a=n.unproject(o);if(!(a.latitude<-I.PI_OVER_TWO||a.latitude>I.PI_OVER_TWO))return n.ellipsoid.cartographicToCartesian(a,i)}var Pxt=new hn;function Dxt(e,t,n,i){let r=e.getPickRay(t,Pxt),o=-r.origin.x/r.direction.x;hn.getPoint(r,o,i);let a=n.unproject(new h(i.y,i.z,0));if(!(a.latitude<-I.PI_OVER_TWO||a.latitude>I.PI_OVER_TWO||a.longitude<-Math.PI||a.longitude>Math.PI))return n.ellipsoid.cartographicToCartesian(a,i)}rn.prototype.pickEllipsoid=function(e,t,n){let i=this._scene.canvas;if(!(i.clientWidth===0||i.clientHeight===0)){if(l(n)||(n=new h),t=t??te.default,this._mode===re.SCENE3D)n=Sxt(this,e,t,n);else if(this._mode===re.SCENE2D)n=Ixt(this,e,this._projection,n);else if(this._mode===re.COLUMBUS_VIEW)n=Dxt(this,e,this._projection,n);else return;return n}};var Rxt=new h,Oxt=new h,Mxt=new h;function Lxt(e,t,n){let i=e._scene.canvas,r=i.clientWidth,o=i.clientHeight,a=Math.tan(e.frustum.fovy*.5),s=e.frustum.aspectRatio*a,c=e.frustum.near,u=2/r*t.x-1,f=2/o*(o-t.y)-1,d=e.positionWC;h.clone(d,n.origin);let p=h.multiplyByScalar(e.directionWC,c,Rxt);h.add(d,p,p);let g=h.multiplyByScalar(e.rightWC,u*c*s,Oxt),m=h.multiplyByScalar(e.upWC,f*c*a,Mxt),y=h.add(p,g,n.direction);return h.add(y,m,y),h.subtract(y,d,y),h.normalize(y,y),n}var aj=new h;function Nxt(e,t,n){let i=e._scene.canvas,r=i.clientWidth,o=i.clientHeight,a=e.frustum,s=a.offCenterFrustum;l(s)&&(a=s);let c=2/r*t.x-1;c*=(a.right-a.left)*.5;let u=2/o*(o-t.y)-1;u*=(a.top-a.bottom)*.5;let f=n.origin;if(h.clone(e.positionWC,f),h.multiplyByScalar(e.rightWC,c,aj),h.add(aj,f,f),h.multiplyByScalar(e.upWC,u,aj),h.add(aj,f,f),h.clone(e.directionWC,n.direction),e._mode===re.SCENE2D&&e._scene.mapMode2D===Du.INFINITE_SCROLL){let d=e._maxCoord.x;f.y=I.mod(f.y+d,2*d)-d}return n}rn.prototype.getPickRay=function(e,t){l(t)||(t=new hn);let n=this._scene.canvas;if(n.clientWidth<=0||n.clientHeight<=0)return;let i=this.frustum;return l(i.aspectRatio)&&l(i.fov)&&l(i.near)?Lxt(this,e,t):Nxt(this,e,t)};var Fxt=new h,Bxt=new h;rn.prototype.distanceToBoundingSphere=function(e){let t=h.subtract(this.positionWC,e.center,Fxt),n=h.multiplyByScalar(this.directionWC,h.dot(t,this.directionWC),Bxt);return Math.max(0,h.magnitude(n)-e.radius)};var kxt=new k;rn.prototype.getPixelSize=function(e,t,n){let i=this.distanceToBoundingSphere(e),r=this.frustum.getPixelDimensions(t,n,i,this._scene.pixelRatio,kxt);return Math.max(r.x,r.y)};function zxt(e,t,n,i,r,o){let a=h.clone(t);n.y>i?a.y-=n.y-i:n.y<-i&&(a.y+=-i-n.y),n.z>r?a.z-=n.z-r:n.z<-r&&(a.z+=-r-n.z);function s(c){let u=h.lerp(t,a,c.time,new h);e.worldToCameraCoordinatesPoint(u,e.position)}return{easingFunction:ya.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:o,update:s}}var Uxt=new h,nEe=new h,Vxt=new h,jxt=new h;function Hxt(e,t){let n=e.position,i=e.direction,r=e.worldToCameraCoordinatesVector(h.UNIT_X,Uxt),o=-h.dot(r,n)/h.dot(r,i),a=h.add(n,h.multiplyByScalar(i,o,nEe),nEe);e.cameraToWorldCoordinatesPoint(a,a),n=e.cameraToWorldCoordinatesPoint(e.position,Vxt);let s=Math.tan(e.frustum.fovy*.5),c=e.frustum.aspectRatio*s,u=h.magnitude(h.subtract(n,a,jxt)),f=c*u,d=s*u,p=e._maxCoord.x,g=e._maxCoord.y,m=Math.max(f-p,p),y=Math.max(d-g,g);if(n.z<-m||n.z>m||n.y<-y||n.y>y){let A=a.y<-m||a.y>m,b=a.z<-y||a.z>y;if(A||b)return zxt(e,n,a,m,y,t)}}rn.prototype.createCorrectPositionTween=function(e){if(this._mode===re.COLUMBUS_VIEW)return Hxt(this,e)};var Gxt=new h,Ls={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};rn.prototype.cancelFlight=function(){l(this._currentFlight)&&(this._currentFlight.cancelTween(),this._currentFlight=void 0)};rn.prototype.completeFlight=function(){if(l(this._currentFlight)){this._currentFlight.cancelTween();let e={destination:void 0,orientation:{heading:void 0,pitch:void 0,roll:void 0}};e.destination=Ls.destination,e.orientation.heading=Ls.heading,e.orientation.pitch=Ls.pitch,e.orientation.roll=Ls.roll,this.setView(e),l(this._currentFlight.complete)&&this._currentFlight.complete(),this._currentFlight=void 0}};rn.prototype.flyTo=function(e){e=e??H.EMPTY_OBJECT;let t=e.destination;if(this._mode===re.MORPHING)return;this.cancelFlight();let i=t instanceof ie;i&&(t=this.getRectangleCameraCoordinates(t,Gxt));let r=e.orientation??H.EMPTY_OBJECT;if(l(r.direction)&&(r=hEe(this,t,r,pee.orientation)),l(e.duration)&&e.duration<=0){let f=pee;f.destination=e.destination,f.orientation.heading=r.heading,f.orientation.pitch=r.pitch,f.orientation.roll=r.roll,f.convert=e.convert,f.endTransform=e.endTransform,this.setView(f),typeof e.complete=="function"&&e.complete();return}let o=this,a;Ls.destination=t,Ls.heading=r.heading,Ls.pitch=r.pitch,Ls.roll=r.roll,Ls.duration=e.duration,Ls.complete=function(){a===o._currentFlight&&(o._currentFlight=void 0),l(e.complete)&&e.complete()},Ls.cancel=e.cancel,Ls.endTransform=e.endTransform,Ls.convert=i?!1:e.convert,Ls.maximumHeight=e.maximumHeight,Ls.pitchAdjustHeight=e.pitchAdjustHeight,Ls.flyOverLongitude=e.flyOverLongitude,Ls.flyOverLongitudeWeight=e.flyOverLongitudeWeight,Ls.easingFunction=e.easingFunction;let s=this._scene,c=rj.createTween(s,Ls);if(c.duration===0){typeof c.complete=="function"&&c.complete();return}a=s.tweens.add(c),this._currentFlight=a;let u=this._scene.preloadFlightCamera;this._mode!==re.SCENE2D&&(l(u)||(u=rn.clone(this)),u.setView({destination:t,orientation:r}),this._scene.preloadFlightCullingVolume=u.frustum.computeCullingVolume(u.positionWC,u.directionWC,u.upWC))};function Wxt(e,t){let n=e.frustum,i=Math.tan(n.fovy*.5),r=n.aspectRatio*i;return Math.max(t/r,t/i)}function qxt(e,t){let n=e.frustum,i=n.offCenterFrustum;l(i)&&(n=i);let r,o,a=n.right/n.top,s=t*a;return t>s?(r=t,o=r/a):(o=t,r=s),Math.max(r,o)*1.5}var Yxt=100;function bEe(e,t,n){n=ph.clone(l(n)?n:rn.DEFAULT_OFFSET);let i=e._scene.screenSpaceCameraController.minimumZoomDistance,r=e._scene.screenSpaceCameraController.maximumZoomDistance,o=n.range;if(!l(o)||o===0){let a=t.radius;a===0?n.range=Yxt:e.frustum instanceof pn||e._mode===re.SCENE2D?n.range=qxt(e,a):n.range=Wxt(e,a),n.range=I.clamp(n.range,i,r)}return n}rn.prototype.viewBoundingSphere=function(e,t){t=bEe(this,e,t),this.lookAt(e.center,t)};var Xxt=new O,iEe=new h,Kxt=new h,$xt=new h,Jxt=new h,Zxt=new ae,Qxt=new Fe,eTt=new $;rn.prototype.flyToBoundingSphere=function(e,t){t=t??H.EMPTY_OBJECT;let n=this._mode===re.SCENE2D||this._mode===re.COLUMBUS_VIEW;this._setTransform(O.IDENTITY);let i=bEe(this,e,t.offset),r;n?r=h.multiplyByScalar(h.UNIT_Z,i.range,iEe):r=yEe(i.heading,i.pitch,i.range,iEe);let a=this._scene.ellipsoid??te.default,s=mt.eastNorthUpToFixedFrame(e.center,a,Xxt);O.multiplyByPoint(s,r,r);let c,u;if(!n){if(c=h.subtract(e.center,r,Kxt),h.normalize(c,c),u=O.multiplyByPointAsVector(s,h.UNIT_Z,$xt),1-Math.abs(h.dot(c,u))<I.EPSILON6){let d=Fe.fromAxisAngle(c,i.heading,Qxt),p=$.fromQuaternion(d,eTt);h.fromCartesian4(O.getColumn(s,1,Zxt),u),$.multiplyByVector(p,u,u)}let f=h.cross(c,u,Jxt);h.cross(f,c,u),h.normalize(u,u)}this.flyTo({destination:r,orientation:{direction:c,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 rEe=new h,oEe=new h,hee=new h,aEe=new h,U1=[new h,new h,new h,new h];function tTt(e,t){let n=t.radii,i=e.positionWC,r=h.multiplyComponents(t.oneOverRadii,i,rEe),o=h.magnitude(r),a=h.normalize(r,oEe),s,c;h.equalsEpsilon(a,h.UNIT_Z,I.EPSILON10)?(s=new h(0,1,0),c=new h(0,0,1)):(s=h.normalize(h.cross(h.UNIT_Z,a,hee),hee),c=h.normalize(h.cross(a,s,aEe),aEe));let u=Math.sqrt(h.magnitudeSquared(r)-1),f=h.multiplyByScalar(a,1/o,rEe),d=u/o,p=h.multiplyByScalar(s,d,oEe),g=h.multiplyByScalar(c,d,hee),m=h.add(f,g,U1[0]);h.subtract(m,p,m),h.multiplyComponents(n,m,m);let y=h.subtract(f,g,U1[1]);h.subtract(y,p,y),h.multiplyComponents(n,y,y);let A=h.subtract(f,g,U1[2]);h.add(A,p,A),h.multiplyComponents(n,A,A);let b=h.add(f,g,U1[3]);return h.add(b,p,b),h.multiplyComponents(n,b,b),U1}var mee=new k,nTt=new h,eA=[new de,new de,new de,new de];function sj(e,t,n,i,r,o){mee.x=e,mee.y=t;let a=i.pickEllipsoid(mee,r,nTt);return l(a)?(eA[n]=r.cartesianToCartographic(a,eA[n]),1):(eA[n]=r.cartesianToCartographic(o[n],eA[n]),0)}rn.prototype.computeViewRectangle=function(e,t){e=e??te.default;let n=this.frustum.computeCullingVolume(this.positionWC,this.directionWC,this.upWC),i=new se(h.ZERO,e.maximumRadius);if(n.computeVisibility(i)===Xt.OUTSIDE)return;let o=this._scene.canvas,a=o.clientWidth,s=o.clientHeight,c=0,u=tTt(this,e);if(c+=sj(0,0,0,this,e,u),c+=sj(0,s,1,this,e,u),c+=sj(a,s,2,this,e,u),c+=sj(a,0,3,this,e,u),c<2)return ie.MAX_VALUE;t=ie.fromCartographicArray(eA,t);let f=0,d=eA[3].longitude;for(let p=0;p<4;++p){let g=eA[p].longitude,m=Math.abs(g-d);m>I.PI?f+=I.TWO_PI-m:f+=m,d=g}return I.equalsEpsilon(Math.abs(f),I.TWO_PI,I.EPSILON9)&&(t.west=-I.PI,t.east=I.PI,eA[0].latitude>=0?t.north=I.PI_OVER_TWO:t.south=-I.PI_OVER_TWO),t};rn.prototype.switchToPerspectiveFrustum=function(){if(this._mode===re.SCENE2D||this.frustum instanceof Yi)return;let e=this._scene;this.frustum=new Yi,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=I.toRadians(60)};rn.prototype.switchToOrthographicFrustum=function(){if(this._mode===re.SCENE2D||this.frustum instanceof pn)return;let e=fEe(this),t=this._scene;this.frustum=new pn,this.frustum.aspectRatio=t.drawingBufferWidth/t.drawingBufferHeight,this.frustum.width=e};rn.clone=function(e,t){return l(t)||(t=new rn(e._scene)),h.clone(e.position,t.position),h.clone(e.direction,t.direction),h.clone(e.up,t.up),h.clone(e.right,t.right),O.clone(e._transform,t.transform),t._transformChanged=!0,t.frustum=e.frustum.clone(),t};var Ir=rn;function iTt(e){this.pass=e.pass,this.commandList=e.commandList,this.camera=e.camera,this.cullingVolume=e.cullingVolume,this.ready=!1}var Zh=iTt;var Aee=class{constructor(){this._controllers=[],this._needsUpdate=new Set}get controllerCount(){return this._controllers.length}registerController(t,n,i){let r=i??this.controllerCount;this._controllers.splice(r,0,t),this._needsUpdate.add(t),t.connectedCallback(n)}unregisterController(t,n){let i=this._controllers,r=i.indexOf(t);r!==-1&&(i.splice(r,1),t.disconnectedCallback(n))}update(t,n){for(let i of this._controllers)i.enabled&&(this._needsUpdate.has(i)&&(i.firstUpdate(t,n),this._needsUpdate.delete(i)),i.update(t,n))}},dj=Aee;var EEe=La(Uu(),1),xEe=576,rTt=100,V1="#ffffff",hj="#48b";function SEe(e,t){this.credit=e,this.count=t??1}function oTt(e,t){let n=e.length;for(let i=0;i<n;i++){let r=e[i];if(wt.equals(r,t))return!0}return!1}function aTt(e){let t=e._previousCesiumCredit,n=e._currentCesiumCredit;wt.equals(n,t)||(l(t)&&e._cesiumCreditContainer.removeChild(t.element),l(n)&&e._cesiumCreditContainer.appendChild(n.element),e._previousCesiumCredit=n)}var wEe="cesium-credit-delimiter";function TEe(e){let t=document.createElement("span");return t.textContent=e,t.className=wEe,t}function CEe(e,t){if(l(t)){let n=document.createElement(t);n._creditId=e._creditId,n.appendChild(e),e=n}return e}function vEe(e,t,n,i){let r=e.childNodes,o=-1;t.sort(function(a,s){return s.count-a.count});for(let a=0;a<t.length;++a){let s=t[a].credit;if(l(s)){if(o=a,l(n)&&(o*=2,a>0)){let u=o-1;if(r.length<=u)e.appendChild(TEe(n));else{let f=r[u];f.className!==wEe&&e.replaceChild(TEe(n),f)}}let c=s.element;if(r.length<=o)e.appendChild(CEe(c,i));else{let u=r[o];u._creditId!==s._id&&e.replaceChild(CEe(c,i),u)}}}for(++o;o<r.length;)e.removeChild(r[o])}function sTt(e){let t=e._lightboxCredits,n=e.viewport.clientWidth,i=e.viewport.clientHeight;n!==e._lastViewportWidth&&(n<xEe?(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>=xEe&&i!==e._lastViewportHeight&&(t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`,e._lastViewportHeight=i)}function cTt(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: ${V1};
|
|
position: relative;
|
|
min-height: ${rTt}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: ${V1};
|
|
}
|
|
.cesium-credit-lightbox > ul > li a:hover {
|
|
color: ${hj};
|
|
}
|
|
.cesium-credit-lightbox.cesium-credit-lightbox-expanded {
|
|
border: 1px solid #444;
|
|
border-radius: 5px;
|
|
max-width: 470px;
|
|
}
|
|
.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: ${V1};
|
|
}
|
|
.cesium-credit-lightbox-close:hover {
|
|
color: ${hj};
|
|
}
|
|
.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: ${V1};
|
|
}
|
|
.cesium-credit-expand-link:hover {
|
|
color: ${hj};
|
|
}
|
|
|
|
.cesium-credit-text {
|
|
color: ${V1};
|
|
}
|
|
|
|
.cesium-credit-delimiter {
|
|
padding: 0 5px;
|
|
}
|
|
|
|
.cesium-credit-textContainer *,
|
|
.cesium-credit-logoContainer * {
|
|
display: inline;
|
|
}
|
|
|
|
.cesium-credit-textContainer a:hover {
|
|
color: ${hj}
|
|
}
|
|
|
|
.cesium-credit-textContainer .cesium-credit-wrapper:first-of-type {
|
|
padding-left: 5px;
|
|
}
|
|
`;function n(o){if(o.shadowRoot)return o.shadowRoot;if(o.getRootNode){let a=o.getRootNode();if(a instanceof ShadowRoot)return a}}let i=n(e)??document.head,r=document.createElement("style");r.innerHTML=t,i.appendChild(r)}function Ro(e,t,n){let i=this;n=n??document.body;let r=document.createElement("div");r.className="cesium-credit-lightbox-overlay",n.appendChild(r);let o=document.createElement("div");o.className="cesium-credit-lightbox",r.appendChild(o);function a(m){o.contains(m.target)||i.hideLightbox()}r.addEventListener("click",a,!1);let s=document.createElement("div");s.className="cesium-credit-lightbox-title",s.textContent="Data provided by:",o.appendChild(s);let c=document.createElement("a");c.onclick=this.hideLightbox.bind(this),c.innerHTML="×",c.className="cesium-credit-lightbox-close",o.appendChild(c);let u=document.createElement("ul");o.appendChild(u);let f=document.createElement("div");f.className="cesium-credit-logoContainer",f.style.display="inline",e.appendChild(f);let d=document.createElement("div");d.className="cesium-credit-textContainer",d.style.display="inline",e.appendChild(d);let p=document.createElement("a");p.className="cesium-credit-expand-link",p.onclick=this.showLightbox.bind(this),p.textContent="Data attribution",e.appendChild(p),cTt(e);let g=wt.clone(Ro.cesiumCredit);this._delimiter=t??"\u2022",this._screenContainer=d,this._cesiumCreditContainer=f,this._lastViewportHeight=void 0,this._lastViewportWidth=void 0,this._lightboxCredits=o,this._creditList=u,this._lightbox=r,this._hideLightbox=a,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 zt,lightboxCredits:new zt},this._defaultCredit=void 0,this.viewport=n,this.container=e}function IEe(e,t,n,i){i=i??1;let r=t.get(n.id);if(l(r))r.count<Number.MAX_VALUE&&(r.count+=i);else{let o=e._creditDisplayElementPool,a=e._creditDisplayElementPoolIndex;a<o.length?(r=o[a],r.credit=n,r.count=i):(r=new SEe(n,i),o.push(r)),++e._creditDisplayElementPoolIndex,t.set(n.id,r)}}Ro.prototype.addCreditToNextFrame=function(e){if(e.isIon()){l(this._defaultCredit)||(this._defaultCredit=wt.clone(PEe())),this._currentCesiumCredit=this._defaultCredit;return}let t;e.showOnScreen?t=this._currentFrameCredits.screenCredits:t=this._currentFrameCredits.lightboxCredits,IEe(this,t,e)};Ro.prototype.addStaticCredit=function(e){let t=this._staticCredits;oTt(t,e)||t.push(e)};Ro.prototype.removeStaticCredit=function(e){let t=this._staticCredits,n=t.indexOf(e);n!==-1&&t.splice(n,1)};Ro.prototype.showLightbox=function(){this._lightbox.style.display="block",this._expanded=!0};Ro.prototype.hideLightbox=function(){this._lightbox.style.display="none",this._expanded=!1};Ro.prototype.update=function(){this._expanded&&sTt(this)};Ro.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 r=0;r<i.length;++r){let o=i[r],a=o.showOnScreen?t:n;o.isIon()&&wt.equals(Ro.cesiumCredit,this._cesiumCredit)||IEe(this,a,o,Number.MAX_VALUE)}wt.equals(Ro.cesiumCredit,this._cesiumCredit)||(this._cesiumCredit=wt.clone(Ro.cesiumCredit)),this._currentCesiumCredit=this._cesiumCredit};Ro.prototype.endFrame=function(){let e=this._currentFrameCredits.screenCredits.values;vEe(this._screenContainer,e,this._delimiter,void 0);let t=this._currentFrameCredits.lightboxCredits.values;this._expandLink.style.display=t.length>0?"inline":"none",vEe(this._creditList,t,void 0,"li"),aTt(this)};Ro.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),ue(this)};Ro.prototype.isDestroyed=function(){return!1};Ro._cesiumCredit=void 0;Ro._cesiumCreditInitialized=!1;var mj;function PEe(){if(!l(mj)){let e=$t("Assets/Images/ion-credit.png");e.indexOf("http://")!==0&&e.indexOf("https://")!==0&&e.indexOf("data:")!==0&&(e=new EEe.default(e).path()),mj=new wt(`<a href="https://cesium.com/" target="_blank"><img src="${e}" style="vertical-align: -7px" title="Cesium ion"/></a>`,!0)}return Ro._cesiumCreditInitialized||(Ro._cesiumCredit=mj,Ro._cesiumCreditInitialized=!0),mj}Object.defineProperties(Ro,{cesiumCredit:{get:function(){return PEe(),Ro._cesiumCredit},set:function(e){Ro._cesiumCredit=e,Ro._cesiumCreditInitialized=!0}}});Ro.CreditDisplayElement=SEe;var pj=Ro;function gj(e){e=e??H.EMPTY_OBJECT,this._camera=e.camera,this._frustumSplits=e.frustumSplits,this._color=e.color??U.CYAN,this._updateOnChange=e.updateOnChange??!0,this.show=e.show??!0,this.id=e.id,this._id=void 0,this._outlinePrimitives=[],this._planesPrimitives=[]}var lTt=new h,uTt=new $,fTt=new Fe,dTt=new Yi,hTt=new ru,mTt=new pn,pTt=new Aa,gTt=new U,_Tt=[1,1e5];gj.prototype.update=function(e){if(!this.show)return;let t=this._planesPrimitives,n=this._outlinePrimitives,i,r;if(this._updateOnChange){for(r=t.length,i=0;i<r;++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 o=this._camera,a=o.frustum,s;a instanceof Yi?s=dTt:a instanceof ru?s=hTt:a instanceof pn?s=mTt:s=pTt,s=a.clone(s);let c,u=this._frustumSplits;!l(u)||u.length<=1?(u=_Tt,u[0]=this._camera.frustum.near,u[1]=this._camera.frustum.far,c=1):c=u.length-1;let f=o.positionWC,d=o.directionWC,p=o.upWC,g=o.rightWC;g=h.negate(g,lTt);let m=uTt;$.setColumn(m,0,g,m),$.setColumn(m,1,p,m),$.setColumn(m,2,d,m);let y=Fe.fromRotationMatrix(m,fTt);for(t.length=n.length=c,i=0;i<c;++i)s.near=u[i],s.far=u[i+1],t[i]=new Fn({geometryInstances:new Bt({geometry:new VC({origin:f,orientation:y,frustum:s,_drawNearPlane:i===0}),attributes:{color:Kt.fromColor(U.fromAlpha(this._color,.1,gTt))},id:this.id,pickPrimitive:this}),appearance:new _n({translucent:!0,flat:!0}),asynchronous:!1}),n[i]=new Fn({geometryInstances:new Bt({geometry:new SN({origin:f,orientation:y,frustum:s,_drawNearPlane:i===0}),attributes:{color:Kt.fromColor(this._color)},id:this.id,pickPrimitive:this}),appearance:new _n({translucent:!1,flat:!0}),asynchronous:!1})}for(r=t.length,i=0;i<r;++i)n[i].update(e),t[i].update(e)};gj.prototype.isDestroyed=function(){return!1};gj.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 ue(this)};var Tg=gj;var _j=`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); // left, bottom
|
|
vec2 maxPlane = vec2(czm_frustumPlanes.w, czm_frustumPlanes.x); // right, top
|
|
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 yj=`in vec4 position;
|
|
|
|
out vec4 positionEC;
|
|
|
|
void main()
|
|
{
|
|
positionEC = czm_modelView * position;
|
|
gl_Position = czm_projection * positionEC;
|
|
|
|
czm_vertexLogDepth();
|
|
}
|
|
`;function H1(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 j1=fn.supportsTypedArrays()?new Float32Array(12):[],DEe=new h,REe=new h,bee=new h,OEe=new h,Aj=new h;function yTt(e,t){let n=e.radii,i=t.camera,r,o,a;if(i.frustum instanceof pn)r=h.ZERO,o=i.rightWC,a=i.upWC;else{let d=i.positionWC,p=h.multiplyComponents(e.oneOverRadii,d,DEe),g=h.normalize(p,REe),m=h.normalize(h.cross(h.UNIT_Z,p,bee),bee),y=h.normalize(h.cross(g,m,OEe),OEe),A=h.magnitude(p),b=Math.sqrt(A*A-1);r=h.multiplyByScalar(g,1/A,DEe);let x=b/A;o=h.multiplyByScalar(m,x,REe),a=h.multiplyByScalar(y,x,bee)}let s=h.add(r,a,Aj);h.subtract(s,o,s),h.multiplyComponents(n,s,s),h.pack(s,j1,0);let c=h.subtract(r,a,Aj);h.subtract(c,o,c),h.multiplyComponents(n,c,c),h.pack(c,j1,3);let u=h.add(r,a,Aj);h.add(u,o,u),h.multiplyComponents(n,u,u),h.pack(u,j1,6);let f=h.subtract(r,a,Aj);return h.add(f,o,f),h.multiplyComponents(n,f,f),h.pack(f,j1,9),j1}H1.prototype.update=function(e){if(this._mode=e.mode,e.mode!==re.SCENE3D)return;let t=e.context,n=e.mapProjection.ellipsoid.radii,i=new te(n.x+this._ellipsoidOffset,n.y+this._ellipsoidOffset,n.z+this._ellipsoidOffset),r=e.useLogDepth;if(l(this._command)||(this._rs=je.fromCache({cull:{enabled:!0},depthTest:{enabled:!0},colorMask:{red:!1,green:!1,blue:!1,alpha:!1}}),this._command=new nt({renderState:this._rs,boundingVolume:new se(h.ZERO,i.maximumRadius),pass:Pe.OPAQUE,owner:this})),!l(this._sp)||this._useLogDepth!==r){this._useLogDepth=r;let a=new Ge({sources:[yj]}),s=new Ge({sources:[_j]});r&&(s.defines.push("LOG_DEPTH"),a.defines.push("LOG_DEPTH")),this._sp=Zt.replaceCache({shaderProgram:this._sp,context:t,vertexShaderSource:a,fragmentShaderSource:s,attributeLocations:{position:0}}),this._command.shaderProgram=this._sp}let o=yTt(i,e);if(l(this._va))this._va.getAttribute(0).vertexBuffer.copyFromArrayView(o);else{let a=new Tt({attributes:{position:new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:o})},indices:[0,1,2,2,1,3],primitiveType:Re.TRIANGLES});this._va=Vn.fromGeometry({context:t,geometry:a,attributeLocations:{position:0},bufferUsage:Oe.DYNAMIC_DRAW}),this._command.vertexArray=this._va}};H1.prototype.execute=function(e,t){this._mode===re.SCENE3D&&this._command.execute(e,t)};H1.prototype.isDestroyed=function(){return!1};H1.prototype.destroy=function(){this._sp=this._sp&&this._sp.destroy(),this._va=this._va&&this._va.destroy()};var bj=H1;function Px(){}var ATt=/\bgl_FragDepth\b/,bTt=/\bdiscard\b/;function xTt(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"depthOnly");if(l(n))return n;let i=t.fragmentShaderSource,r=!1,o=i.sources;for(let s=0;s<o.length;++s)if(ATt.test(o[s])||bTt.test(o[s])){r=!0;break}let a=i.defines.indexOf("LOG_DEPTH")>=0;if(!r&&!a){let s=`void main()
|
|
{
|
|
out_FragColor = vec4(1.0);
|
|
}
|
|
`;i=new Ge({sources:[s]})}else if(!r&&a){let s=`void main()
|
|
{
|
|
out_FragColor = vec4(1.0);
|
|
czm_writeLogDepth();
|
|
}
|
|
`;i=new Ge({defines:["LOG_DEPTH"],sources:[s]})}return e.shaderCache.createDerivedShaderProgram(t,"depthOnly",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:i,attributeLocations:t._attributeLocations})}function TTt(e,t){let n=e._depthOnlyRenderStateCache,i=n[t.id];if(l(i))return i;let r=je.getState(t);r.depthMask=!0,r.colorMask={red:!1,green:!1,blue:!1,alpha:!1};let o=je.fromCache(r);return n[t.id]=o,o}Px.createDepthOnlyDerivedCommand=function(e,t,n,i){l(i)||(i={});let r=i.depthOnlyCommand?.shaderProgram,o=i.depthOnlyCommand?.renderState;return i.depthOnlyCommand=nt.shallowClone(t,i.depthOnlyCommand),!l(r)||i.shaderProgramId!==t.shaderProgram.id?(i.depthOnlyCommand.shaderProgram=xTt(n,t.shaderProgram),i.depthOnlyCommand.renderState=TTt(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.depthOnlyCommand.shaderProgram=r,i.depthOnlyCommand.renderState=o),i};var CTt=/\s+czm_writeLogDepth\(/,vTt=/\s+czm_vertexLogDepth\(/;function ETt(e,t){if(t.fragmentShaderSource.defines.indexOf("LOG_DEPTH_READ_ONLY")>=0)return t;let i=e.shaderCache.getDerivedShaderProgram(t,"logDepth");if(l(i))return i;let r=t._attributeLocations,o=t.vertexShaderSource.clone(),a=t.fragmentShaderSource.clone();o.defines=l(o.defines)?o.defines.slice(0):[],o.defines.push("LOG_DEPTH"),a.defines=l(a.defines)?a.defines.slice(0):[],a.defines.push("LOG_DEPTH");let s=!1,c=o.sources;for(let f=0;f<c.length;++f)if(vTt.test(c[f])){s=!0;break}if(!s){for(let d=0;d<c.length;++d)c[d]=Ge.replaceMain(c[d],"czm_log_depth_main");c.push(`
|
|
|
|
void main()
|
|
{
|
|
czm_log_depth_main();
|
|
czm_vertexLogDepth();
|
|
}
|
|
`)}c=a.sources,s=!1;for(let f=0;f<c.length;++f)CTt.test(c[f])&&(s=!0);a.defines.indexOf("LOG_DEPTH_WRITE")!==-1&&(s=!0);let u="";if(!s){for(let f=0;f<c.length;f++)c[f]=Ge.replaceMain(c[f],"czm_log_depth_main");u=`
|
|
void main()
|
|
{
|
|
czm_log_depth_main();
|
|
czm_writeLogDepth();
|
|
}
|
|
`}return c.push(u),e.shaderCache.createDerivedShaderProgram(t,"logDepth",{vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:r})}Px.createLogDepthCommand=function(e,t,n){l(n)||(n={});let i=n.command?.shaderProgram;return n.command=nt.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=ETt(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};function STt(e,t,n){let i=e.shaderCache.getDerivedShaderProgram(t,"pick");if(l(i))return i;let r=t._attributeLocations,{sources:o,defines:a}=t.fragmentShaderSource,c=o.some(g=>g.includes("out_FragData"))?"out_FragData_0":"out_FragColor",u=`void main ()
|
|
{
|
|
czm_non_pick_main();
|
|
if (${c}.a == 0.0) {
|
|
discard;
|
|
}
|
|
${c} = ${n};
|
|
} `,f=o.length,d=new Array(f+1);for(let g=0;g<f;++g)d[g]=Ge.replaceMain(o[g],"czm_non_pick_main");d[f]=u;let p=new Ge({sources:d,defines:a});return e.shaderCache.createDerivedShaderProgram(t,"pick",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:p,attributeLocations:r})}function xee(e,t){let n=e.picking.pickRenderStateCache,i=n[t.id];if(l(i))return i;let r=je.getState(t);r.blending.enabled=!1,r.depthMask=!0;let o=je.fromCache(r);return n[t.id]=o,o}Px.createPickDerivedCommand=function(e,t,n,i){l(i)||(i={});let r=i.pickCommand?.shaderProgram,o=i.pickCommand?.renderState;return i.pickCommand=nt.shallowClone(t,i.pickCommand),!l(r)||i.shaderProgramId!==t.shaderProgram.id?(i.pickCommand.shaderProgram=STt(n,t.shaderProgram,t.pickId),i.pickCommand.renderState=xee(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.pickCommand.shaderProgram=r,i.pickCommand.renderState=o),i};var wTt=`uint rgba8UnormToUint32(vec4 c)
|
|
{
|
|
uvec4 b = uvec4(c * 255.0 + 0.5);
|
|
return (b.r) | (b.g << 8u) | (b.b << 16u) | (b.a << 24u);
|
|
}
|
|
`;function ITt(e,t,n){let i=e.shaderCache.getDerivedShaderProgram(t,"snap");if(l(i))return i;let r=t._attributeLocations,{sources:o,defines:a}=t.fragmentShaderSource,c=o.some(g=>g.includes("out_FragData"))?"out_FragData_0":"out_FragColor",u=`${wTt}
|
|
void main ()
|
|
{
|
|
czm_non_snap_main();
|
|
if (${c}.a == 0.0) {
|
|
discard;
|
|
}
|
|
${c} = ${n};
|
|
} `,f=o.length,d=new Array(f+1);for(let g=0;g<f;++g)d[g]=Ge.replaceMain(o[g],"czm_non_snap_main");d[f]=u;let p=new Ge({sources:d,defines:a});return e.shaderCache.createDerivedShaderProgram(t,"snap",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:p,attributeLocations:r})}Px.createSnapDerivedCommand=function(e,t,n,i){l(i)||(i={});let r=i.snapCommand?.shaderProgram,o=i.snapCommand?.renderState;return i.snapCommand=nt.shallowClone(t,i.snapCommand),!l(r)||i.shaderProgramId!==t.shaderProgram.id?(i.snapCommand.shaderProgram=ITt(n,t.shaderProgram,t.snapId),i.snapCommand.renderState=xee(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.snapCommand.shaderProgram=r,i.snapCommand.renderState=o),i};function TS(e,t,n){let i=e.length;for(let r=0;r<i;r++)e[r].trimStart().split(/\s+/)[0]===t&&(e[r]=`${t} ${n}`)}function PTt(e){return e.isArray?e.arrayLength:gt.getComponentCount(e.type)}function MEe(e,t,n){return`((${e} - float(${t})) / float(${n}))`}function LEe(e,t){let n=Mt.getMaximum(t);return`(${e}) / float(${n})`}function DTt(e,t){let n="float(value)";if(t.hasValueTransform){let i=t.offset,r=t.scale;n=MEe(n,i,r)}return e.normalized||(n=LEe(n,e.componentType)),n}function RTt(e,t,n){let r=`float(${`value.${n}`})`;if(t.hasValueTransform){let o=t.offset[n],a=t.scale[n];r=MEe(r,o,a)}return e.normalized||(r=LEe(r,e.componentType)),r}function OTt(e,t,n){let i=n.schemaId,r=n.className,o=n.propertyName,a=`pickMetadata-${i}-${r}-${o}`,s=e.shaderCache.getDerivedShaderProgram(t,a);if(l(s))return s;let c=n.metadataProperty,u=n.classProperty,f=u.getGlslType(),d=["0.0","0.0","0.0","0.0"],p=PTt(u);if(p===1)d[0]=DTt(u,c);else{let A=["x","y","z","w"];for(let b=0;b<p;b++)d[b]=RTt(u,c,A[b])}let g=t.fragmentShaderSource.defines.slice();g.push(Cd.METADATA_PICKING_ENABLED),TS(g,Cd.METADATA_PICKING_VALUE_TYPE,f),TS(g,Cd.METADATA_PICKING_VALUE_STRING,`metadata.${o}`),TS(g,Cd.METADATA_PICKING_VALUE_COMPONENT_X,d[0]),TS(g,Cd.METADATA_PICKING_VALUE_COMPONENT_Y,d[1]),TS(g,Cd.METADATA_PICKING_VALUE_COMPONENT_Z,d[2]),TS(g,Cd.METADATA_PICKING_VALUE_COMPONENT_W,d[3]);let m=new Ge({sources:t.fragmentShaderSource.sources,defines:g});return e.shaderCache.createDerivedShaderProgram(t,a,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:m,attributeLocations:t._attributeLocations})}Px.createPickMetadataDerivedCommand=function(e,t,n,i){return l(i)||(i={}),i.pickMetadataCommand=nt.shallowClone(t,i.pickMetadataCommand),i.pickMetadataCommand.shaderProgram=OTt(n,t.shaderProgram,t.pickedMetadataInfo),i.pickMetadataCommand.renderState=xee(e,t.renderState),i.shaderProgramId=t.shaderProgram.id,i};function MTt(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"HDR");if(l(n))return n;let i=t._attributeLocations,r=t.vertexShaderSource.clone(),o=t.fragmentShaderSource.clone();return r.defines=l(r.defines)?r.defines.slice(0):[],r.defines.push("HDR"),o.defines=l(o.defines)?o.defines.slice(0):[],o.defines.push("HDR"),e.shaderCache.createDerivedShaderProgram(t,"HDR",{vertexShaderSource:r,fragmentShaderSource:o,attributeLocations:i})}Px.createHdrCommand=function(e,t,n){l(n)||(n={});let i=n.command?.shaderProgram;return n.command=nt.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=MTt(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};var Op=Px;function xj(e){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 r=i.alpha;if(!l(r)){t._alpha=void 0,t._beta=void 0,t._gamma=void 0;return}t._alpha=I.toRadians(r),t._beta=I.toRadians(i.beta),t._gamma=I.toRadians(i.gamma)}window.addEventListener("deviceorientation",n,!1),this._removeListener=function(){window.removeEventListener("deviceorientation",n,!1)}}var LTt=new Fe,NEe=new Fe,NTt=new $;function FTt(e,t,n,i){let r=e.direction,o=e.right,a=e.up,s=Fe.fromAxisAngle(r,n,NEe),c=Fe.fromAxisAngle(o,i,LTt),u=Fe.multiply(c,s,c),f=Fe.fromAxisAngle(a,t,NEe);Fe.multiply(f,u,u);let d=$.fromQuaternion(u,NTt);$.multiplyByVector(d,o,o),$.multiplyByVector(d,a,a),$.multiplyByVector(d,r,r)}xj.prototype.update=function(){if(!l(this._alpha))return;l(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;FTt(this._scene.camera,-e,t,n),this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma};xj.prototype.isDestroyed=function(){return!1};xj.prototype.destroy=function(){return this._removeListener(),ue(this)};var Tj=xj;function Tee(){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(Tee.prototype,{heightFalloff:{get:function(){return this._heightFalloff},set:function(e){this._heightFalloff=e}}});var BTt=new h;Tee.prototype.update=function(e){if(!(e.fog.enabled=this.enabled))return;e.fog.renderable=this.renderable;let n=e.camera,i=n.positionCartographic;if(!l(i)||i.height>this.maxHeight||e.mode!==re.SCENE3D){e.fog.enabled=!1,e.fog.density=0;return}let r=i.height,o=this.density*this.heightScalar*Math.pow(Math.max(r/this.maxHeight,I.EPSILON4),-Math.max(this._heightFalloff,0)),a=h.normalize(n.positionWC,BTt),s=Math.abs(h.dot(n.directionWC,a));o*=1-s,e.fog.density=o,e.fog.visualDensityScalar=this.visualDensityScalar,e.fog.sse=this.screenSpaceErrorFactor,e.fog.minimumBrightness=this.minimumBrightness};var Cj=Tee;function kTt(e,t,n){this.context=e,this.commandList=[],this.panoramaCommandList=[],this.shadowMaps=[],this.brdfLutGenerator=void 0,this.environmentMap=void 0,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this.specularEnvironmentMapsMaximumLOD=void 0,this.mode=re.SCENE3D,this.morphTime=re.getMorphTime(re.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,snap:!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,this.edgeVisibilityRequested=!1,this.planarFillRequested=!1}var vj=kTt;var oc={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},Dx=oc.DERIVED_COMMANDS_MAXIMUM_LENGTH,WEe=["opaqueFrontFaceCommand","opaqueBackFaceCommand","depthOnlyFrontFaceCommand","depthOnlyBackFaceCommand","depthOnlyFrontAndBackFaceCommand","translucentFrontFaceCommand","translucentBackFaceCommand","translucentFrontFaceManualDepthTestCommand","translucentBackFaceManualDepthTestCommand","pickFrontFaceCommand","pickBackFaceCommand"];function Rx(){this._frontFaceAlphaByDistance=new Wt(0,1,0,1),this._backFaceAlphaByDistance=new Wt(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=ie.clone(ie.MAX_VALUE),this._derivedCommandKey=0,this._derivedCommandsDirty=!1,this._derivedCommandPacks=void 0,this._derivedCommandTypes=new Array(Dx),this._derivedBlendCommandTypes=new Array(Dx),this._derivedPickCommandTypes=new Array(Dx),this._derivedCommandTypesToUpdate=new Array(Dx),this._derivedCommandsLength=0,this._derivedBlendCommandsLength=0,this._derivedPickCommandsLength=0,this._derivedCommandsToUpdateLength=0}Object.defineProperties(Rx.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}}});Rx.prototype.update=function(e){let t=e.globe;if(!l(t)||!t.show){this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._sunVisibleThroughGlobe=!0,this._environmentVisible=!0,this._useDepthPlane=!1;return}this._frontFaceAlphaByDistance=FEe(t.translucency.enabled,t.translucency.frontFaceAlpha,t.translucency.frontFaceAlphaByDistance,this._frontFaceAlphaByDistance),this._backFaceAlphaByDistance=FEe(t.translucency.enabled,t.translucency.backFaceAlpha,t.translucency.backFaceAlphaByDistance,this._backFaceAlphaByDistance),this._frontFaceTranslucent=BEe(t.translucency.enabled,this._frontFaceAlphaByDistance,t),this._backFaceTranslucent=BEe(t.translucency.enabled,this._backFaceAlphaByDistance,t),this._requiresManualDepthTest=jTt(this,e,t),this._sunVisibleThroughGlobe=zTt(this,e),this._environmentVisible=UTt(this,e),this._useDepthPlane=VTt(this,e),this._numberOfTextureUniforms=HTt(this),this._rectangle=ie.clone(t.translucency.rectangle,this._rectangle),GTt(this,e)};function FEe(e,t,n,i){return e?l(n)?(Wt.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 BEe(e,t,n){return e&&(n.baseColor.alpha<1||t.nearValue<1||t.farValue<1)}function zTt(e,t){let n=e._frontFaceTranslucent,i=e._backFaceTranslucent;return n&&(t.cameraUnderground||i)}function UTt(e,t){return!t.cameraUnderground||e._frontFaceTranslucent}function VTt(e,t){return!t.cameraUnderground&&!e._frontFaceTranslucent}function jTt(e,t,n){return e._frontFaceTranslucent&&!e._backFaceTranslucent&&!n.depthTestAgainstTerrain&&t.mode!==re.SCENE2D&&t.context.depthTexture}function HTt(e){let t=0;return e._frontFaceTranslucent&&++t,e._requiresManualDepthTest&&++t,t}function GTt(e,t){e._derivedCommandsLength=Cee(e,t,!1,!1,e._derivedCommandTypes),e._derivedBlendCommandsLength=Cee(e,t,!0,!1,e._derivedBlendCommandTypes),e._derivedPickCommandsLength=Cee(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 r=0;for(n=0;n<Dx;++n)(i&1<<n)>0&&(e._derivedCommandTypesToUpdate[r++]=n);e._derivedCommandsToUpdateLength=r;let o=i!==e._derivedCommandKey;e._derivedCommandKey=i,e._derivedCommandsDirty=o,!l(e._derivedCommandPacks)&&e._frontFaceTranslucent&&(e._derivedCommandPacks=oCt())}function Cee(e,t,n,i,r){let o=0,a=e._frontFaceTranslucent,s=e._backFaceTranslucent;if(!a)return o;let c=t.cameraUnderground,u=e._requiresManualDepthTest,f=i?oc.PICK_FRONT_FACE:u?oc.TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:oc.TRANSLUCENT_FRONT_FACE,d=i?oc.PICK_BACK_FACE:u?oc.TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:oc.TRANSLUCENT_BACK_FACE;return t.mode===re.SCENE2D?(r[o++]=oc.DEPTH_ONLY_FRONT_FACE,r[o++]=f,o):(s?(n||(r[o++]=oc.DEPTH_ONLY_FRONT_AND_BACK_FACE),c?(r[o++]=f,r[o++]=d):(r[o++]=d,r[o++]=f)):c?(n||(r[o++]=oc.DEPTH_ONLY_BACK_FACE),r[o++]=oc.OPAQUE_FRONT_FACE,r[o++]=d):(n||(r[o++]=oc.DEPTH_ONLY_FRONT_FACE),r[o++]=oc.OPAQUE_BACK_FACE,r[o++]=f),o)}function Fd(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}function kEe(e,t){return e.indexOf(t)>-1}function WTt(e,t){Fd(e.defines,"TRANSLUCENT"),Fd(t.defines,"TRANSLUCENT")}function qTt(e,t){Fd(e.defines,"GROUND_ATMOSPHERE"),Fd(t.defines,"GROUND_ATMOSPHERE"),Fd(e.defines,"FOG"),Fd(t.defines,"FOG"),Fd(e.defines,"TRANSLUCENT"),Fd(t.defines,"TRANSLUCENT")}function vee(e,t){if(kEe(t.defines,"TILE_LIMIT_RECTANGLE")||kEe(t.defines,"ENABLE_CLIPPING_PLANES"))return;let n=`void main()
|
|
{
|
|
out_FragColor = vec4(1.0);
|
|
}
|
|
`;t.sources=[n]}function Eee(e,t){let n=t.sources,i=n.length;for(let o=0;o<i;++o)n[o]=Ge.replaceMain(n[o],"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 qEe(e,t){Eee(e,t),Fd(e.defines,"GROUND_ATMOSPHERE"),Fd(t.defines,"GROUND_ATMOSPHERE"),Fd(e.defines,"FOG"),Fd(t.defines,"FOG")}function YTt(e,t){Eee(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function XTt(e,t){qEe(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function zEe(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 KTt(e,t,n,i,r,o){if(!l(r))return t;if(!i&&l(n))return n;let a=e.shaderCache.getDerivedShaderProgram(t,o);if(!l(a)){let s=t._attributeLocations,c=t.vertexShaderSource.clone(),u=t.fragmentShaderSource.clone();c.defines=l(c.defines)?c.defines.slice(0):[],u.defines=l(u.defines)?u.defines.slice(0):[],r(c,u),a=e.shaderCache.createDerivedShaderProgram(t,o,{vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:s})}return a}function $Tt(e){e.cull.face=Ui.BACK,e.cull.enabled=!0}function JTt(e){e.cull.face=Ui.FRONT,e.cull.enabled=!0}function ZTt(e){e.cull.face=Ui.BACK,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function QTt(e){e.cull.face=Ui.FRONT,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function eCt(e){e.cull.enabled=!1,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function UEe(e){e.cull.face=Ui.BACK,e.cull.enabled=!0,e.depthMask=!1,e.blending=en.ALPHA_BLEND}function VEe(e){e.cull.face=Ui.FRONT,e.cull.enabled=!0,e.depthMask=!1,e.blending=en.ALPHA_BLEND}function tCt(e){e.cull.face=Ui.BACK,e.cull.enabled=!0,e.blending.enabled=!1}function nCt(e){e.cull.face=Ui.FRONT,e.cull.enabled=!0,e.blending.enabled=!1}function iCt(e,t,n,i,r){if(!l(i))return e;if(!n&&l(t))return t;let o=r[e.id];if(!l(o)){let a=je.getState(e);i(a),o=je.fromCache(a),r[e.id]=o}return o}function CS(e){return{u_classificationTexture:function(){return e._globeTranslucencyFramebuffer.classificationTexture}}}function rCt(e,t,n,i,r){return l(r)?!i&&l(n)?n:Ot(t,r(e),!1):t}function Qh(e){this.pass=e.pass,this.pickOnly=e.pickOnly,this.getShaderProgramFunction=e.getShaderProgramFunction,this.getRenderStateFunction=e.getRenderStateFunction,this.getUniformMapFunction=e.getUniformMapFunction,this.renderStateCache={}}function oCt(){return[new Qh({pass:Pe.GLOBE,pickOnly:!1,getShaderProgramFunction:WTt,getRenderStateFunction:$Tt,getUniformMapFunction:void 0}),new Qh({pass:Pe.GLOBE,pickOnly:!1,getShaderProgramFunction:qTt,getRenderStateFunction:JTt,getUniformMapFunction:void 0}),new Qh({pass:Pe.GLOBE,pickOnly:!1,getShaderProgramFunction:vee,getRenderStateFunction:ZTt,getUniformMapFunction:void 0}),new Qh({pass:Pe.GLOBE,pickOnly:!1,getShaderProgramFunction:vee,getRenderStateFunction:QTt,getUniformMapFunction:void 0}),new Qh({pass:Pe.GLOBE,pickOnly:!1,getShaderProgramFunction:vee,getRenderStateFunction:eCt,getUniformMapFunction:void 0}),new Qh({pass:Pe.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:Eee,getRenderStateFunction:UEe,getUniformMapFunction:CS}),new Qh({pass:Pe.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:qEe,getRenderStateFunction:VEe,getUniformMapFunction:CS}),new Qh({pass:Pe.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:YTt,getRenderStateFunction:UEe,getUniformMapFunction:CS}),new Qh({pass:Pe.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:XTt,getRenderStateFunction:VEe,getUniformMapFunction:CS}),new Qh({pass:Pe.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:zEe,getRenderStateFunction:tCt,getUniformMapFunction:CS}),new Qh({pass:Pe.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:zEe,getRenderStateFunction:nCt,getUniformMapFunction:CS})]}var jEe=new Array(Dx),HEe=new Array(Dx);Rx.prototype.updateDerivedCommands=function(e,t){let n=this._derivedCommandTypesToUpdate,i=this._derivedCommandsToUpdateLength;if(i!==0){for(let r=0;r<i;++r)HEe[r]=this._derivedCommandPacks[n[r]],jEe[r]=WEe[n[r]];aCt(this,e,i,n,jEe,HEe,t)}};function aCt(e,t,n,i,r,o,a){let s=t.derivedCommands.globeTranslucency,c=e._derivedCommandsDirty;if(t.dirty||!l(s)||c){t.dirty=!1,l(s)||(s={},t.derivedCommands.globeTranslucency=s);let u=a.frameNumber,f=s.uniformMapDirtyFrame??0,d=s.shaderProgramDirtyFrame??0,p=s.renderStateDirtyFrame??0,g=s.uniformMap!==t.uniformMap,m=s.shaderProgramId!==t.shaderProgram.id,y=s.renderStateId!==t.renderState.id;g&&(s.uniformMapDirtyFrame=u),m&&(s.shaderProgramDirtyFrame=u),y&&(s.renderStateDirtyFrame=u),s.uniformMap=t.uniformMap,s.shaderProgramId=t.shaderProgram.id,s.renderStateId=t.renderState.id;for(let A=0;A<n;++A){let b=o[A],x=i[A],T=r[A],C=s[T],E,w,D;l(C)?(E=C.uniformMap,w=C.shaderProgram,D=C.renderState):(E=void 0,w=void 0,D=void 0),C=nt.shallowClone(t,C),s[T]=C;let R=C.derivedCommands.uniformMapDirtyFrame??0,M=C.derivedCommands.shaderProgramDirtyFrame??0,N=C.derivedCommands.renderStateDirtyFrame??0,_=g||R<f,v=m||M<d,S=y||N<p;_&&(C.derivedCommands.uniformMapDirtyFrame=u),v&&(C.derivedCommands.shaderProgramDirtyFrame=u),S&&(C.derivedCommands.renderStateDirtyFrame=u),C.derivedCommands.type=x,C.pass=b.pass,C.pickOnly=b.pickOnly,C.uniformMap=rCt(e,t.uniformMap,E,_,b.getUniformMapFunction),C.shaderProgram=KTt(a.context,t.shaderProgram,w,v,b.getShaderProgramFunction,T),C.renderState=iCt(t.renderState,D,S,b.getRenderStateFunction,b.renderStateCache)}}}Rx.prototype.pushDerivedCommands=function(e,t,n){let i=n.passes.pick||n.passes.pickVoxel;if(i&&t)return;let r=this._derivedCommandTypes,o=this._derivedCommandsLength;if(i?(r=this._derivedPickCommandTypes,o=this._derivedPickCommandsLength):t&&(r=this._derivedBlendCommandTypes,o=this._derivedBlendCommandsLength),o===0){n.commandList.push(e);return}let a=e.derivedCommands.globeTranslucency;for(let s=0;s<o;++s){let c=WEe[r[s]];n.commandList.push(a[c])}};function YEe(e,t,n,i,r,o){for(let a=0;a<t;++a){let s=e[a],c=s.derivedCommands.type;(!l(o)||o.indexOf(c)>-1)&&n(s,i,r)}}function GEe(e,t,n,i,r){for(let o=0;o<t;++o)n(e[o],i,r)}var sCt=[oc.OPAQUE_FRONT_FACE,oc.OPAQUE_BACK_FACE],cCt=[oc.DEPTH_ONLY_FRONT_FACE,oc.DEPTH_ONLY_BACK_FACE,oc.DEPTH_ONLY_FRONT_AND_BACK_FACE];Rx.prototype.executeGlobeCommands=function(e,t,n,i,r){let o=i.context,a=e.commands[Pe.GLOBE],s=e.indices[Pe.GLOBE];s!==0&&(this._globeTranslucencyFramebuffer=n,n.clearClassification(o,r),YEe(a,s,t,i,r,sCt))};Rx.prototype.executeGlobeClassificationCommands=function(e,t,n,i,r){let{context:o}=i,{uniformState:a}=o,s=e.commands[Pe.GLOBE],c=e.indices[Pe.GLOBE],u=e.commands[Pe.TERRAIN_CLASSIFICATION],f=e.indices[Pe.TERRAIN_CLASSIFICATION];if(c===0||f===0)return;let d=this._frontFaceTranslucent,p=this._backFaceTranslucent;if((!d||!p)&&GEe(u,f,t,i,r),!d&&!p)return;this._globeTranslucencyFramebuffer=n;let g=a.globeDepthTexture,m=r.framebuffer;if(r.framebuffer=n.classificationFramebuffer,YEe(s,c,t,i,r,cCt),o.depthTexture){let y=n.packDepth(o,r);a.globeDepthTexture=y}GEe(u,f,t,i,r),a.globeDepthTexture=g,r.framebuffer=m};var Ej=Rx;var _f=`uniform sampler2D colorTexture;
|
|
|
|
in vec2 v_textureCoordinates;
|
|
|
|
void main()
|
|
{
|
|
out_FragColor = texture(colorTexture, v_textureCoordinates);
|
|
}
|
|
`;function Mp(){this._numSamples=1,this.previousFramebuffer=void 0,this._previousFramebuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this._fbo=new si({depthStencil:!0,createDepthAttachments:!1}),this._fboClassified=new si({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 ui({color:new U(0,0,0,0),owner:this}),this._clearCommand=new ui({color:new U(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(Mp.prototype,{unclassifiedCommand:{get:function(){return this._unclassifiedCommand}}});Mp.isTranslucencySupported=function(e){return e.depthTexture&&e.fragmentDepth};var lCt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:Qn.EQUAL,frontOperation:{fail:Pt.KEEP,zFail:Pt.KEEP,zPass:Pt.KEEP},backFunction:Qn.NEVER,reference:0,mask:qt.CLASSIFICATION_MASK},blending:en.ALPHA_BLEND},uCt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:Qn.NOT_EQUAL,frontOperation:{fail:Pt.KEEP,zFail:Pt.KEEP,zPass:Pt.KEEP},backFunction:Qn.NEVER,reference:0,mask:qt.CLASSIFICATION_MASK},blending:en.ALPHA_BLEND},fCt={depthMask:!0,depthTest:{enabled:!0},stencilTest:qt.setCesium3DTileBit(),stencilMask:qt.CESIUM_3D_TILE_MASK,blending:en.ALPHA_BLEND},dCt=`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;
|
|
}
|
|
`,hCt=`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
|
|
}
|
|
`;Mp.prototype.update=function(e,t,n){let i=this._fbo.getColorTexture(),r=this.previousFramebuffer!==this._previousFramebuffer;this._previousFramebuffer=this.previousFramebuffer;let o=this._numSamples!==t,a=e.drawingBufferWidth,s=e.drawingBufferHeight,c=!l(i)||i.width!==a||i.height!==s;if((c||r||o)&&(this._numSamples=t,this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),l(this._previousFramebuffer)||(this._depthStencilTexture=new Et({context:e,width:a,height:s,pixelFormat:He.DEPTH_STENCIL,pixelDatatype:ke.UNSIGNED_INT_24_8}),t>1&&(this._depthStencilRenderbuffer=new ld({context:e,width:a,height:s,format:fu.DEPTH24_STENCIL8,numSamples:t})))),!l(this._fbo.framebuffer)||c||r||o){this._fbo.destroy(),this._fboClassified.destroy();let u,f;l(this._previousFramebuffer)?(u=n.getDepthStencilTexture(),f=n.getDepthStencilRenderbuffer()):(u=this._depthStencilTexture,f=this._depthStencilRenderbuffer),this._fbo.setDepthStencilTexture(u),l(f)&&this._fbo.setDepthStencilRenderbuffer(f),this._fbo.update(e,a,s,t),l(this._previousFramebuffer)||(this._fboClassified.setDepthStencilTexture(u),this._fboClassified.update(e,a,s))}if(l(this._rsUnclassified)||(this._rsUnclassified=je.fromCache(lCt),this._rsClassified=je.fromCache(uCt),this._rsDefault=je.fromCache(fCt)),!l(this._unclassifiedCommand)||r||o){l(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy());let u=l(this._previousFramebuffer)?hCt:dCt,f=new Ge({defines:["UNCLASSIFIED"],sources:[u]}),d=new Ge({sources:[u]});this._unclassifiedCommand=e.createViewportQuadCommand(f,{renderState:l(this._previousFramebuffer)?this._rsUnclassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),this._classifiedCommand=e.createViewportQuadCommand(d,{renderState:l(this._previousFramebuffer)?this._rsClassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),l(this._translucentCommand)&&(this._translucentCommand.shaderProgram=this._translucentCommand.shaderProgram&&this._translucentCommand.shaderProgram.destroy()),l(this._previousFramebuffer)||(this._translucentCommand=e.createViewportQuadCommand(_f,{renderState:this._rsUnclassified,uniformMap:this._uniformMap,owner:this}))}};Mp.prototype.prepareTextures=function(e,t){this._fbo._numSamples>1&&this._fbo.prepareTextures(e,t)};Mp.prototype.clear=function(e,t){l(this._previousFramebuffer)?this._fbo.clear(e,this._clearColorCommand,t):(this._fbo.clear(e,this._clearCommand,t),this._fboClassified.clear(e,this._clearCommand,t))};Mp.prototype.executeClassified=function(e,t){if(!l(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)};Mp.prototype.executeUnclassified=function(e,t){this._unclassifiedCommand.execute(e,t)};Mp.prototype.isDestroyed=function(){return!1};Mp.prototype.destroy=function(){return this._fbo.destroy(),this._fboClassified.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),l(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy()),ue(this)};var G1=Mp;function Sj(e){this._total=e,this.usedThisFrame=0,this.stolenFromMeThisFrame=0,this.starvedThisFrame=!1,this.starvedLastFrame=!1}Object.defineProperties(Sj.prototype,{total:{get:function(){return this._total}}});function tA(e){let t=new Array(kc.NUMBER_OF_JOB_TYPES);t[kc.TEXTURE]=new Sj(l(e)?e[kc.TEXTURE]:10),t[kc.PROGRAM]=new Sj(l(e)?e[kc.PROGRAM]:10),t[kc.BUFFER]=new Sj(l(e)?e[kc.BUFFER]:30);let n=t.length,i,r=0;for(i=0;i<n;++i)r+=t[i].total;let o=new Array(n);for(i=0;i<n;++i)o[i]=!1;this._totalBudget=r,this._totalUsedThisFrame=0,this._budgets=t,this._executedThisFrame=o}tA.getTimestamp=An;Object.defineProperties(tA.prototype,{totalBudget:{get:function(){return this._totalBudget}}});tA.prototype.disableThisFrame=function(){this._totalUsedThisFrame=this._totalBudget};tA.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};tA.prototype.execute=function(e,t){let n=this._budgets,i=n[t],r=this._executedThisFrame[t];if(this._totalUsedThisFrame>=this._totalBudget&&r)return i.starvedThisFrame=!0,!1;let o;if(i.usedThisFrame+i.stolenFromMeThisFrame>=i.total){let c=n.length,u;for(u=0;u<c&&(o=n[u],!(o.usedThisFrame+o.stolenFromMeThisFrame<o.total&&!o.starvedLastFrame));++u);if(u===c&&r)return!1;r&&(i.starvedThisFrame=!0)}let a=tA.getTimestamp();e.execute();let s=tA.getTimestamp()-a;return this._totalUsedThisFrame+=s,o?o.stolenFromMeThisFrame+=s:i.usedThisFrame+=s,this._executedThisFrame[t]=!0,!0};var wj=tA;function Ij(e){e=e??H.EMPTY_OBJECT;let t=zn(e.container);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 r=document.createElement("div");r.className="cesium-performanceDisplay-ms",this._msText=document.createTextNode(""),r.appendChild(this._msText),n.appendChild(r),n.appendChild(i),this._container.appendChild(n),this._lastFpsSampleTime=An(),this._lastMsSampleTime=An(),this._fpsFrameCount=0,this._msFrameCount=0,this._throttled=!1;let o=document.createElement("div");o.className="cesium-performanceDisplay-throttled",this._throttledText=document.createTextNode(""),o.appendChild(this._throttledText),n.appendChild(o)}Object.defineProperties(Ij.prototype,{throttled:{get:function(){return this._throttled},set:function(e){this._throttled!==e&&(e?this._throttledText.nodeValue="(throttled)":this._throttledText.nodeValue="",this._throttled=e)}}});Ij.prototype.update=function(e){let t=An(),n=e??!0;this._fpsFrameCount++;let i=t-this._lastFpsSampleTime;if(i>1e3){let o="N/A";n&&(o=this._fpsFrameCount*1e3/i|0),this._fpsText.nodeValue=`${o} FPS`,this._lastFpsSampleTime=t,this._fpsFrameCount=0}this._msFrameCount++;let r=t-this._lastMsSampleTime;if(r>200){let o="N/A";n&&(o=(r/this._msFrameCount).toFixed(2)),this._msText.nodeValue=`${o} MS`,this._lastMsSampleTime=t,this._msFrameCount=0}};Ij.prototype.destroy=function(){return ue(this)};var nA=Ij;var ac={};ac.decodeRawMetadataValue=function(e,t,n){switch(e){case Mt.INT8:return t.getInt8(n);case Mt.UINT8:return t.getUint8(n);case Mt.INT16:return t.getInt16(n,!0);case Mt.UINT16:return t.getUint16(n,!0);case Mt.INT32:return t.getInt32(n,!0);case Mt.UINT32:return t.getUint32(n,!0);case Mt.INT64:return t.getBigInt64(n,!0);case Mt.UINT64:return t.getBigUint64(n,!0);case Mt.FLOAT32:return t.getFloat32(n,!0);case Mt.FLOAT64:return t.getFloat64(n,!0)}throw new oe(`Invalid component type: ${e}`)};ac.decodeRawMetadataValueComponent=function(e,t,n){let i=e.componentType,r=ac.decodeRawMetadataValue(i,t,n);return e.normalized?Mt.normalize(r,i):r};ac.decodeRawMetadataValueElement=function(e,t,n){let i=e.componentType,r=Mt.getSizeInBytes(i),o=e.type,a=gt.getComponentCount(o),s=r*a;if(a>1){let f=Array(a);for(let d=0;d<a;d++){let p=n*s+d*r,g=ac.decodeRawMetadataValueComponent(e,t,p);f[d]=g}return f}let c=n*s;return ac.decodeRawMetadataValueComponent(e,t,c)};ac.decodeRawMetadataValues=function(e,t){let n=new DataView(t.buffer,t.byteOffset,t.byteLength);if(e.isArray){let r=e.arrayLength,o=Array(r);for(let a=0;a<r;a++){let s=ac.decodeRawMetadataValueElement(e,n,a);o[a]=s}return o}return ac.decodeRawMetadataValueElement(e,n,0)};ac.convertToObjectType=function(e,t){if(!l(t)||e===gt.SCALAR||e===gt.STRING||e===gt.BOOLEAN||e===gt.ENUM)return t;let n=t.map(i=>Number(i));switch(e){case gt.VEC2:return k.unpack(n,0,new k);case gt.VEC3:return h.unpack(n,0,new h);case gt.VEC4:return ae.unpack(n,0,new ae);case gt.MAT2:return Zi.unpack(n,0,new Zi);case gt.MAT3:return $.unpack(n,0,new $);case gt.MAT4:return O.unpack(n,0,new O)}throw new oe(`Invalid metadata object type: ${e}`)};ac.convertFromObjectType=function(e,t){if(!l(t)||e===gt.SCALAR||e===gt.STRING||e===gt.BOOLEAN||e===gt.ENUM)return t;switch(e){case gt.VEC2:return k.pack(t,Array(2));case gt.VEC3:return h.pack(t,Array(3));case gt.VEC4:return ae.pack(t,Array(4));case gt.MAT2:return Zi.pack(t,Array(4));case gt.MAT3:return $.pack(t,Array(9));case gt.MAT4:return O.pack(t,Array(16))}throw new oe(`Invalid metadata object type: ${e}`)};ac.decodeMetadataValues=function(e,t,n){let i=ac.decodeRawMetadataValues(e,n);if(t.hasValueTransform){let o=ac.convertFromObjectType(e.type,t.offset),a=ac.convertFromObjectType(e.type,t.scale);i=A0.valueTransformInPlace(i,o,a,Mt.applyValueTransform)}if(e.isArray){let o=e.arrayLength,a=Array(o);for(let s=0;s<o;s++){let c=i[s],u=ac.convertToObjectType(e.type,c);a[s]=u}return a}return ac.convertToObjectType(e.type,i)};var Pj=Object.freeze(ac);function Ox(){this._framebuffer=new si,this._textureToCopy=void 0,this._copyDepthCommand=void 0}Object.defineProperties(Ox.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function mCt(e,t,n){let{width:i,height:r}=n;e._framebuffer.update(t,i,r)}function pCt(e,t,n){l(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:je.fromCache(),uniformMap:{colorTexture:function(){return e._textureToCopy}},owner:e})),e._textureToCopy=n,e._copyDepthCommand.framebuffer=e.framebuffer}Ox.prototype.update=function(e,t){mCt(this,e,t),pCt(this,e,t)};var gCt=new ae,_Ct=new ae(1,1/255,1/65025,1/16581375);Ox.prototype.getDepth=function(e,t,n){if(!l(this.framebuffer))return;let i=e.readPixels({x:t,y:n,width:1,height:1,framebuffer:this.framebuffer}),r=ae.unpack(i,0,gCt);return ae.divideByScalar(r,255,r),ae.dot(r,_Ct)};Ox.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)};Ox.prototype.isDestroyed=function(){return!1};Ox.prototype.destroy=function(){return this._framebuffer.destroy(),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=l(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy()),ue(this)};var Dj=Ox;function iA(){this._framebufferManager=new si({colorAttachmentsLength:3,createColorAttachments:!0,depthStencil:!0,supportsDepthTexture:!0,color:!0}),this._framebuffer=void 0,this._colorTexture=void 0,this._idTexture=void 0,this._depthTexture=void 0,this._depthStencilTexture=void 0,this._clearCommand=new ui({color:new U(0,0,0,0),depth:1,stencil:0,owner:this})}Object.defineProperties(iA.prototype,{framebuffer:{get:function(){return this._framebuffer}},colorTexture:{get:function(){return this._colorTexture}},idTexture:{get:function(){return this._idTexture}},depthTexture:{get:function(){return this._depthTexture}},depthStencilTexture:{get:function(){return this._depthStencilTexture}}});iA.prototype.update=function(e,t,n,i,r){let o=t.width,a=t.height,s=n?e.halfFloatingPointTexture?ke.HALF_FLOAT:ke.FLOAT:ke.UNSIGNED_BYTE,c=this._framebufferManager.update(e,o,a,1,s,He.RGBA);return this._framebufferManager.framebuffer&&(this._framebuffer=this._framebufferManager.framebuffer,this._colorTexture=l(i)?i:this._framebufferManager.getColorTexture(0),this._idTexture=this._framebufferManager.getColorTexture(1),this._depthTexture=this._framebufferManager.getColorTexture(2),this._depthStencilTexture=l(r)?r:this._framebufferManager.getDepthStencilTexture()),c};iA.prototype.clear=function(e,t,n){this.getClearCommand(n).execute(e,t)};iA.prototype.getClearCommand=function(e){return this._clearCommand.framebuffer=this._framebuffer,l(e)&&U.clone(e,this._clearCommand.color),this._clearCommand};iA.prototype.getFramebuffer=function(e,t,n,i){return this.update(e,t,!1,n,i),this._framebuffer};iA.prototype.isDestroyed=function(){return!1};iA.prototype.destroy=function(){return this._framebufferManager=this._framebufferManager&&this._framebufferManager.destroy(),this._clearCommand=void 0,ue(this)};var Rj=iA;function Mx(){this._framebufferManager=new si({colorAttachmentsLength:1,createColorAttachments:!0,depthStencil:!0,supportsDepthTexture:!0,color:!0}),this._framebuffer=void 0,this._idTexture=void 0,this._depthStencilTexture=void 0,this._clearCommand=new ui({color:new U(0,0,0,0),depth:1,stencil:0,owner:this})}Object.defineProperties(Mx.prototype,{framebuffer:{get:function(){return this._framebuffer}},idTexture:{get:function(){return this._idTexture}},depthStencilTexture:{get:function(){return this._depthStencilTexture}}});Mx.prototype.update=function(e,t,n){let i=t.width,r=t.height,o=e.colorBufferFloat?ke.FLOAT:ke.UNSIGNED_BYTE,a=this._framebufferManager.update(e,i,r,1,o,He.RED);return this._framebufferManager.framebuffer&&(this._framebuffer=this._framebufferManager.framebuffer,this._idTexture=this._framebufferManager.getColorTexture(0),this._depthStencilTexture=this._framebufferManager.getDepthStencilTexture()),a};Mx.prototype.getClearCommand=function(e){return this._clearCommand.framebuffer=this._framebuffer,l(e)&&U.clone(e,this._clearCommand.color),this._clearCommand};Mx.prototype.releaseResources=function(){l(this._framebuffer)&&(this._framebufferManager.destroy(),this._framebuffer=void 0,this._idTexture=void 0,this._depthStencilTexture=void 0)};Mx.prototype.isDestroyed=function(){return!1};Mx.prototype.destroy=function(){return this._framebufferManager=this._framebufferManager&&this._framebufferManager.destroy(),this._clearCommand=void 0,ue(this)};var Oj=Mx;function yCt(e,t){this.near=e??0,this.far=t??0;let n=Pe.NUMBER_OF_PASSES,i=new Array(n),r=new Array(n);for(let o=0;o<n;++o)i[o]=[],r[o]=0;this.commands=i,this.indices=r}var Mj=yCt;var Lx=`uniform highp sampler2D u_depthTexture;
|
|
|
|
in vec2 v_textureCoordinates;
|
|
|
|
void main()
|
|
{
|
|
out_FragColor = czm_packDepth(texture(u_depthTexture, v_textureCoordinates).r);
|
|
}
|
|
`;function Lp(){this._picking=!1,this._snapping=!1,this._numSamples=1,this._tempCopyDepthTexture=void 0,this._pickColorFramebuffer=new si({depthStencil:!0,supportsDepthTexture:!0}),this._snapColorFramebuffer=new si({depthStencil:!0,supportsDepthTexture:!0,pixelDatatype:ke.FLOAT,pixelFormat:He.RGBA}),this._outputFramebuffer=new si({depthStencil:!0,supportsDepthTexture:!0}),this._copyDepthFramebuffer=new si,this._tempCopyDepthFramebuffer=new si,this._updateDepthFramebuffer=new si({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 Je,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(Lp.prototype,{colorFramebufferManager:{get:function(){return this._snapping?this._snapColorFramebuffer: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}},snapping:{get:function(){return this._snapping},set:function(e){this._snapping=e}}});function XEe(e,t,n,i,r){let o=e._viewport;o.width=n,o.height=i;let a=!Je.equals(o,r.viewport),s=a!==e._useScissorTest;e._useScissorTest=a,Je.equals(e._scissorRectangle,r.viewport)||(e._scissorRectangle=Je.clone(r.viewport,e._scissorRectangle),s=!0),(!l(e._rs)||!Je.equals(o,e._rs.viewport)||s)&&(e._rs=je.fromCache({viewport:o,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}}),e._rsBlend=je.fromCache({viewport:o,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:en.ALPHA_BLEND}),e._rsUpdate=je.fromCache({viewport:o,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:Qn.EQUAL,frontOperation:{fail:Pt.KEEP,zFail:Pt.KEEP,zPass:Pt.KEEP},backFunction:Qn.NEVER,reference:qt.CESIUM_3D_TILE_MASK,mask:qt.CESIUM_3D_TILE_MASK}})),l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(Lx,{uniformMap:{u_depthTexture:function(){return e.colorFramebufferManager.getDepthStencilTexture()}},owner:e})),e._copyDepthCommand.framebuffer=e._copyDepthFramebuffer.framebuffer,e._copyDepthCommand.renderState=e._rs,l(e._copyColorCommand)||(e._copyColorCommand=t.createViewportQuadCommand(_f,{uniformMap:{colorTexture:function(){return e.colorFramebufferManager.getColorTexture()}},owner:e})),e._copyColorCommand.renderState=e._rs,l(e._tempCopyDepthCommand)||(e._tempCopyDepthCommand=t.createViewportQuadCommand(Lx,{uniformMap:{u_depthTexture:function(){return e._tempCopyDepthTexture}},owner:e})),e._tempCopyDepthCommand.framebuffer=e._tempCopyDepthFramebuffer.framebuffer,e._tempCopyDepthCommand.renderState=e._rs,l(e._updateDepthCommand)||(e._updateDepthCommand=t.createViewportQuadCommand(_f,{uniformMap:{colorTexture:function(){return e._tempCopyDepthFramebuffer.getColorTexture()}},owner:e})),e._updateDepthCommand.framebuffer=e._updateDepthFramebuffer.framebuffer,e._updateDepthCommand.renderState=e._rsUpdate,l(e._clearGlobeColorCommand)||(e._clearGlobeColorCommand=new ui({color:new U(0,0,0,0),stencil:0,owner:e})),e._clearGlobeColorCommand.framebuffer=e.framebuffer}Lp.prototype.update=function(e,t,n,i,r,o){let{width:a,height:s}=n,c=r?e.halfFloatingPointTexture?ke.HALF_FLOAT:ke.FLOAT:ke.UNSIGNED_BYTE;this._numSamples=i,this.snapping?this._snapColorFramebuffer.update(e,a,s):this.picking?this._pickColorFramebuffer.update(e,a,s):this._outputFramebuffer.update(e,a,s,i,c),this._copyDepthFramebuffer.update(e,a,s),XEe(this,e,a,s,t),e.uniformState.globeDepthTexture=void 0,this._clearGlobeDepth=o};Lp.prototype.prepareColorTextures=function(e,t){!this.picking&&this._numSamples>1&&this._outputFramebuffer.prepareTextures(e,t)};Lp.prototype.executeCopyDepth=function(e,t){l(this._copyDepthCommand)&&(this.prepareColorTextures(e),this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._copyDepthFramebuffer.getColorTexture())};Lp.prototype.executeUpdateDepth=function(e,t,n){let i=l(n)?n:t.framebuffer.depthStencilTexture;if(!this._clearGlobeDepth&&i===this.colorFramebufferManager.getDepthStencilTexture()){l(this._copyDepthCommand)&&this._copyDepthCommand.execute(e,t);return}if(!l(this._updateDepthCommand))return;let r=this._updateDepthFramebuffer;if(!l(r.framebuffer)||r.getDepthStencilTexture()!==i||r.getColorTexture()!==this._copyDepthFramebuffer.getColorTexture()){let o=this._copyDepthFramebuffer.getColorTexture(),{width:a,height:s}=o;this._tempCopyDepthFramebuffer.destroy(),this._tempCopyDepthFramebuffer.update(e,a,s),r.setColorTexture(o,0),r.setDepthStencilTexture(i),r.update(e,a,s),XEe(this,e,a,s,t)}this._tempCopyDepthTexture=i,this._tempCopyDepthCommand.execute(e,t),this._updateDepthCommand.execute(e,t)};Lp.prototype.executeCopyColor=function(e,t){l(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)};Lp.prototype.clear=function(e,t,n){let i=this._clearGlobeColorCommand;l(i)&&(U.clone(n,i.color),this.colorFramebufferManager.clear(e,i,t))};Lp.prototype.isDestroyed=function(){return!1};Lp.prototype.destroy=function(){return this._pickColorFramebuffer.destroy(),this._snapColorFramebuffer.destroy(),this._outputFramebuffer.destroy(),this._copyDepthFramebuffer.destroy(),this._tempCopyDepthFramebuffer.destroy(),this._updateDepthFramebuffer.destroy(),l(this._copyColorCommand)&&(this._copyColorCommand.shaderProgram=this._copyColorCommand.shaderProgram.destroy()),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=this._copyDepthCommand.shaderProgram.destroy()),l(this._tempCopyDepthCommand)&&(this._tempCopyDepthCommand.shaderProgram=this._tempCopyDepthCommand.shaderProgram.destroy()),l(this._updateDepthCommand)&&(this._updateDepthCommand.shaderProgram=this._updateDepthCommand.shaderProgram.destroy()),ue(this)};var Lj=Lp;function Nx(){this._framebuffer=new si({depthStencil:!0,supportsDepthTexture:!0}),this._packedDepthFramebuffer=new si,this._renderState=void 0,this._packedDepthCommand=void 0,this._clearCommand=void 0,this._viewport=new Je,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0}Object.defineProperties(Nx.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 ACt(e){e._framebuffer.destroy(),e._packedDepthFramebuffer.destroy()}function bCt(e,t,n,i,r){let o=r?t.halfFloatingPointTexture?ke.HALF_FLOAT:ke.FLOAT:ke.UNSIGNED_BYTE;e._framebuffer.update(t,n,i,1,o),e._packedDepthFramebuffer.update(t,n,i)}function xCt(e,t,n,i,r){e._viewport.width=n,e._viewport.height=i;let o=!Je.equals(e._viewport,r.viewport),a=o!==e._useScissorTest;e._useScissorTest=o,Je.equals(e._scissorRectangle,r.viewport)||(e._scissorRectangle=Je.clone(r.viewport,e._scissorRectangle),a=!0),(!l(e._renderState)||!Je.equals(e._viewport,e._renderState.viewport)||a)&&(e._renderState=je.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packedDepthCommand)||(e._packedDepthCommand=t.createViewportQuadCommand(Lx,{uniformMap:{u_depthTexture:function(){return e.depthStencilTexture}},owner:e})),l(e._clearCommand)||(e._clearCommand=new ui({color:new U(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}Nx.prototype.updateAndClear=function(e,t,n,i){let r=t.width,o=t.height;bCt(this,n,r,o,e),xCt(this,n,r,o,i),this._useHdr=e};Nx.prototype.clearClassification=function(e,t){this._clearCommand.execute(e,t)};Nx.prototype.packDepth=function(e,t){return this._packedDepthCommand.execute(e,t),this.packedDepthTexture};Nx.prototype.isDestroyed=function(){return!1};Nx.prototype.destroy=function(){return ACt(this),ue(this)};var Nj=Nx;var W1=`#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 Fj=`/**
|
|
* Compositing for Weighted Blended Order-Independent Transparency. See:
|
|
* - http://jcgt.org/published/0002/02/09/
|
|
* - http://casual-effects.blogspot.com/2014/03/weighted-blended-order-independent.html
|
|
*/
|
|
|
|
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;
|
|
}
|
|
}
|
|
`;function Cg(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 si({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._alphaFBO=new si({createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._adjustTranslucentFBO=new si({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1}),this._adjustAlphaFBO=new si({createColorAttachments:!1}),this._opaqueClearCommand=new ui({color:new U(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new ui({color:new U(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new ui({color:new U(0,0,0,0),owner:this}),this._alphaClearCommand=new ui({color:new U(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 Je,this._rs=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHDR=!1}function KEe(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function See(e){e._translucentFBO.destroy(),e._alphaFBO.destroy(),e._adjustTranslucentFBO.destroy(),e._adjustAlphaFBO.destroy()}function $Ee(e){KEe(e),See(e)}function TCt(e,t,n,i){KEe(e),e._accumulationTexture=new Et({context:t,width:n,height:i,pixelFormat:He.RGBA,pixelDatatype:ke.FLOAT}),e._revealageTexture=new Et({context:t,pixelFormat:He.RGBA,pixelDatatype:ke.FLOAT,width:n,height:i,flipY:!1})}function CCt(e,t){See(e);let n=ee.FRAMEBUFFER_COMPLETE,i=!0,{width:r,height:o}=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,r,o),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture,0),e._adjustTranslucentFBO.setColorTexture(e._revealageTexture,1),e._adjustTranslucentFBO.update(t,r,o),(e._translucentFBO.status!==n||e._adjustTranslucentFBO.status!==n)&&(See(e),e._translucentMRTSupport=!1)),!e._translucentMRTSupport){e._translucentFBO.setColorTexture(e._accumulationTexture),e._translucentFBO.setDepthStencilTexture(e._depthStencilTexture),e._translucentFBO.update(t,r,o),e._alphaFBO.setColorTexture(e._revealageTexture),e._alphaFBO.setDepthStencilTexture(e._depthStencilTexture),e._alphaFBO.update(t,r,o),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture),e._adjustTranslucentFBO.update(t,r,o),e._adjustAlphaFBO.setColorTexture(e._revealageTexture),e._adjustAlphaFBO.update(t,r,o);let a=e._translucentFBO.status===n,s=e._alphaFBO.status===n,c=e._adjustTranslucentFBO.status===n,u=e._adjustAlphaFBO.status===n;(!a||!s||!c||!u)&&($Ee(e),e._translucentMultipassSupport=!1,i=!1)}return i}Cg.prototype.update=function(e,t,n,i,r){if(!this.isSupported())return;this._opaqueFBO=n,this._opaqueTexture=n.getColorTexture(0),this._depthStencilTexture=n.getDepthStencilTexture();let{width:o,height:a}=this._opaqueTexture,s=this._accumulationTexture,c=!l(s)||s.width!==o||s.height!==a||i!==this._useHDR,u=this._numSamples!==r;if((c||u)&&(this._numSamples=r,TCt(this,e,o,a)),(!l(this._translucentFBO.framebuffer)||c||u)&&!CCt(this,e))return;this._useHDR=i;let f=this,d,p;l(this._compositeCommand)||(d=new Ge({sources:[Fj]}),this._translucentMRTSupport&&d.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(d,{uniformMap:p,owner:this})),l(this._adjustTranslucentCommand)||(this._translucentMRTSupport?(d=new Ge({defines:["MRT"],sources:[W1]}),p={u_bgColor:function(){return f._translucentMRTClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this})):this._translucentMultipassSupport&&(d=new Ge({sources:[W1]}),p={u_bgColor:function(){return f._translucentMultipassClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this}),p={u_bgColor:function(){return f._alphaClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustAlphaCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this}))),this._viewport.width=o,this._viewport.height=a;let g=!Je.equals(this._viewport,t.viewport),m=g!==this._useScissorTest;this._useScissorTest=g,Je.equals(this._scissorRectangle,t.viewport)||(this._scissorRectangle=Je.clone(t.viewport,this._scissorRectangle),m=!0),(!l(this._rs)||!Je.equals(this._viewport,this._rs.viewport)||m)&&(this._rs=je.fromCache({viewport:this._viewport,scissorTest:{enabled:this._useScissorTest,rectangle:this._scissorRectangle}})),l(this._compositeCommand)&&(this._compositeCommand.renderState=this._rs),this._adjustTranslucentCommand&&(this._adjustTranslucentCommand.renderState=this._rs),l(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.renderState=this._rs)};var vCt={enabled:!0,color:new U(0,0,0,0),equationRgb:Wc.ADD,equationAlpha:Wc.ADD,functionSourceRgb:Kr.ONE,functionDestinationRgb:Kr.ONE,functionSourceAlpha:Kr.ZERO,functionDestinationAlpha:Kr.ONE_MINUS_SOURCE_ALPHA},ECt={enabled:!0,color:new U(0,0,0,0),equationRgb:Wc.ADD,equationAlpha:Wc.ADD,functionSourceRgb:Kr.ONE,functionDestinationRgb:Kr.ONE,functionSourceAlpha:Kr.ONE,functionDestinationAlpha:Kr.ONE},SCt={enabled:!0,color:new U(0,0,0,0),equationRgb:Wc.ADD,equationAlpha:Wc.ADD,functionSourceRgb:Kr.ZERO,functionDestinationRgb:Kr.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:Kr.ZERO,functionDestinationAlpha:Kr.ONE_MINUS_SOURCE_ALPHA};function wee(e,t,n,i){let r=n[i.id];if(!l(r)){let o=je.getState(i);o.depthMask=!1,o.blending=t,r=je.fromCache(o),n[i.id]=r}return r}function wCt(e,t,n){return wee(t,vCt,e._translucentRenderStateCache,n)}function ICt(e,t,n){return wee(t,ECt,e._translucentRenderStateCache,n)}function PCt(e,t,n){return wee(t,SCt,e._alphaRenderStateCache,n)}var DCt=` 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);
|
|
`,RCt=` 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;
|
|
`,OCt=` float ai = czm_out_FragColor.a;
|
|
out_FragColor = vec4(ai);
|
|
`;function Iee(e,t,n,i){let{shaderCache:r}=e,o=r.getDerivedShaderProgram(t,n);if(l(o))return o;let a=t._attributeLocations,s=t.fragmentShaderSource.clone();s.sources=s.sources.map(function(f){return Ge.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")}),s.sources.splice(0,0,`#define CESIUM_REDIRECTED_COLOR_OUTPUT
|
|
vec4 czm_out_FragColor;
|
|
bool czm_discard = false;
|
|
`);let c=[...i.matchAll(/out_FragData_(\d+)/g)],u="";for(let f=0;f<c.length;f++){let d=c[f];u=`layout (location = ${d[1]}) out vec4 ${d[0]};
|
|
${u}`}return s.sources.push(u),s.sources.push(`void main()
|
|
{
|
|
czm_translucent_main();
|
|
if (czm_discard)
|
|
{
|
|
discard;
|
|
}
|
|
${i}}
|
|
`),r.createDerivedShaderProgram(t,n,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:s,attributeLocations:a})}function MCt(e,t){return Iee(e,t,"translucentMRT",DCt)}function LCt(e,t){return Iee(e,t,"translucentMultipass",RCt)}function NCt(e,t){return Iee(e,t,"alphaMultipass",OCt)}Cg.prototype.createDerivedCommands=function(e,t,n){if(l(n)||(n={}),this._translucentMRTSupport){let s,c;return l(n.translucentCommand)&&(s=n.translucentCommand.shaderProgram,c=n.translucentCommand.renderState),n.translucentCommand=nt.shallowClone(e,n.translucentCommand),!l(s)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=MCt(t,e.shaderProgram),n.translucentCommand.renderState=wCt(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=s,n.translucentCommand.renderState=c),n}let i,r,o,a;return l(n.translucentCommand)&&(i=n.translucentCommand.shaderProgram,r=n.translucentCommand.renderState,o=n.alphaCommand.shaderProgram,a=n.alphaCommand.renderState),n.translucentCommand=nt.shallowClone(e,n.translucentCommand),n.alphaCommand=nt.shallowClone(e,n.alphaCommand),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=LCt(t,e.shaderProgram),n.translucentCommand.renderState=ICt(this,t,e.renderState),n.alphaCommand.shaderProgram=NCt(t,e.shaderProgram),n.alphaCommand.renderState=PCt(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=i,n.translucentCommand.renderState=r,n.alphaCommand.shaderProgram=o,n.alphaCommand.renderState=a),n};function FCt(e,t,n,i,r,o){let{context:a,frameState:s}=t,{useLogDepth:c,shadowState:u}=s,f=t._hdr,d=i.framebuffer,p=u.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(a,i),i.framebuffer=e._adjustAlphaFBO.framebuffer,e._adjustAlphaCommand.execute(a,i);let g=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;for(let m=0;m<r.length;++m){let y=r[m];y=c?y.derivedCommands.logDepth.command:y,y=f?y.derivedCommands.hdr.command:y;let A=p&&y.receiveShadows?y.derivedCommands.oit.shadows.translucentCommand:y.derivedCommands.oit.translucentCommand;n(A,t,i,g)}if(l(o)){let m=o.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<r.length;++m){let y=r[m];y=c?y.derivedCommands.logDepth.command:y,y=f?y.derivedCommands.hdr.command:y;let A=p&&y.receiveShadows?y.derivedCommands.oit.shadows.alphaCommand:y.derivedCommands.oit.alphaCommand;n(A,t,i,g)}if(l(o)){let m=o.unclassifiedCommand,y=p&&m.receiveShadows?m.derivedCommands.oit.shadows.alphaCommand:m.derivedCommands.oit.alphaCommand;n(y,t,i,g)}i.framebuffer=d}function BCt(e,t,n,i,r,o){let{context:a,frameState:s}=t,{useLogDepth:c,shadowState:u}=s,f=t._hdr,d=i.framebuffer,p=u.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(a,i);let g=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;for(let m=0;m<r.length;++m){let y=r[m];y=c?y.derivedCommands.logDepth.command:y,y=f?y.derivedCommands.hdr.command:y;let A=p&&y.receiveShadows?y.derivedCommands.oit.shadows.translucentCommand:y.derivedCommands.oit.translucentCommand;n(A,t,i,g)}if(l(o)){let m=o.unclassifiedCommand,y=p&&m.receiveShadows?m.derivedCommands.oit.shadows.translucentCommand:m.derivedCommands.oit.translucentCommand;n(y,t,i,g)}i.framebuffer=d}Cg.prototype.executeCommands=function(e,t,n,i,r){if(this._translucentMRTSupport){BCt(this,e,t,n,i,r);return}FCt(this,e,t,n,i,r)};Cg.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)};Cg.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this._opaqueFBO.framebuffer,U.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};Cg.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport};Cg.prototype.isDestroyed=function(){return!1};Cg.prototype.destroy=function(){return $Ee(this),l(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),l(this._adjustTranslucentCommand)&&(this._adjustTranslucentCommand.shaderProgram=this._adjustTranslucentCommand.shaderProgram&&this._adjustTranslucentCommand.shaderProgram.destroy()),l(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.shaderProgram=this._adjustAlphaCommand.shaderProgram&&this._adjustAlphaCommand.shaderProgram.destroy()),ue(this)};var Bj=Cg;function q1(){this._framebuffer=new si({color:!1,depthStencil:!0,supportsDepthTexture:!0}),this._passState=void 0}Object.defineProperties(q1.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function kCt(e){e._framebuffer.destroy()}function zCt(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i);let r=new _c(t);r.blendingEnabled=!1,r.scissorTest={enabled:!0,rectangle:new Je},r.viewport=new Je,e._passState=r}q1.prototype.update=function(e,t,n){let i=n.width,r=n.height;this._framebuffer.isDirty(i,r)&&zCt(this,e);let o=this.framebuffer,a=this._passState;return a.framebuffer=o,a.viewport.width=i,a.viewport.height=r,a.scissorTest.rectangle.x=t.x,a.scissorTest.rectangle.y=r-t.y,a.scissorTest.rectangle.width=1,a.scissorTest.rectangle.height=1,a};q1.prototype.isDestroyed=function(){return!1};q1.prototype.destroy=function(){return kCt(this),ue(this)};var kj=q1;function Fx(e){let t=new _c(e);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new Je},t.viewport=new Je,this._context=e,this._fb=new si({depthStencil:!0}),this._passState=t,this._width=0,this._height=0}function JEe(e,t,n,i,r=1){let o=Math.max(n,i),a=o*o,s=Math.floor(n*.5),c=Math.floor(i*.5),u=0,f=0,d=0,p=-1,g=new Set;for(let m=0;m<a;++m){if(-s<=u&&u<=s&&-c<=f&&f<=c){let y=4*((c-f)*n+u+s),A=U.bytesToRgba(t[y],t[y+1],t[y+2],t[y+3]),b=e.getObjectByPickColor(A);if(l(b)&&(g.add(b),g.size>=r))break}if(u===f||u<0&&-u===f||u>0&&u===1-f){let y=d;d=-p,p=y}u+=d,f+=p}return[...g]}Fx.prototype.begin=function(e,t){let n=this._context,{width:i,height:r}=t;return Je.clone(e,this._passState.scissorTest.rectangle),this._width=i,this._height=r,this._fb.update(n,i,r),this._passState.framebuffer=this._fb.framebuffer,this._passState.viewport.width=i,this._passState.viewport.height=r,this._passState};Fx.prototype.endAsync=async function(e,t,n=1){let i=e.width??1,r=e.height??1,o=this._context,a=this._fb.framebuffer,s=ke.UNSIGNED_BYTE,c=He.RGBA;l(a)&&a.numberOfColorAttachments>0&&(s=a.getColorTexture(0).pixelDatatype,c=a.getColorTexture(0).pixelFormat);let u=o.readPixelsToPBO({x:e.x,y:e.y,width:i,height:r,framebuffer:a}),f=Gk.create({context:o});try{await f.waitForSignal(g=>t.afterRender.push(g));let d=He.createTypedArray(c,s,i,r);return u.getBufferData(d),JEe(o,d,i,r,n)}catch{throw new oe("Async Picking Request Timeout")}finally{f.destroy(),u.destroy()}};Fx.prototype.end=function(e,t=1){let n=e.width??1,i=e.height??1,r=this._context,o=r.readPixels({x:e.x,y:e.y,width:n,height:i,framebuffer:this._fb.framebuffer});return JEe(r,o,n,i,t)};Fx.prototype.readCenterPixel=function(e){let t=e.width??1,n=e.height??1,r=this._context.readPixels({x:e.x,y:e.y,width:t,height:n,framebuffer:this._fb.framebuffer}),o=Math.floor(t*.5),s=4*(Math.floor(n*.5)*t+o);return r.slice(s,s+4)};Fx.prototype.isDestroyed=function(){return!1};Fx.prototype.destroy=function(){return this._fb.destroy(),ue(this)};var zj=Fx;function vg(){this._numSamples=1,this._colorFramebuffer=new si({depthStencil:!0,supportsDepthTexture:!0}),this._idFramebuffer=new si({depthStencil:!0,supportsDepthTexture:!0}),this._idClearColor=new U(0,0,0,0),this._clearCommand=new ui({color:new U(0,0,0,0),depth:1,owner:this})}function UCt(e){e._colorFramebuffer.destroy(),e._idFramebuffer.destroy()}Object.defineProperties(vg.prototype,{framebuffer:{get:function(){return this._colorFramebuffer.framebuffer}},idFramebuffer:{get:function(){return this._idFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._colorFramebuffer.getDepthStencilTexture()}}});vg.prototype.update=function(e,t,n,i){let r=t.width,o=t.height,a=n?e.halfFloatingPointTexture?ke.HALF_FLOAT:ke.FLOAT:ke.UNSIGNED_BYTE;this._numSamples=i,this._colorFramebuffer.update(e,r,o,i,a),this._idFramebuffer.update(e,r,o)};vg.prototype.clear=function(e,t,n){U.clone(n,this._clearCommand.color),U.clone(this._idClearColor,this._clearCommand.color),this._colorFramebuffer.clear(e,this._clearCommand,t),this._idFramebuffer.clear(e,this._clearCommand,t)};vg.prototype.getFramebuffer=function(){return this._colorFramebuffer.framebuffer};vg.prototype.getIdFramebuffer=function(){return this._idFramebuffer.framebuffer};vg.prototype.prepareColorTextures=function(e){this._numSamples>1&&this._colorFramebuffer.prepareTextures(e)};vg.prototype.isDestroyed=function(){return!1};vg.prototype.destroy=function(){return UCt(this),ue(this)};var vS=vg;function rA(){}var VCt={HAS_CLIPPING_PLANES:!0,ENABLE_CLIPPING_POLYGONS:!0};rA.hasClippingForShadowCast=function(e){let t=e.defines;return l(t)&&t.some(function(n){return VCt[n]===!0})};rA.getShadowCastShaderKeyword=function(e,t,n,i,r){return`castShadow ${e} ${t} ${n} ${i} ${r}`};rA.createShadowCastVertexShader=function(e,t,n){let i=e.defines.slice(0),r=e.sources.slice(0);i.push("SHADOW_MAP"),n&&i.push("GENERATE_POSITION");let o=Ge.findPositionVarying(e),a=l(o);if(t&&!a){let s=r.length;for(let u=0;u<s;++u)r[u]=Ge.replaceMain(r[u],"czm_shadow_cast_main");r.push(`out vec3 v_positionEC;
|
|
void main()
|
|
{
|
|
czm_shadow_cast_main();
|
|
v_positionEC = (czm_inverseProjection * gl_Position).xyz;
|
|
}`)}return new Ge({defines:i,sources:r})};rA.createShadowCastFragmentShader=function(e,t,n,i,r){let o=e.defines.slice(0),a=e.sources.slice(0);o.push("SHADOW_MAP");let s=Ge.findPositionVarying(e),c=l(s);c||(s="v_positionEC");let u=a.length;for(let d=0;d<u;++d)a[d]=Ge.replaceMain(a[d],"czm_shadow_cast_main");let f="";return t&&(c||(f+=`in vec3 v_positionEC;
|
|
`),f+=`uniform vec4 shadowMap_lightPositionEC;
|
|
`),i&&r?f+=`void main()
|
|
{
|
|
czm_shadow_cast_main();
|
|
`:i?f+=`void main()
|
|
{
|
|
`:f+=`void main()
|
|
{
|
|
czm_shadow_cast_main();
|
|
if (out_FragColor.a == 0.0)
|
|
{
|
|
discard;
|
|
}
|
|
`,t?f+=` float distance = length(${s});
|
|
if (distance >= shadowMap_lightPositionEC.w)
|
|
{
|
|
discard;
|
|
}
|
|
distance /= shadowMap_lightPositionEC.w; // radius
|
|
out_FragColor = czm_packDepth(distance);
|
|
`:n?f+=` out_FragColor = vec4(1.0);
|
|
`:f+=` out_FragColor = czm_packDepth(gl_FragCoord.z);
|
|
`,f+=`}
|
|
`,a.push(f),new Ge({defines:o,sources:a})};rA.getShadowReceiveShaderKeyword=function(e,t,n,i){let r=e._usesDepthTexture,o=e._polygonOffsetSupported,a=e._isPointLight,s=e._isSpotLight,c=e._numberOfCascades>1,u=e.debugCascadeColors,f=e.softShadows;return`receiveShadow ${r}${o}${a}${s}${c}${u}${f}${t}${n}${i}`};rA.createShadowReceiveVertexShader=function(e,t,n){let i=e.defines.slice(0),r=e.sources.slice(0);return i.push("SHADOW_MAP"),t&&(n?i.push("GENERATE_POSITION_AND_NORMAL"):i.push("GENERATE_POSITION")),new Ge({defines:i,sources:r})};rA.createShadowReceiveFragmentShader=function(e,t,n,i,r){let o=Ge.findNormalVarying(e),a=!i&&l(o)||i&&r,s=Ge.findPositionVarying(e),c=l(s),u=t._usesDepthTexture,f=t._polygonOffsetSupported,d=t._isPointLight,p=t._isSpotLight,g=t._numberOfCascades>1,m=t.debugCascadeColors,y=t.softShadows,A=d?t._pointBias:i?t._terrainBias:t._primitiveBias,b=e.defines.slice(0),x=e.sources.slice(0),T=x.length;for(let w=0;w<T;++w)x[w]=Ge.replaceMain(x[w],"czm_shadow_receive_main");d?b.push("USE_CUBE_MAP_SHADOW"):u&&b.push("USE_SHADOW_DEPTH_TEXTURE"),y&&!d&&b.push("USE_SOFT_SHADOWS"),g&&n&&i&&(a?b.push("ENABLE_VERTEX_LIGHTING"):b.push("ENABLE_DAYNIGHT_SHADING")),n&&A.normalShading&&a&&(b.push("USE_NORMAL_SHADING"),A.normalShadingSmooth>0&&b.push("USE_NORMAL_SHADING_SMOOTH"));let C="";d?C+=`uniform samplerCube shadowMap_textureCube;
|
|
`:C+=`uniform sampler2D shadowMap_texture;
|
|
`;let E;return c?E=` return vec4(${s}, 1.0);
|
|
`:E=`#ifndef LOG_DEPTH
|
|
return czm_windowToEyeCoordinates(gl_FragCoord);
|
|
#else
|
|
return vec4(v_logPositionEC, 1.0);
|
|
#endif
|
|
`,C+=`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()
|
|
{
|
|
${E}}
|
|
vec3 getNormalEC()
|
|
{
|
|
${a?` return normalize(${o});
|
|
`:` return vec3(1.0);
|
|
`}}
|
|
void applyNormalOffset(inout vec4 positionEC, vec3 normalEC, float nDotL)
|
|
{
|
|
${A.normalOffset&&a?` float normalOffset = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.x;
|
|
float normalOffsetScale = 1.0 - nDotL;
|
|
vec3 offset = normalOffset * normalOffsetScale * normalEC;
|
|
positionEC.xyz += offset;
|
|
`:""}}
|
|
`,C+=`void main()
|
|
{
|
|
czm_shadow_receive_main();
|
|
vec4 positionEC = getPositionEC();
|
|
vec3 normalEC = getNormalEC();
|
|
float depth = -positionEC.z;
|
|
`,C+=` czm_shadowParameters shadowParameters;
|
|
shadowParameters.texelStepSize = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.xy;
|
|
shadowParameters.depthBias = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.z;
|
|
shadowParameters.normalShadingSmooth = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.w;
|
|
shadowParameters.darkness = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.w;
|
|
`,i?C+=` shadowParameters.depthBias *= max(depth * 0.01, 1.0);
|
|
`:f||(C+=` shadowParameters.depthBias *= mix(1.0, 100.0, depth * 0.0015);
|
|
`),d?C+=` 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?C+=` 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?C+=` 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);
|
|
`:""}`:C+=` 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);
|
|
`,C+=` out_FragColor.rgb *= visibility;
|
|
}
|
|
`,x.push(C),new Ge({defines:b,sources:x})};var Np=rA;function Fp(e){e=e??H.EMPTY_OBJECT;let t=e.context;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;(fn.isEdge()||(fn.isChrome()||fn.isFirefox())&&fn.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 O,this._shadowMapTexture=void 0,this._lightDirectionEC=new h,this._lightPositionEC=new ae,this._distance=0,this._lightCamera=e.lightCamera,this._shadowMapCamera=new Uj,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new se,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 k,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new Aa:l(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new ae,new ae],this._cascadeMatrices=[new O,new O,new O,new O],this._cascadeDistances=new ae;let i;this._isPointLight?i=6:this._cascadesEnabled?i=this._numberOfCascades:i=1,this._passes=new Array(i);for(let r=0;r<i;++r)this._passes[r]=new jCt(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,Dee(this),this._clearCommand=new ui({depth:1,color:new U}),this._clearPassState=new _c(t),this._size=e.size??2048,this.size=this._size}Fp.MAXIMUM_DISTANCE=2e4;function jCt(e){this.camera=new Uj,this.passState=new _c(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function Pee(e,t){return je.fromCache({cull:{enabled:!0,face:Ui.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 Dee(e){let t=!e._usesDepthTexture;e._primitiveRenderState=Pee(t,e._primitiveBias),e._terrainRenderState=Pee(t,e._terrainBias),e._pointRenderState=Pee(t,e._pointBias)}Fp.prototype.debugCreateRenderStates=function(){Dee(this)};Object.defineProperties(Fp.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){XCt(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 Ree(e){let t=e._passes.length;for(let n=0;n<t;++n){let i=e._passes[n],r=i.framebuffer;l(r)&&!r.isDestroyed()&&r.destroy(),i.framebuffer=void 0}e._depthAttachment=e._depthAttachment&&e._depthAttachment.destroy(),e._colorAttachment=e._colorAttachment&&e._colorAttachment.destroy()}function HCt(e,t){let n=new ld({context:t,width:e._textureSize.x,height:e._textureSize.y,format:fu.DEPTH_COMPONENT16}),i=new Et({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:He.RGBA,pixelDatatype:ke.UNSIGNED_BYTE,sampler:Ut.NEAREST}),r=new Ta({context:t,depthRenderbuffer:n,colorTextures:[i],destroyAttachments:!1}),o=e._passes.length;for(let a=0;a<o;++a){let s=e._passes[a];s.framebuffer=r,s.passState.framebuffer=r}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function GCt(e,t){let n=new Et({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:He.DEPTH_STENCIL,pixelDatatype:ke.UNSIGNED_INT_24_8,sampler:Ut.NEAREST}),i=new Ta({context:t,depthStencilTexture:n,destroyAttachments:!1}),r=e._passes.length;for(let o=0;o<r;++o){let a=e._passes[o];a.framebuffer=i,a.passState.framebuffer=i}e._shadowMapTexture=n,e._depthAttachment=n}function WCt(e,t){let n=new ld({context:t,width:e._textureSize.x,height:e._textureSize.y,format:fu.DEPTH_COMPONENT16}),i=new aa({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:He.RGBA,pixelDatatype:ke.UNSIGNED_BYTE,sampler:Ut.NEAREST}),r=[i.negativeX,i.negativeY,i.negativeZ,i.positiveX,i.positiveY,i.positiveZ];for(let o=0;o<6;++o){let a=new Ta({context:t,depthRenderbuffer:n,colorTextures:[r[o]],destroyAttachments:!1}),s=e._passes[o];s.framebuffer=a,s.passState.framebuffer=a}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function eSe(e,t){e._isPointLight?WCt(e,t):e._usesDepthTexture?GCt(e,t):HCt(e,t)}function qCt(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==ee.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,Dee(e),Ree(e),eSe(e,t))}function YCt(e,t){(!l(e._passes[0].framebuffer)||e._shadowMapTexture.width!==e._textureSize.x)&&(Ree(e),eSe(e,t),qCt(e,t),tSe(e,t))}function tSe(e,t,n){n=n??0,(e._isPointLight||n===0)&&(e._clearCommand.framebuffer=e._passes[n].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function XCt(e,t){e._size=t;let n=e._passes,i=n.length,r=e._textureSize;if(e._isPointLight){t=Ft.maximumCubeMapSize>=t?t:Ft.maximumCubeMapSize,r.x=t,r.y=t;let o=new Je(0,0,t,t);n[0].passState.viewport=o,n[1].passState.viewport=o,n[2].passState.viewport=o,n[3].passState.viewport=o,n[4].passState.viewport=o,n[5].passState.viewport=o}else i===1?(t=Ft.maximumTextureSize>=t?t:Ft.maximumTextureSize,r.x=t,r.y=t,n[0].passState.viewport=new Je(0,0,t,t)):i===4&&(t=Ft.maximumTextureSize>=t*2?t:Ft.maximumTextureSize/2,r.x=t*2,r.y=t*2,n[0].passState.viewport=new Je(0,0,t,t),n[1].passState.viewport=new Je(t,0,t,t),n[2].passState.viewport=new Je(0,t,t,t),n[3].passState.viewport=new Je(t,t,t,t));e._clearPassState.viewport=new Je(0,0,r.x,r.y);for(let o=0;o<i;++o){let a=n[o],s=a.passState.viewport,c=s.x/r.x,u=s.y/r.y,f=s.width/r.x,d=s.height/r.y;a.textureOffsets=new O(f,0,0,c,0,d,0,u,0,0,1,0,0,0,0,1)}}var KCt=new Je;function $Ct(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=Pe.OVERLAY,i}function JCt(e,t){let n=t.context,i=t.context.drawingBufferWidth,r=t.context.drawingBufferHeight,o=Math.min(i,r)*.3,a=KCt;a.x=i-o,a.y=0,a.width=o,a.height=o;let s=e._debugShadowViewCommand;l(s)||(s=$Ct(e,n),e._debugShadowViewCommand=s),(!l(s.renderState)||!Je.equals(s.renderState.viewport,a))&&(s.renderState=je.fromCache({viewport:Je.clone(a)})),t.commandList.push(e._debugShadowViewCommand)}var Bp=new Array(8);Bp[0]=new ae(-1,-1,-1,1);Bp[1]=new ae(1,-1,-1,1);Bp[2]=new ae(1,1,-1,1);Bp[3]=new ae(-1,1,-1,1);Bp[4]=new ae(-1,-1,1,1);Bp[5]=new ae(1,-1,1,1);Bp[6]=new ae(1,1,1,1);Bp[7]=new ae(-1,1,1,1);var oA=new O,Oee=new Array(8);for(let e=0;e<8;++e)Oee[e]=new ae;function ZCt(e,t){let n=new Bt({geometry:new Pm({minimum:new h(-.5,-.5,-.5),maximum:new h(.5,.5,.5)}),attributes:{color:Kt.fromColor(t)}}),i=new Bt({geometry:new K_({radius:.5}),attributes:{color:Kt.fromColor(t)}});return new Fn({geometryInstances:[n,i],appearance:new _n({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}var QCt=[U.RED,U.GREEN,U.BLUE,U.MAGENTA],evt=new h;function tvt(e,t){JCt(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 Tg({camera:e._sceneCamera,color:U.CYAN,updateOnChange:!1})),e._debugCameraFrustum.update(t)),e._cascadesEnabled){if(e.debugFreezeFrame){n&&(e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=new Tg({camera:e._shadowMapCamera,color:U.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 Tg({camera:e._passes[i].camera,color:QCt[i],updateOnChange:!1})),e._debugCascadeFrustums[i].update(t)}}else if(e._isPointLight){if(!l(e._debugLightFrustum)||e._needsUpdate){let i=e._shadowMapCamera.positionWC,r=Fe.IDENTITY,o=e._pointLightRadius*2,a=h.fromElements(o,o,o,evt),s=O.fromTranslationQuaternionRotationScale(i,r,a,oA);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=ZCt(s,U.YELLOW)}e._debugLightFrustum.update(t)}else(!l(e._debugLightFrustum)||e._needsUpdate)&&(e._debugLightFrustum=new Tg({camera:e._shadowMapCamera,color:U.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function Uj(){this.viewMatrix=new O,this.inverseViewMatrix=new O,this.frustum=void 0,this.positionCartographic=new de,this.positionWC=new h,this.directionWC=h.clone(h.UNIT_Z),this.upWC=h.clone(h.UNIT_Y),this.rightWC=h.clone(h.UNIT_X),this.viewProjectionMatrix=new O}Uj.prototype.clone=function(e){O.clone(e.viewMatrix,this.viewMatrix),O.clone(e.inverseViewMatrix,this.inverseViewMatrix),this.frustum=e.frustum.clone(this.frustum),de.clone(e.positionCartographic,this.positionCartographic),h.clone(e.positionWC,this.positionWC),h.clone(e.directionWC,this.directionWC),h.clone(e.upWC,this.upWC),h.clone(e.rightWC,this.rightWC)};var nvt=new O(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);Uj.prototype.getViewProjection=function(){let e=this.viewMatrix,t=this.frustum.projectionMatrix;return O.multiply(t,e,this.viewProjectionMatrix),O.multiply(nvt,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var ivt=new Array(5),rvt=new Yi,ovt=new Array(4),nSe=new h,iSe=new h;function avt(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,r=i.frustum.near,o=i.frustum.far,a=e._numberOfCascades,s,c=o-r,u=o/r,f=.9,d=!1;t.shadowState.closestObjectSize<200&&(d=!0,f=.9);let p=ovt,g=ivt;for(g[0]=r,g[a]=o,s=0;s<a;++s){let N=(s+1)/a,_=r*Math.pow(u,N),v=r+c*N,S=I.lerp(v,_,f);g[s+1]=S,p[s]=S-g[s]}if(d){for(s=0;s<a;++s)p[s]=Math.min(p[s],e._maximumCascadeDistances[s]);let N=g[0];for(s=0;s<a-1;++s)N+=p[s],g[s+1]=N}ae.unpack(g,0,e._cascadeSplits[0]),ae.unpack(g,1,e._cascadeSplits[1]),ae.unpack(p,0,e._cascadeDistances);let m=n.frustum,y=m.left,A=m.right,b=m.bottom,x=m.top,T=m.near,C=m.far,E=n.positionWC,w=n.directionWC,D=n.upWC,R=i.frustum.clone(rvt),M=n.getViewProjection();for(s=0;s<a;++s){R.near=g[s],R.far=g[s+1];let N=O.multiply(R.projectionMatrix,i.viewMatrix,oA),_=O.inverse(N,oA),v=O.multiply(M,_,oA),S=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,nSe),P=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,iSe);for(let j=0;j<8;++j){let B=ae.clone(Bp[j],Oee[j]);O.multiplyByVector(v,B,B),h.divideByScalar(B,B.w,B),h.minimumByComponent(B,S,S),h.maximumByComponent(B,P,P)}S.x=Math.max(S.x,0),S.y=Math.max(S.y,0),S.z=0,P.x=Math.min(P.x,1),P.y=Math.min(P.y,1),P.z=Math.min(P.z,1);let L=e._passes[s],F=L.camera;F.clone(n);let V=F.frustum;V.left=y+S.x*(A-y),V.right=y+P.x*(A-y),V.bottom=b+S.y*(x-b),V.top=b+P.y*(x-b),V.near=T+S.z*(C-T),V.far=T+P.z*(C-T),L.cullingVolume=F.frustum.computeCullingVolume(E,w,D);let z=e._cascadeMatrices[s];O.multiply(F.getViewProjection(),i.inverseViewMatrix,z),O.multiply(L.textureOffsets,z,z)}}var svt=new O,cvt=new h,lvt=new h,ZEe=new h;function uvt(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,r=O.multiply(i.frustum.projectionMatrix,i.viewMatrix,oA),o=O.inverse(r,oA),a=n.directionWC,s=i.directionWC;h.equalsEpsilon(a,s,I.EPSILON10)&&(s=i.upWC);let c=h.cross(a,s,cvt);s=h.cross(c,a,lvt),h.normalize(s,s),h.normalize(c,c);let u=h.fromElements(0,0,0,ZEe),f=O.computeView(u,a,s,c,svt),d=O.multiply(f,o,oA),p=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,nSe),g=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,iSe);for(let C=0;C<8;++C){let E=ae.clone(Bp[C],Oee[C]);O.multiplyByVector(d,E,E),h.divideByScalar(E,E.w,E),h.minimumByComponent(E,p,p),h.maximumByComponent(E,g,g)}g.z+=1e3,p.z-=10;let m=ZEe;m.x=-(.5*(p.x+g.x)),m.y=-(.5*(p.y+g.y)),m.z=-g.z;let y=O.fromTranslation(m,oA);f=O.multiply(y,f,f);let A=.5*(g.x-p.x),b=.5*(g.y-p.y),x=g.z-p.z,T=n.frustum;T.left=-A,T.right=A,T.bottom=-b,T.top=b,T.near=.01,T.far=x,O.clone(f,n.viewMatrix),O.inverse(f,n.inverseViewMatrix),O.getTranslation(n.inverseViewMatrix,n.positionWC),t.mapProjection.ellipsoid.cartesianToCartographic(n.positionWC,n.positionCartographic),h.clone(a,n.directionWC),h.clone(s,n.upWC),h.clone(c,n.rightWC)}var fvt=[new h(-1,0,0),new h(0,-1,0),new h(0,0,-1),new h(1,0,0),new h(0,1,0),new h(0,0,1)],dvt=[new h(0,-1,0),new h(0,0,-1),new h(0,-1,0),new h(0,-1,0),new h(0,0,1),new h(0,-1,0)],hvt=[new h(0,0,1),new h(1,0,0),new h(-1,0,0),new h(0,0,-1),new h(1,0,0),new h(1,0,0)];function mvt(e,t){let n=new Yi;n.fov=I.PI_OVER_TWO,n.near=1,n.far=e._pointLightRadius,n.aspectRatio=1;for(let i=0;i<6;++i){let r=e._passes[i].camera;r.positionWC=e._shadowMapCamera.positionWC,r.positionCartographic=t.mapProjection.ellipsoid.cartesianToCartographic(r.positionWC,r.positionCartographic),r.directionWC=fvt[i],r.upWC=dvt[i],r.rightWC=hvt[i],O.computeView(r.positionWC,r.directionWC,r.upWC,r.rightWC,r.viewMatrix),O.inverse(r.viewMatrix,r.inverseViewMatrix),r.frustum=n}}var pvt=new h,gvt=new h,rSe=new se,QEe=rSe.center;function _vt(e,t){let n=e._sceneCamera,i=e._shadowMapCamera,r=rSe;if(e._cascadesEnabled){if(n.frustum.near>=e.maximumDistance){e._outOfView=!0,e._needsUpdate=!1;return}let o=t.mapProjection.ellipsoid.geodeticSurfaceNormal(n.positionWC,pvt),a=h.negate(i.directionWC,gvt),s=h.dot(o,a);if(e.fadingEnabled){let c=I.clamp(s/.1,0,1);e._darkness=I.lerp(1,e.darkness,c)}else e._darkness=e.darkness;if(s<0){e._outOfView=!0,e._needsUpdate=!1;return}e._needsUpdate=!0,e._outOfView=!1}else if(e._isPointLight)r.center=i.positionWC,r.radius=e._pointLightRadius,e._outOfView=t.cullingVolume.computeVisibility(r)===Xt.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(r),se.clone(r,e._boundingSphere);else{let o=i.frustum.far/2,a=h.add(i.positionWC,h.multiplyByScalar(i.directionWC,o,QEe),QEe);r.center=a,r.radius=o,e._outOfView=t.cullingVolume.computeVisibility(r)===Xt.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(r),se.clone(r,e._boundingSphere)}}function yvt(e,t){let n=t.camera,i=e._lightCamera,r=e._sceneCamera,o=e._shadowMapCamera;e._cascadesEnabled?h.clone(i.directionWC,o.directionWC):e._isPointLight?h.clone(i.positionWC,o.positionWC):o.clone(i);let a=e._lightDirectionEC;O.multiplyByPointAsVector(n.viewMatrix,o.directionWC,a),h.normalize(a,a),h.negate(a,a),O.multiplyByPoint(n.viewMatrix,o.positionWC,e._lightPositionEC),e._lightPositionEC.w=e._pointLightRadius;let s,c;e._fitNearFar?(s=Math.min(t.shadowState.nearPlane,e.maximumDistance),c=Math.min(t.shadowState.farPlane,e.maximumDistance),c=Math.max(c,s+1)):(s=n.frustum.near,c=e.maximumDistance),e._sceneCamera=Ir.clone(n,r),n.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=s,e._sceneCamera.frustum.far=c,e._distance=c-s,_vt(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}Fp.prototype.update=function(e){if(yvt(this,e),this._needsUpdate)if(YCt(this,e.context),this._isPointLight&&mvt(this,e),this._cascadesEnabled&&(uvt(this,e),this._numberOfCascades>1&&avt(this,e)),this._isPointLight)this._shadowMapCullingVolume=is.fromBoundingSphere(this._boundingSphere);else{let t=this._shadowMapCamera,n=t.positionWC,i=t.directionWC,r=t.upWC;this._shadowMapCullingVolume=t.frustum.computeCullingVolume(n,i,r),this._passes.length===1&&this._passes[0].camera.clone(t)}if(this._passes.length===1){let t=this._sceneCamera.inverseViewMatrix;O.multiply(this._shadowMapCamera.getViewProjection(),t,this._shadowMapMatrix)}this.debugShow&&tvt(this,e)};Fp.prototype.updatePass=function(e,t){tSe(this,e,t)};var Avt=new k;function oSe(e,t,n){let i=e._isPointLight?e._pointBias:n?e._terrainBias:e._primitiveBias,r={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 o=Avt;return o.x=1/e._textureSize.x,o.y=1/e._textureSize.y,ae.fromElements(o.x,o.y,i.depthBias,i.normalShadingSmooth,this.combinedUniforms1)},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){return ae.fromElements(i.normalOffsetScale,e._distance,e.maximumDistance,e._darkness,this.combinedUniforms2)},combinedUniforms1:new ae,combinedUniforms2:new ae};return Ot(t,r,!1)}function bvt(e,t,n,i,r,o){let a,s,c;if(l(o)&&(a=o.shaderProgram,s=o.renderState,c=o.uniformMap),o=nt.shallowClone(n,o),o.castShadows=!0,o.receiveShadows=!1,!l(a)||r!==n.shaderProgram.id||t){let u=n.shaderProgram,f=n.pass===Pe.GLOBE,d=n.pass!==Pe.TRANSLUCENT,p=e._isPointLight,g=e._usesDepthTexture,m=u.vertexShaderSource,y=u.fragmentShaderSource,A=d&&Np.hasClippingForShadowCast(y),b=Np.getShadowCastShaderKeyword(p,f,g,d,A);if(a=i.shaderCache.getDerivedShaderProgram(u,b),!l(a)){let T=Np.createShadowCastVertexShader(m,p,f),C=Np.createShadowCastFragmentShader(y,p,g,d,A);a=i.shaderCache.createDerivedShaderProgram(u,b,{vertexShaderSource:T,fragmentShaderSource:C,attributeLocations:u._attributeLocations})}s=e._primitiveRenderState,p?s=e._pointRenderState:f&&(s=e._terrainRenderState),n.renderState.cull.enabled||(s=Xe(s,!1),s.cull=Xe(s.cull,!1),s.cull.enabled=!1,s=je.fromCache(s)),c=oSe(e,n.uniformMap,f)}return o.shaderProgram=a,o.renderState=s,o.uniformMap=c,o}Fp.createReceiveDerivedCommand=function(e,t,n,i,r){l(r)||(r={});let o=e.length>0,a=t.shaderProgram,s=a.vertexShaderSource,c=a.fragmentShaderSource,u=t.pass===Pe.GLOBE,f=!1;if(u&&(f=t.owner.data.renderedMesh.encoding.hasVertexNormals),t.receiveShadows&&o){let d,p;l(r.receiveCommand)&&(d=r.receiveCommand.shaderProgram,p=r.receiveCommand.uniformMap),r.receiveCommand=nt.shallowClone(t,r.receiveCommand),r.castShadows=!1,r.receiveShadows=!0;let g=r.receiveShaderCastShadows!==t.castShadows,m=r.receiveShaderProgramId!==t.shaderProgram.id;if(!l(d)||m||n||g){let y=Np.getShadowReceiveShaderKeyword(e[0],t.castShadows,u,f);if(d=i.shaderCache.getDerivedShaderProgram(a,y),!l(d)){let A=Np.createShadowReceiveVertexShader(s,u,f),b=Np.createShadowReceiveFragmentShader(c,e[0],t.castShadows,u,f);d=i.shaderCache.createDerivedShaderProgram(a,y,{vertexShaderSource:A,fragmentShaderSource:b,attributeLocations:a._attributeLocations})}p=oSe(e[0],t.uniformMap,u)}r.receiveCommand.shaderProgram=d,r.receiveCommand.uniformMap=p,r.receiveShaderProgramId=t.shaderProgram.id,r.receiveShaderCastShadows=t.castShadows}return r};Fp.createCastDerivedCommand=function(e,t,n,i,r){if(l(r)||(r={}),t.castShadows){let o=r.castCommands;l(o)||(o=r.castCommands=[]);let a=r.castShaderProgramId,s=e.length;o.length=s;for(let c=0;c<s;++c)o[c]=bvt(e[c],n,t,i,a,o[c]);r.castShaderProgramId=t.shaderProgram.id}return r};Fp.prototype.isDestroyed=function(){return!1};Fp.prototype.destroy=function(){Ree(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 ue(this)};var aA=Fp;var Vj=`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 ES=`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
|
|
// Reverse premultiplication process to get the correct composited result of the classification primitives
|
|
color.rgb /= color.a;
|
|
#endif
|
|
out_FragColor = color;
|
|
#endif
|
|
}
|
|
`;var xvt=!1;function sA(e){this._drawClassificationFBO=new si({createDepthAttachments:!1}),this._accumulationFBO=new si({createDepthAttachments:!1}),this._packFBO=new si,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 ui({color:new U(0,0,0,0),owner:this}),this._clearDepthStencilCommand=new ui({depth:1,stencil:0,owner:this}),this._supported=e.depthTexture,this._viewport=new Je,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(sA.prototype,{hasTranslucentDepth:{get:function(){return this._hasTranslucentDepth}}});function aSe(e){e._textureToComposite=void 0,e._translucentDepthStencilTexture=e._translucentDepthStencilTexture&&!e._translucentDepthStencilTexture.isDestroyed()&&e._translucentDepthStencilTexture.destroy()}function sSe(e){e._drawClassificationFBO.destroy(),e._accumulationFBO.destroy(),e._packFBO.destroy()}function Tvt(e,t,n,i){aSe(e),e._translucentDepthStencilTexture=new Et({context:t,width:n,height:i,pixelFormat:He.DEPTH_STENCIL,pixelDatatype:ke.UNSIGNED_INT_24_8,sampler:Ut.NEAREST})}function Cvt(e,t,n,i){sSe(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 vvt(e,t,n,i){if(!e.isSupported())return;e._opaqueDepthStencilTexture=i;let r=e._opaqueDepthStencilTexture.width,o=e._opaqueDepthStencilTexture.height;e._drawClassificationFBO.isDirty(r,o)&&(Tvt(e,t,r,o),Cvt(e,t,r,o));let a,s;if(l(e._packDepthCommand)||(a=new Ge({sources:[Vj]}),s={u_opaqueDepthTexture:function(){return e._opaqueDepthStencilTexture},u_translucentDepthTexture:function(){return e._translucentDepthStencilTexture}},e._packDepthCommand=t.createViewportQuadCommand(a,{uniformMap:s,owner:e})),!l(e._compositeCommand)){a=new Ge({sources:[ES]}),s={colorTexture:function(){return e._textureToComposite}},xvt&&(a.defines=["DEBUG_SHOW_DEPTH"],s.u_packedTranslucentDepth=function(){return e._packFBO.getColorTexture()}),e._compositeCommand=t.createViewportQuadCommand(a,{uniformMap:s,owner:e});let f=e._compositeCommand,d=f.shaderProgram,p=t.shaderCache.createDerivedShaderProgram(d,"pick",{vertexShaderSource:d.vertexShaderSource,fragmentShaderSource:new Ge({sources:a.sources,defines:["PICK"]}),attributeLocations:d._attributeLocations}),g=nt.shallowClone(f);g.shaderProgram=p,f.derivedCommands.pick=g}l(e._copyCommand)||(a=new Ge({sources:[ES]}),s={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._copyCommand=t.createViewportQuadCommand(a,{uniformMap:s,owner:e})),l(e._accumulateCommand)||(a=new Ge({sources:[ES]}),s={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._accumulateCommand=t.createViewportQuadCommand(a,{uniformMap:s,owner:e})),e._viewport.width=r,e._viewport.height=o;let c=!Je.equals(e._viewport,n.viewport),u=c!==e._useScissorTest;e._useScissorTest=c,Je.equals(e._scissorRectangle,n.viewport)||(e._scissorRectangle=Je.clone(n.viewport,e._scissorRectangle),u=!0),(!l(e._rsDepth)||!Je.equals(e._viewport,e._rsDepth.viewport)||u)&&(e._rsDepth=je.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packDepthCommand)&&(e._packDepthCommand.renderState=e._rsDepth),(!l(e._rsAccumulate)||!Je.equals(e._viewport,e._rsAccumulate.viewport)||u)&&(e._rsAccumulate=je.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:Qn.EQUAL,reference:qt.CESIUM_3D_TILE_MASK}})),l(e._accumulateCommand)&&(e._accumulateCommand.renderState=e._rsAccumulate),(!l(e._rsComp)||!Je.equals(e._viewport,e._rsComp.viewport)||u)&&(e._rsComp=je.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:en.ALPHA_BLEND})),l(e._compositeCommand)&&(e._compositeCommand.renderState=e._rsComp,e._compositeCommand.derivedCommands.pick.renderState=e._rsComp)}sA.prototype.executeTranslucentCommands=function(e,t,n,i,r){let o=e.frameState.useLogDepth,a=e.context,s=n.framebuffer;for(let c=0;c<i.length;++c){let u=i[c];if(u=o?u.derivedCommands.logDepth.command:u,u.depthForTranslucentClassification){this._hasTranslucentDepth=!0;break}}if(this._hasTranslucentDepth){vvt(this,a,n,r),n.framebuffer=this._drawClassificationFBO.framebuffer,this._clearDepthStencilCommand.execute(a,n);for(let c=0;c<i.length;++c){let u=i[c];if(u=o?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(a,n)),n.framebuffer=s}};sA.prototype.executeClassificationCommands=function(e,t,n,i){if(!this._hasTranslucentDepth)return;let r=e.context,o=r.uniformState,a=n.framebuffer;n.framebuffer=this._accumulationFBO.framebuffer,this._accumulateCommand.execute(r,n),n.framebuffer=this._drawClassificationFBO.framebuffer,this._frustumsDrawn>1&&this._clearColorCommand.execute(r,n),o.updatePass(Pe.CESIUM_3D_TILE_CLASSIFICATION);let s=o.globeDepthTexture;o.globeDepthTexture=this._packFBO.getColorTexture();let c=i.commands[Pe.CESIUM_3D_TILE_CLASSIFICATION],u=i.indices[Pe.CESIUM_3D_TILE_CLASSIFICATION];for(let f=0;f<u;++f)t(c[f],e,n);o.globeDepthTexture=s,n.framebuffer=a,this._frustumsDrawn!==1&&(n.framebuffer=this._accumulationFBO.framebuffer,this._accumulateCommand.execute(r,n),n.framebuffer=a)};sA.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),Evt(this,e,t)};function Evt(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}sA.prototype.isSupported=function(){return this._supported};sA.prototype.isDestroyed=function(){return!1};sA.prototype.destroy=function(){return aSe(this),sSe(this),l(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),l(this._packDepthCommand)&&(this._packDepthCommand.shaderProgram=this._packDepthCommand.shaderProgram&&this._packDepthCommand.shaderProgram.destroy()),ue(this)};var jj=sA;function Svt(){this.command=void 0,this.near=void 0,this.far=void 0}function Hj(e,t,n){let i=e.context,r;i.depthTexture&&(r=new Lj);let o;e._useOIT&&i.depthTexture&&(o=new Bj(i));let a=new _c(i);a.viewport=Je.clone(n),this.camera=t,this._cameraClone=Ir.clone(t),this._cameraStartFired=!1,this._cameraMovedTime=void 0,this.viewport=n,this.passState=a,this.pickFramebuffer=new zj(i),this.snapFramebuffer=void 0,this.pickDepthFramebuffer=new kj,this.sceneFramebuffer=new vS,this.edgeFramebuffer=new Rj,this.planarFillIdFramebuffer=new Oj,this.globeDepth=r,this.globeTranslucencyFramebuffer=new Nj,this.oit=o,this.translucentTileClassification=new jj(i),this.pickDepths=[],this.frustumCommandsList=[],this.debugFrustumStatistics=void 0,this._commandExtents=[]}var Mee=new h,Lee=new h;function wvt(e,t,n){let i=Math.max(h.maximumComponent(h.abs(e.position,Mee)),h.maximumComponent(h.abs(t.position,Lee))),r=1/Math.max(1,i);return h.multiplyByScalar(e.position,r,Mee),h.multiplyByScalar(t.position,r,Lee),h.equalsEpsilon(Mee,Lee,n)&&h.equalsEpsilon(e.direction,t.direction,n)&&h.equalsEpsilon(e.up,t.up,n)&&h.equalsEpsilon(e.right,t.right,n)&&O.equalsEpsilon(e.transform,t.transform,n)&&e.frustum.equalsEpsilon(t.frustum,n)}Hj.prototype.checkForCameraUpdates=function(e){let t=this.camera,n=this._cameraClone;return wvt(t,n,I.EPSILON15)?(this._cameraStartFired&&An()-this._cameraMovedTime>e.cameraEventWaitTime&&(t.moveEnd.raiseEvent(),this._cameraStartFired=!1),!1):(this._cameraStartFired||(t.moveStart.raiseEvent(),this._cameraStartFired=!0),this._cameraMovedTime=An(),Ir.clone(t,n),!0)};function Ivt(e,t,n,i){let{frameState:r}=t,{camera:o,useLogDepth:a}=r,s=a?t.logarithmicDepthFarToNearRatio:t.farToNearRatio,c=t.mode===re.SCENE2D,u=t.nearToFarDistance2D;i*=1+I.EPSILON2,n=Math.min(Math.max(n,o.frustum.near),o.frustum.far),i=Math.max(Math.min(i,o.frustum.far),n);let f;c?(i=Math.min(i,o.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(s));let{frustumCommandsList:d}=e;d.length=f;for(let p=0;p<f;++p){let g,m;c?(g=Math.min(i-u,n+p*u),m=Math.min(i,g+u)):(g=Math.max(n,Math.pow(s,p)*n),m=Math.min(i,s*g)),l(d[p])?(d[p].near=g,d[p].far=m):d[p]=new Mj(g,m)}}function Pvt(e,t,n){let{command:i,near:r,far:o}=n;t.debugShowFrustums&&(i.debugOverlappingFrustums=0);let{frustumCommandsList:a}=e;for(let s=0;s<a.length;++s){let c=a[s];if(r>c.far)continue;if(o<c.near)break;let u=i.pass,f=c.indices[u]++;if(c.commands[u][f]=i,t.debugShowFrustums&&(i.debugOverlappingFrustums|=1<<s),i.executeInClosestFrustum)break}if(t.debugShowFrustums){let{debugFrustumStatistics:s}=e,{debugOverlappingFrustums:c}=i,u=s.commandsInFrustums;u[c]=l(u[c])?u[c]+1:1,++s.totalCommands}t.updateDerivedCommands(i)}var cSe=new is,Dvt=new $o;Hj.prototype.createPotentiallyVisibleSet=function(e){let{frameState:t}=e,{camera:n,commandList:i,shadowState:r}=t,{positionWC:o,directionWC:a,frustum:s}=n,c=e._computeCommandList,u=e._overlayCommandList;e.debugShowFrustums&&(this.debugFrustumStatistics={totalCommands:0,commandsInFrustums:{}});let f=this.frustumCommandsList;for(let M=0;M<f.length;++M)for(let N=0;N<Pe.NUMBER_OF_PASSES;++N)f[M].indices[N]=0;c.length=0,u.length=0;let d=this._commandExtents,p=d.length,g=0,m=+Number.MAX_VALUE,y=-Number.MAX_VALUE,{shadowsEnabled:A}=r,b=+Number.MAX_VALUE,x=-Number.MAX_VALUE,T=Number.MAX_VALUE,C=t.mode===re.SCENE3D?t.occluder:void 0,{cullingVolume:E}=t,w=cSe.planes;for(let M=0;M<5;++M)w[M]=E.planes[M];E=cSe;for(let M=0;M<i.length;++M){let N=i[M],{pass:_,boundingVolume:v}=N;if(_===Pe.COMPUTE)c.push(N);else if(_===Pe.OVERLAY)u.push(N);else{let S,P;if(l(v)){if(!e.isVisible(E,N,C))continue;let F=v.computePlaneDistances(o,a,Dvt);if(S=F.start,P=F.stop,m=Math.min(m,S),y=Math.max(y,P),A&&N.receiveShadows&&S<aA.MAXIMUM_DISTANCE&&!(_===Pe.GLOBE&&S<-100&&P>100)){let V=P-S;_!==Pe.GLOBE&&S<100&&(T=Math.min(T,V)),b=Math.min(b,S),x=Math.max(x,P)}}else N instanceof ui?(S=s.near,P=s.far):(S=s.near,P=s.far,m=Math.min(m,S),y=Math.max(y,P));let L=d[g];l(L)||(L=d[g]=new Svt),L.command=N,L.near=S,L.far=P,g++}}A&&(b=Math.min(Math.max(b,s.near),s.far),x=Math.max(Math.min(x,s.far),b),r.nearPlane=b,r.farPlane=x,r.closestObjectSize=T),Ivt(this,e,m,y);for(let M=0;M<g;M++)Pvt(this,e,d[M]);if(g<p)for(let M=g;M<p;M++){let N=d[M];if(!l(N.command))break;N.command=void 0}let D=f.length,{frustumSplits:R}=t;R.length=D+1;for(let M=0;M<D;++M)R[M]=f[M].near,M===D-1&&(R[M+1]=f[M].far)};Hj.prototype.destroy=function(){this.pickFramebuffer=this.pickFramebuffer&&this.pickFramebuffer.destroy(),this.snapFramebuffer=this.snapFramebuffer&&this.snapFramebuffer.destroy(),this.pickDepthFramebuffer=this.pickDepthFramebuffer&&this.pickDepthFramebuffer.destroy(),this.sceneFramebuffer=this.sceneFramebuffer&&this.sceneFramebuffer.destroy(),this.edgeFramebuffer=this.edgeFramebuffer&&this.edgeFramebuffer.destroy(),this.planarFillIdFramebuffer=this.planarFillIdFramebuffer&&this.planarFillIdFramebuffer.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 SS=Hj;var uSe=.1,Rvt=new Zh({pass:lo.MOST_DETAILED_PRELOAD}),Ovt=new Zh({pass:lo.MOST_DETAILED_PICK}),Y1=new Zh({pass:lo.PICK});function gs(e){this._mostDetailedRayPicks=[],this.pickRenderStateCache={},this._pickPositionCache={},this._pickPositionCacheDirty=!1;let t=new Je(0,0,1,1),n=new Ir(e);n.frustum=new pn({width:uSe,aspectRatio:1,near:.1}),this._pickOffscreenView=new SS(e,n,t)}gs.prototype.update=function(){this._pickPositionCacheDirty=!0};gs.prototype.getPickDepth=function(e,t){let n=e.view.pickDepths,i=n[t];return l(i)||(i=new Dj,n[t]=i),i};var Mvt=new Aa,Lvt=new h,Gj=new h,Nvt=new k,Fvt=new O;function Bvt(e,t,n,i,r){let o=e.camera,a=o.frustum,s=a.offCenterFrustum;l(s)&&(a=s);let c=2*(t.x-r.x)/r.width-1;c*=(a.right-a.left)*.5;let u=2*(r.height-t.y-r.y)/r.height-1;u*=(a.top-a.bottom)*.5;let f=O.clone(o.transform,Fvt);o._setTransform(O.IDENTITY);let d=h.clone(o.position,Lvt);h.multiplyByScalar(o.right,c,Gj),h.add(Gj,d,d),h.multiplyByScalar(o.up,u,Gj),h.add(Gj,d,d),o._setTransform(f),e.mode===re.SCENE2D&&h.fromElements(d.z,d.x,d.y,d);let p=a.getPixelDimensions(r.width,r.height,1,1,Nvt),g=Mvt;return g.right=p.x*.5,g.left=-g.right,g.top=p.y*.5,g.bottom=-g.top,g.near=a.near,g.far=a.far,g.computeCullingVolume(d,o.directionWC,o.upWC)}var kvt=new ru,zvt=new k;function Uvt(e,t,n,i,r){let o=e.camera,a=o.frustum,s=a.near,c=Math.tan(a.fovy*.5),u=a.aspectRatio*c,f=2*(t.x-r.x)/r.width-1,d=2*(r.height-t.y-r.y)/r.height-1,p=f*s*u,g=d*s*c,m=a.getPixelDimensions(r.width,r.height,1,1,zvt),y=m.x*n*.5,A=m.y*i*.5,b=kvt;return b.top=g+A,b.bottom=g-A,b.right=p+y,b.left=p-y,b.near=s,b.far=a.far,b.computeCullingVolume(o.positionWC,o.directionWC,o.upWC)}function Wj(e,t,n,i,r){let o=e.camera.frustum;return o instanceof pn||o instanceof Aa?Bvt(e,t,n,i,r):Uvt(e,t,n,i,r)}var X1=new Je(0,0,3,3),qj=new k,K1=new U(0,0,0,0);function Nee(e,t,n,i,r){return r.width=n??3,r.height=i??r.width,r.x=t.x-(r.width-1)*.5,r.y=e-t.y-(r.height-1)*.5,r}function Yj(e,t,n,i,r,o){let{context:a,frameState:s,defaultView:c}=e,{viewport:u,pickFramebuffer:f}=c,d=o?.framebuffer??f;e.view=c,u.x=0,u.y=0,u.width=a.drawingBufferWidth,u.height=a.drawingBufferHeight;let p=c.passState;p.viewport=Je.clone(u,p.viewport);let g=cr.transformWindowToDrawingBuffer(e,t,qj);Nee(a.drawingBufferHeight,g,i,r,n),e.jobScheduler.disableThisFrame(),e.updateFrameState(),s.cullingVolume=Wj(e,g,n.width,n.height,u),s.invertClassification=!1,s.passes.pick=!0,s.passes.snap=o?.snap??!1,s.tilesetPassState=Y1,a.uniformState.update(s),e.updateEnvironment(),p=d.begin(n,u),e.updateAndExecuteCommands(p,K1),e.resolveFramebuffers(p)}function Xj(e){let{context:t}=e;t.endFrame()}gs.prototype.pickAsync=async function(e,t,n,i,r=1){let{context:o,frameState:a,defaultView:s}=e,{pickFramebuffer:c}=s,u=X1;Yj(e,t,u,n,i);let f;return o.webgl2?f=c.endAsync(u,a,r):(f=c.end(u,r),f=Promise.resolve(f),pt("picking-async-fallback","Fallback to synchronous picking because async operation requires WebGL2 context.")),Xj(e),f};gs.prototype.pick=function(e,t,n,i,r=1){let{defaultView:o}=e,{pickFramebuffer:a}=o,s=X1;Yj(e,t,s,n,i);let c=a.end(s,r);return Xj(e),c};gs.prototype.pickVoxelCoordinate=function(e,t,n,i){let{context:r,frameState:o,defaultView:a}=e,{viewport:s,pickFramebuffer:c}=a;e.view=a,s.x=0,s.y=0,s.width=r.drawingBufferWidth,s.height=r.drawingBufferHeight;let u=a.passState;u.viewport=Je.clone(s,u.viewport);let f=cr.transformWindowToDrawingBuffer(e,t,qj),d=Nee(r.drawingBufferHeight,f,n,i,X1);e.jobScheduler.disableThisFrame(),e.updateFrameState(),o.cullingVolume=Wj(e,f,d.width,d.height,s),o.invertClassification=!1,o.passes.pickVoxel=!0,o.tilesetPassState=Y1,r.uniformState.update(o),e.updateEnvironment(),u=c.begin(d,s),e.updateAndExecuteCommands(u,K1),e.resolveFramebuffers(u);let p=c.readCenterPixel(d);return r.endFrame(),p};gs.prototype.pickMetadata=function(e,t,n){let{context:i,frameState:r,defaultView:o}=e,{viewport:a,pickFramebuffer:s}=o;e.view=o,a.x=0,a.y=0,a.width=i.drawingBufferWidth,a.height=i.drawingBufferHeight;let c=o.passState;c.viewport=Je.clone(a,c.viewport);let u=cr.transformWindowToDrawingBuffer(e,t,qj),f=Nee(i.drawingBufferHeight,u,1,1,X1);e.jobScheduler.disableThisFrame(),e.updateFrameState(),r.cullingVolume=Wj(e,u,f.width,f.height,a),r.invertClassification=!1,r.passes.pick=!0,r.tilesetPassState=Y1,r.pickingMetadata=!0,r.pickedMetadataInfo=n,i.uniformState.update(r),e.updateEnvironment(),c=s.begin(f,a),e.updateAndExecuteCommands(c,K1);let d=e._environmentState.useOIT;e._environmentState.useOIT=!1,e.resolveFramebuffers(c),e._environmentState.useOIT=d;let p=s.readCenterPixel(f);return i.endFrame(),r.pickingMetadata=!1,Pj.decodeMetadataValues(n.classProperty,n.metadataProperty,p)};function Vvt(e,t){let{defaultView:n,context:i,frameState:r,environmentState:o}=e,{viewport:a,pickDepthFramebuffer:s}=n;e.view=n,a.x=0,a.y=0,a.width=i.drawingBufferWidth,a.height=i.drawingBufferHeight;let c=n.passState;c.viewport=Je.clone(a,c.viewport),e.clearPasses(r.passes),r.passes.pick=!0,r.passes.depth=!0,r.cullingVolume=Wj(e,t,1,1,a),r.tilesetPassState=Y1,e.updateEnvironment(),o.renderTranslucentDepthForPick=!0,c=s.update(i,t,a),e.updateAndExecuteCommands(c,K1),e.resolveFramebuffers(c),i.endFrame()}var jvt=new Yi,Hvt=new ru,Gvt=new pn,Wvt=new Aa;gs.prototype.pickPositionWorldCoordinates=function(e,t,n){if(!e.useDepthPicking)return;let i=t.toString();if(this._pickPositionCacheDirty)this._pickPositionCache={},this._pickPositionCacheDirty=!1;else if(this._pickPositionCache.hasOwnProperty(i))return h.clone(this._pickPositionCache[i],n);let{context:r,frameState:o,camera:a,defaultView:s}=e,{uniformState:c}=r;e.view=s;let u=cr.transformWindowToDrawingBuffer(e,t,qj);e.pickTranslucentDepth?Vvt(e,u):(e.updateFrameState(),c.update(o),e.updateEnvironment()),u.y=e.drawingBufferHeight-u.y;let f;l(a.frustum.fov)?f=a.frustum.clone(jvt):l(a.frustum.infiniteProjectionMatrix)?f=a.frustum.clone(Hvt):l(a.frustum.width)?f=a.frustum.clone(Gvt):f=a.frustum.clone(Wvt);let{frustumCommandsList:d}=s,p=d.length;for(let g=0;g<p;++g){let y=this.getPickDepth(e,g).getDepth(r,u.x,u.y);if(l(y)&&y>0&&y<1){let A=d[g],b;return e.mode===re.SCENE2D?(b=a.position.z,a.position.z=b-A.near+1,f.far=Math.max(1,A.far-A.near),f.near=1,c.update(o),c.updateFrustum(f)):(f.near=A.near*(g!==0?e.opaqueFrustumNearOffset:1),f.far=A.far,c.updateFrustum(f)),n=cr.drawingBufferToWorldCoordinates(e,u,y,n),e.mode===re.SCENE2D&&(a.position.z=b,c.update(o)),this._pickPositionCache[i]=h.clone(n),n}}this._pickPositionCache[i]=void 0};var qvt=new de;gs.prototype.pickPosition=function(e,t,n){if(n=this.pickPositionWorldCoordinates(e,t,n),l(n)&&e.mode!==re.SCENE3D){h.fromElements(n.y,n.z,n.x,n);let i=e.mapProjection,r=i.ellipsoid,o=i.unproject(n,qvt);r.cartographicToCartesian(o,n)}return n};function Yvt(e,t,n,i,r,o){for(let a of e){let s=a.object,c=a.position,u=a.exclude;if(l(c)&&!l(s))return n.push(a),!0;if(!l(s)||!l(s.primitive)||!u&&(n.push(a),n.length>=t))return!0;let f=s.primitive,d=!1;if(typeof f.getGeometryInstanceAttributes=="function"&&l(s.id)){let p=f.getGeometryInstanceAttributes(s.id);l(p)&&l(p.show)&&(d=!0,p.show=Dn.toValue(!1,p.show),r.push(p))}s instanceof us&&(d=!0,s.show=!1,o.push(s)),d||(f.show=!1,i.push(f))}}function fSe(e,t){let n=[],i=[],r=[],o=[];l(t)||(t=Number.MAX_VALUE);let a=e(t);for(;l(a)&&a.length>0&&!Yvt(a,t,n,i,r,o);)a=e(t-n.length);for(let s=0;s<i.length;++s)i[s].show=!0;for(let s=0;s<r.length;++s){let c=r[s];c.show=Dn.toValue(!0,c.show)}for(let s=0;s<o.length;++s)o[s].show=!0;return n}gs.prototype.drillPick=function(e,t,n,i,r){return fSe(s=>this.pick(e,t,i,r,s).map(u=>({object:u,position:void 0,exclude:!1})),n).map(s=>s.object)};var lSe=new h,Xvt=new h;function Kvt(e,t,n){this.ray=e,this.width=t,this.tilesets=n,this.ready=!1;let i=this;this.promise=new Promise(r=>{i._completePick=()=>{r()}})}function dSe(e,t,n,i){let r=t.direction,o=h.mostOrthogonalAxis(r,lSe),a=h.cross(r,o,lSe),s=h.cross(r,a,Xvt);return i.position=t.origin,i.direction=r,i.up=s,i.right=a,i.frustum.width=n??uSe,i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC)}function $vt(e,t,n){let i=t.frameState,{ray:r,width:o,tilesets:a}=n,s=e._pickOffscreenView.camera,c=dSe(e,r,o,s),u=Rvt;u.camera=s,u.cullingVolume=c;let f=!0,d=a.length;for(let p=0;p<d;++p){let g=a[p];g.show&&t.primitives.contains(g)&&(g.updateForPass(i,u),f=f&&u.ready)}return f&&n._completePick(),f}gs.prototype.updateMostDetailedRayPicks=function(e){let t=this._mostDetailedRayPicks;for(let n=0;n<t.length;++n)$vt(this,e,t[n])&&t.splice(n--,1)};function hSe(e,t,n){for(let i=0;i<e.length;++i){let r=e.get(i);r.show&&(l(r.isCesium3DTileset)?(!l(t)||t.indexOf(r)===-1)&&n.push(r):r instanceof pu&&hSe(r,t,n))}}function Kj(e,t,n,i,r,o){let a=[];if(hSe(t.primitives,i,a),a.length===0)return Promise.resolve(o());let s=new Kvt(n,r,a);return e._mostDetailedRayPicks.push(s),s.promise.then(function(){return o()})}function Jvt(e,t){return!l(e)||!l(t)||t.length===0?!1:t.indexOf(e)>-1||t.indexOf(e.primitive)>-1||t.indexOf(e.id)>-1}function Zvt(e,t,n,i,r,o,a){let{context:s,frameState:c}=t,u=s.uniformState,f=e._pickOffscreenView;t.view=f,dSe(e,n,r,f.camera);let d=Je.clone(f.viewport,X1),p=f.pickFramebuffer.begin(d,f.viewport);t.jobScheduler.disableThisFrame(),t.updateFrameState(),c.invertClassification=!1,c.passes.pick=!0,c.passes.offscreen=!0,a?c.tilesetPassState=Ovt:c.tilesetPassState=Y1,u.update(c),t.updateEnvironment(),t.updateAndExecuteCommands(p,K1),t.resolveFramebuffers(p);let g,m=f.pickFramebuffer.end(d,1)[0];if(t.context.depthTexture){let{frustumCommandsList:y}=f,A=y.length;for(let b=0;b<A;++b){let T=e.getPickDepth(t,b).getDepth(s,0,0);if(l(T)&&T>0&&T<1){let C=y[b],E=C.near*(b!==0?t.opaqueFrustumNearOffset:1),w=C.far,D=E+T*(w-E);g=hn.getPoint(n,D);break}}}if(t.view=t.defaultView,s.endFrame(),l(m)||l(g))return{object:m,position:g,exclude:!l(g)&&o||Jvt(m,i)}}function Fee(e,t,n,i,r,o,a,s){return fSe(function(){let u=Zvt(e,t,n,r,o,a,s);return u?[u]:void 0},i)}function wS(e,t,n,i,r,o,a){let s=Fee(e,t,n,1,i,r,o,a);if(s.length>0)return s[0]}function $j(e,t){return new Promise((n,i)=>{t.then(function(r){let o=e.postRender.addEventListener(function(){o(),n(r)});e.requestRender()}).catch(function(r){i(r)})})}gs.prototype.pickFromRay=function(e,t,n,i){return wS(this,e,t,n,i,!1,!1)};gs.prototype.drillPickFromRay=function(e,t,n,i,r){return Fee(this,e,t,n,i,r,!1,!1)};gs.prototype.pickFromRayMostDetailed=function(e,t,n,i){let r=this;return t=hn.clone(t),n=l(n)?n.slice():n,$j(e,Kj(r,e,t,n,i,function(){return wS(r,e,t,n,i,!1,!0)}))};gs.prototype.drillPickFromRayMostDetailed=function(e,t,n,i,r){let o=this;return t=hn.clone(t),i=l(i)?i.slice():i,$j(e,Kj(o,e,t,i,r,function(){return Fee(o,e,t,n,i,r,!1,!0)}))};var Qvt=new h,eEt=new h,tEt=new hn,mSe=new de;function Bee(e,t){let n=e.ellipsoid,i=Oi._defaultMaxTerrainHeight,r=n.geodeticSurfaceNormalCartographic(t,eEt),o=de.toCartesian(t,n,Qvt),a=tEt;a.origin=o,a.direction=r;let s=new hn;return hn.getPoint(a,i,s.origin),h.negate(r,s.direction),s}function pSe(e,t){let n=e.ellipsoid,i=de.fromCartesian(t,n,mSe);return Bee(e,i)}function gSe(e,t){let n=e.ellipsoid;return de.fromCartesian(t,n,mSe).height}function nEt(e,t,n,i,r){let o=Bee(t,n);return Kj(e,t,o,i,r,function(){let a=wS(e,t,o,i,r,!0,!0);if(l(a))return gSe(t,a.position)})}function iEt(e,t,n,i,r,o){let a=pSe(t,n);return Kj(e,t,a,i,r,function(){let s=wS(e,t,a,i,r,!0,!0);if(l(s))return h.clone(s.position,o)})}gs.prototype.sampleHeight=function(e,t,n,i){let r=Bee(e,t),o=wS(this,e,r,n,i,!0,!1);if(l(o))return gSe(e,o.position)};gs.prototype.clampToHeight=function(e,t,n,i,r){let o=pSe(e,t),a=wS(this,e,o,n,i,!0,!1);if(l(a))return h.clone(a.position,r)};gs.prototype.sampleHeightMostDetailed=function(e,t,n,i){n=l(n)?n.slice():n;let r=t.length,o=new Array(r);for(let a=0;a<r;++a)o[a]=nEt(this,e,t[a],n,i);return $j(e,Promise.all(o).then(function(a){let s=a.length;for(let c=0;c<s;++c)t[c].height=a[c];return t}))};gs.prototype.clampToHeightMostDetailed=function(e,t,n,i){n=l(n)?n.slice():n;let r=t.length,o=new Array(r);for(let a=0;a<r;++a)o[a]=iEt(this,e,t[a],n,i,t[a]);return $j(e,Promise.all(o).then(function(a){let s=a.length;for(let c=0;c<s;++c)t[c]=a[c];return t}))};gs.prototype.destroy=function(){this._pickOffscreenView=this._pickOffscreenView&&this._pickOffscreenView.destroy()};var Jj=gs;var Zj=`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 Qj=`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;
|
|
// Avoid numerical error at far plane
|
|
if (depth >= 1.0) {
|
|
posEC.z = czm_currentFrustum.y;
|
|
}
|
|
return posEC;
|
|
}
|
|
|
|
// Reconstruct surface normal in eye coordinates, avoiding edges
|
|
vec3 getNormalXEdge(vec3 positionEC)
|
|
{
|
|
// Find the 3D surface positions at adjacent screen pixels
|
|
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;
|
|
|
|
// Compute potential tangent vectors
|
|
vec3 dx0 = positionEC - positionLeft;
|
|
vec3 dx1 = positionRight - positionEC;
|
|
vec3 dy0 = positionEC - positionDown;
|
|
vec3 dy1 = positionUp - positionEC;
|
|
|
|
// The shorter tangent is more likely to be on the same surface
|
|
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);
|
|
|
|
// Exit if we are too close to the back of the frustum, where the depth value is invalid.
|
|
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);
|
|
// Choose a step length such that the marching stops just before 3 * variance.
|
|
float stepLength = 3.0 * gaussianVariance / (float(stepCount) + 1.0);
|
|
float metersPerPixel = czm_metersPerPixel(positionEC, 1.0);
|
|
// Minimum step is 1 pixel to avoid double sampling
|
|
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);
|
|
|
|
// Initial sampling direction (different for each pixel)
|
|
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;
|
|
// Loop over sampling directions
|
|
#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
|
|
// Step along sampling direction, away from output pixel
|
|
vec2 samplePixel = floor(gl_FragCoord.xy + float(j + 1) * radialStep) + vec2(0.5);
|
|
|
|
// Exit if we stepped off the screen
|
|
if (clamp(samplePixel, vec2(0.0), czm_viewport.zw) != samplePixel) {
|
|
break;
|
|
}
|
|
|
|
// Compute step vector from output point to sampled point
|
|
vec4 samplePositionEC = pixelToEye(samplePixel);
|
|
vec3 stepVector = samplePositionEC.xyz - positionEC.xyz;
|
|
|
|
// Estimate the angle from the surface normal.
|
|
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);
|
|
|
|
// Weight contribution based on the distance from the output point
|
|
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 e6=`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 t6=`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 n6=`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 i6=`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 r6=`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 o6=`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 a6=`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 s6=`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 c6=`uniform sampler2D colorTexture;
|
|
|
|
in vec2 v_textureCoordinates;
|
|
|
|
#ifdef AUTO_EXPOSURE
|
|
uniform sampler2D autoExposure;
|
|
#else
|
|
uniform float exposure;
|
|
#endif
|
|
|
|
// See slides 142 and 143:
|
|
// http://www.gdcvault.com/play/1012459/Uncharted_2__HDR_Lighting
|
|
|
|
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; // shoulder strength
|
|
const float B = 0.30; // linear strength
|
|
const float C = 0.10; // linear angle
|
|
const float D = 0.20; // toe strength
|
|
const float E = 0.01; // toe numerator
|
|
const float F = 0.30; // toe denominator
|
|
|
|
const float white = 11.2; // linear white point value
|
|
|
|
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 l6=`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 u6=`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 Bx=`#define SAMPLES 8
|
|
|
|
uniform float delta;
|
|
uniform float sigma;
|
|
uniform float direction; // 0.0 for x direction, 1.0 for y direction
|
|
|
|
uniform sampler2D colorTexture;
|
|
|
|
#ifdef USE_STEP_SIZE
|
|
uniform float stepSize;
|
|
#else
|
|
uniform vec2 step;
|
|
#endif
|
|
|
|
in vec2 v_textureCoordinates;
|
|
|
|
// Incremental Computation of the Gaussian:
|
|
// https://developer.nvidia.com/gpugems/GPUGems3/gpugems3_ch40.html
|
|
|
|
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 f6=`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;
|
|
|
|
// whether it is in space or not
|
|
// 6500000.0 is empirical value
|
|
#define DISTANCE_TO_SPACE 6500000.0
|
|
|
|
// return ndc from world coordinate biased earthRadius
|
|
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);
|
|
}
|
|
|
|
// Check if current pixel is included Earth
|
|
// if then mask it gradually
|
|
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));
|
|
}
|
|
|
|
// For Chromatic effect
|
|
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;
|
|
|
|
// Sun position
|
|
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 sun is not in the screen space, use original color.
|
|
if(!isSpace || !((sunPos.x >= -1.1 && sunPos.x <= 1.1) && (sunPos.y >= -1.1 && sunPos.y <= 1.1)))
|
|
{
|
|
// Lens flare is disabled when not in space until #5932 is fixed.
|
|
// https://github.com/CesiumGS/cesium/issues/5932
|
|
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);
|
|
|
|
// ghost vector to image centre:
|
|
vec2 ghostVec = (vec2(0.5) - texcoord) * ghostDispersal;
|
|
vec3 direction = normalize(vec3(ghostVec, 0.0));
|
|
|
|
// sample ghosts:
|
|
vec4 result = vec4(0.0);
|
|
vec4 ghost = vec4(0.0);
|
|
for (int i = 0; i < 4; ++i)
|
|
{
|
|
vec2 offset = fract(texcoord + ghostVec * float(i));
|
|
// Only bright spots from the centre of the source image
|
|
ghost += textureDistorted(colorTexture, offset, direction.xy, distortionVec, isSpace);
|
|
}
|
|
result += ghost;
|
|
|
|
// sample halo
|
|
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;
|
|
|
|
// dirt on lens
|
|
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);
|
|
|
|
// Rotating starburst texture's coordinate
|
|
// dot(czm_view[0].xyz, vec3(0.0, 0.0, 1.0)) + dot(czm_view[1].xyz, vec3(0.0, 1.0, 0.0))
|
|
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 d6=`uniform sampler2D colorTexture;
|
|
uniform vec3 white;
|
|
|
|
in vec2 v_textureCoordinates;
|
|
|
|
#ifdef AUTO_EXPOSURE
|
|
uniform sampler2D autoExposure;
|
|
#else
|
|
uniform float exposure;
|
|
#endif
|
|
|
|
// See equation 4:
|
|
// http://www.cs.utah.edu/~reinhard/cdrom/tonemap.pdf
|
|
|
|
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 h6=`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 m6=`uniform sampler2D colorTexture;
|
|
|
|
in vec2 v_textureCoordinates;
|
|
|
|
#ifdef AUTO_EXPOSURE
|
|
uniform sampler2D autoExposure;
|
|
#else
|
|
uniform float exposure;
|
|
#endif
|
|
|
|
// See equation 3:
|
|
// http://www.cs.utah.edu/~reinhard/cdrom/tonemap.pdf
|
|
|
|
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 p6=`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);
|
|
}
|
|
`;/**
|
|
* @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 g6=`/**
|
|
* @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.
|
|
*/
|
|
|
|
// NVIDIA GameWorks Graphics Samples GitHub link: https://github.com/NVIDIAGameWorks/GraphicsSamples
|
|
// Original source (archived): https://archive.org/details/nvidiagame-works-graphics-samples-master
|
|
// Original FXAA 3.11 shader link: https://github.com/NVIDIAGameWorks/GraphicsSamples/blob/master/samples/es3-kepler/FXAA/FXAA3_11.h
|
|
// Shader link in fork: https://github.com/lyntel/GraphicsSamples/blob/3d30817ebeeade64fe6a4fc3aa1fe4265c29b6fd/samples/es3-kepler/FXAA/FXAA3_11.h
|
|
|
|
// Steps used to integrate into Cesium:
|
|
// * The following defines are set:
|
|
// #define FXAA_PC 1
|
|
// #define FXAA_WEBGL_1 1
|
|
// #define FXAA_GREEN_AS_LUMA 1
|
|
// #define FXAA_EARLY_EXIT 1
|
|
// #define FXAA_GLSL_120 1
|
|
// * All other preprocessor directives besides the FXAA_QUALITY__P* directives were removed.
|
|
// * Double underscores are invalid for preprocessor directives so replace them with a single underscore. Replace
|
|
// /FXAA_QUALITY__P(.*)/g with /FXAA_QUALITY__P$1/.
|
|
// * There are no implicit conversions from ivec* to vec* so replace:
|
|
// #define FxaaInt2 ivec2
|
|
// with
|
|
// #define FxaaInt2 vec2
|
|
// * The texture2DLod function is only available in vertex shaders so replace:
|
|
// #define FxaaTexTop(t, p) texture2DLod(t, p, 0.0)
|
|
// #define FxaaTexOff(t, p, o, r) texture2DLod(t, p + (o * r), 0.0)
|
|
// with
|
|
// #define FxaaTexTop(t, p) texture(t, p)
|
|
// #define FxaaTexOff(t, p, o, r) texture(t, p + (o * r))
|
|
// * FXAA_QUALITY_PRESET is prepended in the javascript code. We may want to expose that setting in the future.
|
|
// * The following parameters to FxaaPixelShader are unused and can be removed:
|
|
// fxaaConsolePosPos
|
|
// fxaaConsoleRcpFrameOpt
|
|
// fxaaConsoleRcpFrameOpt2
|
|
// fxaaConsole360RcpFrameOpt2
|
|
// fxaaConsoleEdgeSharpness
|
|
// fxaaConsoleEdgeThreshold
|
|
// fxaaConsoleEdgeThresholdMi
|
|
// fxaaConsole360ConstDir
|
|
|
|
//
|
|
// Choose the quality preset.
|
|
// This needs to be compiled into the shader as it effects code.
|
|
// Best option to include multiple presets is to
|
|
// in each shader define the preset, then include this file.
|
|
//
|
|
// OPTIONS
|
|
// -----------------------------------------------------------------------
|
|
// 10 to 15 - default medium dither (10=fastest, 15=highest quality)
|
|
// 20 to 29 - less dither, more expensive (20=fastest, 29=highest quality)
|
|
// 39 - no dither, very expensive
|
|
//
|
|
// NOTES
|
|
// -----------------------------------------------------------------------
|
|
// 12 = slightly faster then FXAA 3.9 and higher edge quality (default)
|
|
// 13 = about same speed as FXAA 3.9 and better than 12
|
|
// 23 = closest to FXAA 3.9 visually and performance wise
|
|
// _ = the lowest digit is directly related to performance
|
|
// _ = the highest digit is directly related to style
|
|
//
|
|
//#define FXAA_QUALITY_PRESET 12
|
|
|
|
|
|
#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(
|
|
//
|
|
// Use noperspective interpolation here (turn off perspective interpolation).
|
|
// {xy} = center of pixel
|
|
FxaaFloat2 pos,
|
|
//
|
|
// Input color texture.
|
|
// {rgb_} = color in linear or perceptual color space
|
|
// if (FXAA_GREEN_AS_LUMA == 0)
|
|
// {___a} = luma in perceptual color space (not linear)
|
|
FxaaTex tex,
|
|
//
|
|
// Only used on FXAA Quality.
|
|
// This must be from a constant/uniform.
|
|
// {x_} = 1.0/screenWidthInPixels
|
|
// {_y} = 1.0/screenHeightInPixels
|
|
FxaaFloat2 fxaaQualityRcpFrame,
|
|
//
|
|
// Only used on FXAA Quality.
|
|
// This used to be the FXAA_QUALITY_SUBPIX define.
|
|
// It is here now to allow easier tuning.
|
|
// Choose the amount of sub-pixel aliasing removal.
|
|
// This can effect sharpness.
|
|
// 1.00 - upper limit (softer)
|
|
// 0.75 - default amount of filtering
|
|
// 0.50 - lower limit (sharper, less sub-pixel aliasing removal)
|
|
// 0.25 - almost off
|
|
// 0.00 - completely off
|
|
FxaaFloat fxaaQualitySubpix,
|
|
//
|
|
// Only used on FXAA Quality.
|
|
// This used to be the FXAA_QUALITY_EDGE_THRESHOLD define.
|
|
// It is here now to allow easier tuning.
|
|
// The minimum amount of local contrast required to apply algorithm.
|
|
// 0.333 - too little (faster)
|
|
// 0.250 - low quality
|
|
// 0.166 - default
|
|
// 0.125 - high quality
|
|
// 0.063 - overkill (slower)
|
|
FxaaFloat fxaaQualityEdgeThreshold,
|
|
//
|
|
// Only used on FXAA Quality.
|
|
// This used to be the FXAA_QUALITY_EDGE_THRESHOLD_MIN define.
|
|
// It is here now to allow easier tuning.
|
|
// Trims the algorithm from processing darks.
|
|
// 0.0833 - upper limit (default, the start of visible unfiltered edges)
|
|
// 0.0625 - high quality (faster)
|
|
// 0.0312 - visible limit (slower)
|
|
// Special notes when using FXAA_GREEN_AS_LUMA,
|
|
// Likely want to set this to zero.
|
|
// As colors that are mostly not-green
|
|
// will appear very dark in the green channel!
|
|
// Tune by looking at mostly non-green content,
|
|
// then start at zero and increase until aliasing is a problem.
|
|
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);
|
|
}
|
|
`;function kx(){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 si,this._commands=void 0,this._clearCommand=void 0,this._minMaxLuminance=new k,this.enabled=!0,this._enabled=!0,this.minimumLuminance=.1,this.maximumLuminance=10}Object.defineProperties(kx.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},outputTexture:{get:function(){let e=this._framebuffers;if(l(e))return e[e.length-1].getColorTexture(0)}}});function _Se(e){let t=e._framebuffers;if(!l(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 rEt(e,t){_Se(e);let n=e._width,i=e._height,r=t.halfFloatingPointTexture?ke.HALF_FLOAT:ke.FLOAT,o=Math.ceil(Math.log(Math.max(n,i))/Math.log(3)),a=new Array(o);for(let c=0;c<o;++c)n=Math.max(Math.ceil(n/3),1),i=Math.max(Math.ceil(i/3),1),a[c]=new si,a[c].update(t,n,i,1,r);let s=a[o-1].getColorTexture(0);e._previousLuminance.update(t,s.width,s.height,1,r),e._framebuffers=a}function ySe(e){let t=e._commands;if(!l(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].shaderProgram.destroy();e._commands=void 0}function oEt(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 aEt(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 sEt(e,t){ySe(e);let n=e._framebuffers,i=n.length,r=new Array(i);for(let o=0;o<i;++o)r[o]=t.createViewportQuadCommand(aEt(o,i),{framebuffer:n[o].framebuffer,uniformMap:oEt(e,o)});e._commands=r}kx.prototype.clear=function(e){let t=this._framebuffers;if(!l(t))return;let n=this._clearCommand;l(n)||(n=this._clearCommand=new ui({color:new U(0,0,0,0),framebuffer:void 0}));let i=t.length;for(let r=0;r<i;++r)t[r].clear(e,n)};kx.prototype.update=function(e){let t=e.drawingBufferWidth,n=e.drawingBufferHeight;(t!==this._width||n!==this._height)&&(this._width=t,this._height=n,rEt(this,e),sEt(this,e),this._ready||(this._ready=!0)),this._minMaxLuminance.x=this.minimumLuminance,this._minMaxLuminance.y=this.maximumLuminance;let i=this._framebuffers,r=i[i.length-1];i[i.length-1]=this._previousLuminance,this._commands[this._commands.length-1].framebuffer=this._previousLuminance.framebuffer,this._previousLuminance=r};kx.prototype.execute=function(e,t){this._colorTexture=t;let n=this._commands;if(!l(n))return;let i=n.length;for(let r=0;r<i;++r)n[r].execute(e)};kx.prototype.isDestroyed=function(){return!1};kx.prototype.destroy=function(){return _Se(this),ySe(this),ue(this)};var _6=kx;var cEt={NEAREST:0,LINEAR:1},Bd=cEt;function zx(e){e=e??H.EMPTY_OBJECT;let{name:t=Kn(),fragmentShader:n,uniforms:i,textureScale:r=1,forcePowerOfTwo:o=!1,sampleMode:a=Bd.NEAREST,pixelFormat:s=He.RGBA,pixelDatatype:c=ke.UNSIGNED_BYTE,clearColor:u=U.BLACK,scissorRectangle:f}=e;this._fragmentShader=n,this._uniforms=i,this._textureScale=r,this._forcePowerOfTwo=o,this._sampleMode=a,this._pixelFormat=s,this._pixelDatatype=c,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 d=new _c;d.scissorTest={enabled:!0,rectangle:l(f)?Je.clone(f):new Je},this._passState=d,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(zx.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(l(this._textureCache)){let e=this._textureCache.getFramebuffer(this._name);if(l(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 lEt=/uniform\s+sampler2D\s+depthTexture/g;zx.prototype._isSupported=function(e){return!lEt.test(this._fragmentShader)||e.depthTexture};function uEt(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(r){let o=t[n];t[n]=r;let a=e._actualUniforms,s=a[n];l(s)&&s!==o&&s instanceof Et&&!l(e._textureCache.getStageByName(n))&&(e._texturesToRelease.push(s),delete a[n],delete a[`${n}Dimensions`]),o instanceof Et&&e._texturesToRelease.push(o),typeof r=="string"||r instanceof HTMLCanvasElement||r instanceof HTMLImageElement||r instanceof HTMLVideoElement||r instanceof ImageData?e._dirtyUniforms.push(n):a[n]=r}}}function fEt(e,t){return function(){let n=e._actualUniforms[t];return typeof n=="function"?n():n}}function dEt(e,t){return function(){let n=e[t]();if(l(n))return n.dimensions}}function hEt(e){if(l(e._uniformMap))return;let t={},n={},i=e._uniforms,r=e._actualUniforms;for(let o in i){if(!i.hasOwnProperty(o))continue;typeof i[o]!="function"?(t[o]=fEt(e,o),n[o]=uEt(e,i,o)):(t[o]=i[o],n[o]=i[o]),r[o]=i[o];let a=t[o]();(typeof a=="string"||a instanceof Et||a instanceof HTMLImageElement||a instanceof HTMLCanvasElement||a instanceof HTMLVideoElement)&&(t[`${o}Dimensions`]=dEt(t,o))}e._uniforms={},Object.defineProperties(e._uniforms,n),e._uniformMap=Ot(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 mEt(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 pEt(e,t){if(l(e._command)&&!e._logDepthChanged&&!e._selectedDirty)return;let n=e._fragmentShader;if(l(e._selectedIdTexture)){let r=e._selectedIdTexture.width;n=mEt(n,r)}let i=new Ge({defines:[e._useLogDepth?"LOG_DEPTH":""],sources:[n]});e._command=t.createViewportQuadCommand(i,{uniformMap:e._uniformMap,owner:e})}function gEt(e){let t=e._sampleMode,n,i;t===Bd.LINEAR?(n=Gt.LINEAR,i=ni.LINEAR):(n=Gt.NEAREST,i=ni.NEAREST);let r=e._sampler;(!l(r)||r.minificationFilter!==n||r.magnificationFilter!==i)&&(e._sampler=new Ut({wrapS:on.CLAMP_TO_EDGE,wrapT:on.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i}))}function _Et(e,t){return function(n){e._texturesToCreate.push({name:t,source:n})}}function yEt(e,t){return function(){return e._textureCache.getOutputTexture(t)}}function AEt(e,t){let n=e._texturesToRelease;for(let s=0;s<n.length;++s){let c=n[s];l(c)&&c.destroy()}n.length=0;let i=e._texturesToCreate;for(let s=0;s<i.length;++s){let{name:c,source:u}=i[s];e._actualUniforms[c]=new Et({context:t,source:u})}i.length=0;let r=e._dirtyUniforms;if(r.length===0&&!l(e._texturePromise)){e._ready=!0;return}if(r.length===0||l(e._texturePromise))return;let o=e._uniforms,a=[];for(let s=0;s<r.length;++s){let c=r[s],u=o[c],f=e._textureCache.getStageByName(u);if(l(f))e._actualUniforms[c]=yEt(e,u);else if(typeof u=="string"){let d=new De({url:u});a.push(d.fetchImage().then(_Et(e,c)))}else e._texturesToCreate.push({name:c,source:u})}r.length=0,a.length>0?(e._ready=!1,e._texturePromise=Promise.all(a).then(function(){e._ready=!0,e._texturePromise=void 0})):e._ready=!0}function ASe(e){l(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(!l(t))return;let n=e._uniforms,i=e._actualUniforms;for(let r in i){if(!i.hasOwnProperty(r))continue;let o=i[r];o instanceof Et&&(l(t.getStageByName(n[r]))||o.destroy(),e._dirtyUniforms.push(r))}}function bEt(e){let t=l(e._selected)?e._selected.length:0,n=l(e._parentSelected)?e._parentSelected:0,i=e._selected!==e._selectedShadow||t!==e._selectedLength||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength;if(l(e._selected)&&l(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):l(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&l(e._combinedSelected)){if(!l(e._combinedSelectedShadow))return!0;for(let r=0;r<e._combinedSelected.length;++r)if(e._combinedSelected[r]!==e._combinedSelectedShadow[r])return!0}return i}function xEt(e,t){if(!e._selectedDirty)return;e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy(),e._selectedIdTexture=void 0;let n=e._combinedSelected;if(!l(n))return;let i=0;for(let a=0;a<n.length;++a){let s=n[a];l(s.pickIds)?i+=s.pickIds.length:l(s.pickId)&&++i}if(n.length===0||i===0){let a=new Uint8Array([255,255,255,255]);e._selectedIdTexture=new Et({context:t,pixelFormat:He.RGBA,pixelDatatype:ke.UNSIGNED_BYTE,source:{arrayBufferView:a,width:1,height:1},sampler:Ut.NEAREST});return}let r=0,o=new Uint8Array(i*4);for(let a=0;a<n.length;++a){let s=n[a];if(l(s.pickIds)){let c=s.pickIds,u=c.length;for(let f=0;f<u;++f){let d=c[f].color;o[r]=U.floatToByte(d.red),o[r+1]=U.floatToByte(d.green),o[r+2]=U.floatToByte(d.blue),o[r+3]=U.floatToByte(d.alpha),r+=4}}else if(l(s.pickId)){let c=s.pickId.color;o[r]=U.floatToByte(c.red),o[r+1]=U.floatToByte(c.green),o[r+2]=U.floatToByte(c.blue),o[r+3]=U.floatToByte(c.alpha),r+=4}}e._selectedIdTexture=new Et({context:t,pixelFormat:He.RGBA,pixelDatatype:ke.UNSIGNED_BYTE,source:{arrayBufferView:o,width:i,height:1},sampler:Ut.NEAREST})}zx.prototype.update=function(e,t){if(this.enabled!==this._enabled&&!this.enabled&&ASe(this),this._enabled=this.enabled,!this._enabled||(this._logDepthChanged=t!==this._useLogDepth,this._useLogDepth=t,this._selectedDirty=bEt(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=l(this._selected)?this._selected.length:0,this._parentSelectedLength=l(this._parentSelected)?this._parentSelected.length:0,xEt(this,e),hEt(this),AEt(this,e),pEt(this,e),gEt(this),this._selectedDirty=!1,!this._ready))return;let n=this._textureCache.getFramebuffer(this._name);if(this._command.framebuffer=n,!l(n))return;let i=n.getColorTexture(0),r;(i.width!==e.drawingBufferWidth||i.height!==e.drawingBufferHeight)&&(r=this._renderState,(!l(r)||i.width!==r.viewport.width||i.height!==r.viewport.height)&&(this._renderState=je.fromCache({viewport:new Je(0,0,i.width,i.height)}))),this._command.renderState=r};zx.prototype.execute=function(e,t,n,i){if(!l(this._command)||!l(this._command.framebuffer)||!this._ready||!this._enabled)return;this._colorTexture=t,this._depthTexture=n,this._idTexture=i,Ut.equals(this._colorTexture.sampler,this._sampler)||(this._colorTexture.sampler=this._sampler);let r=this.scissorRectangle.width>0&&this.scissorRectangle.height>0?this._passState:void 0;l(r)&&(r.context=e),this._command.execute(e,r)};zx.prototype.isDestroyed=function(){return!1};zx.prototype.destroy=function(){return ASe(this),ue(this)};var Mr=zx;function Ux(e){e=e??H.EMPTY_OBJECT,this._stages=e.stages,this._inputPreviousStageTexture=e.inputPreviousStageTexture??!0;let t=e.name;l(t)||(t=Kn()),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(Ux.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}}});Ux.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};Ux.prototype.get=function(e){return this._stages[e]};function TEt(e){let t=l(e._selected)?e._selected.length:0,n=l(e._parentSelected)?e._parentSelected:0,i=e._selected!==e._selectedShadow||t!==e._selectedLength;if(i=i||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength,l(e._selected)&&l(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):l(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&l(e._combinedSelected)){if(!l(e._combinedSelectedShadow))return!0;t=e._combinedSelected.length;for(let r=0;r<t;++r)if(e._combinedSelected[r]!==e._combinedSelectedShadow[r])return!0}return i}Ux.prototype.update=function(e,t){this._selectedDirty=TEt(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=l(this._selected)?this._selected.length:0,this._parentSelectedLength=l(this._parentSelected)?this._parentSelected.length:0;let n=this._stages,i=n.length;for(let r=0;r<i;++r){let o=n[r];this._selectedDirty&&(o.parentSelected=this._combinedSelected),o.update(e,t)}};Ux.prototype.isDestroyed=function(){return!1};Ux.prototype.destroy=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return ue(this)};var yf=Ux;var Xo={};function kee(e){let r=`#define USE_STEP_SIZE
|
|
${Bx}`,o=new Mr({name:`${e}_x_direction`,fragmentShader:r,uniforms:{delta:1,sigma:2,stepSize:1,direction:0},sampleMode:Bd.LINEAR}),a=new Mr({name:`${e}_y_direction`,fragmentShader:r,uniforms:{delta:1,sigma:2,stepSize:1,direction:1},sampleMode:Bd.LINEAR}),s={};return Object.defineProperties(s,{delta:{get:function(){return o.uniforms.delta},set:function(c){let u=o.uniforms,f=a.uniforms;u.delta=f.delta=c}},sigma:{get:function(){return o.uniforms.sigma},set:function(c){let u=o.uniforms,f=a.uniforms;u.sigma=f.sigma=c}},stepSize:{get:function(){return o.uniforms.stepSize},set:function(c){let u=o.uniforms,f=a.uniforms;u.stepSize=f.stepSize=c}}}),new yf({name:e,stages:[o,a],uniforms:s})}Xo.createBlurStage=function(){return kee("czm_blur")};Xo.createDepthOfFieldStage=function(){let e=kee("czm_depth_of_field_blur"),t=new Mr({name:"czm_depth_of_field_composite",fragmentShader:o6,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 yf({name:"czm_depth_of_field",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};Xo.isDepthOfFieldSupported=function(e){return e.context.depthTexture};Xo.createEdgeDetectionStage=function(){let e=Kn();return new Mr({name:`czm_edge_detection_${e}`,fragmentShader:s6,uniforms:{length:.25,color:U.clone(U.BLACK)}})};Xo.isEdgeDetectionSupported=function(e){return e.context.depthTexture};function CEt(e){if(!l(e))return Xo.createEdgeDetectionStage();let t=new yf({name:"czm_edge_detection_multiple",stages:e,inputPreviousStageTexture:!1}),n={},i="",r="";for(let s=0;s<e.length;++s)i+=`uniform sampler2D edgeTexture${s};
|
|
`,r+=` vec4 edge${s} = texture(edgeTexture${s}, v_textureCoordinates);
|
|
if (edge${s}.a > 0.0)
|
|
{
|
|
color = edge${s};
|
|
break;
|
|
}
|
|
`,n[`edgeTexture${s}`]=e[s].name;let o=`${i}in vec2 v_textureCoordinates;
|
|
void main() {
|
|
vec4 color = vec4(0.0);
|
|
for (int i = 0; i < ${e.length}; i++)
|
|
{
|
|
${r} }
|
|
out_FragColor = color;
|
|
}
|
|
`,a=new Mr({name:"czm_edge_detection_combine",fragmentShader:o,uniforms:n});return new yf({name:"czm_edge_detection_composite",stages:[t,a]})}Xo.createSilhouetteStage=function(e){let t=CEt(e),n=new Mr({name:"czm_silhouette_color_edges",fragmentShader:p6,uniforms:{silhouetteTexture:t.name}});return new yf({name:"czm_silhouette",stages:[t,n],inputPreviousStageTexture:!1,uniforms:t.uniforms})};Xo.isSilhouetteSupported=function(e){return e.context.depthTexture};Xo.createBloomStage=function(){let e=new Mr({name:"czm_bloom_contrast_bias",fragmentShader:r6,uniforms:{contrast:128,brightness:-.3}}),t=kee("czm_bloom_blur"),n=new yf({name:"czm_bloom_contrast_bias_blur",stages:[e,t]}),i=new Mr({name:"czm_bloom_generate_composite",fragmentShader:n6,uniforms:{glowOnly:!1,bloomTexture:n.name}}),r={};return Object.defineProperties(r,{glowOnly:{get:function(){return i.uniforms.glowOnly},set:function(o){i.uniforms.glowOnly=o}},contrast:{get:function(){return e.uniforms.contrast},set:function(o){e.uniforms.contrast=o}},brightness:{get:function(){return e.uniforms.brightness},set:function(o){e.uniforms.brightness=o}},delta:{get:function(){return t.uniforms.delta},set:function(o){t.uniforms.delta=o}},sigma:{get:function(){return t.uniforms.sigma},set:function(o){t.uniforms.sigma=o}},stepSize:{get:function(){return t.uniforms.stepSize},set:function(o){t.uniforms.stepSize=o}}}),new yf({name:"czm_bloom",stages:[n,i],inputPreviousStageTexture:!1,uniforms:r})};Xo.createAmbientOcclusionStage=function(){let e=new Mr({name:"czm_ambient_occlusion_generate",fragmentShader:Qj,uniforms:{intensity:3,bias:.1,lengthCap:.26,directionCount:8,stepCount:32,randomTexture:void 0}}),t=new Mr({name:"czm_ambient_occlusion_composite",fragmentShader:e6,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 yf({name:"czm_ambient_occlusion",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};Xo.isAmbientOcclusionSupported=function(e){return e.context.depthTexture};var vEt=`#define FXAA_QUALITY_PRESET 39
|
|
${g6}
|
|
${u6}`;Xo.createFXAAStage=function(){return new Mr({name:"czm_FXAA",fragmentShader:vEt,sampleMode:Bd.LINEAR})};Xo.createAcesTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
|
|
`:"";return t+=Zj,new Mr({name:"czm_aces",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Xo.createFilmicTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
|
|
`:"";return t+=c6,new Mr({name:"czm_filmic",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Xo.createPbrNeutralTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
|
|
`:"";return t+=l6,new Mr({name:"czm_pbr_neutral",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Xo.createReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
|
|
`:"";return t+=m6,new Mr({name:"czm_reinhard",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Xo.createModifiedReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
|
|
`:"";return t+=d6,new Mr({name:"czm_modified_reinhard",fragmentShader:t,uniforms:{white:U.WHITE,autoExposure:void 0,exposure:1}})};Xo.createAutoExposureStage=function(){return new _6};Xo.createBlackAndWhiteStage=function(){return new Mr({name:"czm_black_and_white",fragmentShader:t6,uniforms:{gradations:5}})};Xo.createBrightnessStage=function(){return new Mr({name:"czm_brightness",fragmentShader:i6,uniforms:{brightness:.5}})};Xo.createNightVisionStage=function(){return new Mr({name:"czm_night_vision",fragmentShader:h6})};Xo.createDepthViewStage=function(){return new Mr({name:"czm_depth_view",fragmentShader:a6})};Xo.createLensFlareStage=function(){return new Mr({name:"czm_lens_flare",fragmentShader:f6,uniforms:{dirtTexture:$t("Assets/Textures/LensFlare/DirtMask.jpg"),starTexture:$t("Assets/Textures/LensFlare/StarBurst.jpg"),intensity:2,distortion:10,ghostDispersal:.4,haloWidth:.4,dirtAmount:.4,earthRadius:te.WGS84.maximumRadius}})};var kd=Xo;function Eg(e){this._collection=e,this._framebuffers=[],this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0,this._updateDependencies=!1}function J1(e){for(;l(e.length);)e=e.get(e.length-1);return e.name}function zee(e,t,n,i,r){if(!i.enabled||!i._isSupported(t))return r;let o=n[i.name]={};if(l(r)){let s=e.getStageByName(r);o[J1(s)]=!0}let a=i.uniforms;if(l(a)){let s=Object.getOwnPropertyNames(a),c=s.length;for(let u=0;u<c;++u){let f=a[s[u]];if(typeof f=="string"){let d=e.getStageByName(f);l(d)&&(o[J1(d)]=!0)}}}return i.name}function $1(e,t,n,i,r){if(l(i.enabled)&&!i.enabled||l(i._isSupported)&&!i._isSupported(t))return r;let o=r,a=!l(i.inputPreviousStageTexture)||i.inputPreviousStageTexture,s=r,c=i.length;for(let d=0;d<c;++d){let p=i.get(d);l(p.length)?s=$1(e,t,n,p,r):s=zee(e,t,n,p,r),a&&(r=s)}let u,f;if(a)for(u=1;u<c;++u)f=J1(i.get(u)),l(n[f])||(n[f]={}),n[f][o]=!0;else for(u=1;u<c;++u){f=J1(i.get(u));let d=n[f];for(let p=0;p<u;++p)d[J1(i.get(p))]=!0}return s}function EEt(e,t){let n={};if(l(e.ambientOcclusion)){let i=e.ambientOcclusion,r=e.bloom,o=e._tonemapping,a=e.fxaa,s=$1(e,t,n,i,void 0);s=$1(e,t,n,r,s),s=zee(e,t,n,o,s),s=$1(e,t,n,e,s),zee(e,t,n,a,s)}else $1(e,t,n,e,void 0);return n}function SEt(e,t,n){let r=e._collection.getStageByName(t),o=r._textureScale,a=r._forcePowerOfTwo,s=r._pixelFormat,c=r._pixelDatatype,u=r._clearColor,f,d,p=e._framebuffers,g=p.length;for(f=0;f<g;++f){if(d=p[f],o!==d.textureScale||a!==d.forcePowerOfTwo||s!==d.pixelFormat||c!==d.pixelDatatype||!U.equals(u,d.clearColor))continue;let m=d.stages,y=m.length,A=!1;for(let b=0;b<y;++b)if(n[m[b]]){A=!0;break}if(!A)break}return l(d)&&f<g?(d.stages.push(t),d):(d={textureScale:o,forcePowerOfTwo:a,pixelFormat:s,pixelDatatype:c,clearColor:u,stages:[t],buffer:new si({pixelFormat:s,pixelDatatype:c}),clear:void 0},p.push(d),d)}function wEt(e,t){let n=EEt(e._collection,t);for(let i in n)n.hasOwnProperty(i)&&(e._stageNameToFramebuffer[i]=SEt(e,i,n[i]))}function Uee(e){let t=e._framebuffers,n=t.length;for(let i=0;i<n;++i)t[i].buffer.destroy()}function IEt(e,t){let n=e._width,i=e._height,r=e._framebuffers,o=r.length;for(let a=0;a<o;++a){let s=r[a],c=s.textureScale,u=Math.ceil(n*c),f=Math.ceil(i*c),d=Math.min(u,f);s.forcePowerOfTwo&&(I.isPowerOfTwo(d)||(d=I.nextPowerOfTwo(d)),u=d,f=d),s.buffer.update(t,u,f),s.clear=new ui({color:s.clearColor,framebuffer:s.buffer.framebuffer})}}Eg.prototype.updateDependencies=function(){this._updateDependencies=!0};Eg.prototype.update=function(e){let t=this._collection,n=this._updateDependencies,i=l(t.ambientOcclusion)&&t.ambientOcclusion.enabled&&t.ambientOcclusion._isSupported(e),r=l(t.bloom)&&t.bloom.enabled&&t.bloom._isSupported(e),o=l(t._tonemapping)&&t._tonemapping.enabled&&t._tonemapping._isSupported(e),a=l(t.fxaa)&&t.fxaa.enabled&&t.fxaa._isSupported(e),s=!l(t._activeStages)||t._activeStages.length>0||i||r||o||a;if((n||!s&&this._framebuffers.length>0)&&(Uee(this),this._framebuffers.length=0,this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0),!n&&!s)return;this._framebuffers.length===0&&wEt(this,e);let c=e.drawingBufferWidth,u=e.drawingBufferHeight,f=this._width!==c||this._height!==u;!n&&!f||(this._width=c,this._height=u,this._updateDependencies=!1,Uee(this),IEt(this,e))};Eg.prototype.clear=function(e){let t=this._framebuffers;for(let n=0;n<t.length;++n)t[n].clear.execute(e)};Eg.prototype.getStageByName=function(e){return this._collection.getStageByName(e)};Eg.prototype.getOutputTexture=function(e){return this._collection.getOutputTexture(e)};Eg.prototype.getFramebuffer=function(e){let t=this._stageNameToFramebuffer[e];if(l(t))return t.buffer.framebuffer};Eg.prototype.isDestroyed=function(){return!1};Eg.prototype.destroy=function(){return Uee(this),ue(this)};var IS=Eg;var bSe={REINHARD:"REINHARD",MODIFIED_REINHARD:"MODIFIED_REINHARD",FILMIC:"FILMIC",ACES:"ACES",PBR_NEUTRAL:"PBR_NEUTRAL"};Object.freeze(bSe);var cA=bSe;var Vee=[];function kl(){let e=kd.createFXAAStage(),t=kd.createAmbientOcclusionStage(),n=kd.createBloomStage();this._autoExposureEnabled=!1,this._autoExposure=kd.createAutoExposureStage(),this._exposure=1,this._tonemapping=void 0,this._tonemapper=void 0,this.tonemapper=cA.PBR_NEUTRAL;let i=this._tonemapping;e.enabled=!1,t.enabled=!1,n.enabled=!1,i.enabled=!1;let r=new IS(this),o={},a=Vee;for(a.push(e,t,n,i);a.length>0;){let c=a.pop();o[c.name]=c,c._textureCache=r;let u=c.length;if(l(u))for(let f=0;f<u;++f)a.push(c.get(f))}this._stages=[],this._activeStages=[],this._previousActiveStages=[],this._randomTexture=void 0;let s=this;t.uniforms.randomTexture=function(){return s._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=o,this._textureCache=r}Object.defineProperties(kl.prototype,{ready:{get:function(){let e=!1,t=this._stages,n=t.length;for(let s=n-1;s>=0;--s){let c=t[s];e=e||c.ready&&c.enabled}let i=this._fxaa,r=this._ao,o=this._bloom,a=this._tonemapping;return e=e||i.ready&&i.enabled,e=e||r.ready&&r.enabled,e=e||o.ready&&o.enabled,e=e||a.ready&&a.enabled,e}},fxaa:{get:function(){return this._fxaa}},ambientOcclusion:{get:function(){return this._ao}},bloom:{get:function(){return this._bloom}},length:{get:function(){return jee(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 a=n-1;a>=0;--a){let s=t[a];if(l(s)&&s.ready&&s.enabled)return this.getOutputTexture(s.name)}let i=this._tonemapping;if(i.enabled&&i.ready)return this.getOutputTexture(i.name);let r=this._bloom;if(r.enabled&&r.ready)return this.getOutputTexture(r.name);let o=this._ao;if(o.enabled&&o.ready)return this.getOutputTexture(o.name)}},hasSelected:{get:function(){let e=this._stages.slice();for(;e.length>0;){let t=e.pop();if(!l(t))continue;if(l(t.selected))return!0;let n=t.length;if(l(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;l(this._tonemapping)&&(delete this._stageNames[this._tonemapping.name],this._tonemapping.destroy());let t=this._autoExposureEnabled,n;switch(e){case cA.REINHARD:n=kd.createReinhardTonemappingStage(t);break;case cA.MODIFIED_REINHARD:n=kd.createModifiedReinhardTonemappingStage(t);break;case cA.FILMIC:n=kd.createFilmicTonemappingStage(t);break;case cA.PBR_NEUTRAL:n=kd.createPbrNeutralTonemappingStage(t);break;default:n=kd.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,l(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 jee(e){if(!e._stagesRemoved)return;e._stagesRemoved=!1;let t=[],n=e._stages;for(let i=0,r=0;i<n.length;++i){let o=n[i];o&&(o._index=r++,t.push(o))}e._stages=t}kl.prototype.add=function(e){let t=this._stageNames,n=Vee;for(n.push(e);n.length>0;){let r=n.pop();t[r.name]=r,r._textureCache=this._textureCache;let o=r.length;if(l(o))for(let a=0;a<o;++a)n.push(r.get(a))}let i=this._stages;return e._index=i.length,i.push(e),this._textureCacheDirty=!0,e};kl.prototype.remove=function(e){if(!this.contains(e))return!1;let t=this._stageNames,n=Vee;for(n.push(e);n.length>0;){let i=n.pop();delete t[i.name];let r=i.length;if(l(r))for(let o=0;o<r;++o)n.push(i.get(o))}return this._stages[e._index]=void 0,this._stagesRemoved=!0,this._textureCacheDirty=!0,e._index=void 0,e._textureCache=void 0,e.destroy(),!0};kl.prototype.contains=function(e){return l(e)&&l(e._index)&&e._textureCache===this._textureCache};kl.prototype.get=function(e){return jee(this),this._stages[e]};kl.prototype.removeAll=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)this.remove(e[n]);e.length=0};kl.prototype.getStageByName=function(e){return this._stageNames[e]};kl.prototype.update=function(e,t,n){jee(this);let i=this._activeStages,r=this._activeStages=this._previousActiveStages;this._previousActiveStages=i;let o=this._stages;r.length=o.length;let a=0;for(let b=0;b<o.length;++b){let x=o[b];x.ready&&x.enabled&&x._isSupported(e)&&(r[a++]=x)}r.length=a;let s=a!==i.length;if(!s){for(let b=0;b<a;++b)if(r[b]!==i[b]){s=!0;break}}let c=this._ao,u=this._bloom,f=this._autoExposure,d=this._tonemapping,p=this._fxaa;d.enabled=n;let g=c.enabled&&c._isSupported(e),m=u.enabled&&u._isSupported(e),y=d.enabled&&d._isSupported(e),A=p.enabled&&p._isSupported(e);if((s||this._textureCacheDirty||g!==this._aoEnabled||m!==this._bloomEnabled||y!==this._tonemappingEnabled||A!==this._fxaaEnabled)&&(this._textureCache.updateDependencies(),this._aoEnabled=g,this._bloomEnabled=m,this._tonemappingEnabled=y,this._fxaaEnabled=A,this._textureCacheDirty=!1),l(this._randomTexture)&&!g&&(this._randomTexture.destroy(),this._randomTexture=void 0),!l(this._randomTexture)&&g){let x=new Uint8Array(196608);for(let T=0;T<196608;T+=3)x[T]=Math.floor(Math.random()*255);this._randomTexture=new Et({context:e,pixelFormat:He.RGB,pixelDatatype:ke.UNSIGNED_BYTE,source:{arrayBufferView:x,width:256,height:256},sampler:new Ut({wrapS:on.REPEAT,wrapT:on.REPEAT,minificationFilter:Gt.NEAREST,magnificationFilter:ni.NEAREST})})}this._textureCache.update(e),p.update(e,t),c.update(e,t),u.update(e,t),d.update(e,t),this._autoExposureEnabled&&f.update(e,t);for(let b=0;b<o.length;++b)o[b].update(e,t);a=0;for(let b=0;b<o.length;++b){let x=o[b];x.ready&&x.enabled&&x._isSupported(e)&&a++}s=a!==r.length,s&&this.update(e,t,n)};kl.prototype.clear=function(e){this._textureCache.clear(e),this._autoExposureEnabled&&this._autoExposure.clear(e)};function Vx(e){for(;l(e.length);)e=e.get(e.length-1);return e.outputTexture}kl.prototype.getOutputTexture=function(e){let t=this.getStageByName(e);if(l(t))return Vx(t)};function kp(e,t,n,i,r){if(l(e.execute)){e.execute(t,n,i,r);return}if(e.inputPreviousStageTexture){kp(e.get(0),t,n,i,r);for(let o=1;o<e.length;++o)kp(e.get(o),t,Vx(e.get(o-1)),i,r)}else for(let o=0;o<e.length;++o)kp(e.get(o),t,n,i,r)}kl.prototype.execute=function(e,t,n,i){let r=this._activeStages,o=r.length,a=this._fxaa,s=this._ao,c=this._bloom,u=this._autoExposure,f=this._tonemapping,d=s.enabled&&s._isSupported(e),p=c.enabled&&c._isSupported(e),g=this._autoExposureEnabled,m=f.enabled&&f._isSupported(e),y=a.enabled&&a._isSupported(e);if(!y&&!d&&!p&&!m&&o===0)return;let A=t;d&&s.ready&&(kp(s,e,A,n,i),A=Vx(s)),p&&c.ready&&(kp(c,e,A,n,i),A=Vx(c)),g&&u.ready&&kp(u,e,A,n,i),m&&f.ready&&(kp(f,e,A,n,i),A=Vx(f));let b=A;if(o>0){kp(r[0],e,A,n,i);for(let x=1;x<o;++x)kp(r[x],e,Vx(r[x-1]),n,i);b=Vx(r[o-1])}y&&a.ready&&kp(a,e,b,n,i)};kl.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(_f,{uniformMap:{colorTexture:function(){return n.outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};kl.prototype.isDestroyed=function(){return!1};kl.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(),ue(this)};var y6=kl;function jx(e){this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0,this._morphToOrthographic=!1}jx.prototype.completeMorph=function(){l(this._completeMorph)&&this._completeMorph()};jx.prototype.morphTo2D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;this._previousMode=n.mode,this._morphToOrthographic=n.camera.frustum instanceof pn,!(this._previousMode===re.SCENE2D||this._previousMode===re.MORPHING)&&(this._scene.morphStart.raiseEvent(this,this._previousMode,re.SCENE2D,!0),n._mode=re.MORPHING,n.camera._setTransform(O.IDENTITY),this._previousMode===re.COLUMBUS_VIEW?sSt(this,e):mSt(this,e,t),e===0&&l(this._completeMorph)&&this._completeMorph())};var PEt=new h,DEt=new h,REt=new h,OEt=new h,MEt=new h,LEt=new h,NEt=new h,FEt=new de,BEt=new O,kEt=new Yi,zEt=new pn,UEt={position:void 0,direction:void 0,up:void 0,position2D:void 0,direction2D:void 0,up2D:void 0,frustum:void 0};jx.prototype.morphToColumbusView=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,this._previousMode===re.COLUMBUS_VIEW||this._previousMode===re.MORPHING)return;this._scene.morphStart.raiseEvent(this,this._previousMode,re.COLUMBUS_VIEW,!0),n.camera._setTransform(O.IDENTITY);let i=PEt,r=DEt,o=REt;if(e>0)i.x=0,i.y=-1,i.z=1,i=h.multiplyByScalar(h.normalize(i,i),5*t.maximumRadius,i),h.negate(h.normalize(i,r),r),h.cross(h.UNIT_X,r,o);else{let u=n.camera;if(this._previousMode===re.SCENE2D)h.clone(u.position,i),i.z=u.frustum.right-u.frustum.left,h.negate(h.UNIT_Z,r),h.clone(h.UNIT_Y,o);else{h.clone(u.positionWC,i),h.clone(u.directionWC,r),h.clone(u.upWC,o);let f=t.scaleToGeodeticSurface(i,NEt),d=mt.eastNorthUpToFixedFrame(f,t,BEt);O.inverseTransformation(d,d),n.mapProjection.project(t.cartesianToCartographic(i,FEt),i),O.multiplyByPointAsVector(d,r,r),O.multiplyByPointAsVector(d,o,o)}}let a;this._morphToOrthographic?(a=zEt,a.width=n.camera.frustum.right-n.camera.frustum.left,a.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight):(a=kEt,a.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,a.fov=I.toRadians(60));let s=UEt;s.position=i,s.direction=r,s.up=o,s.frustum=a;let c=gSt(s);Z1(this,c),this._previousMode===re.SCENE2D?pSt(this,e,s,c):(s.position2D=O.multiplyByPoint(Ir.TRANSFORM_2D,i,OEt),s.direction2D=O.multiplyByPointAsVector(Ir.TRANSFORM_2D,r,MEt),s.up2D=O.multiplyByPointAsVector(Ir.TRANSFORM_2D,o,LEt),n._mode=re.MORPHING,RSe(this,e,s,c)),e===0&&l(this._completeMorph)&&this._completeMorph()};var Wee={position:new h,direction:new h,up:new h,frustum:void 0},TSe=new Yi;jx.prototype.morphTo3D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,!(this._previousMode===re.SCENE3D||this._previousMode===re.MORPHING)){if(this._scene.morphStart.raiseEvent(this,this._previousMode,re.SCENE3D,!0),n._mode=re.MORPHING,n.camera._setTransform(O.IDENTITY),this._previousMode===re.SCENE2D)JEt(this,e,t);else{let i;e>0?(i=Wee,h.fromDegrees(0,0,5*t.maximumRadius,t,i.position),h.negate(i.position,i.direction),h.normalize(i.direction,i.direction),h.clone(h.UNIT_Z,i.up)):i=CSe(this,t);let r,o=n.camera;o.frustum instanceof pn?r=o.frustum.clone():(r=TSe,r.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,r.fov=I.toRadians(60)),i.frustum=r;let a=MSe(i);Z1(this,a),Gee(this,e,i,a)}e===0&&l(this._completeMorph)&&this._completeMorph()}};jx.prototype.isDestroyed=function(){return!1};jx.prototype.destroy=function(){return A6(this),ue(this)};function Z1(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new os(e._scene.canvas);let n=function(){e._morphCancelled=!0,e._scene.camera.cancelFlight(),t(e)};e._completeMorph=n,e._morphHandler.setInputAction(n,ln.LEFT_DOWN),e._morphHandler.setInputAction(n,ln.MIDDLE_DOWN),e._morphHandler.setInputAction(n,ln.RIGHT_DOWN),e._morphHandler.setInputAction(n,ln.WHEEL)}}function A6(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 VEt=new de,jEt=new h,HEt=new O;function CSe(e,t){let n=e._scene,i=n.camera,r=Wee,o=r.position,a=r.direction,s=r.up,c=n.mapProjection.unproject(i.position,VEt);t.cartographicToCartesian(c,o);let u=t.scaleToGeodeticSurface(o,jEt),f=mt.eastNorthUpToFixedFrame(u,t,HEt);return O.multiplyByPointAsVector(f,i.direction,a),O.multiplyByPointAsVector(f,i.up,s),r}var GEt=new h,WEt=new h,qEt=new h,YEt=new h,XEt=new h,KEt=new h;function Gee(e,t,n,i){t*=.5;let r=e._scene,o=r.camera,a=h.clone(o.position,GEt),s=h.clone(o.direction,WEt),c=h.clone(o.up,qEt),u=O.multiplyByPoint(Ir.TRANSFORM_2D_INVERSE,n.position,YEt),f=O.multiplyByPointAsVector(Ir.TRANSFORM_2D_INVERSE,n.direction,XEt),d=O.multiplyByPointAsVector(Ir.TRANSFORM_2D_INVERSE,n.up,KEt);function p(m){zd(a,u,m.time,o.position),zd(s,f,m.time,o.direction),zd(c,d,m.time,o.up),h.cross(o.direction,o.up,o.right),h.normalize(o.right,o.right)}let g=r.tweens.add({duration:t,easingFunction:ya.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){OSe(e,r,0,1,t,i)}});e._currentTweens.push(g)}var $Et=new pn,vSe=new h,ESe=new h,SSe=new h,qee=new h,wSe=new h,ISe=new h;function JEt(e,t,n){t/=3;let i=e._scene,r=i.camera,o;t>0?(o=Wee,h.fromDegrees(0,0,5*n.maximumRadius,n,o.position),h.negate(o.position,o.direction),h.normalize(o.direction,o.direction),h.clone(h.UNIT_Z,o.up)):(r.position.z=r.frustum.right-r.frustum.left,o=CSe(e,n));let a;e._morphToOrthographic?(a=$Et,a.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,a.width=r.frustum.right-r.frustum.left):(a=TSe,a.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,a.fov=I.toRadians(60)),o.frustum=a;let s=MSe(o);Z1(e,s);let c;e._morphToOrthographic?c=function(){Gee(e,t,o,s)}:c=function(){DSe(e,t,o,function(){Gee(e,t,o,s)})},t>0?(i._mode=re.SCENE2D,r.flyTo({duration:t,destination:h.fromDegrees(0,0,5*n.maximumRadius,n,qee),complete:function(){i._mode=re.MORPHING,c()}})):c()}function zd(e,t,n,i){return h.lerp(e,t,n,i)}function PSe(e,t,n,i,r){let o=e._scene,a=o.camera;if(a.frustum instanceof pn)return;let s=a.frustum.fov,c=I.RADIANS_PER_DEGREE*.5,u=n.position.z*Math.tan(s*.5);a.frustum.far=u/Math.tan(c*.5)+1e7;function f(p){a.frustum.fov=I.lerp(s,c,p.time);let g=u/Math.tan(a.frustum.fov*.5);i(a,g)}let d=o.tweens.add({duration:t,easingFunction:ya.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){a.frustum=n.frustum.clone(),r(e)}});e._currentTweens.push(d)}var ZEt=new h,QEt=new h,eSt=new h,Hee=new h,tSt=new h,nSt=new h,iSt=new Aa,rSt=new hn,oSt=new h,aSt={position:void 0,direction:void 0,up:void 0,frustum:void 0};function sSt(e,t){t*=.5;let n=e._scene,i=n.camera,r=h.clone(i.position,ZEt),o=h.clone(i.direction,QEt),a=h.clone(i.up,eSt),s=h.negate(h.UNIT_Z,tSt),c=h.clone(h.UNIT_Y,nSt),u=Hee;if(t>0)h.clone(h.ZERO,Hee),u.z=5*n.ellipsoid.maximumRadius;else{h.clone(r,Hee);let A=rSt;O.multiplyByPoint(Ir.TRANSFORM_2D,r,A.origin),O.multiplyByPointAsVector(Ir.TRANSFORM_2D,o,A.direction);let b=n.globe;if(l(b)){let x=b.pickWorldCoordinates(A,n,!0,oSt);l(x)&&(O.multiplyByPoint(Ir.TRANSFORM_2D_INVERSE,x,u),u.z+=h.distance(r,u))}}let f=iSt;f.right=u.z*.5,f.left=-f.right,f.top=f.right*(n.drawingBufferHeight/n.drawingBufferWidth),f.bottom=-f.top;let d=aSt;d.position=u,d.direction=s,d.up=c,d.frustum=f;let p=LSe(d);Z1(e,p);function g(A){zd(r,u,A.time,i.position),zd(o,s,A.time,i.direction),zd(a,c,A.time,i.up),h.cross(i.direction,i.up,i.right),h.normalize(i.right,i.right),i._adjustOrthographicFrustum(!0)}function m(A,b){A.position.z=b}let y=n.tweens.add({duration:t,easingFunction:ya.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){PSe(e,t,d,m,p)}});e._currentTweens.push(y)}var xSe=new de,cSt={position:new h,direction:new h,up:new h,position2D:new h,direction2D:new h,up2D:new h,frustum:new Aa},lSt={position:new h,direction:new h,up:new h,frustum:void 0},uSt=new h,fSt=new hn,dSt=new O,hSt=new h;function mSt(e,t,n){t*=.5;let i=e._scene,r=i.camera,o=cSt;if(t>0)h.clone(h.ZERO,o.position),o.position.z=5*n.maximumRadius,h.negate(h.UNIT_Z,o.direction),h.clone(h.UNIT_Y,o.up);else{n.cartesianToCartographic(r.positionWC,xSe),i.mapProjection.project(xSe,o.position),h.negate(h.UNIT_Z,o.direction),h.clone(h.UNIT_Y,o.up);let d=fSt;h.clone(o.position2D,d.origin);let p=h.clone(r.directionWC,d.direction),g=n.scaleToGeodeticSurface(r.positionWC,hSt),m=mt.eastNorthUpToFixedFrame(g,n,dSt);O.inverseTransformation(m,m),O.multiplyByPointAsVector(m,p,p),O.multiplyByPointAsVector(Ir.TRANSFORM_2D,p,p);let y=i.globe;if(l(y)){let A=y.pickWorldCoordinates(d,i,!0,uSt);if(l(A)){let b=h.distance(o.position2D,A);A.x+=b,h.clone(A,o.position2D)}}}function a(d,p){d.position.x=p}O.multiplyByPoint(Ir.TRANSFORM_2D,o.position,o.position2D),O.multiplyByPointAsVector(Ir.TRANSFORM_2D,o.direction,o.direction2D),O.multiplyByPointAsVector(Ir.TRANSFORM_2D,o.up,o.up2D);let s=o.frustum;s.right=o.position.z*.5,s.left=-s.right,s.top=s.right*(i.drawingBufferHeight/i.drawingBufferWidth),s.bottom=-s.top;let c=lSt;O.multiplyByPoint(Ir.TRANSFORM_2D_INVERSE,o.position2D,c.position),h.clone(o.direction,c.direction),h.clone(o.up,c.up),c.frustum=s;let u=LSe(c);Z1(e,u);function f(){PSe(e,t,o,a,u)}RSe(e,t,o,f)}function DSe(e,t,n,i){let r=e._scene,o=r.camera,a=o.frustum.right-o.frustum.left;o.frustum=n.frustum.clone();let s=o.frustum.fov,c=I.RADIANS_PER_DEGREE*.5,u=a*Math.tan(s*.5);o.frustum.far=u/Math.tan(c*.5)+1e7,o.frustum.fov=c;function f(p){o.frustum.fov=I.lerp(c,s,p.time),o.position.z=u/Math.tan(o.frustum.fov*.5)}let d=r.tweens.add({duration:t,easingFunction:ya.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){i(e)}});e._currentTweens.push(d)}function pSt(e,t,n,i){t*=.5;let r=e._scene,o=r.camera,a=h.clone(n.position,qee),s=h.clone(n.direction,wSe),c=h.clone(n.up,ISe);r._mode=re.MORPHING;function u(){o.frustum=n.frustum.clone();let f=h.clone(o.position,vSe),d=h.clone(o.direction,ESe),p=h.clone(o.up,SSe);f.z=a.z;function g(y){zd(f,a,y.time,o.position),zd(d,s,y.time,o.direction),zd(p,c,y.time,o.up),h.cross(o.direction,o.up,o.right),h.normalize(o.right,o.right)}let m=r.tweens.add({duration:t,easingFunction:ya.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){i(e)}});e._currentTweens.push(m)}e._morphToOrthographic?u():DSe(e,0,n,u)}function RSe(e,t,n,i){let r=e._scene,o=r.camera,a=h.clone(o.position,vSe),s=h.clone(o.direction,ESe),c=h.clone(o.up,SSe),u=h.clone(n.position2D,qee),f=h.clone(n.direction2D,wSe),d=h.clone(n.up2D,ISe);function p(m){zd(a,u,m.time,o.position),zd(s,f,m.time,o.direction),zd(c,d,m.time,o.up),h.cross(o.direction,o.up,o.right),h.normalize(o.right,o.right),o._adjustOrthographicFrustum(!0)}let g=r.tweens.add({duration:t,easingFunction:ya.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){OSe(e,r,1,0,t,i)}});e._currentTweens.push(g)}function OSe(e,t,n,i,r,o){let a={object:t,property:"morphTime",startValue:n,stopValue:i,duration:r,easingFunction:ya.QUARTIC_OUT};l(o)&&(a.complete=function(){o(e)});let s=t.tweens.addProperty(a);e._currentTweens.push(s)}function MSe(e){return function(t){let n=t._scene;n._mode=re.SCENE3D,n.morphTime=re.getMorphTime(re.SCENE3D),A6(t);let i=n.camera;(t._previousMode!==re.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,h.clone(e.position,i.position),h.clone(e.direction,i.direction),h.clone(e.up,i.up),h.cross(i.direction,i.up,i.right),h.normalize(i.right,i.right),i.frustum=e.frustum.clone());let r=i.frustum;n.frameState.useLogDepth&&(r.near=.1,r.far=1e10);let o=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,re.SCENE3D,o)}}function LSe(e){return function(t){let n=t._scene;n._mode=re.SCENE2D,n.morphTime=re.getMorphTime(re.SCENE2D),A6(t);let i=n.camera;h.clone(e.position,i.position),i.position.z=n.ellipsoid.maximumRadius*2,h.clone(e.direction,i.direction),h.clone(e.up,i.up),h.cross(i.direction,i.up,i.right),h.normalize(i.right,i.right),i.frustum=e.frustum.clone();let r=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,re.SCENE2D,r)}}function gSt(e){return function(t){let n=t._scene;n._mode=re.COLUMBUS_VIEW,n.morphTime=re.getMorphTime(re.COLUMBUS_VIEW),A6(t);let i=n.camera;(t._previousModeMode!==re.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,h.clone(e.position,i.position),h.clone(e.direction,i.direction),h.clone(e.up,i.up),h.cross(i.direction,i.up,i.right),h.normalize(i.right,i.right));let r=i.frustum;n.frameState.useLogDepth&&(r.near=.1,r.far=1e10);let o=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,re.COLUMBUS_VIEW,o)}}var b6=jx;var NSe={LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4};Object.freeze(NSe);var or=NSe;var USe=[Xr.SHIFT,Xr.CTRL,Xr.ALT,[Xr.SHIFT,Xr.CTRL],[Xr.SHIFT,Xr.ALT],[Xr.CTRL,Xr.ALT],[Xr.SHIFT,Xr.CTRL,Xr.ALT]];function Ns(e,t){if(!l(t))return`${e}`;let n=Array.isArray(t)?t.toSorted():[t];return`${e}+${n.join("+")}`}function _St(e,t){k.clone(e.distance.startPosition,t.distance.startPosition),k.clone(e.distance.endPosition,t.distance.endPosition),k.clone(e.angleAndHeight.startPosition,t.angleAndHeight.startPosition),k.clone(e.angleAndHeight.endPosition,t.angleAndHeight.endPosition)}function FSe(e,t,n){let i=Ns(or.PINCH,t),r=e._update,o=e._isDown,a=e._eventStartPosition,s=e._pressTime,c=e._releaseTime;r[i]=!0,o[i]=!1,a[i]=new k;let u=e._movement[i];l(u)||(u=e._movement[i]={}),u.distance={startPosition:new k,endPosition:new k},u.angleAndHeight={startPosition:new k,endPosition:new k},u.prevAngle=0,e._eventHandler.setInputAction(function(f){e._buttonsDown++,o[i]=!0,s[i]=new Date,k.lerp(f.position1,f.position2,.5,a[i])},ln.PINCH_START,t),e._eventHandler.setInputAction(function(){e._buttonsDown=Math.max(e._buttonsDown-1,0),o[i]=!1,c[i]=new Date},ln.PINCH_END,t),e._eventHandler.setInputAction(function(f){if(o[i]){r[i]?(_St(f,u),r[i]=!1,u.prevAngle=u.angleAndHeight.startPosition.x):(k.clone(f.distance.endPosition,u.distance.endPosition),k.clone(f.angleAndHeight.endPosition,u.angleAndHeight.endPosition));let d=u.angleAndHeight.endPosition.x,p=u.prevAngle,g=Math.PI*2;for(;d>=p+Math.PI;)d-=g;for(;d<p-Math.PI;)d+=g;u.angleAndHeight.endPosition.x=-d*n.clientWidth/12,u.angleAndHeight.startPosition.x=-p*n.clientWidth/12}},ln.PINCH_MOVE,t)}function BSe(e,t){let n=Ns(or.WHEEL,t),i=e._pressTime,r=e._releaseTime,o=e._update;o[n]=!0;let a=e._movement[n];l(a)||(a=e._movement[n]={});let s=e._lastMovement[n];l(s)||(s=e._lastMovement[n]={startPosition:new k,endPosition:new k,valid:!1}),a.startPosition=new k,k.clone(k.ZERO,a.startPosition),a.endPosition=new k,e._eventHandler.setInputAction(function(c){let u=7.5*I.toRadians(c);i[n]=r[n]=new Date,a.endPosition.x=0,a.endPosition.y=u,k.clone(a.endPosition,s.endPosition),s.valid=!0,o[n]=!1},ln.WHEEL,t)}function PS(e,t,n){let i=Ns(n,t),r=e._isDown,o=e._eventStartPosition,a=e._pressTime;r[i]=!1,o[i]=new k;let s=e._lastMovement[i];l(s)||(s=e._lastMovement[i]={startPosition:new k,endPosition:new k,valid:!1});let c,u;n===or.LEFT_DRAG?(c=ln.LEFT_DOWN,u=ln.LEFT_UP):n===or.RIGHT_DRAG?(c=ln.RIGHT_DOWN,u=ln.RIGHT_UP):n===or.MIDDLE_DRAG&&(c=ln.MIDDLE_DOWN,u=ln.MIDDLE_UP),e._eventHandler.setInputAction(function(f){e._buttonsDown++,s.valid=!1,r[i]=!0,a[i]=new Date,k.clone(f.position,o[i])},c,t),e._eventHandler.setInputAction(function(){Yee(Ns(n,void 0),e);for(let f of USe){let d=Ns(n,f);Yee(d,e)}},u,t)}function Yee(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 kSe(e,t){k.clone(e.startPosition,t.startPosition),k.clone(e.endPosition,t.endPosition)}function ySt(e,t,n){let i=n._isDown,r=!1,o=Ns(e,t);for(let[c,u]of Object.entries(i))c.startsWith(e)&&u&&c!==o&&(r=!0,Yee(c,n));if(!r)return;let a=n._pressTime,s=n._lastMovement[o];l(s)||(s=n._lastMovement[o]={startPosition:new k,endPosition:new k,valid:!1}),n._buttonsDown++,s.valid=!1,i[o]=!0,a[o]=new Date}function zSe(e,t){let n=e._update,i=e._movement,r=e._lastMovement,o=e._isDown;for(let a in or)if(or.hasOwnProperty(a)){let s=or[a];if(l(s)){let c=Ns(s,t);n[c]=!0,l(e._lastMovement[c])||(e._lastMovement[c]={startPosition:new k,endPosition:new k,valid:!1}),l(e._movement[c])||(e._movement[c]={startPosition:new k,endPosition:new k})}}e._eventHandler.setInputAction(function(a){for(let s in or)if(or.hasOwnProperty(s)){let c=or[s];if(l(c)){let u=Ns(c,t);ySt(c,t,e),o[u]&&(n[u]?(kSe(i[u],r[u]),r[u].valid=!0,kSe(a,i[u]),n[u]=!1):k.clone(a.endPosition,i[u].endPosition))}}k.clone(a.endPosition,e._currentMousePosition)},ln.MOUSE_MOVE,t)}function Ud(e){this._eventHandler=new os(e),this._update={},this._movement={},this._lastMovement={},this._isDown={},this._eventStartPosition={},this._pressTime={},this._releaseTime={},this._buttonsDown=0,this._currentMousePosition=new k,BSe(this,void 0),FSe(this,void 0,e),PS(this,void 0,or.LEFT_DRAG),PS(this,void 0,or.RIGHT_DRAG),PS(this,void 0,or.MIDDLE_DRAG),zSe(this,void 0);for(let t of USe)BSe(this,t),FSe(this,t,e),PS(this,t,or.LEFT_DRAG),PS(this,t,or.RIGHT_DRAG),PS(this,t,or.MIDDLE_DRAG),zSe(this,t)}Object.defineProperties(Ud.prototype,{currentMousePosition:{get:function(){return this._currentMousePosition}},anyButtonDown:{get:function(){let e=!this._update[Ns(or.WHEEL)]||!this._update[Ns(or.WHEEL,Xr.SHIFT)]||!this._update[Ns(or.WHEEL,Xr.CTRL)]||!this._update[Ns(or.WHEEL,Xr.ALT)];return this._buttonsDown>0||e}}});Ud.prototype.isMoving=function(e,t){let n=Ns(e,t);return!this._update[n]};Ud.prototype.getMovement=function(e,t){let n=Ns(e,t);return this._movement[n]};Ud.prototype.getLastMovement=function(e,t){let n=Ns(e,t),i=this._lastMovement[n];if(i.valid)return i};Ud.prototype.isButtonDown=function(e,t){let n=Ns(e,t);return this._isDown[n]};Ud.prototype.getStartMousePosition=function(e,t){if(e===or.WHEEL)return this._currentMousePosition;let n=Ns(e,t);return this._eventStartPosition[n]};Ud.prototype.getButtonPressTime=function(e,t){let n=Ns(e,t);return this._pressTime[n]};Ud.prototype.getButtonReleaseTime=function(e,t){let n=Ns(e,t);return this._releaseTime[n]};Ud.prototype.reset=function(){for(let e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)};Ud.prototype.isDestroyed=function(){return!1};Ud.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),ue(this)};var x6=Ud;function T6(e,t,n,i,r,o,a,s,c,u){this._tweens=e,this._tweenjs=t,this._startObject=Xe(n),this._stopObject=Xe(i),this._duration=r,this._delay=o,this._easingFunction=a,this._update=s,this._complete=c,this.cancel=u,this.needsStart=!0}Object.defineProperties(T6.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}}});T6.prototype.cancelTween=function(){this._tweens.remove(this)};function em(){this._tweens=[]}Object.defineProperties(em.prototype,{length:{get:function(){return this._tweens.length}}});em.prototype.add=function(e){if(e=e??H.EMPTY_OBJECT,e.duration===0)return l(e.complete)&&e.complete(),new T6(this);let t=e.duration/Un.SECONDS_PER_MILLISECOND,n=e.delay??0,i=n/Un.SECONDS_PER_MILLISECOND,r=e.easingFunction??ya.LINEAR_NONE,o=e.startObject,a=new Rfe(o);a.to(Xe(e.stopObject),t),a.delay(i),a.easing(r),l(e.update)&&a.onUpdate(function(){e.update(o)}),a.onComplete(e.complete??null),a.repeat(e._repeat??0);let s=new T6(this,a,e.startObject,e.stopObject,e.duration,n,r,e.update,e.complete,e.cancel);return this._tweens.push(s),s};em.prototype.addProperty=function(e){e=e??H.EMPTY_OBJECT;let t=e.object,n=e.property,i=e.startValue,r=e.stopValue;function o(a){t[n]=a.value}return this.add({startObject:{value:i},stopObject:{value:r},duration:e.duration??3,delay:e.delay,easingFunction:e.easingFunction,update:o,complete:e.complete,cancel:e.cancel,_repeat:e._repeat})};em.prototype.addAlpha=function(e){e=e??H.EMPTY_OBJECT;let t=e.material,n=[];for(let r in t.uniforms)t.uniforms.hasOwnProperty(r)&&l(t.uniforms[r])&&l(t.uniforms[r].alpha)&&n.push(r);function i(r){let o=n.length;for(let a=0;a<o;++a)t.uniforms[n[a]].alpha=r.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})};em.prototype.addOffsetIncrement=function(e){e=e??H.EMPTY_OBJECT;let n=e.material.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})};em.prototype.remove=function(e){if(!l(e))return!1;let t=this._tweens.indexOf(e);return t!==-1?(e.tweenjs.stop(),l(e.cancel)&&e.cancel(),this._tweens.splice(t,1),!0):!1};em.prototype.removeAll=function(){let e=this._tweens;for(let t=0;t<e.length;++t){let n=e[t];n.tweenjs.stop(),l(n.cancel)&&n.cancel()}e.length=0};em.prototype.contains=function(e){return l(e)&&this._tweens.indexOf(e)!==-1};em.prototype.get=function(e){return this._tweens[e]};em.prototype.update=function(e){let t=this._tweens,n=0;for(e=l(e)?e/Un.SECONDS_PER_MILLISECOND:An();n<t.length;){let i=t[n],r=i.tweenjs;if(i.needsStart)i.needsStart=!1,r.start(e);else if(r.update(e))n++;else{if(t[n]?.needsStart)continue;r.stop(),t.splice(n,1)}}};var DS=em;function eR(e){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=or.LEFT_DRAG,this.zoomEventTypes=[or.RIGHT_DRAG,or.WHEEL,or.PINCH],this.rotateEventTypes=or.LEFT_DRAG,this.tiltEventTypes=[or.MIDDLE_DRAG,or.PINCH,{eventType:or.LEFT_DRAG,modifier:Xr.CTRL},{eventType:or.RIGHT_DRAG,modifier:Xr.CTRL}],this.lookEventTypes={eventType:or.LEFT_DRAG,modifier:Xr.SHIFT};let t=e.ellipsoid??te.default;this.minimumPickingTerrainHeight=te.WGS84.equals(t)?15e4:t.minimumRadius*.025,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight,this.minimumPickingTerrainDistanceWithInertia=te.WGS84.equals(t)?4e3:t.minimumRadius*63e-5,this.minimumCollisionTerrainHeight=te.WGS84.equals(t)?15e3:t.minimumRadius*.0025,this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight,this.minimumTrackBallHeight=te.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 x6(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 DS,this._tween=void 0,this._horizontalRotationAxis=void 0,this._tiltCenterMousePosition=new k(-1,-1),this._tiltCenter=new h,this._rotateMousePosition=new k(-1,-1),this._rotateStartPosition=new h,this._strafeStartPosition=new h,this._strafeMousePosition=new k,this._strafeEndMousePosition=new k,this._zoomMouseStart=new k(-1,-1),this._zoomWorldPosition=new h,this._useZoomWorldPosition=!1,this._panLastMousePosition=new k,this._panLastWorldPosition=new h,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 de(Math.PI,I.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 ASt(e,t){if(e<0)return 0;let n=(1-t)*25;return Math.exp(-n*e)}function bSt(e){return k.equalsEpsilon(e.startPosition,e.endPosition,I.EPSILON14)}var xSt=.4;function TSt(e,t,n,i,r,o,a){let s=o[a];l(s)||(s=o[a]={startPosition:new k,endPosition:new k,motion:new k,inertiaEnabled:!0});let c=e.getButtonPressTime(t,n),u=e.getButtonReleaseTime(t,n),f=c&&u&&(u.getTime()-c.getTime())/1e3,p=u&&(new Date().getTime()-u.getTime())/1e3;if(c&&u&&f<xSt){let g=ASt(p,i),m=e.getLastMovement(t,n);if(!l(m)||bSt(m)||!s.inertiaEnabled||(s.motion.x=(m.endPosition.x-m.startPosition.x)*.5,s.motion.y=(m.endPosition.y-m.startPosition.y)*.5,s.startPosition=k.clone(m.startPosition,s.startPosition),s.endPosition=k.multiplyByScalar(s.motion,g,s.endPosition),s.endPosition=k.add(s.startPosition,s.endPosition,s.endPosition),isNaN(s.endPosition.x)||isNaN(s.endPosition.y)||k.distance(s.startPosition,s.endPosition)<.5))return;if(!e.isButtonDown(t,n)){let y=e.getStartMousePosition(t,n);r(o,y,s)}}}function CSt(e,t){if(l(t)){let n=e[t];l(n)&&(n.inertiaEnabled=!0);let i=e._inertiaDisablers[t];if(l(i)){let r=i.length;for(let o=0;o<r;++o)n=e[i[o]],l(n)&&(n.inertiaEnabled=!1)}}}var VSe=[];function zl(e,t,n,i,r,o){if(!l(n))return;let a=e._aggregator;Array.isArray(n)||(VSe[0]=n,n=VSe);let s=n.length;for(let c=0;c<s;++c){let u=n[c],f=l(u.eventType)?u.eventType:u,d=u.modifier,p=a.isMoving(f,d)&&a.getMovement(f,d),g=a.getStartMousePosition(f,d);e.enableInputs&&t&&(p?(i(e,g,p),CSt(e,o)):r<1&&TSt(a,f,d,r,i,e,o))}}var C6=new hn,vSt=new h,ESt=new k,SSt=new h,wSt=new k,ISt=new h,PSt=new h,DSt=new h,RSt=new h,QSe=new h,OSt=new h,MSt=new h,LSt=new h,NSt=new h,FSt=new h,BSt=new h,kSt=new h,zSt=new h,USt=new h,VSt=new h,Hx=new h,jSe=new h,HSe=new h,Xee={orientation:new Oc};function nte(e,t,n,i,r,o){let a=1;l(o)&&(a=I.clamp(Math.abs(o),.25,1));let s=n.endPosition.y-n.startPosition.y,u=s>0?e.minimumZoomDistance*a:0,f=e.maximumZoomDistance,d=r-u,p=i*d;p=I.clamp(p,e._minimumZoomRate,e._maximumZoomRate);let g=s/e._scene.canvas.clientHeight;g=Math.min(g,e.maximumMovementRatio);let m=p*g;if(e.enableCollisionDetection||e.minimumZoomDistance===0||!l(e._globe)){if(m>0&&Math.abs(r-u)<1||m<0&&Math.abs(r-f)<1)return;r-m<u?m=r-u-1:r-m>f&&(m=r-f)}let y=e._scene,A=y.camera,b=y.mode,x=Xee.orientation;x.heading=A.heading,x.pitch=A.pitch,x.roll=A.roll;let T=n.inertiaEnabled??k.equals(t,e._zoomMouseStart),C=e._zoomingOnVector,E=e._rotatingZoom,w;if(T||(e._zoomMouseStart=k.clone(t,e._zoomMouseStart),l(e._globe)&&b===re.SCENE2D?(w=A.getPickRay(t,C6).origin,w=h.fromElements(w.y,w.z,w.x)):l(e._globe)&&(w=Sg(e,t,vSt)),l(w)?(e._useZoomWorldPosition=!0,e._zoomWorldPosition=h.clone(w,e._zoomWorldPosition)):e._useZoomWorldPosition=!1,C=e._zoomingOnVector=!1,E=e._rotatingZoom=!1,e._zoomingUnderground=e._cameraUnderground),!e._useZoomWorldPosition){A.zoomIn(m);return}let D=b===re.COLUMBUS_VIEW;if(A.positionCartographic.height<2e6&&(E=!0),!T||E){if(b===re.SCENE2D){let R=e._zoomWorldPosition,M=A.position;if(!h.equals(R,M)&&A.positionCartographic.height<e._maxCoord.x*2){let N=A.position.x,_=h.subtract(R,M,SSt);h.normalize(_,_);let v=h.distance(R,M)*m/(A.getMagnitude()*.5);A.move(_,v*.5),(A.position.x<0&&N>0||A.position.x>0&&N<0)&&(w=A.getPickRay(t,C6).origin,w=h.fromElements(w.y,w.z,w.x),e._zoomWorldPosition=h.clone(w,e._zoomWorldPosition))}}else if(b===re.SCENE3D){let R=h.normalize(A.position,QSe);if(e._cameraUnderground||e._zoomingUnderground||A.positionCartographic.height<3e3&&Math.abs(h.dot(A.direction,R))<.6)D=!0;else{let M=y.canvas,N=wSt;N.x=M.clientWidth/2,N.y=M.clientHeight/2;let _=Sg(e,N,ISt);if(!l(_))D=!0;else if(A.positionCartographic.height<1e6)if(h.dot(A.direction,R)>=-.5)D=!0;else{let v=MSt;h.clone(A.position,v);let S=e._zoomWorldPosition,P=OSt;if(P=h.normalize(S,P),h.dot(P,R)<0)return;let L=VSt,F=FSt;h.clone(A.direction,F),h.add(v,h.multiplyByScalar(F,1e3,Hx),L);let V=BSt,z=kSt;h.subtract(S,v,V),h.normalize(V,z);let j=h.dot(R,z);if(j>=0){e._zoomMouseStart.x=-1;return}let B=Math.acos(-j),G=h.magnitude(v),W=h.magnitude(S),Q=G-m,q=h.magnitude(V),J=Math.asin(I.clamp(q/W*Math.sin(B),-1,1)),Z=Math.asin(I.clamp(Q/W*Math.sin(B),-1,1)),ce=J-Z+B,Ae=LSt;h.normalize(v,Ae);let le=NSt;le=h.cross(z,Ae,le),le=h.normalize(le,le),h.normalize(h.cross(Ae,le,Hx),F),h.multiplyByScalar(h.normalize(L,Hx),h.magnitude(L)-m,L),h.normalize(v,v),h.multiplyByScalar(v,Q,v);let Ce=zSt;h.multiplyByScalar(h.add(h.multiplyByScalar(Ae,Math.cos(ce)-1,jSe),h.multiplyByScalar(F,Math.sin(ce),HSe),Hx),Q,Ce),h.add(v,Ce,v),h.normalize(L,Ae),h.normalize(h.cross(Ae,le,Hx),F);let ye=USt;h.multiplyByScalar(h.add(h.multiplyByScalar(Ae,Math.cos(ce)-1,jSe),h.multiplyByScalar(F,Math.sin(ce),HSe),Hx),h.magnitude(L),ye),h.add(L,ye,L),h.clone(v,A.position),h.normalize(h.subtract(L,v,Hx),A.direction),h.clone(A.direction,A.direction),h.cross(A.direction,A.up,A.right),h.cross(A.right,A.direction,A.up),A.setView(Xee);return}else{let v=h.normalize(_,PSt),S=h.normalize(e._zoomWorldPosition,DSt),P=h.dot(S,v);if(P>0&&P<1){let L=I.acosClamped(P),F=h.cross(S,v,RSt),V=Math.abs(L)>I.toRadians(20)?A.positionCartographic.height*.75:A.positionCartographic.height-m,z=m/V;A.rotate(F,L*z)}}}}e._rotatingZoom=!D}if(!T&&D||C){let R,M=cr.worldToWindowCoordinates(y,e._zoomWorldPosition,ESt);b!==re.COLUMBUS_VIEW&&k.equals(t,e._zoomMouseStart)&&l(M)?R=A.getPickRay(M,C6):R=A.getPickRay(t,C6);let N=R.direction;(b===re.COLUMBUS_VIEW||b===re.SCENE2D)&&h.fromElements(N.y,N.z,N.x,N),A.move(N,m),e._zoomingOnVector=!0}else A.zoomIn(m);e._cameraUnderground||A.setView(Xee)}var jSt=new hn,HSt=new hn,GSt=new h;function WSt(e,t,n){let r=e._scene.camera,o=r.getPickRay(n.startPosition,jSt).origin,a=r.getPickRay(n.endPosition,HSt).origin;o=h.fromElements(o.y,o.z,o.x,o),a=h.fromElements(a.y,a.z,a.x,a);let s=h.subtract(o,a,GSt),c=h.magnitude(s);c>0&&(h.normalize(s,s),r.move(s,c))}function GSe(e,t,n){l(n.distance)&&(n=n.distance);let r=e._scene.camera;nte(e,t,n,e.zoomFactor,r.getMagnitude())}var qSt=new k,YSt=new k;function WSe(e,t,n){if(l(n.angleAndHeight)){XSt(e,t,n.angleAndHeight);return}let i=e._scene,r=i.camera,o=i.canvas,a=o.clientWidth,s=o.clientHeight,c=qSt;c.x=2/a*n.startPosition.x-1,c.y=2/s*(s-n.startPosition.y)-1,c=k.normalize(c,c);let u=YSt;u.x=2/a*n.endPosition.x-1,u.y=2/s*(s-n.endPosition.y)-1,u=k.normalize(u,u);let f=I.acosClamped(c.x);c.y<0&&(f=I.TWO_PI-f);let d=I.acosClamped(u.x);u.y<0&&(d=I.TWO_PI-d);let p=d-f;r.twistRight(p)}function XSt(e,t,n){let i=e._rotateFactor*e._rotateRateRangeAdjustment;i>e._maximumRotateRate&&(i=e._maximumRotateRate),i<e._minimumRotateRate&&(i=e._minimumRotateRate);let r=e._scene,o=r.camera,a=r.canvas,s=(n.endPosition.x-n.startPosition.x)/a.clientWidth;s=Math.min(s,e.maximumMovementRatio);let c=i*s*Math.PI*4;o.twistRight(c)}function KSt(e){let t=e._scene.mapMode2D===Du.ROTATE;O.equals(O.IDENTITY,e._scene.camera.transform)?(zl(e,e.enableTranslate,e.translateEventTypes,WSt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),zl(e,e.enableZoom,e.zoomEventTypes,GSe,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&zl(e,e.enableRotate,e.tiltEventTypes,WSe,e.inertiaSpin,"_lastInertiaTiltMovement")):(zl(e,e.enableZoom,e.zoomEventTypes,GSe,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&zl(e,e.enableRotate,e.translateEventTypes,WSe,e.inertiaSpin,"_lastInertiaSpinMovement"))}var ewe=new hn,$St=new h,JSt=new h;function Sg(e,t,n){let i=e._scene,r=e._globe,o=i.camera,a;if(i.pickPositionSupported&&(a=i.pickPositionWorldCoordinates(t,$St)),!l(r))return h.clone(a,n);let s=!e._cameraUnderground,c=o.getPickRay(t,ewe),u=r.pickWorldCoordinates(c,i,s,JSt),f=l(a)?h.distance(a,o.positionWC):Number.POSITIVE_INFINITY,d=l(u)?h.distance(u,o.positionWC):Number.POSITIVE_INFINITY;return f<d?h.clone(a,n):h.clone(u,n)}var ZSt=new de;function D6(e){let t=e._ellipsoid,n=e._scene,i=n.camera,r=n.mode,o=0;if(r===re.SCENE3D){let c=t.cartesianToCartographic(i.position,ZSt);l(c)&&(o=c.height)}else o=i.position.z;let a=e._scene.globeHeight??0;return Math.abs(a-o)}var QSt=new h;function twe(e,t){let n=t.origin,i=t.direction,r=D6(e),o=h.normalize(n,QSt),a=Math.abs(h.dot(o,i));return a=Math.max(a,.5)*2,r*a}function nwe(e,t,n,i){let r=h.distance(t.origin,n),o=D6(e),a=I.clamp(o*5,e._minimumUndergroundPickDistance,e._maximumUndergroundPickDistance);return r>a&&(r=Math.min(r,o/5),r=Math.max(r,100)),hn.getPoint(t,r,i)}function iwe(e,t,n,i){let r;return l(n)?(r=h.distance(t.origin,n),r>e._maximumUndergroundPickDistance&&(r=D6(e))):r=D6(e),hn.getPoint(t,r,i)}var ewt=new k;function rwe(e,t){let n=t.endPosition,i=k.subtract(t.endPosition,t.startPosition,ewt),r=e._strafeEndMousePosition;k.add(r,i,r),t.endPosition=r,ite(e,t,e._strafeStartPosition),t.endPosition=n}var qSe=new hn,twt=new hn,Kee=new h,nwt=new h,iwt=new h,rwt=new h,owt=new tn(h.UNIT_X,0),awt=new k,swt=new k;function cwt(e,t,n){if(h.equals(t,e._translateMousePosition)||(e._looking=!1),h.equals(t,e._strafeMousePosition)||(e._strafing=!1),e._looking){bf(e,t,n);return}if(e._strafing){rwe(e,n);return}let r=e._scene.camera,o=e._cameraUnderground,a=k.clone(n.startPosition,awt),s=k.clone(n.endPosition,swt),c=r.getPickRay(a,qSe),u=h.clone(h.ZERO,rwt),f=h.UNIT_X,d;if(r.position.z<e._minimumPickingTerrainHeight&&(d=Sg(e,a,Kee),l(d)&&(u.x=d.x)),o||u.x>r.position.z&&l(d)){let T=d;o&&(T=iwe(e,c,d,Kee)),k.clone(t,e._strafeMousePosition),k.clone(t,e._strafeEndMousePosition),h.clone(T,e._strafeStartPosition),e._strafing=!0,ite(e,n,e._strafeStartPosition);return}let p=tn.fromPointNormal(u,f,owt);c=r.getPickRay(a,qSe);let g=ci.rayPlane(c,p,Kee),m=r.getPickRay(s,twt),y=ci.rayPlane(m,p,nwt);if(!l(g)||!l(y)){e._looking=!0,bf(e,t,n),k.clone(t,e._translateMousePosition);return}let A=h.subtract(g,y,iwt),b=A.x;A.x=A.y,A.y=A.z,A.z=b;let x=h.magnitude(A);x>I.EPSILON6&&(h.normalize(A,A),r.move(A,x))}var owe=new k,S6=new hn,w6=new h,lwt=new h,awe=new O,uwt=new O,fwt=new h,dwt=new tn(h.UNIT_X,0),$ee=new h,Qee=new de,swe=new O,hwt=new Fe,mwt=new $,I6=new h;function pwt(e,t,n){if(l(n.angleAndHeight)&&(n=n.angleAndHeight),k.equals(t,e._tiltCenterMousePosition)||(e._tiltCVOffMap=!1,e._looking=!1),e._looking){bf(e,t,n);return}let r=e._scene.camera;e._tiltCVOffMap||!e.onMap()||Math.abs(r.position.z)>e._minimumPickingTerrainHeight?(e._tiltCVOffMap=!0,gwt(e,t,n)):_wt(e,t,n)}function gwt(e,t,n){let i=e._scene,r=i.camera,o=i.canvas,a=owe;a.x=o.clientWidth/2,a.y=o.clientHeight/2;let s=r.getPickRay(a,S6),c=h.UNIT_X,u=s.origin,f=s.direction,d,p=h.dot(c,f);if(Math.abs(p)>I.EPSILON6&&(d=-h.dot(c,u)/p),!l(d)||d<=0){e._looking=!0,bf(e,t,n),k.clone(t,e._tiltCenterMousePosition);return}let g=h.multiplyByScalar(f,d,w6);h.add(u,g,g);let m=i.mapProjection,y=m.ellipsoid;h.fromElements(g.y,g.z,g.x,g);let A=m.unproject(g,Qee);y.cartographicToCartesian(A,g);let b=mt.eastNorthUpToFixedFrame(g,y,awe),x=e._globe,T=e._ellipsoid;e._globe=void 0,e._ellipsoid=te.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let C=O.clone(r.transform,swe);r._setTransform(b),Af(e,t,n,h.UNIT_Z),r._setTransform(C),e._globe=x,e._ellipsoid=T;let E=T.maximumRadius;e._rotateFactor=1/E,e._rotateRateRangeAdjustment=E}function _wt(e,t,n){let i=e._scene,r=i.camera,o=e._cameraUnderground,a,s,c=h.UNIT_X;if(k.equals(t,e._tiltCenterMousePosition))a=h.clone(e._tiltCenter,w6);else{if(r.position.z<e._minimumPickingTerrainHeight&&(a=Sg(e,t,w6)),!l(a)){s=r.getPickRay(t,S6);let _=s.origin,v=s.direction,S,P=h.dot(c,v);if(Math.abs(P)>I.EPSILON6&&(S=-h.dot(c,_)/P),!l(S)||S<=0){e._looking=!0,bf(e,t,n),k.clone(t,e._tiltCenterMousePosition);return}a=h.multiplyByScalar(v,S,w6),h.add(_,a,a)}o&&(l(s)||(s=r.getPickRay(t,S6)),nwe(e,s,a,a)),k.clone(t,e._tiltCenterMousePosition),h.clone(a,e._tiltCenter)}let u=i.canvas,f=owe;f.x=u.clientWidth/2,f.y=e._tiltCenterMousePosition.y,s=r.getPickRay(f,S6);let d=h.clone(h.ZERO,fwt);d.x=a.x;let p=tn.fromPointNormal(d,c,dwt),g=ci.rayPlane(s,p,lwt),m=r._projection,y=m.ellipsoid;h.fromElements(a.y,a.z,a.x,a);let A=m.unproject(a,Qee);y.cartographicToCartesian(A,a);let b=mt.eastNorthUpToFixedFrame(a,y,awe),x;l(g)?(h.fromElements(g.y,g.z,g.x,g),A=m.unproject(g,Qee),y.cartographicToCartesian(A,g),x=mt.eastNorthUpToFixedFrame(g,y,uwt)):x=b;let T=e._globe,C=e._ellipsoid;e._globe=void 0,e._ellipsoid=te.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let E=h.UNIT_Z,w=O.clone(r.transform,swe);r._setTransform(b);let D=h.cross(h.UNIT_Z,h.normalize(r.position,$ee),$ee),R=h.dot(r.right,D);if(Af(e,t,n,E,!1,!0),r._setTransform(x),R<0){let _=n.startPosition.y-n.endPosition.y;(o&&_<0||!o&&_>0)&&(E=void 0);let v=r.constrainedAxis;r.constrainedAxis=void 0,Af(e,t,n,E,!0,!1),r.constrainedAxis=v}else Af(e,t,n,E,!0,!1);if(l(r.constrainedAxis)){let _=h.cross(r.direction,r.constrainedAxis,I6);h.equalsEpsilon(_,h.ZERO,I.EPSILON6)||(h.dot(_,r.right)<0&&h.negate(_,_),h.cross(_,r.direction,r.up),h.cross(r.direction,r.up,r.right),h.normalize(r.up,r.up),h.normalize(r.right,r.right))}r._setTransform(w),e._globe=T,e._ellipsoid=C;let M=C.maximumRadius;e._rotateFactor=1/M,e._rotateRateRangeAdjustment=M;let N=h.clone(r.positionWC,$ee);if(e.enableCollisionDetection&&ate(e,!0),!h.equals(r.positionWC,N)){r._setTransform(x),r.worldToCameraCoordinatesPoint(N,N);let _=h.magnitudeSquared(N);h.magnitudeSquared(r.position)>_&&(h.normalize(r.position,r.position),h.multiplyByScalar(r.position,Math.sqrt(_),r.position));let v=h.angleBetween(N,r.position),S=h.cross(N,r.position,N);h.normalize(S,S);let P=Fe.fromAxisAngle(S,v,hwt),L=$.fromQuaternion(P,mwt);$.multiplyByVector(L,r.direction,r.direction),$.multiplyByVector(L,r.up,r.up),h.cross(r.direction,r.up,r.right),h.cross(r.right,r.direction,r.up),r._setTransform(w)}}var cwe=new k,lwe=new hn,uwe=new h;function ywt(e,t,n){l(n.distance)&&(n=n.distance);let i=e._scene,r=i.camera,o=i.canvas,a=e._cameraUnderground,s;a?s=t:(s=cwe,s.x=o.clientWidth/2,s.y=o.clientHeight/2);let c=r.getPickRay(s,lwe),u=c.origin,f=c.direction,d=r.position.z,p;d<e._minimumPickingTerrainHeight&&(p=Sg(e,s,uwe));let g;if(l(p)&&(g=h.distance(u,p)),a){let m=twe(e,c,d);l(g)?g=Math.min(g,m):g=m}if(!l(g)){let m=h.UNIT_X;g=-h.dot(m,u)/h.dot(m,f)}nte(e,t,n,e.zoomFactor,g)}function Awt(e){let n=e._scene.camera;if(!O.equals(O.IDENTITY,n.transform))zl(e,e.enableRotate,e.rotateEventTypes,Af,e.inertiaSpin,"_lastInertiaSpinMovement"),zl(e,e.enableZoom,e.zoomEventTypes,dwe,e.inertiaZoom,"_lastInertiaZoomMovement");else{let i=e._tweens;if(e._aggregator.anyButtonDown&&i.removeAll(),zl(e,e.enableTilt,e.tiltEventTypes,pwt,e.inertiaSpin,"_lastInertiaTiltMovement"),zl(e,e.enableTranslate,e.translateEventTypes,cwt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),zl(e,e.enableZoom,e.zoomEventTypes,ywt,e.inertiaZoom,"_lastInertiaZoomMovement"),zl(e,e.enableLook,e.lookEventTypes,bf),!e._aggregator.anyButtonDown&&!i.contains(e._tween)){let r=n.createCorrectPositionTween(e.bounceAnimationTime);l(r)&&(e._tween=i.add(r))}i.update()}}var bwt=new hn,xwt=new tn(h.UNIT_X,0),Twt=new h,Cwt=new h;function ite(e,t,n){let i=e._scene,r=i.camera,o=r.getPickRay(t.endPosition,bwt),a=h.clone(r.direction,Cwt);i.mode===re.COLUMBUS_VIEW&&h.fromElements(a.z,a.x,a.y,a);let s=tn.fromPointNormal(n,a,xwt),c=ci.rayPlane(o,s,Twt);l(c)&&(a=h.subtract(n,c,a),i.mode===re.COLUMBUS_VIEW&&h.fromElements(a.y,a.z,a.x,a),h.add(r.position,a,r.position))}var YSe=new h,fwe=new de,ete=new h,tte=new te,vwt=new h,Ewt=new h,Swt=new h;function wwt(e,t,n){let r=e._scene.camera,o=e._cameraUnderground,a=e._ellipsoid;if(!O.equals(r.transform,O.IDENTITY)){Af(e,t,n);return}let s,c,u=a.geodeticSurfaceNormal(r.position,vwt);if(k.equals(t,e._rotateMousePosition)){if(e._looking)bf(e,t,n,u);else if(e._rotating)Af(e,t,n);else if(e._strafing)rwe(e,n);else{if(h.magnitude(r.position)<h.magnitude(e._rotateStartPosition))return;s=h.magnitude(e._rotateStartPosition),c=ete,c.x=c.y=c.z=s,a=te.fromCartesian3(c,tte),Zee(e,t,n,a)}return}e._looking=!1,e._rotating=!1,e._strafing=!1;let f=a.cartesianToCartographic(r.positionWC,fwe).height,d=e._globe;if(l(d)&&f<e._minimumPickingTerrainHeight){let p=Sg(e,n.startPosition,Swt);if(l(p)){let g,m=r.getPickRay(n.startPosition,ewe);if(o)g=!0,iwe(e,m,p,p);else{let y=a.geodeticSurfaceNormal(p,Ewt);Math.abs(h.dot(m.direction,y))<.05?g=!0:g=h.magnitude(r.position)<h.magnitude(p)}g?(k.clone(t,e._strafeEndMousePosition),h.clone(p,e._strafeStartPosition),e._strafing=!0,ite(e,n,e._strafeStartPosition)):(s=h.magnitude(p),c=ete,c.x=c.y=c.z=s,a=te.fromCartesian3(c,tte),Zee(e,t,n,a),h.clone(p,e._rotateStartPosition))}else e._looking=!0,bf(e,t,n,u)}else l(r.pickEllipsoid(n.startPosition,e._ellipsoid,YSe))?(Zee(e,t,n,e._ellipsoid),h.clone(YSe,e._rotateStartPosition)):f>e._minimumTrackBallHeight?(e._rotating=!0,Af(e,t,n)):(e._looking=!0,bf(e,t,n,u));k.clone(t,e._rotateMousePosition)}function Af(e,t,n,i,r,o){r=r??!1,o=o??!1;let a=e._scene,s=a.camera,c=a.canvas,u=s.constrainedAxis;l(i)&&(s.constrainedAxis=i);let f=h.magnitude(s.position),d=e._rotateFactor*(f-e._rotateRateRangeAdjustment);d>e._maximumRotateRate&&(d=e._maximumRotateRate),d<e._minimumRotateRate&&(d=e._minimumRotateRate);let p=(n.startPosition.x-n.endPosition.x)/c.clientWidth,g=(n.startPosition.y-n.endPosition.y)/c.clientHeight;p=Math.min(p,e.maximumMovementRatio),g=Math.min(g,e.maximumMovementRatio);let m=d*p*Math.PI*2,y=d*g*Math.PI;if(l(i)&&l(e.maximumTiltAngle)){let A=e.maximumTiltAngle,b=h.dot(s.direction,i),x=Math.PI-Math.acos(b)+y;x>A&&(y-=x-A)}r||s.rotateRight(m),o||s.rotateUp(y),s.constrainedAxis=u}var Jee=ae.clone(ae.UNIT_W),XSe=ae.clone(ae.UNIT_W),v6=new h,RS=new h,E6=new h,KSe=new h,Iwt=new k,Pwt=new k,Dwt=new k,Rwt=new k,Owt=new hn;function Zee(e,t,n,i){let r=e._scene,o=r.camera,a=k.clone(n.startPosition,Iwt),s=k.clone(n.endPosition,Pwt),c=i.cartesianToCartographic(o.positionWC,fwe).height,u,f;if(!n.inertiaEnabled&&c<e._minimumPickingTerrainHeight&&(u=h.clone(e._panLastWorldPosition,Jee),!l(e._globe)&&!k.equalsEpsilon(a,e._panLastMousePosition)&&(u=Sg(e,a,Jee)),!l(e._globe)&&l(u))){let d=h.subtract(u,o.positionWC,RS),p=h.multiplyByScalar(o.directionWC,h.dot(o.directionWC,d),RS),g=h.magnitude(p),m=o.frustum.getPixelDimensions(r.drawingBufferWidth,r.drawingBufferHeight,g,r.pixelRatio,Rwt),y=k.subtract(s,a,Dwt),A=h.multiplyByScalar(o.rightWC,y.x*m.x,RS),b=h.normalize(o.positionWC,QSe),x=o.getPickRay(s,Owt).direction,T=h.subtract(x,h.projectVector(x,o.rightWC,E6),E6),C=h.angleBetween(T,o.directionWC),E=1;l(o.frustum.fov)&&(E=Math.max(Math.tan(C),.1));let w=Math.abs(h.dot(o.directionWC,b)),D=-y.y*m.y*2/Math.sqrt(E)*(1-w),R=h.multiplyByScalar(x,D,E6);w=Math.abs(h.dot(o.upWC,b));let M=h.multiplyByScalar(o.upWC,-y.y*(1-w)*m.y,KSe);f=h.add(u,A,XSe),f=h.add(f,R,f),f=h.add(f,M,f),h.clone(f,e._panLastWorldPosition),k.clone(s,e._panLastMousePosition)}if((!l(u)||!l(f))&&(u=o.pickEllipsoid(a,i,Jee),f=o.pickEllipsoid(s,i,XSe)),!l(u)||!l(f)){e._rotating=!0,Af(e,t,n);return}if(u=o.worldToCameraCoordinates(u,u),f=o.worldToCameraCoordinates(f,f),l(o.constrainedAxis)){let d=o.constrainedAxis,p=h.mostOrthogonalAxis(d,v6);h.cross(p,d,p),h.normalize(p,p);let g=h.cross(d,p,RS),m=h.magnitude(u),y=h.dot(d,u),A=Math.acos(y/m),b=h.multiplyByScalar(d,y,E6);h.subtract(u,b,b),h.normalize(b,b);let x=h.magnitude(f),T=h.dot(d,f),C=Math.acos(T/x),E=h.multiplyByScalar(d,T,KSe);h.subtract(f,E,E),h.normalize(E,E);let w=Math.acos(h.dot(b,p));h.dot(b,g)<0&&(w=I.TWO_PI-w);let D=Math.acos(h.dot(E,p));h.dot(E,g)<0&&(D=I.TWO_PI-D);let R=w-D,M;h.equalsEpsilon(d,o.position,I.EPSILON2)?M=o.right:M=h.cross(d,o.position,v6);let N=h.cross(d,M,v6),_=h.dot(N,h.subtract(u,d,RS)),v=h.dot(N,h.subtract(f,d,RS)),S;_>0&&v>0?S=C-A:_>0&&v<=0?h.dot(o.position,d)>0?S=-A-C:S=A+C:S=A-C,o.rotateRight(R),o.rotateUp(S)}else{h.normalize(u,u),h.normalize(f,f);let d=h.dot(u,f),p=h.cross(u,f,v6);if(d<1&&!h.equalsEpsilon(p,h.ZERO,I.EPSILON14)){let g=Math.acos(d);o.rotate(p,g)}}}var Mwt=new h,Lwt=new de,$Se=0;function dwe(e,t,n){l(n.distance)&&(n=n.distance);let i=n.inertiaEnabled,r=e._ellipsoid,o=e._scene,a=o.camera,s=o.canvas,c=e._cameraUnderground,u;c?u=t:(u=cwe,u.x=s.clientWidth/2,u.y=s.clientHeight/2);let f=a.getPickRay(u,lwe),d,p=r.cartesianToCartographic(a.position,Lwt).height,g=Math.abs($Se)<e.minimumPickingTerrainDistanceWithInertia;(i?g:p<e._minimumPickingTerrainHeight)&&(d=Sg(e,u,uwe));let y;if(l(d)&&(y=h.distance(f.origin,d)),!l(e._globe)&&l(y)&&a.getMagnitude()<y&&(y=void 0),l(y)&&($Se=y),c){let b=twe(e,f,p);l(y)?y=Math.min(y,b):y=b}l(y)||(y=p);let A=h.normalize(a.position,Mwt);nte(e,t,n,e.zoomFactor,y,h.dot(A,a.direction))}var hwe=new k,P6=new hn,Q1=new h,Nwt=new h,mwe=new O,Fwt=new O,pwe=new O,Bwt=new Fe,kwt=new $,rte=new de,ote=new h;function zwt(e,t,n){let r=e._scene.camera;if(!O.equals(r.transform,O.IDENTITY))return;if(l(n.angleAndHeight)&&(n=n.angleAndHeight),k.equals(t,e._tiltCenterMousePosition)||(e._tiltOnEllipsoid=!1,e._looking=!1),e._looking){let s=e._ellipsoid.geodeticSurfaceNormal(r.position,ote);bf(e,t,n,s);return}let a=e._ellipsoid.cartesianToCartographic(r.position,rte);e._tiltOnEllipsoid||a.height>e._minimumCollisionTerrainHeight?(e._tiltOnEllipsoid=!0,Vwt(e,t,n)):jwt(e,t,n)}var Uwt=new de;function Vwt(e,t,n){let i=e._ellipsoid,r=e._scene,o=r.camera,a=e.minimumZoomDistance*.25,s=i.cartesianToCartographic(o.positionWC,Uwt).height;if(s-a-1<I.EPSILON3&&n.endPosition.y-n.startPosition.y<0)return;let c=r.canvas,u=hwe;u.x=c.clientWidth/2,u.y=c.clientHeight/2;let f=o.getPickRay(u,P6),d,p=ci.rayEllipsoid(f,i);if(l(p))d=hn.getPoint(f,p.start,Q1);else if(s>e._minimumTrackBallHeight){let x=ci.grazingAltitudeLocation(f,i);if(!l(x))return;let T=i.cartesianToCartographic(x,rte);T.height=0,d=i.cartographicToCartesian(T,Q1)}else{e._looking=!0;let x=e._ellipsoid.geodeticSurfaceNormal(o.position,ote);bf(e,t,n,x),k.clone(t,e._tiltCenterMousePosition);return}let g=mt.eastNorthUpToFixedFrame(d,i,mwe),m=e._globe,y=e._ellipsoid;e._globe=void 0,e._ellipsoid=te.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let A=O.clone(o.transform,pwe);o._setTransform(g),Af(e,t,n,h.UNIT_Z),o._setTransform(A),e._globe=m,e._ellipsoid=y;let b=y.maximumRadius;e._rotateFactor=1/b,e._rotateRateRangeAdjustment=b}function jwt(e,t,n){let i=e._ellipsoid,r=e._scene,o=r.camera,a=e._cameraUnderground,s,c,u;if(k.equals(t,e._tiltCenterMousePosition))s=h.clone(e._tiltCenter,Q1);else{if(s=Sg(e,t,Q1),!l(s)){if(c=o.getPickRay(t,P6),u=ci.rayEllipsoid(c,i),!l(u)){if(i.cartesianToCartographic(o.position,rte).height<=e._minimumTrackBallHeight){e._looking=!0;let v=e._ellipsoid.geodeticSurfaceNormal(o.position,ote);bf(e,t,n,v),k.clone(t,e._tiltCenterMousePosition)}return}s=hn.getPoint(c,u.start,Q1)}a&&(l(c)||(c=o.getPickRay(t,P6)),nwe(e,c,s,s)),k.clone(t,e._tiltCenterMousePosition),h.clone(s,e._tiltCenter)}let f=r.canvas,d=hwe;d.x=f.clientWidth/2,d.y=e._tiltCenterMousePosition.y,c=o.getPickRay(d,P6);let p=h.magnitude(s),g=h.fromElements(p,p,p,ete),m=te.fromCartesian3(g,tte);if(u=ci.rayEllipsoid(c,m),!l(u))return;let y=h.magnitude(c.origin)>p?u.start:u.stop,A=hn.getPoint(c,y,Nwt),b=mt.eastNorthUpToFixedFrame(s,i,mwe),x=mt.eastNorthUpToFixedFrame(A,m,Fwt),T=e._globe,C=e._ellipsoid;e._globe=void 0,e._ellipsoid=te.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let E=h.UNIT_Z,w=O.clone(o.transform,pwe);o._setTransform(x);let D=h.cross(A,o.positionWC,I6);if(h.dot(o.rightWC,D)<0){let _=n.startPosition.y-n.endPosition.y;(a&&_<0||!a&&_>0)&&(E=void 0);let v=o.constrainedAxis;o.constrainedAxis=void 0,Af(e,t,n,E,!0,!1),o.constrainedAxis=v}else Af(e,t,n,E,!0,!1);if(o._setTransform(b),Af(e,t,n,E,!1,!0),l(o.constrainedAxis)){let _=h.cross(o.direction,o.constrainedAxis,I6);h.equalsEpsilon(_,h.ZERO,I.EPSILON6)||(h.dot(_,o.right)<0&&h.negate(_,_),h.cross(_,o.direction,o.up),h.cross(o.direction,o.up,o.right),h.normalize(o.up,o.up),h.normalize(o.right,o.right))}o._setTransform(w),e._globe=T,e._ellipsoid=C;let M=C.maximumRadius;e._rotateFactor=1/M,e._rotateRateRangeAdjustment=M;let N=h.clone(o.positionWC,I6);if(e.enableCollisionDetection&&ate(e,!0),!h.equals(o.positionWC,N)){o._setTransform(x),o.worldToCameraCoordinatesPoint(N,N);let _=h.magnitudeSquared(N);h.magnitudeSquared(o.position)>_&&(h.normalize(o.position,o.position),h.multiplyByScalar(o.position,Math.sqrt(_),o.position));let v=h.angleBetween(N,o.position),S=h.cross(N,o.position,N);h.normalize(S,S);let P=Fe.fromAxisAngle(S,v,Bwt),L=$.fromQuaternion(P,kwt);$.multiplyByVector(L,o.direction,o.direction),$.multiplyByVector(L,o.up,o.up),h.cross(o.direction,o.up,o.right),h.cross(o.right,o.direction,o.up),o._setTransform(w)}}var Hwt=new k,Gwt=new k,JSe=new hn,ZSe=new hn,Wwt=new h,qwt=new h;function bf(e,t,n,i){let o=e._scene.camera,a=Hwt;a.x=n.startPosition.x,a.y=0;let s=Gwt;s.x=n.endPosition.x,s.y=0;let c=o.getPickRay(a,JSe),u=o.getPickRay(s,ZSe),f=0,d,p;o.frustum instanceof pn?(d=c.origin,p=u.origin,h.add(o.direction,d,d),h.add(o.direction,p,p),h.subtract(d,o.position,d),h.subtract(p,o.position,p),h.normalize(d,d),h.normalize(p,p)):(d=c.direction,p=u.direction);let g=h.dot(d,p);g<1&&(f=Math.acos(g)),f=n.startPosition.x>n.endPosition.x?-f:f;let m=e._horizontalRotationAxis;if(l(i)?o.look(i,-f):l(m)?o.look(m,-f):o.lookLeft(f),a.x=0,a.y=n.startPosition.y,s.x=0,s.y=n.endPosition.y,c=o.getPickRay(a,JSe),u=o.getPickRay(s,ZSe),f=0,o.frustum instanceof pn?(d=c.origin,p=u.origin,h.add(o.direction,d,d),h.add(o.direction,p,p),h.subtract(d,o.position,d),h.subtract(p,o.position,p),h.normalize(d,d),h.normalize(p,p)):(d=c.direction,p=u.direction),g=h.dot(d,p),g<1&&(f=Math.acos(g)),f=n.startPosition.y>n.endPosition.y?-f:f,i=i??m,l(i)){let y=o.direction,A=h.negate(i,Wwt),b=h.equalsEpsilon(y,i,I.EPSILON2),x=h.equalsEpsilon(y,A,I.EPSILON2);if(!b&&!x){g=h.dot(y,i);let T=I.acosClamped(g);f>0&&f>T&&(f=T-I.EPSILON4),g=h.dot(y,A),T=I.acosClamped(g),f<0&&-f>T&&(f=-T+I.EPSILON4);let C=h.cross(i,y,qwt);o.look(C,f)}else(b&&f<0||x&&f>0)&&o.look(o.right,-f)}else o.lookUp(f)}function Ywt(e){zl(e,e.enableRotate,e.rotateEventTypes,wwt,e.inertiaSpin,"_lastInertiaSpinMovement"),zl(e,e.enableZoom,e.zoomEventTypes,dwe,e.inertiaZoom,"_lastInertiaZoomMovement"),zl(e,e.enableTilt,e.tiltEventTypes,zwt,e.inertiaSpin,"_lastInertiaTiltMovement"),zl(e,e.enableLook,e.lookEventTypes,bf)}var Xwt=new O,Kwt=new de;function ate(e,t){e._adjustedHeightForTerrain=!0;let n=e._scene,i=n.mode;if(i===re.SCENE2D||i===re.MORPHING)return;let r=n.camera,o=n.ellipsoid??te.WGS84,a=n.mapProjection,s,c;O.equals(r.transform,O.IDENTITY)||(s=O.clone(r.transform,Xwt),c=h.magnitude(r.position),r._setTransform(O.IDENTITY));let u=Kwt;i===re.SCENE3D?o.cartesianToCartographic(r.position,u):a.unproject(r.position,u);let f=!1;if(u.height<e._minimumCollisionTerrainHeight){let d=e._scene.globeHeight;if(l(d)){let p=d+e.minimumZoomDistance,g=d-e._lastGlobeHeight,m=g/e._lastGlobeHeight;u.height<p&&(t||Math.abs(m)<=.1)&&(u.height=p,i===re.SCENE3D?o.cartographicToCartesian(u,r.position):a.project(u,r.position),f=!0),t||Math.abs(m)<=.1?e._lastGlobeHeight=d:e._lastGlobeHeight+=g*.1}}l(s)&&(r._setTransform(s),f&&(h.normalize(r.position,r.position),h.negate(r.position,r.direction),h.multiplyByScalar(r.position,Math.max(c,e.minimumZoomDistance),r.position),h.normalize(r.direction,r.direction),h.cross(r.direction,r.up,r.right),h.cross(r.right,r.direction,r.up)))}eR.prototype.onMap=function(){let e=this._scene,t=e.mode,n=e.camera;return t===re.COLUMBUS_VIEW?Math.abs(n.position.x)-this._maxCoord.x<0&&Math.abs(n.position.y)-this._maxCoord.y<0:!0};var $wt=new h,Jwt=new h;eR.prototype.update=function(){let e=this._scene,{camera:t,globe:n,mode:i}=e;O.equals(t.transform,O.IDENTITY)?(this._globe=n,this._ellipsoid=e.ellipsoid??te.default):(this._globe=void 0,this._ellipsoid=te.UNIT_SPHERE);let{verticalExaggeration:r,verticalExaggerationRelativeHeight:o}=e;this._minimumCollisionTerrainHeight=pr.getHeight(this.minimumCollisionTerrainHeight,r,o),this._minimumPickingTerrainHeight=pr.getHeight(this.minimumPickingTerrainHeight,r,o),this._minimumTrackBallHeight=pr.getHeight(this.minimumTrackBallHeight,r,o),this._cameraUnderground=e.cameraUnderground&&l(this._globe);let a=this._ellipsoid.maximumRadius;this._rotateFactor=1/a,this._rotateRateRangeAdjustment=a,this._adjustedHeightForTerrain=!1;let s=h.clone(t.positionWC,$wt),c=h.clone(t.directionWC,Jwt);if(i===re.SCENE2D?KSt(this):i===re.COLUMBUS_VIEW?(this._horizontalRotationAxis=h.UNIT_Z,Awt(this)):i===re.SCENE3D&&(this._horizontalRotationAxis=void 0,Ywt(this)),this.enableCollisionDetection&&!this._adjustedHeightForTerrain){let u=!h.equals(s,t.positionWC)||!h.equals(c,t.directionWC);ate(this,u)}this._aggregator.reset()};eR.prototype.isDestroyed=function(){return!1};eR.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),ue(this)};var R6=eR;function tR(e){let t=new _c(e);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new Je},t.viewport=new Je,this._context=e,this._fb=new si({depthStencil:!0,pixelDatatype:ke.FLOAT,pixelFormat:He.RGBA}),this._passState=t}function Zwt(e,t,n,i){let r=Math.max(n,i),o=r*r,a=Math.floor(n*.5),s=Math.floor(i*.5),c=0,u=0,f=0,d=-1,p=[];for(let g=0;g<o;++g){if(-a<=c&&c<=a&&-s<=u&&u<=s){let m=4*((s-u)*n+c+a),y=t[m],A=e.getObjectByPickColor(y);l(A)&&p.push({object:A,isEdge:t[m+1]>0,depth:t[m+2],x:c,y:u})}if(c===u||c<0&&-c===u||c>0&&c===1-u){let m=f;f=-d,d=m}c+=f,u+=d}return p}tR.prototype.begin=function(e,t){let n=this._context,{width:i,height:r}=t;return Je.clone(e,this._passState.scissorTest.rectangle),this._fb.update(n,i,r),this._passState.framebuffer=this._fb.framebuffer,this._passState.viewport.width=i,this._passState.viewport.height=r,this._passState};tR.prototype.end=function(e){let t=e.width??1,n=e.height??1,i=this._context,r=i.readPixels({x:e.x,y:e.y,width:t,height:n,pixelDatatype:ke.FLOAT,framebuffer:this._fb.framebuffer});return Zwt(i,r,t,n)};tR.prototype.isDestroyed=function(){return!1};tR.prototype.destroy=function(){return this._fb.destroy(),ue(this)};var O6=tR;var M6={},Qwt=new Je(0,0,3,3),eIt=new k,tIt=new hn,nIt=new h,iIt=3,rIt=.1;function ste(e){return Math.sqrt(e.x*e.x+e.y*e.y)}function gwe(e){let t=Number.POSITIVE_INFINITY;for(let a of e)!a.isEdge&&ste(a)<=iIt&&(t=Math.min(t,a.depth));let n=t*(1+rIt),i=e.filter(a=>!a.isEdge||a.depth<=n),r=i.some(a=>a.isEdge);return i.filter(a=>a.isEdge===r).reduce((a,s)=>ste(s)<ste(a)?s:a)}function _we(e,t,n){let i=eIt;i.x=t.x+n.x,i.y=t.y+n.y;let r=e.camera.getPickRay(i,tIt);if(!l(r))return;let o=h.dot(r.direction,e.camera.directionWC);if(o<=0)return;let a=n.depth/o,s=h.multiplyByScalar(r.direction,a,nIt);return h.add(r.origin,s,new h)}M6.snap=function(e,t,n){let i=n?.width??25,r=n?.height??i,{context:o,defaultView:a}=e;if(!o.colorBufferFloat){pt("snap-color-buffer-float","Scene.snap requires the EXT_color_buffer_float extension, which is not supported on this platform.");return}l(a.snapFramebuffer)||(a.snapFramebuffer=new O6(o));let s=a.snapFramebuffer,c=Qwt;Yj(e,t,c,i,r,{framebuffer:s,snap:!0});let u=s.end(c);if(Xj(e),u.length===0)return;let f=gwe(u);if(!l(f))return;let d=_we(e,t,f);if(l(d))return{object:f.object,isEdge:f.isEdge,position:d,screenPosition:new k(t.x+f.x,t.y+f.y)}};M6._selectBestHit=gwe;M6._snapHitToWorld=_we;var L6=M6;var N6=`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 F6=`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;
|
|
}
|
|
|
|
// See section 9. "The bright-pass filter" of Realtime HDR Rendering
|
|
// http://www.cg.tuwien.ac.at/research/publications/2007/Luksch_2007_RHR/Luksch_2007_RHR-RealtimeHDR%20.pdf
|
|
|
|
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 wg(){this._sceneFramebuffer=new vS;let e=.125,t=new Array(6);t[0]=new Mr({fragmentShader:_f,textureScale:e,forcePowerOfTwo:!0,sampleMode:Bd.LINEAR});let n=t[1]=new Mr({fragmentShader:F6,uniforms:{avgLuminance:.5,threshold:.25,offset:.1},textureScale:e,forcePowerOfTwo:!0}),i=this;this._delta=1,this._sigma=2,this._blurStep=new k,t[2]=new Mr({fragmentShader:Bx,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 Mr({fragmentShader:Bx,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 Mr({fragmentShader:_f,sampleMode:Bd.LINEAR}),this._uCenter=new k,this._uRadius=void 0,t[5]=new Mr({fragmentShader:N6,uniforms:{center:function(){return i._uCenter},radius:function(){return i._uRadius},colorTexture2:function(){return i._sceneFramebuffer.framebuffer.getColorTexture(0)}}}),this._stages=new yf({stages:t});let r=new IS(this),o=t.length;for(let a=0;a<o;++a)t[a]._textureCache=r;this._textureCache=r,this.length=t.length}wg.prototype.get=function(e){return this._stages.get(e)};wg.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 oIt=new ae,ywe=new k,aIt=new k,Awe=new O;function sIt(e,t,n){let i=t.uniformState,r=i.sunPositionWC,o=i.view,a=i.viewProjection,s=i.projection,c=O.computeViewportTransformation(n,0,1,Awe),u=O.multiplyByPoint(o,r,oIt),f=mt.pointToGLWindowCoordinates(a,c,r,ywe);u.x+=I.SOLAR_RADIUS;let d=mt.pointToGLWindowCoordinates(s,c,u,u),p=k.magnitude(k.subtract(d,f,d))*30*2,g=aIt;g.x=p,g.y=p,e._uCenter=k.clone(f,e._uCenter),e._uRadius=Math.max(g.x,g.y)*.15;let m=t.drawingBufferWidth,y=t.drawingBufferHeight,A=e._stages,b=A.get(0),x=b.outputTexture.width,T=b.outputTexture.height,C=new Je;C.width=x,C.height=T,c=O.computeViewportTransformation(C,0,1,Awe),f=mt.pointToGLWindowCoordinates(a,c,r,ywe),g.x*=x/m,g.y*=T/y;let E=b.scissorRectangle;E.x=Math.max(f.x-g.x*.5,0),E.y=Math.max(f.y-g.y*.5,0),E.width=Math.min(g.x,m),E.height=Math.min(g.y,y);for(let w=1;w<4;++w)Je.clone(E,A.get(w).scissorRectangle)}wg.prototype.clear=function(e,t,n){this._sceneFramebuffer.clear(e,t,n),this._textureCache.clear(e)};wg.prototype.update=function(e){let t=e.context,n=e.viewport,i=this._sceneFramebuffer;i.update(t,n);let r=i.framebuffer;return this._textureCache.update(t),this._stages.update(t,!1),sIt(this,t,n),r};wg.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 r=1;r<i;++r)n.get(r).execute(e,n.get(r-1).outputTexture)};wg.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(_f,{uniformMap:{colorTexture:function(){return n._stages.get(n._stages.length-1).outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};wg.prototype.isDestroyed=function(){return!1};wg.prototype.destroy=function(){return this._textureCache.destroy(),this._stages.destroy(),ue(this)};var B6=wg;function bwe(){this._cachedShowFrustumsShaders={}}function cIt(e){let t={},n=e.vertexAttributes;for(let i in n)n.hasOwnProperty(i)&&(t[i]=n[i].index);return t}function lIt(e,t){let n=e.context,i=t,r=i.fragmentShaderSource.clone(),o=[];r.sources=r.sources.map(function(f){f=Ge.replaceMain(f,"czm_Debug_main");let d=/out_FragData_(\d+)/g,p;for(;(p=d.exec(f))!==null;)o.indexOf(p[1])===-1&&o.push(p[1]);return f});let a=o.length,s="";s+=`uniform vec3 debugShowCommandsColor;
|
|
`,s+=`uniform vec3 debugShowFrustumsColor;
|
|
`,s+=`void main()
|
|
{
|
|
czm_Debug_main();
|
|
`;let c;if(a>0)for(c=0;c<a;++c)s+=` out_FragData_${o[c]}.rgb *= debugShowCommandsColor;
|
|
`,s+=` out_FragData_${o[c]}.rgb *= debugShowFrustumsColor;
|
|
`;else s+=` out_FragColor.rgb *= debugShowCommandsColor;
|
|
`,s+=` out_FragColor.rgb *= debugShowFrustumsColor;
|
|
`;s+="}",r.sources.push(s);let u=cIt(i);return Zt.fromCache({context:n,vertexShaderSource:i.vertexShaderSource,fragmentShaderSource:r,attributeLocations:u})}var nR=new U;function uIt(e,t){let n;return l(t.uniformMap)?n=t.uniformMap:n={},l(n.debugShowCommandsColor)||l(n.debugShowFrustumsColor)||(n.debugShowCommandsColor=function(){return e.debugShowCommands?(l(t._debugColor)||(t._debugColor=U.fromRandom()),t._debugColor):U.WHITE},n.debugShowFrustumsColor=function(){return e.debugShowFrustums?(nR.red=t.debugOverlappingFrustums&1?1:0,nR.green=t.debugOverlappingFrustums&2?1:0,nR.blue=t.debugOverlappingFrustums&4?1:0,nR.alpha=1,nR):U.WHITE}),n}var fIt=new nt;bwe.prototype.executeDebugShowFrustumsCommand=function(e,t,n){let i=t.shaderProgram.id,r=this._cachedShowFrustumsShaders[i];l(r)||(r=lIt(e,t.shaderProgram),this._cachedShowFrustumsShaders[i]=r);let o=nt.shallowClone(t,fIt);o.shaderProgram=r,o.uniformMap=uIt(e,t),o.execute(e.context,n)};var k6=bwe;function Gx(e,t,n){this._primitive=e,this._tileIndex=t,this._sampleIndex=n,this._metadata={},this._orientedBoundingBox=new Jt}Gx.fromKeyframeNode=function(e,t,n,i){let r=new Gx(e,t,n),{spatialNode:o,content:a}=i;return r._metadata=dIt(e,a,n),r._orientedBoundingBox=mIt(e,o,n,r._orientedBoundingBox),r};function dIt(e,t,n){if(!l(t)||!l(t.metadata))return;let{names:i,types:r}=e.provider,{metadata:o}=t,a={};for(let s=0;s<i.length;s++){let c=i[s],u=gt.getComponentCount(r[s]),f=o[s].slice(n*u,(n+1)*u);a[c]=f}return a}var xwe=new h,hIt=new h;function mIt(e,t,n,i){let r=t.dimensions,o=r.x*r.y,a=Math.floor(n/o),s=n-a*o,c=Math.floor(s/r.x),u=s-c*r.x,f=h.fromElements(u,c,a,xwe),d=h.divideComponents(h.subtract(f,e._paddingBefore,xwe),e.dimensions,hIt);return e._shape.computeOrientedBoundingBoxForSample(t,e.dimensions,d,i)}Object.defineProperties(Gx.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()}}});Gx.prototype.hasProperty=function(e){return l(this._metadata[e])};Gx.prototype.getNames=function(){return Object.keys(this._metadata)};Gx.prototype.getProperty=function(e){return this._metadata[e]};var z6=Gx;var Twe={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"};Object.freeze(Twe);var Ig=Twe;function OS(){this._defaultTexture=void 0,this._textures={},this._loadedImages=[],this._lastUpdatedFrame=-1}OS.prototype.getTexture=function(e){return this._textures[e]};function pIt(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];l(i)&&i!==e._defaultTexture&&i.destroy(),e._textures[t]=e._defaultTexture})}OS.prototype.loadTexture2D=function(e,t){l(t.typedArray)?this._loadedImages.push({id:e,textureUniform:t}):pIt(this,e,t)};function gIt(e,t,n){let{id:i,textureUniform:r,image:o}=t,a=n.webgl2?U6(r,o,n):_It(r,o,n),s=e._textures[i];l(s)&&s!==n.defaultTexture&&s.destroy(),e._textures[i]=a}function U6(e,t,n){let{typedArray:i,sampler:r}=e,o=l(i)?vwe(e,n):new Et({context:n,source:t,sampler:r});return Cwe(r)&&o.generateMipmap(),o}function _It(e,t,n){let{typedArray:i,sampler:r}=e,o=Cwe(r),a=r.wrapS===on.REPEAT||r.wrapS===on.MIRRORED_REPEAT||r.wrapT===on.REPEAT||r.wrapT===on.MIRRORED_REPEAT,{width:s,height:c}=l(i)?e:t,u=[s,c].every(I.isPowerOfTwo);if((o||a)&&!u)if(l(i)){if(e.pixelDatatype===ke.UNSIGNED_BYTE){let d=Ek(i,s,c),p=eb(d);return U6({sampler:r},p,n)}}else{let d=eb(t);return U6(e,d,n)}else return U6(e,t,n);return o?console.warn("Texture requires resizing for mipmaps but pixelDataType cannot be resized. The texture may be rendered incorrectly."):a&&console.warn("Texture requires resizing for wrapping but pixelDataType cannot be resized. The texture may be rendered incorrectly."),vwe(e,n)}function Cwe(e){return[Gt.NEAREST_MIPMAP_NEAREST,Gt.NEAREST_MIPMAP_LINEAR,Gt.LINEAR_MIPMAP_NEAREST,Gt.LINEAR_MIPMAP_LINEAR].includes(e.minificationFilter)}function vwe(e,t){let{pixelFormat:n,pixelDatatype:i,width:r,height:o,typedArray:a,sampler:s}=e;return new Et({context:t,pixelFormat:n,pixelDatatype:i,source:{arrayBufferView:a,width:r,height:o},sampler:s,flipY:!1})}OS.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 r=n[i];gIt(this,r,t)}n.length=0};OS.prototype.isDestroyed=function(){return!1};OS.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 ue(this)};var V6=OS;function iR(e){e=e??H.EMPTY_OBJECT,this.mode=e.mode??Ey.MODIFY_MATERIAL,this.lightingModel=e.lightingModel,this.uniforms=e.uniforms??H.EMPTY_OBJECT,this.varyings=e.varyings??H.EMPTY_OBJECT,this.vertexShaderText=e.vertexShaderText,this.fragmentShaderText=e.fragmentShaderText,this.translucencyMode=e.translucencyMode??ox.INHERIT,this._textureManager=new V6,this._defaultTexture=void 0,this.uniformMap=yIt(this),this.usedVariablesVertex={attributeSet:{},featureIdSet:{},metadataSet:{}},this.usedVariablesFragment={attributeSet:{},featureIdSet:{},metadataSet:{},materialSet:{}},xIt(this),TIt(this)}function yIt(e){let t=e.uniforms,n={};for(let i in t)if(t.hasOwnProperty(i)){let r=t[i];r.type===Ig.SAMPLER_2D?(e._textureManager.loadTexture2D(i,r.value),n[i]=AIt(e,i)):n[i]=bIt(e,i)}return n}function AIt(e,t){return function(){return e._textureManager.getTexture(t)??e._defaultTexture}}function bIt(e,t){return function(){return e.uniforms[t].value}}function Wx(e,t,n){let i;for(;(i=t.exec(e))!==null;){let r=i[1];n[r]=!0}}function xIt(e){let t=/[vf]sInput\.attributes\.(\w+)/g,n=/[vf]sInput\.featureIds\.(\w+)/g,i=/[vf]sInput\.(?:metadata|metadataClass|metadataStatistics)\.(\w+)/g,r,o=e.vertexShaderText;l(o)&&(r=e.usedVariablesVertex.attributeSet,Wx(o,t,r),r=e.usedVariablesVertex.featureIdSet,Wx(o,n,r),r=e.usedVariablesVertex.metadataSet,Wx(o,i,r));let a=e.fragmentShaderText;if(l(a)){r=e.usedVariablesFragment.attributeSet,Wx(a,t,r),r=e.usedVariablesFragment.featureIdSet,Wx(a,n,r),r=e.usedVariablesFragment.metadataSet,Wx(a,i,r);let s=/material\.(\w+)/g,c=e.usedVariablesFragment.materialSet;Wx(a,s,c)}}function Ewe(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 il(e,t,n,i){if(e.hasOwnProperty(t)){let r=`${Ewe(t)} is not available in the ${i} shader. Did you mean ${Ewe(n)} instead?`;throw new pe(r)}}function TIt(e){let t=e.usedVariablesVertex.attributeSet;il(t,"position","positionMC","vertex"),il(t,"normal","normalMC","vertex"),il(t,"tangent","tangentMC","vertex"),il(t,"bitangent","bitangentMC","vertex"),il(t,"positionWC","positionMC","vertex"),il(t,"positionEC","positionMC","vertex"),il(t,"normalEC","normalMC","vertex"),il(t,"tangentEC","tangentMC","vertex"),il(t,"bitangentEC","bitangentMC","vertex");let n=e.usedVariablesFragment.attributeSet;il(n,"position","positionEC","fragment"),il(n,"normal","normalEC","fragment"),il(n,"tangent","tangentEC","fragment"),il(n,"bitangent","bitangentEC","fragment"),il(n,"normalMC","normalEC","fragment"),il(n,"tangentMC","tangentEC","fragment"),il(n,"bitangentMC","bitangentEC","fragment")}iR.prototype.setUniform=function(e,t){let n=this.uniforms[e];n.type===Ig.SAMPLER_2D?this._textureManager.loadTexture2D(e,t):l(t.clone)?n.value=t.clone(n.value):n.value=t};iR.prototype.update=function(e){this._defaultTexture=e.context.defaultTexture,this._textureManager.update(e)};iR.prototype.isDestroyed=function(){return!1};iR.prototype.destroy=function(){this._textureManager=this._textureManager&&this._textureManager.destroy(),ue(this)};var Pg=iR;function CIt(e){e=e??H.EMPTY_OBJECT,this.typedArray=e.typedArray,this.width=e.width,this.height=e.height,this.pixelFormat=e.pixelFormat??He.RGBA,this.pixelDatatype=e.pixelDatatype??ke.UNSIGNED_BYTE;let t=e.url;typeof t=="string"&&(t=De.createIfNeeded(t)),this.resource=t;let i=e.repeat??!0?on.REPEAT:on.CLAMP_TO_EDGE;this.sampler=new Ut({wrapS:i,wrapT:i,minificationFilter:e.minificationFilter,magnificationFilter:e.magnificationFilter,maximumAnisotropy:e.maximumAnisotropy})}var j6=CIt;function vIt(e){let{names:t,types:n,componentTypes:i,minimumValues:r,maximumValues:o}=e;for(let a=0;a<t.length;a++){if(!EIt(r?.[a],o?.[a]))continue;let s=SIt(t[a],n[a],i[a],r[a],o[a]);if(l(s))return s}}function EIt(e,t){if(!Array.isArray(e)||!Array.isArray(t))return!1;let n=Math.min(...e),i=Math.max(...t);return n<i}function SIt(e,t,n,i,r){if(t===gt.VEC4&&n===Mt.FLOAT32)return wIt(e,i,r);if(t===gt.SCALAR&&n===Mt.FLOAT32)return IIt(e,i,r)}function wIt(e,t,n){let i=Math.min(...t),r=Math.max(...n);if(!(i<0||r>1))return new Pg({fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material)
|
|
{
|
|
material.diffuse = fsInput.metadata.${e}.rgb;
|
|
material.alpha = fsInput.metadata.${e}.a;
|
|
}`})}function IIt(e,t,n){let r=xk([new U(.267,.004,.329),new U(.282,.14,.457),new U(.254,.265,.53),new U(.207,.372,.553),new U(.164,.471,.558),new U(.128,.567,.551),new U(.135,.659,.518),new U(.194,.741,.443),new U(.282,.819,.369),new U(.396,.898,.301),new U(.538,.965,.236),new U(.741,.998,.149),new U(.993,1,.144)],128),o=new j6({typedArray:r,width:128,height:1});return new Pg({uniforms:{u_colorMap:{type:Ig.SAMPLER_2D,value:o},u_minimumValue:{type:Ig.FLOAT,value:t[0]},u_maximumValue:{type:Ig.FLOAT,value:n[0]}},fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material)
|
|
{
|
|
float value = fsInput.metadata.${e};
|
|
vec3 voxelNormal = fsInput.attributes.normalEC;
|
|
float diffuse = max(0.0, dot(voxelNormal, czm_lightDirectionEC));
|
|
float lighting = 0.5 + 0.5 * diffuse;
|
|
|
|
if (value >= u_minimumValue && value <= u_maximumValue) {
|
|
float lerp = (value - u_minimumValue) / (u_maximumValue - u_minimumValue);
|
|
material.diffuse = texture(u_colorMap, vec2(lerp, 0.5)).rgb * lighting;
|
|
material.alpha = 1.0;
|
|
}
|
|
}`})}var rR=vIt;function PIt(e,t){let{shaderBuilder:n}=e,{names:i,types:r,componentTypes:o,minimumValues:a,maximumValues:s}=t._provider,c=r.length,u=l(a)&&l(s);n.addDefine("METADATA_COUNT",c,he.FRAGMENT),u&&n.addDefine("STATISTICS",void 0,he.FRAGMENT);for(let _=0;_<c;_++){let v=i[_],S=H6(r[_]),P=`PropertyStatistics_${v}`,L=`PropertyStatistics_${v}`;n.addStruct(P,L,he.FRAGMENT),n.addStructField(P,S,"min"),n.addStructField(P,S,"max")}let f="MetadataStatistics",d="MetadataStatistics",p="metadataStatistics";n.addStruct(f,d,he.FRAGMENT);for(let _=0;_<c;_++){let v=i[_],S=`PropertyStatistics_${v}`,P=v;n.addStructField(f,S,P)}let g="Metadata",m="Metadata",y="metadata";n.addStruct(g,m,he.FRAGMENT);for(let _=0;_<c;_++){let v=H6(r[_]);n.addStructField(g,v,i[_])}let A="Attributes",b="Attributes",x="attributes";n.addStruct(A,b,he.FRAGMENT),n.addStructField(A,"vec3","positionEC"),n.addStructField(A,"vec3","normalEC");let T="Voxel",C="Voxel",E="voxel";n.addStruct(T,C,he.FRAGMENT),n.addStructField(T,"vec3","viewDirUv"),n.addStructField(T,"float","travelDistance"),n.addStructField(T,"int","stepCount"),n.addStructField(T,"int","tileIndex"),n.addStructField(T,"int","sampleIndex"),n.addStructField(T,"float","distanceToDepthBuffer");let w="FragmentInput";n.addStruct(w,"FragmentInput",he.FRAGMENT),n.addStructField(w,d,p),n.addStructField(w,m,y),n.addStructField(w,b,x),n.addStructField(w,C,E);let R="Properties",M="Properties",N="properties";n.addStruct(R,M,he.FRAGMENT);for(let _=0;_<c;_++){let v=H6(r[_]);n.addStructField(R,v,i[_])}{let _="clearProperties";n.addFunction(_,`${M} clearProperties()`,he.FRAGMENT),n.addFunctionLines(_,[`${M} ${N};`]);for(let v=0;v<c;v++){let S=H6(r[v],o[v]);n.addFunctionLines(_,[`${N}.${i[v]} = ${S}(0.0);`])}n.addFunctionLines(_,[`return ${N};`])}{let _="sumProperties";n.addFunction(_,`${M} sumProperties(${M} propertiesA, ${M} propertiesB)`,he.FRAGMENT),n.addFunctionLines(_,[`${M} ${N};`]);for(let v=0;v<c;v++){let S=i[v];n.addFunctionLines(_,[`${N}.${S} = propertiesA.${S} + propertiesB.${S};`])}n.addFunctionLines(_,[`return ${N};`])}{let _="scaleProperties";n.addFunction(_,`${M} scaleProperties(${M} ${N}, float scale)`,he.FRAGMENT),n.addFunctionLines(_,[`${M} scaledProperties = ${N};`]);for(let v=0;v<c;v++)n.addFunctionLines(_,[`scaledProperties.${i[v]} *= scale;`]);n.addFunctionLines(_,["return scaledProperties;"])}{let _="mixProperties";n.addFunction(_,`${M} mixProperties(${M} propertiesA, ${M} propertiesB, float mixFactor)`,he.FRAGMENT),n.addFunctionLines(_,[`${M} ${N};`]);for(let v=0;v<c;v++){let S=i[v];n.addFunctionLines(_,[`${N}.${S} = mix(propertiesA.${S}, propertiesB.${S}, mixFactor);`])}n.addFunctionLines(_,[`return ${N};`])}{let _="copyPropertiesToMetadata";n.addFunction(_,`void copyPropertiesToMetadata(in ${M} ${N}, inout ${m} ${y})`,he.FRAGMENT);for(let v=0;v<c;v++){let S=i[v];n.addFunctionLines(_,[`${y}.${S} = ${N}.${S};`])}}if(u){let _="setStatistics";n.addFunction(_,`void setStatistics(inout ${d} ${p})`,he.FRAGMENT);for(let v=0;v<c;v++){let S=i[v],P=r[v],L=gt.getComponentCount(P);for(let F=0;F<L;F++){let V=RIt(P,F),z=a[v][F],j=s[v][F];!l(z)||!l(j)||n.addFunctionLines(_,[`${p}.${S}.min${V} = ${Swe(z)};`,`${p}.${S}.max${V} = ${Swe(j)};`])}}}{let _="getPropertiesFromMegatextureAtUv";n.addFunction(_,`${M} getPropertiesFromMegatextureAtUv(vec3 texcoord)`,he.FRAGMENT),n.addFunctionLines(_,[`${M} ${N};`]);for(let v=0;v<c;v++){let S=r[v],P=o[v],L=DIt(S,P);n.addFunctionLines(_,[`properties.${i[v]} = texture(u_megatextureTextures[${v}], texcoord)${L};`])}n.addFunctionLines(_,[`return ${N};`])}}function H6(e){if(e===gt.SCALAR)return"float";if(e===gt.VEC2)return"vec2";if(e===gt.VEC3)return"vec3";if(e===gt.VEC4)return"vec4"}function DIt(e){if(e===gt.SCALAR)return".r";if(e===gt.VEC2)return".ra";if(e===gt.VEC3)return".rgb";if(e===gt.VEC4)return""}function Swe(e){let t=e.toString();return t.indexOf(".")===-1&&(t=`${e}.0`),t}function RIt(e,t){return e===gt.SCALAR?"":`[${t}]`}var G6=PIt;function tm(e){let{planes:t,modelMatrix:n=O.IDENTITY,unionClippingRegions:i=!1}=e??H.EMPTY_OBJECT;if(this._planes=[],this.modelMatrix=O.clone(n),this.planeAdded=new be,this.planeRemoved=new be,this._unionClippingRegions=i,this._testIntersection=i?wwe:Iwe,this._float32View=void 0,this._clippingPlanesTexture=void 0,l(t))for(let r=0;r<t.length;++r)this.add(t[r])}function wwe(e){return e===Xt.OUTSIDE}function Iwe(e){return e===Xt.INSIDE}Object.defineProperties(tm.prototype,{length:{get:function(){return this._planes.length}},unionClippingRegions:{get:function(){return this._unionClippingRegions},set:function(e){this._unionClippingRegions!==e&&(this._unionClippingRegions=e,this._testIntersection=e?wwe:Iwe)}},texture:{get:function(){return this._clippingPlanesTexture}},clippingPlanesState:{get:function(){return this._unionClippingRegions?this._planes.length:-this._planes.length}}});tm.prototype.add=function(e){let t=this._planes.length;e.index=t,this._planes.push(e),this.planeAdded.raiseEvent(e,t)};tm.prototype.get=function(e){return this._planes[e]};function Pwe(e,t){for(let n=0;n<e.length;++n)if(tn.equals(e[n],t))return n;return-1}tm.prototype.contains=function(e){return Pwe(this._planes,e)!==-1};tm.prototype.remove=function(e){let t=this._planes,n=Pwe(t,e);if(n===-1)return!1;e instanceof ls&&(e.onChangeCallback=void 0,e.index=-1);let i=t.length-1;for(let r=n;r<i;++r){let o=t[r+1];t[r]=o,o instanceof ls&&(o.index=r)}return t.length=i,this.planeRemoved.raiseEvent(e,n),!0};tm.prototype.removeAll=function(){let e=this._planes;for(let t=0;t<e.length;++t){let n=e[t];n instanceof ls&&(n.onChangeCallback=void 0,n.index=-1),this.planeRemoved.raiseEvent(n,t)}this._planes=[]};var OIt=new tn(h.fromElements(1,0,0),0);function MIt(e,t){let n=e._float32View,i=e._planes,r=0;for(let o=0;o<i.length;++o){let{normal:a,distance:s}=NIt(i[o],t,OIt);n[r]=a.x,n[r+1]=a.y,n[r+2]=a.z,n[r+3]=s,r+=4}}var cte=new ae,LIt=new h;function NIt(e,t,n){let{normal:i,distance:r}=e,o=ae.fromElements(i.x,i.y,i.z,r,cte),a=O.multiplyByVector(t,o,cte),s=h.fromCartesian4(a,LIt);return a=ae.divideByScalar(a,h.magnitude(s),cte),tn.fromCartesian4(a,n)}function Dwe(e,t){return t.x=Math.min(e,Ft.maximumTextureSize),t.y=Math.ceil(e/t.x),t}var FIt=new k;tm.prototype.update=function(e,t){let n=this._clippingPlanesTexture,i=this.length;if(l(n)){let a=n.width*n.height;(a<i||i<.25*a)&&(n.destroy(),n=void 0,this._clippingPlanesTexture=void 0)}if(this.length===0)return;if(!l(n)){let a=Dwe(i,FIt);a.y*=2,n=new Et({context:e.context,width:a.x,height:a.y,pixelFormat:He.RGBA,pixelDatatype:ke.FLOAT,sampler:Ut.NEAREST,flipY:!1}),this._float32View=new Float32Array(a.x*a.y*4),this._clippingPlanesTexture=n}let{width:r,height:o}=n;MIt(this,t),n.copyFrom({source:{width:r,height:o,arrayBufferView:this._float32View}})};tm.getTextureResolution=function(e,t,n){let i=e.texture;if(l(i))return n.x=i.width,n.y=i.height,n;let r=e.length,o=Dwe(r,n);return o.y*=2,o};tm.prototype.isDestroyed=function(){return!1};tm.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),ue(this)};var lA=tm;var W6=`struct Ray {
|
|
vec3 pos;
|
|
vec3 dir;
|
|
};
|
|
|
|
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);
|
|
}
|
|
`;var q6=`// See Intersection.glsl for the definition of intersectScene
|
|
// See IntersectionUtils.glsl for the definition of nextIntersection
|
|
// See convertLocalToBoxUv.glsl, convertLocalToCylinderUv.glsl, or convertLocalToEllipsoidUv.glsl
|
|
// for the definitions of convertLocalToShapeSpaceDerivative and getTileAndUvCoordinate.
|
|
// The appropriate functions are selected based on the VoxelPrimitive shape type,
|
|
// and added to the shader in Scene/VoxelRenderResources.js.
|
|
// See Octree.glsl for the definitions of TraversalData, SampleData,
|
|
// traverseOctreeFromBeginning, and traverseOctreeFromExisting
|
|
// See Megatexture.glsl for the definition of accumulatePropertiesFromMegatexture
|
|
|
|
#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 mat4 u_transformPositionViewToLocal;
|
|
uniform mat3 u_transformDirectionViewToLocal;
|
|
uniform vec3 u_cameraPositionLocal;
|
|
uniform vec3 u_cameraDirectionLocal;
|
|
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)
|
|
|
|
/**
|
|
* Given a coordinate within a tile, and sample spacings along a ray through
|
|
* the coordinate, find the distance to the points where the ray entered and
|
|
* exited the voxel cell, along with the surface normals at those points.
|
|
* The surface normals are returned in shape space coordinates.
|
|
*/
|
|
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 = viewRay.dir * jacobianT;
|
|
vec3 sampleSizeAlongRay = getSampleSize(sampleData.tileCoords.w) / gradient;
|
|
|
|
RayShapeIntersection voxelIntersection = getVoxelIntersection(sampleData.tileUv, sampleSizeAlongRay);
|
|
|
|
// Transform normal from shape space to Cartesian space to eye space
|
|
vec3 voxelNormal = jacobianT * voxelIntersection.entry.xyz;
|
|
voxelNormal = normalize(czm_normal * voxelNormal);
|
|
|
|
// Compare with the shape intersection, to choose the appropriate normal
|
|
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) {
|
|
// Stop at end of shape
|
|
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) {
|
|
// tileUv = 1.0 is a valid coordinate but sampleIndex = u_inputDimensions is not.
|
|
// (tileUv = 1.0 corresponds to the far edge of the last sample, at index = u_inputDimensions - 1).
|
|
// Clamp to [0, voxelDimensions - 0.5) to avoid numerical error before flooring
|
|
vec3 maxCoordinate = vec3(u_inputDimensions) - vec3(0.5);
|
|
vec3 inputCoordinate = clamp(sampleData.inputCoordinate, vec3(0.0), maxCoordinate);
|
|
ivec3 sampleIndex = ivec3(floor(inputCoordinate));
|
|
// Convert to a 1D index for lookup in a 1D data array
|
|
return sampleIndex.x + u_inputDimensions.x * (sampleIndex.y + u_inputDimensions.y * sampleIndex.z);
|
|
}
|
|
|
|
/**
|
|
* Compute the view ray at the current fragment, in the local coordinates of the shape.
|
|
*/
|
|
Ray getViewRayLocal() {
|
|
vec4 eyeCoordinates = czm_windowToEyeCoordinates(gl_FragCoord);
|
|
vec3 origin;
|
|
vec3 direction;
|
|
if (czm_orthographicIn3D == 1.0) {
|
|
eyeCoordinates.z = 0.0;
|
|
origin = (u_transformPositionViewToLocal * eyeCoordinates).xyz;
|
|
direction = u_cameraDirectionLocal;
|
|
} else {
|
|
origin = u_cameraPositionLocal;
|
|
direction = u_transformDirectionViewToLocal * normalize(eyeCoordinates.xyz);
|
|
}
|
|
return Ray(origin, direction);
|
|
}
|
|
|
|
Ray getViewRayEC() {
|
|
vec4 eyeCoordinates = czm_windowToEyeCoordinates(gl_FragCoord);
|
|
vec3 viewPosEC = (czm_orthographicIn3D == 1.0)
|
|
? vec3(eyeCoordinates.xy, 0.0)
|
|
: vec3(0.0);
|
|
vec3 viewDirEC = normalize(eyeCoordinates.xyz);
|
|
return Ray(viewPosEC, viewDirEC);
|
|
}
|
|
|
|
void main()
|
|
{
|
|
Ray viewRayLocal = getViewRayLocal();
|
|
Ray viewRayEC = getViewRayEC();
|
|
|
|
Intersections ix;
|
|
vec2 screenCoord = (gl_FragCoord.xy - czm_viewport.xy) / czm_viewport.zw; // [0,1]
|
|
RayShapeIntersection shapeIntersection = intersectScene(screenCoord, viewRayLocal, viewRayEC, ix);
|
|
// Exit early if the scene was completely missed.
|
|
if (shapeIntersection.entry.w == NO_HIT) {
|
|
discard;
|
|
}
|
|
|
|
float currentT = shapeIntersection.entry.w;
|
|
float endT = shapeIntersection.exit.w;
|
|
|
|
vec3 positionEC = viewRayEC.pos + currentT * viewRayEC.dir;
|
|
TileAndUvCoordinate tileAndUv = getTileAndUvCoordinate(positionEC);
|
|
vec3 positionLocal = viewRayLocal.pos + currentT * viewRayLocal.dir;
|
|
mat3 jacobianT = convertLocalToShapeSpaceDerivative(positionLocal);
|
|
|
|
// Traverse the tree from the start position
|
|
TraversalData traversalData;
|
|
SampleData sampleDatas[SAMPLE_COUNT];
|
|
traverseOctreeFromBeginning(tileAndUv, traversalData, sampleDatas);
|
|
vec4 step = getStepSize(sampleDatas[0], viewRayLocal, shapeIntersection, jacobianT, currentT);
|
|
|
|
FragmentInput fragmentInput;
|
|
#if defined(STATISTICS)
|
|
setStatistics(fragmentInput.metadataStatistics);
|
|
#endif
|
|
|
|
czm_modelMaterial materialOutput;
|
|
vec4 colorAccum = vec4(0.0);
|
|
|
|
for (int stepCount = 0; stepCount < STEP_COUNT_MAX; ++stepCount) {
|
|
// Read properties from the megatexture based on the traversal state
|
|
Properties properties = accumulatePropertiesFromMegatexture(sampleDatas);
|
|
|
|
// Prepare the custom shader inputs
|
|
copyPropertiesToMetadata(properties, fragmentInput.metadata);
|
|
|
|
fragmentInput.attributes.positionEC = positionEC;
|
|
// Re-normalize normals: some shape intersections may have been scaled to encode positive/negative shapes
|
|
fragmentInput.attributes.normalEC = normalize(step.xyz);
|
|
|
|
fragmentInput.voxel.viewDirUv = viewRayLocal.dir;
|
|
|
|
fragmentInput.voxel.travelDistance = step.w;
|
|
fragmentInput.voxel.stepCount = stepCount;
|
|
fragmentInput.voxel.tileIndex = sampleDatas[0].megatextureIndex;
|
|
fragmentInput.voxel.sampleIndex = getSampleIndex(sampleDatas[0]);
|
|
fragmentInput.voxel.distanceToDepthBuffer = ix.distanceToDepthBuffer - currentT;
|
|
|
|
// Run the custom shader
|
|
fragmentMain(fragmentInput, materialOutput);
|
|
|
|
// Sanitize the custom shader output
|
|
vec4 color = vec4(materialOutput.diffuse, materialOutput.alpha);
|
|
color.rgb = max(color.rgb, vec3(0.0));
|
|
color.a = clamp(color.a, 0.0, 1.0);
|
|
|
|
// Pre-multiplied alpha blend
|
|
colorAccum += (1.0 - colorAccum.a) * vec4(color.rgb * color.a, color.a);
|
|
|
|
// Stop traversing if the alpha has been fully saturated
|
|
if (colorAccum.a > ALPHA_ACCUM_MAX) {
|
|
colorAccum.a = ALPHA_ACCUM_MAX;
|
|
break;
|
|
}
|
|
|
|
if (step.w == 0.0) {
|
|
// Shape is infinitely thin. The ray may have hit the edge of a
|
|
// foreground voxel. Step ahead slightly to check for more voxels
|
|
step.w = 0.001;
|
|
}
|
|
|
|
// Keep raymarching
|
|
currentT += step.w;
|
|
// Check if there's more intersections.
|
|
if (currentT > endT) {
|
|
#if (INTERSECTION_COUNT == 1)
|
|
break;
|
|
#else
|
|
shapeIntersection = nextIntersection(ix);
|
|
if (shapeIntersection.entry.w == NO_HIT) {
|
|
break;
|
|
} else {
|
|
// Found another intersection. Resume raymarching there
|
|
currentT = shapeIntersection.entry.w;
|
|
endT = shapeIntersection.exit.w;
|
|
}
|
|
#endif
|
|
}
|
|
positionEC = viewRayEC.pos + currentT * viewRayEC.dir;
|
|
tileAndUv = getTileAndUvCoordinate(positionEC);
|
|
positionLocal = viewRayLocal.pos + currentT * viewRayLocal.dir;
|
|
jacobianT = convertLocalToShapeSpaceDerivative(positionLocal);
|
|
|
|
// Traverse the tree from the current ray position.
|
|
// This is similar to traverseOctreeFromBeginning but is faster when the ray is in the same tile as the previous step.
|
|
traverseOctreeFromExisting(tileAndUv, traversalData, sampleDatas);
|
|
step = getStepSize(sampleDatas[0], viewRayLocal, shapeIntersection, jacobianT, currentT);
|
|
}
|
|
|
|
// Convert the alpha from [0,ALPHA_ACCUM_MAX] to [0,1]
|
|
colorAccum.a /= ALPHA_ACCUM_MAX;
|
|
|
|
#if defined(PICKING)
|
|
// If alpha is 0.0 there is nothing to pick
|
|
if (colorAccum.a == 0.0) {
|
|
discard;
|
|
}
|
|
out_FragColor = u_pickColor;
|
|
#elif defined(PICKING_VOXEL)
|
|
// If alpha is 0.0 there is nothing to pick
|
|
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 Y6=`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 X6=`/* Intersection defines
|
|
#define INTERSECTION_COUNT ###
|
|
*/
|
|
|
|
#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 {
|
|
// Don't access these member variables directly - call the functions instead.
|
|
|
|
// Store an array of ray-surface intersections. Each intersection is composed of:
|
|
// .xyz for the surface normal at the intersection point
|
|
// .w for the T value
|
|
// The scale of the normal encodes the shape intersection type:
|
|
// length(intersection.xyz) = 1: positive shape entry
|
|
// length(intersection.xyz) = 2: positive shape exit
|
|
// length(intersection.xyz) = 3: negative shape entry
|
|
// length(intersection.xyz) = 4: negative shape exit
|
|
// INTERSECTION_COUNT is the number of ray-*shape* (volume) intersections,
|
|
// so we need twice as many to track ray-*surface* intersections
|
|
vec4 intersections[INTERSECTION_COUNT * 2];
|
|
float distanceToDepthBuffer;
|
|
|
|
#if (INTERSECTION_COUNT > 1)
|
|
// Maintain state for future nextIntersection calls
|
|
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);
|
|
}
|
|
|
|
// Use defines instead of real functions because WebGL1 cannot access array with non-constant index.
|
|
#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) {
|
|
// Sort the intersections from min T to max T with bubble sort.
|
|
// Note: If this sorting function changes, some of the intersection test may
|
|
// need to be updated. Search for "bubble sort" to find those areas.
|
|
const int sortPasses = INTERSECTION_COUNT * 2 - 1;
|
|
for (int n = sortPasses; n > 0; --n) {
|
|
for (int i = 0; i < sortPasses; ++i) {
|
|
// The loop should be: for (i = 0; i < n; ++i) {...} but WebGL1 cannot
|
|
// loop with non-constant condition, so it has to break early instead
|
|
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;
|
|
}
|
|
}
|
|
|
|
// Prepare initial state for nextIntersection
|
|
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) {
|
|
// The loop should be: for (i = ix.index; i < passCount; ++i) {...} but WebGL1 cannot
|
|
// loop with non-constant condition, so it has to continue instead.
|
|
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 = intersectionType % 2 == 0;
|
|
|
|
ix.surroundCount += enter ? +1 : -1;
|
|
ix.surroundIsPositive = currShapeIsPositive ? enter : ix.surroundIsPositive;
|
|
|
|
// entering positive or exiting negative
|
|
if (ix.surroundCount == 1 && ix.surroundIsPositive && enter == currShapeIsPositive) {
|
|
shapeIntersection.entry = surfaceIntersection;
|
|
}
|
|
|
|
// exiting positive or entering negative after being inside positive
|
|
bool exitPositive = !enter && currShapeIsPositive && ix.surroundCount == 0;
|
|
bool enterNegativeFromPositive = enter && !currShapeIsPositive && ix.surroundCount == 2 && ix.surroundIsPositive;
|
|
if (exitPositive || enterNegativeFromPositive) {
|
|
shapeIntersection.exit = surfaceIntersection;
|
|
|
|
// entry and exit have been found, so the loop can stop
|
|
if (exitPositive) {
|
|
// After exiting positive shape there is nothing left to intersect, so jump to the end index.
|
|
ix.index = passCount;
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
|
|
return shapeIntersection;
|
|
}
|
|
#endif
|
|
|
|
// NOTE: initializeIntersections, nextIntersection aren't even declared unless INTERSECTION_COUNT > 1
|
|
`;var K6=`// See IntersectionUtils.glsl for the definitions of Ray, Intersections,
|
|
// setIntersectionPair, INF_HIT, NO_HIT
|
|
|
|
/* intersectDepth defines (set in Scene/VoxelRenderResources.js)
|
|
#define DEPTH_INTERSECTION_INDEX ###
|
|
*/
|
|
|
|
void intersectDepth(in vec2 screenCoord, in Ray ray, inout Intersections ix) {
|
|
float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, screenCoord));
|
|
float entry;
|
|
float exit;
|
|
if (logDepthOrDepth != 0.0) {
|
|
// Calculate how far the ray must travel before it hits the depth buffer.
|
|
vec4 eyeCoordinateDepth = czm_screenToEyeCoordinates(screenCoord, logDepthOrDepth);
|
|
eyeCoordinateDepth /= eyeCoordinateDepth.w;
|
|
entry = dot(eyeCoordinateDepth.xyz - ray.pos, ray.dir);
|
|
exit = +INF_HIT;
|
|
} else {
|
|
// There's no depth at this location.
|
|
entry = NO_HIT;
|
|
exit = NO_HIT;
|
|
}
|
|
ix.distanceToDepthBuffer = entry;
|
|
#if defined(DEPTH_TEST)
|
|
setIntersectionPair(ix, DEPTH_INTERSECTION_INDEX, vec2(entry, exit));
|
|
#endif
|
|
}
|
|
`;var $6=`// See IntersectionUtils.glsl for the definitions of Ray, Intersections, INF_HIT,
|
|
// NO_HIT, setShapeIntersection
|
|
|
|
/* Clipping plane defines (set in Scene/VoxelRenderResources.js)
|
|
#define CLIPPING_PLANES_UNION
|
|
#define CLIPPING_PLANES_COUNT
|
|
#define CLIPPING_PLANES_INTERSECTION_INDEX
|
|
*/
|
|
|
|
uniform sampler2D u_clippingPlanesTexture;
|
|
uniform mat4 u_clippingPlanesMatrix;
|
|
|
|
// Plane is in Hessian Normal Form
|
|
vec4 intersectPlane(in Ray ray, in vec4 plane) {
|
|
vec3 n = plane.xyz; // normal
|
|
float w = plane.w; // -dot(pointOnPlane, normal)
|
|
|
|
float a = dot(ray.pos, n);
|
|
float b = dot(ray.dir, n);
|
|
float t = -(w + a) / b;
|
|
|
|
return vec4(n, t);
|
|
}
|
|
|
|
#ifdef CLIPPING_PLANES
|
|
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)
|
|
// Union and intersection are the same when there's one clipping plane, and the code
|
|
// is more simplified.
|
|
vec4 planeUv = getClippingPlane(u_clippingPlanesTexture, 0);
|
|
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);
|
|
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);
|
|
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
|
|
}
|
|
#endif
|
|
`;var oR=`// See IntersectionUtils.glsl for the definitions of Ray, NO_HIT, INF_HIT,
|
|
// RayShapeIntersection
|
|
|
|
vec4 transformNormalToEC(in vec4 intersection) {
|
|
return vec4(normalize(czm_normal * intersection.xyz), intersection.w);
|
|
}
|
|
|
|
RayShapeIntersection transformNormalsToEC(in RayShapeIntersection ix) {
|
|
return RayShapeIntersection(transformNormalToEC(ix.entry), transformNormalToEC(ix.exit));
|
|
}
|
|
|
|
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] = transformNormalsToEC(intersectHalfSpace(ray, minMaxAngle.x, false));
|
|
intersections[1] = transformNormalsToEC(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);
|
|
bool hitPositiveSide = hitPositiveHalfPlane(ray, intersection, true);
|
|
|
|
farSide = transformNormalToEC(farSide);
|
|
|
|
if (hitPositiveSide) {
|
|
intersection = transformNormalToEC(intersection);
|
|
intersections[0].entry = -1.0 * farSide;
|
|
intersections[0].exit = vec4(-1.0 * intersection.xyz, intersection.w);
|
|
intersections[1].entry = intersection;
|
|
intersections[1].exit = farSide;
|
|
} else {
|
|
vec4 miss = vec4(normalize(czm_normal * 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)
|
|
{
|
|
// Note: works for maxAngle > minAngle + pi, where the "regular wedge"
|
|
// is actually a negative volume.
|
|
// Compute intersections with the two planes.
|
|
// Normals will point toward the "outside" (negative space)
|
|
vec4 intersect1 = intersectLongitude(ray, minMaxAngle.x, false);
|
|
vec4 intersect2 = intersectLongitude(ray, minMaxAngle.y, true);
|
|
|
|
// Choose intersection with smallest T as the "first", the other as "last"
|
|
// Note: first or last could be in the "shadow" wedge, beyond the tip
|
|
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) {
|
|
// Ray crosses both faces of negative wedge, exiting then entering the positive shape
|
|
return transformNormalsToEC(RayShapeIntersection(first, last));
|
|
} else if (!exitFromInside && enterFromOutside) {
|
|
// Ray starts inside wedge. last is in shadow wedge, and first is actually the entry
|
|
return transformNormalsToEC(RayShapeIntersection(-1.0 * farSide, first));
|
|
} else if (exitFromInside && !enterFromOutside) {
|
|
// First intersection was in the shadow wedge, so last is actually the exit
|
|
return transformNormalsToEC(RayShapeIntersection(last, farSide));
|
|
} else { // !exitFromInside && !enterFromOutside
|
|
// Both intersections were in the shadow wedge
|
|
return transformNormalsToEC(RayShapeIntersection(miss, miss));
|
|
}
|
|
}
|
|
`;var J6=`// See IntersectionUtils.glsl for the definitions of Ray, RayShapeIntersection,
|
|
// NO_HIT, Intersections
|
|
|
|
/* Box defines (set in Scene/VoxelBoxShape.js)
|
|
#define BOX_INTERSECTION_INDEX ### // always 0
|
|
*/
|
|
|
|
uniform sampler2D u_renderBoundPlanesTexture;
|
|
|
|
RayShapeIntersection intersectBoundPlanes(in Ray ray) {
|
|
vec4 lastEntry = vec4(ray.dir, -INF_HIT);
|
|
vec4 firstExit = vec4(-ray.dir, +INF_HIT);
|
|
for (int i = 0; i < 6; i++) {
|
|
vec4 boundPlane = getBoundPlane(u_renderBoundPlanesTexture, i);
|
|
vec4 intersection = intersectPlane(ray, boundPlane);
|
|
if (dot(ray.dir, boundPlane.xyz) < 0.0) {
|
|
lastEntry = intersection.w > lastEntry.w ? intersection : lastEntry;
|
|
} else {
|
|
firstExit = intersection.w < firstExit.w ? intersection: firstExit;
|
|
}
|
|
}
|
|
|
|
if (lastEntry.w < firstExit.w) {
|
|
return RayShapeIntersection(lastEntry, firstExit);
|
|
} else {
|
|
return RayShapeIntersection(vec4(-ray.dir, NO_HIT), vec4(ray.dir, NO_HIT));
|
|
}
|
|
}
|
|
|
|
void intersectShape(in Ray rayUV, in Ray rayEC, inout Intersections ix)
|
|
{
|
|
RayShapeIntersection intersection = intersectBoundPlanes(rayEC);
|
|
setShapeIntersection(ix, BOX_INTERSECTION_INDEX, intersection);
|
|
}
|
|
`;var Z6=`// See IntersectionUtils.glsl for the definitions of Ray, NO_HIT, Intersections,
|
|
// RayShapeIntersection, setSurfaceIntersection, setShapeIntersection,
|
|
// intersectIntersections
|
|
// See IntersectLongitude.glsl for the definitions of intersectHalfPlane,
|
|
// intersectFlippedWedge, intersectRegularWedge
|
|
|
|
/* Cylinder defines (set in Scene/VoxelCylinderShape.js)
|
|
#define CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN
|
|
#define CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT
|
|
#define CYLINDER_HAS_RENDER_BOUNDS_ANGLE
|
|
#define CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF
|
|
#define CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF
|
|
#define CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO
|
|
|
|
#define CYLINDER_INTERSECTION_INDEX_RADIUS_MAX
|
|
#define CYLINDER_INTERSECTION_INDEX_RADIUS_MIN
|
|
#define CYLINDER_INTERSECTION_INDEX_ANGLE
|
|
*/
|
|
|
|
// Cylinder uniforms
|
|
uniform vec2 u_cylinderRenderRadiusMinMax;
|
|
#if defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE)
|
|
uniform vec2 u_cylinderRenderAngleMinMax;
|
|
#endif
|
|
|
|
uniform sampler2D u_renderBoundPlanesTexture;
|
|
|
|
RayShapeIntersection intersectBoundPlanes(in Ray ray) {
|
|
vec4 lastEntry = vec4(ray.dir, -INF_HIT);
|
|
vec4 firstExit = vec4(-ray.dir, +INF_HIT);
|
|
for (int i = 0; i < 2; i++) {
|
|
vec4 boundPlane = getBoundPlane(u_renderBoundPlanesTexture, i);
|
|
vec4 intersection = intersectPlane(ray, boundPlane);
|
|
if (dot(ray.dir, boundPlane.xyz) < 0.0) {
|
|
lastEntry = intersection.w > lastEntry.w ? intersection : lastEntry;
|
|
} else {
|
|
firstExit = intersection.w < firstExit.w ? intersection: firstExit;
|
|
}
|
|
}
|
|
|
|
if (lastEntry.w < firstExit.w) {
|
|
return RayShapeIntersection(lastEntry, firstExit);
|
|
} else {
|
|
return RayShapeIntersection(vec4(-ray.dir, NO_HIT), vec4(ray.dir, NO_HIT));
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Find the intersection of a ray with a right cylindrical surface of a given radius
|
|
* about the z-axis.
|
|
*/
|
|
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;
|
|
vec3 normal1 = vec3((position + t1 * direction) * signFlip, 0.0);
|
|
vec3 normal2 = vec3((position + t2 * direction) * signFlip, 0.0);
|
|
// Return normals in eye coordinates
|
|
vec4 intersect1 = vec4(normalize(czm_normal * normal1), t1);
|
|
vec4 intersect2 = vec4(normalize(czm_normal * normal2), t2);
|
|
|
|
return RayShapeIntersection(intersect1, intersect2);
|
|
}
|
|
|
|
/**
|
|
* Find the intersection of a ray with a right cylindrical solid of given
|
|
* radius and height bounds. NOTE: The shape is assumed to be convex.
|
|
*/
|
|
RayShapeIntersection intersectBoundedCylinder(in Ray ray, in Ray rayEC, in float radius)
|
|
{
|
|
RayShapeIntersection cylinderIntersection = intersectCylinder(ray, radius, true);
|
|
RayShapeIntersection heightBoundsIntersection = intersectBoundPlanes(rayEC);
|
|
return intersectIntersections(ray, cylinderIntersection, heightBoundsIntersection);
|
|
}
|
|
|
|
void intersectShape(in Ray ray, in Ray rayEC, inout Intersections ix)
|
|
{
|
|
RayShapeIntersection outerIntersect = intersectBoundedCylinder(ray, rayEC, u_cylinderRenderRadiusMinMax.y);
|
|
|
|
setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_RADIUS_MAX, outerIntersect);
|
|
|
|
if (outerIntersect.entry.w == NO_HIT) {
|
|
return;
|
|
}
|
|
|
|
#if defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT)
|
|
// When the cylinder is perfectly thin it's necessary to sandwich the
|
|
// inner cylinder intersection inside the outer cylinder intersection.
|
|
|
|
// Without this special case,
|
|
// [outerMin, outerMax, innerMin, innerMax] will bubble sort to
|
|
// [outerMin, innerMin, outerMax, innerMax] which will cause the back
|
|
// side of the cylinder to be invisible because it will think the ray
|
|
// is still inside the inner (negative) cylinder after exiting the
|
|
// outer (positive) cylinder.
|
|
|
|
// With this special case,
|
|
// [outerMin, innerMin, innerMax, outerMax] will bubble sort to
|
|
// [outerMin, innerMin, innerMax, outerMax] which will work correctly.
|
|
|
|
// Note: If initializeIntersections() changes its sorting function
|
|
// from bubble sort to something else, this code may need to change.
|
|
RayShapeIntersection innerIntersect = intersectCylinder(ray, 1.0, false);
|
|
setSurfaceIntersection(ix, 0, outerIntersect.entry, true, true); // positive, enter
|
|
setSurfaceIntersection(ix, 1, innerIntersect.entry, false, true); // negative, enter
|
|
setSurfaceIntersection(ix, 2, innerIntersect.exit, false, false); // negative, exit
|
|
setSurfaceIntersection(ix, 3, outerIntersect.exit, true, false); // positive, exit
|
|
#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 Q6=`// See IntersectionUtils.glsl for the definitions of Ray, NO_HIT, INF_HIT, Intersections,
|
|
// RayShapeIntersection, setSurfaceIntersection, setShapeIntersection
|
|
// See IntersectLongitude.glsl for the definitions of intersectHalfPlane,
|
|
// intersectFlippedWedge, intersectRegularWedge
|
|
|
|
/* Ellipsoid defines (set in Scene/VoxelEllipsoidShape.js)
|
|
#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE
|
|
#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO
|
|
#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF
|
|
#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF
|
|
#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF
|
|
#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF
|
|
#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF
|
|
#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF
|
|
#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF
|
|
#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF
|
|
#define ELLIPSOID_INTERSECTION_INDEX_LONGITUDE
|
|
#define ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX
|
|
#define ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN
|
|
#define ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX
|
|
#define ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN
|
|
*/
|
|
|
|
#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE)
|
|
uniform vec2 u_ellipsoidRenderLongitudeMinMax;
|
|
#endif
|
|
uniform float u_eccentricitySquared;
|
|
uniform vec2 u_ellipsoidRenderLatitudeSinMinMax;
|
|
uniform vec2 u_clipMinMaxHeight; // Values are negative: clipHeight - maxShapeHeight
|
|
|
|
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 height, in bool convex)
|
|
{
|
|
// Scale the ray by the ellipsoid axes to make it a unit sphere
|
|
// Note: approximating ellipsoid + height as an ellipsoid
|
|
vec3 radiiCorrection = vec3(1.0) / (u_ellipsoidRadii + height);
|
|
vec3 position = ray.pos * radiiCorrection;
|
|
vec3 direction = ray.dir * radiiCorrection;
|
|
|
|
float a = dot(direction, direction); // ~ 1.0 (or maybe 4.0 if ray is scaled)
|
|
float b = dot(direction, position); // roughly inside [-1.0, 1.0] when zoomed in
|
|
float c = dot(position, position) - 1.0; // ~ 0.0 when zoomed in.
|
|
float determinant = b * b - a * c; // ~ b * b when zoomed in
|
|
|
|
if (determinant < 0.0) {
|
|
vec4 miss = vec4(normalize(direction), NO_HIT);
|
|
return RayShapeIntersection(miss, miss);
|
|
}
|
|
|
|
determinant = sqrt(determinant);
|
|
|
|
// Compute larger root using standard formula
|
|
float signB = b < 0.0 ? -1.0 : 1.0;
|
|
// The other root may suffer from subtractive cancellation in the standard formula.
|
|
// Compute it from the first root instead.
|
|
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 * (position + tmin * direction);
|
|
vec3 d2 = directionScale * (position + tmax * direction);
|
|
|
|
// Return normals in eye coordinates. Use spherical approximation for the normal.
|
|
vec3 normal1 = normalize(czm_normal * d1);
|
|
vec3 normal2 = normalize(czm_normal * d2);
|
|
|
|
return RayShapeIntersection(vec4(normal1, tmin), vec4(normal2, tmax));
|
|
}
|
|
|
|
/**
|
|
* Given a circular cone around the z-axis, with apex at the origin,
|
|
* find the parametric distance(s) along a ray where that ray intersects
|
|
* the cone.
|
|
* The cone opening angle is described by the squared cosine of
|
|
* its half-angle (the angle between the Z-axis and the surface)
|
|
*/
|
|
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;
|
|
// determinant = b * b - a * c. But bSin * bSin = aSin * cSin.
|
|
// Avoid subtractive cancellation by expanding to eliminate these terms
|
|
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) {
|
|
// Ray is parallel to cone surface
|
|
return (b == 0.0)
|
|
? vec2(NO_HIT) // Ray is on cone surface
|
|
: vec2(-0.5 * c / b, NO_HIT);
|
|
}
|
|
|
|
determinant = sqrt(determinant);
|
|
|
|
// Compute larger root using standard formula
|
|
float signB = b < 0.0 ? -1.0 : 1.0;
|
|
float t1 = (-b - signB * determinant) / a;
|
|
// The other root may suffer from subtractive cancellation in the standard formula.
|
|
// Compute it from the first root instead.
|
|
float t2 = c / (a * t1);
|
|
float tmin = min(t1, t2);
|
|
float tmax = max(t1, t2);
|
|
return vec2(tmin, tmax);
|
|
}
|
|
|
|
/**
|
|
* Given a point on a conical surface, find the surface normal at that point.
|
|
*/
|
|
vec3 getConeNormal(in vec3 p, in bool convex) {
|
|
// Start with radial component pointing toward z-axis
|
|
vec2 radial = -abs(p.z) * normalize(p.xy);
|
|
// Z component points toward opening of cone
|
|
float zSign = (p.z < 0.0) ? -1.0 : 1.0;
|
|
float z = length(p.xy) * zSign;
|
|
// Flip normal if shape is convex
|
|
float flip = (convex) ? -1.0 : 1.0;
|
|
return normalize(vec3(radial, z) * flip);
|
|
}
|
|
|
|
/**
|
|
* Compute the shift between the ellipsoid origin and the apex of a cone of latitude
|
|
*/
|
|
float getLatitudeConeShift(in float sinLatitude) {
|
|
// Find prime vertical radius of curvature:
|
|
// the distance along the ellipsoid normal to the intersection with the z-axis
|
|
float x2 = u_eccentricitySquared * sinLatitude * sinLatitude;
|
|
float primeVerticalRadius = u_ellipsoidRadii.x * inversesqrt(1.0 - x2);
|
|
|
|
// Compute a shift from the origin to the intersection of the cone with the z-axis
|
|
return primeVerticalRadius * u_eccentricitySquared * sinLatitude;
|
|
}
|
|
|
|
void intersectFlippedCone(in Ray ray, in float cosHalfAngle, out RayShapeIntersection intersections[2]) {
|
|
// Shift the ray to account for the latitude cone not being centered at the Earth center
|
|
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);
|
|
|
|
// Initialize output with no intersections
|
|
intersections[0].entry = -1.0 * farSide;
|
|
intersections[0].exit = farSide;
|
|
intersections[1].entry = miss;
|
|
intersections[1].exit = miss;
|
|
|
|
if (intersect.x == NO_HIT) {
|
|
return;
|
|
}
|
|
|
|
// Find the points of intersection
|
|
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) {
|
|
// no valid intersections
|
|
} 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) {
|
|
// Shift the ray to account for the latitude cone not being centered at the Earth center
|
|
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);
|
|
}
|
|
|
|
// Find the points of intersection
|
|
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, in Ray rayEC, inout Intersections ix) { // Outer ellipsoid
|
|
RayShapeIntersection outerIntersect = intersectHeight(ray, u_clipMinMaxHeight.y, true);
|
|
setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX, outerIntersect);
|
|
|
|
// Exit early if the outer ellipsoid was missed.
|
|
if (outerIntersect.entry.w == NO_HIT) {
|
|
return;
|
|
}
|
|
|
|
// Inner ellipsoid
|
|
RayShapeIntersection innerIntersect = intersectHeight(ray, u_clipMinMaxHeight.x, false);
|
|
|
|
if (innerIntersect.entry.w == NO_HIT) {
|
|
setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN, innerIntersect);
|
|
} else {
|
|
// When the ellipsoid is large and thin it's possible for floating point math
|
|
// to cause the ray to intersect the inner ellipsoid before the outer ellipsoid.
|
|
// To prevent this from happening, clamp innerIntersect to outerIntersect and
|
|
// sandwich the inner ellipsoid intersection inside the outer ellipsoid intersection.
|
|
|
|
// Without this special case,
|
|
// [outerMin, outerMax, innerMin, innerMax] will bubble sort to
|
|
// [outerMin, innerMin, outerMax, innerMax] which will cause the back
|
|
// side of the ellipsoid to be invisible because it will think the ray
|
|
// is still inside the inner (negative) ellipsoid after exiting the
|
|
// outer (positive) ellipsoid.
|
|
|
|
// With this special case,
|
|
// [outerMin, innerMin, innerMax, outerMax] will bubble sort to
|
|
// [outerMin, innerMin, innerMax, outerMax] which will work correctly.
|
|
|
|
// Note: If initializeIntersections() changes its sorting function
|
|
// from bubble sort to something else, this code may need to change.
|
|
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); // positive, enter
|
|
setSurfaceIntersection(ix, 1, innerIntersect.entry, false, true); // negative, enter
|
|
setSurfaceIntersection(ix, 2, innerIntersect.exit, false, false); // negative, exit
|
|
setSurfaceIntersection(ix, 3, outerIntersect.exit, true, false); // positive, exit
|
|
}
|
|
|
|
// Bottom cone
|
|
#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
|
|
|
|
// Top cone
|
|
#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
|
|
|
|
// Wedge
|
|
#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 MS=`// Main intersection function for Voxel scenes.
|
|
// See IntersectBox.glsl, IntersectCylinder.glsl, or IntersectEllipsoid.glsl
|
|
// for the definition of intersectShape. The appropriate function is selected
|
|
// based on the VoxelPrimitive shape type, and added to the shader in
|
|
// Scene/VoxelRenderResources.js.
|
|
// See also IntersectClippingPlane.glsl and IntersectDepth.glsl.
|
|
// See IntersectionUtils.glsl for the definitions of Ray, NO_HIT,
|
|
// getFirstIntersection, initializeIntersections, nextIntersection.
|
|
|
|
/* Intersection defines (set in Scene/VoxelRenderResources.js)
|
|
#define INTERSECTION_COUNT ###
|
|
*/
|
|
|
|
RayShapeIntersection intersectScene(in vec2 screenCoord, in Ray ray, in Ray rayEC, out Intersections ix) {
|
|
// Do a ray-shape intersection to find the exact starting and ending points.
|
|
intersectShape(ray, rayEC, ix);
|
|
|
|
// Exit early if the positive shape was completely missed or behind the ray.
|
|
RayShapeIntersection intersection = getFirstIntersection(ix);
|
|
if (intersection.entry.w == NO_HIT) {
|
|
// Positive shape was completely missed - so exit early.
|
|
return intersection;
|
|
}
|
|
|
|
// Clipping planes
|
|
#if defined(CLIPPING_PLANES)
|
|
intersectClippingPlanes(ray, ix);
|
|
#endif
|
|
|
|
// Depth
|
|
intersectDepth(screenCoord, rayEC, ix);
|
|
|
|
// Find the first intersection that's in front of the ray
|
|
#if (INTERSECTION_COUNT > 1)
|
|
initializeIntersections(ix);
|
|
for (int i = 0; i < INTERSECTION_COUNT; ++i) {
|
|
intersection = nextIntersection(ix);
|
|
if (intersection.exit.w > 0.0) {
|
|
// Set start to 0.0 when ray is inside the shape.
|
|
intersection.entry.w = max(intersection.entry.w, 0.0);
|
|
break;
|
|
}
|
|
}
|
|
#else
|
|
// Set start to 0.0 when ray is inside the shape.
|
|
intersection.entry.w = max(intersection.entry.w, 0.0);
|
|
#endif
|
|
|
|
return intersection;
|
|
}
|
|
`;var eH=`uniform vec3 u_boxLocalToShapeUvScale;
|
|
|
|
uniform ivec4 u_cameraTileCoordinates;
|
|
uniform vec3 u_cameraTileUv;
|
|
uniform mat3 u_boxEcToXyz;
|
|
|
|
mat3 convertLocalToShapeSpaceDerivative(in vec3 positionLocal) {
|
|
// For BOX, local space = shape space, so the Jacobian is the identity matrix.
|
|
return mat3(1.0);
|
|
}
|
|
|
|
vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) {
|
|
return shapeUv / u_boxLocalToShapeUvScale;
|
|
}
|
|
|
|
vec3 convertEcToDeltaTile(in vec3 positionEC) {
|
|
vec3 dPosition = u_boxEcToXyz * positionEC;
|
|
return u_boxLocalToShapeUvScale * dPosition * float(1 << u_cameraTileCoordinates.w);
|
|
}
|
|
|
|
TileAndUvCoordinate getTileAndUvCoordinate(in vec3 positionEC) {
|
|
vec3 deltaTileCoordinate = convertEcToDeltaTile(positionEC);
|
|
vec3 tileUvSum = u_cameraTileUv + deltaTileCoordinate;
|
|
ivec3 tileCoordinate = u_cameraTileCoordinates.xyz + ivec3(floor(tileUvSum));
|
|
tileCoordinate = min(max(ivec3(0), tileCoordinate), ivec3((1 << u_cameraTileCoordinates.w) - 1));
|
|
ivec3 tileCoordinateChange = tileCoordinate - u_cameraTileCoordinates.xyz;
|
|
vec3 tileUv = clamp(tileUvSum - vec3(tileCoordinateChange), 0.0, 1.0);
|
|
return TileAndUvCoordinate(ivec4(tileCoordinate, u_cameraTileCoordinates.w), tileUv);
|
|
}
|
|
`;var tH=`uniform vec3 u_cylinderLocalToShapeUvScale; // x = radius scale, y = angle scale, z = height scale
|
|
uniform float u_cylinderShapeUvAngleRangeOrigin;
|
|
uniform mat3 u_cylinderEcToRadialTangentUp;
|
|
uniform ivec4 u_cameraTileCoordinates;
|
|
uniform vec3 u_cameraTileUv;
|
|
uniform vec3 u_cameraShapePosition; // (radial distance, angle, height) of camera in shape space
|
|
|
|
mat3 convertLocalToShapeSpaceDerivative(in vec3 position) {
|
|
vec3 radial = normalize(vec3(position.xy, 0.0));
|
|
vec3 z = vec3(0.0, 0.0, 1.0);
|
|
vec3 east = normalize(vec3(-position.y, position.x, 0.0));
|
|
return mat3(radial, east / length(position.xy), z);
|
|
}
|
|
|
|
vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) {
|
|
float radius = shapeUv.x / u_cylinderLocalToShapeUvScale.x;
|
|
float angle = shapeUv.y * czm_twoPi / u_cylinderLocalToShapeUvScale.y;
|
|
float height = shapeUv.z / u_cylinderLocalToShapeUvScale.z;
|
|
|
|
return vec3(radius, angle, height);
|
|
}
|
|
|
|
/**
|
|
* Computes the change in polar coordinates given a change in position.
|
|
* @param {vec2} dPosition The change in position in Cartesian coordinates.
|
|
* @param {float} cameraRadialDistance The radial distance of the camera from the origin.
|
|
* @return {vec2} The change in polar coordinates (radial distance, angle).
|
|
*/
|
|
vec2 computePolarChange(in vec2 dPosition, in float cameraRadialDistance) {
|
|
float dAngle = atan(dPosition.y, cameraRadialDistance + dPosition.x);
|
|
// Find the direction of the radial axis at the output angle, in Cartesian coordinates
|
|
vec2 outputRadialAxis = vec2(cos(dAngle), sin(dAngle));
|
|
float sinHalfAngle = sin(dAngle / 2.0);
|
|
float versine = 2.0 * sinHalfAngle * sinHalfAngle;
|
|
float dRadial = dot(dPosition, outputRadialAxis) - cameraRadialDistance * versine;
|
|
return vec2(dRadial, dAngle);
|
|
}
|
|
|
|
vec3 convertEcToDeltaShape(in vec3 positionEC) {
|
|
// 1. Rotate to radial, tangent, and up coordinates
|
|
vec3 rtu = u_cylinderEcToRadialTangentUp * positionEC;
|
|
// 2. Compute change in angular and radial coordinates.
|
|
vec2 dPolar = computePolarChange(rtu.xy, u_cameraShapePosition.x);
|
|
return vec3(dPolar.xy, rtu.z);
|
|
}
|
|
|
|
vec3 convertEcToDeltaTile(in vec3 positionEC) {
|
|
vec3 deltaShape = convertEcToDeltaShape(positionEC);
|
|
// Convert to tileset coordinates in [0, 1]
|
|
float dx = u_cylinderLocalToShapeUvScale.x * deltaShape.x;
|
|
float dy = deltaShape.y / czm_twoPi;
|
|
#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE)
|
|
// Wrap to ensure dy is not crossing through the unoccupied angle range, where
|
|
// angle to tile coordinate conversions would be more complicated
|
|
float cameraUvAngle = (u_cameraShapePosition.y + czm_pi) / czm_twoPi;
|
|
float cameraUvAngleShift = fract(cameraUvAngle - u_cylinderShapeUvAngleRangeOrigin);
|
|
float rawOutputUvAngle = cameraUvAngleShift + dy;
|
|
float rotation = floor(rawOutputUvAngle);
|
|
dy -= rotation;
|
|
#endif
|
|
dy *= u_cylinderLocalToShapeUvScale.y;
|
|
float dz = u_cylinderLocalToShapeUvScale.z * deltaShape.z;
|
|
// Convert to tile coordinate changes
|
|
return vec3(dx, dy, dz) * float(1 << u_cameraTileCoordinates.w);
|
|
}
|
|
|
|
TileAndUvCoordinate getTileAndUvCoordinate(in vec3 positionEC) {
|
|
vec3 deltaTileCoordinate = convertEcToDeltaTile(positionEC);
|
|
vec3 tileUvSum = u_cameraTileUv + deltaTileCoordinate;
|
|
ivec3 tileCoordinate = u_cameraTileCoordinates.xyz + ivec3(floor(tileUvSum));
|
|
int maxTileCoordinate = (1 << u_cameraTileCoordinates.w) - 1;
|
|
tileCoordinate.x = min(max(0, tileCoordinate.x), maxTileCoordinate);
|
|
tileCoordinate.z = min(max(0, tileCoordinate.z), maxTileCoordinate);
|
|
#if (!defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE))
|
|
ivec3 tileCoordinateChange = tileCoordinate - u_cameraTileCoordinates.xyz;
|
|
if (tileCoordinate.y < 0) {
|
|
tileCoordinate.y += (maxTileCoordinate + 1);
|
|
} else if (tileCoordinate.y > maxTileCoordinate) {
|
|
tileCoordinate.y -= (maxTileCoordinate + 1);
|
|
}
|
|
#else
|
|
tileCoordinate.y = min(max(0, tileCoordinate.y), maxTileCoordinate);
|
|
ivec3 tileCoordinateChange = tileCoordinate - u_cameraTileCoordinates.xyz;
|
|
#endif
|
|
vec3 tileUv = tileUvSum - vec3(tileCoordinateChange);
|
|
tileUv.x = clamp(tileUv.x, 0.0, 1.0);
|
|
#if (!defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE))
|
|
// If there is only one tile spanning 2*PI angle, the coordinate wraps around
|
|
tileUv.y = (u_cameraTileCoordinates.w == 0) ? fract(tileUv.y) : clamp(tileUv.y, 0.0, 1.0);
|
|
#else
|
|
tileUv.y = clamp(tileUv.y, 0.0, 1.0);
|
|
#endif
|
|
tileUv.z = clamp(tileUv.z, 0.0, 1.0);
|
|
return TileAndUvCoordinate(ivec4(tileCoordinate, u_cameraTileCoordinates.w), tileUv);
|
|
}
|
|
`;var nH=`/* Ellipsoid defines (set in Scene/VoxelEllipsoidShape.js)
|
|
#define ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE
|
|
#define ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE
|
|
*/
|
|
|
|
uniform vec3 u_cameraPositionCartographic; // (longitude, latitude, height) in radians and meters
|
|
uniform vec2 u_ellipsoidCurvatureAtLatitude;
|
|
uniform mat3 u_ellipsoidEcToEastNorthUp;
|
|
uniform vec3 u_ellipsoidRadii;
|
|
uniform vec2 u_evoluteScale; // (radii.x ^ 2 - radii.z ^ 2) * vec2(1.0, -1.0) / radii;
|
|
uniform vec3 u_ellipsoidInverseRadiiSquared;
|
|
#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE)
|
|
uniform float u_ellipsoidShapeUvLongitudeRangeOrigin;
|
|
#endif
|
|
uniform vec3 u_ellipsoidLocalToShapeUvScale; // x = longitude scale, y = latitude scale, z = height scale
|
|
|
|
uniform ivec4 u_cameraTileCoordinates;
|
|
uniform vec3 u_cameraTileUv;
|
|
|
|
// robust iterative solution without trig functions
|
|
// https://github.com/0xfaded/ellipse_demo/issues/1
|
|
// https://stackoverflow.com/questions/22959698/distance-from-given-point-to-given-ellipse
|
|
// Extended to return radius of curvature along with the point
|
|
vec3 nearestPointAndRadiusOnEllipse(vec2 pos, vec2 radii) {
|
|
vec2 p = abs(pos);
|
|
vec2 inverseRadii = 1.0 / radii;
|
|
|
|
// We describe the ellipse parametrically: v = radii * vec2(cos(t), sin(t))
|
|
// but store the cos and sin of t in a vec2 for efficiency.
|
|
// Initial guess: t = pi/4
|
|
vec2 tTrigs = vec2(0.7071067811865476);
|
|
// Initial guess of point on ellipsoid
|
|
vec2 v = radii * tTrigs;
|
|
// Center of curvature of the ellipse at v
|
|
vec2 evolute = u_evoluteScale * tTrigs * tTrigs * tTrigs;
|
|
|
|
const int iterations = 3;
|
|
for (int i = 0; i < iterations; ++i) {
|
|
// Find the (approximate) intersection of p - evolute with the ellipsoid.
|
|
vec2 q = normalize(p - evolute) * length(v - evolute);
|
|
// Update the estimate of t.
|
|
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));
|
|
}
|
|
|
|
mat3 convertLocalToShapeSpaceDerivative(in vec3 position) {
|
|
vec3 east = normalize(vec3(-position.y, position.x, 0.0));
|
|
|
|
// Convert the 3D position to a 2D position relative to the ellipse (radii.x, radii.z)
|
|
// (assume radii.y == radii.x) and find the nearest point on the ellipse and its normal
|
|
float distanceFromZAxis = length(position.xy);
|
|
vec2 posEllipse = vec2(distanceFromZAxis, position.z);
|
|
vec3 surfacePointAndRadius = nearestPointAndRadiusOnEllipse(posEllipse, u_ellipsoidRadii.xz);
|
|
vec2 surfacePoint = surfacePointAndRadius.xy;
|
|
|
|
vec2 normal2d = normalize(surfacePoint * u_ellipsoidInverseRadiiSquared.xz);
|
|
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));
|
|
|
|
return mat3(east / distanceFromZAxis, north / (surfacePointAndRadius.z + height), up);
|
|
}
|
|
|
|
vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) {
|
|
// Convert from [0, 1] to radians [-pi, pi]
|
|
float longitude = shapeUv.x * czm_twoPi;
|
|
#if defined (ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE)
|
|
longitude /= u_ellipsoidLocalToShapeUvScale.x;
|
|
#endif
|
|
|
|
// Convert from [0, 1] to radians [-pi/2, pi/2]
|
|
float latitude = shapeUv.y * czm_pi;
|
|
#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE)
|
|
latitude /= u_ellipsoidLocalToShapeUvScale.y;
|
|
#endif
|
|
|
|
float height = shapeUv.z / u_ellipsoidLocalToShapeUvScale.z;
|
|
|
|
return vec3(longitude, latitude, height);
|
|
}
|
|
|
|
vec3 convertEcToDeltaShape(in vec3 positionEC) {
|
|
vec3 enu = u_ellipsoidEcToEastNorthUp * positionEC;
|
|
|
|
// 1. Compute the change in longitude from the camera to the ENU point
|
|
// First project the camera and ENU positions to the equatorial XY plane,
|
|
// positioning the camera on the +x axis, so that enu.x projects along the +y axis
|
|
float cosLatitude = cos(u_cameraPositionCartographic.y);
|
|
float sinLatitude = sin(u_cameraPositionCartographic.y);
|
|
float primeVerticalRadius = 1.0 / u_ellipsoidCurvatureAtLatitude.x;
|
|
vec2 cameraXY = vec2((primeVerticalRadius + u_cameraPositionCartographic.z) * cosLatitude, 0.0);
|
|
// Note precision loss in positionXY.x if length(enu) << length(cameraXY)
|
|
vec2 positionXY = cameraXY + vec2(-enu.y * sinLatitude + enu.z * cosLatitude, enu.x);
|
|
float dLongitude = atan(positionXY.y, positionXY.x);
|
|
|
|
// 2. Find the longitude component of positionXY, by rotating about Z until the y component is zero.
|
|
// Use the versine to compute the change in x directly from the change in angle:
|
|
// versine(angle) = 2 * sin^2(angle/2)
|
|
float sinHalfLongitude = sin(dLongitude / 2.0);
|
|
float dx = length(positionXY) * 2.0 * sinHalfLongitude * sinHalfLongitude;
|
|
// Rotate longitude component back to ENU North and Up, and remove from enu
|
|
enu += vec3(-enu.x, -dx * sinLatitude, dx * cosLatitude);
|
|
|
|
// 3. Compute the change in latitude from the camera to the ENU point.
|
|
// First project the camera and ENU positions to the meridional ZX plane,
|
|
// positioning the camera on the +Z axis, so that enu.y maps to the +X axis.
|
|
float meridionalRadius = 1.0 / u_ellipsoidCurvatureAtLatitude.y;
|
|
vec2 cameraZX = vec2(meridionalRadius + u_cameraPositionCartographic.z, 0.0);
|
|
vec2 positionZX = cameraZX + vec2(enu.z, enu.y);
|
|
float dLatitude = atan(positionZX.y, positionZX.x);
|
|
|
|
// 4. Compute the change in height above the ellipsoid
|
|
// Find the change in enu.z associated with rotating the point to the latitude of the camera
|
|
float sinHalfLatitude = sin(dLatitude / 2.0);
|
|
float dz = length(positionZX) * 2.0 * sinHalfLatitude * sinHalfLatitude;
|
|
// The remaining change in enu.z is the change in height above the ellipsoid
|
|
float dHeight = enu.z + dz;
|
|
|
|
return vec3(dLongitude, dLatitude, dHeight);
|
|
}
|
|
|
|
vec3 convertEcToDeltaTile(in vec3 positionEC) {
|
|
vec3 deltaShape = convertEcToDeltaShape(positionEC);
|
|
// Convert to tileset coordinates in [0, 1]
|
|
float dx = deltaShape.x / czm_twoPi;
|
|
|
|
#if (defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE))
|
|
// Wrap to ensure dx is not crossing through the unoccupied angle range, where
|
|
// angle to tile coordinate conversions would be more complicated
|
|
float cameraUvLongitude = (u_cameraPositionCartographic.x + czm_pi) / czm_twoPi;
|
|
float cameraUvLongitudeShift = fract(cameraUvLongitude - u_ellipsoidShapeUvLongitudeRangeOrigin);
|
|
float rawOutputUvLongitude = cameraUvLongitudeShift + dx;
|
|
float rotation = floor(rawOutputUvLongitude);
|
|
dx -= rotation;
|
|
dx *= u_ellipsoidLocalToShapeUvScale.x;
|
|
#endif
|
|
|
|
float dy = deltaShape.y / czm_pi;
|
|
#if (defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE))
|
|
dy *= u_ellipsoidLocalToShapeUvScale.y;
|
|
#endif
|
|
|
|
float dz = u_ellipsoidLocalToShapeUvScale.z * deltaShape.z;
|
|
// Convert to tile coordinate changes
|
|
return vec3(dx, dy, dz) * float(1 << u_cameraTileCoordinates.w);
|
|
}
|
|
|
|
TileAndUvCoordinate getTileAndUvCoordinate(in vec3 positionEC) {
|
|
vec3 deltaTileCoordinate = convertEcToDeltaTile(positionEC);
|
|
vec3 tileUvSum = u_cameraTileUv + deltaTileCoordinate;
|
|
ivec3 tileCoordinate = u_cameraTileCoordinates.xyz + ivec3(floor(tileUvSum));
|
|
int maxTileCoordinate = (1 << u_cameraTileCoordinates.w) - 1;
|
|
tileCoordinate.y = min(max(0, tileCoordinate.y), maxTileCoordinate);
|
|
tileCoordinate.z = min(max(0, tileCoordinate.z), maxTileCoordinate);
|
|
#if (!defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE))
|
|
ivec3 tileCoordinateChange = tileCoordinate - u_cameraTileCoordinates.xyz;
|
|
if (tileCoordinate.x < 0) {
|
|
tileCoordinate.x += (maxTileCoordinate + 1);
|
|
} else if (tileCoordinate.x > maxTileCoordinate) {
|
|
tileCoordinate.x -= (maxTileCoordinate + 1);
|
|
}
|
|
#else
|
|
tileCoordinate.x = min(max(0, tileCoordinate.x), maxTileCoordinate);
|
|
ivec3 tileCoordinateChange = tileCoordinate - u_cameraTileCoordinates.xyz;
|
|
#endif
|
|
vec3 tileUv = tileUvSum - vec3(tileCoordinateChange);
|
|
#if (!defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE))
|
|
// If there is only one tile spanning 2*PI angle, the coordinate wraps around
|
|
tileUv.x = (u_cameraTileCoordinates.w == 0) ? fract(tileUv.x) : clamp(tileUv.x, 0.0, 1.0);
|
|
#else
|
|
tileUv.x = clamp(tileUv.x, 0.0, 1.0);
|
|
#endif
|
|
tileUv.y = clamp(tileUv.y, 0.0, 1.0);
|
|
tileUv.z = clamp(tileUv.z, 0.0, 1.0);
|
|
return TileAndUvCoordinate(ivec4(tileCoordinate, u_cameraTileCoordinates.w), tileUv);
|
|
}
|
|
`;var iH=`// These octree flags must be in sync with GpuOctreeFlag in VoxelTraversal.js
|
|
#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; // does not include padding, and is in the z-up orientation
|
|
uniform ivec3 u_inputDimensions; // includes padding, and is in the orientation of the input data
|
|
#if defined(PADDING)
|
|
uniform ivec3 u_paddingBefore;
|
|
#endif
|
|
|
|
struct OctreeNodeData {
|
|
int data;
|
|
int flag;
|
|
};
|
|
|
|
struct TraversalData {
|
|
ivec4 octreeCoords;
|
|
int parentOctreeIndex;
|
|
};
|
|
|
|
struct TileAndUvCoordinate {
|
|
ivec4 tileCoords;
|
|
vec3 tileUv;
|
|
};
|
|
|
|
struct SampleData {
|
|
int megatextureIndex;
|
|
ivec4 tileCoords;
|
|
vec3 tileUv;
|
|
vec3 inputCoordinate;
|
|
#if (SAMPLE_COUNT > 1)
|
|
float weight;
|
|
#endif
|
|
};
|
|
|
|
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 = (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 = (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 TileAndUvCoordinate tileAndUv, in ivec4 octreeCoords) {
|
|
int levelDifference = tileAndUv.tileCoords.w - octreeCoords.w;
|
|
float scalar = exp2(-1.0 * float(levelDifference));
|
|
vec3 originShift = vec3(tileAndUv.tileCoords.xyz - (octreeCoords.xyz << levelDifference)) * scalar;
|
|
return tileAndUv.tileUv * scalar + originShift;
|
|
}
|
|
|
|
vec3 getClampedTileUv(in TileAndUvCoordinate tileAndUv, in ivec4 octreeCoords) {
|
|
vec3 tileUv = getTileUv(tileAndUv, octreeCoords);
|
|
return clamp(tileUv, vec3(0.0), vec3(1.0));
|
|
}
|
|
|
|
void addSampleCoordinates(in TileAndUvCoordinate tileAndUv, inout SampleData sampleData) {
|
|
vec3 tileUv = getClampedTileUv(tileAndUv, 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 = inputCoordinate.z;
|
|
// u_inputDimensions.z is the y-up dimension along the 3D Tiles y-axis.
|
|
inputCoordinate.z = float(u_inputDimensions.z) - inputY;
|
|
#elif defined(SHAPE_CYLINDER)
|
|
float angle = inputCoordinate.y;
|
|
float height = inputCoordinate.z;
|
|
#if (!defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE))
|
|
// Account for the different 0-angle convention in glTF vs 3DTiles
|
|
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;
|
|
// Adding 0.5 moves to the center of the texel
|
|
float leafCoordXStart = float((leafIndex % u_octreeLeafNodeTilesPerRow) * leafNodeTexelCount) + 0.5;
|
|
float leafCoordY = float(leafIndex / u_octreeLeafNodeTilesPerRow) + 0.5;
|
|
|
|
// Get an interpolation weight and a flag to determine whether to read the parent texture
|
|
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;
|
|
// TODO: this looks wrong? Should be comparing to OCTREE_FLAG_PACKED_LEAF_FROM_PARENT
|
|
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;
|
|
|
|
// Get megatexture indices for both samples
|
|
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 ivec4 tileCoordinate, inout TraversalData traversalData) {
|
|
OctreeNodeData childData;
|
|
|
|
for (int i = 0; i < OCTREE_MAX_LEVELS; ++i) {
|
|
// tileCoordinate.xyz is defined at the level of detail tileCoordinate.w.
|
|
// Find the corresponding coordinate at the level traversalData.octreeCoords.w
|
|
int level = traversalData.octreeCoords.w + 1;
|
|
int levelDifference = tileCoordinate.w - level;
|
|
ivec3 coordinateAtLevel = tileCoordinate.xyz >> levelDifference;
|
|
traversalData.octreeCoords = ivec4(coordinateAtLevel, level);
|
|
|
|
ivec3 childCoordinate = coordinateAtLevel & 1;
|
|
childData = getOctreeChildData(traversalData.parentOctreeIndex, childCoordinate);
|
|
|
|
if (childData.flag != OCTREE_FLAG_INTERNAL) {
|
|
// leaf tile - stop traversing
|
|
break;
|
|
}
|
|
|
|
traversalData.parentOctreeIndex = childData.data;
|
|
}
|
|
|
|
return childData;
|
|
}
|
|
|
|
/**
|
|
* Transform a given position to an octree tile coordinate and a position within that tile,
|
|
* and find the corresponding megatexture index and texture coordinates
|
|
*/
|
|
void traverseOctreeFromBeginning(in TileAndUvCoordinate tileAndUv, 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(tileAndUv.tileCoords, traversalData);
|
|
}
|
|
|
|
#if (SAMPLE_COUNT == 1)
|
|
getOctreeLeafSampleData(nodeData, traversalData.octreeCoords, sampleDatas[0]);
|
|
addSampleCoordinates(tileAndUv, sampleDatas[0]);
|
|
#else
|
|
getOctreeLeafSampleDatas(nodeData, traversalData.octreeCoords, sampleDatas);
|
|
addSampleCoordinates(tileAndUv, sampleDatas[0]);
|
|
addSampleCoordinates(tileAndUv, sampleDatas[1]);
|
|
#endif
|
|
}
|
|
|
|
bool insideTile(in ivec4 tileCoordinate, in ivec4 octreeCoords) {
|
|
int levelDifference = tileCoordinate.w - octreeCoords.w;
|
|
if (levelDifference < 0) {
|
|
return false;
|
|
}
|
|
ivec3 coordinateAtLevel = tileCoordinate.xyz >> levelDifference;
|
|
return coordinateAtLevel == octreeCoords.xyz;
|
|
}
|
|
|
|
void traverseOctreeFromExisting(in TileAndUvCoordinate tileAndUv, inout TraversalData traversalData, inout SampleData sampleDatas[SAMPLE_COUNT]) {
|
|
ivec4 tileCoords = tileAndUv.tileCoords;
|
|
if (insideTile(tileCoords, traversalData.octreeCoords)) {
|
|
for (int i = 0; i < SAMPLE_COUNT; i++) {
|
|
addSampleCoordinates(tileAndUv, sampleDatas[i]);
|
|
}
|
|
return;
|
|
}
|
|
|
|
// Go up tree until we find a parent tile containing tileCoords.
|
|
// Assumes all parents are available all they way up to the root.
|
|
for (int i = 0; i < OCTREE_MAX_LEVELS; ++i) {
|
|
traversalData.octreeCoords.xyz /= 2;
|
|
traversalData.octreeCoords.w -= 1;
|
|
|
|
if (insideTile(tileCoords, traversalData.octreeCoords)) {
|
|
break;
|
|
}
|
|
|
|
traversalData.parentOctreeIndex = getOctreeParentIndex(traversalData.parentOctreeIndex);
|
|
}
|
|
|
|
// Go down tree
|
|
OctreeNodeData nodeData = traverseOctreeDownwards(tileCoords, traversalData);
|
|
|
|
#if (SAMPLE_COUNT == 1)
|
|
getOctreeLeafSampleData(nodeData, traversalData.octreeCoords, sampleDatas[0]);
|
|
addSampleCoordinates(tileAndUv, sampleDatas[0]);
|
|
#else
|
|
getOctreeLeafSampleDatas(nodeData, traversalData.octreeCoords, sampleDatas);
|
|
addSampleCoordinates(tileAndUv, sampleDatas[0]);
|
|
addSampleCoordinates(tileAndUv, sampleDatas[1]);
|
|
#endif
|
|
}
|
|
`;var rH=`// See Octree.glsl for the definitions of SampleData
|
|
|
|
/* Megatexture defines (set in Scene/VoxelRenderResources.js)
|
|
#define SAMPLE_COUNT ###
|
|
#define PADDING
|
|
*/
|
|
|
|
uniform ivec3 u_megatextureTileCounts; // number of tiles in the megatexture, along each axis
|
|
|
|
vec3 index1DTo3DTexCoord(int index)
|
|
{
|
|
int tilesPerZ = u_megatextureTileCounts.x * u_megatextureTileCounts.y;
|
|
int iz = index / tilesPerZ;
|
|
int remainder = index - iz * tilesPerZ;
|
|
int iy = remainder / u_megatextureTileCounts.x;
|
|
int ix = remainder - iy * u_megatextureTileCounts.x;
|
|
return vec3(ix, iy, iz) / vec3(u_megatextureTileCounts);
|
|
}
|
|
|
|
Properties getPropertiesFromMegatexture(in SampleData sampleData) {
|
|
int tileIndex = sampleData.megatextureIndex;
|
|
|
|
vec3 voxelCoord = sampleData.inputCoordinate;
|
|
|
|
// UV coordinate of the lower corner of the tile in the megatexture
|
|
vec3 tileUvOffset = index1DTo3DTexCoord(tileIndex);
|
|
|
|
// Voxel location
|
|
vec3 tileDimensions = vec3(u_inputDimensions);
|
|
vec3 clampedVoxelCoord = clamp(voxelCoord, vec3(0.5), tileDimensions - vec3(0.5));
|
|
vec3 voxelUv = clampedVoxelCoord / tileDimensions / vec3(u_megatextureTileCounts);
|
|
|
|
return getPropertiesFromMegatextureAtUv(tileUvOffset + voxelUv);
|
|
}
|
|
|
|
// Convert an array of sample datas to a final weighted properties.
|
|
Properties accumulatePropertiesFromMegatexture(in SampleData sampleDatas[SAMPLE_COUNT]) {
|
|
#if (SAMPLE_COUNT == 1)
|
|
return getPropertiesFromMegatexture(sampleDatas[0]);
|
|
#else
|
|
// When more than one sample is taken the accumulator needs to start at 0
|
|
Properties properties = clearProperties();
|
|
for (int i = 0; i < SAMPLE_COUNT; ++i) {
|
|
float weight = sampleDatas[i].weight;
|
|
|
|
// Avoid reading the megatexture when the weight is 0 as it can be costly.
|
|
if (weight > 0.0) {
|
|
Properties tempProperties = getPropertiesFromMegatexture(sampleDatas[i]);
|
|
tempProperties = scaleProperties(tempProperties, weight);
|
|
properties = sumProperties(properties, tempProperties);
|
|
}
|
|
}
|
|
return properties;
|
|
#endif
|
|
}
|
|
`;var Rwe={Z_UP:0,Y_UP:1};Object.freeze(Rwe);var Dg=Rwe;function BIt(e){let t=new ry;this.shaderBuilder=t;let n=e._customShader,i=Ot(e._uniformMap,n.uniformMap);e._uniformMap=i;let r=n.uniforms;for(let m in r)if(r.hasOwnProperty(m)){let y=r[m];t.addUniform(y.type,m,he.FRAGMENT)}t.addUniform("sampler3D","u_megatextureTextures[METADATA_COUNT]",he.FRAGMENT),this.uniformMap=i;let o=e._clippingPlanes,a=l(o)&&o.enabled?o.length:0;this.clippingPlanes=o,this.clippingPlanesLength=a;let s=e._shape.renderBoundPlanes,c=s?.length??0;this.renderBoundPlanes=s,this.renderBoundPlanesLength=c,t.addVertexLines([Y6]),e.provider.metadataOrder===Dg.Y_UP&&t.addDefine("Y_UP_METADATA_ORDER",void 0,he.FRAGMENT);let u=e._provider.shape;u==="BOX"?t.addDefine("SHAPE_BOX",void 0,he.FRAGMENT):u==="CYLINDER"?t.addDefine("SHAPE_CYLINDER",void 0,he.FRAGMENT):u==="ELLIPSOID"&&t.addDefine("SHAPE_ELLIPSOID",void 0,he.FRAGMENT),t.addFragmentLines([n.fragmentShaderText,"#line 0",iH,W6,rH,X6,$6,K6]),a>0&&(t.addDefine("CLIPPING_PLANES",void 0,he.FRAGMENT),t.addDefine("CLIPPING_PLANES_COUNT",a,he.FRAGMENT),o.unionClippingRegions&&t.addDefine("CLIPPING_PLANES_UNION",void 0,he.FRAGMENT)),e._depthTest&&t.addDefine("DEPTH_TEST",void 0,he.FRAGMENT),u==="BOX"?t.addFragmentLines([eH,J6,MS]):u==="CYLINDER"?t.addFragmentLines([tH,oR,Z6,MS]):u==="ELLIPSOID"&&t.addFragmentLines([nH,oR,Q6,MS]),t.addFragmentLines([q6]);let f=e._shape,d=f.shaderDefines;for(let m in d)if(d.hasOwnProperty(m)){let y=d[m];l(y)&&(y=y===!0?void 0:y,t.addDefine(m,y,he.FRAGMENT))}let p=f.shaderMaximumIntersectionsLength;a>0&&(t.addDefine("CLIPPING_PLANES_INTERSECTION_INDEX",p,he.FRAGMENT),a===1?p+=1:o.unionClippingRegions?p+=2:p+=1),e._depthTest&&(t.addDefine("DEPTH_INTERSECTION_INDEX",p,he.FRAGMENT),p+=1),t.addDefine("INTERSECTION_COUNT",p,he.FRAGMENT),(!h.equals(e.paddingBefore,h.ZERO)||!h.equals(e.paddingAfter,h.ZERO))&&t.addDefine("PADDING",void 0,he.FRAGMENT),e._useLogDepth&&t.addDefine("LOG_DEPTH_READ_ONLY",void 0,he.FRAGMENT);let g=e._traversal;t.addDefine("SAMPLE_COUNT",`${g._sampleCount}`,he.FRAGMENT)}var oH=BIt;var Owe=new k;function kIt(e,t){let n=new oH(e);G6(n,e);let{shaderBuilder:i,clippingPlanes:r,clippingPlanesLength:o,renderBoundPlanes:a,renderBoundPlanesLength:s}=n;if(o>0){let T="getClippingPlane",C=`vec4 ${T}(highp sampler2D packedPlanes, int planeNumber)`,E=va.getTextureResolution(r,t,Owe),w=Mwe(E);i.addFunction(T,C,he.FRAGMENT),i.addFunctionLines(T,[w])}if(s>0){let T="getBoundPlane",C=`vec4 ${T}(highp sampler2D packedPlanes, int planeNumber)`,E=lA.getTextureResolution(a,t,Owe),w=Mwe(E);i.addFunction(T,C,he.FRAGMENT),i.addFunctionLines(T,[w])}let c=i.clone();c.addDefine("PICKING",void 0,he.FRAGMENT);let u=i.clone();u.addDefine("PICKING_VOXEL",void 0,he.FRAGMENT);let f=i.buildShaderProgram(t),d=c.buildShaderProgram(t),p=u.buildShaderProgram(t),g=je.fromCache({cull:{enabled:!0,face:Ui.BACK},depthTest:{enabled:!1},depthMask:!1,blending:en.PRE_MULTIPLIED_ALPHA_BLEND}),m=t.getViewportQuadVertexArray(),y=e._depthTest,A=new nt({vertexArray:m,primitiveType:Re.TRIANGLES,renderState:g,shaderProgram:f,uniformMap:n.uniformMap,modelMatrix:e._compoundModelMatrix,pass:Pe.VOXELS,executeInClosestFrustum:!0,owner:this,cull:y,occlude:y}),b=nt.shallowClone(A,new nt);b.shaderProgram=d,b.pickOnly=!0;let x=nt.shallowClone(A,new nt);if(x.shaderProgram=p,x.pickOnly=!0,l(e._drawCommand)){let T=e._drawCommand;T.shaderProgram=T.shaderProgram&&T.shaderProgram.destroy()}if(l(e._drawCommandPick)){let T=e._drawCommandPick;T.shaderProgram=T.shaderProgram&&T.shaderProgram.destroy()}if(l(e._drawCommandPickVoxel)){let T=e._drawCommandPickVoxel;T.shaderProgram=T.shaderProgram&&T.shaderProgram.destroy()}e._drawCommand=A,e._drawCommandPick=b,e._drawCommandPickVoxel=x}function Mwe(e){let t=e.x,n=e.y,i=1/t,r=1/n,o=`${i}`;o.indexOf(".")===-1&&(o+=".0");let a=`${r}`;return a.indexOf(".")===-1&&(a+=".0"),`int pixY = planeNumber / ${t};
|
|
int pixX = planeNumber - (pixY * ${t});
|
|
// Sample from center of pixel
|
|
float u = (float(pixX) + 0.5) * ${o};
|
|
float v = (float(pixY) + 0.5) * ${a};
|
|
return texture(packedPlanes, vec2(u, v));`}var aH=kIt;function Rg(e){let{loader:t,metadata:n}=e;this._loader=t,this._metadata=n,this._resourcesLoaded=!1,this._ready=!1}Object.defineProperties(Rg.prototype,{ready:{get:function(){return this._ready}},metadata:{get:function(){return this._metadata}}});Rg.fromMetadataArray=function(e){return new Rg({metadata:e})};Rg.fromGltf=async function(e){let t=new Ad({gltfResource:e,releaseGltfJson:!1,loadAttributesAsTypedArray:!0});try{await t.load()}catch(n){throw t.destroy(),n}return new Rg({loader:t})};Rg.prototype.update=function(e,t){let n=this._loader;if(!this._ready){if(t.afterRender.push(()=>!0),!l(n)){this._ready=!0;return}if(this._resourcesLoaded){let{structuralMetadata:i,scene:r}=n.components,{attributes:o}=r.nodes[0].primitives[0];this._metadata=zIt(o,i,e),this._ready=!0;return}this._resourcesLoaded=n.process(t)}};function zIt(e,t,n){let{className:i,names:r,types:o,componentTypes:a}=n.provider,s=t.propertyAttributes.find(f=>f.class.id===i),{properties:c}=s,u=new Array(r.length);for(let f=0;f<e.length;f++){let d=c[r[f]].attribute,p=e.find(A=>A.name===d);if(!l(p))continue;let g=Mt.toComponentDatatype(a[f]),m=gt.getComponentCount(o[f]),y=p.count*m;u[f]=Y.createArrayBufferView(g,p.typedArray.buffer,p.typedArray.byteOffset+p.byteOffset,y)}return u}Rg.prototype.isDestroyed=function(){return!1};Rg.prototype.destroy=function(){return this._loader=this._loader&&this._loader.destroy(),ue(this)};var LS=Rg;function rl(){this._orientedBoundingBox=new Jt,this._boundingSphere=new se,this._boundTransform=new O,this._shapeTransform=new O,this._minBounds=rl.DefaultMinBounds.clone(),this._maxBounds=rl.DefaultMaxBounds.clone(),this._renderMinBounds=rl.DefaultMinBounds.clone(),this._renderMaxBounds=rl.DefaultMaxBounds.clone();let{DefaultMinBounds:e,DefaultMaxBounds:t}=rl,n=[new ls(h.negate(h.UNIT_X,new h),e.x),new ls(h.negate(h.UNIT_Y,new h),e.y),new ls(h.negate(h.UNIT_Z,new h),e.z),new ls(h.UNIT_X,-t.x),new ls(h.UNIT_Y,-t.y),new ls(h.UNIT_Z,-t.z)];this._renderBoundPlanes=new lA({planes:n}),this._localToShapeUvTranslate=new h,this._shaderUniforms={boxEcToXyz:new $,boxLocalToShapeUvScale:new h},this._shaderDefines={BOX_INTERSECTION_INDEX:void 0},this._shaderMaximumIntersectionsLength=0}Object.defineProperties(rl.prototype,{orientedBoundingBox:{get:function(){return this._orientedBoundingBox}},renderBoundPlanes:{get:function(){return this._renderBoundPlanes}},boundingSphere:{get:function(){return this._boundingSphere}},boundTransform:{get:function(){return this._boundTransform}},shapeTransform:{get:function(){return this._shapeTransform}},shaderUniforms:{get:function(){return this._shaderUniforms}},shaderDefines:{get:function(){return this._shaderDefines}},shaderMaximumIntersectionsLength:{get:function(){return this._shaderMaximumIntersectionsLength}}});var UIt=new h,VIt=new h,jIt=new $,HIt=new h,GIt=new h;rl.prototype.update=function(e,t,n,i,r){i=i??t.clone(HIt),r=r??n.clone(GIt),t=h.clone(t,this._minBounds),n=h.clone(n,this._maxBounds);let o=h.clamp(t,i,r,this._renderMinBounds),a=h.clamp(n,i,r,this._renderMaxBounds),s=O.getScale(e,VIt);if(o.x>a.x||o.y>a.y||o.z>a.z||(o.x===a.x)+(o.y===a.y)+(o.z===a.z)>=2||s.x===0||s.y===0||s.z===0)return!1;let c=this._renderBoundPlanes;c.get(0).distance=o.x,c.get(1).distance=o.y,c.get(2).distance=o.z,c.get(3).distance=-a.x,c.get(4).distance=-a.y,c.get(5).distance=-a.z,this._shapeTransform=O.clone(e,this._shapeTransform),this._orientedBoundingBox=fte(o,a,this._shapeTransform,this._orientedBoundingBox),this._boundTransform=O.fromRotationTranslation(this._orientedBoundingBox.halfAxes,this._orientedBoundingBox.center,this._boundTransform),this._boundingSphere=se.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere);let u=this._shaderUniforms,f=this._shaderDefines;for(let y in f)f.hasOwnProperty(y)&&(f[y]=void 0);let d=0;f.BOX_INTERSECTION_INDEX=d,d+=1;let p=t,g=n,m=h.fromElements(lte(p.x,g.x),lte(p.y,g.y),lte(p.z,g.z),u.boxLocalToShapeUvScale);return this._localToShapeUvTranslate=h.negate(h.multiplyComponents(m,p,this._localToShapeUvTranslate),this._localToShapeUvTranslate),this._shaderMaximumIntersectionsLength=d,!0};function lte(e,t){return I.equalsEpsilon(e,t,I.EPSILON7)?1:1/(t-e)}var WIt=new O;rl.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=O.inverse(this._shapeTransform,WIt),i=O.getMatrix3(n,t.boxEcToXyz),r=e.context.uniformState.inverseViewRotation;$.multiply(i,r,t.boxEcToXyz)};rl.prototype.convertLocalToShapeUvSpace=function(e,t){let{boxLocalToShapeUvScale:n}=this._shaderUniforms,i=this._localToShapeUvTranslate;return h.add(h.multiplyComponents(e,n,t),i,t)};var sH=new h,ute=new h;rl.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,r){let o=this._minBounds,a=this._maxBounds,s=1/Math.pow(2,e),c=h.fromElements(I.lerp(o.x,a.x,s*t),I.lerp(o.y,a.y,s*n),I.lerp(o.z,a.z,s*i),sH),u=h.fromElements(I.lerp(o.x,a.x,s*(t+1)),I.lerp(o.y,a.y,s*(n+1)),I.lerp(o.z,a.z,s*(i+1)),ute);return fte(c,u,this._shapeTransform,r)};var Lwe=new h;rl.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let r=1/Math.pow(2,e.level),o=h.divideComponents(h.ONE,t,Lwe),a=h.multiplyByScalar(o,r,Lwe),s=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,sH),r,sH),c=h.add(s,a,ute),u=this._minBounds,f=this._maxBounds,d=h.fromElements(I.lerp(u.x,f.x,s.x),I.lerp(u.y,f.y,s.y),I.lerp(u.z,f.z,s.z),sH),p=h.fromElements(I.lerp(u.x,f.x,c.x),I.lerp(u.y,f.y,c.y),I.lerp(u.z,f.z,c.z),ute);return fte(d,p,this._shapeTransform,i)};rl.DefaultMinBounds=Object.freeze(new h(-1,-1,-1));rl.DefaultMaxBounds=Object.freeze(new h(1,1,1));var Nwe=new h;function fte(e,t,n,i){let r=rl.DefaultMinBounds,o=rl.DefaultMaxBounds;if(h.equals(e,r)&&h.equals(t,o))i.center=O.getTranslation(n,i.center),i.halfAxes=O.getMatrix3(n,i.halfAxes);else{let s=O.getScale(n,Nwe),c=h.midpoint(e,t,UIt);i.center=O.multiplyByPoint(n,c,i.center),s=h.fromElements(s.x*.5*(t.x-e.x),s.y*.5*(t.y-e.y),s.z*.5*(t.z-e.z),Nwe);let u=O.getRotation(n,jIt);i.halfAxes=$.setScale(u,s,i.halfAxes)}return i}var NS=rl;function xf(){this._orientedBoundingBox=new Jt,this._boundingSphere=new se,this._boundTransform=new O,this._shapeTransform=new O,this._minBounds=xf.DefaultMinBounds.clone(),this._maxBounds=xf.DefaultMaxBounds.clone();let{DefaultMinBounds:e,DefaultMaxBounds:t}=xf,n=[new ls(h.negate(h.UNIT_Z,new h),e.z),new ls(h.UNIT_Z,-t.z)];this._renderBoundPlanes=new lA({planes:n}),this._localToShapeUvTranslate=new h,this._shaderUniforms={cameraShapePosition:new h,cylinderEcToRadialTangentUp:new $,cylinderRenderRadiusMinMax:new k,cylinderRenderAngleMinMax:new k,cylinderLocalToShapeUvScale:new h,cylinderShapeUvAngleRangeOrigin:0},this._shaderDefines={CYLINDER_HAS_SHAPE_BOUNDS_ANGLE:void 0,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_INTERSECTION_INDEX_RADIUS_MAX:void 0,CYLINDER_INTERSECTION_INDEX_RADIUS_MIN:void 0,CYLINDER_INTERSECTION_INDEX_ANGLE:void 0},this._shaderMaximumIntersectionsLength=0}Object.defineProperties(xf.prototype,{orientedBoundingBox:{get:function(){return this._orientedBoundingBox}},renderBoundPlanes:{get:function(){return this._renderBoundPlanes}},boundingSphere:{get:function(){return this._boundingSphere}},boundTransform:{get:function(){return this._boundTransform}},shapeTransform:{get:function(){return this._shapeTransform}},shaderUniforms:{get:function(){return this._shaderUniforms}},shaderDefines:{get:function(){return this._shaderDefines}},shaderMaximumIntersectionsLength:{get:function(){return this._shaderMaximumIntersectionsLength}}});var qIt=new h,YIt=new h,XIt=new h,KIt=new h,$It=new h,JIt=new O,ZIt=new h,Fwe=new k;xf.prototype.update=function(e,t,n,i,r){i=i??t.clone(YIt),r=r??n.clone(XIt),t=h.clone(t,this._minBounds),n=h.clone(n,this._maxBounds);let{DefaultMinBounds:o,DefaultMaxBounds:a}=xf,s=a.y-o.y,c=.5*s,u=I.EPSILON10,f=I.EPSILON10;t.x=Math.max(0,t.x),n.x=Math.max(0,n.x),t.y=I.negativePiToPi(t.y),n.y=I.negativePiToPi(n.y),i.y=I.negativePiToPi(i.y),r.y=I.negativePiToPi(r.y);let d=h.maximumByComponent(t,i,KIt),p=h.minimumByComponent(n,r,$It),g=O.getScale(e,qIt);if(p.x===0||d.x>p.x||d.z>p.z||I.equalsEpsilon(g.x,0,void 0,u)||I.equalsEpsilon(g.y,0,void 0,u)||I.equalsEpsilon(g.z,0,void 0,u))return!1;let m=this._renderBoundPlanes;m.get(0).distance=d.z,m.get(1).distance=-p.z,this._shapeTransform=O.clone(e,this._shapeTransform),this._orientedBoundingBox=mte(d,p,this._shapeTransform,this._orientedBoundingBox),this._boundTransform=O.fromRotationTranslation(this._orientedBoundingBox.halfAxes,this._orientedBoundingBox.center,this._boundTransform),this._boundingSphere=se.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere);let y=n.y<t.y,A=n.y-t.y+y*s,b=p.y<d.y,x=p.y-d.y+b*s,T=x>=c-f&&x<s-f,C=x>f&&x<c-f,E=x<=f,w=T||C||E,D=this._shaderUniforms,R=this._shaderDefines;for(let W in R)R.hasOwnProperty(W)&&(R[W]=void 0);let M=0;R.CYLINDER_INTERSECTION_INDEX_RADIUS_MAX=M,M+=1,A<s-f&&(R.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE=!0),d.x!==o.x&&(R.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN=!0,R.CYLINDER_INTERSECTION_INDEX_RADIUS_MIN=M,M+=1),D.cylinderRenderRadiusMinMax=k.fromElements(d.x,p.x,D.cylinderRenderRadiusMinMax),d.x===p.x&&(R.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT=!0);let N=n.x-t.x,_=0,v=1;N!==0&&(_=1/N,v=-t.x*_);let S=n.z-t.z,P=0,L=1;S!==0&&(P=1/S,L=-t.z*P),w&&(R.CYLINDER_HAS_RENDER_BOUNDS_ANGLE=!0,R.CYLINDER_INTERSECTION_INDEX_ANGLE=M,T?(R.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF=!0,M+=1):C?(R.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF=!0,M+=2):E&&(R.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO=!0,M+=2),D.cylinderRenderAngleMinMax=k.fromElements(d.y,p.y,D.cylinderRenderAngleMinMax));let F=(t.y-o.y)/s,V=(n.y-o.y)/s,z=1-A/s,j=(V+.5*z)%1;D.cylinderShapeUvAngleRangeOrigin=j;let B=0,G=1;if(A>f){B=s/A;let W=F-j;G=-B*(W-Math.floor(W))}return D.cylinderLocalToShapeUvScale=h.fromElements(_,B,P,D.cylinderLocalToShapeUvScale),this._localToShapeUvTranslate=h.fromElements(v,G,L,this._localToShapeUvTranslate),this._shaderMaximumIntersectionsLength=M,!0};var QIt=new $,ePt=new $,tPt=new O;xf.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=O.inverse(this._shapeTransform,JIt),i=O.multiplyByPoint(n,e.camera.positionWC,ZIt);t.cameraShapePosition=h.fromElements(k.magnitude(i),Math.atan2(i.y,i.x),i.z,t.cameraShapePosition);let r=k.normalize(k.fromCartesian3(i,Fwe),Fwe),o=$.fromRowMajorArray([r.x,r.y,0,-r.y,r.x,0,0,0,1],QIt),a=e.context.uniformState.inverseView,s=O.multiplyTransformation(n,a,tPt),c=O.getMatrix3(s,ePt);t.cylinderEcToRadialTangentUp=$.multiply(o,c,t.cylinderEcToRadialTangentUp)};xf.prototype.convertLocalToShapeUvSpace=function(e,t){let n=Math.hypot(e.x,e.y),i=Math.atan2(e.y,e.x),r=e.z,{cylinderLocalToShapeUvScale:o,cylinderShapeUvAngleRangeOrigin:a}=this._shaderUniforms,s=this._localToShapeUvTranslate;return n=n*o.x+s.x,i=(i+Math.PI)/(2*Math.PI),i-=a,i=i-Math.floor(i),i=i*o.y+s.y,r=r*o.z+s.z,h.fromElements(n,i,r,t)};var cH=new h,hte=new h;xf.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,r){let o=this._minBounds,a=this._maxBounds,s=1/Math.pow(2,e),c=h.fromElements(I.lerp(o.x,a.x,t*s),I.lerp(o.y,a.y,n*s),I.lerp(o.z,a.z,i*s),cH),u=h.fromElements(I.lerp(o.x,a.x,(t+1)*s),I.lerp(o.y,a.y,(n+1)*s),I.lerp(o.z,a.z,(i+1)*s),hte);return mte(c,u,this._shapeTransform,r)};var Bwe=new h;xf.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let r=1/Math.pow(2,e.level),o=h.divideComponents(h.ONE,t,Bwe),a=h.multiplyByScalar(o,r,Bwe),s=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,cH),r,cH),c=h.add(s,a,hte),u=this._minBounds,f=this._maxBounds,d=h.fromElements(I.lerp(u.x,f.x,s.x),I.lerp(u.y,f.y,s.y),I.lerp(u.z,f.z,s.z),cH),p=h.fromElements(I.lerp(u.x,f.x,c.x),I.lerp(u.y,f.y,c.y),I.lerp(u.z,f.z,c.z),hte);return mte(d,p,this._shapeTransform,i)};xf.DefaultMinBounds=Object.freeze(new h(0,-I.PI,-1));xf.DefaultMaxBounds=Object.freeze(new h(1,+I.PI,1));var nPt=5,iPt=new Array(nPt),rPt=new h,oPt=new $,aPt=new O,sPt=new O,cPt=new O,dte=new O,lPt=new h,uPt=new h,fPt=new h,zwe=new Array(8);for(let e=0;e<8;e++)zwe[e]=new h;function kwe(e,t,n){return Math.abs(ae.dot(e,t))<n}function dPt(e){let t=O.getColumn(e,0,lPt),n=O.getColumn(e,1,uPt),i=O.getColumn(e,2,fPt),r=I.EPSILON4;return kwe(t,n,r)&&kwe(n,i,r)}function hPt(e,t){let n=zwe;h.fromElements(-.5,-.5,-.5,n[0]),h.fromElements(-.5,-.5,.5,n[1]),h.fromElements(-.5,.5,-.5,n[2]),h.fromElements(-.5,.5,.5,n[3]),h.fromElements(.5,-.5,-.5,n[4]),h.fromElements(.5,-.5,.5,n[5]),h.fromElements(.5,.5,-.5,n[6]),h.fromElements(.5,.5,.5,n[7]);for(let i=0;i<8;++i)O.multiplyByPoint(e,n[i],n[i]);return Jt.fromPoints(n,t)}var mPt=new h;function mte(e,t,n,i){let r=e.x,o=t.x,a=e.y,s=t.y<a?t.y+I.TWO_PI:t.y,c=e.z,u=t.z,f=s-a,d=a+f*.5,p=iPt,g=0;p[g++]=a,p[g++]=s,p[g++]=d,f>I.PI&&(p[g++]=d-I.PI_OVER_TWO,p[g++]=d+I.PI_OVER_TWO);let m=Number.POSITIVE_INFINITY,y=Number.POSITIVE_INFINITY,A=Number.NEGATIVE_INFINITY,b=Number.NEGATIVE_INFINITY;for(let F=0;F<g;++F){let V=p[F]-d,z=Math.cos(V),j=Math.sin(V),B=z*r,G=j*r,W=z*o,Q=j*o;m=Math.min(m,B,W),y=Math.min(y,G,Q),A=Math.max(A,B,W),b=Math.max(b,G,Q)}let x=A-m,T=b-y,C=u-c,E=(m+A)*.5,w=(y+b)*.5,D=(c+u)*.5,R=h.fromElements(E,w,D,rPt),M=$.fromRotationZ(d,oPt),N=h.fromElements(x,T,C,mPt),_=O.fromScale(N,cPt),v=O.fromRotation(M,sPt),S=O.fromTranslation(R,aPt),P=O.multiplyTransformation(v,O.multiplyTransformation(S,_,dte),dte),L=O.multiplyTransformation(n,P,dte);return dPt(L)?Jt.fromTransformation(L,i):hPt(L,i)}var FS=xf;function Vd(){this._orientedBoundingBox=new Jt,this._boundingSphere=new se,this._boundTransform=new O,this._shapeTransform=new O,this._rectangle=new ie,this._minimumHeight=Vd.DefaultMinBounds.z,this._maximumHeight=Vd.DefaultMaxBounds.z,this._ellipsoid=new te,this._translation=new h,this._rotation=new $,this._localToShapeUvTranslate=new h,this._shaderUniforms={cameraPositionCartographic:new h,ellipsoidEcToEastNorthUp:new $,ellipsoidRadii:new h,eccentricitySquared:0,evoluteScale:new k,ellipsoidCurvatureAtLatitude:new k,ellipsoidInverseRadiiSquared:new h,ellipsoidRenderLongitudeMinMax:new k,ellipsoidShapeUvLongitudeRangeOrigin:0,ellipsoidShapeUvLongitudeMinMaxMid:new h,ellipsoidLocalToShapeUvScale:new h,ellipsoidRenderLatitudeSinMinMax:new k,clipMinMaxHeight:new k},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_SHAPE_BOUNDS_LONGITUDE: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}Object.defineProperties(Vd.prototype,{orientedBoundingBox:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}},boundTransform:{get:function(){return this._boundTransform}},shapeTransform:{get:function(){return this._shapeTransform}},shaderUniforms:{get:function(){return this._shaderUniforms}},shaderDefines:{get:function(){return this._shaderDefines}},shaderMaximumIntersectionsLength:{get:function(){return this._shaderMaximumIntersectionsLength}}});var pPt=new h,gPt=new h,_Pt=new h,yPt=new h,APt=new h,bPt=new h,xPt=new h,TPt=new h,Uwe=new h,Vwe=new h,CPt=new ie;Vd.prototype.update=function(e,t,n,i,r){let{DefaultMinBounds:o,DefaultMaxBounds:a}=Vd;i=i??o,r=r??a;let s=I.EPSILON10,c=I.EPSILON10,u=I.EPSILON10,f=I.EPSILON3,d=O.getScale(e,TPt),p=h.clone(o,pPt);p.z=-h.minimumComponent(d);let g=h.clamp(t,p,a,gPt),m=h.clamp(n,p,a,_Pt),y=h.clamp(i,p,a,yPt),A=h.clamp(r,p,a,APt),b=h.maximumByComponent(g,y,bPt),x=h.minimumByComponent(m,A,xPt),T=h.add(d,h.fromElements(m.z,m.z,m.z,Uwe),Uwe),C=h.add(d,h.fromElements(x.z,x.z,x.z,Vwe),Vwe);if(b.y>x.y||b.y===a.y||x.y===o.y||b.z>x.z||I.equalsEpsilon(C,h.ZERO,void 0,s))return!1;this._rectangle=ie.fromRadians(g.x,g.y,m.x,m.y),this._translation=O.getTranslation(e,this._translation),this._rotation=O.getRotation(e,this._rotation),this._ellipsoid=te.fromCartesian3(d,this._ellipsoid),this._minimumHeight=g.z,this._maximumHeight=m.z;let E=ie.fromRadians(b.x,b.y,x.x,x.y,CPt);this._orientedBoundingBox=pte(E,b.z,x.z,this._ellipsoid,this._translation,this._rotation,this._orientedBoundingBox),this._shapeTransform=O.fromRotationTranslation(this._rotation,this._translation,this._shapeTransform),this._boundTransform=O.fromRotationTranslation(this._orientedBoundingBox.halfAxes,this._orientedBoundingBox.center,this._boundTransform),this._boundingSphere=se.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere);let w=a.x-o.x,D=.5*w,R=x.x<b.x,M=x.x-b.x+R*w,N=M<=c,_=M>=D-c&&M<w-c,v=M>c&&M<D-c,S=N||_||v,P=m.x<g.x,L=m.x-g.x+P*w,F=L>D+c&&L<w-c,V=L>=D-c&&L<=D+c,z=L<D-c,j=F||V||z,B=x.y<-f,G=x.y>=-f&&x.y<=+f,W=x.y>+f&&x.y<a.y-u,Q=B||G||W,q=b.y>o.y+u&&b.y<-f,J=b.y>=-f&&b.y<=+f,Z=b.y>+f,ce=q||J||Z,Ae=Q||ce,le=m.y-g.y,Ce=m.y<-f,ye=m.y>=-f&&m.y<=+f,ve=m.y>+f&&m.y<a.y-u,Ie=Ce||ye||ve,Le=g.y>o.y+u&&g.y<-f,$e=g.y>=-f&&g.y<=+f,Ye=g.y>+f,Ke=Ie||(Le||$e||Ye),we=this._shaderUniforms,We=this._shaderDefines;for(let wn in We)We.hasOwnProperty(wn)&&(We[wn]=void 0);we.ellipsoidRadii=h.clone(T,we.ellipsoidRadii);let{x:Ct,z:ct}=we.ellipsoidRadii,dn=ct/Ct;we.eccentricitySquared=1-dn*dn,we.evoluteScale=k.fromElements((Ct*Ct-ct*ct)/Ct,(ct*ct-Ct*Ct)/ct,we.evoluteScale),we.ellipsoidInverseRadiiSquared=h.divideComponents(h.ONE,h.multiplyComponents(we.ellipsoidRadii,we.ellipsoidRadii,we.ellipsoidInverseRadiiSquared),we.ellipsoidInverseRadiiSquared);let Ht=0;We.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX=Ht,Ht+=1,We.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN=Ht,Ht+=1,we.clipMinMaxHeight=k.fromElements(b.z-m.z,x.z-m.z,we.clipMinMaxHeight);let bt=m.z-g.z,Dt=bt===0?0:1/bt;S&&(We.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE=!0,We.ELLIPSOID_INTERSECTION_INDEX_LONGITUDE=Ht,_?(We.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF=!0,Ht+=1):v?(We.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF=!0,Ht+=2):N&&(We.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO=!0,Ht+=2),we.ellipsoidRenderLongitudeMinMax=k.fromElements(b.x,x.x,we.ellipsoidRenderLongitudeMinMax));let In=0,rt=1;if(j){We.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE=!0;let wn=(g.x-o.x)/w,Mi=(m.x-o.x)/w,lr=1-L/w,Li=(Mi+.5*lr)%1;if(we.ellipsoidShapeUvLongitudeRangeOrigin=Li,L>c){In=w/L;let Wi=wn-Li;rt=-In*(Wi-Math.floor(Wi))}}Ae&&(ce&&(We.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN=!0,We.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN=Ht,q?(We.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF=!0,Ht+=1):J?(We.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF=!0,Ht+=1):Z&&(We.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF=!0,Ht+=2)),Q&&(We.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX=!0,We.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX=Ht,B?(We.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF=!0,Ht+=2):G?(We.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF=!0,Ht+=1):W&&(We.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF=!0,Ht+=1)),we.ellipsoidRenderLatitudeSinMinMax=k.fromElements(Math.sin(b.y),Math.sin(x.y),we.ellipsoidRenderLatitudeSinMinMax));let dt=0,vi=1;return Ke&&(We.ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE=!0,le>u&&(dt=(a.y-o.y)/le,vi=(o.y-g.y)/le)),we.ellipsoidLocalToShapeUvScale=h.fromElements(In,dt,Dt,we.ellipsoidLocalToShapeUvScale),this._localToShapeUvTranslate=h.fromElements(rt,vi,0,this._localToShapeUvTranslate),this._shaderMaximumIntersectionsLength=Ht,!0};var vPt=new de,EPt=new h,SPt=new O,jwe=new $;Vd.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=this._ellipsoid,i=e.camera.positionWC,r=n.cartesianToCartographic(i,vPt);h.fromElements(r.longitude,r.latitude,r.height,t.cameraPositionCartographic);let o=h.fromRadians(r.longitude,r.latitude,0,n,EPt);t.ellipsoidCurvatureAtLatitude=n.getLocalCurvature(o,t.ellipsoidCurvatureAtLatitude);let a=mt.eastNorthUpToFixedFrame(o,n,SPt),s=O.getRotation(a,jwe),c=e.context.uniformState.viewRotation,u=$.multiply(c,s,jwe);t.ellipsoidEcToEastNorthUp=$.transpose(u,t.ellipsoidEcToEastNorthUp)};var Kwe=new ie;Vd.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,r){let o=1/Math.pow(2,e),a=t*o,s=(t+1)*o,c=n*o,u=(n+1)*o,f=i*o,d=(i+1)*o,p=ie.subsection(this._rectangle,a,c,s,u,Kwe),g=I.lerp(this._minimumHeight,this._maximumHeight,f),m=I.lerp(this._minimumHeight,this._maximumHeight,d);return pte(p,g,m,this._ellipsoid,this._translation,this._rotation,r)};var wPt=new k,IPt=new k,aR=new k,Hwe=new k,Gwe=new k,sR=new k;function PPt(e,t,n,i){let r=k.abs(e,wPt),o=k.fromElements(1/t.x,1/t.y,IPt),a=k.fromElements(Math.SQRT1_2,Math.SQRT1_2,aR),s=k.multiplyComponents(t,a,Hwe),c=k.fromElements(n.x*a.x*a.x*a.x,n.y*a.y*a.y*a.y,Gwe);for(let u=0;u<3;++u){let f=k.magnitude(k.subtract(s,c,sR)),d=k.normalize(k.subtract(r,c,sR),sR),p=k.multiplyByScalar(d,f,sR);a=k.multiplyComponents(k.add(p,c,aR),o,aR),a=k.normalize(k.clamp(a,k.ZERO,k.ONE,aR),aR),s=k.multiplyComponents(t,a,Hwe),c=k.fromElements(n.x*a.x*a.x*a.x,n.y*a.y*a.y*a.y,Gwe)}return h.fromElements(Math.sign(e.x)*s.x,Math.sign(e.y)*s.y,k.magnitude(k.subtract(s,c,sR)),i)}var DPt=new k,Wwe=new k,RPt=new h,qwe=new k;Vd.prototype.convertLocalToShapeUvSpace=function(e,t){let n=Math.atan2(e.y,e.x),{ellipsoidRadii:i,evoluteScale:r,ellipsoidInverseRadiiSquared:o,ellipsoidShapeUvLongitudeRangeOrigin:a,ellipsoidLocalToShapeUvScale:s}=this._shaderUniforms,c=this._localToShapeUvTranslate,u=Math.hypot(e.x,e.y),f=k.fromElements(u,e.z,Wwe),d=PPt(f,k.fromElements(i.x,i.z,DPt),r,RPt),p=k.normalize(k.fromElements(d.x*o.x,d.y*o.z,qwe),qwe),g=Math.atan2(p.y,p.x),m=k.magnitude(f)<k.magnitude(d)?-1:1,y=k.subtract(f,d,Wwe),A=m*k.magnitude(y),{ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE:b,ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE:x}=this._shaderDefines;return n=(n+Math.PI)/(2*Math.PI),l(b)&&(n-=a,n=n-Math.floor(n),n=n*s.x+c.x),g=(g+Math.PI/2)/Math.PI,l(x)&&(g=g*s.y+c.y),A=1+A*s.z,h.fromElements(n,g,A,t)};var Ywe=new h,Xwe=new h,OPt=new h;Vd.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let r=1/Math.pow(2,e.level),o=h.divideComponents(h.ONE,t,Ywe),a=h.multiplyByScalar(o,r,Ywe),s=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,Xwe),r,Xwe),c=h.add(s,a,OPt),u=ie.subsection(this._rectangle,s.x,s.y,c.x,c.y,Kwe),f=I.lerp(this._minimumHeight,this._maximumHeight,s.z),d=I.lerp(this._minimumHeight,this._maximumHeight,c.z);return pte(u,f,d,this._ellipsoid,this._translation,this._rotation,i)};function pte(e,t,n,i,r,o,a){return a=Jt.fromRectangle(e,t,n,i,a),a.center=h.add(a.center,r,a.center),a.halfAxes=$.multiply(a.halfAxes,o,a.halfAxes),a}Vd.DefaultMinBounds=Object.freeze(new h(-I.PI,-I.PI_OVER_TWO,-te.WGS84.minimumRadius));Vd.DefaultMaxBounds=Object.freeze(new h(I.PI,I.PI_OVER_TWO,10*te.WGS84.maximumRadius));var BS=Vd;var Ru={BOX:"BOX",ELLIPSOID:"ELLIPSOID",CYLINDER:"CYLINDER"};Ru.getMinBounds=function(e){switch(e){case Ru.BOX:return NS.DefaultMinBounds;case Ru.ELLIPSOID:return BS.DefaultMinBounds;case Ru.CYLINDER:return FS.DefaultMinBounds}};Ru.getMaxBounds=function(e){switch(e){case Ru.BOX:return NS.DefaultMaxBounds;case Ru.ELLIPSOID:return BS.DefaultMaxBounds;case Ru.CYLINDER:return FS.DefaultMaxBounds}};Ru.getShapeConstructor=function(e){switch(e){case Ru.BOX:return NS;case Ru.ELLIPSOID:return BS;case Ru.CYLINDER:return FS}};Object.freeze(Ru);var Sc=Ru;var gte=Object.freeze({UNLOADED:0,RECEIVING:1,PROCESSING:2,LOADED:3,FAILED:4,UNAVAILABLE:5});function cR(e,t){this.spatialNode=e,this.keyframe=t,this.state=gte.UNLOADED,this.content=void 0,this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1}cR.prototype.unload=function(){this.content=this.content&&this.content.destroy(),this.spatialNode=void 0,this.state=gte.UNLOADED,this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1};cR.priorityComparator=function(e,t){return e.priority-t.priority};cR.searchComparator=function(e,t){return e.keyframe-t.keyframe};cR.LoadState=gte;var zr=cR;function zp(e,t,n,i,r=134217728,o){let a=MPt(i),s=LPt(n),c=n*Mt.getSizeInBytes(i),u=zp.get3DTextureDimension(t,c,r,o),f=h.divideComponents(u,t,new h);this.channelCount=n,this.componentType=i,this.textureMemoryByteLength=c*u.x*u.y*u.z,this.tileCounts=h.clone(f,new h),this.voxelCountPerTile=h.clone(t,new h),this.maximumTileCount=f.x*f.y*f.z,this.texture=new Wk({context:e,pixelFormat:s,pixelDatatype:a,flipY:!1,width:u.x,height:u.y,depth:u.z,sampler:new Ut({wrapR:on.CLAMP_TO_EDGE,wrapS:on.CLAMP_TO_EDGE,wrapT:on.CLAMP_TO_EDGE,minificationFilter:Gt.LINEAR,magnificationFilter:ni.LINEAR})}),this.nodes=new Array(this.maximumTileCount);for(let d=0;d<this.maximumTileCount;d++)this.nodes[d]=new NPt(d);for(let d=0;d<this.maximumTileCount;d++){let p=this.nodes[d];p.previousNode=d>0?this.nodes[d-1]:void 0,p.nextNode=d<this.maximumTileCount-1?this.nodes[d+1]:void 0}this.occupiedList=void 0,this.emptyList=this.nodes[0],this.occupiedCount=0,this._nearestSampling=!1}Object.defineProperties(zp.prototype,{nearestSampling:{get:function(){return this._nearestSampling},set:function(e){this._nearestSampling!==e&&(e?this.texture.sampler=Ut.NEAREST:this.texture.sampler=new Ut({wrapR:on.CLAMP_TO_EDGE,wrapS:on.CLAMP_TO_EDGE,wrapT:on.CLAMP_TO_EDGE,minificationFilter:Gt.LINEAR,magnificationFilter:ni.LINEAR}),this._nearestSampling=e)}}});function MPt(e){if(e===Mt.FLOAT32||e===Mt.FLOAT64)return ke.FLOAT;if(e===Mt.UINT8)return ke.UNSIGNED_BYTE}function LPt(e){switch(e){case 1:return He.RED;case 2:return He.RG;case 3:return He.RGB;case 4:return He.RGBA}}function NPt(e){this.index=e,this.nextNode=void 0,this.previousNode=void 0}zp.prototype.add=function(e){if(this.isFull())throw new pe("Trying to add when there are no empty spots");let t=this.emptyList;this.emptyList=this.emptyList.nextNode,l(this.emptyList)&&(this.emptyList.previousNode=void 0),t.nextNode=this.occupiedList,l(t.nextNode)&&(t.nextNode.previousNode=t),this.occupiedList=t;let n=t.index;return this.writeDataToTexture(n,e),this.occupiedCount++,n};zp.prototype.remove=function(e){if(e<0||e>=this.maximumTileCount)throw new pe("Megatexture index out of bounds");let t=this.nodes[e];l(t.previousNode)&&(t.previousNode.nextNode=t.nextNode),l(t.nextNode)&&(t.nextNode.previousNode=t.previousNode),t.nextNode=this.emptyList,l(t.nextNode)&&(t.nextNode.previousNode=t),t.previousNode=void 0,this.emptyList=t,this.occupiedCount--};zp.prototype.isFull=function(){return this.emptyList===void 0};zp.get3DTextureDimension=function(e,t,n,i){let{maximum3DTextureSize:r}=Ft;if(h.maximumComponent(e)>r)throw new oe("The GL context does not support a 3D texture large enough to contain a tile with the given dimensions.");let o=t*e.x*e.y*e.z,a=Math.floor(n/o);if(a<1)throw new oe("Not enough texture memory available to create a megatexture with the given tile dimensions.");l(i)?i=Math.min(i,a):i=a;let s=Object.entries(e).sort((f,d)=>d[1]-f[1]),c=s.map(([f,d])=>Math.floor(r/d));for(let f=0;f<3;f++){let d=$we(c);if(d<i)break;let p=c.slice();p.splice(f,1);let g=p[0]*p[1],m=d-i,y=Math.floor(m/g);c[f]-=y}$we(c)>a&&(c[2]=Math.floor(a/(c[0]*c[1])));let u=new h;for(let f=0;f<3;f++){let[d,p]=s[f];u[d]=c[f]*p}return u};function $we(e){return e.reduce((t,n)=>t*n)}zp.prototype.writeDataToTexture=function(e,t){let{tileCounts:n,voxelCountPerTile:i}=this,r={arrayBufferView:t,width:i.x,height:i.y,depth:i.z},o=n.x*n.y,a=Math.floor(e/o),s=e-a*o,c=Math.floor(s/n.x),u=s-c*n.x,f={source:r,xOffset:u*i.x,yOffset:c*i.y,zOffset:a*i.z};this.texture.copyFrom(f)};zp.prototype.isDestroyed=function(){return!1};zp.prototype.destroy=function(){return this.texture=this.texture&&this.texture.destroy(),ue(this)};var lH=zp;function jd(e,t,n,i,r,o,a){this.children=void 0,this.parent=r,this.level=e,this.x=t,this.y=n,this.z=i,this.dimensions=h.clone(a),this.keyframeNodes=[],this.renderableKeyframeNodes=[],this.renderableKeyframeNodeLerp=0,this.renderableKeyframeNodePrevious=void 0,this.renderableKeyframeNodeNext=void 0,this.orientedBoundingBox=new Jt,this.approximateVoxelSize=0,this.screenSpaceError=0,this.visitedFrameNumber=-1,this.computeBoundingVolumes(o)}var FPt=new h;jd.prototype.computeBoundingVolumes=function(e){this.orientedBoundingBox=e.computeOrientedBoundingBoxForTile(this.level,this.x,this.y,this.z,this.orientedBoundingBox);let t=$.getScale(this.orientedBoundingBox.halfAxes,FPt),n=2*h.maximumComponent(t);this.approximateVoxelSize=n/h.minimumComponent(this.dimensions)};jd.prototype.constructChildNodes=function(e){let{level:t,x:n,y:i,z:r}=this,o=n*2,a=i*2,s=r*2,c=a+1,u=o+1,f=s+1,d=t+1,p=[[d,o,a,s],[d,u,a,s],[d,o,c,s],[d,u,c,s],[d,o,a,f],[d,u,a,f],[d,o,c,f],[d,u,c,f]];this.children=p.map(([g,m,y,A])=>new jd(g,m,y,A,this,e,this.dimensions))};jd.prototype.visibility=function(e,t){let n=this.orientedBoundingBox;return e.cullingVolume.computeVisibilityWithPlaneMask(n,t)};jd.prototype.computeScreenSpaceError=function(e,t){let n=this.orientedBoundingBox,i=Math.sqrt(n.distanceSquaredTo(e));i=Math.max(i,I.EPSILON7);let r=this.approximateVoxelSize,o=t*(r/i);this.screenSpaceError=o};var Jwe={keyframe:0};function lR(e,t){return Jwe.keyframe=e,Cr(t,Jwe,zr.searchComparator)}jd.prototype.computeSurroundingRenderableKeyframeNodes=function(e){let t=this,n=t.level,i=Math.floor(e),r=Math.ceil(e),o,a,s=+Number.MAX_VALUE,c=+Number.MAX_VALUE;for(;l(t);){let{renderableKeyframeNodes:d}=t;if(d.length>=1){let p=BPt(i,d),g=d[p],m=r===i||i<g.keyframe?p:Math.min(p+1,d.length-1),y=d[m],A=i-g.keyframe,b=Zwe(n-t.level,A);b<s&&(s=b,o=g);let x=y.keyframe-r,T=Zwe(n-t.level,x);if(T<c&&(c=T,a=y),A===0&&x===0)break}t=t.parent}if(this.renderableKeyframeNodePrevious=o,this.renderableKeyframeNodeNext=a,!l(o)||!l(a))return;let u=o.keyframe,f=a.keyframe;this.renderableKeyframeNodeLerp=u===f?0:I.clamp((e-u)/(f-u),0,1)};function BPt(e,t){let n=lR(e,t);return n<0?I.clamp(~n-1,0,t.length-1):n}function Zwe(e,t){let n=Math.exp(e*4),i=t>=0?1:-200;return e*n+t*i}jd.prototype.isVisited=function(e){return this.visitedFrameNumber===e};jd.prototype.createKeyframeNode=function(e){let t=lR(e,this.keyframeNodes);if(t<0){t=~t;let n=new zr(this,e);this.keyframeNodes.splice(t,0,n)}};jd.prototype.destroyKeyframeNode=function(e,t){let n=e.keyframe,i=lR(n,this.keyframeNodes);if(i<0)throw new pe("Keyframe node does not exist.");if(this.keyframeNodes.splice(i,1),e.megatextureIndex!==-1){for(let o=0;o<t.length;o++)t[o].remove(e.megatextureIndex);let r=lR(n,this.renderableKeyframeNodes);if(r<0)throw new pe("Renderable keyframe node does not exist.");this.renderableKeyframeNodes.splice(r,1)}e.unload()};jd.prototype.addKeyframeNodeToMegatextures=function(e,t){if(e.megatextureIndex!==-1||e.content.metadata.length!==t.length)throw new pe("Keyframe node cannot be added to megatexture");let{metadata:n}=e.content;for(let o=0;o<t.length;o++){let a=t[o];e.megatextureIndex=a.add(n[o])}let i=this.renderableKeyframeNodes,r=lR(e.keyframe,i);if(r>=0)throw new pe("Keyframe already renderable");r=~r,i.splice(r,0,e)};jd.prototype.isRenderable=function(e){let t=this.renderableKeyframeNodePrevious,n=this.renderableKeyframeNodeNext,i=this.level;return l(t)&&l(n)&&(t.spatialNode.level===i||n.spatialNode.level===i)&&this.visitedFrameNumber===e};var uH=jd;function uA(e,t,n,i){let{provider:r,dimensions:o,inputDimensions:a}=e,{types:s,componentTypes:c}=r;l(i)?i=Math.min(Math.max(0,i),512*1024*1024):i=128*1024*1024,this._primitive=e,this.textureMemoryByteLength=0,this.megatextures=new Array(s.length);let u=l(r.maximumTileCount)?r.maximumTileCount:l(r.availableLevels)?(8**r.availableLevels-1)/7:void 0;for(let b=0;b<s.length;b++){let x=s[b],T=gt.getComponentCount(x),C=c[b];this.megatextures[b]=new lH(t,a,T,C,i,u),this.textureMemoryByteLength+=this.megatextures[b].textureMemoryByteLength}let f=this.megatextures[0].maximumTileCount;this._simultaneousRequestCount=0,this._debugPrint=!1,this._calculateStatistics=this._primitive._calculateStatistics??!1,this._frameNumber=0;let d=e._shape;this.rootNode=new uH(0,0,0,0,void 0,d,o),this._priorityQueue=new f_({maximumLength:f,comparator:zr.priorityComparator}),this._highPriorityKeyframeNodes=new Array(f),this._highPriorityKeyframeNodeCount=0,this._keyframeNodesInMegatexture=new Array(f),this._keyframeCount=n,this._sampleCount=void 0,this._keyframeLocation=0,this._binaryTreeKeyframeWeighting=new Array(n),this._initialTilesLoaded=!1;let p=this._binaryTreeKeyframeWeighting;p[0]=0,p[n-1]=0,_te(p,1,n-2,0);let g=9,m=2048,y=Math.floor(m/g),A=Math.ceil(f/y);this.internalNodeTexture=new Et({context:t,pixelFormat:He.RGBA,pixelDatatype:ke.UNSIGNED_BYTE,flipY:!1,width:m,height:A,sampler:new Ut({minificationFilter:Gt.NEAREST,magnificationFilter:ni.NEAREST})}),this.internalNodeTilesPerRow=y,this.internalNodeTexelSizeUv=new k(1/m,1/A),this.leafNodeTexture=void 0,this.leafNodeTilesPerRow=void 0,this.leafNodeTexelSizeUv=new k}uA.prototype.findKeyframeNode=function(e){return this._keyframeNodesInMegatexture.find(function(t){return t.megatextureIndex===e})};function _te(e,t,n,i){if(t>n)return;let r=Math.floor((t+n)/2);e[r]=i,_te(e,t,r-1,i+1),_te(e,r+1,n,i+1)}uA.simultaneousRequestCountMaximum=50;uA.prototype.update=function(e,t,n,i){let r=this._primitive,o=e.context,a=this.megatextures[0].maximumTileCount,s=this._keyframeCount,c=r._levelBlendFactor,u=c>0,f=s>1,d=(u?2:1)*(f?2:1);this._sampleCount=d;let p=d>=2;if(p&&!l(this.leafNodeTexture)){let T=Math.floor(512),C=Math.ceil(a/T);this.leafNodeTexture=new Et({context:o,pixelFormat:He.RGBA,pixelDatatype:ke.UNSIGNED_BYTE,flipY:!1,width:1024,height:C,sampler:new Ut({minificationFilter:Gt.NEAREST,magnificationFilter:ni.NEAREST})}),this.leafNodeTexelSizeUv=k.fromElements(1/1024,1/C,this.leafNodeTexelSizeUv),this.leafNodeTilesPerRow=T}else!p&&l(this.leafNodeTexture)&&(this.leafNodeTexture=this.leafNodeTexture.destroy());if(this._keyframeLocation=I.clamp(t,0,s-1),n&&Qwe(this,this.rootNode),i)return;this._frameNumber=e.frameNumber;let g=An();UPt(this,e),VPt(this,e);let m=An();qPt(this,d,c);let y=An(),A=r.loadProgress.numberOfListeners>0||r.allTilesLoaded.numberOfListeners>0||r.initialTilesLoaded.numberOfListeners>0;if(this._debugPrint||this._calculateStatistics||A){let b=m-g,x=y-m,T=y-g;WPt(this,e,b,x,T)}};uA.prototype.isRenderable=function(e){return e.isRenderable(this._frameNumber)};uA.prototype.isDestroyed=function(){return!1};uA.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(),ue(this)};function Qwe(e,t){if(t.computeBoundingVolumes(e._primitive._shape),l(t.children))for(let n=0;n<8;n++){let i=t.children[n];Qwe(e,i)}}function kPt(e,t){if(e._simultaneousRequestCount>=uA.simultaneousRequestCountMaximum)return;let i=e._primitive.provider,{keyframe:r,spatialNode:o}=t;if(l(i.availableLevels)&&o.level>=i.availableLevels)return;function a(f){e._simultaneousRequestCount--,t.content=f,t.state=l(f)?zr.LoadState.PROCESSING:zr.LoadState.UNAVAILABLE}function s(f){e._simultaneousRequestCount--,t.state=zr.LoadState.FAILED,e._primitive.tileFailed.raiseEvent()}let c={tileLevel:o.level,tileX:o.x,tileY:o.y,tileZ:o.z,keyframe:r},u=i.requestData(c);l(u)&&(e._simultaneousRequestCount++,t.state=zr.LoadState.RECEIVING,u.then(a).catch(s))}function zPt(e){return e/(1+e)}function UPt(e,t){let n=e._frameNumber,i=e._priorityQueue;i.reset(),eIe(e.rootNode,is.MASK_INDETERMINATE,e,t);let r=e._highPriorityKeyframeNodes,o=0,a;for(;i.length>0;)a=i.removeMaximum(),a.highPriorityFrameNumber=n,r[o]=a,o++;e._highPriorityKeyframeNodeCount=o}function VPt(e,t){let n=e.megatextures[0],i=n.occupiedCount,r=e._keyframeNodesInMegatexture;r.length=i,r.sort(jPt);let o=e._highPriorityKeyframeNodes,a=e._highPriorityKeyframeNodeCount,s=0,c=0;for(let u=0;u<a;u++){let f=o[u];if(!(f.state===zr.LoadState.LOADED||f.spatialNode===void 0)&&(f.state===zr.LoadState.UNLOADED&&kPt(e,f),f.state===zr.LoadState.PROCESSING)){let{content:d}=f;if(d.update(e._primitive,t),!d.ready)continue;if(!HPt(d.metadata,e)){f.content=void 0,f.state=zr.LoadState.FAILED,e._primitive.tileFailed.raiseEvent();continue}let p;if(n.isFull()){p=i-1-s,s++;let g=r[p];e._primitive.tileUnload.raiseEvent(),g.spatialNode.destroyKeyframeNode(g,e.megatextures)}else p=i+c,c++;f.spatialNode.addKeyframeNodeToMegatextures(f,e.megatextures),f.state=zr.LoadState.LOADED,r[p]=f,e._primitive.tileLoad.raiseEvent()}}}function jPt(e,t){return e.highPriorityFrameNumber===t.highPriorityFrameNumber?t.priority-e.priority:t.highPriorityFrameNumber-e.highPriorityFrameNumber}function HPt(e,t){let n=t._primitive.provider.types.length;if(!Array.isArray(e)||e.length!==n)return!1;let{megatextures:i}=t;for(let r=0;r<n;r++){let{voxelCountPerTile:o,channelCount:a}=i[r],{x:s,y:c,z:u}=o,f=s*c*u,d=e[r],p=f*a;if(d.length!==p)return!1}return!0}function eIe(e,t,n,i){let{camera:r,context:o,pixelRatio:a,frameNumber:s}=i,{positionWC:c,frustum:u}=r,d=o.drawingBufferHeight/a/u.sseDenominator;if(e.computeScreenSpaceError(c,d),t=e.visibility(i,t),t===is.MASK_OUTSIDE)return;e.visitedFrameNumber=s;let p=n._primitive,g=p._shape,m=p.screenSpaceError,y=n._priorityQueue,A=n._keyframeCount,b=I.clamp(Math.floor(n._keyframeLocation),0,A-2),x=b+1;if(A===1)e.createKeyframeNode(0);else if(e.keyframeNodes.length!==A)for(let D=0;D<A;D++)e.createKeyframeNode(D);let{screenSpaceError:T,keyframeNodes:C}=e,E=zPt(T),w=!1;for(let D=0;D<C.length;D++){let R=C[D];R.priority=10*E+GPt(b,R.keyframe,x,n),R.state!==zr.LoadState.UNAVAILABLE&&R.state!==zr.LoadState.FAILED&&R.priority!==-Number.MAX_VALUE&&y.insert(R),R.state===zr.LoadState.LOADED&&(w=!0)}if(T<m||!w){e.children=void 0;return}l(e.children)||e.constructChildNodes(g);for(let D=0;D<8;D++){let R=e.children[D];eIe(R,t,n,i)}}function GPt(e,t,n,i){let r=Math.min(Math.abs(t-e),Math.abs(t-n)),o=Math.max(e,i._keyframeCount-n-1,1),a=Math.pow(1-r/o,4),s=Math.exp(-i._binaryTreeKeyframeWeighting[t]);return I.lerp(s,a,.15+.85*a)}function WPt(e,t,n,i,r){let o=e._keyframeCount,a=e.rootNode,s=Object.keys(zr.LoadState).length,c=new Array(s),u=new Array(s),f=0;for(let w=0;w<s;w++){let D=new Array(o).fill(0);c[w]=D,u[w]=0}function d(w){let D=w.keyframeNodes;for(let R=0;R<D.length;R++){let M=D[R],N=M.keyframe,_=M.state;c[_][N]+=1,u[_]+=1,f++}if(l(w.children))for(let R=0;R<8;R++){let M=w.children[R];d(M)}}d(a),e._primitive.statistics.numberOfTilesWithContentReady=u[zr.LoadState.LOADED],e._primitive.statistics.visited=f;let p=u[zr.LoadState.RECEIVING],g=u[zr.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 A=`KEYFRAMES: ${c[zr.LoadState.LOADED]}`,b=`UNLOADED: ${u[zr.LoadState.UNLOADED]} | RECEIVING: ${u[zr.LoadState.RECEIVING]} | PROCESSING: ${u[zr.LoadState.PROCESSING]} | LOADED: ${u[zr.LoadState.LOADED]} | FAILED: ${u[zr.LoadState.FAILED]} | UNAVAILABLE: ${u[zr.LoadState.UNAVAILABLE]} | TOTAL: ${f}`,x=Math.round(n*100)/100,T=Math.round(i*100)/100,C=Math.round(r*100)/100,E=`LOAD: ${x} | OCT: ${T} | ALL: ${C}`;console.log(`${A} || ${b} || ${E}`)}var fH={INTERNAL:0,LEAF:1,PACKED_LEAF_FROM_PARENT:2};function qPt(e,t,n){let i=e._primitive._screenSpaceError,r=e._keyframeLocation,o=e._frameNumber,a=t>=2,s=0,c=0,u=[],f=[];function d(g,m,y,A,b){let x=!1;if(l(g.children))for(let T=0;T<8;T++){let C=g.children[T];C.computeSurroundingRenderableKeyframeNodes(r),C.isRenderable(o)&&(x=!0)}if(x){u[b]=fH.INTERNAL<<16|m,u[y]=A,s++,A=m,b=A*9+1;for(let T=0;T<8;T++){let C=g.children[T];m=s,y=m*9+0,d(C,m,y,A,b+T)}}else{if(e._primitive.tileVisible.raiseEvent(),a){let T=c*5,C=g.renderableKeyframeNodePrevious,E=g.level-C.spatialNode.level,w=C.spatialNode.parent,D=l(w)?w.renderableKeyframeNodePrevious:C,R=YPt(g,i,n),M=E,N=1,_=C.megatextureIndex,v=D.megatextureIndex;f[T+0]=R,f[T+1]=M,f[T+2]=N,f[T+3]=_,f[T+4]=v,u[b]=fH.LEAF<<16|c}else{let T=g.renderableKeyframeNodePrevious,E=g.level-T.spatialNode.level===0?fH.LEAF:fH.PACKED_LEAF_FROM_PARENT;u[b]=E<<16|T.megatextureIndex}c++}}let p=e.rootNode;p.computeSurroundingRenderableKeyframeNodes(r),p.isRenderable(o)&&d(p,0,0,0,0),XPt(u,9,e.internalNodeTilesPerRow,e.internalNodeTexture),a&&KPt(f,2,e.leafNodeTilesPerRow,e.leafNodeTexture)}function YPt(e,t,n){if(e.parent===void 0)return 0;let i=e.screenSpaceError,r=e.parent.screenSpaceError,a=((t-i)/(r-i)+n-1)/n;return I.clamp(a,0,1)}function XPt(e,t,n,i){let r=He.componentsLength(i.pixelFormat),o=Math.ceil(e.length/t),a=Math.max(1,t*Math.min(o,n)),s=Math.max(1,Math.ceil(o/n)),c=new Uint8Array(a*s*r);for(let d=0;d<e.length;d++){let p=e[d],g=d*r;for(let m=0;m<r;m++)c[g+m]=p>>>m*8&255}let f={source:{arrayBufferView:c,width:a,height:s},xOffset:0,yOffset:0};i.copyFrom(f)}function KPt(e,t,n,i){let r=He.componentsLength(i.pixelFormat),o=5,a=Math.ceil(e.length/o),s=Math.max(1,t*Math.min(a,n)),c=Math.max(1,Math.ceil(a/n)),u=new Uint8Array(s*c*r);for(let p=0;p<a;p++){let g=e[p*o+0],m=e[p*o+1],y=e[p*o+2],A=e[p*o+3],b=e[p*o+4],x=I.clamp(Math.floor(65536*g),0,65535);u[p*8+0]=x>>>0&255,u[p*8+1]=x>>>8&255,u[p*8+2]=m&255,u[p*8+3]=y&255,u[p*8+4]=A>>>0&255,u[p*8+5]=A>>>8&255,u[p*8+6]=b>>>0&255,u[p*8+7]=b>>>8&255}let d={source:{arrayBufferView:u,width:s,height:c},xOffset:0,yOffset:0};i.copyFrom(d)}var dH=uA;function Up(e){e=e??H.EMPTY_OBJECT;let{provider:t=Up.DefaultProvider,modelMatrix:n=O.IDENTITY,customShader:i=rR(t),clock:r,calculateStatistics:o=!1}=e;this._ready=!1,this._provider=t,this._traversal=void 0,this._statistics=new Ip,this._calculateStatistics=o;let{shape:a,minBounds:s=Sc.getMinBounds(a),maxBounds:c=Sc.getMaxBounds(a),dimensions:u,paddingBefore:f=h.ZERO,paddingAfter:d=h.ZERO,metadataOrder:p,availableLevels:g=1}=t;this._dimensions=h.clone(u),this._paddingBefore=h.clone(f),this._paddingAfter=h.clone(d),this._inputDimensions=$Pt(u,f,d,p),this._availableLevels=g,this._minBounds=s.clone(),this._minBoundsOld=new h,this._maxBounds=c.clone(),this._maxBoundsOld=new h,this._minClippingBounds=s.clone(),this._minClippingBoundsOld=new h,this._maxClippingBounds=c.clone(),this._maxClippingBoundsOld=new h,this._verticalExaggeration=1,this._verticalExaggerationRelativeHeight=0,this._clippingPlanes=void 0,this._clippingPlanesState=0,this._clippingPlanesEnabled=!1,this._modelMatrix=O.clone(n),this._modelMatrixOld=O.clone(this._modelMatrix),this._customShader=i??Up.DefaultCustomShader,this._customShaderCompilationEvent=new be,this._shaderDirty=!0,this._drawCommand=void 0,this._drawCommandPick=void 0,this._pickId=void 0,this._clock=r,this._transformPositionLocalToWorld=new O,this._transformPositionWorldToLocal=new O,this._transformPlaneLocalToView=new O,this._transformDirectionWorldToLocal=new $,this._nearestSampling=!1,this._levelBlendFactor=0,this._stepSizeMultiplier=1,this._depthTest=!0,this._useLogDepth=void 0,this._screenSpaceError=4,this._debugPolylines=new Ep,this._debugDraw=!1,this._disableRender=!1,this._disableUpdate=!1;let m=Sc.getShapeConstructor(a);this._shape=new m,nIe(this),this._shapeVisible=iIe(this),this._uniforms={octreeInternalNodeTexture:void 0,octreeInternalNodeTilesPerRow:0,octreeInternalNodeTexelSizeUv:new k,octreeLeafNodeTexture:void 0,octreeLeafNodeTilesPerRow:0,octreeLeafNodeTexelSizeUv:new k,megatextureTextures:[],megatextureTileCounts:new h,dimensions:this._dimensions,inputDimensions:this._inputDimensions,paddingBefore:this._paddingBefore,paddingAfter:this._paddingAfter,transformPositionViewToLocal:new O,transformDirectionViewToLocal:new $,cameraPositionLocal:new h,cameraDirectionLocal:new h,cameraTileCoordinates:new ae,cameraTileUv:new h,ndcSpaceAxisAlignedBoundingBox:new ae,clippingPlanesTexture:void 0,clippingPlanesMatrix:new O,renderBoundPlanesTexture:void 0,stepSize:this._stepSizeMultiplier,pickColor:new U},this._shapeDefinesOld={},this._uniformMap={};let y=this._uniforms,A=this._uniformMap;for(let b in y)if(y.hasOwnProperty(b)){let x=`u_${b}`;A[x]=function(){return y[b]}}JPt(this,this._shape),this.tileLoad=new be,this.tileVisible=new be,this.tileFailed=new be,this.tileUnload=new be,this.loadProgress=new be,this.allTilesLoaded=new be,this.initialTilesLoaded=new be}function $Pt(e,t,n,i){let r=h.add(e,t,new h);if(h.add(r,n,r),i===Dg.Y_UP){let o=r.y;r.y=r.z,r.z=o}return r}function JPt(e,t){let n=e._uniformMap,{shaderUniforms:i,shaderDefines:r}=t;for(let o in i)if(i.hasOwnProperty(o)){let a=`u_${o}`;n[a]=function(){return i[o]}}e._shapeDefinesOld=Xe(r,!0)}Object.defineProperties(Up.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){this._modelMatrix=O.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){this._disableRender=!e}},disableUpdate:{get:function(){return this._disableUpdate},set:function(e){this._disableUpdate=e}},debugDraw:{get:function(){return this._debugDraw},set:function(e){this._debugDraw=e}},depthTest:{get:function(){return this._depthTest},set:function(e){this._depthTest!==e&&(this._depthTest=e,this._shaderDirty=!0)}},nearestSampling:{get:function(){return this._nearestSampling},set:function(e){this._nearestSampling=e}},levelBlendFactor:{get:function(){return this._levelBlendFactor},set:function(e){this._levelBlendFactor=I.clamp(e,0,1)}},screenSpaceError:{get:function(){return this._screenSpaceError},set:function(e){this._screenSpaceError=e}},stepSize:{get:function(){return this._stepSizeMultiplier},set:function(e){this._stepSizeMultiplier=e}},minBounds:{get:function(){return this._minBounds},set:function(e){this._minBounds=h.clone(e,this._minBounds)}},maxBounds:{get:function(){return this._maxBounds},set:function(e){this._maxBounds=h.clone(e,this._maxBounds)}},minClippingBounds:{get:function(){return this._minClippingBounds},set:function(e){this._minClippingBounds=h.clone(e,this._minClippingBounds)}},maxClippingBounds:{get:function(){return this._maxClippingBounds},set:function(e){this._maxClippingBounds=h.clone(e,this._maxClippingBounds)}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){va.setOwner(e,this,"_clippingPlanes")}},customShader:{get:function(){return this._customShader},set:function(e){if(e===this._customShader)return;let t=this._uniformMap,i=this._customShader.uniformMap;for(let r in i)i.hasOwnProperty(r)&&delete t[r];if(l(e))this._customShader=e;else{let r=rR(this._provider);this._customShader=r??Up.DefaultCustomShader}this._shaderDirty=!0}},customShaderCompilationEvent:{get:function(){return this._customShaderCompilationEvent}},statistics:{get:function(){return this._statistics}}});var ZPt=new ae,QPt=new ae,eDt=new O,tDt=new O,nDt=new h,iDt=new ae;Up.prototype.update=function(e){let t=this._provider,n=this._uniforms;this._customShader.update(e);let i=e.context;if(!this._ready){uDt(this,t,i),e.afterRender.push(()=>(this._ready=!0,!0));return}let r=nIe(this),o=lDt(this,e);if((r||o)&&(this._shapeVisible=iIe(this),bDt(this)&&(this._shaderDirty=!0)),!this._shapeVisible)return;this._shape.updateViewTransforms(e);let a=xDt(t.timeIntervalCollection,this._clock),s=this._traversal,c=s._sampleCount;if(s.update(e,a,r,this._disableUpdate),c!==s._sampleCount&&(this._shaderDirty=!0),!s.isRenderable(s.rootNode)||(this._debugDraw&&PDt(this,e),this._disableRender))return;this._useLogDepth!==e.useLogDepth&&(this._useLogDepth=e.useLogDepth,this._shaderDirty=!0),TDt(this,e)&&(this._shaderDirty=!0);let f=s.leafNodeTexture;l(f)&&(n.octreeLeafNodeTexture=s.leafNodeTexture,n.octreeLeafNodeTexelSizeUv=k.clone(s.leafNodeTexelSizeUv,n.octreeLeafNodeTexelSizeUv),n.octreeLeafNodeTilesPerRow=s.leafNodeTilesPerRow),this._shaderDirty&&(aH(this,i),this._shaderDirty=!1);let d=i.uniformState.viewProjection,{orientedBoundingBox:p}=this._shape,g=EDt(p,d,QPt);if(g.x===1||g.y===1||g.z===-1||g.w===-1)return;n.ndcSpaceAxisAlignedBoundingBox=ae.clone(g,n.ndcSpaceAxisAlignedBoundingBox);let y=i.uniformState.inverseView,A=O.multiplyTransformation(this._transformPositionWorldToLocal,y,n.transformPositionViewToLocal);this._transformPlaneLocalToView=O.transpose(A,this._transformPlaneLocalToView);let b=i.uniformState.inverseViewRotation;n.transformDirectionViewToLocal=$.multiply(this._transformDirectionWorldToLocal,b,n.transformDirectionViewToLocal),n.cameraPositionLocal=O.multiplyByPoint(this._transformPositionWorldToLocal,e.camera.positionWC,n.cameraPositionLocal),n.cameraDirectionLocal=$.multiplyByVector(this._transformDirectionWorldToLocal,e.camera.directionWC,n.cameraDirectionLocal);let x=aDt(this,n.cameraPositionLocal,iDt);n.cameraTileCoordinates=ae.fromElements(Math.floor(x.x),Math.floor(x.y),Math.floor(x.z),x.w,n.cameraTileCoordinates),n.cameraTileUv=h.fromElements(x.x-Math.floor(x.x),x.y-Math.floor(x.y),x.z-Math.floor(x.z),n.cameraTileUv),n.stepSize=this._stepSizeMultiplier,rDt(this),oDt(this,e);let T=e.passes.pick?this._drawCommandPick:e.passes.pickVoxel?this._drawCommandPickVoxel:this._drawCommand;T.boundingVolume=this._shape.boundingSphere,e.commandList.push(T)};function rDt(e){let{megatextures:t}=e._traversal;for(let n=0;n<t.length;++n)t[n].nearestSampling=e._nearestSampling}function oDt(e,t){let n=e._uniforms,{renderBoundPlanes:i}=e._shape;l(i)&&(i.update(t,e._transformPlaneLocalToView),n.renderBoundPlanesTexture=i.texture)}function aDt(e,t,n){let i=e._shape.convertLocalToShapeUvSpace(t,nDt),r=e._availableLevels,o=2**(r-1);return ae.fromElements(i.x*o,i.y*o,i.z*o,r-1,n)}var sDt=new h,yte=new h,cDt=new de;function lDt(e,t){let{verticalExaggeration:n,verticalExaggerationRelativeHeight:i}=t;return e._verticalExaggeration===n&&e._verticalExaggerationRelativeHeight===i?!1:(e._verticalExaggeration=n,e._verticalExaggerationRelativeHeight=i,!0)}function uDt(e,t,n){let i=e._uniforms;e._pickId=n.createPickId({primitive:e}),i.pickColor=U.clone(e._pickId.color,i.pickColor);let r=t.keyframeCount??1;e._traversal=new dH(e,n,r),e.statistics.texturesByteLength=e._traversal.textureMemoryByteLength,ADt(e._traversal,i)}function nIe(e){return uR(e,"_modelMatrix","_modelMatrixOld")+uR(e,"_minBounds","_minBoundsOld")+uR(e,"_maxBounds","_maxBoundsOld")+uR(e,"_minClippingBounds","_minClippingBoundsOld")+uR(e,"_maxClippingBounds","_maxClippingBoundsOld")>0}function uR(e,t,n){let i=e[t],r=e[n],o=!i.equals(r);return o&&i.clone(r),o?1:0}var fDt=new h,dDt=new h,hDt=new h,mDt=new h,pDt=new O,gDt=new O;function iIe(e){let t=e._verticalExaggeration,n=e._verticalExaggerationRelativeHeight,i=h.clone(e._minBounds,fDt),r=h.clone(e._maxBounds,dDt),o=h.clone(e._minClippingBounds,hDt),a=h.clone(e._maxClippingBounds,mDt),s=O.clone(e._modelMatrix,pDt);if(e.shape===Sc.ELLIPSOID)i.z=pr.getHeight(e._minBounds.z,t,n),r.z=pr.getHeight(e._maxBounds.z,t,n),o.z=pr.getHeight(e._minClippingBounds.z,t,n),a.z=pr.getHeight(e._maxClippingBounds.z,t,n);else{let m=h.fromElements(1,1,t,sDt);O.multiplyByScale(s,m,s),O.multiplyByTranslation(s,yDt(e),s)}let c=e._provider,u=c.shapeTransform??O.IDENTITY,f=c.globalTransform??O.IDENTITY,d=O.multiplyTransformation(f,s,gDt);O.multiplyTransformation(d,u,d);let p=e._shape;return p.update(d,i,r,o,a)?(e._transformPositionLocalToWorld=O.clone(p.shapeTransform,e._transformPositionLocalToWorld),e._transformPositionWorldToLocal=O.inverse(e._transformPositionLocalToWorld,e._transformPositionWorldToLocal),e._transformDirectionWorldToLocal=O.getMatrix3(e._transformPositionWorldToLocal,e._transformDirectionWorldToLocal),!0):!1}var _Dt=new h;function yDt(e){let t=e._verticalExaggeration,n=e._verticalExaggerationRelativeHeight,{shapeTransform:i=O.IDENTITY,globalTransform:r=O.IDENTITY}=e._provider,o=O.getTranslation(i,yte),a=O.multiplyByPoint(e._modelMatrix,o,yte),s=O.multiplyByPoint(r,a,yte),u=te.WGS84.cartesianToCartographic(s,cDt),f=0;l(u)&&(f=u.height);let d=pr.getHeight(f,t,n);return h.fromElements(0,0,(d-f)/t,_Dt)}function ADt(e,t){t.octreeInternalNodeTexture=e.internalNodeTexture,t.octreeInternalNodeTexelSizeUv=k.clone(e.internalNodeTexelSizeUv,t.octreeInternalNodeTexelSizeUv),t.octreeInternalNodeTilesPerRow=e.internalNodeTilesPerRow;let{megatextures:n}=e,i=n[0];t.megatextureTextures=new Array(n.length);for(let r=0;r<n.length;r++)t.megatextureTextures[r]=n[r].texture;t.megatextureTileCounts=h.clone(i.tileCounts,t.megatextureTileCounts)}function bDt(e){let{shaderDefines:t}=e._shape,n=Object.keys(t).some(i=>t[i]!==e._shapeDefinesOld[i]);return n&&(e._shapeDefinesOld=Xe(t,!0)),n}function xDt(e,t){if(!l(e)||!l(t))return 0;let n=t.currentTime,i,r=e.indexOf(n);r>=0?i=e.get(r):(r=~r,r===e.length?(r=e.length-1,i=e.get(r),n=i.stop):(i=e.get(r),n=i.start));let o=K.secondsDifference(i.stop,i.start),s=K.secondsDifference(n,i.start)/o;return r+s}function TDt(e,t){let n=e.clippingPlanes;if(!l(n))return!1;n.update(t);let{clippingPlanesState:i,enabled:r}=n;if(r){let o=e._uniforms;o.clippingPlanesTexture=n.texture,o.clippingPlanesMatrix=O.transpose(O.multiplyTransformation(O.inverse(n.modelMatrix,o.clippingPlanesMatrix),e._transformPositionLocalToWorld,o.clippingPlanesMatrix),o.clippingPlanesMatrix)}return e._clippingPlanesState===i&&e._clippingPlanesEnabled===r?!1:(e._clippingPlanesState=i,e._clippingPlanesEnabled=r,!0)}Up.prototype.isDestroyed=function(){return!1};Up.prototype.destroy=function(){let e=this._drawCommand;l(e)&&(e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy());let t=this._drawCommandPick;return l(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(),ue(this)};var tIe=new Array(new ae(-1,-1,-1,1),new ae(1,-1,-1,1),new ae(-1,1,-1,1),new ae(1,1,-1,1),new ae(-1,-1,1,1),new ae(1,-1,1,1),new ae(-1,1,1,1),new ae(1,1,1,1)),CDt=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),vDt=new Array(new ae,new ae,new ae,new ae,new ae,new ae,new ae,new ae);function EDt(e,t,n){let i=O.fromRotationTranslation(e.halfAxes,e.center,eDt),r=O.multiply(t,i,tDt),o=+Number.MAX_VALUE,a=-Number.MAX_VALUE,s=+Number.MAX_VALUE,c=-Number.MAX_VALUE,u,f=vDt,d=tIe.length;for(u=0;u<d;u++)O.multiplyByVector(r,tIe[u],f[u]);for(u=0;u<d;u++){let p=f[u];if(p.z>=-p.w){let g=p.x/p.w,m=p.y/p.w;o=Math.min(o,g),a=Math.max(a,g),s=Math.min(s,m),c=Math.max(c,m)}else for(let g=0;g<3;g++){let m=CDt[u*3+g],y=f[m];if(y.z>=-y.w){let A=p.z+p.w,b=y.z+y.w,x=A/(A-b),T=ae.lerp(p,y,x,ZPt),C=T.x/T.w,E=T.y/T.w;o=Math.min(o,C),a=Math.max(a,C),s=Math.min(s,E),c=Math.max(c,E)}}}return o=I.clamp(o,-1,1),s=I.clamp(s,-1,1),a=I.clamp(a,-1,1),c=I.clamp(c,-1,1),n=ae.fromElements(o,s,a,c,n),n}var Ate=3e7,SDt=new h(Ate,0,0),wDt=new h(0,Ate,0),IDt=new h(0,0,Ate);function PDt(e,t){let n=e._traversal,i=e._debugPolylines;i.removeAll();function r(c,u,f,d){i.add({positions:[c,u],width:d,material:ir.fromType("Color",{color:f})})}function o(c,u,f){let d=c.computeCorners();r(d[0],d[1],u,f),r(d[2],d[3],u,f),r(d[4],d[5],u,f),r(d[6],d[7],u,f),r(d[0],d[2],u,f),r(d[4],d[6],u,f),r(d[1],d[3],u,f),r(d[5],d[7],u,f),r(d[0],d[4],u,f),r(d[2],d[6],u,f),r(d[1],d[5],u,f),r(d[3],d[7],u,f)}function a(c){if(!n.isRenderable(c))return;let u=c.level,d=Math.max(1,5/Math.pow(2,u)),g=[U.RED,U.LIME,U.BLUE][u%3];if(o(c.orientedBoundingBox,g,d),l(c.children))for(let m=0;m<8;m++)a(c.children[m])}o(e._shape.orientedBoundingBox,U.WHITE,5),a(n.rootNode);let s=10;r(h.ZERO,SDt,U.RED,s),r(h.ZERO,wDt,U.LIME,s),r(h.ZERO,IDt,U.BLUE,s),i.update(t)}Up.DefaultCustomShader=new Pg({fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material)
|
|
{
|
|
vec3 voxelNormal = fsInput.attributes.normalEC;
|
|
float diffuse = max(0.0, dot(voxelNormal, czm_lightDirectionEC));
|
|
float lighting = 0.5 + 0.5 * diffuse;
|
|
material.diffuse = vec3(lighting);
|
|
material.alpha = 1.0;
|
|
}`});function rIe(){this.shape=Sc.BOX,this.dimensions=new h(1,1,1),this.names=["data"],this.types=[gt.SCALAR],this.componentTypes=[Mt.FLOAT32],this.maximumTileCount=1}rIe.prototype.requestData=function(e){if((l(e)?e.tileLevel??0:0)>=1)return;let n=new LS({metadata:[new Float32Array(1)]});return Promise.resolve(n)};Up.DefaultProvider=new rIe;var qx=Up;function DDt(e,t,n,i){if(!l(e)||l(t)&&e.id!==t)return;let o=(e.classes||{})[n];if(!l(o))return;let s=(o.properties||{})[i];if(l(s))return s}var hH=DDt;function RDt(e,t,n,i,r){this.schemaId=e,this.className=t,this.propertyName=n,this.classProperty=i,this.metadataProperty=r}var mH=RDt;function ODt(e,t,n){if(!l(e))return;let i=e.propertyTextures;for(let r of i)if(r.class.id===t){let s=r.properties[n];if(l(s))return s}}var pH=ODt;var _H=function(e){return function(){e.frameState.afterRender.push(function(){e.requestRender()})}};function di(e){e=e??H.EMPTY_OBJECT;let t=e.canvas,n=e.creditContainer,i=e.creditViewport,r=e.contextOptions instanceof Hk;if(r)this._context=e.contextOptions.createSceneContext(t);else{let u=Xe(e.contextOptions);this._context=new Tv(t,u)}let o=this._context,a=l(n);a||(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)),l(i)||(i=t.parentNode),this._id=Kn(),this._jobScheduler=new wj,this._frameState=new vj(o,new pj(n,"\u2022",i),this._jobScheduler),this._frameState.scene3DOnly=e.scene3DOnly??!1,this._removeCreditContainer=!a,this._creditContainer=n,this._canvas=t,this._computeEngine=new Ok(o),this._ellipsoid=e.ellipsoid??te.default,this._globe=void 0,this._globeTranslucencyState=new Ej,this._primitives=new pu({countReferences:r}),this._groundPrimitives=new pu({countReferences:r}),this._globeHeight=void 0,this._globeHeightDirty=!0,this._cameraUnderground=!1,this._removeUpdateHeightCallback=void 0,this._logDepthBuffer=di.defaultLogDepthBuffer&&o.fragmentDepth,this._logDepthBufferDirty=!0,this._tweens=new DS,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._overlayCommandList=[],this._useOIT=e.orderIndependentTranslucency??!0,this._executeOITFunction=void 0,this._depthPlane=new bj(e.depthPlaneEllipsoidOffset),this._clearColorCommand=new ui({color:new U,stencil:0,owner:this}),this._depthClearCommand=new ui({depth:1,owner:this}),this._stencilClearCommand=new ui({stencil:0}),this._classificationStencilClearCommand=new ui({stencil:0,renderState:je.fromCache({stencilMask:qt.CLASSIFICATION_MASK})}),this._depthOnlyRenderStateCache={},this._transitioner=new b6(this),this._preUpdate=new be,this._postUpdate=new be,this._renderError=new be,this._preRender=new be,this._postRender=new be,this._controllerHost=new dj,this._minimumDisableDepthTestDistance=0,this._debugInspector=new k6,this._msaaSamples=e.msaaSamples??4,this.rethrowRenderErrors=!1,this.completeMorphOnUserInput=!0,this.morphStart=new be,this.morphComplete=new be,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=U.clone(U.BLACK),this._mode=re.SCENE3D,this._mapProjection=l(e.mapProjection)?e.mapProjection:new ki(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 mE,this.fog=new Cj,this.fog.enabled=te.WGS84.equals(this._ellipsoid),te.WGS84.equals(this._ellipsoid)||(Ir.DEFAULT_VIEW_RECTANGLE=ie.fromDegrees(-45,-45,45,45)),this._shadowMapCamera=new Ir(this),this.shadowMap=new aA({context:o,lightCamera:this._shadowMapCamera,enabled:e.shadows??!1}),this.invertClassification=!1,this.invertClassificationColor=U.clone(U.WHITE),this._actualInvertClassificationColor=U.clone(this._invertClassificationColor),this._invertClassification=new G1,this.focalLength=void 0,this.eyeSeparation=void 0,this.postProcessStages=new y6,this._brdfLutGenerator=new ij,this._performanceDisplay=void 0,this._debugVolume=void 0,this._screenSpaceCameraController=new R6(this),this._cameraUnderground=!1,this._mapMode2D=e.mapMode2D??Du.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=fl.requestCompletedEvent.addEventListener(_H(this)),this._removeTaskProcessorListenerCallback=Yn.taskCompletedEvent.addEventListener(_H(this)),this._removeGlobeCallbacks=[],this._removeTerrainProviderReadyListener=void 0;let s=new Je(0,0,o.drawingBufferWidth,o.drawingBufferHeight),c=new Ir(this);this._logDepthBuffer&&(c.frustum.near=.1,c.frustum.far=1e10),this.preloadFlightCamera=new Ir(this),this.preloadFlightCullingVolume=void 0,this._picking=new Jj(this),this._defaultView=new SS(this,c,s),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 ny,this._enableEdgeVisibility=!1,this._enablePlanarFillId=!1,uIe(this,0,K.now()),this.updateFrameState(),this.initializeFrame()}di.defaultLogDepthBuffer=!0;function MDt(e,t){for(let i=0;i<e._removeGlobeCallbacks.length;++i)e._removeGlobeCallbacks[i]();e._removeGlobeCallbacks.length=0;let n=[];l(t)&&(n.push(t.imageryLayersUpdatedEvent.addEventListener(_H(e))),n.push(t.terrainProviderChanged.addEventListener(_H(e)))),e._removeGlobeCallbacks=n}Object.defineProperties(di.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 Ft.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return Ft.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 hp.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,MDt(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}},controllerHost:{get:function(){return this._controllerHost}},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(l(this.globe))return this.globe.imageryLayers}},terrainProvider:{get:function(){if(l(this.globe))return this.globe.terrainProvider},set:function(e){this._removeTerrainProviderReadyListener=this._removeTerrainProviderReadyListener&&this._removeTerrainProviderReadyListener(),l(this.globe)&&(this.globe.terrainProvider=e)}},terrainProviderChanged:{get:function(){if(l(this.globe))return this.globe.terrainProviderChanged}},vectorProvider:{get:function(){return this.globe?.vectorProvider}},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){e===re.SCENE2D?this.morphTo2D(0):e===re.SCENE3D?this.morphTo3D(0):e===re.COLUMBUS_VIEW&&this.morphToColumbusView(0),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){this._useWebVR=e,this._useWebVR?(this._frameState.creditDisplay.container.style.visibility="hidden",this._cameraVR=new Ir(this),l(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new Tj(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){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,Ft.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}}});di.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 LDt(e,t){let n=e.pickedMetadataInfo,i=t.pickedMetadataInfo;return n?.schemaId!==i?.schemaId||n?.className!==i?.className||n?.propertyName!==i?.propertyName}function oIe(e,t,n){let i=e._frameState,r=e._context,o=e._view.oit,{lightShadowMaps:a,lightShadowsEnabled:s}=i.shadowState,c=t.derivedCommands;l(t.pickId)&&(c.picking=Op.createPickDerivedCommand(e,t,r,c.picking)),l(t.snapId)&&i.passes.snap&&(c.snapping=Op.createSnapDerivedCommand(e,t,r,c.snapping)),i.pickingMetadata&&t.pickMetadataAllowed&&(t.pickedMetadataInfo=i.pickedMetadataInfo,l(t.pickedMetadataInfo)&&(c.pickingMetadata=Op.createPickMetadataDerivedCommand(e,t,r,c.pickingMetadata))),t.pickOnly||(c.depth=Op.createDepthOnlyDerivedCommand(e,t,r,c.depth)),c.originalCommand=t,e._hdr&&(c.hdr=Op.createHdrCommand(t,r,c.hdr),t=c.hdr.command,c=t.derivedCommands),s&&t.receiveShadows&&(c.shadows=aA.createReceiveDerivedCommand(a,t,n,r,c.shadows)),t.pass===Pe.TRANSLUCENT&&l(o)&&o.isSupported()&&(s&&t.receiveShadows?(c.oit=l(c.oit)?c.oit:{},c.oit.shadows=o.createDerivedCommands(c.shadows.receiveCommand,r,c.oit.shadows)):c.oit=o.createDerivedCommands(t,r,c.oit))}di.prototype.updateDerivedCommands=function(e){let{derivedCommands:t}=e;if(!l(t))return;let n=this._frameState,{shadowState:i,useLogDepth:r}=this._frameState,o=this._context,a=!1,s=i.lastDirtyTime;e.lastDirtyTime!==s&&(e.lastDirtyTime=s,e.dirty=!0,a=!0);let c=this._hdr,u=l(t.logDepth),f=l(t.hdr),d=l(t.originalCommand),p=r&&!u,g=c&&!f,m=(!r||!c)&&!d,y=n.pickingMetadata&&LDt(e,n),A=n.passes.snap&&l(e.snapId)&&!l(t.snapping);if(e.dirty=e.dirty||p||g||m||y||A,!e.dirty)return;e.dirty=!1;let{shadowsEnabled:b,shadowMaps:x}=i;b&&e.castShadows&&(t.shadows=aA.createCastDerivedCommand(x,e,a,o,t.shadows)),(u||p)&&(t.logDepth=Op.createLogDepthCommand(e,o,t.logDepth),oIe(this,t.logDepth.command,a)),(d||m)&&oIe(this,e,a)};var NDt=new Zh({pass:lo.RENDER}),bte=new Zh({pass:lo.PRELOAD}),xte=new Zh({pass:lo.PRELOAD_FLIGHT}),FDt=new Zh({pass:lo.REQUEST_RENDER_MODE_DEFER_CHECK}),aIe=new se,Tte;function BDt(e){if(!(e._mode!==re.SCENE3D||!e.globe?.show||e._cameraUnderground||e._globeTranslucencyState.translucent))return aIe.radius=e.ellipsoid.minimumRadius+e.frameState.minimumTerrainHeight,Tte=WN.fromBoundingSphere(aIe,e.camera.positionWC,Tte),Tte}di.prototype.clearPasses=function(e){e.render=!1,e.pick=!1,e.pickVoxel=!1,e.snap=!1,e.depth=!1,e.postProcess=!1,e.offscreen=!1};function uIe(e,t,n){let i=e._frameState;i.frameNumber=t,i.time=K.clone(n,i.time)}di.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=BDt(this),t.minimumTerrainHeight=0,t.minimumDisableDepthTestDistance=this._minimumDisableDepthTestDistance,t.invertClassification=this.invertClassification,t.useLogDepth=this._logDepthBuffer&&!(this.camera.frustum instanceof pn||this.camera.frustum instanceof Aa),t.light=this.light,t.cameraUnderground=this._cameraUnderground,t.globeTranslucencyState=this._globeTranslucencyState;let{globe:n}=this;l(n)&&n._terrainExaggerationChanged&&(this.verticalExaggeration=n._terrainExaggeration,this.verticalExaggerationRelativeHeight=n._terrainExaggerationRelativeHeight,n._terrainExaggerationChanged=!1),t.verticalExaggeration=this.verticalExaggeration,t.verticalExaggerationRelativeHeight=this.verticalExaggerationRelativeHeight,l(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=U.clone(this.invertClassificationColor,this._actualInvertClassificationColor),G1.isTranslucencySupported(this._context)||(this._actualInvertClassificationColor.alpha=1),t.invertClassificationColor=this._actualInvertClassificationColor,l(this.globe)?t.maximumScreenSpaceError=this.globe.maximumScreenSpaceError:t.maximumScreenSpaceError=2,this.clearPasses(t.passes),t.tilesetPassState=void 0};di.prototype.isVisible=function(e,t,n){if(!l(t))return!1;let{boundingVolume:i}=t;return!l(i)||!t.cull?!0:e.computeVisibility(i)===Xt.OUTSIDE?!1:!l(n)||!t.occlude||!i.isOccluded(n)};var gH=new O(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);gH=O.inverseTransformation(gH,gH);function kDt(e,t,n,i){let r=t._frameState,o=r.context,a=e.boundingVolume;l(t._debugVolume)&&t._debugVolume.destroy();let s=h.clone(a.center);if(r.mode!==re.SCENE3D){s=O.multiplyByPoint(gH,s,s);let m=r.mapProjection,y=m.unproject(s);s=m.ellipsoid.cartographicToCartesian(y)}let c,u,{radius:f}=a;l(f)?(c=Ks.createGeometry(new Ks({radii:new h(f,f,f),vertexFormat:_n.FLAT_VERTEX_FORMAT})),u=O.fromTranslation(s)):(c=Nc.createGeometry(Nc.fromDimensions({dimensions:new h(2,2,2),vertexFormat:_n.FLAT_VERTEX_FORMAT})),u=O.fromRotationTranslation(a.halfAxes,s,new O)),t._debugVolume=new Fn({geometryInstances:new Bt({geometry:Gn.toWireframe(c),modelMatrix:u,attributes:{color:new Kt(1,0,0,1)}}),appearance:new _n({flat:!0,translucent:!1}),asynchronous:!1});let d=r.commandList,p=r.commandList=[];t._debugVolume.update(r),e=p[0],r.useLogDepth&&(e=Op.createLogDepthCommand(e,o).command);let g;l(i)&&(g=n.framebuffer,n.framebuffer=i),e.execute(o,n),l(g)&&(n.framebuffer=g),r.commandList=d}function Ul(e,t,n,i){let r=t._frameState,o=t._context;if(l(t.debugCommandFilter)&&!t.debugCommandFilter(e))return;if(e instanceof ui){e.execute(o,n);return}e.debugShowBoundingVolume&&l(e.boundingVolume)&&kDt(e,t,n,i),r.useLogDepth&&l(e.derivedCommands.logDepth)&&(e=e.derivedCommands.logDepth.command);let a=r.passes;if(!a.pick&&!a.pickVoxel&&!a.depth&&t._hdr&&l(e.derivedCommands)&&l(e.derivedCommands.hdr)&&(e=e.derivedCommands.hdr.command),a.pick||a.depth){if(a.pick&&!a.depth){if(r.passes.snap){l(e.derivedCommands.snapping)?(e=e.derivedCommands.snapping.snapCommand,e.execute(o,n)):l(e.derivedCommands.depth)&&(e=e.derivedCommands.depth.depthOnlyCommand,e.execute(o,n));return}if(r.pickingMetadata&&l(e.derivedCommands.pickingMetadata)){e=e.derivedCommands.pickingMetadata.pickMetadataCommand,e.execute(o,n);return}if(!r.pickingMetadata&&l(e.derivedCommands.picking)){e=e.derivedCommands.picking.pickCommand,e.execute(o,n);return}}else if(l(e.derivedCommands.depth)){e=e.derivedCommands.depth.depthOnlyCommand,e.execute(o,n);return}}if(t.debugShowCommands||t.debugShowFrustums){t._debugInspector.executeDebugShowFrustumsCommand(t,e,n);return}r.shadowState.lightShadowsEnabled&&e.receiveShadows&&l(e.derivedCommands.shadows)?e.derivedCommands.shadows.receiveCommand.execute(o,n):e.execute(o,n)}function sIe(e,t,n){let{derivedCommands:i}=e;if(!l(i))return;let r=t._frameState,o=t._context;r.useLogDepth&&l(i.logDepth)&&(e=i.logDepth.command);let{picking:a,pickingMetadata:s,depth:c}=e.derivedCommands;l(s)&&(e=i.pickingMetadata.pickMetadataCommand,e.execute(o,n)),l(a)?(e=a.pickCommand,e.execute(o,n)):l(c)&&(e=c.depthOnlyCommand,e.execute(o,n))}function fIe(e,t,n){return t.boundingVolume.distanceSquaredTo(n)-e.boundingVolume.distanceSquaredTo(n)}var zDt=new h;function cIe(e,t){let n=h.subtract(e,t,zDt),i=Math.max(0,h.magnitude(n));return i*i}function UDt(e,t,n){let i=e.boundingVolume,r=t.boundingVolume;return cIe(r.center,n)-cIe(i.center,n)}function VDt(e,t,n){return e.boundingVolume.distanceSquaredTo(n)-t.boundingVolume.distanceSquaredTo(n)+I.EPSILON12}function jDt(e,t,n,i,r){U0(i,fIe,e.camera.positionWC),l(r)&&t(r.unclassifiedCommand,e,n);for(let o=0;o<i.length;++o)t(i[o],e,n)}function HDt(e,t,n,i,r){U0(i,VDt,e.camera.positionWC),l(r)&&t(r.unclassifiedCommand,e,n);for(let o=0;o<i.length;++o)t(i[o],e,n)}function GDt(e,t,n){e.context.uniformState.updatePass(Pe.VOXELS);let i=n.commands[Pe.VOXELS];i.length=n.indices[Pe.VOXELS],U0(i,fIe,e.camera.positionWC);for(let r=0;r<i.length;++r)Ul(i[r],e,t)}function WDt(e,t,n){e.context.uniformState.updatePass(Pe.GAUSSIAN_SPLATS);let i=n.commands[Pe.GAUSSIAN_SPLATS];i.length=n.indices[Pe.GAUSSIAN_SPLATS],U0(i,UDt,e.camera.positionWC);for(let r=0;r<i.length;++r)Ul(i[r],e,t)}var qDt=new Yi,YDt=new ru,XDt=new pn,KDt=new Aa;function $Dt(e){let{frustum:t}=e;return l(t.fov)?t.clone(qDt):l(t.infiniteProjectionMatrix)?t.clone(YDt):l(t.width)?t.clone(XDt):t.clone(KDt)}function JDt(e){if(e._environmentState.useOIT){if(!l(e._executeOITFunction)){let{view:t,context:n}=e;e._executeOITFunction=function(i,r,o,a,s){t.globeDepth.prepareColorTextures(n),t.oit.executeCommands(i,r,o,a,s)}}return e._executeOITFunction}return e.frameState.passes.render?jDt:HDt}function ZDt(e,t,n){let{frameState:i,context:r}=e,{pick:o,pickVoxel:a}=i.passes,s=o||a,c;!s&&e._environmentState.useInvertClassification&&i.invertClassificationColor.alpha<1&&(c=e._invertClassification);let u=JDt(e);r.uniformState.updatePass(Pe.TRANSLUCENT);let f=n.commands[Pe.TRANSLUCENT];f.length=n.indices[Pe.TRANSLUCENT],u(e,Ul,t,f,c)}function QDt(e,t,n){let{translucentTileClassification:i,globeDepth:r}=e._view;if(!(n.indices[Pe.CESIUM_3D_TILE_CLASSIFICATION]>0)||!i.isSupported())return;let a=n.commands[Pe.TRANSLUCENT];i.executeTranslucentCommands(e,Ul,t,a,r.depthStencilTexture),i.executeClassificationCommands(e,Ul,t,n)}function e1t(e,t,n){e.context.uniformState.updatePass(Pe.CESIUM_3D_TILE_EDGES);let i=t.framebuffer;e.context.uniformState.edgeColorTexture=e.context.defaultTexture,e.context.uniformState.edgeIdTexture=e.context.defaultTexture,e.context.uniformState.edgeDepthTexture=e.context.defaultTexture,e._enableEdgeVisibility&&l(e._view)&&l(e._view.edgeFramebuffer)&&(t.framebuffer=e._view.edgeFramebuffer.framebuffer);let r=n.commands[Pe.CESIUM_3D_TILE_EDGES],o=n.indices[Pe.CESIUM_3D_TILE_EDGES];e._enableEdgeVisibility&&l(e._view)&&l(e._view.edgeFramebuffer)&&e._view.edgeFramebuffer.getClearCommand(new U(0,0,0,0)).execute(e.context,t);for(let a=0;a<o;++a)Ul(r[a],e,t);t.framebuffer=i}function t1t(e,t,n){let{context:i}=e,{uniformState:r}=i;r.updatePass(Pe.CESIUM_3D_TILE_PLANAR_FILL_ID),r.planarFillIdTexture=i.defaultTexture;let o=e._view,a=o&&o.planarFillIdFramebuffer,s=n.commands[Pe.CESIUM_3D_TILE_PLANAR_FILL_ID],c=n.indices[Pe.CESIUM_3D_TILE_PLANAR_FILL_ID];if(c!==0&&e._enablePlanarFillId&&l(a)&&l(a.framebuffer)){let u=t.framebuffer;t.framebuffer=a.framebuffer,a.getClearCommand(new U(0,0,0,0)).execute(i,t);for(let d=0;d<c;++d)Ul(s[d],e,t);t.framebuffer=u}}function n1t(e,t,n){e.context.uniformState.updatePass(Pe.CESIUM_3D_TILE_EDGES_DIRECT);let i=n.commands[Pe.CESIUM_3D_TILE_EDGES_DIRECT],r=n.indices[Pe.CESIUM_3D_TILE_EDGES_DIRECT];for(let o=0;o<r;++o)Ul(i[o],e,t)}function vte(e,t){let{camera:n,context:i,frameState:r}=e,{uniformState:o}=i;o.updateCamera(n),o.planarFillIdTexture=i.defaultTexture;let a=$Dt(n);a.near=n.frustum.near,a.far=n.frustum.far;let s=r.passes,c=s.pick||s.pickVoxel;c||i1t(e,t);let{clearGlobeDepth:u,renderTranslucentDepthForPick:f,useDepthPlane:d,useGlobeDepthFramebuffer:p,useInvertClassification:g,usePostProcessSelected:m}=e._environmentState,{globeDepth:y,globeTranslucencyFramebuffer:A,sceneFramebuffer:b,frustumCommandsList:x}=e._view,T=x.length,C=e._globeTranslucencyState,E=e._depthClearCommand,w=e._stencilClearCommand,D=e._classificationStencilClearCommand,R=e._depthPlane,M=n.position.z;function N(v,S){o.updatePass(S);let P=v.commands[S],L=v.indices[S];for(let F=0;F<L;++F)Ul(P[F],e,t);return L}function _(v,S){o.updatePass(S);let P=v.commands[S],L=v.indices[S];for(let F=0;F<L;++F)sIe(P[F],e,t)}for(let v=0;v<T;++v){let S=T-v-1,P=x[S];e.mode===re.SCENE2D?(n.position.z=M-P.near+1,a.far=Math.max(1,P.far-P.near),a.near=1,o.update(r),o.updateFrustum(a)):(a.near=S!==0?P.near*e.opaqueFrustumNearOffset:P.near,a.far=P.far,o.updateFrustum(a)),E.execute(i,t),i.stencilBuffer&&w.execute(i,t),C.translucent?(o.updatePass(Pe.GLOBE),C.executeGlobeCommands(P,Ul,A,e,t)):N(P,Pe.GLOBE),p&&y.executeCopyDepth(i,t),f||(C.translucent?(o.updatePass(Pe.TERRAIN_CLASSIFICATION),C.executeGlobeClassificationCommands(P,Ul,A,e,t)):N(P,Pe.TERRAIN_CLASSIFICATION)),u&&(E.execute(i,t),d&&R.execute(i,t));let L;if(e1t(e,t,P),e._enableEdgeVisibility&&l(e._view)&&l(e._view.edgeFramebuffer)){let V=e._view.edgeFramebuffer.colorTexture;l(V)?e.context.uniformState.edgeColorTexture=V:e.context.uniformState.edgeColorTexture=e.context.defaultTexture;let z=e._view.edgeFramebuffer.idTexture;l(z)?e.context.uniformState.edgeIdTexture=z:e.context.uniformState.edgeIdTexture=e.context.defaultTexture;let j=e._view.edgeFramebuffer.depthTexture;l(j)?e.context.uniformState.edgeDepthTexture=j:e.context.uniformState.edgeDepthTexture=e.context.defaultTexture}else e.context.uniformState.edgeColorTexture=e.context.defaultTexture,e.context.uniformState.edgeIdTexture=e.context.defaultTexture,e.context.uniformState.edgeDepthTexture=e.context.defaultTexture;if(t1t(e,t,P),e._enablePlanarFillId&&l(e._view)&&l(e._view.planarFillIdFramebuffer)){let V=e._view.planarFillIdFramebuffer.idTexture;o.planarFillIdTexture=l(V)?V:i.defaultTexture}else o.planarFillIdTexture=i.defaultTexture;if(!g||c||f)L=N(P,Pe.CESIUM_3D_TILE),L>0&&(p&&(y.prepareColorTextures(i,u),y.executeUpdateDepth(i,t,y.depthStencilTexture)),f||(L=N(P,Pe.CESIUM_3D_TILE_CLASSIFICATION)));else{e._invertClassification.clear(i,t);let V=t.framebuffer;t.framebuffer=e._invertClassification._fbo.framebuffer,N(P,Pe.CESIUM_3D_TILE),p&&(e._invertClassification.prepareTextures(i),y.executeUpdateDepth(i,t,e._invertClassification._fbo.getDepthStencilTexture())),L=N(P,Pe.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW),t.framebuffer=V,e._invertClassification.executeClassified(i,t),r.invertClassificationColor.alpha===1&&e._invertClassification.executeUnclassified(i,t),L>0&&i.stencilBuffer&&D.execute(i,t),L=N(P,Pe.CESIUM_3D_TILE_CLASSIFICATION)}if(L>0&&i.stencilBuffer&&w.execute(i,t),GDt(e,t,P),N(P,Pe.OPAQUE),n1t(e,t,P),WDt(e,t,P),S!==0&&e.mode!==re.SCENE2D&&(a.near=P.near,o.updateFrustum(a)),ZDt(e,t,P),QDt(e,t,P),i.depthTexture&&e.useDepthPicking&&(p||f)){let V=e._picking.getPickDepth(e,S);V.update(i,y.depthStencilTexture),V.executeCopyDepth(i,t)}if(c||!m)continue;let F=t.framebuffer;t.framebuffer=b.getIdFramebuffer(),a.near=S!==0?P.near*e.opaqueFrustumNearOffset:P.near,a.far=P.far,o.updateFrustum(a),C.translucent?(o.updatePass(Pe.GLOBE),C.executeGlobeCommands(P,sIe,A,e,t)):_(P,Pe.GLOBE),u&&(E.framebuffer=t.framebuffer,E.execute(i,t),E.framebuffer=void 0),u&&d&&R.execute(i,t),_(P,Pe.CESIUM_3D_TILE),_(P,Pe.OPAQUE),_(P,Pe.TRANSLUCENT),t.framebuffer=F}}function i1t(e,t){let{context:n,environmentState:i,view:r}=e;if(n.uniformState.updatePass(Pe.ENVIRONMENT),l(i.skyBoxCommand)&&Ul(i.skyBoxCommand,e,t),i.isSkyAtmosphereVisible&&Ul(i.skyAtmosphereCommand,e,t),i.isSunVisible&&(i.sunDrawCommand.execute(n,t),e.sunBloom&&!i.useWebVR)){let a;i.useGlobeDepthFramebuffer?a=r.globeDepth.framebuffer:i.usePostProcess?a=r.sceneFramebuffer.framebuffer:a=i.originalFramebuffer,e._sunPostProcess.execute(n),e._sunPostProcess.copy(n,a),t.framebuffer=a}i.isMoonVisible&&i.moonCommand.execute(n,t);let o=e.frameState.panoramaCommandList;for(let a=o.length-1;a>=0;a--){let s=o[a];l(s.shaderProgram)?Ul(o[a],e,t):o.splice(a,1)}}function dIe(e){e.context.uniformState.updatePass(Pe.COMPUTE);let t=e._environmentState.sunComputeCommand;l(t)&&t.execute(e._computeEngine);let n=e._computeCommandList;for(let i=0;i<n.length;++i)n[i].execute(e._computeEngine)}function r1t(e,t){e.context.uniformState.updatePass(Pe.OVERLAY);let n=e.context,i=e._overlayCommandList;for(let r=0;r<i.length;++r)i[r].execute(n,t)}function o1t(e,t,n){let{shadowMapCullingVolume:i,isPointLight:r,passes:o}=n,a=o.length,s=[Pe.GLOBE,Pe.CESIUM_3D_TILE,Pe.OPAQUE,Pe.TRANSLUCENT];for(let c=0;c<t.length;++c){let u=t[c];if(e.updateDerivedCommands(u),!(!u.castShadows||s.indexOf(u.pass)<0||!e.isVisible(i,u)))if(r)for(let f=0;f<a;++f)o[f].commandList.push(u);else if(a===1)o[0].commandList.push(u);else{let f=!1;for(let d=a-1;d>=0;--d){let p=o[d].cullingVolume;if(e.isVisible(p,u))o[d].commandList.push(u),f=!0;else if(f)break}}}}function hIe(e){let{shadowState:t,commandList:n}=e.frameState,{shadowsEnabled:i,shadowMaps:r}=t;if(!i)return;let{context:o}=e,{uniformState:a}=o;for(let s=0;s<r.length;++s){let c=r[s];if(c.outOfView)continue;let{passes:u}=c;for(let f=0;f<u.length;++f)u[f].commandList.length=0;o1t(e,n,c);for(let f=0;f<u.length;++f){let d=c.passes[f],{camera:p,commandList:g}=d;a.updateCamera(p),c.updatePass(o,f);for(let m=0;m<g.length;++m){let y=g[m];a.updatePass(y.pass);let A=y.derivedCommands.shadows.castCommands[s];Ul(A,e,d.passState)}}}}var a1t=new h;di.prototype.updateAndExecuteCommands=function(e,t){A1t(this,e,t),this._environmentState.useWebVR?s1t(this,e,t):this._frameState.mode!==re.SCENE2D||this._mapMode2D===Du.ROTATE?fA(!0,this,e):g1t(this,e)};function s1t(e,t){let n=e._view,i=n.camera,o=e._environmentState.renderTranslucentDepthForPick;mIe(e),n.createPotentiallyVisibleSet(e),dIe(e),o||hIe(e);let a=t.viewport;a.x=0,a.y=0,a.width=a.width*.5;let s=Ir.clone(i,e._cameraVR);s.frustum=i.frustum;let c=i.frustum.near,u=c*(e.focalLength??5),f=e.eyeSeparation??u/30,d=h.multiplyByScalar(s.right,f*.5,a1t);i.frustum.aspectRatio=a.width/a.height;let p=.5*f*c/u;h.add(s.position,d,i.position),i.frustum.xOffset=p,vte(e,t),a.x=a.width,h.subtract(s.position,d,i.position),i.frustum.xOffset=-p,vte(e,t),Ir.clone(s,i)}var c1t=new de(Math.PI,I.PI_OVER_TWO),l1t=new h,u1t=new h,f1t=new O,d1t=new O,h1t=new h,m1t=new h,p1t=new Je;function g1t(e,t){let{frameState:n,camera:i}=e,{uniformState:r}=e.context,o=t.viewport,a=Je.clone(o,p1t);t.viewport=a;let s=c1t,c=l1t;e.mapProjection.project(s,c);let f=h.clone(i.position,u1t),d=O.clone(i.transform,d1t),p=i.frustum.clone();i._setTransform(O.IDENTITY);let g=O.computeViewportTransformation(a,0,1,f1t),m=i.frustum.projectionMatrix,y=i.positionWC.y,A=h.fromElements(I.sign(y)*c.x-y,0,-i.positionWC.x,h1t),b=mt.pointToGLWindowCoordinates(m,g,A,m1t);b.x=Math.floor(b.x);let x=a.x,T=a.width;if(y===0||b.x<=x||b.x>=x+T)fA(!0,e,t);else if(Math.abs(x+T*.5-b.x)<1)a.width=b.x-a.x,i.position.x*=I.sign(i.position.x),i.frustum.right=0,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),r.update(n),fA(!0,e,t),a.x=b.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),r.update(n),fA(!1,e,t);else if(b.x>x+T*.5){a.width=b.x-x;let C=i.frustum.right;i.frustum.right=c.x-y,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),r.update(n),fA(!0,e,t),a.x=b.x,a.width=x+T-b.x,i.position.x=-i.position.x,i.frustum.left=-i.frustum.right,i.frustum.right=C-i.frustum.right*2,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),r.update(n),fA(!1,e,t)}else{a.x=b.x,a.width=x+T-b.x;let C=i.frustum.left;i.frustum.left=-c.x-y,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),r.update(n),fA(!0,e,t),a.x=x,a.width=b.x-x,i.position.x=-i.position.x,i.frustum.right=-i.frustum.left,i.frustum.left=C-i.frustum.left*2,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),r.update(n),fA(!1,e,t)}i._setTransform(d),h.clone(f,i.position),i.frustum=p.clone(),t.viewport=o}function fA(e,t,n){let i=t._view,{renderTranslucentDepthForPick:r}=t._environmentState;e||(t.frameState.commandList.length=0),mIe(t),i.createPotentiallyVisibleSet(t),e&&(dIe(t),r||hIe(t)),vte(t,n)}var lIe=new is;di.prototype.updateEnvironment=function(){let e=this._frameState,t=this._view,n=this._environmentState,i=e.passes.render,r=e.passes.offscreen,o=this.atmosphere,a=this.skyAtmosphere,s=this.globe,c=this._globeTranslucencyState;if(!i||this._mode!==re.SCENE2D&&t.camera.frustum instanceof pn||!c.environmentVisible)n.skyAtmosphereCommand=void 0,n.skyBoxCommand=void 0,n.sunDrawCommand=void 0,n.sunComputeCommand=void 0,n.moonCommand=void 0;else{if(l(a)){if(l(s))a.setDynamicLighting(_y.fromGlobeFlags(s)),n.isReadyForAtmosphere=n.isReadyForAtmosphere||!s.show||s._surface._tilesToRender.length>0;else{let b=o.dynamicLighting;a.setDynamicLighting(b),n.isReadyForAtmosphere=!0}n.skyAtmosphereCommand=a.update(e,s),l(n.skyAtmosphereCommand)&&this.updateDerivedCommands(n.skyAtmosphereCommand)}else n.skyAtmosphereCommand=void 0;n.skyBoxCommand=l(this.skyBox)?this.skyBox.update(e,this._hdr):void 0;let A=l(this.sun)?this.sun.update(e,t.passState,this._hdr):void 0;n.sunDrawCommand=l(A)?A.drawCommand:void 0,n.sunComputeCommand=l(A)?A.computeCommand:void 0,n.moonCommand=l(this.moon)?this.moon.update(e):void 0}let u=n.clearGlobeDepth=l(s)&&s.show&&(!s.depthTestAgainstTerrain||this.mode===re.SCENE2D);(n.useDepthPlane=u&&this.mode===re.SCENE3D&&c.useDepthPlane)&&this._depthPlane.update(e),n.renderTranslucentDepthForPick=!1,n.useWebVR=this._useWebVR&&this.mode!==re.SCENE2D&&!r;let d=e.mode===re.SCENE3D&&!c.sunVisibleThroughGlobe?e.occluder:void 0,p=e.cullingVolume,g=lIe.planes;for(let A=0;A<5;++A)g[A]=p.planes[A];p=lIe,n.isSkyAtmosphereVisible=l(n.skyAtmosphereCommand)&&n.isReadyForAtmosphere,n.isSunVisible=this.isVisible(p,n.sunDrawCommand,d),n.isMoonVisible=this.isVisible(p,n.moonCommand,d);let m=this.specularEnvironmentMaps,y=this._specularEnvironmentCubeMap;l(m)&&y?.url!==m?(l(y)&&y.destroy(),this._specularEnvironmentCubeMap=new hp(m)):!l(m)&&l(y)&&(y.destroy(),this._specularEnvironmentCubeMap=void 0),l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.update(e)};function _1t(e){let t=e._frameState;e.debugShowFrustumPlanes!==e._debugShowFrustumPlanes&&(e.debugShowFrustumPlanes?e._debugFrustumPlanes=new Tg({camera:e.camera,updateOnChange:!1,frustumSplits:t.frustumSplits}):e._debugFrustumPlanes=e._debugFrustumPlanes&&e._debugFrustumPlanes.destroy(),e._debugShowFrustumPlanes=e.debugShowFrustumPlanes),l(e._debugFrustumPlanes)&&e._debugFrustumPlanes.update(t)}function y1t(e){let t=e._frameState,{passes:n,shadowState:i,shadowMaps:r}=t,o=r.length,a=o>0&&!n.pick&&!n.pickVoxel&&e.mode===re.SCENE3D;if(a!==i.shadowsEnabled&&(++i.lastDirtyTime,i.shadowsEnabled=a),i.lightShadowsEnabled=!1,!!a){for(let s=0;s<o;++s)if(r[s]!==i.shadowMaps[s]){++i.lastDirtyTime;break}i.shadowMaps.length=0,i.lightShadowMaps.length=0;for(let s=0;s<o;++s){let c=r[s];c.update(t),i.shadowMaps.push(c),c.fromLightSource&&(i.lightShadowMaps.push(c),i.lightShadowsEnabled=!0),c.dirty&&(++i.lastDirtyTime,c.dirty=!1)}}}function mIe(e){let t=e._frameState;t.edgeVisibilityRequested=!1,t.planarFillRequested=!1,e._groundPrimitives.update(t),e._primitives.update(t),t.edgeVisibilityRequested&&e._enableEdgeVisibility===!1&&(e._enableEdgeVisibility=!0),e._enablePlanarFillId=t.planarFillRequested,_1t(e),y1t(e),e._globe&&e._globe.render(t)}function A1t(e,t,n){let i=e._context,r=e._frameState,o=e._environmentState,a=e._view,s=r.passes,c=s.pick||s.pickVoxel;l(a.globeDepth)&&(a.globeDepth.picking=c,a.globeDepth.snapping=s.snap);let u=o.useWebVR;o.originalFramebuffer=t.framebuffer,l(e.sun)&&e.sunBloom!==e._sunBloom?(e.sunBloom&&!u?e._sunPostProcess=new B6:l(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy()),e._sunBloom=e.sunBloom):!l(e.sun)&&l(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy(),e._sunBloom=!1);let f=e._clearColorCommand;U.clone(n,f.color),f.execute(i,t);let d=o.useGlobeDepthFramebuffer=l(a.globeDepth);d&&(a.globeDepth.update(i,t,a.viewport,e.msaaSamples,e._hdr,o.clearGlobeDepth),a.globeDepth.clear(i,t,n));let p=a.oit,g=o.useOIT=!c&&l(p)&&p.isSupported();g&&(p.update(i,t,a.globeDepth.colorFramebufferManager,e._hdr,e.msaaSamples),p.clear(i,t,n),o.useOIT=p.isSupported());let m=e.postProcessStages,y=o.usePostProcess=!c&&(e._hdr||m.length>0||m.ambientOcclusion.enabled||m.fxaa.enabled||m.bloom.enabled);o.usePostProcessSelected=!1,y&&(a.sceneFramebuffer.update(i,a.viewport,e._hdr,e.msaaSamples),a.sceneFramebuffer.clear(i,t,n),m.update(i,r.useLogDepth,e._hdr),m.clear(i),y=o.usePostProcess=m.ready,o.usePostProcessSelected=y&&m.hasSelected),o.isSunVisible&&e.sunBloom&&!u?(t.framebuffer=e._sunPostProcess.update(t),e._sunPostProcess.clear(i,t,n)):d?t.framebuffer=a.globeDepth.framebuffer:y&&(t.framebuffer=a.sceneFramebuffer.framebuffer),l(t.framebuffer)&&f.execute(i,t);let A=o.useInvertClassification=!c&&l(t.framebuffer)&&e.invertClassification;if(!c&&e._enableEdgeVisibility&&a.edgeFramebuffer.update(i,a.viewport,e._hdr),!c&&e._enablePlanarFillId?a.planarFillIdFramebuffer.update(i,a.viewport,e._hdr):c||a.planarFillIdFramebuffer.releaseResources(),A){let T;if(r.invertClassificationColor.alpha===1&&d&&(T=a.globeDepth.framebuffer),l(T)||i.depthTexture){if(e._invertClassification.previousFramebuffer=T,e._invertClassification.update(i,e.msaaSamples,a.globeDepth.colorFramebufferManager),e._invertClassification.clear(i,t),r.invertClassificationColor.alpha<1&&g){let C=e._invertClassification.unclassifiedCommand,E=C.derivedCommands;E.oit=p.createDerivedCommands(C,i,E.oit)}}else o.useInvertClassification=!1}e._globeTranslucencyState.translucent&&a.globeTranslucencyFramebuffer.updateAndClear(e._hdr,a.viewport,i,t)}di.prototype.resolveFramebuffers=function(e){let t=this._context,n=this._environmentState,i=this._view,{globeDepth:r,translucentTileClassification:o}=i;l(r)&&r.prepareColorTextures(t);let{useOIT:a,useGlobeDepthFramebuffer:s,usePostProcess:c,originalFramebuffer:u}=n,f=s?r.colorFramebufferManager:void 0,d=i.sceneFramebuffer._colorFramebuffer,p=i.sceneFramebuffer.idFramebuffer;if(a&&(e.framebuffer=c?d.framebuffer:u,i.oit.execute(t,e)),o.hasTranslucentDepth&&o.isSupported()&&o.execute(this,e),c){i.sceneFramebuffer.prepareColorTextures(t);let g=d;s&&!a&&(g=f);let m=this.postProcessStages,y=g.getColorTexture(0),A=p.getColorTexture(0),b=(f??d).getDepthStencilTexture();m.execute(t,y,b,A),m.copy(t,u)}!a&&!c&&s&&(e.framebuffer=u,r.executeCopyColor(t,e))};function b1t(e){let t=e._frameState.afterRender,n=t.slice();t.length=0;for(let i=0;i<n.length;++i)n[i]()&&e.requestRender()}function x1t(e){if(e.mode===re.MORPHING)return;let t=e.camera.positionCartographic;return e.getHeight(t)}function pIe(e,t,n){let i=Number.NEGATIVE_INFINITY;if(e instanceof pu){let r=e.length;for(let o=0;o<r;++o){let a=e.get(o),s=pIe(a,t,n);l(s)&&s>i&&(i=s)}}else if(e.isCesium3DTileset&&e.show&&e.enableCollision){let r=e.getHeight(t,n);if(l(r)&&r>i)return r}return i}di.prototype.getHeight=function(e,t){if(!l(e))return;let n=t===it.CLAMP_TO_TERRAIN||t===it.RELATIVE_TO_TERRAIN,i=t===it.CLAMP_TO_3D_TILE||t===it.RELATIVE_TO_3D_TILE;if(!l(e))return;let r=Number.NEGATIVE_INFINITY;if(!n){let a=pIe(this.primitives,e,this);l(a)&&a>r&&(r=a)}let o=this._globe;if(!i&&l(o)&&o.show){let a=o.getHeight(e);a>r&&(r=a)}if(r>Number.NEGATIVE_INFINITY)return r};var Cte=new de;di.prototype.updateHeight=function(e,t,n){let i=this._ellipsoid,r=g=>{de.clone(e,Cte);let m;l(g)&&(m=g.height),l(m)||(m=this.getHeight(e,n)),l(m)&&(Cte.height=m,t(Cte))},o=n===it.CLAMP_TO_TERRAIN||n===it.RELATIVE_TO_TERRAIN,a=n===it.CLAMP_TO_3D_TILE||n===it.RELATIVE_TO_3D_TILE,s;!a&&l(this.globe)&&(s=this.globe._surface.updateHeight(e,r));let c={},u=g=>{if(o||g.isDestroyed()||!g.isCesium3DTileset)return;let m=g.updateHeight(e,r,i);c[g.id]=m};if(!o){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),d=this.primitives.primitiveRemoved.addEventListener(g=>{g.isDestroyed()||!g.isCesium3DTileset||(l(c[g.id])&&c[g.id](),delete c[g.id])});return()=>{s=s&&s(),Object.values(c).forEach(g=>g()),c={},f(),d()}};function T1t(e){let t=e.camera,n=e._mode,i=e._screenSpaceCameraController,r=t.positionCartographic;if(!l(r))return!1;if(!i.onMap()&&r.height<0)return!0;if(n===re.SCENE2D||n===re.MORPHING)return!1;let o=e._globeHeight;return l(o)&&r.height<o}di.prototype.initializeFrame=function(){if(this._shaderFrameCount++===120&&(this._shaderFrameCount=0,this._context.shaderCache.destroyReleasedShaderPrograms(),this._context.textureCache.destroyReleasedTextures()),this._tweens.update(),this._globeHeightDirty){l(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),this._globeHeight=x1t(this),this._globeHeightDirty=!1;let e=this.camera.positionCartographic;this._removeUpdateHeightCallback=this.updateHeight(e,t=>{this.isDestroyed()||(this._globeHeight=t.height)})}this._cameraUnderground=T1t(this),this._globeTranslucencyState.update(this),this._screenSpaceCameraController.update(),l(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this.camera.update(this._mode),this.camera._updateCameraChanged()};function C1t(e,t){if(e.debugShowFramesPerSecond){if(!l(e._performanceDisplay)){let n=document.createElement("div");n.className="cesium-performanceDisplay-defaultContainer",e._canvas.parentNode.appendChild(n);let r=new nA({container:n});e._performanceDisplay=r,e._performanceContainer=n}e._performanceDisplay.throttled=e.requestRenderMode,e._performanceDisplay.update(t)}else l(e._performanceDisplay)&&(e._performanceDisplay=e._performanceDisplay&&e._performanceDisplay.destroy(),e._performanceContainer.parentNode.removeChild(e._performanceContainer))}function v1t(e){e._jobScheduler.resetBudgets();let t=e._frameState;e.primitives.prePassesUpdate(t),l(e.globe)&&e.globe.update(t),e._picking.update(),t.creditDisplay.update()}function E1t(e){e.primitives.postPassesUpdate(e._frameState),fl.update()}var S1t=new U;function w1t(e){let t=e._frameState,n=e.context,{uniformState:i}=n,r=e._defaultView;e._view=r,e.updateFrameState(),t.passes.render=!0,t.passes.postProcess=e.postProcessStages.hasSelected,t.tilesetPassState=NDt;let o=e.backgroundColor??U.BLACK;e._hdr&&(o=U.clone(o,S1t),o.red=Math.pow(o.red,e.gamma),o.green=Math.pow(o.green,e.gamma),o.blue=Math.pow(o.blue,e.gamma)),t.backgroundColor=o,t.atmosphere=e.atmosphere,e.fog.update(t),i.update(t);let a=e.shadowMap;l(a)&&a.enabled&&(!l(e.light)||e.light instanceof ny?h.negate(i.sunDirectionWC,e._shadowMapCamera.direction):h.clone(e.light.direction,e._shadowMapCamera.direction),t.shadowMaps.push(a)),e._computeCommandList.length=0,e._overlayCommandList.length=0;let s=r.viewport;s.x=0,s.y=0,s.width=n.drawingBufferWidth,s.height=n.drawingBufferHeight;let c=r.passState;c.framebuffer=void 0,c.blendingEnabled=void 0,c.scissorTest=void 0,c.viewport=Je.clone(s,c.viewport),n.beginFrame(),l(e.globe)&&e.globe.beginFrame(t),e.updateEnvironment(),e.updateAndExecuteCommands(c,o),e.resolveFramebuffers(c),c.framebuffer=void 0,r1t(e,c),l(e.globe)&&(e.globe.endFrame(t),e.globe.tilesLoaded||(e._renderRequested=!0)),n.endFrame()}function Yx(e,t){try{t(e)}catch(n){if(e._renderError.raiseEvent(e,n),e.rethrowRenderErrors)throw n}}function I1t(e){return e._picking.updateMostDetailedRayPicks(e)}di.prototype.render=function(e){this._preUpdate.raiseEvent(this,e);let t=this._frameState;t.newFrame=!1,l(e)||(e=K.now()),this._controllerHost.update(this,e);let n=this._view.checkForCameraUpdates(this);n&&(this._globeHeightDirty=!0);let i=!this.requestRenderMode||this._renderRequested||n||this._logDepthBufferDirty||this._hdrDirty||this.mode===re.MORPHING;if(!i&&l(this.maximumRenderTimeChange)&&l(this._lastRenderTime)){let r=Math.abs(K.secondsDifference(this._lastRenderTime,e));i=i||r>this.maximumRenderTimeChange}if(i){this._lastRenderTime=K.clone(e,this._lastRenderTime),this._renderRequested=!1,this._logDepthBufferDirty=!1,this._hdrDirty=!1;let r=I.incrementWrap(t.frameNumber,15e6,1);uIe(this,r,e),t.newFrame=!0}Yx(this,v1t),this.primitives.show&&(Yx(this,I1t),Yx(this,P1t),Yx(this,D1t),i||Yx(this,R1t)),this._postUpdate.raiseEvent(this,e),i&&(this._preRender.raiseEvent(this,e),t.creditDisplay.beginFrame(),Yx(this,w1t)),C1t(this,i),Yx(this,E1t),b1t(this),i&&(this._postRender.raiseEvent(this,e),t.creditDisplay.endFrame())};di.prototype.forceRender=function(e){this._renderRequested=!0,this.render(e)};di.prototype.requestRender=function(){this._renderRequested=!0};di.prototype.clampLineWidth=function(e){return Math.max(Ft.minimumAliasedLineWidth,Math.min(e,Ft.maximumAliasedLineWidth))};di.prototype.pick=function(e,t,n){return this._picking.pick(this,e,t,n,1)[0]};di.prototype.snap=function(e,t){return L6.snap(this,e,t)};di.prototype.pickAsync=async function(e,t,n){return(await this._picking.pickAsync(this,e,t,n,1))[0]};di.prototype.pickVoxel=function(e,t,n){let i=this.pick(e,t,n);if(!l(i))return;let r=i.primitive;if(!(r instanceof qx))return;let o=this._picking.pickVoxelCoordinate(this,e,t,n),a=255*o[0]+o[1],s=r._traversal.findKeyframeNode(a);if(!l(s))return;let c=255*o[2]+o[3];return z6.fromKeyframeNode(r,a,c,s)};di.prototype.pickMetadata=function(e,t,n,i){let r=this.pick(e);if(!l(r))return;let o=r.detail?.model?.structuralMetadata;if(!l(o))return;let a=o.schema,s=hH(a,t,n,i);if(!l(s))return;let c=pH(o,n,i);if(!l(c))return;let u=new mH(t,n,i,s,c);return this._picking.pickMetadata(this,e,u)};di.prototype.pickMetadataSchema=function(e){let t=this.pick(e);return l(t)?t.detail?.model?.structuralMetadata?.schema:void 0};di.prototype.pickPositionWorldCoordinates=function(e,t){return this._picking.pickPositionWorldCoordinates(this,e,t)};di.prototype.pickPosition=function(e,t){return this._picking.pickPosition(this,e,t)};di.prototype.drillPick=function(e,t,n,i){return this._picking.drillPick(this,e,t,n,i)};function P1t(e){let t=e._frameState;bte.camera=t.camera,bte.cullingVolume=t.cullingVolume,e.primitives.updateForPass(t,bte)}function D1t(e){let t=e._frameState;if(!t.camera.canPreloadFlight())return;xte.camera=e.preloadFlightCamera,xte.cullingVolume=e.preloadFlightCullingVolume,e.primitives.updateForPass(t,xte)}function R1t(e){e.primitives.updateForPass(e._frameState,FDt)}di.prototype.pickFromRay=function(e,t,n){return this._picking.pickFromRay(this,e,t,n)};di.prototype.drillPickFromRay=function(e,t,n,i){return this._picking.drillPickFromRay(this,e,t,n,i)};di.prototype.pickFromRayMostDetailed=function(e,t,n){return this._picking.pickFromRayMostDetailed(this,e,t,n)};di.prototype.drillPickFromRayMostDetailed=function(e,t,n,i){return this._picking.drillPickFromRayMostDetailed(this,e,t,n,i)};di.prototype.sampleHeight=function(e,t,n){return this._picking.sampleHeight(this,e,t,n)};di.prototype.clampToHeight=function(e,t,n,i){return this._picking.clampToHeight(this,e,t,n,i)};di.prototype.sampleHeightMostDetailed=function(e,t,n){return this._picking.sampleHeightMostDetailed(this,e,t,n)};di.prototype.clampToHeightMostDetailed=function(e,t,n){return this._picking.clampToHeightMostDetailed(this,e,t,n)};di.prototype.cartesianToCanvasCoordinates=function(e,t){return cr.worldToWindowCoordinates(this,e,t)};di.prototype.completeMorph=function(){this._transitioner.completeMorph()};di.prototype.morphTo2D=function(e){e=e??2,this._transitioner.morphTo2D(e,this._ellipsoid)};di.prototype.morphToColumbusView=function(e){e=e??2,this._transitioner.morphToColumbusView(e,this._ellipsoid)};di.prototype.morphTo3D=function(e){e=e??2,this._transitioner.morphTo3D(e,this._ellipsoid)};function O1t(e,t){if(e._removeTerrainProviderReadyListener=e._removeTerrainProviderReadyListener&&e._removeTerrainProviderReadyListener(),t.ready){l(e.globe)&&(e.globe.terrainProvider=t.provider);return}e.globe.terrainProvider=void 0,e._removeTerrainProviderReadyListener=t.readyEvent.addEventListener(n=>{l(e)&&l(e.globe)&&(e.globe.terrainProvider=n),e._removeTerrainProviderReadyListener()})}di.prototype.setTerrain=function(e){return O1t(this,e),e};di.prototype.isDestroyed=function(){return!1};di.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(),l(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,l(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),ue(this)};var yH=di;var fR=`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;
|
|
|
|
// Adjustment to the atmosphere radius applied based on the camera height.
|
|
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);
|
|
|
|
// Since atmosphere scattering assumes the atmosphere is a spherical shell, we compute an inner radius of the atmosphere best fit
|
|
// for the position on the ellipsoid.
|
|
float radiusAdjust = (ellipsoidRadiiDifference / 4.0) + distanceAdjust;
|
|
float atmosphereInnerRadius = (length(czm_viewerPositionWC) - czm_eyeHeight) - radiusAdjust;
|
|
|
|
// Setup the primary ray: from the camera position to the vertex position.
|
|
vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC;
|
|
vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC);
|
|
czm_ray primaryRay = czm_ray(czm_viewerPositionWC, cameraToPositionWCDirection);
|
|
|
|
underTranslucentGlobe = 0.0;
|
|
|
|
// Brighten the sky atmosphere under the Earth's atmosphere when translucency is enabled.
|
|
#if defined(GLOBE_TRANSLUCENT)
|
|
|
|
// Check for intersection with the inner radius of the atmopshere.
|
|
czm_raySegment primaryRayEarthIntersect = czm_raySphereIntersectionInterval(primaryRay, vec3(0.0), atmosphereInnerRadius + radiusAdjust);
|
|
if (primaryRayEarthIntersect.start > 0.0 && primaryRayEarthIntersect.stop > 0.0) {
|
|
|
|
// Compute position on globe.
|
|
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);
|
|
|
|
// Control the color using the camera angle.
|
|
float angle = dot(normalize(czm_viewerPositionWC), normalize(onEarth));
|
|
|
|
// Control the opacity using the distance from Earth.
|
|
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);
|
|
|
|
// Set the traslucent flag to avoid alpha adjustment in computeFinalColor funciton.
|
|
underTranslucentGlobe = 1.0;
|
|
return;
|
|
}
|
|
#endif
|
|
|
|
computeScattering(
|
|
primaryRay,
|
|
length(cameraToPositionWC),
|
|
lightDirection,
|
|
atmosphereInnerRadius,
|
|
rayleighColor,
|
|
mieColor,
|
|
opacity
|
|
);
|
|
|
|
// Alter the opacity based on how close the viewer is to the ground.
|
|
// (0.0 = At edge of atmosphere, 1.0 = On ground)
|
|
float cameraHeight = czm_eyeHeight + atmosphereInnerRadius;
|
|
float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS;
|
|
opacity = clamp((atmosphereOuterRadius - cameraHeight) / (atmosphereOuterRadius - atmosphereInnerRadius), 0.0, 1.0);
|
|
|
|
// Alter alpha based on time of day (0.0 = night , 1.0 = day)
|
|
float nightAlpha = (u_radiiAndDynamicAtmosphereColor.z != 0.0) ? clamp(dot(normalize(positionWC), lightDirection), 0.0, 1.0) : 1.0;
|
|
opacity *= pow(nightAlpha, 0.5);
|
|
}
|
|
`;var AH=`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
|
|
|
|
// For the parts of the sky atmosphere that are not behind a translucent globe,
|
|
// we mix in the default opacity so that the sky atmosphere still appears at distance.
|
|
// This is needed because the opacity in the sky atmosphere is initially adjusted based
|
|
// on the camera height.
|
|
if (translucent == 0.0) {
|
|
color.a = mix(color.b, 1.0, color.a) * smoothstep(0.0, 1.0, czm_morphTime);
|
|
}
|
|
|
|
out_FragColor = color;
|
|
}
|
|
`;var bH=`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;
|
|
vec4 positionEC = czm_modelView * position;
|
|
gl_Position = czm_projection * positionEC;
|
|
}
|
|
`;function kS(e){e=e??te.WGS84,this.show=!0,this.perFragmentAtmosphere=!1,this._ellipsoid=e;let t=1.025,n=h.multiplyByScalar(e.radii,t,new h);this._scaleMatrix=O.fromScale(n),this._modelMatrix=new O,this._command=new nt({owner:this,modelMatrix:this._modelMatrix}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._flags=void 0,this.atmosphereLightIntensity=50,this.atmosphereRayleighCoefficient=new h(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new h(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 h;let i=new h;i.x=e.maximumRadius*t,i.y=e.maximumRadius,i.z=0,this._radiiAndDynamicAtmosphereColor=i;let r=this;this._command.uniformMap={u_radiiAndDynamicAtmosphereColor:function(){return r._radiiAndDynamicAtmosphereColor},u_hsbShift:function(){return r._hueSaturationBrightness.x=r.hueShift,r._hueSaturationBrightness.y=r.saturationShift,r._hueSaturationBrightness.z=r.brightnessShift,r._hueSaturationBrightness},u_atmosphereLightIntensity:function(){return r.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return r.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return r.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return r.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return r.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return r.atmosphereMieAnisotropy}}}Object.defineProperties(kS.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});kS.prototype.setDynamicLighting=function(e){this._radiiAndDynamicAtmosphereColor.z=e};var Ete=new O;kS.prototype.update=function(e,t){if(!this.show)return;let n=e.mode;if(n!==re.SCENE3D&&n!==re.MORPHING||!e.passes.render)return;let i=O.fromRotationTranslation(e.context.uniformState.inverseViewRotation,h.ZERO,Ete),r=O.multiplyTransformation(i,zi.Y_UP_TO_Z_UP,Ete),o=O.multiply(this._scaleMatrix,r,Ete);O.clone(o,this._modelMatrix);let a=e.context,s=M1t(this),c=e.globeTranslucencyState.translucent,u=this.perFragmentAtmosphere||c||!l(t)||!t.show,f=this._command;if(!l(f.vertexArray)){let p=Ks.createGeometry(new Ks({radii:new h(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:Be.POSITION_ONLY}));f.vertexArray=Vn.fromGeometry({context:a,geometry:p,attributeLocations:Gn.createAttributeLocations(p),bufferUsage:Oe.STATIC_DRAW}),f.renderState=je.fromCache({cull:{enabled:!0,face:Ui.FRONT},blending:en.ALPHA_BLEND,depthMask:!1})}let d=s|u<<2|c<<3;if(d!==this._flags){this._flags=d;let p=[];s&&p.push("COLOR_CORRECT"),u&&p.push("PER_FRAGMENT_ATMOSPHERE"),c&&p.push("GLOBE_TRANSLUCENT");let g=new Ge({defines:p,sources:[dp,fR,bH]}),m=new Ge({defines:p,sources:[dp,fR,AH]});this._spSkyAtmosphere=Zt.fromCache({context:a,vertexShaderSource:g,fragmentShaderSource:m}),f.shaderProgram=this._spSkyAtmosphere}return f};function M1t(e){return!(I.equalsEpsilon(e.hueShift,0,I.EPSILON7)&&I.equalsEpsilon(e.saturationShift,0,I.EPSILON7)&&I.equalsEpsilon(e.brightnessShift,0,I.EPSILON7))}kS.prototype.isDestroyed=function(){return!1};kS.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),this._spSkyAtmosphere=this._spSkyAtmosphere&&this._spSkyAtmosphere.destroy(),ue(this)};var xH=kS;var TH=`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 CH=`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 vH=`uniform mat3 u_cubeMapPanoramaTransform;
|
|
|
|
in vec3 position;
|
|
out vec3 v_texCoord;
|
|
|
|
void main()
|
|
{
|
|
vec3 p = czm_viewRotation * (u_cubeMapPanoramaTransform * (czm_entireFrustum.y * position));
|
|
gl_Position = czm_projection * vec4(p, 1.0);
|
|
v_texCoord = position.xyz;
|
|
}
|
|
`;function dR(e){this.sources=e.sources,this._sources=void 0,this._transform=e.transform,this.show=e.show??!0,this._returnCommand=e.returnCommand??!1,this._addToPanoramaCommandList=!this._returnCommand,this._command=new nt({modelMatrix:O.clone(O.IDENTITY),owner:this,pass:Pe.ENVIRONMENT}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0,this._hasError=!1,this._error=void 0;let t=e.credit;typeof t=="string"&&(t=new wt(t)),this._credit=t}Object.defineProperties(dR.prototype,{transform:{get:function(){return this._transform}},credit:{get:function(){return l(this._credit)?this._credit:void 0}}});dR.prototype.update=function(e,t){let n=this,{mode:i,passes:r,context:o,panoramaCommandList:a}=e;if(!this.show||i!==re.SCENE3D&&i!==re.MORPHING||!r.render)return;if(this._hasError){let c=this._error;throw this._hasError=!1,this._error=void 0,c}if(this._sources!==this.sources){this._sources=this.sources;let c=this.sources;typeof c.positiveX=="string"?qk(o,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 aa({context:o,source:c})),this._addToPanoramaCommandList=!0}let s=this._command;if(!l(s.vertexArray)){s.uniformMap={u_cubeMap:function(){return n._cubeMap},u_cubeMapPanoramaTransform:function(){return n._transform}};let c=Nc.createGeometry(Nc.fromDimensions({dimensions:new h(2,2,2),vertexFormat:Be.POSITION_ONLY})),u=this._attributeLocations=Gn.createAttributeLocations(c);s.vertexArray=Vn.fromGeometry({context:o,geometry:c,attributeLocations:u,bufferUsage:Oe.STATIC_DRAW}),s.renderState=je.fromCache({depthTest:{enabled:!1},depthMask:!1,blending:en.ALPHA_BLEND}),this._addToPanoramaCommandList=!0}if(!l(s.shaderProgram)||this._useHdr!==t){let c=new Ge({defines:[t?"HDR":""],sources:[TH]});s.shaderProgram=Zt.fromCache({context:o,vertexShaderSource:l(this._transform)?vH:CH,fragmentShaderSource:c,attributeLocations:this._attributeLocations}),this._useHdr=t,this._addToPanoramaCommandList=!0}if(l(this._cubeMap)){if(this.show&&l(this._credit)&&!this._returnCommand&&e.creditDisplay.addCreditToNextFrame(this._credit),this._returnCommand)return s;this._addToPanoramaCommandList&&(a.push(s),this._addToPanoramaCommandList=!1)}};dR.prototype.isDestroyed=function(){return!1};dR.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(),ue(this)};var zS=dR;function Xx(e){this._sources=e.sources,this._show=e.show??!0,this._panorama=new zS({sources:this._sources,show:this._show,returnCommand:!0})}Object.defineProperties(Xx.prototype,{sources:{get:function(){return this._panorama.sources},set:function(e){this._panorama.sources=e}},show:{get:function(){return this._panorama.show},set:function(e){this._panorama.show=e}}});Xx.prototype.update=function(e,t){let{mode:n,passes:i}=e;if(!(n!==re.SCENE3D&&n!==re.MORPHING)&&i.render)return this._panorama.update(e,t)};Xx.prototype.isDestroyed=function(){return!1};Xx.prototype.destroy=function(){return this._panorama=this._panorama&&this._panorama.destroy(),ue(this)};function US(e){return $t(`Assets/Textures/SkyBox/tycho2t3_80_${e}.jpg`)}Xx.createEarthSkyBox=function(){return new Xx({sources:{positiveX:US("px"),negativeX:US("mx"),positiveY:US("py"),negativeY:US("my"),positiveZ:US("pz"),negativeZ:US("mz")}})};var EH=Xx;var SH=`uniform sampler2D u_texture;
|
|
|
|
in vec2 v_textureCoordinates;
|
|
|
|
void main()
|
|
{
|
|
vec4 color = texture(u_texture, v_textureCoordinates);
|
|
out_FragColor = czm_gammaCorrect(color);
|
|
}
|
|
`;var wH=`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);
|
|
|
|
// The following loop has been manually unrolled for speed, to
|
|
// avoid sin() and cos().
|
|
//
|
|
//for (float i = 0.4; i < 3.2; i += 1.047) {
|
|
// vec2 direction = vec2(sin(i), cos(i));
|
|
// burst += 0.4 * addBurst(position, direction, lengthScalar);
|
|
//
|
|
// direction = vec2(sin(i - 0.08), cos(i - 0.08));
|
|
// burst += 0.3 * addBurst(position, direction, lengthScalar);
|
|
//}
|
|
|
|
burst += 0.4 * addBurst(position, vec2(0.38942, 0.92106), lengthScalar); // angle == 0.4
|
|
burst += 0.4 * addBurst(position, vec2(0.99235, 0.12348), lengthScalar); // angle == 0.4 + 1.047
|
|
burst += 0.4 * addBurst(position, vec2(0.60327, -0.79754), lengthScalar); // angle == 0.4 + 1.047 * 2.0
|
|
|
|
burst += 0.3 * addBurst(position, vec2(0.31457, 0.94924), lengthScalar); // angle == 0.4 - 0.08
|
|
burst += 0.3 * addBurst(position, vec2(0.97931, 0.20239), lengthScalar); // angle == 0.4 + 1.047 - 0.08
|
|
burst += 0.3 * addBurst(position, vec2(0.66507, -0.74678), lengthScalar); // angle == 0.4 + 1.047 * 2.0 - 0.08
|
|
|
|
// End of manual loop unrolling.
|
|
|
|
color += clamp(burst, vec4(0.0), vec4(1.0)) * 0.15;
|
|
|
|
out_FragColor = clamp(color, vec4(0.0), vec4(1.0));
|
|
}
|
|
`;var IH=`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;
|
|
}
|
|
`;function mR(){this.show=!0,this._drawCommand=new nt({primitiveType:Re.TRIANGLES,boundingVolume:new se,owner:this}),this._commands={drawCommand:this._drawCommand,computeCommand:void 0},this._boundingVolume=new se,this._boundingVolume2D=new se,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(mR.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var L1t=new k,N1t=new k,F1t=new ae,hR=new ae;mR.prototype.update=function(e,t,n){if(!this.show)return;let i=e.mode;if(i===re.SCENE2D||i===re.MORPHING||!e.passes.render)return;let r=e.context,o=t.viewport.width,a=t.viewport.height;if(!l(this._texture)||o!==this._drawingBufferWidth||a!==this._drawingBufferHeight||this._glowFactorDirty||n!==this._useHdr){this._texture=this._texture&&this._texture.destroy(),this._drawingBufferWidth=o,this._drawingBufferHeight=a,this._glowFactorDirty=!1,this._useHdr=n;let C=Math.max(o,a);C=Math.pow(2,Math.ceil(Math.log(C)/Math.log(2))-2),C=Math.max(1,C);let E=n?r.halfFloatingPointTexture?ke.HALF_FLOAT:ke.FLOAT:ke.UNSIGNED_BYTE;this._texture=new Et({context:r,width:C,height:C,pixelFormat:He.RGBA,pixelDatatype:E}),this._glowLengthTS=this._glowFactor*5,this._radiusTS=1/(1+2*this._glowLengthTS)*.5;let w=this,D={u_radiusTS:function(){return w._radiusTS}};this._commands.computeCommand=new lu({fragmentShaderSource:wH,outputTexture:this._texture,uniformMap:D,persists:!1,owner:this,postExecute:function(){w._commands.computeCommand=void 0}})}let s=this._drawCommand;if(!l(s.vertexArray)){let C={direction:0},E=new Uint8Array(8);E[0]=0,E[1]=0,E[2]=255,E[3]=0,E[4]=255,E[5]=255,E[6]=0,E[7]=255;let w=Ze.createVertexBuffer({context:r,typedArray:E,usage:Oe.STATIC_DRAW}),D=[{index:C.direction,vertexBuffer:w,componentsPerAttribute:2,normalize:!0,componentDatatype:Y.UNSIGNED_BYTE}],R=Ze.createIndexBuffer({context:r,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Oe.STATIC_DRAW,indexDatatype:Ve.UNSIGNED_SHORT});s.vertexArray=new Vn({context:r,attributes:D,indexBuffer:R}),s.shaderProgram=Zt.fromCache({context:r,vertexShaderSource:IH,fragmentShaderSource:SH,attributeLocations:C}),s.renderState=je.fromCache({blending:en.ALPHA_BLEND}),s.uniformMap=this._uniformMap}let c=r.uniformState.sunPositionWC,u=r.uniformState.sunPositionColumbusView,f=this._boundingVolume,d=this._boundingVolume2D;h.clone(c,f.center),d.center.x=u.z,d.center.y=u.x,d.center.z=u.y,f.radius=I.SOLAR_RADIUS+I.SOLAR_RADIUS*this._glowLengthTS,d.radius=f.radius,i===re.SCENE3D?se.clone(f,s.boundingVolume):i===re.COLUMBUS_VIEW&&se.clone(d,s.boundingVolume);let p=cr.computeActualEllipsoidPosition(e,c,hR),g=h.magnitude(h.subtract(p,e.camera.position,hR)),m=r.uniformState.projection,y=F1t;y.x=0,y.y=0,y.z=-g,y.w=1;let A=O.multiplyByVector(m,y,hR),b=cr.clipToGLWindowCoordinates(t.viewport,A,L1t);y.x=I.SOLAR_RADIUS;let x=O.multiplyByVector(m,y,hR),T=cr.clipToGLWindowCoordinates(t.viewport,x,N1t);return this._size=k.magnitude(k.subtract(T,b,hR)),this._size=2*this._size*(1+2*this._glowLengthTS),this._size=Math.ceil(this._size),this._commands};mR.prototype.isDestroyed=function(){return!1};mR.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(),ue(this)};var PH=mR;var yIe=La($O(),1);function B1t(e,t,n){return` 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 DH=B1t;var k1t={modifyFragmentShader:function(t){return t=Ge.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}}},pR=k1t;var Kx={NEEDS_DECODE:0,DECODING:1,READY:2,FAILED:3};function gR(e){this._parsedContent=void 0,this._drawCommand=void 0,this._isTranslucent=!1,this._styleTranslucent=!1,this._constantColor=U.clone(U.DARKGRAY),this._highlightColor=U.clone(U.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=Kx.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??Pe.OPAQUE,this._cull=e.cull??!0,this.style=void 0,this._style=void 0,this.styleDirty=!1,this.modelMatrix=O.clone(O.IDENTITY),this._modelMatrix=O.clone(O.IDENTITY),this.time=0,this.shadows=Rn.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??jo.NONE,this._splittingEnabled=!1,this._error=void 0,z1t(this,e)}Object.defineProperties(gR.prototype,{pointsLength:{get:function(){return this._pointsLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}},color:{get:function(){return U.clone(this._highlightColor)},set:function(e){this._highlightColor=U.clone(e,this._highlightColor)}},boundingSphere:{get:function(){if(l(this._drawCommand))return this._drawCommand.boundingVolume},set:function(e){this._boundingSphere=se.clone(e,this._boundingSphere)}}});function z1t(e,t){let n=jE.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&&l(n.batchTableBinary)&&(n.styleableProperties=pp.getBinaryProperties(n.pointsLength,n.batchTableJson,n.batchTableBinary)),l(n.draco)){let s=n.draco;e._decodingState=Kx.NEEDS_DECODE,s.dequantizeInShader=e._dequantizeInShader}let i=n.positions;l(i)&&(e._isQuantized=i.isQuantized,e._quantizedVolumeScale=i.quantizedVolumeScale,e._quantizedVolumeOffset=i.quantizedVolumeOffset,e._quantizedRange=i.quantizedRange);let r=n.normals;l(r)&&(e._isOctEncoded16P=r.octEncoded);let o=n.colors;l(o)&&(l(o.constantColor)&&(e._constantColor=U.clone(o.constantColor,e._constantColor),e._hasColors=!1),e._isRGB565=o.isRGB565);let a=n.batchIds;l(n.batchIds)&&(a.name="BATCH_ID",a.semantic="BATCH_ID",a.setIndex=void 0),n.hasBatchIds&&e._batchTableLoaded(n.batchLength,n.batchTableJson,n.batchTableBinary),e._pointsLength=n.pointsLength}var U1t=new h,V1t=new h,j1t=new h,gIe,RH;function H1t(e){if(!l(RH)){gIe=new yIe.default(0),RH=new Array(e);for(let t=0;t<e;++t)RH[t]=gIe.random()}return RH}function G1t(e){let n=e.length/3,i=Math.min(n,20),r=H1t(20),o=Number.MAX_VALUE,a=-Number.MAX_VALUE,s=h.fromElements(o,o,o,U1t),c=h.fromElements(a,a,a,V1t);for(let f=0;f<i;++f){let d=Math.floor(r[f]*n),p=h.unpack(e,d*3,j1t);h.minimumByComponent(s,p,s),h.maximumByComponent(c,p,c)}let u=se.fromCornerPoints(s,c);return u.radius+=I.EPSILON2,u}function _Ie(e,t){let n=Y.fromTypedArray(e);return n===Y.INT||n===Y.UNSIGNED_INT||n===Y.DOUBLE?(pt("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 W1t=new ae,q1t=new ae,Y1t=new U,AIe=0,OH=1,Dte=2,bIe=3,X1t=4,Ste=new O,K1t=new O;function $1t(e,t){let n=t.context,i=e._parsedContent,r=e._pointsLength,o=i.positions,a=i.colors,s=i.normals,c=i.batchIds,u=i.styleableProperties,f=l(u),d=e._isQuantized,p=e._isQuantizedDraco,g=e._isOctEncoded16P,m=e._isOctEncodedDraco,y=e._quantizedRange,A=e._octEncodedRange,b=e._isRGB565,x=e._isTranslucent,T=e._hasColors,C=e._hasNormals,E=e._hasBatchIds,w,D,R=[],M={};if(e._styleableShaderAttributes=M,f){let z=X1t;for(let j in u)if(u.hasOwnProperty(j)){let B=u[j],G=_Ie(B.typedArray,j);w=B.componentCount,D=Y.fromTypedArray(G);let W=Ze.createVertexBuffer({context:n,typedArray:G,usage:Oe.STATIC_DRAW});e._geometryByteLength+=W.sizeInBytes;let Q={index:z,vertexBuffer:W,componentsPerAttribute:w,componentDatatype:D,normalize:!1,offsetInBytes:0,strideInBytes:0};R.push(Q),M[j]={location:z,componentCount:w},++z}}let N=Ze.createVertexBuffer({context:n,typedArray:o.typedArray,usage:Oe.STATIC_DRAW});e._geometryByteLength+=N.sizeInBytes;let _;T&&(_=Ze.createVertexBuffer({context:n,typedArray:a.typedArray,usage:Oe.STATIC_DRAW}),e._geometryByteLength+=_.sizeInBytes);let v;C&&(v=Ze.createVertexBuffer({context:n,typedArray:s.typedArray,usage:Oe.STATIC_DRAW}),e._geometryByteLength+=v.sizeInBytes);let S;E&&(c.typedArray=_Ie(c.typedArray,"batchIds"),S=Ze.createVertexBuffer({context:n,typedArray:c.typedArray,usage:Oe.STATIC_DRAW}),e._geometryByteLength+=S.sizeInBytes);let P=[];if(d?D=Y.UNSIGNED_SHORT:p?D=y<=255?Y.UNSIGNED_BYTE:Y.UNSIGNED_SHORT:D=Y.FLOAT,P.push({index:AIe,vertexBuffer:N,componentsPerAttribute:3,componentDatatype:D,normalize:!1,offsetInBytes:0,strideInBytes:0}),e._cull&&(d||p?e._boundingSphere=se.fromCornerPoints(h.ZERO,e._quantizedVolumeScale):e._boundingSphere=G1t(o.typedArray)),T)if(b)P.push({index:OH,vertexBuffer:_,componentsPerAttribute:1,componentDatatype:Y.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0});else{let z=x?4:3;P.push({index:OH,vertexBuffer:_,componentsPerAttribute:z,componentDatatype:Y.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0})}C&&(g?(w=2,D=Y.UNSIGNED_BYTE):m?(w=2,D=A<=255?Y.UNSIGNED_BYTE:Y.UNSIGNED_SHORT):(w=3,D=Y.FLOAT),P.push({index:Dte,vertexBuffer:v,componentsPerAttribute:w,componentDatatype:D,normalize:!1,offsetInBytes:0,strideInBytes:0})),E&&P.push({index:bIe,vertexBuffer:S,componentsPerAttribute:1,componentDatatype:Y.fromTypedArray(c.typedArray),normalize:!1,offsetInBytes:0,strideInBytes:0}),f&&(P=P.concat(R));let L=new Vn({context:n,attributes:P}),F={depthTest:{enabled:!0}},V={depthTest:{enabled:!0},depthMask:!1,blending:en.ALPHA_BLEND};e._opaquePass===Pe.CESIUM_3D_TILE&&(F.stencilTest=qt.setCesium3DTileBit(),F.stencilMask=qt.CESIUM_3D_TILE_MASK,V.stencilTest=qt.setCesium3DTileBit(),V.stencilMask=qt.CESIUM_3D_TILE_MASK),e._opaqueRenderState=je.fromCache(F),e._translucentRenderState=je.fromCache(V),e._drawCommand=new nt({boundingVolume:new se,cull:e._cull,modelMatrix:new O,primitiveType:Re.POINTS,vertexArray:L,count:r,shaderProgram:void 0,uniformMap:void 0,renderState:x?e._translucentRenderState:e._opaqueRenderState,pass:x?Pe.TRANSLUCENT:e._opaquePass,owner:e,castShadows:!1,receiveShadows:!1,pickId:e._pickIdLoaded()})}function J1t(e,t){let n=t.context,i=e._isQuantized,r=e._isQuantizedDraco,o=e._isOctEncodedDraco,a={u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier:function(){let s=W1t;if(s.x=e._attenuation?e.maximumAttenuation:e._pointSize,s.x*=t.pixelRatio,s.y=e.time,e._attenuation){let c=t.camera.frustum,u;t.mode===re.SCENE2D||c instanceof pn?u=Number.POSITIVE_INFINITY:u=n.drawingBufferHeight/t.camera.frustum.sseDenominator,s.z=e.geometricError*e.geometricErrorScale,s.w=u}return s},u_highlightColor:function(){return e._highlightColor},u_constantColor:function(){return e._constantColor},u_clippingPlanes:function(){let s=e.clippingPlanes;return e.isClipped?s.texture:n.defaultTexture},u_clippingPlanesEdgeStyle:function(){let s=e.clippingPlanes;if(!l(s))return U.TRANSPARENT;let c=U.clone(s.edgeColor,Y1t);return c.alpha=s.edgeWidth,c},u_clippingPlanesMatrix:function(){let s=e.clippingPlanes;if(!l(s))return O.IDENTITY;let c=e.clippingPlanesOriginMatrix??e._modelMatrix;O.multiply(n.uniformState.view3D,c,Ste);let u=O.multiply(Ste,s.modelMatrix,Ste);return O.inverseTranspose(u,K1t)}};pR.addUniforms(e,a),(i||r||o)&&(a=Ot(a,{u_quantizedVolumeScaleAndOctEncodedRange:function(){let s=q1t;if(l(e._quantizedVolumeScale)){let c=h.clone(e._quantizedVolumeScale,s);h.divideByScalar(c,e._quantizedRange,s)}return s.w=e._octEncodedRange,s}})),l(e._uniformMapLoaded)&&(a=e._uniformMapLoaded(a)),e._drawCommand.uniformMap=a}function wte(e,t){let n=/czm_3dtiles_property_(\d+)/g,i=n.exec(e);for(;i!==null;){let r=parseInt(i[1]);t.indexOf(r)===-1&&t.push(r),i=n.exec(e)}}function Ite(e,t){e=e.slice(e.indexOf(`
|
|
`));let n=/czm_3dtiles_builtin_property_(\w+)/g,i=n.exec(e);for(;i!==null;){let r=i[1];t.indexOf(r)===-1&&t.push(r),i=n.exec(e)}}function Pte(e,t){let n=e.numberOfAttributes;for(let i=0;i<n;++i){let r=e.getAttribute(i);if(r.index===t)return r}}var Z1t={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 Q1t(e,t,n){let i,r,o,a=t.context,s=l(n),c=e._isQuantized,u=e._isQuantizedDraco,f=e._isOctEncoded16P,d=e._isOctEncodedDraco,p=e._isRGB565,g=e._isTranslucent,m=e._hasColors,y=e._hasNormals,A=e._hasBatchIds,b=e._backFaceCulling,x=e._normalShading,T=e._drawCommand.vertexArray,C=e.clippingPlanes,E=e._attenuation,w,D,R,M=g,N=Xe(Z1t),_={},v=e._styleableShaderAttributes;for(r in v)v.hasOwnProperty(r)&&(o=v[r],N[r]=`czm_3dtiles_property_${o.location}`,_[o.location]=o);if(s){let le={translucent:!1},Ce="(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)";w=n.getColorShaderFunction(`getColorFromStyle${Ce}`,N,le),D=n.getShowShaderFunction(`getShowFromStyle${Ce}`,N,le),R=n.getPointSizeShaderFunction(`getPointSizeFromStyle${Ce}`,N,le),l(w)&&le.translucent&&(M=!0)}e._styleTranslucent=M;let S=l(w),P=l(D),L=l(R),F=e.isClipped,V=[],z=[];S&&(wte(w,V),Ite(w,z)),P&&(wte(D,V),Ite(D,z)),L&&(wte(R,V),Ite(R,z));let j=z.indexOf("COLOR")>=0,B=z.indexOf("NORMAL")>=0;if(B&&!y)throw new oe("Style references the NORMAL semantic but the point cloud does not have normals");for(r in v)if(v.hasOwnProperty(r)){o=v[r];let le=V.indexOf(o.location)>=0,Ce=Pte(T,o.location);Ce.enabled=le}let G=m&&(!S||j);if(m){let le=Pte(T,OH);le.enabled=G}let W=y&&(x||b||B);if(y){let le=Pte(T,Dte);le.enabled=W}let Q={a_position:AIe};G&&(Q.a_color=OH),W&&(Q.a_normal=Dte),A&&(Q.a_batchId=bIe);let q="",J=V.length;for(i=0;i<J;++i){let le=V[i];o=_[le];let Ce=o.componentCount,ye=`czm_3dtiles_property_${le}`,ve;Ce===1?ve="float":ve=`vec${Ce}`,q+=`in ${ve} ${ye};
|
|
`,Q[ye]=o.location}J1t(e,t);let Z=`in vec3 a_position;
|
|
out vec4 v_color;
|
|
uniform vec4 u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier;
|
|
uniform vec4 u_constantColor;
|
|
uniform vec4 u_highlightColor;
|
|
`;Z+=`float u_pointSize;
|
|
float tiles3d_tileset_time;
|
|
`,E&&(Z+=`float u_geometricError;
|
|
float u_depthMultiplier;
|
|
`),Z+=q,G&&(g?Z+=`in vec4 a_color;
|
|
`:p?Z+=`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;
|
|
`:Z+=`in vec3 a_color;
|
|
`),W&&(f||d?Z+=`in vec2 a_normal;
|
|
`:Z+=`in vec3 a_normal;
|
|
`),A&&(Z+=`in float a_batchId;
|
|
`),(c||u||d)&&(Z+=`uniform vec4 u_quantizedVolumeScaleAndOctEncodedRange;
|
|
`),S&&(Z+=w),P&&(Z+=D),L&&(Z+=R),Z+=`void main()
|
|
{
|
|
u_pointSize = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.x;
|
|
tiles3d_tileset_time = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.y;
|
|
`,E&&(Z+=` u_geometricError = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.z;
|
|
u_depthMultiplier = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.w;
|
|
`),G?g?Z+=` vec4 color = a_color;
|
|
`:p?Z+=` 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);
|
|
`:Z+=` vec4 color = vec4(a_color, 1.0);
|
|
`:Z+=` vec4 color = u_constantColor;
|
|
`,c||u?Z+=` vec3 position = a_position * u_quantizedVolumeScaleAndOctEncodedRange.xyz;
|
|
`:Z+=` vec3 position = a_position;
|
|
`,Z+=` vec3 position_absolute = vec3(czm_model * vec4(position, 1.0));
|
|
`,W?(f?Z+=` vec3 normal = czm_octDecode(a_normal);
|
|
`:d?Z+=` vec3 normal = czm_octDecode(a_normal, u_quantizedVolumeScaleAndOctEncodedRange.w).zxy;
|
|
`:Z+=` vec3 normal = a_normal;
|
|
`,Z+=` vec3 normalEC = czm_normal * normal;
|
|
`):Z+=` vec3 normal = vec3(1.0);
|
|
`,S&&(Z+=` color = getColorFromStyle(position, position_absolute, color, normal);
|
|
`),P&&(Z+=` float show = float(getShowFromStyle(position, position_absolute, color, normal));
|
|
`),L?Z+=` gl_PointSize = getPointSizeFromStyle(position, position_absolute, color, normal) * czm_pixelRatio;
|
|
`:E?Z+=` vec4 positionEC = czm_modelView * vec4(position, 1.0);
|
|
float depth = -positionEC.z;
|
|
gl_PointSize = min((u_geometricError / depth) * u_depthMultiplier, u_pointSize);
|
|
`:Z+=` gl_PointSize = u_pointSize;
|
|
`,Z+=` color = color * u_highlightColor;
|
|
`,W&&x&&(Z+=` float diffuseStrength = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC);
|
|
diffuseStrength = max(diffuseStrength, 0.4);
|
|
color.xyz *= diffuseStrength * czm_lightColor;
|
|
`),Z+=` v_color = color;
|
|
gl_Position = czm_modelViewProjection * vec4(position, 1.0);
|
|
`,W&&b&&(Z+=` float visible = step(-normalEC.z, 0.0);
|
|
gl_Position *= visible;
|
|
gl_PointSize *= visible;
|
|
`),P&&(Z+=` gl_Position.w *= float(show);
|
|
gl_PointSize *= float(show);
|
|
`),Z+=`}
|
|
`;let ce=`in vec4 v_color;
|
|
`;F&&(ce+=`uniform highp sampler2D u_clippingPlanes;
|
|
uniform mat4 u_clippingPlanesMatrix;
|
|
uniform vec4 u_clippingPlanesEdgeStyle;
|
|
`,ce+=`
|
|
`,ce+=_S(C,a),ce+=`
|
|
`),ce+=`void main()
|
|
{
|
|
out_FragColor = czm_gammaCorrect(v_color);
|
|
`,F&&(ce+=DH("u_clippingPlanes","u_clippingPlanesMatrix","u_clippingPlanesEdgeStyle")),ce+=`}
|
|
`,e.splitDirection!==jo.NONE&&(ce=pR.modifyFragmentShader(ce)),l(e._vertexShaderLoaded)&&(Z=e._vertexShaderLoaded(Z)),l(e._fragmentShaderLoaded)&&(ce=e._fragmentShaderLoaded(ce));let Ae=e._drawCommand;l(Ae.shaderProgram)&&Ae.shaderProgram.destroy(),Ae.shaderProgram=Zt.fromCache({context:a,vertexShaderSource:Z,fragmentShaderSource:ce,attributeLocations:Q});try{Ae.shaderProgram._bind()}catch{throw new oe("Error generating style shader: this may be caused by a type mismatch, index out-of-bounds, or other syntax error.")}}function eRt(e,t){if(e._decodingState===Kx.READY)return!1;if(e._decodingState===Kx.NEEDS_DECODE){let n=e._parsedContent,i=n.draco,r=h_.decodePointCloud(i,t);l(r)&&(e._decodingState=Kx.DECODING,r.then(function(o){e._decodingState=Kx.READY;let a=l(o.POSITION)?o.POSITION.array:void 0,s=l(o.RGB)?o.RGB.array:void 0,c=l(o.RGBA)?o.RGBA.array:void 0,u=l(o.NORMAL)?o.NORMAL.array:void 0,f=l(o.BATCH_ID)?o.BATCH_ID.array:void 0,d=l(a)&&l(o.POSITION.data.quantization),p=l(u)&&l(o.NORMAL.data.quantization);if(d){let A=o.POSITION.data.quantization,b=A.range;e._quantizedVolumeScale=h.fromElements(b,b,b),e._quantizedVolumeOffset=h.unpack(A.minValues),e._quantizedRange=(1<<A.quantizationBits)-1,e._isQuantizedDraco=!0}p&&(e._octEncodedRange=(1<<o.NORMAL.data.quantization.quantizationBits)-1,e._isOctEncodedDraco=!0);let g=n.styleableProperties,m=i.batchTableProperties;for(let A in m)if(m.hasOwnProperty(A)){let b=o[A];l(g)||(g={}),g[A]={typedArray:b.array,componentCount:b.data.componentsPerAttribute}}l(a)&&(n.positions={typedArray:a});let y=c??s;l(y)&&(n.colors={typedArray:y}),l(u)&&(n.normals={typedArray:u}),l(f)&&(n.batchIds={typedArray:f}),n.styleableProperties=g}).catch(function(o){e._decodingState=Kx.FAILED,e._error=o}))}return!0}var tRt=new ae,nRt=new h;gR.prototype.update=function(e){let t=e.context;if(l(this._error)){let u=this._error;throw this._error=void 0,u}if(eRt(this,t))return;let i=!1,r=!O.equals(this._modelMatrix,this.modelMatrix);if(this._mode!==e.mode&&(this._mode=e.mode,r=!0),l(this._drawCommand)||($1t(this,e),r=!0,i=!0,this._ready=!0,this._parsedContent=void 0),r){O.clone(this.modelMatrix,this._modelMatrix);let u=this._drawCommand.modelMatrix;if(O.clone(this._modelMatrix,u),l(this._rtcCenter)&&O.multiplyByTranslation(u,this._rtcCenter,u),l(this._quantizedVolumeOffset)&&O.multiplyByTranslation(u,this._quantizedVolumeOffset,u),e.mode!==re.SCENE3D){let d=e.mapProjection,p=O.getColumn(u,3,tRt);ae.equals(p,ae.UNIT_W)||mt.basisTo2D(d,u,u)}let f=this._drawCommand.boundingVolume;if(se.clone(this._boundingSphere,f),this._cull){let d=f.center;O.multiplyByPoint(u,d,d);let p=O.getScale(u,nRt);f.radius*=h.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 o=this.splitDirection!==jo.NONE;this._splittingEnabled!==o&&(this._splittingEnabled=o,i=!0),i&&Q1t(this,e,this._style),this._drawCommand.castShadows=Rn.castShadows(this.shadows),this._drawCommand.receiveShadows=Rn.receiveShadows(this.shadows);let a=this._highlightColor.alpha<1||this._constantColor.alpha<1||this._styleTranslucent;this._drawCommand.renderState=a?this._translucentRenderState:this._opaqueRenderState,this._drawCommand.pass=a?Pe.TRANSLUCENT:this._opaquePass;let s=e.commandList,c=e.passes;(c.render||c.pick)&&s.push(this._drawCommand)};gR.prototype.isDestroyed=function(){return!1};gR.prototype.destroy=function(){let e=this._drawCommand;return l(e)&&(e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy()),ue(this)};var MH=gR;function Jx(e){e=e??H.EMPTY_OBJECT,this.show=e.show??!0,this.modelMatrix=O.clone(e.modelMatrix??O.IDENTITY),this.shadows=e.shadows??Rn.ENABLED,this.maximumMemoryUsage=e.maximumMemoryUsage??256,this.shading=new J0(e.shading),this.style=e.style,this.frameFailed=new be,this.frameChanged=new be,this._clock=e.clock,this._intervals=e.intervals,this._clippingPlanes=void 0,this.clippingPlanes=e.clippingPlanes,this._pointCloudEyeDomeLighting=new xy,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(Jx.prototype,{clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){va.setOwner(e,this,"_clippingPlanes")}},totalMemoryUsageInBytes:{get:function(){return this._totalMemoryUsageInBytes}},boundingSphere:{get:function(){if(l(this._lastRenderedFrame))return this._lastRenderedFrame.pointCloud.boundingSphere}}});function iRt(e){return`uniform vec4 czm_pickColor;
|
|
${e}`}function rRt(e){return function(t){return Ot(t,{czm_pickColor:function(){return e._pickId.color}})}}function oRt(){return"czm_pickColor"}Jx.prototype.makeStyleDirty=function(){this._styleDirty=!0};Jx.prototype._getAverageLoadTime=function(){return this._runningLength===0?.05:this._runningAverage};var aRt=new K;function Ote(e){let t=e._clock,n=t.canAnimate&&t.shouldAnimate,i=t.multiplier;return n?i:0}function $x(e,t){return e._intervals.indexOf(t.start)}function sRt(e,t){let n=e._intervals,i=e._clock,r=Ote(e);if(r===0)return;let o=e._getAverageLoadTime(),a=K.addSeconds(i.currentTime,o*r,aRt),s=n.indexOf(a),c=$x(e,t);return s===c&&(r>=0?++s:--s),n.get(s)}function cRt(e){let t=e._intervals,i=e._clock.currentTime,r=t.indexOf(i);return t.get(r)}function lRt(e,t,n){let i=Ote(e),r=$x(e,t),o=$x(e,n);return i>=0?r>=o:r<=o}function TIe(e,t){return function(n){let i=l(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 uRt(e,t,n){let i=$x(e,t),r=e._frames,o=r[i];if(!l(o)){let a=t.data.transform,s=l(a)?O.fromArray(a):void 0,c=t.data.uri;o={pointCloud:void 0,transform:s,timestamp:An(),sequential:!0,ready:!1,touchedFrameNumber:n.frameNumber,uri:c},r[i]=o,De.fetchArrayBuffer({url:c}).then(function(u){o.pointCloud=new MH({arrayBuffer:u,cull:!0,fragmentShaderLoaded:iRt,uniformMapLoaded:rRt(e),pickIdLoaded:oRt})}).catch(TIe(e,c))}return o}function fRt(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 dRt(e,t,n,i){t.touchedFrameNumber<i.frameNumber-1&&(t.sequential=!1);let r=t.pointCloud;if(l(r)&&!t.ready){let o=i.commandList,a=o.length;if(CIe(e,t,n,i),r.ready&&(t.ready=!0,e._totalMemoryUsageInBytes+=r.geometryByteLength,o.length=a,t.sequential)){let s=(An()-t.timestamp)/1e3;fRt(e,s)}}t.touchedFrameNumber=i.frameNumber}var hRt=new O;function mRt(e,t){let n=e.shading;return l(n)&&l(n.baseResolution)?n.baseResolution:l(t.boundingSphere)?I.cbrt(t.boundingSphere.volume()/t.pointsLength):0}function pRt(e){let t=e.shading;return l(t)&&l(t.maximumAttenuation)?t.maximumAttenuation:10}var gRt=new J0;function CIe(e,t,n,i){let r=e.shading??gRt,o=t.pointCloud,a=t.transform??O.IDENTITY;o.modelMatrix=O.multiplyTransformation(e.modelMatrix,a,hRt),o.style=e.style,o.time=n.timeSinceLoad,o.shadows=e.shadows,o.clippingPlanes=e._clippingPlanes,o.isClipped=n.isClipped,o.attenuation=r.attenuation,o.backFaceCulling=r.backFaceCulling,o.normalShading=r.normalShading,o.geometricError=mRt(e,o),o.geometricErrorScale=r.geometricErrorScale,o.maximumAttenuation=pRt(e);try{o.update(i)}catch(s){TIe(e,t.uri)(s)}t.touchedFrameNumber=i.frameNumber}function Rte(e,t,n,i){let r=uRt(e,t,i);dRt(e,r,n,i)}function _Rt(e){return function(t){return t.touchedFrameNumber<e.frameNumber}}function vIe(e,t){let n=e._frames,i=n.length;for(let r=0;r<i;++r){let o=n[r];if(l(o)&&(!l(t)||t(o))){let a=o.pointCloud;o.ready&&(e._totalMemoryUsageInBytes-=a.geometryByteLength),l(a)&&a.destroy(),o===e._lastRenderedFrame&&(e._lastRenderedFrame=void 0),n[r]=void 0}}}function yRt(e,t){let n=$x(e,t),i=e._frames[n];if(l(i)&&i.ready)return i}function xIe(e,t,n,i,r){return l(n)?n.ready?!0:(Rte(e,t,i,r),n.ready):!1}function ARt(e,t,n,i,r){let o,a,s,c=e._intervals,u=e._frames,f=$x(e,n),d=$x(e,t);if(f>=d){for(o=f;o>=d;--o)if(a=c.get(o),s=u[o],xIe(e,a,s,i,r))return a}else for(o=f;o<=d;++o)if(a=c.get(o),s=u[o],xIe(e,a,s,i,r))return a;return t}function bRt(e,t,n){let i=e._frames,r=i.length;for(let o=0;o<r;++o){let a=i[o];l(a)&&l(a.pointCloud)&&(a.pointCloud.clippingPlanesDirty=t,a.pointCloud.styleDirty=n)}}var VS={timeSinceLoad:0,isClipped:!1,clippingPlanesDirty:!1};Jx.prototype.update=function(e){if(e.mode===re.MORPHING||!this.show)return;l(this._pickId)||(this._pickId=e.context.createPickId({primitive:this})),l(this._loadTimestamp)||(this._loadTimestamp=K.clone(e.time));let t=Math.max(K.secondsDifference(e.time,this._loadTimestamp)*1e3,0),n=this._clippingPlanes,i=0,r=!1,o=l(n)&&n.enabled;o&&(n.update(e),i=n.clippingPlanesState),this._clippingPlanesState!==i&&(this._clippingPlanesState=i,r=!0);let a=this._styleDirty;this._styleDirty=!1,(r||a)&&bRt(this,r,a),VS.timeSinceLoad=t,VS.isClipped=o;let s=this.shading,c=this._pointCloudEyeDomeLighting,u=e.commandList,f=u.length,d=this._previousInterval,p=this._nextInterval,g=cRt(this);if(!l(g))return;let m=!1,y=Ote(this),A=y===0;y!==this._clockMultiplier&&(m=!0,this._clockMultiplier=y),(!l(d)||A)&&(d=g),(!l(p)||m||lRt(this,g,p))&&(p=sRt(this,g)),d=ARt(this,d,g,VS,e);let b=yRt(this,d);l(b)||(Rte(this,d,VS,e),b=this._lastRenderedFrame),l(b)&&CIe(this,b,VS,e),l(p)&&Rte(this,p,VS,e);let x=this;l(b)&&!l(this._lastRenderedFrame)&&e.afterRender.push(function(){return!0}),l(b)&&b!==this._lastRenderedFrame&&x.frameChanged.numberOfListeners>0&&e.afterRender.push(function(){return x.frameChanged.raiseEvent(x),!0}),this._previousInterval=d,this._nextInterval=p,this._lastRenderedFrame=b;let T=this._totalMemoryUsageInBytes,C=this.maximumMemoryUsage*1024*1024;T>C&&vIe(this,_Rt(e));let w=u.length-f;l(s)&&s.attenuation&&s.eyeDomeLighting&&w>0&&c.update(e,f,s,this.boundingSphere)};Jx.prototype.isDestroyed=function(){return!1};Jx.prototype.destroy=function(){return vIe(this),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),ue(this)};var _R=Jx;function wIe(e,t){if(l(t)){let n=t.clock;l(n)&&n.getValue(e)}}function xRt(e){e._renderLoopRunning=!0;let t=0;function n(i){if(!e.isDestroyed())if(e._useDefaultRenderLoop)try{let r=e._targetFrameRate;if(!l(r))e.resize(),e.render(),requestAnimationFrame(n);else{let o=1e3/r,a=i-t;a>o&&(e.resize(),e.render(),t=i-a%o),requestAnimationFrame(n)}}catch(r){e._useDefaultRenderLoop=!1,e._renderLoopRunning=!1,e._showRenderLoopErrors&&e.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,r)}else e._renderLoopRunning=!1}requestAnimationFrame(n)}function IIe(e){let t=e._useBrowserRecommendedResolution?1:window.devicePixelRatio;return t*=e._resolutionScale,l(e._scene)&&(e._scene.pixelRatio=t),t}function PIe(e){let t=e._canvas,n=t.clientWidth,i=t.clientHeight,r=IIe(e);e._canvasClientWidth=n,e._canvasClientHeight=i,n*=r,i*=r,t.width=n,t.height=i,e._canRender=n!==0&&i!==0,e._lastDevicePixelRatio=window.devicePixelRatio}function DIe(e){let t=e._canvas,n=t.width,i=t.height;if(n!==0&&i!==0){let r=e._scene.camera.frustum;l(r.aspectRatio)?r.aspectRatio=n/i:(r.top=r.right*(i/n),r.bottom=-r.top)}}function Lr(e,t){e=zn(e),t=t??H.EMPTY_OBJECT;let n=document.createElement("div");n.className="cesium-widget",e.appendChild(n);let i=document.createElement("canvas"),r=fn.supportsImageRenderingPixelated();this._supportsImageRenderingPixelated=r,r&&(i.style.imageRendering=fn.imageRenderingValue()),i.oncontextmenu=function(){return!1},i.onselectstart=function(){return!1};function o(){i!==i.ownerDocument.activeElement&&i.ownerDocument.activeElement.blur()}(t.blurActiveElementOnCanvasFocus??!0)&&(i.addEventListener("mousedown",o),i.addEventListener("pointerdown",o)),n.appendChild(i);let s=document.createElement("div");s.className="cesium-widget-credits";let c=l(t.creditContainer)?zn(t.creditContainer):n;c.appendChild(s);let u=l(t.creditViewport)?zn(t.creditViewport):n,f=t.showRenderLoopErrors??!0,d=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=c,this._innerCreditContainer=s,this._canRender=!1,this._renderLoopRunning=!1,this._showRenderLoopErrors=f,this._resolutionScale=1,this._useBrowserRecommendedResolution=d,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 be,this._allowDataSourcesToSuspendAnimation=!0,this._clock=l(t.clock)?t.clock:new jm,l(t.shouldAnimate)&&(this._clock.shouldAnimate=t.shouldAnimate),PIe(this);try{let p=t.ellipsoid??te.default,g=new yH({canvas:i,contextOptions:t.contextOptions,creditContainer:s,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=h.UNIT_Z,IIe(this),DIe(this);let m=t.globe;l(m)||(m=new $8(p)),m!==!1&&(g.globe=m,g.globe.shadows=t.terrainShadows??Rn.RECEIVE_ONLY);let y=t.skyBox;!l(y)&&te.WGS84.equals(p)&&(y=EH.createEarthSkyBox()),y!==!1&&(g.skyBox=y,g.sun=new PH,te.WGS84.equals(p)&&(g.moon=new tj));let A=t.skyAtmosphere;!l(A)&&te.WGS84.equals(p)&&(A=new xH(p),A.show=t.globe!==!1&&m.show),A!==!1&&(g.skyAtmosphere=A);let b=t.baseLayer;t.globe!==!1&&b!==!1&&(l(b)||(b=wa.fromWorldImagery()),g.imageryLayers.add(b)),l(t.terrainProvider)&&t.globe!==!1&&(g.terrainProvider=t.terrainProvider),l(t.terrain)&&t.globe!==!1&&g.setTerrain(t.terrain),this._screenSpaceEventHandler=new os(i),l(t.sceneMode)&&(t.sceneMode===re.SCENE2D&&this._scene.morphTo2D(0),t.sceneMode===re.COLUMBUS_VIEW&&this._scene.morphToColumbusView(0)),this._useDefaultRenderLoop=void 0,this.useDefaultRenderLoop=t.useDefaultRenderLoop??!0,this._targetFrameRate=void 0,this.targetFrameRate=t.targetFrameRate;let x=this;this._onRenderError=function(R,M){x._useDefaultRenderLoop=!1,x._renderLoopRunning=!1,x._showRenderLoopErrors&&x.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,M)},g.renderError.addEventListener(this._onRenderError);let T=t.dataSources,C=!1;l(T)||(T=new Xk,C=!0);let E=new T8({scene:g,dataSourceCollection:T}),w=new Fo;this._dataSourceChangedListeners={},this._automaticallyTrackDataSourceClocks=t.automaticallyTrackDataSourceClocks??!0,this._dataSourceCollection=T,this._destroyDataSourceCollection=C,this._dataSourceDisplay=E,this._eventHelper=w,this._canAnimateUpdateCallback=this._updateCanAnimate,w.add(this._clock.onTick,Lr.prototype._onTick,this),w.add(g.morphStart,Lr.prototype._clearTrackedObject,this),w.add(T.dataSourceAdded,Lr.prototype._onDataSourceAdded,this),w.add(T.dataSourceRemoved,Lr.prototype._onDataSourceRemoved,this),w.add(g.postRender,Lr.prototype._postRender,this);let D=T.length;for(let R=0;R<D;R++)this._dataSourceAdded(T,T.get(R));this._dataSourceAdded(void 0,E.defaultDataSource),w.add(T.dataSourceAdded,Lr.prototype._dataSourceAdded,this),w.add(T.dataSourceRemoved,Lr.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(Lr.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){this._targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._useDefaultRenderLoop},set:function(e){this._useDefaultRenderLoop!==e&&(this._useDefaultRenderLoop=e,e&&!this._renderLoopRunning&&xRt(this))}},resolutionScale:{get:function(){return this._resolutionScale},set:function(e){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,Mte(this);let t=this.scene,n=t.mode;!l(e)||!l(e.position)?(this._needTrackedEntityUpdate=!1,(n===re.COLUMBUS_VIEW||n===re.SCENE2D)&&(t.screenSpaceCameraController.enableTranslate=!0),(n===re.COLUMBUS_VIEW||n===re.SCENE3D)&&(t.screenSpaceCameraController.enableTilt=!0),this._entityView=void 0,this.camera.lookAtTransform(O.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,wIe(this.clock,e))}}});Lr.prototype.showErrorPanel=function(e,t,n){let i=this._element,r=document.createElement("div");r.className="cesium-widget-errorPanel";let o=document.createElement("div");o.className="cesium-widget-errorPanel-content",r.appendChild(o);let a=document.createElement("div");a.className="cesium-widget-errorPanel-header",a.appendChild(document.createTextNode(e)),o.appendChild(a);let s=document.createElement("div");s.className="cesium-widget-errorPanel-scroll",o.appendChild(s);function c(){s.style.maxHeight=`${Math.max(Math.round(i.clientHeight*.9-100),30)}px`}c(),l(window.addEventListener)&&window.addEventListener("resize",c,!1);let u=l(t),f=l(n);if(u||f){let g=document.createElement("div");if(g.className="cesium-widget-errorPanel-message",s.appendChild(g),f){let m=m0(n);u||(typeof n=="string"&&(n=new Error(n)),t=m0({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 A=document.createElement("span");A.className="cesium-widget-errorPanel-more-details",A.appendChild(document.createTextNode("See more...")),y.appendChild(A),y.onclick=function(b){y.removeChild(A),y.appendChild(document.createTextNode(m)),y.className="cesium-widget-errorPanel-message-details",o.className="cesium-widget-errorPanel-content expanded",y.onclick=void 0},s.appendChild(y)}g.innerHTML=`<p>${t}</p>`}let d=document.createElement("div");d.className="cesium-widget-errorPanel-buttonPanel",o.appendChild(d);let p=document.createElement("button");p.setAttribute("type","button"),p.className="cesium-button",p.appendChild(document.createTextNode("OK")),p.onclick=function(){l(c)&&l(window.removeEventListener)&&window.removeEventListener("resize",c,!1),i.removeChild(r)},d.appendChild(p),i.appendChild(r)};Lr.prototype.isDestroyed=function(){return!1};Lr.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(),l(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()),ue(this)};Lr.prototype.resize=function(){let e=this._canvas;!this._forceResize&&this._canvasClientWidth===e.clientWidth&&this._canvasClientHeight===e.clientHeight&&this._lastDevicePixelRatio===window.devicePixelRatio||(this._forceResize=!1,PIe(this),DIe(this),this._scene.requestRender())};Lr.prototype.render=function(){if(this._canRender){this._scene.initializeFrame();let e=this._clock.tick();this._scene.render(e)}else this._clock.tick()};Lr.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(Lr.prototype._onEntityCollectionChanged,this)};Lr.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(Lr.prototype._onEntityCollectionChanged,this),l(this.trackedEntity)&&n.getById(this.trackedEntity.id)===this.trackedEntity&&(this.trackedEntity=void 0)};Lr.prototype._updateCanAnimate=function(e){this._clock.canAnimate=e};var TRt=new se;Lr.prototype._onTick=function(e){let t=e.currentTime,n=this._dataSourceDisplay.update(t);this._allowDataSourcesToSuspendAnimation&&this._canAnimateUpdateCallback(n);let i=this._entityView;if(l(i)){let r=this._trackedEntity;this._dataSourceDisplay.getBoundingSphere(r,!1,i.boundingSphere??TRt)===It.DONE&&i.update(t)}};Lr.prototype._onEntityCollectionChanged=function(e,t,n){let i=n.length;for(let r=0;r<i;r++){let o=n[r];this.trackedEntity===o&&(this.trackedEntity=void 0)}};Lr.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};Lr.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&wIe(this.clock,e)};Lr.prototype._onDataSourceAdded=function(e,t){this._automaticallyTrackDataSourceClocks&&(this.clockTrackedDataSource=t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,Lr.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};Lr.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 r=e.length;this._automaticallyTrackDataSourceClocks&&r>0?this.clockTrackedDataSource=e.get(r-1):this.clockTrackedDataSource=void 0}};Lr.prototype.addController=function(e){return this.scene.controllerHost.registerController(e,this.container)};Lr.prototype.removeController=function(e){return this.scene.controllerHost.unregisterController(e,this.container)};Lr.prototype.zoomTo=function(e,t){return RIe(this,e,{offset:t},!1)};Lr.prototype.flyTo=function(e,t){return RIe(this,e,t,!0)};function RIe(e,t,n,i){Mte(e);let r=new Promise(o=>{e._completeZoom=function(a){o(a)}});return e._zoomPromise=r,e._zoomIsFlight=i,e._zoomOptions=n,Promise.resolve(t).then(function(o){if(e._zoomPromise===r){if(o instanceof wa){let a;l(o.imageryProvider)?a=Promise.resolve(o.getImageryRectangle()):a=new Promise(s=>{let c=o.readyEvent.addEventListener(()=>{c(),s(o.getImageryRectangle())})}),a.then(function(s){return gS(s,e.scene)}).then(function(s){e._zoomPromise===r&&(e._zoomTarget=s)});return}if(o instanceof Yo||o instanceof _R||o instanceof qx||o instanceof as){e._zoomTarget=o;return}if(o.isLoading&&l(o.loadingEvent)){let a=o.loadingEvent.addEventListener(function(){a(),e._zoomPromise===r&&(e._zoomTarget=o.entities.values.slice(0))});return}if(Array.isArray(o)){e._zoomTarget=o.slice(0);return}o=o.values??o,l(o.entities)&&(o=o.entities.values),Array.isArray(o)?e._zoomTarget=o.slice(0):e._zoomTarget=[o]}}),e.scene.requestRender(),r}function yR(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function Mte(e){let t=e._zoomPromise;l(t)&&(yR(e),e._completeZoom(!1))}Lr.prototype._postRender=function(){CRt(this),vRt(this)};var EIe=new se;function CRt(e){let t=e._zoomTarget;if(!l(t)||e.scene.mode===re.MORPHING)return;let n=e.scene,i=n.camera,r=e._zoomOptions??{},o;function a(f){l(r.offset)||(r.offset=new ph(0,-.5,f.radius)),o={offset:r.offset,duration:r.duration,maximumHeight:r.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyToBoundingSphere(f,o):(i.viewBoundingSphere(f,r.offset),i.lookAtTransform(O.IDENTITY),e._completeZoom(!0)),yR(e)}if(t instanceof _R){if(l(t.boundingSphere)){a(t.boundingSphere);return}let f=t.frameChanged.addEventListener(function(d){a(d.boundingSphere),f()});return}if(t instanceof Yo||t instanceof qx){a(t.boundingSphere);return}if(t instanceof as){a(t.boundingVolume);return}if(t instanceof de){o={destination:n.ellipsoid.cartographicToCartesian(t),duration:r.duration,maximumHeight:r.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyTo(o):(i.setView(o),e._completeZoom(!0)),yR(e);return}let s=t,c=[];for(let f=0,d=s.length;f<d;f++){let p=e._dataSourceDisplay.getBoundingSphere(s[f],!1,EIe);if(p===It.PENDING)return;p!==It.FAILED&&c.push(se.clone(EIe))}if(c.length===0){Mte(e);return}e.trackedEntity=void 0;let u=se.fromBoundingSpheres(c);e._zoomIsFlight?(yR(e),i.flyToBoundingSphere(u,{duration:r.duration,maximumHeight:r.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)},offset:r.offset})):(i.viewBoundingSphere(u,r.offset),i.lookAtTransform(O.IDENTITY),yR(e),e._completeZoom(!0))}var SIe=new se;function vRt(e){if(!e._needTrackedEntityUpdate)return;let t=e._trackedEntity,n=e.clock.currentTime,i=X.getValueOrUndefined(t.position,n);if(!l(i))return;let r=e.scene,o=e._dataSourceDisplay.getBoundingSphere(t,!1,SIe);if(o===It.PENDING)return;let a=r.mode;(a===re.COLUMBUS_VIEW||a===re.SCENE2D)&&(r.screenSpaceCameraController.enableTranslate=!1),(a===re.COLUMBUS_VIEW||a===re.SCENE3D)&&(r.screenSpaceCameraController.enableTilt=!1);let s=o!==It.FAILED?SIe:void 0;e._entityView=new E8(t,r,r.ellipsoid),e._entityView.update(n,s),e._needTrackedEntityUpdate=!1}var LH=Lr;var ERt=U.WHITE,SRt=U.BLACK,wRt=new k(2,2);function jS(e){e=e??H.EMPTY_OBJECT,this._definitionChanged=new be,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(jS.prototype,{isConstant:{get:function(){return X.isConstant(this._evenColor)&&X.isConstant(this._oddColor)&&X.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},evenColor:me("evenColor"),oddColor:me("oddColor"),repeat:me("repeat")});jS.prototype.getType=function(e){return"Checkerboard"};var IRt=new K;jS.prototype.getValue=function(e,t){return l(e)||(e=K.now(IRt)),l(t)||(t={}),t.lightColor=X.getValueOrClonedDefault(this._evenColor,e,ERt,t.lightColor),t.darkColor=X.getValueOrClonedDefault(this._oddColor,e,SRt,t.darkColor),t.repeat=X.getValueOrDefault(this._repeat,e,wRt),t};jS.prototype.equals=function(e){return this===e||e instanceof jS&&X.equals(this._evenColor,e._evenColor)&&X.equals(this._oddColor,e._oddColor)&&X.equals(this._repeat,e._repeat)};var AR=jS;var NH={id:void 0},HS=new Array(2);function Lte(e){let t=e.propertyNames,n=t.length;for(let i=0;i<n;i++)e[t[i]]=void 0;e._name=void 0,e._availability=void 0}function OIe(e,t,n,i){HS[0]=n,HS[1]=i.id,t[JSON.stringify(HS)]=i.definitionChanged.addEventListener(la.prototype._onDefinitionChanged,e)}function MIe(e,t,n,i){HS[0]=n,HS[1]=i.id;let r=JSON.stringify(HS);t[r](),t[r]=void 0}function dA(e){if(e._shouldRecomposite=!0,e._suspendCount!==0)return;let t=e._collections,n=t.length,i=e._collectionsCopy,r=i.length,o,a,s,c,u,f=e._composite,d=new Qs(e),p=e._eventHash,g;for(o=0;o<r;o++)for(u=i[o],u.collectionChanged.removeEventListener(la.prototype._onCollectionChanged,e),s=u.values,g=u.id,c=s.length-1;c>-1;c--)a=s[c],MIe(e,p,g,a);for(o=n-1;o>=0;o--)for(u=t[o],u.collectionChanged.addEventListener(la.prototype._onCollectionChanged,e),s=u.values,g=u.id,c=s.length-1;c>-1;c--){a=s[c],OIe(e,p,g,a);let y=d.getById(a.id);l(y)||(y=f.getById(a.id),l(y)?Lte(y):(NH.id=a.id,y=new $r(NH)),d.add(y)),y.merge(a)}e._collectionsCopy=t.slice(0),f.suspendEvents(),f.removeAll();let m=d.values;for(o=0;o<m.length;o++)f.add(m[o]);f.resumeEvents()}function la(e,t){this._owner=t,this._composite=new Qs(this),this._suspendCount=0,this._collections=l(e)?e.slice():[],this._collectionsCopy=[],this._id=Kn(),this._eventHash={},dA(this),this._shouldRecomposite=!1}Object.defineProperties(la.prototype,{collectionChanged:{get:function(){return this._composite._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._composite.values}},owner:{get:function(){return this._owner}}});la.prototype.addCollection=function(e,t){l(t)?this._collections.splice(t,0,e):this._collections.push(e),dA(this)};la.prototype.removeCollection=function(e){let t=this._collections.indexOf(e);return t!==-1?(this._collections.splice(t,1),dA(this),!0):!1};la.prototype.removeAllCollections=function(){this._collections.length=0,dA(this)};la.prototype.containsCollection=function(e){return this._collections.indexOf(e)!==-1};la.prototype.contains=function(e){return this._composite.contains(e)};la.prototype.indexOfCollection=function(e){return this._collections.indexOf(e)};la.prototype.getCollection=function(e){return this._collections[e]};la.prototype.getCollectionsLength=function(){return this._collections.length};function FH(e,t){return e.indexOf(t)}function LIe(e,t,n){let i=e._collections;if(t=I.clamp(t,0,i.length-1),n=I.clamp(n,0,i.length-1),t===n)return;let r=i[t];i[t]=i[n],i[n]=r,dA(e)}la.prototype.raiseCollection=function(e){let t=FH(this._collections,e);LIe(this,t,t+1)};la.prototype.lowerCollection=function(e){let t=FH(this._collections,e);LIe(this,t,t-1)};la.prototype.raiseCollectionToTop=function(e){let t=FH(this._collections,e);t!==this._collections.length-1&&(this._collections.splice(t,1),this._collections.push(e),dA(this))};la.prototype.lowerCollectionToBottom=function(e){let t=FH(this._collections,e);t!==0&&(this._collections.splice(t,1),this._collections.splice(0,0,e),dA(this))};la.prototype.suspendEvents=function(){this._suspendCount++,this._composite.suspendEvents()};la.prototype.resumeEvents=function(){this._suspendCount--,this._shouldRecomposite&&this._suspendCount===0&&(dA(this),this._shouldRecomposite=!1),this._composite.resumeEvents()};la.prototype.computeAvailability=function(){return this._composite.computeAvailability()};la.prototype.getById=function(e){return this._composite.getById(e)};la.prototype._onCollectionChanged=function(e,t,n){let i=this._collectionsCopy,r=i.length,o=this._composite;o.suspendEvents();let a,s,c,u,f=n.length,d=this._eventHash,p=e.id;for(a=0;a<f;a++){let m=n[a];MIe(this,d,p,m);let y=m.id;for(s=r-1;s>=0;s--)c=i[s].getById(y),l(c)&&(l(u)||(u=o.getById(y),Lte(u)),u.merge(c));l(u)||o.removeById(y),u=void 0}let g=t.length;for(a=0;a<g;a++){let m=t[a];OIe(this,d,p,m);let y=m.id;for(s=r-1;s>=0;s--)c=i[s].getById(y),l(c)&&(l(u)||(u=o.getById(y),l(u)?Lte(u):(NH.id=y,u=new $r(NH),o.add(u))),u.merge(c));u=void 0}o.resumeEvents()};la.prototype._onDefinitionChanged=function(e,t,n,i){let r=this._collections,o=this._composite,a=r.length,s=e.id,c=o.getById(s),u=c[t],f=!l(u),d=!0;for(let p=a-1;p>=0;p--){let g=r[p].getById(e.id);if(l(g)){let m=g[t];if(l(m)){if(d)if(d=!1,l(m.merge)&&l(m.clone))u=m.clone(u);else{u=m;break}u.merge(m)}}}f&&c.propertyNames.indexOf(t)===-1&&c.addProperty(t),c[t]=u};var NIe=la;function hA(){this._definitionChanged=new be,this._composite=new Bl,this._composite.definitionChanged.addEventListener(hA.prototype._raiseDefinitionChanged,this)}Object.defineProperties(hA.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite._intervals}}});hA.prototype.getType=function(e){let t=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(t))return t.getType(e)};var PRt=new K;hA.prototype.getValue=function(e,t){l(e)||(e=K.now(PRt));let n=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};hA.prototype.equals=function(e){return this===e||e instanceof hA&&this._composite.equals(e._composite,X.equals)};hA.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var bR=hA;var RR=La(Uu(),1);function Zx(){this._definitionChanged=new be,this._startTime=void 0,this._stopTime=void 0,this._currentTime=void 0,this._clockRange=void 0,this._clockStep=void 0,this._multiplier=void 0}Object.defineProperties(Zx.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},startTime:yu("startTime"),stopTime:yu("stopTime"),currentTime:yu("currentTime"),clockRange:yu("clockRange"),clockStep:yu("clockStep"),multiplier:yu("multiplier")});Zx.prototype.clone=function(e){return l(e)||(e=new Zx),e.startTime=this.startTime,e.stopTime=this.stopTime,e.currentTime=this.currentTime,e.clockRange=this.clockRange,e.clockStep=this.clockStep,e.multiplier=this.multiplier,e};Zx.prototype.equals=function(e){return this===e||l(e)&&K.equals(this.startTime,e.startTime)&&K.equals(this.stopTime,e.stopTime)&&K.equals(this.currentTime,e.currentTime)&&this.clockRange===e.clockRange&&this.clockStep===e.clockStep&&this.multiplier===e.multiplier};Zx.prototype.merge=function(e){this.startTime=this.startTime??e.startTime,this.stopTime=this.stopTime??e.stopTime,this.currentTime=this.currentTime??e.currentTime,this.clockRange=this.clockRange??e.clockRange,this.clockStep=this.clockStep??e.clockStep,this.multiplier=this.multiplier??e.multiplier};Zx.prototype.getValue=function(e){return l(e)||(e=new jm),e.startTime=this.startTime??e.startTime,e.stopTime=this.stopTime??e.stopTime,e.currentTime=this.currentTime??e.currentTime,e.clockRange=this.clockRange??e.clockRange,e.multiplier=this.multiplier??e.multiplier,e.clockStep=this.clockStep??e.clockStep,e};var Vp=Zx;var DRt=U.WHITE,RRt=.1,ORt=new k(8,8),MRt=new k(0,0),LRt=new k(1,1);function GS(e){e=e??H.EMPTY_OBJECT,this._definitionChanged=new be,this._color=void 0,this._colorSubscription=void 0,this._cellAlpha=void 0,this._cellAlphaSubscription=void 0,this._lineCount=void 0,this._lineCountSubscription=void 0,this._lineThickness=void 0,this._lineThicknessSubscription=void 0,this._lineOffset=void 0,this._lineOffsetSubscription=void 0,this.color=e.color,this.cellAlpha=e.cellAlpha,this.lineCount=e.lineCount,this.lineThickness=e.lineThickness,this.lineOffset=e.lineOffset}Object.defineProperties(GS.prototype,{isConstant:{get:function(){return X.isConstant(this._color)&&X.isConstant(this._cellAlpha)&&X.isConstant(this._lineCount)&&X.isConstant(this._lineThickness)&&X.isConstant(this._lineOffset)}},definitionChanged:{get:function(){return this._definitionChanged}},color:me("color"),cellAlpha:me("cellAlpha"),lineCount:me("lineCount"),lineThickness:me("lineThickness"),lineOffset:me("lineOffset")});GS.prototype.getType=function(e){return"Grid"};var NRt=new K;GS.prototype.getValue=function(e,t){return l(e)||(e=K.now(NRt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,DRt,t.color),t.cellAlpha=X.getValueOrDefault(this._cellAlpha,e,RRt),t.lineCount=X.getValueOrClonedDefault(this._lineCount,e,ORt,t.lineCount),t.lineThickness=X.getValueOrClonedDefault(this._lineThickness,e,LRt,t.lineThickness),t.lineOffset=X.getValueOrClonedDefault(this._lineOffset,e,MRt,t.lineOffset),t};GS.prototype.equals=function(e){return this===e||e instanceof GS&&X.equals(this._color,e._color)&&X.equals(this._cellAlpha,e._cellAlpha)&&X.equals(this._lineCount,e._lineCount)&&X.equals(this._lineThickness,e._lineThickness)&&X.equals(this._lineOffset,e._lineOffset)};var xR=GS;function WS(e){this._definitionChanged=new be,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(WS.prototype,{isConstant:{get:function(){return X.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:me("color")});WS.prototype.getType=function(e){return"PolylineArrow"};var FRt=new K;WS.prototype.getValue=function(e,t){return l(e)||(e=K.now(FRt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,U.WHITE,t.color),t};WS.prototype.equals=function(e){return this===e||e instanceof WS&&X.equals(this._color,e._color)};var TR=WS;var BRt=U.WHITE,kRt=U.TRANSPARENT,zRt=16,URt=255;function qS(e){e=e??H.EMPTY_OBJECT,this._definitionChanged=new be,this._color=void 0,this._colorSubscription=void 0,this._gapColor=void 0,this._gapColorSubscription=void 0,this._dashLength=void 0,this._dashLengthSubscription=void 0,this._dashPattern=void 0,this._dashPatternSubscription=void 0,this.color=e.color,this.gapColor=e.gapColor,this.dashLength=e.dashLength,this.dashPattern=e.dashPattern}Object.defineProperties(qS.prototype,{isConstant:{get:function(){return X.isConstant(this._color)&&X.isConstant(this._gapColor)&&X.isConstant(this._dashLength)&&X.isConstant(this._dashPattern)}},definitionChanged:{get:function(){return this._definitionChanged}},color:me("color"),gapColor:me("gapColor"),dashLength:me("dashLength"),dashPattern:me("dashPattern")});qS.prototype.getType=function(e){return"PolylineDash"};var VRt=new K;qS.prototype.getValue=function(e,t){return l(e)||(e=K.now(VRt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,BRt,t.color),t.gapColor=X.getValueOrClonedDefault(this._gapColor,e,kRt,t.gapColor),t.dashLength=X.getValueOrDefault(this._dashLength,e,zRt,t.dashLength),t.dashPattern=X.getValueOrDefault(this._dashPattern,e,URt,t.dashPattern),t};qS.prototype.equals=function(e){return this===e||e instanceof qS&&X.equals(this._color,e._color)&&X.equals(this._gapColor,e._gapColor)&&X.equals(this._dashLength,e._dashLength)&&X.equals(this._dashPattern,e._dashPattern)};var CR=qS;var jRt=U.WHITE,HRt=.25,GRt=1;function YS(e){e=e??H.EMPTY_OBJECT,this._definitionChanged=new be,this._color=void 0,this._colorSubscription=void 0,this._glowPower=void 0,this._glowPowerSubscription=void 0,this._taperPower=void 0,this._taperPowerSubscription=void 0,this.color=e.color,this.glowPower=e.glowPower,this.taperPower=e.taperPower}Object.defineProperties(YS.prototype,{isConstant:{get:function(){return X.isConstant(this._color)&&X.isConstant(this._glow)}},definitionChanged:{get:function(){return this._definitionChanged}},color:me("color"),glowPower:me("glowPower"),taperPower:me("taperPower")});YS.prototype.getType=function(e){return"PolylineGlow"};var WRt=new K;YS.prototype.getValue=function(e,t){return l(e)||(e=K.now(WRt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,jRt,t.color),t.glowPower=X.getValueOrDefault(this._glowPower,e,HRt,t.glowPower),t.taperPower=X.getValueOrDefault(this._taperPower,e,GRt,t.taperPower),t};YS.prototype.equals=function(e){return this===e||e instanceof YS&&X.equals(this._color,e._color)&&X.equals(this._glowPower,e._glowPower)&&X.equals(this._taperPower,e._taperPower)};var vR=YS;var qRt=U.WHITE,YRt=U.BLACK,XRt=1;function XS(e){e=e??H.EMPTY_OBJECT,this._definitionChanged=new be,this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this.color=e.color,this.outlineColor=e.outlineColor,this.outlineWidth=e.outlineWidth}Object.defineProperties(XS.prototype,{isConstant:{get:function(){return X.isConstant(this._color)&&X.isConstant(this._outlineColor)&&X.isConstant(this._outlineWidth)}},definitionChanged:{get:function(){return this._definitionChanged}},color:me("color"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth")});XS.prototype.getType=function(e){return"PolylineOutline"};var KRt=new K;XS.prototype.getValue=function(e,t){return l(e)||(e=K.now(KRt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,qRt,t.color),t.outlineColor=X.getValueOrClonedDefault(this._outlineColor,e,YRt,t.outlineColor),t.outlineWidth=X.getValueOrDefault(this._outlineWidth,e,XRt),t};XS.prototype.equals=function(e){return this===e||e instanceof XS&&X.equals(this._color,e._color)&&X.equals(this._outlineColor,e._outlineColor)&&X.equals(this._outlineWidth,e._outlineWidth)};var Qx=XS;function Og(e,t){this._value=void 0,this._definitionChanged=new be,this._eventHelper=new Fo,this._referenceFrame=t??Vi.FIXED,this.setValue(e)}Object.defineProperties(Og.prototype,{isConstant:{get:function(){let e=this._value;if(!l(e))return!0;let t=e.length;for(let n=0;n<t;n++)if(!X.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var $Rt=new K;Og.prototype.getValue=function(e,t){return l(e)||(e=K.now($Rt)),this.getValueInReferenceFrame(e,Vi.FIXED,t)};Og.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._value;if(!l(i))return;let r=i.length;l(n)||(n=new Array(r));let o=0,a=0;for(;o<r;){let c=i[o].getValueInReferenceFrame(e,t,n[o]);l(c)&&(n[a]=c,a++),o++}return n.length=a,n};Og.prototype.setValue=function(e){let t=this._eventHelper;if(t.removeAll(),l(e)){this._value=e.slice();let n=e.length;for(let i=0;i<n;i++){let r=e[i];l(r)&&t.add(r.definitionChanged,Og.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};Og.prototype.equals=function(e){return this===e||e instanceof Og&&this._referenceFrame===e._referenceFrame&&X.arrayEquals(this._value,e._value)};Og.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var mA=Og;function pA(e){this._value=void 0,this._definitionChanged=new be,this._eventHelper=new Fo,this.setValue(e)}Object.defineProperties(pA.prototype,{isConstant:{get:function(){let e=this._value;if(!l(e))return!0;let t=e.length;for(let n=0;n<t;n++)if(!X.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});var JRt=new K;pA.prototype.getValue=function(e,t){l(e)||(e=K.now(JRt));let n=this._value;if(!l(n))return;let i=n.length;l(t)||(t=new Array(i));let r=0,o=0;for(;r<i;){let s=this._value[r].getValue(e,t[r]);l(s)&&(t[o]=s,o++),r++}return t.length=o,t};pA.prototype.setValue=function(e){let t=this._eventHelper;if(t.removeAll(),l(e)){this._value=e.slice();let n=e.length;for(let i=0;i<n;i++){let r=e[i];l(r)&&t.add(r.definitionChanged,pA.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};pA.prototype.equals=function(e){return this===e||e instanceof pA&&X.arrayEquals(this._value,e._value)};pA.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var ER=pA;var ZRt={packedLength:1,pack:function(e,t,n){return n=n??0,t[n]=e,t},unpack:function(e,t,n){return t=t??0,e[t]},convertPackedArrayForInterpolation:function(e,t,n,i){l(i)||(i=[]),t=t??0,n=n??e.length;let r;for(let o=0,a=n-t+1;o<a;o++){let s=e[t+o];o===0||Math.abs(r-s)<Math.PI?i[o]=s:i[o]=s-I.TWO_PI,r=s}},unpackInterpolationResult:function(e,t,n,i,r){return r=e[0],r<0?r+I.TWO_PI:r}},nm=ZRt;var FIe={HORIZONTAL:0,VERTICAL:1};Object.freeze(FIe);var jp=FIe;var QRt=jp.HORIZONTAL,eOt=U.WHITE,tOt=U.BLACK,nOt=0,iOt=1;function KS(e){e=e??H.EMPTY_OBJECT,this._definitionChanged=new be,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(KS.prototype,{isConstant:{get:function(){return X.isConstant(this._orientation)&&X.isConstant(this._evenColor)&&X.isConstant(this._oddColor)&&X.isConstant(this._offset)&&X.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},orientation:me("orientation"),evenColor:me("evenColor"),oddColor:me("oddColor"),offset:me("offset"),repeat:me("repeat")});KS.prototype.getType=function(e){return"Stripe"};var rOt=new K;KS.prototype.getValue=function(e,t){return l(e)||(e=K.now(rOt)),l(t)||(t={}),t.horizontal=X.getValueOrDefault(this._orientation,e,QRt)===jp.HORIZONTAL,t.evenColor=X.getValueOrClonedDefault(this._evenColor,e,eOt,t.evenColor),t.oddColor=X.getValueOrClonedDefault(this._oddColor,e,tOt,t.oddColor),t.offset=X.getValueOrDefault(this._offset,e,nOt),t.repeat=X.getValueOrDefault(this._repeat,e,iOt),t};KS.prototype.equals=function(e){return this===e||e instanceof KS&&X.equals(this._orientation,e._orientation)&&X.equals(this._evenColor,e._evenColor)&&X.equals(this._oddColor,e._oddColor)&&X.equals(this._offset,e._offset)&&X.equals(this._repeat,e._repeat)};var SR=KS;function eT(){this._definitionChanged=new be,this._intervals=new xa,this._intervals.changedEvent.addEventListener(eT.prototype._intervalsChanged,this)}Object.defineProperties(eT.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var oOt=new K;eT.prototype.getValue=function(e,t){l(e)||(e=K.now(oOt));let n=this._intervals.findDataForIntervalContainingDate(e);return l(n)&&typeof n.clone=="function"?n.clone(t):n};eT.prototype.equals=function(e){return this===e||e instanceof eT&&this._intervals.equals(e._intervals,X.equals)};eT.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var gA=eT;function wR(e,t){this._velocityVectorProperty=new Zy(e,!0),this._subscription=void 0,this._ellipsoid=void 0,this._definitionChanged=new be,this.ellipsoid=t??te.default;let n=this;this._velocityVectorProperty.definitionChanged.addEventListener(function(){n._definitionChanged.raiseEvent(n)})}Object.defineProperties(wR.prototype,{isConstant:{get:function(){return X.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 BIe=new h,aOt=new h,kIe=new $,sOt=new K;wR.prototype.getValue=function(e,t){l(e)||(e=K.now(sOt));let n=this._velocityVectorProperty._getValue(e,aOt,BIe);if(l(n))return mt.rotationMatrixFromPositionVelocity(BIe,n,this._ellipsoid,kIe),Fe.fromRotationMatrix(kIe,t)};wR.prototype.equals=function(e){return this===e||e instanceof wR&&X.equals(this._velocityVectorProperty,e._velocityVectorProperty)&&(this._ellipsoid===e._ellipsoid||this._ellipsoid.equals(e._ellipsoid))};var BH=wR;var Mg={COMPLETE:0,BELOW_ELLIPSOID_HORIZON:1,ABOVE_ELLIPSOID_HORIZON:2};Mg.validate=function(e){return e===Mg.COMPLETE||e===Mg.BELOW_ELLIPSOID_HORIZON||e===Mg.ABOVE_ELLIPSOID_HORIZON};Mg.toString=function(e){switch(e){case Mg.COMPLETE:return"COMPLETE";case Mg.BELOW_ELLIPSOID_HORIZON:return"BELOW_ELLIPSOID_HORIZON";case Mg.ABOVE_ELLIPSOID_HORIZON:return"ABOVE_ELLIPSOID_HORIZON";default:throw new pe("SensorVolumePortionToDisplay value is not valid and cannot be converted to a String.")}};var IR=Mg;function _A(){}_A.packedLength=h.packedLength;_A.unpack=h.unpack;_A.pack=h.pack;var Nte;function PR(e,t){return t[0]==="#"&&(t=Nte+t),Yy.fromString(e,t)}function zIe(e,t,n){if(l(n.reference))return PR(t,n.reference);if(l(n.velocityReference)){let i=PR(t,n.velocityReference);switch(e){case h:case _A:return new Zy(i,e===_A);case Fe:return new BH(i)}}throw new oe(`${JSON.stringify(n)} is not valid CZML.`)}function cOt(e,t){return new cp(function(n,i){return t(e.getValue(n,i))},e.isConstant)}var ar=new h,Vl=new _F,ol=new de,tT=new Cn,kH=new Fe;function lOt(e){let t=e.rgbaf;if(l(t))return t;let n=e.rgba;if(!l(n))return;let i=n.length;if(i===U.packedLength)return[U.byteToFloat(n[0]),U.byteToFloat(n[1]),U.byteToFloat(n[2]),U.byteToFloat(n[3])];t=new Array(i);for(let r=0;r<i;r+=5)t[r]=n[r],t[r+1]=U.byteToFloat(n[r+1]),t[r+2]=U.byteToFloat(n[r+2]),t[r+3]=U.byteToFloat(n[r+3]),t[r+4]=U.byteToFloat(n[r+4]);return t}function UIe(e,t){let n=e.uri??e;return l(t)?t.getDerivedResource({url:n}):De.createIfNeeded(n)}function uOt(e){let t=e.wsen;if(l(t))return t;let n=e.wsenDegrees;if(!l(n))return;let i=n.length;if(i===ie.packedLength)return[I.toRadians(n[0]),I.toRadians(n[1]),I.toRadians(n[2]),I.toRadians(n[3])];t=new Array(i);for(let r=0;r<i;r+=5)t[r]=n[r],t[r+1]=I.toRadians(n[r+1]),t[r+2]=I.toRadians(n[r+2]),t[r+3]=I.toRadians(n[r+3]),t[r+4]=I.toRadians(n[r+4]);return t}function fOt(e){let t=e.length;if(Vl.magnitude=1,t===2)return Vl.clock=e[0],Vl.cone=e[1],h.fromSpherical(Vl,ar),[ar.x,ar.y,ar.z];let n=new Array(t/3*4);for(let i=0,r=0;i<t;i+=3,r+=4)n[r]=e[i],Vl.clock=e[i+1],Vl.cone=e[i+2],h.fromSpherical(Vl,ar),n[r+1]=ar.x,n[r+2]=ar.y,n[r+3]=ar.z;return n}function dOt(e){let t=e.length;if(t===3)return Vl.clock=e[0],Vl.cone=e[1],Vl.magnitude=e[2],h.fromSpherical(Vl,ar),[ar.x,ar.y,ar.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],Vl.clock=e[i+1],Vl.cone=e[i+2],Vl.magnitude=e[i+3],h.fromSpherical(Vl,ar),n[i+1]=ar.x,n[i+2]=ar.y,n[i+3]=ar.z;return n}function hOt(e){let t=e.length;if(t===3)return ol.longitude=e[0],ol.latitude=e[1],ol.height=e[2],te.default.cartographicToCartesian(ol,ar),[ar.x,ar.y,ar.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],ol.longitude=e[i+1],ol.latitude=e[i+2],ol.height=e[i+3],te.default.cartographicToCartesian(ol,ar),n[i+1]=ar.x,n[i+2]=ar.y,n[i+3]=ar.z;return n}function mOt(e){let t=e.length;if(t===3)return ol.longitude=I.toRadians(e[0]),ol.latitude=I.toRadians(e[1]),ol.height=e[2],te.default.cartographicToCartesian(ol,ar),[ar.x,ar.y,ar.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],ol.longitude=I.toRadians(e[i+1]),ol.latitude=I.toRadians(e[i+2]),ol.height=e[i+3],te.default.cartographicToCartesian(ol,ar),n[i+1]=ar.x,n[i+2]=ar.y,n[i+3]=ar.z;return n}function Fte(e){let t=e.cartesian;if(l(t))return t;let n=e.cartesianVelocity;if(l(n))return n;let i=e.unitCartesian;if(l(i))return i;let r=e.unitSpherical;if(l(r))return fOt(r);let o=e.spherical;if(l(o))return dOt(o);let a=e.cartographicRadians;if(l(a))return hOt(a);let s=e.cartographicDegrees;if(l(s))return mOt(s);throw new oe(`${JSON.stringify(e)} is not a valid CZML interval.`)}function VIe(e,t){h.unpack(e,t,ar),h.normalize(ar,ar),h.pack(ar,e,t)}function pOt(e){let t=Fte(e);if(t.length===3)return VIe(t,0),t;for(let n=1;n<t.length;n+=4)VIe(t,n);return t}function jIe(e,t){Fe.unpack(e,t,kH),Fe.normalize(kH,kH),Fe.pack(kH,e,t)}function gOt(e){let t=e.unitQuaternion;if(l(t)){if(t.length===4)return jIe(t,0),t;for(let n=1;n<t.length;n+=5)jIe(t,n)}return t}function HIe(e){return typeof e=="boolean"?Boolean:typeof e=="number"?Number:typeof e=="string"?String:e.hasOwnProperty("array")?Array:e.hasOwnProperty("boolean")?Boolean:e.hasOwnProperty("boundingRectangle")?Je:e.hasOwnProperty("cartesian2")?k:e.hasOwnProperty("cartesian")||e.hasOwnProperty("spherical")||e.hasOwnProperty("cartographicRadians")||e.hasOwnProperty("cartographicDegrees")?h:e.hasOwnProperty("unitCartesian")||e.hasOwnProperty("unitSpherical")?_A:e.hasOwnProperty("rgba")||e.hasOwnProperty("rgbaf")?U:e.hasOwnProperty("arcType")?sn:e.hasOwnProperty("classificationType")?Zn:e.hasOwnProperty("colorBlendMode")?Ml:e.hasOwnProperty("cornerType")?tr:e.hasOwnProperty("heightReference")?it:e.hasOwnProperty("horizontalOrigin")?ji:e.hasOwnProperty("date")?K:e.hasOwnProperty("labelStyle")?bo:e.hasOwnProperty("number")?Number:e.hasOwnProperty("nearFarScalar")?Wt:e.hasOwnProperty("distanceDisplayCondition")?jt:e.hasOwnProperty("object")||e.hasOwnProperty("value")?Object:e.hasOwnProperty("unitQuaternion")?Fe:e.hasOwnProperty("pathMode")?Ag:e.hasOwnProperty("shadowMode")?Rn:e.hasOwnProperty("string")?String:e.hasOwnProperty("stripeOrientation")?jp:e.hasOwnProperty("wsen")||e.hasOwnProperty("wsenDegrees")?ie:e.hasOwnProperty("uri")?RR.default:e.hasOwnProperty("verticalOrigin")?Wn:Object}function _Ot(e,t,n){switch(e){case sn:return sn[t.arcType??t];case Array:return t.array;case Boolean:return t.boolean??t;case Je:return t.boundingRectangle;case k:return t.cartesian2;case h:return Fte(t);case _A:return pOt(t);case U:return lOt(t);case Zn:return Zn[t.classificationType??t];case Ml:return Ml[t.colorBlendMode??t];case tr:return tr[t.cornerType??t];case it:return it[t.heightReference??t];case ji:return ji[t.horizontalOrigin??t];case Image:return UIe(t,n);case K:return K.fromIso8601(t.date??t);case bo:return bo[t.labelStyle??t];case Number:return t.number??t;case Wt:return t.nearFarScalar;case jt:return t.distanceDisplayCondition;case Object:return t.object??t.value??t;case Ag:return Ag[t.pathMode??t];case Fe:return gOt(t);case nm:return t.number??t;case IR:return IR[t.portionToDisplay??t];case Rn:return Rn[t.shadowMode??t.shadows??t];case String:return t.string??t;case jp:return jp[t.stripeOrientation??t];case ie:return uOt(t);case RR.default:return UIe(t,n);case Wn:return Wn[t.verticalOrigin??t];default:throw new oe(`Unknown CzmlDataSource interval type: ${e}`)}}var yOt={HERMITE:FN,LAGRANGE:VN,LINEAR:qC};function zH(e,t){let n=e.interpolationAlgorithm,i=e.interpolationDegree;(l(n)||l(i))&&t.setInterpolationOptions({interpolationAlgorithm:yOt[n],interpolationDegree:i});let r=e.forwardExtrapolationType;l(r)&&(t.forwardExtrapolationType=Qf[r]);let o=e.forwardExtrapolationDuration;l(o)&&(t.forwardExtrapolationDuration=o);let a=e.backwardExtrapolationType;l(a)&&(t.backwardExtrapolationType=Qf[a]);let s=e.backwardExtrapolationDuration;l(s)&&(t.backwardExtrapolationDuration=s)}var GIe={iso8601:void 0};function Oo(e){if(l(e))return GIe.iso8601=e,Cn.fromIso8601(GIe)}function Bte(e){let t=Qe.MAXIMUM_INTERVAL.clone();return t.data=e,t}function WIe(e){let t=new Bl;return t.intervals.addInterval(Bte(e)),t}function qIe(e){let t=new Cc(e.referenceFrame);return t.intervals.addInterval(Bte(e)),t}function UH(e,t,n,i,r,o,a){let s=Oo(i.interval);l(r)&&(l(s)?s=Cn.intersect(s,r,tT):s=r);let c,u,f,d=!l(i.reference)&&!l(i.velocityReference),p=l(s)&&!s.equals(Qe.MAXIMUM_INTERVAL);if(i.delete===!0){if(!p){t[n]=void 0;return}return iPe(t[n],s)}let g=!1;if(d){if(u=_Ot(e,i,o),!l(u))return;c=e.packedLength??1,f=u.length??1,g=!l(i.array)&&typeof u!="string"&&f>c&&e!==Object}let m=typeof e.unpack=="function"&&e!==nm;if(!g&&!p){d?t[n]=new yi(m?e.unpack(u,0):u):t[n]=zIe(e,a,i);return}let y=t[n],A,b=i.epoch;if(l(b)&&(A=K.fromIso8601(b)),g&&!p){y instanceof Md||(t[n]=y=new Md(e)),y.addSamplesPackedArray(u,A),zH(i,y);return}let x;if(!g&&p){s=s.clone(),d?s.data=m?e.unpack(u,0):u:s.data=zIe(e,a,i),l(y)||(t[n]=y=d?new gA:new Bl),d&&y instanceof gA?y.intervals.addInterval(s):y instanceof Bl?(d&&(s.data=new yi(s.data)),y.intervals.addInterval(s)):(t[n]=y=WIe(y),d&&(s.data=new yi(s.data)),y.intervals.addInterval(s));return}l(y)||(t[n]=y=new Bl),y instanceof Bl||(t[n]=y=WIe(y));let T=y.intervals;x=T.findInterval(s),(!l(x)||!(x.data instanceof Md))&&(x=s.clone(),x.data=new Md(e),T.addInterval(x)),x.data.addSamplesPackedArray(u,A),zH(i,x.data)}function iPe(e,t){if(e instanceof Md){e.removeSamples(t);return}else if(e instanceof gA){e.intervals.removeInterval(t);return}else if(e instanceof Bl){let n=e.intervals;for(let i=0;i<n.length;++i){let r=Cn.intersect(n.get(i),t,tT);r.isEmpty||iPe(r.data,t)}n.removeInterval(t);return}}function Te(e,t,n,i,r,o,a){if(l(i))if(Array.isArray(i))for(let s=0,c=i.length;s<c;++s)UH(e,t,n,i[s],r,o,a);else UH(e,t,n,i,r,o,a)}function YIe(e,t,n,i,r,o){let a=Oo(n.interval);l(i)&&(l(a)?a=Cn.intersect(a,i,tT):a=i);let s=l(n.cartesianVelocity)?1:0,c=h.packedLength*(s+1),u,f,d=!l(n.reference),p=l(a)&&!a.equals(Qe.MAXIMUM_INTERVAL);if(n.delete===!0){if(!p){e[t]=void 0;return}return rPe(e[t],a)}let g,m=!1;if(d&&(l(n.referenceFrame)&&(g=Vi[n.referenceFrame]),g=g??Vi.FIXED,u=Fte(n),f=u.length??1,m=f>c),!m&&!p){d?e[t]=new _u(h.unpack(u),g):e[t]=PR(o,n.reference);return}let y=e[t],A,b=n.epoch;if(l(b)&&(A=K.fromIso8601(b)),m&&!p){(!(y instanceof vc)||l(g)&&y.referenceFrame!==g)&&(e[t]=y=new vc(g,s)),y.addSamplesPackedArray(u,A),zH(n,y);return}let x;if(!m&&p){a=a.clone(),d?a.data=h.unpack(u):a.data=PR(o,n.reference),l(y)||(d?y=new $y(g):y=new Cc(g),e[t]=y),d&&y instanceof $y&&l(g)&&y.referenceFrame===g?y.intervals.addInterval(a):y instanceof Cc?(d&&(a.data=new _u(a.data,g)),y.intervals.addInterval(a)):(e[t]=y=qIe(y),d&&(a.data=new _u(a.data,g)),y.intervals.addInterval(a));return}l(y)?y instanceof Cc||(e[t]=y=qIe(y)):e[t]=y=new Cc(g);let T=y.intervals;x=T.findInterval(a),(!l(x)||!(x.data instanceof vc)||l(g)&&x.data.referenceFrame!==g)&&(x=a.clone(),x.data=new vc(g,s),T.addInterval(x)),x.data.addSamplesPackedArray(u,A),zH(n,x.data)}function rPe(e,t){if(e instanceof vc){e.removeSamples(t);return}else if(e instanceof $y){e.intervals.removeInterval(t);return}else if(e instanceof Cc){let n=e.intervals;for(let i=0;i<n.length;++i){let r=Cn.intersect(n.get(i),t,tT);r.isEmpty||rPe(r.data,t)}n.removeInterval(t);return}}function oPe(e,t,n,i,r,o){if(l(n))if(Array.isArray(n))for(let a=0,s=n.length;a<s;++a)YIe(e,t,n[a],i,r,o);else YIe(e,t,n,i,r,o)}function XIe(e,t,n,i){l(n.references)?VH(e,t,n.references,n.interval,i,ER,Bl):(l(n.cartesian2)?n.array=k.unpackArray(n.cartesian2):l(n.cartesian)&&(n.array=k.unpackArray(n.cartesian)),l(n.array)&&Te(Array,e,t,n,void 0,void 0,i))}function KIe(e,t,n,i,r,o){let a=Oo(n.interval);l(i)&&(l(a)?a=Cn.intersect(a,i,tT):a=i);let s=e[t],c,u;if(l(a)){s instanceof bR||(s=new bR,e[t]=s);let d=s.intervals;u=d.findInterval({start:a.start,stop:a.stop}),l(u)?c=u.data:(u=a.clone(),d.addInterval(u))}else c=s;let f;l(n.solidColor)?(c instanceof Yt||(c=new Yt),f=n.solidColor,Te(U,c,"color",f.color,void 0,void 0,o)):l(n.grid)?(c instanceof xR||(c=new xR),f=n.grid,Te(U,c,"color",f.color,void 0,r,o),Te(Number,c,"cellAlpha",f.cellAlpha,void 0,r,o),Te(k,c,"lineCount",f.lineCount,void 0,r,o),Te(k,c,"lineThickness",f.lineThickness,void 0,r,o),Te(k,c,"lineOffset",f.lineOffset,void 0,r,o)):l(n.image)?(c instanceof Wb||(c=new Wb),f=n.image,Te(Image,c,"image",f.image,void 0,r,o),Te(k,c,"repeat",f.repeat,void 0,r,o),Te(U,c,"color",f.color,void 0,r,o),Te(Boolean,c,"transparent",f.transparent,void 0,r,o)):l(n.stripe)?(c instanceof SR||(c=new SR),f=n.stripe,Te(jp,c,"orientation",f.orientation,void 0,r,o),Te(U,c,"evenColor",f.evenColor,void 0,r,o),Te(U,c,"oddColor",f.oddColor,void 0,r,o),Te(Number,c,"offset",f.offset,void 0,r,o),Te(Number,c,"repeat",f.repeat,void 0,r,o)):l(n.polylineOutline)?(c instanceof Qx||(c=new Qx),f=n.polylineOutline,Te(U,c,"color",f.color,void 0,r,o),Te(U,c,"outlineColor",f.outlineColor,void 0,r,o),Te(Number,c,"outlineWidth",f.outlineWidth,void 0,r,o)):l(n.polylineGlow)?(c instanceof vR||(c=new vR),f=n.polylineGlow,Te(U,c,"color",f.color,void 0,r,o),Te(Number,c,"glowPower",f.glowPower,void 0,r,o),Te(Number,c,"taperPower",f.taperPower,void 0,r,o)):l(n.polylineArrow)?(c instanceof TR||(c=new TR),f=n.polylineArrow,Te(U,c,"color",f.color,void 0,void 0,o)):l(n.polylineDash)?(c instanceof CR||(c=new CR),f=n.polylineDash,Te(U,c,"color",f.color,void 0,void 0,o),Te(U,c,"gapColor",f.gapColor,void 0,void 0,o),Te(Number,c,"dashLength",f.dashLength,void 0,r,o),Te(Number,c,"dashPattern",f.dashPattern,void 0,r,o)):l(n.checkerboard)&&(c instanceof AR||(c=new AR),f=n.checkerboard,Te(U,c,"evenColor",f.evenColor,void 0,r,o),Te(U,c,"oddColor",f.oddColor,void 0,r,o),Te(k,c,"repeat",f.repeat,void 0,r,o)),l(u)?u.data=c:e[t]=c}function Tf(e,t,n,i,r,o){if(l(n))if(Array.isArray(n))for(let a=0,s=n.length;a<s;++a)KIe(e,t,n[a],i,r,o);else KIe(e,t,n,i,r,o)}function AOt(e,t,n,i){let r=t.name;l(r)&&(e.name=t.name)}function bOt(e,t,n,i){let r=t.description;l(r)&&Te(String,e,"description",r,void 0,i,n)}function xOt(e,t,n,i){let r=t.position;l(r)&&oPe(e,"position",r,void 0,i,n)}function TOt(e,t,n,i){let r=t.viewFrom;l(r)&&Te(h,e,"viewFrom",r,void 0,i,n)}function COt(e,t,n,i){let r=t.orientation;l(r)&&Te(Fe,e,"orientation",r,void 0,i,n)}function vOt(e,t,n,i){let r=t.properties;if(l(r)){l(e.properties)||(e.properties=new Au);for(let o in r)if(r.hasOwnProperty(o)){e.properties.hasProperty(o)||e.properties.addProperty(o);let a=r[o];if(Array.isArray(a))for(let s=0,c=a.length;s<c;++s)UH(HIe(a[s]),e.properties,o,a[s],void 0,i,n);else UH(HIe(a),e.properties,o,a,void 0,i,n)}}}function VH(e,t,n,i,r,o,a){let s=n.map(function(c){return PR(r,c)});if(l(i)){i=Oo(i);let c=e[t];if(!(c instanceof a)){let u=new a;u.intervals.addInterval(Bte(c)),e[t]=c=u}i.data=new o(s),c.intervals.addInterval(i)}else e[t]=new o(s)}function $Ie(e,t,n,i){let r=n.references;l(r)?VH(e,t,r,n.interval,i,ER,Bl):Te(Array,e,t,n,void 0,void 0,i)}function JIe(e,t,n,i){if(l(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;++r)$Ie(e,t,n[r],i);else $Ie(e,t,n,i)}function ZIe(e,t,n,i){let r=n.references;l(r)?VH(e,t,r,n.interval,i,mA,Cc):(l(n.cartesian)?n.array=h.unpackArray(n.cartesian):l(n.cartographicRadians)?n.array=h.fromRadiansArrayHeights(n.cartographicRadians,te.default):l(n.cartographicDegrees)&&(n.array=h.fromDegreesArrayHeights(n.cartographicDegrees,te.default)),l(n.array)&&Te(Array,e,t,n,void 0,void 0,i))}function OR(e,t,n,i){if(l(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;++r)ZIe(e,t,n[r],i);else ZIe(e,t,n,i)}function EOt(e){return h.unpackArray(e)}function SOt(e){return h.fromRadiansArrayHeights(e,te.default)}function wOt(e){return h.fromDegreesArrayHeights(e,te.default)}function QIe(e,t,n,i){let r=n.references;if(l(r)){let o=r.map(function(a){let s={};return VH(s,"positions",a,n.interval,i,mA,Cc),s.positions});e[t]=new mA(o)}else l(n.cartesian)?n.array=n.cartesian.map(EOt):l(n.cartographicRadians)?n.array=n.cartographicRadians.map(SOt):l(n.cartographicDegrees)&&(n.array=n.cartographicDegrees.map(wOt)),l(n.array)&&Te(Array,e,t,n,void 0,void 0,i)}function IOt(e,t,n,i){if(l(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;++r)QIe(e,t,n[r],i);else QIe(e,t,n,i)}function POt(e,t,n,i){if(l(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;r++)XIe(e,t,n[r],i);else XIe(e,t,n,i)}function DOt(e,t,n,i){let r=t.availability;if(!l(r))return;let o;if(Array.isArray(r))for(let a=0,s=r.length;a<s;++a)l(o)||(o=new xa),o.addInterval(Oo(r[a]));else o=new xa,o.addInterval(Oo(r));e.availability=o}function ROt(e,t,n,i,r){l(t)&&Te(_A,e,"alignedAxis",t,n,i,r)}function OOt(e,t,n,i){let r=t.billboard;if(!l(r))return;let o=Oo(r.interval),a=e.billboard;l(a)||(e.billboard=a=new Pl),Te(Boolean,a,"show",r.show,o,i,n),Te(Image,a,"image",r.image,o,i,n),Te(Number,a,"scale",r.scale,o,i,n),Te(k,a,"pixelOffset",r.pixelOffset,o,i,n),Te(h,a,"eyeOffset",r.eyeOffset,o,i,n),Te(ji,a,"horizontalOrigin",r.horizontalOrigin,o,i,n),Te(Wn,a,"verticalOrigin",r.verticalOrigin,o,i,n),Te(it,a,"heightReference",r.heightReference,o,i,n),Te(U,a,"color",r.color,o,i,n),Te(nm,a,"rotation",r.rotation,o,i,n),ROt(a,r.alignedAxis,o,i,n),Te(Boolean,a,"sizeInMeters",r.sizeInMeters,o,i,n),Te(Number,a,"width",r.width,o,i,n),Te(Number,a,"height",r.height,o,i,n),Te(Wt,a,"scaleByDistance",r.scaleByDistance,o,i,n),Te(Wt,a,"translucencyByDistance",r.translucencyByDistance,o,i,n),Te(Wt,a,"pixelOffsetScaleByDistance",r.pixelOffsetScaleByDistance,o,i,n),Te(Je,a,"imageSubRegion",r.imageSubRegion,o,i,n),Te(jt,a,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Te(Number,a,"disableDepthTestDistance",r.disableDepthTestDistance,o,i,n)}function MOt(e,t,n,i){let r=t.box;if(!l(r))return;let o=Oo(r.interval),a=e.box;l(a)||(e.box=a=new Lv),Te(Boolean,a,"show",r.show,o,i,n),Te(h,a,"dimensions",r.dimensions,o,i,n),Te(it,a,"heightReference",r.heightReference,o,i,n),Te(Boolean,a,"fill",r.fill,o,i,n),Tf(a,"material",r.material,o,i,n),Te(Boolean,a,"outline",r.outline,o,i,n),Te(U,a,"outlineColor",r.outlineColor,o,i,n),Te(Number,a,"outlineWidth",r.outlineWidth,o,i,n),Te(Rn,a,"shadows",r.shadows,o,i,n),Te(jt,a,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function LOt(e,t,n,i){let r=t.corridor;if(!l(r))return;let o=Oo(r.interval),a=e.corridor;l(a)||(e.corridor=a=new Fv),Te(Boolean,a,"show",r.show,o,i,n),OR(a,"positions",r.positions,n),Te(Number,a,"width",r.width,o,i,n),Te(Number,a,"height",r.height,o,i,n),Te(it,a,"heightReference",r.heightReference,o,i,n),Te(Number,a,"extrudedHeight",r.extrudedHeight,o,i,n),Te(it,a,"extrudedHeightReference",r.extrudedHeightReference,o,i,n),Te(tr,a,"cornerType",r.cornerType,o,i,n),Te(Number,a,"granularity",r.granularity,o,i,n),Te(Boolean,a,"fill",r.fill,o,i,n),Tf(a,"material",r.material,o,i,n),Te(Boolean,a,"outline",r.outline,o,i,n),Te(U,a,"outlineColor",r.outlineColor,o,i,n),Te(Number,a,"outlineWidth",r.outlineWidth,o,i,n),Te(Rn,a,"shadows",r.shadows,o,i,n),Te(jt,a,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Te(Zn,a,"classificationType",r.classificationType,o,i,n),Te(Number,a,"zIndex",r.zIndex,o,i,n)}function NOt(e,t,n,i){let r=t.cylinder;if(!l(r))return;let o=Oo(r.interval),a=e.cylinder;l(a)||(e.cylinder=a=new Bv),Te(Boolean,a,"show",r.show,o,i,n),Te(Number,a,"length",r.length,o,i,n),Te(Number,a,"topRadius",r.topRadius,o,i,n),Te(Number,a,"bottomRadius",r.bottomRadius,o,i,n),Te(it,a,"heightReference",r.heightReference,o,i,n),Te(Boolean,a,"fill",r.fill,o,i,n),Tf(a,"material",r.material,o,i,n),Te(Boolean,a,"outline",r.outline,o,i,n),Te(U,a,"outlineColor",r.outlineColor,o,i,n),Te(Number,a,"outlineWidth",r.outlineWidth,o,i,n),Te(Number,a,"numberOfVerticalLines",r.numberOfVerticalLines,o,i,n),Te(Number,a,"slices",r.slices,o,i,n),Te(Rn,a,"shadows",r.shadows,o,i,n),Te(jt,a,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function FOt(e,t){let n=e.version;if(l(n)&&typeof n=="string"){let o=n.split(".");if(o.length===2){if(o[0]!=="1")throw new oe("Cesium only supports CZML version 1.");t._version=n}}if(!l(t._version))throw new oe("CZML version information invalid. It is expected to be a property on the document object in the <Major>.<Minor> version format.");let i=t._documentPacket;l(e.name)&&(i.name=e.name);let r=e.clock;if(l(r)){let o=i.clock;l(o)?(o.interval=r.interval??o.interval,o.currentTime=r.currentTime??o.currentTime,o.range=r.range??o.range,o.step=r.step??o.step,o.multiplier=r.multiplier??o.multiplier):i.clock={interval:r.interval,currentTime:r.currentTime,range:r.range,step:r.step,multiplier:r.multiplier}}}function BOt(e,t,n,i){let r=t.ellipse;if(!l(r))return;let o=Oo(r.interval),a=e.ellipse;l(a)||(e.ellipse=a=new kv),Te(Boolean,a,"show",r.show,o,i,n),Te(Number,a,"semiMajorAxis",r.semiMajorAxis,o,i,n),Te(Number,a,"semiMinorAxis",r.semiMinorAxis,o,i,n),Te(Number,a,"height",r.height,o,i,n),Te(it,a,"heightReference",r.heightReference,o,i,n),Te(Number,a,"extrudedHeight",r.extrudedHeight,o,i,n),Te(it,a,"extrudedHeightReference",r.extrudedHeightReference,o,i,n),Te(nm,a,"rotation",r.rotation,o,i,n),Te(nm,a,"stRotation",r.stRotation,o,i,n),Te(Number,a,"granularity",r.granularity,o,i,n),Te(Boolean,a,"fill",r.fill,o,i,n),Tf(a,"material",r.material,o,i,n),Te(Boolean,a,"outline",r.outline,o,i,n),Te(U,a,"outlineColor",r.outlineColor,o,i,n),Te(Number,a,"outlineWidth",r.outlineWidth,o,i,n),Te(Number,a,"numberOfVerticalLines",r.numberOfVerticalLines,o,i,n),Te(Rn,a,"shadows",r.shadows,o,i,n),Te(jt,a,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Te(Zn,a,"classificationType",r.classificationType,o,i,n),Te(Number,a,"zIndex",r.zIndex,o,i,n)}function kOt(e,t,n,i){let r=t.ellipsoid;if(!l(r))return;let o=Oo(r.interval),a=e.ellipsoid;l(a)||(e.ellipsoid=a=new zv),Te(Boolean,a,"show",r.show,o,i,n),Te(h,a,"radii",r.radii,o,i,n),Te(h,a,"innerRadii",r.innerRadii,o,i,n),Te(Number,a,"minimumClock",r.minimumClock,o,i,n),Te(Number,a,"maximumClock",r.maximumClock,o,i,n),Te(Number,a,"minimumCone",r.minimumCone,o,i,n),Te(Number,a,"maximumCone",r.maximumCone,o,i,n),Te(it,a,"heightReference",r.heightReference,o,i,n),Te(Boolean,a,"fill",r.fill,o,i,n),Tf(a,"material",r.material,o,i,n),Te(Boolean,a,"outline",r.outline,o,i,n),Te(U,a,"outlineColor",r.outlineColor,o,i,n),Te(Number,a,"outlineWidth",r.outlineWidth,o,i,n),Te(Number,a,"stackPartitions",r.stackPartitions,o,i,n),Te(Number,a,"slicePartitions",r.slicePartitions,o,i,n),Te(Number,a,"subdivisions",r.subdivisions,o,i,n),Te(Rn,a,"shadows",r.shadows,o,i,n),Te(jt,a,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function zOt(e,t,n,i){let r=t.label;if(!l(r))return;let o=Oo(r.interval),a=e.label;l(a)||(e.label=a=new op),Te(Boolean,a,"show",r.show,o,i,n),Te(String,a,"text",r.text,o,i,n),Te(String,a,"font",r.font,o,i,n),Te(bo,a,"style",r.style,o,i,n),Te(Number,a,"scale",r.scale,o,i,n),Te(Boolean,a,"showBackground",r.showBackground,o,i,n),Te(U,a,"backgroundColor",r.backgroundColor,o,i,n),Te(k,a,"backgroundPadding",r.backgroundPadding,o,i,n),Te(k,a,"pixelOffset",r.pixelOffset,o,i,n),Te(h,a,"eyeOffset",r.eyeOffset,o,i,n),Te(ji,a,"horizontalOrigin",r.horizontalOrigin,o,i,n),Te(Wn,a,"verticalOrigin",r.verticalOrigin,o,i,n),Te(it,a,"heightReference",r.heightReference,o,i,n),Te(U,a,"fillColor",r.fillColor,o,i,n),Te(U,a,"outlineColor",r.outlineColor,o,i,n),Te(Number,a,"outlineWidth",r.outlineWidth,o,i,n),Te(Wt,a,"translucencyByDistance",r.translucencyByDistance,o,i,n),Te(Wt,a,"pixelOffsetScaleByDistance",r.pixelOffsetScaleByDistance,o,i,n),Te(Wt,a,"scaleByDistance",r.scaleByDistance,o,i,n),Te(jt,a,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Te(Number,a,"disableDepthTestDistance",r.disableDepthTestDistance,o,i,n)}function UOt(e,t,n,i){let r=t.model;if(!l(r))return;let o=Oo(r.interval),a=e.model;l(a)||(e.model=a=new dy),Te(Boolean,a,"show",r.show,o,i,n),Te(RR.default,a,"uri",r.gltf,o,i,n),Te(Number,a,"scale",r.scale,o,i,n),Te(Number,a,"minimumPixelSize",r.minimumPixelSize,o,i,n),Te(Number,a,"maximumScale",r.maximumScale,o,i,n),Te(Boolean,a,"incrementallyLoadTextures",r.incrementallyLoadTextures,o,i,n),Te(Boolean,a,"runAnimations",r.runAnimations,o,i,n),Te(Boolean,a,"clampAnimations",r.clampAnimations,o,i,n),Te(Rn,a,"shadows",r.shadows,o,i,n),Te(it,a,"heightReference",r.heightReference,o,i,n),Te(U,a,"silhouetteColor",r.silhouetteColor,o,i,n),Te(Number,a,"silhouetteSize",r.silhouetteSize,o,i,n),Te(U,a,"color",r.color,o,i,n),Te(Ml,a,"colorBlendMode",r.colorBlendMode,o,i,n),Te(Number,a,"colorBlendAmount",r.colorBlendAmount,o,i,n),Te(jt,a,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n);let s,c,u=r.nodeTransformations;if(l(u))if(Array.isArray(u))for(s=0,c=u.length;s<c;++s)ePe(a,u[s],o,i,n);else ePe(a,u,o,i,n);let f=r.articulations;if(l(f))if(Array.isArray(f))for(s=0,c=f.length;s<c;++s)tPe(a,f[s],o,i,n);else tPe(a,f,o,i,n)}function ePe(e,t,n,i,r){let o=Oo(t.interval);l(n)&&(l(o)?o=Cn.intersect(o,n,tT):o=n);let a=e.nodeTransformations,s=Object.keys(t);for(let c=0,u=s.length;c<u;++c){let f=s[c];if(f==="interval")continue;let d=t[f];if(!l(d))continue;l(a)||(e.nodeTransformations=a=new Au),a.hasProperty(f)||a.addProperty(f);let p=a[f];l(p)||(a[f]=p=new Uv),Te(h,p,"translation",d.translation,o,i,r),Te(Fe,p,"rotation",d.rotation,o,i,r),Te(h,p,"scale",d.scale,o,i,r)}}function tPe(e,t,n,i,r){let o=Oo(t.interval);l(n)&&(l(o)?o=Cn.intersect(o,n,tT):o=n);let a=e.articulations,s=Object.keys(t);for(let c=0,u=s.length;c<u;++c){let f=s[c];if(f==="interval")continue;let d=t[f];l(d)&&(l(a)||(e.articulations=a=new Au),a.hasProperty(f)||a.addProperty(f),Te(Number,a,f,d,o,i,r))}}function VOt(e,t,n,i){let r=t.path;if(!l(r))return;let o=Oo(r.interval),a=e.path;l(a)||(e.path=a=new hy),Te(Boolean,a,"show",r.show,o,i,n),Te(Number,a,"leadTime",r.leadTime,o,i,n),Te(Number,a,"trailTime",r.trailTime,o,i,n),Te(Number,a,"width",r.width,o,i,n),Te(Number,a,"resolution",r.resolution,o,i,n),Tf(a,"material",r.material,o,i,n),Te(jt,a,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Te(String,a,"relativeTo",r.relativeTo,o,i,n),Te(Ag,a,"materialMode",r.materialMode,o,i,n)}function jOt(e,t,n,i){let r=t.point;if(!l(r))return;let o=Oo(r.interval),a=e.point;l(a)||(e.point=a=new jv),Te(Boolean,a,"show",r.show,o,i,n),Te(Number,a,"pixelSize",r.pixelSize,o,i,n),Te(it,a,"heightReference",r.heightReference,o,i,n),Te(U,a,"color",r.color,o,i,n),Te(U,a,"outlineColor",r.outlineColor,o,i,n),Te(Number,a,"outlineWidth",r.outlineWidth,o,i,n),Te(Wt,a,"scaleByDistance",r.scaleByDistance,o,i,n),Te(Wt,a,"translucencyByDistance",r.translucencyByDistance,o,i,n),Te(jt,a,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Te(Number,a,"disableDepthTestDistance",r.disableDepthTestDistance,o,i,n)}function DR(e){this.polygon=e,this._definitionChanged=new be}Object.defineProperties(DR.prototype,{isConstant:{get:function(){let e=this.polygon._positions,t=this.polygon._holes;return(!l(e)||e.isConstant)&&(!l(t)||t.isConstant)}},definitionChanged:{get:function(){return this._definitionChanged}}});DR.prototype.getValue=function(e,t){let n;l(this.polygon._positions)&&(n=this.polygon._positions.getValue(e));let i;return l(this.polygon._holes)&&(i=this.polygon._holes.getValue(e),l(i)&&(i=i.map(function(r){return new Vc(r)}))),l(t)?(t.positions=n,t.holes=i,t):new Vc(n,i)};DR.prototype.equals=function(e){return this===e||e instanceof DR&&X.equals(this.polygon._positions,e.polygon._positions)&&X.equals(this.polygon._holes,e.polygon._holes)};function HOt(e,t,n,i){let r=t.polygon;if(!l(r))return;let o=Oo(r.interval),a=e.polygon;l(a)||(e.polygon=a=new ap),Te(Boolean,a,"show",r.show,o,i,n),OR(a,"_positions",r.positions,n),IOt(a,"_holes",r.holes,n),(l(a._positions)||l(a._holes))&&(a.hierarchy=new DR(a)),Te(Number,a,"height",r.height,o,i,n),Te(it,a,"heightReference",r.heightReference,o,i,n),Te(Number,a,"extrudedHeight",r.extrudedHeight,o,i,n),Te(it,a,"extrudedHeightReference",r.extrudedHeightReference,o,i,n),Te(nm,a,"stRotation",r.stRotation,o,i,n),Te(Number,a,"granularity",r.granularity,o,i,n),Te(Boolean,a,"fill",r.fill,o,i,n),Tf(a,"material",r.material,o,i,n),Te(Boolean,a,"outline",r.outline,o,i,n),Te(U,a,"outlineColor",r.outlineColor,o,i,n),Te(Number,a,"outlineWidth",r.outlineWidth,o,i,n),Te(Boolean,a,"perPositionHeight",r.perPositionHeight,o,i,n),Te(Boolean,a,"closeTop",r.closeTop,o,i,n),Te(Boolean,a,"closeBottom",r.closeBottom,o,i,n),Te(sn,a,"arcType",r.arcType,o,i,n),Te(Rn,a,"shadows",r.shadows,o,i,n),Te(jt,a,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Te(Zn,a,"classificationType",r.classificationType,o,i,n),Te(Number,a,"zIndex",r.zIndex,o,i,n)}function GOt(e){return e?sn.GEODESIC:sn.NONE}function WOt(e,t,n,i){let r=t.polyline;if(!l(r))return;let o=Oo(r.interval),a=e.polyline;if(l(a)||(e.polyline=a=new Dl),Te(Boolean,a,"show",r.show,o,i,n),OR(a,"positions",r.positions,n),Te(Number,a,"width",r.width,o,i,n),Te(Number,a,"granularity",r.granularity,o,i,n),Tf(a,"material",r.material,o,i,n),Tf(a,"depthFailMaterial",r.depthFailMaterial,o,i,n),Te(sn,a,"arcType",r.arcType,o,i,n),Te(Boolean,a,"clampToGround",r.clampToGround,o,i,n),Te(Rn,a,"shadows",r.shadows,o,i,n),Te(jt,a,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Te(Zn,a,"classificationType",r.classificationType,o,i,n),Te(Number,a,"zIndex",r.zIndex,o,i,n),l(r.followSurface)&&!l(r.arcType)){let s={};Te(Boolean,s,"followSurface",r.followSurface,o,i,n),a.arcType=cOt(s.followSurface,GOt)}}function qOt(e,t,n,i){let r=t.polylineVolume;if(!l(r))return;let o=Oo(r.interval),a=e.polylineVolume;l(a)||(e.polylineVolume=a=new Hv),OR(a,"positions",r.positions,n),POt(a,"shape",r.shape,n),Te(Boolean,a,"show",r.show,o,i,n),Te(tr,a,"cornerType",r.cornerType,o,i,n),Te(Boolean,a,"fill",r.fill,o,i,n),Tf(a,"material",r.material,o,i,n),Te(Boolean,a,"outline",r.outline,o,i,n),Te(U,a,"outlineColor",r.outlineColor,o,i,n),Te(Number,a,"outlineWidth",r.outlineWidth,o,i,n),Te(Number,a,"granularity",r.granularity,o,i,n),Te(Rn,a,"shadows",r.shadows,o,i,n),Te(jt,a,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function YOt(e,t,n,i){let r=t.rectangle;if(!l(r))return;let o=Oo(r.interval),a=e.rectangle;l(a)||(e.rectangle=a=new sp),Te(Boolean,a,"show",r.show,o,i,n),Te(ie,a,"coordinates",r.coordinates,o,i,n),Te(Number,a,"height",r.height,o,i,n),Te(it,a,"heightReference",r.heightReference,o,i,n),Te(Number,a,"extrudedHeight",r.extrudedHeight,o,i,n),Te(it,a,"extrudedHeightReference",r.extrudedHeightReference,o,i,n),Te(nm,a,"rotation",r.rotation,o,i,n),Te(nm,a,"stRotation",r.stRotation,o,i,n),Te(Number,a,"granularity",r.granularity,o,i,n),Te(Boolean,a,"fill",r.fill,o,i,n),Tf(a,"material",r.material,o,i,n),Te(Boolean,a,"outline",r.outline,o,i,n),Te(U,a,"outlineColor",r.outlineColor,o,i,n),Te(Number,a,"outlineWidth",r.outlineWidth,o,i,n),Te(Rn,a,"shadows",r.shadows,o,i,n),Te(jt,a,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Te(Zn,a,"classificationType",r.classificationType,o,i,n),Te(Number,a,"zIndex",r.zIndex,o,i,n)}function XOt(e,t,n,i){let r=t.tileset;if(!l(r))return;let o=Oo(r.interval),a=e.tileset;l(a)||(e.tileset=a=new Vv),Te(Boolean,a,"show",r.show,o,i,n),Te(RR.default,a,"uri",r.uri,o,i,n),Te(Number,a,"maximumScreenSpaceError",r.maximumScreenSpaceError,o,i,n)}function KOt(e,t,n,i){let r=t.wall;if(!l(r))return;let o=Oo(r.interval),a=e.wall;l(a)||(e.wall=a=new my),Te(Boolean,a,"show",r.show,o,i,n),OR(a,"positions",r.positions,n),JIe(a,"minimumHeights",r.minimumHeights,n),JIe(a,"maximumHeights",r.maximumHeights,n),Te(Number,a,"granularity",r.granularity,o,i,n),Te(Boolean,a,"fill",r.fill,o,i,n),Tf(a,"material",r.material,o,i,n),Te(Boolean,a,"outline",r.outline,o,i,n),Te(U,a,"outlineColor",r.outlineColor,o,i,n),Te(Number,a,"outlineWidth",r.outlineWidth,o,i,n),Te(Rn,a,"shadows",r.shadows,o,i,n),Te(jt,a,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function nPe(e,t,n,i,r){let o=e.id;if(l(o)||(o=Kn()),Nte=o,!l(r._version)&&o!=="document")throw new oe("The first CZML packet is required to be the document object.");if(e.delete===!0)t.removeById(o);else if(o==="document")FOt(e,r);else{let a=t.getOrCreateEntity(o),s=e.parent;l(s)&&(a.parent=t.getOrCreateEntity(s));for(let c=n.length-1;c>-1;c--)n[c](a,e,t,i)}Nte=void 0}function $Ot(e){let t,n=e._documentPacket.clock;if(!l(n)){if(!l(e._clock)){let r=e._entityCollection.computeAvailability();if(!r.start.equals(Qe.MINIMUM_VALUE)){let o=r.start,a=r.stop,s=K.secondsDifference(a,o),c=Math.round(s/120);return t=new Vp,t.startTime=K.clone(o),t.stopTime=K.clone(a),t.clockRange=_a.LOOP_STOP,t.multiplier=c,t.currentTime=K.clone(o),t.clockStep=Br.SYSTEM_CLOCK_MULTIPLIER,e._clock=t,!0}}return!1}l(e._clock)?t=e._clock.clone():(t=new Vp,t.startTime=Qe.MINIMUM_VALUE.clone(),t.stopTime=Qe.MAXIMUM_VALUE.clone(),t.currentTime=Qe.MINIMUM_VALUE.clone(),t.clockRange=_a.LOOP_STOP,t.clockStep=Br.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=1);let i=Oo(n.interval);return l(i)&&(t.startTime=i.start,t.stopTime=i.stop),l(n.currentTime)&&(t.currentTime=K.fromIso8601(n.currentTime)),l(n.range)&&(t.clockRange=_a[n.range]??_a.LOOP_STOP),l(n.step)&&(t.clockStep=Br[n.step]??Br.SYSTEM_CLOCK_MULTIPLIER),l(n.multiplier)&&(t.multiplier=n.multiplier),t.equals(e._clock)?!1:(e._clock=t.clone(e._clock),!0)}function aPe(e,t,n,i){n=n??H.EMPTY_OBJECT;let r=t,o=n.sourceUri,a=n.credit;if(typeof a=="string"&&(a=new wt(a)),e._credit=a,typeof t=="string"||t instanceof De){t=De.createIfNeeded(t),r=t.fetchJson(),o=o??t.clone();let s=e._resourceCredits,c=t.credits;if(l(c)){let u=c.length;for(let f=0;f<u;f++)s.push(c[f])}}return o=De.createIfNeeded(o),Ca.setLoading(e,!0),Promise.resolve(r).then(function(s){return JOt(e,s,o,i)}).catch(function(s){return Ca.setLoading(e,!1),e._error.raiseEvent(e,s),console.log(s),Promise.reject(s)})}function JOt(e,t,n,i){Ca.setLoading(e,!0);let r=e._entityCollection;i&&(e._version=void 0,e._documentPacket=new sPe,r.removeAll()),Ha._processCzml(t,r,n,void 0,e);let o=$Ot(e),a=e._documentPacket;return l(a.name)&&e._name!==a.name?(e._name=a.name,o=!0):!l(e._name)&&l(n)&&(e._name=ty(n.getUrlComponent()),o=!0),Ca.setLoading(e,!1),o&&e._changed.raiseEvent(e),e}function sPe(){this.name=void 0,this.clock=void 0}function Ha(e){this._name=e,this._changed=new be,this._error=new be,this._isLoading=!1,this._loading=new be,this._clock=void 0,this._documentPacket=new sPe,this._version=void 0,this._entityCollection=new Qs(this),this._entityCluster=new gd,this._credit=void 0,this._resourceCredits=[]}Ha.load=function(e,t){return new Ha().load(e,t)};Object.defineProperties(Ha.prototype,{name:{get:function(){return this._name}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}},credit:{get:function(){return this._credit}}});Ha.updaters=[OOt,MOt,LOt,NOt,BOt,kOt,zOt,UOt,AOt,bOt,VOt,jOt,HOt,WOt,qOt,vOt,YOt,xOt,XOt,TOt,KOt,COt,DOt];Ha.registerUpdater=function(e){Ha.updaters.includes(e)||Ha.updaters.push(e)};Ha.unregisterUpdater=function(e){if(Ha.updaters.includes(e)){let t=Ha.updaters.indexOf(e);Ha.updaters.splice(t,1)}};Ha.prototype.process=function(e,t){return aPe(this,e,t,!1)};Ha.prototype.load=function(e,t){return aPe(this,e,t,!0)};Ha.prototype.update=function(e){return!0};Ha.processPacketData=Te;Ha.processPositionPacketData=oPe;Ha.processMaterialPacketData=Tf;Ha._processCzml=function(e,t,n,i,r){if(i=i??Ha.updaters,Array.isArray(e))for(let o=0,a=e.length;o<a;++o)nPe(e[o],t,i,n,r);else nPe(e,t,i,n,r)};var jH=Ha;function kte(e){return e}function HH(e){if(e==null)return kte;var t,n,i=e.scale[0],r=e.scale[1],o=e.translate[0],a=e.translate[1];return function(s,c){c||(t=n=0);var u=2,f=s.length,d=new Array(f);for(d[0]=(t+=s[0])*i+o,d[1]=(n+=s[1])*r+a;u<f;)d[u]=s[u],++u;return d}}function cPe(e,t){for(var n,i=e.length,r=i-t;r<--i;)n=e[r],e[r++]=e[i],e[i]=n}function zte(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return lPe(e,n)})}:lPe(e,t)}function lPe(e,t){var n=t.id,i=t.bbox,r=t.properties==null?{}:t.properties,o=Ute(e,t);return n==null&&i==null?{type:"Feature",properties:r,geometry:o}:i==null?{type:"Feature",id:n,properties:r,geometry:o}:{type:"Feature",id:n,bbox:i,properties:r,geometry:o}}function Ute(e,t){var n=HH(e.transform),i=e.arcs;function r(f,d){d.length&&d.pop();for(var p=i[f<0?~f:f],g=0,m=p.length;g<m;++g)d.push(n(p[g],g));f<0&&cPe(d,m)}function o(f){return n(f)}function a(f){for(var d=[],p=0,g=f.length;p<g;++p)r(f[p],d);return d.length<2&&d.push(d[0]),d}function s(f){for(var d=a(f);d.length<4;)d.push(d[0]);return d}function c(f){return f.map(s)}function u(f){var d=f.type,p;switch(d){case"GeometryCollection":return{type:d,geometries:f.geometries.map(u)};case"Point":p=o(f.coordinates);break;case"MultiPoint":p=f.coordinates.map(o);break;case"LineString":p=a(f.arcs);break;case"MultiLineString":p=f.arcs.map(a);break;case"Polygon":p=c(f.arcs);break;case"MultiPolygon":p=f.arcs.map(c);break;default:return null}return{type:d,coordinates:p}}return u(t)}function GH(e){return h.fromDegrees(e[0],e[1],e[2])}var Vte={"urn:ogc:def:crs:OGC:1.3:CRS84":GH,"EPSG:4326":GH,"urn:ogc:def:crs:EPSG::4326":GH},uPe={},fPe={},jte=48,Hte,Gte=U.ROYALBLUE,Wte=U.YELLOW,qte=2,Yte=U.fromBytes(255,255,0,100),Xte=!1,nMt={small:24,medium:48,large:64},iMt=["title","description","marker-size","marker-symbol","marker-color","stroke","stroke-opacity","stroke-width","fill","fill-opacity"];function dPe(e,t){let n="";for(let i in e)if(e.hasOwnProperty(i)){if(i===t||iMt.indexOf(i)!==-1)continue;let r=e[i];l(r)&&(typeof r=="object"?n+=`<tr><th>${i}</th><td>${dPe(r)}</td></tr>`:n+=`<tr><th>${i}</th><td>${r}</td></tr>`)}return n.length>0&&(n=`<table class="cesium-infoBox-defaultTable"><tbody>${n}</tbody></table>`),n}function rMt(e,t,n){let i;return function(r,o){return l(i)||(i=e(t,n)),i}}function oMt(e,t){return new cp(rMt(dPe,e,t),!0)}function WH(e,t,n){let i=e.id;if(!l(i)||e.type!=="Feature")i=Kn();else{let a=2,s=i;for(;l(t.getById(s));)s=`${i}_${a}`,a++;i=s}let r=t.getOrCreateEntity(i),o=e.properties;if(l(o)){r.properties=o;let a,s=o.title;if(l(s))r.name=s,a="title";else{let u=Number.MAX_VALUE;for(let f in o)if(o.hasOwnProperty(f)&&o[f]){let d=f.toLowerCase();if(u>1&&d==="title"){a=f;break}else u>2&&d==="name"?(u=2,a=f):u>3&&/title/i.test(f)?(u=3,a=f):u>4&&/name/i.test(f)&&(u=4,a=f)}l(a)&&(r.name=o[a])}let c=o.description;c!==null&&(r.description=l(c)?new yi(c):n(o,a))}return r}function Kte(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++)n[i]=t(e[i]);return n}var hPe={Feature:pPe,FeatureCollection:aMt,GeometryCollection:gPe,LineString:xPe,MultiLineString:TPe,MultiPoint:APe,MultiPolygon:EPe,Point:yPe,Polygon:vPe,Topology:SPe},mPe={GeometryCollection:gPe,LineString:xPe,MultiLineString:TPe,MultiPoint:APe,MultiPolygon:EPe,Point:yPe,Polygon:vPe,Topology:SPe};function pPe(e,t,n,i,r){if(t.geometry===null){WH(t,e._entityCollection,r.describe);return}if(!l(t.geometry))throw new oe("feature.geometry is required.");let o=t.geometry.type,a=mPe[o];if(!l(a))throw new oe(`Unknown geometry type: ${o}`);a(e,t,t.geometry,i,r)}function aMt(e,t,n,i,r){let o=t.features;for(let a=0,s=o.length;a<s;a++)pPe(e,o[a],void 0,i,r)}function gPe(e,t,n,i,r){let o=n.geometries;for(let a=0,s=o.length;a<s;a++){let c=o[a],u=c.type,f=mPe[u];if(!l(f))throw new oe(`Unknown geometry type: ${u}`);f(e,t,c,i,r)}}function _Pe(e,t,n,i,r){let o=r.markerSymbol,a=r.markerColor,s=r.markerSize,c=t.properties;if(l(c)){let g=c["marker-color"];l(g)&&(a=U.fromCssColorString(g)),s=nMt[c["marker-size"]]??s;let m=c["marker-symbol"];l(m)&&(o=m)}let u;l(o)?o.length===1?u=e._pinBuilder.fromText(o.toUpperCase(),a,s):u=e._pinBuilder.fromMakiIconId(o,a,s):u=e._pinBuilder.fromColor(a,s);let f=new Pl;f.verticalOrigin=new yi(Wn.BOTTOM),i.length===2&&r.clampToGround&&(f.heightReference=it.CLAMP_TO_GROUND);let d=WH(t,e._entityCollection,r.describe);d.billboard=f,d.position=new _u(n(i));let p=Promise.resolve(u).then(function(g){f.image=new yi(g)}).catch(function(){f.image=new yi(e._pinBuilder.fromColor(a,s))});e._promises.push(p)}function yPe(e,t,n,i,r){_Pe(e,t,i,n.coordinates,r)}function APe(e,t,n,i,r){let o=n.coordinates;for(let a=0;a<o.length;a++)_Pe(e,t,i,o[a],r)}function bPe(e,t,n,i,r){let o=r.strokeMaterialProperty,a=r.strokeWidthProperty,s=t.properties;if(l(s)){let f=s["stroke-width"];l(f)&&(a=new yi(f));let d,p=s.stroke;l(p)&&(d=U.fromCssColorString(p));let g=s["stroke-opacity"];l(g)&&g!==1&&(l(d)||(d=o.color.getValue().clone()),d.alpha=g),l(d)&&(o=new Yt(d))}let c=WH(t,e._entityCollection,r.describe),u=new Dl;c.polyline=u,u.clampToGround=r.clampToGround,u.material=o,u.width=a,u.positions=new yi(Kte(i,n)),u.arcType=sn.RHUMB}function xPe(e,t,n,i,r){bPe(e,t,i,n.coordinates,r)}function TPe(e,t,n,i,r){let o=n.coordinates;for(let a=0;a<o.length;a++)bPe(e,t,i,o[a],r)}function CPe(e,t,n,i,r){if(i.length===0||i[0].length===0)return;let o=r.strokeMaterialProperty.color,a=r.fillMaterialProperty,s=r.strokeWidthProperty,c=t.properties;if(l(c)){let g=c["stroke-width"];l(g)&&(s=new yi(g));let m,y=c.stroke;l(y)&&(m=U.fromCssColorString(y));let A=c["stroke-opacity"];l(A)&&A!==1&&(l(m)||(m=o.getValue().clone()),m.alpha=A),l(m)&&(o=new yi(m));let b,x=c.fill,T=a.color.getValue();l(x)&&(b=U.fromCssColorString(x),b.alpha=T.alpha),A=c["fill-opacity"],l(A)&&A!==T.alpha&&(l(b)||(b=T.clone()),b.alpha=A),l(b)&&(a=new Yt(b))}let u=new ap;u.outline=new yi(!0),u.outlineColor=o,u.outlineWidth=s,u.material=a,u.arcType=sn.RHUMB;let f=[];for(let g=1,m=i.length;g<m;g++)f.push(new Vc(Kte(i[g],n)));let d=i[0];u.hierarchy=new yi(new Vc(Kte(d,n),f)),d[0].length>2?u.perPositionHeight=new yi(!0):r.clampToGround||(u.height=0);let p=WH(t,e._entityCollection,r.describe);p.polygon=u}function vPe(e,t,n,i,r){CPe(e,t,i,n.coordinates,r)}function EPe(e,t,n,i,r){let o=n.coordinates;for(let a=0;a<o.length;a++)CPe(e,t,i,o[a],r)}function SPe(e,t,n,i,r){for(let o in n.objects)if(n.objects.hasOwnProperty(o)){let a=zte(n,n.objects[o]),s=hPe[a.type];s(e,a,a,i,r)}}function yA(e){this._name=e,this._changed=new be,this._error=new be,this._isLoading=!1,this._loading=new be,this._entityCollection=new Qs(this),this._promises=[],this._pinBuilder=new k_,this._entityCluster=new gd,this._credit=void 0,this._resourceCredits=[]}yA.load=function(e,t){return new yA().load(e,t)};Object.defineProperties(yA,{markerSize:{get:function(){return jte},set:function(e){jte=e}},markerSymbol:{get:function(){return Hte},set:function(e){Hte=e}},markerColor:{get:function(){return Gte},set:function(e){Gte=e}},stroke:{get:function(){return Wte},set:function(e){Wte=e}},strokeWidth:{get:function(){return qte},set:function(e){qte=e}},fill:{get:function(){return Yte},set:function(e){Yte=e}},clampToGround:{get:function(){return Xte},set:function(e){Xte=e}},crsNames:{get:function(){return Vte}},crsLinkHrefs:{get:function(){return uPe}},crsLinkTypes:{get:function(){return fPe}}});Object.defineProperties(yA.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{value:void 0,writable:!1},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}},credit:{get:function(){return this._credit}}});yA.prototype.load=function(e,t){return wPe(this,e,t,!0)};yA.prototype.process=function(e,t){return wPe(this,e,t,!1)};function wPe(e,t,n,i){Ca.setLoading(e,!0),n=n??H.EMPTY_OBJECT;let r=n.credit;typeof r=="string"&&(r=new wt(r)),e._credit=r;let o=t,a=n.sourceUri;if(typeof t=="string"||t instanceof De){t=De.createIfNeeded(t),o=t.fetchJson(),a=a??t.getUrlComponent();let s=e._resourceCredits,c=t.credits;if(l(c)){let u=c.length;for(let f=0;f<u;f++)s.push(c[f])}}return n={describe:n.describe??oMt,markerSize:n.markerSize??jte,markerSymbol:n.markerSymbol??Hte,markerColor:n.markerColor??Gte,strokeWidthProperty:new yi(n.strokeWidth??qte),strokeMaterialProperty:new Yt(n.stroke??Wte),fillMaterialProperty:new Yt(n.fill??Yte),clampToGround:n.clampToGround??Xte},Promise.resolve(o).then(function(s){return sMt(e,s,n,a,i)}).catch(function(s){throw Ca.setLoading(e,!1),e._error.raiseEvent(e,s),s})}yA.prototype.update=function(e){return!0};function sMt(e,t,n,i,r){let o;l(i)&&(o=ty(i)),l(o)&&e._name!==o&&(e._name=o,e._changed.raiseEvent(e));let a=hPe[t.type];if(!l(a))throw new oe(`Unsupported GeoJSON object type: ${t.type}`);let s=t.crs,c=s!==null?GH:null;if(l(s)){if(!l(s.properties))throw new oe("crs.properties is undefined.");let u=s.properties;if(s.type==="name"){if(c=Vte[u.name],!l(c))throw new oe(`Unknown crs name: ${u.name}`)}else if(s.type==="link"){let f=uPe[u.href];if(l(f)||(f=fPe[u.type]),!l(f))throw new oe(`Unable to resolve crs link: ${JSON.stringify(u)}`);c=f(u)}else if(s.type==="EPSG"){if(c=Vte[`EPSG:${u.code}`],!l(c))throw new oe(`Unknown crs EPSG code: ${u.code}`)}else throw new oe(`Unknown crs type: ${s.type}`)}return Promise.resolve(c).then(function(u){return r&&e._entityCollection.removeAll(),u!==null&&a(e,t,t,u,n),Promise.all(e._promises).then(function(){return e._promises.length=0,Ca.setLoading(e,!1),e})})}var nT=yA;var $te=function(e,t){return $te=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(n[r]=i[r])},$te(e,t)};function Hp(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");$te(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Ga=function(){return Ga=Object.assign||function(t){for(var n,i=1,r=arguments.length;i<r;i++){n=arguments[i];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Ga.apply(this,arguments)};function IPe(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var i=n.call(e),r,o=[],a;try{for(;(t===void 0||t-- >0)&&!(r=i.next()).done;)o.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(a)throw a.error}}return o}function PPe(e,t,n){if(n||arguments.length===2)for(var i=0,r=t.length,o;i<r;i++)(o||!(i in t))&&(o||(o=Array.prototype.slice.call(t,0,i)),o[i]=t[i]);return e.concat(o||Array.prototype.slice.call(t))}var DPe="4.1.5";var RPe=Object.prototype.hasOwnProperty;function Cf(e){return typeof e=="boolean"}function OPe(e,t,n){var i;return e.length>t&&(n==null?(n="…",i=3):i=n.length,e=e.substring(0,t-i)+n),e}function AA(e,t){for(var n=e.length-1;n>=0;n--)t(e[n])===!0&&e.splice(n,1)}function im(e){throw new Error("Unhandled case for value: '".concat(e,"'"))}var qH=/\s+/,YH=(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},e.prototype.setClass=function(t){return this.setAttr("class",t)},e.prototype.addClass=function(t){for(var n=this.getClass(),i=n?n.split(qH):[],r=t.split(qH),o;o=r.shift();)i.indexOf(o)===-1&&i.push(o);return this.getAttrs().class=i.join(" "),this},e.prototype.removeClass=function(t){for(var n=this.getClass(),i=n?n.split(qH):[],r=t.split(qH),o;i.length&&(o=r.shift());){var a=i.indexOf(o);a!==-1&&i.splice(a,1)}return this.getAttrs().class=i.join(" "),this},e.prototype.getClass=function(){return this.getAttrs().class||""},e.prototype.hasClass=function(t){return(" "+this.getClass()+" ").indexOf(" "+t+" ")!==-1},e.prototype.setInnerHTML=function(t){return this.innerHTML=t,this},e.prototype.setInnerHtml=function(t){return this.setInnerHTML(t)},e.prototype.getInnerHTML=function(){return this.innerHTML||""},e.prototype.getInnerHtml=function(){return this.getInnerHTML()},e.prototype.toAnchorString=function(){var t=this.getTagName(),n=this.buildAttrsStr();return n=n?" "+n:"",["<",t,n,">",this.getInnerHtml(),"</",t,">"].join("")},e.prototype.buildAttrsStr=function(){var t=this.getAttrs(),n=[];for(var i in t)RPe.call(t,i)&&n.push(i+'="'+t[i]+'"');return n.join(" ")},e})();function LPe(e,t,n){var i,r;if(n==null?(n="…",r=3,i=8):(r=n.length,i=n.length),e.length<=t)return e;var o=t-r,a=cMt(e);if(a.query){var s=a.query.match(/^(.*?)(?=(\?|#))(.*?)$/i);s&&(a.query=a.query.substr(0,s[1].length),e=MPe(a))}if(e.length<=t||(a.host&&(a.host=a.host.replace(/^www\./,""),e=MPe(a)),e.length<=t))return e;var c="";if(a.host&&(c+=a.host),c.length>=o)return a.host.length===t?(a.host.substr(0,t-r)+n).substr(0,o+i):Jte(c,o,n).substr(0,o+i);var u="";if(a.path&&(u+="/"+a.path),a.query&&(u+="?"+a.query),u)if((c+u).length>=o){if((c+u).length==t)return(c+u).substr(0,t);var f=o-c.length;return(c+Jte(u,f,n)).substr(0,o+i)}else c+=u;if(a.fragment){var d="#"+a.fragment;if((c+d).length>=o){if((c+d).length==t)return(c+d).substr(0,t);var p=o-c.length;return(c+Jte(d,p,n)).substr(0,o+i)}else c+=d}if(a.scheme&&a.host){var g=a.scheme+"://";if((c+g).length<o)return(g+c).substr(0,t)}if(c.length<=t)return c;var m="";return o>0&&(m=c.substr(-1*Math.floor(o/2))),(c.substr(0,Math.ceil(o/2))+n+m).substr(0,o+i)}function cMt(e){var t={},n=e,i=n.match(/^([a-z]+):\/\//i);return i&&(t.scheme=i[1],n=n.slice(i[0].length)),i=n.match(/^(.*?)(?=(\?|#|\/|$))/i),i&&(t.host=i[1],n=n.slice(i[0].length)),i=n.match(/^\/(.*?)(?=(\?|#|$))/i),i&&(t.path=i[1],n=n.slice(i[0].length)),i=n.match(/^\?(.*?)(?=(#|$))/i),i&&(t.query=i[1],n=n.slice(i[0].length)),i=n.match(/^#(.*?)$/i),i&&(t.fragment=i[1]),t}function MPe(e){var t="";return e.scheme&&e.host&&(t+=e.scheme+"://"),e.host&&(t+=e.host),e.path&&(t+="/"+e.path),e.query&&(t+="?"+e.query),e.fragment&&(t+="#"+e.fragment),t}function Jte(e,t,n){var i=t/2,r=Math.ceil(i),o=-1*Math.floor(i),a="";return o<0&&(a=e.substr(o)),e.substr(0,r)+n+a}function NPe(e,t,n){if(e.length<=t)return e;var i,r;n==null?(n="…",i=8,r=3):(i=n.length,r=n.length);var o=t-r,a="";return o>0&&(a=e.substr(-1*Math.floor(o/2))),(e.substr(0,Math.ceil(o/2))+n+a).substr(0,o+i)}function FPe(e,t,n){return OPe(e,t,n)}var BPe=(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 YH({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.length&&this.truncate.length<t.getAnchorText().length&&(n.title=t.getAnchorHref()),n},e.prototype.createCssClass=function(t){var n=this.className;if(n){for(var i=[n],r=t.getCssClassSuffixes(),o=0,a=r.length;o<a;o++)i.push(n+"-"+r[o]);return i.join(" ")}else return""},e.prototype.processAnchorText=function(t){return t=this.doTruncate(t),t},e.prototype.doTruncate=function(t){var n=this.truncate;if(!n.length)return t;var i=n.length,r=n.location;return r==="smart"?LPe(t,i):r==="middle"?NPe(t,i):FPe(t,i)},e})();var Gp=(function(){function e(t){this._=null,this.matchedText="",this.offset=0,this.tagBuilder=t.tagBuilder,this.matchedText=t.matchedText,this.offset=t.offset}return e.prototype.getMatchedText=function(){return this.matchedText},e.prototype.setOffset=function(t){this.offset=t},e.prototype.getOffset=function(){return this.offset},e.prototype.getCssClassSuffixes=function(){return[this.type]},e.prototype.buildTag=function(){return this.tagBuilder.build(this)},e})();function kPe(e){return e>=0&&e<=31||e==127}function Lg(e){return e>=65&&e<=90||e>=97&&e<=122}function Wa(e){return e>=48&&e<=57}function XH(e){return e==34||e==39}function bA(e){return e<8232?e<160?e>=9&&e<=13||e==32:e<5760?e==160:e==5760||e>=8192&&e<=8202:e<8287?e>=8232&&e<=8233||e==8239:e<12288?e==8287:e==12288||e==65279}function rm(e){return e<4800?e<2949?e<2451?e<1425?e<768?e<192?e<169?e<65?e>=48&&e<=57:e>=65&&e<=90||e>=97&&e<=122:e<181?e>=169&&e<=170||e==174:e==181||e==186:e<710?e<216?e>=192&&e<=214:e>=216&&e<=246||e>=248&&e<=705:e<748?e>=710&&e<=721||e>=736&&e<=740:e==748||e==750:e<910?e<895?e<886?e>=768&&e<=884:e>=886&&e<=887||e>=890&&e<=893:e<904?e==895||e==902:e>=904&&e<=906||e==908:e<1155?e<931?e>=910&&e<=929:e>=931&&e<=1013||e>=1015&&e<=1153:e<1369?e>=1155&&e<=1327||e>=1329&&e<=1366:e==1369||e>=1377&&e<=1415:e<1808?e<1552?e<1476?e<1471?e>=1425&&e<=1469:e==1471||e>=1473&&e<=1474:e<1488?e>=1476&&e<=1477||e==1479:e>=1488&&e<=1514||e>=1520&&e<=1522:e<1749?e<1568?e>=1552&&e<=1562:e>=1568&&e<=1641||e>=1646&&e<=1747:e<1770?e>=1749&&e<=1756||e>=1759&&e<=1768:e>=1770&&e<=1788||e==1791:e<2230?e<2042?e<1869?e>=1808&&e<=1866:e>=1869&&e<=1969||e>=1984&&e<=2037:e<2112?e==2042||e>=2048&&e<=2093:e>=2112&&e<=2139||e>=2208&&e<=2228:e<2406?e<2260?e>=2230&&e<=2237:e>=2260&&e<=2273||e>=2275&&e<=2403:e<2437?e>=2406&&e<=2415||e>=2417&&e<=2435:e>=2437&&e<=2444||e>=2447&&e<=2448:e<2693?e<2579?e<2519?e<2486?e<2474?e>=2451&&e<=2472:e>=2474&&e<=2480||e==2482:e<2503?e>=2486&&e<=2489||e>=2492&&e<=2500:e>=2503&&e<=2504||e>=2507&&e<=2510:e<2534?e<2524?e==2519:e>=2524&&e<=2525||e>=2527&&e<=2531:e<2565?e>=2534&&e<=2545||e>=2561&&e<=2563:e>=2565&&e<=2570||e>=2575&&e<=2576:e<2631?e<2613?e<2602?e>=2579&&e<=2600:e>=2602&&e<=2608||e>=2610&&e<=2611:e<2620?e>=2613&&e<=2614||e>=2616&&e<=2617:e==2620||e>=2622&&e<=2626:e<2649?e<2635?e>=2631&&e<=2632:e>=2635&&e<=2637||e==2641:e<2662?e>=2649&&e<=2652||e==2654:e>=2662&&e<=2677||e>=2689&&e<=2691:e<2821?e<2759?e<2730?e<2703?e>=2693&&e<=2701:e>=2703&&e<=2705||e>=2707&&e<=2728:e<2741?e>=2730&&e<=2736||e>=2738&&e<=2739:e>=2741&&e<=2745||e>=2748&&e<=2757:e<2784?e<2763?e>=2759&&e<=2761:e>=2763&&e<=2765||e==2768:e<2809?e>=2784&&e<=2787||e>=2790&&e<=2799:e==2809||e>=2817&&e<=2819:e<2887?e<2858?e<2831?e>=2821&&e<=2828:e>=2831&&e<=2832||e>=2835&&e<=2856:e<2869?e>=2858&&e<=2864||e>=2866&&e<=2867:e>=2869&&e<=2873||e>=2876&&e<=2884:e<2911?e<2902?e>=2887&&e<=2888||e>=2891&&e<=2893:e>=2902&&e<=2903||e>=2908&&e<=2909:e<2929?e>=2911&&e<=2915||e>=2918&&e<=2927:e==2929||e>=2946&&e<=2947:e<3517?e<3205?e<3046?e<2984?e<2969?e<2958?e>=2949&&e<=2954:e>=2958&&e<=2960||e>=2962&&e<=2965:e<2974?e>=2969&&e<=2970||e==2972:e>=2974&&e<=2975||e>=2979&&e<=2980:e<3014?e<2990?e>=2984&&e<=2986:e>=2990&&e<=3001||e>=3006&&e<=3010:e<3024?e>=3014&&e<=3016||e>=3018&&e<=3021:e==3024||e==3031:e<3142?e<3086?e<3072?e>=3046&&e<=3055:e>=3072&&e<=3075||e>=3077&&e<=3084:e<3114?e>=3086&&e<=3088||e>=3090&&e<=3112:e>=3114&&e<=3129||e>=3133&&e<=3140:e<3160?e<3146?e>=3142&&e<=3144:e>=3146&&e<=3149||e>=3157&&e<=3158:e<3174?e>=3160&&e<=3162||e>=3168&&e<=3171:e>=3174&&e<=3183||e>=3200&&e<=3203:e<3333?e<3274?e<3242?e<3214?e>=3205&&e<=3212:e>=3214&&e<=3216||e>=3218&&e<=3240:e<3260?e>=3242&&e<=3251||e>=3253&&e<=3257:e>=3260&&e<=3268||e>=3270&&e<=3272:e<3296?e<3285?e>=3274&&e<=3277:e>=3285&&e<=3286||e==3294:e<3313?e>=3296&&e<=3299||e>=3302&&e<=3311:e>=3313&&e<=3314||e>=3329&&e<=3331:e<3423?e<3389?e<3342?e>=3333&&e<=3340:e>=3342&&e<=3344||e>=3346&&e<=3386:e<3402?e>=3389&&e<=3396||e>=3398&&e<=3400:e>=3402&&e<=3406||e>=3412&&e<=3415:e<3458?e<3430?e>=3423&&e<=3427:e>=3430&&e<=3439||e>=3450&&e<=3455:e<3482?e>=3458&&e<=3459||e>=3461&&e<=3478:e>=3482&&e<=3505||e>=3507&&e<=3515:e<3804?e<3722?e<3570?e<3535?e<3520?e==3517:e>=3520&&e<=3526||e==3530:e<3544?e>=3535&&e<=3540||e==3542:e>=3544&&e<=3551||e>=3558&&e<=3567:e<3664?e<3585?e>=3570&&e<=3571:e>=3585&&e<=3642||e>=3648&&e<=3662:e<3716?e>=3664&&e<=3673||e>=3713&&e<=3714:e==3716||e>=3719&&e<=3720:e<3754?e<3737?e<3725?e==3722:e==3725||e>=3732&&e<=3735:e<3749?e>=3737&&e<=3743||e>=3745&&e<=3747:e==3749||e==3751:e<3776?e<3757?e>=3754&&e<=3755:e>=3757&&e<=3769||e>=3771&&e<=3773:e<3784?e>=3776&&e<=3780||e==3782:e>=3784&&e<=3789||e>=3792&&e<=3801:e<4176?e<3902?e<3872?e<3840?e>=3804&&e<=3807:e==3840||e>=3864&&e<=3865:e<3895?e>=3872&&e<=3881||e==3893:e==3895||e==3897:e<3974?e<3913?e>=3902&&e<=3911:e>=3913&&e<=3948||e>=3953&&e<=3972:e<4038?e>=3974&&e<=3991||e>=3993&&e<=4028:e==4038||e>=4096&&e<=4169:e<4688?e<4301?e<4256?e>=4176&&e<=4253:e>=4256&&e<=4293||e==4295:e<4348?e==4301||e>=4304&&e<=4346:e>=4348&&e<=4680||e>=4682&&e<=4685:e<4746?e<4698?e>=4688&&e<=4694||e==4696:e>=4698&&e<=4701||e>=4704&&e<=4744:e<4786?e>=4746&&e<=4749||e>=4752&&e<=4784:e>=4786&&e<=4789||e>=4792&&e<=4798:e<11035?e<7416?e<6176?e<5873?e<4992?e<4824?e<4802?e==4800:e>=4802&&e<=4805||e>=4808&&e<=4822:e<4888?e>=4824&&e<=4880||e>=4882&&e<=4885:e>=4888&&e<=4954||e>=4957&&e<=4959:e<5121?e<5024?e>=4992&&e<=5007:e>=5024&&e<=5109||e>=5112&&e<=5117:e<5761?e>=5121&&e<=5740||e>=5743&&e<=5759:e>=5761&&e<=5786||e>=5792&&e<=5866:e<6002?e<5920?e<5888?e>=5873&&e<=5880:e>=5888&&e<=5900||e>=5902&&e<=5908:e<5984?e>=5920&&e<=5940||e>=5952&&e<=5971:e>=5984&&e<=5996||e>=5998&&e<=6e3:e<6108?e<6016?e>=6002&&e<=6003:e>=6016&&e<=6099||e==6103:e<6155?e>=6108&&e<=6109||e>=6112&&e<=6121:e>=6155&&e<=6157||e>=6160&&e<=6169:e<6783?e<6512?e<6400?e<6272?e>=6176&&e<=6263:e>=6272&&e<=6314||e>=6320&&e<=6389:e<6448?e>=6400&&e<=6430||e>=6432&&e<=6443:e>=6448&&e<=6459||e>=6470&&e<=6509:e<6608?e<6528?e>=6512&&e<=6516:e>=6528&&e<=6571||e>=6576&&e<=6601:e<6688?e>=6608&&e<=6617||e>=6656&&e<=6683:e>=6688&&e<=6750||e>=6752&&e<=6780:e<7040?e<6832?e<6800?e>=6783&&e<=6793:e>=6800&&e<=6809||e==6823:e<6992?e>=6832&&e<=6846||e>=6912&&e<=6987:e>=6992&&e<=7001||e>=7019&&e<=7027:e<7245?e<7168?e>=7040&&e<=7155:e>=7168&&e<=7223||e>=7232&&e<=7241:e<7376?e>=7245&&e<=7293||e>=7296&&e<=7304:e>=7376&&e<=7378||e>=7380&&e<=7414:e<8450?e<8130?e<8025?e<7960?e<7424?e>=7416&&e<=7417:e>=7424&&e<=7669||e>=7675&&e<=7957:e<8008?e>=7960&&e<=7965||e>=7968&&e<=8005:e>=8008&&e<=8013||e>=8016&&e<=8023:e<8031?e<8027?e==8025:e==8027||e==8029:e<8118?e>=8031&&e<=8061||e>=8064&&e<=8116:e>=8118&&e<=8124||e==8126:e<8205?e<8150?e<8134?e>=8130&&e<=8132:e>=8134&&e<=8140||e>=8144&&e<=8147:e<8178?e>=8150&&e<=8155||e>=8160&&e<=8172:e>=8178&&e<=8180||e>=8182&&e<=8188:e<8305?e<8252?e==8205:e==8252||e==8265:e<8336?e==8305||e==8319:e>=8336&&e<=8348||e>=8400&&e<=8432:e<8579?e<8486?e<8469?e<8455?e==8450:e==8455||e>=8458&&e<=8467:e<8482?e==8469||e>=8473&&e<=8477:e==8482||e==8484:e<8495?e<8488?e==8486:e==8488||e>=8490&&e<=8493:e<8517?e>=8495&&e<=8505||e>=8508&&e<=8511:e>=8517&&e<=8521||e==8526:e<9410?e<9e3?e<8592?e>=8579&&e<=8580:e>=8592&&e<=8703||e>=8986&&e<=8987:e<9193?e==9e3||e==9167:e>=9193&&e<=9203||e>=9208&&e<=9210:e<9723?e<9654?e==9410||e>=9642&&e<=9643:e==9654||e==9664:e<10548?e>=9723&&e<=9726||e>=9728&&e<=10175:e>=10548&&e<=10549||e>=11013&&e<=11015:e<43259?e<12445?e<11688?e<11520?e<11264?e<11088?e>=11035&&e<=11036:e==11088||e==11093:e<11360?e>=11264&&e<=11310||e>=11312&&e<=11358:e>=11360&&e<=11492||e>=11499&&e<=11507:e<11568?e<11559?e>=11520&&e<=11557:e==11559||e==11565:e<11647?e>=11568&&e<=11623||e==11631:e>=11647&&e<=11670||e>=11680&&e<=11686:e<11744?e<11712?e<11696?e>=11688&&e<=11694:e>=11696&&e<=11702||e>=11704&&e<=11710:e<11728?e>=11712&&e<=11718||e>=11720&&e<=11726:e>=11728&&e<=11734||e>=11736&&e<=11742:e<12330?e<11823?e>=11744&&e<=11775:e==11823||e>=12293&&e<=12294:e<12353?e>=12330&&e<=12341||e>=12347&&e<=12349:e>=12353&&e<=12438||e>=12441&&e<=12442:e<42512?e<12951?e<12549?e<12449?e>=12445&&e<=12447:e>=12449&&e<=12538||e>=12540&&e<=12543:e<12704?e>=12549&&e<=12589||e>=12593&&e<=12686:e>=12704&&e<=12730||e>=12784&&e<=12799:e<19968?e<12953?e==12951:e==12953||e>=13312&&e<=19893:e<42192?e>=19968&&e<=40917||e>=40960&&e<=42124:e>=42192&&e<=42237||e>=42240&&e<=42508:e<42891?e<42623?e<42560?e>=42512&&e<=42539:e>=42560&&e<=42610||e>=42612&&e<=42621:e<42775?e>=42623&&e<=42725||e>=42736&&e<=42737:e>=42775&&e<=42783||e>=42786&&e<=42888:e<43072?e<42928?e>=42891&&e<=42926:e>=42928&&e<=42935||e>=42999&&e<=43047:e<43216?e>=43072&&e<=43123||e>=43136&&e<=43205:e>=43216&&e<=43225||e>=43232&&e<=43255:e<55243?e<43744?e<43488?e<43312?e<43261?e==43259:e==43261||e>=43264&&e<=43309:e<43392?e>=43312&&e<=43347||e>=43360&&e<=43388:e>=43392&&e<=43456||e>=43471&&e<=43481:e<43600?e<43520?e>=43488&&e<=43518:e>=43520&&e<=43574||e>=43584&&e<=43597:e<43642?e>=43600&&e<=43609||e>=43616&&e<=43638:e>=43642&&e<=43714||e>=43739&&e<=43741:e<43824?e<43785?e<43762?e>=43744&&e<=43759:e>=43762&&e<=43766||e>=43777&&e<=43782:e<43808?e>=43785&&e<=43790||e>=43793&&e<=43798:e>=43808&&e<=43814||e>=43816&&e<=43822:e<44012?e<43868?e>=43824&&e<=43866:e>=43868&&e<=43877||e>=43888&&e<=44010:e<44032?e>=44012&&e<=44013||e>=44016&&e<=44025:e>=44032&&e<=55203||e>=55216&&e<=55238:e<64848?e<64298?e<64112?e<55296?e>=55243&&e<=55291:e>=55296&&e<=57343||e>=63744&&e<=64109:e<64275?e>=64112&&e<=64217||e>=64256&&e<=64262:e>=64275&&e<=64279||e>=64285&&e<=64296:e<64320?e<64312?e>=64298&&e<=64310:e>=64312&&e<=64316||e==64318:e<64326?e>=64320&&e<=64321||e>=64323&&e<=64324:e>=64326&&e<=64433||e>=64467&&e<=64829:e<65296?e<65024?e<64914?e>=64848&&e<=64911:e>=64914&&e<=64967||e>=65008&&e<=65019:e<65136?e>=65024&&e<=65039||e>=65056&&e<=65071:e>=65136&&e<=65140||e>=65142&&e<=65276:e<65474?e<65345?e>=65296&&e<=65305||e>=65313&&e<=65338:e>=65345&&e<=65370||e>=65382&&e<=65470:e<65490?e>=65474&&e<=65479||e>=65482&&e<=65487:e>=65490&&e<=65495||e>=65498&&e<=65500}function zPe(e){return e<47?e<42?e==33||e>=35&&e<=39:e>=42&&e<=43||e==45:e<63?e==47||e==61:e<94?e==63:e>=94&&e<=96||e>=123&&e<=126}function UPe(e){return e<91?e<47?e>=35&&e<=43||e==45:e<61?e==47:e==61||e==64:e<95?e==91||e==93:e<123?e==95:e>=123&&e<=126||e==10003}function KH(e){return e<58?e<44?e==33:e==44||e==46:e<63?e>=58&&e<=59:e==63||e==94}function VPe(e){return e<91?e==40:e==91||e==123}function Zte(e){return e<93?e==41:e==93||e==125}var jPe=/^(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|travelersinsurance|vermögensberatung|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbah1a3hjkrd|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|vermögensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--mgbcpq6gpa1a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbc0a9azcg|xn--nqv7fs00ema|americanfamily|weatherchannel|xn--54b7fta0cc|xn--6qq986b3xl|xn--80aqecdr1a|xn--b4w605ferd|xn--fiq228c5hs|xn--h2breg3eve|xn--jlq480n2rg|xn--mgba3a3ejt|xn--mgbaam7a8h|xn--mgbayh7gpa|xn--mgbbh1a71e|xn--mgbca7dzdo|xn--mgbi4ecexp|xn--mgbx4cd0ab|xn--rvc1e0am3e|international|lifeinsurance|wolterskluwer|xn--cckwcxetd|xn--eckvdtc9d|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--h2brj9c8c|xn--tiq49xqyj|xn--yfro4i67o|xn--ygbi2ammx|construction|lplfinancial|scholarships|versicherung|xn--3e0b707e|xn--45br5cyl|xn--4dbrk0ce|xn--80adxhks|xn--80asehdb|xn--8y0a063a|xn--gckr3f0f|xn--mgb9awbf|xn--mgbab2bd|xn--mgbgu82a|xn--mgbpl2fh|xn--mgbt3dhd|xn--mk1bu44c|xn--ngbc5azd|xn--ngbe9e0a|xn--ogbpf8fl|xn--qcka1pmc|accountants|barclaycard|blackfriday|blockbuster|bridgestone|calvinklein|contractors|creditunion|engineering|enterprises|investments|kerryhotels|lamborghini|motorcycles|olayangroup|photography|playstation|productions|progressive|redumbrella|williamhill|xn--11b4c3d|xn--1ck2e1b|xn--1qqw23a|xn--2scrj9c|xn--3bst00m|xn--3ds443g|xn--3hcrj9c|xn--42c2d9a|xn--45brj9c|xn--55qw42g|xn--6frz82g|xn--80ao21a|xn--9krt00a|xn--cck2b3b|xn--czr694b|xn--d1acj3b|xn--efvy88h|xn--fct429k|xn--fjq720a|xn--flw351e|xn--g2xx48c|xn--gecrj9c|xn--gk3at1e|xn--h2brj9c|xn--hxt814e|xn--imr513n|xn--j6w193g|xn--jvr189m|xn--kprw13d|xn--kpry57d|xn--mgbbh1a|xn--mgbtx2b|xn--mix891f|xn--nyqy26a|xn--otu796d|xn--pgbs0dh|xn--q9jyb4c|xn--rhqv96g|xn--rovu88b|xn--s9brj9c|xn--ses554g|xn--t60b56a|xn--vuq861b|xn--w4rs40l|xn--xhq521b|xn--zfr164b|சிங்கப்பூர்|accountant|apartments|associates|basketball|bnpparibas|boehringer|capitalone|consulting|creditcard|cuisinella|eurovision|extraspace|foundation|healthcare|immobilien|industries|management|mitsubishi|nextdirect|properties|protection|prudential|realestate|republican|restaurant|schaeffler|tatamotors|technology|university|vlaanderen|xn--30rr7y|xn--3pxu8k|xn--45q11c|xn--4gbrim|xn--55qx5d|xn--5tzm5g|xn--80aswg|xn--90a3ac|xn--9dbq2a|xn--9et52u|xn--c2br7g|xn--cg4bki|xn--czrs0t|xn--czru2d|xn--fiq64b|xn--fiqs8s|xn--fiqz9s|xn--io0a7i|xn--kput3i|xn--mxtq1m|xn--o3cw4h|xn--pssy2u|xn--q7ce6a|xn--unup4y|xn--wgbh1c|xn--wgbl6a|xn--y9a3aq|accenture|allfinanz|amsterdam|analytics|aquarelle|barcelona|bloomberg|christmas|community|directory|education|equipment|fairwinds|financial|firestone|fresenius|furniture|goldpoint|hisamitsu|homedepot|homegoods|homesense|institute|insurance|kuokgroup|landrover|lifestyle|marketing|marshalls|melbourne|microsoft|panasonic|pramerica|richardli|shangrila|solutions|statebank|statefarm|stockholm|travelers|vacations|xn--90ais|xn--c1avg|xn--d1alf|xn--e1a4c|xn--fhbei|xn--j1aef|xn--j1amh|xn--l1acc|xn--ngbrx|xn--nqv7f|xn--p1acf|xn--qxa6a|xn--tckwe|xn--vhquv|yodobashi|موريتانيا|abudhabi|airforce|allstate|attorney|barclays|barefoot|bargains|baseball|boutique|bradesco|broadway|brussels|builders|business|capetown|catering|catholic|cipriani|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|exchange|feedback|fidelity|firmdale|football|frontier|goodyear|grainger|graphics|hdfcbank|helsinki|holdings|hospital|infiniti|ipiranga|istanbul|jpmorgan|lighting|lundbeck|marriott|mckinsey|memorial|merckmsd|mortgage|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|softbank|software|stcgroup|supplies|training|vanguard|ventures|verisign|woodside|xn--90ae|xn--node|xn--p1ai|xn--qxam|yokohama|السعودية|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|banamex|bauhaus|bestbuy|booking|brother|capital|caravan|careers|channel|charity|chintai|citadel|clubmed|college|cologne|company|compare|contact|cooking|corsica|country|coupons|courses|cricket|cruises|dentist|digital|domains|exposed|express|farmers|fashion|ferrari|ferrero|finance|fishing|fitness|flights|florist|flowers|forsale|frogans|fujitsu|gallery|genting|godaddy|grocery|guitars|hamburg|hangout|hitachi|holiday|hosting|hotmail|hyundai|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lanxess|lasalle|latrobe|leclerc|limited|lincoln|markets|monster|netbank|netflix|network|neustar|okinawa|organic|origins|philips|pioneer|politie|realtor|recipes|rentals|reviews|rexroth|samsung|sandvik|schmidt|schwarz|science|shiksha|singles|staples|storage|support|surgery|systems|temasek|theater|theatre|tickets|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|yamaxun|youtube|zuerich|католик|البحرين|الجزائر|العليان|پاکستان|كاثوليك|இந்தியா|abbott|abbvie|africa|agency|airbus|airtel|alipay|alsace|alstom|amazon|anquan|aramco|author|bayern|beauty|berlin|bharti|bostik|boston|broker|camera|career|casino|center|chanel|chrome|church|circle|claims|clinic|coffee|comsec|condos|coupon|credit|cruise|dating|datsun|dealer|degree|dental|design|direct|doctor|dunlop|dupont|durban|emerck|energy|estate|events|expert|family|flickr|futbol|gallup|garden|george|giving|global|google|gratis|health|hermes|hiphop|hockey|hotels|hughes|imamat|insure|intuit|jaguar|joburg|juegos|kaufen|kindle|kosher|latino|lawyer|lefrak|living|locker|london|luxury|madrid|maison|makeup|market|mattel|mobile|monash|mormon|moscow|museum|nagoya|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|pictet|quebec|racing|realty|reisen|repair|report|review|rogers|ryukyu|safety|sakura|sanofi|school|schule|search|secure|select|shouji|soccer|social|stream|studio|supply|suzuki|swatch|sydney|taipei|taobao|target|tattoo|tennis|tienda|tjmaxx|tkmaxx|toyota|travel|unicom|viajes|viking|villas|virgin|vision|voting|voyage|walter|webcam|xihuan|yachts|yandex|zappos|москва|онлайн|ابوظبي|ارامكو|الاردن|المغرب|امارات|فلسطين|مليسيا|भारतम्|இலங்கை|ファッション|actor|adult|aetna|amfam|amica|apple|archi|audio|autos|azure|baidu|beats|bible|bingo|black|boats|bosch|build|canon|cards|chase|cheap|cisco|citic|click|cloud|coach|codes|crown|cymru|dance|deals|delta|drive|dubai|earth|edeka|email|epson|faith|fedex|final|forex|forum|gallo|games|gifts|gives|glass|globo|gmail|green|gripe|group|gucci|guide|homes|honda|horse|house|hyatt|ikano|irish|jetzt|koeln|kyoto|lamer|lease|legal|lexus|lilly|loans|locus|lotte|lotto|mango|media|miami|money|movie|music|nexus|nikon|ninja|nokia|nowtv|omega|osaka|paris|parts|party|phone|photo|pizza|place|poker|praxi|press|prime|promo|quest|radio|rehab|reise|ricoh|rocks|rodeo|rugby|salon|sener|seven|sharp|shell|shoes|skype|sling|smart|smile|solar|space|sport|stada|store|study|style|sucks|swiss|tatar|tires|tirol|tmall|today|tokyo|tools|toray|total|tours|trade|trust|tunes|tushu|ubank|vegas|video|vodka|volvo|wales|watch|weber|weibo|works|world|xerox|yahoo|ישראל|ایران|بازار|بھارت|سودان|سورية|همراه|भारोत|संगठन|বাংলা|భారత్|ഭാരതം|嘉里大酒店|aarp|able|aero|akdn|ally|amex|arab|army|arpa|arte|asda|asia|audi|auto|baby|band|bank|bbva|beer|best|bike|bing|blog|blue|bofa|bond|book|buzz|cafe|call|camp|care|cars|casa|case|cash|cbre|cern|chat|citi|city|club|cool|coop|cyou|data|date|dclk|deal|dell|desi|diet|dish|docs|dvag|erni|fage|fail|fans|farm|fast|fido|film|fire|fish|flir|food|ford|free|fund|game|gbiz|gent|ggee|gift|gmbh|gold|golf|goog|guge|guru|hair|haus|hdfc|help|here|host|hsbc|icbc|ieee|imdb|immo|info|itau|java|jeep|jobs|jprs|kddi|kids|kiwi|kpmg|kred|land|lego|lgbt|lidl|life|like|limo|link|live|loan|love|ltda|luxe|maif|meet|meme|menu|mini|mint|mobi|moda|moto|name|navy|news|next|nico|nike|ollo|open|page|pars|pccw|pics|ping|pink|play|plus|pohl|porn|post|prod|prof|qpon|read|reit|rent|rest|rich|room|rsvp|ruhr|safe|sale|sarl|save|saxo|scot|seat|seek|sexy|shia|shop|show|silk|sina|site|skin|sncf|sohu|song|sony|spot|star|surf|talk|taxi|team|tech|teva|tiaa|tips|town|toys|tube|vana|visa|viva|vivo|vote|voto|wang|weir|wien|wiki|wine|work|xbox|yoga|zara|zero|zone|дети|сайт|بارت|بيتك|ڀارت|تونس|شبكة|عراق|عمان|موقع|भारत|ভারত|ভাৰত|ਭਾਰਤ|ભારત|ଭାରତ|ಭಾರತ|ලංකා|アマゾン|グーグル|クラウド|ポイント|组织机构|電訊盈科|香格里拉|aaa|abb|abc|aco|ads|aeg|afl|aig|anz|aol|app|art|aws|axa|bar|bbc|bbt|bcg|bcn|bet|bid|bio|biz|bms|bmw|bom|boo|bot|box|buy|bzh|cab|cal|cam|car|cat|cba|cbn|ceo|cfa|cfd|com|cpa|crs|dad|day|dds|dev|dhl|diy|dnp|dog|dot|dtv|dvr|eat|eco|edu|esq|eus|fan|fit|fly|foo|fox|frl|ftr|fun|fyi|gal|gap|gay|gdn|gea|gle|gmo|gmx|goo|gop|got|gov|hbo|hiv|hkt|hot|how|ibm|ice|icu|ifm|inc|ing|ink|int|ist|itv|jcb|jio|jll|jmp|jnj|jot|joy|kfh|kia|kim|kpn|krd|lat|law|lds|llc|llp|lol|lpl|ltd|man|map|mba|med|men|mil|mit|mlb|mls|mma|moe|moi|mom|mov|msd|mtn|mtr|nab|nba|nec|net|new|nfl|ngo|nhk|now|nra|nrw|ntt|nyc|obi|one|ong|onl|ooo|org|ott|ovh|pay|pet|phd|pid|pin|pnc|pro|pru|pub|pwc|red|ren|ril|rio|rip|run|rwe|sap|sas|sbi|sbs|scb|sew|sex|sfr|ski|sky|soy|spa|srl|stc|tab|tax|tci|tdk|tel|thd|tjx|top|trv|tui|tvs|ubs|uno|uol|ups|vet|vig|vin|vip|wed|win|wme|wow|wtc|wtf|xin|xxx|xyz|you|yun|zip|бел|ком|қаз|мкд|мон|орг|рус|срб|укр|հայ|קום|عرب|قطر|كوم|مصر|कॉम|नेट|คอม|ไทย|ລາວ|ストア|セール|みんな|中文网|亚马逊|天主教|我爱你|新加坡|淡马锡|飞利浦|ac|ad|ae|af|ag|ai|al|am|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|ss|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw|ελ|ευ|бг|ею|рф|გე|닷넷|닷컴|삼성|한국|コム|世界|中信|中国|中國|企业|佛山|信息|健康|八卦|公司|公益|台湾|台灣|商城|商店|商标|嘉里|在线|大拿|娱乐|家電|广东|微博|慈善|手机|招聘|政务|政府|新闻|时尚|書籍|机构|游戏|澳門|点看|移动|网址|网店|网站|网络|联通|谷歌|购物|通販|集团|食品|餐厅|香港)$/;var Qte=/https?:\/\//i,HPe=new RegExp("^"+Qte.source,"i"),lMt=/^(javascript|vbscript):/i,uMt=/^[A-Za-z][-.+A-Za-z0-9]*:(\/\/)?([^:/]*)/,fMt=/^(?:\/\/)?([^/#?:]+)/,$S=Lg;function ene(e){return Lg(e)||Wa(e)||e===43||e===45||e===46}var Ng=rm;function $H(e){return e===95||Ng(e)}function tne(e){return rm(e)||UPe(e)||KH(e)}function JH(e){return e===47||e===63||e===35}function nne(e){return jPe.test(e.toLowerCase())}function GPe(e){if(lMt.test(e))return!1;var t=e.match(uMt);if(!t)return!1;var n=!!t[1],i=t[2];return n?!0:!(i.indexOf(".")===-1||!/[A-Za-z]/.test(i))}function WPe(e){var t=e.match(fMt);if(!t)return!1;var n=t[0],i=n.split(".");if(i.length<2)return!1;var r=i[i.length-1];return!!nne(r)}var dMt=/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,hMt=/[:/?#]/;function qPe(e){var t=e.split(hMt,1)[0];return dMt.test(t)}var mMt=/^(https?:\/\/)?(?:www\.)?/i,pMt=/^\/\//,YPe=(function(e){Hp(t,e);function t(n){var i=e.call(this,n)||this;return i.type="url",i.url="",i.urlMatchType="scheme",i.protocolRelativeMatch=!1,i.stripPrefix={scheme:!0,www:!0},i.stripTrailingSlash=!0,i.decodePercentEncoding=!0,i.protocolPrepended=!1,i.urlMatchType=n.urlMatchType,i.url=n.url,i.protocolRelativeMatch=n.protocolRelativeMatch,i.stripPrefix=n.stripPrefix,i.stripTrailingSlash=n.stripTrailingSlash,i.decodePercentEncoding=n.decodePercentEncoding,i}return t.prototype.getType=function(){return"url"},t.prototype.getUrlMatchType=function(){return this.urlMatchType},t.prototype.getUrl=function(){var n=this.url;return!this.protocolRelativeMatch&&this.urlMatchType!=="scheme"&&!this.protocolPrepended&&(n=this.url="http://"+n,this.protocolPrepended=!0),n},t.prototype.getAnchorHref=function(){var n=this.getUrl();return n.replace(/&/g,"&")},t.prototype.getAnchorText=function(){var n=this.getMatchedText();return this.protocolRelativeMatch&&(n=yMt(n)),this.stripPrefix.scheme&&(n=gMt(n)),this.stripPrefix.www&&(n=_Mt(n)),this.stripTrailingSlash&&(n=AMt(n)),this.decodePercentEncoding&&(n=bMt(n)),n},t})(Gp);function gMt(e){return e.replace(HPe,"")}function _Mt(e){return e.includes("www.")?e.replace(mMt,"$1"):e}function yMt(e){return e.replace(pMt,"")}function AMt(e){return e.charAt(e.length-1)==="/"&&(e=e.slice(0,-1)),e}function bMt(e){var t=e.replace(/%(?:22|26|27|3C|3E)/gi,function(n){return n==="%22"?""":n==="%26"?"&":n==="%27"?"'":n==="%3C"||n==="%3c"?"<":">"});if(t.includes("%"))try{return decodeURIComponent(t)}catch{}return t}var XPe=/^mailto:/i,ine=rm;function ZH(e){return ine(e)||zPe(e)}function KPe(e){var t=e.split(".").pop();return nne(t)}var $Pe=(function(e){Hp(t,e);function t(n){var i=e.call(this,n)||this;return i.type="email",i.email="",i.email=n.email,i}return t.prototype.getType=function(){return"email"},t.prototype.getEmail=function(){return this.email},t.prototype.getAnchorHref=function(){return"mailto:"+this.email},t.prototype.getAnchorText=function(){return this.email},t})(Gp);function rne(e){return e===95||rm(e)}function JPe(e){return e.length<=140}var ZPe=["twitter","facebook","instagram","tiktok","youtube"];var QPe=(function(e){Hp(t,e);function t(n){var i=e.call(this,n)||this;return i.type="hashtag",i.serviceName="twitter",i.hashtag="",i.serviceName=n.serviceName,i.hashtag=n.hashtag,i}return t.prototype.getType=function(){return"hashtag"},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getHashtag=function(){return this.hashtag},t.prototype.getAnchorHref=function(){var n=this.serviceName,i=this.hashtag;switch(n){case"twitter":return"https://twitter.com/hashtag/"+i;case"facebook":return"https://www.facebook.com/hashtag/"+i;case"instagram":return"https://instagram.com/explore/tags/"+i;case"tiktok":return"https://www.tiktok.com/tag/"+i;case"youtube":return"https://youtube.com/hashtag/"+i;default:im(n)}},t.prototype.getAnchorText=function(){return"#"+this.hashtag},t.prototype.getCssClassSuffixes=function(){var n=e.prototype.getCssClassSuffixes.call(this),i=this.getServiceName();return i&&n.push(i),n},t})(Gp);var xMt={twitter:/^@\w{1,15}$/,instagram:/^@[_\w]{1,30}$/,soundcloud:/^@[-a-z0-9_]{3,25}$/,tiktok:/^@[.\w]{1,23}[\w]$/,youtube:/^@[-.·\w]{3,30}$/};function one(e){return e===45||e===46||e===95||Lg(e)||Wa(e)}function eDe(e,t){var n=xMt[t];return n.test(e)}var tDe=["twitter","instagram","soundcloud","tiktok","youtube"];var nDe=(function(e){Hp(t,e);function t(n){var i=e.call(this,n)||this;return i.type="mention",i.serviceName="twitter",i.mention="",i.mention=n.mention,i.serviceName=n.serviceName,i}return t.prototype.getType=function(){return"mention"},t.prototype.getMention=function(){return this.mention},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getAnchorHref=function(){switch(this.serviceName){case"twitter":return"https://twitter.com/"+this.mention;case"instagram":return"https://instagram.com/"+this.mention;case"soundcloud":return"https://soundcloud.com/"+this.mention;case"tiktok":return"https://www.tiktok.com/@"+this.mention;case"youtube":return"https://youtube.com/@"+this.mention;default:im(this.serviceName)}},t.prototype.getAnchorText=function(){return"@"+this.mention},t.prototype.getCssClassSuffixes=function(){var n=e.prototype.getCssClassSuffixes.call(this),i=this.getServiceName();return i&&n.push(i),n},t})(Gp);var TMt=/[-. ()]/,CMt=/(?:(?:(?:(\+)?\d{1,3}[-. ]?)?\(?\d{3}\)?[-. ]?\d{3}[-. ]?\d{4})|(?:(\+)(?:9[976]\d|8[987530]\d|6[987]\d|5[90]\d|42\d|3[875]\d|2[98654321]\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1)[-. ]?(?:\d[-. ]?){6,12}\d+))([,;]+[0-9]+#?)*/,vMt=/(0([1-9]-?[1-9]\d{3}|[1-9]{2}-?\d{3}|[1-9]{2}\d{1}-?\d{2}|[1-9]{2}\d{2}-?\d{1})-?\d{4}|0[789]0-?\d{4}-?\d{4}|050-?\d{4}-?\d{4})/,EMt=new RegExp("^".concat(CMt.source,"|").concat(vMt.source,"$"));function ane(e){return e===45||e===46||e===32}function QH(e){return e===44||e===59}function iDe(e){var t=e.charAt(0)==="+"||TMt.test(e);return t&&EMt.test(e)}var rDe=(function(e){Hp(t,e);function t(n){var i=e.call(this,n)||this;return i.type="phone",i.number="",i.plusSign=!1,i.number=n.number,i.plusSign=n.plusSign,i}return t.prototype.getType=function(){return"phone"},t.prototype.getPhoneNumber=function(){return this.number},t.prototype.getNumber=function(){return this.getPhoneNumber()},t.prototype.getAnchorHref=function(){return"tel:"+(this.plusSign?"+":"")+this.number},t.prototype.getAnchorText=function(){return this.matchedText},t})(Gp);var SMt=(function(){function e(t,n){this.charIdx=0,this.matches=[],this._stateMachines=[],this.schemeUrlMachinesCount=0,this.text=t,this.tagBuilder=n.tagBuilder,this.stripPrefix=n.stripPrefix,this.stripTrailingSlash=n.stripTrailingSlash,this.decodePercentEncoding=n.decodePercentEncoding,this.hashtagServiceName=n.hashtagServiceName,this.mentionServiceName=n.mentionServiceName}return Object.defineProperty(e.prototype,"stateMachines",{get:function(){return this._stateMachines},enumerable:!1,configurable:!0}),e.prototype.addMachine=function(t){this._stateMachines.push(t),aDe(t)&&this.schemeUrlMachinesCount++},e.prototype.removeMachine=function(t){this._stateMachines=this._stateMachines.filter(function(n){return n!==t}),aDe(t)&&this.schemeUrlMachinesCount--},e.prototype.hasSchemeUrlMachine=function(){return this.schemeUrlMachinesCount>0},e})();function sDe(e,t){for(var n=new SMt(e,t);n.charIdx<n.text.length;n.charIdx++){var i=e.charAt(n.charIdx),r=e.charCodeAt(n.charIdx);if(n.stateMachines.length===0)eG(n,i,r);else{for(var o=n.stateMachines.length-1;o>=0;o--){var a=n.stateMachines[o];switch(a.state){case 11:OMt(n,a,r);break;case 12:MMt(n,a,r);break;case 0:wMt(n,a,r);break;case 1:IMt(n,a,r);break;case 2:PMt(n,a,r);break;case 3:DMt(n,a,r);break;case 4:RMt(n,a,i,r);break;case 5:LMt(n,a,r);break;case 6:NMt(n,a,i,r);break;case 7:FMt(n,a,i,r);break;case 13:BMt(n,a,r);break;case 14:kMt(n,a,r);break;case 8:zMt(n,a,r);break;case 9:UMt(n,a,r);break;case 10:VMt(n,a,r);break;case 15:jMt(n,a,i,r);break;case 16:HMt(n,a,i,r);break;case 17:GMt(n,a,i,r);break;case 18:WMt(n,a,i,r);break;case 19:qMt(n,a,i,r);break;case 20:YMt(n,a,r);break;case 21:XMt(n,a,r);break;case 22:iT(n,a,r);break;case 23:KMt(n,a,r);break;case 24:$Mt(n,a,r);break;case 25:JMt(n,a,r);break;case 26:ZMt(n,a,r);break;case 27:QMt(n,a,r);break;case 28:eLt(n,a,r);break;case 29:tLt(n,a,r);break;case 30:nLt(n,a,r);break;case 31:iLt(n,a,r);break;case 32:oLt(n,a,i,r);break;case 33:aLt(n,a,r);break;case 34:sLt(n,a,r);break;case 35:cLt(n,a,r);break;case 36:lLt(n,a,i,r);break;case 37:rLt(n,a,i,r);break;case 38:uLt(n,a,i,r);break;case 39:fLt(n,a,i,r);break;case 40:dLt(n,a,r);break;case 41:hLt(n,a,r);break;default:im(a.state)}}if(!n.hasSchemeUrlMachine()&&n.charIdx>0&&$S(r)){var s=n.text.charCodeAt(n.charIdx-1);$S(s)||n.addMachine(tG(n.charIdx,0))}}}for(var c=n.stateMachines.length-1;c>=0;c--)n.stateMachines.forEach(function(u){return ua(n,u)});return n.matches}function eG(e,t,n){var i=e.charIdx;if(n===35)e.addMachine(yLt(i,28));else if(n===64)e.addMachine(ALt(i,30));else if(n===47)e.addMachine(cne(i,11));else if(n===43)e.addMachine(sne(i,37));else if(n===40)e.addMachine(sne(i,32));else{if(Wa(n)&&(e.addMachine(sne(i,38)),e.addMachine(gLt(i,13))),ine(n)){var r=t.toLowerCase()==="m"?15:22;e.addMachine(_Lt(i,r))}$S(n)&&e.addMachine(tG(i,0)),rm(n)&&e.addMachine(cne(i,5))}}function wMt(e,t,n){n===58?t.state=2:n===45?t.state=1:ene(n)||e.removeMachine(t)}function IMt(e,t,n){var i=e.charIdx;n===45||(n===47?(e.removeMachine(t),e.addMachine(cne(i,11))):ene(n)?t.state=0:e.removeMachine(t))}function PMt(e,t,n){var i=e.charIdx;n===47?t.state=3:n===46?e.removeMachine(t):Ng(n)?(t.state=5,$S(n)&&e.addMachine(tG(i,0))):e.removeMachine(t)}function DMt(e,t,n){n===47?t.state=4:tne(n)?(t.state=10,t.acceptStateReached=!0):ua(e,t)}function RMt(e,t,n,i){i===47?(t.state=10,t.acceptStateReached=!0):Ng(i)?(t.state=5,t.acceptStateReached=!0):e.removeMachine(t)}function OMt(e,t,n){n===47?t.state=12:e.removeMachine(t)}function MMt(e,t,n){Ng(n)?t.state=5:e.removeMachine(t)}function LMt(e,t,n){n===46?t.state=7:n===45?t.state=6:n===58?t.state=8:JH(n)?t.state=10:$H(n)||ua(e,t)}function NMt(e,t,n,i){i===45||(i===46?ua(e,t):Ng(i)?t.state=5:ua(e,t))}function FMt(e,t,n,i){i===46?ua(e,t):Ng(i)?(t.state=5,t.acceptStateReached=!0):ua(e,t)}function BMt(e,t,n){n===46?t.state=14:n===58?t.state=8:Wa(n)||(JH(n)?t.state=10:rm(n)?e.removeMachine(t):ua(e,t))}function kMt(e,t,n){Wa(n)?(t.octetsEncountered++,t.octetsEncountered===4&&(t.acceptStateReached=!0),t.state=13):ua(e,t)}function zMt(e,t,n){Wa(n)?t.state=9:ua(e,t)}function UMt(e,t,n){Wa(n)||(JH(n)?t.state=10:ua(e,t))}function VMt(e,t,n){tne(n)||ua(e,t)}function jMt(e,t,n,i){n.toLowerCase()==="a"?t.state=16:iT(e,t,i)}function HMt(e,t,n,i){n.toLowerCase()==="i"?t.state=17:iT(e,t,i)}function GMt(e,t,n,i){n.toLowerCase()==="l"?t.state=18:iT(e,t,i)}function WMt(e,t,n,i){n.toLowerCase()==="t"?t.state=19:iT(e,t,i)}function qMt(e,t,n,i){n.toLowerCase()==="o"?t.state=20:iT(e,t,i)}function YMt(e,t,n){n===58?t.state=21:iT(e,t,n)}function XMt(e,t,n){ZH(n)?t.state=22:e.removeMachine(t)}function iT(e,t,n){n===46?t.state=23:n===64?t.state=24:ZH(n)?t.state=22:e.removeMachine(t)}function KMt(e,t,n){n===46||n===64?e.removeMachine(t):ZH(n)?t.state=22:e.removeMachine(t)}function $Mt(e,t,n){Ng(n)?t.state=25:e.removeMachine(t)}function JMt(e,t,n){n===46?t.state=27:n===45?t.state=26:$H(n)||ua(e,t)}function ZMt(e,t,n){n===45||n===46?ua(e,t):$H(n)?t.state=25:ua(e,t)}function QMt(e,t,n){n===46||n===45?ua(e,t):Ng(n)?(t.state=25,t.acceptStateReached=!0):ua(e,t)}function eLt(e,t,n){rne(n)?(t.state=29,t.acceptStateReached=!0):e.removeMachine(t)}function tLt(e,t,n){rne(n)||ua(e,t)}function nLt(e,t,n){one(n)?(t.state=31,t.acceptStateReached=!0):e.removeMachine(t)}function iLt(e,t,n){one(n)||(rm(n)?e.removeMachine(t):ua(e,t))}function rLt(e,t,n,i){Wa(i)?t.state=38:(e.removeMachine(t),eG(e,n,i))}function oLt(e,t,n,i){Wa(i)?t.state=33:e.removeMachine(t),eG(e,n,i)}function aLt(e,t,n){Wa(n)?t.state=34:e.removeMachine(t)}function sLt(e,t,n){Wa(n)?t.state=35:e.removeMachine(t)}function cLt(e,t,n){n===41?t.state=36:e.removeMachine(t)}function lLt(e,t,n,i){Wa(i)?t.state=38:ane(i)?t.state=39:e.removeMachine(t)}function uLt(e,t,n,i){var r=e.charIdx;t.acceptStateReached=!0,QH(i)?t.state=40:i===35?t.state=41:Wa(i)||(i===40?t.state=32:ane(i)?t.state=39:(ua(e,t),$S(i)&&e.addMachine(tG(r,0))))}function fLt(e,t,n,i){Wa(i)?t.state=38:i===40?t.state=32:(ua(e,t),eG(e,n,i))}function dLt(e,t,n){QH(n)||(n===35?t.state=41:Wa(n)?t.state=38:ua(e,t))}function hLt(e,t,n){QH(n)?t.state=40:Wa(n)?e.removeMachine(t):ua(e,t)}function ua(e,t){var n=e.matches,i=e.text,r=e.charIdx,o=e.tagBuilder,a=e.stripPrefix,s=e.stripTrailingSlash,c=e.decodePercentEncoding,u=e.hashtagServiceName,f=e.mentionServiceName;if(e.removeMachine(t),!!t.acceptStateReached){var d=t.startIdx,p=i.slice(t.startIdx,r);switch(p=pLt(p),t.type){case 0:{var g=i.charCodeAt(t.startIdx-1);if(g===64)return;switch(t.matchType){case 0:{var m=Qte.exec(p);if(m&&(d=d+m.index,p=p.slice(m.index)),!GPe(p))return;break}case 1:{if(!WPe(p))return;break}case 2:{if(!qPe(p))return;break}default:im(t)}n.push(new YPe({tagBuilder:o,matchedText:p,offset:d,urlMatchType:mLt(t.matchType),url:p,protocolRelativeMatch:p.slice(0,2)==="//",stripPrefix:a,stripTrailingSlash:s,decodePercentEncoding:c}));break}case 1:{KPe(p)&&n.push(new $Pe({tagBuilder:o,matchedText:p,offset:d,email:p.replace(XPe,"")}));break}case 2:{JPe(p)&&n.push(new QPe({tagBuilder:o,matchedText:p,offset:d,serviceName:u,hashtag:p.slice(1)}));break}case 3:{eDe(p,f)&&n.push(new nDe({tagBuilder:o,matchedText:p,offset:d,serviceName:f,mention:p.slice(1)}));break}case 4:{if(p=p.replace(/ +$/g,""),iDe(p)){var y=p.replace(/[^0-9,;#]/g,"");n.push(new rDe({tagBuilder:o,matchedText:p,offset:d,number:y,plusSign:p.charAt(0)==="+"}))}break}default:im(t)}}}function mLt(e){switch(e){case 0:return"scheme";case 1:return"tld";case 2:return"ipV4";default:im(e)}}var oDe={")":"(","}":"{","]":"["};function pLt(e){for(var t={"(":0,"{":0,"[":0},n=0;n<e.length;n++){var i=e.charAt(n),r=e.charCodeAt(n);VPe(r)?t[i]++:Zte(r)&&t[oDe[i]]--}for(var o=e.length-1;o>=0;){var i=e.charAt(o),r=e.charCodeAt(o);if(Zte(r)){var a=oDe[i];if(t[a]<0)t[a]++,o--;else break}else if(KH(r))o--;else break}return e.slice(0,o+1)}function tG(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:0}}function cne(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:1}}function gLt(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:2,octetsEncountered:1}}function _Lt(e,t){return{type:1,startIdx:e,state:t,acceptStateReached:!1}}function yLt(e,t){return{type:2,startIdx:e,state:t,acceptStateReached:!1}}function ALt(e,t){return{type:3,startIdx:e,state:t,acceptStateReached:!1}}function sne(e,t){return{type:4,startIdx:e,state:t,acceptStateReached:!1}}function aDe(e){return e.type===0&&e.matchType===0}var Wp=(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})(),une=new Wp,bLt=(function(){function e(t,n){this.charIdx=0,this.state=0,this.currentDataIdx=0,this.currentTag=une,this.html=t,this.callbacks=n}return e})();function cDe(e,t){for(var n=new bLt(e,t),i=e.length;n.charIdx<i;){var r=e.charAt(n.charIdx),o=e.charCodeAt(n.charIdx);switch(n.state){case 0:xLt(n,r);break;case 1:TLt(n,r,o);break;case 2:vLt(n,r,o);break;case 3:CLt(n,r,o);break;case 4:ELt(n,r,o);break;case 5:SLt(n,r,o);break;case 6:wLt(n,r,o);break;case 7:ILt(n,r,o);break;case 8:PLt(n,r);break;case 9:DLt(n,r);break;case 10:RLt(n,r,o);break;case 11:OLt(n,r,o);break;case 12:MLt(n,r);break;case 13:LLt(n);break;case 14:NLt(n,r);break;case 15:FLt(n,r);break;case 16:BLt(n,r);break;case 17:kLt(n,r);break;case 18:zLt(n,r);break;case 19:ULt(n,r);break;case 20:VLt(n,r);break;default:im(n.state)}n.charIdx++}n.currentDataIdx<n.charIdx&&jLt(n)}function xLt(e,t){t==="<"&&qp(e)}function TLt(e,t,n){t==="!"?e.state=13:t==="/"?(e.state=2,e.currentTag=new Wp(Ga(Ga({},e.currentTag),{isClosing:!0}))):t==="<"?qp(e):Lg(n)?(e.state=3,e.currentTag=new Wp(Ga(Ga({},e.currentTag),{isOpening:!0}))):(e.state=0,e.currentTag=une)}function CLt(e,t,n){bA(n)?(e.currentTag=new Wp(Ga(Ga({},e.currentTag),{name:lne(e)})),e.state=4):t==="<"?qp(e):t==="/"?(e.currentTag=new Wp(Ga(Ga({},e.currentTag),{name:lne(e)})),e.state=12):t===">"?(e.currentTag=new Wp(Ga(Ga({},e.currentTag),{name:lne(e)})),Yp(e)):!Lg(n)&&!Wa(n)&&t!==":"&&Hd(e)}function vLt(e,t,n){t===">"?Hd(e):Lg(n)?e.state=3:Hd(e)}function ELt(e,t,n){bA(n)||(t==="/"?e.state=12:t===">"?Yp(e):t==="<"?qp(e):t==="="||XH(n)||kPe(n)?Hd(e):e.state=5)}function SLt(e,t,n){bA(n)?e.state=6:t==="/"?e.state=12:t==="="?e.state=7:t===">"?Yp(e):t==="<"?qp(e):XH(n)&&Hd(e)}function wLt(e,t,n){bA(n)||(t==="/"?e.state=12:t==="="?e.state=7:t===">"?Yp(e):t==="<"?qp(e):XH(n)?Hd(e):e.state=5)}function ILt(e,t,n){bA(n)||(t==='"'?e.state=8:t==="'"?e.state=9:/[>=`]/.test(t)?Hd(e):t==="<"?qp(e):e.state=10)}function PLt(e,t){t==='"'&&(e.state=11)}function DLt(e,t){t==="'"&&(e.state=11)}function RLt(e,t,n){bA(n)?e.state=4:t===">"?Yp(e):t==="<"&&qp(e)}function OLt(e,t,n){bA(n)?e.state=4:t==="/"?e.state=12:t===">"?Yp(e):t==="<"?qp(e):(e.state=4,HLt(e))}function MLt(e,t){t===">"?(e.currentTag=new Wp(Ga(Ga({},e.currentTag),{isClosing:!0})),Yp(e)):Hd(e)}function LLt(e){var t=e.html,n=e.charIdx;t.slice(n,n+2)==="--"?(e.charIdx++,e.currentTag=new Wp(Ga(Ga({},e.currentTag),{type:"comment"})),e.state=14):t.slice(n,n+7).toUpperCase()==="DOCTYPE"?(e.charIdx+=6,e.currentTag=new Wp(Ga(Ga({},e.currentTag),{type:"doctype"})),e.state=20):Hd(e)}function NLt(e,t){t==="-"?e.state=15:t===">"?Hd(e):e.state=16}function FLt(e,t){t==="-"?e.state=18:t===">"?Hd(e):e.state=16}function BLt(e,t){t==="-"&&(e.state=17)}function kLt(e,t){t==="-"?e.state=18:e.state=16}function zLt(e,t){t===">"?Yp(e):t==="!"?e.state=19:t==="-"||(e.state=16)}function ULt(e,t){t==="-"?e.state=17:t===">"?Yp(e):e.state=16}function VLt(e,t){t===">"?Yp(e):t==="<"&&qp(e)}function Hd(e){e.state=0,e.currentTag=une}function qp(e){e.state=1,e.currentTag=new Wp({idx:e.charIdx})}function Yp(e){var t=e.html.slice(e.currentDataIdx,e.currentTag.idx);t&&e.callbacks.onText(t,e.currentDataIdx);var n=e.currentTag;n.type==="comment"?e.callbacks.onComment(n.idx):n.type==="doctype"?e.callbacks.onDoctype(n.idx):(n.isOpening&&e.callbacks.onOpenTag(n.name,n.idx),n.isClosing&&e.callbacks.onCloseTag(n.name,n.idx)),Hd(e),e.currentDataIdx=e.charIdx+1}function jLt(e){var t=e.html.slice(e.currentDataIdx,e.charIdx);e.callbacks.onText(t,e.currentDataIdx),e.currentDataIdx=e.charIdx+1}function lne(e){var t=e.currentTag.idx+(e.currentTag.isClosing?2:1);return e.html.slice(t,e.charIdx).toLowerCase()}function HLt(e){e.charIdx--}var GLt=(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=WLt(t.urls),this.email=Cf(t.email)?t.email:this.email,this.phone=Cf(t.phone)?t.phone:this.phone,this.hashtag=t.hashtag||this.hashtag,this.mention=t.mention||this.mention,this.newWindow=Cf(t.newWindow)?t.newWindow:this.newWindow,this.stripPrefix=qLt(t.stripPrefix),this.stripTrailingSlash=Cf(t.stripTrailingSlash)?t.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding=Cf(t.decodePercentEncoding)?t.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=t.sanitizeHtml||!1;var n=this.mention;if(n!==!1&&tDe.indexOf(n)===-1)throw new Error("invalid `mention` cfg '".concat(n,"' - see docs"));var i=this.hashtag;if(i!==!1&&ZPe.indexOf(i)===-1)throw new Error("invalid `hashtag` cfg '".concat(i,"' - see docs"));this.truncate=YLt(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"],r=0,o=[];return cDe(t,{onOpenTag:function(a){i.indexOf(a)>=0&&r++},onText:function(a,s){if(r===0){var c=/( | |<|<|>|>|"|"|')/gi,u=a.split(c),f=s;u.forEach(function(d,p){if(p%2===0){var g=n.parseText(d,f);o.push.apply(o,PPe([],IPe(g),!1))}f+=d.length})}},onCloseTag:function(a){i.indexOf(a)>=0&&(r=Math.max(r-1,0))},onComment:function(){},onDoctype:function(){}}),o=this.compactMatches(o),o=this.removeUnwantedMatches(o),o},e.prototype.compactMatches=function(t){t.sort(XLt);for(var n=0;n<t.length-1;){var i=t[n],r=i.getOffset(),o=i.getMatchedText().length;if(n+1<t.length&&t[n+1].getOffset()===r){var a=t[n+1].getMatchedText().length>o?n:n+1;t.splice(a,1);continue}n++}return t},e.prototype.removeUnwantedMatches=function(t){return this.hashtag||AA(t,function(n){return n.getType()==="hashtag"}),this.email||AA(t,function(n){return n.getType()==="email"}),this.phone||AA(t,function(n){return n.getType()==="phone"}),this.mention||AA(t,function(n){return n.getType()==="mention"}),this.urls.schemeMatches||AA(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="scheme"}),this.urls.tldMatches||AA(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="tld"}),this.urls.ipV4Matches||AA(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="ipV4"}),t},e.prototype.parseText=function(t,n){n=n||0;for(var i=sDe(t,{tagBuilder:this.getTagBuilder(),stripPrefix:this.stripPrefix,stripTrailingSlash:this.stripTrailingSlash,decodePercentEncoding:this.decodePercentEncoding,hashtagServiceName:this.hashtag,mentionServiceName:this.mention||"twitter"}),r=0,o=i.length;r<o;r++)i[r].setOffset(n+i[r].getOffset());return i},e.prototype.link=function(t){if(!t)return"";this.sanitizeHtml&&(t=t.replace(/</g,"<").replace(/>/g,">"));for(var n=this.parse(t),i=new Array(n.length*2+1),r=0,o=0,a=n.length;o<a;o++){var s=n[o];i.push(t.substring(r,s.getOffset())),i.push(this.createMatchReturnVal(s)),r=s.getOffset()+s.getMatchedText().length}return i.push(t.substring(r)),i.join("")},e.prototype.createMatchReturnVal=function(t){var n;if(this.replaceFn&&(n=this.replaceFn.call(this.context,t)),typeof n=="string")return n;if(n===!1)return t.getMatchedText();if(n instanceof YH)return n.toAnchorString();var i=t.buildTag();return i.toAnchorString()},e.prototype.getTagBuilder=function(){var t=this.tagBuilder;return t||(t=this.tagBuilder=new BPe({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),t},e.version=DPe,e})(),lDe=GLt;function WLt(e){return e==null&&(e=!0),Cf(e)?{schemeMatches:e,tldMatches:e,ipV4Matches:e}:{schemeMatches:Cf(e.schemeMatches)?e.schemeMatches:!0,tldMatches:Cf(e.tldMatches)?e.tldMatches:!0,ipV4Matches:Cf(e.ipV4Matches)?e.ipV4Matches:!0}}function qLt(e){return e==null&&(e=!0),Cf(e)?{scheme:e,www:e}:{scheme:Cf(e.scheme)?e.scheme:!0,www:Cf(e.www)?e.www:!0}}function YLt(e){return typeof e=="number"?{length:e,location:"end"}:Ga({length:Number.POSITIVE_INFINITY,location:"end"},e)}function XLt(e,t){return e.getOffset()-t.getOffset()}var nG=lDe;var yDe;typeof DOMParser<"u"&&(yDe=new DOMParser);var KLt=new nG({stripPrefix:!1,email:!1,replaceFn:function(e,t){return t.urlMatchType==="scheme"||t.urlMatchType==="www"}}),iG=32,uDe=2414016,fDe=1,dDe=16093e3,hDe=.1,$Lt=[null,void 0,"http://www.topografix.com/GPX/1/1"],jr={gpx:$Lt};function JLt(e){return new Promise((t,n)=>{let i=new FileReader;i.addEventListener("load",function(){t(i.result)}),i.addEventListener("error",function(){n(i.error)}),i.readAsText(e)})}function fne(e,t){let n=NR(e,"id");return n=l(n)?n:Kn(),t.getOrCreateEntity(n)}function dne(e){let t=mDe(e,"lon"),n=mDe(e,"lat"),i=MR(e,"ele",jr.gpx);return h.fromDegrees(t,n,i)}function mDe(e,t){if(!l(e))return;let n=e.getAttribute(t);if(n!==null){let i=parseFloat(n);return isNaN(i)?void 0:i}}function NR(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function xA(e,t,n){if(!l(e))return;let i=e.childNodes,r=i.length;for(let o=0;o<r;o++){let a=i[o];if(a.localName===t&&n.indexOf(a.namespaceURI)!==-1)return a}}function hne(e,t,n){if(!l(e))return;let i=[],r=e.getElementsByTagName(t),o=r.length;for(let a=0;a<o;a++){let s=r[a];s.localName===t&&n.indexOf(s.namespaceURI)!==-1&&i.push(s)}return i}function MR(e,t,n){let i=xA(e,t,n);if(l(i)){let r=parseFloat(i.textContent);return isNaN(r)?void 0:r}}function Ou(e,t,n){let i=xA(e,t,n);if(l(i))return i.textContent.trim()}function ADe(e){let t=new Pl;return t.width=iG,t.height=iG,t.scaleByDistance=new Wt(uDe,fDe,dDe,hDe),t.pixelOffsetScaleByDistance=new Wt(uDe,fDe,dDe,hDe),t.verticalOrigin=new yi(Wn.BOTTOM),t.image=e,t}function ZLt(){let e=new op;return e.translucencyByDistance=new Wt(3e6,1,5e6,0),e.pixelOffset=new k(17,0),e.horizontalOrigin=ji.LEFT,e.font="16px sans-serif",e.style=bo.FILL_AND_OUTLINE,e}function bDe(e){let t=new Dl;return t.width=4,t.material=new Qx,t.material.color=l(e)?e:U.RED,t.material.outlineWidth=2,t.material.outlineColor=U.BLACK,t}var pDe={time:{text:"Time",tag:"time"},comment:{text:"Comment",tag:"cmt"},description:{text:"Description",tag:"desc"},source:{text:"Source",tag:"src"},number:{text:"GPS track/route number",tag:"number"},type:{text:"Type",tag:"type"}},LR;typeof document<"u"&&(LR=document.createElement("div"));function mne(e,t){let n,i="",r=Object.keys(pDe),o=r.length;for(n=0;n<o;n++){let f=r[n],d=pDe[f];d.value=Ou(e,d.tag,jr.gpx)??"",l(d.value)&&d.value!==""&&(i=`${i}<p>${d.text}: ${d.value}</p>`)}if(!l(i)||i==="")return;i=KLt.link(i),LR.innerHTML=i;let a=LR.querySelectorAll("a");for(n=0;n<a.length;n++)a[n].setAttribute("target","_blank");let s=U.WHITE,c=U.BLACK,u='<div class="cesium-infoBox-description-lighter" style="';return u+="overflow:auto;",u+="word-wrap:break-word;",u+=`background-color:${s.toCssColorString()};`,u+=`color:${c.toCssColorString()};`,u+='">',u+=`${LR.innerHTML}</div>`,LR.innerHTML="",u}function xDe(e,t,n,i){let r=dne(t),o=fne(t,n);o.position=r;let a=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",U.RED,iG);o.billboard=ADe(a);let s=Ou(t,"name",jr.gpx);o.name=s,o.label=ZLt(),o.label.text=s,o.description=mne(t,o),i.clampToGround&&(o.billboard.heightReference=it.CLAMP_TO_GROUND,o.label.heightReference=it.CLAMP_TO_GROUND)}function QLt(e,t,n,i){let r=fne(t,n);r.description=mne(t,r);let o=hne(t,"rtept",jr.gpx),a=new Array(o.length);for(let s=0;s<o.length;s++)xDe(e,o[s],n,i),a[s]=dne(o[s]);r.polyline=bDe(i.routeColor),i.clampToGround&&(r.polyline.clampToGround=!0),r.polyline.positions=a}function eNt(e,t,n,i){let r=fne(t,n);r.description=mne(t,r);let o=hne(t,"trkseg",jr.gpx),a=[],s=[],c,u=!0,f=new vc;for(let d=0;d<o.length;d++)c=tNt(o[d]),a=a.concat(c.positions),c.times.length>0?(s=s.concat(c.times),f.addSamples(s,a),u=u&&!0):u=!1;if(u){let d=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",U.RED,iG);r.billboard=ADe(d),r.position=f,i.clampToGround&&(r.billboard.heightReference=it.CLAMP_TO_GROUND),r.availability=new xa,r.availability.addInterval(new Cn({start:s[0],stop:s[s.length-1]}))}r.polyline=bDe(i.trackColor),r.polyline.positions=a,i.clampToGround&&(r.polyline.clampToGround=!0)}function tNt(e){let t={positions:[],times:[]},n=hne(e,"trkpt",jr.gpx),i;for(let r=0;r<n.length;r++){let o=dne(n[r]);t.positions.push(o),i=Ou(n[r],"time",jr.gpx),l(i)&&t.times.push(K.fromIso8601(i))}return t}function nNt(e){let t=xA(e,"metadata",jr.gpx);if(l(t)){let n={name:Ou(t,"name",jr.gpx),desc:Ou(t,"desc",jr.gpx),author:iNt(t),copyright:oNt(t),link:TDe(t),time:Ou(t,"time",jr.gpx),keywords:Ou(t,"keywords",jr.gpx),bounds:aNt(t)};if(l(n.name)||l(n.desc)||l(n.author)||l(n.copyright)||l(n.link)||l(n.time)||l(n.keywords)||l(n.bounds))return n}}function iNt(e){let t=xA(e,"author",jr.gpx);if(l(t)){let n={name:Ou(t,"name",jr.gpx),email:rNt(t),link:TDe(t)};if(l(n.name)||l(n.email)||l(n.link))return n}}function rNt(e){let t=xA(e,"email",jr.gpx);if(l(t)){let n=Ou(t,"id",jr.gpx),i=Ou(t,"domain",jr.gpx);return`${n}@${i}`}}function TDe(e){let t=xA(e,"link",jr.gpx);if(l(t)){let n={href:NR(t,"href"),text:Ou(t,"text",jr.gpx),mimeType:Ou(t,"type",jr.gpx)};if(l(n.href)||l(n.text)||l(n.mimeType))return n}}function oNt(e){let t=xA(e,"copyright",jr.gpx);if(l(t)){let n={author:NR(t,"author"),year:Ou(t,"year",jr.gpx),license:Ou(t,"license",jr.gpx)};if(l(n.author)||l(n.year)||l(n.license))return n}}function aNt(e){let t=xA(e,"bounds",jr.gpx);if(l(t)){let n={minLat:MR(t,"minlat",jr.gpx),maxLat:MR(t,"maxlat",jr.gpx),minLon:MR(t,"minlon",jr.gpx),maxLon:MR(t,"maxlon",jr.gpx)};if(l(n.minLat)||l(n.maxLat)||l(n.minLon)||l(n.maxLon))return n}}var gDe={wpt:xDe,rte:QLt,trk:eNt};function sNt(e,t,n,i){let r=Object.keys(gDe),o=r.length;for(let a=0;a<o;a++){let s=r[a],c=gDe[s],u=t.childNodes,f=u.length;for(let d=0;d<f;d++){let p=u[d];p.localName===s&&jr.gpx.indexOf(p.namespaceURI)!==-1&&c(e,p,n,i)}}}function _De(e,t,n){let i=e._entityCollection;i.removeAll();let r=t.documentElement,o=NR(r,"version"),a=NR(r,"creator"),s,c=nNt(r);l(c)&&(s=c.name),r.localName==="gpx"?sNt(e,r,i,n):console.log(`GPX - Unsupported node: ${r.localName}`);let u,f=i.computeAvailability(),d=f.start,p=f.stop,g=K.equals(d,Qe.MINIMUM_VALUE),m=K.equals(p,Qe.MAXIMUM_VALUE);if(!g||!m){let A;g&&(A=new Date,A.setHours(0,0,0,0),d=K.fromDate(A)),m&&(A=new Date,A.setHours(24,0,0,0),p=K.fromDate(A)),u=new Vp,u.startTime=d,u.stopTime=p,u.currentTime=K.clone(d),u.clockRange=_a.LOOP_STOP,u.clockStep=Br.SYSTEM_CLOCK_MULTIPLIER,u.multiplier=Math.round(Math.min(Math.max(K.secondsDifference(p,d)/60,1),31556900))}let y=!1;return e._name!==s&&(e._name=s,y=!0),e._creator!==a&&(e._creator=a,y=!0),cNt(e._metadata,c)&&(e._metadata=c,y=!0),e._version!==o&&(e._version=o,y=!0),u!==e._clock&&(y=!0,e._clock=u),y&&e._changed.raiseEvent(e),Ca.setLoading(e,!1),e}function cNt(e,t){return!l(e)&&!l(t)?!1:l(e)&&l(t)?e.name!==t.name||e.dec!==t.desc||e.src!==t.src||e.author!==t.author||e.copyright!==t.copyright||e.link!==t.link||e.time!==t.time||e.bounds!==t.bounds:!0}function lNt(e,t,n,i){i=i??H.EMPTY_OBJECT;let r=n;if(typeof n=="string"||n instanceof De){n=De.createIfNeeded(n),r=n.fetchBlob();let o=e._resourceCredits,a=n.credits;if(l(a)){let s=a.length;for(let c=0;c<s;c++)o.push(a[c])}}return Promise.resolve(r).then(function(o){return o instanceof Blob?JLt(o).then(function(a){let s,c;try{s=yDe.parseFromString(a,"application/xml")}catch(u){c=u.toString()}if(l(c)||s.body||s.documentElement.tagName==="parsererror"){let u=l(c)?c:s.documentElement.firstChild.nodeValue;throw u||(u=s.body.innerText),new oe(u)}return _De(e,s,i)}):_De(e,o,i)}).catch(function(o){return e._error.raiseEvent(e,o),console.log(o),Promise.reject(o)})}function JS(){this._changed=new be,this._error=new be,this._loading=new be,this._clock=void 0,this._entityCollection=new Qs(this),this._entityCluster=new gd,this._name=void 0,this._version=void 0,this._creator=void 0,this._metadata=void 0,this._isLoading=!1,this._pinBuilder=new k_}JS.load=function(e,t){return new JS().load(e,t)};Object.defineProperties(JS.prototype,{name:{get:function(){return this._name}},version:{get:function(){return this._version}},creator:{get:function(){return this._creator}},metadata:{get:function(){return this._metadata}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}}});JS.prototype.update=function(e){return!0};JS.prototype.load=function(e,t){if(!l(e))throw new pe("data is required.");t=t??H.EMPTY_OBJECT,Ca.setLoading(this,!0);let n=this._name,i=this;return lNt(this,this._entityCollection,e,t).then(function(){let r,o=i._entityCollection.computeAvailability(),a=o.start,s=o.stop,c=K.equals(a,Qe.MINIMUM_VALUE),u=K.equals(s,Qe.MAXIMUM_VALUE);if(!c||!u){let d;c&&(d=new Date,d.setHours(0,0,0,0),a=K.fromDate(d)),u&&(d=new Date,d.setHours(24,0,0,0),s=K.fromDate(d)),r=new Vp,r.startTime=a,r.stopTime=s,r.currentTime=K.clone(a),r.clockRange=_a.LOOP_STOP,r.clockStep=Br.SYSTEM_CLOCK_MULTIPLIER,r.multiplier=Math.round(Math.min(Math.max(K.secondsDifference(s,a)/60,1),31556900))}let f=!1;return r!==i._clock&&(i._clock=r,f=!0),n!==i._name&&(f=!0),f&&i._changed.raiseEvent(i),Ca.setLoading(i,!1),i}).catch(function(r){return Ca.setLoading(i,!1),i._error.raiseEvent(i,r),console.log(r),Promise.reject(r)})};var rG=JS;function uNt(e,t){this.position=e,this.headingPitchRoll=t}var oG=uNt;var xO=La(Uu(),1);var pne=new Date(2107,11,31),gne=new Date(1980,0,1),St=void 0,rT=1/0,vf="undefined",Ef="function",CDe="object",Gi=new Uint8Array;var fNt=64,vDe=2;try{typeof navigator!=vf&&navigator.hardwareConcurrency&&(vDe=navigator.hardwareConcurrency)}catch{}var dNt={workerURI:"./core/web-worker-wasm.js",wasmURI:"./core/streams/zlib-wasm/zlib-streams.wasm",chunkSize:64*1024,maxWorkers:vDe,terminateWorkerTimeout:5e3,workerStarvationTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,CompressionStream:typeof CompressionStream!=vf&&CompressionStream,DecompressionStream:typeof DecompressionStream!=vf&&DecompressionStream},hNt=["baseURI","wasmURI","workerURI","chunkSize","maxWorkers","terminateWorkerTimeout","workerStarvationTimeout","useCompressionStream","useWebWorkers","CompressionStream","DecompressionStream","CompressionStreamZlib","DecompressionStreamZlib"],EDe=Object.assign({},dNt);function FR(){return EDe}function ZS(e){return Math.max(e.chunkSize,fNt)}function Xp(e){for(let t of hNt){let n=e[t];n!==St&&(EDe[t]=n)}}var BR=[[],[],[],[],[],[],[],[]];for(let e=0;e<256;e++){let t=e;for(let n=0;n<8;n++)t=t&1?t>>>1^3988292384:t>>>1;BR[0][e]=t}for(let e=0;e<256;e++)for(let t=1;t<8;t++){let n=BR[t-1][e];BR[t][e]=n>>>8^BR[0][n&255]}var[SDe,mNt,pNt,gNt,_Nt,yNt,ANt,bNt]=BR,Fg=class{constructor(t){this.crc=t||-1}append(t){let n=this.crc|0,i=t.length|0,r=0;if(i>=8&&t.buffer){let o=new DataView(t.buffer,t.byteOffset,i),a=i-8;for(;r<=a;r+=8){let s=n^o.getInt32(r,!0),c=o.getInt32(r+4,!0);n=bNt[s&255]^ANt[s>>>8&255]^yNt[s>>>16&255]^_Nt[s>>>24&255]^gNt[c&255]^pNt[c>>>8&255]^mNt[c>>>16&255]^SDe[c>>>24&255]}}for(;r<i;r++)n=n>>>8^SDe[(n^t[r])&255];this.crc=n}get(){return~this.crc}};var kR=class extends TransformStream{constructor(){let t,n=new Fg;super({transform(i,r){n.append(i),r.enqueue(i)},flush(){let i=new Uint8Array(4);new DataView(i.buffer).setUint32(0,n.get()),t.value=i}}),t=this}};function QS(e){if(typeof TextEncoder==vf){e=unescape(encodeURIComponent(e));let t=new Uint8Array(e.length);for(let n=0;n<t.length;n++)t[n]=e.charCodeAt(n);return t}else return new TextEncoder().encode(e)}var jl={concat(e,t){if(e.length===0||t.length===0)return e.concat(t);let n=e[e.length-1],i=jl.getPartial(n);return i===32?e.concat(t):jl._shiftRight(t,i,n|0,e.slice(0,e.length-1))},bitLength(e){let t=e.length;if(t===0)return 0;let n=e[t-1];return(t-1)*32+jl.getPartial(n)},clamp(e,t){if(e.length*32<t)return e;e=e.slice(0,Math.ceil(t/32));let n=e.length;return t=t&31,n>0&&t&&(e[n-1]=jl.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 a=0;a<e.length;a++)i.push(n|e[a]>>>t),n=e[a]<<32-t;let r=e.length?e[e.length-1]:0,o=jl.getPartial(r);return i.push(jl.partial(t+o&31,t+o>32?n:i.pop(),1)),i}},zR={bytes:{fromBits(e){let n=jl.bitLength(e)/8,i=new Uint8Array(n),r;for(let o=0;o<n;o++)(o&3)===0&&(r=e[o/4]),i[o]=r>>>24,r<<=8;return i},toBits(e){let t=[],n,i=0;for(n=0;n<e.length;n++)i=i<<8|e[n],(n&3)===3&&(t.push(i),i=0);return n&3&&t.push(jl.partial(8*(n&3),i)),t}}},wDe={};wDe.sha1=class{constructor(e){let t=this;t.blockSize=512,t._init=[1732584193,4023233417,2562383102,271733878,3285377520],t._key=[1518500249,1859775393,2400959708,3395469782],e?(t._h=e._h.slice(0),t._buffer=e._buffer.slice(0),t._length=e._length):t.reset()}reset(){let e=this;return e._h=e._init.slice(0),e._buffer=[],e._length=0,e}update(e){let t=this;typeof e=="string"&&(e=zR.utf8String.toBits(e));let n=t._buffer=jl.concat(t._buffer,e),i=t._length,r=t._length=i+jl.bitLength(e);if(r>9007199254740991)throw new Error("Cannot hash more than 2^53 - 1 bits");let o=new Uint32Array(n),a=0;for(let s=t.blockSize+i-(t.blockSize+i&t.blockSize-1);s<=r;s+=t.blockSize)t._block(o.subarray(16*a,16*(a+1))),a+=1;return n.splice(0,16*a),t}finalize(){let e=this,t=e._buffer,n=e._h;t=jl.concat(t,[jl.partial(1,1)]);for(let i=t.length+2;i&15;i++)t.push(0);for(t.push(Math.floor(e._length/4294967296)),t.push(e._length|0);t.length;)e._block(t.splice(0,16));return e.reset(),n}_f(e,t,n,i){if(e<=19)return t&n|~t&i;if(e<=39)return t^n^i;if(e<=59)return t&n|t&i|n&i;if(e<=79)return t^n^i}_S(e,t){return t<<e|t>>>32-e}_block(e){let t=this,n=t._h,i=Array(80);for(let u=0;u<16;u++)i[u]=e[u];let r=n[0],o=n[1],a=n[2],s=n[3],c=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,r)+t._f(u,o,a,s)+c+i[u]+t._key[Math.floor(u/20)]|0;c=s,s=a,a=t._S(30,o),o=r,r=f}n[0]=n[0]+r|0,n[1]=n[1]+o|0,n[2]=n[2]+a|0,n[3]=n[3]+s|0,n[4]=n[4]+c|0}};var _ne={};_ne.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],r=e.length,o,a,s,c=1;if(r!==4&&r!==6&&r!==8)throw new Error("invalid aes key size");for(t._key=[a=e.slice(0),s=[]],o=r;o<4*r+28;o++){let u=a[o-1];(o%r===0||r===8&&o%r===4)&&(u=n[u>>>24]<<24^n[u>>16&255]<<16^n[u>>8&255]<<8^n[u&255],o%r===0&&(u=u<<8^u>>>24^c<<24,c=c<<1^(c>>7)*283)),a[o]=a[o-r]^u}for(let u=0;o;u++,o--){let f=a[u&3?o:o-4];o<=4||u<4?s[u]=f:s[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],r=[],o=[],a,s,c,u;for(let f=0;f<256;f++)o[(r[f]=f<<1^(f>>7)*283)^f]=f;for(let f=a=0;!n[f];f^=s||1,a=o[a]||1){let d=a^a<<1^a<<2^a<<3^a<<4;d=d>>8^d&255^99,n[f]=d,i[d]=f,u=r[c=r[s=r[f]]];let p=u*16843009^c*65537^s*257^f*16843008,g=r[d]*257^d*16843008;for(let m=0;m<4;m++)e[m][f]=g=g<<24^g>>>8,t[m][d]=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,r=[0,0,0,0],o=this._tables[t],a=o[0],s=o[1],c=o[2],u=o[3],f=o[4],d=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,A,b,x;for(let T=0;T<i;T++)A=a[d>>>24]^s[p>>16&255]^c[g>>8&255]^u[m&255]^n[y],b=a[p>>>24]^s[g>>16&255]^c[m>>8&255]^u[d&255]^n[y+1],x=a[g>>>24]^s[m>>16&255]^c[d>>8&255]^u[p&255]^n[y+2],m=a[m>>>24]^s[d>>16&255]^c[p>>8&255]^u[g&255]^n[y+3],y+=4,d=A,p=b,g=x;for(let T=0;T<4;T++)r[t?3&-T:T]=f[d>>>24]<<24^f[p>>16&255]<<16^f[g>>8&255]<<8^f[m&255]^n[y++],A=d,d=p,p=g,g=m,m=A;return r}};var yne={};yne.ctrGladman=class{constructor(e,t){this._prf=e,this._initIv=t,this._iv=t}reset(){this._iv=this._initIv}update(e){return this.calculate(this._prf,e,this._iv)}incWord(e){if((e>>24&255)===255){let t=e>>16&255,n=e>>8&255,i=e&255;t===255?(t=0,n===255?(n=0,i===255?i=0:++i):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=i}else e+=1<<24;return e}incCounter(e){(e[0]=this.incWord(e[0]))===0&&(e[1]=this.incWord(e[1]))}calculate(e,t,n){let i;if(!(i=t.length))return[];let r=jl.bitLength(t);for(let o=0;o<i;o+=4){this.incCounter(n);let a=e.encrypt(n);t[o]^=a[0],t[o+1]^=a[1],t[o+2]^=a[2],t[o+3]^=a[3]}return jl.clamp(t,r)}};var TA={importKey(e){return new TA.hmacSha1(zR.bytes.toBits(e))},pbkdf2(e,t,n,i){if(n=n||1e4,i<0||n<0)throw new Error("invalid params to pbkdf2");let r=(i>>5)+1<<2,o,a,s,c,u,f=new ArrayBuffer(r),d=new DataView(f),p=0,g=jl;for(t=zR.bytes.toBits(t),u=1;p<(r||1);u++){for(o=a=e.encrypt(g.concat(t,[u])),s=1;s<n;s++)for(a=e.encrypt(a),c=0;c<a.length;c++)o[c]^=a[c];for(s=0;p<(r||1)&&s<o.length;s++)d.setInt32(p,o[s]),p+=4}return f.slice(0,i/8)}};TA.hmacSha1=class{constructor(e){let t=this,n=t._hash=wDe.sha1,i=[[],[]];t._baseHash=[new n,new n];let r=t._baseHash[0].blockSize/32;e.length>r&&(e=new n().update(e).finalize());for(let o=0;o<r;o++)i[0][o]=e[o]^909522486,i[1][o]=e[o]^1549556828;t._baseHash[0].update(i[0]),t._baseHash[1].update(i[1]),t._resultHash=new n(t._baseHash[0])}reset(){let e=this;e._resultHash=new e._hash(e._baseHash[0]),e._updated=!1}update(e){let t=this;t._updated=!0,t._resultHash.update(e)}digest(){let e=this,t=e._resultHash.finalize(),n=new e._hash(e._baseHash[1]).update(t).finalize();return e.reset(),n}encrypt(e){if(this._updated)throw new Error("encrypt on already updated hmac called!");return this.update(e),this.digest(e)}};var xNt=typeof crypto!=vf&&typeof crypto.getRandomValues==Ef,Bg="Invalid password",CA="Invalid signature",kg="zipjs-abort-check-password",TNt="Crypto API not supported";function aG(e){if(xNt)return crypto.getRandomValues(e);throw new Error(TNt)}var ew=16,CNt="raw",DDe={name:"PBKDF2"},vNt={name:"HMAC"},ENt="SHA-1",SNt=Object.assign({hash:vNt},DDe),Ane=Object.assign({iterations:1e3,hash:{name:ENt}},DDe),wNt=["deriveBits"],VR=[8,12,16],UR=[16,24,32],zg=10,INt=[0,0,0,0],lG=typeof crypto!=vf,GR=lG&&crypto.subtle,RDe=lG&&typeof GR!=vf,Kp=zR.bytes,PNt=_ne.aes,DNt=yne.ctrGladman,RNt=TA.hmacSha1,IDe=lG&&RDe&&typeof GR.importKey==Ef,PDe=lG&&RDe&&typeof GR.deriveBits==Ef,sG=class extends TransformStream{constructor({password:t,rawPassword:n,encryptionStrength:i,checkPasswordOnly:r}){super({start(){ODe(this,t,n,i)},async transform(o,a){let s=this,{password:c,strength:u,resolveReady:f,ready:d}=s;c?(await ONt(s,u,c,Gd(o,0,VR[u]+2)),o=Gd(o,VR[u]+2),r?a.error(new Error(kg)):f()):await d;let p=new Uint8Array(o.length-zg-(o.length-zg)%ew);a.enqueue(MDe(s,o,p,0,zg,!0))},async flush(o){let{ctr:a,hmac:s,pending:c,ready:u}=this;if(s&&a){await u;let f=Gd(c,0,c.length-zg),d=Gd(c,c.length-zg),p=Gi;if(f.length){let y=HR(Kp,f);s.update(y);let A=a.update(y);p=jR(Kp,A)}let g=Gd(jR(Kp,s.digest()),0,zg),m=c.length<zg?1:0;for(let y=0;y<zg;y++)m|=g[y]^d[y];if(m)throw new Error(CA);o.enqueue(p)}}})}},cG=class extends TransformStream{constructor({password:t,rawPassword:n,encryptionStrength:i}){let r;super({start(){ODe(this,t,n,i)},async transform(o,a){let s=this,{password:c,strength:u,resolveReady:f,ready:d}=s,p=Gi;c?(p=await MNt(s,u,c),f()):await d;let g=new Uint8Array(p.length+o.length-o.length%ew);g.set(p,0),a.enqueue(MDe(s,o,g,p.length,0))},async flush(o){let{ctr:a,hmac:s,pending:c,ready:u}=this;if(s&&a){await u;let f=Gi;if(c.length){let d=a.update(HR(Kp,c));s.update(d),f=jR(Kp,d)}r.signature=jR(Kp,s.digest()).slice(0,zg),o.enqueue(bne(f,r.signature))}}}),r=this}};function ODe(e,t,n,i){Object.assign(e,{ready:new Promise(r=>e.resolveReady=r),password:FNt(t,n),strength:i-1,pending:Gi})}function MDe(e,t,n,i,r,o){let{ctr:a,hmac:s,pending:c}=e;c.length&&(t=bne(c,t));let u=t.length-r;n=BNt(n,i+(u-u%ew));let f;for(f=0;f<=u-ew;f+=ew){let d=HR(Kp,Gd(t,f,f+ew));o&&s.update(d);let p=a.update(d);o||s.update(p),n.set(jR(Kp,p),f+i)}return e.pending=Gd(t,f),n}async function ONt(e,t,n,i){let r=await LDe(e,t,n,Gd(i,0,VR[t])),o=Gd(i,VR[t]);if(r[0]!=o[0]||r[1]!=o[1])throw new Error(Bg)}async function MNt(e,t,n){let i=aG(new Uint8Array(VR[t])),r=await LDe(e,t,n,i);return bne(i,r)}async function LDe(e,t,n,i){e.password=null;let r=await LNt(CNt,n,SNt,!1,wNt),o=await NNt(Object.assign({salt:i},Ane),r,8*(UR[t]*2+2)),a=new Uint8Array(o),s=HR(Kp,Gd(a,0,UR[t])),c=HR(Kp,Gd(a,UR[t],UR[t]*2)),u=Gd(a,UR[t]*2);return Object.assign(e,{keys:{key:s,authentication:c,passwordVerification:u},ctr:new DNt(new PNt(s),Array.from(INt)),hmac:new RNt(c)}),u}async function LNt(e,t,n,i,r){if(IDe)try{return await GR.importKey(e,t,n,i,r)}catch{return IDe=!1,TA.importKey(t)}else return TA.importKey(t)}async function NNt(e,t,n){if(PDe)try{return await GR.deriveBits(e,t,n)}catch{return PDe=!1,TA.pbkdf2(t,e.salt,Ane.iterations,n)}else return TA.pbkdf2(t,e.salt,Ane.iterations,n)}function FNt(e,t){return t===St?QS(e):t}function bne(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 BNt(e,t){if(t&&t>e.length){let n=e;e=new Uint8Array(t),e.set(n,0)}return e}function Gd(e,t,n){return e.subarray(t,n)}function jR(e,t){return e.fromBits(t)}function HR(e,t){return e.toBits(t)}var WR=12,uG=class extends TransformStream{constructor({password:t,rawPassword:n,passwordVerification:i,checkPasswordOnly:r}){super({start(){kDe(this,t,n,i)},transform(o,a){let s=this;if(s.password||s.rawPassword){let c=NDe(s,o.subarray(0,WR));if(s.password=s.rawPassword=null,(c.at(-1)^s.passwordVerification)!=0)throw new Error(Bg);o=o.subarray(WR)}r?a.error(new Error(kg)):a.enqueue(NDe(s,o))}})}},fG=class extends TransformStream{constructor({password:t,rawPassword:n,passwordVerification:i}){super({start(){kDe(this,t,n,i)},transform(r,o){let a=this,s,c;if(a.password||a.rawPassword){a.password=a.rawPassword=null;let u=aG(new Uint8Array(WR));u[WR-1]=a.passwordVerification,s=new Uint8Array(r.length+u.length),s.set(FDe(a,u),0),c=WR}else s=new Uint8Array(r.length),c=0;s.set(FDe(a,r),c),o.enqueue(s)}})}};function kDe(e,t,n,i){Object.assign(e,{password:t,rawPassword:n,passwordVerification:i}),kNt(e,t,n)}function NDe(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=zDe(e)^t[i],dG(e,n[i]);return n}function FDe(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=zDe(e)^t[i],dG(e,t[i]);return n}function kNt(e,t,n){let i=[305419896,591751049,878082192];if(Object.assign(e,{keys:i,crcKey0:new Fg(i[0]),crcKey2:new Fg(i[2])}),n)for(let r=0;r<n.length;r++)dG(e,n[r]);else for(let r=0;r<t.length;r++)dG(e,t.charCodeAt(r))}function dG(e,t){let[,n]=e.keys;e.crcKey0.append([t]);let i=~e.crcKey0.get();n=BDe(Math.imul(BDe(n+UDe(i)),134775813)+1),e.crcKey2.append([n>>>24]);let r=~e.crcKey2.get();e.keys=[i,n,r]}function zDe(e){let t=e.keys[2]|2;return UDe(Math.imul(t,t^1)>>>8)}function UDe(e){return e&255}function BDe(e){return e&4294967295}var tw="Invalid uncompressed size",qR="Invalid compressed data",zNt="deflate-raw",UNt="deflate64-raw",VNt="gzip",jNt=10,xne=8,hG=class extends TransformStream{constructor(t,{chunkSize:n,CompressionStreamZlib:i,CompressionStream:r}){super({});let{compressed:o,encrypted:a,useCompressionStream:s,zipCrypto:c,signed:u,level:f,deflate64:d}=t,p=this,g,m,y,A=super.readable,b=u&&o&&!d&&(!a||c)&&!!(s&&r);(!a||c)&&u&&!b&&(g=new kR,A=vA(A,g)),o&&(b?(y=new Tne,A=HDe(A,new r(VNt)),A=vA(A,y)):A=jDe(A,s,{level:f,chunkSize:n},r,i,r)),a&&(c?A=vA(A,new fG(t)):(m=new cG(t),A=vA(A,m))),VDe(p,A,()=>{let x;a&&!c&&(x=m.signature),(!a||c)&&u&&(x=b?y.signature:new DataView(g.value.buffer).getUint32(0)),p.signature=x})}},Tne=class extends TransformStream{constructor(){let t,n=jNt,i=new Uint8Array(0);super({transform(r,o){if(n){let p=Math.min(n,r.length);if(n-=p,r=r.subarray(p),!r.length)return}let a=i.length+r.length;if(a<=xne){let p=new Uint8Array(a);p.set(i),p.set(r,i.length),i=p;return}let s=a-xne,c=new Uint8Array(s),u=Math.min(s,i.length);c.set(i.subarray(0,u),0),s>u&&c.set(r.subarray(0,s-u),u),o.enqueue(c);let f=new Uint8Array(xne),d=i.length-u;d&&f.set(i.subarray(u),0),f.set(r.subarray(s-u),d),i=f},flush(){let r=new DataView(i.buffer,i.byteOffset,i.byteLength);t.signature=r.getUint32(0,!0),t.uncompressedSize=r.getUint32(4,!0)}}),t=this}},mG=class extends TransformStream{constructor(t,{chunkSize:n,DecompressionStreamZlib:i,DecompressionStream:r}){super({});let{zipCrypto:o,encrypted:a,signed:s,signature:c,compressed:u,useCompressionStream:f,deflate64:d}=t,p,g,m=super.readable;a&&(o?m=vA(m,new uG(t)):(g=new sG(t),m=vA(m,g))),u&&(m=jDe(m,f,{chunkSize:n,deflate64:d},r,i,r),m=WNt(m)),(!a||o)&&s&&(p=new kR,m=vA(m,p)),VDe(this,m,()=>{if((!a||o)&&s){let y=new DataView(p.value.buffer);if(c!=y.getUint32(0,!1))throw new Error(CA)}})}};function VDe(e,t,n){t=vA(t,new TransformStream({flush:n})),Object.defineProperty(e,"readable",{get(){return t}})}function jDe(e,t,n,i,r,o){let a=t&&i?i:r||o,s=n.deflate64?UNt:zNt,c;try{c=new a(s,n)}catch(u){if(t)if(r)c=new r(s,n);else if(o)c=new o(s,n);else throw u;else throw u}return HDe(e,c)}function vA(e,t){return e.pipeThrough(t)}function HDe(e,t){let n=t.writable.getWriter(),i=e.getReader();return r(),t.readable;async function r(){try{for(;;){await n.ready;let o=await i.read();if(o.done){await n.close();break}await n.write(o.value)}}catch(o){await HNt(n,o),await GNt(i,o)}}}async function HNt(e,t){try{await e.abort(t)}catch{}}async function GNt(e,t){try{await e.cancel(t)}catch{}}function WNt(e){let t=e.getReader();return new ReadableStream({async pull(n){let i;try{i=await t.read()}catch(a){if(a&&a.message)throw a;let s=new Error(qR);throw s.cause=a,s}let{value:r,done:o}=i;o?n.close():n.enqueue(r)},cancel(n){return t.cancel(n)}})}var qNt=64*1024,GDe="message",WDe="start",qDe="pull",Cne="data",YDe="ack",XDe="close",nw="deflate",_G="inflate";var pG=class extends TransformStream{constructor(t,n){super({});let i=this,{codecType:r}=t,o;r.startsWith(nw)?o=hG:r.startsWith(_G)&&(o=mG),i.outputSize=0;let a=0,s=new o(t,n),c=super.readable,u=new TransformStream({transform(d,p){d&&d.length&&(a+=d.length,p.enqueue(d))},flush(){Object.assign(i,{inputSize:a})}}),f=new TransformStream({transform(d,p){if(d&&d.length&&(p.enqueue(d),i.outputSize+=d.length,t.outputSize!==St&&i.outputSize>t.outputSize))throw new Error(tw)},flush(){let{signature:d}=s;Object.assign(i,{signature:d,inputSize:a})}});Object.defineProperty(i,"readable",{get(){return c.pipeThrough(u).pipeThrough(s).pipeThrough(f)}})}},gG=class extends TransformStream{constructor(t){let n;t>=1||(t=qNt),super({transform:i,flush(r){n&&n.length&&r.enqueue(n)}});function i(r,o){if(n){let s=new Uint8Array(n.length+r.length);s.set(n),s.set(r,n.length),r=s,n=null}let a=0;for(;r.length-a>t;)o.enqueue(r.slice(a,a+t)),a+=t;n=a?r.slice(a):r}}};var KDe={type:"module"},QDe="error",YNt="messageerror",yG,$De,vne,JDe,Sne=!0;try{Sne=typeof structuredClone==Ef&&structuredClone(new DOMException("","AbortError")).code!==St}catch{}var e1e=()=>{};function t1e({initModule:e}){e1e=e}var oT=class{constructor(t,{readable:n,writable:i},{options:r,config:o,streamOptions:a,useWebWorkers:s,transferStreams:c,workerURI:u},f){let{signal:d}=a;return Object.assign(t,{busy:!0,generation:(t.generation||0)+1,readable:n.pipeThrough(new gG(ZS(o))).pipeThrough(new wne(a),{signal:d}),writable:i,options:Object.assign({},r),workerURI:u,transferStreams:c,terminate(){return new Promise(p=>{let{worker:g,busy:m}=t;g?(m?t.resolveTerminated=p:(g.terminate(),p()),t.interface=null):p()})},onTaskFinished(){if(t.busy){let{resolveTerminated:p}=t;p&&(t.resolveTerminated=null,t.terminated=!0,t.worker.terminate(),p()),t.busy=!1,f(t)}}}),yG===St&&(yG=typeof Worker!=vf),(s&&yG?XNt:n1e)(t,o)}},wne=class extends TransformStream{constructor({onstart:t,onprogress:n,size:i,onend:r}){let o=0;super({async start(){t&&await Ene(t,i)},async transform(a,s){o+=a.length,n&&await Ene(n,o,i),s.enqueue(a)},async flush(){r&&await Ene(r,o)}})}};async function Ene(e,...t){try{await e(...t)}catch{}}function n1e(e,t){return{run:()=>KNt(e,t)}}function XNt(e,t){let{baseURI:n,chunkSize:i}=t,{wasmURI:r}=t;if(!e.interface){typeof r==Ef&&(r=r());let o;try{o=AG(e.workerURI,n,e)}catch{return yG=!1,n1e(e,t)}Object.assign(e,{worker:o,terminated:!1,interface:{run:()=>$Nt(e,{chunkSize:i,wasmURI:r,baseURI:n})}})}return e.interface}async function KNt({options:e,readable:t,writable:n,onTaskFinished:i},r){let o;try{if(!e.useCompressionStream)try{await e1e(r)}catch{let u=e.codecType.startsWith(nw)?r.CompressionStreamZlib:r.DecompressionStreamZlib;(!u||u.requiresModule)&&(e.useCompressionStream=!0)}o=new pG(e,r),await t.pipeThrough(o).pipeTo(n,{preventClose:!0,preventAbort:!0});let{signature:a,inputSize:s,outputSize:c}=o;return{signature:a,inputSize:s,outputSize:c}}catch(a){throw o&&(a.outputSize=o.outputSize),a}finally{i()}}async function $Nt(e,t){let n,i,r=new Promise((p,g)=>{n=p,i=g});Object.assign(e,{reader:null,writer:null,resolveResult:n,rejectResult:i,result:r});let{readable:o,options:a}=e,{writable:s,closed:c,abortPipe:u}=JNt(e.writable),f;try{f=Ine({type:WDe,options:a,config:t,readable:o,writable:s},e)}catch(p){u();try{await c}catch{}throw e.onTaskFinished(),p}f||Object.assign(e,{reader:o.getReader(),writer:s.getWriter()});try{let p=await r;return await d(),await c,p}catch(p){await d(),u();try{await c}catch{}throw p}async function d(){if(!f&&!s.locked)try{await s.getWriter().close()}catch{}}}function JNt(e){let t=new AbortController,{writable:n,readable:i}=new TransformStream,r=i.pipeTo(e,{preventClose:!0,preventAbort:!0,signal:t.signal});return r.catch(()=>{}),{writable:n,closed:r,abortPipe:()=>t.abort()}}function i1e(e){let{worker:t}=e;if(t)try{t.terminate()}catch{}e.interface=null}function AG(e,t,n,i,r=!0){let o,a,s;if(vne===St||$De!==e){let c=typeof e==Ef;c?a=e(r):a=e;let u=a.startsWith("data:"),f=a.startsWith("blob:");if(u||f){i===St&&(i=!1),i&&(s=KDe);try{o=new Worker(a,s)}catch(d){if(f)try{URL.revokeObjectURL(a)}catch{}if(c&&f)return AG(e,t,n,i,!1);if(i)throw d;return AG(e,t,n,!0,!1)}}else{i===St&&(i=!0),i&&(s=KDe);try{a=new URL(a,t)}catch{}try{o=new Worker(a,s)}catch(d){if(i)throw d;return AG(e,t,n,!1,r)}}$De=e,vne=a,JDe=s}else o=new Worker(vne,JDe);return o.addEventListener(GDe,c=>ZNt(c,n)),o.addEventListener(QDe,c=>ZDe(c,n)),o.addEventListener(YNt,c=>ZDe(c,n)),o}function ZDe(e,t){e.preventDefault&&e.preventDefault();let{rejectResult:n,writer:i,onTaskFinished:r}=t;i1e(t),n&&(n(e.error||new Error(e.message||QDe)),i&&i.releaseLock(),r())}function Ine(e,{worker:t,writer:n,transferStreams:i}){try{let{value:r,readable:o,writable:a}=e,s=[];if(r&&(e.value=r.byteOffset||r.byteLength!=r.buffer.byteLength?new Uint8Array(r):r,s.push(e.value.buffer)),i&&Sne?(o&&s.push(o),a&&s.push(a)):e.readable=e.writable=null,s.length)try{return t.postMessage(e,s),!0}catch{Sne=!1,e.readable=e.writable=null,t.postMessage(e)}else t.postMessage(e)}catch(r){throw n&&n.releaseLock(),r}}async function ZNt({data:e},t){let{type:n,value:i,messageId:r,result:o,error:a}=e,{reader:s,writer:c,resolveResult:u,rejectResult:f,onTaskFinished:d,generation:p}=t,g=()=>t.generation!=p;try{if(a){let{message:y,stack:A,code:b,name:x,outputSize:T}=a,C=new Error(y);Object.assign(C,{stack:A,code:b,name:x,outputSize:T}),m(C)}else{if(n==qDe){let{value:y,done:A}=await s.read();g()||Ine({type:Cne,value:y,done:A,messageId:r},t)}n==Cne&&(await c.ready,await c.write(new Uint8Array(i)),g()||Ine({type:YDe,messageId:r},t)),n==XDe&&m(null,o)}}catch(y){g()||(i1e(t),m(y))}function m(y,A){g()||(y?f(y):u(A),c&&c.releaseLock(),d())}}var aT=[],iw=[],rw,bG;var r1e=0;async function TG(e,t){let{options:n,config:i}=t,{transferStreams:r,useWebWorkers:o,useCompressionStream:a,compressed:s,signed:c,encrypted:u}=n,{workerURI:f,maxWorkers:d}=i;t.transferStreams=r||r===St;let p=!s&&!c&&!u&&!t.transferStreams;return t.useWebWorkers=!p&&(o||o===St&&i.useWebWorkers),t.workerURI=t.useWebWorkers&&f?f:St,n.useCompressionStream=a||a===St&&i.useCompressionStream,(await g()).run();async function g(){let y=aT.find(A=>!A.busy);if(y)return o1e(y),new oT(y,e,t,m);if(aT.length<d){let A={indexWorker:r1e};return r1e++,aT.push(A),new oT(A,e,t,m)}else return new Promise(A=>{iw.push({resolve:A,stream:e,workerOptions:t}),bG=i.workerStarvationTimeout,xG()})}function m(y){if(a1e(),iw.length){let[{resolve:A,stream:b,workerOptions:x}]=iw.splice(0,1);A(new oT(y,b,x,m)),xG()}else y.worker?(o1e(y),tFt(y,t)):aT=aT.filter(A=>A!=y)}}function xG(){!rw&&iw.length&&Number.isFinite(bG)&&bG>=0&&(rw=setTimeout(QNt,bG))}function a1e(){rw&&(clearTimeout(rw),rw=null)}function QNt(){if(rw=null,iw.length){let[{resolve:e,stream:t,workerOptions:n}]=iw.splice(0,1),i=Object.assign({},n,{useWebWorkers:!1,workerURI:St});e(new oT({},t,i,eFt)),xG()}}function eFt(){a1e(),xG()}function tFt(e,t){let{config:n}=t,{terminateWorkerTimeout:i}=n;Number.isFinite(i)&&i>=0&&(e.terminated?e.terminated=!1:e.terminateTimeout=setTimeout(async()=>{aT=aT.filter(r=>r!=e);try{await e.terminate()}catch{}},i))}function o1e(e){let{terminateTimeout:t}=e;t&&(clearTimeout(t),e.terminateTimeout=null)}var s1e="Writer iterator completed too soon",c1e="Writer not initialized",nFt="text/plain";var iFt="Content-Type";var rFt=64*1024,Tnr=256*1024,Pne="writable",ow=class{constructor(){this.size=0}init(){this.initialized=!0}},YR=class extends ow{get readable(){return this.createReadable()}createReadable({offset:t=0,size:n,diskNumberStart:i,chunkSize:r=rFt}={}){let o=this,a=0;return new ReadableStream({async pull(s){let c=n===St?r:Math.min(r,n-a),u=await qa(o,t+a,c,i);s.enqueue(u),a+r>n||n===St&&!u.length&&c?s.close():a+=r}})}},CG=class extends ow{constructor(){super();let t=this,n=new WritableStream({write(i){if(!t.initialized)throw new Error(c1e);return t.writeUint8Array(i)}});Object.defineProperty(t,Pne,{get(){return n}})}writeUint8Array(){}};var XR=class extends CG{constructor(t){super(),Object.assign(this,{data:"data:"+(t||"")+";base64,",pending:[]})}writeUint8Array(t){let n=this,i,r=n.pending,o=n.pending.length;for(n.pending="",i=0;i<Math.floor((o+t.length)/3)*3-o;i++)r+=String.fromCharCode(t[i]);for(;i<t.length;i++)n.pending+=String.fromCharCode(t[i]);r.length>2?n.data+=btoa(r):n.pending=r+n.pending}getData(){return this.data+btoa(this.pending)}},$p=class extends YR{constructor(t){super(),Object.assign(this,{blob:t,size:t.size})}async readUint8Array(t,n){let i=this,r=t+n,a=await(t||r<i.size?i.blob.slice(t,r):i.blob).arrayBuffer();return a.byteLength>n&&(a=a.slice(t,r)),new Uint8Array(a)}},aw=class extends ow{constructor(t){super();let n=this,i=new TransformStream,r=[];t&&r.push([iFt,t]),Object.defineProperty(n,Pne,{get(){return i.writable}}),n.blob=new Response(i.readable,{headers:r}).blob(),n.blob.catch(()=>{})}getData(){return this.blob}},KR=class extends $p{constructor(t){super(new Blob([t],{type:nFt}))}},$R=class extends aw{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 r=new FileReader;return new Promise((o,a)=>{Object.assign(r,{onload:({target:s})=>o(s.result),onerror:()=>a(r.error)}),r.readAsText(i,t)})}}};var vG=class extends YR{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,r)=>{await Sf(i),r!=n.length-1&&(t.lastDiskOffset+=i.size),t.size+=i.size})),super.init()}async readUint8Array(t,n,i=0){let r=this,{readers:o}=this,a,s=i;s==-1&&(s=o.length-1);let c=t;for(;o[s]&&c>=o[s].size;)c-=o[s].size,s++;let u=o[s];if(u){let f=u.size;if(c+n<=f)a=await qa(u,c,n);else{let d=f-c;a=new Uint8Array(n);let p=await qa(u,c,d);a.set(p,0);let g=await r.readUint8Array(t+d,n-d,i);a.set(g,d),p.length+g.length<n&&(a=a.subarray(0,p.length+g.length))}}else a=Gi;return r.lastDiskNumber=Math.max(s,r.lastDiskNumber),a}},JR=class extends ow{constructor(t,n=4294967295){super();let i=this;Object.assign(i,{diskNumber:0,diskOffset:0,size:0,maxSize:n,availableSize:n});let r,o,a,s=new WritableStream({async write(f){let{availableSize:d}=i;if(a)f.length>=d?(await c(f.subarray(0,d)),await u(),i.diskOffset+=r.size,i.diskNumber++,a=null,i.availableSize=i.maxSize,f.length>d&&await this.write(f.subarray(d))):await c(f);else{let{value:p,done:g}=await t.next();if(g&&!p)throw new Error(s1e);r=p,r.size=0,r.maxSize&&(i.maxSize=r.maxSize),i.availableSize=i.maxSize,await Sf(r),o=p.writable,a=o.getWriter(),await this.write(f)}},async close(){a&&(await a.ready,await u())},async abort(f){a&&await a.abort(f)}});Object.defineProperty(i,Pne,{get(){return s}});async function c(f){let d=f.length;d&&(await a.ready,await a.write(f),r.size+=d,i.availableSize-=d)}async function u(){await a.close()}}},sT=class{constructor(t){return Array.isArray(t)&&(t=new vG(t)),t instanceof ReadableStream&&(t={readable:t}),t}},sw=class{constructor(t){return t.writable===St&&typeof t.next==Ef&&(t=new JR(t)),t instanceof WritableStream&&(t={writable:t}),t.size===St&&(t.size=0),t instanceof JR||Object.assign(t,{diskNumber:0,diskOffset:0,availableSize:rT,maxSize:rT}),t}};async function Sf(e,t){if(e.init&&!e.initialized)await e.init(t);else return Promise.resolve()}function qa(e,t,n,i){return e.readUint8Array(t,n,i)}var l1e="\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\xA0".split(""),oFt=l1e.length==256;function u1e(e){if(oFt){let t="";for(let n=0;n<e.length;n++)t+=l1e[e[n]];return t}else return new TextDecoder().decode(e)}function ZR(e,t){return t&&t.trim().toLowerCase()=="cp437"?u1e(e):new TextDecoder(t,{ignoreBOM:!0}).decode(e)}var Dne="filename",Rne="rawFilename",QR="comment",One="rawComment",eO="uncompressedSize",Mne="compressedSize",Lne="offset",Nne="diskNumberStart",cw="lastModDate",EG="rawLastModDate",tO="lastAccessDate",f1e="rawLastAccessDate",nO="creationDate",Fne="rawCreationDate",Bne="internalFileAttributes",kne="externalFileAttributes",zne="msdosAttributesRaw",Une="msdosAttributes",Vne="msDosCompatible",SG="zip64",jne="encrypted",Hne="version",Gne="versionMadeBy",Wne="zipCrypto",lw="directory",qne="executable",Yne="compressionMethod",Xne="signature",wG="extraField",aFt="extraFieldInfoZip",sFt="extraFieldUnix";var Kne="unixMode",$ne="setuid",Jne="setgid",Zne="sticky",cFt="bitFlag",lFt="filenameUTF8",uFt="commentUTF8",fFt="rawExtraField",dFt="extraFieldZip64",hFt="extraFieldUnicodePath",mFt="extraFieldUnicodeComment",pFt="extraFieldAES",gFt="extraFieldNTFS",_Ft="extraFieldExtendedTimestamp",yFt=[Dne,Rne,eO,Mne,cw,EG,QR,One,tO,nO,Fne,Lne,Nne,Bne,kne,zne,Une,Vne,SG,jne,Hne,Gne,Wne,lw,qne,Yne,Xne,wG,sFt,aFt,"uid","gid",Kne,$ne,Jne,Zne,cFt,lFt,uFt,fFt,dFt,hFt,mFt,pFt,gFt,_Ft],EA=class{constructor(t){yFt.forEach(n=>this[n]=t[n])}};var d1e="filenameEncoding",h1e="commentEncoding",m1e="decodeText",p1e="extractPrependedData",g1e="extractAppendedData",IG="password",PG="rawPassword",DG="passThrough",RG="signal",_1e="checkPasswordOnly",y1e="checkOverlappingEntryOnly",A1e="checkOverlappingEntry",Qne="checkAmbiguity",b1e="checkSignature",OG="useWebWorkers",MG="useCompressionStream",LG="transferStreams",NG="preventClose",x1e="encryptionStrength",T1e="extendedTimestamp",C1e="keepOrder",v1e="level",E1e="bufferedWrite",S1e="createTempStream",w1e="dataDescriptorSignature",I1e="useUnicodeFileNames",P1e="dataDescriptor",D1e="supportZip64SplitFile",R1e="encodeText",iO="offset",O1e="usdz",M1e="unixExtraFieldType",eie="strictness",L1e="maxAppendedDataSize",rO="strict",N1e="balanced",tie="tolerant";var oO="File format is not recognized",q1e="End of central directory not found",Y1e="End of Zip64 central directory locator not found",X1e="Central directory header not found",K1e="Local file header not found",$1e="Zip64 extra field not found",J1e="File contains encrypted entry",Z1e="Encryption method not supported",iie="Compression method not supported",rie="Split zip file",Q1e="Overlapping entry found",eRe="Ambiguous archive",B1e="utf-8",xFt="UTF8",k1e="cp437",z1e=2057,TFt=[[eO,4294967295],[Mne,4294967295],[Lne,4294967295],[Nne,65535]],U1e={65535:{getValue:br,bytes:4},4294967295:{getValue:Ug,bytes:8}},lT=class{constructor(t,n={}){Object.assign(this,{reader:new sT(t),options:n,config:FR(),readRanges:new Map})}async*getEntriesGenerator(t={}){let n=this,{reader:i}=n,{config:r}=n;if(await Sf(i),(i.size===St||!i.readUint8Array)&&(i=new $p(await new Response(i.readable).blob()),await Sf(i)),i.size<22)throw new Error(oO);let o=iRe(Pa(n,t,eie),Pa(n,t,Qne)),a=o==rO,s=o!=tie,c=IFt(Pa(n,t,L1e),o),{endOfDirectoryInfo:u,endOfDirectoryReachingEndCount:f}=await DFt(i,s,c);if(!u){let B=await qa(i,0,4),G=fo(B);throw br(G)==134695760?new Error(rie):new Error(q1e)}s&&f>1&&wf("multiple end of central directory records");let d=fo(u),p=br(d,12),g=br(d,16),m=u.offset,y=Da(d,20),A=m+22+y;i.size-A>c&&wf("appended data");let b=Da(d,4),x=i.lastDiskNumber||0,T=Da(d,6),C=Da(d,10),E=0,w,D;if(g==4294967295||p==4294967295||C==65535||T==65535){let B=u.offset>=20?await qa(i,u.offset-20,20):Gi,G=fo(B);if(B.length==20&&br(G,0)==117853008){g=Ug(G,8);let W=await qa(i,g,56,-1),Q=fo(W),q=u.offset-20-56-(i.lastDiskOffset||0);if((W.length<56||br(Q,0)!=101075792)&&g!=q&&q>=0){let J=g;g=q,g>J&&(E=g-J),W=await qa(i,g,56,-1),Q=fo(W)}if(W.length<56||br(Q,0)!=101075792)throw new Error(Y1e);D=!0,b==65535?b=br(Q,16):a&&b!=br(Q,16)&&wf("mismatched zip64 end of central directory record"),T==65535?T=br(Q,20):a&&T!=br(Q,20)&&wf("mismatched zip64 end of central directory record"),C==65535?C=Ug(Q,32):a&&C!=Ug(Q,32)&&wf("mismatched zip64 end of central directory record"),p==4294967295?p=Ug(Q,40):a&&p!=Ug(Q,40)&&wf("mismatched zip64 end of central directory record"),g=Ug(Q,48)+E}}let R=p,M=u.offset-(D?76:0);if(g>=i.size&&(E=i.size-g-p-22,g=i.size-p-22),x!=b)throw new Error(rie);if(g<0)throw new Error(oO);let N=0,_=await qa(i,g,p,T),v=fo(_);if(p){if(_.length<4)throw new Error(oO);let B=M-p-(i.lastDiskOffset||0);if(g!=B&&T==b){let W=!(br(v,N)==33639248);if(!W&&B>=0&&B+4<=i.size){let Q=await qa(i,B,4,T);W=br(fo(Q),0)==33639248}if(W){let Q=g;g=B,g>Q&&(E+=g-Q),_=await qa(i,g,p,T),v=fo(_)}}}let S=M-g-(i.lastDiskOffset||0);if(p!=S&&S>=0&&T==b&&(p=S,_=await qa(i,g,p,T),v=fo(_)),g<0||g>=i.size)throw new Error(oO);w=g;let P=Pa(n,t,d1e),L=Pa(n,t,h1e),F=a?new Set:St,V;for(let B=0;B<C;B++){let G=new oie(i,r,n.options);if(N+46>_.length||br(v,N)!=33639248)throw new Error(X1e);tRe(G,v,N+6);let W=!!G.bitFlag.languageEncodingFlag,Q=N+46,q=Q+G.filenameLength,J=q+G.extraFieldLength,Z=Da(v,N+4),ce=Z>>8==0,Ae=Z>>8==3,le=_.subarray(Q,q),Ce=Da(v,N+32),ye=J+Ce,ve=_.subarray(J,ye),Ie=W,Le=W,$e=br(v,N+38),Ye=$e&255,yt={readOnly:!!(Ye&1),hidden:!!(Ye&2),system:!!(Ye&4),directory:!!(Ye&16),archive:!!(Ye&32)},Ke=br(v,N+42),we=Pa(n,t,m1e)||ZR,We=Ie?B1e:P||k1e,Ct=Le?B1e:L||k1e,ct=we(le,We);ct===St&&(ct=ZR(le,We));let dn=we(ve,Ct);dn===St&&(dn=ZR(ve,Ct)),Object.assign(G,{index:B,versionMadeBy:Z,msDosCompatible:ce,compressedSize:0,uncompressedSize:0,commentLength:Ce,offset:Ke,diskNumberStart:Da(v,N+34),internalFileAttributes:Da(v,N+36),externalFileAttributes:$e,msdosAttributesRaw:Ye,msdosAttributes:yt,rawFilename:le,filenameUTF8:Ie,commentUTF8:Le,rawExtraField:_.subarray(q,J),rawComment:ve,filename:ct,comment:dn}),nRe(G,G,v,N+6),G.offset+=E,w=Math.min(G.offset,w),a&&(F.has(G.filename)&&(V=!0),F.add(G.filename));let Ht=G.externalFileAttributes>>16&65535;G.unixMode===St&&(Ht&16877)!=0&&(G.unixMode=Ht);let bt=!!(G.unixMode&2048),Dt=!!(G.unixMode&1024),In=!!(G.unixMode&512),rt=G.unixMode!==St?(G.unixMode&73)!=0:Ae&&(Ht&73)!=0,dt=G.unixMode!==St&&(G.unixMode&61440)==16384,vi=(Ht&61440)==16384;Object.assign(G,{setuid:bt,setgid:Dt,sticky:In,unixExternalUpper:Ht,internalFileAttribute:G.internalFileAttributes,externalFileAttribute:G.externalFileAttributes,executable:rt,directory:dt||vi||ce&&yt.directory||G.filename.endsWith("/")&&!G.uncompressedSize,zipCrypto:G.encrypted&&!G.extraFieldAES});let wn=new EA(G);wn.getData=(lr,Li)=>G.getData(lr,wn,n.readRanges,Li),wn.arrayBuffer=async lr=>{let Li=new TransformStream,[Wi]=await Promise.all([new Response(Li.readable).arrayBuffer(),G.getData(Li,wn,n.readRanges,lr)]);return Wi},N=ye;let{onprogress:Mi}=t;if(Mi)try{await Mi(B+1,C,new EA(G))}catch{}yield wn}a&&N!=R&&wf("trailing central directory data"),V&&wf("duplicate filename"),a&&(E||C&&w>0)&&wf("prepended data");let z=Pa(n,t,p1e),j=Pa(n,t,g1e);return z&&(n.prependedData=w>0?await qa(i,0,w):Gi),n.comment=y?await qa(i,m+22,y):Gi,j&&(n.appendedData=A<i.size?await qa(i,A,i.size-A):Gi),!0}async getEntries(t={}){let n=[];for await(let i of this.getEntriesGenerator(t))n.push(i);return n}async close(){}};var oie=class{constructor(t,n,i){Object.assign(this,{reader:t,config:n,options:i})}async getData(t,n,i,r={}){let o=this,{reader:a,index:s,offset:c,diskNumberStart:u,extraFieldAES:f,extraFieldZip64:d,compressionMethod:p,config:g,bitFlag:m,signature:y,rawLastModDate:A,uncompressedSize:b,compressedSize:x}=o,{dataDescriptor:T}=m,C=n.localDirectory={},E=await qa(a,c,30,u),w=fo(E),D=Pa(o,r,IG),R=Pa(o,r,PG),M=Pa(o,r,DG);if(D=D&&D.length&&D,R=R&&R.length&&R,f&&f.originalCompressionMethod!=99)throw new Error(iie);if(p!=0&&p!=8&&p!=9&&!M)throw new Error(iie);if(E.length<30||br(w,0)!=67324752)throw new Error(K1e);tRe(C,w,4);let{extraFieldLength:N,filenameLength:_}=C,v=iRe(Pa(o,r,eie),Pa(o,r,Qne))==rO,S=Gi;if(v&&(_||N)){let ve=await qa(a,c+30,_+N,u);S=ve.subarray(0,_),C.rawExtraField=ve.subarray(_)}else C.rawExtraField=N?await qa(a,c+30+_,N,u):Gi;nRe(o,C,w,4,!0),v&&OFt(o,C,S);let{lastAccessDate:P,creationDate:L}=C;P&&(n.lastAccessDate=P),L&&(n.creationDate=L);let F=o.encrypted&&C.encrypted&&!M,V=F&&!f;if(M||(n.zipCrypto=V),F){if(!V&&f.strength===St)throw new Error(Z1e);if(!D&&!R)throw new Error(J1e)}let z=c+30+_+N,j=x,B=a.createReadable({offset:z,size:j,diskNumberStart:u,chunkSize:ZS(g)}),G=Pa(o,r,RG),W=Pa(o,r,_1e),Q=Pa(o,r,A1e),q=Pa(o,r,y1e);q&&(Q=!0);let{onstart:J,onprogress:Z,onend:ce}=r,Ae=p==9,le=Pa(o,r,MG);Ae&&(le=!1);let Ce={options:{codecType:_G,password:D,rawPassword:R,zipCrypto:V,encryptionStrength:f&&f.strength,signed:Pa(o,r,b1e)&&!M,passwordVerification:V&&(T?A>>>8&255:y>>>24&255),outputSize:M?x:b,signature:y,compressed:p!=0&&!M,encrypted:F,useWebWorkers:Pa(o,r,OG),useCompressionStream:le,transferStreams:Pa(o,r,LG),deflate64:Ae,checkPasswordOnly:W},config:g,streamOptions:{signal:G,size:j,onstart:J,onprogress:Z,onend:ce}};Q&&await wFt({reader:a,fileEntry:n,index:s,offset:c,diskNumberStart:u,signature:y,compressedSize:x,uncompressedSize:b,dataOffset:z,dataDescriptor:T||C.bitFlag.dataDescriptor,extraFieldZip64:d||C.extraFieldZip64,readRanges:i});let ye;try{if(!q){W&&(t=new WritableStream),t=new sw(t),await Sf(t,M?x:b),{writable:ye}=t;let{outputSize:ve}=await TG({readable:B,writable:ye},Ce);if(t.size+=ve,ve!=(M?x:b))throw new Error(tw)}}catch(ve){if(ve.outputSize!==St&&(t.size+=ve.outputSize),!W||ve.message!=kg)throw ve}finally{!Pa(o,r,NG)&&ye&&!ye.locked&&await ye.getWriter().close()}return W||q?St:t.getData?t.getData():ye}};function tRe(e,t,n){let i=e.rawBitFlag=Da(t,n+2),r=(i&1)==1,o=br(t,n+6);Object.assign(e,{encrypted:r,version:Da(t,n),bitFlag:{level:(i&6)>>1,dataDescriptor:(i&8)==8,languageEncodingFlag:(i&2048)==2048},rawLastModDate:o,lastModDate:MFt(o),filenameLength:Da(t,n+22),extraFieldLength:Da(t,n+24)})}function nRe(e,t,n,i,r){let{rawExtraField:o}=t,a=t.extraField=new Map,s=fo(new Uint8Array(o)),c=0;try{for(;c<o.length;){let x=Da(s,c),T=Da(s,c+2);a.set(x,{type:x,data:o.slice(c+4,c+4+T)}),c+=4+T}}catch{}let u=Da(n,i+4);Object.assign(t,{signature:br(n,i+10),compressedSize:br(n,i+14),uncompressedSize:br(n,i+18)});let f=a.get(1);f&&(CFt(f,t),t.extraFieldZip64=f);let d=a.get(28789);d&&(V1e(d,Dne,Rne,t,e),t.extraFieldUnicodePath=d);let p=a.get(25461);p&&(V1e(p,QR,One,t,e),t.extraFieldUnicodeComment=p);let g=a.get(39169);g&&g.data.length>=7?(vFt(g,t,u),t.extraFieldAES=g):t.compressionMethod=u;let m=a.get(10);m&&(EFt(m,t),t.extraFieldNTFS=m);let y=a.get(30805);if(y)j1e(y,t,!1),t.extraFieldUnix=y;else{let x=a.get(30837);x&&(j1e(x,t,!0),t.extraFieldInfoZip=x)}let A=a.get(21589);A&&(SFt(A,t,r),t.extraFieldExtendedTimestamp=A);let b=a.get(6534);b&&(t.extraFieldUSDZ=b)}function CFt(e,t){t.zip64=!0;let n=fo(e.data),i=TFt.filter(([o,a])=>t[o]==a),r=i.reduce((o,[,a])=>o+U1e[a].bytes,0);if(e.data.length<r)throw new Error($1e);for(let o=0,a=0;o<i.length;o++){let[s,c]=i[o],u=U1e[c];t[s]=e[s]=u.getValue(n,a),a+=u.bytes}}function V1e(e,t,n,i,r){if(e.data.length<5){e.valid=!1;return}let o=fo(e.data),a=new Fg;a.append(r[n]);let s=fo(new Uint8Array(4));s.setUint32(0,a.get(),!0);let c=br(o,1);Object.assign(e,{version:SA(o,0),[t]:ZR(e.data.subarray(5)),valid:!r.bitFlag.languageEncodingFlag&&c==br(s,0)}),e.valid&&(i[t]=e[t],i[t+xFt]=!0)}function vFt(e,t,n){let i=fo(e.data),r=SA(i,4);Object.assign(e,{vendorVersion:SA(i,0),vendorId:SA(i,2),strength:r,originalCompressionMethod:n,compressionMethod:Da(i,5)}),t.compressionMethod=e.compressionMethod}function EFt(e,t){let n=fo(e.data),i=4,r;try{for(;i<e.data.length&&!r;){let o=Da(n,i),a=Da(n,i+2);o==1&&(r=e.data.slice(i+4,i+4+a)),i+=4+a}}catch{}try{if(r&&r.length==24){let o=fo(r),a=o.getBigUint64(0,!0),s=o.getBigUint64(8,!0),c=o.getBigUint64(16,!0);Object.assign(e,{rawLastModDate:a,rawLastAccessDate:s,rawCreationDate:c});let u=nie(a),f=nie(s),d=nie(c),p={lastModDate:u,lastAccessDate:f,creationDate:d};Object.assign(e,p),Object.assign(t,p)}}catch{}}function j1e(e,t,n){try{let i=fo(new Uint8Array(e.data)),r,o;if(n){let a=0,s=SA(i,a++),c=SA(i,a++);r=H1e(e.data.subarray(a,a+c)),a+=c;let u=SA(i,a++);o=H1e(e.data.subarray(a,a+u)),Object.assign(e,{version:s,uid:r,gid:o})}else e.data.length>=4&&(r=Da(i,0),o=Da(i,2),Object.assign(e,{uid:r,gid:o}));r!==St&&(t.uid=r),o!==St&&(t.gid=o)}catch{}}function H1e(e){let t=new Uint8Array(4);return t.set(e,0),new DataView(t.buffer,t.byteOffset,4).getUint32(0,!0)}function SFt(e,t,n){if(!e.data.length)return;let i=fo(e.data),r=SA(i,0),o=[],a=[];n?((r&1)==1&&(o.push(cw),a.push(EG)),(r&2)==2&&(o.push(tO),a.push(f1e)),(r&4)==4&&(o.push(nO),a.push(Fne))):e.data.length>=5&&(o.push(cw),a.push(EG));let s=1;o.forEach((c,u)=>{if(e.data.length>=s+4){let f=br(i,s);t[c]=e[c]=new Date((f|0)*1e3);let d=a[u];e[d]=f}s+=4})}async function wFt({reader:e,fileEntry:t,index:n,offset:i,diskNumberStart:r,signature:o,compressedSize:a,uncompressedSize:s,dataOffset:c,dataDescriptor:u,extraFieldZip64:f,readRanges:d}){let p=0;if(r&&e.readers)for(let y=0;y<Math.min(r,e.readers.length);y++)p+=e.readers[y].size;let g=0;if(u&&(f?g=20:g=12),g){let y=await qa(e,c+a,g+4,r);if(y.length==g+4&&br(fo(y),0)==134695760){let b=br(fo(y),4),x,T;f?(x=Ug(fo(y),8),T=Ug(fo(y),16)):(x=br(fo(y),8),T=br(fo(y),12)),(t.encrypted&&!t.zipCrypto||b==o)&&x==a&&T==s&&(g+=4)}}let m={start:p+i,end:p+c+a+g,fileEntry:t};for(let[y,A]of d)if(y!=n&&m.start<A.end&&A.start<m.end){let b=new Error(Q1e);throw b.overlappingEntry=A.fileEntry,b}d.set(n,m)}function iRe(e,t){return e===St?t?rO:N1e:e}function IFt(e,t){return e!==St?e:t==rO?0:t==tie?1/0:65535}var PFt=64,G1e=0,bie=1,kG=2;async function DFt(e,t,n){let{size:i}=e,r=Math.min(i,65557),o={count:PFt},a,s,c=0;for await(let[u,f,d,p,g]of rRe(e,r)){let m=Da(u,p+20);if(g+22+m==i){let y=await oRe(e,u,f,p,g,i,o);if(y==kG){if(a||(a=aie(d,p,g)),c++,!t||c>1)break}else y==bie&&!s&&(s=aie(d,p,g))}}return a||(a=s),a||(a=await RFt(e,n,o)),{endOfDirectoryInfo:a,endOfDirectoryReachingEndCount:c}}async function RFt(e,t,n){let{size:i}=e,r=Math.min(i,t==1/0?i:65557+t),o,a;for await(let[s,c,u,f,d]of rRe(e,r)){let p=aie(u,f,d);o||(o=p);let g=await oRe(e,s,c,f,d,i,n);if(g==kG)return p;g==bie&&!a&&(a=p)}return a||o}async function*rRe(e,t){let n=e.size-t,i=await qa(e,n,t),r=fo(i);for(let o=i.length-22;o>=0;o--)br(r,o)==101010256&&(yield[r,n,i,o,n+o])}function aie(e,t,n){return{offset:n,buffer:e.slice(t,t+22).buffer}}async function oRe(e,t,n,i,r,o,a){let s=Da(t,i+10),c=br(t,i+12),u=br(t,i+16);if(s==65535||c==4294967295||u==4294967295)return await W1e(e,t,n,r-20,o,a)==117853008?kG:G1e;if(!s&&!c)return bie;for(let f of[r-c,u])if(await W1e(e,t,n,f,o,a)==33639248)return kG;return G1e}async function W1e(e,t,n,i,r,o){if(i<0||i+4>r)return St;if(i>=n)return br(t,i-n);if(o.count>0){o.count--;let a=await qa(e,i,4);return br(fo(a),0)}return St}function OFt(e,t,n){let{rawFilename:i}=e;(n.length!=i.length||n.some((r,o)=>r!=i[o]))&&wf("mismatched local file header (filename)"),(t.rawBitFlag&z1e)!=(e.rawBitFlag&z1e)&&wf("mismatched local file header (general purpose bit flag)"),t.compressionMethod!=e.compressionMethod&&wf("mismatched local file header (compression method)"),!t.bitFlag.dataDescriptor&&(t.signature||t.compressedSize||t.uncompressedSize)&&(t.signature!=e.signature||t.compressedSize!=e.compressedSize||t.uncompressedSize!=e.uncompressedSize)&&wf("mismatched local file header (signature or sizes)")}function wf(e){let t=new Error(eRe);throw t.reason=e,t}function Pa(e,t,n){return t[n]===St?e.options[n]:t[n]}function MFt(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 nie(e){return new Date(Number(e/BigInt(1e4)-BigInt(116444736e5)))}function SA(e,t){return e.getUint8(t)}function Da(e,t){return e.getUint16(t,!0)}function br(e,t){return e.getUint32(t,!0)}function Ug(e,t){return Number(e.getBigUint64(t,!0))}function fo(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}var mRe="File already exists",Eie="Zip file comment exceeds 64KB",pRe="File entry comment exceeds 64KB",gRe="File entry name exceeds 64KB",Sie="Version exceeds 65535",_Re="The strength must equal 1, 2, or 3",yRe="Extra field type exceeds 65535",ZG="Extra field data exceeds 64KB",jFt="Compression method not supported",ARe=-2147483648,bRe=2147483647,QG="Zip64 is not supported (set the 'zip64' option to 'true')",xRe="Undefined uncompressed size",TRe="Undefined reader",CRe="Zip file not empty",HFt="Invalid uid (must be integer 0..2^32-1)",GFt="Invalid gid (must be integer 0..2^32-1)",WFt="Invalid UNIX mode (must be integer 0..65535)",qFt="Invalid unixExtraFieldType (must be 'infozip' or 'unix')",YFt="uid/gid must be 0..65535 for unixExtraFieldType 'unix' (use 'infozip' for larger ids)",XFt="Invalid msdosAttributesRaw (must be integer 0..255)",KFt="Invalid msdosAttributes (must be an object with boolean flags)",sRe=new Uint8Array([7,0,2,0,65,69,3,0,0]),Cie="infozip",vie="unix",xie=0,cRe=[],pO=class{constructor(t,n={}){t=new sw(t);let i=t.availableSize!==St&&t.availableSize>0&&t.availableSize!==rT&&t.maxSize!==St&&t.maxSize>0&&t.maxSize!==rT;Object.assign(this,{writer:t,addSplitZipSignature:i,options:n,config:FR(),files:new Map,filenames:new Set,offset:n[iO]===St?t.size||t.writable.size||0:n[iO],initialOffset:n[iO]===St?0:n[iO]-(t.size||t.writable.size||0),pendingAddFileCalls:new Set,bufferedWrites:0,lastFileEntry:St})}async prependZip(t){if(this.filenames.size)throw new Error(CRe);t=new sT(t),await Sf(t);let n=new lT(t.readable),i=await n.getEntries();await n.close(),await Sf(this.writer),await t.readable.pipeTo(this.writer.writable,{preventClose:!0,preventAbort:!0}),this.writer.size=this.offset=t.size,this.filenames=new Set(i.map(r=>r.filename)),this.files=new Map(i.map(r=>{let{version:o,rawLastModDate:a,lastAccessDate:s,creationDate:c,rawFilename:u,bitFlag:f,encrypted:d,uncompressedSize:p,compressedSize:g,diskOffset:m,diskNumber:y,zip64:A}=r,{compressionMethod:b,rawExtraFieldZip64:x,rawExtraFieldAES:T,rawExtraFieldExtendedTimestamp:C,rawExtraFieldNTFS:E,rawExtraFieldUnix:w,rawExtraField:D}=r,{level:R,languageEncodingFlag:M,dataDescriptor:N}=f;x=x||Gi,T=T||Gi,C=C||Gi,E=E||Gi,w=w||Gi,D=D||Gi,r.extraFieldAES&&(b=99);let _=Nr(x,T,C,E,w,D),v=A&&p>=4294967295,S=A&&g>=4294967295,P=SRe(R,M,N,d,b)&-7|R<<1,{headerArray:L,headerView:F}=ERe({version:o,bitFlag:P,compressionMethod:b,uncompressedSize:p,compressedSize:g,rawLastModDate:a,rawFilename:u,zip64CompressedSize:S,zip64UncompressedSize:v,extraFieldLength:_}),{signature:V}=r;return V!==St&&wc(F,10,V),Object.assign(r,{zip64UncompressedSize:v,zip64CompressedSize:S,zip64Offset:A&&this.offset-m>=4294967295,zip64DiskNumberStart:A&&y>=65535,rawExtraFieldZip64:x,rawExtraFieldAES:T,rawExtraFieldExtendedTimestamp:C,rawExtraFieldNTFS:E,rawExtraFieldUnix:w,rawExtraField:D,extendedTimestamp:C.length>0||E.length>0,extraFieldExtendedTimestampFlag:1+(s?2:0)+(c?4:0),headerArray:L,headerView:F}),[r.filename,r]}))}async add(t="",n,i={}){let r=this;i=Object.assign({},i);let{pendingAddFileCalls:o,config:a}=r;xie<a.maxWorkers?xie++:await new Promise(u=>cRe.push(u));let s,c;try{if(t=t.trim(),hi(r,i,lw)&&!t.endsWith("/")&&(t+="/"),r.filenames.has(t))throw new Error(mRe);return r.filenames.add(t),c=!0,s=$Ft(r,t,n,i),o.add(s),await s}catch(u){throw c&&r.filenames.delete(t),u}finally{o.delete(s);let u=cRe.shift();u?u():xie--}}remove(t){let{filenames:n,files:i}=this;if(typeof t=="string"&&(t=i.get(t)),t&&t.filename!==St){let{filename:r}=t;if(n.has(r)&&i.has(r))return n.delete(r),i.delete(r),!0}return!1}async close(t=Gi,n={}){let i=this,{pendingAddFileCalls:r,writer:o}=this,{writable:a}=o;if(Nr(t)>65535)throw new Error(Eie);for(;r.size;)await Promise.allSettled(Array.from(r));return await sBt(i,t,n),hi(i,n,NG)||await a.getWriter().close(),o.getData?o.getData():a}};async function $Ft(e,t,n,i){let r=JFt(e,t,i);({name:t}=r);let o=ZFt(e,t,i),{comment:a}=o,s=i[wG];e.files.set(t,St);let c;try{let u=await QFt(e,n,o,i);({reader:n}=u);let{diskOffset:f,diskNumber:d}=e.writer;i=Object.assign({},i,r.resolvedOptions,o.resolvedOptions,u.resolvedOptions,{internalFileAttribute:o.resolvedOptions.internalFileAttributes,externalFileAttribute:r.resolvedOptions.externalFileAttributes,signature:i[Xne],offset:e.offset-f,diskNumberStart:d});let p=nBt(i),g=rBt(i),m=Nr(p.localHeaderArray,g.dataDescriptorArray);c=await eBt(e,t,n,{headerInfo:p,dataDescriptorInfo:g,metadataSize:m},i)}catch(u){throw e.files.delete(t),u}return Object.assign(c,{name:t,comment:a,extraField:s}),new EA(c)}function JFt(e,t,n){t=t.trim();let i=hi(e,n,Vne),r=hi(e,n,Gne,i?20:768),o=hi(e,n,qne),a=hi(e,n,"uid"),s=hi(e,n,"gid"),c=hi(e,n,Kne),u=hi(e,n,M1e),f=hi(e,n,$ne),d=hi(e,n,Jne),p=hi(e,n,Zne);if(a!==St&&(a<0||a>4294967295))throw new Error(HFt);if(s!==St&&(s<0||s>4294967295))throw new Error(GFt);if(c!==St&&(c<0||c>65535))throw new Error(WFt);if(u!==St&&u!==Cie&&u!==vie)throw new Error(qFt);if(u===vie&&(a!==St&&a>65535||s!==St&&s>65535))throw new Error(YFt);u===St&&(a!==St||s!==St)&&(u=Cie);let g=hi(e,n,zne),m=hi(e,n,Une),y=a!==St||s!==St||c!==St||u,A=g!==St||m!==St;if(y?(i=!1,r=r&65535|768):A&&(i=!0,r=r&255),g!==St&&(g<0||g>255))throw new Error(XFt);if(m&&typeof m!==CDe)throw new Error(KFt);if(r>65535)throw new Error(Sie);let b=hi(e,n,kne,0);!n[lw]&&t.endsWith("/")&&(n[lw]=!0);let x=hi(e,n,lw);x?(t.endsWith("/")||(t+="/"),b===0&&(b=16,i||(b|=16877<<16))):!i&&b===0&&(o?b=493<<16:b=420<<16);let T;return i||(T=b>>16&65535,c=c===St?T:c&65535,f?c|=2048:f=!!(c&2048),d?c|=1024:d=!!(c&1024),p?c|=512:p=!!(c&512),x&&(c|=16384),b=(c&65535)<<16|b&255),{msdosAttributesRaw:g,msdosAttributes:m}=iBt(g,m),A&&(b=b&4294967295|g&255),{name:t,resolvedOptions:{versionMadeBy:r,msDosCompatible:i,externalFileAttributes:b,unixExternalUpper:T,uid:a,gid:s,unixMode:c,unixExtraFieldType:u,setuid:f,setgid:d,sticky:p,msdosAttributesRaw:g,msdosAttributes:m}}}function ZFt(e,t,n){let i=hi(e,n,R1e,QS),r=i(t);if(r===St&&(r=QS(t)),Nr(r)>65535)throw new Error(gRe);let o=n[QR]||"",a=i(o);if(a===St&&(a=QS(o)),Nr(a)>65535)throw new Error(pRe);let s=hi(e,n,Hne,20);if(s>65535)throw new Error(Sie);let c=hi(e,n,cw,new Date),u=hi(e,n,tO),f=hi(e,n,nO),d=hi(e,n,Bne,0),p=hi(e,n,DG),g,m;p||(g=hi(e,n,IG),m=hi(e,n,PG));let y=hi(e,n,x1e,3),A=hi(e,n,Wne),b=hi(e,n,T1e,!0),x=hi(e,n,C1e,!0),T=hi(e,n,OG),C=hi(e,n,LG,!0),E=hi(e,n,E1e),w=hi(e,n,S1e),D=hi(e,n,w1e,!0),R=hi(e,n,RG),M=hi(e,n,I1e,!0),N=hi(e,n,Yne);if(!p&&N!==St&&N!==0&&N!==8)throw new Error(jFt);let _=hi(e,n,v1e),v=hi(e,n,MG),S=hi(e,n,P1e);E&&S===St&&(S=!1),(S===St||A)&&(S=!0),_!==St&&_!=6&&(v=!1),!v&&e.config.CompressionStream===St&&e.config.CompressionStreamZlib===St&&(_=0);let P=hi(e,n,SG);if(!A&&(g!==St||m!==St)&&!(y>=1&&y<=3))throw new Error(_Re);let L=Gi,F=n[wG];if(F){let V=0,z=0;F.forEach(B=>V+=4+Nr(B)),L=new Uint8Array(V);let j=Zp(L);F.forEach((B,G)=>{if(G>65535)throw new Error(yRe);if(Nr(B)>65535)throw new Error(ZG);Vg(j,z,G),Vg(j,z+2,Nr(B)),_O(L,B,z+4),z+=4+Nr(B)})}return{comment:o,resolvedOptions:{rawFilename:r,rawComment:a,version:s,lastModDate:c,lastAccessDate:u,creationDate:f,internalFileAttributes:d,passThrough:p,password:g,rawPassword:m,encryptionStrength:y,zipCrypto:A,extendedTimestamp:b,keepOrder:x,useWebWorkers:T,transferStreams:C,bufferedWrite:E,createTempStream:w,dataDescriptorSignature:D,signal:R,useUnicodeFileNames:M,compressionMethod:N,level:_,useCompressionStream:v,dataDescriptor:S,zip64:P,rawExtraField:L}}}async function QFt(e,t,{resolvedOptions:n},i){let{passThrough:r,zipCrypto:o,password:a,rawPassword:s,encryptionStrength:c}=n,{dataDescriptor:u,zip64:f,level:d,compressionMethod:p}=n,g=0,m=0;if(r){if(!t)throw new Error(TRe);if(m=i[eO],m===St)throw new Error(xRe)}let y=f===!0,A=hi(e,i,jne),b=!!t&&(!!(a&&Nr(a)||s&&Nr(s))||r&&A);t||(d=0,p=0);let x=b?o?12:16+c*4:0;t&&(t=new sT(t),await Sf(t),r?(i.uncompressedSize=m,g=hRe(m)+x):t.size===St?(u=!0,(f||f===St)&&(f=!0,m=g=4294967296)):(i.uncompressedSize=m=t.size,g=hRe(m)+x));let T=y||m>=4294967295,C=y||g>=4294967295;if(T||C){if(f===!1)throw new Error(QG);f=!0}return f=f||!1,{reader:t,resolvedOptions:{dataDescriptor:u,zip64:f,zip64UncompressedSize:T,zip64CompressedSize:C,uncompressedSize:m,level:d,compressionMethod:p,encrypted:b}}}async function eBt(e,t,n,i,r){let{files:o,writer:a}=e,{keepOrder:s,dataDescriptor:c,signal:u}=r,{headerInfo:f}=i,d=e.options[O1e],p=e.lastFileEntry,g={},m,y,A,b,x,T,C=0,E;o.set(t,g),e.lastFileEntry=g;try{let M;s&&(M=p&&p.lock,w()),r.bufferedWrite||!s||e.writerLocked||e.bufferedWrites||!c?(m=!0,e.bufferedWrites++,r.createTempStream?E=await r.createTempStream():E=new TransformStream(St,St,{highWaterMark:rT}),E.size=0,await Sf(a)):(E=a,await D()),await Sf(E);let{diskOffset:N}=a;if(e.addSplitZipSignature){delete e.addSplitZipSignature;let P=new Uint8Array(4),L=Zp(P);wc(L,0,134695760),await am(a,P),e.offset+=4}d&&!m&&lRe(i,e.offset-N);let{localHeaderArray:_}=f;m||(await M,await R());let v=a.diskNumber,S=fRe(e,a);if(g.diskNumberStart=v,m||(x=!0,T=a.size,await am(E,_)),g=await tBt(n,E,g,i,e.config,r),m||(x=!1),o.set(t,g),g.filename=t,m){if(await Promise.all([E.writable.getWriter().close(),M]),await D(),b=!0,T=a.size,await R(),g.diskNumberStart=a.diskNumber,g.offset=fRe(e,a),d){let P=i.metadataSize;lRe(i,e.offset-a.diskOffset),g.size+=i.metadataSize-P}aBt(g,f.localHeaderView,r),await am(a,f.localHeaderArray),await fBt(E.readable,a,u,P=>C+=P),a.size+=E.size,b=!1}else g.diskNumberStart=v,g.offset=S;return e.offset+=g.size,g}catch(M){if(b||x){if(e.hasCorruptedEntries=!0,M)try{M.corruptedEntry=!0}catch{}e.offset+=a.size-T,m&&(e.offset+=C)}throw o.delete(t),M}finally{if(m&&e.bufferedWrites--,A&&A(),y&&y(),m&&E&&E.dispose)try{await E.dispose()}catch{}}function w(){g.lock=new Promise(M=>A=M)}async function D(){e.writerLocked=!0;let{lockWriter:M}=e;e.lockWriter=new Promise(N=>y=()=>{e.writerLocked=!1,N()}),await M}async function R(){Nr(f.localHeaderArray)>a.availableSize&&(a.availableSize=0,await am(a,Gi))}}async function tBt(e,t,{diskNumberStart:n,lock:i},r,o,a){let{headerInfo:s,dataDescriptorInfo:c,metadataSize:u}=r,{headerArray:f,headerView:d,lastModDate:p,rawLastModDate:g,encrypted:m,compressed:y,version:A,compressionMethod:b,rawExtraFieldZip64:x,localExtraFieldZip64Length:T,rawExtraFieldExtendedTimestamp:C,extraFieldExtendedTimestampFlag:E,rawExtraFieldNTFS:w,rawExtraFieldUnix:D,rawExtraFieldAES:R}=s,{dataDescriptorArray:M}=c,{rawFilename:N,lastAccessDate:_,creationDate:v,password:S,rawPassword:P,level:L,zip64:F,zip64UncompressedSize:V,zip64CompressedSize:z,zipCrypto:j,dataDescriptor:B,directory:G,executable:W,versionMadeBy:Q,rawComment:q,rawExtraField:J,useWebWorkers:Z,transferStreams:ce,onstart:Ae,onprogress:le,onend:Ce,signal:ye,encryptionStrength:ve,extendedTimestamp:Ie,msDosCompatible:Le,internalFileAttributes:$e,externalFileAttributes:Ye,uid:yt,gid:Ke,unixMode:we,setuid:We,setgid:Ct,sticky:ct,unixExternalUpper:dn,msdosAttributesRaw:Ht,msdosAttributes:bt,useCompressionStream:Dt,passThrough:In}=a,rt={lock:i,versionMadeBy:Q,zip64:F,directory:!!G,executable:!!W,filenameUTF8:!0,rawFilename:N,commentUTF8:!0,rawComment:q,rawExtraFieldZip64:x,localExtraFieldZip64Length:T,rawExtraFieldExtendedTimestamp:C,rawExtraFieldNTFS:w,rawExtraFieldUnix:D,rawExtraFieldAES:R,rawExtraField:J,extendedTimestamp:Ie,msDosCompatible:Le,internalFileAttributes:$e,externalFileAttributes:Ye,diskNumberStart:n,uid:yt,gid:Ke,unixMode:we,setuid:We,setgid:Ct,sticky:ct,unixExternalUpper:dn,msdosAttributesRaw:Ht,msdosAttributes:bt},{signature:dt,uncompressedSize:vi}=a,wn=0;In||(vi=0);let{writable:Mi}=t;if(e){let lr=e.createReadable?e.createReadable({chunkSize:ZS(o)}):e.readable,Li=e.size,Wi={options:{codecType:nw,level:L,rawPassword:P,password:S,encryptionStrength:ve,zipCrypto:m&&j,passwordVerification:m&&j&&g>>8&255,signed:!In,compressed:y&&!In,encrypted:m&&!In,useWebWorkers:Z,useCompressionStream:Dt,transferStreams:ce},config:o,streamOptions:{signal:ye,size:Li,onstart:Ae,onprogress:le,onend:Ce}};try{let ri=await TG({readable:lr,writable:Mi},Wi);if(wn=ri.outputSize,t.size+=wn,In||(vi=ri.inputSize,dt=ri.signature),!z&&wn>=4294967295||!V&&vi>=4294967295)throw new Error(QG)}catch(ri){throw ri.outputSize!==St&&(t.size+=ri.outputSize),ri}}return oBt({signature:dt,compressedSize:wn,uncompressedSize:vi,headerInfo:s,dataDescriptorInfo:c},a),B&&await am(t,M),Object.assign(rt,{uncompressedSize:vi,compressedSize:wn,lastModDate:p,rawLastModDate:g,creationDate:v,lastAccessDate:_,encrypted:m,zipCrypto:j,size:u+wn,compressionMethod:b,version:A,headerArray:f,headerView:d,signature:dt,extraFieldExtendedTimestampFlag:E,zip64UncompressedSize:V,zip64CompressedSize:z}),rt}function nBt(e){let{rawFilename:t,lastModDate:n,lastAccessDate:i,creationDate:r,level:o,zip64:a,zipCrypto:s,useUnicodeFileNames:c,dataDescriptor:u,directory:f,rawExtraField:d,encryptionStrength:p,extendedTimestamp:g,passThrough:m,encrypted:y,zip64UncompressedSize:A,zip64CompressedSize:b,uncompressedSize:x}=e,{version:T,compressionMethod:C}=e,E=!f&&(C===St?o===St||o>0:C!==0),w,D=m||!E,R=a&&(e.bufferedWrite||!u||!A&&!b||D),M=R||a&&u&&(A||b);if(a&&(A||b)){let q=Wd(20);if(q.uint16(1),q.uint16(16),w=q.array,R&&(q.uint64(x),D)){let J=y?s?12:16+p*4:0;q.uint64(m?0:x+J)}}else w=Gi;let N;if(y&&!s){let Q=Wd(Nr(sRe)+2);Q.uint16(39169),Q.bytes(sRe),N=Q.array,N[8]=p}else N=Gi;let _,v,S;if(g){let Q=$G(n);if(vRe(Q)){let q=9+(i?4:0)+(r?4:0),J=Wd(q);S=1+(i?2:0)+(r?4:0),J.uint16(21589),J.uint16(q-4),J.uint8(S),J.uint32(Q),i&&J.uint32(dRe($G(i))),r&&J.uint32(dRe($G(r))),v=J.array}else v=Gi;try{let q=Tie(n),J=Wd(36);J.uint16(10),J.uint16(32),J.skip(4),J.uint16(1),J.uint16(24),J.uint64(q),J.uint64(Tie(i)||q),J.uint64(Tie(r)||q),_=J.array}catch{_=Gi}}else _=v=Gi;let P;try{let{uid:Q,gid:q,unixExtraFieldType:J}=e;if(J==Cie&&(Q!==St||q!==St)){let Z=uRe(Q),ce=uRe(q),Ae=3+Z.length+ce.length,le=Wd(4+Ae);le.uint16(30837),le.uint16(Ae),le.uint8(1),le.uint8(Z.length),le.bytes(Z),le.uint8(ce.length),le.bytes(ce),P=le.array}else if(J==vie&&(Q!==St||q!==St)){let Z=Wd(8);Z.uint16(30805),Z.uint16(4),Z.uint16((Q===St?0:Q)&65535),Z.uint16((q===St?0:q)&65535),P=Z.array}else P=Gi}catch{P=Gi}C===St&&(C=E?8:0),a&&(T=T>45?T:45),y&&!s&&(T=T>51?T:51,N[9]=C,C=99);let L=M?Nr(w):0,F=L+Nr(N,v,_,P,d);if(F>65535)throw new Error(ZG);let{headerArray:V,headerView:z,rawLastModDate:j}=ERe({version:T,bitFlag:SRe(o,c,u,y,C),compressionMethod:C,uncompressedSize:x,lastModDate:n<gne?gne:n>pne?pne:n,rawFilename:t,zip64CompressedSize:b,zip64UncompressedSize:A,extraFieldLength:F}),B=Wd(30+Nr(t)+F),G=B.array,W=Zp(G);return B.uint32(67324752),B.bytes(V),B.bytes(t),M&&B.bytes(w),B.bytes(N),B.bytes(v),B.bytes(_),B.bytes(P),B.bytes(d),u&&(b||wc(W,18,0),A||wc(W,22,0)),{localHeaderArray:G,localHeaderView:W,headerArray:V,headerView:z,lastModDate:n,rawLastModDate:j,encrypted:y,compressed:E,version:T,compressionMethod:C,extraFieldExtendedTimestampFlag:S,rawExtraFieldZip64:Gi,localExtraFieldZip64Length:L,rawExtraFieldExtendedTimestamp:v,rawExtraFieldNTFS:_,rawExtraFieldUnix:P,rawExtraFieldAES:N,extraFieldLength:F}}function lRe(e,t){let{headerInfo:n}=e,{localHeaderArray:i,extraFieldLength:r}=n,o=64-(t+Nr(i))%64;o<4&&(o+=64);let a=new Uint8Array(o),s=Zp(a);Vg(s,0,6534),Vg(s,2,o-4);let c=i;n.localHeaderArray=i=new Uint8Array(Nr(c)+o),_O(i,c),_O(i,a,Nr(c));let u=Zp(i);Vg(u,28,r+o),n.localHeaderView=u,e.metadataSize+=o}function uRe(e){if(e===St)return Gi;{let t=new Uint8Array(4);Zp(t).setUint32(0,e,!0);let i=4;for(;i>1&&t[i-1]===0;)i--;return t.subarray(0,i)}}function iBt(e,t){if(e!==St)e=e&255;else if(t!==St){let{readOnly:n,hidden:i,system:r,directory:o,archive:a}=t,s=0;n&&(s|=1),i&&(s|=2),r&&(s|=4),o&&(s|=16),a&&(s|=32),e=s&255}return t===St&&(t={readOnly:!!(e&1),hidden:!!(e&2),system:!!(e&4),directory:!!(e&16),archive:!!(e&32)}),{msdosAttributesRaw:e,msdosAttributes:t}}function rBt({zip64:e,dataDescriptor:t,dataDescriptorSignature:n}){let i=Gi,r,o=0,a=e?20:12;return n&&(a+=4),t&&(i=new Uint8Array(a),r=Zp(i),n&&(o=4,wc(r,0,134695760))),{dataDescriptorArray:i,dataDescriptorView:r,dataDescriptorOffset:o}}function oBt({signature:e,compressedSize:t,uncompressedSize:n,headerInfo:i,dataDescriptorInfo:r},{zip64:o,zipCrypto:a,dataDescriptor:s}){let{headerView:c,encrypted:u}=i,{dataDescriptorView:f,dataDescriptorOffset:d}=r;(!u||a)&&e!==St&&(wc(c,10,e),s&&wc(f,d,e)),o?s&&(gO(f,d+4,BigInt(t)),gO(f,d+12,BigInt(n))):(wc(c,14,t),wc(c,18,n),s&&(wc(f,d+4,t),wc(f,d+8,n)))}function aBt({rawFilename:e,encrypted:t,zip64:n,localExtraFieldZip64Length:i,signature:r,compressedSize:o,uncompressedSize:a,zip64UncompressedSize:s,zip64CompressedSize:c},u,{dataDescriptor:f}){if(f||(t||wc(u,14,r),c||wc(u,18,o),s||wc(u,22,a)),n&&i){let d=30+Nr(e)+4;gO(u,d,BigInt(a)),gO(u,d+8,BigInt(o))}}async function sBt(e,t,n){let i=cBt(e.files),{cdStartDiskNumber:r,cdStartDiskOffset:o}=await lBt(e,i,n);await uBt(e,t,n,{cdStartDiskNumber:r,cdStartDiskOffset:o,directoryDataLength:i})}function cBt(e){let t=0;for(let[,n]of e){let{rawFilename:i,rawExtraFieldAES:r,rawComment:o,rawExtraFieldNTFS:a,rawExtraFieldUnix:s,rawExtraField:c,extendedTimestamp:u,extraFieldExtendedTimestampFlag:f,lastModDate:d,zip64UncompressedSize:p,zip64CompressedSize:g,uncompressedSize:m,compressedSize:y}=n,A=n.offset>=4294967295,b=n.diskNumberStart>=65535,x;if(A||b||p||g){let w=4+(p?8:0)+(g?8:0)+(A?8:0)+(b?4:0),D=Wd(w);D.uint16(1),D.uint16(w-4),p&&D.uint64(m),g&&D.uint64(y),A&&D.uint64(n.offset),b&&D.uint32(n.diskNumberStart),x=D.array}else x=Gi;n.rawExtraFieldZip64=x,n.zip64Offset=A,n.zip64DiskNumberStart=b;let T,C=$G(d);if(u&&vRe(C)){let w=Wd(9);w.uint16(21589),w.uint16(5),w.uint8(f),w.uint32(C),T=w.array}else T=Gi;n.rawExtraFieldExtendedTimestamp=T;let E=Nr(x,r,a,s,T,c);if(E>65535)throw new Error(ZG);t+=46+Nr(i,o)+E}return t}async function lBt(e,t,n){let{files:i,writer:r}=e,o=new Uint8Array(t);await Sf(r);let a=0,s=0,c=r.diskNumber,u=r.diskOffset;for(let[f,d]of Array.from(i.values()).entries()){let{offset:p,rawFilename:g,rawExtraFieldZip64:m,rawExtraFieldAES:y,rawExtraFieldExtendedTimestamp:A,rawExtraFieldNTFS:b,rawExtraFieldUnix:x,rawExtraField:T,rawComment:C,versionMadeBy:E,headerArray:w,headerView:D,zip64UncompressedSize:R,zip64CompressedSize:M,zip64DiskNumberStart:N,zip64Offset:_,internalFileAttributes:v,externalFileAttributes:S,diskNumberStart:P,uncompressedSize:L,compressedSize:F}=d,V=Nr(m,y,A,b,x,T),z=46+Nr(g,C)+V;a+z-s>r.availableSize&&(await am(r,o.slice(s,a)),s=a,r.availableSize=0,await am(r,Gi)),f==0&&(c=r.diskNumber,u=r.diskOffset),R||wc(D,18,L),M||wc(D,14,F),(_||N)&&d.version<45&&Vg(D,0,45);let j=Wd(z);if(j.uint32(33639248),j.uint16(E),j.bytes(w.subarray(0,24)),j.uint16(V),j.uint16(Nr(C)),j.uint16(N?65535:P),j.uint16(v),j.uint32(S),j.uint32(_?4294967295:p),j.bytes(g),j.bytes(m),j.bytes(y),j.bytes(A),j.bytes(b),j.bytes(x),j.bytes(T),j.bytes(C),_O(o,j.array,a),a+=z,n.onprogress)try{await n.onprogress(f+1,i.size,new EA(d))}catch{}}return await am(r,s?o.slice(s):o),{cdStartDiskNumber:c,cdStartDiskOffset:u}}async function uBt(e,t,n,i){let{writer:r}=e,{cdStartDiskNumber:o,cdStartDiskOffset:a}=i,{directoryDataLength:s}=i,c=e.files.size,u=o,f=e.offset-a-(o?e.initialOffset:0),d=r.diskNumber;r.availableSize<22&&d++;let p=hi(e,n,SG);if(f>=4294967295||s>=4294967295||c>=65535||d>=65535){if(p===!1)throw new Error(QG);p=!0}let g=Nr(t);if(g>65535)throw new Error(Eie);let m=Wd(p?98:22);Nr(m.array)+g>r.availableSize&&(r.availableSize=0,await am(r,Gi)),d=r.diskNumber,p&&(m.uint32(101075792),m.uint64(44),m.uint16(45),m.uint16(45),m.uint32(d),m.uint32(u),m.uint64(c),m.uint64(c),m.uint64(s),m.uint64(f),m.uint32(117853008),m.uint32(d),m.uint64(BigInt(e.offset)+BigInt(s)-BigInt(r.diskOffset)-BigInt(r.diskNumber?e.initialOffset:0)),m.uint32(d+1),hi(e,n,D1e,!0)&&(d=65535,u=65535),c=65535,f=4294967295,s=4294967295),m.uint32(101010256),m.uint16(d),m.uint16(u),m.uint16(c),m.uint16(c),m.uint32(s),m.uint32(f),m.uint16(g),await am(r,m.array),g&&await am(r,t)}function Wd(e){let t=new Uint8Array(e),n=Zp(t),i=0;return{array:t,uint8:r=>{dBt(n,i,r),i+=1},uint16:r=>{Vg(n,i,r),i+=2},uint32:r=>{wc(n,i,r),i+=4},uint64:r=>{gO(n,i,BigInt(r)),i+=8},bytes:r=>{_O(t,r,i),i+=Nr(r)},skip:r=>i+=r}}function fRe(e,t){return e.offset-t.diskOffset-(t.diskNumber?e.initialOffset:0)}async function am(e,t){let{writable:n}=e,i=n.getWriter();try{await i.ready,e.size+=Nr(t),await i.write(t)}finally{i.releaseLock()}}async function fBt(e,t,n,i){let r=t.writable.getWriter();try{await e.pipeTo(new WritableStream({async write(o){await r.ready,await r.write(o),i(Nr(o))}}),{preventClose:!0,preventAbort:!0,signal:n})}finally{r.releaseLock()}}function Tie(e){if(e)return(BigInt(e.getTime())+BigInt(116444736e5))*BigInt(1e4)}function $G(e){return Math.floor(e.getTime()/1e3)}function vRe(e){return e>=ARe&&e<=bRe}function dRe(e){return Math.min(bRe,Math.max(ARe,e))}function hi(e,t,n,i){let r=t[n]===St?e.options[n]:t[n];return r===St?i:r}function hRe(e){return e+5*(Math.floor(e/16383)+1)}function dBt(e,t,n){e.setUint8(t,n)}function Vg(e,t,n){e.setUint16(t,n,!0)}function wc(e,t,n){e.setUint32(t,n,!0)}function gO(e,t,n){e.setBigUint64(t,n,!0)}function _O(e,t,n){e.set(t,n)}function Zp(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Nr(...e){let t=0;return e.forEach(n=>n&&(t+=n.length)),t}function ERe({version:e,bitFlag:t,compressionMethod:n,uncompressedSize:i,compressedSize:r,lastModDate:o,rawLastModDate:a,rawFilename:s,zip64CompressedSize:c,zip64UncompressedSize:u,extraFieldLength:f}){let d=Wd(26),p=d.array,g=Zp(p);if(d.uint16(e),d.uint16(t),d.uint16(n),a===St){let m=new Uint32Array(1),y=Zp(m);Vg(y,0,(o.getHours()<<6|o.getMinutes())<<5|o.getSeconds()/2),Vg(y,2,(o.getFullYear()-1980<<4|o.getMonth()+1)<<5|o.getDate()),a=m[0]}return d.uint32(a),d.skip(4),c||r!==St?d.uint32(c?4294967295:r):d.skip(4),u||i!==St?d.uint32(u?4294967295:i):d.skip(4),d.uint16(Nr(s)),d.uint16(f),{headerArray:p,headerView:g,rawLastModDate:a}}function SRe(e,t,n,i,r){let o=0;return t&&(o=o|2048),n&&(o=o|8),(r==8||r==9)&&(e>=0&&e<=3&&(o=o|6),e>3&&e<=5&&(o=o|4),e==9&&(o=o|2)),i&&(o=o|1),o}var eir=1024*1024;var nir=1024*1024;var rir=1024*1024;var oir=512*1024;try{Xp({baseURI:import.meta.url})}catch{}var hBt=[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],mBt=[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],pBt=[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],gBt=[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],_Bt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],AO=new Uint8Array(288);AO.fill(8,0,144),AO.fill(9,144,256),AO.fill(7,256,280),AO.fill(8,280,288);var yBt=new Uint8Array(30).fill(5);function yO(e){let t=new Uint16Array(16);for(let r of e)t[r]++;t[0]=0;let n=new Uint16Array(17);for(let r=1;15>=r;r++)n[r+1]=n[r]+t[r];let i=new Uint16Array(e.length);for(let r=0;r<e.length;r++)e[r]&&(i[n[e[r]]++]=r);return{t,symbols:i}}var If="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function wRe(e){let t;e({wasmURI:()=>(t||(t="data:application/wasm;base64,"+(n=>{let i="",r=n.length,o=0;for(;r>o+2;o+=3){let s=n[o]<<16|n[o+1]<<8|n[o+2];i+=If[s>>18&63]+If[s>>12&63]+If[s>>6&63]+If[63&s]}let a=r-o;if(a===1){let s=n[o]<<16;i+=If[s>>18&63]+If[s>>12&63]+"=="}else if(a===2){let s=n[o]<<16|n[o+1]<<8;i+=If[s>>18&63]+If[s>>12&63]+If[s>>6&63]+"="}return i})((n=>{let i=0,r=0,o=0,a=new Uint8Array(1024),s=0,c=0;for(;!c;){c=f(1);let A=f(2);if(A==0)d();else if(A==1)p(yO(AO),yO(yBt));else{if(A!=2)throw Error("invalid deflate block type");p(...g())}}return a.subarray(0,s);function u(){if(i>=n.length)throw Error("unexpected end of deflate data");return n[i++]}function f(A){for(;A>o;)r|=u()<<o,o+=8;let b=r&(1<<A)-1;return r>>>=A,o-=A,b}function d(){r=0,o=0;let A=u()|u()<<8;i+=2,y(s+A);for(let b=0;A>b;b++)a[s++]=u()}function p(A,b){let x=m(A);for(;x!=256;){if(256>x)y(s+1),a[s++]=x;else{let T=x-257,C=hBt[T]+f(mBt[T]),E=m(b),w=pBt[E]+f(gBt[E]);y(s+C);let D=s-w;for(let R=0;C>R;R++)a[s++]=a[D+R]}x=m(A)}}function g(){let A=f(5)+257,b=f(5)+1,x=f(4)+4,T=new Uint8Array(19);for(let D=0;x>D;D++)T[_Bt[D]]=f(3);let C=yO(T),E=new Uint8Array(A+b),w=0;for(;w<E.length;){let D=m(C);if(16>D)E[w++]=D;else if(D==16){let R=E[w-1],M=f(2)+3;for(;M--;)E[w++]=R}else w+=D==17?f(3)+3:f(7)+11}return[yO(E.subarray(0,A)),yO(E.subarray(A))]}function m(A){let{t:b,symbols:x}=A,T=0,C=0,E=0;for(let w=1;15>=w;w++){T|=f(1);let D=b[w];if(D>T-C)return x[E+(T-C)];E+=D,C=C+D<<1,T<<=1}throw Error("invalid huffman code")}function y(A){if(a.length<A){let b=2*a.length;for(;A>b;)b*=2;let x=new Uint8Array(b);x.set(a.subarray(0,s)),a=x}}})((n=>{let i=(n=(n+"").replace(/[^A-Za-z0-9+/=]/g,"")).length,r=[];for(let o=0;i>o;o+=4){let a=If.indexOf(n[o])<<18|If.indexOf(n[o+1])<<12|(63&If.indexOf(n[o+2]))<<6|63&If.indexOf(n[o+3]);r.push(a>>16&255),n[o+2]!=="="&&r.push(a>>8&255),n[o+3]!=="="&&r.push(255&a)}return new Uint8Array(r)})("zb19kF3XcSd2vu7He/fdmTvAABzigUTfK0gaSxiBkqghRarWc2jODIcgBCXRH/6DVSQEDkXcBwJ8M08Q5ZX5hp+mbUnLcqlcjEsbY72qWOVIFVWFu6GztEXb9Fq70Wa5iVKljVUp1WYrqz82tXJKteVKKUT46z73fQwGIEhq7XAKfOd+ndOnT5/uPn26+6jT249qpZS+t/OgGQ718EGN/5nhUD1oh+GGFNWDSj2o9PDBeMj/6eGDyXBUdEN+RT+hh/YTd8baGe2SRCudqpbGf0qpVGltrLa2FWUqUq7tXNtEURRp5axyShkXWxfpx3S7HcVaP2WeMnGqh9pf+u0oS37DHY4f3Xz0wtYXjOqcPf/wudODzY8/cH7z8yqZG12ePX928MDW6c+rNJ+6p9rF6PqxrQtnNre3VTauZfP8Q2rm4Ojy3OntwQNnLpzf/tyjmw+p2Sw8kMaar6Teopi85Kbn5qZuffZXzj6m9s0290atj2rlxg80V7vbfmhzsu3mitveX0xectvzc1O3uO0Ds829pu2Do1rR9oJ7eGtzU5kDzc1dIMSPnj537sIZpTOu9Ozpc2d/ZVOpGx944Oz5h85ubZ4ZPPDw586fGZy9cP6BwenPnNvU6sYHNh/dPrN19rHB5vkHtgenz/Qe2NrcHlzY2lTR4SsefXZz8MCZz21tbZ4fqLh64IEzj59+4Oz5M1ubj26eHzyw+fiZzce48q3Nh89c+Nz5gbq9NauV11lLHep2bvj4LR9dbv/9PzF3GpV95/06G75H+aJXtY8qs3LlHyn/U33SrfhnDiwaVVlfkPJZ7f/a9lHY6FaxtxcrdbHS3vYdvtB+uO11n1RdGW8HlfbfPFBXivSieelApRdNWkVrXCNZ/wSZz/eXjerojCJSy6ZDiqJlk2akfVqXijRxLcbbrWXjcFlXGpU5r3Gnk2UU+y8xeOnJXJMGFN6QwkeKTG+LNKlB/xGAOKgUg2NIMThqNzj68/3KjgAyAMgEgBTFAQhFcV054vo0xb0qElhIka7xtqLUrVDqH++jtVL7FwFfacyQrNeUentxUCX91dAuJVv4RqNRICgrLTq6bFKyDQxafqyAwrjxLx4gt2yU/9IBbrSTZf55RkS2mmvKHvFmsGheuqEywNbjfYp7pSNTasvjtGiKSq06Ls1XajXXGbAS3qw0Adtuo9LdEj0zpLulIVUCzIzMolkoW2RQ6FRq3a2glFa6GUW9bNJOm1+cr7QbkvHzdYTLotKruSXjizorI7tCUZmQrpSfr8sIIMxXOlekfBGuC1xnlHiFXrYyPyxjUv47wxP8WlZX2j/eL+PQ+2Q1V/5ImXolPVb+p5cvJyfdCsX+faCri5+tVO8iE6nXg57/O3WZZoHg0wZpGqOjSlACfij2N1Lq9cWeV5T6I+vdQWkaRDY4s+RO5Yp0GZGtXK68Kh3pUnUsyIfxbInH1t900bt+zX1b65Ii2y0VGa8HpSH0Fh9EWwJD5A2lIF1FqrdFSR+jZUk1A1yqjHj87MrkCBpyG6Umg4GUMYxQaFDqhqQF3VmluMVoNVfkZDJR3ENXIgxzShEKYZijK4c5zXBXhjniYY5GwxzxMBu7QgZkLcNsdg2zmRhmK8OcjOd1BA4kU0iZFYqYPH1xyq3IVDSkRxMwqgGSGs9WTCpF0WjqRtP8w6vSeFXqDLMIX2JWGa6BJ1mnBTheYDjMhlvxLxwgwwDg3a8d8F/jRwIHPpsEZsQwmqoCJR2vK2eG/ocLi0a5Ff9v8Qs6+/HCXcPbjPI/Wrhr59LOzs6Ow9UPF6jtO7V/rO9/8Af/6x9E22j5JwuMJv9q+N2hrNJ1Zb0i3auSPhjTyTz1rywwBt2Kf4lLKem6alF6kiJqbWzlrcys+FcXlpTyDgyp4fyhX/jwtYVSCWXhcwwGRZQypdUbuWWukQoJeVW4yvjhWm5Jl9b/iNtUXveqiEwfzIZMDyy1ZmLu16XNyAJUG0BVI1AjsnWVUHSSFCUbW7nLyBauUmTWc92J8J3pYTbgLlOQEqDWck2GJwUg0RT7W2qygFuVpuMyQTjmB9lezUKiX5nCyduGbF1aftVmZPxwPTcZ8PwqvvIOvDojHTrKPUY7W+CRJ7fyCL9gBbFfrE/mUeZfWpAOoTs8Vi/zlQI1vbyAiaSyEcLdGOHSJUy1ReOqqF7LzRjV6MZXhfSASTInu2AWXxXiZULz312AvFD+tQW+6b9+wA/x+40DQnoovy70g/EVcSbyOlo2Lx0gDbny8gGwybpSntZzlWECWL/Yq5R/nEzPg9R6eB+zIchnlmY0loqm9ouYa5cO+H8fGu64DJzpJGTMiS3pWcenfZTIUlTj/a8dIOcfJ8etKKnYv3BApiPQaUj1GKeQ8aE5Q26P5iyjpBPLT4M8MicmkCZDHzH+zQoEUxgBsL2Aed0x4M1LCsCu5jYLo2VWmtFyIDTITqbFKtoIgjVlWXIV/CV74C+5Fv7IUeTfTxEqqP3xXgUicL6oN7qV9l3Wlfz3Fn7BqNtMQdq/JsXUf2+BVSu0t5s+Ai2Q9gu1THmfNOyLlHfQx6IN8GhNbg2CThjpE328xepCrzIBalZglIHcvwwVkkyjDikzDPqk9qzeXRxUplGGNBlWhlgDU6wMafQMypDGT8d3SuNTsMsjLDIvB+Fu/PvI7CncVUYO0+wwubsYHcqbgX/phrrUzOpEbYg89MTKMiTPQy2LRC1jJQvgGH8jKmUVQIkKwFJdiRZTNZqA4Znqb7oIWQuRLrPB9evKQsxFLOZQbQHI9LJZ8GlpyFW6VL7TqIEVd7sjAKTShZQn9kJpfCcjF2QdKF7YSBBUCgwVMwUy6B2JKpf5nQP+FnyoGv1FpCKTNdmap1pDwnWVjmrQ/nHSctNSTGlduV6ZNAyOLLTtrwXNdTSXE2GN6GTQ63UmIl8+GKu6QT254gMQiWAB+LNgmcrbvtdrmLzQD1u42ykNL2uEJq3oMkZWAEKV/gmwwouyLjGZEHJQwdNQ90IZGzBou95Uopq3lLxl+P58pRx0fqhEVhTuXJNllUjbFdYUVQXNuNSiEqlcsWYMxY0/AK1EPvQL2kpG8WqupP7DFUgZhPfSDYwo0qBrGSqTa//8AaFudKrpET6leNEUeD/GuwW6xaX5jAyvBAzFy2YhAO1WpGOFUMFCFvoGfZEfzI8eJNSqy4QstZjYXcmkrkY8omFqjpKawPUoCWOR7M0fkrfLH2SidGRiBT5h0ErgE4l/HyV78gmD2Wgm+IRp+ISa4BPMtAZV1PAJHfiEGvGJxN8IVZ75hAlLBZYOMuZVo6Mn4BNYCmCwRfUH8wWfiEbqcDTiEwoD4po+ukCNSkjYiTounMKHVyfwkFEqM5vHPxUKikBBGhRkmIKwEibDFMSTSzEFURIWxsmIfiJKA/2kTBcAhEvzYSVCilLAIP1gRV2DfnjdsNAsF0A//GC+eWBWyPlZUTEdGJWaVNyF+YwYBFYC4XGEdy2FZ2CuNQ8HuUBdbm/qctdFXVaoywKdVrBqJ6iLWwnU5fz7yF1NClmRQnYvKYSZwUaLhq5MYxZgIS0NLgAud1UxJOTVLPfdSAzpRgyZQF7JeFGN2guxM2BeN520gbyMMDc7Nj/IAm2hMU1wn7AAFPJiztcS8jIj8oqYvMBmKbqCvDIhrxFxGWoF4mqNiKu1i7hagMBchbjMWxKX2U1c5kriMiPiMng3GhGXwyLTXWHlUWGJqs1wbOMhu9vKM0FaNqyfZWw7FBbVWqw8kHlRMO84UU8ZxRm1fVEfVaSy/z3T6RDijPvqUyw7lHc9oe7HoTOXEdvkdB/qmjd9lj9g3wpqpxU1eCPXbLsqgxGwkbxBunVgk2i0OBF3bj03kxJTjyRm1AjIKfE4LURdECB6WjiyvUCEo7Mr5NgsxMLRhTFthKMLYz9hFrLMVBwbIr1dzy3wxmQWkQ7ix46UBTY2qtnA8AEY81Ozh4RlAnZjCeuuKmH1O5awmjEbiHhCwmqRsIGImykaBcsMOqv7DGqwXvEIu0bVioKqZadULRU0pzEyrIz3eg6Di5gTXpTf2aCEYd0f1DA7pYZdWRnWZQ1yQYOkeNkwTUVsQ3JX6F1TVDQ9Mi4TWxTIKpowQ02Slb2qGcoEM9TbJyuT7Uk/o17KwnJMMtEukomun2Si6yWZ6CokE12dZK6Amyyl67lqJslsNtKJ1chsPZKUDqKJGZpq2Jkit9toHURVSqoRInosIGZFDVMjQan8+8CyLn620iIo9YQaZkUNs7vUMGeGZsUMpxWxZKyICYd1QqMLYZlIai91zIFVMzmMlm1qpI65kSWW3FheurG8ROWkS+e527YaYaFy0nfBhF8oFVZ2XmVlwtYFkRsBMzwYSbDMfJ0pQsMuMCTVBcPPvpTpZCicOTLBxACzE3NzE7i5EluWDnoE3oIBKoijYLrolHa0ELeiM+5m4WZy8imZa0EG8PumGVUT5iOvV5wbkuK5xhZcx4bpCZNvQq6yYvJljuZyxSxerhukTrNwM8nCtbBwE6agGq1ZI37ELDwANmbhdjQfFeajGc9HNZ6PolZNz0czMR/VxHy0o/loeT5ano9W5iP33DBmMW9FT1oICDKYj/xgvnkwYteht3vxbDXFs3UwCo17r94Oz1ZTPHuPyrBvFbAJMw0Tk/DsMdkEnm138WwzzbMnh2LMs+0Ez56mo4Znu2me7cY8++3TEfPsKwlm1Evh2XaaZ5s9efZb0Uh0vTQSXYVGoqvQyF5wY1EVeLZuBKyMjW54thnxbGw0aubZery6scwgTaPYZ7w9pGR1EzZ0zHhfh3m2RSOBZ+vR/pkRnm0ans0GIguerYRn24Znm4mlM+SIneDYLnBsE9YDLK6YlfobsVPKLNsKy7aAWAk1YJyYZWuwbAuWjR+Nt8C7RyzbCMsOpgsXEBt6KmIJkmC0nyU2NlKywlHNqpoX0NkGBOKP54NN3ic1NGzDSjMZNsJrNsKT+kXli8HJXI+NaMPZzP94Xrqps1iROqoyp96jMq/10Kz411Shq6DHux62Y2xfrpR/Tf0sw24Gs1qzbI5CGC8bIhV5lWVzirCP659gIf5Y0cq+anU89L8CoeG/mqKyD4NunoC1KVQa+BZVlm8smqPhd9Fr/8PbyM5ZVRlU+8XZYPw7jF4um9ub4TL+pTfUsnFglcVh0UJJe3WPaCb+sbUqXjY/uE22pLQv/CzF3RNlIrZUhWdYj170UV1iIw6kNtuHBsMkkGJZoktLieg+dtksijrYkQalklvJgOSOTd4j6WIq1DhPjheJzuv+srklkw8+Ia8effMKW22PsaZx10tvqNuw5LvrSbn3vduwx+1farOi+9ib3+zsOL+zYyju8hoUuPi0/HzKsx61yGACpXMm4PpwRhGPepFm+5hS0B+24bsiz/63u/V7giNGcRTjtNDglGV31Qljo6p4VcSxC5sKh3m1X1n/nTeUGG9e5THBDyal9lGvvImM/6Gqy5vJ+J9GdXmAjP+BqssuGf8TVZeHpIPlQTxXdTmHqbYCjWXRfKKUnb7qMHaQMadmyn2TLiLY+vC/KvrJFX/DPe/+nP7IggB7M0eiOElbH731Y8vtrJPPzBZz1swf0EfV+25YcH/nF1c8M7v7yqxzdFSa59K5Mu8UUqra+HmQ9+fbG90y68zwg04ZdT4ipcquTmC481FstydiT3Cr+W0gL7gbxEtKUTKgtC5hFNd1GcPeWDPdY3vb9Fcp9b/722Z9a1XcJhal4tllswjJlIIy8VfcVDFPLfD2nRoLkMK72pviJhbM/4ghkalx2Ksy6XyUQT2KfVuKsNt3Cxv+Bn7nDdtH6WLtjzy2CmbZ7zMt+X/QZjr2/6rpFqV+tu9TVvz8f8iufOouVhYTtYVeRdTyyUnuRdV2Q2pH4jGzSFFG0al+vp8Sjx0AUv63pyojW6adj0xjcfk6sWhgXpyn1F/WVwP1IwB151W4JZHyP0h3P2Q8WZbIwAvzBsXGUb/jmPca7PJJsfDpHcpRwa/eoSJxfDk8Gg6e4sb/Y5l8Cs4nZSJdOxK69rHr7doEXMvGsUVsSR1gbX8aJn4+BYkbQfLf7wFJg+Rb3wEkPr0oWhujHPLwWnCBVvfG0MvTcMkC3PqdFMOU8kZaAygrYVNwRiC3aThNxE42UZl2ljPFlBEtm7sF9hbbECNoYzytrIzs4hjaRSoo2hvazmKDAbzGRs+iszg9ph+5fnL1CwNQ1hu279PBlpBcmJQLF7e2ZKKzDnULGf/HV6Kp4OlKM6LLdEb2ft69Ey0qWWbzabpsPuFNudBZzkac5OZdDXyHG8joJm828uOiDuZzgHmrbFEMRSoMhmHlfzWfxYZ+D65Nk3216Kul1kRHmTz8n7yhSjfBrOE7xftxvRmrtLGZGIh/cFvVguYd+38/X1ftRcMuabH/2ULNK3SK/U+lGMv+V2xX/AuaH7zAG/NzwPeg9umdWgXUAxS74ndMGZPzO0Zec/xaC685vObCay8aru1FM1lbsrs2cv7SVEXpdEVUUMvvzJ3zL9xYQ+9JCf0C8DI6hW9h81rTnL9kwE9qKnynpgPUKo4c8sEY4WmyiWhXE1zjzxZqKngtJtVGqNa8WS1dUSu1eUEUDEefInPXr+/s7LyubjO/LIrUp8n4vxBmrH28nltst4FXw3yN0S1jikqwS/8axlPMKX8ARgtOWooTBxPS3h9+ION9vRIOQ4lP+hfLFFvlYQLtmuHR9PzhHYVoPMOTzi08w1N/+bLtV2BFw21fXBTu/+etKdmC1z8A8v/TCRl5dzOhpLeqs4Q3/ixMBbNo7g7sjneQNrqVpRmyNIPSan6MOljbFSTM4m6yPXAaS5267ODFXom3Y8AOz6LSMQsJU63zfmEdeWAdH3wbrONI/83l3JOmXjYP8XV0Ebcir+tl8wjfaV+EzHZ1lS2bBynxMzIWMxfLlBWlm066MN0o8jdvbLH66P/BFM467we0f95wnrbox+cydm5pU4aF/37KKPP7T3bF5YEytplRBgchu2zO0RzKg+P6hQ5TsAIF2zLrqIzX51flLp3r4y5tNBRLQ+2Jhij1SR9tTZNhXLZHpCgVHBRt/aDo8skyz4SDrLuXuVc05/fTIerSAcFWcaS6gcnrO9P6w/uAqn8aSIvR5FV5A9PQQ9Usfh6pSwx4RjlcjIa49csDP9wu96P4qXKe4rJFDssbRsU8pbS/782grm5cUrpqU3QCtLiat4GGHtAwOUlaQE2rmSQ6Az+98bg21WiLK5/AVc5IcsBQRG3GELUFQzn27IaNqg4fot6MUdpgn8nU4LewcmwILO+9PlimGokoF03z16anaAuGoSC7j4E4DD6JvAFcEdsAYZIH6DRXe9M7rtlG2Mb9abCOvg2wAoFQ+yI7r/OkS9AWmFvbJ7vrfs/bqTuZqDuRui+rvs+w9wArcEwwkuX1xjUQIkqGYzkg4xZj3DCcZR64RqDmHPNz9B3fO65/6gTdP5ue3e8FybbGBB9mASQSze5J8/8wvbKCeNncL/zvsWXzacgdpnkGE1RPh+jmKyr6qz0q+ouGz9wQmDEcnTsfxKPvjhnyD26r9pPz8cYWzfinzMbW21KCqEMztX/S9MpZFGlfry6P8NYvlsX7ZQGdL5pbq4zyRXOsoros/RDl+3muVnIhE/c9KH66nMfPp8ob8bMC4sYi2eLn9nIGP7eUR1nGzbDLeSAaW6OomWAG4GmRL7ZYm8Ucy+hGsvQenv7wlQrehwkYgWOuSO4iWMWSUhUPbwdlc4dS1AFddDAxnC+gRSfHtSlbZojN7r68zXyQ5zlsDifDnYitlfi8PQEnw5bWGUnDfkgO3e/DsafFgGQ8P7l77dGcQHHUvVR4Rzv0MmPuVoXujbsW91gxiDFRuGsx98AMKWbQg7NxaanNk3NyAkISsAElrSt7MleHBAAbHsN2jO+8qTM2QDtpS9B4XENoNj2rqzZ16EivciecyDrXqxwdPZkrjOf3bkNAwb9tl0mnZNs9ZcDpDBG5nohpcpSd4Hul3MONXuVKuO21TuWwWvKIqfGIweGjZlGle1UKQ+VMmVALbbcoQzDL9X3VEVbboqxXtmD7ngGPARAZuSpF8+rtVeR6ZQssqOXtKTf1JQ/bHUqPyM/gpV7Zog6YMiq1jeLSWs3jiW9b3qzlUUOtcWgOSm+ngnE/De8l5EIbXOI2EqnciUBAi1g0nADQrdU8kjfVHcqilXX28XKhlYTSJeWwdk9gZuxglyL2r6q+W/H/GrtyKaikjDtHIppnwgCRMnHETBxCsx2dsQbj8ClG/8bxu+MpMno3g9IHbb6fHz7k/ygrk043m0QfZkcHWwX7T+Vd6tAs3Go7h4Jd9PXbJhWGWVEY2rsUhjalNCsKQ47JlL1dhYFyMIpZs0I55l7udY/NKTOoJivbXpUZTzua5Y7N+yHUmZqBynkWY1rnfcouMhizordk9cbbgyMC6WJyZmAEs0tKlTnNMnAQcrO8nocGWgM1uxSYHDCLXdT4fyEC5gaMMfX51ncaJW2Ij+URDz8p/0fTFiPob/6fNe8f8bO0v0txHzr1fY2QzShbzVu7hiKiLHQ5uc4uswR9/bamS2FBAarLGpaEXjNmkgYzjZzvZDSD9XiHv8KkaWQmzaD1mWaWUTBcRiGOqNOeNl8cvc41iKJ9NMPORYtmvpZdKrNoiN2AiV2bq9YqBOzalggn2yvZoHq4DOv8edAUtcmK6ZKh8q5ftkBh8uBmGKwNTdgpeHqnYplJ39KEws1013Ls3/zLKaMmzZT7OkcyXvnxBJuHHd9QayBv7W0i+aM3FE9jWBFVvxvsMZ2bM9YggCFwJJ7x1NzrHNnj6V5f3LTHPTaQ/U8C8Wi5LOvnpCN+bXeXbdnhlmXsTLkP3/xLoV8Ytf0/b9a77WXz/dsyYSSizfCIfLrMd1FvjqnUH8/gMSNJr5Oaea62zQrP3WpWQrOYwEU65pDDg7rczxxkVjjILE+c/czFGg4CEV7lYw6SviMO0kytMmGVoZylNgNIeclTLxlzksnpNTviC/8621MvZ/z+jw1+Z6GiMGvAshQmiWVzz5hNTOCYMrcyxSXid8El7pnkEmhxuhNYULWgUBr/vaBGz+RsOJvpzEP/QxWVlQkdib5jKcLkNovmFqg8Jqg8BKVnikHuCxXcitisDRnj2/G/Y6GOXh22lm+nCLFVGauubFjBTni20cVzZg9RuA03SEN42phaWmxWaZWWtZZoWmuB0YPVUngvstJELXA8VJbPjhhhZ3aP+TW3x71ij3uz4yUVM78kmLsyrEaDuWu0+ICdyl7sVbHsYM9SpwdTTRWWKPsp7vmorniNklOEeJ8IK5Sc9YaIxxFLlektN/bh/c4bah3sL4iuNGNDWIvtGQmifcU07P9wvF6ar1rBls7YhRO1o+hEF3YtYcRHqzbGto2tvDyUFqoMP/MYwwgkEFFeE9aqUQ/eonB4zU50YflaNPNli31899glCUZ0GMmCvb8xlFVslBerWLCRZRTlLYD/P0yYUe4ebSugE5BZkFOpLMhrTGbbdANOxvAUPoxwZyX9beMGnWJQ2mweu5v1BrJ3KAktZQICXja6ubr6HsaoJ1HoSdTY9SLuwWquERna7A8o2R9gBv5P9uxOMdGd5FrdObq7O4t/Q91Jr+gOtkv9K5PEFWHQmZmNd5OS61MiBLYGoBSGisNrzGSemtbCbDa17RF2oLyGUMbStCVbdcey3buku/Y2OEAAqwNAvppHU5pPdJ2aT8TwauIZSQgPVf7lKabIQLrSstYfABcR7TK6AfZrAPq6vOs1FsPXbb8IJjkw2FyxepVzWJCrYtR4Av4R3q3n2Kn4F3wdnALsorlddGIbfDrgJbU48OwuSPDtiOHJEa/mhl2Nj4mdgB0ub+EkBfw+2NYxDB2Lixa5U+zp1CHXI1eQkMmt4lB+bNncEtyfICGSmjrU6sHHp1fF1KKYWhuV61ZxQWzcAox4BRFqcY9wm32ldlXHF7dyxgXPvp0AtrXe5RcXzS0VL7AVG+3jmpVGuCmUM+y2UDKrhv8iHcaiWNxTuTfxFdpszNpsQ6VjdRY+GEglYEWjbZERMTjP24uW4uImiVFA8eYMqD0s43kLu84sIsQaYbrYZOvWfkdLGRFq8NvALeijHM/xp7hBCvaxtW69bI5R5P8uRV0O8IwYqC4Hxxxe62L017rlgtDY/xxo7IvlQkaFxAgsZF9t6c5wwkFIzFRqESJng20tM7x2KrS45aycepNRjWL/2Gbk4YKb1RzaiKQfZUYzCDZooQuzUE9z6H6eYx0o8zsGnjuZdzXxbkerTCinrCdx114PTiKimv30WpTXZcewnRyv4rUq9QUqaEFX9Lq/5Q37wbUoQzx4GqIyOtQZxWtgmV9gCgYvys4aR+qjmNdQKE/mZu/6UmkyhKUhZLIJxU1DyN2L4xq/1NSYUraRI5AwlY9Z4d2z/nwU8ZYiJC6VmLcU8VMhcFZIBx9S2nzK7yaUTKYpSLBDwVEheYgKSUK8GfBQpd70wagwSnldzQFCmHazXrkPb3RYQU+Dw2AHG4gJtXc5c6aTgY8JlhAdaqOdNLSzUBZsIOusT1Qy9Zbh+/NV4obUYYfODlSNBFy0ww6dMB3kWNhUbTh05ujmfJVAFYHRLhfdJIFyl04EPrYzKsRfswMWh0QdcPJ76QYeG0rYX7MN7Lan/TXTCX/NDrZO2V+zwLvsr8ml+Yza7HfWpgLsXYCGhRMdKwQZC1noG+tNeDA/erBPBGIYybkxEcxNj6QM956UuC9Q9hXfUEr7CgutNMkoyRguCClGDKYuaw+H/Bf94zQT4n8Sb/tdXjyiLmzSJSe6/GWLZij5WRsaxExhqJVVM1N+fp8QAXV7RoZNmpqMvM2Sqmjc+/ldJ9z1dlF+I4rnlOKQOXaAcz3IMvEb67EXKdz8FwZb2UPaDOHQ6J/A28XhwGYPwxn/dvaT3e1GB86rg3ed3uVdxwk8GI7CkCoM6cg/kWVFcIwMXnkruzwlZ4vWrjv9K+4cKVpZW1ylZ4s7mmJ/XDxS3LHboy8q8uy/fK/OJVbhCVLFcfjhndjK1aHGi7/x6DsskaGOHbbg4Rd8H92aCAjnfydaD7u1/wH7OQ0TL1ZFFVjk5ZNehpAZqwuQTKr4ML8oawFXOpESw2Wz2ES1uLUtDrvwn/cceHqiW7MbLV9b7+7t1vdu5fDsvoYXnvMfWOeN/N+J1iUcwa3mWWef5AgSu9xfsUIm2YBu8Z2B3/kJNns9u4jg5vPa63tF7X1GV9abe3LlX8Vyx/p4I1eQma8icjpe6wavA4q2KutpSxaY57qV9UceI7vlj2wXt/EtCVs+rj+CaxRuKW7L2KOWzT2iLDJojCzgLehXaML5j0voeFAy+fXGX0mz3sAtp7U/wja4vZ/9pr7Gw/QONQqUFO/Cvd9T16jjP9UzbyQeisejtf6moHDeieLCo9WFK+M9YTT2qoXcNVqwYracxj7TtFDoLKulR0sODTxcslIJixfUP5g5oOLZpvKWVM4Qt0LjiVfrHipV2t1iuG13y3NOqO6WL7By6m4xDIvmMCvwTWVRgDQKFdnre4v9AuXF4zq+juqWVPLWb71b5DPYneuAhjNTIBwTC/zrwcX89eEiIpstmmO8a6sWMYWgi+MznlHscTJeLxOn3JEJyKzlz1VvJjKtVsvy5stfKmQWcv7fwTDCKWSYWpjDj3uxQva4nmedvoeAQQDreEtV3Hh5pXBKpnqKSHHpUcFf1LxXWI3cfDowXcyHV46tgu+cCrvQ4/64Gip5r+nSpHF8RNsSI9IrY6+avXoh9U52FUDiBoZ5jm6fAsOSO7kXGHYCDMYo72mMFqqHF81hEQjzvBFrZHLxMPJsZ10qDj1NrmwiqXlFF5oYsc0o1BT0VNg/YXAQTAQCIYrE5AHuHUhmBDboxQYTRuijiAOkTEtO5mo3FHYMxbijf6kaj1mu42hTx3/6vh59B319Jz39d5NDeUyGshP65I34lTSAOoEOlV0dkNHTa07lSSmY7cG3bUPMyYis41EpGpUEGg5eMItmgJh0BHqxtfN3orVcN4rGsGF+IhR1cUuneRZ4oGm8lIz/KkzCdvQQ1Zri1okWYiGRl5bEXKKlt/cjW9on3VDs1bZGMA3rDWR7Xhe/IG+dY4eXRaOKD3vr+Ra0qq70SsHdrrGCnxsN+ZuUcGmpEnxfWiKmtheXJmXuO3gs4xVxaBWSXdjjyOtZwzeIvxl43Vs2gwA27IIOzl9cG/7/9aVrdx3WWa/26HfTZ866lkmFbFh7Syxeq7bV3AoOn98Pw74MIzsbii8ad6mK/dOGd5NGqD4nbqgYYb06fmmjnycU734T/jUnhNPfzna5SUpYaxSud0kJyQgnrXeNkySYlW+HD4ls2zpxMEnqqu01QsOqlPe11tmOii2zUcms8yr6KVOXuTcwLk+H6iC4pa4iOMqkkr0l4o+MlBBzKyW3njspRet5JKV4PY+llKznvP8O9lBXUV21GBzs1v0/egMOO2xPzmS3pgVWEMHjoYUBj+DF0eLgUHhptDgEFL4Z7LwS+biWTeEIrnhABoxEPfSJ80lZiuGOG4b40hK2orzdyPUhuP43c4ZnDLIM6skpNXoc7TnjrniMmnuV8Gu4GSypSy8gtp+y2j+T7pqDHX/ptzRi7a6cnYvmQY7XEcJkmmXn4QGvGZlz8Fxl+gQoGQcyJsxPMM/sdL/sLsBHj+2e/briMUV4zIPyNjhJNs1K1LtiJSrjziIm1XfO+b/eDx//OaWyyvon+t5IMNvvRCztrP/VPm9i8oI2jw9N6n3W6/WR4MBytjcTKa210ewN+fKSTNVXlio72OK8XdbPfJKnfnynfnnpagp0fPXVC2zEf7gUVFxU7PNe6bzxBdneRY4YAOnUI//4V5b8731JH9ciHWJ/iS+wbzPYqgIUbGe1PXL3jNeBjcR2e8C0+9kYJji/Bcii3kWuHVt4vuiJQd3VGUAiUyyGUEyW7Yjtteuii9wHK4AJu8J3V1Hjyc1hZYosB6Q2sjZwVP69v/EaH9kf+A2W/mLZgKsnM+QFUM59uT0kOggowYwk1JU41yNt5eqvNNrKcf2R8i0qWlIfLd+yrfTdvTIGp/3W4GTXfoX3lNgfSvvi4rRFQ+bVAlKB3utCMHJvlAppNWNT1r9h89HfzQ5rPbkfUNw4YTjL/onWdgiLFUxz0cgkh4Uvp7e4hmVOg1Cu/XzlLZ6/A8vfr7Kl6q/UWjdDgK0uTNZiY9y5QmernIsJeTFC3POioV3hzocl+N5wMptA/M5//w3V8w9uMFjZ11omGSZPkA62RARVP418W0ix+DSz/Bee1ixpvMY2rzwVz7BVcDpkZpYgFoS6wUORY304bhFh7lXLX3ru3/xfT2xjD8nrfre0k2E/YNOwub5wZ3B/4L1Gzg9cWn/paS1l7AroJoxojdvI7kr/c7dy1w8MZXfZ5361bPObj5c2xBu1PwX9un2XfpoLzh/pc07pS09rskVVslMx4MA7z5dtBif7fd8eVJyT8IVfepPXvPBnSDM1alrCrbDBCudIB6ctW1SSi23Upewu/UX2LsyALWzuKvkC+31FBfkOGMZfcDLfbdku98c32KXVrJL2SX9Vwmixn2sIw0F2mx0Z0ZMX7uQ1zDYHlyOtRdinjTgVs/GL56sWADcSioT8u6R/wRLF33q2yn9/XM8vlTEeLJD61rPVzNQDhQcFJd96tpqdepDgwZsa07eerYqpBxEeKLLferbKph7Yu3TZxsDclf5nuaE2UM0I5o2q9l32uarzfPNFzXm6t0toZTO0677aLqEUzu6+n2yzs1Cx+360LQ5Uu+9boK6N4WpLEA9Djn6VM9zvcpbxUhaMtxI8fhHpQ1r+l8+R4QQd33q2KL9FM0AEl2aBKy4VQCeXMmD82aIsLSfd5Dq4QYsUsumGG2LEMTpvNcKBFEK09XA7uuonFRIQ4akmNfl0/MBc7YG92gN3tQfR1R7EV3uQ7HrAPUylh2noYfZHEXNsdkArOfdOyF+0xrv/6DoS3f3VZduDYcH/5LI9gc1kh6z5BQ5J2Nn5RM1ihR+R2kJiEU7Yjx2tgPUwvZoKoUQgt/1oSpFDE4/5YgB2jMaQyo1r3JoF+/tLA03Wf/uDWM1pTi9sIfZCZXKBKLJQNOOiHRfduBiNi/G4mIyL6bjYGhfb42I2LnbGxXxcnBkXZ1HkwwQKzmfGKc1z1fSbNyq4gDH69gdlkL79wYYOjRsyHRdjOr5OjI5qjsajyZlumW7rSoWiGRftuOjGxWhcjMfFZFxMx8XWuNgeF7NxsTMu5uPizLjY4EuHXLa+CKiAQRiRKoOtyOss+2ctfRCpL1bYDSCsUhOPLVqx2BJLyY6nmrC7rQc1L1YGvEM6XrekwFsqeOOdAj+LDW+w0ubzdvg4Z2eqXpBmMbwxJSEiUlxL5v9XzTK03T1ve13OYPWaYAeYc0UkXpctxEvwfjq1ZSXLbbaaNnVw72SWFsnDZBwiKcEYDBAiMBJqneiWM15z3XB/S32xztkm9aDMQm+5ApKW0Ag8EdQnc91xqAZRh8i6sIrerm/l4jZMHTRoULN4ce1C9BjHvFfcESADruEmUUsMYSJRl3dqlU3g3s+XcxRV+8v5JhXZjDEKeXBm/U5Ocbec96/O+Fc7KO73T5pyDnvYO4XfmQlPZ/2ruTxV5RwcppA4Qq/5/yX2348p7lYLXtPMoJrd6OeYjmbN/yvnX3d4dCPJ3VkM7yHZMtpHM2yqNX4I65LXFA/KgxZbs4rmKKIDTX8RYHcCgUQ5zW2w5SX3P2IHi/241fN6UMV4Ex7UNI/FeVYmfkgtKnrVDYOyS/vIUMGuzOVhOsgDB8/1bs3uCnUVU36nNhTTDYgCiSmB7o/gG8/00RvIqFSx1xc5Y1zc58icESmNiL5XNRHqPTJ9RLRhZ6s06A4yvCQsEFadUCWOY5joavgR68qhPtxZ1uAWcHKLQ2qojX8nulTQDBXdqsAuyj46yP3aB1DR4WQATw72BkmoqCsOgMoF1iy00Ksyr+7NNSVlPDGWGAOaratZWjjR5zGkWbrxRH8rT2TKZST4SmhGIoFiCQ3aBy8icxE4TEu2IKClMm/mj8pkeiUyTSTIqRJaHc8TFPELUg7cGR5uHM2DNRSqVzJE2IQWX0sGTCJhOKTewUdCiZtiMpv5YfZBhYrsijBAJWZzzYcYjfUSTkmVZR/WGnJAh9wljcb1Magm6q70+WdHX0kAxu9np7QdBu1dzp1RzYEarKGhblL94D6gL1auWVKwTOl3pf2LjV6UfVNrB8ZLvcod5WyCPVbiOcEW818/RIJ/r+7p8qLDh+RbkspNBXTFCDnWcuIBE6hYk3gJywQKqVUcZT5hUI8Jso3qo1D5OYVYFUPKwicVo4Iblm1Ro/ezW7UdypEYcJupbEjP6PUJToUs2OqV4QCZy+xqkv2BZi8TNiwbxvZ/ZWRLHyZnPvaF794sN382P3lz/3pIY2UaHj05Hl7fqb/akkXot5ckzdQ3luT60lJ0tQ+v+iD7bw3DijU9m2sUm29gHorYgKM4npPtVipkXhzZfxQbCdimd5VnqrENcdK8ULltbEM+70leaRsMQ6p4f1PT2BQhNZmJVq541tg7rvb48mW7LebUq8A52jkOSSfFRRPL+YKCI+c8IQ/CfPb7mhOnhb5o35pAjQ7V6nH3X16aaHaP54wesVCp+3L1VjWxG4kMDNrnDNtKcMeUiIhyfPnqUvZfN4BifAOw7IH2LoFtIPAB7PQezuL8lnXi8zHkPu3xmGfZG22dwFqSjA9/wxacmJQ4+Vh70RyDic6GOdXyl3cu/+6Q1/2xZC5xbAGBUy+oHIoPe9Loi7wV02RT8Rq5RY/rl3XOVqxXwu93dW48jewIyC3BNoFgg2ihwtXGdMxZ48RbPIbbXsw+4UDLiwfr4gNc+vqo9FVdoxNfO1h8kK+f38/X32iuvy1v+jdwCJnfhxwABr1CmIs3YtKN4C3++v6mZyJ9pUeC+G8s4YtzdRX5uXqZGcKi+eaSb9c4JQ++YV0ucYyF4m1MnKPCoVyRuDxgSwuOs+5E2I5mv7LifZx5BbxBDop4Zal0UPH4BevNVrAlm6swi90EYa6LwNiQHGg2MAt9JbPwl57R/tKXdXGMCRGOYwEcPmtjBEiA7d0AFKYPrO0Mm+6JQAuhwcFF8ZUlGWrEwrxhwyFy3zgI7YMR0wnw0BTO3gVcEStbk7hi4ZT1JI98wAU5H9UZcq++IkOkx5AkpH8ukCTXhoSb4TtjSGL//14WJDFI+Rg5Px+Q9kJPlQZi6vTkfLamuea+q7PKBfA4P0EzMzkBFMXUFiUk3TUpcajXqJq3ngbp9XXA7An7xESYhHXED8BzKkOtYqnhOJWmhK/g0QBmVbyXt1RU8f4s++ctPTeUcxzSYGzntFeShdC+qWNA+3v9L9Rt5nXOR4Z/9/LBfv4HizyA/ocHwZWHHLstypoTQ7BaNK8vInP0fUF303wG0OuL8JdjQy1n1oGLWdube6qkK0cEpfy06tRQeFQ4uG2EtG8s8UbhN+Cj0Kakixj11UYKfXMJkSL1cW16y+abS6z+sMe8KI5YxjQD8/oiGm8HeDhWNGRLH7VneLkOr747xeljpEpqOGC7oNyy8qruc6HHfIO72+PK1aL50UHOax26zYdp/eggsQGh+JCA8/1FtgQvm+83X2APWuzZ8egQpMm3mqcBZ1ZyCISeOiw5UpGI3G1WjDmoLkSBVZzVnktw1I43oHGj144sFiOJ/LDj9QSwITvSaGzvzVU2CZsJsMkAc0/EjvHKQYQ58b5ORyguGVFcIScPpWVwxCsk726O/Kyw2YkdgiNYR/mdGI5gWHdswBAYBMGNvmv8K04eoJf+FXdft5xjMWukI4bmEBGW8C6IfFth76PaV1dwQ09oJuRcwKIDH0E63leZbjUL/BgxodkS3KSDZWcMU8CuLW5ONBtR9kkOAoh4RcltSRJjEeMzsj1rabY+J5I8nyRsSzntAxQ1RXgu5G04tAxrHl4Kcf4nWVDFZCo2GRoGJ0ftM9BkKOeQfVkpRfzQYNdaecNUklEmy33JBGfuxf96JbJdo/JV7qNu1vNGTItsipII2REagQ/OhSx7/hFniiI52S70OQKd4gy30OOIdDPXGjOmLLJkHwD+H3Hxnoi5sCk+NPFe9o+Nbg1JI+qaT4JjErh82d6pY++8JQejWeJ/Q6OUhrWXMK4h59sNi84s8DHHO1aRpMXhMyCyNT7IRAdW1hCFW4NI4JjIEzCdmCFsVRsSqBVMMDH6Gckk5A1xNpSzQGleihgZQi+ZrMpeOcCXrxyQRDrQDVsnBXvH9avy8NUDIs3Ucf2a3HntQIa0T20fexyK5dYq22267a13ZLsBHYy376e6FRY1l5ZY/2OVLwoqn+00Z7y+uISQEeRH4QNeWNIdVyE/sG4cOwT/o0UlqC5uFn/NytIXCOaz94yF5O51W3SNNd2EkIwnF5Zh1QqjNtwOjLgdiH4YsRuNpH1MGcrn0mkwn0mrdqgrGWzBGCDSXGBNJmBNAjxJs4C8PljbI1iT3sVQP/xtgosEio1Mb/nDPX/ulAuHXl36CmepE2DSRbMzV6XBZ4N5OqsfblJp2g2Gu551+i6VyfUuskdQOnbiEKVSbjawKuKuyNlFSOuDtHgX/Y6p37x+0mx0l9Sl3wqYT4QJyCEPTO5Vm6bsDb6geNS1d2NyaE/2I9TPSbgabMd1hh1fxrbb4HDbZNFc+nuI0PUFyjv7ECMaqBRmIzumC2l/7Ln6tijBXYHoKwEct9hQ9QhgGCBtXWUyYzf4GOU32d5TKZ/lFqG8g+zydkwVEk957Snnrg+xegS3CsszPiu0CNp+WKFl/12m20Nht2DJVdItHbPhpMs7hoH5TjPeIWdaxaHlvDtQRpwCEhHHoiq2G5abUrImdry6MsJ0+ZgoYboJG41tYGQuMDK4RtiG+pxwpg5Fu5AU9yiaQNLuEZ5E0u5nE0jqjJAU9S6G+qPx4EY8mJE4RDUGWtirxytu26y4zRBrbvB+SthBjV0xml6yLbSU82tj4bWuoVKzIoN+rdl0XRRrGh4L+NmoIj5nVobcTa6C+eAfSC6BBM4TwMVx/ccHqjEsU7Po5wCT2QMmE0ILX1miqFluGj/7yRHXNLuXmnFoLN5jqWkaP/a3XGqaMC0MEqIaYgfgUYPhCbsoJJIcLxKZbkWm70bbn/6tou2NBm0zf4Noy3t7oUxyZVrRc3Zj6Z/+rWLpPzZYav8NYqkVxMQ0lhIcXiNJPwN8GauBCaVrlWE1MAUnhhpooAamYMdpUAUva50NZWkPpQ1Le5yh3ij0LRhFNGeEDl7zspPSLAfdvXKCHblP8kHNnDJnq3LN90ljMEnDw3C/09zPT7F/eL7OSwx2Reb1/JKSPBMOy6WMN4Wna3Cjmjd4MceO5py60clqFwejUOhKOA8rLC+amy3ssD2txXvPXNN7j4870433HgyoklfhLxWOHDl40sPZVA/8k5d2TL8rR0JJVJk2xrB27z+wRgrhJ1ucjuTj63lz0K7JftjiUcDZ5FFPDpk/BqdYshvdkpe5nGWCg2nXxeFAjNt8BA8fQRPs7B+ovf1clXBiA9ARbp8TxeH+qgNdzfJ54UgtlfTYDuAQsC0mvVPdypyAcbhNyWofz9a3tvqcjkRJ7O4aG3v6VVy8b2LrxLteoO7xLdsb79SM7xrcHTbbM+P7ujcOAhIX7kyi/6XvHfYe5V6wxQN+BEg3VJDgwMEdo8OxcHxqLaLb4PpeyMU8P5mXyXc/XyC9rO0x+puNB9587ZApPnJo+kYdDivlmLmeHGRqx3tEfMBTJkfvWt4nkEMdXWXkkCeMAdMeH+VkkPWTR5hDTvisnW8vSQd59xc4QsfCS+z1zFP7nFTBWTV4XOHHfYK3kSyq5dTYqKfi0zFqCvj59hL4zcmRTQ7tZaEG/Ly0dEoqQVNZgKQOqFdNFhaG5xw8ugy3Iwz2mFRQIfkSohY3uoxergcw358Jj3tt6YS0v2xeW+KFrZP4Gz0TaaWUDhhE3BacX6x8dv9abkZ9NiE5IF46JVPz/ioSNLl7uAuGD4cX+BAriYEOGOEDVc1bYOSYpKZl3JhJ3Bjpkw30xsH04MQbnPRKcHE7GeAc5CO4siNc2UlcuV7zLbmAqz1wFBBQxb0qaqZyZ3KaAxs2TFvX8AyL+Sx+JRYzOczZeH1rdSs3IxTL+XUhrQLFHFgacngZ9lkRF/pDEgwho3KIo1KzSmPuy0wydUAwZizsRN5E3vKZsz7lfUmy2W+Ktzd7QReLIXVApeWcHxhX7EY3HKQbogwL0g3BdUjXcvim3K8lNwRv0erxpMYmjRx4xpUrvsQzPQohSXHAdfaMZsd0Ps6I+Qj8FE0Q4pjcTkzzCO6j8Q7l4UWzgJgPCQYMoZPYML45JBCauBUCOUMt9ciUm/IFEmBlz7X07DB4CLTDPmcipxw1LQ78s5y1XiECjW9Uxj9nOCpYXPQlHhJBSaG1TwvdCi3W7FaKTH4KKV63+yBFvgjUemufHVYUUqeJwdCwS4VY4DmJe3Nq1zH/HJQtsr0N2bQmW3yMo6PCMcMPlnzShpVUvkrWqUHJQSyPGJNqmRVq0TzWq8brqj3fdJO7/Hu+wVFTRgL8J6OmEomaCgZO8Q9ps9u1nOiA9WcwVyAd0kYXEVV1E1I19Rk3PuAOgsGZZbn4+pIcV3VpCVmavN2Q6b2jm91UtopGCMPCSGDTkLF0j4jsc8Jgbi15Nq+UOY+BpEv6dDnL41UWvKVgud+BscMeGRSkYrBNs32kgLoHKf6oI2M5I8eK8F4Am3LJSjeiEUCRWO+xIJFqU2qt55y1Q0nk2Jh3hWaDPIAdUAUiEmpDCmUZD9AXHnBlNhAFy+smWvWq4zix0fMOHot2nwSD6h6DF2LMpFNjXHKImZIQM0mjFlhaZSTOLLBzjjMDY+A4M6llguWpUciqYX8d00gO482p7mQEaKhdT9SuQ8QmaQn/3F07h3+GFrqzwfgjsZpvVd21gIXzFsIoMnLZH0e6PRTRkWCOi7I5kA0tFrmBpdQwR/LDYzW5k6LU3F7BTpPUsPf3Gob9GCU9HHsRyCjpSXxwEBgJS2QngnBDzssbaR1343/3VbKtIRKTIbESIxYsywapuzAJ0lPd4N7Uk8OUmbeZ8LVhD6vr/TSipC6joGkoDkYKJ7uPWMDt5OqaouIjfIcl+0Deh0iHRcxuNC49t4taco5zPNSV5t238czBcmiJXTMxd6oY3FlzllXYCWC2crIPZGW/juDKuE1peIv7CQ5CdoKHi2NcO0z9djP1Xdg/fGmp2cnDclbymmPX5VlzIh8LedlfwtCLqvXaUqXZjUTcigYypXEQMM4becqI4gkHvqfMKUhxSNRRPjvMIOgSHMenyUjeVg6yNaRPchQebGHYYuk1C57KICqgqUCjAiMnUwKciFAFTI6vLWXZf+P0Pgbsi9hM8eYiyo8L8r+km8VTUHOP9fxzaBkVkj3ZFf77ghZFb1BhXZFudIUf317NgOclyLJazlLC0c4F00mFw2NKSTuOUibcfE64+b6QIkDTDHoZyevUXs9V8wVl65I4U3He+nChOW874hYNe1qaevJkq1FkdVJX/LLjl2N8aTiFPSKoDUJGHIdYO1w4XDj4UhmEhjgOtDa4iHERcyAkQkDckmJbYyLB1qauOGWlW1IpIq4dAkJcCLw2o8Brw+eYSA4GzksdBY+pWLKmOJSQa4XPUhF/KiO+C7IbGyORY4ENSwm8jsQpToOBWGInESvJLW2IU24jJ3ItaLdIc9mhfaRprt/4V2vo6/Byrlq5rPbhvZFudLPfy7BdKEpXa6x0NWrXFUrX6ljr2ugDuau5Yea7l9Jl31LpstdQupwoXbbZCGSFY9k8HljqsnnIG3a9MJDQLuRTZp3j1KSKFnhOo6W54mNB6vvoxMgZjLdjIwTham/LaEIp808SOjbRFtP24zDCWNFzoo1xApNJgcxiI53W9EQTfcgPt+sqvrYYj3+u6l6LN6bembr3OLZ5WVl6vNH/TI+hGcjWGCedH6txX18SkK/Q1yy1TzaY+nTDDTmka5I+3NUZuttDl8smlLnHgzInRMHa2yONaodl5zqTq210BTehK7hGV3BvodgYTF+1aB5p+DHz/8D4/la0urHmNqFW7aG0MVVfRW/LxvrgSDcZaYqjnjtMAi1IvcrbHcNnxf3/CkFMB3+Dyqj9OSij4C+z8GH4RV6d720j19OO31c8hsN0qki5FZVlVqns73d0NA5CHwcalJFEJMR8CjKfLB3sDxMnVqtg8oUR2McE9WK41i0jJA3C6dMwkpheJNF2MMdazjUbhHfRg1WexVy6ViV9Di7Fxs+Jra1c+S/CYUVOwf7uEilkSpb2cMDz4RB1Lha5BZiOwwHtbEq46/LlJ/l0xU+zs95TOz/Rt5n7SHmkhRGPuluIkx8MUD428ky7lbhDi6AHFJCgGemZw10WIhMPVka37xvfxsYjgHstmCTvfvNyZ0cvm68thXpw6V3zPiBIZcS+tsSOQsum00jb24N5YSX83s0x8pKGknNyvDlcO3yoly5uPCSnQqpl8zw04zcfPwO7dHqHOspLY1gdX2TnBG/PeRh/v76E0SVdHAdmPeNCy4HdWg7s1pzMTY7qYJNuysZdJDkwcsK45VFGLxYgAj/uPwDsrVWqy+BxetGVJmsVJ0qVrI8Z5xH3T3D6kNL4F7+CNUDItMOO54fFkd0MKkbkpa9oSZu9MzdAdBC6em8Xkc1KnAs5UMRfekE3Sfcmw1zYcV3Jpf/d39L+cEitGGLQjV3xBQeUIiaAI3lvXgMJs5wfwDrqk8EynCEYXE0RvCF80uMQfGTjuFcOYwyBOc5fYl/3MSSTcfcSkIRiE+gj3nxm7M03Bh8NYie74J4a/4LmtMpa7u5jdEFycxo1cjhL/E69D8eu8gsz4YUXRy8s1HfqGZy3Km1fCqgzAxym+nvP6EnUYc/rRTDOgv3Lf9fA2axxa/U3N19WCqek/t6XOeesjxBpdOnLkxVhgDk3g2wu4WDX6ZbC/dZV7qdX3o/GtPH3GtrYd03a+C0dnGUmOhhOsgi0kUnu9VeWvCQ9VSE058fFsnn5IFn//WLZfBOFV4tlc+kgh1f/DOnLvy3l5/fXy+brUv4q+O+LB8kW75WZFBRRPViWDYomvQvDfndlmnikkDxEloUq5HURx2O6DSIYMD4yvnO/vBRWz89o3zlXaf/T/dD3l80Lmn1UfhIuvySX/3e43JHL/xguv8hnNiFnucuy/zNLlN9Js3/kzp7f/tzDD589c3bz/IAe3Xz0wtYX1Ic/9NEPffhDH1569MLg3OYX1NnzF0+fO/sQnTs72Nw6fe74uc3znx08sk3bm4PRszMXHtqkyQefO987f+Hz5+mRzdMPbW7Rw+dOf3b6i4fObg9Onz+zOX33M2cHoRra2nxs8/RADS5coEdPn/9Cc/vC1uhT2v7Co5+5cG579PX24MLW5kP0mXMXzvQaaNRnPvfww5tbtLm1dWFLbQ+2Nk8/Gi6mgF9aokfPbm+fPf9Z2jz/0NKFh5e4GnX2/JkLW1ubZwZNV848sjl1O8C1+/ZDpwenRzenu0zo08Ont+gzp8/0VFPt1hkA8OjpwZlHRl98/uz5hy58nrbP/srmGEXcu8EXHtu8yshwf65slO82w3LmwqOPbW1ub5+9cJ4e3Rw8cuEhJf8Vak7tU0qlKlEtFau2ilSmnOooq3Jl1IzSalb5VzvZHzqrnIpUrBKVqpZqq0zlalbNqf3qBtVVR9R71AfVR9Wd6pfUf6HOqG31tPqH6s/U/6GMbtqa/psLf/vC3/7wNx/+DoS/Qm2o7/LOmVECA2DN1Zy6UZXqw8qr0+pJ9SdK6yeRpspqp2Od6o4u9IImfYte0Q9Ott+02bSFNg6qg+oGdYNaUAvqRnWjOqQOqa7qqsPqsLpJ3aRW1Ip6p/23Adc7u/6eDH9Phb+nw98z4e/Z8PfCz6H/eke/Otlu017TznPqOfVr6tfU8+p59evq19VvqN9Qv6l+U31JfUl9WX1ZfUV9RdFdSu2kSmmt1M1aqVml1KU1pVRL+nezknvc13Bvv1IqUf7SXHZSNj/H/8yuf3bXP7frXzT1z7+wL9vcXdXuT5vX4/AvCf/S8K8V/rXDvyz864R/Of/zr+7P3tNUnzQTZ26fSpNW3I4y17G5mdGzyv/1/uzRhNt2KuV/iserUGkox6zVp+EdUGOLYSn4flPGKEmZ3iwrjTJKRisnZaONVkVL+R/PZy06oQWr/x8=")))),t)})}var Ra,yw,jg,bO;function IRe(e){if(Ra=e,{malloc:yw,free:jg,memory:bO}=Ra,typeof yw!="function"||typeof jg!="function"||!bO)throw Ra=yw=jg=bO=null,new Error("Invalid WASM module")}function PRe(e,t,n={}){let i=typeof n.level=="number"?n.level:-1,r=typeof n.outBuffer=="number"?n.outBuffer:64*1024,o=typeof n.inBufferSize=="number"?n.inBufferSize:64*1024;return new TransformStream({start(){try{let s;if(this.out=yw(r),this.in=yw(o),this.inBufferSize=o,!this.out||!this.in)throw new Error("allocation failed");if(this._scratch=new Uint8Array(r),e?(this._process=Ra.deflate_process,this._last_consumed=Ra.deflate_last_consumed,this._end=Ra.deflate_end,this.streamHandle=Ra.deflate_new(),t==="gzip"?s=Ra.deflate_init_gzip(this.streamHandle,i):t==="deflate-raw"?s=Ra.deflate_init_raw(this.streamHandle,i):s=Ra.deflate_init(this.streamHandle,i)):t==="deflate64-raw"?(this._process=Ra.inflate9_process,this._last_consumed=Ra.inflate9_last_consumed,this._end=Ra.inflate9_end,this.streamHandle=Ra.inflate9_new(),s=Ra.inflate9_init_raw(this.streamHandle)):(this._process=Ra.inflate_process,this._last_consumed=Ra.inflate_last_consumed,this._end=Ra.inflate_end,this.streamHandle=Ra.inflate_new(),t==="deflate-raw"?s=Ra.inflate_init_raw(this.streamHandle):t==="gzip"?s=Ra.inflate_init_gzip(this.streamHandle):s=Ra.inflate_init(this.streamHandle)),s!==0)throw new Error("init failed:"+s)}catch(s){throw a(this),s}},transform(s,c){try{let u=s,f=new Uint8Array(bO.buffer),d=this._process,p=this._last_consumed,g=this.out,m=this._scratch,y=0;for(;y<u.length;){let A=Math.min(u.length-y,32768);if((!this.in||this.inBufferSize<A)&&(this.in&&jg&&(jg(this.in),this.in=0),this.in=yw(A),this.inBufferSize=A,!this.in))throw new Error("allocation failed");f.set(u.subarray(y,y+A),this.in);let b=d(this.streamHandle,this.in,A,g,r,0),x=b&16777215;if(x&&(m.set(f.subarray(g,g+x),0),c.enqueue(m.slice(0,x))),!e){let C=b>>24&255,E=C&128?C-256:C;if(E<0)throw new Error("process error:"+E)}let T=p(this.streamHandle);if(T===0)break;y+=T}}catch(u){a(this),c.error(u)}},flush(s){try{let c=new Uint8Array(bO.buffer),u=this._process,f=this.out,d=this._scratch;for(;;){let p=u(this.streamHandle,0,0,f,r,4),g=p&16777215,m=p>>24&255;if(!e){let y=m&128?m-256:m;if(y<0)throw new Error("process error:"+y)}if(g&&(d.set(c.subarray(f,f+g),0),s.enqueue(d.slice(0,g))),m===1||g===0)break}}catch(c){s.error(c)}finally{let c=a(this);c!==0&&s.error(new Error("end error:"+c))}},cancel(){a(this)}});function a(s){let c=0;return s.streamHandle&&s._end&&(c=s._end(s.streamHandle)),s.streamHandle=0,s.in&&jg&&jg(s.in),s.in=0,s.out&&jg&&jg(s.out),s.out=0,c}}var Aw=class{constructor(t="deflate",n){return PRe(!0,t,n)}},bw=class{constructor(t="deflate",n){return PRe(!1,t,n)}};Aw.requiresModule=!0;bw.requiresModule=!0;var DRe=!1;async function RRe(e,{baseURI:t}){if(!DRe){let n,i;try{try{i=new URL(e,t)}catch{}n=await(await fetch(i)).arrayBuffer()}catch(o){if(e.startsWith("data:application/wasm;base64,"))n=ABt(e);else throw o}let r=await WebAssembly.instantiate(n);IRe(r.instance.exports),DRe=!0}}function ABt(e){let t=e.split(",")[1],n=atob(t),i=n.length,r=new Uint8Array(i);for(let o=0;o<i;++o)r[o]=n.charCodeAt(o);return r.buffer}var wie;wRe(Xp);t1e({initModule:e=>{if(!wie){let{wasmURI:t}=e;typeof t==Ef&&(t=t()),wie=RRe(t,e)}return wie}});Xp({CompressionStreamZlib:Aw,DecompressionStreamZlib:bw});function bBt(e,t){this.position=e,this.headingPitchRange=t}var e5=bBt;function t5(e,t){this.id=t,this.name=e,this.playlistIndex=0,this.playlist=[],this.tourStart=new be,this.tourEnd=new be,this.entryStart=new be,this.entryEnd=new be,this._activeEntries=[]}t5.prototype.addPlaylistEntry=function(e){this.playlist.push(e)};t5.prototype.play=function(e,t){this.tourStart.raiseEvent();let n=this;MRe.call(this,e,t,function(i){n.playlistIndex=0,i||ORe(n._activeEntries),n.tourEnd.raiseEvent(i)})};t5.prototype.stop=function(){ORe(this._activeEntries)};function ORe(e){for(let t=e.pop();t!==void 0;t=e.pop())t.stop()}function MRe(e,t,n){let i=this.playlist[this.playlistIndex];if(i){let r=xBt.bind(this,e,t,n);if(this._activeEntries.push(i),this.entryStart.raiseEvent(i),i.blocking)i.play(r,e.scene.camera,t);else{let o=this;i.play(function(){o.entryEnd.raiseEvent(i);let a=o._activeEntries.indexOf(i);a>=0&&o._activeEntries.splice(a,1)}),r(e,t,n)}}else l(n)&&n(!1)}function xBt(e,t,n,i){let r=this.playlist[this.playlistIndex];if(this.entryEnd.raiseEvent(r,i),i)n(i);else{let o=this._activeEntries.indexOf(r);o>=0&&this._activeEntries.splice(o,1),this.playlistIndex++,MRe.call(this,e,t,n)}}var n5=t5;function i5(e,t,n){this.type="KmlTourFlyTo",this.blocking=!0,this.activeCamera=null,this.activeCallback=null,this.duration=e,this.view=n,this.flyToMode=t}i5.prototype.play=function(e,t,n){if(this.activeCamera=t,l(e)&&e!==null){let r=this;this.activeCallback=function(o){delete r.activeCallback,delete r.activeCamera,e(l(o)?!1:o)}}let i=this.getCameraOptions(n);if(this.view.headingPitchRoll)t.flyTo(i);else if(this.view.headingPitchRange){let r=new se(this.view.position);t.flyToBoundingSphere(r,i)}};i5.prototype.stop=function(){l(this.activeCamera)&&this.activeCamera.cancelFlight(),l(this.activeCallback)&&this.activeCallback(!0)};i5.prototype.getCameraOptions=function(e){let t={duration:this.duration};return l(this.activeCallback)&&(t.complete=this.activeCallback),this.flyToMode==="smooth"&&(t.easingFunction=ya.LINEAR_NONE),this.view.headingPitchRoll?(t.destination=this.view.position,t.orientation=this.view.headingPitchRoll):this.view.headingPitchRange&&(t.offset=this.view.headingPitchRange),l(e)&&(t=Ot(t,e)),t};var r5=i5;function Iie(e){this.type="KmlTourWait",this.blocking=!0,this.duration=e,this.timeout=null}Iie.prototype.play=function(e){let t=this;this.activeCallback=e,this.timeout=setTimeout(function(){delete t.activeCallback,e(!1)},this.duration*1e3)};Iie.prototype.stop=function(){clearTimeout(this.timeout),l(this.activeCallback)&&this.activeCallback(!0)};var o5=Iie;var HRe={avi:"video/x-msvideo",bmp:"image/bmp",bz2:"application/x-bzip2",chm:"application/vnd.ms-htmlhelp",css:"text/css",csv:"text/csv",doc:"application/msword",dvi:"application/x-dvi",eps:"application/postscript",flv:"video/x-flv",gif:"image/gif",gz:"application/x-gzip",htm:"text/html",html:"text/html",ico:"image/vnd.microsoft.icon",jnlp:"application/x-java-jnlp-file",jpeg:"image/jpeg",jpg:"image/jpeg",m3u:"audio/x-mpegurl",m4v:"video/mp4",mathml:"application/mathml+xml",mid:"audio/midi",midi:"audio/midi",mov:"video/quicktime",mp3:"audio/mpeg",mp4:"video/mp4",mp4v:"video/mp4",mpeg:"video/mpeg",mpg:"video/mpeg",odp:"application/vnd.oasis.opendocument.presentation",ods:"application/vnd.oasis.opendocument.spreadsheet",odt:"application/vnd.oasis.opendocument.text",ogg:"application/ogg",pdf:"application/pdf",png:"image/png",pps:"application/vnd.ms-powerpoint",ppt:"application/vnd.ms-powerpoint",ps:"application/postscript",qt:"video/quicktime",rdf:"application/rdf+xml",rss:"application/rss+xml",rtf:"application/rtf",svg:"image/svg+xml",swf:"application/x-shockwave-flash",text:"text/plain",tif:"image/tiff",tiff:"image/tiff",txt:"text/plain",wav:"audio/x-wav",wma:"audio/x-ms-wma",wmv:"video/x-ms-wmv",xml:"application/xml",zip:"application/zip",detectFromFilename:function(e){let t=e.toLowerCase();return t=e_(t),HRe[t]}},kie;typeof DOMParser<"u"&&(kie=new DOMParser);var TBt=new nG({stripPrefix:!1,email:!1,replaceFn:function(e){return e.urlMatchType==="scheme"||e.urlMatchType==="www"}}),wA=32,LRe=2414016,NRe=1,FRe=16093e3,BRe=.1,kRe=[null,void 0,"http://www.opengis.net/kml/2.2","http://earth.google.com/kml/2.2","http://earth.google.com/kml/2.1","http://earth.google.com/kml/2.0"],zRe=["http://www.google.com/kml/ext/2.2"],CBt=["http://www.w3.org/2005/Atom"],Ue={kml:kRe,gx:zRe,atom:CBt,kmlgx:kRe.concat(zRe)},zie={Document:QRe,Folder:jBt,Placemark:HBt,NetworkLink:ZBt,GroundOverlay:KBt,PhotoOverlay:nOe,ScreenOverlay:XBt,Tour:WBt},Mie=class{constructor(t){this._dataSource=t,this._deferred=Vu(),this._stack=[],this._promises=[],this._timeoutSet=!1,this._used=!1,this._started=0,this._timeThreshold=1e3}get dataSource(){return this._dataSource}addNodes(t,n){this._stack.push({nodes:t,index:0,processingData:n}),this._used=!0}addPromise(t){this._promises.push(t)}wait(){let t=this._deferred;return this._used||t.resolve(),Promise.all([t.promise,Promise.all(this._promises)])}process(){let t=this._stack.length===1;return t&&(this._started=Hg._getTimestamp()),this._process(t)}_giveUpTime(){if(this._timeoutSet)return;this._timeoutSet=!0,this._timeThreshold=50;let t=this;setTimeout(function(){t._timeoutSet=!1,t._started=Hg._getTimestamp(),t._process(!0)},0)}_nextNode(){let t=this._stack,n=t[t.length-1],i=n.index,r=n.nodes;if(i!==r.length)return++n.index,r[i]}_pop(){let t=this._stack;return t.pop(),t.length===0?(this._deferred.resolve(),!1):!0}_process(t){let n=this.dataSource,i=this._stack[this._stack.length-1].processingData,r=this._nextNode();for(;l(r);){let o=zie[r.localName];if(l(o)&&(Ue.kml.indexOf(r.namespaceURI)!==-1||Ue.gx.indexOf(r.namespaceURI)!==-1)&&(o(n,r,i,this),this._timeoutSet||Hg._getTimestamp()>this._started+this._timeThreshold)){this._giveUpTime();return}r=this._nextNode()}this._pop()&&t&&this._process(!0)}};function vBt(e){let t=e.slice(0,Math.min(4,e.size)),n=Vu(),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 EBt(e){let t=Vu(),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 GRe(e){let t={xsi:"http://www.w3.org/2001/XMLSchema-instance"},n,i,r,o;for(let a in t)t.hasOwnProperty(a)&&(r=RegExp(`[< ]${a}:`),o=`xmlns:${a}=`,r.test(e)&&e.indexOf(o)===-1&&(l(n)||(n=e.substr(0,e.indexOf("<kml")+4),i=e.substr(n.length)),n+=` ${o}"${t[a]}"`));return l(n)&&(e=n+i),e}function WRe(e){let t=e.indexOf("xmlns:"),n=e.indexOf(">",t),i,r,o;for(;t!==-1&&t<n;)i=e.slice(t,e.indexOf('"',t)),r=t,t=e.indexOf(i,t+1),t!==-1?(o=e.indexOf('"',e.indexOf('"',t)+1),e=e.slice(0,t-1)+e.slice(o+1,e.length),t=e.indexOf("xmlns:",r-1)):t=e.indexOf("xmlns:",r+1);return e}async function SBt(e,t){let n=await e.getData(new $R);n=GRe(n),n=WRe(n),t.kml=kie.parseFromString(n,"application/xml")}async function Pie(e,t){let n=HRe.detectFromFilename(e.filename)??"application/octet-stream",i=await e.getData(new XR(n));t[e.filename]=i}function Pf(e,t,n,i){let r=i.keys,o=new xO.default("."),a=e.querySelectorAll(t);for(let s=0;s<a.length;s++){let c=a[s],u=c.getAttribute(n);if(l(u)){let d=new xO.default(u).absoluteTo(o).toString(),p=r.indexOf(d);if(p!==-1){let g=r[p];c.setAttribute(n,i[g]),t==="a"&&c.getAttribute("download")===null&&c.setAttribute("download",g)}}}}function Df(e,t,n,i){let r=e.querySelectorAll(t);for(let o=0;o<r.length;o++){let a=r[o],s=a.getAttribute(n),c=Uie(s,i);l(c)&&a.setAttribute(n,c.url)}}function qRe(e,t,n){let i=_s(e,"id");i=l(i)&&i.length!==0?i:Kn(),l(n)&&(i=n+i);let r=t.getById(i);return l(r)&&(i=Kn(),l(n)&&(i=n+i)),r=t.add(new $r({id:i})),l(r.kml)||(r.addProperty("kml"),r.kml=new Bie),r}function TO(e,t){return e==="absolute"||e==="relativeToGround"||t==="relativeToSeaFloor"}function l5(e,t){if(!l(e))return h.fromDegrees(0,0,0,t);let n=e.match(/[^\s,\n]+/g);if(!l(n))return h.fromDegrees(0,0,0,t);let i=parseFloat(n[0]),r=parseFloat(n[1]),o=parseFloat(n[2]);return i=isNaN(i)?0:i,r=isNaN(r)?0:r,o=isNaN(o)?0:o,h.fromDegrees(i,r,o,t)}function a5(e,t){if(!l(e))return;let n=e.textContent.match(/[^\s\n]+/g);if(!l(n))return;let i=n.length,r=new Array(i),o=0;for(let a=0;a<i;a++)r[o++]=l5(n[a],t);return r}function IA(e,t){if(!l(e))return;let n=e.getAttribute(t);if(n!==null){let i=parseFloat(n);return isNaN(i)?void 0:i}}function _s(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function Xi(e,t,n){if(!l(e))return;let i=e.childNodes,r=i.length;for(let o=0;o<r;o++){let a=i[o];if(a.localName===t&&n.indexOf(a.namespaceURI)!==-1)return a}}function URe(e,t,n){if(!l(e))return;let i=[],r=e.getElementsByTagNameNS("*",t),o=r.length;for(let a=0;a<o;a++){let s=r[a];s.localName===t&&n.indexOf(s.namespaceURI)!==-1&&i.push(s)}return i}function sm(e,t,n){if(!l(e))return[];let i=[],r=e.childNodes,o=r.length;for(let a=0;a<o;a++){let s=r[a];s.localName===t&&n.indexOf(s.namespaceURI)!==-1&&i.push(s)}return i}function xi(e,t,n){let i=Xi(e,t,n);if(l(i)){let r=parseFloat(i.textContent);return isNaN(r)?void 0:r}}function Bn(e,t,n){let i=Xi(e,t,n);if(l(i))return i.textContent.trim()}function cm(e,t,n){let i=Xi(e,t,n);if(l(i)){let r=i.textContent.trim();return r==="1"||/^true$/i.test(r)}}function Uie(e,t,n){if(!l(e))return;let i;if(l(n)){e=e.replace(/\\/g,"/");let r=n[e];if(l(r))i=new De({url:r});else{let o=new xO.default(t.getUrlComponent()),a=new xO.default(e);r=n[a.absoluteTo(o)],l(r)&&(i=new De({url:r}))}}return l(i)||(i=t.getDerivedResource({url:e})),i}var Lu={maximumRed:void 0,red:void 0,maximumGreen:void 0,green:void 0,maximumBlue:void 0,blue:void 0};function Lie(e,t){if(!l(e)||/^\s*$/gm.test(e))return;e[0]==="#"&&(e=e.substring(1));let n=parseInt(e.substring(0,2),16)/255,i=parseInt(e.substring(2,4),16)/255,r=parseInt(e.substring(4,6),16)/255,o=parseInt(e.substring(6,8),16)/255;return t?(o>0?(Lu.maximumRed=o,Lu.red=void 0):(Lu.maximumRed=void 0,Lu.red=0),r>0?(Lu.maximumGreen=r,Lu.green=void 0):(Lu.maximumGreen=void 0,Lu.green=0),i>0?(Lu.maximumBlue=i,Lu.blue=void 0):(Lu.maximumBlue=void 0,Lu.blue=0),Lu.alpha=n,U.fromRandom(Lu)):new U(o,r,i,n)}function fT(e,t,n){let i=Bn(e,t,n);if(l(i))return Lie(i,Bn(e,"colorMode",n)==="random")}function wBt(e){let t=Xi(e,"TimeStamp",Ue.kmlgx),n=Bn(t,"when",Ue.kmlgx);if(!l(t)||!l(n)||n.length===0)return;let i=K.fromIso8601(n),r=new xa;return r.addInterval(new Cn({start:i,stop:Qe.MAXIMUM_VALUE})),r}function IBt(e){let t=Xi(e,"TimeSpan",Ue.kmlgx);if(!l(t))return;let n,i=Xi(t,"begin",Ue.kmlgx),r=l(i)?K.fromIso8601(i.textContent):void 0,o=Xi(t,"end",Ue.kmlgx),a=l(o)?K.fromIso8601(o.textContent):void 0;if(l(r)&&l(a)){if(K.lessThan(a,r)){let s=r;r=a,a=s}n=new xa,n.addInterval(new Cn({start:r,stop:a}))}else l(r)?(n=new xa,n.addInterval(new Cn({start:r,stop:Qe.MAXIMUM_VALUE}))):l(a)&&(n=new xa,n.addInterval(new Cn({start:Qe.MINIMUM_VALUE,stop:a})));return n}function YRe(){let e=new Pl;return e.width=wA,e.height=wA,e.scaleByDistance=new Wt(LRe,NRe,FRe,BRe),e.pixelOffsetScaleByDistance=new Wt(LRe,NRe,FRe,BRe),e}function Vie(){let e=new ap;return e.outline=!0,e.outlineColor=U.WHITE,e}function XRe(){let e=new op;return e.translucencyByDistance=new Wt(3e6,1,5e6,0),e.pixelOffset=new k(17,0),e.horizontalOrigin=ji.LEFT,e.font="16px sans-serif",e.style=bo.FILL_AND_OUTLINE,e}function jie(e,t,n,i,r){let o=Bn(e,"href",Ue.kml);if(!l(o)||o.length===0)return;if(o.indexOf("root://icons/palette-")===0){let s=o.charAt(21),c=xi(e,"x",Ue.gx)??0,u=xi(e,"y",Ue.gx)??0;c=Math.min(c/32,7),u=7-Math.min(u/32,7);let f=8*u+c;o=`https://maps.google.com/mapfiles/kml/pal${s}/icon${f}.png`}let a=Uie(o,n,i);if(r){let s=Bn(e,"refreshMode",Ue.kml),c=Bn(e,"viewRefreshMode",Ue.kml);s==="onInterval"||s==="onExpire"?pt(`kml-refreshMode-${s}`,`KML - Unsupported Icon refreshMode: ${s}`):(c==="onStop"||c==="onRegion")&&pt(`kml-refreshMode-${c}`,`KML - Unsupported Icon viewRefreshMode: ${c}`);let u=Bn(e,"viewBoundScale",Ue.kml)??1,f=c==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",d=Bn(e,"viewFormat",Ue.kml)??f,p=Bn(e,"httpQuery",Ue.kml);l(d)&&a.setQueryParameters(kf(c5(d))),l(p)&&a.setQueryParameters(kf(c5(p)));let g=t._ellipsoid;return Gie(a,t.camera,t.canvas,u,t._lastCameraView.bbox,g),a}return a}function PBt(e,t,n,i,r){let o=xi(t,"scale",Ue.kml),a=xi(t,"heading",Ue.kml),s=fT(t,"color",Ue.kml),c=Xi(t,"Icon",Ue.kml),u=jie(c,e,i,r,!1);l(c)&&!l(u)&&(u=!1);let f=xi(c,"x",Ue.gx),d=xi(c,"y",Ue.gx),p=xi(c,"w",Ue.gx),g=xi(c,"h",Ue.gx),m=Xi(t,"hotSpot",Ue.kml),y=IA(m,"x"),A=IA(m,"y"),b=_s(m,"xunits"),x=_s(m,"yunits"),T=n.billboard;l(T)||(T=YRe(),n.billboard=T),T.image=u,T.scale=o,T.color=s,(l(f)||l(d)||l(p)||l(g))&&(T.imageSubRegion=new Je(f,d,p,g)),l(a)&&a!==0&&(T.rotation=I.toRadians(-a),T.alignedAxis=h.UNIT_Z),o=o??1;let C,E;l(y)&&(b==="pixels"?C=-y*o:b==="insetPixels"?C=(y-wA)*o:b==="fraction"&&(C=-y*wA*o),C+=wA*.5*o),l(A)&&(x==="pixels"?E=A*o:x==="insetPixels"?E=(-A+wA)*o:x==="fraction"&&(E=A*wA*o),E-=wA*.5*o),(l(C)||l(E))&&(T.pixelOffset=new k(C,E))}function s5(e,t,n,i,r){for(let o=0,a=t.childNodes.length;o<a;o++){let s=t.childNodes.item(o);if(s.localName==="IconStyle")PBt(e,s,n,i,r);else if(s.localName==="LabelStyle"){let c=n.label;l(c)||(c=XRe(),n.label=c),c.scale=xi(s,"scale",Ue.kml)??c.scale,c.fillColor=fT(s,"color",Ue.kml)??c.fillColor,c.text=n.name}else if(s.localName==="LineStyle"){let c=n.polyline;l(c)||(c=new Dl,n.polyline=c),c.width=xi(s,"width",Ue.kml),c.material=fT(s,"color",Ue.kml),l(fT(s,"outerColor",Ue.gx))&&pt("kml-gx:outerColor","KML - gx:outerColor is not supported in a LineStyle"),l(xi(s,"outerWidth",Ue.gx))&&pt("kml-gx:outerWidth","KML - gx:outerWidth is not supported in a LineStyle"),l(xi(s,"physicalWidth",Ue.gx))&&pt("kml-gx:physicalWidth","KML - gx:physicalWidth is not supported in a LineStyle"),l(cm(s,"labelVisibility",Ue.gx))&&pt("kml-gx:labelVisibility","KML - gx:labelVisibility is not supported in a LineStyle")}else if(s.localName==="PolyStyle"){let c=n.polygon;l(c)||(c=Vie(),n.polygon=c),c.material=fT(s,"color",Ue.kml)??c.material,c.fill=cm(s,"fill",Ue.kml)??c.fill,c.outline=cm(s,"outline",Ue.kml)??c.outline}else if(s.localName==="BalloonStyle"){let c=Lie(Bn(s,"bgColor",Ue.kml))??U.WHITE,u=Lie(Bn(s,"textColor",Ue.kml))??U.BLACK,f=Bn(s,"text",Ue.kml);n.addProperty("balloonStyle"),n.balloonStyle={bgColor:c,textColor:u,text:f}}else if(s.localName==="ListStyle"){let c=Bn(s,"listItemType",Ue.kml);(c==="radioFolder"||c==="checkOffOnly")&&pt(`kml-listStyle-${c}`,`KML - Unsupported ListStyle with listItemType: ${c}`)}}}function DBt(e,t,n,i,r){let o=new $r,a,s=-1,c=t.childNodes,u=c.length;for(let d=0;d<u;d++){let p=c[d];(p.localName==="Style"||p.localName==="StyleMap")&&(s=d)}if(s!==-1){let d=c[s];if(d.localName==="Style")s5(e,d,o,i,r);else{let p=sm(d,"Pair",Ue.kml);for(let g=0;g<p.length;g++){let m=p[g],y=Bn(m,"key",Ue.kml);if(y==="normal"){let A=Bn(m,"styleUrl",Ue.kml);if(l(A))a=n.getById(A),l(a)||(a=n.getById(`#${A}`)),l(a)&&o.merge(a);else{let b=Xi(m,"Style",Ue.kml);s5(e,b,o,i,r)}}else pt(`kml-styleMap-${y}`,`KML - Unsupported StyleMap key: ${y}`)}}}let f=Bn(t,"styleUrl",Ue.kml);if(l(f)){let d=f;if(f[0]!=="#"&&f.indexOf("#")!==-1){let p=f.split("#"),g=p[0];d=`${i.getDerivedResource({url:g}).getUrlComponent()}#${p[1]}`}a=n.getById(d),l(a)||(a=n.getById(`#${d}`)),l(a)&&o.merge(a)}return o}function RBt(e,t,n){return t.fetchXML().then(function(i){return KRe(e,i,n,t,!0)})}function KRe(e,t,n,i,r,o){let a,s,c,u,f=URe(t,"Style",Ue.kml);if(l(f)){let y=f.length;for(a=0;a<y;a++)u=f[a],s=_s(u,"id"),l(s)&&(s=`#${s}`,r&&l(i)&&(s=i.getUrlComponent()+s),l(n.getById(s))||(c=new $r({id:s}),n.add(c),s5(e,u,c,i,o)))}let d=URe(t,"StyleMap",Ue.kml);if(l(d)){let y=d.length;for(a=0;a<y;a++){let A=d[a];if(s=_s(A,"id"),l(s)){let b=sm(A,"Pair",Ue.kml);for(let x=0;x<b.length;x++){let T=b[x],C=Bn(T,"key",Ue.kml);if(C==="normal"){if(s=`#${s}`,r&&l(i)&&(s=i.getUrlComponent()+s),!l(n.getById(s))){c=n.getOrCreateEntity(s);let E=Bn(T,"styleUrl",Ue.kml);if(l(E)){E[0]!=="#"&&(E=`#${E}`),r&&l(i)&&(E=i.getUrlComponent()+E);let w=n.getById(E);l(w)&&c.merge(w)}else u=Xi(T,"Style",Ue.kml),s5(e,u,c,i,o)}}else pt(`kml-styleMap-${C}`,`KML - Unsupported StyleMap key: ${C}`)}}}}let p=[],g=t.getElementsByTagName("styleUrl"),m=g.length;for(a=0;a<m;a++){let y=g[a].textContent;if(y[0]!=="#"){let A=y.split("#");if(A.length===2){let b=A[0],x=i.getDerivedResource({url:b});p.push(RBt(e,x,n))}}}return p}function Hie(e,t,n){let i=new Yy(e,t.id,["position"]),r=new bg(t.position);t.polyline=l(n.polyline)?n.polyline.clone():new Dl,t.polyline.positions=new mA([i,r])}function $Re(e,t){return!l(e)&&!l(t)||e==="clampToGround"?it.CLAMP_TO_GROUND:e==="relativeToGround"?it.RELATIVE_TO_GROUND:e==="absolute"?it.NONE:t==="clampToSeaFloor"?(pt("kml-gx:altitudeMode-clampToSeaFloor","KML - <gx:altitudeMode>:clampToSeaFloor is currently not supported, using <kml:altitudeMode>:clampToGround."),it.CLAMP_TO_GROUND):t==="relativeToSeaFloor"?(pt("kml-gx:altitudeMode-relativeToSeaFloor","KML - <gx:altitudeMode>:relativeToSeaFloor is currently not supported, using <kml:altitudeMode>:relativeToGround."),it.RELATIVE_TO_GROUND):(l(e)?pt("kml-altitudeMode-unknown",`KML - Unknown <kml:altitudeMode>:${e}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`):pt("kml-gx:altitudeMode-unknown",`KML - Unknown <gx:altitudeMode>:${t}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`),it.CLAMP_TO_GROUND)}function OBt(e,t,n){return n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround"?e:((l(t)&&t!=="clampToGround"||l(n)&&n!=="clampToSeaFloor")&&pt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${t??n}`),new bg(e))}function MBt(e,t,n,i){if(!l(e))return;if(n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround")return e;(l(t)&&t!=="clampToGround"||l(n)&&n!=="clampToSeaFloor")&&pt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${t??n}`);let r=e.length;for(let o=0;o<r;o++){let a=e[o];i.scaleToGeodeticSurface(a,a)}return e}function u5(e,t,n,i){let r=t.label;l(r)||(r=l(n.label)?n.label.clone():XRe(),t.label=r),r.text=t.name;let o=t.billboard;if(l(o)||(o=l(n.billboard)?n.billboard.clone():YRe(),t.billboard=o),l(o.image)?o.image.getValue()||(o.image=void 0):o.image=e._pinBuilder.fromColor(U.YELLOW,64),l(o.scale)){let a=o.scale.getValue();a!==0?r.pixelOffset=new k(a*16+1,0):(r.pixelOffset=void 0,r.horizontalOrigin=void 0)}l(i)&&e._clampToGround&&(o.heightReference=i,r.heightReference=i)}function JRe(e,t){let n=e.path;l(n)||(n=new hy,n.leadTime=0,e.path=n);let i=t.polyline;l(i)&&(n.material=i.material,n.width=i.width)}function LBt(e,t,n,i,r){let o=Bn(n,"coordinates",Ue.kml),a=Bn(n,"altitudeMode",Ue.kml),s=Bn(n,"altitudeMode",Ue.gx),c=cm(n,"extrude",Ue.kml),u=e._ellipsoid,f=l5(o,u);return i.position=f,u5(e,i,r,$Re(a,s)),c&&TO(a,s)&&Hie(t,i,r),!0}function VRe(e,t,n,i,r){let o=Xi(n,"coordinates",Ue.kml),a=Bn(n,"altitudeMode",Ue.kml),s=Bn(n,"altitudeMode",Ue.gx),c=cm(n,"extrude",Ue.kml),u=cm(n,"tessellate",Ue.kml),f=TO(a,s),d=xi(n,"drawOrder",Ue.gx),p=e._ellipsoid,g=a5(o,p),m=r.polyline;if(f&&c){let y=new my;i.wall=y,y.positions=g;let A=r.polygon;l(A)&&(y.fill=A.fill,y.material=A.material),y.outline=!0,l(m)?(y.outlineColor=l(m.material)?m.material.color:U.WHITE,y.outlineWidth=m.width):l(A)&&(y.outlineColor=l(A.material)?A.material.color:U.WHITE)}else if(e._clampToGround&&!f&&u){let y=new Dl;y.clampToGround=!0,i.polyline=y,y.positions=g,l(m)?(y.material=l(m.material)?m.material.color.getValue(Qe.MINIMUM_VALUE):U.WHITE,y.width=m.width??1):(y.material=U.WHITE,y.width=1),y.zIndex=d}else l(d)&&pt("kml-gx:drawOrder","KML - gx:drawOrder is not supported in LineStrings when clampToGround is false"),e._clampToGround&&!u&&pt("kml-line-tesselate","Ignoring clampToGround for KML lines without the tessellate flag."),m=l(m)?m.clone():new Dl,i.polyline=m,m.positions=MBt(g,a,s,p),(!u||f)&&(m.arcType=sn.NONE);return!0}function NBt(e,t,n,i,r){let o=Xi(n,"outerBoundaryIs",Ue.kml),a=Xi(o,"LinearRing",Ue.kml),s=Xi(a,"coordinates",Ue.kml),c=e._ellipsoid,u=a5(s,c),f=cm(n,"extrude",Ue.kml),d=Bn(n,"altitudeMode",Ue.kml),p=Bn(n,"altitudeMode",Ue.gx),g=TO(d,p),m=l(r.polygon)?r.polygon.clone():Vie(),y=r.polyline;if(l(y)&&(m.outlineColor=l(y.material)?y.material.color:U.WHITE,m.outlineWidth=y.width),i.polygon=m,g?(m.perPositionHeight=!0,m.extrudedHeight=f?0:void 0):e._clampToGround||(m.height=0),l(u)){let A=new Vc(u),b=sm(n,"innerBoundaryIs",Ue.kml);for(let x=0;x<b.length;x++){a=sm(b[x],"LinearRing",Ue.kml);for(let T=0;T<a.length;T++)s=Xi(a[T],"coordinates",Ue.kml),u=a5(s,c),l(u)&&A.holes.push(new Vc(u))}m.hierarchy=A}return!0}function FBt(e,t,n,i,r){let o=Bn(n,"altitudeMode",Ue.kml),a=Bn(n,"altitudeMode",Ue.gx),s=sm(n,"coord",Ue.gx),c=sm(n,"angles",Ue.gx),u=sm(n,"when",Ue.kml),f=cm(n,"extrude",Ue.kml),d=TO(o,a),p=e._ellipsoid;c.length>0&&pt("kml-gx:angles","KML - gx:angles are not supported in gx:Tracks");let g=Math.min(s.length,u.length),m=[],y=[];for(let b=0;b<g;b++){let x=l5(s[b].textContent,p);m.push(x),y.push(K.fromIso8601(u[b].textContent))}let A=new vc;return A.addSamples(y,m),i.position=A,u5(e,i,r,$Re(o,a)),JRe(i,r),i.availability=new xa,u.length>0&&i.availability.addInterval(new Cn({start:y[0],stop:y[y.length-1]})),d&&f&&Hie(t,i,r),!0}function jRe(e,t,n,i,r,o,a,s,c){let u=e[0],f=e[e.length-1],d=new vc;d.addSamples(e,t),n.intervals.addInterval(new Cn({start:u,stop:f,isStartIncluded:c,isStopIncluded:c,data:OBt(d,a,s)})),i.addInterval(new Cn({start:u,stop:f,isStartIncluded:c,isStopIncluded:c})),r.intervals.addInterval(new Cn({start:u,stop:f,isStartIncluded:c,isStopIncluded:c,data:o}))}function BBt(e,t,n,i,r){let o=cm(n,"interpolate",Ue.gx),a=sm(n,"Track",Ue.gx),s,c,u,f=!1,d=new gA,p=new xa,g=new Cc,m=e._ellipsoid;for(let y=0,A=a.length;y<A;y++){let b=a[y],x=sm(b,"when",Ue.kml),T=sm(b,"coord",Ue.gx),C=Bn(b,"altitudeMode",Ue.kml),E=Bn(b,"altitudeMode",Ue.gx),w=TO(C,E),D=cm(b,"extrude",Ue.kml),R=Math.min(T.length,x.length),M=[];s=[];for(let N=0;N<R;N++){let _=l5(T[N].textContent,m);M.push(_),s.push(K.fromIso8601(x[N].textContent))}o&&(l(c)&&jRe([c,s[0]],[u,M[0]],g,p,d,!1,"absolute",void 0,!1),c=s[R-1],u=M[M.length-1]),jRe(s,M,g,p,d,w&&D,C,E,!0),f=f||w&&D}return i.availability=p,i.position=g,u5(e,i,r),JRe(i,r),f&&(Hie(t,i,r),i.polyline.show=d),!0}var ZRe={Point:LBt,LineString:VRe,LinearRing:VRe,Polygon:NBt,Track:FBt,MultiTrack:BBt,MultiGeometry:kBt,Model:zBt};function kBt(e,t,n,i,r,o){let a=n.childNodes,s=!1;for(let c=0,u=a.length;c<u;c++){let f=a.item(c),d=ZRe[f.localName];if(l(d)){let p=qRe(f,t,o);p.parent=i,p.name=i.name,p.availability=i.availability,p.description=i.description,p.kml=i.kml,d(e,t,f,p,r)&&(s=!0)}}return s}function zBt(e,t,n,i,r){return pt("kml-unsupportedGeometry",`KML - Unsupported geometry: ${n.localName}`),!1}function UBt(e,t){let n=Xi(e,"ExtendedData",Ue.kml);if(!l(n))return;l(Xi(n,"SchemaData",Ue.kml))&&pt("kml-schemaData","KML - SchemaData is unsupported"),l(_s(n,"xmlns:prefix"))&&pt("kml-extendedData","KML - ExtendedData with xmlns:prefix is unsupported");let i={},r=sm(n,"Data",Ue.kml);if(l(r)){let o=r.length;for(let a=0;a<o;a++){let s=r[a],c=_s(s,"name");l(c)&&(i[c]={displayName:Bn(s,"displayName",Ue.kml),value:Bn(s,"value",Ue.kml)})}}t.kml.extendedData=i}var Fr;typeof document<"u"&&(Fr=document.createElement("div"));function VBt(e,t,n,i,r){let o,a,s,c=t.kml,u=c.extendedData,f=Bn(e,"description",Ue.kml),d=t.balloonStyle??n.balloonStyle,p=U.WHITE,g=U.BLACK,m=f;l(d)&&(p=d.bgColor??U.WHITE,g=d.textColor??U.BLACK,m=d.text??f);let y;if(l(m)){if(m=m.replace("$[name]",t.name??""),m=m.replace("$[description]",f??""),m=m.replace("$[address]",c.address??""),m=m.replace("$[Snippet]",c.snippet??""),m=m.replace("$[id]",t.id),m=m.replace("$[geDirections]",""),l(u)){let x=m.match(/\$\[.+?\]/g);if(x!==null)for(o=0;o<x.length;o++){let T=x[o],C=T.substr(2,T.length-3),E=/\/displayName$/.test(C);C=C.replace(/\/displayName$/,""),y=u[C],l(y)&&(y=E?y.displayName:y.value),l(y)&&(m=m.replace(T,y??""))}}}else if(l(u)&&(s=Object.keys(u),s.length>0)){for(m='<table class="cesium-infoBox-defaultTable cesium-infoBox-defaultTable-lighter"><tbody>',o=0;o<s.length;o++)a=s[o],y=u[a],m+=`<tr><th>${y.displayName??a}</th><td>${y.value??""}</td></tr>`;m+="</tbody></table>"}if(!l(m))return;m=TBt.link(m),Fr.innerHTML=m;let A=Fr.querySelectorAll("a");for(o=0;o<A.length;o++)A[o].setAttribute("target","_blank");l(i)&&i.keys.length>1&&(Pf(Fr,"a","href",i),Pf(Fr,"link","href",i),Pf(Fr,"area","href",i),Pf(Fr,"img","src",i),Pf(Fr,"iframe","src",i),Pf(Fr,"video","src",i),Pf(Fr,"audio","src",i),Pf(Fr,"source","src",i),Pf(Fr,"track","src",i),Pf(Fr,"input","src",i),Pf(Fr,"embed","src",i),Pf(Fr,"script","src",i),Pf(Fr,"video","poster",i)),Df(Fr,"a","href",r),Df(Fr,"link","href",r),Df(Fr,"area","href",r),Df(Fr,"img","src",r),Df(Fr,"iframe","src",r),Df(Fr,"video","src",r),Df(Fr,"audio","src",r),Df(Fr,"source","src",r),Df(Fr,"track","src",r),Df(Fr,"input","src",r),Df(Fr,"embed","src",r),Df(Fr,"script","src",r),Df(Fr,"video","poster",r);let b='<div class="cesium-infoBox-description-lighter" style="';b+="overflow:auto;",b+="word-wrap:break-word;",b+=`background-color:${p.toCssColorString()};`,b+=`color:${g.toCssColorString()};`,b+='">',b+=`${Fr.innerHTML}</div>`,Fr.innerHTML="",t.description=b}function f5(e,t,n){let i=n.entityCollection,r=n.parentEntity,o=n.sourceResource,a=n.uriResolver,s=qRe(t,i,n.context),c=s.kml,u=DBt(e,t,n.styleCollection,o,a),f=Bn(t,"name",Ue.kml);s.name=f,s.parent=r;let d=IBt(t);l(d)||(d=wBt(t)),s.availability=d,Wie(s);function p(T){return T?T.show&&p(T.parent):!0}let g=cm(t,"visibility",Ue.kml);s.show=p(r)&&(g??!0);let m=Xi(t,"author",Ue.atom),y=c.author;y.name=Bn(m,"name",Ue.atom),y.uri=Bn(m,"uri",Ue.atom),y.email=Bn(m,"email",Ue.atom);let A=Xi(t,"link",Ue.atom),b=c.link;b.href=_s(A,"href"),b.hreflang=_s(A,"hreflang"),b.rel=_s(A,"rel"),b.type=_s(A,"type"),b.title=_s(A,"title"),b.length=_s(A,"length"),c.address=Bn(t,"address",Ue.kml),c.phoneNumber=Bn(t,"phoneNumber",Ue.kml),c.snippet=Bn(t,"Snippet",Ue.kml),UBt(t,s),VBt(t,s,u,a,o);let x=e._ellipsoid;return tOe(t,s,x),eOe(t,s,x),l(Xi(t,"Region",Ue.kml))&&pt("kml-region","KML - Placemark Regions are unsupported"),{entity:s,styleEntity:u}}function QRe(e,t,n,i){i.addNodes(t.childNodes,n),i.process()}function jBt(e,t,n,i){let r=f5(e,t,n),o=Xe(n);o.parentEntity=r.entity,QRe(e,t,o,i)}function HBt(e,t,n,i){let r=f5(e,t,n),o=r.entity,a=r.styleEntity,s=!1,c=t.childNodes;for(let u=0,f=c.length;u<f&&!s;u++){let d=c.item(u),p=ZRe[d.localName];l(p)&&(p(e,n.entityCollection,d,o,a,o.id),s=!0)}s||(o.merge(a),u5(e,o,a))}var GBt={FlyTo:YBt,Wait:qBt,SoundCue:Die,AnimatedUpdate:Die,TourControl:Die};function WBt(e,t,n,i){let r=Bn(t,"name",Ue.kml),o=_s(t,"id"),a=new n5(r,o),s=Xi(t,"Playlist",Ue.gx);if(s){let c=e._ellipsoid,u=s.childNodes;for(let f=0;f<u.length;f++){let d=u[f];if(d.localName){let p=GBt[d.localName];p?p(a,d,c):console.log(`Unknown KML Tour playlist entry type ${d.localName}`)}}}e._kmlTours.push(a)}function Die(e,t){pt(`KML Tour unsupported node ${t.localName}`)}function qBt(e,t){let n=xi(t,"duration",Ue.gx);e.addPlaylistEntry(new o5(n))}function YBt(e,t,n){let i=xi(t,"duration",Ue.gx),r=Bn(t,"flyToMode",Ue.gx),o={kml:{}};tOe(t,o,n),eOe(t,o,n);let a=o.kml.lookAt||o.kml.camera,s=new r5(i,r,a);e.addPlaylistEntry(s)}function eOe(e,t,n){let i=Xi(e,"Camera",Ue.kml);if(l(i)){let r=xi(i,"longitude",Ue.kml)??0,o=xi(i,"latitude",Ue.kml)??0,a=xi(i,"altitude",Ue.kml)??0,s=xi(i,"heading",Ue.kml)??0,c=xi(i,"tilt",Ue.kml)??0,u=xi(i,"roll",Ue.kml)??0,f=h.fromDegrees(r,o,a,n),d=Oc.fromDegrees(s,c-90,u);t.kml.camera=new oG(f,d)}}function tOe(e,t,n){let i=Xi(e,"LookAt",Ue.kml);if(l(i)){let r=xi(i,"longitude",Ue.kml)??0,o=xi(i,"latitude",Ue.kml)??0,a=xi(i,"altitude",Ue.kml)??0,s=xi(i,"heading",Ue.kml),c=xi(i,"tilt",Ue.kml),u=xi(i,"range",Ue.kml)??0;c=I.toRadians(c??0),s=I.toRadians(s??0);let f=new ph(s,c-I.PI_OVER_TWO,u),d=h.fromDegrees(r,o,a,n);t.kml.lookAt=new e5(d,f)}}function XBt(e,t,n,i){let r=n.screenOverlayContainer;if(!l(r))return;let o=n.sourceResource,a=n.uriResolver,s=Xi(t,"Icon",Ue.kml),c=jie(s,e,o,a,!1);if(!l(c))return;let u=document.createElement("img");e._screenOverlays.push(u),u.src=c.url,u.onload=function(){let f=["position: absolute"],d=Xi(t,"screenXY",Ue.kml),p=Xi(t,"overlayXY",Ue.kml),g=Xi(t,"size",Ue.kml),m,y,A,b,x,T;l(g)&&(m=IA(g,"x"),y=IA(g,"y"),A=_s(g,"xunits"),b=_s(g,"yunits"),l(m)&&m!==-1&&m!==0&&(A==="fraction"?x=`width: ${Math.floor(m*100)}%`:A==="pixels"&&(x=`width: ${m}px`),f.push(x)),l(y)&&y!==-1&&y!==0&&(b==="fraction"?T=`height: ${Math.floor(y*100)}%`:b==="pixels"&&(T=`height: ${y}px`),f.push(T))),u.style=f.join(";");let C=0,E=u.height;l(p)&&(m=IA(p,"x"),y=IA(p,"y"),A=_s(p,"xunits"),b=_s(p,"yunits"),l(m)&&(A==="fraction"?C=m*u.width:(A==="pixels"||A==="insetPixels")&&(C=m)),l(y)&&(b==="fraction"?E=y*u.height:(b==="pixels"||b==="insetPixels")&&(E=y))),l(d)&&(m=IA(d,"x"),y=IA(d,"y"),A=_s(d,"xunits"),b=_s(d,"yunits"),l(m)&&(A==="fraction"?x=`left: calc(${Math.floor(m*100)}% - ${C}px)`:A==="pixels"?x=`left: ${m-C}px`:A==="insetPixels"&&(x=`right: ${m-C}px`),f.push(x)),l(y)&&(b==="fraction"?T=`bottom: calc(${Math.floor(y*100)}% - ${E}px)`:b==="pixels"?T=`bottom: ${y-E}px`:b==="insetPixels"&&(T=`top: ${y-E}px`),f.push(T))),u.style=f.join(";")},r.appendChild(u)}function KBt(e,t,n,i){let o=f5(e,t,n).entity,a,s=!1,c=e._ellipsoid,u=a5(Xi(t,"LatLonQuad",Ue.gx),c),f=xi(t,"drawOrder",Ue.kml);if(l(u))a=Vie(),a.hierarchy=new Vc(u),a.zIndex=f,o.polygon=a,s=!0;else{a=new sp,a.zIndex=f,o.rectangle=a;let m=Xi(t,"LatLonBox",Ue.kml);if(l(m)){let y=xi(m,"west",Ue.kml),A=xi(m,"south",Ue.kml),b=xi(m,"east",Ue.kml),x=xi(m,"north",Ue.kml);l(y)&&(y=I.negativePiToPi(I.toRadians(y))),l(A)&&(A=I.clampToLatitudeRange(I.toRadians(A))),l(b)&&(b=I.negativePiToPi(I.toRadians(b))),l(x)&&(x=I.clampToLatitudeRange(I.toRadians(x))),a.coordinates=new ie(y,A,b,x);let T=xi(m,"rotation",Ue.kml);if(l(T)){let C=I.toRadians(T);a.rotation=C,a.stRotation=C}}}let d=Xi(t,"Icon",Ue.kml),p=jie(d,e,n.sourceResource,n.uriResolver,!0);if(l(p)){s&&pt("kml-gx:LatLonQuad","KML - gx:LatLonQuad Icon does not support texture projection.");let m=xi(d,"x",Ue.gx),y=xi(d,"y",Ue.gx),A=xi(d,"w",Ue.gx),b=xi(d,"h",Ue.gx);(l(m)||l(y)||l(A)||l(b))&&pt("kml-groundOverlay-xywh","KML - gx:x, gx:y, gx:w, gx:h aren't supported for GroundOverlays"),a.material=p,a.material.color=fT(t,"color",Ue.kml),a.material.transparent=!0}else a.material=fT(t,"color",Ue.kml);let g=Bn(t,"altitudeMode",Ue.kml);l(g)?g==="absolute"?(a.height=xi(t,"altitude",Ue.kml),a.zIndex=void 0):g!=="clampToGround"&&pt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${g}`):(g=Bn(t,"altitudeMode",Ue.gx),g==="relativeToSeaFloor"?(pt("kml-altitudeMode-relativeToSeaFloor","KML - altitudeMode relativeToSeaFloor is currently not supported, treating as absolute."),a.height=xi(t,"altitude",Ue.kml),a.zIndex=void 0):g==="clampToSeaFloor"?pt("kml-altitudeMode-clampToSeaFloor","KML - altitudeMode clampToSeaFloor is currently not supported, treating as clampToGround."):l(g)&&pt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${g}`))}function nOe(e,t,n,i){e._unsupportedNode.raiseEvent(e,n.parentEntity,t,n.entityCollection,n.styleCollection,n.sourceResource,n.uriResolver),pt(`kml-unsupportedFeature-${t.nodeName}`,`KML - Unsupported feature: ${t.nodeName}`)}var PA={INTERVAL:0,EXPIRE:1,STOP:2};function c5(e){if(!l(e)||e.length===0)return"";let t=e[0];return(t==="&"||t==="?")&&(e=e.substring(1)),e}var $Bt=new ie,xw=new de,Rie=new k,JBt=new h;function Gie(e,t,n,i,r,o){function a(u){return u<-I.PI_OVER_TWO?-I.PI_OVER_TWO:u>I.PI_OVER_TWO?I.PI_OVER_TWO:u}function s(u){return u>I.PI?u-I.TWO_PI:u<-I.PI?u+I.TWO_PI:u}let c=NT(e.queryParameters);if(c=c.replace(/%5B/g,"[").replace(/%5D/g,"]"),l(t)&&t._mode!==re.MORPHING){let u,f;if(r=r??$Bt,l(n)&&(Rie.x=n.clientWidth*.5,Rie.y=n.clientHeight*.5,u=t.pickEllipsoid(Rie,o,JBt)),l(u)?f=o.cartesianToCartographic(u,xw):(f=ie.center(r,xw),u=o.cartographicToCartesian(f)),l(i)&&!I.equalsEpsilon(i,1,I.EPSILON9)){let b=r.width*i*.5,x=r.height*i*.5;r=new ie(s(f.longitude-b),a(f.latitude-x),s(f.longitude+b),a(f.latitude+x))}c=c.replace("[bboxWest]",I.toDegrees(r.west).toString()),c=c.replace("[bboxSouth]",I.toDegrees(r.south).toString()),c=c.replace("[bboxEast]",I.toDegrees(r.east).toString()),c=c.replace("[bboxNorth]",I.toDegrees(r.north).toString());let d=I.toDegrees(f.longitude).toString(),p=I.toDegrees(f.latitude).toString();c=c.replace("[lookatLon]",d),c=c.replace("[lookatLat]",p),c=c.replace("[lookatTilt]",I.toDegrees(t.pitch).toString()),c=c.replace("[lookatHeading]",I.toDegrees(t.heading).toString()),c=c.replace("[lookatRange]",h.distance(t.positionWC,u)),c=c.replace("[lookatTerrainLon]",d),c=c.replace("[lookatTerrainLat]",p),c=c.replace("[lookatTerrainAlt]",f.height.toString()),o.cartesianToCartographic(t.positionWC,xw),c=c.replace("[cameraLon]",I.toDegrees(xw.longitude).toString()),c=c.replace("[cameraLat]",I.toDegrees(xw.latitude).toString()),c=c.replace("[cameraAlt]",I.toDegrees(xw.height).toString());let g=t.frustum,m=g.aspectRatio,y="",A="";if(l(m)){let b=I.toDegrees(g.fov);m>1?(y=b,A=b/m):(A=b,y=b*m)}c=c.replace("[horizFov]",y.toString()),c=c.replace("[vertFov]",A.toString())}else c=c.replace("[bboxWest]","-180"),c=c.replace("[bboxSouth]","-90"),c=c.replace("[bboxEast]","180"),c=c.replace("[bboxNorth]","90"),c=c.replace("[lookatLon]",""),c=c.replace("[lookatLat]",""),c=c.replace("[lookatRange]",""),c=c.replace("[lookatTilt]",""),c=c.replace("[lookatHeading]",""),c=c.replace("[lookatTerrainLon]",""),c=c.replace("[lookatTerrainLat]",""),c=c.replace("[lookatTerrainAlt]",""),c=c.replace("[cameraLon]",""),c=c.replace("[cameraLat]",""),c=c.replace("[cameraAlt]",""),c=c.replace("[horizFov]",""),c=c.replace("[vertFov]","");l(n)?(c=c.replace("[horizPixels]",n.clientWidth),c=c.replace("[vertPixels]",n.clientHeight)):(c=c.replace("[horizPixels]",""),c=c.replace("[vertPixels]","")),c=c.replace("[terrainEnabled]","1"),c=c.replace("[clientVersion]","1"),c=c.replace("[kmlVersion]","2.2"),c=c.replace("[clientName]","Cesium"),c=c.replace("[language]","English"),e.setQueryParameters(kf(c))}function ZBt(e,t,n,i){let o=f5(e,t,n).entity,a=n.sourceResource,s=n.uriResolver,c=Xi(t,"Link",Ue.kml);if(l(c)||(c=Xi(t,"Url",Ue.kml)),l(c)){let u=Bn(c,"href",Ue.kml),f,d;if(l(u)){let p=u;if(u=Uie(u,a,n.uriResolver),/^data:/.test(u.getUrlComponent()))/\.kmz/i.test(a.getUrlComponent())||(p=a.getDerivedResource({url:p}));else{if(p=u.clone(),f=Bn(c,"viewRefreshMode",Ue.kml),f==="onRegion"){pt("kml-refrehMode-onRegion","KML - Unsupported viewRefreshMode: onRegion");return}d=Bn(c,"viewBoundScale",Ue.kml)??1;let A=f==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",b=Bn(c,"viewFormat",Ue.kml)??A,x=Bn(c,"httpQuery",Ue.kml);l(b)&&u.setQueryParameters(kf(c5(b))),l(x)&&u.setQueryParameters(kf(c5(x)));let T=e._ellipsoid;Gie(u,e.camera,e.canvas,d,e._lastCameraView.bbox,T)}let g={sourceUri:p,uriResolver:s,context:o.id,screenOverlayContainer:n.screenOverlayContainer},m=new Qs,y=Fie(e,m,u,g).then(function(A){let b=e._entityCollection,x=m.values;b.suspendEvents();for(let E=0;E<x.length;E++){let w=x[E];l(w.parent)||(w.parent=o,Wie(w)),b.add(w)}b.resumeEvents();let T=Bn(c,"refreshMode",Ue.kml),C=xi(c,"refreshInterval",Ue.kml)??0;if(T==="onInterval"&&C>0||T==="onExpire"||f==="onStop"){let E=Xi(A,"NetworkLinkControl",Ue.kml),w=l(E),D=K.now(),R={id:Kn(),href:u,cookie:{},lastUpdated:D,updating:!1,entity:o,viewBoundScale:d,needsUpdate:!1,cameraUpdateTime:D},M=0;if(w&&(R.cookie=kf(Bn(E,"cookie",Ue.kml)??""),M=xi(E,"minRefreshPeriod",Ue.kml)??0),T==="onInterval")w&&(C=Math.max(M,C)),R.refreshMode=PA.INTERVAL,R.time=C;else if(T==="onExpire"){let N;if(w&&(N=Bn(E,"expires",Ue.kml)),l(N))try{let _=K.fromIso8601(N),v=K.secondsDifference(_,D);v>0&&v<M&&K.addSeconds(D,M,_),R.refreshMode=PA.EXPIRE,R.time=_}catch{pt("kml-refreshMode-onInterval-onExpire","KML - NetworkLinkControl expires is not a valid date")}else pt("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element")}else l(e.camera)?(R.refreshMode=PA.STOP,R.time=xi(c,"viewRefreshTime",Ue.kml)??0):pt("kml-refrehMode-onStop-noCamera","A NetworkLink with viewRefreshMode=onStop requires the `camera` property to be defined.");l(R.refreshMode)&&e._networkLinks.set(R.id,R)}}).catch(function(A){pt(`An error occured during loading ${u.url}`),e._error.raiseEvent(e,A)});i.addPromise(y)}}}function QBt(e,t,n,i){let r=zie[t.localName];return l(r)?r(e,t,n,i):nOe(e,t,n,i)}function Nie(e,t,n,i,r,o,a){t.removeAll();let s=n.documentElement,c=s.localName==="Document"?s:Xi(s,"Document",Ue.kml),u=Bn(c,"name",Ue.kml);l(u)||(u=ty(i.getUrlComponent())),l(e._name)||(e._name=u);let f=new Hg._DeferredLoading(e),d=new Qs(e);return Promise.all(KRe(e,n,d,i,!1,r)).then(function(){let p=n.documentElement;if(p.localName==="kml"){let m=p.childNodes;for(let y=0;y<m.length;y++){let A=m[y];if(l(zie[A.localName])){p=A;break}}}let g={parentEntity:void 0,entityCollection:t,styleCollection:d,sourceResource:i,uriResolver:r,context:a,screenOverlayContainer:o};return t.suspendEvents(),QBt(e,p,g,f),t.resumeEvents(),f.wait().then(function(){return n.documentElement})})}async function e2t(e,t,n,i,r){let o=$t("ThirdParty/Workers/zip-web-worker.js"),a=$t("ThirdParty/zip-module.wasm");Xp({workerURI:o,wasmURI:a});let s=new lT(new $p(n)),c=await s.getEntries(),u=[],f={},d;for(let p=0;p<c.length;p++){let g=c[p];g.directory||(/\.kml$/i.test(g.filename)&&(!l(d)||!/\//i.test(g.filename))?(l(d)&&u.push(Pie(d,f)),d=g):u.push(Pie(g,f)))}if(l(d)&&u.push(SBt(d,f)),await Promise.all(u),s.close(),!l(f.kml))throw new oe("KMZ file does not contain a KML document.");return f.keys=Object.keys(f),Nie(e,t,f.kml,i,f,r)}function Fie(e,t,n,i){i=i??H.EMPTY_OBJECT;let r=i.sourceUri,o=i.uriResolver,a=i.context,s=i.screenOverlayContainer,c=n;if(typeof n=="string"||n instanceof De){n=De.createIfNeeded(n),c=n.fetchBlob(),r=r??n.clone();let u=e._resourceCredits,f=n.credits;if(l(f)){let d=f.length;for(let p=0;p<d;p++)u.push(f[p])}}else r=r??De.DEFAULT.clone();return r=De.createIfNeeded(r),l(s)&&(s=zn(s)),Promise.resolve(c).then(function(u){return u instanceof Blob?vBt(u).then(function(f){return f?e2t(e,t,u,r,s):EBt(u).then(function(d){d=GRe(d),d=WRe(d);let p,g;try{p=kie.parseFromString(d,"application/xml")}catch(m){g=m.toString()}if(l(g)||p.body||p.documentElement.tagName==="parsererror"){let m=l(g)?g:p.documentElement.firstChild.nodeValue;throw m||(m=p.body.innerText),new oe(m)}return Nie(e,t,p,r,o,s,a)})}):Nie(e,t,u,r,o,s,a)}).catch(function(u){return e._error.raiseEvent(e,u),console.log(u),Promise.reject(u)})}var Hg=class e{constructor(t){t=t??H.EMPTY_OBJECT;let n=t.camera,i=t.canvas;this._changed=new be,this._error=new be,this._loading=new be,this._refresh=new be,this._unsupportedNode=new be,this._clock=void 0,this._entityCollection=new Qs(this),this._name=void 0,this._isLoading=!1,this._pinBuilder=new k_,this._networkLinks=new zt,this._entityCluster=new gd,this.canvas=i,this.camera=n,this._lastCameraView={position:l(n)?h.clone(n.positionWC):void 0,direction:l(n)?h.clone(n.directionWC):void 0,up:l(n)?h.clone(n.upWC):void 0,bbox:l(n)?n.computeViewRectangle():ie.clone(ie.MAX_VALUE)},this._ellipsoid=t.ellipsoid??te.default;let r=t.credit;typeof r=="string"&&(r=new wt(r)),this._credit=r,this._resourceCredits=[],this._kmlTours=[],this._screenOverlays=[]}static load(t,n){return n=n??H.EMPTY_OBJECT,new e(n).load(t,n)}get name(){return this._name}set name(t){this._name!==t&&(this._name=t,this._changed.raiseEvent(this))}get clock(){return this._clock}get entities(){return this._entityCollection}get isLoading(){return this._isLoading}get changedEvent(){return this._changed}get errorEvent(){return this._error}get loadingEvent(){return this._loading}get refreshEvent(){return this._refresh}get unsupportedNodeEvent(){return this._unsupportedNode}get show(){return this._entityCollection.show}set show(t){this._entityCollection.show=t}get clustering(){return this._entityCluster}set clustering(t){this._entityCluster=t}get credit(){return this._credit}get kmlTours(){return this._kmlTours}load(t,n){n=n??H.EMPTY_OBJECT,Ca.setLoading(this,!0);let i=this._name;this._name=void 0,this._clampToGround=n.clampToGround??!1;let r=this;return Fie(this,this._entityCollection,t,n).then(function(){let o,a=r._entityCollection.computeAvailability(),s=a.start,c=a.stop,u=K.equals(s,Qe.MINIMUM_VALUE),f=K.equals(c,Qe.MAXIMUM_VALUE);if(!u||!f){let p;u&&(p=new Date,p.setHours(0,0,0,0),s=K.fromDate(p)),f&&(p=new Date,p.setHours(24,0,0,0),c=K.fromDate(p)),o=new Vp,o.startTime=s,o.stopTime=c,o.currentTime=K.clone(s),o.clockRange=_a.LOOP_STOP,o.clockStep=Br.SYSTEM_CLOCK_MULTIPLIER,o.multiplier=Math.round(Math.min(Math.max(K.secondsDifference(c,s)/60,1),31556900))}let d=!1;return o!==r._clock&&(r._clock=o,d=!0),i!==r._name&&(d=!0),d&&r._changed.raiseEvent(r),Ca.setLoading(r,!1),r}).catch(function(o){return Ca.setLoading(r,!1),r._error.raiseEvent(r,o),console.log(o),Promise.reject(o)})}destroy(){for(;this._screenOverlays.length>0;)this._screenOverlays.pop().remove()}update(t){let n=this._networkLinks;if(n.length===0)return!0;let i=K.now(),r=this;Oie.removeAll();function o(d){let p=d._children,g=p.length;for(let m=0;m<g;++m){let y=p[m];Oie.set(y.id,y),o(y)}}let a=!1,s=this._lastCameraView,c=this.camera;l(c)&&!(c.positionWC.equalsEpsilon(s.position,I.EPSILON7)&&c.directionWC.equalsEpsilon(s.direction,I.EPSILON7)&&c.upWC.equalsEpsilon(s.up,I.EPSILON7))&&(s.position=h.clone(c.positionWC),s.direction=h.clone(c.directionWC),s.up=h.clone(c.upWC),s.bbox=c.computeViewRectangle(),a=!0);let u=new zt,f=!1;return n.values.forEach(function(d){let p=d.entity;if(!Oie.contains(p.id)){if(!d.updating){let g=!1;if(d.refreshMode===PA.INTERVAL?K.secondsDifference(i,d.lastUpdated)>d.time&&(g=!0):d.refreshMode===PA.EXPIRE?K.greaterThan(i,d.time)&&(g=!0):d.refreshMode===PA.STOP&&(a&&(d.needsUpdate=!0,d.cameraUpdateTime=i),d.needsUpdate&&K.secondsDifference(i,d.cameraUpdateTime)>=d.time&&(g=!0)),g){o(p),d.updating=!0;let m=new Qs,y=d.href.clone();y.setQueryParameters(d.cookie);let A=r._ellipsoid??te.default;Gie(y,r.camera,r.canvas,d.viewBoundScale,s.bbox,A),Fie(r,m,y,{context:p.id}).then(t2t(r,d,m,u,y)).catch(function(b){let x=`NetworkLink ${d.href} refresh failed: ${b}`;console.log(x),r._error.raiseEvent(r,x)}),f=!0}}u.set(d.id,d)}}),f&&(this._networkLinks=u,this._changed.raiseEvent(this)),!0}};function Wie(e){let t=e.parent;if(l(t)){let n=t.availability;if(l(n)){let i=e.availability;l(i)?i.intersect(n):e.availability=n}}}function t2t(e,t,n,i,r){return function(o){if(!i.contains(t.id))return;let a=!1,s=Xi(o,"NetworkLinkControl",Ue.kml),c=l(s),u=0;if(c){if(l(Xi(s,"Update",Ue.kml))){pt("kml-networkLinkControl-update","KML - NetworkLinkControl updates aren't supported."),t.updating=!1,i.remove(t.id);return}t.cookie=kf(Bn(s,"cookie",Ue.kml)??""),u=xi(s,"minRefreshPeriod",Ue.kml)??0}let f=K.now(),d=t.refreshMode;if(d===PA.INTERVAL)l(s)&&(t.time=Math.max(u,t.time));else if(d===PA.EXPIRE){let D;if(l(s)&&(D=Bn(s,"expires",Ue.kml)),l(D))try{let R=K.fromIso8601(D),M=K.secondsDifference(R,f);M>0&&M<u&&K.addSeconds(f,u,R),t.time=R}catch{pt("kml-networkLinkControl-expires","KML - NetworkLinkControl expires is not a valid date"),a=!0}else pt("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element"),a=!0}let p=t.entity,g=e._entityCollection,m=n.values;function y(D){g.remove(D);let R=D._children,M=R.length;for(let N=0;N<M;++N)y(R[N])}g.suspendEvents();let A=g.values.slice(),b;for(b=0;b<A.length;++b){let D=A[b];D.parent===p&&(D.parent=void 0,y(D))}for(g.resumeEvents(),g.suspendEvents(),b=0;b<m.length;b++){let D=m[b];l(D.parent)||(D.parent=p,Wie(D)),g.add(D)}g.resumeEvents(),a?i.remove(t.id):t.lastUpdated=f;let x=g.computeAvailability(),T=x.start,C=x.stop,E=K.equals(T,Qe.MINIMUM_VALUE),w=K.equals(C,Qe.MAXIMUM_VALUE);if(!E||!w){let D=e._clock;(D.startTime!==T||D.stopTime!==C)&&(D.startTime=T,D.stopTime=C,e._changed.raiseEvent(e))}t.updating=!1,t.needsUpdate=!1,e._refresh.raiseEvent(e,r.getUrlComponent(!0))}}var Oie=new zt,Bie=class{constructor(){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}};Hg._DeferredLoading=Mie;Hg._getTimestamp=An;var Tw=Hg;function CO(){pe.throwInstantiationError()}CO.prototype.update=pe.throwInstantiationError;CO.prototype.getBoundingSphere=pe.throwInstantiationError;CO.prototype.isDestroyed=pe.throwInstantiationError;CO.prototype.destroy=pe.throwInstantiationError;var iOe=CO;var qie=32,n2t="http://www.opengis.net/kml/2.2",um="http://www.google.com/kml/ext/2.2",i2t="http://www.w3.org/2000/xmlns/";function d5(e){this._files={},this._promises=[],this._count=0,this._modelCallback=e}var r2t=/^data:image\/([^,;]+)/;d5.prototype.texture=function(e){let t=this,n;if(typeof e=="string"||e instanceof De){if(e=De.createIfNeeded(e),!e.isDataUri)return e.url;let i=e.url.match(r2t);n=`texture_${++this._count}`,l(i)&&(n+=`.${i[1]}`);let r=e.fetchBlob().then(function(o){t._files[n]=o});return this._promises.push(r),n}if(e instanceof HTMLCanvasElement){n=`texture_${++this._count}.png`;let i=new Promise(r=>{e.toBlob(function(o){t._files[n]=o,r()})});return this._promises.push(i),n}return""};function o2t(e,t){return function(n){e._files[t]=n}}d5.prototype.model=function(e,t){let n=this._modelCallback;if(!l(n))throw new oe("Encountered a model entity while exporting to KML, but no model callback was supplied.");let i={},r=n(e,t,i);for(let o in i)if(i.hasOwnProperty(o)){let a=Promise.resolve(i[o]);this._promises.push(a),a.then(o2t(this,o))}return r};Object.defineProperties(d5.prototype,{promise:{get:function(){return Promise.all(this._promises)}},files:{get:function(){return this._files}}});function h5(e){this._time=e}h5.prototype.get=function(e,t,n){let i;return l(e)&&(i=l(e.getValue)?e.getValue(this._time,n):e),i??t};h5.prototype.getColor=function(e,t){let n=this.get(e,t);if(l(n))return hT(n)};h5.prototype.getMaterialType=function(e){if(l(e))return e.getType(this._time)};function Yie(){this._ids={},this._styles={},this._count=0}Yie.prototype.get=function(e){let t=this._ids,n=e.innerHTML;if(l(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};Yie.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 aOe(){this._ids={}}aOe.prototype.get=function(e){if(!l(e))return this.get(Kn());let t=this._ids;return l(t[e])?`${e.toString()}-${++t[e]}`:(t[e]=0,e)};function Xie(e){e=e??H.EMPTY_OBJECT;let t=e.entities,n=e.kmz??!1,i=Xie._createState(e),r=t.values.filter(function(u){return!l(u.parent)}),o=i.kmlDoc,a=o.documentElement;a.setAttributeNS(i2t,"xmlns:gx",um);let s=o.createElement("Document");a.appendChild(s),cOe(i,s,r),i.styleCache.save(s);let c=i.externalFileHandler;return c.promise.then(function(){let f=new XMLSerializer().serializeToString(i.kmlDoc);return n?a2t(f,c.files):{kml:f,externalFiles:c.files}})}async function a2t(e,t){let n=$t("ThirdParty/Workers/zip-web-worker.js"),i=$t("ThirdParty/zip-module.wasm");Xp({workerURI:n,wasmURI:i});let r=new aw("application/vnd.google-earth.kmz"),o=new pO(r);await o.add("doc.kml",new KR(e));let a=Object.keys(t);return await sOe(o,a,t,0),await o.close(),{kmz:await r.getData()}}async function sOe(e,t,n,i){if(t.length===i)return;let r=t[i];return await e.add(r,new $p(n[r])),sOe(e,t,n,i+1)}Xie._createState=function(e){let t=e.entities,n=new Yie,i=t.computeAvailability(),r=l(e.time)?e.time:i.start,o=e.defaultAvailability??i,a=e.sampleDuration??60;o.start===Qe.MINIMUM_VALUE?o.stop===Qe.MAXIMUM_VALUE?o=new Cn:K.addSeconds(o.stop,-10*a,o.start):o.stop===Qe.MAXIMUM_VALUE&&K.addSeconds(o.start,10*a,o.stop);let s=new d5(e.modelCallback);return{kmlDoc:document.implementation.createDocument(n2t,"kml"),ellipsoid:e.ellipsoid??te.default,idManager:new aOe,styleCache:n,externalFileHandler:s,time:r,valueGetter:new h5(r),sampleDuration:a,defaultAvailability:new xa([o])}};function cOe(e,t,n){let i=e.kmlDoc,r=e.styleCache,o=e.valueGetter,a=e.idManager,s=n.length,c,u,f;for(let d=0;d<s;++d){let p=n[d];c=[],u=[],f=[],s2t(e,p,u,f),c2t(e,p.polyline,u,f),oOe(e,p.rectangle,u,f,c),oOe(e,p.polygon,u,f,c),d2t(e,p,p.model,u,f);let g,m=p.availability;l(m)&&(g=i.createElement("TimeSpan"),K.equals(m.start,Qe.MINIMUM_VALUE)||g.appendChild(bn(i,"begin",K.toIso8601(m.start))),K.equals(m.stop,Qe.MAXIMUM_VALUE)||g.appendChild(bn(i,"end",K.toIso8601(m.stop))));for(let b=0;b<c.length;++b){let x=c[b];x.setAttribute("id",a.get(p.id)),x.appendChild(bn(i,"name",p.name)),x.appendChild(bn(i,"visibility",p.show)),x.appendChild(bn(i,"description",p.description)),l(g)&&x.appendChild(g),t.appendChild(x)}let y=u.length;if(y>0){let b=i.createElement("Placemark");b.setAttribute("id",a.get(p.id));let x=p.name,T=p.label;if(l(T)){let E=i.createElement("LabelStyle"),w=o.get(T.text);x=l(w)&&w.length>0?w:x;let D=o.getColor(T.fillColor);l(D)&&(E.appendChild(bn(i,"color",D)),E.appendChild(bn(i,"colorMode","normal")));let R=o.get(T.scale);l(R)&&E.appendChild(bn(i,"scale",R)),f.push(E)}b.appendChild(bn(i,"name",x)),b.appendChild(bn(i,"visibility",p.show)),b.appendChild(bn(i,"description",p.description)),l(g)&&b.appendChild(g),t.appendChild(b);let C=f.length;if(C>0){let E=i.createElement("Style");for(let w=0;w<C;++w)E.appendChild(f[w]);b.appendChild(bn(i,"styleUrl",r.get(E)))}if(u.length===1)b.appendChild(u[0]);else if(u.length>1){let E=i.createElement("MultiGeometry");for(let w=0;w<y;++w)E.appendChild(u[w]);b.appendChild(E)}}let A=p._children;if(A.length>0){let b=i.createElement("Folder");b.setAttribute("id",a.get(p.id)),b.appendChild(bn(i,"name",p.name)),b.appendChild(bn(i,"visibility",p.show)),b.appendChild(bn(i,"description",p.description)),t.appendChild(b),cOe(e,b,A)}}}var Nu=new h,Hl=new de,lm=new K;function s2t(e,t,n,i){let r=e.kmlDoc,o=e.ellipsoid,a=e.valueGetter,s=t.billboard??t.point;if(!l(s)&&!l(t.path))return;let c=t.position;if(!c.isConstant){lOe(e,t,s,n,i);return}a.get(c,void 0,Nu);let u=bn(r,"coordinates",dT(Nu,o)),f=r.createElement("Point"),d=r.createElement("altitudeMode");d.appendChild(mT(e,s.heightReference)),f.appendChild(d),f.appendChild(u),n.push(f);let p=s instanceof Pl?fOe(e,s):uOe(e,s);i.push(p)}function lOe(e,t,n,i,r){let o=e.kmlDoc,a=e.ellipsoid,s=e.valueGetter,c,u=t.position,f=!0;u instanceof Cc?(c=u.intervals,f=!1):c=t.availability??e.defaultAvailability;let d=n instanceof dy,p,g,m,y=[];for(p=0;p<c.length;++p){let b=c.get(p),x=f?u:b.data,T=o.createElement("altitudeMode");x instanceof bg?(x=x._value,T.appendChild(mT(e,it.CLAMP_TO_GROUND))):l(n)?T.appendChild(mT(e,n.heightReference)):T.appendChild(mT(e,it.NONE));let C=[],E=[];if(x.isConstant){s.get(x,void 0,Nu);let D=bn(o,"coordinates",dT(Nu,a));C.push(K.toIso8601(b.start)),E.push(D),C.push(K.toIso8601(b.stop)),E.push(D)}else if(x instanceof vc)for(m=x._property._times,g=0;g<m.length;++g)C.push(K.toIso8601(m[g])),x.getValueInReferenceFrame(m[g],Vi.FIXED,Nu),E.push(dT(Nu,a));else if(x instanceof Md){m=x._times;let D=x._values;for(g=0;g<m.length;++g)C.push(K.toIso8601(m[g])),h.fromArray(D,g*3,Nu),E.push(dT(Nu,a))}else{let D=e.sampleDuration;b.start.clone(lm),b.isStartIncluded||K.addSeconds(lm,D,lm);let R=b.stop;for(;K.lessThan(lm,R);)x.getValue(lm,Nu),C.push(K.toIso8601(lm)),E.push(dT(Nu,a)),K.addSeconds(lm,D,lm);b.isStopIncluded&&K.equals(lm,R)&&(x.getValue(lm,Nu),C.push(K.toIso8601(lm)),E.push(dT(Nu,a)))}let w=o.createElementNS(um,"Track");w.appendChild(T);for(let D=0;D<C.length;++D){let R=bn(o,"when",C[D]),M=bn(o,"coord",E[D],um);w.appendChild(R),w.appendChild(M)}d&&w.appendChild(dOe(e,n)),y.push(w)}if(y.length===1)i.push(y[0]);else if(y.length>1){let b=o.createElementNS(um,"MultiTrack");for(p=0;p<y.length;++p)b.appendChild(y[p]);i.push(b)}if(l(n)&&!d){let b=n instanceof Pl?fOe(e,n):uOe(e,n);r.push(b)}let A=t.path;if(l(A)){let b=s.get(A.width),x=A.material;if(l(x)||l(b)){let T=o.createElement("LineStyle");l(b)&&T.appendChild(bn(o,"width",b)),Kie(e,x,T),r.push(T)}}}function uOe(e,t){let n=e.kmlDoc,i=e.valueGetter,r=n.createElement("IconStyle"),o=i.getColor(t.color);l(o)&&(r.appendChild(bn(n,"color",o)),r.appendChild(bn(n,"colorMode","normal")));let a=i.get(t.pixelSize);return l(a)&&r.appendChild(bn(n,"scale",a/qie)),r}function fOe(e,t){let n=e.kmlDoc,i=e.valueGetter,r=e.externalFileHandler,o=n.createElement("IconStyle"),a=i.get(t.image);if(l(a)){a=r.texture(a);let p=n.createElement("Icon");p.appendChild(bn(n,"href",a));let g=i.get(t.imageSubRegion);l(g)&&(p.appendChild(bn(n,"x",g.x,um)),p.appendChild(bn(n,"y",g.y,um)),p.appendChild(bn(n,"w",g.width,um)),p.appendChild(bn(n,"h",g.height,um))),o.appendChild(p)}let s=i.getColor(t.color);l(s)&&(o.appendChild(bn(n,"color",s)),o.appendChild(bn(n,"colorMode","normal")));let c=i.get(t.scale);l(c)&&o.appendChild(bn(n,"scale",c));let u=i.get(t.pixelOffset);if(l(u)){c=c??1,k.divideByScalar(u,c,u);let p=i.get(t.width,qie),g=i.get(t.height,qie),m=i.get(t.horizontalOrigin,ji.CENTER);m===ji.CENTER?u.x-=p*.5:m===ji.RIGHT&&(u.x-=p);let y=i.get(t.verticalOrigin,Wn.CENTER);y===Wn.TOP?u.y+=g:y===Wn.CENTER&&(u.y+=g*.5);let A=n.createElement("hotSpot");A.setAttribute("x",-u.x),A.setAttribute("y",u.y),A.setAttribute("xunits","pixels"),A.setAttribute("yunits","pixels"),o.appendChild(A)}let f=i.get(t.rotation),d=i.get(t.alignedAxis);return l(f)&&h.equals(h.UNIT_Z,d)&&(f=I.toDegrees(-f),f===0&&(f=360),o.appendChild(bn(n,"heading",f))),o}function c2t(e,t,n,i){let r=e.kmlDoc,o=e.ellipsoid,a=e.valueGetter;if(!l(t))return;let s=r.createElement("LineString"),c=r.createElement("altitudeMode"),u=a.get(t.clampToGround,!1),f;u?(s.appendChild(bn(r,"tessellate",!0)),f=r.createTextNode("clampToGround")):f=r.createTextNode("absolute"),c.appendChild(f),s.appendChild(c);let d=t.positions,p=a.get(d),g=bn(r,"coordinates",dT(p,o));s.appendChild(g);let m=a.get(t.zIndex);u&&l(m)&&s.appendChild(bn(r,"drawOrder",m,um)),n.push(s);let y=r.createElement("LineStyle"),A=a.get(t.width);l(A)&&y.appendChild(bn(r,"width",A)),Kie(e,t.material,y),i.push(y)}function l2t(e,t,n){let i=e.kmlDoc,r=e.valueGetter,o=r.get(t.height,0);n>0&&(o=n);let a=t.coordinates,s=r.get(a),c=[],u=[ie.northeast,ie.southeast,ie.southwest,ie.northwest];for(let g=0;g<4;++g)u[g](s,Hl),c.push(`${I.toDegrees(Hl.longitude)},${I.toDegrees(Hl.latitude)},${o}`);let f=bn(i,"coordinates",c.join(" ")),d=i.createElement("outerBoundaryIs"),p=i.createElement("LinearRing");return p.appendChild(f),d.appendChild(p),[d]}function rOe(e,t,n,i){let r=e.kmlDoc,o=e.ellipsoid,a=[],s=t.length;for(let f=0;f<s;++f)de.fromCartesian(t[f],o,Hl),a.push(`${I.toDegrees(Hl.longitude)},${I.toDegrees(Hl.latitude)},${i?Hl.height:n}`);let c=bn(r,"coordinates",a.join(" ")),u=r.createElement("LinearRing");return u.appendChild(c),u}function u2t(e,t,n){let i=e.kmlDoc,r=e.valueGetter,o=r.get(t.height,0),a=r.get(t.perPositionHeight,!1);!a&&n>0&&(o=n);let s=[],c=t.hierarchy,u=r.get(c),f=Array.isArray(u)?u:u.positions,d=i.createElement("outerBoundaryIs");d.appendChild(rOe(e,f,o,a)),s.push(d);let p=u.holes;if(l(p)){let g=p.length;for(let m=0;m<g;++m){let y=i.createElement("innerBoundaryIs");y.appendChild(rOe(e,p[m].positions,o,a)),s.push(y)}}return s}function oOe(e,t,n,i,r){let o=e.kmlDoc,a=e.valueGetter;if(!l(t))return;let s=t instanceof sp;if(s&&a.getMaterialType(t.material)==="Image"){f2t(e,t,r);return}let c=o.createElement("Polygon"),u=a.get(t.extrudedHeight,0);u>0&&c.appendChild(bn(o,"extrude",!0));let f=s?l2t(e,t,u):u2t(e,t,u),d=f.length;for(let A=0;A<d;++A)c.appendChild(f[A]);let p=o.createElement("altitudeMode");p.appendChild(mT(e,t.heightReference)),c.appendChild(p),n.push(c);let g=o.createElement("PolyStyle"),m=a.get(t.fill,!1);m&&g.appendChild(bn(o,"fill",m)),Kie(e,t.material,g);let y=a.get(t.outline,!1);if(y){g.appendChild(bn(o,"outline",y));let A=o.createElement("LineStyle"),b=a.get(t.outlineWidth,1);A.appendChild(bn(o,"width",b));let x=a.getColor(t.outlineColor,U.BLACK);A.appendChild(bn(o,"color",x)),A.appendChild(bn(o,"colorMode","normal")),i.push(A)}i.push(g)}function f2t(e,t,n){let i=e.kmlDoc,r=e.valueGetter,o=e.externalFileHandler,a=i.createElement("GroundOverlay"),s=i.createElement("altitudeMode");s.appendChild(mT(e,t.heightReference)),a.appendChild(s);let c=r.get(t.height);l(c)&&a.appendChild(bn(i,"altitude",c));let u=r.get(t.coordinates),f=i.createElement("LatLonBox");f.appendChild(bn(i,"north",I.toDegrees(u.north))),f.appendChild(bn(i,"south",I.toDegrees(u.south))),f.appendChild(bn(i,"east",I.toDegrees(u.east))),f.appendChild(bn(i,"west",I.toDegrees(u.west))),a.appendChild(f);let d=r.get(t.material),p=o.texture(d.image),g=i.createElement("Icon");g.appendChild(bn(i,"href",p)),a.appendChild(g);let m=d.color;l(m)&&a.appendChild(bn(i,"color",hT(d.color))),n.push(a)}function dOe(e,t){let n=e.kmlDoc,i=e.valueGetter,r=e.externalFileHandler,o=n.createElement("Model"),a=i.get(t.scale);if(l(a)){let u=n.createElement("scale");u.appendChild(bn(n,"x",a)),u.appendChild(bn(n,"y",a)),u.appendChild(bn(n,"z",a)),o.appendChild(u)}let s=n.createElement("Link"),c=r.model(t,e.time);return s.appendChild(bn(n,"href",c)),o.appendChild(s),o}function d2t(e,t,n,i,r){let o=e.kmlDoc,a=e.ellipsoid,s=e.valueGetter;if(!l(n))return;let c=t.position;if(!c.isConstant){lOe(e,t,n,i,r);return}let u=dOe(e,n),f=o.createElement("altitudeMode");f.appendChild(mT(e,n.heightReference)),u.appendChild(f),s.get(c,void 0,Nu),de.fromCartesian(Nu,a,Hl);let d=o.createElement("Location");d.appendChild(bn(o,"longitude",I.toDegrees(Hl.longitude))),d.appendChild(bn(o,"latitude",I.toDegrees(Hl.latitude))),d.appendChild(bn(o,"altitude",Hl.height)),u.appendChild(d),i.push(u)}function Kie(e,t,n){let i=e.kmlDoc,r=e.valueGetter;if(!l(t))return;let o=r.get(t);if(!l(o))return;let a,s=r.getMaterialType(t),c,u;switch(s){case"Image":a=hT(U.WHITE);break;case"Color":case"Grid":case"PolylineGlow":case"PolylineArrow":case"PolylineDash":a=hT(o.color);break;case"PolylineOutline":a=hT(o.color),c=hT(o.outlineColor),u=o.outlineWidth,n.appendChild(bn(i,"outerColor",c,um)),n.appendChild(bn(i,"outerWidth",u,um));break;case"Stripe":a=hT(o.oddColor);break}l(a)&&(n.appendChild(bn(i,"color",a)),n.appendChild(bn(i,"colorMode","normal")))}function mT(e,t){let n=e.kmlDoc,r=e.valueGetter.get(t,it.NONE),o;switch(r){case it.NONE:o=n.createTextNode("absolute");break;case it.CLAMP_TO_GROUND:o=n.createTextNode("clampToGround");break;case it.RELATIVE_TO_GROUND:o=n.createTextNode("relativeToGround");break}return o}function dT(e,t){Array.isArray(e)||(e=[e]);let n=e.length,i=[];for(let r=0;r<n;++r)de.fromCartesian(e[r],t,Hl),i.push(`${I.toDegrees(Hl.longitude)},${I.toDegrees(Hl.latitude)},${Hl.height}`);return i.join(" ")}function bn(e,t,n,i){n=n??"",typeof n=="boolean"&&(n=n?"1":"0");let r=l(i)?e.createElementNS(i,t):e.createElement(t),o=n==="string"&&n.indexOf("<")!==-1?e.createCDATASection(n):e.createTextNode(n);return r.appendChild(o),r}function hT(e){let t="",n=e.toBytes();for(let i=3;i>=0;--i)t+=n[i]<16?`0${n[i].toString(16)}`:n[i].toString(16);return t}var hOe=Xie;var m5=`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;
|
|
}
|
|
|
|
// Interpolate a voxel with its neighbor (along the positive X-axis)
|
|
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);
|
|
}
|
|
|
|
// Intersection with a unit sphere with radius 0.5 at center (0, 0, 0).
|
|
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;
|
|
}
|
|
|
|
// Transforms the ray origin and direction into unit sphere space,
|
|
// then transforms the result back into the ellipsoid's space.
|
|
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;
|
|
}
|
|
|
|
// Assume that if phase shift is being called for octave i,
|
|
// the frequency is of i - 1. This saves us from doing extra
|
|
// division / multiplication operations.
|
|
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));
|
|
}
|
|
|
|
// The cloud texture function derived from Gardner's 1985 paper,
|
|
// "Visual Simulation of Clouds."
|
|
// https://www.cs.drexel.edu/~david/Classes/Papers/p297-gardner.pdf
|
|
const float T0 = 0.6; // contrast of the texture pattern
|
|
const float k = 0.1; // computed to produce a maximum value of 1
|
|
const float C0 = 0.8; // coefficient
|
|
const float FX0 = 0.6; // frequency X
|
|
const float FY0 = 0.6; // frequency Y
|
|
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; // fraction of surface reflection due to ambient or scattered light,
|
|
const float t = 0.4; // fraction of texture shading
|
|
const float s = 0.25; // fraction of specular reflection
|
|
|
|
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); // diffuse reflection
|
|
float Is = max(pow(dot(-lightDir, -rayDir), 2.0), 0.0); // specular reflection
|
|
float It = T(cloudPoint); // texture function
|
|
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;
|
|
|
|
// The dot product between the cloud's normal and the ray's direction is greatest
|
|
// in the center of the ellipsoid's surface. It decreases towards the edge.
|
|
// Thus, it is used to blur the areas leading to the edges of the ellipsoid,
|
|
// so that no harsh lines appear.
|
|
|
|
// The first (and biggest) layer of worley noise is then subtracted from this.
|
|
// The final result is scaled up so that the base cloud is not too translucent.
|
|
float ndDot = clamp(dot(cloudNormal, -rayDir), 0.0, 1.0);
|
|
float TR = pow(ndDot, 3.0) - W; // translucency
|
|
TR *= 1.3;
|
|
|
|
// Subtracting the second and third layers of worley noise is more complicated.
|
|
// If these layers of noise were simply subtracted from the current translucency,
|
|
// the shape derived from the first layer of noise would be completely deleted.
|
|
// The erosion of this noise should thus be constricted to the edges of the cloud.
|
|
// However, because the edges of the ellipsoid were already blurred away, mapping
|
|
// the noise to (1.0 - ndDot) will have no impact on most of the cloud's appearance.
|
|
// The value of (0.5 - ndDot) provides the best compromise.
|
|
float minusDot = 0.5 - ndDot;
|
|
|
|
// Even with the previous calculation, subtracting the second layer of wnoise
|
|
// erode too much of the cloud. The addition of it, however, will detailed
|
|
// volume to the cloud. As long as the noise is only added and not subtracted,
|
|
// the results are aesthetically pleasing.
|
|
|
|
// The minusDot product is mapped in a way that it is larger at the edges of
|
|
// the ellipsoid, so a subtraction and min operation are used instead of
|
|
// an addition and max one.
|
|
TR -= min(minusDot * W2, 0.0);
|
|
|
|
// The third level of worley noise is subtracted from the result, with some
|
|
// modifications. First, a scalar is added to minusDot so that the noise
|
|
// starts affecting the shape farther away from the center of the ellipsoid's
|
|
// surface. Then, it is scaled down so its impact is not too intense.
|
|
TR -= 0.8 * (minusDot + 0.25) * W3;
|
|
|
|
// The texture function's shading does not correlate with the shape of the cloud
|
|
// produced by the layers of noise, so an extra shading scalar is calculated.
|
|
// The darkest areas of the cloud are assigned to be where the noise erodes
|
|
// the cloud the most. This is then interpolated based on the translucency
|
|
// and the diffuse shading term of that point in the cloud.
|
|
float shading = mix(1.0 - 0.8 * W * W, 1.0, Id * TR);
|
|
|
|
// To avoid values that are too dark, this scalar is increased by a small amount
|
|
// and clamped so it never goes to zero.
|
|
shading = clamp(shading + 0.2, 0.3, 1.0);
|
|
|
|
// Finally, the contrast of the cloud's color is increased.
|
|
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
|
|
// To avoid calculations with high values,
|
|
// we raycast from an arbitrarily smaller space.
|
|
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 p5=`#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() {
|
|
// Unpack attributes.
|
|
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 g5=`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));
|
|
}
|
|
|
|
// Frequency corresponds to cell size.
|
|
// The higher the frequency, the smaller the cell size.
|
|
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 _5=`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 y5=`
|
|
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);
|
|
}
|
|
`;var h2t=new h(1,1,1);function $ie(e){e=e??h2t,this._dimensions=h.clone(e)}Object.defineProperties($ie.prototype,{dimensions:{get:function(){return this._dimensions},set:function(e){h.clone(e,this._dimensions)}}});var m2t=new h;$ie.prototype.emit=function(e){let t=this._dimensions,n=h.multiplyByScalar(t,.5,m2t),i=I.randomBetween(-n.x,n.x),r=I.randomBetween(-n.y,n.y),o=I.randomBetween(-n.z,n.z);e.position=h.fromElements(i,r,o,e.position),e.velocity=h.normalize(e.position,e.velocity)};var mOe=$ie;var Jie=class{constructor(){at(this,"featuresLength");at(this,"pointsLength");at(this,"trianglesLength");at(this,"geometryByteLength");at(this,"texturesByteLength");at(this,"batchTableByteLength");at(this,"innerContents");at(this,"ready");at(this,"tileset");at(this,"tile");at(this,"url");at(this,"batchTable");at(this,"metadata");at(this,"group");this.featurePropertiesDirty=!1}hasProperty(t,n){pe.throwInstantiationError()}getFeature(t){pe.throwInstantiationError()}applyDebugSettings(t,n){pe.throwInstantiationError()}applyStyle(t){pe.throwInstantiationError()}update(t,n){pe.throwInstantiationError()}pick(t,n,i){pe.throwInstantiationError()}isDestroyed(){pe.throwInstantiationError()}destroy(){pe.throwInstantiationError()}},pOe=Jie;function vO(e){e=e??H.EMPTY_OBJECT,this._maximumSubtreeCount=e.maximumSubtreeCount??0,this._subtreeRequestCounter=0,this._queue=new f_({comparator:vO.comparator})}vO.prototype.addSubtree=function(e){let t=new p2t(e,this._subtreeRequestCounter);this._subtreeRequestCounter++,this._queue.insert(t);let n=e.implicitCoordinates;if(n.level>0){let i=n.getParentSubtreeCoordinates(),r=this.find(i)}if(this._maximumSubtreeCount>0)for(;this._queue.length>this._maximumSubtreeCount&&this._queue.getMinimum()!==t;)this._queue.removeMinimum()};vO.prototype.find=function(e){let t=this._queue,n=t.internalArray,i=t.length;for(let r=0;r<i;r++){let o=n[r],s=o.subtree.implicitCoordinates;if(e.isEqual(s))return o.subtree}};vO.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 p2t(e,t){this.subtree=e,this.stamp=t}var A5=vO;function EO(e){e=e??H.EMPTY_OBJECT;let{className:t,names:n,types:i,componentTypes:r,shape:o,dimensions:a,paddingBefore:s=h.ZERO.clone(),paddingAfter:c=h.ZERO.clone(),globalTransform:u=O.IDENTITY.clone(),shapeTransform:f=O.IDENTITY.clone(),minBounds:d,maxBounds:p,minimumValues:g,maximumValues:m,maximumTileCount:y}=e;this._shapeTransform=f,this._globalTransform=u,this._shape=o,this._minBounds=d,this._maxBounds=p,this._dimensions=a,this._paddingBefore=s,this._paddingAfter=c,this._className=t,this._names=n,this._types=i,this._componentTypes=r,this._metadataOrder=o===Sc.ELLIPSOID?Dg.Z_UP:Dg.Y_UP,this._minimumValues=g,this._maximumValues=m,this._maximumTileCount=y,this._availableLevels=void 0,this._implicitTileset=void 0,this._subtreeCache=new A5}Object.defineProperties(EO.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}}});EO.fromUrl=async function(e){let t=De.createIfNeeded(e),n=await t.fetchJson();_2t(n);let i=v2t(n,t);await i.load();let{root:r}=n,o=Qi(n,"3DTILES_metadata")?n.extensions["3DTILES_metadata"]:n,a=new cS({metadataJson:o,schema:i.schema}),s=r.content.extensions["3DTILES_content_voxels"],c=s.class,u=E2t(a,c);Object.assign(u,y2t(r)),l(r.transform)?u.globalTransform=O.unpack(r.transform):u.globalTransform=O.clone(O.IDENTITY),u.dimensions=h.unpack(s.dimensions),u.maximumTileCount=g2t(a),l(s.padding)&&(u.paddingBefore=h.unpack(s.padding.before),u.paddingAfter=h.unpack(s.padding.after));let f=new EO(u),d=new E0(t,r,i.schema);return f._implicitTileset=d,f._availableLevels=d.availableLevels,Ni.unload(i),f};function g2t(e){if(l(e.tileset))return e.tileset.getPropertyBySemantic(ch.TILESET_TILE_COUNT)}function _2t(e){let t=e.root;if(!l(t.content))throw new oe("Root must have content");if(!Qi(t.content,"3DTILES_content_voxels"))throw new oe("Root tile content must have 3DTILES_content_voxels extension");if(!Qi(t,"3DTILES_implicit_tiling")&&!l(t.implicitTiling))throw new oe("Root tile must have implicit tiling");if(!l(e.schema)&&!l(e.schemaUri)&&!Qi(e,"3DTILES_metadata"))throw new oe("Tileset must have a metadata schema")}function y2t(e){let t=e.boundingVolume;if(l(t.box))return T2t(t.box);if(l(t.region))return A2t(t.region);if(Qi(t,"3DTILES_bounding_volume_cylinder"))return C2t(t.extensions["3DTILES_bounding_volume_cylinder"]);throw new oe("Only box, region and 3DTILES_bounding_volume_cylinder are supported in Cesium3DTilesVoxelProvider")}function A2t(e){let t=e[0],n=e[1],i=e[2],r=e[3],o=e[4],a=e[5],s=O.fromScale(te.WGS84.radii),c=new h(t,n,o),u=new h(i,r,a);return{shape:Sc.ELLIPSOID,minBounds:c,maxBounds:u,shapeTransform:s}}var b2t=new h,x2t=new $;function T2t(e){let t=Jt.unpack(e),n=$.getScale(t.halfAxes,b2t),i=$.getRotation(t.halfAxes,x2t);return{shape:Sc.BOX,minBounds:h.negate(n,new h),maxBounds:h.clone(n),shapeTransform:O.fromRotationTranslation(i,t.center)}}function C2t(e){let{minRadius:t,maxRadius:n,height:i,minAngle:r=-I.PI,maxAngle:o=I.PI,translation:a=[0,0,0],rotation:s=[0,0,0,1]}=e,c=-.5*i+a[2],u=.5*i+a[2],f=O.fromTranslationQuaternionRotationScale(h.unpack(a),Fe.unpack(s),h.ONE);return{shape:Sc.CYLINDER,minBounds:h.fromElements(t,r,c),maxBounds:h.fromElements(n,o,u),shapeTransform:f}}function v2t(e,t){let{schemaUri:n,schema:i}=e;return l(n)?Ni.getSchemaLoader({resource:t.getDerivedResource({url:n})}):Ni.getSchemaLoader({schema:i})}function E2t(e,t){let{schema:n,statistics:i}=e,r=i?.classes[t],o=n.classes[t].properties,a=Object.entries(o).map(([g,m])=>{let{type:y,componentType:A}=m,b=r?.properties[g].min,x=r?.properties[g].max,T=gt.getComponentCount(y),C=gOe(b,T),E=gOe(x,T);return{id:g,type:y,componentType:A,minValue:C,maxValue:E}}),s=a.map(g=>g.id),c=a.map(g=>g.type),u=a.map(g=>g.componentType),f=a.map(g=>g.minValue),d=a.map(g=>g.maxValue),p=f.some(l);return{className:t,names:s,types:c,componentTypes:u,minimumValues:p?f:void 0,maximumValues:p?d:void 0}}function gOe(e,t){if(!l(e))return;let n=Array.isArray(e)?e:[e];return Array.from({length:t},(i,r)=>n[r])}async function S2t(e,t){let n=e._implicitTileset,i=e._subtreeCache,r=i.find(t);if(l(r))return r;let o=n.subtreeUriTemplate.getDerivedResource({templateValues:t.getTemplateValues()}),a=n.baseResource.getDerivedResource({url:o.url}),s=await a.fetchArrayBuffer();if(r=i.find(t),l(r))return r;let c=Vy(s);return r=await y_.fromSubtreeJson(a,c.jsonPayload,c.binaryPayload,n,t),i.addSubtree(r),r}EO.prototype.requestData=async function(e){e=e??H.EMPTY_OBJECT;let{tileLevel:t=0,tileX:n=0,tileY:i=0,tileZ:r=0,keyframe:o=0}=e;if(o!==0)return Promise.reject("3D Tiles currently doesn't support time-dynamic data.");let a=this._implicitTileset,s=new v0({subdivisionScheme:a.subdivisionScheme,subtreeLevels:a.subtreeLevels,level:t,x:n,y:i,z:r}),c=s.isSubtreeRoot()&&s.level>0,u=c?s.getParentSubtreeCoordinates():s.getSubtreeCoordinates(),d=await S2t(this,u);if(!(c?d.childSubtreeIsAvailableAtCoordinates:d.tileIsAvailableAtCoordinates).call(d,s))return Promise.reject(`Tile is not available at level ${t}, x ${n}, y ${i}, z ${r}.`);let{contentUriTemplates:m,baseResource:y}=a,A=m[0].getDerivedResource({templateValues:s.getTemplateValues()}),b=y.getDerivedResource({url:A.url});return LS.fromGltf(b)};var _Oe=EO;function Zie(e){e=e??1,this._radius=e??1}Object.defineProperties(Zie.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});Zie.prototype.emit=function(e){let t=I.randomBetween(0,I.TWO_PI),n=I.randomBetween(0,this._radius),i=n*Math.cos(t),r=n*Math.sin(t),o=0;e.position=h.fromElements(i,r,o,e.position),e.velocity=h.clone(h.UNIT_Z,e.velocity)};var b5=Zie;var x5={CUMULUS:0};x5.validate=function(e){return e===x5.CUMULUS};Object.freeze(x5);var SO=x5;function fm(e,t){if(e=e??H.EMPTY_OBJECT,this._show=e.show??!0,this._position=h.clone(e.position??h.ZERO),!l(e.scale)&&l(e.maximumSize))this._maximumSize=h.clone(e.maximumSize),this._scale=new k(this._maximumSize.x,this._maximumSize.y);else{this._scale=k.clone(e.scale??new k(20,12));let n=new h(this._scale.x,this._scale.y,Math.min(this._scale.x,this._scale.y)/1.5);this._maximumSize=h.clone(e.maximumSize??n)}this._slice=e.slice??-1,this._color=U.clone(e.color??U.WHITE),this._brightness=e.brightness??1,this._cloudCollection=t,this._index=-1}var w2t=fm.SHOW_INDEX=0,I2t=fm.POSITION_INDEX=1,P2t=fm.SCALE_INDEX=2,D2t=fm.MAXIMUM_SIZE_INDEX=3,R2t=fm.SLICE_INDEX=4,O2t=fm.BRIGHTNESS_INDEX=5,M2t=fm.COLOR_INDEX=6;fm.NUMBER_OF_PROPERTIES=7;function pT(e,t){let n=e._cloudCollection;l(n)&&(n._updateCloud(e,t),e._dirty=!0)}Object.defineProperties(fm.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,pT(this,w2t))}},position:{get:function(){return this._position},set:function(e){let t=this._position;h.equals(t,e)||(h.clone(e,t),pT(this,I2t))}},scale:{get:function(){return this._scale},set:function(e){let t=this._scale;k.equals(t,e)||(k.clone(e,t),pT(this,P2t))}},maximumSize:{get:function(){return this._maximumSize},set:function(e){let t=this._maximumSize;h.equals(t,e)||(h.clone(e,t),pT(this,D2t))}},color:{get:function(){return this._color},set:function(e){let t=this._color;U.equals(t,e)||(U.clone(e,t),pT(this,M2t))}},slice:{get:function(){return this._slice},set:function(e){this._slice!==e&&(this._slice=e,pT(this,R2t))}},brightness:{get:function(){return this._brightness},set:function(e){this._brightness!==e&&(this._brightness=e,pT(this,O2t))}}});fm.prototype._destroy=function(){this._cloudCollection=void 0};var qd=fm;var Rf,T5=new h,L2t={positionHighAndScaleX:0,positionLowAndScaleY:1,packedAttribute0:2,packedAttribute1:3,color:4},N2t={direction:0,positionHighAndScaleX:1,positionLowAndScaleY:2,packedAttribute0:3,packedAttribute1:4,color:5},F2t=qd.SHOW_INDEX,B2t=qd.POSITION_INDEX,k2t=qd.SCALE_INDEX,z2t=qd.MAXIMUM_SIZE_INDEX,U2t=qd.SLICE_INDEX,V2t=qd.BRIGHTNESS_INDEX,j2t=qd.NUMBER_OF_PROPERTIES,H2t=qd.COLOR_INDEX;function dm(e){e=e??H.EMPTY_OBJECT,this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(j2t),this._noiseTexture=void 0,this._textureSliceWidth=128,this._noiseTextureRows=4,this.noiseDetail=e.noiseDetail??16,this.noiseOffset=h.clone(e.noiseOffset??h.ZERO),this._loading=!1,this._ready=!1;let t=this;this._uniforms={u_noiseTexture:function(){return t._noiseTexture},u_noiseTextureDimensions:yOe(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 yOe(e){return function(){return T5.x=e._textureSliceWidth,T5.y=e._noiseTextureRows,T5.z=1/e._noiseTextureRows,T5}}Object.defineProperties(dm.prototype,{length:{get:function(){return ere(this),this._clouds.length}}});function AOe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}dm.prototype.add=function(e){e=e??H.EMPTY_OBJECT;let t=e.cloudType??SO.CUMULUS,n;return t===SO.CUMULUS&&(n=new qd(e,this),n._index=this._clouds.length,this._clouds.push(n),this._createVertexArray=!0),n};dm.prototype.remove=function(e){return this.contains(e)?(this._clouds[e._index]=void 0,this._cloudsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};dm.prototype.removeAll=function(){AOe(this._clouds),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!0};function ere(e){if(e._cloudsRemoved){e._cloudsRemoved=!1;let t=[],n=e._clouds,i=n.length;for(let r=0,o=0;r<i;++r){let a=n[r];l(a)&&(n._index=o++,t.push(a))}e._clouds=t}}dm.prototype._updateCloud=function(e,t){e._dirty||(this._cloudsToUpdate[this._cloudsToUpdateIndex++]=e),++this._propertiesChanged[t]};dm.prototype.contains=function(e){return l(e)&&e._cloudCollection===this};dm.prototype.get=function(e){return ere(this),this._clouds[e]};var G2t=new Float32Array([-1,-1,1,-1,1,1,-1,1]),W2t=new Uint16Array([0,1,2,0,2,3]);function q2t(e){let t=Ze.createVertexBuffer({context:e,typedArray:G2t,usage:Oe.STATIC_DRAW}),n=Ze.createIndexBuffer({context:e,typedArray:W2t,usage:Oe.STATIC_DRAW,indexDatatype:Ve.UNSIGNED_SHORT}),i=[{index:0,vertexBuffer:t,componentsPerAttribute:2,componentDatatype:Y.FLOAT}];return new Vn({context:e,attributes:i,indexBuffer:n})}var tre;function Y2t(e){let n=e.cache.cloudCollection_indexBufferBatched;if(l(n))return n;let i=16384*6-6,r=new Uint16Array(i);for(let o=0,a=0;o<i;o+=6,a+=4)r[o]=a,r[o+1]=a+1,r[o+2]=a+2,r[o+3]=a,r[o+4]=a+2,r[o+5]=a+3;return n=Ze.createIndexBuffer({context:e,typedArray:r,usage:Oe.STATIC_DRAW,indexDatatype:Ve.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferBatched=n,n}function X2t(e){let t=e.cache.cloudCollection_indexBufferInstanced;return l(t)||(t=Ze.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Oe.STATIC_DRAW,indexDatatype:Ve.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferInstanced=t),t}function K2t(e){let t=e.cache.cloudCollection_vertexBufferInstanced;return l(t)||(t=Ze.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Oe.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_vertexBufferInstanced=t),t}function $2t(e,t,n){let i=[{index:Rf.positionHighAndScaleX,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:Oe.STATIC_DRAW},{index:Rf.positionLowAndScaleY,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:Oe.STATIC_DRAW},{index:Rf.packedAttribute0,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:Oe.STATIC_DRAW},{index:Rf.packedAttribute1,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:Oe.STATIC_DRAW},{index:Rf.color,componentsPerAttribute:4,componentDatatype:Y.UNSIGNED_BYTE,normalize:!0,usage:Oe.STATIC_DRAW}];n&&i.push({index:Rf.direction,componentsPerAttribute:2,componentDatatype:Y.FLOAT,vertexBuffer:K2t(e)});let r=n?t:4*t;return new ay(e,i,r,n)}var Qie=new Sn;function bOe(e,t,n,i){let r,o=n[Rf.positionHighAndScaleX],a=n[Rf.positionLowAndScaleY],s=i.position;Sn.fromCartesian(s,Qie);let c=i.scale,u=Qie.high,f=Qie.low;e._instanced?(r=i._index,o(r,u.x,u.y,u.z,c.x),a(r,f.x,f.y,f.z,c.y)):(r=i._index*4,o(r+0,u.x,u.y,u.z,c.x),o(r+1,u.x,u.y,u.z,c.x),o(r+2,u.x,u.y,u.z,c.x),o(r+3,u.x,u.y,u.z,c.x),a(r+0,f.x,f.y,f.z,c.y),a(r+1,f.x,f.y,f.z,c.y),a(r+2,f.x,f.y,f.z,c.y),a(r+3,f.x,f.y,f.z,c.y))}function xOe(e,t,n,i){let r,o=n[Rf.packedAttribute0],a=i.show,s=i.brightness;e._instanced?(r=i._index,o(r,a,s,0,0)):(r=i._index*4,o(r+0,a,s,0,0),o(r+1,a,s,1,0),o(r+2,a,s,1,1),o(r+3,a,s,0,1))}function TOe(e,t,n,i){let r,o=n[Rf.packedAttribute1],a=i.maximumSize,s=i.slice;e._instanced?(r=i._index,o(r,a.x,a.y,a.z,s)):(r=i._index*4,o(r+0,a.x,a.y,a.z,s),o(r+1,a.x,a.y,a.z,s),o(r+2,a.x,a.y,a.z,s),o(r+3,a.x,a.y,a.z,s))}function COe(e,t,n,i){let r,o=n[Rf.color],a=i.color,s=U.floatToByte(a.red),c=U.floatToByte(a.green),u=U.floatToByte(a.blue),f=U.floatToByte(a.alpha);e._instanced?(r=i._index,o(r,s,c,u,f)):(r=i._index*4,o(r+0,s,c,u,f),o(r+1,s,c,u,f),o(r+2,s,c,u,f),o(r+3,s,c,u,f))}function J2t(e,t,n,i){bOe(e,t,n,i),xOe(e,t,n,i),TOe(e,t,n,i),COe(e,t,n,i)}function Z2t(e,t,n,i){let r=e,o=r._textureSliceWidth,a=r._noiseTextureRows,s=t.context;r._vaNoise=q2t(s),r._spNoise=Zt.fromCache({context:s,vertexShaderSource:n,fragmentShaderSource:i,attributeLocations:{position:0}});let c=r.noiseDetail,u=r.noiseOffset;r._noiseTexture=new Et({context:s,width:o*o/a,height:o*a,pixelDatatype:ke.UNSIGNED_BYTE,pixelFormat:He.RGBA,sampler:new Ut({wrapS:on.REPEAT,wrapT:on.REPEAT,minificationFilter:Gt.NEAREST,magnificationFilter:ni.NEAREST})});let f=new lu({vertexArray:r._vaNoise,shaderProgram:r._spNoise,outputTexture:r._noiseTexture,uniformMap:{u_noiseTextureDimensions:yOe(r),u_noiseDetail:function(){return c},u_noiseOffset:function(){return u}},persists:!1,owner:e,postExecute:function(d){r._ready=!0,r._loading=!1}});t.commandList.push(f),r._loading=!0}function Q2t(e,t){let n=e,i=t.context;n._createVertexArray=!1,n._vaf=n._vaf&&n._vaf.destroy();let r=e._clouds,o=r.length;if(o>0){n._vaf=$2t(i,o,n._instanced);let a=n._vaf.writers,s;for(s=0;s<o;++s){let c=r[s];J2t(e,t,a,c)}n._vaf.commit(tre(i))}}var ekt=[];function tkt(e,t){let n=t.context,i=e,o=i._clouds.length,a=i._cloudsToUpdate,s=i._cloudsToUpdateIndex,c=i._propertiesChanged,u=ekt;u.length=0,(c[B2t]||c[k2t])&&u.push(bOe),(c[F2t]||c[V2t])&&u.push(xOe),(c[z2t]||c[U2t])&&u.push(TOe),c[H2t]&&u.push(COe);let f=u.length,d=i._vaf.writers,p,g,m;if(s/o>.1){for(p=0;p<s;++p)for(g=a[p],g._dirty=!1,m=0;m<f;++m)u[m](e,t,d,g);i._vaf.commit(tre(n))}else{for(p=0;p<s;++p){for(g=a[p],g._dirty=!1,m=0;m<f;++m)u[m](e,t,d,g);i._instanced?i._vaf.subCommit(g._index,1):i._vaf.subCommit(g._index*4,4)}i._vaf.endSubCommits()}i._cloudsToUpdateIndex=0}function nkt(e,t,n,i){let r=t.context,o=e,a=new Ge({defines:[],sources:[n]});o._instanced&&a.defines.push("INSTANCED");let s=new Ge({defines:[],sources:[i]});o.debugBillboards&&s.defines.push("DEBUG_BILLBOARDS"),o.debugEllipsoids&&s.defines.push("DEBUG_ELLIPSOIDS"),o._sp=Zt.replaceCache({context:r,shaderProgram:o._sp,vertexShaderSource:a,fragmentShaderSource:s,attributeLocations:Rf}),o._rs=je.fromCache({depthTest:{enabled:!0,func:ee.LESS},depthMask:!1,blending:en.ALPHA_BLEND}),o._spCreated=!0,o._compiledDebugBillboards=o.debugBillboards,o._compiledDebugEllipsoids=o.debugEllipsoids}function ikt(e,t){let n=e,i=t.passes,r=n._uniforms,o=t.commandList;if(i.render){let a=n._colorCommands,s=n._vaf.va,c=s.length;a.length=c;for(let u=0;u<c;u++){let f=a[u];l(f)||(f=a[u]=new nt),f.pass=Pe.TRANSLUCENT,f.owner=e,f.uniformMap=r,f.count=s[u].indicesCount,f.vertexArray=s[u].va,f.shaderProgram=n._sp,f.renderState=n._rs,n._instanced&&(f.count=6,f.instanceCount=n._clouds.length),o.push(f)}}}dm.prototype.update=function(e){if(ere(this),!this.show)return;let t=this.debugBillboards||this.debugEllipsoids;this._ready=t?!0:l(this._noiseTexture),!this._ready&&!this._loading&&!t&&Z2t(this,e,_5,g5),this._instanced=e.context.instancedArrays,Rf=this._instanced?N2t:L2t,tre=this._instanced?X2t:Y2t;let i=this._clouds.length,r=this._cloudsToUpdate,o=this._cloudsToUpdateIndex;this._createVertexArray?Q2t(this,e):o>0&&tkt(this,e),o>i*1.5&&(r.length=i),!(!l(this._vaf)||!l(this._vaf.va)||!this._ready&!t)&&((!this._spCreated||this.debugBillboards!==this._compiledDebugBillboards||this.debugEllipsoids!==this._compiledDebugEllipsoids)&&nkt(this,e,p5,m5),ikt(this,e))};dm.prototype.isDestroyed=function(){return!1};dm.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(),AOe(this._clouds),ue(this)};var vOe=dm;var rkt=I.toRadians(30);function nre(e){this._angle=e??rkt}Object.defineProperties(nre.prototype,{angle:{get:function(){return this._angle},set:function(e){this._angle=e}}});nre.prototype.emit=function(e){let t=Math.tan(this._angle),n=I.randomBetween(0,I.TWO_PI),i=I.randomBetween(0,t),r=i*Math.cos(n),o=i*Math.sin(n),a=1;e.velocity=h.fromElements(r,o,a,e.velocity),h.normalize(e.velocity,e.velocity),e.position=h.clone(h.ZERO,e.position)};var EOe=nre;function wO(e){e=e??H.EMPTY_OBJECT;let t=e.attributeName,n=e.perInstanceAttribute;l(n)||(n=!1);let i=e.glslDatatype??"vec3",r=`v_${t}`,o;if(t==="normal"||t==="tangent"||t==="bitangent")o=`vec4 getColor() { return vec4((${r} + vec3(1.0)) * 0.5, 1.0); }
|
|
`;else switch(t==="st"&&(i="vec2"),i){case"float":o=`vec4 getColor() { return vec4(vec3(${r}), 1.0); }
|
|
`;break;case"vec2":o=`vec4 getColor() { return vec4(${r}, 0.0, 1.0); }
|
|
`;break;case"vec3":o=`vec4 getColor() { return vec4(${r}, 1.0); }
|
|
`;break;case"vec4":o=`vec4 getColor() { return ${r}; }
|
|
`;break}let a=`in vec3 position3DHigh;
|
|
in vec3 position3DLow;
|
|
in float batchId;
|
|
${n?"":`in ${i} ${t};
|
|
`}out ${i} ${r};
|
|
void main()
|
|
{
|
|
vec4 p = czm_translateRelativeToEye(position3DHigh, position3DLow);
|
|
${n?`${r} = czm_batchTable_${t}(batchId);
|
|
`:`${r} = ${t};
|
|
`}gl_Position = czm_modelViewProjectionRelativeToEye * p;
|
|
}`,s=`in ${i} ${r};
|
|
${o}
|
|
void main()
|
|
{
|
|
out_FragColor = getColor();
|
|
}`;this.material=void 0,this.translucent=e.translucent??!1,this._vertexShaderSource=e.vertexShaderSource??a,this._fragmentShaderSource=e.fragmentShaderSource??s,this._renderState=Sr.getDefaultRenderState(!1,!1,e.renderState),this._closed=e.closed??!1,this._attributeName=t,this._glslDatatype=i}Object.defineProperties(wO.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}}});wO.prototype.getFragmentShaderSource=Sr.prototype.getFragmentShaderSource;wO.prototype.isTranslucent=Sr.prototype.isTranslucent;wO.prototype.getRenderState=Sr.prototype.getRenderState;var SOe=wO;function C5(e){e=e??H.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=O.clone(e.modelMatrix??O.IDENTITY),this._modelMatrix=new O,this.id=e.id,this._id=void 0,this._primitive=void 0}C5.prototype.update=function(e){if(this.show){if(!l(this._primitive)||!O.equals(this._modelMatrix,this.modelMatrix)||this._length!==this.length||this._width!==this.width||this._id!==this.id){this._modelMatrix=O.clone(this.modelMatrix,this._modelMatrix),this._length=this.length,this._width=this.width,this._id=this.id,l(this._primitive)&&this._primitive.destroy(),this.modelMatrix[12]===0&&this.modelMatrix[13]===0&&this.modelMatrix[14]===0&&(this.modelMatrix[14]=.01);let t=new Bt({geometry:new V_({positions:[h.ZERO,h.UNIT_X],width:this.width,vertexFormat:Ua.VERTEX_FORMAT,colors:[U.RED,U.RED],arcType:sn.NONE}),modelMatrix:O.multiplyByUniformScale(this.modelMatrix,this.length,new O),id:this.id,pickPrimitive:this}),n=new Bt({geometry:new V_({positions:[h.ZERO,h.UNIT_Y],width:this.width,vertexFormat:Ua.VERTEX_FORMAT,colors:[U.GREEN,U.GREEN],arcType:sn.NONE}),modelMatrix:O.multiplyByUniformScale(this.modelMatrix,this.length,new O),id:this.id,pickPrimitive:this}),i=new Bt({geometry:new V_({positions:[h.ZERO,h.UNIT_Z],width:this.width,vertexFormat:Ua.VERTEX_FORMAT,colors:[U.BLUE,U.BLUE],arcType:sn.NONE}),modelMatrix:O.multiplyByUniformScale(this.modelMatrix,this.length,new O),id:this.id,pickPrimitive:this});this._primitive=new Fn({geometryInstances:[t,n,i],appearance:new Ua,asynchronous:!1})}this._primitive.update(e)}};C5.prototype.isDestroyed=function(){return!1};C5.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};var v5=C5;function okt(e){this.direction=h.clone(e.direction),this.color=U.clone(e.color??U.WHITE),this.intensity=e.intensity??1}var wOe=okt;var E5=`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);
|
|
|
|
// Convert tangent space material normal to eye space
|
|
materialInput.normalEC = normalEC;
|
|
materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, materialInput.normalEC);
|
|
|
|
// Convert view vector to world space
|
|
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 S5=`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; // position in model coordinates
|
|
v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates
|
|
v_st = st;
|
|
|
|
gl_Position = czm_modelViewProjectionRelativeToEye * p;
|
|
}
|
|
`;function gT(e){e=e??H.EMPTY_OBJECT;let t=e.translucent??!0,n=e.aboveGround??!1;this.material=l(e.material)?e.material:ir.fromType(ir.ColorType),this.translucent=e.translucent??!0,this._vertexShaderSource=e.vertexShaderSource??S5,this._fragmentShaderSource=e.fragmentShaderSource??E5,this._renderState=Sr.getDefaultRenderState(t,!n,e.renderState),this._closed=!1,this._flat=e.flat??!1,this._faceForward=e.faceForward??n,this._aboveGround=n}Object.defineProperties(gT.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 gT.VERTEX_FORMAT}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}},aboveGround:{get:function(){return this._aboveGround}}});gT.VERTEX_FORMAT=Be.POSITION_AND_ST;gT.prototype.getFragmentShaderSource=Sr.prototype.getFragmentShaderSource;gT.prototype.isTranslucent=Sr.prototype.isTranslucent;gT.prototype.getRenderState=Sr.prototype.getRenderState;var IOe=gT;var akt=1e5;function IO(e){e=e??H.EMPTY_OBJECT;let t=e.credit;typeof t=="string"&&(t=new wt(t)),this._credit=t,this._radius=l(e.radius)?e.radius:akt,this._image=e.image,this._transform=l(e.transform)?e.transform:O.IDENTITY,this._repeatHorizontal=l(e.repeatHorizontal)?e.repeatHorizontal:1,this._repeatVertical=l(e.repeatVertical)?e.repeatVertical:1;let n=new gF({radius:this._radius,vertexFormat:Be.ALL}),i=new Bt({geometry:n,modelMatrix:this._transform}),r=new ir({fabric:{type:"Image",uniforms:{image:this._image,repeat:new k(-this._repeatHorizontal,this._repeatVertical)}}});return this._primitive=new Fn({geometryInstances:i,appearance:new Ar({material:r,closed:!0,faceForward:!1,flat:!0,translucent:!1,renderState:{cull:{enabled:!1}}}),credit:this._credit}),this}Object.defineProperties(IO.prototype,{radius:{get:function(){return this._radius}},image:{get:function(){return this._image}},transform:{get:function(){return this._transform}},credit:{get:function(){return l(this._credit)?this._credit:void 0}},show:{get:function(){return l(this._primitive)?this._primitive.show:void 0},set:function(e){l(this._primitive)&&(this._primitive.show=e)}}});IO.prototype.update=function(e){return l(this._credit)&&e.creditDisplay.addCreditToNextFrame(this._credit),this._primitive.update(e)};IO.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};IO.prototype.isDestroyed=function(){return this._primitive.isDestroyed()};var POe=IO;function Fu(e){this._scene=e.scene,this.samplingWindow=e.samplingWindow??Fu.defaultSettings.samplingWindow,this.quietPeriod=e.quietPeriod??Fu.defaultSettings.quietPeriod,this.warmupPeriod=e.warmupPeriod??Fu.defaultSettings.warmupPeriod,this.minimumFrameRateDuringWarmup=e.minimumFrameRateDuringWarmup??Fu.defaultSettings.minimumFrameRateDuringWarmup,this.minimumFrameRateAfterWarmup=e.minimumFrameRateAfterWarmup??Fu.defaultSettings.minimumFrameRateAfterWarmup,this._lowFrameRate=new be,this._nominalFrameRate=new be,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(r,o){skt(t,o)}),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(){ckt(t)}this._visibilityChangeRemoveListener=void 0,l(n)&&(document.addEventListener(n,i,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(n,i,!1)})}Fu.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8};Fu.fromScene=function(e){return(!l(e._frameRateMonitor)||e._frameRateMonitor.isDestroyed())&&(e._frameRateMonitor=new Fu({scene:e})),e._frameRateMonitor};Object.defineProperties(Fu.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}}});Fu.prototype.pause=function(){++this._pauseCount,this._pauseCount===1&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)};Fu.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)};Fu.prototype.isDestroyed=function(){return!1};Fu.prototype.destroy=function(){return this._preUpdateRemoveListener(),l(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),ue(this)};function skt(e,t){if(e._pauseCount>0)return;let n=An();if(e._needsQuietPeriod)e._needsQuietPeriod=!1,e._frameTimes.length=0,e._quietPeriodEndTime=n+e.quietPeriod/Un.SECONDS_PER_MILLISECOND,e._warmupPeriodEndTime=e._quietPeriodEndTime+(e.warmupPeriod+e.samplingWindow)/Un.SECONDS_PER_MILLISECOND;else if(n>=e._quietPeriodEndTime){e._frameTimes.push(n);let i=n-e.samplingWindow/Un.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 r=(n-e._frameTimes[0])/(e._frameTimes.length-1);e._lastFramesPerSecond=1e3/r;let o=1e3/(n>e._warmupPeriodEndTime?e.minimumFrameRateAfterWarmup:e.minimumFrameRateDuringWarmup);r>o?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 ckt(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}var w5=Fu;var rre=class e{constructor(t){t=t??H.EMPTY_OBJECT;let n=lkt(t.geoJson),i=t.allowPicking??!0,r=t.ellipsoid??te.default,o=new Float64Array(0);function a(d){return o.length<d&&(o=new Float64Array(d)),o}if(this.show=t.show??!0,this._url=t.url,this._ids=n.ids,this._properties=n.properties,this._featureCount=n.ids.length,this._pickObjectFactory=t.pickObjectFactory,this._points=void 0,this._polylines=void 0,this._polygons=void 0,n.pointCount>0){let d={primitiveCountMax:n.pointCount,allowPicking:i};this._points=new hf(d)}if(n.polylineCount>0){let d={primitiveCountMax:n.polylineCount,vertexCountMax:n.polylineVertexCount,allowPicking:i};this._polylines=new vl(d)}if(n.polygonCount>0){let d={primitiveCountMax:n.polygonCount,vertexCountMax:n.polygonVertexCount,holeCountMax:n.polygonHoleCount,triangleCountMax:n.polygonTriangleCount,allowPicking:i};this._polygons=new Cl(d)}let s=new h,c=0,u=0,f=0;for(let d=0;d<n.features.length;d++){let p=n.features[d],g=p.featureId,m=this._properties[g];for(let y=0;y<p.points.length;y++){let A=c++;this._points.add({featureId:g,position:NOe(p.points[y],r,s),pickObject:i?ire(this,A,this._points,el,m):void 0})}for(let y=0;y<p.polylines.length;y++){let A=u++;this._polylines.add({featureId:g,positions:DOe(p.polylines[y],r,a),pickObject:i?ire(this,A,this._polylines,Cs,m):void 0})}for(let y=0;y<p.polygons.length;y++){let A=p.polygons[y],b=f++;this._polygons.add({featureId:g,positions:DOe(A.positions,r,a),holes:A.holes,triangles:A.triangles,pickObject:i?ire(this,b,this._polygons,oa,m):void 0})}}}get url(){let t=this._url;if(l(t))return t instanceof De?t.getUrlComponent(!0):t}get featureCount(){return this._featureCount}get ids(){return this._ids}get properties(){return this._properties}get points(){return this._points}get polylines(){return this._polylines}get polygons(){return this._polygons}static async fromUrl(t,n){let i=De.createIfNeeded(t),r=await i.fetchJson();if(!l(r))throw new oe(`Failed to load GeoJSON from ${i.getUrlComponent(!0)}.`);return e.fromGeoJson(r,{...n,url:i})}static fromGeoJson(t,n){return new e({...n,geoJson:t})}getId(t){return this._ids[t]}getProperties(t){return this._properties[t]}update(t){this.show&&(l(this._points)&&this._points.update(t),l(this._polylines)&&this._polylines.update(t),l(this._polygons)&&this._polygons.update(t))}destroy(){return this._points&&(this._points.destroy(),this._points=void 0),this._polylines&&(this._polylines.destroy(),this._polylines=void 0),this._polygons&&(this._polygons.destroy(),this._polygons=void 0),ue(this)}isDestroyed(){return!1}};function ire(e,t,n,i,r){return l(e._pickObjectFactory)?e._pickObjectFactory(t,n,r):{index:t,collection:n,get primitive(){return n.get(t,new i)},parentPrimitive:e,properties:r}}function lkt(e){let t=ukt(e),n=[],i=[],r=[],o=0,a=0,s=0,c=0,u=0,f=0,d=0;for(let p=0;p<t.length;p++){let g=t[p],m={points:[],polylines:[],polygons:[]};if(ROe(g.geometry,m),m.points.length===0&&m.polylines.length===0&&m.polygons.length===0)continue;let y=i.length;i.push(g.id),r.push(xkt(g.properties)?g.properties:H.EMPTY_OBJECT);for(let A=0;A<m.polygons.length;A++){let b=m.polygons[A];f+=b.holes.length,d+=b.triangles.length/3,u+=b.positions.length}for(let A=0;A<m.polylines.length;A++)s+=m.polylines[A].length;o+=m.points.length,a+=m.polylines.length,c+=m.polygons.length,n.push({featureId:y,points:m.points,polylines:m.polylines,polygons:m.polygons})}return{features:n,ids:i,properties:r,pointCount:o,polylineCount:a,polylineVertexCount:s,polygonCount:c,polygonVertexCount:u,polygonHoleCount:f,polygonTriangleCount:d}}function ukt(e){if(!l(e)||!l(e.type))throw new oe("GeoJSON object must define 'type'.");switch(e.type){case"FeatureCollection":return e.features;case"Feature":return[e];default:if(Akt(e.type))return[{type:"Feature",geometry:e,properties:H.EMPTY_OBJECT,id:void 0}];throw new oe(`Unsupported GeoJSON type: ${e.type}`)}}function ROe(e,t){if(!(!l(e)||!l(e.type)))switch(e.type){case"Point":OOe(e.coordinates,t.points);return;case"MultiPoint":dkt(e.coordinates,t.points);return;case"LineString":MOe(e.coordinates,t.polylines);return;case"MultiLineString":hkt(e.coordinates,t.polylines);return;case"Polygon":LOe(e.coordinates,t.polygons);return;case"MultiPolygon":mkt(e.coordinates,t.polygons);return;case"GeometryCollection":fkt(e.geometries,t);return;default:return}}function fkt(e,t){if(Array.isArray(e))for(let n=0;n<e.length;n++)ROe(e[n],t)}function OOe(e,t){let n=ore(e);l(n)&&t.push(n)}function dkt(e,t){for(let n=0;n<e.length;n++)OOe(e[n],t)}function MOe(e,t){let n=pkt(e);l(n)&&n.length>=2&&t.push(n)}function hkt(e,t){for(let n=0;n<e.length;n++)MOe(e[n],t)}function LOe(e,t){let n=gkt(e);l(n)&&t.push(n)}function mkt(e,t){for(let n=0;n<e.length;n++)LOe(e[n],t)}function pkt(e){if(!Array.isArray(e))return;let t=[];for(let n=0;n<e.length;n++){let i=ore(e[n]);l(i)&&t.push(i)}return t.length>=2?t:void 0}function gkt(e){if(!Array.isArray(e)||e.length===0)return;let t=[];for(let s=0;s<e.length;s++){let c=_kt(e[s]);l(c)&&t.push(c)}if(t.length===0||t[0].length<3)return;let i=[],r=[],o=[];for(let s=0;s<t.length;s++){let c=t[s];if(!(c.length<3)){s>0&&o.push(r.length);for(let u=0;u<c.length;u++){let f=c[u];r.push(f),i.push(new k(f[0],f[1]))}}}if(r.length<3)return;let a=li.triangulate(i,o);if(!(!l(a)||a.length<3))return{positions:r,holes:new Uint32Array(o),triangles:new Uint32Array(a)}}function _kt(e){if(!Array.isArray(e))return;let t=[];for(let n=0;n<e.length;n++){let i=ore(e[n]);l(i)&&t.push(i)}if(!(t.length<3))return t.length>1&&ykt(t[0],t[t.length-1])&&t.pop(),t.length>=3?t:void 0}function ore(e){if(!Array.isArray(e)||e.length<2)return;let t=e[0],n=e[1],i=e[2]??0;if(!(!Number.isFinite(t)||!Number.isFinite(n)||!Number.isFinite(i)))return[t,n,i]}function ykt(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function Akt(e){return e==="Point"||e==="MultiPoint"||e==="LineString"||e==="MultiLineString"||e==="Polygon"||e==="MultiPolygon"||e==="GeometryCollection"}function NOe(e,t,n){return h.fromDegrees(e[0],e[1],e[2]??0,t,n)}var bkt=new h;function DOe(e,t,n){let i=e.length*3,r=n(i);for(let o=0;o<e.length;o++){let a=NOe(e[o],t,bkt);r[o*3]=a.x,r[o*3+1]=a.y,r[o*3+2]=a.z}return r.subarray(0,i)}function xkt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var FOe=rre;var BOe=La(gX(),1);function are(){this._image=new Image}are.prototype.isReady=function(){return!0};are.prototype.shouldDiscardImage=function(e){return e===this._image};function _T(e){e=e??H.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 $i({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ie(-I.PI,-I.PI,I.PI,I.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new wt(t)),this._credit=t,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=23,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new are),this._errorEvent=new be}Object.defineProperties(_T.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}}});_T.fromMetadata=function(e,t){if(!e.imageryPresent)throw new oe(`The server ${e.url} doesn't have imagery`);let n=new _T(t);return n._metadata=e,n};_T.prototype.getTileCredits=function(e,t,n){let i=this._metadata,r=i.getTileInformation(e,t,n);if(l(r)){let o=i.providers[r.imageryProvider];if(l(o))return[o]}};_T.prototype.requestImage=function(e,t,n,i){let r=this._tileDiscardPolicy._image,o=this._metadata,a=M_.tileXYToQuadKey(e,t,n),s=o.getTileInformation(e,t,n);if(!l(s)){if(o.isValid(a)){let u=new Eo({throttle:i.throttle,throttleByServer:i.throttleByServer,type:i.type,priorityFunction:i.priorityFunction});o.populateSubtree(e,t,n,u);return}return Promise.resolve(r)}if(!s.hasImagery())return Promise.resolve(r);let c=Tkt(this,s,e,t,n,i).fetchArrayBuffer();if(l(c))return c.then(function(u){Ck(o.key,u);let f=new Uint8Array(u),d,p=o.protoImagery;if((!l(p)||!p)&&(d=Ckt(f)),!l(d)&&(!l(p)||p)){let g=vkt(f);d=g.imageType,f=g.imageData}return!l(d)||!l(f)?r:m_({uint8Array:f,format:d,flipY:!0})})};_T.prototype.pickFeatures=function(e,t,n,i,r){};function Tkt(e,t,n,i,r,o){let a=M_.tileXYToQuadKey(n,i,r),s=t.imageryVersion;return s=l(s)&&s>0?s:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1-0${a}-i.${s.toString()}`,request:o})}function Ckt(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 vkt(e){let t=BOe.Reader.create(e),n=t.len,i={};for(;t.pos<n;){let a=t.uint32(),s;switch(a>>>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(s=i.copyrightIds,l(s)||(s=i.copyrightIds=[]),(a&7)===2){let c=t.uint32()+t.pos;for(;t.pos<c;)s.push(t.uint32())}else s.push(t.uint32());break;default:t.skipType(a&7);break}}let r=i.imageType;if(l(r))switch(r){case 0:i.imageType="image/jpeg";break;case 4:i.imageType="image/png";break;default:throw new oe("GoogleEarthEnterpriseImageryProvider: Unsupported image type.")}let o=i.alphaType;return l(o)&&o!==0&&(console.log("GoogleEarthEnterpriseImageryProvider: External alpha not supported."),delete i.alphaType,delete i.imageAlpha),i}var kOe=_T;var Ekt=600;function Qp(e){e=e??H.EMPTY_OBJECT,this._key=l(e.key)?e.key:xs.defaultApiKey,this._baseResource=De.createIfNeeded(e.url??xs.streetViewStaticApiEndpoint),this._metadataResource=this._baseResource.getDerivedResource({url:"streetview/metadata"}),this._tileSize=e.tileSize??Ekt}Object.defineProperties(Qp.prototype,{});Qp.prototype.loadPanorama=async function(e){let t=e.cartographic,n=e.tileSize??this._tileSize,i=`${n}x${n}`,r=e.signature,{panoId:o}=e;l(o)||(o=(await this.getNearestPanoId(t)).panoId);let a=xs.getDefaultCredit(),s=h.fromDegrees(I.toDegrees(t.longitude),I.toDegrees(t.latitude),0),c=[this._loadFaceImage({heading:0,pitch:0,tileSizeString:i,panoId:o,signature:r}),this._loadFaceImage({heading:180,pitch:0,tileSizeString:i,panoId:o,signature:r}),this._loadFaceImage({heading:-90,pitch:-90,tileSizeString:i,panoId:o,signature:r}),this._loadFaceImage({heading:-90,pitch:90,tileSizeString:i,panoId:o,signature:r}),this._loadFaceImage({heading:270,pitch:0,tileSizeString:i,panoId:o,signature:r}),this._loadFaceImage({heading:90,pitch:0,tileSizeString:i,panoId:o,signature:r})],[u,f,d,p,g,m]=await Promise.all(c),y=mt.localFrameToFixedFrameGenerator("north","down"),A=O.getMatrix3(y(s,te.default),new $);return new zS({sources:{positiveX:u,negativeX:f,positiveY:d,negativeY:p,positiveZ:g,negativeZ:m},transform:A,credit:a})};Qp.prototype.getNearestPanoId=async function(e,t){let i=[I.toDegrees(e.latitude),I.toDegrees(e.longitude)].join(","),o=await this._metadataResource.getDerivedResource({queryParameters:{key:this._key,location:i,radius:t??50}}).fetchJson();if(o.status!=="OK")throw new pe(`GoogleStreetViewCubeMapPanoramaProvider metadata error: ${o.status}`);return{panoId:o.pano_id,latitude:o.location.lat,longitude:o.location.lng}};Qp.prototype.getPanoIdMetadata=async function(e){let n=await this._metadataResource.getDerivedResource({queryParameters:{key:this._key,pano:e}}).fetchJson();if(n.status!=="OK")throw new pe(`GoogleStreetViewCubeMapPanoramaProvider metadata error: ${n.status}`);return n};Qp.prototype._loadFaceImage=async function(e){let t=this._buildFaceUrl(e);try{return await De.fetchImage({url:t,preferImageBitmap:!0,flipY:!0})}catch{throw new pe(`Failed to load Street View face image: ${t}`)}};Qp.prototype._buildFaceUrl=function(e){let{heading:t,pitch:n,tileSizeString:i,panoId:r,signature:o}=e;return this._baseResource.getDerivedResource({queryParameters:{size:i,pano:r,heading:t,pitch:n,key:this._key,...l(o)&&{signature:o}}}).url};Qp.fromUrl=async function(e){if(e=e??{},e.key=e.key??xs.defaultStreetViewStaticApiKey??xs.defaultApiKey,!l(e.key)&&!l(xs.defaultStreetViewStaticApiKey)&&!l(xs.defaultApiKey))throw new pe("options.key, GoogleMaps.defaultStreetViewStaticApiKey or GoogleMaps.defaultApiKey is required.");return new Qp({...e})};Qp._parseMetadata=function(e){return{cartographic:de.fromDegrees(e.location.lng,e.location.lat,0)}};var zOe=Qp;var Skt=new U(1,1,1,.4),wkt=new U(0,1,0,.05),Ikt=new U(0,.5,0,.2);function yT(e){e=e??H.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=l(e.tilingScheme)?e.tilingScheme:new $i({ellipsoid:e.ellipsoid}),this._cells=e.cells??8,this._color=e.color??Skt,this._glowColor=e.glowColor??wkt,this._glowWidth=e.glowWidth??6,this._backgroundColor=e.backgroundColor??Ikt,this._errorEvent=new be,this._tileWidth=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._canvasSize=e.canvasSize??256,this._canvas=this._createGridCanvas()}Object.defineProperties(yT.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}}});yT.prototype._drawGrid=function(e){let n=this._canvasSize;for(let i=0;i<=this._cells;++i){let o=1+i/this._cells*(n-1);e.moveTo(o,0),e.lineTo(o,n),e.moveTo(0,o),e.lineTo(n,o)}e.stroke()};yT.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"),r=this._backgroundColor.toCssColorString();i.fillStyle=r,i.fillRect(t,t,n,n);let o=this._glowColor.toCssColorString();i.strokeStyle=o,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 a=this._color.toCssColorString();return i.strokeStyle=a,i.lineWidth=2,i.strokeRect(t,t,n,n),i.lineWidth=1,this._drawGrid(i),e};yT.prototype.getTileCredits=function(e,t,n){};yT.prototype.requestImage=function(e,t,n,i){return Promise.resolve(this._canvas)};yT.prototype.pickFeatures=function(e,t,n,i,r){};var UOe=yT;function hm(){}hm._maxDecodingConcurrency=Math.max(fn.hardwareConcurrency-1,1);hm._decodeTaskProcessor=new Yn("decodeI3S",hm._maxDecodingConcurrency);hm._promise=void 0;async function Pkt(){if(await hm._decodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}))return hm._decodeTaskProcessor;throw new oe("I3S decoder could not be initialized.")}hm.decode=async function(e,t,n,i,r){return l(hm._promise)||(hm._promise=Pkt()),hm._promise.then(function(o){let a=n._parent._data,s=n._parent._inverseRotationMatrix,c=0,u=0,f=0;l(a.obb)?(c=a.obb.center[0],u=a.obb.center[1],f=a.obb.center[2]):l(a.mbs)&&(c=a.mbs[0],u=a.mbs[1],f=a.mbs[2]);let d=$.fromRotationX(-I.PI_OVER_TWO),p=new $;$.multiply(d,s,p);let g=de.fromDegrees(c,u,f),m=te.WGS84.cartographicToCartesian(g),y={binaryData:n._data,featureData:l(i)&&l(i[0])?i[0].data:void 0,schema:t,bufferInfo:n._geometryBufferInfo,ellipsoidRadiiSquare:te.WGS84.radiiSquared,url:e,geoidDataList:n._dataProvider._geoidDataList,cartographicCenter:g,cartesianCenter:m,parentRotation:p,enableFeatures:n._dataProvider.showFeatures,splitGeometryByColorTransparency:n._dataProvider.adjustMaterialAlphaMode,symbologyData:r,calculateNormals:n._dataProvider.calculateNormals};return o.scheduleTask(y)})};var I5=hm;function sre(e,t){this._parent=e,this._dataProvider=e._dataProvider,this._layer=e._layer,l(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(sre.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}}});sre.prototype.load=async function(){return this._data=await e0.loadJson(this._resource),this._data};var P5=sre;function Gg(e,t){this._storageInfo=t,this._parent=e,this._dataProvider=e._dataProvider,this._loadPromise=void 0;let n=`attributes/${t.key}/0`;l(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(Gg.prototype,{resource:{get:function(){return this._resource}},header:{get:function(){return this._header}},values:{get:function(){if(l(this._values)){if(l(this._values.attributeValues))return this._values.attributeValues;if(l(this._values.objectIds))return this._values.objectIds}return[]}},name:{get:function(){return this._storageInfo.name}}});function D5(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 Dkt(e){return e==="String"?1:D5(e)}async function Rkt(e){let t=await e._dataProvider._loadBinary(e._resource),n=new DataView(t);e._data=t,e._validateHeader(n);let i=e._parseHeader(n),r=e._getBodyOffset(i);e._validateBody(n,r),e._parseBody(n,r)}Gg.prototype.load=function(){return l(this._loadPromise)?this._loadPromise:(this._loadPromise=Rkt(this).catch(function(e){console.error(e)}),this._loadPromise)};Gg.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 r=e.getUint32(n,!0),o=e.getUint32(n+4,!0);i=r+Math.pow(2,32)*o,n+=8}else if(t==="Int64"){let r=e.getUint32(n,!0),o=e.getUint32(n+4,!0);o<Math.pow(2,31)?i=r+Math.pow(2,32)*o:i=r+Math.pow(2,32)*(o-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}};Gg.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],r=this._parseValue(e,i.valueType,t);this._header[i.property]=r.value,t=r.offset}return t};Gg.prototype._parseBody=function(e,t){this._values={};for(let n=0;n<this._storageInfo.ordering.length;n++){let i=this._storageInfo.ordering[n],r=i==="ObjectIds"?"objectIds":i,o=this._storageInfo[r];if(l(o)){this._values[r]=[];for(let a=0;a<this._header.count;++a)if(o.valueType!=="String"){let s=this._parseValue(e,o.valueType,t);this._values[r].push(s.value),t=s.offset}else{let s=this._values.attributeByteCounts[a],c="";for(let u=0;u<s;++u){let f=this._parseValue(e,o.valueType,t);f.value.charCodeAt(0)!==0&&(c+=f.value),t=f.offset}this._values[r].push(c)}}}};Gg.prototype._getBodyOffset=function(e){let t=0;return l(this._storageInfo.attributeValues)?t=D5(this._storageInfo.attributeValues.valueType):l(this._storageInfo.objectIds)&&(t=D5(this._storageInfo.objectIds.valueType)),t>0?Math.ceil(e/t)*t:e};Gg.prototype._validateHeader=function(e){let t=0;for(let n=0;n<this._storageInfo.header.length;n++){let i=this._storageInfo.header[n];t+=Dkt(i.valueType)}if(e.byteLength<t)throw new oe(`Invalid attribute buffer size (field: ${this.name}, header: ${t}, actual: ${e.byteLength})`)};Gg.prototype._validateBody=function(e,t){if(!l(this._header.count))throw new oe(`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 r=this._storageInfo.ordering[i],o=r==="ObjectIds"?"objectIds":r,a=this._storageInfo[o];if(l(a))if(a.valueType!=="String"){o==="attributeByteCounts"&&(n=t);let s=D5(a.valueType);t+=s*this._header.count}else{if(!l(n))throw new oe(`Invalid attribute buffer (field: ${this.name}, attributeByteCounts is missing)`);for(let s=0;s<this._header.count&&t<e.byteLength;++s){let c=this._parseValue(e,this._storageInfo.attributeByteCounts.valueType,n);t+=c.value,n=c.offset}}else throw new oe(`Invalid attribute buffer (field: ${this.name}, ${o} is missing)`)}if(e.byteLength<t)throw new oe(`Invalid attribute buffer size (field: ${this.name}, expected: ${t}, actual: ${e.byteLength})`)};var R5=Gg;function PO(e,t){let n=e._dataProvider,i=e._layer,r;l(e._nodeIndex)?r=i.resource.getDerivedResource({url:`nodes/${e._data.mesh.geometry.resource}/${t}`}):r=e.resource.getDerivedResource({url:t}),this._parent=e,this._dataProvider=n,this._layer=i,this._resource=r,this._customAttributes=void 0}Object.defineProperties(PO.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},customAttributes:{get:function(){return this._customAttributes}}});PO.prototype.load=function(){let e=this;return this._dataProvider._loadBinary(this._resource).then(function(t){return e._data=t,t})};var Okt=new h,Mkt=new h,Lkt=new h,Nkt=new h,Fkt=new h;function cre(e,t,n,i){let r=h.subtract(i,n,Okt),o=h.cross(r,h.subtract(e,n,Mkt),Nkt),a=h.cross(r,h.subtract(t,n,Lkt),Fkt);return h.dot(o,a)>=0}var Bkt=new h,kkt=new h,zkt=new h,Ukt=new h,Vkt=new h,jkt=new h,Hkt=new h,Gkt=new h,Wkt=new h,qkt=new h;PO.prototype.getClosestPointIndexOnTriangle=function(e,t,n){if(l(this._customAttributes)&&l(this._customAttributes.positions)){let i=new h(e,t,n);i.x-=this._customAttributes.cartesianCenter.x,i.y-=this._customAttributes.cartesianCenter.y,i.z-=this._customAttributes.cartesianCenter.z,$.multiplyByVector(this._customAttributes.parentRotation,i,i);let r=Number.MAX_VALUE,o,a,s,c,u=this._customAttributes.positions,f=this._customAttributes.indices,d;l(f)?d=f.length:d=u.length/3;for(let p=0;p<d;p++){let g,m,y;l(f)?(g=f[p],m=f[p+1],y=f[p+2]):(g=p*3,m=p*3+1,y=p*3+2);let A=h.fromElements(u[g*3],u[g*3+1],u[g*3+2],Bkt),b=h.fromElements(u[m*3],u[m*3+1],u[m*3+2],kkt),x=new h(u[y*3],u[y*3+1],u[y*3+2],zkt);if(!cre(i,A,b,x)||!cre(i,b,A,x)||!cre(i,x,A,b))continue;let T=h.subtract(b,A,Ukt),C=h.subtract(x,A,Vkt),E=h.cross(T,C,jkt);if(h.magnitude(E)===0)continue;let w=h.normalize(E,Hkt),D=h.subtract(i,A,Gkt),R=Math.abs(h.dot(D,w));if(R<r){r=R,o=p;let M=h.magnitudeSquared(h.subtract(i,A,D)),N=h.magnitudeSquared(h.subtract(i,b,Wkt)),_=h.magnitudeSquared(h.subtract(i,x,qkt));M<N&&M<_?(s=g,c=A,a=M):N<_?(s=m,c=b,a=N):(s=y,c=x,a=_)}}if(l(o))return{index:s,distanceSquared:a,distance:Math.sqrt(a),queriedPosition:i,closestPosition:h.clone(c)}}return{index:-1,distanceSquared:Number.Infinity,distance:Number.Infinity}};function VOe(e){let t=[],n=e.length;for(let i=0;i<n;i++)i<3?t.push(Av(e[i])):t.push(e[i]);return t}PO.prototype._generateGltf=function(e,t,n,i,r,o,a,s){let c={pbrMetallicRoughness:{metallicFactor:0},doubleSided:!0,name:"Material"},u=!1,f,d="";if(l(this._parent._data.mesh)&&l(this._layer._data.materialDefinitions)){let T=this._parent._data.mesh.material.definition;if(T>=0&&T<this._layer._data.materialDefinitions.length){if(f=this._layer._data.materialDefinitions[T],c=f,l(c.pbrMetallicRoughness)&&l(c.pbrMetallicRoughness.baseColorTexture)){u=!0,c.pbrMetallicRoughness.baseColorTexture.index=0;let C="0";if(l(this._layer._data.textureSetDefinitions))for(let E=0;E<this._layer._data.textureSetDefinitions.length;E++){let w=this._layer._data.textureSetDefinitions[E];for(let D=0;D<w.formats.length;D++){let R=w.formats[D];if(R.format==="jpg"){C=R.name;break}}}l(this._parent._data.mesh)&&this._parent._data.mesh.material.resource>=0&&(d=this._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.material.resource}/textures/${C}`}).url)}l(c.pbrMetallicRoughness)&&l(c.pbrMetallicRoughness.baseColorFactor)&&(c.pbrMetallicRoughness.baseColorFactor=VOe(c.pbrMetallicRoughness.baseColorFactor)),l(c.emissiveFactor)&&(c.emissiveFactor=VOe(c.emissiveFactor))}}else l(this._parent._data.textureData)&&(u=!0,d=this._parent.resource.getDerivedResource({url:`${this._parent._data.textureData[0].href}`}).url,c.pbrMetallicRoughness.baseColorTexture={index:0});l(c.alphaMode)&&(c.alphaMode=c.alphaMode.toUpperCase());let p=[],g=[],m=[];u&&(p=[{sampler:0,source:0}],g=[{uri:d}],m=[{magFilter:9729,minFilter:9986,wrapS:10497,wrapT:10497}]);let y=[],A=n.length;for(let x=0;x<A;x++){let T=n[x].primitives,C=T.length;for(let E=0;E<C;E++){let w=T[E];if(l(w.material)){for(;w.material>=y.length;){let R=Xe(c,!0);y.push(R)}let D=y[w.material];l(w.extra)&&w.extra.isTransparent?l(D.alphaMode)||(D.alphaMode="BLEND"):D.alphaMode==="BLEND"&&(D.alphaMode="OPAQUE")}}}return{scene:0,scenes:[{nodes:e}],nodes:t,meshes:n,buffers:i,bufferViews:r,accessors:o,materials:y,textures:p,images:g,samplers:m,asset:{version:"2.0"},extensions:a,extensionsUsed:s}};var DO=PO;function al(e,t,n){let i,r,o,a;n?(i=0,r=e):(i=e._level+1,r=e._layer),typeof t=="number"?o=t:a=e.resource.getDerivedResource({url:`${t}/`}),this._parent=e,this._dataProvider=e._dataProvider,this._isRoot=n,this._level=i,this._layer=r,this._nodeIndex=o,this._resource=a,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(al.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}}});al.prototype.load=async function(){let e=this;function t(){if(!e._isRoot){let r=e._create3DTileDefinition();e._tile=new Yh(e._layer._tileset,e._dataProvider.resource,r,e._parent._tile),e._tile._i3sNode=e}}if(!l(this._nodeIndex)){let r=await e0.loadJson(this._resource);e._data=r,t();return}let n=await this._layer._getNodeInNodePages(this._nodeIndex);e._data=n;let i;e._isRoot?i="nodes/root/":l(n.mesh)&&(i=`../${n.mesh.geometry.resource}/`),l(i)&&l(e._parent.resource)&&(e._resource=e._parent.resource.getDerivedResource({url:i})),t()};function jOe(e,t){let n=new R5(e,t);return e._fields[t.name]=n,n.load()}al.prototype.loadFields=function(){let e=this._layer._data.attributeStorageInfo,t=[];if(l(e))for(let n=0;n<e.length;n++){let i=e[n],r=this._fields[i.name];l(r)?t.push(r.load()):t.push(jOe(this,i))}return Promise.all(t)};al.prototype.loadField=function(e){let t=this._fields[e];if(l(t))return t.load();let n=this._layer._data.attributeStorageInfo;if(l(n))for(let i=0;i<n.length;i++){let r=n[i];if(r.name===e)return jOe(this,r)}return Promise.resolve()};al.prototype.getFieldsForPickedPosition=function(e){let t=this.geometryData[0];if(!l(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)};al.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};al.prototype._loadChildren=function(){let e=this;if(l(this._childrenReadyPromise))return this._childrenReadyPromise;let t=[];if(l(e._data.children))for(let n=0;n<e._data.children.length;n++){let i=e._data.children[n],r=new al(e,i.href??i,!1);e._children.push(r),t.push(r.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};al.prototype._loadGeometryData=function(){let e=[];if(l(this._data.geometryData))for(let t=0;t<this._data.geometryData.length;t++){let n=new DO(this,this._data.geometryData[t].href);this._geometryData.push(n),e.push(n.load())}else if(l(this._data.mesh)){let t=this._layer._findBestGeometryBuffers(this._data.mesh.geometry.definition,["position","uv0"]),n=`./geometries/${t.bufferIndex}/`,i=new DO(this,n);i._geometryDefinitions=t.definition,i._geometryBufferInfo=t.geometryBufferInfo,this._geometryData.push(i),e.push(i.load())}return Promise.all(e)};al.prototype._loadFeatureData=function(){let e=[];if(l(this._data.featureData))for(let t=0;t<this._data.featureData.length;t++){let n=new P5(this,this._data.featureData[t].href);this._featureData.push(n),e.push(n.load())}return Promise.all(e)};al.prototype._clearGeometryData=function(){this._geometryData=[]};al.prototype._create3DTileDefinition=function(){let e=this._data.obb,t=this._data.mbs;if(!l(e)&&!l(t)){console.error("Failed to load I3S node. Bounding volume is required.");return}let n;if(l(e)?n=de.fromDegrees(e.center[0],e.center[1],e.center[2]):n=de.fromDegrees(t[0],t[1],t[2]),l(this._dataProvider._geoidDataList)&&l(n))for(let b=0;b<this._dataProvider._geoidDataList.length;b++){let x=this._dataProvider._geoidDataList[b],T=x.projection.project(n);if(T.x>x.nativeExtent.west&&T.x<x.nativeExtent.east&&T.y>x.nativeExtent.south&&T.y<x.nativeExtent.north){n.height+=$kt(T.x,T.y,x);break}}let i,r,o;l(e)?(i={box:[0,0,0,e.halfSize[0],0,0,0,e.halfSize[1],0,0,0,e.halfSize[2]]},o=Math.max(Math.max(this._data.obb.halfSize[0],this._data.obb.halfSize[1]),this._data.obb.halfSize[2]),r=te.WGS84.cartographicToCartesian(n)):(i={sphere:[0,0,0,t[3]]},r=te.WGS84.cartographicToCartesian(n),o=this._data.mbs[3]),o*=2;let a=1/0;if(l(this._data.lodThreshold))if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThresholdSQ"){let b=Math.sqrt(this._data.lodThreshold/(Math.PI*.25));a=o/b}else if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThreshold"){let b=this._data.lodThreshold;a=o/b}else console.error("Invalid lodSelectionMetricType in Layer");else if(l(this._data.lodSelection))for(let b=0;b<this._data.lodSelection.length;b++)this._data.lodSelection[b].metricType==="maxScreenThreshold"&&(a=o/this._data.lodSelection[b].maxError);a===1/0&&(a=1e5);let s=a*16,c=new Oc(0,0,0),u=mt.headingPitchRollQuaternion(r,c);l(this._data.obb)&&(u=new Fe(this._data.obb.quaternion[0],this._data.obb.quaternion[1],this._data.obb.quaternion[2],this._data.obb.quaternion[3]));let f=$.fromQuaternion(u),d=$.inverse(f,new $),p=new O(f[0],f[1],f[2],0,f[3],f[4],f[5],0,f[6],f[7],f[8],0,r.x,r.y,r.z,1),g=O.inverse(p,new O),m=O.clone(p);l(this._parent._globalTransform)&&O.multiply(p,this._parent._inverseGlobalTransform,m),this._globalTransform=p,this._inverseGlobalTransform=g,this._inverseRotationMatrix=d;let y=[];for(let b=0;b<this._children.length;b++)y.push(this._children[b]._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:l(this._resource)?this._resource.url:void 0},geometricError:s}};al.prototype._loadSymbology=async function(){!l(this._symbologyData)&&l(this._layer._symbology)&&(this._symbologyData=await this._layer._symbology._getSymbology(this))};al.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),l(this._geometryData)&&this._geometryData.length>0){this._dataProvider._applySymbology&&await this._loadSymbology();let r=this._geometryData[0].resource.url,o=this._layer._data.store.defaultGeometrySchema,a=this._geometryData[0],s=await I5.decode(r,o,a,this._featureData[0],this._symbologyData);if(!l(s))return;e=a._generateGltf(s.meshData.nodesInScene,s.meshData.nodes,s.meshData.meshes,s.meshData.buffers,s.meshData.bufferViews,s.meshData.accessors,s.meshData.rootExtensions,s.meshData.extensionsUsed),this._geometryData[0]._customAttributes=s.meshData._customAttributes}let n=this._dataProvider._binarizeGltf(e),i=new Blob([n],{type:"application/binary"});return URL.createObjectURL(i)};async function Ykt(e){let t=e._layer._filters,n=[];for(let i=0;i<t.length;i++){let r=e.loadField(t[i].name);n.push(r)}return await Promise.all(n),t}function Xkt(e,t,n){if(!l(n.values)||n.values.length===0)return!1;let i=l(t)?t.values:[],r;e<i.length&&(r=i[e]);let o=!1;for(let a=0;a<n.values.length;a++)if(n.values[a]===r){o=!0;break}return o}async function HOe(e,t){let n=e._tile.content.batchTable;if(l(n)&&n.featuresLength>0){n.setAllShow(!0);let i=await Ykt(e);if(i.length>0)for(let r=0;r<n.featuresLength;r++)for(let o=0;o<i.length;o++){let a=i[o];if(!Xkt(r,e._fields[a.name],a)){n.setShow(r,!1);break}}}t.show=!0}al.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(l(this._geometryData)&&this._geometryData.length>0&&l(t)&&t.ready){t.show=!1;let n=HOe(this,t);e.push(n)}return Promise.all(e)};Yh.prototype._hookedRequestContent=Yh.prototype.requestContent;Yh.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(!l(t)){e._isLoading=!1;return}return e._contentResource=new De({url:t}),e._hookedRequestContent()}).then(t=>{let n=t?._model;return l(e._i3sNode._geometryData)&&e._i3sNode._geometryData.length>0&&l(n)&&(n.show=!1,n.readyEvent.addEventListener(()=>{HOe(e._i3sNode,n)})),e._isLoading=!1,t})}};function Kkt(e,t,n,i,r,o){let a=n*(1-e)+i*e,s=r*(1-e)+o*e;return a*(1-t)+s*t}function O5(e,t,n,i){let r=e+t*n;return i[r]}function $kt(e,t,n){let i=n.nativeExtent,r=(e-i.west)/(i.east-i.west)*(n.width-1),o=(t-i.south)/(i.north-i.south)*(n.height-1),a=Math.floor(r),s=Math.floor(o);r-=a,o-=s;let c=a<n.width?a+1:a,u=s<n.height?s+1:s;s=n.height-1-s,u=n.height-1-u;let f=O5(a,s,n.width,n.buffer),d=O5(c,s,n.width,n.buffer),p=O5(a,u,n.width,n.buffer),g=O5(c,u,n.width,n.buffer),m=Kkt(r,o,f,d,p,g);return m=m*n.scale+n.offset,m}Object.defineProperties(Yh.prototype,{i3sNode:{get:function(){return this._i3sNode}}});var RO=al;function M5(e){this._layer=e,this._defaultSymbology=void 0,this._valueFields=[],this._uniqueValueHash=void 0,this._classBreaksHash=void 0,this._parseLayerSymbology()}Object.defineProperties(M5.prototype,{defaultSymbology:{get:function(){return this._defaultSymbology}}});function lre(e,t){let n=[];for(let i=0;i<e.length;i++){let r=U.byteToFloat(e[i]);i<3?n.push(Av(r)):n.push(r)}return n.length===3&&(l(t)?n.push(1-t/100):n.push(1)),n}function Cw(e,t){let n={edges:void 0,material:void 0};if(l(e)&&l(e.symbolLayers))for(let i=0;i<e.symbolLayers.length;i++){let r=e.symbolLayers[i];if(r.type==="Fill"){let o=r.edges,a=r.outline;if(l(o)?(n.edges={},l(o.color)&&(n.edges.color=lre(o.color,o.transparency))):l(a)&&(n.edges={},l(a.color)&&(n.edges.color=lre(a.color,a.transparency))),!t){let s=r.material;l(s)&&(n.material={colorMixMode:s.colorMixMode},l(s.color)&&(n.material.color=lre(s.color,s.transparency)))}break}}return n}function Jkt(e,t){if(l(e.uniqueValueGroups)){let n={};for(let i=0;i<e.uniqueValueGroups.length;i++){let r=e.uniqueValueGroups[i].classes;if(l(r))for(let o=0;o<r.length;o++){let a=Cw(r[o].symbol,t),s=r[o].values;for(let c=0;c<s.length;c++){let u=s[c],f=n;for(let d=0;d<u.length;d++){let p=u[d];d===u.length-1?f[p]=a:(l(f[p])||(f[p]={}),f=f[p])}}}}return n}if(l(e.uniqueValueInfos)){let n={};for(let i=0;i<e.uniqueValueInfos.length;i++){let r=e.uniqueValueInfos[i];n[r.value]=Cw(r.symbol,t)}return n}}function Zkt(e,t){if(l(e.classBreakInfos)){let n=[...e.classBreakInfos];n.sort(function(r,o){let a=r.classMaxValue??r.classMinValue,s=o.classMaxValue??o.classMinValue;return a-s});let i={ranges:[],symbols:[]};l(e.minValue)&&(i.ranges.push(e.minValue),i.symbols.push(void 0));for(let r=0;r<n.length;r++){let o=n[r];l(o.classMinValue)&&(i.ranges.length===0||o.classMinValue>i.ranges[i.ranges.length-1])&&(i.ranges.push(o.classMinValue),i.symbols.push(void 0)),l(o.classMaxValue)&&(i.ranges.length===0||o.classMaxValue>i.ranges[i.ranges.length-1])&&(i.ranges.push(o.classMaxValue),i.symbols.push(Cw(o.symbol,t)))}return i.symbols.push(void 0),i}}M5.prototype._parseLayerSymbology=function(){let e=this._layer.data.drawingInfo;if(l(e)&&l(e.renderer)){let t=this._layer.data.cachedDrawingInfo,n=l(t)&&t.color===!0,i=e.renderer;i.type==="simple"?this._defaultSymbology=Cw(i.symbol,n):i.type==="uniqueValue"?(this._defaultSymbology=Cw(i.defaultSymbol,n),this._valueFields.push(i.field1),l(i.field2)&&this._valueFields.push(i.field2),l(i.field3)&&this._valueFields.push(i.field3),this._uniqueValueHash=Jkt(i,n)):i.type==="classBreaks"&&(this._defaultSymbology=Cw(i.defaultSymbol,n),this._valueFields.push(i.field),this._classBreaksHash=Zkt(i,n))}};function GOe(e,t,n,i){let r=t[n];if(i<r.length){let o=r[i],a=e[o];return l(a)&&++n<t.length?GOe(a,t,n,i):a}}function Qkt(e,t){let n=0,i=e.length;if(n<i)do{let r=n+i>>>1;e[r]<t?n=r+1:i=r}while(n<i);return n}function e3t(e,t,n){let i=t[n],r=Qkt(e.ranges,i);return e.symbols[r]}M5.prototype._getSymbology=async function(e){let t={default:this._defaultSymbology};if(this._valueFields.length>0){let n=[];for(let o=0;o<this._valueFields.length;o++)n.push(e.loadField(this._valueFields[o]));await Promise.all(n);let i=[];for(let o=0;o<this._valueFields.length;o++)i.push(e.fields[this._valueFields[o]].values);let r;if(l(this._uniqueValueHash)?r=o=>GOe(this._uniqueValueHash,i,0,o):l(this._classBreaksHash)&&(r=o=>e3t(this._classBreaksHash,i[0],o)),l(r)){let o=i[0];for(let a=0;a<o.length;a++){let s=r(a);l(s)&&(t[a]=s)}}}return t};var L5=M5;function Bu(e,t,n){this._dataProvider=e,this._parent=n,!l(t.href)&&l(t.id)&&(t.href=`layers/${t.id}`);let i=this._parent.resource.getUrlComponent(),r;i.match(/layers\/\d/)?r=`${i}`.replace(/\/+$/,""):r=`${i}`.replace(/\/?$/,"/").concat(`${t.href}`),this._version=t.store.version;let o=this._version.split(".");this._majorVersion=parseInt(o[0]),this._minorVersion=o.length>1?parseInt(o[1]):0,this._resource=new De({url:r}),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(Bu.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(l(this.version))return this.majorVersion<1||this.majorVersion===1&&this.minorVersion<=6}}});Bu.prototype.load=async function(e){if(this._data.spatialReference.wkid!==4326)throw new oe(`Unsupported spatial reference: ${this._data.spatialReference.wkid}`);if(this._dataProvider.applySymbology&&(this._symbology=new L5(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()};Bu.prototype._computeGeometryDefinitions=function(e){if(this._geometryDefinitions=[],l(this._data.geometryDefinitions))for(let t=0;t<this._data.geometryDefinitions.length;t++){let n=[],i=this._data.geometryDefinitions[t].geometryBuffers;for(let r=0;r<i.length;r++){let o=i[r],a=[],s=!1;if(l(o.compressedAttributes)&&e){s=!0;let c=o.compressedAttributes.attributes;for(let u=0;u<c.length;u++)a.push(c[u])}else for(let c in o)c!=="offset"&&a.push(c);n.push({compressed:s,attributes:a,index:i.indexOf(o)})}n.sort(function(r,o){return r.compressed&&!o.compressed?-1:!r.compressed&&o.compressed?1:r.attributes.length-o.attributes.length}),this._geometryDefinitions.push(n)}};Bu.prototype._findBestGeometryBuffers=function(e,t){let n=this._geometryDefinitions[e];if(l(n)){for(let i=0;i<n.length;++i){let r=n[i],o=!1,a=r.attributes;for(let s=0;s<t.length;s++)if(!a.includes(t[s])){o=!0;break}if(!o)return{bufferIndex:r.index,definition:n,geometryBufferInfo:r}}if(l(n[0]))return{bufferIndex:0,definition:n,geometryBufferInfo:n[0]}}};Bu.prototype._loadRootNode=function(e){if(l(this._data.nodePages)){let t=0;l(this._data.nodePages.rootIndex)&&(t=this._data.nodePages.rootIndex),this._rootNode=new RO(this,t,!0)}else this._rootNode=new RO(this,this._data.store.rootNode,!0);return this._rootNode.load(e)};Bu.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]})};Bu._fetchJson=function(e){return e.fetchJson()};Bu.prototype._loadNodePage=function(e){let t=this;if(!l(this._nodePageFetches[e])){let n=this.resource.getDerivedResource({url:`nodepages/${e}/`}),i=Bu._fetchJson(n).then(function(r){return l(r.error)&&r.error.code!==200?Promise.reject(r.error):(t._nodePages[e]=r.nodes,r)});this._nodePageFetches[e]=i}return this._nodePageFetches[e]};Bu.prototype._computeExtent=function(){l(this._data.fullExtent)?this._extent=ie.fromDegrees(this._data.fullExtent.xmin,this._data.fullExtent.ymin,this._data.fullExtent.xmax,this._data.fullExtent.ymax):l(this._data.store.extent)&&(this._extent=ie.fromDegrees(this._data.store.extent[0],this._data.store.extent[1],this._data.store.extent[2],this._data.store.extent[3]))};Bu.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),r=this._symbology?.defaultSymbology?.edges?.color;l(r)&&!l(e?.outlineColor)&&(e=l(e)?Xe(e):{},e.outlineColor=U.fromCartesian4(ae.fromArray(r))),this._tileset=await Yo.fromUrl(i,e),this._tileset.show=this._parent.show,this._tileset._isI3STileSet=!0,this._tileset.tileUnload.addEventListener(function(o){o._i3sNode._clearGeometryData(),URL.revokeObjectURL(o._contentResource._url),o._contentResource=o._i3sNode.resource}),this._tileset.tileVisible.addEventListener(function(o){l(o._i3sNode)&&o._i3sNode._loadChildren()})};Bu.prototype._updateVisibility=function(){l(this._tileset)&&(this._tileset.show=this._parent.show)};Bu.prototype.filterByAttributes=function(e){this._filters=l(e)?Xe(e,!0):[];let t=this._rootNode;return l(t)?t._filterFeatures():Promise.resolve()};var vw=Bu;function N5(e,t){this._dataProvider=e,this._resource=new De({url:t}),this._resource.setQueryParameters(e.resource.queryParameters),this._resource.appendForwardSlash()}Object.defineProperties(N5.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},names:{get:function(){let e=[],t=this._data.summary;if(l(t))for(let n=0;n<t.length;++n)e.push(t[n].fieldName);return e}}});N5.prototype.load=async function(){return this._data=await e0.loadJson(this._resource),this._data};N5.prototype._getValues=function(e){let t=this._data.summary;if(l(t))for(let n=0;n<t.length;++n){let i=t[n];if(i.fieldName===e)return l(i.mostFrequentValues)?[...i.mostFrequentValues]:[]}};var F5=N5;function OO(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(OO.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(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}}});OO._fromData=async function(e,t,n,i){let r=new OO(e,i,n);if(r._data.layerType==="group"){let o=r._data.sublayers;if(l(o)){let a=[];for(let c=0;c<o.length;c++){let u=OO._fromData(e,t,o[c],r);a.push(u)}let s=await Promise.all(a);for(let c=0;c<s.length;c++){let u=s[c];r._sublayers.push(u),r._i3sLayers.push(...u._i3sLayers)}}}else if(r._data.layerType==="3DObject"){let o=t.concat(`/sublayers/${r._data.id}`),a=new De({url:o});a.setQueryParameters(e.resource.queryParameters),a.appendForwardSlash(),r._resource=a;let s=await e0.loadJson(r._resource),c=new vw(e,s,r);r._i3sLayers.push(c)}else console.log(`${r._data.layerType} layer ${r._data.name} is skipped as not supported.`);return r};var B5=OO;var YOe=La(WOe(),1);function Ya(e){e=e??H.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??H.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(Ya.prototype,{name:{get:function(){return this._name}},show:{get:function(){return this._show},set:function(e){if(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}}});Ya.prototype.destroy=function(){for(let e=0;e<this._layers.length;e++)l(this._layers[e]._tileset)&&this._layers[e]._tileset.destroy();return ue(this)};Ya.prototype.isDestroyed=function(){return!1};Ya.prototype.update=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.update(e)};Ya.prototype.prePassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.prePassesUpdate(e)};Ya.prototype.postPassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.postPassesUpdate(e)};Ya.prototype.updateForPass=function(e,t){for(let n=0;n<this._layers.length;n++)l(this._layers[n]._tileset)&&this._layers[n]._tileset.updateForPass(e,t)};function t3t(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 qOe(e,t,n){if(t.layerType==="Building"){l(n.showFeatures)||(e._showFeatures=!0),l(n.adjustMaterialAlphaMode)||(e._adjustMaterialAlphaMode=!0),l(n.applySymbology)||(e._applySymbology=!0),l(n.calculateNormals)||(e._calculateNormals=!0);let i=t3t(e,t.id);if(l(t.sublayers)){let r=[];for(let a=0;a<t.sublayers.length;a++){let s=B5._fromData(e,i,t.sublayers[a],e);r.push(s)}let o=await Promise.all(r);for(let a=0;a<o.length;a++){let s=o[a];e._sublayers.push(s),e._layers.push(...s._i3sLayers)}}if(l(t.statisticsHRef)){let r=i.concat(`/${t.statisticsHRef}`),o=new F5(e,r);await o.load(),e._attributeStatistics.push(o)}if(l(t.fullExtent)){let r=ie.fromDegrees(t.fullExtent.xmin,t.fullExtent.ymin,t.fullExtent.xmax,t.fullExtent.ymax);e._layersExtent.push(r)}}else if(t.layerType==="3DObject"||t.layerType==="IntegratedMesh"){!l(n.calculateNormals)&&!l(t.textureSetDefinitions)&&(e._calculateNormals=!0);let i=new vw(e,t,e);e._layers.push(i),l(i._extent)&&e._layersExtent.push(i._extent)}else console.log(`${t.layerType} layer ${t.name} is skipped as not supported.`)}Ya.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT;let n=De.createIfNeeded(e);n.setQueryParameters({f:"pjson"},!0);let i=await Ya.loadJson(n),r=new Ya(t);if(r._resource=n,r._data=i,l(i.layers)){let a=[];for(let s=0;s<i.layers.length;s++){let c=qOe(r,i.layers[s],t);a.push(c)}await Promise.all(a)}else await qOe(r,i,t);r._computeExtent();let o=[];for(let a=0;a<r._layers.length;a++)o.push(r._layers[a].load(t.cesium3dTilesetOptions));return await Promise.all(o),r};Ya._fetchJson=function(e){return e.fetchJson()};Ya.loadJson=async function(e){let t=await Ya._fetchJson(e);if(l(t.error)){if(console.error("Failed to fetch I3S ",e.url),l(t.error.message)&&console.error(t.error.message),l(t.error.details))for(let n=0;n<t.error.details.length;n++)console.log(t.error.details[n]);throw new oe(t.error)}return t};Ya.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 oe(`Failed to load binary: ${e.url}`);return t};Ya.prototype._binarizeGltf=function(e){let n=new TextEncoder().encode(JSON.stringify(e)),i=new Uint8Array(n.byteLength+20),r={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 r.magic[0]=103,r.magic[1]=108,r.magic[2]=84,r.magic[3]=70,r.version[0]=2,r.length[0]=i.byteLength,r.chunkLength[0]=n.byteLength,r.chunkType[0]=1313821514,r.chunkData.set(n),i};var n3t=new k;function i3t(e,t){let n=e.tilingScheme,i=[],r={},o=e._lodCount,a=de.fromRadians(t.west,t.north),s=de.fromRadians(t.east,t.south),c=n.positionToTileXY(a,o),u=n.positionToTileXY(s,o);for(let d=c.x;d<=u.x;d++)for(let p=c.y;p<=u.y;p++){let g=k.fromElements(d,p,n3t),m=g.toString();if(!r.hasOwnProperty(m)){let y={x:g.x,y:g.y,level:o,tilingScheme:n,terrainProvider:e,positions:[]};r[m]=y,i.push(y)}}let f=[];for(let d=0;d<i.length;++d){let p=i[d],g=p.terrainProvider.requestTileGeometry(p.x,p.y,p.level);f.push(g)}return Promise.all(f).then(function(d){let p=[];for(let g=0;g<d.length;g++){let m={tilingScheme:n,x:i[g].x,y:i[g].y,level:i[g].level},y=d[g],A="Geographic";n._projection instanceof _i&&(A="WebMercator");let b={projectionType:A,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===eh.LERC){let x=YOe.default.decode(y._buffer);b.buffer=x.pixels[0]}else b.buffer=y._buffer;p.push(b)}return p})}async function r3t(e){let t=e._geoidTiledTerrainProvider;if(l(t))try{let n=await i3t(t,e._extent);e._geoidDataList=n}catch{console.log("Error retrieving Geoid Terrain tiles - no geoid conversion will be performed.")}}Ya.prototype.loadGeoidData=async function(){return l(this._geoidDataPromise)?this._geoidDataPromise:(this._geoidDataPromise=r3t(this),this._geoidDataPromise)};Ya.prototype._computeExtent=function(){let e;for(let t=0;t<this._layersExtent.length;t++){let n=this._layersExtent[t];l(e)?ie.union(e,n,e):e=ie.clone(n)}this._extent=e};Ya.prototype.getAttributeNames=function(){let e=[];for(let t=0;t<this._attributeStatistics.length;++t)e.push(...this._attributeStatistics[t].names);return e};Ya.prototype.getAttributeValues=function(e){for(let t=0;t<this._attributeStatistics.length;++t){let n=this._attributeStatistics[t]._getValues(e);if(l(n))return n}return[]};Ya.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 e0=Ya;var MO={};MO.createTilesetFromIModelId=async function({iModelId:e,changesetId:t,tilesetOptions:n}){let{exports:i}=await rs.getExports(e,t);if(i.length>0&&i.every(c=>c.status===rs.ExportStatus.Invalid))throw new oe(`All exports for this iModel are Invalid: ${e}`);let r=i.find(c=>c.status===rs.ExportStatus.Complete);if(!l(r))return;let o=new URL(r._links.mesh.href);o.pathname=`${o.pathname}/tileset.json`;let a=o.toString(),s=new De({url:a});return Yo.fromUrl(s,n)};MO.createTilesetForRealityDataId=async function({iTwinId:e,realityDataId:t,type:n,rootDocument:i,tilesetOptions:r}){if(!l(n)||!l(i)){let c=await rs.getRealityDataMetadata(e,t);i=c.rootDocument,n=c.type}if(![rs.RealityDataType.Cesium3DTiles,rs.RealityDataType.PNTS,rs.RealityDataType.RealityMesh3DTiles,rs.RealityDataType.Terrain3DTiles,rs.RealityDataType.GaussianSplat3DTiles].includes(n))throw new oe(`Reality data type is not a mesh type: ${n}`);let a=await rs.getRealityDataURL(e,t,i),s={maximumScreenSpaceError:4,...r};return Yo.fromUrl(a,s)};MO.createDataSourceForRealityDataId=async function({iTwinId:e,realityDataId:t,type:n,rootDocument:i}){if(!l(n)||!l(i)){let a=await rs.getRealityDataMetadata(e,t);i=a.rootDocument,n=a.type}if(![rs.RealityDataType.KML,rs.RealityDataType.GeoJSON].includes(n))throw new oe(`Reality data type is not a data source type: ${n}`);let o=await rs.getRealityDataURL(e,t,i);return n===rs.RealityDataType.GeoJSON?nT.load(o):Tw.load(o)};MO.loadGeospatialFeatures=async function({iTwinId:e,collectionId:t,limit:n}){let i=n??1e4,r=`${rs.apiEndpoint}geospatial-features/itwins/${e}/ogc/collections/${t}/items`,o=new De({url:r,headers:{Authorization:rs._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{limit:i,client:"CesiumJS"}});return nT.load(o)};var XOe=MO;function KOe(){}Object.defineProperties(KOe.prototype,{color:{get:pe.throwInstantiationError},intensity:{get:pe.throwInstantiationError}});var $Oe=KOe;var o3t=0,a3t=14,s3t=-1e3,c3t=1e4,l3t=2*Math.PI*te.WGS84.maximumRadius,u3t=256,f3t=new ie,d3t=new ie,ure=class{constructor(t,n){n=n??{},this._resource=De.createIfNeeded(t),this._urlTemplate=this._resource.url,this._extent=ie.clone(n.extent),this._minZoom=n.minZoom??o3t,this._maxZoom=n.maxZoom??a3t,this._featureIdProperty=n.featureIdProperty,this._show=!0,this._tileset=void 0,this._tilesetJsonUrl=void 0}static async fromUrl(t,n){let i=new this(t,n);return await i._initializeTileset(),i}get urlTemplate(){return this._urlTemplate}get resource(){return this._resource}get extent(){return this._extent}get tileset(){return this._tileset}get show(){return this._show}set show(t){this._show=t,l(this._tileset)&&(this._tileset.show=t)}_createRuntimeTilesetOptions(){return{minZoom:this._minZoom,maxZoom:this._maxZoom,extent:this._extent}}_createTilesetLoadOptions(){return{}}_configureTileset(t){}_createCodec(){}async _initializeTileset(){let t=h3t(this._resource,this._createRuntimeTilesetOptions()),n=new Blob([JSON.stringify(t)],{type:"application/json"}),i=URL.createObjectURL(n);this._tilesetJsonUrl=i;try{this._tileset=await Yo.fromUrl(i,this._createTilesetLoadOptions())}catch(r){throw URL.revokeObjectURL(i),this._tilesetJsonUrl=void 0,r}URL.revokeObjectURL(i),this._tilesetJsonUrl=void 0,this._configureTileset(this._tileset),this._tileset._runtimeContentCodec=this._createCodec(),this._tileset.show=this._show}update(t){l(this._tileset)&&this._tileset.update(t)}prePassesUpdate(t){l(this._tileset)&&this._tileset.prePassesUpdate(t)}postPassesUpdate(t){l(this._tileset)&&this._tileset.postPassesUpdate(t)}updateForPass(t,n){l(this._tileset)&&this._tileset.updateForPass(t,n)}isDestroyed(){return!1}destroy(){return l(this._tileset)&&(this._tileset.destroy(),this._tileset=void 0),l(this._tilesetJsonUrl)&&(URL.revokeObjectURL(this._tilesetJsonUrl),this._tilesetJsonUrl=void 0),this._resource=void 0,this._extent=void 0,this._featureIdProperty=void 0,ue(this)}};function h3t(e,t){let n=new So,i=l(t.extent)?ie.clone(t.extent):ie.clone(n.rectangle),r=p3t(n,i,t.minZoom),o={boundingVolume:{region:QOe(i)},geometricError:ZOe(0),refine:"REPLACE",children:[]};for(let a=r.minY;a<=r.maxY;a++)for(let s=r.minX;s<=r.maxX;s++){let c=JOe(n,e,i,t.minZoom,t.maxZoom,s,a);l(c)&&o.children.push(c)}return o.children.length===0&&(o.geometricError=0),{asset:{version:"1.1"},geometricError:o.geometricError,root:o}}function JOe(e,t,n,i,r,o,a){if(!g3t(e,i,o,a,n,f3t,d3t))return;let s=e.tileXYToRectangle(o,a,i,new ie),c={boundingVolume:{region:QOe(s)},geometricError:i<r?ZOe(i):0,refine:"REPLACE",content:{uri:m3t(t,i,o,a)}};if(i>=r)return c;let u=i+1,f=[];for(let d=a*2;d<=a*2+1;d++)for(let p=o*2;p<=o*2+1;p++){let g=JOe(e,t,n,u,r,p,d);l(g)&&f.push(g)}return f.length>0?c.children=f:c.geometricError=0,c}function m3t(e,t,n,i){let o=e.url.replace(/\{z\}/gi,`${t}`).replace(/\{x\}/gi,`${n}`).replace(/\{y\}/gi,`${i}`);return Jd(o)}function ZOe(e){return l3t/((1<<e)*u3t)}function QOe(e){return[e.west,e.south,e.east,e.north,s3t,c3t]}function p3t(e,t,n){let i=(1<<n)-1,r=de.fromRadians(t.west,t.north),o=de.fromRadians(t.east,t.south),a=e.positionToTileXY(r,n),s=e.positionToTileXY(o,n);return!l(a)||!l(s)||t.west>t.east?{minX:0,maxX:i,minY:0,maxY:i}:{minX:I.clamp(Math.min(a.x,s.x),0,i),maxX:I.clamp(Math.max(a.x,s.x),0,i),minY:I.clamp(Math.min(a.y,s.y),0,i),maxY:I.clamp(Math.max(a.y,s.y),0,i)}}function g3t(e,t,n,i,r,o,a){let s=e.tileXYToRectangle(n,i,t,o);return l(ie.intersection(s,r,a))}var z5=ure;var fre=0,eMe=new h,U5=new h,_3t=new So;function y3t(e,t,n){let i=t.tileX,r=t.tileY,o=t.tileZ,a=n?.featureIdProperty,s=_3t.tileXYToRectangle(i,r,o),c=ie.center(s),u=h.fromRadians(c.longitude,c.latitude,0),f=4294967295,d=f,p=f,g=new Map,m=new Map,y=[],A=[],b=[],x=0;function T(){let z=(4-x%4)%4;z>0&&(b.push(new Uint8Array(z)),x+=z)}function C(z,j){T();let B=x;b.push(new Uint8Array(z.buffer,z.byteOffset,z.byteLength)),x+=z.byteLength;let G=y.length;return y.push({buffer:0,byteOffset:B,byteLength:z.byteLength,target:j}),G}function E(z,j){let B=C(z,j.target),G=gt.getComponentCount(j.type),W={bufferView:B,byteOffset:0,componentType:j.componentType,count:z.length/G,type:j.type};l(j.min)&&(W.min=j.min),l(j.max)&&(W.max=j.max);let Q=A.length;return A.push(W),Q}function w(z){let j=Number.POSITIVE_INFINITY,B=Number.POSITIVE_INFINITY,G=Number.POSITIVE_INFINITY,W=Number.NEGATIVE_INFINITY,Q=Number.NEGATIVE_INFINITY,q=Number.NEGATIVE_INFINITY;for(let J=0;J<z.length;J+=3){let Z=z[J],ce=z[J+1],Ae=z[J+2];Z<j&&(j=Z),ce<B&&(B=ce),Ae<G&&(G=Ae),Z>W&&(W=Z),ce>Q&&(Q=ce),Ae>q&&(q=Ae)}return{min:[j,B,G],max:[W,Q,q]}}function D(z,j,B){if(B.length===0)return;let G=new Uint32Array(B),W=E(G,{type:"SCALAR",componentType:Y.UNSIGNED_INT,target:ee.ARRAY_BUFFER});z._FEATURE_ID_0=W;let Q={featureCount:g.size,nullFeatureId:d,attribute:0};m.size>0&&(Q.propertyTable=0),j.EXT_mesh_features={featureIds:[Q]}}function R(z,j){j=j??4;let B=(j-x%j)%j;B>0&&(b.push(new Uint8Array(B)),x+=B);let G=x;b.push(z),x+=z.byteLength;let W=y.length;return y.push({buffer:0,byteOffset:G,byteLength:z.byteLength}),W}function M(){if(m.size===0)return;let z=new Map;for(let W of m.values())for(let[Q,q]of Object.entries(W)){if(!l(q))continue;let J=typeof q,Z;J==="string"?Z="STRING":J==="number"?Z="SCALAR":J==="boolean"?Z="BOOLEAN":Z="STRING";let ce=z.get(Q);l(ce)?ce!==Z&&z.set(Q,"STRING"):z.set(Q,Z)}if(z.size===0)return;let j={};for(let[W,Q]of z)Q==="SCALAR"?j[W]={type:"SCALAR",componentType:"FLOAT64"}:Q==="BOOLEAN"?j[W]={type:"BOOLEAN"}:j[W]={type:"STRING"};let B={},G=g.size;for(let[W,Q]of z)if(Q==="SCALAR"){let q=new Float64Array(G);for(let Z=0;Z<G;Z++){let Ae=m.get(Z)?.[W];q[Z]=typeof Ae=="number"&&Number.isFinite(Ae)?Ae:NaN}let J=R(new Uint8Array(q.buffer,q.byteOffset,q.byteLength),8);B[W]={values:J}}else if(Q==="BOOLEAN"){let q=Math.ceil(G/8),J=new Uint8Array(q);for(let ce=0;ce<G;ce++)m.get(ce)?.[W]&&(J[ce>>3]|=1<<(ce&7));let Z=R(J);B[W]={values:Z}}else{let q=new TextEncoder,J=[],Z=new Uint32Array(G+1),ce=0;for(let ve=0;ve<G;ve++){Z[ve]=ce;let Le=m.get(ve)?.[W],$e;Le==null?$e="":typeof Le=="string"?$e=Le:$e=String(Le);let Ye=q.encode($e);J.push(Ye),ce+=Ye.byteLength}Z[G]=ce;let Ae=new Uint8Array(ce),le=0;for(let ve of J)Ae.set(ve,le),le+=ve.byteLength;let Ce=R(Ae),ye=R(new Uint8Array(Z.buffer,Z.byteOffset,Z.byteLength));B[W]={values:Ce,stringOffsets:ye,stringOffsetType:"UINT32"}}return{schema:{classes:{mvt_feature:{properties:j}}},propertyTables:[{class:"mvt_feature",count:G,properties:B}]}}let N=[],_=[],v=[u.x,u.y,u.z];for(let z of e.layers){let j=z.extent,B=[],G=[],W=[],Q=[],q=[],J=0,Z=[],ce=[],Ae=[],le=[],Ce=[],ye=[],ve=[],Ie=0;for(let Ye of z.features){let yt=l(a)?b3t(Ye,a,g)??d:A3t(Ye,g);if(yt!==d&&!m.has(yt)){let Ke=Object.assign({},Ye.properties);Ke._layer=z.name??"",m.set(yt,Ke)}if(Ye.type==="Point"){let Ke=Ye.geometry;for(let we of Ke)dre(we,i,r,o,j,fre,u,B),G.push(yt);continue}if(Ye.type==="LineString"){let Ke=Ye.geometry;for(let we of Ke){let We=W.length/3;for(let Ct of we)dre(Ct,i,r,o,j,fre,u,W),Q.push(yt);for(let Ct=0;Ct<we.length;Ct++)q.push(We+Ct);q.push(p),J++}continue}if(Ye.type==="Polygon"){let Ke=Ye.geometry,we=x3t(Ke);for(let We of we){let Ct=[We.outerRing,...We.holes],ct=[],dn=[],Ht=[],bt=0;for(let dt=0;dt<Ct.length;dt++){let vi=Ct[dt];dt>0&&Ht.push(bt);for(let wn of vi)ct.push(new k(wn.x,wn.y)),dre(wn,i,r,o,j,fre,u,dn),bt++}if(ct.length<3)continue;let Dt=li.triangulate(ct,Ht.length>0?Ht:void 0);if(!l(Dt)||Dt.length===0){pt("buildVectorGltfFromMVT-triangulation-failed","Polygon triangulation failed; skipping polygon.");continue}let In=Z.length/3,rt=Ae.length;le.push(In),Ce.push(rt),ye.push(Ht.length);for(let dt=0;dt<Ht.length;dt++)ve.push(In+Ht[dt]);for(let dt=0;dt<dn.length;dt++)Z.push(dn[dt]);for(let dt=0;dt<dn.length/3;dt++)ce.push(yt);for(let dt=0;dt<Dt.length;dt++)Ae.push(Dt[dt]+In);Ie++}}}if(B.length===0&&W.length===0&&Z.length===0)continue;q.length>0&&q[q.length-1]===p&&q.pop();let Le=[];if(B.length>0){let Ye=new Float32Array(B),yt=w(Ye),we={POSITION:E(Ye,{type:"VEC3",componentType:Y.FLOAT,target:ee.ARRAY_BUFFER,min:yt.min,max:yt.max})},We={CESIUM_mesh_vector:{vector:!0,count:Ye.length/3}};D(we,We,G),Le.push({mode:Re.POINTS,attributes:we,extensions:We})}if(W.length>0&&q.length>1){let Ye=new Float32Array(W),yt=new Uint32Array(q),Ke=w(Ye),we=E(Ye,{type:"VEC3",componentType:Y.FLOAT,target:ee.ARRAY_BUFFER,min:Ke.min,max:Ke.max}),We=E(yt,{type:"SCALAR",componentType:Y.UNSIGNED_INT,target:ee.ELEMENT_ARRAY_BUFFER}),Ct={POSITION:we},ct={CESIUM_mesh_vector:{vector:!0,count:J}};D(Ct,ct,Q),Le.push({mode:Re.LINE_STRIP,indices:We,attributes:Ct,extensions:ct})}if(Z.length>0&&Ae.length>=3){let Ye=new Float32Array(Z),yt=new Uint32Array(Ae),Ke=new Uint32Array(le),we=new Uint32Array(Ce),We=ve.length>0,Ct=We?new Uint32Array(ye):void 0,ct=We?new Uint32Array(ve):void 0,dn=w(Ye),Ht=E(Ye,{type:"VEC3",componentType:Y.FLOAT,target:ee.ARRAY_BUFFER,min:dn.min,max:dn.max}),bt=E(yt,{type:"SCALAR",componentType:Y.UNSIGNED_INT,target:ee.ELEMENT_ARRAY_BUFFER}),Dt=E(Ke,{type:"SCALAR",componentType:Y.UNSIGNED_INT,target:ee.ARRAY_BUFFER}),In=E(we,{type:"SCALAR",componentType:Y.UNSIGNED_INT,target:ee.ARRAY_BUFFER}),rt=l(Ct)?E(Ct,{type:"SCALAR",componentType:Y.UNSIGNED_INT,target:ee.ARRAY_BUFFER}):void 0,dt=l(ct)?E(ct,{type:"SCALAR",componentType:Y.UNSIGNED_INT,target:ee.ARRAY_BUFFER}):void 0,vi={POSITION:Ht},wn={CESIUM_mesh_vector:{vector:!0,count:Ie,polygonAttributeOffsets:Dt,polygonIndicesOffsets:In}};We&&(wn.CESIUM_mesh_vector.polygonHoleCounts=rt,wn.CESIUM_mesh_vector.polygonHoleOffsets=dt),D(vi,wn,ce),Le.push({mode:Re.TRIANGLES,indices:bt,attributes:vi,extensions:wn})}if(Le.length===0)continue;let $e=N.length;N.push({primitives:Le}),_.push({name:z.name,mesh:$e,translation:v})}if(_.length===0)return;let S=M(),P=E3t(b,x),L=["CESIUM_mesh_vector"];g.size>0&&L.push("EXT_mesh_features"),l(S)&&L.push("EXT_structural_metadata");let F=_.map((z,j)=>j),V={asset:{version:"2.0"},extensionsUsed:L,scene:0,scenes:[{nodes:F}],nodes:_,meshes:N,accessors:A,bufferViews:y,buffers:[{byteLength:P.byteLength}],extensions:void 0};return l(S)&&(V.extensions={EXT_structural_metadata:S}),v3t(V,P)}function A3t(e,t){let n=t.get(e);return l(n)||(n=t.size,t.set(e,n)),n}function b3t(e,t,n){let i=e.properties;if(!l(i))return;let r=i[t];if(!l(r)||typeof r!="string"&&typeof r!="number"&&typeof r!="boolean"||typeof r=="number"&&!Number.isFinite(r))return;let o=`${typeof r}:${r}`,a=n.get(o);return l(a)||(a=n.size,n.set(o,a)),a}function x3t(e){let t=[];for(let n of e){let i=C3t(n);if(i.length<3)continue;T3t(i)<=0?t.push({outerRing:i,holes:[]}):t.length>0&&t[t.length-1].holes.push(i)}return t}function T3t(e){let t=0;for(let n=0,i=e.length-1;n<e.length;i=n++)t+=(e[i].x+e[n].x)*(e[i].y-e[n].y);return t/2}function C3t(e){return e.length>1&&e[0].x===e[e.length-1].x&&e[0].y===e[e.length-1].y?e.slice(0,e.length-1):e}function dre(e,t,n,i,r,o,a,s){let c=1<<i,u=(t+e.x/r)/c,f=(n+e.y/r)/c,d=u*2*Math.PI-Math.PI,p=Math.atan(Math.sinh(Math.PI*(1-2*f)));h.fromRadians(d,p,o,void 0,eMe),h.subtract(eMe,a,U5),s.push(U5.x,U5.y,U5.z)}function v3t(e,t){let a=new TextEncoder().encode(JSON.stringify(e)),s=Math.ceil(a.length/4)*4,c=new Uint8Array(s);c.fill(32),c.set(a);let u=Math.ceil(t.byteLength/4)*4,f=new Uint8Array(u);f.set(t);let d=20+s+8+u,p=new Uint8Array(d),g=new DataView(p.buffer),m=0;return g.setUint32(m,1179937895,!0),m+=4,g.setUint32(m,2,!0),m+=4,g.setUint32(m,d,!0),m+=4,g.setUint32(m,s,!0),m+=4,g.setUint32(m,1313821514,!0),m+=4,p.set(c,m),m+=s,g.setUint32(m,u,!0),m+=4,g.setUint32(m,5130562,!0),m+=4,p.set(f,m),p}function E3t(e,t){let n=new Uint8Array(t),i=0;for(let r of e)n.set(r,i),i+=r.byteLength;return n}var V5=y3t;var S3t=new TextDecoder,j5={UNKNOWN:0,POINT:1,LINESTRING:2,POLYGON:3},w3t={LAYERS:3},LO={NAME:1,FEATURES:2,KEYS:3,VALUES:4,EXTENT:5},hre={TAGS:2,TYPE:3,GEOMETRY:4},AT={STRING:1,FLOAT:2,DOUBLE:3,INT64:4,UINT64:5,SINT64:6,BOOL:7},I3t=["Unknown","Point","LineString","Polygon"];function P3t(e){let t=new Uint8Array(e),n=[],i=0;for(;i<t.length;){let r=H5(t,i,t.length),o=r.fieldNumber,a=r.wireType;if(i=r.newPos,o===w3t.LAYERS&&a===2){let s=Wg(t,i,t.length);i=s.newPos;let c=ku(i,s.value,t.length,"layer");n.push(D3t(t,i,c)),i=c}else i=G5(t,i,a,t.length)}return{layers:n}}function D3t(e,t,n){let i=t,r="",o=4096,a=[],s=[],c=[];for(;i<n;){let f=H5(e,i,n),d=f.fieldNumber,p=f.wireType;if(i=f.newPos,d===LO.NAME&&p===2){let g=Wg(e,i,n);i=g.newPos;let m=ku(i,g.value,n,"layer name");r=pre(e,i,g.value),i=m}else if(d===LO.FEATURES&&p===2){let g=Wg(e,i,n);i=g.newPos;let m=ku(i,g.value,n,"feature");c.push({start:i,end:m}),i=m}else if(d===LO.KEYS&&p===2){let g=Wg(e,i,n);i=g.newPos;let m=ku(i,g.value,n,"key");a.push(pre(e,i,g.value)),i=m}else if(d===LO.VALUES&&p===2){let g=Wg(e,i,n);i=g.newPos;let m=ku(i,g.value,n,"value"),y=M3t(e,i,m);s.push(y),i=m}else if(d===LO.EXTENT&&p===0){let g=Ew(e,i,n);o=g.value,i=g.newPos}else i=G5(e,i,p,n)}let u=c.map(({start:f,end:d})=>R3t(e,f,d,a,s));return{name:r,extent:o,features:u}}function R3t(e,t,n,i,r){let o=t,a=j5.UNKNOWN,s=[],c=[];for(;o<n;){let d=H5(e,o,n),p=d.fieldNumber,g=d.wireType;if(o=d.newPos,p===hre.TYPE&&g===0){let m=Ew(e,o,n);a=m.value,o=m.newPos}else if(p===hre.TAGS&&g===2){let m=Wg(e,o,n);o=m.newPos;let y=ku(o,m.value,n,"feature tags");for(;o<y;){let A=Ew(e,o,y);s.push(A.value),o=A.newPos}}else if(p===hre.GEOMETRY&&g===2){let m=Wg(e,o,n);o=m.newPos;let y=ku(o,m.value,n,"feature geometry");for(;o<y;){let A=Ew(e,o,y);c.push(A.value),o=A.newPos}}else o=G5(e,o,g,n)}let u={};for(let d=0;d<s.length-1;d+=2){let p=i[s[d]],g=r[s[d+1]];typeof p!="string"||g===void 0||(u[p]=g)}let f=O3t(a,c);return{type:I3t[a]??"Unknown",geometry:f,properties:u}}function O3t(e,t){let n=0,i=0,r=0;if(e===j5.POINT){let o=[];for(;n<t.length;){let a=t[n++],s=a&7,c=a>>3;if(s===1)for(let u=0;u<c;u++)i+=t0(t[n++]),r+=t0(t[n++]),o.push({x:i,y:r})}return o}if(e===j5.LINESTRING){let o=[],a=null;for(;n<t.length;){let s=t[n++],c=s&7,u=s>>3;if(c===1)a!==null&&o.push(a),a=[],i+=t0(t[n++]),r+=t0(t[n++]),a.push({x:i,y:r});else if(c===2)for(let f=0;f<u;f++)i+=t0(t[n++]),r+=t0(t[n++]),a.push({x:i,y:r})}return a!==null&&o.push(a),o}if(e===j5.POLYGON){let o=[],a=null;for(;n<t.length;){let s=t[n++],c=s&7,u=s>>3;if(c===1)a!==null&&o.push(a),a=[],i+=t0(t[n++]),r+=t0(t[n++]),a.push({x:i,y:r});else if(c===2)for(let f=0;f<u;f++)i+=t0(t[n++]),r+=t0(t[n++]),a.push({x:i,y:r});else c===7&&a!==null&&a.length>0&&(a.push({x:a[0].x,y:a[0].y}),o.push(a),a=null)}return a!==null&&o.push(a),o}return[]}function M3t(e,t,n){let i=t;for(;i<n;){let r=H5(e,i,n),o=r.fieldNumber,a=r.wireType;if(i=r.newPos,o===AT.STRING&&a===2){let s=Wg(e,i,n);i=s.newPos;let c=ku(i,s.value,n,"string value");return pre(e,i,c-i)}else{if(o===AT.FLOAT&&a===5)return ku(i,4,n,"float value"),new DataView(e.buffer,e.byteOffset+i,4).getFloat32(0,!0);if(o===AT.DOUBLE&&a===1)return ku(i,8,n,"double value"),new DataView(e.buffer,e.byteOffset+i,8).getFloat64(0,!0);if(o===AT.INT64&&a===0){let s=Sw(e,i,n);return mre(s.value)}else if(o===AT.UINT64&&a===0){let s=Sw(e,i,n);return mre(s.value)}else if(o===AT.SINT64&&a===0){let s=Sw(e,i,n);return mre(L3t(s.value))}else if(o===AT.BOOL&&a===0)return Ew(e,i,n).value!==0}i=G5(e,i,a,n)}}function H5(e,t,n){let i=Ew(e,t,n);return{fieldNumber:i.value>>>3,wireType:i.value&7,newPos:i.newPos}}function Ew(e,t,n){let i=Sw(e,t,n,5);if(i.value>0xffffffffn)throw new oe("Invalid MVT uint32 varint.");return{value:Number(i.value),newPos:i.newPos}}function Wg(e,t,n){let i=Sw(e,t,n);if(i.value>BigInt(Number.MAX_SAFE_INTEGER))throw new oe("Invalid MVT length varint.");return{value:Number(i.value),newPos:i.newPos}}function Sw(e,t,n,i){let r=0n,o=0n,a=0,s=i??10;for(;;){if(t>=n||t>=e.length)throw new oe("Invalid MVT: truncated varint.");let c=e[t++];if(r|=BigInt(c&127)<<o,a++,(c&128)===0)break;if(a>=s)throw new oe("Invalid MVT: varint is too long.");o+=7n}return{value:r,newPos:t}}function pre(e,t,n){let i=ku(t,n,e.length,"string");return S3t.decode(e.subarray(t,i))}function ku(e,t,n,i){if(!Number.isFinite(t)||t<0)throw new oe(`Invalid MVT ${i}: invalid length.`);let r=e+t;if(!Number.isFinite(r)||r<e||r>n)throw new oe(`Invalid MVT ${i}: length exceeds available bytes.`);return r}function G5(e,t,n,i){if(n===0)return Sw(e,t,i).newPos;if(n===1)return ku(t,8,i,"fixed64 field");if(n===2){let r=Wg(e,t,i);return ku(r.newPos,r.value,i,"length-delimited field")}else if(n===5)return ku(t,4,i,"fixed32 field");throw new oe(`Unsupported protobuf wire type: ${n}`)}function t0(e){return e>>>1^-(e&1)}function L3t(e){return e>>1n^-(e&1n)}function mre(e){return e<=BigInt(Number.MAX_SAFE_INTEGER)&&e>=BigInt(Number.MIN_SAFE_INTEGER)?Number(e):e}var W5=P3t;var q5=class extends z5{static async fromUrl(t,n){return super.fromUrl(t,n)}_createTilesetLoadOptions(){return{skipLevelOfDetail:!1,enablePick:!0,featureIdLabel:"featureId_0",instanceFeatureIdLabel:"instanceFeatureId_0"}}_configureTileset(t){t._modelUpAxis=zi.Z,t._modelForwardAxis=zi.X}_createCodec(){let t=this._featureIdProperty;return{contentType:"mvt",missingTilePolicy:{statusCodes:[404,204]},createContent:async(n,i,r,o)=>{let a=W5(o),s=tMe(r.getUrlComponent(!0)),c=V5(a,s,{featureIdProperty:t});if(!l(c)){if(!N3t(a))return new dg(n,i);throw new oe("Decoded MVT tile did not produce vector glTF content.")}return gx.fromGltf(n,i,r,c)}}}};function tMe(e){let t=e.match(/\/(\d+)\/(\d+)\/(\d+)(?:\.[^/?#]+)?(?:[?#]|$)/i);return t?{tileZ:parseInt(t[1],10),tileX:parseInt(t[2],10),tileY:parseInt(t[3],10)}:(pt("MVTDataProvider.parseTileCoordinates",`MVT tile URL did not match /{z}/{x}/{y} pattern. Falling back to z/x/y = 0/0/0. URL: ${e}`),{tileZ:0,tileX:0,tileY:0})}function N3t(e){let t=e.layers;for(let n=0;n<t.length;n++)if(t[n].features.length>0)return!0;return!1}q5._parseTileCoordinates=tMe;var nMe=q5;var F3t=/\/$/,iMe=new wt('© <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 ww(e){e=e??H.EMPTY_OBJECT;let t=e.styleId,n=e.accessToken;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=De.createIfNeeded(e.url??"https://api.mapbox.com/styles/v1/");this._styleId=t,this._accessToken=n;let r=e.tilesize??512;this._tilesize=r;let o=e.username??"mapbox";this._username=o;let a=l(e.scaleFactor)?"@2x":"",s=i.getUrlComponent();F3t.test(s)||(s+="/"),s+=`${this._username}/${t}/tiles/${this._tilesize}/{z}/{x}/{y}${a}`,i.url=s,i.setQueryParameters({access_token:n});let c;l(e.credit)?(c=e.credit,typeof c=="string"&&(c=new wt(c))):c=iMe,this._resource=i,this._imageryProvider=new Sa({url:i,credit:c,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(ww.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}}});ww.prototype.getTileCredits=function(e,t,n){};ww.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};ww.prototype.pickFeatures=function(e,t,n,i,r){return this._imageryProvider.pickFeatures(e,t,n,i,r)};ww._defaultCredit=iMe;var rMe=ww;function gre(e){}gre.prototype.isReady=function(){return!0};gre.prototype.shouldDiscardImage=function(e){return!1};var oMe=gre;var B3t=new wt("MapQuest, Open Street Map and contributors, CC-BY-SA");function Y5(e){e=e??H.EMPTY_OBJECT;let t=De.createIfNeeded(e.url??"https://tile.openstreetmap.org/");t.appendForwardSlash(),t.url+=`{z}/{x}/{y}${e.retinaTiles?"@2x":""}.${e.fileExtension??"png"}`;let n=new So({ellipsoid:e.ellipsoid}),i=256,r=256,o=e.minimumLevel??0,a=e.maximumLevel,s=e.rectangle??n.rectangle,c=n.positionToTileXY(ie.southwest(s),o),u=n.positionToTileXY(ie.northeast(s),o),f=(Math.abs(u.x-c.x)+1)*(Math.abs(u.y-c.y)+1),d=e.credit??B3t;typeof d=="string"&&(d=new wt(d)),Sa.call(this,{url:t,credit:d,tilingScheme:n,tileWidth:i,tileHeight:r,minimumLevel:o,maximumLevel:a,rectangle:s})}l(Object.create)&&(Y5.prototype=Object.create(Sa.prototype),Y5.prototype.constructor=Y5);var DA=Y5;function aMe(){pe.throwInstantiationError()}Object.defineProperties(aMe.prototype,{show:{get:pe.throwInstantiationError,set:pe.throwInstantiationError},transform:{get:pe.throwInstantiationError},credit:{get:pe.throwInstantiationError}});var sMe=aMe;function X5(){pe.throwInstantiationError()}Object.defineProperties(X5.prototype,{});X5.fromUrl=function(e){pe.throwInstantiationError()};X5.prototype.loadPanorama=function(e){pe.throwInstantiationError()};var cMe=X5;var k3t=new k(1,1);function _re(e){e=e??H.EMPTY_OBJECT,this.mass=e.mass??1,this.position=h.clone(e.position??h.ZERO),this.velocity=h.clone(e.velocity??h.ZERO),this.life=e.life??Number.MAX_VALUE,this.image=e.image,this.startColor=U.clone(e.startColor??U.WHITE),this.endColor=U.clone(e.endColor??U.WHITE),this.startScale=e.startScale??1,this.endScale=e.endScale??1,this.imageSize=k.clone(e.imageSize??k3t),this._age=0,this._normalizedAge=0,this._billboard=void 0}Object.defineProperties(_re.prototype,{age:{get:function(){return this._age}},normalizedAge:{get:function(){return this._normalizedAge}}});var lMe=new h;_re.prototype.update=function(e,t){return h.multiplyByScalar(this.velocity,e,lMe),h.add(this.position,lMe,this.position),l(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 NO=_re;function uMe(e){e=e??H.EMPTY_OBJECT,this.time=e.time??0,this.minimum=e.minimum??0,this.maximum=e.maximum??50,this._complete=!1}Object.defineProperties(uMe.prototype,{complete:{get:function(){return this._complete}}});var fMe=uMe;function dMe(e){}dMe.prototype.emit=function(e){pe.throwInstantiationError()};var hMe=dMe;var mMe=new k(1,1);function FO(e){e=e??H.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;l(t)||(t=new b5(.5)),this._emitter=t,this._bursts=e.bursts,this._modelMatrix=O.clone(e.modelMatrix??O.IDENTITY),this._emitterModelMatrix=O.clone(e.emitterModelMatrix??O.IDENTITY),this._matrixDirty=!0,this._combinedMatrix=new O,this._startColor=U.clone(e.color??e.startColor??U.WHITE),this._endColor=U.clone(e.color??e.endColor??U.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=k.clone(e.imageSize??e.minimumImageSize??mMe),this._maximumImageSize=k.clone(e.imageSize??e.maximumImageSize??mMe),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 be,this._isComplete=!1,this._updateParticlePool=!0,this._particleEstimate=0}Object.defineProperties(FO.prototype,{emitter:{get:function(){return this._emitter},set:function(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){this._matrixDirty=this._matrixDirty||!O.equals(this._modelMatrix,e),O.clone(e,this._modelMatrix)}},emitterModelMatrix:{get:function(){return this._emitterModelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!O.equals(this._emitterModelMatrix,e),O.clone(e,this._emitterModelMatrix)}},startColor:{get:function(){return this._startColor},set:function(e){U.clone(e,this._startColor)}},endColor:{get:function(){return this._endColor},set:function(e){U.clone(e,this._endColor)}},startScale:{get:function(){return this._startScale},set:function(e){this._startScale=e}},endScale:{get:function(){return this._endScale},set:function(e){this._endScale=e}},emissionRate:{get:function(){return this._emissionRate},set:function(e){this._emissionRate=e,this._updateParticlePool=!0}},minimumSpeed:{get:function(){return this._minimumSpeed},set:function(e){this._minimumSpeed=e}},maximumSpeed:{get:function(){return this._maximumSpeed},set:function(e){this._maximumSpeed=e}},minimumParticleLife:{get:function(){return this._minimumParticleLife},set:function(e){this._minimumParticleLife=e}},maximumParticleLife:{get:function(){return this._maximumParticleLife},set:function(e){this._maximumParticleLife=e,this._updateParticlePool=!0}},minimumMass:{get:function(){return this._minimumMass},set:function(e){this._minimumMass=e}},maximumMass:{get:function(){return this._maximumMass},set:function(e){this._maximumMass=e}},minimumImageSize:{get:function(){return this._minimumImageSize},set:function(e){this._minimumImageSize=e}},maximumImageSize:{get:function(){return this._maximumImageSize},set:function(e){this._maximumImageSize=e}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters=e}},lifetime:{get:function(){return this._lifetime},set:function(e){this._lifetime=e}},complete:{get:function(){return this._complete}},isComplete:{get:function(){return this._isComplete}}});function z3t(e){let t=e._emissionRate,n=e._maximumParticleLife,i=0,r=e._bursts;if(l(r)){let d=r.length;for(let p=0;p<d;++p)i+=r[p].maximum}let o=e._billboardCollection,a=e.image,s=Math.ceil(t*n+i),c=e._particles,u=e._particlePool,f=Math.max(s-c.length-u.length,0);for(let d=0;d<f;++d){let p=new NO;p._billboard=o.add({image:a,show:!1}),u.push(p)}e._particleEstimate=s}function U3t(e){let t=e._particlePool.pop();return l(t)||(t=new NO),t}function V3t(e,t){e._particlePool.push(t)}function j3t(e){let t=e._particles,n=e._particlePool,i=e._billboardCollection,r=t.length,o=n.length,a=e._particleEstimate,s=o-Math.max(a-r-o,0);for(let c=s;c<o;++c){let u=n[c];i.remove(u._billboard)}n.length=s}function H3t(e){l(e._billboard)&&(e._billboard.show=!1)}function pMe(e,t){let n=t._billboard;l(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=I.lerp(t.startColor.red,t.endColor.red,t.normalizedAge),r=I.lerp(t.startColor.green,t.endColor.green,t.normalizedAge),o=I.lerp(t.startColor.blue,t.endColor.blue,t.normalizedAge),a=I.lerp(t.startColor.alpha,t.endColor.alpha,t.normalizedAge);n.color=new U(i,r,o,a),n.scale=I.lerp(t.startScale,t.endScale,t.normalizedAge)}function G3t(e,t){t.startColor=U.clone(e._startColor,t.startColor),t.endColor=U.clone(e._endColor,t.endColor),t.startScale=e._startScale,t.endScale=e._endScale,t.image=e.image,t.life=I.randomBetween(e._minimumParticleLife,e._maximumParticleLife),t.mass=I.randomBetween(e._minimumMass,e._maximumMass),t.imageSize.x=I.randomBetween(e._minimumImageSize.x,e._maximumImageSize.x),t.imageSize.y=I.randomBetween(e._minimumImageSize.y,e._maximumImageSize.y),t._normalizedAge=0,t._age=0;let n=I.randomBetween(e._minimumSpeed,e._maximumSpeed);h.multiplyByScalar(t.velocity,n,t.velocity),e._particles.push(t)}function W3t(e,t){if(e._isComplete)return 0;t=I.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),l(e.bursts)){let r=e.bursts.length;for(let o=0;o<r;o++){let a=e.bursts[o],s=e._currentTime;l(a)&&!a._complete&&s>a.time&&(i+=I.randomBetween(a.minimum,a.maximum),a._complete=!0)}}return i}var K5=new h;FO.prototype.update=function(e){if(!this.show)return;l(this._billboardCollection)||(this._billboardCollection=new md),this._updateParticlePool&&(z3t(this),this._updateParticlePool=!1);let t=0;this._previousTime&&(t=K.secondsDifference(e.time,this._previousTime)),t<0&&(t=0);let n=this._particles,i=this._emitter,r=this.updateCallback,o,a,s=n.length;for(o=0;o<s;++o)a=n[o],a.update(t,r)?pMe(this,a):(H3t(a),V3t(this,a),n[o]=n[s-1],--o,--s);n.length=s;let c=W3t(this,t);if(c>0&&l(i)){this._matrixDirty&&(this._combinedMatrix=O.multiply(this.modelMatrix,this.emitterModelMatrix,this._combinedMatrix),this._matrixDirty=!1);let u=this._combinedMatrix;for(o=0;o<c;o++)a=U3t(this),this._emitter.emit(a),h.add(a.position,a.velocity,K5),O.multiplyByPoint(u,K5,K5),a.position=O.multiplyByPoint(u,a.position,a.position),h.subtract(K5,a.position,a.velocity),h.normalize(a.velocity,a.velocity),G3t(this,a),pMe(this,a)}if(this._billboardCollection.update(e),this._previousTime=K.clone(e.time,this._previousTime),this._currentTime+=t,this._lifetime!==Number.MAX_VALUE&&this._currentTime>this._lifetime)if(this.loop){if(this._currentTime=I.mod(this._currentTime,this._lifetime),this.bursts){let u=this.bursts.length;for(o=0;o<u;o++)this.bursts[o]._complete=!1}}else this._isComplete=!0,this._complete.raiseEvent(this);e.frameNumber%120===0&&j3t(this)};FO.prototype.isDestroyed=function(){return!1};FO.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),ue(this)};var gMe=FO;var yre=class{constructor(){at(this,"quadtree");at(this,"tilingScheme");at(this,"errorEvent");pe.throwInstantiationError()}static computeDefaultLevelZeroMaximumGeometricError(t){return t.ellipsoid.maximumRadius*2*Math.PI*.25/(65*t.getNumberOfXTilesAtLevel(0))}update(t,n){pe.throwInstantiationError()}beginUpdate(t,n,i){pe.throwInstantiationError()}endUpdate(t,n,i){pe.throwInstantiationError()}getLevelMaximumGeometricError(t){pe.throwInstantiationError()}loadTile(t,n,i){pe.throwInstantiationError()}computeTileVisibility(t,n,i){pe.throwInstantiationError()}showTileThisFrame(t,n,i,r){pe.throwInstantiationError()}computeDistanceToTile(t,n){pe.throwInstantiationError()}isDestroyed(){pe.throwInstantiationError()}destroy(){pe.throwInstantiationError()}},_Me=yre;function Are(e){e=e??1,this._radius=e??1}Object.defineProperties(Are.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});Are.prototype.emit=function(e){let t=I.randomBetween(0,I.TWO_PI),n=I.randomBetween(0,I.PI),i=I.randomBetween(0,this._radius),r=i*Math.cos(t)*Math.sin(n),o=i*Math.sin(t)*Math.sin(n),a=i*Math.cos(n);e.position=h.fromElements(r,o,a,e.position),e.velocity=h.normalize(e.position,e.velocity)};var yMe=Are;function BO(){}BO.prototype.evaluate=function(e,t){pe.throwInstantiationError()};BO.prototype.evaluateColor=function(e,t){pe.throwInstantiationError()};BO.prototype.getShaderFunction=function(e,t,n,i){pe.throwInstantiationError()};BO.prototype.getVariables=function(){pe.throwInstantiationError()};var AMe=BO;function Iw(e){this._ready=!1,this._provider=void 0,this._errorEvent=new be,this._readyEvent=new be,Y3t(this,e)}Object.defineProperties(Iw.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}}});Iw.fromWorldTerrain=function(e){return new Iw(_v(e))};Iw.fromWorldBathymetry=function(e){return new Iw(Tk(e))};function q3t(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function Y3t(e,t){let n;try{n=await Promise.resolve(t),e._provider=n,e._ready=!0,e._readyEvent.raiseEvent(n)}catch(i){q3t(e._errorEvent,i)}}var $5=Iw;function Pw(){}Pw.prototype.boundingVolume=void 0;Pw.prototype.boundingSphere=void 0;Pw.prototype.distanceToCamera=function(e){pe.throwInstantiationError()};Pw.prototype.intersectPlane=function(e){pe.throwInstantiationError()};Pw.prototype.createDebugVolume=function(e){pe.throwInstantiationError()};var bMe=Pw;function kO(e){e=e??H.EMPTY_OBJECT,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new $i({ellipsoid:e.ellipsoid}),this._color=e.color??U.YELLOW,this._errorEvent=new be,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(kO.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}}});kO.prototype.getTileCredits=function(e,t,n){};kO.prototype.requestImage=function(e,t,n,i){let r=document.createElement("canvas");r.width=256,r.height=256;let o=r.getContext("2d"),a=this._color.toCssColorString();return o.strokeStyle=a,o.lineWidth=2,o.strokeRect(1,1,255,255),o.font="bold 25px Arial",o.textAlign="center",o.fillStyle=a,o.fillText(`L: ${n}`,124,86),o.fillText(`X: ${e}`,124,136),o.fillText(`Y: ${t}`,124,186),Promise.resolve(r)};kO.prototype.pickFeatures=function(e,t,n,i,r){};var J5=kO;function bre(e){pe.throwInstantiationError()}bre.prototype.isReady=pe.throwInstantiationError;bre.prototype.shouldDiscardImage=pe.throwInstantiationError;var xMe=bre;var TMe={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3};Object.freeze(TMe);var CMe=TMe;function Z5(e,t){this.show=!0,l(e)||(e=new Je),this.rectangle=Je.clone(e),l(t)||(t=ir.fromType(ir.ColorType,{color:new U(1,1,1,1)})),this.material=t,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}Z5.prototype.update=function(e){if(!this.show)return;let t=this._rs;if((!l(t)||!Je.equals(t.viewport,this.rectangle))&&(this._rs=je.fromCache({blending:en.ALPHA_BLEND,viewport:this.rectangle})),e.passes.render){let i=e.context;if(this._material!==this.material||!l(this._overlayCommand)){this._material=this.material,l(this._overlayCommand)&&this._overlayCommand.shaderProgram.destroy();let r=new Ge({sources:[this._material.shaderSource,y5]});this._overlayCommand=i.createViewportQuadCommand(r,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this}),this._overlayCommand.pass=Pe.OVERLAY}this._material.update(i),this._overlayCommand.renderState=this._rs,this._overlayCommand.uniformMap=this._material._uniforms,e.commandList.push(this._overlayCommand)}};Z5.prototype.isDestroyed=function(){return!1};Z5.prototype.destroy=function(){return l(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),ue(this)};var vMe=Z5;var xre=class{constructor(){at(this,"globalTransform");at(this,"shapeTransform");at(this,"shape");at(this,"minBounds");at(this,"maxBounds");at(this,"dimensions");at(this,"paddingBefore");at(this,"paddingAfter");at(this,"names");at(this,"types");at(this,"componentTypes");at(this,"minimumValues");at(this,"maximumValues");at(this,"maximumTileCount");at(this,"availableLevels");at(this,"keyframeCount");at(this,"timeIntervalCollection");pe.throwInstantiationError()}requestData(t){pe.throwInstantiationError()}},EMe=xre;function qg(){pe.throwInstantiationError()}Object.defineProperties(qg.prototype,{orientedBoundingBox:{get:pe.throwInstantiationError},boundingSphere:{get:pe.throwInstantiationError},boundTransform:{get:pe.throwInstantiationError},shapeTransform:{get:pe.throwInstantiationError},shaderUniforms:{get:pe.throwInstantiationError},shaderDefines:{get:pe.throwInstantiationError},shaderMaximumIntersectionsLength:{get:pe.throwInstantiationError}});qg.prototype.update=pe.throwInstantiationError;qg.prototype.updateViewTransforms=pe.throwInstantiationError;qg.prototype.convertLocalToShapeUvSpace=pe.throwInstantiationError;qg.prototype.computeOrientedBoundingBoxForTile=pe.throwInstantiationError;qg.prototype.computeOrientedBoundingBoxForSample=pe.throwInstantiationError;qg.DefaultMinBounds=pe.throwInstantiationError;qg.DefaultMaxBounds=pe.throwInstantiationError;var SMe=qg;var X3t=new U,K3t=new U,$3t=new U,J3t=new U,wMe=new ae,zO=new Uint8Array(4);function IMe(e,t,n,i){let r=t.height===n.height?0:(e-t.height)/(n.height-t.height);return U.lerp(t.color,n.color,r,i)}function Q5(e,t){return{height:e,color:U.clone(t)}}function PMe(e){return e=e.filter(function(t,n,i){let r=n>0,o=n<i.length-1,a=r?t.height===i[n-1].height:!0,s=o?t.height===i[n+1].height:!0;return!a||!s}),e=e.filter(function(t,n,i){let r=n>0,o=n<i.length-1,a=r?U.equals(t.color,i[n-1].color):!1,s=o?U.equals(t.color,i[n+1].color):!1;return!a||!s}),e=e.filter(function(t,n,i){let r=n>0,o=r?U.equals(t.color,i[n-1].color):!1,a=r?t.height===i[n-1].height:!0;return!o||!a}),e}function Z3t(e){let t,n,i=[],r=e.length;for(t=0;t<r;t++){let o=e[t],a=o.entries,s=a.length,c=[];for(n=0;n<s;n++){let g=a[n],m=I.clamp(g.height,zu._minimumHeight,zu._maximumHeight),y=U.clone(g.color,X3t);y.red*=y.alpha,y.green*=y.alpha,y.blue*=y.alpha,c.push(Q5(m,y))}let u=!0,f=!0;for(n=0;n<s-1;n++){let g=c[n+0],m=c[n+1];u=u&&g.height<=m.height,f=f&&g.height>=m.height}f?c=c.reverse():u||U0(c,function(g,m){return I.sign(g.height-m.height)});let d=o.extendDownwards??!1,p=o.extendUpwards??!1;c.length===1&&!d&&!p&&(d=!0,p=!0),d&&c.splice(0,0,Q5(zu._minimumHeight,c[0].color)),p&&c.splice(c.length,0,Q5(zu._maximumHeight,c[c.length-1].color)),c=PMe(c),i.push(c)}return i}function Q3t(e){let t=Z3t(e),n=[],i,r;function o(u,f){n.push(Q5(u,f))}function a(u,f,d){let p=U.multiplyByScalar(d,1-f.alpha,J3t);p=U.add(p,f,p),o(u,p)}let s=t.length;for(r=0;r<s;r++){let u=t[r],f=0,d=0;i=n,n=[];let p=u.length,g=i.length;for(;f<p||d<g;){let m=f<p?u[f]:void 0,y=f>0?u[f-1]:void 0,A=f<p-1?u[f+1]:void 0,b=d<g?i[d]:void 0,x=d>0?i[d-1]:void 0,T=d<g-1?i[d+1]:void 0;if(l(m)&&l(b)&&m.height===b.height){let C=l(T)&&b.height===T.height,E=!l(x),w=!l(T),D=l(A)&&m.height===A.height,R=!l(y),M=!l(A);C?D?(a(m.height,m.color,b.color),a(m.height,A.color,T.color)):R?(o(m.height,b.color),a(m.height,m.color,T.color)):M?(a(m.height,m.color,b.color),o(m.height,T.color)):(a(m.height,m.color,b.color),a(m.height,m.color,T.color)):E?D?(o(m.height,m.color),a(m.height,A.color,b.color)):M?(o(m.height,m.color),o(m.height,b.color)):(R||o(m.height,m.color),a(m.height,m.color,b.color)):w?D?(a(m.height,m.color,b.color),o(m.height,A.color)):R?(o(m.height,b.color),o(m.height,m.color)):M?a(m.height,m.color,b.color):(a(m.height,m.color,b.color),o(m.height,m.color)):D?(a(m.height,m.color,b.color),a(m.height,A.color,b.color)):R?(o(m.height,b.color),a(m.height,m.color,b.color)):M?(a(m.height,m.color,b.color),o(m.height,b.color)):a(m.height,m.color,b.color),f+=D?2:1,d+=C?2:1}else if(l(m)&&l(b)&&l(x)&&m.height<b.height){let C=IMe(m.height,x,b,$3t);l(y)?l(A)?a(m.height,m.color,C):(a(m.height,m.color,C),o(m.height,C)):(o(m.height,C),a(m.height,m.color,C)),f++}else if(l(b)&&l(m)&&l(y)&&b.height<m.height){let C=IMe(b.height,y,m,K3t);l(x)?l(T)?a(b.height,C,b.color):(a(b.height,C,b.color),o(b.height,C)):(o(b.height,C),a(b.height,C,b.color)),d++}else l(m)&&(!l(b)||m.height<b.height)?(l(b)&&!l(x)&&!l(A)?(o(m.height,m.color),o(m.height,zu._emptyColor),o(b.height,zu._emptyColor)):(!l(b)&&l(x)&&!l(y)&&(o(x.height,zu._emptyColor),o(m.height,zu._emptyColor)),o(m.height,m.color)),f++):l(b)&&(!l(m)||b.height<m.height)&&(o(b.height,b.color),d++)}}return PMe(n)}function zu(e){let{scene:t,layers:n}=e??H.EMPTY_OBJECT,{context:i}=t,r=Q3t(n),o=r.length,a,s,c;if(!zu._useFloatTexture(i)){s=ke.UNSIGNED_BYTE,c=He.RGBA,a=new Uint8Array(o*4);for(let g=0;g<o;g++)ae.packFloat(r[g].height,wMe),ae.pack(wMe,a,g*4)}else{s=ke.FLOAT,c=i.webgl2?He.RED:He.LUMINANCE,a=new Float32Array(o);for(let g=0;g<o;g++)a[g]=r[g].height}let f=Et.create({context:i,pixelFormat:c,pixelDatatype:s,source:{arrayBufferView:a,width:o,height:1},sampler:new Ut({wrapS:on.CLAMP_TO_EDGE,wrapT:on.CLAMP_TO_EDGE,minificationFilter:Gt.NEAREST,magnificationFilter:ni.NEAREST})}),d=new Uint8Array(o*4);for(let g=0;g<o;g++)r[g].color.toBytes(zO),d[g*4+0]=zO[0],d[g*4+1]=zO[1],d[g*4+2]=zO[2],d[g*4+3]=zO[3];let p=Et.create({context:i,pixelFormat:He.RGBA,pixelDatatype:ke.UNSIGNED_BYTE,source:{arrayBufferView:d,width:o,height:1},sampler:new Ut({wrapS:on.CLAMP_TO_EDGE,wrapT:on.CLAMP_TO_EDGE,minificationFilter:Gt.LINEAR,magnificationFilter:ni.LINEAR})});return ir.fromType("ElevationBand",{heights:f,colors:p})}zu._useFloatTexture=function(e){return e.floatingPointTexture};zu._maximumHeight=5906376425472;zu._minimumHeight=-5906376425472;zu._emptyColor=new U(0,0,0,0);var DMe=zu;async function ezt(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??H.EMPTY_OBJECT,e.onlyUsingWithGoogleGeocoder||pt("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??xs.defaultApiKey;if(!l(n))return tzt(t);let i,r=xs.getDefaultCredit();l(r)&&(i=[r]);let o=new De({url:`${xs.mapTilesApiEndpoint}v1/3dtiles/root.json`,queryParameters:{key:n},credits:i});return Yo.fromUrl(o,t)}var RMe={};async function tzt(e){let i=RMe[2275207];l(i)||(i=ga.fromAssetId(2275207),RMe[2275207]=i);let r=await i;return Yo.fromUrl(r,e)}var OMe=ezt;async function nzt(e){let t=await Yo.fromIonAssetId(96188,e);e=e??H.EMPTY_OBJECT;let n=e.style;if(!l(n)){let i=(e.defaultColor??U.WHITE).toCssColorString();n=new Uy({color:`Boolean(\${feature['cesium#color']}) ? color(\${feature['cesium#color']}) : ${i}`})}return t.style=n,t}var MMe=nzt;function izt(e){e=e??H.EMPTY_OBJECT;let t=[],n=e.geometry;(!l(n.attributes)||!l(n.primitiveType))&&(n=n.constructor.createGeometry(n));let i=n.attributes,r=O.clone(e.modelMatrix??O.IDENTITY),o=e.length??1e4;if(l(i.normal)&&t.push(new Bt({geometry:Gn.createLineSegmentsForVectors(n,"normal",o),attributes:{color:new Kt(1,0,0,1)},modelMatrix:r})),l(i.tangent)&&t.push(new Bt({geometry:Gn.createLineSegmentsForVectors(n,"tangent",o),attributes:{color:new Kt(0,1,0,1)},modelMatrix:r})),l(i.bitangent)&&t.push(new Bt({geometry:Gn.createLineSegmentsForVectors(n,"bitangent",o),attributes:{color:new Kt(0,0,1,1)},modelMatrix:r})),t.length>0)return new Fn({asynchronous:!1,geometryInstances:t,appearance:new _n({flat:!0,translucent:!1})})}var LMe=izt;var NMe=`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);
|
|
}
|
|
`;var Tre=class{get enabled(){return pe.throwInstantiationError()}set enabled(t){pe.throwInstantiationError()}connectedCallback(t){pe.throwInstantiationError()}disconnectedCallback(t){pe.throwInstantiationError()}update(t,n){pe.throwInstantiationError()}firstUpdate(t,n){pe.throwInstantiationError()}},FMe=Tre;var BMe=new h,rzt=new tn(h.UNIT_X,0),ozt=new hn,azt=new k(1,1,1);function n0(e,t,n,i=azt){let{camera:r,ellipsoid:o}=e,a=o.scaleToGeodeticSurface(r.positionWC,BMe);if(!l(a))return;let s=h.magnitude(r.positionWC),c=h.magnitude(a),u=s<=c,f=o.geodeticSurfaceNormal(r.positionWC,BMe),d=h.dot(f,r.directionWC),p=d>0;if(u||p){let g=tn.fromPointNormal(r.positionWC,f,rzt),{clientHeight:m}=e.canvas,y=i.y*m/(2*Math.tan(r.frustum.fovy*.5));g.distance-=d*y;let A=r.getPickRay(t,ozt);return ci.rayPlane(A,g,n)}return r.pickEllipsoid(t,o,n)}var kMe={LEFT:0,MIDDLE:1,RIGHT:2};Object.freeze(kMe);var sc=kMe;function szt(e){if(e===sc.LEFT)return ln.LEFT_DOWN;if(e===sc.MIDDLE)return ln.MIDDLE_DOWN;if(e===sc.RIGHT)return ln.RIGHT_DOWN}function czt(e){if(e===sc.LEFT)return ln.LEFT_UP;if(e===sc.MIDDLE)return ln.MIDDLE_UP;if(e===sc.RIGHT)return ln.RIGHT_UP}var Cre=class{static registerDragInputBindings(t,n,i){let r=new Set,o={isDragging:!1};for(let a of n){o.isDragging=!1;let s=szt(a.button),c=czt(a.button);l(s)&&t.setInputAction((...u)=>{o.isDragging=!0,l(i.start)&&i.start(...u)},s,a.modifier),l(c)&&(t.setInputAction((...u)=>{o.isDragging&&(o.isDragging=!1,l(i.end)&&i.end(...u))},c,a.modifier),t.setInputAction((...u)=>{o.isDragging&&(o.isDragging=!1,l(i.end)&&i.end(...u))},c)),r.add(a.modifier)}for(let a of r)t.setInputAction((...s)=>{o.isDragging&&l(i.change)&&i.change(...s)},ln.MOUSE_MOVE,a);return o}},i0=Cre;var vre=class e{static _getDefaultDragInputs(){return[Object.freeze({button:sc.LEFT})]}constructor(t=H.EMPTY_OBJECT){this._enabled=!0,this._handler=void 0,this._lastUpdateTime=void 0,this.dragInputs=t.dragInputs??e._getDefaultDragInputs(),this._dragInputState=void 0,this._panDelta=new k,this._panPosition=new k,this.pickWorldPosition=n0,this._ellipsoidNormal=new h,this._ellipsoidSurfacePosition=new h,this._panDirectionX=new h,this._panDirectionY=new h,this._pixelSize=new k,this._panVelocity=new k,this.panSpeed=1,this.inertiaEnabled=!0,this.inertialDecay=6,this.maximumMovementRatio=.1}get enabled(){return this._enabled}set enabled(t){this._enabled=t,t?(this._lastUpdateTime=An(),this._panDelta.x=0,this._panDelta.y=0):l(this._dragInputState)&&(this._dragInputState.isDragging=!1)}get isDragging(){return l(this._dragInputState)&&this._dragInputState.isDragging}connectedCallback(t){let n=new os(t);this._handler=n,this._dragInputState=i0.registerDragInputBindings(n,this.dragInputs,{start:this._handleStartPan.bind(this),change:this._handlePan.bind(this)})}disconnectedCallback(t){let n=this._handler;l(n)&&!n.isDestroyed()&&n.destroy()}firstUpdate(){this._lastUpdateTime=An(),this._panDelta.x=0,this._panDelta.y=0}update(t){let n=(An()-this._lastUpdateTime)*Un.SECONDS_PER_MILLISECOND,{camera:i,ellipsoid:r,canvas:o}=t,a=-this._panDelta.x,s=this._panDelta.y;if(this.inertiaEnabled&&!this.isDragging){let C=Math.exp(-this.inertialDecay*n);this._panVelocity.x*=C,this._panVelocity.y*=C,a=this._panVelocity.x*n,s=this._panVelocity.y*n}let{clientWidth:c,clientHeight:u}=o;if(n===0||c===0||u===0||Math.abs(a)<=I.EPSILON3&&Math.abs(s)<=I.EPSILON3){this._lastUpdateTime=An(),this._panDelta.x=0,this._panDelta.y=0;return}let f=this._panPosition,d=this.pickWorldPosition(t,f,this._ellipsoidSurfacePosition);l(d)||(d=r.scaleToGeodeticSurface(i.positionWC,this._ellipsoidSurfacePosition));let p=h.clone(i.rightWC,this._panDirectionX);p=h.normalize(p,this._panDirectionX);let g=h.normalize(d,this._panDirectionY),m=h.distance(i.positionWC,d),{drawingBufferWidth:y,drawingBufferHeight:A,pixelRatio:b}=t,x=i.frustum.getPixelDimensions(y,A,m,b,this._pixelSize),T=this.maximumMovementRatio*Math.max(c,u);a=I.clamp(a,-T,T),this._panVelocity.x=a/n,a*=this.panSpeed*x.x,s=I.clamp(s,-T,T),this._panVelocity.y=s/n,s*=this.panSpeed*x.y,i.move(p,a),i.move(g,s),this._lastUpdateTime=An(),this._panDelta.x=0,this._panDelta.y=0}_handleStartPan(){this.enabled&&(this._panDelta.x=0,this._panDelta.y=0)}_handlePan(t){this._panDelta.x+=t.endPosition.x-t.startPosition.x,this._panDelta.y+=t.endPosition.y-t.startPosition.y,this._panPosition.x=t.endPosition.x,this._panPosition.y=t.endPosition.y}},e9=vre;var Ere=class e{static _getDefaultDragInputs(){return[Object.freeze({button:sc.LEFT})]}constructor(t=H.EMPTY_OBJECT){this._enabled=!0,this._handler=void 0,this._lastUpdateTime=void 0,this.dragInputs=t.dragInputs??e._getDefaultDragInputs(),this._dragInputState=void 0,this._panDelta=new k,this._panPosition=new k,this.pickWorldPosition=n0,this._ellipsoidNormal=new h,this._ellipsoidSurfacePosition=new h,this._panDirectionX=new h,this._panDirectionY=new h,this._pixelSize=new k,this._panVelocity=new k,this.panSpeed=1,this.inertiaEnabled=!0,this.inertialDecay=6,this.maximumMovementRatio=.1}get enabled(){return this._enabled}set enabled(t){this._enabled=t,t?(this._panDelta.x=0,this._panDelta.y=0):l(this._dragInputState)&&(this._dragInputState.isDragging=!1)}get isDragging(){return l(this._dragInputState)&&this._dragInputState.isDragging}connectedCallback(t){let n=new os(t);this._handler=n,this._dragInputState=i0.registerDragInputBindings(n,this.dragInputs,{start:this._handleStartPan.bind(this),change:this._handlePan.bind(this)})}disconnectedCallback(t){let n=this._handler;l(n)&&!n.isDestroyed()&&n.destroy()}firstUpdate(){this._lastUpdateTime=An(),this._panDelta.x=0,this._panDelta.y=0}update(t){let n=(An()-this._lastUpdateTime)*Un.SECONDS_PER_MILLISECOND,i=-this._panDelta.x,r=this._panDelta.y;if(this.inertiaEnabled&&!this.isDragging){let w=Math.exp(-this.inertialDecay*n);this._panVelocity.x*=w,this._panVelocity.y*=w,i=this._panVelocity.x*n,r=this._panVelocity.y*n}let{camera:o,ellipsoid:a,canvas:s}=t,{clientWidth:c,clientHeight:u}=s;if(n===0||c===0||u===0||Math.abs(i)<=I.EPSILON3&&Math.abs(r)<=I.EPSILON3){this._lastUpdateTime=An(),this._panDelta.x=0,this._panDelta.y=0;return}let f=this._panPosition,d=this.pickWorldPosition(t,f,this._ellipsoidSurfacePosition);l(d)||(d=a.scaleToGeodeticSurface(o.positionWC,this._ellipsoidSurfacePosition));let p=a.geodeticSurfaceNormal(d,this._ellipsoidNormal),g=h.clone(o.rightWC,this._panDirectionX);g=h.normalize(g,this._panDirectionX);let m=h.clone(o.upWC,this._panDirectionY),y=Math.abs(h.dot(p,o.directionWC));I.lessThan(y,1,I.EPSILON6)&&(m=h.cross(p,g,this._panDirectionY)),m=h.normalize(m,this._panDirectionY);let A=h.distance(o.positionWC,d),{drawingBufferWidth:b,drawingBufferHeight:x,pixelRatio:T}=t,C=o.frustum.getPixelDimensions(b,x,A,T,this._pixelSize),E=this.maximumMovementRatio*Math.max(c,u);i=I.clamp(i,-E,E),this._panVelocity.x=i/n,i*=this.panSpeed*C.x,r=I.clamp(r,-E,E),this._panVelocity.y=r/n,r*=this.panSpeed*C.y,o.move(g,i),o.move(m,r),this._lastUpdateTime=An(),this._panDelta.x=0,this._panDelta.y=0}_handleStartPan(t){this.enabled&&(this._panDelta.x=0,this._panDelta.y=0)}_handlePan(t){this._panDelta.x+=t.endPosition.x-t.startPosition.x,this._panDelta.y+=t.endPosition.y-t.startPosition.y,this._panPosition.x=t.endPosition.x,this._panPosition.y=t.endPosition.y}},t9=Ere;var Sre=class{constructor(){this._elevatorController=new e9,this._mapController=new t9,this._enabled=!0,this._ellipsoidNormal=new h,this.angleThreshold=I.toRadians(125)}get enabled(){return this._enabled}set enabled(t){this._enabled=t}get elevatorController(){return this._elevatorController}get mapController(){return this._mapController}connectedCallback(t){this._elevatorController.connectedCallback(t),this._mapController.connectedCallback(t)}disconnectedCallback(t){this._elevatorController.disconnectedCallback(t),this._mapController.disconnectedCallback(t)}firstUpdate(){this._elevatorController.firstUpdate(),this._mapController.firstUpdate()}update(t){let n=t.camera,i=t.ellipsoid.geodeticSurfaceNormal(n.positionWC,this._ellipsoidNormal),r=Math.abs(h.angleBetween(i,n.directionWC));(r<this.angleThreshold&&r>Math.PI-this.angleThreshold?this._elevatorController:this._mapController).update(t)}},zMe=Sre;var wre=class e{static _getDefaultDragInputs(){return[Object.freeze({button:sc.LEFT,modifier:Xr.CTRL}),Object.freeze({button:sc.RIGHT})]}constructor(t=H.EMPTY_OBJECT){this._enabled=!0,this._handler=void 0,this._lastUpdateTime=void 0,this.tiltEnabled=!0,this.orbitEnabled=!0,this.useDragPosition=!1,this.dragInputs=t.dragInputs??e._getDefaultDragInputs(),this._dragInputState=void 0,this._dragDelta=new k,this._screenSpaceDragPosition=new k,this._screenSpaceOrigin=new k,this.pickWorldPosition=n0,this._hasTarget=!1,this._target=new h,this._axis=new h,this.tiltMagnitude=2,this.dampingEnabled=!0,this.tiltAnimationDuration=.0045,this.maximumTiltVelocity=I.PI,this.minimumTiltVelocity=I.EPSILON20,this.orbitMagnitude=2,this.orbitAnimationDuration=.0045,this.maximumOrbitVelocity=I.TWO_PI,this.minimumOrbitVelocity=I.EPSILON20,this._tiltAxis=new h,this._tiltQuaternion=new Fe,this._tiltOffset=new h,this._tiltOrigin=new h,this._tiltDampenedResults={velocity:0,value:0},this._orbitTargetEnu=new O,this._orbitTargetEast=new h,this._orbitQuaternion=new Fe,this._orbitOffset=new h,this._orbitLookOffset=new h,this._orbitOrigin=new h,this._orbitDampenedResults={velocity:0,value:0},this.maximumMovementRatio=.1}get enabled(){return this._enabled}set enabled(t){this._enabled=t,t?(this._lastUpdateTime=An(),this._dragDelta.x=0,this._dragDelta.y=0):l(this._dragInputState)&&(this._dragInputState.isDragging=!1)}get isDragging(){return l(this._dragInputState)&&this._dragInputState.isDragging}connectedCallback(t){let n=new os(t);this._handler=n,this._dragInputState=i0.registerDragInputBindings(n,this.dragInputs,{start:this._handleStartDrag.bind(this),change:this._handleDrag.bind(this)})}disconnectedCallback(t){let n=this._handler;l(n)&&!n.isDestroyed()&&n.destroy()}firstUpdate(){this._lastUpdateTime=An(),this._dragDelta.x=0,this._dragDelta.y=0}_handleStartDrag(t){this.enabled&&(this._hasTarget=!1,this._screenSpaceDragPosition.x=t.position.x,this._screenSpaceDragPosition.y=t.position.y,this._dragDelta.x=0,this._dragDelta.y=0)}_handleDrag(t){this._dragDelta.x+=t.endPosition.x-t.startPosition.x,this._dragDelta.y+=t.endPosition.y-t.startPosition.y}get tiltAngle(){return this._tiltDampenedResults.value}get tiltVelocity(){return this._tiltDampenedResults.velocity}set tiltVelocity(t){this._tiltDampenedResults.velocity=t}get orbitAngle(){return this._orbitDampenedResults.value}get orbitVelocity(){return this._orbitDampenedResults.velocity}set orbitVelocity(t){this._orbitDampenedResults.velocity=t}orbit(t,n,i,r,o,a=te.default){let s=mt.eastNorthUpToFixedFrame(n,a,this._orbitTargetEnu),c=O.multiplyByPointAsVector(s,h.UNIT_X,this._orbitTargetEast),u=h.angleBetween(t.directionWC,c);if(Math.abs(this.orbitVelocity)<this.minimumOrbitVelocity&&(this.orbitVelocity=0),!this.isDragging&&this.dampingEnabled&&(r+=this.orbitVelocity*o),r===0)return;let f=u+r,d=this.dampingEnabled?this.maximumOrbitVelocity*this.orbitMagnitude:void 0,p=this.dampingEnabled?this.orbitAnimationDuration:void 0;this._orbitDampenedResults=I.smoothDamp(u,f,this.orbitVelocity,o,d,p,this._orbitDampenedResults);let g=this.orbitAngle-u,m=$.fromQuaternion(Fe.fromAxisAngle(i,-g,this._orbitQuaternion)),y=h.subtract(t.positionWC,n,this._orbitOffset),A=h.dot(y,t.directionWC),b=h.multiplyByScalar(t.directionWC,A,this._orbitLookOffset),x=h.subtract(y,b,this._orbitLookOffset),T=$.multiplyByVector(m,y,this._orbitOffset),C=$.multiplyByVector(m,x,this._orbitLookOffset);h.add(n,T,t.position);let E=h.add(n,C,this._orbitOrigin);t.lookAtWorldPosition(E,a)}tilt(t,n,i,r,o,a=te.default){if(Math.abs(this.tiltVelocity)<this.minimumTiltVelocity&&(this.tiltVelocity=0),!this.isDragging&&this.dampingEnabled&&(r+=this.tiltVelocity*o),r===0)return;let s=h.angleBetween(t.direction,i);(s<I.PI_OVER_TWO&&r>0||s>I.PI_OVER_TWO&&r<0)&&(r*=Math.abs(Math.sin(s)));let c=s+r,u=this.dampingEnabled?this.maximumTiltVelocity*this.tiltMagnitude:void 0,f=this.dampingEnabled?this.tiltAnimationDuration:void 0;I.smoothDamp(s,c,this.tiltVelocity,o,u,f,this._tiltDampenedResults);let d=this.tiltAngle-s,p=$.fromQuaternion(Fe.fromAxisAngle(t.rightWC,-d,this._tiltQuaternion)),g=h.subtract(t.position,n,this._tiltOffset),m=h.dot(g,t.directionWC),y=h.multiplyByScalar(t.directionWC,m,this._tiltOffset),A=h.subtract(t.position,y,this._tiltOrigin),b=$.multiplyByVector(p,y,this._tiltOffset);h.add(A,b,t.position),t.lookAtWorldPosition(A,a)}update(t){let n=(An()-this._lastUpdateTime)*Un.SECONDS_PER_MILLISECOND,{canvas:i}=t,{clientWidth:r,clientHeight:o}=i;if(n===0||r===0||o===0){this._lastUpdateTime=An(),this._dragDelta.x=0,this._dragDelta.y=0;return}let a=this._target;if(this.isDragging&&!this._hasTarget){let s=this._screenSpaceDragPosition;this.useDragPosition||(s=this._screenSpaceOrigin,s.x=r/2,s.y=o/2);let c=this.pickWorldPosition(t,s,this._target),u=l(c);this._hasTarget=u,a=c}if(this._hasTarget){let{camera:s,ellipsoid:c}=t,u=c.geodeticSurfaceNormal(a,this._axis),f=h.negate(u,this._axis);if(this.orbitEnabled){let d=this._dragDelta.x/r;d=I.clamp(d,-this.maximumMovementRatio,this.maximumMovementRatio),d*=this.orbitMagnitude*I.TWO_PI,this.orbit(s,a,f,d,n,c)}if(this.tiltEnabled){let d=this._dragDelta.y/o;d=I.clamp(d,-this.maximumMovementRatio,this.maximumMovementRatio),d*=this.tiltMagnitude*I.PI,this.tilt(s,a,f,d,n,c)}}this._lastUpdateTime=An(),this._dragDelta.x=0,this._dragDelta.y=0}},UMe=wre;var Ire=class e{static _getDefaultDragInputs(){return[Object.freeze({button:sc.MIDDLE})]}static _getDefaultScrollInputs(){return[ln.WHEEL]}constructor(t=H.EMPTY_OBJECT){this._enabled=!0,this._handler=void 0,this._lastUpdateTime=void 0,this.usePointerPosition=!1,this.dragInputs=t.dragInputs??e._getDefaultDragInputs(),this.scrollInputs=t.scrollInputs??e._getDefaultScrollInputs(),this._dragInputState=void 0,this._dragDelta=new k,this._scrollDelta=0,this._zoomInputVelocity=0,this._screenSpaceScrollPosition=new k,this._screenSpaceDragPosition=new k,this._screenSpaceOrigin=new k,this.zoomSensitivity=.2,this.pickWorldPosition=n0,this.zoomDistanceRatio=.4,this.inertiaEnabled=!1,this.inertialDecay=6,this.minimumZoomDistance=0,this.maximumZoomDistance=1e5,this.minimumZoomVelocity=I.EPSILON20,this.maximumZoomVelocity=1,this.dampingEnabled=!0,this.zoomAnimationDuration=.45,this._target=new h,this._zoomDirection=new h,this._zoomDampenedResults={velocity:0,value:0}}get enabled(){return this._enabled}set enabled(t){this._enabled=t,t?(this._lastUpdateTime=An(),this._scrollDelta=0,this._dragDelta.x=0,this._dragDelta.y=0):l(this._dragInputState)&&(this._dragInputState.isDragging=!1)}get isDragging(){return l(this._dragInputState)&&this._dragInputState.isDragging}connectedCallback(t){let n=new os(t);this._handler=n;for(let i of this.scrollInputs)n.setInputAction(this._handleZoom.bind(this),i);n.setInputAction(this._handleZoomPosition.bind(this),ln.MOUSE_MOVE),this._dragInputState=i0.registerDragInputBindings(n,this.dragInputs,{start:this._handleStartDrag.bind(this),change:this._handleDrag.bind(this)})}disconnectedCallback(t){let n=this._handler;l(n)&&!n.isDestroyed()&&n.destroy()}firstUpdate(){this._lastUpdateTime=An(),this._scrollDelta=0,this._dragDelta.x=0,this._dragDelta.y=0}get zoomDistance(){return this._zoomDampenedResults.value}get zoomVelocity(){return this._zoomDampenedResults.velocity}set zoomVelocity(t){this._zoomDampenedResults.velocity=t}update(t){let i=(An()-this._lastUpdateTime)*Un.SECONDS_PER_MILLISECOND,{canvas:r}=t,{clientWidth:o,clientHeight:a}=r;if(i===0||o===0||a===0){this._lastUpdateTime=An(),this._scrollDelta=0,this._dragDelta.x=0,this._dragDelta.y=0;return}let s=this._scrollDelta+this._dragDelta.y;if(s===0&&this.inertiaEnabled){let A=Math.exp(-this.inertialDecay*i);this._zoomInputVelocity*=A,s=this._zoomInputVelocity*i}if(Math.abs(this.zoomVelocity)<this.minimumZoomVelocity&&s<=I.EPSILON3&&s>=-I.EPSILON3&&this.zoomVelocity<=I.EPSILON3){this._lastUpdateTime=An(),this._scrollDelta=0,this._dragDelta.x=0,this._dragDelta.y=0,this.zoomVelocity=0;return}this._zoomInputVelocity=I.clamp(s/i,-this.maximumZoomVelocity,this.maximumZoomVelocity);let{camera:c,ellipsoid:u}=t,f=c.direction,d=h.magnitude(c.positionWC)-u.maximumRadius,p=this.isDragging?this._screenSpaceDragPosition:this._screenSpaceScrollPosition;this.useDragPosition||(p=this._screenSpaceOrigin,p.x=o/2,p.y=a/2);let g=this.pickWorldPosition(t,p,this._target);l(g)&&(f=h.subtract(g,c.positionWC,this._zoomDirection),f=h.normalize(f,this._zoomDirection),d=h.distance(g,c.positionWC)),d=I.clamp(d,d>0?this.minimumZoomDistance:-this.maximumZoomDistance,d>0?this.maximumZoomDistance:-this.minimumZoomDistance);let m=s*d*this.zoomDistanceRatio,y=this.dampingEnabled?this.zoomAnimationDuration:void 0;this._zoomDampenedResults=I.smoothDamp(0,m,this.zoomVelocity,i,void 0,y,this._zoomDampenedResults),c.move(f,this.zoomDistance),this._lastUpdateTime=An(),this._scrollDelta=0,this._dragDelta.x=0,this._dragDelta.y=0}_handleZoom(t){this._scrollDelta+=t*this.zoomSensitivity}_handleZoomPosition(t){this._screenSpaceScrollPosition.x=t.endPosition.x,this._screenSpaceScrollPosition.y=t.endPosition.y}_handleStartDrag(t){this.enabled&&(this._screenSpaceDragPosition.x=t.position.x,this._screenSpaceDragPosition.y=t.position.y,this._dragDelta.x=0,this._dragDelta.y=0)}_handleDrag(t){this._dragDelta.x+=t.endPosition.x-t.startPosition.x,this._dragDelta.y+=t.endPosition.y-t.startPosition.y}},VMe=Ire;var jMe={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",MAT2:"mat2",MAT3:"mat3",MAT4:"mat4"};Object.freeze(jMe);var HMe=jMe;var GMe={SIGX:"SIGX",SIGY:"SIGY",SIGZ:"SIGZ",VARX:"VARX",VARY:"VARY",VARZ:"VARZ",SIGR:"VARZ"};Object.freeze(GMe);var WMe=GMe;function lzt(e){async function t({data:i}){let r=[],o={id:i.id,result:void 0,error:void 0};self.CESIUM_BASE_URL=i.baseUrl;try{let a=await e(i.parameters,r);o.result=a}catch(a){a instanceof Error?o.error={name:a.name,message:a.message,stack:a.stack}:o.error=a}i.canTransferArrayBuffer||(r.length=0);try{postMessage(o,r)}catch(a){o.result=void 0,o.error=`postMessage failed with error: ${m0(a)}
|
|
with responseMessage: ${JSON.stringify(o)}`,postMessage(o)}}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 qMe=lzt;globalThis.CESIUM_VERSION="1.144.0";var UO;typeof ko<"u"&&(UO=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,r=t.jQuery,o=t.JSON;r||typeof jQuery>"u"||(r=jQuery),(function(a){a(t.ko={})})(function(a,s){function c(_,v){return _===null||typeof _ in y?_===v:!1}function u(_,v){var S;return function(){S||(S=m.a.setTimeout(function(){S=e,_()},v))}}function f(_,v){var S;return function(){clearTimeout(S),S=m.a.setTimeout(_,v)}}function d(_,v){v&&v!=="change"?v==="beforeChange"?this.pc(_):this.gb(_,v):this.qc(_)}function p(_,v){v!==null&&v.s&&v.s()}function g(_,v){var S=this.qd,P=S[C];P.ra||(this.Qb&&this.mb[v]?(S.uc(v,_,this.mb[v]),this.mb[v]=null,--this.Qb):P.I[v]||S.uc(v,_,P.J?{da:_}:S.$c(_)),_.Ja&&_.gd())}var m=typeof a<"u"?a:{};m.b=function(_,v){for(var S=_.split("."),P=m,L=0;L<S.length-1;L++)P=P[S[L]];P[S[S.length-1]]=v},m.L=function(_,v,S){_[v]=S},m.version="3.5.1",m.b("version",m.version),m.options={deferUpdates:!1,useOnlyNativeEvents:!1,foreachHidesDestroyed:!1},m.a=(function(){function _(q,J){for(var Z in q)L.call(q,Z)&&J(Z,q[Z])}function v(q,J){if(J)for(var Z in J)L.call(J,Z)&&(q[Z]=J[Z]);return q}function S(q,J){return q.__proto__=J,q}function P(q,J,Z,ce){var Ae=q[J].match(W)||[];m.a.D(Z.match(W),function(le){m.a.Na(Ae,le,ce)}),q[J]=Ae.join(" ")}var L=Object.prototype.hasOwnProperty,F={__proto__:[]}instanceof Array,V=typeof Symbol=="function",z={},j={};z[i&&/Firefox\/2/i.test(i.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"],z.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "),_(z,function(q,J){if(J.length)for(var Z=0,ce=J.length;Z<ce;Z++)j[J[Z]]=q});var B={propertychange:!0},G=n&&(function(){for(var q=3,J=n.createElement("div"),Z=J.getElementsByTagName("i");J.innerHTML="<!--[if gt IE "+ ++q+"]><i></i><![endif]-->",Z[0];);return 4<q?q:e})(),W=/\S+/g,Q;return{Jc:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],D:function(q,J,Z){for(var ce=0,Ae=q.length;ce<Ae;ce++)J.call(Z,q[ce],ce,q)},A:typeof Array.prototype.indexOf=="function"?function(q,J){return Array.prototype.indexOf.call(q,J)}:function(q,J){for(var Z=0,ce=q.length;Z<ce;Z++)if(q[Z]===J)return Z;return-1},Lb:function(q,J,Z){for(var ce=0,Ae=q.length;ce<Ae;ce++)if(J.call(Z,q[ce],ce,q))return q[ce];return e},Pa:function(q,J){var Z=m.a.A(q,J);0<Z?q.splice(Z,1):Z===0&&q.shift()},wc:function(q){var J=[];return q&&m.a.D(q,function(Z){0>m.a.A(J,Z)&&J.push(Z)}),J},Mb:function(q,J,Z){var ce=[];if(q)for(var Ae=0,le=q.length;Ae<le;Ae++)ce.push(J.call(Z,q[Ae],Ae));return ce},jb:function(q,J,Z){var ce=[];if(q)for(var Ae=0,le=q.length;Ae<le;Ae++)J.call(Z,q[Ae],Ae)&&ce.push(q[Ae]);return ce},Nb:function(q,J){if(J instanceof Array)q.push.apply(q,J);else for(var Z=0,ce=J.length;Z<ce;Z++)q.push(J[Z]);return q},Na:function(q,J,Z){var ce=m.a.A(m.a.bc(q),J);0>ce?Z&&q.push(J):Z||q.splice(ce,1)},Ba:F,extend:v,setPrototypeOf:S,Ab:F?S:v,P:_,Ga:function(q,J,Z){if(!q)return q;var ce={},Ae;for(Ae in q)L.call(q,Ae)&&(ce[Ae]=J.call(Z,q[Ae],Ae,q));return ce},Tb:function(q){for(;q.firstChild;)m.removeNode(q.firstChild)},Yb:function(q){q=m.a.la(q);for(var J=(q[0]&&q[0].ownerDocument||n).createElement("div"),Z=0,ce=q.length;Z<ce;Z++)J.appendChild(m.oa(q[Z]));return J},Ca:function(q,J){for(var Z=0,ce=q.length,Ae=[];Z<ce;Z++){var le=q[Z].cloneNode(!0);Ae.push(J?m.oa(le):le)}return Ae},va:function(q,J){if(m.a.Tb(q),J)for(var Z=0,ce=J.length;Z<ce;Z++)q.appendChild(J[Z])},Xc:function(q,J){var Z=q.nodeType?[q]:q;if(0<Z.length){for(var ce=Z[0],Ae=ce.parentNode,le=0,Ce=J.length;le<Ce;le++)Ae.insertBefore(J[le],ce);for(le=0,Ce=Z.length;le<Ce;le++)m.removeNode(Z[le])}},Ua:function(q,J){if(q.length){for(J=J.nodeType===8&&J.parentNode||J;q.length&&q[0].parentNode!==J;)q.splice(0,1);for(;1<q.length&&q[q.length-1].parentNode!==J;)q.length--;if(1<q.length){var Z=q[0],ce=q[q.length-1];for(q.length=0;Z!==ce;)q.push(Z),Z=Z.nextSibling;q.push(ce)}}return q},Zc:function(q,J){7>G?q.setAttribute("selected",J):q.selected=J},Db:function(q){return q===null||q===e?"":q.trim?q.trim():q.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},Ud:function(q,J){return q=q||"",J.length>q.length?!1:q.substring(0,J.length)===J},vd:function(q,J){if(q===J)return!0;if(q.nodeType===11)return!1;if(J.contains)return J.contains(q.nodeType!==1?q.parentNode:q);if(J.compareDocumentPosition)return(J.compareDocumentPosition(q)&16)==16;for(;q&&q!=J;)q=q.parentNode;return!!q},Sb:function(q){return m.a.vd(q,q.ownerDocument.documentElement)},kd:function(q){return!!m.a.Lb(q,m.a.Sb)},R:function(q){return q&&q.tagName&&q.tagName.toLowerCase()},Ac:function(q){return m.onError?function(){try{return q.apply(this,arguments)}catch(J){throw m.onError&&m.onError(J),J}}:q},setTimeout:function(q,J){return setTimeout(m.a.Ac(q),J)},Gc:function(q){setTimeout(function(){throw m.onError&&m.onError(q),q},0)},B:function(q,J,Z){var ce=m.a.Ac(Z);if(Z=B[J],m.options.useOnlyNativeEvents||Z||!r)if(Z||typeof q.addEventListener!="function")if(typeof q.attachEvent<"u"){var Ae=function(Ce){ce.call(q,Ce)},le="on"+J;q.attachEvent(le,Ae),m.a.K.za(q,function(){q.detachEvent(le,Ae)})}else throw Error("Browser doesn't support addEventListener or attachEvent");else q.addEventListener(J,ce,!1);else Q||(Q=typeof r(q).on=="function"?"on":"bind"),r(q)[Q](J,ce)},Fb:function(q,J){if(!q||!q.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var Z;if(m.a.R(q)==="input"&&q.type&&J.toLowerCase()=="click"?(Z=q.type,Z=Z=="checkbox"||Z=="radio"):Z=!1,m.options.useOnlyNativeEvents||!r||Z)if(typeof n.createEvent=="function")if(typeof q.dispatchEvent=="function")Z=n.createEvent(j[J]||"HTMLEvents"),Z.initEvent(J,!0,!0,t,0,0,0,0,0,!1,!1,!1,!1,0,q),q.dispatchEvent(Z);else throw Error("The supplied element doesn't support dispatchEvent");else if(Z&&q.click)q.click();else if(typeof q.fireEvent<"u")q.fireEvent("on"+J);else throw Error("Browser doesn't support triggering events");else r(q).trigger(J)},f:function(q){return m.O(q)?q():q},bc:function(q){return m.O(q)?q.v():q},Eb:function(q,J,Z){var ce;J&&(typeof q.classList=="object"?(ce=q.classList[Z?"add":"remove"],m.a.D(J.match(W),function(Ae){ce.call(q.classList,Ae)})):typeof q.className.baseVal=="string"?P(q.className,"baseVal",J,Z):P(q,"className",J,Z))},Bb:function(q,J){var Z=m.a.f(J);(Z===null||Z===e)&&(Z="");var ce=m.h.firstChild(q);!ce||ce.nodeType!=3||m.h.nextSibling(ce)?m.h.va(q,[q.ownerDocument.createTextNode(Z)]):ce.data=Z,m.a.Ad(q)},Yc:function(q,J){if(q.name=J,7>=G)try{var Z=q.name.replace(/[&<>'"]/g,function(ce){return"&#"+ce.charCodeAt(0)+";"});q.mergeAttributes(n.createElement("<input name='"+Z+"'/>"),!1)}catch{}},Ad:function(q){9<=G&&(q=q.nodeType==1?q:q.parentNode,q.style&&(q.style.zoom=q.style.zoom))},wd:function(q){if(G){var J=q.style.width;q.style.width=0,q.style.width=J}},Pd:function(q,J){q=m.a.f(q),J=m.a.f(J);for(var Z=[],ce=q;ce<=J;ce++)Z.push(ce);return Z},la:function(q){for(var J=[],Z=0,ce=q.length;Z<ce;Z++)J.push(q[Z]);return J},Da:function(q){return V?Symbol(q):q},Zd:G===6,$d:G===7,W:G,Lc:function(q,J){for(var Z=m.a.la(q.getElementsByTagName("input")).concat(m.a.la(q.getElementsByTagName("textarea"))),ce=typeof J=="string"?function(Ce){return Ce.name===J}:function(Ce){return J.test(Ce.name)},Ae=[],le=Z.length-1;0<=le;le--)ce(Z[le])&&Ae.push(Z[le]);return Ae},Nd:function(q){return typeof q=="string"&&(q=m.a.Db(q))?o&&o.parse?o.parse(q):new Function("return "+q)():null},hc:function(q,J,Z){if(!o||!o.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 o.stringify(m.a.f(q),J,Z)},Od:function(q,J,Z){Z=Z||{};var ce=Z.params||{},Ae=Z.includeFields||this.Jc,le=q;if(typeof q=="object"&&m.a.R(q)==="form")for(var le=q.action,Ce=Ae.length-1;0<=Ce;Ce--)for(var ye=m.a.Lc(q,Ae[Ce]),ve=ye.length-1;0<=ve;ve--)ce[ye[ve].name]=ye[ve].value;J=m.a.f(J);var Ie=n.createElement("form");Ie.style.display="none",Ie.action=le,Ie.method="post";for(var Le in J)q=n.createElement("input"),q.type="hidden",q.name=Le,q.value=m.a.hc(m.a.f(J[Le])),Ie.appendChild(q);_(ce,function($e,Ye){var yt=n.createElement("input");yt.type="hidden",yt.name=$e,yt.value=Ye,Ie.appendChild(yt)}),n.body.appendChild(Ie),Z.submitter?Z.submitter(Ie):Ie.submit(),setTimeout(function(){Ie.parentNode.removeChild(Ie)},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 v=this;if(arguments.length===1)return function(){return v.apply(_,arguments)};var S=Array.prototype.slice.call(arguments,1);return function(){var P=S.slice(0);return P.push.apply(P,arguments),v.apply(_,P)}}),m.a.g=new function(){var _=0,v="__ko__"+new Date().getTime(),S={},P,L;return m.a.W?(P=function(F,V){var z=F[v];if(!z||z==="null"||!S[z]){if(!V)return e;z=F[v]="ko"+_++,S[z]={}}return S[z]},L=function(F){var V=F[v];return V?(delete S[V],F[v]=null,!0):!1}):(P=function(F,V){var z=F[v];return!z&&V&&(z=F[v]={}),z},L=function(F){return F[v]?(delete F[v],!0):!1}),{get:function(F,V){var z=P(F,!1);return z&&z[V]},set:function(F,V,z){(F=P(F,z!==e))&&(F[V]=z)},Ub:function(F,V,z){return F=P(F,!0),F[V]||(F[V]=z)},clear:L,Z:function(){return _+++v}}},m.b("utils.domData",m.a.g),m.b("utils.domData.clear",m.a.g.clear),m.a.K=new function(){function _(V,z){var j=m.a.g.get(V,P);return j===e&&z&&(j=[],m.a.g.set(V,P,j)),j}function v(V){var z=_(V,!1);if(z)for(var z=z.slice(0),j=0;j<z.length;j++)z[j](V);m.a.g.clear(V),m.a.K.cleanExternalData(V),F[V.nodeType]&&S(V.childNodes,!0)}function S(V,z){for(var j=[],B,G=0;G<V.length;G++)if((!z||V[G].nodeType===8)&&(v(j[j.length]=B=V[G]),V[G]!==B))for(;G--&&m.a.A(j,V[G])==-1;);}var P=m.a.g.Z(),L={1:!0,8:!0,9:!0},F={1:!0,9:!0};return{za:function(V,z){if(typeof z!="function")throw Error("Callback must be a function");_(V,!0).push(z)},yb:function(V,z){var j=_(V,!1);j&&(m.a.Pa(j,z),j.length==0&&m.a.g.set(V,P,e))},oa:function(V){return m.u.G(function(){L[V.nodeType]&&(v(V),F[V.nodeType]&&S(V.getElementsByTagName("*")))}),V},removeNode:function(V){m.oa(V),V.parentNode&&V.parentNode.removeChild(V)},cleanExternalData:function(V){r&&typeof r.cleanData=="function"&&r.cleanData([V])}}},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,"",""],v=[1,"<table>","</table>"],S=[3,"<table><tbody><tr>","</tr></tbody></table>"],P=[1,"<select multiple='multiple'>","</select>"],L={thead:v,tbody:v,tfoot:v,tr:[2,"<table><tbody>","</tbody></table>"],td:S,th:S,option:P,optgroup:P},F=8>=m.a.W;m.a.ua=function(V,z){var j;if(r){if(r.parseHTML)j=r.parseHTML(V,z)||[];else if((j=r.clean([V],z))&&j[0]){for(var B=j[0];B.parentNode&&B.parentNode.nodeType!==11;)B=B.parentNode;B.parentNode&&B.parentNode.removeChild(B)}}else{(j=z)||(j=n);var B=j.parentWindow||j.defaultView||t,G=m.a.Db(V).toLowerCase(),W=j.createElement("div"),Q;for(Q=(G=G.match(/^(?:\x3c!--.*?--\x3e\s*?)*?<([a-z]+)[\s>]/))&&L[G[1]]||_,G=Q[0],Q="ignored<div>"+Q[1]+V+Q[2]+"</div>",typeof B.innerShiv=="function"?W.appendChild(B.innerShiv(Q)):(F&&j.body.appendChild(W),W.innerHTML=Q,F&&W.parentNode.removeChild(W));G--;)W=W.lastChild;j=m.a.la(W.lastChild.childNodes)}return j},m.a.Md=function(V,z){var j=m.a.ua(V,z);return j.length&&j[0].parentElement||m.a.Yb(j)},m.a.fc=function(V,z){if(m.a.Tb(V),z=m.a.f(z),z!==null&&z!==e)if(typeof z!="string"&&(z=z.toString()),r)r(V).html(z);else for(var j=m.a.ua(z,V.ownerDocument),B=0;B<j.length;B++)V.appendChild(j[B])}})(),m.b("utils.parseHtmlFragment",m.a.ua),m.b("utils.setHtml",m.a.fc),m.aa=(function(){function _(S,P){if(S){if(S.nodeType==8){var L=m.aa.Uc(S.nodeValue);L!=null&&P.push({ud:S,Kd:L})}else if(S.nodeType==1)for(var L=0,F=S.childNodes,V=F.length;L<V;L++)_(F[L],P)}}var v={};return{Xb:function(S){if(typeof S!="function")throw Error("You can only pass a function to ko.memoization.memoize()");var P=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);return v[P]=S,"<!--[ko_memo:"+P+"]-->"},bd:function(S,P){var L=v[S];if(L===e)throw Error("Couldn't find any memo with ID "+S+". Perhaps it's already been unmemoized.");try{return L.apply(null,P||[]),!0}finally{delete v[S]}},cd:function(S,P){var L=[];_(S,L);for(var F=0,V=L.length;F<V;F++){var z=L[F].ud,j=[z];P&&m.a.Nb(j,P),m.aa.bd(L[F].Kd,j),z.nodeValue="",z.parentNode&&z.parentNode.removeChild(z)}},Uc:function(S){return(S=S.match(/^\[ko_memo\:(.*?)\]$/))?S[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(L){for(var z=L,j=0,B;V<L;)if(B=P[V++]){if(V>z){if(5e3<=++j){V=L,m.a.Gc(Error("'Too much recursion' after processing "+j+" task groups."));break}z=L}try{B()}catch(G){m.a.Gc(G)}}}}function v(){_(),V=L=P.length=0}var S,P=[],L=0,F=1,V=0;return t.MutationObserver?S=(function(z){var j=n.createElement("div");return new MutationObserver(z).observe(j,{attributes:!0}),function(){j.classList.toggle("foo")}})(v):S=n&&"onreadystatechange"in n.createElement("script")?function(z){var j=n.createElement("script");j.onreadystatechange=function(){j.onreadystatechange=null,n.documentElement.removeChild(j),j=null,z()},n.documentElement.appendChild(j)}:function(z){setTimeout(z,0)},{scheduler:S,zb:function(z){return L||m.na.scheduler(v),P[L++]=z,F++},cancel:function(z){z=z-(F-L),z>=V&&z<L&&(P[z]=null)},resetForTesting:function(){var z=L-V;return V=L=P.length=0,z},Sd:_}})(),m.b("tasks",m.na),m.b("tasks.schedule",m.na.zb),m.b("tasks.runEarly",m.na.Sd),m.Ta={throttle:function(_,v){_.throttleEvaluation=v;var S=null;return m.$({read:_,write:function(P){clearTimeout(S),S=m.a.setTimeout(function(){_(P)},v)}})},rateLimit:function(_,v){var S,P,L;typeof v=="number"?S=v:(S=v.timeout,P=v.method),_.Hb=!1,L=typeof P=="function"?P:P=="notifyWhenChangesStop"?f:u,_.ub(function(F){return L(F,S,v)})},deferred:function(_,v){if(v!==!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(S){var P,L=!1;return function(){if(!L){m.na.cancel(P),P=m.na.zb(S);try{L=!0,_.notifySubscribers(e,"dirty")}finally{L=!1}}}}))},notify:function(_,v){_.equalityComparer=v=="always"?null:c}};var y={undefined:1,boolean:1,number:1,string:1};m.b("extenders",m.Ta),m.ic=function(_,v,S){this.da=_,this.lc=v,this.mc=S,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,A),A.qb(this)};var A={qb:function(_){_.U={change:[]},_.sc=1},subscribe:function(_,v,S){var P=this;S=S||"change";var L=new m.ic(P,v?_.bind(v):_,function(){m.a.Pa(P.U[S],L),P.hb&&P.hb(S)});return P.Qa&&P.Qa(S),P.U[S]||(P.U[S]=[]),P.U[S].push(L),L},notifySubscribers:function(_,v){if(v=v||"change",v==="change"&&this.Gb(),this.Wa(v)){var S=v==="change"&&this.ed||this.U[v].slice(0);try{m.u.xc();for(var P=0,L;L=S[P];++P)L.Ib||L.lc(_)}finally{m.u.end()}}},ob:function(){return this.sc},Dd:function(_){return this.ob()!==_},Gb:function(){++this.sc},ub:function(_){var v=this,S=m.O(v),P,L,F,V,z;v.gb||(v.gb=v.notifySubscribers,v.notifySubscribers=d);var j=_(function(){v.Ja=!1,S&&V===v&&(V=v.nc?v.nc():v());var B=L||z&&v.sb(F,V);z=L=P=!1,B&&v.gb(F=V)});v.qc=function(B,G){G&&v.Ja||(z=!G),v.ed=v.U.change.slice(0),v.Ja=P=!0,V=B,j()},v.pc=function(B){P||(F=B,v.gb(B,"beforeChange"))},v.rc=function(){z=!0},v.gd=function(){v.sb(F,v.v(!0))&&(L=!0)}},Wa:function(_){return this.U[_]&&this.U[_].length},Bd:function(_){if(_)return this.U[_]&&this.U[_].length||0;var v=0;return m.a.P(this.U,function(S,P){S!=="dirty"&&(v+=P.length)}),v},sb:function(_,v){return!this.equalityComparer||!this.equalityComparer(_,v)},toString:function(){return"[object Object]"},extend:function(_){var v=this;return _&&m.a.P(_,function(S,P){var L=m.Ta[S];typeof L=="function"&&(v=L(v,P)||v)}),v}};m.L(A,"init",A.qb),m.L(A,"subscribe",A.subscribe),m.L(A,"extend",A.extend),m.L(A,"getSubscriptionsCount",A.Bd),m.a.Ba&&m.a.setPrototypeOf(A,Function.prototype),m.T.fn=A,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 _(F){S.push(P),P=F}function v(){P=S.pop()}var S=[],P,L=0;return{xc:_,end:v,cc:function(F){if(P){if(!m.Qc(F))throw Error("Only subscribable things can act as dependencies");P.od.call(P.pd,F,F.fd||(F.fd=++L))}},G:function(F,V,z){try{return _(),F.apply(V,z||[])}finally{v()}},qa:function(){if(P)return P.o.qa()},Va:function(){if(P)return P.o.Va()},Ya:function(){if(P)return P.Ya},o:function(){if(P)return P.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 b=m.a.Da("_latestValue");m.ta=function(_){function v(){return 0<arguments.length?(v.sb(v[b],arguments[0])&&(v.ya(),v[b]=arguments[0],v.xa()),this):(m.u.cc(v),v[b])}return v[b]=_,m.a.Ba||m.a.extend(v,m.T.fn),m.T.fn.qb(v),m.a.Ab(v,x),m.options.deferUpdates&&m.Ta.deferred(v,!0),v};var x={equalityComparer:c,v:function(){return this[b]},xa:function(){this.notifySubscribers(this[b],"spectate"),this.notifySubscribers(this[b])},ya:function(){this.notifySubscribers(this[b],"beforeChange")}};m.a.Ba&&m.a.setPrototypeOf(x,m.T.fn);var T=m.ta.Ma="__ko_proto__";x[T]=m.ta,m.O=function(_){if((_=typeof _=="function"&&_[T])&&_!==x[T]&&_!==m.o.fn[T])throw Error("Invalid object that looks like an observable; possibly from another Knockout instance");return!!_},m.Za=function(_){return typeof _=="function"&&(_[T]===x[T]||_[T]===m.o.fn[T]&&_.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",x),m.L(x,"peek",x.v),m.L(x,"valueHasMutated",x.xa),m.L(x,"valueWillMutate",x.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 v=this.v(),S=[],P=typeof _!="function"||m.O(_)?function(V){return V===_}:_,L=0;L<v.length;L++){var F=v[L];if(P(F)){if(S.length===0&&this.ya(),v[L]!==F)throw Error("Array modified during remove; cannot remove item");S.push(F),v.splice(L,1),L--}}return S.length&&this.xa(),S},removeAll:function(_){if(_===e){var v=this.v(),S=v.slice(0);return this.ya(),v.splice(0,v.length),this.xa(),S}return _?this.remove(function(P){return 0<=m.a.A(_,P)}):[]},destroy:function(_){var v=this.v(),S=typeof _!="function"||m.O(_)?function(F){return F===_}:_;this.ya();for(var P=v.length-1;0<=P;P--){var L=v[P];S(L)&&(L._destroy=!0)}this.xa()},destroyAll:function(_){return _===e?this.destroy(function(){return!0}):_?this.destroy(function(v){return 0<=m.a.A(_,v)}):[]},indexOf:function(_){var v=this();return m.a.A(v,_)},replace:function(_,v){var S=this.indexOf(_);0<=S&&(this.ya(),this.v()[S]=v,this.xa())},sorted:function(_){var v=this().slice(0);return _?v.sort(_):v.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 v=this.v();this.ya(),this.zc(v,_,arguments);var S=v[_].apply(v,arguments);return this.xa(),S===v?this:S}}),m.a.D(["slice"],function(_){m.Ha.fn[_]=function(){var v=this();return v[_].apply(v,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(_,v){function S(){function W(){if(z){var Q=[].concat(_.v()||[]),q;_.Wa("arrayChange")&&((!L||1<z)&&(L=m.a.Pb(j,Q,_.Ob)),q=L),j=Q,L=null,z=0,q&&q.length&&_.notifySubscribers(q,"arrayChange")}}P?W():(P=!0,V=_.subscribe(function(){++z},null,"spectate"),j=[].concat(_.v()||[]),L=null,F=_.subscribe(W))}if(_.Ob={},v&&typeof v=="object"&&m.a.extend(_.Ob,v),_.Ob.sparse=!0,!_.zc){var P=!1,L=null,F,V,z=0,j,B=_.Qa,G=_.hb;_.Qa=function(W){B&&B.call(_,W),W==="arrayChange"&&S()},_.hb=function(W){G&&G.call(_,W),W!=="arrayChange"||_.Wa("arrayChange")||(F&&F.s(),V&&V.s(),V=F=null,P=!1,j=e)},_.zc=function(W,Q,q){function J(Ie,Le,$e){return Z[Z.length]={status:Ie,value:Le,index:$e}}if(P&&!z){var Z=[],ce=W.length,Ae=q.length,le=0;switch(Q){case"push":le=ce;case"unshift":for(Q=0;Q<Ae;Q++)J("added",q[Q],le+Q);break;case"pop":le=ce-1;case"shift":ce&&J("deleted",W[le],le);break;case"splice":Q=Math.min(Math.max(0,0>q[0]?ce+q[0]:q[0]),ce);for(var ce=Ae===1?ce:Math.min(Q+(q[1]||0),ce),Ae=Q+Ae-2,le=Math.max(ce,Ae),Ce=[],ye=[],ve=2;Q<le;++Q,++ve)Q<ce&&ye.push(J("deleted",W[Q],Q)),Q<Ae&&Ce.push(J("added",q[ve],Q));m.a.Kc(ye,Ce);break;default:return}L=Z}}}};var C=m.a.Da("_state");m.o=m.$=function(_,v,S){function P(){if(0<arguments.length){if(typeof L=="function")L.apply(F.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 F.ra||m.u.cc(P),(F.ka||F.J&&P.Xa())&&P.ha(),F.X}if(typeof _=="object"?S=_:(S=S||{},_&&(S.read=_)),typeof S.read!="function")throw Error("Pass a function that returns the value of the ko.computed");var L=S.write,F={X:e,sa:!0,ka:!0,rb:!1,jc:!1,ra:!1,wb:!1,J:!1,Wc:S.read,nb:v||S.owner,l:S.disposeWhenNodeIsRemoved||S.l||null,Sa:S.disposeWhen||S.Sa,Rb:null,I:{},V:0,Ic:null};return P[C]=F,P.Nc=typeof L=="function",m.a.Ba||m.a.extend(P,m.T.fn),m.T.fn.qb(P),m.a.Ab(P,E),S.pure?(F.wb=!0,F.J=!0,m.a.extend(P,w)):S.deferEvaluation&&m.a.extend(P,D),m.options.deferUpdates&&m.Ta.deferred(P,!0),F.l&&(F.jc=!0,F.l.nodeType||(F.l=null)),F.J||S.deferEvaluation||P.ha(),F.l&&P.ja()&&m.a.K.za(F.l,F.Rb=function(){P.s()}),P};var E={equalityComparer:c,qa:function(){return this[C].V},Va:function(){var _=[];return m.a.P(this[C].I,function(v,S){_[S.Ka]=S.da}),_},Vb:function(_){if(!this[C].V)return!1;var v=this.Va();return m.a.A(v,_)!==-1?!0:!!m.a.Lb(v,function(S){return S.Vb&&S.Vb(_)})},uc:function(_,v,S){if(this[C].wb&&v===this)throw Error("A 'pure' computed must not be called recursively");this[C].I[_]=S,S.Ka=this[C].V++,S.La=v.ob()},Xa:function(){var _,v,S=this[C].I;for(_ in S)if(Object.prototype.hasOwnProperty.call(S,_)&&(v=S[_],this.Ia&&v.da.Ja||v.da.Dd(v.La)))return!0},Jd:function(){this.Ia&&!this[C].rb&&this.Ia(!1)},ja:function(){var _=this[C];return _.ka||0<_.V},Rd:function(){this.Ja?this[C].ka&&(this[C].sa=!0):this.Hc()},$c:function(_){if(_.Hb){var v=_.subscribe(this.Jd,this,"dirty"),S=_.subscribe(this.Rd,this);return{da:_,s:function(){v.s(),S.s()}}}return _.subscribe(this.Hc,this)},Hc:function(){var _=this,v=_.throttleEvaluation;v&&0<=v?(clearTimeout(this[C].Ic),this[C].Ic=m.a.setTimeout(function(){_.ha(!0)},v)):_.Ia?_.Ia(!0):_.ha(!0)},ha:function(_){var v=this[C],S=v.Sa,P=!1;if(!v.rb&&!v.ra){if(v.l&&!m.a.Sb(v.l)||S&&S()){if(!v.jc){this.s();return}}else v.jc=!1;v.rb=!0;try{P=this.zd(_)}finally{v.rb=!1}return P}},zd:function(_){var v=this[C],P=!1,S=v.wb?e:!v.V,P={qd:this,mb:v.I,Qb:v.V};m.u.xc({pd:P,od:g,o:this,Ya:S}),v.I={},v.V=0;var L=this.yd(v,P);return v.V?P=this.sb(v.X,L):(this.s(),P=!0),P&&(v.J?this.Gb():this.notifySubscribers(v.X,"beforeChange"),v.X=L,this.notifySubscribers(v.X,"spectate"),!v.J&&_&&this.notifySubscribers(v.X),this.rc&&this.rc()),S&&this.notifySubscribers(v.X,"awake"),P},yd:function(_,v){try{var S=_.Wc;return _.nb?S.call(_.nb):S()}finally{m.u.end(),v.Qb&&!_.J&&m.a.P(v.mb,p),_.sa=_.ka=!1}},v:function(_){var v=this[C];return(v.ka&&(_||!v.V)||v.J&&this.Xa())&&this.ha(),v.X},ub:function(_){m.T.fn.ub.call(this,_),this.nc=function(){return this[C].J||(this[C].sa?this.ha():this[C].ka=!1),this[C].X},this.Ia=function(v){this.pc(this[C].X),this[C].ka=!0,v&&(this[C].sa=!0),this.qc(this,!v)}},s:function(){var _=this[C];!_.J&&_.I&&m.a.P(_.I,function(v,S){S.s&&S.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)}},w={Qa:function(_){var v=this,S=v[C];if(!S.ra&&S.J&&_=="change"){if(S.J=!1,S.sa||v.Xa())S.I=null,S.V=0,v.ha()&&v.Gb();else{var P=[];m.a.P(S.I,function(L,F){P[F.Ka]=L}),m.a.D(P,function(L,F){var V=S.I[L],z=v.$c(V.da);z.Ka=F,z.La=V.La,S.I[L]=z}),v.Xa()&&v.ha()&&v.Gb()}S.ra||v.notifySubscribers(S.X,"awake")}},hb:function(_){var v=this[C];v.ra||_!="change"||this.Wa("change")||(m.a.P(v.I,function(S,P){P.s&&(v.I[S]={da:P.da,Ka:P.Ka,La:P.La},P.s())}),v.J=!0,this.notifySubscribers(e,"asleep"))},ob:function(){var _=this[C];return _.J&&(_.sa||this.Xa())&&this.ha(),m.T.fn.ob.call(this)}},D={Qa:function(_){_!="change"&&_!="beforeChange"||this.v()}};m.a.Ba&&m.a.setPrototypeOf(E,m.T.fn);var R=m.ta.Ma;E[R]=m.o,m.Oc=function(_){return typeof _=="function"&&_[R]===E[R]},m.Fd=function(_){return m.Oc(_)&&_[C]&&_[C].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",E),m.L(E,"peek",E.v),m.L(E,"dispose",E.s),m.L(E,"isActive",E.ja),m.L(E,"getDependenciesCount",E.qa),m.L(E,"getDependencies",E.Va),m.xb=function(_,v){return typeof _=="function"?m.o(_,v,{pure:!0}):(_=m.a.extend({},_),_.pure=!0,m.o(_,v))},m.b("pureComputed",m.xb),(function(){function _(P,L,F){if(F=F||new S,P=L(P),typeof P!="object"||P===null||P===e||P instanceof RegExp||P instanceof Date||P instanceof String||P instanceof Number||P instanceof Boolean)return P;var V=P instanceof Array?[]:{};return F.save(P,V),v(P,function(z){var j=L(P[z]);switch(typeof j){case"boolean":case"number":case"string":case"function":V[z]=j;break;case"object":case"undefined":var B=F.get(j);V[z]=B!==e?B:_(j,L,F)}}),V}function v(P,L){if(P instanceof Array){for(var F=0;F<P.length;F++)L(F);typeof P.toJSON=="function"&&L("toJSON")}else for(F in P)L(F)}function S(){this.keys=[],this.values=[]}m.ad=function(P){if(arguments.length==0)throw Error("When calling ko.toJS, pass the object you want to convert.");return _(P,function(L){for(var F=0;m.O(L)&&10>F;F++)L=L();return L})},m.toJSON=function(P,L,F){return P=m.ad(P),m.a.hc(P,L,F)},S.prototype={constructor:S,save:function(P,L){var F=m.a.A(this.keys,P);0<=F?this.values[F]=L:(this.keys.push(P),this.values.push(L))},get:function(P){return P=m.a.A(this.keys,P),0<=P?this.values[P]:e}}})(),m.b("toJS",m.ad),m.b("toJSON",m.toJSON),m.Wd=function(_,v,S){function P(L){var F=m.xb(_,S).extend({ma:"always"}),V=F.subscribe(function(z){z&&(V.s(),L(z))});return F.notifySubscribers(F.v()),V}return typeof Promise!="function"||v?P(v.bind(S)):new Promise(P)},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(_,v,S){switch(m.a.R(_)){case"option":typeof v=="string"?(m.a.g.set(_,m.c.options.$b,e),"__ko__hasDomDataOptionValue__"in _&&delete _.__ko__hasDomDataOptionValue__,_.value=v):(m.a.g.set(_,m.c.options.$b,v),_.__ko__hasDomDataOptionValue__=!0,_.value=typeof v=="number"?v:"");break;case"select":(v===""||v===null)&&(v=e);for(var P=-1,L=0,F=_.options.length,V;L<F;++L)if(V=m.w.M(_.options[L]),V==v||V===""&&v===e){P=L;break}(S||0<=P||v===e&&1<_.size)&&(_.selectedIndex=P,m.a.W===6&&m.a.setTimeout(function(){_.selectedIndex=P},0));break;default:(v===null||v===e)&&(v=""),_.value=v}}}})(),m.b("selectExtensions",m.w),m.b("selectExtensions.readValue",m.w.M),m.b("selectExtensions.writeValue",m.w.cb),m.m=(function(){function _(z){z=m.a.Db(z),z.charCodeAt(0)===123&&(z=z.slice(1,-1)),z+=`
|
|
,`;var j=[],B=z.match(P),G,W=[],Q=0;if(1<B.length){for(var q=0,J;J=B[q];++q){var Z=J.charCodeAt(0);if(Z===44){if(0>=Q){j.push(G&&W.length?{key:G,value:W.join("")}:{unknown:G||W.join("")}),G=Q=0,W=[];continue}}else if(Z===58){if(!Q&&!G&&W.length===1){G=W.pop();continue}}else{if(Z===47&&1<J.length&&(J.charCodeAt(1)===47||J.charCodeAt(1)===42))continue;Z===47&&q&&1<J.length?(Z=B[q-1].match(L))&&!F[Z[0]]&&(z=z.substr(z.indexOf(J)+1),B=z.match(P),q=-1,J="/"):Z===40||Z===123||Z===91?++Q:Z===41||Z===125||Z===93?--Q:G||W.length||Z!==34&&Z!==39||(J=J.slice(1,-1))}W.push(J)}if(0<Q)throw Error("Unbalanced parentheses, braces, or brackets")}return j}var v=["true","false","null","undefined"],S=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,P=RegExp(`"(?:\\\\.|[^"])*"|'(?:\\\\.|[^'])*'|\`(?:\\\\.|[^\`])*\`|/\\*(?:[^*]|\\*+[^*/])*\\*+/|//.*
|
|
|/(?:\\\\.|[^/])+/w*|[^\\s:,/][^,"'\`{}()/:[\\]]*[^\\s,"'\`{}()/:[\\]]|[^\\s]`,"g"),L=/[\])"'A-Za-z0-9_$]+$/,F={in:1,return:1,typeof:1},V={};return{Ra:[],wa:V,ac:_,vb:function(z,j){function B(Z,ce){var Ae;if(!q){var le=m.getBindingHandler(Z);if(le&&le.preprocess&&!(ce=le.preprocess(ce,Z,B)))return;(le=V[Z])&&(Ae=ce,0<=m.a.A(v,Ae)?Ae=!1:(le=Ae.match(S),Ae=le===null?!1:le[1]?"Object("+le[1]+")"+le[2]:Ae),le=Ae),le&&W.push("'"+(typeof V[Z]=="string"?V[Z]:Z)+"':function(_z){"+Ae+"=_z}")}Q&&(ce="function(){return "+ce+" }"),G.push("'"+Z+"':"+ce)}j=j||{};var G=[],W=[],Q=j.valueAccessors,q=j.bindingParams,J=typeof z=="string"?_(z):z;return m.a.D(J,function(Z){B(Z.key||Z.unknown,Z.value)}),W.length&&B("_ko_property_writers","{"+W.join(",")+" }"),G.join(",")},Id:function(z,j){for(var B=0;B<z.length;B++)if(z[B].key==j)return!0;return!1},eb:function(z,j,B,G,W){z&&m.O(z)?!m.Za(z)||W&&z.v()===G||z(G):(z=j.get("_ko_property_writers"))&&z[B]&&z[B](G)}}})(),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 _(B){return B.nodeType==8&&F.test(L?B.text:B.nodeValue)}function v(B){return B.nodeType==8&&V.test(L?B.text:B.nodeValue)}function S(B,G){for(var W=B,Q=1,q=[];W=W.nextSibling;){if(v(W)&&(m.a.g.set(W,j,!0),Q--,Q===0))return q;q.push(W),_(W)&&Q++}if(!G)throw Error("Cannot find closing comment tag to match: "+B.nodeValue);return null}function P(B,G){var W=S(B,G);return W?0<W.length?W[W.length-1].nextSibling:B.nextSibling:null}var L=n&&n.createComment("test").text==="<!--test-->",F=L?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,V=L?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,z={ul:!0,ol:!0},j="__ko_matchedEndComment__";m.h={ea:{},childNodes:function(B){return _(B)?S(B):B.childNodes},Ea:function(B){if(_(B)){B=m.h.childNodes(B);for(var G=0,W=B.length;G<W;G++)m.removeNode(B[G])}else m.a.Tb(B)},va:function(B,G){if(_(B)){m.h.Ea(B);for(var W=B.nextSibling,Q=0,q=G.length;Q<q;Q++)W.parentNode.insertBefore(G[Q],W)}else m.a.va(B,G)},Vc:function(B,G){var W;_(B)?(W=B.nextSibling,B=B.parentNode):W=B.firstChild,W?G!==W&&B.insertBefore(G,W):B.appendChild(G)},Wb:function(B,G,W){W?(W=W.nextSibling,_(B)&&(B=B.parentNode),W?G!==W&&B.insertBefore(G,W):B.appendChild(G)):m.h.Vc(B,G)},firstChild:function(B){if(_(B))return!B.nextSibling||v(B.nextSibling)?null:B.nextSibling;if(B.firstChild&&v(B.firstChild))throw Error("Found invalid end comment, as the first child of "+B);return B.firstChild},nextSibling:function(B){if(_(B)&&(B=P(B)),B.nextSibling&&v(B.nextSibling)){var G=B.nextSibling;if(v(G)&&!m.a.g.get(G,j))throw Error("Found end comment without a matching opening comment, as child of "+B);return null}return B.nextSibling},Cd:_,Vd:function(B){return(B=(L?B.text:B.nodeValue).match(F))?B[1]:null},Sc:function(B){if(z[m.a.R(B)]){var G=B.firstChild;if(G)do if(G.nodeType===1){var W;W=G.firstChild;var Q=null;if(W)do if(Q)Q.push(W);else if(_(W)){var q=P(W,!0);q?W=q:Q=[W]}else v(W)&&(Q=[W]);while(W=W.nextSibling);if(W=Q)for(Q=G.nextSibling,q=0;q<W.length;q++)Q?B.insertBefore(W[q],Q):B.appendChild(W[q])}while(G=G.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(_,v){var S=this.getBindingsString(_,v),S=S?this.parseBindingsString(S,v,_):null;return m.j.tc(S,_,v,!1)},getBindingAccessors:function(_,v){var S=this.getBindingsString(_,v),S=S?this.parseBindingsString(S,v,_,{valueAccessors:!0}):null;return m.j.tc(S,_,v,!0)},getBindingsString:function(_){switch(_.nodeType){case 1:return _.getAttribute("data-bind");case 8:return m.h.Vd(_);default:return null}},parseBindingsString:function(_,v,S,P){try{var L=this.nd,F=_+(P&&P.valueAccessors||""),V;if(!(V=L[F])){var z,j="with($context){with($data||{}){return{"+m.m.vb(_,P)+"}}}";z=new Function("$context","$element",j),V=L[F]=z}return V(v,S)}catch(B){throw B.message=`Unable to parse bindings.
|
|
Bindings value: `+_+`
|
|
Message: `+B.message,B}}}),m.ga.instance=new m.ga})(),m.b("bindingProvider",m.ga),(function(){function _(le){var Ce=(le=m.a.g.get(le,Ae))&&le.N;Ce&&(le.N=null,Ce.Tc())}function v(le,Ce,ye){this.node=le,this.yc=Ce,this.kb=[],this.H=!1,Ce.N||m.a.K.za(le,_),ye&&ye.N&&(ye.N.kb.push(le),this.Kb=ye)}function S(le){return function(){return le}}function P(le){return le()}function L(le){return m.a.Ga(m.u.G(le),function(Ce,ye){return function(){return le()[ye]}})}function F(le,Ce,ye){return typeof le=="function"?L(le.bind(null,Ce,ye)):m.a.Ga(le,S)}function V(le,Ce){return L(this.getBindings.bind(this,le,Ce))}function z(le,Ce){var ye=m.h.firstChild(Ce);if(ye){var ve,Ie=m.ga.instance,Le=Ie.preprocessNode;if(Le){for(;ve=ye;)ye=m.h.nextSibling(ve),Le.call(Ie,ve);ye=m.h.firstChild(Ce)}for(;ve=ye;)ye=m.h.nextSibling(ve),j(le,ve)}m.i.ma(Ce,m.i.H)}function j(le,Ce){var ye=le,ve=Ce.nodeType===1;ve&&m.h.Sc(Ce),(ve||m.ga.instance.nodeHasBindings(Ce))&&(ye=G(Ce,null,le).bindingContextForDescendants),ye&&!Z[m.a.R(Ce)]&&z(ye,Ce)}function B(le){var Ce=[],ye={},ve=[];return m.a.P(le,function Ie(Le){if(!ye[Le]){var $e=m.getBindingHandler(Le);$e&&($e.after&&(ve.push(Le),m.a.D($e.after,function(Ye){if(le[Ye]){if(m.a.A(ve,Ye)!==-1)throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+ve.join(", "));Ie(Ye)}}),ve.length--),Ce.push({key:Le,Mc:$e})),ye[Le]=!0}}),Ce}function G(le,Ce,ye){var ve=m.a.g.Ub(le,Ae,{}),Ie=ve.hd;if(!Ce){if(Ie)throw Error("You cannot apply bindings multiple times to the same element.");ve.hd=!0}Ie||(ve.context=ye),ve.Zb||(ve.Zb={});var Le;if(Ce&&typeof Ce!="function")Le=Ce;else{var $e=m.ga.instance,Ye=$e.getBindingAccessors||V,yt=m.$(function(){return(Le=Ce?Ce(ye,le):Ye.call($e,le,ye))&&(ye[Q]&&ye[Q](),ye[J]&&ye[J]()),Le},null,{l:le});Le&&yt.ja()||(yt=null)}var Ke=ye,we;if(Le){var We=function(){return m.a.Ga(yt?yt():Le,P)},Ct=yt?function(ct){return function(){return P(yt()[ct])}}:function(ct){return Le[ct]};We.get=function(ct){return Le[ct]&&P(Ct(ct))},We.has=function(ct){return ct in Le},m.i.H in Le&&m.i.subscribe(le,m.i.H,function(){var ct=(0,Le[m.i.H])();if(ct){var dn=m.h.childNodes(le);dn.length&&ct(dn,m.Ec(dn[0]))}}),m.i.pa in Le&&(Ke=m.i.Cb(le,ye),m.i.subscribe(le,m.i.pa,function(){var ct=(0,Le[m.i.pa])();ct&&m.h.firstChild(le)&&ct(le)})),ve=B(Le),m.a.D(ve,function(ct){var dn=ct.Mc.init,Ht=ct.Mc.update,bt=ct.key;if(le.nodeType===8&&!m.h.ea[bt])throw Error("The binding '"+bt+"' cannot be used with virtual elements");try{typeof dn=="function"&&m.u.G(function(){var Dt=dn(le,Ct(bt),We,Ke.$data,Ke);if(Dt&&Dt.controlsDescendantBindings){if(we!==e)throw Error("Multiple bindings ("+we+" and "+bt+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");we=bt}}),typeof Ht=="function"&&m.$(function(){Ht(le,Ct(bt),We,Ke.$data,Ke)},null,{l:le})}catch(Dt){throw Dt.message='Unable to process binding "'+bt+": "+Le[bt]+`"
|
|
Message: `+Dt.message,Dt}})}return ve=we===e,{shouldBindDescendants:ve,bindingContextForDescendants:ve&&Ke}}function W(le,Ce){return le&&le instanceof m.fa?le:new m.fa(le,e,e,Ce)}var Q=m.a.Da("_subscribable"),q=m.a.Da("_ancestorBindingInfo"),J=m.a.Da("_dataDependency");m.c={};var Z={script:!0,textarea:!0,template:!0};m.getBindingHandler=function(le){return m.c[le]};var ce={};m.fa=function(le,Ce,ye,ve,Ie){function Le(){var Ct=Ke?yt():yt,ct=m.a.f(Ct);return Ce?(m.a.extend($e,Ce),q in Ce&&($e[q]=Ce[q])):($e.$parents=[],$e.$root=ct,$e.ko=m),$e[Q]=we,Ye?ct=$e.$data:($e.$rawData=Ct,$e.$data=ct),ye&&($e[ye]=ct),ve&&ve($e,Ce,ct),Ce&&Ce[Q]&&!m.S.o().Vb(Ce[Q])&&Ce[Q](),We&&($e[J]=We),$e.$data}var $e=this,Ye=le===ce,yt=Ye?e:le,Ke=typeof yt=="function"&&!m.O(yt),we,We=Ie&&Ie.dataDependency;Ie&&Ie.exportDependencies?Le():(we=m.xb(Le),we.v(),we.ja()?we.equalityComparer=null:$e[Q]=e)},m.fa.prototype.createChildContext=function(le,Ce,ye,ve){if(!ve&&Ce&&typeof Ce=="object"&&(ve=Ce,Ce=ve.as,ye=ve.extend),Ce&&ve&&ve.noChildContext){var Ie=typeof le=="function"&&!m.O(le);return new m.fa(ce,this,null,function(Le){ye&&ye(Le),Le[Ce]=Ie?le():le},ve)}return new m.fa(le,this,Ce,function(Le,$e){Le.$parentContext=$e,Le.$parent=$e.$data,Le.$parents=($e.$parents||[]).slice(0),Le.$parents.unshift(Le.$parent),ye&&ye(Le)},ve)},m.fa.prototype.extend=function(le,Ce){return new m.fa(ce,this,null,function(ye){m.a.extend(ye,typeof le=="function"?le(ye):le)},Ce)};var Ae=m.a.g.Z();v.prototype.Tc=function(){this.Kb&&this.Kb.N&&this.Kb.N.sd(this.node)},v.prototype.sd=function(le){m.a.Pa(this.kb,le),!this.kb.length&&this.H&&this.Cc()},v.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(le,Ce,ye,ve,Ie){var Le=m.a.g.Ub(le,Ae,{});return Le.Fa||(Le.Fa=new m.T),Ie&&Ie.notifyImmediately&&Le.Zb[Ce]&&m.u.G(ye,ve,[le]),Le.Fa.subscribe(ye,ve,Ce)},ma:function(le,Ce){var ye=m.a.g.get(le,Ae);if(ye&&(ye.Zb[Ce]=!0,ye.Fa&&ye.Fa.notifySubscribers(le,Ce),Ce==m.i.H)){if(ye.N)ye.N.Cc();else if(ye.N===e&&ye.Fa&&ye.Fa.Wa(m.i.pa))throw Error("descendantsComplete event not supported for bindings on this node")}},Cb:function(le,Ce){var ye=m.a.g.Ub(le,Ae,{});return ye.N||(ye.N=new v(le,ye,Ce[q])),Ce[q]==ye?Ce:Ce.extend(function(ve){ve[q]=ye})}},m.Td=function(le){return(le=m.a.g.get(le,Ae))&&le.context},m.ib=function(le,Ce,ye){return le.nodeType===1&&m.h.Sc(le),G(le,Ce,W(ye))},m.ld=function(le,Ce,ye){return ye=W(ye),m.ib(le,F(Ce,ye,le),ye)},m.Oa=function(le,Ce){Ce.nodeType!==1&&Ce.nodeType!==8||z(W(le),Ce)},m.vc=function(le,Ce,ye){if(!r&&t.jQuery&&(r=t.jQuery),2>arguments.length){if(Ce=n.body,!Ce)throw Error("ko.applyBindings: could not find document.body; has the document been loaded?")}else if(!Ce||Ce.nodeType!==1&&Ce.nodeType!==8)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");j(W(le,ye),Ce)},m.Dc=function(le){return!le||le.nodeType!==1&&le.nodeType!==8?e:m.Td(le)},m.Ec=function(le){return(le=m.Dc(le))?le.$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 v(V,z){var j=Object.prototype.hasOwnProperty.call(L,V)?L[V]:_,B;j?j.subscribe(z):(j=L[V]=new m.T,j.subscribe(z),S(V,function(G,W){var Q=!(!W||!W.synchronous);F[V]={definition:G,Gd:Q},delete L[V],B||Q?j.notifySubscribers(G):m.na.zb(function(){j.notifySubscribers(G)})}),B=!0)}function S(V,z){P("getConfig",[V],function(j){j?P("loadComponent",[V,j],function(B){z(B,j)}):z(null,null)})}function P(V,z,j,B){B||(B=m.j.loaders.slice(0));var G=B.shift();if(G){var W=G[V];if(W){var Q=!1;if(W.apply(G,z.concat(function(q){Q?j(null):q!==null?j(q):P(V,z,j,B)}))!==_&&(Q=!0,!G.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else P(V,z,j,B)}else j(null)}var L={},F={};m.j={get:function(V,z){var j=Object.prototype.hasOwnProperty.call(F,V)?F[V]:_;j?j.Gd?m.u.G(function(){z(j.definition)}):m.na.zb(function(){z(j.definition)}):v(V,z)},Bc:function(V){delete F[V]},oc:P},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,B,G,W){function Q(){--J===0&&W(q)}var q={},J=2,Z=G.template;G=G.viewModel,Z?L(B,Z,function(ce){m.j.oc("loadTemplate",[j,ce],function(Ae){q.template=Ae,Q()})}):Q(),G?L(B,G,function(ce){m.j.oc("loadViewModel",[j,ce],function(Ae){q[z]=Ae,Q()})}):Q()}function v(j,B,G){if(typeof B=="function")G(function(Q){return new B(Q)});else if(typeof B[z]=="function")G(B[z]);else if("instance"in B){var W=B.instance;G(function(){return W})}else"viewModel"in B?v(j,B.viewModel,G):j("Unknown viewModel value: "+B)}function S(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(P(j.content))return m.a.Ca(j.content.childNodes)}return m.a.Ca(j.childNodes)}function P(j){return t.DocumentFragment?j instanceof DocumentFragment:j&&j.nodeType===11}function L(j,B,G){typeof B.require=="string"?s||t.require?(s||t.require)([B.require],function(W){W&&typeof W=="object"&&W.Xd&&W.default&&(W=W.default),G(W)}):j("Uses require, but no AMD loader is present"):G(B)}function F(j){return function(B){throw Error("Component '"+j+"': "+B)}}var V={};m.j.register=function(j,B){if(!B)throw Error("Invalid configuration for "+j);if(m.j.tb(j))throw Error("Component "+j+" is already registered");V[j]=B},m.j.tb=function(j){return Object.prototype.hasOwnProperty.call(V,j)},m.j.unregister=function(j){delete V[j],m.j.Bc(j)},m.j.Fc={getConfig:function(j,B){B(m.j.tb(j)?V[j]:null)},loadComponent:function(j,B,G){var W=F(j);L(W,B,function(Q){_(j,W,Q,G)})},loadTemplate:function(j,B,G){if(j=F(j),typeof B=="string")G(m.a.ua(B));else if(B instanceof Array)G(B);else if(P(B))G(m.a.la(B.childNodes));else if(B.element)if(B=B.element,t.HTMLElement?B instanceof HTMLElement:B&&B.tagName&&B.nodeType===1)G(S(B));else if(typeof B=="string"){var W=n.getElementById(B);W?G(S(W)):j("Cannot find element with ID "+B)}else j("Unknown element type: "+B);else j("Unknown template value: "+B)},loadViewModel:function(j,B,G){v(F(j),B,G)}};var z="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=V})(),(function(){function _(S,P){var L=S.getAttribute("params");if(L){var L=v.parseBindingsString(L,P,S,{valueAccessors:!0,bindingParams:!0}),L=m.a.Ga(L,function(z){return m.o(z,null,{l:S})}),F=m.a.Ga(L,function(z){var j=z.v();return z.ja()?m.o({read:function(){return m.a.f(z())},write:m.Za(j)&&function(B){z()(B)},l:S}):j});return Object.prototype.hasOwnProperty.call(F,"$raw")||(F.$raw=L),F}return{$raw:{}}}m.j.getComponentNameForNode=function(S){var P=m.a.R(S);if(m.j.tb(P)&&(P.indexOf("-")!=-1||""+S=="[object HTMLUnknownElement]"||8>=m.a.W&&S.tagName===P))return P},m.j.tc=function(S,P,L,F){if(P.nodeType===1){var V=m.j.getComponentNameForNode(P);if(V){if(S=S||{},S.component)throw Error('Cannot use the "component" binding on a custom element matching a component');var z={name:V,params:_(P,L)};S.component=F?function(){return z}:z}}return S};var v=new m.ga;9>m.a.W&&(m.j.register=(function(S){return function(P){return S.apply(this,arguments)}})(m.j.register),n.createDocumentFragment=(function(S){return function(){var P=S(),L=m.j.dd,F;for(F in L);return P}})(n.createDocumentFragment))})(),(function(){function _(P,L,F){if(L=L.template,!L)throw Error("Component '"+P+"' has no template");P=m.a.Ca(L),m.h.va(F,P)}function v(P,L,F){var V=P.createViewModel;return V?V.call(P,L,F):L}var S=0;m.c.component={init:function(P,L,F,V,z){function j(){var q=B&&B.dispose;typeof q=="function"&&q.call(B),W&&W.s(),G=B=W=null}var B,G,W,Q=m.a.la(m.h.childNodes(P));return m.h.Ea(P),m.a.K.za(P,j),m.o(function(){var q=m.a.f(L()),J,Z;if(typeof q=="string"?J=q:(J=m.a.f(q.name),Z=m.a.f(q.params)),!J)throw Error("No component name specified");var ce=m.i.Cb(P,z),Ae=G=++S;m.j.get(J,function(le){if(G===Ae){if(j(),!le)throw Error("Unknown component '"+J+"'");_(J,le,P);var Ce=v(le,Z,{element:P,templateNodes:Q});le=ce.createChildContext(Ce,{extend:function(ye){ye.$component=Ce,ye.$componentTemplateNodes=Q}}),Ce&&Ce.koDescendantsComplete&&(W=m.i.subscribe(P,m.i.pa,Ce.koDescendantsComplete,Ce)),B=Ce,m.Oa(le,P)}})},null,{l:P}),{controlsDescendantBindings:!0}}},m.h.ea.component=!0})();var M={class:"className",for:"htmlFor"};m.c.attr={update:function(_,v){var S=m.a.f(v())||{};m.a.P(S,function(P,L){L=m.a.f(L);var F=P.indexOf(":"),F="lookupNamespaceURI"in _&&0<F&&_.lookupNamespaceURI(P.substr(0,F)),V=L===!1||L===null||L===e;V?F?_.removeAttributeNS(F,P):_.removeAttribute(P):L=L.toString(),8>=m.a.W&&P in M?(P=M[P],V?_.removeAttribute(P):_[P]=L):V||(F?_.setAttributeNS(F,P,L):_.setAttribute(P,L)),P==="name"&&m.a.Yc(_,V?"":L)})}},(function(){m.c.checked={after:["value","attr"],init:function(_,v,S){function P(){var q=_.checked,J=F();if(!m.S.Ya()&&(q||!z&&!m.S.qa())){var Z=m.u.G(v);if(B){var ce=G?Z.v():Z,Ae=Q;Q=J,Ae!==J?q&&(m.a.Na(ce,J,!0),m.a.Na(ce,Ae,!1)):m.a.Na(ce,J,q),G&&m.Za(Z)&&Z(ce)}else V&&(J===e?J=q:q||(J=e)),m.m.eb(Z,S,"checked",J,!0)}}function L(){var q=m.a.f(v()),J=F();B?(_.checked=0<=m.a.A(q,J),Q=J):_.checked=V&&J===e?!!q:F()===q}var F=m.xb(function(){if(S.has("checkedValue"))return m.a.f(S.get("checkedValue"));if(W)return S.has("value")?m.a.f(S.get("value")):_.value}),V=_.type=="checkbox",z=_.type=="radio";if(V||z){var j=v(),B=V&&m.a.f(j)instanceof Array,G=!(B&&j.push&&j.splice),W=z||B,Q=B?F():e;z&&!_.name&&m.c.uniqueName.init(_,function(){return!0}),m.o(P,null,{l:_}),m.a.B(_,"click",P),m.o(L,null,{l:_}),j=e}}},m.m.wa.checked=!0,m.c.checkedValue={update:function(_,v){_.value=m.a.f(v())}}})(),m.c.class={update:function(_,v){var S=m.a.Db(m.a.f(v()));m.a.Eb(_,_.__ko__cssValue,!1),_.__ko__cssValue=S,m.a.Eb(_,S,!0)}},m.c.css={update:function(_,v){var S=m.a.f(v());S!==null&&typeof S=="object"?m.a.P(S,function(P,L){L=m.a.f(L),m.a.Eb(_,P,L)}):m.c.class.update(_,v)}},m.c.enable={update:function(_,v){var S=m.a.f(v());S&&_.disabled?_.removeAttribute("disabled"):S||_.disabled||(_.disabled=!0)}},m.c.disable={update:function(_,v){m.c.enable.update(_,function(){return!m.a.f(v())})}},m.c.event={init:function(_,v,S,P,L){var F=v()||{};m.a.P(F,function(V){typeof V=="string"&&m.a.B(_,V,function(z){var j,B=v()[V];if(B){try{var G=m.a.la(arguments);P=L.$data,G.unshift(P),j=B.apply(P,G)}finally{j!==!0&&(z.preventDefault?z.preventDefault():z.returnValue=!1)}S.get(V+"Bubble")===!1&&(z.cancelBubble=!0,z.stopPropagation&&z.stopPropagation())}})})}},m.c.foreach={Rc:function(_){return function(){var v=_(),S=m.a.bc(v);return!S||typeof S.length=="number"?{foreach:v,templateEngine:m.ba.Ma}:(m.a.f(v),{foreach:S.data,as:S.as,noChildContext:S.noChildContext,includeDestroyed:S.includeDestroyed,afterAdd:S.afterAdd,beforeRemove:S.beforeRemove,afterRender:S.afterRender,beforeMove:S.beforeMove,afterMove:S.afterMove,templateEngine:m.ba.Ma})}},init:function(_,v){return m.c.template.init(_,m.c.foreach.Rc(v))},update:function(_,v,S,P,L){return m.c.template.update(_,m.c.foreach.Rc(v),S,P,L)}},m.m.Ra.foreach=!1,m.h.ea.foreach=!0,m.c.hasfocus={init:function(_,v,S){function P(V){_.__ko_hasfocusUpdating=!0;var z=_.ownerDocument;if("activeElement"in z){var j;try{j=z.activeElement}catch{j=z.body}V=j===_}z=v(),m.m.eb(z,S,"hasfocus",V,!0),_.__ko_hasfocusLastValue=V,_.__ko_hasfocusUpdating=!1}var L=P.bind(null,!0),F=P.bind(null,!1);m.a.B(_,"focus",L),m.a.B(_,"focusin",L),m.a.B(_,"blur",F),m.a.B(_,"focusout",F),_.__ko_hasfocusLastValue=!1},update:function(_,v){var S=!!m.a.f(v());_.__ko_hasfocusUpdating||_.__ko_hasfocusLastValue===S||(S?_.focus():_.blur(),!S&&_.__ko_hasfocusLastValue&&_.ownerDocument.body.focus(),m.u.G(m.a.Fb,null,[_,S?"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(_,v){m.a.fc(_,v())}},(function(){function _(v,S,P){m.c[v]={init:function(L,F,V,z,j){var B,G,W={},Q,q,J;if(S){z=V.get("as");var Z=V.get("noChildContext");J=!(z&&Z),W={as:z,noChildContext:Z,exportDependencies:J}}return q=(Q=V.get("completeOn")=="render")||V.has(m.i.pa),m.o(function(){var ce=m.a.f(F()),Ae=!P!=!ce,le=!G,Ce;(J||Ae!==B)&&(q&&(j=m.i.Cb(L,j)),Ae&&((!S||J)&&(W.dataDependency=m.S.o()),Ce=S?j.createChildContext(typeof ce=="function"?ce:F,W):m.S.qa()?j.extend(null,W):j),le&&m.S.qa()&&(G=m.a.Ca(m.h.childNodes(L),!0)),Ae?(le||m.h.va(L,m.a.Ca(G)),m.Oa(Ce,L)):(m.h.Ea(L),Q||m.i.ma(L,m.i.H)),B=Ae)},null,{l:L}),{controlsDescendantBindings:!0}}},m.m.Ra[v]=!1,m.h.ea[v]=!0}_("if"),_("ifnot",!1,!0),_("with",!0)})(),m.c.let={init:function(_,v,S,P,L){return v=L.extend(v),m.Oa(v,_),{controlsDescendantBindings:!0}}},m.h.ea.let=!0;var N={};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(_,v,S){function P(){return m.a.jb(_.options,function(Z){return Z.selected})}function L(Z,ce,Ae){var le=typeof ce;return le=="function"?ce(Z):le=="string"?Z[ce]:Ae}function F(Z,ce){if(q&&B)m.i.ma(_,m.i.H);else if(Q.length){var Ae=0<=m.a.A(Q,m.w.M(ce[0]));m.a.Zc(ce[0],Ae),q&&!Ae&&m.u.G(m.a.Fb,null,[_,"change"])}}var V=_.multiple,z=_.length!=0&&V?_.scrollTop:null,j=m.a.f(v()),B=S.get("valueAllowUnset")&&S.has("value"),G=S.get("optionsIncludeDestroyed");v={};var W,Q=[];B||(V?Q=m.a.Mb(P(),m.w.M):0<=_.selectedIndex&&Q.push(m.w.M(_.options[_.selectedIndex]))),j&&(typeof j.length>"u"&&(j=[j]),W=m.a.jb(j,function(Z){return G||Z===e||Z===null||!m.a.f(Z._destroy)}),S.has("optionsCaption")&&(j=m.a.f(S.get("optionsCaption")),j!==null&&j!==e&&W.unshift(N)));var q=!1;if(v.beforeRemove=function(Z){_.removeChild(Z)},j=F,S.has("optionsAfterRender")&&typeof S.get("optionsAfterRender")=="function"&&(j=function(Z,ce){F(0,ce),m.u.G(S.get("optionsAfterRender"),null,[ce[0],Z!==N?Z:e])}),m.a.ec(_,W,function(Z,ce,Ae){return Ae.length&&(Q=!B&&Ae[0].selected?[m.w.M(Ae[0])]:[],q=!0),ce=_.ownerDocument.createElement("option"),Z===N?(m.a.Bb(ce,S.get("optionsCaption")),m.w.cb(ce,e)):(Ae=L(Z,S.get("optionsValue"),Z),m.w.cb(ce,m.a.f(Ae)),Z=L(Z,S.get("optionsText"),Ae),m.a.Bb(ce,Z)),[ce]},v,j),!B){var J;V?J=Q.length&&P().length<Q.length:J=Q.length&&0<=_.selectedIndex?m.w.M(_.options[_.selectedIndex])!==Q[0]:Q.length||0<=_.selectedIndex,J&&m.u.G(m.a.Fb,null,[_,"change"])}(B||m.S.Ya())&&m.i.ma(_,m.i.H),m.a.wd(_),z&&20<Math.abs(z-_.scrollTop)&&(_.scrollTop=z)}},m.c.options.$b=m.a.g.Z(),m.c.selectedOptions={init:function(_,v,S){function P(){var V=v(),z=[];m.a.D(_.getElementsByTagName("option"),function(j){j.selected&&z.push(m.w.M(j))}),m.m.eb(V,S,"selectedOptions",z)}function L(){var V=m.a.f(v()),z=_.scrollTop;V&&typeof V.length=="number"&&m.a.D(_.getElementsByTagName("option"),function(j){var B=0<=m.a.A(V,m.w.M(j));j.selected!=B&&m.a.Zc(j,B)}),_.scrollTop=z}if(m.a.R(_)!="select")throw Error("selectedOptions binding applies only to SELECT elements");var F;m.i.subscribe(_,m.i.H,function(){F?P():(m.a.B(_,"change",P),F=m.o(L,null,{l:_}))},null,{notifyImmediately:!0})},update:function(){}},m.m.wa.selectedOptions=!0,m.c.style={update:function(_,v){var S=m.a.f(v()||{});m.a.P(S,function(P,L){if(L=m.a.f(L),(L===null||L===e||L===!1)&&(L=""),r)r(_).css(P,L);else if(/^--/.test(P))_.style.setProperty(P,L);else{P=P.replace(/-(\w)/g,function(V,z){return z.toUpperCase()});var F=_.style[P];_.style[P]=L,L===F||_.style[P]!=F||isNaN(L)||(_.style[P]=L+"px")}})}},m.c.submit={init:function(_,v,S,P,L){if(typeof v()!="function")throw Error("The value for a submit binding must be a function");m.a.B(_,"submit",function(F){var V,z=v();try{V=z.call(L.$data,_)}finally{V!==!0&&(F.preventDefault?F.preventDefault():F.returnValue=!1)}})}},m.c.text={init:function(){return{controlsDescendantBindings:!0}},update:function(_,v){m.a.Bb(_,v())}},m.h.ea.text=!0,(function(){if(t&&t.navigator){var _=function(W){if(W)return parseFloat(W[1])},v=t.navigator.userAgent,S,P,L,F,V;(S=t.opera&&t.opera.version&&parseInt(t.opera.version()))||(V=_(v.match(/Edge\/([^ ]+)$/)))||_(v.match(/Chrome\/([^ ]+)/))||(P=_(v.match(/Version\/([^ ]+) Safari/)))||(L=_(v.match(/Firefox\/([^ ]+)/)))||(F=m.a.W||_(v.match(/MSIE ([^ ]+)/)))||(F=_(v.match(/rv:([^ )]+)/)))}if(8<=F&&10>F)var z=m.a.g.Z(),j=m.a.g.Z(),B=function(W){var Q=this.activeElement;(Q=Q&&m.a.g.get(Q,j))&&Q(W)},G=function(W,Q){var q=W.ownerDocument;m.a.g.get(q,z)||(m.a.g.set(q,z,!0),m.a.B(q,"selectionchange",B)),m.a.g.set(W,j,Q)};m.c.textInput={init:function(W,Q,q){function J(Le,$e){m.a.B(W,Le,$e)}function Z(){var Le=m.a.f(Q());(Le===null||Le===e)&&(Le=""),ye!==e&&Le===ye?m.a.setTimeout(Z,4):W.value!==Le&&(Ie=!0,W.value=Le,Ie=!1,le=W.value)}function ce(){Ce||(ye=W.value,Ce=m.a.setTimeout(Ae,4))}function Ae(){clearTimeout(Ce),ye=Ce=e;var Le=W.value;le!==Le&&(le=Le,m.m.eb(Q(),q,"textInput",Le))}var le=W.value,Ce,ye,ve=m.a.W==9?ce:Ae,Ie=!1;F&&J("keypress",Ae),11>F&&J("propertychange",function(Le){Ie||Le.propertyName!=="value"||ve(Le)}),F==8&&(J("keyup",Ae),J("keydown",Ae)),G&&(G(W,ve),J("dragend",ce)),(!F||9<=F)&&J("input",ve),5>P&&m.a.R(W)==="textarea"?(J("keydown",ce),J("paste",ce),J("cut",ce)):11>S?J("keydown",ce):4>L?(J("DOMAutoComplete",Ae),J("dragdrop",Ae),J("drop",Ae)):V&&W.type==="number"&&J("keydown",ce),J("change",Ae),J("blur",Ae),m.o(Z,null,{l:W})}},m.m.wa.textInput=!0,m.c.textinput={preprocess:function(W,Q,q){q("textInput",W)}}})(),m.c.uniqueName={init:function(_,v){if(v()){var S="ko_unique_"+ ++m.c.uniqueName.rd;m.a.Yc(_,S)}}},m.c.uniqueName.rd=0,m.c.using={init:function(_,v,S,P,L){var F;return S.has("as")&&(F={as:S.get("as"),noChildContext:S.get("noChildContext")}),v=L.createChildContext(v,F),m.Oa(v,_),{controlsDescendantBindings:!0}}},m.h.ea.using=!0,m.c.value={init:function(_,v,S){var P=m.a.R(_),L=P=="input";if(!L||_.type!="checkbox"&&_.type!="radio"){var F=[],V=S.get("valueUpdate"),z=!1,j=null;V&&(typeof V=="string"?F=[V]:F=m.a.wc(V),m.a.Pa(F,"change"));var B=function(){j=null,z=!1;var Q=v(),q=m.w.M(_);m.m.eb(Q,S,"value",q)};!m.a.W||!L||_.type!="text"||_.autocomplete=="off"||_.form&&_.form.autocomplete=="off"||m.a.A(F,"propertychange")!=-1||(m.a.B(_,"propertychange",function(){z=!0}),m.a.B(_,"focus",function(){z=!1}),m.a.B(_,"blur",function(){z&&B()})),m.a.D(F,function(Q){var q=B;m.a.Ud(Q,"after")&&(q=function(){j=m.w.M(_),m.a.setTimeout(B,0)},Q=Q.substring(5)),m.a.B(_,Q,q)});var G;if(G=L&&_.type=="file"?function(){var Q=m.a.f(v());Q===null||Q===e||Q===""?_.value="":m.u.G(B)}:function(){var Q=m.a.f(v()),q=m.w.M(_);j!==null&&Q===j?m.a.setTimeout(G,0):(Q!==q||q===e)&&(P==="select"?(q=S.get("valueAllowUnset"),m.w.cb(_,Q,q),q||Q===m.w.M(_)||m.u.G(B)):m.w.cb(_,Q))},P==="select"){var W;m.i.subscribe(_,m.i.H,function(){W?S.get("valueAllowUnset")?G():B():(m.a.B(_,"change",B),W=m.o(G,null,{l:_}))},null,{notifyImmediately:!0})}else m.a.B(_,"change",B),m.o(G,null,{l:_})}else m.ib(_,{checkedValue:v})},update:function(){}},m.m.wa.value=!0,m.c.visible={update:function(_,v){var S=m.a.f(v()),P=_.style.display!="none";S&&!P?_.style.display="":!S&&P&&(_.style.display="none")}},m.c.hidden={update:function(_,v){m.c.visible.update(_,function(){return!m.a.f(v())})}},(function(_){m.c[_]={init:function(v,S,P,L,F){return m.c.event.init.call(this,v,function(){var V={};return V[_]=S(),V},P,L,F)}}})("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(_,v){if(typeof _=="string"){v=v||n;var S=v.getElementById(_);if(!S)throw Error("Cannot find template with ID "+_);return new m.C.F(S)}if(_.nodeType==1||_.nodeType==8)return new m.C.ia(_);throw Error("Unknown template type: "+_)},m.ca.prototype.renderTemplate=function(_,v,S,P){return _=this.makeTemplateSource(_,P),this.renderTemplateSource(_,v,S,P)},m.ca.prototype.isTemplateRewritten=function(_,v){return this.allowTemplateRewriting===!1?!0:this.makeTemplateSource(_,v).data("isRewritten")},m.ca.prototype.rewriteTemplate=function(_,v,S){_=this.makeTemplateSource(_,S),v=v(_.text()),_.text(v),_.data("isRewritten",!0)},m.b("templateEngine",m.ca),m.kc=(function(){function _(P,L,F,V){P=m.m.ac(P);for(var z=m.m.Ra,j=0;j<P.length;j++){var B=P[j].key;if(Object.prototype.hasOwnProperty.call(z,B)){var G=z[B];if(typeof G=="function"){if(B=G(P[j].value))throw Error(B)}else if(!G)throw Error("This template engine does not support the '"+B+"' binding within its templates")}}return F="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+m.m.vb(P,{valueAccessors:!0})+" } })()},'"+F.toLowerCase()+"')",V.createJavaScriptEvaluatorBlock(F)+L}var v=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,S=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{xd:function(P,L,F){L.isTemplateRewritten(P,F)||L.rewriteTemplate(P,function(V){return m.kc.Ld(V,L)},F)},Ld:function(P,L){return P.replace(v,function(F,V,z,j,B){return _(B,V,z,L)}).replace(S,function(F,V){return _(V,"<!-- ko -->","#comment",L)})},md:function(P,L){return m.aa.Xb(function(F,V){var z=F.nextSibling;z&&z.nodeName.toLowerCase()===L&&m.ib(z,P,V)})}}})(),m.b("__tr_ambtns",m.kc.md),(function(){m.C={},m.C.F=function(S){if(this.F=S){var P=m.a.R(S);this.ab=P==="script"?1:P==="textarea"?2:P=="template"&&S.content&&S.content.nodeType===11?3:4}},m.C.F.prototype.text=function(){var S=this.ab===1?"text":this.ab===2?"value":"innerHTML";if(arguments.length==0)return this.F[S];var P=arguments[0];S==="innerHTML"?m.a.fc(this.F,P):this.F[S]=P};var _=m.a.g.Z()+"_";m.C.F.prototype.data=function(S){if(arguments.length===1)return m.a.g.get(this.F,_+S);m.a.g.set(this.F,_+S,arguments[1])};var v=m.a.g.Z();m.C.F.prototype.nodes=function(){var S=this.F;if(arguments.length==0){var P=m.a.g.get(S,v)||{},L=P.lb||(this.ab===3?S.content:this.ab===4?S:e);if(!L||P.jd){var F=this.text();F&&F!==P.bb&&(L=m.a.Md(F,S.ownerDocument),m.a.g.set(S,v,{lb:L,bb:F,jd:!0}))}return L}P=arguments[0],this.ab!==e&&this.text(""),m.a.g.set(S,v,{lb:P})},m.C.ia=function(S){this.F=S},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 S=m.a.g.get(this.F,v)||{};return S.bb===e&&S.lb&&(S.bb=S.lb.innerHTML),S.bb}m.a.g.set(this.F,v,{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,B,G){var W;for(B=m.h.nextSibling(B);j&&(W=j)!==B;)j=m.h.nextSibling(W),G(W,j)}function v(j,B){if(j.length){var G=j[0],W=j[j.length-1],Q=G.parentNode,q=m.ga.instance,J=q.preprocessNode;if(J){if(_(G,W,function(Z,ce){var Ae=Z.previousSibling,le=J.call(q,Z);le&&(Z===G&&(G=le[0]||ce),Z===W&&(W=le[le.length-1]||Ae))}),j.length=0,!G)return;G===W?j.push(G):(j.push(G,W),m.a.Ua(j,Q))}_(G,W,function(Z){Z.nodeType!==1&&Z.nodeType!==8||m.vc(B,Z)}),_(G,W,function(Z){Z.nodeType!==1&&Z.nodeType!==8||m.aa.cd(Z,[B])}),m.a.Ua(j,Q)}}function S(j){return j.nodeType?j:0<j.length?j[0]:null}function P(j,B,G,W,Q){Q=Q||{};var q=(j&&S(j)||G||{}).ownerDocument,J=Q.templateEngine||F;if(m.kc.xd(G,J,q),G=J.renderTemplate(G,W,Q,q),typeof G.length!="number"||0<G.length&&typeof G[0].nodeType!="number")throw Error("Template engine must return an array of DOM nodes");switch(q=!1,B){case"replaceChildren":m.h.va(j,G),q=!0;break;case"replaceNode":m.a.Xc(j,G),q=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+B)}return q&&(v(G,W),Q.afterRender&&m.u.G(Q.afterRender,null,[G,W[Q.as||"$data"]]),B=="replaceChildren"&&m.i.ma(j,m.i.H)),G}function L(j,B,G){return m.O(j)?j():typeof j=="function"?j(B,G):j}var F;m.gc=function(j){if(j!=e&&!(j instanceof m.ca))throw Error("templateEngine must inherit from ko.templateEngine");F=j},m.dc=function(j,B,G,W,Q){if(G=G||{},(G.templateEngine||F)==e)throw Error("Set a template engine before calling renderTemplate");if(Q=Q||"replaceChildren",W){var q=S(W);return m.$(function(){var Z=B&&B instanceof m.fa?B:new m.fa(B,null,null,null,{exportDependencies:!0}),J=L(j,Z.$data,Z),Z=P(W,Q,J,Z,G);Q=="replaceNode"&&(W=Z,q=S(W))},null,{Sa:function(){return!q||!m.a.Sb(q)},l:q&&Q=="replaceNode"?q.parentNode:q})}return m.aa.Xb(function(J){m.dc(j,B,G,J,"replaceNode")})},m.Qd=function(j,B,G,W,Q){function q(ye,ve){m.u.G(m.a.ec,null,[W,ye,Z,G,J,ve]),m.i.ma(W,m.i.H)}function J(ye,ve){v(ve,ce),G.afterRender&&G.afterRender(ve,ye),ce=null}function Z(ye,ve){ce=Q.createChildContext(ye,{as:Ae,noChildContext:G.noChildContext,extend:function(Le){Le.$index=ve,Ae&&(Le[Ae+"Index"]=ve)}});var Ie=L(j,ye,ce);return P(W,"ignoreTargetNode",Ie,ce,G)}var ce,Ae=G.as,le=G.includeDestroyed===!1||m.options.foreachHidesDestroyed&&!G.includeDestroyed;if(le||G.beforeRemove||!m.Pc(B))return m.$(function(){var ye=m.a.f(B)||[];typeof ye.length>"u"&&(ye=[ye]),le&&(ye=m.a.jb(ye,function(ve){return ve===e||ve===null||!m.a.f(ve._destroy)})),q(ye)},null,{l:W});q(B.v());var Ce=B.subscribe(function(ye){q(B(),ye)},null,"arrayChange");return Ce.l(W),Ce};var V=m.a.g.Z(),z=m.a.g.Z();m.c.template={init:function(j,B){var G=m.a.f(B());if(typeof G=="string"||"name"in G)m.h.Ea(j);else if("nodes"in G){if(G=G.nodes||[],m.O(G))throw Error('The "nodes" option must be a plain, non-observable array.');var W=G[0]&&G[0].parentNode;W&&m.a.g.get(W,z)||(W=m.a.Yb(G),m.a.g.set(W,z,!0)),new m.C.ia(j).nodes(W)}else if(G=m.h.childNodes(j),0<G.length)W=m.a.Yb(G),new m.C.ia(j).nodes(W);else throw Error("Anonymous template defined, but no template content was provided");return{controlsDescendantBindings:!0}},update:function(j,B,G,W,Q){var q=B();B=m.a.f(q),G=!0,W=null,typeof B=="string"?B={}:(q="name"in B?B.name:j,"if"in B&&(G=m.a.f(B.if)),G&&"ifnot"in B&&(G=!m.a.f(B.ifnot)),G&&!q&&(G=!1)),"foreach"in B?W=m.Qd(q,G&&B.foreach||[],B,j,Q):G?(G=Q,"data"in B&&(G=Q.createChildContext(B.data,{as:B.as,noChildContext:B.noChildContext,exportDependencies:!0})),W=m.dc(q,G,B,j)):m.h.Ea(j),Q=W,(B=m.a.g.get(j,V))&&typeof B.s=="function"&&B.s(),m.a.g.set(j,V,!Q||Q.ja&&!Q.ja()?e:Q)}},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(_,v,S){if(_.length&&v.length){var P,L,F,V,z;for(P=L=0;(!S||P<S)&&(V=_[L]);++L){for(F=0;z=v[F];++F)if(V.value===z.value){V.moved=z.index,z.moved=V.index,v.splice(F,1),P=F=0;break}P+=F}}},m.a.Pb=(function(){function _(v,S,P,L,F){var V=Math.min,z=Math.max,j=[],B,G=v.length,W,Q=S.length,q=Q-G||1,J=G+Q+1,Z,ce,Ae;for(B=0;B<=G;B++)for(ce=Z,j.push(Z=[]),Ae=V(Q,B+q),W=z(0,B-1);W<=Ae;W++)Z[W]=W?B?v[B-1]===S[W-1]?ce[W-1]:V(ce[W]||J,Z[W-1]||J)+1:W+1:B+1;for(V=[],z=[],q=[],B=G,W=Q;B||W;)Q=j[B][W]-1,W&&Q===j[B][W-1]?z.push(V[V.length]={status:P,value:S[--W],index:W}):B&&Q===j[B-1][W]?q.push(V[V.length]={status:L,value:v[--B],index:B}):(--W,--B,F.sparse||V.push({status:"retained",value:S[W]}));return m.a.Kc(q,z,!F.dontLimitMoves&&10*G),V.reverse()}return function(v,S,P){return P=typeof P=="boolean"?{dontLimitMoves:P}:P||{},v=v||[],S=S||[],v.length<S.length?_(v,S,"added","deleted",P):_(S,v,"deleted","added",P)}})(),m.b("utils.compareArrays",m.a.Pb),(function(){function _(P,L,F,V,z){var j=[],B=m.$(function(){var G=L(F,z,m.a.Ua(j,P))||[];0<j.length&&(m.a.Xc(j,G),V&&m.u.G(V,null,[F,G,z])),j.length=0,m.a.Nb(j,G)},null,{l:P,Sa:function(){return!m.a.kd(j)}});return{Y:j,$:B.ja()?B:e}}var v=m.a.g.Z(),S=m.a.g.Z();m.a.ec=function(P,L,F,V,z,j){function B(ct){Ie={Aa:ct,pb:m.ta(ce++)},J.push(Ie),q||ve.push(Ie)}function G(ct){Ie=Q[ct],ce!==Ie.pb.v()&&ye.push(Ie),Ie.pb(ce++),m.a.Ua(Ie.Y,P),J.push(Ie)}function W(ct,dn){if(ct)for(var Ht=0,bt=dn.length;Ht<bt;Ht++)m.a.D(dn[Ht].Y,function(Dt){ct(Dt,Ht,dn[Ht].Aa)})}L=L||[],typeof L.length>"u"&&(L=[L]),V=V||{};var Q=m.a.g.get(P,v),q=!Q,J=[],Z=0,ce=0,Ae=[],le=[],Ce=[],ye=[],ve=[],Ie,Le=0;if(q)m.a.D(L,B);else{if(!j||Q&&Q._countWaitingForRemove){var $e=m.a.Mb(Q,function(ct){return ct.Aa});j=m.a.Pb($e,L,{dontLimitMoves:V.dontLimitMoves,sparse:!0})}for(var $e=0,Ye,yt,Ke;Ye=j[$e];$e++)switch(yt=Ye.moved,Ke=Ye.index,Ye.status){case"deleted":for(;Z<Ke;)G(Z++);yt===e&&(Ie=Q[Z],Ie.$&&(Ie.$.s(),Ie.$=e),m.a.Ua(Ie.Y,P).length&&(V.beforeRemove&&(J.push(Ie),Le++,Ie.Aa===S?Ie=null:Ce.push(Ie)),Ie&&Ae.push.apply(Ae,Ie.Y))),Z++;break;case"added":for(;ce<Ke;)G(Z++);yt!==e?(le.push(J.length),G(yt)):B(Ye.value)}for(;ce<L.length;)G(Z++);J._countWaitingForRemove=Le}m.a.g.set(P,v,J),W(V.beforeMove,ye),m.a.D(Ae,V.beforeRemove?m.oa:m.removeNode);var we,We,Ct;try{Ct=P.ownerDocument.activeElement}catch{}if(le.length)for(;($e=le.shift())!=e;){for(Ie=J[$e],we=e;$e;)if((We=J[--$e].Y)&&We.length){we=We[We.length-1];break}for(L=0;Z=Ie.Y[L];we=Z,L++)m.h.Wb(P,Z,we)}for($e=0;Ie=J[$e];$e++){for(Ie.Y||m.a.extend(Ie,_(P,F,Ie.Aa,z,Ie.pb)),L=0;Z=Ie.Y[L];we=Z,L++)m.h.Wb(P,Z,we);!Ie.Ed&&z&&(z(Ie.Aa,Ie.Y,Ie.pb),Ie.Ed=!0,we=Ie.Y[Ie.Y.length-1])}for(Ct&&P.ownerDocument.activeElement!=Ct&&Ct.focus(),W(V.beforeRemove,Ce),$e=0;$e<Ce.length;++$e)Ce[$e].Aa=S;W(V.afterMove,ye),W(V.afterAdd,ve)}})(),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(_,v,S,P){return(v=!(9>m.a.W)&&_.nodes?_.nodes():null)?m.a.la(v.cloneNode(!0).childNodes):(_=_.text(),m.a.ua(_,P))},m.ba.Ma=new m.ba,m.gc(m.ba.Ma),m.b("nativeTemplateEngine",m.ba),(function(){m.$a=function(){var v=this.Hd=(function(){if(!r||!r.tmpl)return 0;try{if(0<=r.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch{}return 1})();this.renderTemplateSource=function(S,P,L,F){if(F=F||n,L=L||{},2>v)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var V=S.data("precompiled");return V||(V=S.text()||"",V=r.template(null,"{{ko_with $item.koBindingContext}}"+V+"{{/ko_with}}"),S.data("precompiled",V)),S=[P.$data],P=r.extend({koBindingContext:P},L.templateOptions),P=r.tmpl(V,S,P),P.appendTo(F.createElement("div")),r.fragments={},P},this.createJavaScriptEvaluatorBlock=function(S){return"{{ko_code ((function() { return "+S+" })()) }}"},this.addTemplate=function(S,P){n.write("<script type='text/html' id='"+S+"'>"+P+"<\/script>")},0<v&&(r.tmpl.tag.ko_code={open:"__.push($1 || '');"},r.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 uzt=ko;typeof window<"u"?(ko=window.ko,typeof UO<"u"?window.ko=UO:delete window.ko):(ko=global.ko,typeof UO<"u"?global.ko=UO:delete global.ko);var Dw=uzt;/**
|
|
* @license
|
|
* Knockout ES5 plugin - https://github.com/SteveSanderson/knockout-es5
|
|
* Copyright (c) Steve Sanderson
|
|
* MIT license
|
|
*/var Pre="__knockoutObservables",Dre="__knockoutSubscribable";function YMe(e,t){if(!e)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var n=this,i=XMe(e,!0);return t=t||Object.getOwnPropertyNames(e),t.forEach(function(r){if(!(r===Pre||r===Dre)&&!(r in i)){var o=e[r],a=o instanceof Array,s=n.isObservable(o)?o:a?n.observableArray(o):n.observable(o);Object.defineProperty(e,r,{configurable:!0,enumerable:!0,get:s,set:n.isWriteableObservable(s)?s:void 0}),i[r]=s,a&&dzt(n,s)}}),e}function XMe(e,t){var n=e[Pre];return!n&&t&&(n={},Object.defineProperty(e,Pre,{value:n})),n}function fzt(e,t,n){var i=this,r={owner:e,deferEvaluation:!0};if(typeof n=="function")r.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".');r.read=n.get,r.write=n.set}return e[t]=i.computed(r),YMe.call(i,e,[t]),e}function dzt(e,t){var n=null;e.computed(function(){n&&(n.dispose(),n=null);var i=t();i instanceof Array&&(n=hzt(e,t,i))})}function hzt(e,t,n){var i=mzt(e,n);return i.subscribe(t)}function mzt(e,t){var n=t[Dre];if(!n){n=new e.subscribable,Object.defineProperty(t,Dre,{value:n});var i={};pzt(t,n,i),gzt(e,t,n,i)}return n}function pzt(e,t,n){["pop","push","reverse","shift","sort","splice","unshift"].forEach(function(i){var r=e[i];e[i]=function(){var o=r.apply(this,arguments);return n.pause!==!0&&t.notifySubscribers(this),o}})}function gzt(e,t,n,i){["remove","removeAll","destroy","destroyAll","replace"].forEach(function(r){Object.defineProperty(t,r,{enumerable:!1,value:function(){var o;i.pause=!0;try{o=e.observableArray.fn[r].apply(e.observableArray(t),arguments)}finally{i.pause=!1}return n.notifySubscribers(t),o}})})}function KMe(e,t){if(!e)return null;var n=XMe(e,!1);return n&&n[t]||null}function _zt(e,t){var n=KMe(e,t);n&&n.valueHasMutated()}function yzt(e){e.track=YMe,e.getObservable=KMe,e.valueHasMutated=_zt,e.defineProperty=fzt}var n9={attachToKo:yzt};var $Me="http://www.w3.org/2000/svg",JMe="cesium-svgPath-svg",Azt={register:function(e){e.bindingHandlers.cesiumSvgPath={init:function(t,n){let i=document.createElementNS($Me,"svg:svg");i.setAttribute("class",JMe);let r=document.createElementNS($Me,"path");return i.appendChild(r),e.virtualElements.setDomNodeChildren(t,[i]),e.computed({read:function(){let o=e.unwrap(n());r.setAttribute("d",e.unwrap(o.path));let a=e.unwrap(o.width),s=e.unwrap(o.height);i.setAttribute("width",a),i.setAttribute("height",s),i.setAttribute("viewBox",`0 0 ${a} ${s}`),o.css&&i.setAttribute("class",`${JMe} ${e.unwrap(o.css)}`)},disposeWhenNodeIsRemoved:t}),{controlsDescendantBindings:!0}}},e.virtualElements.allowedBindings.cesiumSvgPath=!0}},i9=Azt;n9.attachToKo(Dw);i9.register(Dw);var Ee=Dw;function VO(e){l(e)||(e=new jm),this._clock=e,this._eventHelper=new Fo,this._eventHelper.add(e.onTick,this.synchronize,this),this.systemTime=Ee.observable(K.now()),this.systemTime.equalityComparer=K.equals,this.startTime=Ee.observable(e.startTime),this.startTime.equalityComparer=K.equals,this.startTime.subscribe(function(t){e.startTime=t,this.synchronize()},this),this.stopTime=Ee.observable(e.stopTime),this.stopTime.equalityComparer=K.equals,this.stopTime.subscribe(function(t){e.stopTime=t,this.synchronize()},this),this.currentTime=Ee.observable(e.currentTime),this.currentTime.equalityComparer=K.equals,this.currentTime.subscribe(function(t){e.currentTime=t,this.synchronize()},this),this.multiplier=Ee.observable(e.multiplier),this.multiplier.subscribe(function(t){e.multiplier=t,this.synchronize()},this),this.clockStep=Ee.observable(e.clockStep),this.clockStep.subscribe(function(t){e.clockStep=t,this.synchronize()},this),this.clockRange=Ee.observable(e.clockRange),this.clockRange.subscribe(function(t){e.clockRange=t,this.synchronize()},this),this.canAnimate=Ee.observable(e.canAnimate),this.canAnimate.subscribe(function(t){e.canAnimate=t,this.synchronize()},this),this.shouldAnimate=Ee.observable(e.shouldAnimate),this.shouldAnimate.subscribe(function(t){e.shouldAnimate=t,this.synchronize()},this),Ee.track(this,["systemTime","startTime","stopTime","currentTime","multiplier","clockStep","clockRange","canAnimate","shouldAnimate"])}Object.defineProperties(VO.prototype,{clock:{get:function(){return this._clock}}});VO.prototype.synchronize=function(){let e=this._clock;this.systemTime=K.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};VO.prototype.isDestroyed=function(){return!1};VO.prototype.destroy=function(){this._eventHelper.removeAll(),ue(this)};var r9=VO;function bzt(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,pe.throwInstantiationError()}var ZMe=bzt;var Rw={};Rw.createCheckbox=function(e,t,n){let i=document.createElement("div"),r=document.createElement("label"),o=document.createElement("input");o.type="checkbox";let a=`checked: ${t}`;return l(n)&&(a+=`, enable: ${n}`),o.setAttribute("data-bind",a),r.appendChild(o),r.appendChild(document.createTextNode(e)),i.appendChild(r),i};Rw.createSection=function(e,t,n,i){let r=document.createElement("div");r.className="cesium-cesiumInspector-section",r.setAttribute("data-bind",`css: { "cesium-cesiumInspector-section-collapsed": !${n} }`),e.appendChild(r);let o=document.createElement("h3");o.className="cesium-cesiumInspector-sectionHeader",o.appendChild(document.createTextNode(t)),o.setAttribute("data-bind",`click: ${i}`),r.appendChild(o);let a=document.createElement("div");return a.className="cesium-cesiumInspector-sectionContent",r.appendChild(a),a};Rw.createRangeInput=function(e,t,n,i,r,o){o=o??t;let a=document.createElement("input");a.setAttribute("data-bind",`value: ${o}`),a.type="number";let s=document.createElement("input");s.type="range",s.min=n,s.max=i,s.step=r??"any",s.setAttribute("data-bind",`valueUpdate: "input", value: ${t}`);let c=document.createElement("div");c.appendChild(s);let u=document.createElement("div");return u.className="cesium-cesiumInspector-slider",u.appendChild(document.createTextNode(e)),u.appendChild(a),u.appendChild(c),u};Rw.createRangeInputWithDynamicMinMax=function(e,t,n,i){i=i??t;let r=document.createElement("input");r.setAttribute("data-bind",`value: ${i}`),r.type="number";let o=document.createElement("input");o.type="range",o.step=n??"any",o.setAttribute("data-bind",`valueUpdate: "input", value: ${t}, attr: { min: ${t}Min, max: ${t}Max }`);let a=document.createElement("div");a.appendChild(o);let s=document.createElement("div");return s.className="cesium-cesiumInspector-slider",s.appendChild(document.createTextNode(e)),s.appendChild(r),s.appendChild(a),s};Rw.createButton=function(e,t,n){let i=document.createElement("button");i.type="button",i.textContent=e,i.className="cesium-cesiumInspector-pickButton";let r=`click: ${t}`;return l(n)&&(r+=`, css: {"cesium-cesiumInspector-pickButtonHighlight" : ${n}}`),i.setAttribute("data-bind",r),i};var Of=Rw;function QMe(e,t){this._command=e,t=t??H.EMPTY_OBJECT,this.toggled=t.toggled??!1,this.tooltip=t.tooltip??"",Ee.track(this,["toggled","tooltip"])}Object.defineProperties(QMe.prototype,{command:{get:function(){return this._command}}});var bT=QMe;function xzt(e,t){t=t??!0;let n=new be,i=new be;function r(){let o={args:arguments,cancel:!1},a;return n.raiseEvent(o),o.cancel||(a=e.apply(null,arguments),i.raiseEvent(a)),a}return r.canExecute=t,Ee.track(r,["canExecute"]),Object.defineProperties(r,{beforeExecute:{value:n},afterExecute:{value:i}}),r}var Ln=xzt;function Tzt(e,t,n,i,r){return n.call(i,e[t]),Ee.getObservable(e,t).subscribe(n,i,r)}var Ic=Tzt;var xT="http://www.w3.org/2000/svg",nLe="http://www.w3.org/1999/xlink",o9,jO=U.fromCssColorString("rgba(247,250,255,0.384)"),a9=U.fromCssColorString("rgba(143,191,255,0.216)"),Rre=U.fromCssColorString("rgba(153,197,255,0.098)"),s9=U.fromCssColorString("rgba(255,255,255,0.086)"),Czt=U.fromCssColorString("rgba(255,255,255,0.267)"),vzt=U.fromCssColorString("rgba(255,255,255,0)"),eLe=U.fromCssColorString("rgba(66,67,68,0.3)"),tLe=U.fromCssColorString("rgba(0,0,0,0.5)");function RA(e){return U.fromCssColorString(window.getComputedStyle(e).getPropertyValue("color"))}var HO={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 mm(e){let t=document.createElementNS(xT,e.tagName);for(let n in e)if(e.hasOwnProperty(n)&&n!=="tagName")if(n==="children"){let i=e.children.length;for(let r=0;r<i;++r)t.appendChild(mm(e.children[r]))}else n.indexOf("xlink:")===0?t.setAttributeNS(nLe,n.substring(6),e[n]):n==="textContent"?t.textContent=e[n]:t.setAttribute(n,e[n]);return t}function Ore(e,t,n){let i=document.createElementNS(xT,"text");i.setAttribute("x",e),i.setAttribute("y",t),i.setAttribute("class","cesium-animation-svgText");let r=document.createElementNS(xT,"tspan");return r.textContent=n,i.appendChild(r),i}function Ezt(e,t,n){e.setAttribute("transform",`translate(100,100) rotate(${n})`),t.setAttribute("transform",`rotate(${n})`)}var c9=new U;function Oa(e,t){let n=t.alpha,i=1-n;return c9.red=e.red*i+t.red*n,c9.green=e.green*i+t.green*n,c9.blue=e.blue*i+t.blue*n,c9.toCssColorString()}function Mre(e,t,n){let i=HO[n],r={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 mm(r)}function Szt(e,t,n){let i=HO[n],r=HO.animation_pathWingButton,o={tagName:"g",class:"cesium-animation-rectButton",transform:`translate(${e},${t})`,children:[{class:"cesium-animation-buttonGlow",id:"animation_pathWingButton",tagName:r.tagName,d:r.d},{class:"cesium-animation-buttonMain",id:"animation_pathWingButton",tagName:r.tagName,d:r.d},{class:"cesium-animation-buttonPath",id:n,tagName:i.tagName,transform:i.transform,d:i.d},{tagName:"title",textContent:""}]};return mm(o)}function wzt(e,t){let n=e._viewModel,i=n.shuttleRingDragging;if(!(i&&o9!==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 r=e._centerX,o=e._centerY,s=e._svgNode.getBoundingClientRect(),c,u;if(t.type==="touchstart"||t.type==="touchmove"?(c=t.touches[0].clientX,u=t.touches[0].clientY):(c=t.clientX,u=t.clientY),!i&&(c>s.right||c<s.left||u<s.top||u>s.bottom))return;let f=e._shuttleRingPointer.getBoundingClientRect(),d=c-r-s.left,p=u-o-s.top,g=Math.atan2(p,d)*180/Math.PI+90;g>180&&(g-=360);let m=n.shuttleRingAngle;i||c<f.right&&c>f.left&&u>f.top&&u<f.bottom?(o9=e,n.shuttleRingDragging=!0,n.shuttleRingAngle=g):g<m?n.slower():g>m&&n.faster(),t.preventDefault()}else e===o9&&(o9=void 0),n.shuttleRingDragging=!1}function Yg(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=[Ic(t,"toggled",this.setToggled,this),Ic(t,"tooltip",this.setTooltip,this),Ic(t.command,"canExecute",this.setEnabled,this)]}Yg.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();ue(this)};Yg.prototype.isDestroyed=function(){return!1};Yg.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")}};Yg.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")))};Yg.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e};function Ow(e,t){e=zn(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 r=document.createElement("div");r.className="cesium-animation-theme",r.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=r,this._themeNormal=r.childNodes[0],this._themeHover=r.childNodes[1],this._themeSelect=r.childNodes[2],this._themeDisabled=r.childNodes[3],this._themeKnob=r.childNodes[4],this._themePointer=r.childNodes[5],this._themeSwoosh=r.childNodes[6],this._themeSwooshHover=r.childNodes[7];let o=document.createElementNS(xT,"svg:svg");this._svgNode=o,o.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",nLe);let a=document.createElementNS(xT,"g");this._topG=a,this._realtimeSVG=new Yg(Szt(3,4,"animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new Yg(Mre(44,99,"animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new Yg(Mre(124,99,"animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new Yg(Mre(84,99,"animation_pathPause"),t.pauseViewModel);let s=document.createElementNS(xT,"g");s.appendChild(this._realtimeSVG.svgElement),s.appendChild(this._playReverseSVG.svgElement),s.appendChild(this._playForwardSVG.svgElement),s.appendChild(this._pauseSVG.svgElement);let c=mm({tagName:"circle",class:"cesium-animation-shuttleRingBack",cx:100,cy:100,r:99});this._shuttleRingBackPanel=c;let u=HO.animation_pathSwooshFX,f=HO.animation_pathPointer,d=mm({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=d,this._shuttleRingPointer=mm({class:"cesium-animation-shuttleRingPointer",id:"animation_pathPointer",tagName:f.tagName,d:f.d});let p=mm({tagName:"g",transform:"translate(100,100)"});this._knobOuter=mm({tagName:"circle",class:"cesium-animation-knobOuter",cx:0,cy:0,r:71});let g=61,m=mm({tagName:"circle",class:"cesium-animation-knobInner",cx:0,cy:0,r:g});this._knobDate=Ore(0,-24,""),this._knobTime=Ore(0,-7,""),this._knobStatus=Ore(0,-41,"");let y=mm({tagName:"circle",class:"cesium-animation-blank",cx:0,cy:0,r:g}),A=document.createElementNS(xT,"g");A.setAttribute("class","cesium-animation-shuttleRingG"),e.appendChild(r),a.appendChild(A),a.appendChild(p),a.appendChild(s),A.appendChild(c),A.appendChild(d),A.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),o.appendChild(a),e.appendChild(o);let b=this;function x(D){wzt(b,D)}this._mouseCallback=x,c.addEventListener("mousedown",x,!0),c.addEventListener("touchstart",x,!0),d.addEventListener("mousedown",x,!0),d.addEventListener("touchstart",x,!0),n.addEventListener("mousemove",x,!0),n.addEventListener("touchmove",x,!0),n.addEventListener("mouseup",x,!0),n.addEventListener("touchend",x,!0),n.addEventListener("touchcancel",x,!0),this._shuttleRingPointer.addEventListener("mousedown",x,!0),this._shuttleRingPointer.addEventListener("touchstart",x,!0),this._knobOuter.addEventListener("mousedown",x,!0),this._knobOuter.addEventListener("touchstart",x,!0);let T=this._knobTime.childNodes[0],C=this._knobDate.childNodes[0],E=this._knobStatus.childNodes[0],w;this._subscriptions=[Ic(t.pauseViewModel,"toggled",function(D){w!==D&&(w=D,w?b._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):b._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))}),Ic(t,"shuttleRingAngle",function(D){Ezt(b._shuttleRingPointer,b._knobOuter,D)}),Ic(t,"dateLabel",function(D){C.textContent!==D&&(C.textContent=D)}),Ic(t,"timeLabel",function(D){T.textContent!==D&&(T.textContent=D)}),Ic(t,"multiplierLabel",function(D){E.textContent!==D&&(E.textContent=D)})],this.applyThemeChanges(),this.resize()}Object.defineProperties(Ow.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});Ow.prototype.isDestroyed=function(){return!1};Ow.prototype.destroy=function(){l(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,r=n.length;i<r;i++)n[i].dispose();return ue(this)};Ow.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,r=132,o=e,a=t;e===0&&t===0?(o=i,a=r):e===0?(a=t,o=i*(t/r)):t===0&&(o=e,a=r*(e/i));let s=o/i,c=a/r;n.style.cssText=`width: ${o}px; height: ${a}px; position: absolute; bottom: 0; left: 0; overflow: hidden;`,n.setAttribute("width",o),n.setAttribute("height",a),n.setAttribute("viewBox",`0 0 ${o} ${a}`),this._topG.setAttribute("transform",`scale(${s},${c})`),this._centerX=Math.max(1,100*s),this._centerY=Math.max(1,100*c),this._lastHeight=e,this._lastWidth=t};Ow.prototype.applyThemeChanges=function(){let e=this._container.ownerDocument;if(!e.body.contains(this._container)){if(l(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=RA(this._themeNormal),n=RA(this._themeHover),i=RA(this._themeSelect),r=RA(this._themeDisabled),o=RA(this._themeKnob),a=RA(this._themePointer),s=RA(this._themeSwoosh),c=RA(this._themeSwooshHover),u=mm({tagName:"defs",children:[{id:"animation_buttonNormal",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Oa(t,jO)},{tagName:"stop",offset:"12%","stop-color":Oa(t,a9)},{tagName:"stop",offset:"46%","stop-color":Oa(t,Rre)},{tagName:"stop",offset:"81%","stop-color":Oa(t,s9)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Oa(n,jO)},{tagName:"stop",offset:"12%","stop-color":Oa(n,a9)},{tagName:"stop",offset:"46%","stop-color":Oa(n,Rre)},{tagName:"stop",offset:"81%","stop-color":Oa(n,s9)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Oa(i,jO)},{tagName:"stop",offset:"12%","stop-color":Oa(i,a9)},{tagName:"stop",offset:"46%","stop-color":Oa(i,Rre)},{tagName:"stop",offset:"81%","stop-color":Oa(i,s9)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Oa(r,Czt)},{tagName:"stop",offset:"75%","stop-color":Oa(r,vzt)}]},{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":s.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":s.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":s.toCssColorString()}]},{id:"animation_shuttleRingSwooshHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":c.toCssColorString()}]},{id:"animation_shuttleRingPointerGradient",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":a.toCssColorString()},{tagName:"stop",offset:"40%","stop-color":a.toCssColorString()},{tagName:"stop",offset:"60%","stop-color":Oa(a,tLe)},{tagName:"stop",offset:"100%","stop-color":Oa(a,tLe)}]},{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":Oa(o,jO)},{tagName:"stop",offset:"60%","stop-color":Oa(o,eLe)},{tagName:"stop",offset:"85%","stop-color":Oa(o,a9)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":Oa(o,eLe)},{tagName:"stop",offset:"60%","stop-color":Oa(o,jO)},{tagName:"stop",offset:"85%","stop-color":Oa(o,s9)}]}]});l(this._defsElement)?this._svgNode.replaceChild(u,this._defsElement):this._svgNode.appendChild(u),this._defsElement=u};var l9=Ow;var Izt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],OA=15,Mw=105;function iLe(e,t){return e-t}function Lre(e,t){let n=Cr(t,e,iLe);return n<0?~n:n}function Pzt(e,t){if(Math.abs(e)<=OA)return e/OA;let n=OA,i=Mw,r,o=0,a;return e>0?(r=Math.log(t[t.length-1]),a=(r-o)/(i-n),Math.exp(o+a*(e-n))):(r=Math.log(-t[0]),a=(r-o)/(i-n),-Math.exp(o+a*(Math.abs(e)-n)))}function Dzt(e,t,n){if(n.clockStep===Br.SYSTEM_CLOCK)return OA;if(Math.abs(e)<=1)return e*OA;let i=t[t.length-1];e>i?e=i:e<-i&&(e=-i);let r=OA,o=Mw,a,s=0,c;return e>0?(a=Math.log(i),c=(a-s)/(o-r),(Math.log(e)-s)/c+r):(a=Math.log(-t[0]),c=(a-s)/(o-r),-((Math.log(Math.abs(e))-s)/c+r))}function Yd(e){let t=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=Yd.defaultDateFormatter,this._timeFormatter=Yd.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,Ee.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(Yd.defaultTicks),this.timeLabel=void 0,Ee.defineProperty(this,"timeLabel",function(){return t._timeFormatter(t._clockViewModel.currentTime,t)}),this.dateLabel=void 0,Ee.defineProperty(this,"dateLabel",function(){return t._dateFormatter(t._clockViewModel.currentTime,t)}),this.multiplierLabel=void 0,Ee.defineProperty(this,"multiplierLabel",function(){let a=t._clockViewModel;if(a.clockStep===Br.SYSTEM_CLOCK)return"Today";let s=a.multiplier;return s%1===0?`${s.toFixed(0)}x`:`${s.toFixed(3).replace(/0{0,3}$/,"")}x`}),this.shuttleRingAngle=void 0,Ee.defineProperty(this,"shuttleRingAngle",{get:function(){return Dzt(e.multiplier,t._allShuttleRingTicks,e)},set:function(a){a=Math.max(Math.min(a,Mw),-Mw);let s=t._allShuttleRingTicks,c=t._clockViewModel;if(c.clockStep=Br.SYSTEM_CLOCK_MULTIPLIER,Math.abs(a)===Mw){c.multiplier=a>0?s[s.length-1]:s[0];return}let u=Pzt(a,s);if(t.snapToTicks)u=s[Lre(u,s)];else if(u!==0){let f=Math.abs(u);if(f>100){let d=f.toFixed(0).length-2,p=Math.pow(10,d);u=Math.round(u/p)*p|0}else f>OA?u=Math.round(u):f>1?u=+u.toFixed(1):f>0&&(u=+u.toFixed(2))}c.multiplier=u}}),this._canAnimate=void 0,Ee.defineProperty(this,"_canAnimate",function(){let a=t._clockViewModel,s=a.clockRange;if(t.shuttleRingDragging||s===_a.UNBOUNDED)return!0;let c=a.multiplier,u=a.currentTime,f=a.startTime,d;if(s===_a.LOOP_STOP)d=K.greaterThan(u,f)||u.equals(f)&&c>0;else{let p=a.stopTime;d=K.greaterThan(u,f)&&K.lessThan(u,p)||u.equals(f)&&c>0||u.equals(p)&&c<0}return d||(a.shouldAnimate=!1),d}),this._isSystemTimeAvailable=void 0,Ee.defineProperty(this,"_isSystemTimeAvailable",function(){let a=t._clockViewModel;if(a.clockRange===_a.UNBOUNDED)return!0;let c=a.systemTime;return K.greaterThanOrEquals(c,a.startTime)&&K.lessThanOrEquals(c,a.stopTime)}),this._isAnimating=void 0,Ee.defineProperty(this,"_isAnimating",function(){return t._clockViewModel.shouldAnimate&&(t._canAnimate||t.shuttleRingDragging)});let n=Ln(function(){let a=t._clockViewModel;a.shouldAnimate?a.shouldAnimate=!1:t._canAnimate&&(a.shouldAnimate=!0)});this._pauseViewModel=new bT(n,{toggled:Ee.computed(function(){return!t._isAnimating}),tooltip:"Pause"});let i=Ln(function(){let a=t._clockViewModel,s=a.multiplier;s>0&&(a.multiplier=-s),a.shouldAnimate=!0});this._playReverseViewModel=new bT(i,{toggled:Ee.computed(function(){return t._isAnimating&&e.multiplier<0}),tooltip:"Play Reverse"});let r=Ln(function(){let a=t._clockViewModel,s=a.multiplier;s<0&&(a.multiplier=-s),a.shouldAnimate=!0});this._playForwardViewModel=new bT(r,{toggled:Ee.computed(function(){return t._isAnimating&&e.multiplier>0&&e.clockStep!==Br.SYSTEM_CLOCK}),tooltip:"Play Forward"});let o=Ln(function(){t._clockViewModel.clockStep=Br.SYSTEM_CLOCK},Ee.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new bT(o,{toggled:Ee.computed(function(){return e.clockStep===Br.SYSTEM_CLOCK}),tooltip:Ee.computed(function(){return t._isSystemTimeAvailable?"Today (real-time)":"Current time not in range"})}),this._slower=Ln(function(){let a=t._clockViewModel,s=t._allShuttleRingTicks,c=a.multiplier,u=Lre(c,s)-1;u>=0&&(a.multiplier=s[u])}),this._faster=Ln(function(){let a=t._clockViewModel,s=t._allShuttleRingTicks,c=a.multiplier,u=Lre(c,s)+1;u<s.length&&(a.multiplier=s[u])})}Yd.defaultDateFormatter=function(e,t){let n=K.toGregorianDate(e);return`${Izt[n.month-1]} ${n.day} ${n.year}`};Yd.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];Yd.defaultTimeFormatter=function(e,t){let n=K.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`};Yd.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)};Yd.prototype.setShuttleRingTicks=function(e){let t,n,i,r={},o=this._sortedFilteredPositiveTicks;for(o.length=0,t=0,n=e.length;t<n;++t)i=e[t],r.hasOwnProperty(i)||(r[i]=!0,o.push(i));o.sort(iLe);let a=[];for(n=o.length,t=n-1;t>=0;--t)i=o[t],i!==0&&a.push(-i);Xn(a,o),this._allShuttleRingTicks=a};Object.defineProperties(Yd.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){this._dateFormatter=e}},timeFormatter:{get:function(){return this._timeFormatter},set:function(e){this._timeFormatter=e}}});Yd._maxShuttleRingAngle=Mw;Yd._realtimeShuttleRingAngle=OA;var u9=Yd;function rLe(e){e=e??H.EMPTY_OBJECT;let t=e.globe,n=e.imageryProviderViewModels??H.EMPTY_ARRAY,i=e.terrainProviderViewModels??H.EMPTY_ARRAY;this._globe=t,this.imageryProviderViewModels=n.slice(0),this.terrainProviderViewModels=i.slice(0),this.dropDownVisible=!1,Ee.track(this,["imageryProviderViewModels","terrainProviderViewModels","dropDownVisible"]);let r=Ee.getObservable(this,"imageryProviderViewModels"),o=Ee.pureComputed(function(){let d=r(),p={},g;for(g=0;g<d.length;g++){let A=d[g],b=A.category;l(p[b])?p[b].push(A):p[b]=[A]}let m=Object.keys(p),y=[];for(g=0;g<m.length;g++){let A=m[g];y.push({name:A,providers:p[A]})}return y});this._imageryProviders=o;let a=Ee.getObservable(this,"terrainProviderViewModels"),s=Ee.pureComputed(function(){let d=a(),p={},g;for(g=0;g<d.length;g++){let A=d[g],b=A.category;l(p[b])?p[b].push(A):p[b]=[A]}let m=Object.keys(p),y=[];for(g=0;g<m.length;g++){let A=m[g];y.push({name:A,providers:p[A]})}return y});this._terrainProviders=s,this.buttonTooltip=void 0,Ee.defineProperty(this,"buttonTooltip",function(){let d=this.selectedImagery,p=this.selectedTerrain,g=l(d)?d.name:void 0,m=l(p)?p.name:void 0;return l(g)&&l(m)?`${g}
|
|
${m}`:l(g)?g:m}),this.buttonImageUrl=void 0,Ee.defineProperty(this,"buttonImageUrl",function(){let d=this.selectedImagery;if(l(d))return d.iconUrl}),this.selectedImagery=void 0;let c=Ee.observable();this._currentImageryLayers=[],Ee.defineProperty(this,"selectedImagery",{get:function(){return c()},set:function(d){if(c()===d){this.dropDownVisible=!1;return}let p,g=this._currentImageryLayers,m=g.length,y=this._globe.imageryLayers,A=!1;for(p=0;p<m;p++){let b=y.length;for(let x=0;x<b;x++){let T=y.get(x);if(T===g[p]){y.remove(T),A=!0;break}}}if(l(d)){let b=d.creationCommand();if(Array.isArray(b)){let x=b.length;for(this._currentImageryLayers=[],p=x-1;p>=0;p--){let T=wa.fromProviderAsync(b[p]);y.add(T,0),this._currentImageryLayers.push(T)}}else{this._currentImageryLayers=[];let x=wa.fromProviderAsync(b);if(x.name=d.name,A)y.add(x,0);else{let T=y.get(0);l(T)&&y.remove(T),y.add(x,0)}this._currentImageryLayers.push(x)}}c(d),this.dropDownVisible=!1}}),this.selectedTerrain=void 0;let u=Ee.observable();Ee.defineProperty(this,"selectedTerrain",{get:function(){return u()},set:function(d){if(u()===d){this.dropDownVisible=!1;return}let p;if(l(d)&&(p=d.creationCommand()),l(p)&&!l(p.then))this._globe.depthTestAgainstTerrain=!(p instanceof B0),this._globe.terrainProvider=p;else if(l(p)){let g=!1,m=this._globe.terrainProviderChanged.addEventListener(()=>{g=!0,m()}),A=new $5(p).readyEvent.addEventListener(b=>{g||(this._globe.depthTestAgainstTerrain=!(b instanceof B0),this._globe.terrainProvider=b,A())})}u(d),this.dropDownVisible=!1}});let f=this;this._toggleDropDown=Ln(function(){f.dropDownVisible=!f.dropDownVisible}),this.selectedImagery=e.selectedImageryProviderViewModel??n[0],this.selectedTerrain=e.selectedTerrainProviderViewModel}Object.defineProperties(rLe.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}});var f9=rLe;function d9(e,t){e=zn(e);let n=new f9(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 r=document.createElement("img");r.setAttribute("draggable","false"),r.className="cesium-baseLayerPicker-selected",r.setAttribute("data-bind","attr: { src: buttonImageUrl }, visible: !!buttonImageUrl"),i.appendChild(r);let o=document.createElement("div");o.className="cesium-baseLayerPicker-dropDown",o.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-dropDown-visible" : dropDownVisible }'),e.appendChild(o);let a=document.createElement("div");a.className="cesium-baseLayerPicker-sectionTitle",a.setAttribute("data-bind","visible: imageryProviderViewModels.length > 0"),a.innerHTML="Imagery",o.appendChild(a);let s=document.createElement("div");s.className="cesium-baseLayerPicker-section",s.setAttribute("data-bind","foreach: _imageryProviders"),o.appendChild(s);let c=document.createElement("div");c.className="cesium-baseLayerPicker-category",s.appendChild(c);let u=document.createElement("div");u.className="cesium-baseLayerPicker-categoryTitle",u.setAttribute("data-bind","text: name"),c.appendChild(u);let f=document.createElement("div");f.className="cesium-baseLayerPicker-choices",f.setAttribute("data-bind","foreach: providers"),c.appendChild(f);let d=document.createElement("div");d.className="cesium-baseLayerPicker-item",d.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(d);let p=document.createElement("img");p.className="cesium-baseLayerPicker-itemIcon",p.setAttribute("data-bind","attr: { src: iconUrl }"),p.setAttribute("draggable","false"),d.appendChild(p);let g=document.createElement("div");g.className="cesium-baseLayerPicker-itemLabel",g.setAttribute("data-bind","text: name"),d.appendChild(g);let m=document.createElement("div");m.className="cesium-baseLayerPicker-sectionTitle",m.setAttribute("data-bind","visible: terrainProviderViewModels.length > 0"),m.innerHTML="Terrain",o.appendChild(m);let y=document.createElement("div");y.className="cesium-baseLayerPicker-section",y.setAttribute("data-bind","foreach: _terrainProviders"),o.appendChild(y);let A=document.createElement("div");A.className="cesium-baseLayerPicker-category",y.appendChild(A);let b=document.createElement("div");b.className="cesium-baseLayerPicker-categoryTitle",b.setAttribute("data-bind","text: name"),A.appendChild(b);let x=document.createElement("div");x.className="cesium-baseLayerPicker-choices",x.setAttribute("data-bind","foreach: providers"),A.appendChild(x);let T=document.createElement("div");T.className="cesium-baseLayerPicker-item",T.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedTerrain },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedTerrain = $data; }'),x.appendChild(T);let C=document.createElement("img");C.className="cesium-baseLayerPicker-itemIcon",C.setAttribute("data-bind","attr: { src: iconUrl }"),C.setAttribute("draggable","false"),T.appendChild(C);let E=document.createElement("div");E.className="cesium-baseLayerPicker-itemLabel",E.setAttribute("data-bind","text: name"),T.appendChild(E),Ee.applyBindings(n,i),Ee.applyBindings(n,o),this._viewModel=n,this._container=e,this._element=i,this._dropPanel=o,this._closeDropDown=function(w){i.contains(w.target)||o.contains(w.target)||(n.dropDownVisible=!1)},fn.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(d9.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});d9.prototype.isDestroyed=function(){return!1};d9.prototype.destroy=function(){return fn.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Ee.cleanNode(this._element),Ee.cleanNode(this._dropPanel),this._container.removeChild(this._element),this._container.removeChild(this._dropPanel),ue(this)};var h9=d9;function oLe(e){let t=e.creationFunction;l(t.canExecute)||(t=Ln(t)),this._creationCommand=t,this.name=e.name,this.tooltip=e.tooltip,this.iconUrl=e.iconUrl,this._category=e.category??"",Ee.track(this,["name","tooltip","iconUrl"])}Object.defineProperties(oLe.prototype,{creationCommand:{get:function(){return this._creationCommand}},category:{get:function(){return this._category}}});var ho=oLe;function Rzt(){let e=[],t=devicePixelRatio>=2;return e.push(new ho({name:"Bing Maps Aerial",iconUrl:$t("Widgets/Images/ImageryProviders/bingAerial.png"),tooltip:"Bing Maps aerial imagery, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return Iy({style:wy.AERIAL})}})),e.push(new ho({name:"Bing Maps Aerial with Labels",iconUrl:$t("Widgets/Images/ImageryProviders/bingAerialLabels.png"),tooltip:"Bing Maps aerial imagery with labels, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return Iy({style:wy.AERIAL_WITH_LABELS})}})),e.push(new ho({name:"Bing Maps Roads",iconUrl:$t("Widgets/Images/ImageryProviders/bingRoads.png"),tooltip:"Bing Maps standard road maps, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return Iy({style:wy.ROAD})}})),e.push(new ho({name:"ArcGIS World Imagery",iconUrl:$t("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 Sy.fromBasemapType(Ap.SATELLITE,{enablePickFeatures:!1})}})),e.push(new ho({name:"ArcGIS World Hillshade",iconUrl:$t("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 Sy.fromBasemapType(Ap.HILLSHADE,{enablePickFeatures:!1})}})),e.push(new ho({name:"Esri World Ocean",iconUrl:$t("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 Sy.fromBasemapType(Ap.OCEANS,{enablePickFeatures:!1})}})),e.push(new ho({name:"Open\xADStreet\xADMap",iconUrl:$t("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 DA({url:"https://tile.openstreetmap.org/"})}})),e.push(new ho({name:"Stadia x Stamen Watercolor",iconUrl:$t("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 DA({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 ho({name:"Stadia x Stamen Toner",iconUrl:$t("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 DA({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 ho({name:"Stadia Alidade Smooth",iconUrl:$t("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 DA({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 ho({name:"Stadia Alidade Smooth Dark",iconUrl:$t("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 DA({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 ho({name:"Sentinel-2",iconUrl:$t("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 Eu.fromAssetId(3954)}})),e.push(new ho({name:"Blue Marble",iconUrl:$t("Widgets/Images/ImageryProviders/blueMarble.png"),tooltip:"Blue Marble Next Generation July, 2004 imagery from NASA.",category:"Cesium ion",creationFunction:function(){return Eu.fromAssetId(3845)}})),e.push(new ho({name:"Earth at night",iconUrl:$t("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 Eu.fromAssetId(3812)}})),e.push(new ho({name:"Natural Earth\xA0II",iconUrl:$t("Widgets/Images/ImageryProviders/naturalEarthII.png"),tooltip:`Natural Earth II, darkened for contrast.
|
|
http://www.naturalearthdata.com/`,category:"Cesium ion",creationFunction:function(){return sx.fromUrl($t("Assets/Textures/NaturalEarthII"))}})),e.push(new ho({name:"Google Maps Satellite",iconUrl:$t("Widgets/Images/ImageryProviders/googleSatellite.png"),tooltip:"Imagery from Google Maps",category:"Cesium ion",creationFunction:function(){return Eu.fromAssetId(3830182)}})),e.push(new ho({name:"Google Maps Satellite with Labels",iconUrl:$t("Widgets/Images/ImageryProviders/googleSatelliteLabels.png"),tooltip:"Imagery with place labels from Google Maps",category:"Cesium ion",creationFunction:function(){return Eu.fromAssetId(3830183)}})),e.push(new ho({name:"Google Maps Roadmap",iconUrl:$t("Widgets/Images/ImageryProviders/googleRoadmap.png"),tooltip:"Labeled roads and other features on a base landscape from Google Maps",category:"Cesium ion",creationFunction:function(){return Eu.fromAssetId(3830184)}})),e.push(new ho({name:"Google Maps Contour",iconUrl:$t("Widgets/Images/ImageryProviders/googleContour.png"),tooltip:"Hillshade mapping, contour lines, natural features (roadmap features hidden) from Google Maps",category:"Cesium ion",creationFunction:function(){return Eu.fromAssetId(3830186)}})),e.push(new ho({name:"Azure Maps Aerial",iconUrl:$t("Widgets/Images/ImageryProviders/azureAerial.png"),tooltip:"Imagery from Azure Maps",category:"Cesium ion",creationFunction:function(){return Eu.fromAssetId(3891168)}})),e.push(new ho({name:"Azure Maps Roads",iconUrl:$t("Widgets/Images/ImageryProviders/azureRoads.png"),tooltip:"Labeled roads and other features on a base landscape from Azure Maps",category:"Cesium ion",creationFunction:function(){return Eu.fromAssetId(3891169)}})),e}var m9=Rzt;function Ozt(){let e=[];return e.push(new ho({name:"WGS84 Ellipsoid",iconUrl:$t("Widgets/Images/TerrainProviders/Ellipsoid.png"),tooltip:"WGS84 standard ellipsoid, also known as EPSG:4326",category:"Cesium ion",creationFunction:function(){return new B0({ellipsoid:te.WGS84})}})),e.push(new ho({name:"Cesium World Terrain",iconUrl:$t("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 _v({requestWaterMask:!0,requestVertexNormals:!0})}})),e}var p9=Ozt;function Mzt(e){let t;if(l(e)){t="Command Statistics";let n=e.commandsInFrustums;for(let i in n)if(n.hasOwnProperty(i)){let r=parseInt(i,10),o;if(r===7)o="1, 2 and 3";else{let a=[];for(let s=2;s>=0;s--){let c=Math.pow(2,s);r>=c&&(a.push(s+1),r-=c)}o=a.reverse().join(" and ")}t+=`<br> ${n[i]} in frustum ${o}`}t+=`<br>Total: ${e.totalCommands}`}return t}function Nre(e,t,n){let i=Math.min(n,t);return i=Math.max(i,e),i}var Lzt=new hn,Nzt=new h;function GO(e,t){let n=this,i=e.canvas,r=new os(i);this._eventHandler=r,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 o=this._scene.globe;o.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="",Ee.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=Ln(function(){n.dropDownVisible=!n.dropDownVisible}),this._toggleGeneral=Ln(function(){n.generalVisible=!n.generalVisible}),this._togglePrimitives=Ln(function(){n.primitivesVisible=!n.primitivesVisible}),this._toggleTerrain=Ln(function(){n.terrainVisible=!n.terrainVisible}),this._frustumsSubscription=Ee.getObservable(this,"frustums").subscribe(function(u){n._scene.debugShowFrustums=u,n._scene.requestRender()}),this._frustumPlanesSubscription=Ee.getObservable(this,"frustumPlanes").subscribe(function(u){n._scene.debugShowFrustumPlanes=u,n._scene.requestRender()}),this._performanceSubscription=Ee.getObservable(this,"performance").subscribe(function(u){u?n._performanceDisplay=new nA({container:n._performanceContainer}):n._performanceContainer.innerHTML=""}),this._showPrimitiveBoundingSphere=Ln(function(){return n._primitive.debugShowBoundingVolume=n.primitiveBoundingSphere,n._scene.requestRender(),!0}),this._primitiveBoundingSphereSubscription=Ee.getObservable(this,"primitiveBoundingSphere").subscribe(function(){n._showPrimitiveBoundingSphere()}),this._showPrimitiveReferenceFrame=Ln(function(){if(n.primitiveReferenceFrame){let u=n._primitive.modelMatrix;n._modelMatrixPrimitive=new v5({modelMatrix:u}),n._scene.primitives.add(n._modelMatrixPrimitive)}else l(n._modelMatrixPrimitive)&&(n._scene.primitives.remove(n._modelMatrixPrimitive),n._modelMatrixPrimitive=void 0);return n._scene.requestRender(),!0}),this._primitiveReferenceFrameSubscription=Ee.getObservable(this,"primitiveReferenceFrame").subscribe(function(){n._showPrimitiveReferenceFrame()}),this._doFilterPrimitive=Ln(function(){return n.filterPrimitive?n._scene.debugCommandFilter=function(u){return l(n._modelMatrixPrimitive)&&u.owner===n._modelMatrixPrimitive._primitive?!0:l(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=Ee.getObservable(this,"filterPrimitive").subscribe(function(){n._doFilterPrimitive(),n._scene.requestRender()}),this._wireframeSubscription=Ee.getObservable(this,"wireframe").subscribe(function(u){o._surface.tileProvider._debug.wireframe=u,n._scene.requestRender()}),this._depthFrustumSubscription=Ee.getObservable(this,"depthFrustum").subscribe(function(u){n._scene.debugShowDepthFrustum=u,n._scene.requestRender()}),this._incrementDepthFrustum=Ln(function(){let u=n.depthFrustum+1;return n.depthFrustum=Nre(1,n._numberOfFrustums,u),n._scene.requestRender(),!0}),this._decrementDepthFrustum=Ln(function(){let u=n.depthFrustum-1;return n.depthFrustum=Nre(1,n._numberOfFrustums,u),n._scene.requestRender(),!0}),this._suspendUpdatesSubscription=Ee.getObservable(this,"suspendUpdates").subscribe(function(u){o._surface._debug.suspendLodUpdate=u,u||(n.filterTile=!1)});let a;this._showTileCoordinates=Ln(function(){return n.tileCoordinates&&!l(a)?a=e.imageryLayers.addImageryProvider(new J5({tilingScheme:e.terrainProvider.tilingScheme})):!n.tileCoordinates&&l(a)&&(e.imageryLayers.remove(a),a=void 0),!0}),this._tileCoordinatesSubscription=Ee.getObservable(this,"tileCoordinates").subscribe(function(){n._showTileCoordinates(),n._scene.requestRender()}),this._tileBoundingSphereSubscription=Ee.getObservable(this,"tileBoundingSphere").subscribe(function(){n._showTileBoundingSphere(),n._scene.requestRender()}),this._showTileBoundingSphere=Ln(function(){return n.tileBoundingSphere?o._surface.tileProvider._debug.boundingSphereTile=n._tile:o._surface.tileProvider._debug.boundingSphereTile=void 0,n._scene.requestRender(),!0}),this._doFilterTile=Ln(function(){return n.filterTile?(n.suspendUpdates=!0,o._surface._tilesToRender=[],l(n._tile)&&n._tile.renderable&&o._surface._tilesToRender.push(n._tile)):n.suspendUpdates=!1,!0}),this._filterTileSubscription=Ee.getObservable(this,"filterTile").subscribe(function(){n.doFilterTile(),n._scene.requestRender()});function s(u){let f=n._scene.pick({x:u.position.x,y:u.position.y});l(f)&&(n.primitive=l(f.collection)?f.collection:f.primitive),n._scene.requestRender(),n.pickPrimitiveActive=!1}this._pickPrimitive=Ln(function(){n.pickPrimitiveActive=!n.pickPrimitiveActive}),this._pickPrimitiveActiveSubscription=Ee.getObservable(this,"pickPrimitiveActive").subscribe(function(u){u?r.setInputAction(s,ln.LEFT_CLICK):r.removeInputAction(ln.LEFT_CLICK)});function c(u){let f,d=o.ellipsoid,p=n._scene.camera.getPickRay(u.position,Lzt),g=o.pick(p,n._scene,Nzt);if(l(g)){let m=d.cartesianToCartographic(g),y=o._surface.tileProvider._tilesToRenderByTextureCount;for(let A=0;!f&&A<y.length;++A){let b=y[A];if(l(b))for(let x=0;!f&&x<b.length;++x){let T=b[x];ie.contains(T.rectangle,m)&&(f=T)}}}n.tile=f,n.pickTileActive=!1}this._pickTile=Ln(function(){n.pickTileActive=!n.pickTileActive}),this._pickTileActiveSubscription=Ee.getObservable(this,"pickTileActive").subscribe(function(u){u?r.setInputAction(c,ln.LEFT_CLICK):r.removeInputAction(ln.LEFT_CLICK)}),this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()})}Object.defineProperties(GO.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 Ln(function(){e.tile=e.tile.parent})}},selectNW:{get:function(){let e=this;return Ln(function(){e.tile=e.tile.northwestChild})}},selectNE:{get:function(){let e=this;return Ln(function(){e.tile=e.tile.northeastChild})}},selectSW:{get:function(){let e=this;return Ln(function(){e.tile=e.tile.southwestChild})}},selectSE:{get:function(){let e=this;return Ln(function(){e.tile=e.tile.southeastChild})}},primitive:{get:function(){return this._primitive},set:function(e){let t=this._primitive;e!==t&&(this.hasPickedPrimitive=!0,l(t)&&(t.debugShowBoundingVolume=!1),this._scene.debugCommandFilter=void 0,l(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(l(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;l(n)&&l(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}}});GO.prototype._update=function(){this.frustums&&(this.frustumStatisticText=Mzt(this._scene.debugFrustumStatistics));let e=this._scene.numberOfFrustums;this._numberOfFrustums=e,this.depthFrustum=Nre(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}`};GO.prototype.isDestroyed=function(){return!1};GO.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(),ue(this)};var g9=GO;function _9(e,t){e=zn(e);let n=document.createElement("div"),i=new g9(t,n);this._viewModel=i,this._container=e;let r=document.createElement("div");this._element=r;let o=document.createElement("div");o.textContent="Cesium Inspector",o.className="cesium-cesiumInspector-button",o.setAttribute("data-bind","click: toggleDropDown"),r.appendChild(o),r.className="cesium-cesiumInspector",r.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : dropDownVisible, "cesium-cesiumInspector-hidden" : !dropDownVisible }'),e.appendChild(this._element);let a=document.createElement("div");a.className="cesium-cesiumInspector-dropDown",r.appendChild(a);let s=Of.createSection,c=Of.createCheckbox,u=s(a,"General","generalVisible","toggleGeneral"),f=c("Show Frustums","frustums"),d=document.createElement("div");d.className="cesium-cesiumInspector-frustumStatistics",d.setAttribute("data-bind","visible: frustums, html: frustumStatisticText"),f.appendChild(d),u.appendChild(f),u.appendChild(c("Show Frustum Planes","frustumPlanes")),u.appendChild(c("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 A=document.createElement("input");A.type="button",A.value="-",A.className="cesium-cesiumInspector-pickButton",A.setAttribute("data-bind","click: decrementDepthFrustum"),g.appendChild(A);let b=document.createElement("input");b.type="button",b.value="+",b.className="cesium-cesiumInspector-pickButton",b.setAttribute("data-bind","click: incrementDepthFrustum"),g.appendChild(b);let x=s(a,"Primitives","primitivesVisible","togglePrimitives"),T=document.createElement("div");T.className="cesium-cesiumInspector-pickSection",x.appendChild(T);let C=document.createElement("input");C.type="button",C.value="Pick a primitive",C.className="cesium-cesiumInspector-pickButton",C.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive');let E=document.createElement("div");E.className="cesium-cesiumInspector-center",E.appendChild(C),T.appendChild(E),T.appendChild(c("Show bounding sphere","primitiveBoundingSphere","hasPickedPrimitive")),T.appendChild(c("Show reference frame","primitiveReferenceFrame","hasPickedPrimitive")),this._primitiveOnly=c("Show only selected","filterPrimitive","hasPickedPrimitive"),T.appendChild(this._primitiveOnly);let w=s(a,"Terrain","terrainVisible","toggleTerrain"),D=document.createElement("div");D.className="cesium-cesiumInspector-pickSection",w.appendChild(D);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'),E=document.createElement("div"),E.appendChild(R),E.className="cesium-cesiumInspector-center",D.appendChild(E);let M=document.createElement("div");D.appendChild(M);let N=document.createElement("input");N.type="button",N.value="Parent",N.className="cesium-cesiumInspector-pickButton",N.setAttribute("data-bind","click: selectParent");let _=document.createElement("input");_.type="button",_.value="NW",_.className="cesium-cesiumInspector-pickButton",_.setAttribute("data-bind","click: selectNW");let v=document.createElement("input");v.type="button",v.value="NE",v.className="cesium-cesiumInspector-pickButton",v.setAttribute("data-bind","click: selectNE");let S=document.createElement("input");S.type="button",S.value="SW",S.className="cesium-cesiumInspector-pickButton",S.setAttribute("data-bind","click: selectSW");let P=document.createElement("input");P.type="button",P.value="SE",P.className="cesium-cesiumInspector-pickButton",P.setAttribute("data-bind","click: selectSE");let L=document.createElement("div");L.className="cesium-cesiumInspector-tileText",M.className="cesium-cesiumInspector-frustumStatistics",M.appendChild(L),M.setAttribute("data-bind","visible: hasPickedTile"),L.setAttribute("data-bind","html: tileText");let F=document.createElement("div");F.className="cesium-cesiumInspector-relativeText",F.textContent="Select relative:",M.appendChild(F);let V=document.createElement("table"),z=document.createElement("tr"),j=document.createElement("tr"),B=document.createElement("td");B.appendChild(N);let G=document.createElement("td");G.appendChild(_);let W=document.createElement("td");W.appendChild(v),z.appendChild(B),z.appendChild(G),z.appendChild(W);let Q=document.createElement("td"),q=document.createElement("td");q.appendChild(S);let J=document.createElement("td");J.appendChild(P),j.appendChild(Q),j.appendChild(q),j.appendChild(J),V.appendChild(z),V.appendChild(j),M.appendChild(V),D.appendChild(c("Show bounding volume","tileBoundingSphere","hasPickedTile")),D.appendChild(c("Show only selected","filterTile","hasPickedTile")),w.appendChild(c("Wireframe","wireframe")),w.appendChild(c("Suspend LOD update","suspendUpdates")),w.appendChild(c("Show tile coordinates","tileCoordinates")),Ee.applyBindings(i,this._element)}Object.defineProperties(_9.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});_9.prototype.isDestroyed=function(){return!1};_9.prototype.destroy=function(){return Ee.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),ue(this)};var y9=_9;function Fzt(e){return function(t){let n=e._scene.pick(t.position);l(n)&&n.primitive instanceof Yo&&(e.tileset=n.primitive),e.pickActive=!1}}function sLe(e,t){t?e._eventHandler.setInputAction(function(n){let i=e._scene.pick(n.endPosition);l(i)&&i.primitive instanceof Yo&&(e.tileset=i.primitive)},ln.MOUSE_MOVE):(e._eventHandler.removeInputAction(ln.MOUSE_MOVE),e.picking=e.picking)}var Bzt={maximumFractionDigits:3};function WO(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,Bzt):Math.round(t).toLocaleString()}function qO(e,t){if(!l(e))return"";let n=t?e._statisticsPerPass[lo.PICK]:e._statisticsPerPass[lo.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>${WO(n.geometryByteLength)}</li><li><strong>Texture Memory (MB): </strong>${WO(n.texturesByteLength)}</li><li><strong>Batch Table Memory (MB): </strong>${WO(n.batchTableByteLength)}</li>`,i+="</ul>"),i}function cLe(){let e=Ni.statistics;return`
|
|
<ul class="cesium-cesiumInspector-statistics">
|
|
<li><strong>Geometry Memory (MB): </strong>${WO(e.geometryByteLength)}</li>
|
|
<li><strong>Texture Memory (MB): </strong>${WO(e.texturesByteLength)}</li>
|
|
</ul>
|
|
`}var kzt=[{text:"Highlight",value:sf.HIGHLIGHT},{text:"Replace",value:sf.REPLACE},{text:"Mix",value:sf.MIX}],aLe=new U(1,1,0,.4),zzt=new U,A9=new U;function cc(e,t){let n=this,i=e.canvas;this._eventHandler=new os(i),this._scene=e,this._performanceContainer=t,this._canvas=i,this._performanceDisplay=new nA({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,Ee.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=Ee.observable({}),this.properties=[],Ee.defineProperty(this,"properties",function(){let B=[],G=n._properties();for(let W in G)G.hasOwnProperty(W)&&B.push(W);return B});let r=Ee.observable();Ee.defineProperty(this,"dynamicScreenSpaceError",{get:function(){return r()},set:function(B){r(B),l(n._tileset)&&(n._tileset.dynamicScreenSpaceError=B)}}),this.dynamicScreenSpaceError=!1;let o=Ee.observable();Ee.defineProperty(this,"colorBlendMode",{get:function(){return o()},set:function(B){o(B),l(n._tileset)&&(n._tileset.colorBlendMode=B,n._scene.requestRender())}}),this.colorBlendMode=sf.HIGHLIGHT;let a=Ee.observable(),s=Ee.observable();Ee.defineProperty(this,"picking",{get:function(){return s()},set:function(B){s(B),B?n._eventHandler.setInputAction(function(G){let W=e.pick(G.endPosition);if(W instanceof us?(n.feature=W,n.tile=W.content.tile):l(W)&&l(W.content)?(n.feature=void 0,n.tile=W.content.tile):(n.feature=void 0,n.tile=void 0),!!l(n._tileset)){if(a&&l(W)&&l(W.content)){let Q;e.pickPositionSupported&&(Q=e.pickPosition(G.endPosition),l(Q)&&(n._tileset.debugPickPosition=Q)),n._tileset.debugPickedTile=W.content.tile}else n._tileset.debugPickedTile=void 0;n._scene.requestRender()}},ln.MOUSE_MOVE):(n.feature=void 0,n.tile=void 0,n._eventHandler.removeInputAction(ln.MOUSE_MOVE))}}),this.picking=!0;let c=Ee.observable();Ee.defineProperty(this,"colorize",{get:function(){return c()},set:function(B){c(B),l(n._tileset)&&(n._tileset.debugColorizeTiles=B,n._scene.requestRender())}}),this.colorize=!1;let u=Ee.observable();Ee.defineProperty(this,"wireframe",{get:function(){return u()},set:function(B){u(B),l(n._tileset)&&(n._tileset.debugWireframe=B,n._scene.requestRender())}}),this.wireframe=!1;let f=Ee.observable();Ee.defineProperty(this,"showBoundingVolumes",{get:function(){return f()},set:function(B){f(B),l(n._tileset)&&(n._tileset.debugShowBoundingVolume=B,n._scene.requestRender())}}),this.showBoundingVolumes=!1;let d=Ee.observable();Ee.defineProperty(this,"showContentBoundingVolumes",{get:function(){return d()},set:function(B){d(B),l(n._tileset)&&(n._tileset.debugShowContentBoundingVolume=B,n._scene.requestRender())}}),this.showContentBoundingVolumes=!1;let p=Ee.observable();Ee.defineProperty(this,"showRequestVolumes",{get:function(){return p()},set:function(B){p(B),l(n._tileset)&&(n._tileset.debugShowViewerRequestVolume=B,n._scene.requestRender())}}),this.showRequestVolumes=!1;let g=Ee.observable();Ee.defineProperty(this,"freezeFrame",{get:function(){return g()},set:function(B){g(B),l(n._tileset)&&(n._tileset.debugFreezeFrame=B,n._scene.debugShowFrustumPlanes=B,n._scene.requestRender())}}),this.freezeFrame=!1,Ee.defineProperty(this,"showOnlyPickedTileDebugLabel",{get:function(){return a()},set:function(B){a(B),l(n._tileset)&&(n._tileset.debugPickedTileLabelOnly=B,n._scene.requestRender())}}),this.showOnlyPickedTileDebugLabel=!1;let m=Ee.observable();Ee.defineProperty(this,"showGeometricError",{get:function(){return m()},set:function(B){m(B),l(n._tileset)&&(n._tileset.debugShowGeometricError=B,n._scene.requestRender())}}),this.showGeometricError=!1;let y=Ee.observable();Ee.defineProperty(this,"showRenderingStatistics",{get:function(){return y()},set:function(B){y(B),l(n._tileset)&&(n._tileset.debugShowRenderingStatistics=B,n._scene.requestRender())}}),this.showRenderingStatistics=!1;let A=Ee.observable();Ee.defineProperty(this,"showMemoryUsage",{get:function(){return A()},set:function(B){A(B),l(n._tileset)&&(n._tileset.debugShowMemoryUsage=B,n._scene.requestRender())}}),this.showMemoryUsage=!1;let b=Ee.observable();Ee.defineProperty(this,"showUrl",{get:function(){return b()},set:function(B){b(B),l(n._tileset)&&(n._tileset.debugShowUrl=B,n._scene.requestRender())}}),this.showUrl=!1;let x=Ee.observable();Ee.defineProperty(this,"maximumScreenSpaceError",{get:function(){return x()},set:function(B){B=Number(B),isNaN(B)||(x(B),l(n._tileset)&&(n._tileset.maximumScreenSpaceError=B))}}),this.maximumScreenSpaceError=16;let T=Ee.observable();Ee.defineProperty(this,"dynamicScreenSpaceErrorDensity",{get:function(){return T()},set:function(B){B=Number(B),isNaN(B)||(T(B),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=B))}}),this.dynamicScreenSpaceErrorDensity=2e-4,this.dynamicScreenSpaceErrorDensitySliderValue=void 0,Ee.defineProperty(this,"dynamicScreenSpaceErrorDensitySliderValue",{get:function(){return Math.pow(T(),1/6)},set:function(B){let G=Math.pow(B,6);T(G),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=G)}});let C=Ee.observable();Ee.defineProperty(this,"dynamicScreenSpaceErrorFactor",{get:function(){return C()},set:function(B){B=Number(B),isNaN(B)||(C(B),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorFactor=B))}}),this.dynamicScreenSpaceErrorFactor=24;let E=Fzt(this),w=Ee.observable();Ee.defineProperty(this,"pickActive",{get:function(){return w()},set:function(B){w(B),B?n._eventHandler.setInputAction(E,ln.LEFT_CLICK):n._eventHandler.removeInputAction(ln.LEFT_CLICK)}});let D=Ee.observable();Ee.defineProperty(this,"pointCloudShading",{get:function(){return D()},set:function(B){D(B),l(n._tileset)&&(n._tileset.pointCloudShading.attenuation=B)}}),this.pointCloudShading=!1;let R=Ee.observable();Ee.defineProperty(this,"geometricErrorScale",{get:function(){return R()},set:function(B){B=Number(B),isNaN(B)||(R(B),l(n._tileset)&&(n._tileset.pointCloudShading.geometricErrorScale=B))}}),this.geometricErrorScale=1;let M=Ee.observable();Ee.defineProperty(this,"maximumAttenuation",{get:function(){return M()},set:function(B){B=Number(B),isNaN(B)||(M(B),l(n._tileset)&&(n._tileset.pointCloudShading.maximumAttenuation=B===0?void 0:B))}}),this.maximumAttenuation=0;let N=Ee.observable();Ee.defineProperty(this,"baseResolution",{get:function(){return N()},set:function(B){B=Number(B),isNaN(B)||(N(B),l(n._tileset)&&(n._tileset.pointCloudShading.baseResolution=B===0?void 0:B))}}),this.baseResolution=0;let _=Ee.observable();Ee.defineProperty(this,"eyeDomeLighting",{get:function(){return _()},set:function(B){_(B),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLighting=B)}}),this.eyeDomeLighting=!1;let v=Ee.observable();Ee.defineProperty(this,"eyeDomeLightingStrength",{get:function(){return v()},set:function(B){B=Number(B),isNaN(B)||(v(B),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingStrength=B))}}),this.eyeDomeLightingStrength=1;let S=Ee.observable();Ee.defineProperty(this,"eyeDomeLightingRadius",{get:function(){return S()},set:function(B){B=Number(B),isNaN(B)||(S(B),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingRadius=B))}}),this.eyeDomeLightingRadius=1,this.pickActive=!1;let P=Ee.observable();Ee.defineProperty(this,"skipLevelOfDetail",{get:function(){return P()},set:function(B){P(B),l(n._tileset)&&(n._tileset.skipLevelOfDetail=B)}}),this.skipLevelOfDetail=!0;let L=Ee.observable();Ee.defineProperty(this,"skipScreenSpaceErrorFactor",{get:function(){return L()},set:function(B){B=Number(B),isNaN(B)||(L(B),l(n._tileset)&&(n._tileset.skipScreenSpaceErrorFactor=B))}}),this.skipScreenSpaceErrorFactor=16;let F=Ee.observable();Ee.defineProperty(this,"baseScreenSpaceError",{get:function(){return F()},set:function(B){B=Number(B),isNaN(B)||(F(B),l(n._tileset)&&(n._tileset.baseScreenSpaceError=B))}}),this.baseScreenSpaceError=1024;let V=Ee.observable();Ee.defineProperty(this,"skipLevels",{get:function(){return V()},set:function(B){B=Number(B),isNaN(B)||(V(B),l(n._tileset)&&(n._tileset.skipLevels=B))}}),this.skipLevels=1;let z=Ee.observable();Ee.defineProperty(this,"immediatelyLoadDesiredLevelOfDetail",{get:function(){return z()},set:function(B){z(B),l(n._tileset)&&(n._tileset.immediatelyLoadDesiredLevelOfDetail=B)}}),this.immediatelyLoadDesiredLevelOfDetail=!1;let j=Ee.observable();Ee.defineProperty(this,"loadSiblings",{get:function(){return j()},set:function(B){j(B),l(n._tileset)&&(n._tileset.loadSiblings=B)}}),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()}),l(this._tileset)||sLe(this,!0)}Object.defineProperties(cc.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 kzt}},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,l(e)){this._properties(e.properties);let t=["colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl"],n=t.length;for(let r=0;r<n;++r){let o=t[r];this[o]=this[o]}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=qO(e,!1),this._pickStatisticsText=qO(e,!0),this._resourceCacheStatisticsText=cLe(),sLe(this,!1)}},feature:{get:function(){return this._feature},set:function(e){if(this._feature===e)return;let t=this._feature;l(t)&&!t.content.isDestroyed()&&(!this.colorize&&l(this._style)?t.color=l(this._style.color)?this._style.color.evaluateColor(t,zzt):U.WHITE:t.color=A9,this._scene.requestRender()),l(e)&&(U.clone(e.color,A9),e.color=aLe,this._scene.requestRender()),this._feature=e}},tile:{get:function(){return this._tile},set:function(e){if(this._tile===e)return;let t=this._tile;l(t)&&!t.isDestroyed()&&!Fre(t.content)&&(t.color=A9,this._scene.requestRender()),l(e)&&!Fre(e.content)&&(U.clone(e.color,A9),e.color=aLe,this._scene.requestRender()),this._tile=e}}});function Fre(e){if(!l(e))return!1;if(e.featuresLength>0)return!0;let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)if(!Fre(t[i]))return!1;return!0}return!1}cc.prototype.togglePickTileset=function(){this.pickActive=!this.pickActive};cc.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};cc.prototype.toggleTileset=function(){this.tilesetVisible=!this.tilesetVisible};cc.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};cc.prototype.toggleUpdate=function(){this.updateVisible=!this.updateVisible};cc.prototype.toggleLogging=function(){this.loggingVisible=!this.loggingVisible};cc.prototype.toggleStyle=function(){this.styleVisible=!this.styleVisible};cc.prototype.toggleTileDebugLabels=function(){this.tileDebugLabelsVisible=!this.tileDebugLabelsVisible};cc.prototype.toggleOptimization=function(){this.optimizationVisible=!this.optimizationVisible};cc.prototype.trimTilesCache=function(){l(this._tileset)&&this._tileset.trimLoadedTiles()};cc.prototype.compileStyle=function(){let e=this._tileset;if(!(!l(e)||this.styleString===JSON.stringify(e.style))){this._editorError="";try{this.styleString.length===0&&(this.styleString="{}"),this._style=new Uy(JSON.parse(this.styleString)),this._shouldStyle=!0,this._scene.requestRender()}catch(t){this._editorError=t.toString()}this.feature=this._feature,this.tile=this._tile}};cc.prototype.styleEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,r=n.selectionEnd,o=r,s=n.value.slice(i,r).split(`
|
|
`),c=s.length,u;if(t.shiftKey)for(u=0;u<c;++u)s[u][0]===" "&&(s[u][1]===" "?(s[u]=s[u].substr(2),o-=2):(s[u]=s[u].substr(1),o-=1));else for(u=0;u<c;++u)s[u]=` ${s[u]}`,o+=2;let f=s.join(`
|
|
`);n.value=n.value.slice(0,i)+f+n.value.slice(r),n.selectionStart=i!==r?i:o,n.selectionEnd=o}else t.ctrlKey&&(t.keyCode===10||t.keyCode===13)&&this.compileStyle();return!0};cc.prototype._update=function(){let e=this._tileset;if(this.performance&&this._performanceDisplay.update(),l(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=qO(e,!1),this._pickStatisticsText=qO(e,!0),this._resourceCacheStatisticsText=cLe())};cc.prototype.isDestroyed=function(){return!1};cc.prototype.destroy=function(){this._eventHandler.destroy(),this._removePostRenderEvent();let e=this;return this._definedProperties.forEach(function(t){Ee.getObservable(e,t).dispose()}),ue(this)};cc.getStatistics=qO;var b9=cc;function x9(e,t){e=zn(e);let n=document.createElement("div"),i=document.createElement("div");i.setAttribute("data-bind","visible: performance");let r=new b9(t,i);this._viewModel=r,this._container=e,this._element=n;let o=document.createElement("div");o.textContent="3D Tiles Inspector",o.className="cesium-cesiumInspector-button",o.setAttribute("data-bind","click: toggleInspector"),n.appendChild(o),n.className="cesium-cesiumInspector cesium-3DTilesInspector",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),e.appendChild(n);let a=document.createElement("div");a.className="cesium-cesiumInspector-dropDown",n.appendChild(a);let s=Of.createSection,c=Of.createCheckbox,u=Of.createRangeInput,f=Of.createButton,d=s(a,"Tileset","tilesetVisible","toggleTileset"),p=s(a,"Display","displayVisible","toggleDisplay"),g=s(a,"Update","updateVisible","toggleUpdate"),m=s(a,"Logging","loggingVisible","toggleLogging"),y=s(a,"Tile Debug Labels","tileDebugLabelsVisible","toggleTileDebugLabels"),A=s(a,"Style","styleVisible","toggleStyle"),b=s(a,"Optimization","optimizationVisible","toggleOptimization"),x=document.createElement("div");x.className="field-group";let T=document.createElement("label");T.className="field-label",T.appendChild(document.createTextNode("Properties: "));let C=document.createElement("div");C.setAttribute("data-bind","text: properties"),x.appendChild(T),x.appendChild(C),d.appendChild(x),d.appendChild(f("Pick Tileset","togglePickTileset","pickActive")),d.appendChild(f("Trim Tiles Cache","trimTilesCache")),d.appendChild(c("Enable Picking","picking")),p.appendChild(c("Colorize","colorize"));let E=p.appendChild(c("Wireframe","wireframe","_tileset === undefined || hasEnabledWireframe")),w=document.createElement("p");w.setAttribute("data-bind","visible: _tileset !== undefined && !hasEnabledWireframe"),w.setAttribute("class","cesium-3DTilesInspector-disabledElementsInfo"),w.innerText="Set enableDebugWireframe to true in the tileset constructor to enable this option.",E.appendChild(w),p.appendChild(c("Bounding Volumes","showBoundingVolumes")),p.appendChild(c("Content Volumes","showContentBoundingVolumes")),p.appendChild(c("Request Volumes","showRequestVolumes")),p.appendChild(c("Point Cloud Shading","pointCloudShading"));let D=document.createElement("div");D.setAttribute("data-bind","visible: pointCloudShading"),D.appendChild(u("Geometric Error Scale","geometricErrorScale",0,2,.01)),D.appendChild(u("Maximum Attenuation","maximumAttenuation",0,32,1)),D.appendChild(u("Base Resolution","baseResolution",0,1,.01)),D.appendChild(c("Eye Dome Lighting (EDL)","eyeDomeLighting")),p.appendChild(D);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)),D.appendChild(R),g.appendChild(c("Freeze Frame","freezeFrame")),g.appendChild(c("Dynamic Screen Space Error","dynamicScreenSpaceError"));let M=document.createElement("div");M.appendChild(u("Maximum Screen Space Error","maximumScreenSpaceError",0,128,1)),g.appendChild(M);let N=document.createElement("div");N.setAttribute("data-bind","visible: dynamicScreenSpaceError"),N.appendChild(u("Screen Space Error Density","dynamicScreenSpaceErrorDensitySliderValue",0,1,.005,"dynamicScreenSpaceErrorDensity")),N.appendChild(u("Screen Space Error Factor","dynamicScreenSpaceErrorFactor",1,32,.1)),g.appendChild(N),m.appendChild(c("Performance","performance")),m.appendChild(i),m.appendChild(c("Statistics","showStatistics"));let _=document.createElement("div");_.className="cesium-3dTilesInspector-statistics",_.setAttribute("data-bind","html: statisticsText, visible: showStatistics"),m.appendChild(_),m.appendChild(c("Pick Statistics","showPickStatistics"));let v=document.createElement("div");v.className="cesium-3dTilesInspector-statistics",v.setAttribute("data-bind","html: pickStatisticsText, visible: showPickStatistics"),m.appendChild(v),m.appendChild(c("Resource Cache Statistics","showResourceCacheStatistics"));let S=document.createElement("div");S.className="cesium-3dTilesInspector-statistics",S.setAttribute("data-bind","html: resourceCacheStatisticsText, visible: showResourceCacheStatistics"),m.appendChild(S);let P=document.createElement("div");A.appendChild(P),P.appendChild(document.createTextNode("Color Blend Mode: "));let L=document.createElement("select");L.setAttribute("data-bind",'options: colorBlendModes, optionsText: "text", optionsValue: "value", value: colorBlendMode'),P.appendChild(L);let F=document.createElement("textarea");F.setAttribute("data-bind","textInput: styleString, event: { keydown: styleEditorKeyPress }"),P.className="cesium-cesiumInspector-styleEditor",P.appendChild(F);let V=f("Compile (Ctrl+Enter)","compileStyle");P.appendChild(V);let z=document.createElement("div");z.className="cesium-cesiumInspector-error",z.setAttribute("data-bind","text: editorError"),P.appendChild(z),y.appendChild(c("Show Picked Only","showOnlyPickedTileDebugLabel")),y.appendChild(c("Geometric Error","showGeometricError")),y.appendChild(c("Rendering Statistics","showRenderingStatistics")),y.appendChild(c("Memory Usage (MB)","showMemoryUsage")),y.appendChild(c("Url","showUrl")),b.appendChild(c("Skip Tile LODs","skipLevelOfDetail"));let j=document.createElement("div");j.appendChild(u("Skip SSE Factor","skipScreenSpaceErrorFactor",1,50,1)),b.appendChild(j);let B=document.createElement("div");B.appendChild(u("SSE before skipping LOD","baseScreenSpaceError",0,4096,1)),b.appendChild(B);let G=document.createElement("div");G.appendChild(u("Min. levels to skip","skipLevels",0,10,1)),b.appendChild(G),b.appendChild(c("Load only tiles that meet the max SSE.","immediatelyLoadDesiredLevelOfDetail")),b.appendChild(c("Load siblings of visible tiles","loadSiblings")),Ee.applyBindings(r,n)}Object.defineProperties(x9.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});x9.prototype.isDestroyed=function(){return!1};x9.prototype.destroy=function(){return Ee.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),ue(this)};var T9=x9;function C9(e,t){l(t)||(t=document.body),t=zn(t);let n=this,i=Ee.observable(Zo.fullscreen),r=Ee.observable(Zo.enabled),o=t.ownerDocument;this.isFullscreen=void 0,Ee.defineProperty(this,"isFullscreen",{get:function(){return i()}}),this.isFullscreenEnabled=void 0,Ee.defineProperty(this,"isFullscreenEnabled",{get:function(){return r()},set:function(a){r(a&&Zo.enabled)}}),this.tooltip=void 0,Ee.defineProperty(this,"tooltip",function(){return this.isFullscreenEnabled?i()?"Exit full screen":"Full screen":"Full screen unavailable"}),this._command=Ln(function(){Zo.fullscreen?Zo.exitFullscreen():Zo.requestFullscreen(n._fullscreenElement)},Ee.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=zn(e)??o.body,this._callback=function(){i(Zo.fullscreen)},o.addEventListener(Zo.changeEventName,this._callback)}Object.defineProperties(C9.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){this._fullscreenElement=e}},command:{get:function(){return this._command}}});C9.prototype.isDestroyed=function(){return!1};C9.prototype.destroy=function(){document.removeEventListener(Zo.changeEventName,this._callback),ue(this)};var v9=C9;var Uzt="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",Vzt="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 E9(e,t){e=zn(e);let n=new v9(t,e);n._exitFullScreenPath=Vzt,n._enterFullScreenPath=Uzt;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),Ee.applyBindings(n,i),this._container=e,this._viewModel=n,this._element=i}Object.defineProperties(E9.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});E9.prototype.isDestroyed=function(){return!1};E9.prototype.destroy=function(){return this._viewModel.destroy(),Ee.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var S9=E9;var lLe=1e3;function pm(e){l(e.geocoderServices)?this._geocoderServices=e.geocoderServices:this._geocoderServices=[new GC({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 be,this._suggestions=[],this._selectedSuggestion=void 0,this._showSuggestions=!0,this._handleArrowDown=fLe,this._handleArrowUp=uLe;let t=this;this._suggestionsVisible=Ee.pureComputed(function(){let r=Ee.getObservable(t,"_suggestions")().length>0,o=Ee.getObservable(t,"_showSuggestions")();return r&&o}),this._searchCommand=Ln(function(i){if(i=i??yb.SEARCH,t._focusTextbox=!1,l(t._selectedSuggestion))return t.activateSuggestion(t._selectedSuggestion),!1;if(t.hideSuggestions(),t.isSearchInProgress)Yzt(t);else return Wzt(t,t._geocoderServices,i)}),this.deselectSuggestion=function(){t._selectedSuggestion=void 0},this.handleKeyDown=function(i,r){let o=r.key==="ArrowDown"||r.key==="Down"||r.keyCode===40,a=r.key==="ArrowUp"||r.key==="Up"||r.keyCode===38;return(o||a)&&r.preventDefault(),!0},this.handleKeyUp=function(i,r){let o=r.key==="ArrowDown"||r.key==="Down"||r.keyCode===40,a=r.key==="ArrowUp"||r.key==="Up"||r.keyCode===38,s=r.key==="Enter"||r.keyCode===13;return a?uLe(t):o?fLe(t):s&&t._searchCommand(),!0},this.activateSuggestion=function(i){t.hideSuggestions(),t._searchText=i.displayName;let r=i.destination;mLe(t),t.destinationFound(t,r)},this.hideSuggestions=function(){t._showSuggestions=!1,t._selectedSuggestion=void 0},this.showSuggestions=function(){t._showSuggestions=!0},this.handleMouseover=function(i,r){i!==t._selectedSuggestion&&(t._selectedSuggestion=i)},this.keepExpanded=!1,this.autoComplete=e.autocomplete??!0,this.destinationFound=e.destinationFound??pm.flyToDestination,this._focusTextbox=!1,Ee.track(this,["_searchText","_isSearchInProgress","keepExpanded","_suggestions","_selectedSuggestion","_showSuggestions","_focusTextbox"]);let n=Ee.getObservable(this,"_searchText");n.extend({rateLimit:{timeout:500}}),this._suggestionSubscription=n.subscribe(function(){pm._updateSearchSuggestions(t)}),this.isSearchInProgress=void 0,Ee.defineProperty(this,"isSearchInProgress",{get:function(){return this._isSearchInProgress}}),this.searchText=void 0,Ee.defineProperty(this,"searchText",{get:function(){return this.isSearchInProgress?"Searching...":this._searchText},set:function(i){this._searchText=i}}),this.flightDuration=void 0,Ee.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(i){this._flightDuration=i}})}Object.defineProperties(pm.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}}});function uLe(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],pm._adjustSuggestionsScroll(e,n)}function fLe(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],pm._adjustSuggestionsScroll(e,i)}function jzt(e,t){let n=l(t)?t.availability:void 0;return l(n)?yv(t,[e]).then(function(i){return e=i[0],e.height+=lLe,e}):(e.height+=lLe,Promise.resolve(e))}function Hzt(e,t){let n=e._scene,i=n.ellipsoid,r=n.camera,o=n.terrainProvider,a=t,s;return t instanceof ie?I.equalsEpsilon(t.south,t.north,I.EPSILON7)&&I.equalsEpsilon(t.east,t.west,I.EPSILON7)?t=ie.center(t):s=gS(t,n):t=i.cartesianToCartographic(t),l(s)||(s=jzt(t,o)),s.then(function(c){a=i.cartographicToCartesian(c)}).finally(function(){r.flyTo({destination:a,complete:function(){e._complete.raiseEvent()},duration:e._flightDuration,endTransform:O.IDENTITY})})}async function Gzt(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 Wzt(e,t,n){let i=e._searchText;if(hLe(i)){e.showSuggestions();return}e._isSearchInProgress=!0,e._wasGeocodeCancelled=!1;let r,o;for(r=0;r<t.length;r++){if(e._wasGeocodeCancelled)return;if(o=await Gzt(t[r],i,n),l(o)&&o.state==="fulfilled"&&o.value.length>0)break}if(e._wasGeocodeCancelled)return;e._isSearchInProgress=!1,kre(e);let a=o.value;if(o.state==="fulfilled"&&l(a)&&a.length>0){e._searchText=a[0].displayName,e.destinationFound(e,a[0].destination);let s=dLe(e,rP.getCreditsFromResult(a[0]));l(s)||Bre(e,t[r].credit);return}e._searchText=`${i} (not found)`}function Bre(e,t){l(t)&&!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&(e._scene.frameState.creditDisplay.addStaticCredit(t),e._previousCredits.push(t))}function dLe(e,t){return l(t)&&t.forEach(n=>Bre(e,n)),t}function kre(e){!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&e._previousCredits.forEach(t=>{e._scene.frameState.creditDisplay.removeStaticCredit(t)}),e._previousCredits.length=0}function qzt(e,t){let n=zn(e._viewContainer),i=n.getElementsByClassName("search-results")[0],o=n.getElementsByTagName("li")[t];if(t===0){i.scrollTop=0;return}let a=o.offsetTop;a+o.clientHeight>i.clientHeight?i.scrollTop=a+o.clientHeight:a<i.scrollTop&&(i.scrollTop=a)}function Yzt(e){e._isSearchInProgress&&(e._isSearchInProgress=!1,e._wasGeocodeCancelled=!0)}function hLe(e){return/^\s*$/.test(e)}function mLe(e){Ee.getObservable(e,"_suggestions").removeAll()}async function Xzt(e){if(!e.autoComplete)return;let t=e._searchText;if(mLe(e),kre(e),!hLe(t))for(let n of e._geocoderServices){let i=await n.geocode(t,yb.AUTOCOMPLETE);if(e._suggestions=e._suggestions.concat(i),i.length>0){let r=!0;i.forEach(o=>{let a=rP.getCreditsFromResult(o);r=r&&!l(a),dLe(e,a)}),r&&Bre(e,n.credit)}if(e._suggestions.length>=5)return}}pm.flyToDestination=Hzt;pm._updateSearchSuggestions=Xzt;pm._adjustSuggestionsScroll=qzt;pm.prototype.isDestroyed=function(){return!1};pm.prototype.destroy=function(){return this._suggestionSubscription.dispose(),kre(this),ue(this)};var w9=pm;var Kzt="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",$zt="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 I9(e){let t=zn(e.container),n=new w9(e);n._startSearchPath=Kzt,n._stopSearchPath=$zt;let i=document.createElement("form");i.setAttribute("data-bind","submit: search");let r=document.createElement("input");r.type="search",r.className="cesium-geocoder-input",r.setAttribute("placeholder","Enter an address or landmark..."),r.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(){r.select()},0)},r.addEventListener("focus",this._onTextBoxFocus,!1),i.appendChild(r),this._textBox=r;let o=document.createElement("span");o.className="cesium-geocoder-searchButton",o.setAttribute("data-bind","click: search,cesiumSvgPath: { path: isSearchInProgress ? _stopSearchPath : _startSearchPath, width: 32, height: 32 }"),i.appendChild(o),t.appendChild(i);let a=document.createElement("div");a.className="search-results",a.setAttribute("data-bind","visible: _suggestionsVisible");let s=document.createElement("ul");s.setAttribute("data-bind","foreach: _suggestions");let c=document.createElement("li");s.appendChild(c),c.setAttribute("data-bind","text: $data.displayName, click: $parent.activateSuggestion, event: { mouseover: $parent.handleMouseover}, css: { active: $data === $parent._selectedSuggestion }"),a.appendChild(s),t.appendChild(a),Ee.applyBindings(n,i),Ee.applyBindings(n,a),this._container=t,this._searchSuggestionsContainer=a,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()},fn.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(I9.prototype,{container:{get:function(){return this._container}},searchSuggestionsContainer:{get:function(){return this._searchSuggestionsContainer}},viewModel:{get:function(){return this._viewModel}}});I9.prototype.isDestroyed=function(){return!1};I9.prototype.destroy=function(){let e=this._container;return fn.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(),Ee.cleanNode(this._form),Ee.cleanNode(this._searchSuggestionsContainer),e.removeChild(this._form),e.removeChild(this._searchSuggestionsContainer),this._textBox.removeEventListener("focus",this._onTextBoxFocus,!1),ue(this)};var P9=I9;function pLe(e,t){this._scene=e,this._duration=t;let n=this;this._command=Ln(function(){n._scene.camera.flyHome(n._duration)}),this.tooltip="View Home",Ee.track(this,["tooltip"])}Object.defineProperties(pLe.prototype,{scene:{get:function(){return this._scene}},command:{get:function(){return this._command}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}}});var D9=pLe;function R9(e,t,n){e=zn(e);let i=new D9(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 r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button cesium-home-button",r.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 28, height: 28 }"),e.appendChild(r),Ee.applyBindings(i,r),this._container=e,this._viewModel=i,this._element=r}Object.defineProperties(R9.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});R9.prototype.isDestroyed=function(){return!1};R9.prototype.destroy=function(){return Ee.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var O9=R9;function Jzt(e,t){t.currentTarget.parentElement.parentElement.querySelector(`#${e.name}-expander`).classList.toggle("active"),t.currentTarget.textContent=t.currentTarget.textContent==="+"?"-":"+"}function _Le(e,t){Ee.track(e);for(let n=0;n<e.sublayers.length;n++)_Le(e.sublayers[n],t)}function M9(e){return e.modelName==="FullModel"}function yLe(e){return e.modelName==="Overview"}function ALe(e){return yLe(e)||M9(e)}function gLe(e,t){if(ALe(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:Ee.observable(!1),index:t.sublayers.length};return t.topLayers.push(n),t.sublayers.push(e),n}}function Zzt(e,t){if(ALe(e)){t.sublayers.forEach(i=>i.visibility=!1),t.sublayers[e.index].visibility=!0;let n=document.getElementById("bsl-wrapper");M9(e)?(t.currentLevel=t.selectedLevel,n.style.display="block"):(t.selectedLevel=t.currentLevel,t.currentLevel="All",n.style.display="none")}}async function Qzt(e,t){try{let n=e.getAttributeNames();for(let i=0;i<n.length;i++)if(n[i]==="BldgLevel"){let r=e.getAttributeValues(n[i]);for(let o=0;o<r.length;o++)t.push(r[o])}t.sort((i,r)=>i-r),t.unshift("All")}catch(n){console.log(`There was an error getting attributes: ${n}`)}}function eUt(e){let t=this;this.levels=[],this.viewModel={sublayers:[],levels:this.levels,currentLevel:Ee.observable(),selectedLevel:"All",topLayers:[{name:"Select a layer to explore...",disable:Ee.observable(!0),index:-1}],currentLayer:Ee.observable(),expandClickHandler:Jzt,setOptionDisable:function(i,r){Ee.applyBindingsToNode(i,{disable:r.disable},r)},defaultLayer:void 0},this.viewModel.currentLayer.subscribe(function(i){Zzt(i,t.viewModel)});let n=e.sublayers;for(let i=0;i<n.length;i++){_Le(n[i],this.viewModel);let r=gLe(n[i],this.viewModel);l(r)&&(yLe(r)||!l(this.viewModel.defaultLayer)&&M9(r))&&(this.viewModel.defaultLayer=r)}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=gLe(i,this.viewModel),this.viewModel.currentLayer.subscribe(function(r){e.show=M9(r)})}else this.viewModel.topLayers.length===1&&(this.viewModel.topLayers[0].name="Building layers not found");return Qzt(e,this.levels),this.viewModel.currentLevel.subscribe(function(i){i!=="All"?e.filterByAttributes([{name:"BldgLevel",values:[i]}]):e.filterByAttributes()}),this.viewModel}var L9=eUt;function tUt(e,t){let n=document.getElementById(e),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 r=new L9(t);Ee.track(r),Ee.applyBindings(r,n),l(r.defaultLayer)&&(r.currentLayer=r.defaultLayer)}var bLe=tUt;var nUt="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",iUt="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 zre(){this._cameraClicked=new be,this._closeClicked=new be,this.maxHeight=500,this.enableCamera=!1,this.isCameraTracking=!1,this.showInfo=!1,this.titleText="",this.description="",Ee.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,Ee.defineProperty(this,"cameraIconPath",{get:function(){return!this.enableCamera||this.isCameraTracking?iUt:nUt}}),Ee.defineProperty(this,"_bodyless",{get:function(){return!l(this.description)||this.description.length===0}})}zre.prototype.maxHeightOffset=function(e){return`${this.maxHeight-e}px`};Object.defineProperties(zre.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}});var N9=zre;function F9(e){e=zn(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 r=document.createElement("button");r.type="button",r.className="cesium-infoBox-close",r.setAttribute("data-bind","click: function () { closeClicked.raiseEvent(this); }"),r.innerHTML="×",t.appendChild(r);let o=document.createElement("iframe");o.className="cesium-infoBox-iframe",o.setAttribute("sandbox","allow-same-origin allow-popups allow-forms"),o.setAttribute("data-bind","style : { maxHeight : maxHeightOffset(40) }"),o.setAttribute("allowfullscreen",!0),t.appendChild(o);let a=new N9;Ee.applyBindings(a,t),this._container=e,this._element=t,this._frame=o,this._viewModel=a,this._descriptionSubscription=void 0;let s=this;o.addEventListener("load",function(){let c=o.contentDocument,u=c.createElement("link");u.href=$t("Widgets/InfoBox/InfoBoxDescription.css"),u.rel="stylesheet",u.type="text/css";let f=c.createElement("div");f.className="cesium-infoBox-description",c.head.appendChild(u),c.body.appendChild(f),s._descriptionSubscription=Ic(a,"description",function(d){o.style.height="5px",f.innerHTML=d;let p=null,g=f.firstElementChild;if(g!==null&&f.childNodes.length===1){let y=window.getComputedStyle(g);if(y!==null){let A=y["background-color"],b=U.fromCssColorString(A);l(b)&&b.alpha!==0&&(p=y["background-color"])}}t.style["background-color"]=p;let m=f.getBoundingClientRect().height;o.style.height=`${m}px`})}),o.setAttribute("src","about:blank")}Object.defineProperties(F9.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}});F9.prototype.isDestroyed=function(){return!1};F9.prototype.destroy=function(){let e=this._container;return Ee.cleanNode(this._element),e.removeChild(this._element),l(this._descriptionSubscription)&&this._descriptionSubscription.dispose(),ue(this)};var B9=F9;function xLe(){this.showInstructions=!1;let e=this;this._command=Ln(function(){e.showInstructions=!e.showInstructions}),this._showClick=Ln(function(){e._touch=!1}),this._showTouch=Ln(function(){e._touch=!0}),this._touch=!1,this.tooltip="Navigation Instructions",Ee.track(this,["tooltip","showInstructions","_touch"])}Object.defineProperties(xLe.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}});var k9=xLe;function z9(e){let t=zn(e.container),n=new k9,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 r=document.createElement("span");r.className="cesium-navigationHelpButton-wrapper",t.appendChild(r);let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button cesium-navigation-help-button",o.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 32, height: 32 }"),r.appendChild(o);let a=document.createElement("div");a.className="cesium-navigation-help",a.setAttribute("data-bind",'css: { "cesium-navigation-help-visible" : showInstructions}'),r.appendChild(a);let s=document.createElement("button");s.type="button",s.className="cesium-navigation-button cesium-navigation-button-left",s.setAttribute("data-bind",'click: showClick, css: {"cesium-navigation-button-selected": !_touch, "cesium-navigation-button-unselected": _touch}');let c=document.createElement("img");c.src=$t("Widgets/Images/NavigationHelp/Mouse.svg"),c.className="cesium-navigation-button-icon",c.style.width="25px",c.style.height="25px",s.appendChild(c),s.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=$t("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")),a.appendChild(s),a.appendChild(u);let d=document.createElement("div");d.className="cesium-click-navigation-help cesium-navigation-help-instructions",d.setAttribute("data-bind",'css: { "cesium-click-navigation-help-visible" : !_touch}'),d.innerHTML=` <table> <tr> <td><img src="${$t("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="${$t("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="${$t("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>`,a.appendChild(d);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="${$t("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="${$t("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="${$t("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="${$t("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>`,a.appendChild(p),Ee.applyBindings(n,r),this._container=t,this._viewModel=n,this._wrapper=r,this._closeInstructions=function(g){r.contains(g.target)||(n.showInstructions=!1)},fn.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeInstructions,!0):(document.addEventListener("mousedown",this._closeInstructions,!0),document.addEventListener("touchstart",this._closeInstructions,!0))}Object.defineProperties(z9.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});z9.prototype.isDestroyed=function(){return!1};z9.prototype.destroy=function(){return fn.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeInstructions,!0):(document.removeEventListener("mousedown",this._closeInstructions,!0),document.removeEventListener("touchstart",this._closeInstructions,!0)),Ee.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),ue(this)};var U9=z9;function Ure(e){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,Ee.track(this,["lowFrameRateMessage","lowFrameRateMessageDismissed","showingLowFrameRateMessage"]);let t=this;this._dismissMessage=Ln(function(){t.showingLowFrameRateMessage=!1,t.lowFrameRateMessageDismissed=!0});let n=w5.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(Ure.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}});Ure.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),ue(this)};var V9=Ure;function j9(e){let t=zn(e.container),n=new V9(e),i=document.createElement("div");i.className="cesium-performance-watchdog-message-area",i.setAttribute("data-bind","visible: showingLowFrameRateMessage");let r=document.createElement("button");r.setAttribute("type","button"),r.className="cesium-performance-watchdog-message-dismiss",r.innerHTML="×",r.setAttribute("data-bind","click: dismissMessage"),i.appendChild(r);let o=document.createElement("div");o.className="cesium-performance-watchdog-message",o.setAttribute("data-bind","html: lowFrameRateMessage"),i.appendChild(o),t.appendChild(i),Ee.applyBindings(n,i),this._container=t,this._viewModel=n,this._element=i}Object.defineProperties(j9.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});j9.prototype.isDestroyed=function(){return!1};j9.prototype.destroy=function(){return this._viewModel.destroy(),Ee.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var H9=j9;function G9(e){this._scene=e,this._orthographic=e.camera.frustum instanceof pn,this._flightInProgress=!1,this.dropDownVisible=!1,this.tooltipPerspective="Perspective Projection",this.tooltipOrthographic="Orthographic Projection",this.selectedTooltip=void 0,this.sceneMode=e.mode,Ee.track(this,["_orthographic","_flightInProgress","sceneMode","dropDownVisible","tooltipPerspective","tooltipOrthographic"]);let t=this;Ee.defineProperty(this,"selectedTooltip",function(){return t._orthographic?t.tooltipOrthographic:t.tooltipPerspective}),this._toggleDropDown=Ln(function(){t.sceneMode===re.SCENE2D||t._flightInProgress||(t.dropDownVisible=!t.dropDownVisible)}),this._eventHelper=new Fo,this._eventHelper.add(e.morphComplete,function(n,i,r,o){t.sceneMode=r,t._orthographic=r===re.SCENE2D||t._scene.camera.frustum instanceof pn}),this._eventHelper.add(e.preRender,function(){t._flightInProgress=l(e.camera._currentFlight)}),this._switchToPerspective=Ln(function(){t.sceneMode!==re.SCENE2D&&(t._scene.camera.switchToPerspectiveFrustum(),t._orthographic=!1,t.dropDownVisible=!1)}),this._switchToOrthographic=Ln(function(){t.sceneMode!==re.SCENE2D&&(t._scene.camera.switchToOrthographicFrustum(),t._orthographic=!0,t.dropDownVisible=!1)}),this._sceneMode=re}Object.defineProperties(G9.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}}});G9.prototype.isDestroyed=function(){return!1};G9.prototype.destroy=function(){this._eventHelper.removeAll(),ue(this)};var W9=G9;var rUt="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",oUt="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 q9(e,t){e=zn(e);let n=new W9(t);n._perspectivePath=rUt,n._orthographicPath=oUt;let i=document.createElement("span");i.className="cesium-projectionPicker-wrapper cesium-toolbar-button",e.appendChild(i);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button",r.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'),r.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(r);let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",o.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(o);let a=document.createElement("button");a.type="button",a.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",a.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(a),Ee.applyBindings(n,i),this._viewModel=n,this._container=e,this._wrapper=i,this._closeDropDown=function(s){i.contains(s.target)||(n.dropDownVisible=!1)},fn.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(q9.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});q9.prototype.isDestroyed=function(){return!1};q9.prototype.destroy=function(){return this._viewModel.destroy(),fn.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Ee.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),ue(this)};var Y9=q9;function X9(e,t){this._scene=e;let n=this,i=function(r,o,a,s){n.sceneMode=a,n.dropDownVisible=!1};this._eventHelper=new Fo,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",Ee.track(this,["sceneMode","dropDownVisible","tooltip2D","tooltip3D","tooltipColumbusView"]),this.selectedTooltip=void 0,Ee.defineProperty(this,"selectedTooltip",function(){let r=n.sceneMode;return r===re.SCENE2D?n.tooltip2D:r===re.SCENE3D?n.tooltip3D:n.tooltipColumbusView}),this._toggleDropDown=Ln(function(){n.dropDownVisible=!n.dropDownVisible}),this._morphTo2D=Ln(function(){e.morphTo2D(n._duration)}),this._morphTo3D=Ln(function(){e.morphTo3D(n._duration)}),this._morphToColumbusView=Ln(function(){e.morphToColumbusView(n._duration)}),this._sceneMode=re}Object.defineProperties(X9.prototype,{scene:{get:function(){return this._scene}},duration:{get:function(){return this._duration},set:function(e){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}}});X9.prototype.isDestroyed=function(){return!1};X9.prototype.destroy=function(){this._eventHelper.removeAll(),ue(this)};var K9=X9;var aUt="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",sUt="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",cUt="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 $9(e,t,n){e=zn(e);let i=new K9(t,n);i._globePath=aUt,i._flatMapPath=sUt,i._columbusViewPath=cUt;let r=document.createElement("span");r.className="cesium-sceneModePicker-wrapper cesium-toolbar-button",e.appendChild(r);let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button",o.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'),o.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 -->',r.appendChild(o);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.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 }'),r.appendChild(a);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.SCENE2D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip2D },click: morphTo2D,cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64 }'),r.appendChild(s);let c=document.createElement("button");c.type="button",c.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",c.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 }'),r.appendChild(c),Ee.applyBindings(i,r),this._viewModel=i,this._container=e,this._wrapper=r,this._closeDropDown=function(u){r.contains(u.target)||(i.dropDownVisible=!1)},fn.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties($9.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});$9.prototype.isDestroyed=function(){return!1};$9.prototype.destroy=function(){return this._viewModel.destroy(),fn.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Ee.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),ue(this)};var J9=$9;var lUt=new k,Z9="-1000px";function YO(e,t,n){this._scene=e,this._screenPositionX=Z9,this._screenPositionY=Z9,this._tweens=e.tweens,this._container=n??document.body,this._selectionIndicatorElement=t,this._scale=1,this.position=void 0,this.showSelection=!1,Ee.track(this,["position","_screenPositionX","_screenPositionY","_scale","showSelection"]),this.isVisible=void 0,Ee.defineProperty(this,"isVisible",{get:function(){return this.showSelection&&l(this.position)}}),Ee.defineProperty(this,"_transform",{get:function(){return`scale(${this._scale})`}}),this.computeScreenSpacePosition=function(i,r){return cr.worldToWindowCoordinates(e,i,r)}}YO.prototype.update=function(){if(this.showSelection&&l(this.position)){let e=this.computeScreenSpacePosition(this.position,lUt);if(!l(e))this._screenPositionX=Z9,this._screenPositionY=Z9;else{let t=this._container,n=t.parentNode.clientWidth,i=t.parentNode.clientHeight,r=this._selectionIndicatorElement.clientWidth,o=r*.5;e.x=Math.min(Math.max(e.x,-r),n+r)-o,e.y=Math.min(Math.max(e.y,-r),i+r)-o,this._screenPositionX=`${Math.floor(e.x+.25)}px`,this._screenPositionY=`${Math.floor(e.y+.25)}px`}}};YO.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:ya.EXPONENTIAL_OUT})};YO.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:ya.EXPONENTIAL_OUT})};Object.defineProperties(YO.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}});var Q9=YO;function e7(e,t){e=zn(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",r="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",o=document.createElementNS(i,"svg:svg");o.setAttribute("width",160),o.setAttribute("height",160),o.setAttribute("viewBox","0 0 160 160");let a=document.createElementNS(i,"g");a.setAttribute("transform","translate(80,80)"),o.appendChild(a);let s=document.createElementNS(i,"path");s.setAttribute("data-bind","attr: { transform: _transform }"),s.setAttribute("d",r),a.appendChild(s),n.appendChild(o);let c=new Q9(t,this._element,this._container);this._viewModel=c,Ee.applyBindings(this._viewModel,this._element)}Object.defineProperties(e7.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});e7.prototype.isDestroyed=function(){return!1};e7.prototype.destroy=function(){let e=this._container;return Ee.cleanNode(this._element),e.removeChild(this._element),ue(this)};var t7=e7;function TT(e,t,n){this._color=e,this._height=t,this._base=n??0}TT.prototype.getHeight=function(){return this._height};TT.prototype.getBase=function(){return this._base};TT.prototype.getStartTime=function(){return this._start};TT.prototype.getStopTime=function(){return this._stop};TT.prototype.setRange=function(e,t){this._start=e,this._stop=t};TT.prototype.render=function(e){let t="";if(this._start&&this._stop&&this._color){let n=K.secondsDifference(this._start,e.epochJulian),i=Math.round(e.timeBarWidth*e.getAlpha(n)),r=K.secondsDifference(this._stop,e.epochJulian),o=Math.round(e.timeBarWidth*e.getAlpha(r))-i;i<0&&(o+=i,i=0),i+o>e.timeBarWidth&&(o=e.timeBarWidth-i),o>0&&(t=`<span class="cesium-timeline-highlight" style="left: ${i.toString()}px; width: ${o.toString()}px; bottom: ${this._base.toString()}px; height: ${this._height}px; background-color: ${this._color};"></span>`)}return t};var n7=TT;function TLe(e,t,n,i){this.interval=e,this.height=t,this.color=n||new U(.5,.5,.5,1),this.backgroundColor=i||new U(0,0,0,0)}TLe.prototype.render=function(e,t){let n=this.interval.start,i=this.interval.stop,r=t.startJulian,o=K.addSeconds(t.startJulian,t.duration,new K);if(K.lessThan(n,r)&&K.greaterThan(i,o))e.fillStyle=this.color.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height);else if(K.lessThanOrEquals(n,o)&&K.greaterThanOrEquals(i,r)){let a,s,c;for(a=0;a<t.timeBarWidth;++a){let u=K.addSeconds(t.startJulian,a/t.timeBarWidth*t.duration,new K);!l(s)&&K.greaterThanOrEquals(u,n)?s=a:!l(c)&&K.greaterThanOrEquals(u,i)&&(c=a)}e.fillStyle=this.backgroundColor.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height),l(s)&&(l(c)||(c=t.timeBarWidth),e.fillStyle=this.color.toCssColorString(),e.fillRect(s,t.y,Math.max(c-s,1),this.height))}};var i7=TLe;var Vre=1e12,Xd={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},Gl={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},MA=[.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],uUt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Wl(e,t){e=zn(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=Xd.none,this._touchMode=Gl.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=fUt(this),this._onMouseUp=dUt(this),this._onMouseMove=hUt(this),this._onMouseWheel=mUt(this),this._onTouchStart=pUt(this),this._onTouchMove=_Ut(this),this._onTouchEnd=gUt(this);let r=this._timeBarEle;n.addEventListener("mouseup",this._onMouseUp,!1),n.addEventListener("mousemove",this._onMouseMove,!1),r.addEventListener("mousedown",this._onMouseDown,!1),r.addEventListener("DOMMouseScroll",this._onMouseWheel,!1),r.addEventListener("mousewheel",this._onMouseWheel,!1),r.addEventListener("touchstart",this._onTouchStart,!1),r.addEventListener("touchmove",this._onTouchMove,!1),r.addEventListener("touchend",this._onTouchEnd,!1),r.addEventListener("touchcancel",this._onTouchEnd,!1),this._topDiv.oncontextmenu=function(){return!1},t.onTick.addEventListener(this.updateFromClock,this),this.updateFromClock()}Wl.prototype.addEventListener=function(e,t,n){this._topDiv.addEventListener(e,t,n)};Wl.prototype.removeEventListener=function(e,t,n){this._topDiv.removeEventListener(e,t,n)};Wl.prototype.isDestroyed=function(){return!1};Wl.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),ue(this)};Wl.prototype.addHighlightRange=function(e,t,n){let i=new n7(e,t,n);return this._highlightRanges.push(i),this.resize(),i};Wl.prototype.addTrack=function(e,t,n,i){let r=new i7(e,t,n,i);return this._trackList.push(r),this._lastHeight=void 0,this.resize(),r};Wl.prototype.zoomTo=function(e,t){if(this._startJulian=e,this._endJulian=t,this._timeBarSecondsSpan=K.secondsDifference(t,e),this._clock&&this._clock.clockRange!==_a.UNBOUNDED){let i=this._clock.startTime,r=this._clock.stopTime,o=K.secondsDifference(r,i),a=K.secondsDifference(i,this._startJulian),s=K.secondsDifference(r,this._endJulian);this._timeBarSecondsSpan>=o?(this._timeBarSecondsSpan=o,this._startJulian=this._clock.startTime,this._endJulian=this._clock.stopTime):a>0?(this._endJulian=K.addSeconds(this._endJulian,a,new K),this._startJulian=i,this._timeBarSecondsSpan=K.secondsDifference(this._endJulian,this._startJulian)):s<0&&(this._startJulian=K.addSeconds(this._startJulian,s,new K),this._endJulian=r,this._timeBarSecondsSpan=K.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)};Wl.prototype.zoomFrom=function(e){let t=K.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(K.addSeconds(this._startJulian,t-t*e,new K),K.addSeconds(this._endJulian,n*e-n,new K))};function jre(e){return e<10?`0${e.toString()}`:e.toString()}Wl.prototype.makeLabel=function(e){let t=K.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`${uUt[t.month-1]} ${t.day} ${t.year} ${jre(t.hour)}:${jre(t.minute)}:${jre(t.second)}${i}`};Wl.prototype.smallestTicInPixels=7;Wl.prototype._makeTics=function(){let e=this._timeBarEle,t=K.secondsDifference(this._scrubJulian,this._startJulian),n=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan),i=n-8,r,o=this;this._needleEle.style.left=`${n.toString()}px`;let a="",s=.01,c=31536e6,u=1e-10,f=0,d=this._timeBarSecondsSpan;d<s?(d=s,this._timeBarSecondsSpan=s,this._endJulian=K.addSeconds(this._startJulian,s,new K)):d>c&&(d=c,this._timeBarSecondsSpan=c,this._endJulian=K.addSeconds(this._startJulian,c,new K));let p=this._timeBarEle.clientWidth;p<10&&(p=10);let g=this._startJulian,m=Math.min(d/p*1e-5,.4),y,A=K.toGregorianDate(g);d>31536e4?y=K.fromDate(new Date(Date.UTC(Math.floor(A.year/100)*100,0))):d>31536e3?y=K.fromDate(new Date(Date.UTC(Math.floor(A.year/10)*10,0))):d>86400?y=K.fromDate(new Date(Date.UTC(A.year,0))):y=K.fromDate(new Date(Date.UTC(A.year,A.month,A.day)));let b=K.secondsDifference(this._startJulian,K.addSeconds(y,m,new K)),x=b+d;this._epochJulian=y;function T(B){return Math.floor(b/B)*B}function C(B,G){return Math.ceil(B/G+.5)*G}function E(B){return(B-b)/d}function w(B,G){return B-G*Math.round(B/G)}this._rulerEle.innerHTML=this.makeLabel(K.addSeconds(this._endJulian,-s,new K));let D=this._rulerEle.offsetWidth+20;D<30&&(D=180);let R=f;f-=u;let M={startTime:b,startJulian:g,epochJulian:y,duration:d,timeBarWidth:p,getAlpha:E};this._highlightRanges.forEach(function(B){a+=B.render(M)});let N=0,_=0,v=0,S=D/p;S>1&&(S=1),S*=this._timeBarSecondsSpan;let P=-1,L=-1,F=MA.length,V;for(V=0;V<F;++V){let B=MA[V];if(++P,N=B,B>S&&B>f)break;L<0&&p*(B/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(L=P)}if(P>0){for(;P>0;)if(--P,Math.abs(w(N,MA[P]))<1e-5){MA[P]>=f&&(_=MA[P]);break}if(L>=0)for(;L<P;){if(Math.abs(w(_,MA[L]))<1e-5&&MA[L]>=f){v=MA[L];break}++L}}f=R,f>u&&v<1e-5&&Math.abs(f-N)>u&&(v=f,f<=N+u&&(_=0));let z=-999999,j;if(p*(v/this._timeBarSecondsSpan)>=3)for(r=T(v);r<=x;r=C(r,v))a+=`<span class="cesium-timeline-ticTiny" style="left: ${Math.round(p*E(r)).toString()}px;"></span>`;if(p*(_/this._timeBarSecondsSpan)>=3)for(r=T(_);r<=x;r=C(r,_))a+=`<span class="cesium-timeline-ticSub" style="left: ${Math.round(p*E(r)).toString()}px;"></span>`;if(p*(N/this._timeBarSecondsSpan)>=2){this._mainTicSpan=N,x+=N,r=T(N);let B=K.computeTaiMinusUtc(y);for(;r<=x;){let G=K.addSeconds(g,r-b,new K);if(N>2.1){let J=K.computeTaiMinusUtc(G);Math.abs(J-B)>.1&&(r+=J-B,G=K.addSeconds(g,r-b,new K))}let W=Math.round(p*E(r)),Q=this.makeLabel(G);this._rulerEle.innerHTML=Q,j=this._rulerEle.offsetWidth,j<10&&(j=D);let q=W-(j/2-1);q>z?(z=q+j+5,a+=`<span class="cesium-timeline-ticMain" style="left: ${W.toString()}px;"></span><span class="cesium-timeline-ticLabel" style="left: ${q.toString()}px;">${Q}</span>`):a+=`<span class="cesium-timeline-ticSub" style="left: ${W.toString()}px;"></span>`,r=C(r,N)}}else this._mainTicSpan=-1;a+=`<span class="cesium-timeline-icon16" style="left:${i}px;bottom:0;background-position: 0 0;"></span>`,e.innerHTML=a,this._scrubElement=e.lastChild,this._context.clearRect(0,0,this._trackListEle.width,this._trackListEle.height),M.y=0,this._trackList.forEach(function(B){B.render(o._context,M),M.y+=B.height})};Wl.prototype.updateFromClock=function(){this._scrubJulian=this._clock.currentTime;let e=this._scrubElement;if(l(this._scrubElement)){let t=K.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`)}l(this._timelineDragLocation)&&(this._setTimeBarTime(this._timelineDragLocation,this._timelineDragLocation*this._timeBarSecondsSpan/this._topDiv.clientWidth),this.zoomTo(K.addSeconds(this._startJulian,this._timelineDrag,new K),K.addSeconds(this._endJulian,this._timelineDrag,new K)))};Wl.prototype._setTimeBarTime=function(e,t){if(e=Math.round(e),this._scrubJulian=K.addSeconds(this._startJulian,t,new K),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 fUt(e){return function(t){e._mouseMode!==Xd.touchOnly&&(t.button===0?(e._mouseMode=Xd.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition="-16px 0"),e._onMouseMove(t)):(e._mouseX=t.clientX,t.button===2?e._mouseMode=Xd.zoom:e._mouseMode=Xd.slide)),t.preventDefault()}}function dUt(e){return function(t){e._mouseMode=Xd.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function hUt(e){return function(t){let n;if(e._mouseMode===Xd.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===Xd.slide){if(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0){let i=n*e._timeBarSecondsSpan/e._topDiv.clientWidth;e.zoomTo(K.addSeconds(e._startJulian,i,new K),K.addSeconds(e._endJulian,i,new K))}}else e._mouseMode===Xd.zoom&&(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0&&e.zoomFrom(Math.pow(1.01,n)))}}function mUt(e){return function(t){let n=t.wheelDeltaY||t.wheelDelta||-t.detail;Vre=Math.max(Math.min(Math.abs(n),Vre),1),n/=Vre,e.zoomFrom(Math.pow(1.05,-n))}}function pUt(e){return function(t){let n=t.touches.length,i,r,o=e._topDiv.getBoundingClientRect().left;t.preventDefault(),e._mouseMode=Xd.touchOnly,n===1?(i=K.secondsDifference(e._scrubJulian,e._startJulian),r=Math.round(i*e._topDiv.clientWidth/e._timeBarSecondsSpan+o),Math.abs(t.touches[0].clientX-r)<50?(e._touchMode=Gl.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition=n===1?"-16px 0":"0 0")):(e._touchMode=Gl.singleTap,e._touchState.centerX=t.touches[0].clientX-o)):n===2?(e._touchMode=Gl.slideZoom,e._touchState.centerX=(t.touches[0].clientX+t.touches[1].clientX)*.5-o,e._touchState.spanX=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):e._touchMode=Gl.ignore}}function gUt(e){return function(t){let n=t.touches.length,i=e._topDiv.getBoundingClientRect().left;e._touchMode===Gl.singleTap?(e._touchMode=Gl.scrub,e._onTouchMove(t)):e._touchMode===Gl.scrub&&e._onTouchMove(t),e._mouseMode=Xd.touchOnly,n!==1?e._touchMode=n>0?Gl.ignore:Gl.none:e._touchMode===Gl.slideZoom&&(e._touchState.centerX=t.touches[0].clientX-i),e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0")}}function _Ut(e){return function(t){let n,i,r,o,a,s,c=1,u=e._topDiv.getBoundingClientRect().left;e._touchMode===Gl.singleTap&&(e._touchMode=Gl.slideZoom),e._mouseMode=Xd.touchOnly,e._touchMode===Gl.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===Gl.slideZoom&&(r=t.touches.length,r===2?(o=(t.touches[0].clientX+t.touches[1].clientX)*.5-u,a=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):r===1&&(o=t.touches[0].clientX-u,a=0),l(o)&&(a>0&&e._touchState.spanX>0?(c=e._touchState.spanX/a,s=K.addSeconds(e._startJulian,(e._touchState.centerX*e._timeBarSecondsSpan-o*e._timeBarSecondsSpan*c)/e._topDiv.clientWidth,new K)):(n=e._touchState.centerX-o,s=K.addSeconds(e._startJulian,n*e._timeBarSecondsSpan/e._topDiv.clientWidth,new K)),e.zoomTo(s,K.addSeconds(s,e._timeBarSecondsSpan*c,new K)),e._touchState.centerX=o,e._touchState.spanX=a))}}Wl.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 r7=Wl;var wLe=La(SLe(),1);function bUt(e){let t=!1,n=window.screen;return l(n)&&(l(n.lockOrientation)?t=n.lockOrientation(e):l(n.mozLockOrientation)?t=n.mozLockOrientation(e):l(n.msLockOrientation)?t=n.msLockOrientation(e):l(n.orientation&&n.orientation.lock)&&(t=n.orientation.lock(e))),t}function ILe(){let e=window.screen;l(e)&&(l(e.unlockOrientation)?e.unlockOrientation():l(e.mozUnlockOrientation)?e.mozUnlockOrientation():l(e.msUnlockOrientation)?e.msUnlockOrientation():l(e.orientation&&e.orientation.unlock)&&e.orientation.unlock())}function xUt(e,t,n,i){i()||(n()?(t.useWebVR=!1,e._locked&&(ILe(),e._locked=!1),e._noSleep.disable(),Zo.exitFullscreen(),n(!1)):(Zo.fullscreen||Zo.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=bUt("landscape")),t.useWebVR=!0,n(!0)))}function o7(e,t){let n=this,i=Ee.observable(Zo.enabled),r=Ee.observable(!1);this.isVRMode=void 0,Ee.defineProperty(this,"isVRMode",{get:function(){return r()}}),this.isVREnabled=void 0,Ee.defineProperty(this,"isVREnabled",{get:function(){return i()},set:function(a){i(a&&Zo.enabled)}}),this.tooltip=void 0,Ee.defineProperty(this,"tooltip",function(){return i()?r()?"Exit VR mode":"Enter VR mode":"VR mode is unavailable"});let o=Ee.observable(!1);this._isOrthographic=void 0,Ee.defineProperty(this,"_isOrthographic",{get:function(){return o()}}),this._eventHelper=new Fo,this._eventHelper.add(e.preRender,function(){o(e.camera.frustum instanceof pn)}),this._locked=!1,this._noSleep=new wLe.default,this._command=Ln(function(){xUt(n,e,r,o)},Ee.getObservable(this,"isVREnabled")),this._vrElement=zn(t)??document.body,this._callback=function(){!Zo.fullscreen&&r()&&(e.useWebVR=!1,n._locked&&(ILe(),n._locked=!1),n._noSleep.disable(),r(!1))},document.addEventListener(Zo.changeEventName,this._callback)}Object.defineProperties(o7.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){this._vrElement=e}},command:{get:function(){return this._command}}});o7.prototype.isDestroyed=function(){return!1};o7.prototype.destroy=function(){this._eventHelper.removeAll(),document.removeEventListener(Zo.changeEventName,this._callback),ue(this)};var a7=o7;var TUt="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",CUt="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 s7(e,t,n){e=zn(e);let i=new a7(t,n);i._exitVRPath=CUt,i._enterVRPath=TUt;let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-vrButton",r.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(r),Ee.applyBindings(i,r),this._container=e,this._viewModel=i,this._element=r}Object.defineProperties(s7.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});s7.prototype.isDestroyed=function(){return!1};s7.prototype.destroy=function(){return this._viewModel.destroy(),Ee.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var c7=s7;var PLe=new se;function OLe(e){let t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function vUt(e){let t=e.getPropertyIds(),n="";return t.forEach(function(i){let r=e.getProperty(i);l(r)&&(n+=`<tr><th>${i}</th><td>${r}</td></tr>`)}),n.length>0&&(n=`<table class="cesium-infoBox-defaultTable"><tbody>${n}</tbody></table>`),n}function EUt(e){let t,n=[],i=e.getPropertyIds();for(t=0;t<i.length;t++){let o=i[t];/^name$/i.test(o)?n[0]=e.getProperty(o):/name/i.test(o)?n[1]=e.getProperty(o):/^title$/i.test(o)?n[2]=e.getProperty(o):/^(id|identifier)$/i.test(o)?n[3]=e.getProperty(o):/element/i.test(o)?n[4]=e.getProperty(o):/(id|identifier)$/i.test(o)&&(n[5]=e.getProperty(o))}let r=n.length;for(t=0;t<r;t++){let o=n[t];if(l(o)&&o!=="")return o}return"Unnamed Feature"}function DLe(e,t){let n=e.scene.pick(t.position);if(l(n)){let i=n.id??n.primitive.id;if(i instanceof $r)return i;if(n instanceof us||n instanceof ZE)return new $r({name:EUt(n),description:vUt(n),feature:n})}return PUt(e,t.position)}var SUt=new K;function qre(e,t){if(l(t)){let n=t.clock;if(l(n)&&l(e)){let i=n.startTime,r=n.stopTime;K.equals(i,r)&&(r=K.addSeconds(i,I.EPSILON2,SUt)),e.updateFromClock(),e.zoomTo(i,r)}}}var wUt=new h;function IUt(e){let t=e.length;for(let n=0;n<t;++n){let i=e.get(n);if(i instanceof Yo)return i}}function PUt(e,t){let n=e.scene,i=n.camera.getPickRay(t);if(!l(i))return;let r=n.imageryLayers;if(!l(r)){let s=IUt(n.primitives);if(!l(s))return;r=s.imageryLayers}let o=r.pickImageryLayerFeatures(i,n);if(!l(o))return;let a=new $r({id:"Loading...",description:"Loading feature information..."});return o.then(function(s){if(e.selectedEntity!==a)return;if(!l(s)||s.length===0){e.selectedEntity=RLe();return}let c=s[0],u=new $r({id:c.name,description:c.description});if(l(c.position)){let f=e.scene.ellipsoid.cartographicToCartesian(c.position,wUt);u.position=new _u(f)}e.selectedEntity=u},function(){e.selectedEntity===a&&(e.selectedEntity=RLe())}),a}function RLe(){return new $r({id:"None",description:"No features found."})}function DUt(e,t){let n=e._geocoder,i=e._homeButton,r=e._sceneModePicker,o=e._projectionPicker,a=e._baseLayerPicker,s=e._animation,c=e._timeline,u=e._fullscreenButton,f=e._infoBox,d=e._selectionIndicator,p=t?"hidden":"visible";if(l(n)&&(n.container.style.visibility=p),l(i)&&(i.container.style.visibility=p),l(r)&&(r.container.style.visibility=p),l(o)&&(o.container.style.visibility=p),l(a)&&(a.container.style.visibility=p),l(s)&&(s.container.style.visibility=p),l(c)&&(c.container.style.visibility=p),l(u)&&u.viewModel.isFullscreenEnabled&&(u.container.style.visibility=p),l(f)&&(f.container.style.visibility=p),l(d)&&(d.container.style.visibility=p),e._container){let g=t||!l(u)?0:u.container.clientWidth;e._vrButton.container.style.right=`${g}px`,e.forceResize()}}function Ki(e,t){e=zn(e),t=t??H.EMPTY_OBJECT;let n=(!l(t.globe)||t.globe!==!1)&&(!l(t.baseLayerPicker)||t.baseLayerPicker!==!1),i=this,r=document.createElement("div");r.className="cesium-viewer",e.appendChild(r);let o=document.createElement("div");o.className="cesium-viewer-cesiumWidgetContainer",r.appendChild(o);let a=document.createElement("div");a.className="cesium-viewer-bottom",r.appendChild(a);let s=t.scene3DOnly??!1,c,u,f=!1;l(t.clockViewModel)?(u=t.clockViewModel,c=u.clock):(c=new jm,u=new r9(c),f=!0);let d=new LH(o,{baseLayer:n&&l(t.selectedImageryProviderViewModel)||l(t.baseLayer)||l(t.imageryProvider)?!1:void 0,clock:c,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:l(t.creditContainer)?t.creditContainer:a,creditViewport:t.creditViewport,dataSources:t.dataSources,scene3DOnly:s,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=d.scene,g=new Fo;g.add(c.onTick,Ki.prototype._onTick,this);let m;if(!l(t.selectionIndicator)||t.selectionIndicator!==!1){let G=document.createElement("div");G.className="cesium-viewer-selectionIndicatorContainer",r.appendChild(G),m=new t7(G,p)}let y;if(!l(t.infoBox)||t.infoBox!==!1){let G=document.createElement("div");G.className="cesium-viewer-infoBoxContainer",r.appendChild(G),y=new B9(G);let W=y.viewModel;g.add(W.cameraClicked,Ki.prototype._onInfoBoxCameraClicked,this),g.add(W.closeClicked,Ki.prototype._onInfoBoxClockClicked,this)}let A=document.createElement("div");A.className="cesium-viewer-toolbar",r.appendChild(A);let b;if(!l(t.geocoder)||t.geocoder!==!1){let G=document.createElement("div");G.className="cesium-viewer-geocoderContainer",A.appendChild(G);let W;typeof t.geocoder=="string"?W=[new GC({scene:p,geocodeProviderType:t.geocoder})]:l(t.geocoder)&&typeof t.geocoder!="boolean"&&(W=Array.isArray(t.geocoder)?t.geocoder:[t.geocoder]),b=new P9({container:G,geocoderServices:W,scene:p}),g.add(b.viewModel.search.beforeExecute,Ki.prototype._clearObjects,this)}let x;(!l(t.homeButton)||t.homeButton!==!1)&&(x=new O9(A,p),l(b)&&g.add(x.viewModel.command.afterExecute,function(){let G=b.viewModel;G.searchText="",G.isSearchInProgress&&G.search()}),g.add(x.viewModel.command.beforeExecute,Ki.prototype._clearTrackedObject,this));let T;!s&&(!l(t.sceneModePicker)||t.sceneModePicker!==!1)&&(T=new J9(A,p));let C;t.projectionPicker&&(C=new Y9(A,p));let E,w;if(n){let G=t.imageryProviderViewModels??m9(),W=t.terrainProviderViewModels??p9();E=new h9(A,{globe:p.globe,imageryProviderViewModels:G,selectedImageryProviderViewModel:t.selectedImageryProviderViewModel,terrainProviderViewModels:W,selectedTerrainProviderViewModel:t.selectedTerrainProviderViewModel}),w=A.getElementsByClassName("cesium-baseLayerPicker-dropDown")[0]}l(t.baseLayer)&&t.baseLayer!==!1&&(n&&(E.viewModel.selectedImagery=void 0),p.imageryLayers.removeAll(),p.imageryLayers.add(t.baseLayer)),l(t.terrainProvider)&&(n&&(E.viewModel.selectedTerrain=void 0),p.terrainProvider=t.terrainProvider),l(t.terrain)&&(n&&(p.globe.depthTestAgainstTerrain=!0),p.setTerrain(t.terrain));let D;if(!l(t.navigationHelpButton)||t.navigationHelpButton!==!1){let G=!0;try{if(l(window.localStorage)){let W=window.localStorage.getItem("cesium-hasSeenNavHelp");l(W)&&W?G=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true")}}catch{}D=new U9({container:A,instructionsInitiallyVisible:t.navigationInstructionsInitiallyVisible??G})}let R;if(!l(t.animation)||t.animation!==!1){let G=document.createElement("div");G.className="cesium-viewer-animationContainer",r.appendChild(G),R=new l9(G,new u9(u))}let M;if(!l(t.timeline)||t.timeline!==!1){let G=document.createElement("div");G.className="cesium-viewer-timelineContainer",r.appendChild(G),M=new r7(G,c),M.addEventListener("settime",OLe,!1),M.zoomTo(c.startTime,c.stopTime)}let N,_,v;(!l(t.fullscreenButton)||t.fullscreenButton!==!1)&&(v=document.createElement("div"),v.className="cesium-viewer-fullscreenContainer",r.appendChild(v),N=new S9(v,t.fullscreenElement),_=Ic(N.viewModel,"isFullscreenEnabled",function(G){v.style.display=G?"block":"none",l(M)&&(M.container.style.right=`${v.clientWidth}px`,M.resize())}));let S,P,L;if(t.vrButton){let G=document.createElement("div");G.className="cesium-viewer-vrContainer",r.appendChild(G),S=new c7(G,p,t.fullScreenElement),P=Ic(S.viewModel,"isVREnabled",function(W){G.style.display=W?"block":"none",l(N)&&(G.style.right=`${v.clientWidth}px`),l(M)&&(M.container.style.right=`${G.clientWidth}px`,M.resize())}),L=Ic(S.viewModel,"isVRMode",function(W){DUt(i,W)})}this._baseLayerPickerDropDown=w,this._fullscreenSubscription=_,this._vrSubscription=P,this._vrModeSubscription=L,this._dataSourceChangedListeners={},this._container=e,this._bottomContainer=a,this._element=r,this._cesiumWidget=d,this._selectionIndicator=m,this._infoBox=y,this._clockViewModel=u,this._destroyClockViewModel=f,this._toolbar=A,this._homeButton=x,this._sceneModePicker=T,this._projectionPicker=C,this._baseLayerPicker=E,this._navigationHelpButton=D,this._animation=R,this._timeline=M,this._fullscreenButton=N,this._vrButton=S,this._geocoder=b,this._eventHelper=g,this._lastWidth=0,this._lastHeight=0,this._enableInfoOrSelection=l(y)||l(m),this._selectedEntity=void 0,this._selectedEntityChanged=new be;let F=this._cesiumWidget.dataSources,V=this._cesiumWidget.dataSourceDisplay;g.add(F.dataSourceAdded,Ki.prototype._onDataSourceAdded,this),g.add(F.dataSourceRemoved,Ki.prototype._onDataSourceRemoved,this),g.add(p.postUpdate,Ki.prototype.resize,this);let z=F.length;for(let G=0;G<z;G++)this._dataSourceAdded(F,F.get(G));this._dataSourceAdded(void 0,V.defaultDataSource),g.add(F.dataSourceAdded,Ki.prototype._dataSourceAdded,this),g.add(F.dataSourceRemoved,Ki.prototype._dataSourceRemoved,this);function j(G){let W=DLe(i,G);l(W)?X.getValueOrUndefined(W.position,i.clock.currentTime)?i.trackedEntity=W:i.zoomTo(W):l(i.trackedEntity)&&(i.trackedEntity=void 0)}function B(G){i.selectedEntity=DLe(i,G)}d.screenSpaceEventHandler.setInputAction(B,ln.LEFT_CLICK),d.screenSpaceEventHandler.setInputAction(j,ln.LEFT_DOUBLE_CLICK),d._canAnimateUpdateCallback=this._updateCanAnimate(this)}Object.defineProperties(Ki.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=l(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;l(e)?l(t)&&t.animateAppear():l(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,qre(this._timeline,e))}}});Ki.prototype.extend=function(e,t){e(this,t)};Ki.prototype.resize=function(){let e=this._cesiumWidget,t=this._container,n=t.clientWidth,i=t.clientHeight,r=l(this._animation),o=l(this._timeline);if(e.resize(),n===this._lastWidth&&i===this._lastHeight)return;let a=i-125,s=this._baseLayerPickerDropDown;if(l(s)&&(s.style.maxHeight=`${a}px`),l(this._geocoder)){let m=this._geocoder.searchSuggestionsContainer;m.style.maxHeight=`${a}px`}l(this._infoBox)&&(this._infoBox.viewModel.maxHeight=a);let c=this._timeline,u,f=0,d=5,p=3,g=0;if(r&&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())),d=f+5}if(o&&window.getComputedStyle(this._timeline.container).visibility!=="hidden"){let m=this._fullscreenButton,y=this._vrButton,A=c.container,b=A.style;p=A.clientHeight+3,b.left=`${f}px`;let x=0;l(m)&&(x+=m.container.clientWidth),l(y)&&(x+=y.container.clientWidth),b.right=`${x}px`,c.resize()}!o&&l(this._fullscreenButton)&&(g=this._fullscreenButton.container.clientWidth),this._bottomContainer.style.left=`${d}px`,this._bottomContainer.style.bottom=`${p}px`,this._bottomContainer.style.right=`${g}px`,this._lastWidth=n,this._lastHeight=i};Ki.prototype.forceResize=function(){this._lastWidth=0,this.resize()};Ki.prototype.render=function(){this._cesiumWidget.render()};Ki.prototype.isDestroyed=function(){return!1};Ki.prototype.destroy=function(){return l(this.screenSpaceEventHandler)&&!this.screenSpaceEventHandler.isDestroyed()&&(this.screenSpaceEventHandler.removeInputAction(ln.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(ln.LEFT_DOUBLE_CLICK)),this._container.removeChild(this._element),this._element.removeChild(this._toolbar),this._eventHelper.removeAll(),l(this._geocoder)&&(this._geocoder=this._geocoder.destroy()),l(this._homeButton)&&(this._homeButton=this._homeButton.destroy()),l(this._sceneModePicker)&&(this._sceneModePicker=this._sceneModePicker.destroy()),l(this._projectionPicker)&&(this._projectionPicker=this._projectionPicker.destroy()),l(this._baseLayerPicker)&&(this._baseLayerPicker=this._baseLayerPicker.destroy()),l(this._animation)&&(this._element.removeChild(this._animation.container),this._animation=this._animation.destroy()),l(this._timeline)&&(this._timeline.removeEventListener("settime",OLe,!1),this._element.removeChild(this._timeline.container),this._timeline=this._timeline.destroy()),l(this._fullscreenButton)&&(this._fullscreenSubscription.dispose(),this._element.removeChild(this._fullscreenButton.container),this._fullscreenButton=this._fullscreenButton.destroy()),l(this._vrButton)&&(this._vrSubscription.dispose(),this._vrModeSubscription.dispose(),this._element.removeChild(this._vrButton.container),this._vrButton=this._vrButton.destroy()),l(this._infoBox)&&(this._element.removeChild(this._infoBox.container),this._infoBox=this._infoBox.destroy()),l(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(),ue(this)};Ki.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(Ki.prototype._onEntityCollectionChanged,this)};Ki.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(Ki.prototype._onEntityCollectionChanged,this),l(this.selectedEntity)&&n.getById(this.selectedEntity.id)===this.selectedEntity&&(this.selectedEntity=void 0)};Ki.prototype._updateCanAnimate=function(e){return function(t){e._clockViewModel.canAnimate=t}};Ki.prototype._onTick=function(e){let t=e.currentTime,n,i=!1,r=this.selectedEntity,o=l(r)&&this._enableInfoOrSelection;o&&r.isShowing&&r.isAvailable(t)&&(this._cesiumWidget.dataSourceDisplay.getBoundingSphere(r,!0,PLe)!==It.FAILED?n=PLe.center:l(r.position)&&(n=r.position.getValue(t,n)),i=l(n));let a=l(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;l(a)&&(a.position=h.clone(n,a.position),a.showSelection=o&&i,a.update());let s=l(this._infoBox)?this._infoBox.viewModel:void 0;l(s)&&(s.showInfo=o,s.enableCamera=i,s.isCameraTracking=this.trackedEntity===this.selectedEntity,o?(s.titleText=r.name??r.id,s.description=X.getValueOrDefault(r.description,t,"")):(s.titleText="",s.description=""))};Ki.prototype._onEntityCollectionChanged=function(e,t,n){let i=n.length;for(let r=0;r<i;r++){let o=n[r];this.selectedEntity===o&&(this.selectedEntity=void 0)}};Ki.prototype._onInfoBoxCameraClicked=function(e){if(e.isCameraTracking&&this.trackedEntity===this.selectedEntity)this.trackedEntity=void 0;else{let n=this.selectedEntity.position;l(n)?this.trackedEntity=this.selectedEntity:this.zoomTo(this.selectedEntity)}};Ki.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};Ki.prototype._onInfoBoxClockClicked=function(e){this.selectedEntity=void 0};Ki.prototype._clearObjects=function(){this.trackedEntity=void 0,this.selectedEntity=void 0};Ki.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&qre(this.timeline,e)};Ki.prototype._onDataSourceAdded=function(e,t){this._cesiumWidget._automaticallyTrackDataSourceClocks&&t===this.clockTrackedDataSource&&qre(this._timeline,t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,Ki.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};Ki.prototype._onDataSourceRemoved=function(e,t){let n=t.entities.id;this._dataSourceChangedListeners[n](),this._dataSourceChangedListeners[n]=void 0};Ki.prototype.addController=function(e){return this._cesiumWidget.addController(e)};Ki.prototype.removeController=function(e){return this._cesiumWidget.removeController(e)};Ki.prototype.zoomTo=function(e,t){return this._cesiumWidget.zoomTo(e,t)};Ki.prototype.flyTo=function(e,t){return this._cesiumWidget.flyTo(e,t)};var MLe=Ki;function RUt(e){let t=document.createElement("div");t.className="cesium-viewer-cesium3DTilesInspectorContainer",e.container.appendChild(t);let n=new T9(t,e.scene);Object.defineProperties(e,{cesium3DTilesInspector:{get:function(){return n}}})}var LLe=RUt;function OUt(e){let t=document.createElement("div");t.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(t);let n=new y9(t,e.scene);Object.defineProperties(e,{cesiumInspector:{get:function(){return n}}})}var NLe=OUt;function MUt(e,t){t=t??H.EMPTY_OBJECT;let n=!0,i=t.flyToOnDrop??!0,r=new be,o=t.clearOnDrop??!0,a=t.dropTarget??e.container,s=t.clampToGround??!0,c=t.proxy;a=zn(a),Object.defineProperties(e,{dropTarget:{get:function(){return a},set:function(f){FLe(a,u),a=f,Yre(a,u)}},dropEnabled:{get:function(){return n},set:function(f){f!==n&&(f?Yre(a,u):FLe(a,u),n=f)}},dropError:{get:function(){return r}},clearOnDrop:{get:function(){return o},set:function(f){o=f}},flyToOnDrop:{get:function(){return i},set:function(f){i=f}},proxy:{get:function(){return c},set:function(f){c=f}},clampToGround:{get:function(){return s},set:function(f){s=f}}});function u(f){CT(f),o&&(e.entities.removeAll(),e.dataSources.removeAll());let d=f.dataTransfer.files,p=d.length;for(let g=0;g<p;g++){let m=d[g],y=new FileReader;y.onload=LUt(e,m,c,s),y.onerror=NUt(e,m),y.readAsText(m)}}Yre(a,u),e.destroy=Ik(e,e.destroy,function(){e.dropEnabled=!1}),e._handleDrop=u}function CT(e){e.stopPropagation(),e.preventDefault()}function FLe(e,t){let n=e;l(n)&&(n.removeEventListener("drop",t,!1),n.removeEventListener("dragenter",CT,!1),n.removeEventListener("dragover",CT,!1),n.removeEventListener("dragexit",CT,!1))}function Yre(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",CT,!1),e.addEventListener("dragover",CT,!1),e.addEventListener("dragexit",CT,!1)}function LUt(e,t,n,i){let r=e.scene;return function(o){let a=t.name;try{let s;if(/\.czml$/i.test(a))s=jH.load(JSON.parse(o.target.result),{sourceUri:a});else if(/\.geojson$/i.test(a)||/\.json$/i.test(a)||/\.topojson$/i.test(a))s=nT.load(JSON.parse(o.target.result),{sourceUri:a,clampToGround:i});else if(/\.(kml|kmz)$/i.test(a))s=Tw.load(t,{sourceUri:a,proxy:n,camera:r.camera,canvas:r.canvas,clampToGround:i,screenOverlayContainer:e.container});else if(/\.gpx$/i.test(a))s=rG.load(t,{sourceUri:a,proxy:n});else{e.dropError.raiseEvent(e,a,`Unrecognized file: ${a}`);return}l(s)&&e.dataSources.add(s).then(function(c){e.flyToOnDrop&&e.flyTo(c)}).catch(function(c){e.dropError.raiseEvent(e,a,c)})}catch(s){e.dropError.raiseEvent(e,a,s)}}}function NUt(e,t){return function(n){e.dropError.raiseEvent(e,t.name,n.target.error)}}var BLe=MUt;function FUt(e,t){t=t??H.EMPTY_OBJECT;let n=new H9({scene:e.scene,container:e.bottomContainer,lowFrameRateMessage:t.lowFrameRateMessage});Object.defineProperties(e,{performanceWatchdog:{get:function(){return n}}})}var kLe=FUt;function zLe(e){let t=e.split(`
|
|
`),n;for(n=0;n<t.length&&!t[n].match(/\S/);n++);if(n===t.length)return"";let i="",r=/^\s*/,a=t[n].match(r)[0].length;for(let s=n;s<t.length;s++){let c=t[s];c.match(r)[0].length>=a&&(c=c.slice(a)),i+=`${c}
|
|
`}return i}function Kd(e){this._scene=e,this._voxelPrimitive=void 0,this._customShaderCompilationRemoveCallback=void 0,this._definedProperties=[],this._getPrimitiveFunctions=[],this._modelMatrixReady=!1;let t=this;function n(r){let{name:o,initialValue:a}=r;t._definedProperties.push(o);let s=r.setPrimitiveFunction;s===!0&&(s=function(f){t._voxelPrimitive[o]=f});let c=r.getPrimitiveFunction;c===!0&&(c=function(){t[o]=t._voxelPrimitive[o]}),l(c)&&t._getPrimitiveFunctions.push(c);let u=Ee.observable();return Ee.defineProperty(t,o,{get:function(){return u()},set:function(f){typeof a=="number"&&typeof f=="string"&&(f=Number(f),isNaN(f)&&(f=a)),typeof a=="boolean"&&typeof f=="number"&&(f=f===1),u(f),l(s)&&l(t._voxelPrimitive)&&(s(f),e.requestRender())}}),t[o]=a,u}function i(r,o){return function(a){let s=t._voxelPrimitive[r].clone();s[o]=a,t._voxelPrimitive[r]=s}}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 r=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=zLe(r)}}),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 r=t._voxelPrimitive.shape;t.shapeIsBox=r===Sc.BOX}}),n({name:"shapeIsEllipsoid",getPrimitiveFunction:function(){let r=t._voxelPrimitive.shape;t.shapeIsEllipsoid=r===Sc.ELLIPSOID}}),n({name:"shapeIsCylinder",getPrimitiveFunction:function(){let r=t._voxelPrimitive.shape;t.shapeIsCylinder=r===Sc.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:-I.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitudeMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingEllipsoidMaxLongitudeMax",initialValue:I.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:-I.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitudeMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingEllipsoidMinLongitudeMax",initialValue:I.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:-I.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitudeMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingEllipsoidMaxLatitudeMax",initialValue:I.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:-I.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitudeMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingEllipsoidMinLatitudeMax",initialValue:I.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:-I.PI,getPrimitiveFunction:function(){t.clippingCylinderMaxAngleMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingCylinderMaxAngleMax",initialValue:I.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:-I.PI}),n({name:"clippingCylinderMinAngleMax",initialValue:I.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&&r0(t)},getPrimitiveFunction:function(){t.translationX=O.getTranslation(t._voxelPrimitive.modelMatrix,new h).x}}),n({name:"translationY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&r0(t)},getPrimitiveFunction:function(){t.translationY=O.getTranslation(t._voxelPrimitive.modelMatrix,new h).y}}),n({name:"translationZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&r0(t)},getPrimitiveFunction:function(){t.translationZ=O.getTranslation(t._voxelPrimitive.modelMatrix,new h).z}}),n({name:"scaleX",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&r0(t)},getPrimitiveFunction:function(){t.scaleX=O.getScale(t._voxelPrimitive.modelMatrix,new h).x}}),n({name:"scaleY",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&r0(t)},getPrimitiveFunction:function(){t.scaleY=O.getScale(t._voxelPrimitive.modelMatrix,new h).y}}),n({name:"scaleZ",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&r0(t)},getPrimitiveFunction:function(){t.scaleZ=O.getScale(t._voxelPrimitive.modelMatrix,new h).z}}),n({name:"angleX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&r0(t)}}),n({name:"angleY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&r0(t)}}),n({name:"angleZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&r0(t)}})}var BUt=new h,kUt=new h,zUt=new Oc,UUt=new $;function r0(e){let t=h.fromElements(e.translationX,e.translationY,e.translationZ,BUt),n=h.fromElements(e.scaleX,e.scaleY,e.scaleZ,kUt),i=zUt;i.heading=e.angleX,i.pitch=e.angleY,i.roll=e.angleZ;let r=$.fromHeadingPitchRoll(i,UUt),o=$.multiplyByScale(r,n,r);e._voxelPrimitive.modelMatrix=O.fromRotationTranslation(o,t,e._voxelPrimitive.modelMatrix)}Object.defineProperties(Kd.prototype,{scene:{get:function(){return this._scene}},voxelPrimitive:{get:function(){return this._voxelPrimitive},set:function(e){if(l(this._customShaderCompilationRemoveCallback)&&this._customShaderCompilationRemoveCallback(),!l(e))return;this._voxelPrimitive=e;let t=this;t._customShaderCompilationRemoveCallback=t._voxelPrimitive.customShaderCompilationEvent.addEventListener(function(n){let i=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=zLe(i),l(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,r0(t)}}});Kd.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};Kd.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};Kd.prototype.toggleTransform=function(){this.transformVisible=!this.transformVisible};Kd.prototype.toggleBounds=function(){this.boundsVisible=!this.boundsVisible};Kd.prototype.toggleClipping=function(){this.clippingVisible=!this.clippingVisible};Kd.prototype.toggleShader=function(){this.shaderVisible=!this.shaderVisible};Kd.prototype.compileShader=function(){l(this._voxelPrimitive)&&(this._voxelPrimitive.customShader=new Pg({fragmentShaderText:this.shaderString,uniforms:this._voxelPrimitive.customShader.uniforms}))};Kd.prototype.shaderEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,r=n.selectionEnd,o=r,s=n.value.slice(i,r).split(`
|
|
`),c=s.length,u;if(t.shiftKey)for(u=0;u<c;++u)s[u][0]===" "&&(s[u][1]===" "?(s[u]=s[u].substr(2),o-=2):(s[u]=s[u].substr(1),o-=1));else for(u=0;u<c;++u)s[u]=` ${s[u]}`,o+=2;let f=s.join(`
|
|
`);n.value=n.value.slice(0,i)+f+n.value.slice(r),n.selectionStart=i!==r?i:o,n.selectionEnd=o}else t.ctrlKey&&(t.keyCode===10||t.keyCode===13)&&this.compileShader();return!0};Kd.prototype.isDestroyed=function(){return!1};Kd.prototype.destroy=function(){let e=this;return this._definedProperties.forEach(function(t){Ee.getObservable(e,t).dispose()}),ue(this)};var l7=Kd;function u7(e,t){e=zn(e);let n=document.createElement("div"),i=new l7(t);this._viewModel=i,this._container=e,this._element=n;let r=document.createElement("div");r.textContent="Voxel Inspector",r.className="cesium-cesiumInspector-button",r.setAttribute("data-bind","click: toggleInspector"),n.appendChild(r),n.className="cesium-cesiumInspector cesium-VoxelInspector",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),e.appendChild(n);let o=document.createElement("div");o.className="cesium-cesiumInspector-dropDown",n.appendChild(o);let{createSection:a,createCheckbox:s,createRangeInput:c,createButton:u}=Of,f=a(o,"Display","displayVisible","toggleDisplay"),d=a(o,"Transform","transformVisible","toggleTransform"),p=a(o,"Clipping","clippingVisible","toggleClipping"),g=a(o,"Shader","shaderVisible","toggleShader");f.appendChild(s("Depth Test","depthTest")),f.appendChild(s("Show","show")),f.appendChild(s("Disable Update","disableUpdate")),f.appendChild(s("Debug Draw","debugDraw")),f.appendChild(s("Jitter","jitter")),f.appendChild(s("Nearest Sampling","nearestSampling")),f.appendChild(c("Screen Space Error","screenSpaceError",0,128)),f.appendChild(c("Step Size","stepSize",0,2));let m=10,y=10,A=I.PI;d.appendChild(c("Translation X","translationX",-m,+m)),d.appendChild(c("Translation Y","translationY",-m,+m)),d.appendChild(c("Translation Z","translationZ",-m,+m)),d.appendChild(c("Scale X","scaleX",0,+y)),d.appendChild(c("Scale Y","scaleY",0,+y)),d.appendChild(c("Scale Z","scaleZ",0,+y)),d.appendChild(c("Heading","angleX",-A,+A)),d.appendChild(c("Pitch","angleY",-A,+A)),d.appendChild(c("Roll","angleZ",-A,+A)),Xre("Max X","Min X","Max Y","Min Y","Max Z","Min Z","clippingBoxMaxX","clippingBoxMinX","clippingBoxMaxY","clippingBoxMinY","clippingBoxMaxZ","clippingBoxMinZ","shapeIsBox",p),Xre("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","clippingEllipsoidMaxLongitude","clippingEllipsoidMinLongitude","clippingEllipsoidMaxLatitude","clippingEllipsoidMinLatitude","clippingEllipsoidMaxHeight","clippingEllipsoidMinHeight","shapeIsEllipsoid",p),Xre("Max Radius","Min Radius","Max Angle","Min Angle","Max Height","Min Height","clippingCylinderMaxRadius","clippingCylinderMinRadius","clippingCylinderMaxAngle","clippingCylinderMinAngle","clippingCylinderMaxHeight","clippingCylinderMinHeight","shapeIsCylinder",p);let b=document.createElement("div");g.appendChild(b);let x=document.createElement("textarea");x.setAttribute("data-bind","textInput: shaderString, event: { keydown: shaderEditorKeyPress }"),b.className="cesium-cesiumInspector-styleEditor",b.appendChild(x);let T=u("Compile (Ctrl+Enter)","compileShader");b.appendChild(T);let C=document.createElement("label");C.style.display="block",C.setAttribute("data-bind","text: shaderCompilationMessage, style: {color: shaderCompilationSuccess ? 'green' : 'red'}"),b.appendChild(C),Ee.applyBindings(i,n)}Object.defineProperties(u7.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});u7.prototype.isDestroyed=function(){return!1};u7.prototype.destroy=function(){return Ee.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),ue(this)};function Xre(e,t,n,i,r,o,a,s,c,u,f,d,p,g){let m=Of.createRangeInputWithDynamicMinMax,y=g.appendChild(document.createElement("div"));y.setAttribute("data-bind",`if: ${p}`),y.appendChild(m(e,a)),y.appendChild(m(t,s)),y.appendChild(m(n,c)),y.appendChild(m(i,u)),y.appendChild(m(r,f)),y.appendChild(m(o,d))}var f7=u7;function VUt(e){let t=document.createElement("div");t.className="cesium-viewer-voxelInspectorContainer",e.container.appendChild(t);let n=new f7(t,e.scene);Object.defineProperties(e,{voxelInspector:{get:function(){return n}}})}var ULe=VUt;globalThis.CESIUM_VERSION="1.144.0";var jUr="1.144.0";export{C0 as AlphaMode,AU as AlphaPipelineStage,Tz as AnchorPointDirect,Cz as AnchorPointIndirect,l9 as Animation,u9 as AnimationViewModel,Sr as Appearance,Oi as ApproximateTerrainHeights,Mse as ArcGISTiledElevationTerrainProvider,Ap as ArcGisBaseMapType,Sy as ArcGisMapServerImageryProvider,bd as ArcGisMapService,sn as ArcType,hl as ArticulationStageType,zt as AssociativeArray,mE as Atmosphere,Zz as AtmospherePipelineStage,an as AttributeCompression,Vt as AttributeType,_6 as AutoExposure,Q_ as AutomaticUniforms,zi as Axis,Vf as AxisAlignedBoundingBox,nV as Azure2DImageryProvider,Nz as B3dmLoader,Lz as B3dmParser,h9 as BaseLayerPicker,f9 as BaseLayerPickerViewModel,Iv as BatchTable,CE as BatchTableHierarchy,Cu as BatchTexture,bU as BatchTexturePipelineStage,Dr as Billboard,md as BillboardCollection,Pl as BillboardGraphics,Va as BillboardLoadState,ly as BillboardTexture,D3 as BillboardVisualizer,Bse as BingMapsGeocoderService,HU as BingMapsImageryProvider,BD as BingMapsStyle,Wc as BlendEquation,Kr as BlendFunction,Fi as BlendOption,en as BlendingState,Je as BoundingRectangle,se as BoundingSphere,It as BoundingSphereState,mx as BoundingVolumeSemantics,mOe as BoxEmitter,Nc as BoxGeometry,K3 as BoxGeometryUpdater,Lv as BoxGraphics,Pm as BoxOutlineGeometry,ij as BrdfLutGenerator,Ze as Buffer,tC as BufferLoader,el as BufferPoint,hf as BufferPointCollection,Sp as BufferPointMaterial,oa as BufferPolygon,Cl as BufferPolygonCollection,sd as BufferPolygonMaterial,Cs as BufferPolyline,vl as BufferPolylineCollection,cd as BufferPolylineMaterial,ra as BufferPrimitive,as as BufferPrimitiveCollection,su as BufferPrimitiveMaterial,Oe as BufferUsage,vU as CPUStylingPipelineStage,l8 as CallbackPositionProperty,cp as CallbackProperty,Ir as Camera,x6 as CameraEventAggregator,or as CameraEventType,rj as CameraFlightPath,k as Cartesian2,h as Cartesian3,ae as Cartesian4,qD as CartesianRectangle,de as Cartographic,Kse as CartographicGeocoderService,nce as CatmullRomSpline,HE as Cesium3DContentGroup,Yh as Cesium3DTile,pp as Cesium3DTileBatchTable,sf as Cesium3DTileColorBlendMode,pOe as Cesium3DTileContent,eS as Cesium3DTileContentFactory,co as Cesium3DTileContentState,Ms as Cesium3DTileContentType,us as Cesium3DTileFeature,mp as Cesium3DTileFeatureTable,qh as Cesium3DTileOptimizationHint,J4 as Cesium3DTileOptimizations,lo as Cesium3DTilePass,Zh as Cesium3DTilePassState,Fy as Cesium3DTilePointFeature,To as Cesium3DTileRefine,Uy as Cesium3DTileStyle,t8 as Cesium3DTileStyleEngine,ZE as Cesium3DTileVectorFeature,T9 as Cesium3DTilesInspector,b9 as Cesium3DTilesInspectorViewModel,iL as Cesium3DTilesTerrainData,fI as Cesium3DTilesTerrainGeometryProcessor,ple as Cesium3DTilesTerrainProvider,_Oe as Cesium3DTilesVoxelProvider,Yo as Cesium3DTileset,i8 as Cesium3DTilesetBaseTraversal,Z4 as Cesium3DTilesetCache,Vv as Cesium3DTilesetGraphics,e8 as Cesium3DTilesetHeatmap,cS as Cesium3DTilesetMetadata,n8 as Cesium3DTilesetMostDetailedTraversal,o8 as Cesium3DTilesetSkipTraversal,Ip as Cesium3DTilesetStatistics,ic as Cesium3DTilesetTraversal,c8 as Cesium3DTilesetVisualizer,y9 as CesiumInspector,g9 as CesiumInspectorViewModel,mC as CesiumTerrainProvider,LH as CesiumWidget,Ur as Check,AR as CheckerboardMaterialProperty,b5 as CircleEmitter,cue as CircleGeometry,due as CircleOutlineGeometry,GV as ClassificationModelDrawCommand,xU as ClassificationPipelineStage,WP as ClassificationPrimitive,Zn as ClassificationType,ui as ClearCommand,ls as ClippingPlane,va as ClippingPlaneCollection,vD as ClippingPolygon,fp as ClippingPolygonCollection,jm as Clock,_a as ClockRange,Br as ClockStep,r9 as ClockViewModel,vOe as CloudCollection,SO as CloudType,U as Color,Ml as ColorBlendMode,Kt as ColorGeometryInstanceAttribute,Yt as ColorMaterialProperty,ZMe as Command,Y as ComponentDatatype,a4 as Composite3DTileContent,NIe as CompositeEntityCollection,bR as CompositeMaterialProperty,Cc as CompositePositionProperty,Bl as CompositeProperty,lL as CompressedTextureBuffer,lu as ComputeCommand,Ok as ComputeEngine,D4 as ConditionsExpression,EOe as ConeEmitter,_u as ConstantPositionProperty,yi as ConstantProperty,rN as ConstantSpline,j4 as ContentMetadata,Tv as Context,Ft as ContextLimits,FMe as Controller,dj as ControllerHost,uN as CoplanarPolygonGeometry,x_ as CoplanarPolygonGeometryLibrary,dh as CoplanarPolygonOutlineGeometry,tr as CornerType,vz as CorrelationGroup,OC as CorridorGeometry,sr as CorridorGeometryLibrary,$3 as CorridorGeometryUpdater,Fv as CorridorGraphics,AN as CorridorOutlineGeometry,wt as Credit,pj as CreditDisplay,aa as CubeMap,Mk as CubeMapFace,zS as CubeMapPanorama,YT as CubicRealPolynomial,Ui as CullFace,is as CullingVolume,qd as CumulusCloud,j3 as CustomDataSource,vfe as CustomHeightmapTerrainProvider,Pg as CustomShader,Ey as CustomShaderMode,RU as CustomShaderPipelineStage,ox as CustomShaderTranslucencyMode,bN as CylinderGeometry,LC as CylinderGeometryLibrary,J3 as CylinderGeometryUpdater,Bv as CylinderGraphics,xN as CylinderOutlineGeometry,jH as CzmlDataSource,Ca as DataSource,Vp as DataSourceClock,Xk as DataSourceCollection,T8 as DataSourceDisplay,SOe as DebugAppearance,Tg as DebugCameraPrimitive,k6 as DebugInspector,v5 as DebugModelMatrixPrimitive,Ife as DefaultProxy,Ac as DepthFunction,bj as DepthPlane,OU as DequantizationPipelineStage,Op as DerivedCommand,pe as DeveloperError,Tj as DeviceOrientationCameraController,wOe as DirectionalLight,zD as DiscardEmptyTileImagePolicy,VU as DiscardMissingTileImagePolicy,jt as DistanceDisplayCondition,Jn as DistanceDisplayConditionGeometryInstanceAttribute,f_ as DoubleEndedPriorityQueue,TN as DoublyLinkedList,h_ as DracoLoader,nt as DrawCommand,_y as DynamicAtmosphereLightingType,yy as DynamicEnvironmentMapManager,Wv as DynamicGeometryBatch,wi as DynamicGeometryUpdater,_M as EarthOrientationParameters,BA as EarthOrientationParametersSample,ya as EasingFunction,LU as EdgeDetectionPipelineStage,Mh as EdgeDisplayMode,Rj as EdgeFramebuffer,BU as EdgeVisibilityPipelineStage,eu as EllipseGeometry,Ku as EllipseGeometryLibrary,Z3 as EllipseGeometryUpdater,kv as EllipseGraphics,Xf as EllipseOutlineGeometry,te as Ellipsoid,E_ as EllipsoidGeodesic,Ks as EllipsoidGeometry,Q3 as EllipsoidGeometryUpdater,zv as EllipsoidGraphics,Zf as EllipsoidOutlineGeometry,Z8 as EllipsoidPrimitive,Uc as EllipsoidRhumbLine,IOe as EllipsoidSurfaceAppearance,Fa as EllipsoidTangentPlane,B0 as EllipsoidTerrainProvider,vm as EllipsoidalOccluder,dg as Empty3DTileContent,Sn as EncodedCartesian3,$r as Entity,gd as EntityCluster,Qs as EntityCollection,E8 as EntityView,POe as EquirectangularPanorama,be as Event,Fo as EventHelper,zh as Expression,Rt as ExpressionNodeType,Qf as ExtrapolationType,fn as FeatureDetection,rx as FeatureIdPipelineStage,Cj as Fog,ze as ForEach,w5 as FrameRateMonitor,vj as FrameState,Ta as Framebuffer,si as FramebufferManager,H as Frozen,Mj as FrustumCommands,VC as FrustumGeometry,SN as FrustumOutlineGeometry,Zo as Fullscreen,S9 as FullscreenButton,v9 as FullscreenButtonViewModel,yx as GaussianSplat3DTileContent,V4 as GaussianSplatPrimitive,B4 as GaussianSplatRenderResources,QE as GaussianSplatSorter,F4 as GaussianSplatTextureGenerator,nT as GeoJsonDataSource,Bz as GeoJsonLoader,FOe as GeoJsonPrimitive,yb as GeocodeType,P9 as Geocoder,rP as GeocoderService,w9 as GeocoderViewModel,ki as GeographicProjection,$i as GeographicTilingScheme,Tt as Geometry,h4 as Geometry3DTileContent,Me as GeometryAttribute,xn as GeometryAttributes,Yfe as GeometryFactory,Bt as GeometryInstance,yl as GeometryInstanceAttribute,mn as GeometryOffsetAttribute,Gn as GeometryPipeline,UU as GeometryPipelineStage,nh as GeometryType,Ii as GeometryUpdater,oE as GeometryUpdaterSet,sz as GeometryVisualizer,xp as GetFeatureInfoFormat,$8 as Globe,Lj as GlobeDepth,P8 as GlobeSurfaceShaderSet,$h as GlobeSurfaceTile,U8 as GlobeSurfaceTileProvider,V8 as GlobeTranslucency,Nj as GlobeTranslucencyFramebuffer,Ej as GlobeTranslucencyState,AI as GltfBufferViewLoader,bI as GltfDracoLoader,Sz as GltfGpmLoader,wD as GltfGpmLocal,TI as GltfImageLoader,CI as GltfIndexBufferLoader,EI as GltfJsonLoader,Ad as GltfLoader,Xu as GltfLoaderUtil,Dz as GltfMeshPrimitiveGpmLoader,ML as GltfSpzLoader,yz as GltfStructuralMetadataLoader,DI as GltfTextureLoader,RI as GltfVertexBufferLoader,tV as Google2DImageryProvider,kOe as GoogleEarthEnterpriseImageryProvider,KU as GoogleEarthEnterpriseMapsProvider,M_ as GoogleEarthEnterpriseMetadata,aP as GoogleEarthEnterpriseTerrainData,nde as GoogleEarthEnterpriseTerrainProvider,IN as GoogleEarthEnterpriseTileInformation,rde as GoogleGeocoderService,xs as GoogleMaps,zOe as GoogleStreetViewCubeMapPanoramaProvider,rG as GpxDataSource,Zg as GregorianDate,UOe as GridImageryProvider,xR as GridMaterialProperty,ii as GroundGeometryUpdater,HC as GroundPolylineGeometry,tp as GroundPolylinePrimitive,mu as GroundPrimitive,p1 as GroupMetadata,ph as HeadingPitchRange,Oc as HeadingPitchRoll,dM as Heap,it as HeightReference,eh as HeightmapEncoding,Lc as HeightmapTerrainData,rI as HeightmapTessellator,FN as HermitePolynomialApproximation,YA as HermiteSpline,cP as HilbertOrder,O9 as HomeButton,D9 as HomeButtonViewModel,ji as HorizontalOrigin,zMe as HybridScreenSpacePanCameraController,bLe as I3SBuildingSceneLayerExplorer,L9 as I3SBuildingSceneLayerExplorerViewModel,e0 as I3SDataProvider,I5 as I3SDecoder,P5 as I3SFeature,R5 as I3SField,DO as I3SGeometry,vw as I3SLayer,RO as I3SNode,F5 as I3SStatistics,B5 as I3SSublayer,L5 as I3SSymbology,jz as I3dmLoader,zz as I3dmParser,XOe as ITwinData,rs as ITwinPlatform,kN as Iau2000Orientation,xM as Iau2006XysData,zT as Iau2006XysSample,zN as IauOrientationAxes,BN as IauOrientationParameters,bE as ImageBasedLighting,eU as ImageBasedLightingPipelineStage,Wb as ImageMaterialProperty,GD as Imagery,t4 as ImageryConfiguration,YD as ImageryCoverage,aV as ImageryFlags,cV as ImageryInput,wa as ImageryLayer,uS as ImageryLayerCollection,yp as ImageryLayerFeatureInfo,lV as ImageryPipelineStage,xd as ImageryProvider,jn as ImageryState,t1 as Implicit3DTileContent,mI as ImplicitAvailabilityBitstream,pI as ImplicitMetadataView,ka as ImplicitSubdivisionScheme,y_ as ImplicitSubtree,A5 as ImplicitSubtreeCache,oL as ImplicitSubtreeMetadata,v0 as ImplicitTileCoordinates,E0 as ImplicitTileset,Ve as IndexDatatype,B9 as InfoBox,N9 as InfoBoxViewModel,Of as InspectorShared,Do as InstanceAttributeSemantic,pU as InstancingPipelineStage,Yde as InterpolationAlgorithm,Xm as InterpolationType,Xt as Intersect,ci as IntersectionTests,Rm as Intersections2D,$o as Interval,G1 as InvertClassification,Fm as Ion,B_ as IonGeocodeProviderType,GC as IonGeocoderService,Eu as IonImageryProvider,HD as IonImageryProviderFactory,ga as IonResource,wy as IonWorldImageryStyle,Qe as Iso8601,wj as JobScheduler,kc as JobType,Ay as JsonMetadataTable,K as JulianDate,uL as KTX2Transcoder,Xr as KeyboardEventModifier,zr as KeyframeNode,oG as KmlCamera,Tw as KmlDataSource,e5 as KmlLookAt,n5 as KmlTour,r5 as KmlTourFlyTo,o5 as KmlTourWait,Hb as Label,Y0 as LabelCollection,op as LabelGraphics,bo as LabelStyle,cz as LabelVisualizer,VN as LagrangePolynomialApproximation,dr as LeapSecond,$Oe as Light,rg as LightingModel,fV as LightingPipelineStage,qC as LinearApproximation,qA as LinearSpline,nMe as MVTDataProvider,au as ManagedArray,Du as MapMode2D,ehe as MapProjection,$U as MapboxImageryProvider,rMe as MapboxStyleImageryProvider,sV as MappedPositions,ir as Material,Ar as MaterialAppearance,pV as MaterialPipelineStage,xo as MaterialProperty,I as Math,Zi as Matrix2,$ as Matrix3,O as Matrix4,lH as Megatexture,Pz as MeshPrimitiveGpmLocal,Nm as MetadataClass,A0 as MetadataClassProperty,Mt as MetadataComponentType,qn as MetadataEntity,BL as MetadataEnum,NL as MetadataEnumValue,Pj as MetadataPicking,Cd as MetadataPickingPipelineStage,Fh as MetadataPipelineStage,Zl as MetadataSchema,tb as MetadataSchemaLoader,ch as MetadataSemantic,oh as MetadataTable,sL as MetadataTableProperty,gt as MetadataType,sh as MipmapHint,Ed as Model,Sd as Model3DTileContent,UE as ModelAlphaOptions,Gz as ModelAnimation,Hz as ModelAnimationChannel,qz as ModelAnimationCollection,cf as ModelAnimationLoop,gp as ModelAnimationState,iU as ModelArticulation,tU as ModelArticulationStage,aU as ModelClippingPlanesPipelineStage,lU as ModelClippingPolygonsPipelineStage,ix as ModelColorPipelineStage,Tn as ModelComponents,qV as ModelDrawCommand,KV as ModelDrawCommands,Yz as ModelFeature,Xz as ModelFeatureTable,dy as ModelGraphics,n4 as ModelImagery,kE as ModelImageryMapping,jV as ModelLightingOptions,gU as ModelMatrixUpdateStage,uU as ModelNode,zE as ModelPrimitiveImagery,Ps as ModelReader,MV as ModelRenderResources,yU as ModelRuntimeNode,RV as ModelRuntimePrimitive,JV as ModelSceneGraph,BV as ModelSilhouettePipelineStage,OV as ModelSkin,UV as ModelSplitterPipelineStage,ZV as ModelStatistics,qo as ModelType,_t as ModelUtility,o4 as ModelVisualizer,tj as Moon,_V as MorphTargetsPipelineStage,the as MorphWeightSpline,nb as MortonOrder,sc as MouseButton,W4 as Multiple3DTileContent,zk as MultisampleFramebuffer,U9 as NavigationHelpButton,k9 as NavigationHelpButtonViewModel,Wt as NearFarScalar,oMe as NeverTileDiscardPolicy,VV as NodeRenderResources,_U as NodeStatisticsPipelineStage,Uv as NodeTransformationProperty,Bj as OIT,WN as Occluder,yr as OffsetGeometryInstanceAttribute,ohe as OpenCageGeocoderService,DA as OpenStreetMapImageryProvider,P3 as OrderedGroundPrimitiveCollection,Jt as OrientedBoundingBox,pn as OrthographicFrustum,Aa as OrthographicOffCenterFrustum,ahe as Packable,she as PackableForInterpolation,sMe as Panorama,cMe as PanoramaProvider,NO as Particle,fMe as ParticleBurst,hMe as ParticleEmitter,gMe as ParticleSystem,Pe as Pass,_c as PassState,hy as PathGraphics,Ag as PathMode,g8 as PathVisualizer,UN as PeliasGeocoderService,_n as PerInstanceColorAppearance,nA as PerformanceDisplay,H9 as PerformanceWatchdog,V9 as PerformanceWatchdogViewModel,Yi as PerspectiveFrustum,ru as PerspectiveOffCenterFrustum,Dj as PickDepth,kj as PickDepthFramebuffer,zj as PickFramebuffer,Lk as PickId,mH as PickedMetadataInfo,Jj as Picking,yV as PickingPipelineStage,k_ as PinBuilder,ke as PixelDatatype,He as PixelFormat,Oj as PlanarFillIdFramebuffer,tn as Plane,KN as PlaneGeometry,ez as PlaneGeometryUpdater,V3 as PlaneGraphics,JN as PlaneOutlineGeometry,e4 as PntsLoader,jE as PntsParser,MH as PointCloud,xy as PointCloudEyeDomeLighting,J0 as PointCloudShading,bV as PointCloudStylingPipelineStage,jv as PointGraphics,Ss as PointPrimitive,ZP as PointPrimitiveCollection,_8 as PointVisualizer,U_ as PolygonGeometry,$n as PolygonGeometryLibrary,tz as PolygonGeometryUpdater,ap as PolygonGraphics,Vc as PolygonHierarchy,eF as PolygonOutlineGeometry,li as PolygonPipeline,Vh as Polyline,TR as PolylineArrowMaterialProperty,Ep as PolylineCollection,Ua as PolylineColorAppearance,CR as PolylineDashMaterialProperty,V_ as PolylineGeometry,A8 as PolylineGeometryUpdater,vR as PolylineGlowMaterialProperty,Dl as PolylineGraphics,yc as PolylineMaterialAppearance,Qx as PolylineOutlineMaterialProperty,nr as PolylinePipeline,x8 as PolylineVisualizer,tF as PolylineVolumeGeometry,Hm as PolylineVolumeGeometryLibrary,nz as PolylineVolumeGeometryUpdater,Hv as PolylineVolumeGraphics,nF as PolylineVolumeOutlineGeometry,rp as PositionProperty,mA as PositionPropertyArray,Mr as PostProcessStage,y6 as PostProcessStageCollection,yf as PostProcessStageComposite,kd as PostProcessStageLibrary,Bd as PostProcessStageSampleMode,IS as PostProcessStageTextureCache,Iz as PpeMetadata,WMe as PpeSource,wz as PpeTexture,Fn as Primitive,pu as PrimitiveCollection,yE as PrimitiveLoadPlan,_E as PrimitiveOutlineGenerator,CV as PrimitiveOutlinePipelineStage,Pv as PrimitivePipeline,HV as PrimitiveRenderResources,sa as PrimitiveState,vV as PrimitiveStatisticsPipelineStage,Re as PrimitiveType,Y9 as ProjectionPicker,W9 as ProjectionPickerViewModel,X as Property,ER as PropertyArray,pE as PropertyAttribute,pz as PropertyAttributeProperty,Au as PropertyBag,xu as PropertyTable,by as PropertyTexture,mz as PropertyTextureProperty,ho as ProviderViewModel,Phe as Proxy,Kl as QuadraticRealPolynomial,j8 as QuadtreeOccluders,K8 as QuadtreePrimitive,G8 as QuadtreeTile,rc as QuadtreeTileLoadState,_Me as QuadtreeTileProvider,hC as QuantizedMeshTerrainData,UM as QuarticRealPolynomial,Fe as Quaternion,iF as QuaternionSpline,fb as Queue,hn as Ray,ie as Rectangle,nv as RectangleCollisionChecker,ov as RectangleGeometry,Ts as RectangleGeometryLibrary,iz as RectangleGeometryUpdater,sp as RectangleGraphics,cv as RectangleOutlineGeometry,Vi as ReferenceFrame,Yy as ReferenceProperty,je as RenderState,ld as Renderbuffer,fu as RenderbufferFormat,Eo as Request,l0 as RequestErrorEvent,fl as RequestScheduler,Ti as RequestState,Za as RequestType,De as Resource,Ni as ResourceCache,Ql as ResourceCacheKey,zL as ResourceCacheStatistics,er as ResourceLoader,At as ResourceLoaderState,nm as Rotation,oe as RuntimeError,q_ as S2Cell,Zs as SDFSettings,vc as SampledPositionProperty,Md as SampledProperty,Ut as Sampler,bg as ScaledPositionProperty,yH as Scene,vS as SceneFramebuffer,re as SceneMode,EV as SceneMode2DPipelineStage,J9 as SceneModePicker,K9 as SceneModePickerViewModel,cr as SceneTransforms,b6 as SceneTransitioner,R6 as ScreenSpaceCameraController,e9 as ScreenSpaceElevatorCameraController,os as ScreenSpaceEventHandler,ln as ScreenSpaceEventType,i0 as ScreenSpaceInputBindings,t9 as ScreenSpaceMapCameraController,UMe as ScreenSpaceTiltOrbitCameraController,VMe as ScreenSpaceZoomCameraController,ax as SelectedFeatureIdPipelineStage,t7 as SelectionIndicator,Q9 as SelectionIndicatorViewModel,IR as SensorVolumePortionToDisplay,ry as ShaderBuilder,Nk as ShaderCache,he as ShaderDestination,Vk as ShaderFunction,Zt as ShaderProgram,Ge as ShaderSource,Uk as ShaderStruct,aA as ShadowMap,Np as ShadowMapShader,Rn as ShadowMode,fd as ShadowVolumeAppearance,Hk as SharedContext,Dn as ShowGeometryInstanceAttribute,Sb as Simon1994PlanetaryPositions,Ume as SimplePolylineGeometry,JU as SingleTileImageryProvider,wV as SkinningPipelineStage,xH as SkyAtmosphere,EH as SkyBox,O6 as SnapFramebuffer,L6 as Snapping,uH as SpatialNode,Ez as Spdcf,hp as SpecularEnvironmentCubeMap,yMe as SphereEmitter,gF as SphereGeometry,K_ as SphereOutlineGeometry,_F as Spherical,Er as Spline,jo as SplitDirection,pR as Splitter,Dh as StaticGeometryColorBatch,Oh as StaticGeometryPerMaterialBatch,TD as StaticGroundGeometryColorBatch,az as StaticGroundGeometryPerMaterialBatch,b8 as StaticGroundPolylinePerMaterialBatch,CD as StaticOutlineGeometryBatch,qt as StencilConstants,Qn as StencilFunction,Pt as StencilOperation,yF as SteppedSpline,xl as Stereographic,Qb as StorageType,SR as StripeMaterialProperty,jp as StripeOrientation,ec as StructuralMetadata,_p as StyleCommandsNeeded,AMe as StyleExpression,PH as Sun,ny as SunLight,B6 as SunPostProcess,xz as SupportedImageFormats,i9 as SvgPathBindingHandler,Gk as Sync,Yn as TaskProcessor,$5 as Terrain,Hu as TerrainData,po as TerrainEncoding,D1 as TerrainFillMesh,mc as TerrainMesh,Kv as TerrainOffsetProperty,XM as TerrainPicker,Vr as TerrainProvider,js as TerrainQuantization,Or as TerrainState,Et as Texture,Wk as Texture3D,vv as TextureAtlas,Fk as TextureCache,ni as TextureMagnificationFilter,V6 as TextureManager,Gt as TextureMinificationFilter,SP as TexturePacker,j6 as TextureUniform,on as TextureWrap,wm as TileAvailability,Rd as TileBoundingRegion,X4 as TileBoundingS2Cell,Hy as TileBoundingSphere,bMe as TileBoundingVolume,J5 as TileCoordinatesImageryProvider,xMe as TileDiscardPolicy,Pn as TileEdge,WD as TileImagery,sx as TileMapServiceImageryProvider,H4 as TileMetadata,mf as TileOrientedBoundingBox,qr as TileProviderError,q8 as TileReplacementQueue,fi as TileSelectionResult,CMe as TileState,p4 as Tileset3DTileContent,$4 as TilesetMetadata,Kz as TilesetPipelineStage,Vme as TilingScheme,Un as TimeConstants,NE as TimeDynamicImagery,_R as TimeDynamicPointCloud,Cn as TimeInterval,xa as TimeIntervalCollection,$y as TimeIntervalCollectionPositionProperty,gA as TimeIntervalCollectionProperty,ai as TimeStandard,r7 as Timeline,n7 as TimelineHighlightRange,i7 as TimelineTrack,WL as Tipsify,bT as ToggleButtonViewModel,cA as Tonemapper,$_ as TrackingReferenceFrame,mt as Transforms,Ib as TranslationRotationScale,jj as TranslucentTileClassification,lI as TridiagonalSystemSolver,Hw as TrustedServers,DS as TweenCollection,Bk as UniformState,Ig as UniformType,z5 as UrlTemplate3DTilesDataProvider,Sa as UrlTemplateImageryProvider,jUr as VERSION,c7 as VRButton,a7 as VRButtonViewModel,Yme as VRTheWorldTerrainProvider,HMe as VaryingType,ag as Vector3DTileBatch,v4 as Vector3DTileClampedPolylines,E4 as Vector3DTileContent,Ly as Vector3DTileGeometry,A4 as Vector3DTilePoints,b4 as Vector3DTilePolygons,$E as Vector3DTilePolylines,GE as Vector3DTilePrimitive,gx as VectorGltf3DTileContent,Tl as VectorPipeline,_k as VectorProvider,BH as VelocityOrientationProperty,Zy as VelocityVectorProperty,Vn as VertexArray,ay as VertexArrayFacade,ot as VertexAttributeSemantic,Be as VertexFormat,pr as VerticalExaggeration,PV as VerticalExaggerationPipelineStage,Wn as VerticalOrigin,Vpe as VideoSynchronizer,SS as View,MLe as Viewer,vMe as ViewportQuad,Bo as Visibility,iOe as Visualizer,lA as VoxelBoundsCollection,NS as VoxelBoxShape,z6 as VoxelCell,LS as VoxelContent,FS as VoxelCylinderShape,BS as VoxelEllipsoidShape,f7 as VoxelInspector,l7 as VoxelInspectorViewModel,Dg as VoxelMetadataOrder,qx as VoxelPrimitive,EMe as VoxelProvider,oH as VoxelRenderResources,SMe as VoxelShape,Sc as VoxelShapeType,dH as VoxelTraversal,Hpe as VulkanConstants,Ak as WallGeometry,gv as WallGeometryLibrary,rz as WallGeometryUpdater,my as WallGraphics,bk as WallOutlineGeometry,ee as WebGLConstants,QU as WebMapServiceImageryProvider,eV as WebMapTileServiceImageryProvider,_i as WebMercatorProjection,So as WebMercatorTilingScheme,ns as WindingOrder,FP as WireframeIndexGenerator,DV as WireframePipelineStage,Zj as _shadersAcesTonemappingStage,N6 as _shadersAdditiveBlend,W1 as _shadersAdjustTranslucentFS,H3 as _shadersAllMaterialAppearanceFS,G3 as _shadersAllMaterialAppearanceVS,Qj as _shadersAmbientOcclusionGenerate,e6 as _shadersAmbientOcclusionModulate,t3 as _shadersAspectRampMaterial,dp as _shadersAtmosphereCommon,$z as _shadersAtmosphereStageFS,Jz as _shadersAtmosphereStageVS,W3 as _shadersBasicMaterialAppearanceFS,q3 as _shadersBasicMaterialAppearanceVS,N3 as _shadersBillboardCollectionFS,F3 as _shadersBillboardCollectionVS,t6 as _shadersBlackAndWhite,n6 as _shadersBloomComposite,nj as _shadersBrdfLutGeneratorFS,F6 as _shadersBrightPass,i6 as _shadersBrightness,I4 as _shadersBufferPointMaterialFS,w4 as _shadersBufferPointMaterialVS,uk as _shadersBufferPolygonMaterialFS,lk as _shadersBufferPolygonMaterialVS,hk as _shadersBufferPolylineMaterialFS,dk as _shadersBufferPolylineMaterialVS,n3 as _shadersBumpMapMaterial,CU as _shadersCPUStylingStageFS,TU as _shadersCPUStylingStageVS,i3 as _shadersCheckerboardMaterial,m5 as _shadersCloudCollectionFS,p5 as _shadersCloudCollectionVS,g5 as _shadersCloudNoiseFS,_5 as _shadersCloudNoiseVS,Vj as _shadersCompareAndPackTranslucentDepth,Fj as _shadersCompositeOITFS,ES as _shadersCompositeTranslucentClassification,uz as _shadersComputeIrradianceFS,fz as _shadersComputeRadianceMapFS,mV as _shadersConstantLodStageFS,hV as _shadersConstantLodStageVS,r6 as _shadersContrastBias,dz as _shadersConvolveSpecularMapFS,hz as _shadersConvolveSpecularMapVS,vH as _shadersCubeMapPanoramaVS,SU as _shadersCustomShaderStageFS,EU as _shadersCustomShaderStageVS,pv as _shadersCzmBuiltins,o6 as _shadersDepthOfField,_j as _shadersDepthPlaneFS,yj as _shadersDepthPlaneVS,a6 as _shadersDepthView,NMe as _shadersDepthViewPacked,r3 as _shadersDotMaterial,s6 as _shadersEdgeDetection,MU as _shadersEdgeDetectionStageFS,NU as _shadersEdgeVisibilityStageFS,FU as _shadersEdgeVisibilityStageVS,o3 as _shadersElevationBandMaterial,a3 as _shadersElevationContourMaterial,s3 as _shadersElevationRampMaterial,L1 as _shadersEllipsoidFS,E5 as _shadersEllipsoidSurfaceAppearanceFS,S5 as _shadersEllipsoidSurfaceAppearanceVS,N1 as _shadersEllipsoidVS,u6 as _shadersFXAA,g6 as _shadersFXAA3_11,c3 as _shadersFadeMaterial,wU as _shadersFeatureIdStageFS,IU as _shadersFeatureIdStageVS,c6 as _shadersFilmicTonemapping,Bx as _shadersGaussianBlur1D,kU as _shadersGeometryStageFS,zU as _shadersGeometryStageVS,S8 as _shadersGlobeFS,w8 as _shadersGlobeVS,l3 as _shadersGridMaterial,I1 as _shadersGroundAtmosphere,AB as _shadersHSBToRGB,bB as _shadersHSLToRGB,Qz as _shadersImageBasedLightingStageFS,fU as _shadersInstancingStageCommon,dU as _shadersInstancingStageVS,J6 as _shadersIntersectBox,Z6 as _shadersIntersectCylinder,K6 as _shadersIntersectDepth,Q6 as _shadersIntersectEllipsoid,oR as _shadersIntersectLongitude,$6 as _shadersIntersectPlane,MS as _shadersIntersection,X6 as _shadersIntersectionUtils,hU as _shadersLegacyInstancingStageVS,f6 as _shadersLensFlare,uV as _shadersLightingStageFS,dV as _shadersMaterialStageFS,rH as _shadersMegatexture,PU as _shadersMetadataStageFS,DU as _shadersMetadataStageVS,oU as _shadersModelClippingPlanesStageFS,cU as _shadersModelClippingPolygonsStageFS,sU as _shadersModelClippingPolygonsStageVS,rU as _shadersModelColorStageFS,XV as _shadersModelFS,LV as _shadersModelSilhouetteStageFS,NV as _shadersModelSilhouetteStageVS,kV as _shadersModelSplitterStageFS,YV as _shadersModelVS,d6 as _shadersModifiedReinhardTonemapping,gV as _shadersMorphTargetsStageVS,h6 as _shadersNightVision,u3 as _shadersNormalMapMaterial,iH as _shadersOctree,_f as _shadersPassThrough,Lx as _shadersPassThroughDepth,l6 as _shadersPbrNeutralTonemapping,C3 as _shadersPerInstanceColorAppearanceFS,v3 as _shadersPerInstanceColorAppearanceVS,Ev as _shadersPerInstanceFlatColorAppearanceFS,E3 as _shadersPerInstanceFlatColorAppearanceVS,Mz as _shadersPointCloudEyeDomeLighting,AV as _shadersPointCloudStylingStageVS,Gb as _shadersPointPrimitiveCollectionFS,z3 as _shadersPointPrimitiveCollectionVS,lz as _shadersPolygonSignedDistanceFS,f3 as _shadersPolylineArrowMaterial,Qk as _shadersPolylineColorAppearanceVS,cu as _shadersPolylineCommon,d3 as _shadersPolylineDashMaterial,wv as _shadersPolylineFS,h3 as _shadersPolylineGlowMaterial,e3 as _shadersPolylineMaterialAppearanceVS,m3 as _shadersPolylineOutlineMaterial,Kk as _shadersPolylineShadowVolumeFS,$k as _shadersPolylineShadowVolumeMorphFS,Jk as _shadersPolylineShadowVolumeMorphVS,Zk as _shadersPolylineShadowVolumeVS,g4 as _shadersPolylineVS,z4 as _shadersPrimitiveGaussianSplatFS,k4 as _shadersPrimitiveGaussianSplatVS,TV as _shadersPrimitiveOutlineStageFS,xV as _shadersPrimitiveOutlineStageVS,xB as _shadersRGBToHSB,TB as _shadersRGBToHSL,CB as _shadersRGBToXYZ,m6 as _shadersReinhardTonemapping,iV as _shadersReprojectWebMercatorFS,rV as _shadersReprojectWebMercatorVS,p3 as _shadersRimLightingMaterial,ND as _shadersSelectedFeatureIdStageCommon,GP as _shadersShadowVolumeAppearanceFS,T3 as _shadersShadowVolumeAppearanceVS,kb as _shadersShadowVolumeFS,p6 as _shadersSilhouette,SV as _shadersSkinningStageVS,fR as _shadersSkyAtmosphereCommon,AH as _shadersSkyAtmosphereFS,bH as _shadersSkyAtmosphereVS,TH as _shadersSkyBoxFS,CH as _shadersSkyBoxVS,g3 as _shadersSlopeRampMaterial,_3 as _shadersStripeMaterial,SH as _shadersSunFS,wH as _shadersSunTextureFS,IH as _shadersSunVS,Y3 as _shadersTexturedMaterialAppearanceFS,X3 as _shadersTexturedMaterialAppearanceVS,C4 as _shadersVector3DTileClampedPolylinesFS,T4 as _shadersVector3DTileClampedPolylinesVS,x4 as _shadersVector3DTilePolylinesVS,I8 as _shadersVectorCommon,QD as _shadersVectorTileVS,IV as _shadersVerticalExaggerationStageVS,y5 as _shadersViewportQuadFS,bv as _shadersViewportQuadVS,q6 as _shadersVoxelFS,W6 as _shadersVoxelUtils,Y6 as _shadersVoxelVS,A3 as _shadersWater,y3 as _shadersWaterMaskMaterial,vB as _shadersXYZToRGB,EB as _shadersacesTonemapping,SB as _shadersalphaWeight,wB as _shadersantialias,IB as _shadersapplyHSBShift,PB as _shadersapproximateSphericalCoordinates,DB as _shadersapproximateTanh,RB as _shadersbackFacing,OB as _shadersbranchFreeTernary,MB as _shaderscascadeColor,LB as _shaderscascadeDistance,NB as _shaderscascadeMatrix,FB as _shaderscascadeWeights,BB as _shadersclipPolygons,kB as _shaderscolumbusViewMorph,zB as _shaderscomputeAtmosphereColor,UB as _shaderscomputeGroundAtmosphereScattering,VB as _shaderscomputePosition,jB as _shaderscomputeScattering,HB as _shaderscomputeTextureTransform,eH as _shadersconvertLocalToBoxUv,tH as _shadersconvertLocalToCylinderUv,nH as _shadersconvertLocalToEllipsoidUv,GB as _shaderscosineAndSine,WB as _shadersdecodeRGB8,qB as _shadersdecompressTextureCoordinates,CF as _shadersdegreesPerRadian,YB as _shadersdepthClamp,vF as _shadersdepthRange,fB as _shadersdepthRangeStruct,XB as _shaderseastNorthUpToEyeCoordinates,KB as _shadersellipsoidContainsPoint,$B as _shadersellipsoidTextureCoordinates,EF as _shadersepsilon1,SF as _shadersepsilon2,wF as _shadersepsilon3,IF as _shadersepsilon4,PF as _shadersepsilon5,DF as _shadersepsilon6,RF as _shadersepsilon7,JB as _shadersequalsEpsilon,ZB as _shaderseyeOffset,QB as _shaderseyeToWindowCoordinates,e2 as _shadersfastApproximateAtan,t2 as _shadersfog,n2 as _shadersgammaCorrect,i2 as _shadersgeodeticSurfaceNormal,r2 as _shadersgetDefaultMaterial,o2 as _shadersgetDynamicAtmosphereLightDirection,a2 as _shadersgetLambertDiffuse,s2 as _shadersgetSpecular,c2 as _shadersgetWaterNoise,l2 as _shadershue,OF as _shadersinfinity,u2 as _shadersinverseGamma,f2 as _shadersisEmpty,d2 as _shadersisFull,h2 as _shaderslatitudeToWebMercatorFraction,m2 as _shaderslineDistance,p2 as _shaderslinearToSrgb,g2 as _shadersluminance,dB as _shadersmaterial,hB as _shadersmaterialInput,_2 as _shadersmaximumComponent,y2 as _shadersmetersPerPixel,mB as _shadersmodelMaterial,A2 as _shadersmodelToWindowCoordinates,pB as _shadersmodelVertexOutput,b2 as _shadersmultiplyWithColorBalance,x2 as _shadersnearFarScalar,T2 as _shadersoctDecode,MF as _shadersoneOverPi,LF as _shadersoneOverTwoPi,C2 as _shaderspackDepth,NF as _shaderspassCesium3DTile,FF as _shaderspassCesium3DTileClassification,BF as _shaderspassCesium3DTileClassificationIgnoreShow,kF as _shaderspassCesium3DTileEdges,zF as _shaderspassCesium3DTileEdgesDirect,UF as _shaderspassCesium3DTilePlanarFillId,VF as _shaderspassClassification,jF as _shaderspassCompute,HF as _shaderspassEnvironment,GF as _shaderspassGaussianSplats,WF as _shaderspassGlobe,qF as _shaderspassOpaque,YF as _shaderspassOverlay,XF as _shaderspassTerrainClassification,KF as _shaderspassTranslucent,$F as _shaderspassVoxels,v2 as _shaderspbrLighting,E2 as _shaderspbrNeutralTonemapping,S2 as _shadersphong,JF as _shaderspi,ZF as _shaderspiOverFour,QF as _shaderspiOverSix,eB as _shaderspiOverThree,tB as _shaderspiOverTwo,w2 as _shadersplaneDistance,I2 as _shaderspointAlongRay,nB as _shadersradiansPerDegree,gB as _shadersray,P2 as _shadersrayEllipsoidIntersectionInterval,_B as _shadersraySegment,D2 as _shadersraySphereIntersectionInterval,R2 as _shadersreadDepth,O2 as _shadersreadNonPerspective,M2 as _shadersreverseLogDepth,L2 as _shadersround,N2 as _shaderssaturation,iB as _shaderssceneMode2D,rB as _shaderssceneMode3D,oB as _shaderssceneModeColumbusView,aB as _shaderssceneModeMorphing,F2 as _shadersshadowDepthCompare,yB as _shadersshadowParameters,B2 as _shadersshadowVisibility,k2 as _shaderssignNotZero,sB as _shaderssolarRadius,z2 as _shaderssphericalHarmonics,U2 as _shaderssrgbToLinear,V2 as _shaderstangentToEyeSpaceMatrix,j2 as _shaderstextureCube,cB as _shadersthreePiOver2,H2 as _shaderstransformPlane,G2 as _shaderstranslateRelativeToEye,W2 as _shaderstranslucentPhong,q2 as _shaderstranspose,lB as _shaderstwoPi,Y2 as _shadersunpackClippingExtents,X2 as _shadersunpackDepth,K2 as _shadersunpackFloat,$2 as _shadersunpackTexture,J2 as _shadersunpackUint,Z2 as _shadersvalueTransform,Q2 as _shadersvertexLogDepth,uB as _shaderswebMercatorMaxLatitude,ek as _shaderswindowToEyeCoordinates,tk as _shaderswriteDepthClamp,nk as _shaderswriteLogDepth,ik as _shaderswriteNonPerspective,Xn as addAllToArray,bL as addBuffer,fL as addDefaults,_L as addExtensionsRequired,ah as addExtensionsUsed,QA as addPipelineExtras,bs as addToArray,cM as appendForwardSlash,Pr as arrayRemoveDuplicates,Xme as assert,gC as barycentricCoordinates,Cr as binarySearch,$t as buildModuleUrl,V5 as buildVectorGltfFromMVT,rR as buildVoxelCustomShader,aH as buildVoxelDrawCommands,Xe as clone,Ot as combine,gS as computeFlyToLocationForRectangle,qE as createBillboardPointCallback,xk as createColorRamp,Ln as createCommand,m9 as createDefaultImageryProviderViewModels,p9 as createDefaultTerrainProviderViewModels,DMe as createElevationBandMaterial,OMe as createGooglePhotorealistic3DTileset,Kn as createGuid,oo as createMaterialPropertyDescriptor,MMe as createOsmBuildingsAsync,me as createPropertyDescriptor,yu as createRawPropertyDescriptor,LMe as createTangentSpaceDebugPrimitive,qMe as createTaskProcessorWorker,ak as createUniform,sk as createUniformArray,O4 as createVectorTileBuffersFromModelComponents,Tk as createWorldBathymetryAsync,Iy as createWorldImageryAsync,_v as createWorldTerrainAsync,Ck as decodeGoogleEarthEnterpriseData,W5 as decodeMVT,vk as decodeVectorPolylinePositions,n0 as defaultPickWorldPosition,Vu as defer,l as defined,rk as demodernizeShader,qs as deprecationWarning,ue as destroyObject,hOe as exportKml,oC as findAccessorMinMax,tS as findContentMetadata,nS as findGroupMetadata,XA as findMeshoptExtension,G4 as findTileMetadata,vI as forEachTextureInMaterial,m0 as formatError,cpe as freezeRenderState,Jd as getAbsoluteUri,Yu as getAccessorByteStride,lM as getBaseUri,Nh as getBinaryAccessor,DH as getClipAndStyleCode,_S as getClippingFunction,p_ as getComponentReader,zn as getElement,e_ as getExtensionFromUri,ty as getFilenameFromUri,Ek as getImageFromTypedArray,ym as getImagePixels,wo as getJsonFromTypedArray,Om as getMagic,Rz as getMeshPrimitives,hH as getMetadataClassProperty,pH as getMetadataProperty,Wu as getStringFromTypedArray,An as getTimestamp,Qi as hasExtension,py as heightReferenceOnEntityPropertyChanged,Al as isBitSet,MT as isBlobUri,kA as isCrossOriginUrl,bm as isDataUri,_m as isLeapYear,Ee as knockout,Dw as knockout_3_5_1,n9 as knockout_es5,LT as loadAndExecuteScript,qk as loadCubeMap,m_ as loadImageFromTypedArray,qu as loadKTX2,U0 as mergeSort,gL as moveTechniqueRenderStates,yL as moveTechniquesToExtension,Hf as numberOfComponentsForType,NT as objectToQuery,pt as oneTimeWarning,Cy as parseBatchTable,_z as parseFeatureMetadataLegacy,rC as parseGlb,fM as parseResponseHeaders,gz as parseStructuralMetadata,$D as pickModel,Zpe as pointInsideTriangle,Vy as preprocess3DTileContent,G6 as processVoxelProperties,kf as queryToObject,xL as readAccessorPacked,aC as removeExtension,hL as removeExtensionsRequired,iC as removeExtensionsUsed,pL as removePipelineExtras,AL as removeUnusedElements,P4 as renderBufferPointCollection,fk as renderBufferPolygonCollection,gk as renderBufferPolylineCollection,eb as resizeImageToNextPowerOfTwo,Sk as sampleTerrain,yv as sampleTerrainMostDetailed,wT as scaleToGeodeticSurface,Av as srgbToLinear,wk as subdivideArray,Ic as subscribeAndEvaluate,CL as updateAccessorComponentTypes,EL as updateVersion,No as usesExtension,LLe as viewerCesium3DTilesInspectorMixin,NLe as viewerCesiumInspectorMixin,BLe as viewerDragDropMixin,kLe as viewerPerformanceWatchdogMixin,ULe as viewerVoxelInspectorMixin,n0e as webGLConstantToGlslType,Ik as wrapFunction,XC as writeTextToCanvas};
|