Files
2026-08-11 09:53:42 -04:00

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.
*/
"use strict";var MNe=Object.create;var aP=Object.defineProperty;var LNe=Object.getOwnPropertyDescriptor;var NNe=Object.getOwnPropertyNames;var FNe=Object.getPrototypeOf,BNe=Object.prototype.hasOwnProperty;var kNe=(e,t,n)=>t in e?aP(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var zNe=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(i){throw n=[i],i}};var Hi=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}},ese=(e,t)=>{for(var n in t)aP(e,n,{get:t[n],enumerable:!0})},tse=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of NNe(t))!BNe.call(e,r)&&r!==n&&aP(e,r,{get:()=>t[r],enumerable:!(i=LNe(t,r))||i.enumerable});return e};var Go=(e,t,n)=>(n=e!=null?MNe(FNe(e)):{},tse(t||!e||!e.__esModule?aP(n,"default",{value:e,enumerable:!0}):n,e)),Th=e=>tse(aP({},"__esModule",{value:!0}),e);var at=(e,t,n)=>kNe(e,typeof t!="symbol"?t+"":t,n);var c8=Hi((l8t,nse)=>{var O0=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)};O0.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}};O0.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};O0.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};O0.prototype.random_int31=function(){return this.random_int()>>>1};O0.prototype.random_incl=function(){return this.random_int()*(1/4294967295)};O0.prototype.random=function(){return this.random_int()*(1/4294967296)};O0.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)};O0.prototype.random_long=function(){var e=this.random_int()>>>5,t=this.random_int()>>>6;return(e*67108864+t)*(1/9007199254740992)};nse.exports=O0});var xse=Hi((_v,yv)=>{/*! https://mths.be/punycode v1.4.0 by @mathias */(function(e){var t=typeof _v=="object"&&_v&&!_v.nodeType&&_v,n=typeof yv=="object"&&yv&&!yv.nodeType&&yv,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(k){throw new RangeError(b[k])}function P(k,j){for(var B=k.length,G=[];B--;)G[B]=j(k[B]);return G}function R(k,j){var B=k.split("@"),G="";B.length>1&&(G=B[0]+"@",k=B[1]),k=k.replace(A,".");var W=k.split("."),Q=P(W,j).join(".");return G+Q}function O(k){for(var j=[],B=0,G=k.length,W,Q;B<G;)W=k.charCodeAt(B++),W>=55296&&W<=56319&&B<G?(Q=k.charCodeAt(B++),(Q&64512)==56320?j.push(((W&1023)<<10)+(Q&1023)+65536):(j.push(W),B--)):j.push(W);return j}function N(k){return P(k,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 _(k){return k-48<10?k-22:k-65<26?k-65:k-97<26?k-97:a}function v(k,j){return k+22+75*(k<26)-((j!=0)<<5)}function S(k,j,B){var G=0;for(k=B?T(k/f):k>>1,k+=T(k/j);k>x*c>>1;G+=a)k=T(k/x);return T(G+(x+1)*k/(k+u))}function I(k){var j=[],B=k.length,G,W=0,Q=p,q=d,J,Z,ce,Ae,le,Ce,ye,ve,Ie;for(J=k.lastIndexOf(g),J<0&&(J=0),Z=0;Z<J;++Z)k.charCodeAt(Z)>=128&&w("not-basic"),j.push(k.charCodeAt(Z));for(ce=J>0?J+1:0;ce<B;){for(Ae=W,le=1,Ce=a;ce>=B&&w("invalid-input"),ye=_(k.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 M(k){var j,B,G,W,Q,q,J,Z,ce,Ae,le,Ce=[],ye,ve,Ie,Le;for(k=O(k),ye=k.length,j=p,B=0,Q=d,q=0;q<ye;++q)le=k[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=k[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=k[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(k){return R(k,function(j){return m.test(j)?I(j.slice(4).toLowerCase()):j})}function V(k){return R(k,function(j){return y.test(j)?"xn--"+M(j):j})}if(r={version:"1.3.2",ucs2:{decode:O,encode:N},decode:I,encode:M,toASCII:V,toUnicode:F},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return r});else if(t&&n)if(yv.exports==t)n.exports=r;else for(E in r)r.hasOwnProperty(E)&&(t[E]=r[E]);else e.punycode=r})(_v)});var Cse=Hi((Tse,_8)=>{/*!
* 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 _8=="object"&&_8.exports?_8.exports=t():typeof define=="function"&&define.amd?define(t):e.IPv6=t(e)})(Tse,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 Ese=Hi((vse,y8)=>{/*!
* 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 y8=="object"&&y8.exports?y8.exports=t():typeof define=="function"&&define.amd?define(t):e.SecondLevelDomains=t(e)})(vse,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 af=Hi((Sse,A8)=>{/*!
* 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 A8=="object"&&A8.exports?A8.exports=t(xse(),Cse(),Ese()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):e.URI=t(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(Sse,function(e,t,n,i){"use strict";var r=i&&i.URI;function o(v,S){var I=arguments.length>=1,M=arguments.length>=2;if(!(this instanceof o))return I?M?new o(v,S):new o(v):new o;if(v===void 0){if(I)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?v=location.href+"":v=""}if(v===null&&I)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 I={},M,F;if(f(S)==="RegExp")I=null;else if(d(S))for(M=0,F=S.length;M<F;M++)I[S[M]]=!0;else I[S]=!0;for(M=0,F=v.length;M<F;M++){var V=I&&I[v[M]]!==void 0||!I&&S.test(v[M]);V&&(v.splice(M,1),F--,M--)}return v}function g(v,S){var I,M;if(d(S)){for(I=0,M=S.length;I<M;I++)if(!g(v,S[I]))return!1;return!0}var F=f(S);for(I=0,M=v.length;I<M;I++)if(F==="RegExp"){if(typeof v[I]=="string"&&v[I].match(S))return!0}else if(v[I]===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 I=0,M=v.length;I<M;I++)if(v[I]!==S[I])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 I=o.encode(v+"");return S===void 0&&(S=o.escapeQuerySpace),S?I.replace(/%20/g,"+"):I},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(I){try{return o[S](I+"").replace(o.characters[v][S].expression,function(M){return o.characters[v][S].map[M]})}catch{return I}}};for(T in x)o[T+"PathSegment"]=C("pathname",x[T]),o[T+"UrnPathSegment"]=C("urnpath",x[T]);var E=function(v,S,I){return function(M){var F;I?F=function(B){return o[S](o[I](B))}:F=o[S];for(var V=(M+"").split(v),k=0,j=V.length;k<j;k++)V[k]=F(V[k]);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 I;return S||(S={preventInvalidHostname:o.preventInvalidHostname}),v=v.replace(o.leading_whitespace_expression,""),v=v.replace(o.ascii_tab_whitespace,""),I=v.indexOf("#"),I>-1&&(S.fragment=v.substring(I+1)||null,v=v.substring(0,I)),I=v.indexOf("?"),I>-1&&(S.query=v.substring(I+1)||null,v=v.substring(0,I)),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)):(I=v.indexOf(":"),I>-1&&(S.protocol=v.substring(0,I)||null,S.protocol&&!S.protocol.match(o.protocol_expression)?S.protocol=void 0:v.substring(I+1,I+3).replace(/\\/g,"/")==="//"?(v=v.substring(I+3),v=o.parseAuthority(v,S)):(v=v.substring(I+1),S.urn=!0))),S.path=v,S},o.parseHost=function(v,S){v||(v=""),v=v.replace(/\\/g,"/");var I=v.indexOf("/"),M,F;if(I===-1&&(I=v.length),v.charAt(0)==="[")M=v.indexOf("]"),S.hostname=v.substring(1,M)||null,S.port=v.substring(M+2,I)||null,S.port==="/"&&(S.port=null);else{var V=v.indexOf(":"),k=v.indexOf("/"),j=v.indexOf(":",V+1);j!==-1&&(k===-1||j<k)?(S.hostname=v.substring(0,I)||null,S.port=null):(F=v.substring(0,I).split(":"),S.hostname=F[0]||null,S.port=F[1]||null)}return S.hostname&&v.substring(I).charAt(0)!=="/"&&(I++,v="/"+v),S.preventInvalidHostname&&o.ensureValidHostname(S.hostname,S.protocol),S.port&&o.ensureValidPort(S.port),v.substring(I)||"/"},o.parseAuthority=function(v,S){return v=o.parseUserinfo(v,S),o.parseHost(v,S)},o.parseUserinfo=function(v,S){var I=v,M=v.indexOf("\\");M!==-1&&(v=v.replace(/\\/g,"/"));var F=v.indexOf("/"),V=v.lastIndexOf("@",F>-1?F:v.length-1),k;return V>-1&&(F===-1||V<F)?(k=v.substring(0,V).split(":"),S.username=k[0]?o.decode(k[0]):null,k.shift(),S.password=k[0]?o.decode(k.join(":")):null,v=I.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 I={},M=v.split("&"),F=M.length,V,k,j,B=0;B<F;B++)V=M[B].split("="),k=o.decodeQuery(V.shift(),S),j=V.length?o.decodeQuery(V.join("="),S):null,k!=="__proto__"&&(c.call(I,k)?((typeof I[k]=="string"||I[k]===null)&&(I[k]=[I[k]]),I[k].push(j)):I[k]=j);return I},o.build=function(v){var S="",I=!1;return v.protocol&&(S+=v.protocol+":"),!v.urn&&(S||v.hostname)&&(S+="//",I=!0),S+=o.buildAuthority(v)||"",typeof v.path=="string"&&(v.path.charAt(0)!=="/"&&I&&(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,I){var M="",F,V,k,j;for(V in v)if(V!=="__proto__"&&c.call(v,V))if(d(v[V]))for(F={},k=0,j=v[V].length;k<j;k++)v[V][k]!==void 0&&F[v[V][k]+""]===void 0&&(M+="&"+o.buildQueryParameter(V,v[V][k],I),S!==!0&&(F[v[V][k]+""]=!0));else v[V]!==void 0&&(M+="&"+o.buildQueryParameter(V,v[V],I));return M.substring(1)},o.buildQueryParameter=function(v,S,I){return o.encodeQuery(v,I)+(S!==null?"="+o.encodeQuery(S,I):"")},o.addQuery=function(v,S,I){if(typeof S=="object")for(var M in S)c.call(S,M)&&o.addQuery(v,M,S[M]);else if(typeof S=="string"){if(v[S]===void 0){v[S]=I;return}else typeof v[S]=="string"&&(v[S]=[v[S]]);d(I)||(I=[I]),v[S]=(v[S]||[]).concat(I)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},o.setQuery=function(v,S,I){if(typeof S=="object")for(var M in S)c.call(S,M)&&o.setQuery(v,M,S[M]);else if(typeof S=="string")v[S]=I===void 0?null:I;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},o.removeQuery=function(v,S,I){var M,F,V;if(d(S))for(M=0,F=S.length;M<F;M++)v[S[M]]=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")I!==void 0?f(I)==="RegExp"?!d(v[S])&&I.test(v[S])?v[S]=void 0:v[S]=p(v[S],I):v[S]===String(I)&&(!d(I)||I.length===1)?v[S]=void 0:d(v[S])&&(v[S]=p(v[S],I)):v[S]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},o.hasQuery=function(v,S,I,M){switch(f(S)){case"String":break;case"RegExp":for(var F in v)if(c.call(v,F)&&S.test(F)&&(I===void 0||o.hasQuery(v,F,I)))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(I)){case"Undefined":return S in v;case"Boolean":var k=!!(d(v[S])?v[S].length:v[S]);return I===k;case"Function":return!!I(v[S],S,v);case"Array":if(!d(v[S]))return!1;var j=M?g:m;return j(v[S],I);case"RegExp":return d(v[S])?M?g(v[S],I):!1:!!(v[S]&&v[S].match(I));case"Number":I=String(I);case"String":return d(v[S])?M?g(v[S],I):!1:v[S]===I;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},o.joinPaths=function(){for(var v=[],S=[],I=0,M=0;M<arguments.length;M++){var F=new o(arguments[M]);v.push(F);for(var V=F.segment(),k=0;k<V.length;k++)typeof V[k]=="string"&&S.push(V[k]),V[k]&&I++}if(!S.length||!I)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 I=Math.min(v.length,S.length),M;for(M=0;M<I;M++)if(v.charAt(M)!==S.charAt(M)){M--;break}return M<1?v.charAt(0)===S.charAt(0)&&v.charAt(0)==="/"?"/":"":((v.charAt(M)!=="/"||S.charAt(M)!=="/")&&(M=v.substring(0,M).lastIndexOf("/")),v.substring(0,M+1))},o.withinString=function(v,S,I){I||(I={});var M=I.start||o.findUri.start,F=I.end||o.findUri.end,V=I.trim||o.findUri.trim,k=I.parens||o.findUri.parens,j=/[a-z0-9-]=["']?$/i;for(M.lastIndex=0;;){var B=M.exec(v);if(!B)break;var G=B.index;if(I.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=k.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)&&!(I.ignore&&I.ignore.test(q))){Q=G+q.length;var Ae=S(q,G,Q,v);if(Ae===void 0){M.lastIndex=Q;continue}Ae=String(Ae),v=v.slice(0,G)+Ae+v.slice(Q),M.lastIndex=G+Ae.length}}return M.lastIndex=0,v},o.ensureValidHostname=function(v,S){var I=!!v,M=!!S,F=!1;if(M&&(F=g(o.hostProtocols,S)),F&&!I)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,I){return S===void 0?this._parts[v]||"":(this._parts[v]=S||null,this.build(!I),this)}}function P(v,S){return function(I,M){return I===void 0?this._parts[v]||"":(I!==null&&(I=I+"",I.charAt(0)===S&&(I=I.substring(1))),this._parts[v]=I,this.build(!M),this)}}s.protocol=w("protocol"),s.username=w("username"),s.password=w("password"),s.hostname=w("hostname"),s.port=w("port"),s.query=P("query","?"),s.fragment=P("fragment","#"),s.search=function(v,S){var I=this.query(v,S);return typeof I=="string"&&I.length?"?"+I:I},s.hash=function(v,S){var I=this.fragment(v,S);return typeof I=="string"&&I.length?"#"+I:I},s.pathname=function(v,S){if(v===void 0||v===!0){var I=this._parts.path||(this._parts.hostname?"/":"");return v?(this._parts.urn?o.decodeUrnPath:o.decodePath)(I):I}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 I;if(v===void 0)return this.toString();this._string="",this._parts=o._parts();var M=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(!M&&F&&v.pathname!==void 0&&(v=v.toString()),typeof v=="string"||v instanceof String)this._parts=o.parse(String(v),this._parts);else if(M||F){var k=M?v._parts:v;for(I in k)I!=="query"&&c.call(this._parts,I)&&(this._parts[I]=k[I]);k.query&&this.query(k.query,!1)}else throw new TypeError("invalid input");return this.build(!S),this},s.is=function(v){var S=!1,I=!1,M=!1,F=!1,V=!1,k=!1,j=!1,B=!this._parts.urn;switch(this._parts.hostname&&(B=!1,I=o.ip4_expression.test(this._parts.hostname),M=o.ip6_expression.test(this._parts.hostname),S=I||M,F=!S,V=F&&n&&n.has(this._parts.hostname),k=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 I;case"ip6":case"ipv6":case"inet6":return M;case"idn":return k;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return j}return null};var R=s.protocol,O=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))),O.call(this,v,S))},s.hostname=function(v,S){if(this._parts.urn)return v===void 0?"":this;if(v!==void 0){var I={preventInvalidHostname:this._parts.preventInvalidHostname},M=o.parseHost(v,I);if(M!=="/")throw new TypeError('Hostname "'+v+'" contains characters other than [A-Z0-9.-]');v=I.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 I=this.protocol(),M=this.authority();return M?(I?I+"://":"")+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 I=o.parseHost(v,this._parts);if(I!=="/")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 I=o.parseAuthority(v,this._parts);if(I!=="/")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 I=o.buildUserinfo(this._parts);return I&&I.substring(0,I.length-1)}else return v[v.length-1]!=="@"&&(v+="@"),o.parseUserinfo(v,this._parts),this.build(!S),this},s.resource=function(v,S){var I;return v===void 0?this.path()+this.search()+this.hash():(I=o.parse(v),this._parts.path=I.path,this._parts.query=I.query,this._parts.fragment=I.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 I=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,I)||""}else{var M=this._parts.hostname.length-this.domain().length,F=this._parts.hostname.substring(0,M),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 I=this._parts.hostname.match(/\./g);if(I&&I.length<2)return this._parts.hostname;var M=this._parts.hostname.length-this.tld(S).length-1;return M=this._parts.hostname.lastIndexOf(".",M-1)+1,this._parts.hostname.substring(M)||""}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 I=this._parts.hostname.lastIndexOf("."),M=this._parts.hostname.substring(I+1);return S!==!0&&n&&n.list[M.toLowerCase()]&&n.get(this._parts.hostname)||M}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 I=this._parts.path.length-this.filename().length-1,M=this._parts.path.substring(0,I)||(this._parts.hostname?"/":"");return v?o.decodePath(M):M}else{var F=this._parts.path.length-this.filename().length,V=this._parts.path.substring(0,F),k=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(k,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 I=this._parts.path.lastIndexOf("/"),M=this._parts.path.substring(I+1);return v?o.decodePathSegment(M):M}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 I=this.filename(),M=I.lastIndexOf("."),F,V;return M===-1?"":(F=I.substring(M+1),V=/^[a-z0-9%]+$/i.test(F)?F:"",v?o.decodePathSegment(V):V)}else{v.charAt(0)==="."&&(v=v.substring(1));var k=this.suffix(),j;if(k)v?j=new RegExp(u(k)+"$"):j=new RegExp(u("."+k)+"$");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,I){var M=this._parts.urn?":":"/",F=this.path(),V=F.substring(0,1)==="/",k=F.split(M);if(v!==void 0&&typeof v!="number"&&(I=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&&k.shift(),v<0&&(v=Math.max(k.length+v,0)),S===void 0)return v===void 0?k:k[v];if(v===null||k[v]===void 0)if(d(S)){k=[];for(var j=0,B=S.length;j<B;j++)!S[j].length&&(!k.length||!k[k.length-1].length)||(k.length&&!k[k.length-1].length&&k.pop(),k.push(y(S[j])))}else(S||typeof S=="string")&&(S=y(S),k[k.length-1]===""?k[k.length-1]=S:k.push(S));else S?k[v]=y(S):k.splice(v,1);return V&&k.unshift(""),this.path(k.join(M),I)},s.segmentCoded=function(v,S,I){var M,F,V;if(typeof v!="number"&&(I=S,S=v,v=void 0),S===void 0){if(M=this.segment(v,S,I),!d(M))M=M!==void 0?o.decode(M):void 0;else for(F=0,V=M.length;F<V;F++)M[F]=o.decode(M[F]);return M}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,I)};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 I=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace),M=v.call(this,I);return this._parts.query=o.buildQuery(M||I,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,I){var M=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof v=="string"||v instanceof String)M[v]=S!==void 0?S:null;else if(typeof v=="object")for(var F in v)c.call(v,F)&&(M[F]=v[F]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=o.buildQuery(M,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof v!="string"&&(I=S),this.build(!I),this},s.addQuery=function(v,S,I){var M=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return o.addQuery(M,v,S===void 0?null:S),this._parts.query=o.buildQuery(M,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof v!="string"&&(I=S),this.build(!I),this},s.removeQuery=function(v,S,I){var M=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return o.removeQuery(M,v,S),this._parts.query=o.buildQuery(M,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof v!="string"&&(I=S),this.build(!I),this},s.hasQuery=function(v,S,I){var M=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return o.hasQuery(M,v,S,I)},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 I,M="",F,V;for(S.charAt(0)!=="/"&&(I=!0,S="/"+S),(S.slice(-3)==="/.."||S.slice(-2)==="/.")&&(S+="/"),S=S.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),I&&(M=S.substring(1).match(/^(\.\.\/)+/)||"",M&&(M=M[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 I&&this.is("relative")&&(S=M+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 I="",M=0,F=v._parts.query.split("&"),V=F.length;M<V;M++){var k=(F[M]||"").split("=");I+="&"+o.decodeQuery(k[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),k[1]!==void 0&&(I+="="+o.decodeQuery(k[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}S+="?"+I.substring(1)}return S+=o.decodeQuery(v.hash(),!0),S},s.absoluteTo=function(v){var S=this.clone(),I=["protocol","username","password","hostname","port"],M,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=I[F];F++)S._parts[V]=v._parts[V];return S._parts.path?(S._parts.path.substring(-2)===".."&&(S._parts.path+="/"),S.path().charAt(0)!=="/"&&(M=v.directory(),M=M||(v.path().indexOf("/")===0?"/":""),S._parts.path=(M?M+"/":"")+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(),I,M,F,V,k;if(S._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(v=new o(v).normalize(),I=S._parts,M=v._parts,V=S.path(),k=v.path(),V.charAt(0)!=="/")throw new Error("URI is already relative");if(k.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if(I.protocol===M.protocol&&(I.protocol=null),I.username!==M.username||I.password!==M.password||I.protocol!==null||I.username!==null||I.password!==null)return S.build();if(I.hostname===M.hostname&&I.port===M.port)I.hostname=null,I.port=null;else return S.build();if(V===k)return I.path="",S.build();if(F=o.commonPath(V,k),!F)return S.build();var j=M.path.substring(F.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return I.path=j+I.path.substring(F.length)||"./",S.build()},s.equals=function(v){var S=this.clone(),I=new o(v),M={},F={},V={},k,j,B;if(S.normalize(),I.normalize(),S.toString()===I.toString())return!0;if(k=S.query(),j=I.query(),S.query(""),I.query(""),S.toString()!==I.toString()||k.length!==j.length)return!1;M=o.parseQuery(k,this._parts.escapeQuerySpace),F=o.parseQuery(j,this._parts.escapeQuerySpace);for(B in M)if(c.call(M,B)){if(d(M[B])){if(!m(M[B],F[B]))return!1}else if(M[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 KX=Hi((nhn,KD)=>{/*!
* 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 KD=="object"&&KD&&KD.exports&&(KD.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,P=T.length,R=this.pos;T.length=P+w;var O=b(this,w,A);if(O)for(var N=0;N<w;++N,R+=4)T[P++]=O.getUint32(R,!0);else for(var _=this.buf,v=0;v<w;++v,R+=4)T[P++]=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,P=T.length,R=this.pos;T.length=P+w;var O=b(this,w,A);if(O)for(var N=0;N<w;++N,R+=4)T[P++]=O.getInt32(R,!0);else for(var _=this.buf,v=0;v<w;++v,R+=4)T[P++]=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,P=T.length,R=this.pos;T.length=P+w;var O=b(this,w,y);if(O)for(var N=0;N<w;++N,R+=4)T[P++]=O.getFloat32(R,!0);else for(var _=this.buf,v=0;v<w;++v,R+=4)T[P++]=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,P=T.length,R=this.pos;T.length=P+w;var O=b(this,w,y);if(O)for(var N=0;N<w;++N,R+=8)T[P++]=O.getFloat64(R,!0);else for(var _=this.buf,v=0;v<w;++v,R+=8)T[P++]=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 P=C>>>3;T.length=w+P;for(var R=0;R<P;++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 P=C>>>3;T.length=w+P;for(var R=0;R<P;++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,P,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],P=p[A+6],R=p[A+7],(b|x|T|C|E|w|P|R)&128)return u(p,A,m,y);y+=String.fromCharCode(b,x,T,C,E,w,P,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,P,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],P=p[A+6],R=p[A+7],(b|x|T|C|E|w|P|R)&128)return y+f(s,p,A,m);y+=String.fromCharCode(b,x,T,C,E,w,P,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 P=this.constructor.alloc(w);P.set(this.buf.subarray(0,this.pos),0),this.buf=P,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,P=T.hi;P;)C[E++]=w&127|128,w=(w>>>7|P<<25)>>>0,P>>>=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 P=c.length(C);return this.uint32(P),this._reserve(P),P===C.length?p(C,this.buf,this.pos):c.write(C,this.buf,this.pos),this.pos+=P,this},u.prototype.uint32s=function(C){var E=C.length;this._reserve(E*5+5);for(var w=this.buf,P=this.pos,R=P+1,O=0;O<E;++O)R=g(C[O]>>>0,w,R);return this._delim(P,R-P-1)},u.prototype.int32s=function(C){var E=C.length;this._reserve(E*10+5);for(var w=this.buf,P=this.pos,R=P+1,O,N=0;N<E;++N)(O=C[N]|0)<0?R=m(a.fromNumber(O),w,R):R=g(O,w,R);return this._delim(P,R-P-1)},u.prototype.sint32s=function(C){var E=C.length;this._reserve(E*5+5);for(var w=this.buf,P=this.pos,R=P+1,O=0;O<E;++O)R=g((C[O]<<1^C[O]>>31)>>>0,w,R);return this._delim(P,R-P-1)},u.prototype.uint64s=function(C){var E=C.length;this._reserve(E*10+5);for(var w=this.buf,P=this.pos,R=P+1,O=0;O<E;++O)R=m(a.from(C[O]),w,R);return this._delim(P,R-P-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,P=this.pos,R=P+1,O=0;O<E;++O)R=m(a.from(C[O]).zzEncode(),w,R);return this._delim(P,R-P-1)},u.prototype.bools=function(C){var E=C.length;this.uint32(E),this._reserve(E);for(var w=this.buf,P=this.pos,R=0;R<E;++R)w[P++]=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 P=T.buf;return T.view=new DataView(P.buffer,P.byteOffset,P.byteLength)}u.prototype.fixed32s=function(C){var E=C.length,w=E*4;this.uint32(w),this._reserve(w);var P=this.pos,R,O=x(this,E,b);if(O)for(R=0;R<E;++R)O.setUint32(P,C[R]>>>0,!0),P+=4;else{var N=this.buf;for(R=0;R<E;++R)y(C[R]>>>0,N,P),P+=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 P=this.pos,R,O,N=x(this,E,b);if(N)for(R=0;R<E;++R)O=a.from(C[R]),N.setUint32(P,O.lo,!0),N.setUint32(P+4,O.hi,!0),P+=8;else{var _=this.buf;for(R=0;R<E;++R)O=a.from(C[R]),y(O.lo,_,P),y(O.hi,_,P+4),P+=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 P=this.pos,R,O=x(this,E,A);if(O)for(R=0;R<E;++R)O.setFloat32(P,C[R],!0),P+=4;else{var N=this.buf;for(R=0;R<E;++R)r.float.writeFloatLE(C[R],N,P),P+=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 P=this.pos,R,O=x(this,E,A);if(O)for(R=0;R<E;++R)O.setFloat64(P,C[R],!0),P+=8;else{var N=this.buf;for(R=0;R<E;++R)r.float.writeDoubleLE(C[R],N,P),P+=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 P=C.pop();E=this.pos-P-1,w=d(E),w>1?(this._reserve(w-1),this.buf.copyWithin(P+w,P+1,P+1+E),this.pos+=w-1,g(E,this.buf,P)):this.buf[P]=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 zye=Hi((jzn,kye)=>{"use strict";kye.exports=IQe;var qL=1e20;function IQe(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?qL:Math.pow(Math.max(0,.5-w),2),b[m]=w===1?qL:w===0?0:Math.pow(Math.max(0,w-.5),2)}Fye(A,o,a,x,T,E,C),Fye(b,o,a,x,T,E,C);var P=window.Float32Array?new Float32Array(o*a):new Array(o*a);for(m=0,y=o*a;m<y;m++)P[m]=Math.min(Math.max(1-((A[m]-b[m])/i+n),0),1);return P}function Fye(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(Bye(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(Bye(i,r,o,a,t),s=0;s<t;s++)e[c*t+s]=Math.sqrt(r[s])}}function Bye(e,t,n,i,r){n[0]=0,i[0]=-qL,i[1]=+qL;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]=+qL}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 Uye=Hi((Hzn,iH)=>{function PQe(){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 P(_,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 I=S,M=_.charCodeAt(v+1);return 56320<=M&&M<=57343?(I-55296)*1024+(M-56320)+65536:I}if(56320<=S&&S<=57343&&v>=1){var I=_.charCodeAt(v-1),M=S;return 55296<=I&&I<=56319?(I-55296)*1024+(M-56320)+65536:M}return S}function O(_,v,S){var I=[_].concat(v).concat([S]),M=I[I.length-2],F=S,V=I.lastIndexOf(m);if(V>1&&I.slice(1,V).every(function(B){return B==i})&&[i,g,b].indexOf(_)==-1)return C;var k=I.lastIndexOf(r);if(k>0&&I.slice(1,k).every(function(B){return B==r})&&[p,r].indexOf(M)==-1)return I.filter(function(B){return B==r}).length%2==1?E:w;if(M==e&&F==t)return x;if(M==n||M==e||M==t)return F==m&&v.every(function(B){return B==i})?C:T;if(F==n||F==e||F==t)return T;if(M==a&&(F==a||F==s||F==u||F==f))return x;if((M==u||M==s)&&(F==s||F==c))return x;if((M==f||M==c)&&F==c)return x;if(F==i||F==y)return x;if(F==o)return x;if(M==p)return x;var j=I.indexOf(i)!=-1?I.lastIndexOf(i)-1:I.length-2;return[g,b].indexOf(I[j])!=-1&&I.slice(j+1,-1).every(function(B){return B==i})&&F==m||M==y&&[A,b].indexOf(F)!=-1?x:v.indexOf(r)!=-1?C:M==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)),I=[],M=v+1;M<_.length;M++)if(!P(_,M-1)){var F=N(R(_,M));if(O(S,I,F))return M;I.push(F)}return _.length},this.splitGraphemes=function(_){for(var v=[],S=0,I;(I=this.nextBreak(_,S))<_.length;)v.push(_.slice(S,I)),S=I;return S<_.length&&v.push(_.slice(S)),v},this.iterateGraphemes=function(_){var v=0,S={next:(function(){var I,M;return(M=this.nextBreak(_,v))<_.length?(I=_.slice(v,M),v=M,{value:I,done:!1}):v<_.length?(I=_.slice(v),v=_.length,{value:I,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,I;(I=this.nextBreak(_,S))<_.length;)S=I,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 iH<"u"&&iH.exports&&(iH.exports=PQe)});var HDe=Hi((b5,jDe)=>{(function(e,t){typeof b5=="object"&&typeof jDe<"u"?t(b5):typeof define=="function"&&define.amd?define(["exports"],t):(e=e||self,t(e.topojson=e.topojson||{}))})(b5,function(e){"use strict";function t(T){return T}function n(T){if(T==null)return t;var C,E,w=T.scale[0],P=T.scale[1],R=T.translate[0],O=T.translate[1];return function(N,_){_||(C=E=0);var v=2,S=N.length,I=new Array(S);for(I[0]=(C+=N[0])*w+R,I[1]=(E+=N[1])*P+O;v<S;)I[v]=N[v],++v;return I}}function i(T){var C=n(T.transform),E,w=1/0,P=w,R=-w,O=-w;function N(v){v=C(v),v[0]<w&&(w=v[0]),v[0]>R&&(R=v[0]),v[1]<P&&(P=v[1]),v[1]>O&&(O=v[1])}function _(v){switch(v.type){case"GeometryCollection":v.geometries.forEach(_);break;case"Point":N(v.coordinates);break;case"MultiPoint":v.coordinates.forEach(N);break}}T.arcs.forEach(function(v){for(var S=-1,I=v.length,M;++S<I;)M=C(v[S],S),M[0]<w&&(w=M[0]),M[0]>R&&(R=M[0]),M[1]<P&&(P=M[1]),M[1]>O&&(O=M[1])});for(E in T.objects)_(T.objects[E]);return[w,P,R,O]}function r(T,C){for(var E,w=T.length,P=w-C;P<--w;)E=T[P],T[P++]=T[w],T[w]=E}function o(T,C){return typeof C=="string"&&(C=T.objects[C]),C.type==="GeometryCollection"?{type:"FeatureCollection",features:C.geometries.map(function(E){return a(T,E)})}:a(T,C)}function a(T,C){var E=C.id,w=C.bbox,P=C.properties==null?{}:C.properties,R=s(T,C);return E==null&&w==null?{type:"Feature",properties:P,geometry:R}:w==null?{type:"Feature",id:E,properties:P,geometry:R}:{type:"Feature",id:E,bbox:w,properties:P,geometry:R}}function s(T,C){var E=n(T.transform),w=T.arcs;function P(S,I){I.length&&I.pop();for(var M=w[S<0?~S:S],F=0,V=M.length;F<V;++F)I.push(E(M[F],F));S<0&&r(I,V)}function R(S){return E(S)}function O(S){for(var I=[],M=0,F=S.length;M<F;++M)P(S[M],I);return I.length<2&&I.push(I[0]),I}function N(S){for(var I=O(S);I.length<4;)I.push(I[0]);return I}function _(S){return S.map(N)}function v(S){var I=S.type,M;switch(I){case"GeometryCollection":return{type:I,geometries:S.geometries.map(v)};case"Point":M=R(S.coordinates);break;case"MultiPoint":M=S.coordinates.map(R);break;case"LineString":M=O(S.arcs);break;case"MultiLineString":M=S.arcs.map(O);break;case"Polygon":M=_(S.arcs);break;case"MultiPolygon":M=S.arcs.map(_);break;default:return null}return{type:I,coordinates:M}}return v(C)}function c(T,C){var E={},w={},P={},R=[],O=-1;C.forEach(function(v,S){var I=T.arcs[v<0?~v:v],M;I.length<3&&!I[1][0]&&!I[1][1]&&(M=C[++O],C[O]=v,C[S]=M)}),C.forEach(function(v){var S=N(v),I=S[0],M=S[1],F,V;if(F=P[I])if(delete P[F.end],F.push(v),F.end=M,V=w[M]){delete w[V.start];var k=V===F?F:F.concat(V);w[k.start=F.start]=P[k.end=V.end]=k}else w[F.start]=P[F.end]=F;else if(F=w[M])if(delete w[F.start],F.unshift(v),F.start=I,V=P[I]){delete P[V.end];var j=V===F?F:V.concat(F);w[j.start=V.start]=P[j.end=F.end]=j}else w[F.start]=P[F.end]=F;else F=[v],w[F.start=I]=P[F.end=M]=F});function N(v){var S=T.arcs[v<0?~v:v],I=S[0],M;return T.transform?(M=[0,0],S.forEach(function(F){M[0]+=F[0],M[1]+=F[1]})):M=S[S.length-1],v<0?[M,I]:[I,M]}function _(v,S){for(var I in v){var M=v[I];delete S[M.start],delete M.start,delete M.end,M.forEach(function(F){E[F<0?~F:F]=1}),R.push(M)}}return _(P,w),_(w,P),C.forEach(function(v){E[v<0?~v:v]||R.push([v])}),R}function u(T){return s(T,f.apply(this,arguments))}function f(T,C,E){var w,P,R;if(arguments.length>1)w=d(T,C,E);else for(P=0,w=new Array(R=T.arcs.length);P<R;++P)w[P]=P;return{type:"MultiLineString",arcs:c(T,w)}}function d(T,C,E){var w=[],P=[],R;function O(I){var M=I<0?~I:I;(P[M]||(P[M]=[])).push({i:I,g:R})}function N(I){I.forEach(O)}function _(I){I.forEach(N)}function v(I){I.forEach(_)}function S(I){switch(R=I,I.type){case"GeometryCollection":I.geometries.forEach(S);break;case"LineString":N(I.arcs);break;case"MultiLineString":case"Polygon":_(I.arcs);break;case"MultiPolygon":v(I.arcs);break}}return S(C),P.forEach(E==null?function(I){w.push(I[0].i)}:function(I){E(I[0].g,I[I.length-1].g)&&w.push(I[0].i)}),w}function p(T){for(var C=-1,E=T.length,w,P=T[E-1],R=0;++C<E;)w=P,P=T[C],R+=w[0]*P[1]-w[1]*P[0];return Math.abs(R)}function g(T){return s(T,m.apply(this,arguments))}function m(T,C){var E={},w=[],P=[];C.forEach(R);function R(_){switch(_.type){case"GeometryCollection":_.geometries.forEach(R);break;case"Polygon":O(_.arcs);break;case"MultiPolygon":_.arcs.forEach(O);break}}function O(_){_.forEach(function(v){v.forEach(function(S){(E[S=S<0?~S:S]||(E[S]=[])).push(_)})}),w.push(_)}function N(_){return p(s(T,{type:"Polygon",arcs:[_]}).coordinates[0])}return w.forEach(function(_){if(!_._){var v=[],S=[_];for(_._=1,P.push(v);_=S.pop();)v.push(_),_.forEach(function(I){I.forEach(function(M){E[M<0?~M:M].forEach(function(F){F._||(F._=1,S.push(F))})})})}}),w.forEach(function(_){delete _._}),{type:"MultiPolygon",arcs:P.map(function(_){var v=[],S;if(_.forEach(function(k){k.forEach(function(j){j.forEach(function(B){E[B<0?~B:B].length<2&&v.push(B)})})}),v=c(T,v),(S=v.length)>1)for(var I=1,M=N(v[0]),F,V;I<S;++I)(F=N(v[I]))>M&&(V=v[0],v[0]=v[I],v[I]=V,M=F);return v}).filter(function(_){return _.length>0})}}function y(T,C){for(var E=0,w=T.length;E<w;){var P=E+w>>>1;T[P]<C?E=P+1:w=P}return E}function A(T){var C={},E=T.map(function(){return[]});function w(k,j){k.forEach(function(B){B<0&&(B=~B);var G=C[B];G?G.push(j):C[B]=[j]})}function P(k,j){k.forEach(function(B){w(B,j)})}function R(k,j){k.type==="GeometryCollection"?k.geometries.forEach(function(B){R(B,j)}):k.type in O&&O[k.type](k.arcs,j)}var O={LineString:w,MultiLineString:P,Polygon:P,MultiPolygon:function(k,j){k.forEach(function(B){P(B,j)})}};T.forEach(R);for(var N in C)for(var _=C[N],v=_.length,S=0;S<v;++S)for(var I=S+1;I<v;++I){var M=_[S],F=_[I],V;(V=E[M])[N=y(V,F)]!==F&&V.splice(N,0,F),(V=E[F])[N=y(V,M)]!==M&&V.splice(N,0,M)}return E}function b(T){if(T==null)return t;var C,E,w=T.scale[0],P=T.scale[1],R=T.translate[0],O=T.translate[1];return function(N,_){_||(C=E=0);var v=2,S=N.length,I=new Array(S),M=Math.round((N[0]-R)/w),F=Math.round((N[1]-O)/P);for(I[0]=M-C,C=M,I[1]=F-E,E=F;v<S;)I[v]=N[v],++v;return I}}function x(T,C){if(T.transform)throw new Error("already quantized");if(!C||!C.scale){if(!((O=Math.floor(C))>=2))throw new Error("n must be \u22652");_=T.bbox||i(T);var E=_[0],w=_[1],P=_[2],R=_[3],O;C={scale:[P-E?(P-E)/(O-1):1,R-w?(R-w)/(O-1):1],translate:[E,w]}}else _=T.bbox;var N=b(C),_,v,S=T.objects,I={};function M(k){return N(k)}function F(k){var j;switch(k.type){case"GeometryCollection":j={type:"GeometryCollection",geometries:k.geometries.map(F)};break;case"Point":j={type:"Point",coordinates:M(k.coordinates)};break;case"MultiPoint":j={type:"MultiPoint",coordinates:k.coordinates.map(M)};break;default:return k}return k.id!=null&&(j.id=k.id),k.bbox!=null&&(j.bbox=k.bbox),k.properties!=null&&(j.properties=k.properties),j}function V(k){var j=0,B=1,G=k.length,W,Q=new Array(G);for(Q[0]=N(k[0],0);++j<G;)((W=N(k[j],j))[0]||W[1])&&(Q[B++]=W);return B===1&&(Q[B++]=[0,0]),Q.length=B,Q}for(v in S)I[v]=F(S[v]);return{type:"Topology",bbox:_,transform:C,objects:I,arcs:T.arcs.map(V)}}e.bbox=i,e.feature=o,e.merge=g,e.mergeArcs=m,e.mesh=u,e.meshArcs=f,e.neighbors=A,e.quantize=x,e.transform=n,e.untransform=b,Object.defineProperty(e,"__esModule",{value:!0})})});var Gm={};ese(Gm,{__addDisposableResource:()=>M1e,__assign:()=>C5,__asyncDelegator:()=>E1e,__asyncGenerator:()=>v1e,__asyncValues:()=>S1e,__await:()=>dI,__awaiter:()=>y1e,__classPrivateFieldGet:()=>D1e,__classPrivateFieldIn:()=>O1e,__classPrivateFieldSet:()=>R1e,__createBinding:()=>E5,__decorate:()=>f1e,__disposeResources:()=>L1e,__esDecorate:()=>h1e,__exportStar:()=>b1e,__extends:()=>l1e,__generator:()=>A1e,__importDefault:()=>P1e,__importStar:()=>I1e,__makeTemplateObject:()=>w1e,__metadata:()=>_1e,__param:()=>d1e,__propKey:()=>p1e,__read:()=>Yne,__rest:()=>u1e,__rewriteRelativeImportExtension:()=>N1e,__runInitializers:()=>m1e,__setFunctionName:()=>g1e,__spread:()=>x1e,__spreadArray:()=>C1e,__spreadArrays:()=>T1e,__values:()=>v5,default:()=>ZMt});function l1e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Wne(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}function u1e(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]]);return n}function f1e(e,t,n,i){var r=arguments.length,o=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,n):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(r<3?a(o):r>3?a(t,n,o):a(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o}function d1e(e,t){return function(n,i){t(n,i,e)}}function h1e(e,t,n,i,r,o){function a(b){if(b!==void 0&&typeof b!="function")throw new TypeError("Function expected");return b}for(var s=i.kind,c=s==="getter"?"get":s==="setter"?"set":"value",u=!t&&e?i.static?e:e.prototype:null,f=t||(u?Object.getOwnPropertyDescriptor(u,i.name):{}),d,p=!1,g=n.length-1;g>=0;g--){var m={};for(var y in i)m[y]=y==="access"?{}:i[y];for(var y in i.access)m.access[y]=i.access[y];m.addInitializer=function(b){if(p)throw new TypeError("Cannot add initializers after decoration has completed");o.push(a(b||null))};var A=(0,n[g])(s==="accessor"?{get:f.get,set:f.set}:f[c],m);if(s==="accessor"){if(A===void 0)continue;if(A===null||typeof A!="object")throw new TypeError("Object expected");(d=a(A.get))&&(f.get=d),(d=a(A.set))&&(f.set=d),(d=a(A.init))&&r.unshift(d)}else(d=a(A))&&(s==="field"?r.unshift(d):f[c]=d)}u&&Object.defineProperty(u,i.name,f),p=!0}function m1e(e,t,n){for(var i=arguments.length>2,r=0;r<t.length;r++)n=i?t[r].call(e,n):t[r].call(e);return i?n:void 0}function p1e(e){return typeof e=="symbol"?e:"".concat(e)}function g1e(e,t,n){return typeof t=="symbol"&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:n?"".concat(n," ",t):t})}function _1e(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function y1e(e,t,n,i){function r(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(f){try{u(i.next(f))}catch(d){a(d)}}function c(f){try{u(i.throw(f))}catch(d){a(d)}}function u(f){f.done?o(f.value):r(f.value).then(s,c)}u((i=i.apply(e,t||[])).next())})}function A1e(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,r,o,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(u){return function(f){return c([u,f])}}function c(u){if(i)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(n=0)),n;)try{if(i=1,r&&(o=u[0]&2?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,r=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){n.label=u[1];break}if(u[0]===6&&n.label<o[1]){n.label=o[1],o=u;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(u);break}o[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(f){u=[6,f],r=0}finally{i=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function b1e(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&E5(t,e,n)}function v5(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Yne(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 x1e(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Yne(arguments[t]));return e}function T1e(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var i=Array(e),r=0,t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,r++)i[r]=o[a];return i}function C1e(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))}function dI(e){return this instanceof dI?(this.v=e,this):new dI(e)}function v1e(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=n.apply(e,t||[]),r,o=[];return r=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",a),r[Symbol.asyncIterator]=function(){return this},r;function a(g){return function(m){return Promise.resolve(m).then(g,d)}}function s(g,m){i[g]&&(r[g]=function(y){return new Promise(function(A,b){o.push([g,y,A,b])>1||c(g,y)})},m&&(r[g]=m(r[g])))}function c(g,m){try{u(i[g](m))}catch(y){p(o[0][3],y)}}function u(g){g.value instanceof dI?Promise.resolve(g.value.v).then(f,d):p(o[0][2],g)}function f(g){c("next",g)}function d(g){c("throw",g)}function p(g,m){g(m),o.shift(),o.length&&c(o[0][0],o[0][1])}}function E1e(e){var t,n;return t={},i("next"),i("throw",function(r){throw r}),i("return"),t[Symbol.iterator]=function(){return this},t;function i(r,o){t[r]=e[r]?function(a){return(n=!n)?{value:dI(e[r](a)),done:!1}:o?o(a):a}:o}}function S1e(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof v5=="function"?v5(e):e[Symbol.iterator](),n={},i("next"),i("throw"),i("return"),n[Symbol.asyncIterator]=function(){return this},n);function i(o){n[o]=e[o]&&function(a){return new Promise(function(s,c){a=e[o](a),r(s,c,a.done,a.value)})}}function r(o,a,s,c){Promise.resolve(c).then(function(u){o({value:u,done:s})},a)}}function w1e(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function I1e(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=qne(e),i=0;i<n.length;i++)n[i]!=="default"&&E5(t,e,n[i]);return $Mt(t,e),t}function P1e(e){return e&&e.__esModule?e:{default:e}}function D1e(e,t,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(e):i?i.value:t.get(e)}function R1e(e,t,n,i,r){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?r.call(e,n):r?r.value=n:t.set(e,n),n}function O1e(e,t){if(t===null||typeof t!="object"&&typeof t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e=="function"?t===e:e.has(t)}function M1e(e,t,n){if(t!=null){if(typeof t!="object"&&typeof t!="function")throw new TypeError("Object expected.");var i,r;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=t[Symbol.asyncDispose]}if(i===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=t[Symbol.dispose],n&&(r=i)}if(typeof i!="function")throw new TypeError("Object not disposable.");r&&(i=function(){try{r.call(this)}catch(o){return Promise.reject(o)}}),e.stack.push({value:t,dispose:i,async:n})}else n&&e.stack.push({async:!0});return t}function L1e(e){function t(o){e.error=e.hasError?new JMt(o,e.error,"An error was suppressed during disposal."):o,e.hasError=!0}var n,i=0;function r(){for(;n=e.stack.pop();)try{if(!n.async&&i===1)return i=0,e.stack.push(n),Promise.resolve().then(r);if(n.dispose){var o=n.dispose.call(n.value);if(n.async)return i|=2,Promise.resolve(o).then(r,function(a){return t(a),r()})}else i|=1}catch(a){t(a)}if(i===1)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}return r()}function N1e(e,t){return typeof e=="string"&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(n,i,r,o,a){return i?t?".jsx":".js":r&&(!o||!a)?n:r+o+"."+a.toLowerCase()+"js"}):e}var Wne,C5,E5,$Mt,qne,JMt,ZMt,Wm=zNe(()=>{Wne=function(e,t){return Wne=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])},Wne(e,t)};C5=function(){return C5=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},C5.apply(this,arguments)};E5=Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]});$Mt=Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t},qne=function(e){return qne=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},qne(e)};JMt=typeof SuppressedError=="function"?SuppressedError:function(e,t,n){var i=new Error(n);return i.name="SuppressedError",i.error=e,i.suppressed=t,i};ZMt={__extends:l1e,__assign:C5,__rest:u1e,__decorate:f1e,__param:d1e,__esDecorate:h1e,__runInitializers:m1e,__propKey:p1e,__setFunctionName:g1e,__metadata:_1e,__awaiter:y1e,__generator:A1e,__createBinding:E5,__exportStar:b1e,__values:v5,__read:Yne,__spread:x1e,__spreadArrays:T1e,__spreadArray:C1e,__await:dI,__asyncGenerator:v1e,__asyncDelegator:E1e,__asyncValues:S1e,__makeTemplateObject:w1e,__importStar:I1e,__importDefault:P1e,__classPrivateFieldGet:D1e,__classPrivateFieldSet:R1e,__classPrivateFieldIn:O1e,__addDisposableResource:M1e,__disposeResources:L1e,__rewriteRelativeImportExtension:N1e}});var F1e=Hi(S5=>{"use strict";Object.defineProperty(S5,"__esModule",{value:!0});S5.version=void 0;S5.version="4.1.5"});var ib=Hi(nb=>{"use strict";Object.defineProperty(nb,"__esModule",{value:!0});nb.hasOwnProperty=void 0;nb.isBoolean=QMt;nb.ellipsis=eLt;nb.removeWithPredicate=tLt;nb.assertNever=nLt;nb.hasOwnProperty=Object.prototype.hasOwnProperty;function QMt(e){return typeof e=="boolean"}function eLt(e,t,n){var i;return e.length>t&&(n==null?(n="&hellip;",i=3):i=n.length,e=e.substring(0,t-i)+n),e}function tLt(e,t){for(var n=e.length-1;n>=0;n--)t(e[n])===!0&&e.splice(n,1)}function nLt(e){throw new Error("Unhandled case for value: '".concat(e,"'"))}});var w5=Hi(_0=>{"use strict";Object.defineProperty(_0,"__esModule",{value:!0});_0.HtmlTag=_0.whitespaceRe=void 0;var iLt=ib();_0.whitespaceRe=/\s+/;var rLt=(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(_0.whitespaceRe):[],r=t.split(_0.whitespaceRe),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(_0.whitespaceRe):[],r=t.split(_0.whitespaceRe),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)iLt.hasOwnProperty.call(t,i)&&n.push(i+'="'+t[i]+'"');return n.join(" ")},e})();_0.HtmlTag=rLt});var k1e=Hi(Kne=>{"use strict";Object.defineProperty(Kne,"__esModule",{value:!0});Kne.truncateSmart=oLt;function oLt(e,t,n){var i,r;if(n==null?(n="&hellip;",r=3,i=8):(r=n.length,i=n.length),e.length<=t)return e;var o=t-r,a=aLt(e);if(a.query){var s=a.query.match(/^(.*?)(?=(\?|#))(.*?)$/i);s&&(a.query=a.query.substr(0,s[1].length),e=B1e(a))}if(e.length<=t||(a.host&&(a.host=a.host.replace(/^www\./,""),e=B1e(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):Xne(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+Xne(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+Xne(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 aLt(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 B1e(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 Xne(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}});var z1e=Hi($ne=>{"use strict";Object.defineProperty($ne,"__esModule",{value:!0});$ne.truncateMiddle=sLt;function sLt(e,t,n){if(e.length<=t)return e;var i,r;n==null?(n="&hellip;",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)}});var U1e=Hi(Jne=>{"use strict";Object.defineProperty(Jne,"__esModule",{value:!0});Jne.truncateEnd=lLt;var cLt=ib();function lLt(e,t,n){return(0,cLt.ellipsis)(e,t,n)}});var Zne=Hi(I5=>{"use strict";Object.defineProperty(I5,"__esModule",{value:!0});I5.AnchorTagBuilder=void 0;var uLt=w5(),fLt=k1e(),dLt=z1e(),hLt=U1e(),mLt=(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 uLt.HtmlTag({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"?(0,fLt.truncateSmart)(t,i):r==="middle"?(0,dLt.truncateMiddle)(t,i):(0,hLt.truncateEnd)(t,i)},e})();I5.AnchorTagBuilder=mLt});var kC=Hi(P5=>{"use strict";Object.defineProperty(P5,"__esModule",{value:!0});P5.AbstractMatch=void 0;var pLt=(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})();P5.AbstractMatch=pLt});var zC=Hi(Jf=>{"use strict";Object.defineProperty(Jf,"__esModule",{value:!0});Jf.isControlChar=gLt;Jf.isAsciiLetterChar=_Lt;Jf.isDigitChar=yLt;Jf.isQuoteChar=ALt;Jf.isWhitespaceChar=bLt;Jf.isAlphaNumericOrMarkChar=xLt;Jf.isValidEmailLocalPartSpecialChar=TLt;Jf.isUrlSuffixAllowedSpecialChar=CLt;Jf.isUrlSuffixNotAllowedAsFinalChar=vLt;Jf.isOpenBraceChar=ELt;Jf.isCloseBraceChar=SLt;function gLt(e){return e>=0&&e<=31||e==127}function _Lt(e){return e>=65&&e<=90||e>=97&&e<=122}function yLt(e){return e>=48&&e<=57}function ALt(e){return e==34||e==39}function bLt(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 xLt(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 TLt(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 CLt(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 vLt(e){return e<58?e<44?e==33:e==44||e==46:e<63?e>=58&&e<=59:e==63||e==94}function ELt(e){return e<91?e==40:e==91||e==123}function SLt(e){return e<93?e==41:e==93||e==125}});var V1e=Hi(D5=>{"use strict";Object.defineProperty(D5,"__esModule",{value:!0});D5.tldRegex=void 0;D5.tldRegex=/^(?: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 R5=Hi(Yr=>{"use strict";Object.defineProperty(Yr,"__esModule",{value:!0});Yr.isDomainLabelStartChar=Yr.isSchemeStartChar=Yr.tldUrlHostRe=Yr.schemeUrlRe=Yr.invalidSchemeRe=Yr.httpSchemePrefixRe=Yr.httpSchemeRe=void 0;Yr.isSchemeChar=ILt;Yr.isDomainLabelChar=PLt;Yr.isPathChar=DLt;Yr.isUrlSuffixStartChar=RLt;Yr.isKnownTld=j1e;Yr.isValidSchemeUrl=OLt;Yr.isValidTldMatch=MLt;Yr.isValidIpV4Address=FLt;var UC=zC(),wLt=V1e();Yr.httpSchemeRe=/https?:\/\//i;Yr.httpSchemePrefixRe=new RegExp("^"+Yr.httpSchemeRe.source,"i");Yr.invalidSchemeRe=/^(javascript|vbscript):/i;Yr.schemeUrlRe=/^[A-Za-z][-.+A-Za-z0-9]*:(\/\/)?([^:/]*)/;Yr.tldUrlHostRe=/^(?:\/\/)?([^/#?:]+)/;Yr.isSchemeStartChar=UC.isAsciiLetterChar;function ILt(e){return(0,UC.isAsciiLetterChar)(e)||(0,UC.isDigitChar)(e)||e===43||e===45||e===46}Yr.isDomainLabelStartChar=UC.isAlphaNumericOrMarkChar;function PLt(e){return e===95||(0,Yr.isDomainLabelStartChar)(e)}function DLt(e){return(0,UC.isAlphaNumericOrMarkChar)(e)||(0,UC.isUrlSuffixAllowedSpecialChar)(e)||(0,UC.isUrlSuffixNotAllowedAsFinalChar)(e)}function RLt(e){return e===47||e===63||e===35}function j1e(e){return wLt.tldRegex.test(e.toLowerCase())}function OLt(e){if(Yr.invalidSchemeRe.test(e))return!1;var t=e.match(Yr.schemeUrlRe);if(!t)return!1;var n=!!t[1],i=t[2];return n?!0:!(i.indexOf(".")===-1||!/[A-Za-z]/.test(i))}function MLt(e){var t=e.match(Yr.tldUrlHostRe);if(!t)return!1;var n=t[0],i=n.split(".");if(i.length<2)return!1;var r=i[i.length-1];return!!j1e(r)}var LLt=/^(?:(?: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]?)$/,NLt=/[:/?#]/;function FLt(e){var t=e.split(NLt,1)[0];return LLt.test(t)}});var Qne=Hi(O5=>{"use strict";Object.defineProperty(O5,"__esModule",{value:!0});O5.UrlMatch=void 0;var BLt=(Wm(),Th(Gm)),kLt=kC(),zLt=R5(),ULt=/^(https?:\/\/)?(?:www\.)?/i,VLt=/^\/\//,jLt=(function(e){BLt.__extends(t,e);function t(n){var i=e.call(this,n)||this;return i.type="url",i.url="",i.urlMatchType="scheme",i.protocolRelativeMatch=!1,i.stripPrefix={scheme:!0,www:!0},i.stripTrailingSlash=!0,i.decodePercentEncoding=!0,i.protocolPrepended=!1,i.urlMatchType=n.urlMatchType,i.url=n.url,i.protocolRelativeMatch=n.protocolRelativeMatch,i.stripPrefix=n.stripPrefix,i.stripTrailingSlash=n.stripTrailingSlash,i.decodePercentEncoding=n.decodePercentEncoding,i}return t.prototype.getType=function(){return"url"},t.prototype.getUrlMatchType=function(){return this.urlMatchType},t.prototype.getUrl=function(){var n=this.url;return!this.protocolRelativeMatch&&this.urlMatchType!=="scheme"&&!this.protocolPrepended&&(n=this.url="http://"+n,this.protocolPrepended=!0),n},t.prototype.getAnchorHref=function(){var n=this.getUrl();return n.replace(/&amp;/g,"&")},t.prototype.getAnchorText=function(){var n=this.getMatchedText();return this.protocolRelativeMatch&&(n=WLt(n)),this.stripPrefix.scheme&&(n=HLt(n)),this.stripPrefix.www&&(n=GLt(n)),this.stripTrailingSlash&&(n=qLt(n)),this.decodePercentEncoding&&(n=YLt(n)),n},t})(kLt.AbstractMatch);O5.UrlMatch=jLt;function HLt(e){return e.replace(zLt.httpSchemePrefixRe,"")}function GLt(e){return e.includes("www.")?e.replace(ULt,"$1"):e}function WLt(e){return e.replace(VLt,"")}function qLt(e){return e.charAt(e.length-1)==="/"&&(e=e.slice(0,-1)),e}function YLt(e){var t=e.replace(/%(?:22|26|27|3C|3E)/gi,function(n){return n==="%22"?"&quot;":n==="%26"?"&amp;":n==="%27"?"&#39;":n==="%3C"||n==="%3c"?"&lt;":"&gt;"});if(t.includes("%"))try{return decodeURIComponent(t)}catch{}return t}});var G1e=Hi(F_=>{"use strict";Object.defineProperty(F_,"__esModule",{value:!0});F_.isEmailLocalPartStartChar=F_.mailtoSchemePrefixRe=void 0;F_.isEmailLocalPartChar=KLt;F_.isValidEmail=$Lt;var H1e=zC(),XLt=R5();F_.mailtoSchemePrefixRe=/^mailto:/i;F_.isEmailLocalPartStartChar=H1e.isAlphaNumericOrMarkChar;function KLt(e){return(0,F_.isEmailLocalPartStartChar)(e)||(0,H1e.isValidEmailLocalPartSpecialChar)(e)}function $Lt(e){var t=e.split(".").pop();return(0,XLt.isKnownTld)(t)}});var eie=Hi(M5=>{"use strict";Object.defineProperty(M5,"__esModule",{value:!0});M5.EmailMatch=void 0;var JLt=(Wm(),Th(Gm)),ZLt=kC(),QLt=(function(e){JLt.__extends(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})(ZLt.AbstractMatch);M5.EmailMatch=QLt});var tie=Hi(hI=>{"use strict";Object.defineProperty(hI,"__esModule",{value:!0});hI.hashtagServices=void 0;hI.isHashtagTextChar=tNt;hI.isValidHashtag=nNt;var eNt=zC();function tNt(e){return e===95||(0,eNt.isAlphaNumericOrMarkChar)(e)}function nNt(e){return e.length<=140}hI.hashtagServices=["twitter","facebook","instagram","tiktok","youtube"]});var nie=Hi(L5=>{"use strict";Object.defineProperty(L5,"__esModule",{value:!0});L5.HashtagMatch=void 0;var iNt=(Wm(),Th(Gm)),rNt=ib(),oNt=kC(),aNt=(function(e){iNt.__extends(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:(0,rNt.assertNever)(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})(oNt.AbstractMatch);L5.HashtagMatch=aNt});var iie=Hi(mI=>{"use strict";Object.defineProperty(mI,"__esModule",{value:!0});mI.mentionServices=void 0;mI.isMentionTextChar=cNt;mI.isValidMention=lNt;var W1e=zC(),sNt={twitter:/^@\w{1,15}$/,instagram:/^@[_\w]{1,30}$/,soundcloud:/^@[-a-z0-9_]{3,25}$/,tiktok:/^@[.\w]{1,23}[\w]$/,youtube:/^@[-.·\w]{3,30}$/};function cNt(e){return e===45||e===46||e===95||(0,W1e.isAsciiLetterChar)(e)||(0,W1e.isDigitChar)(e)}function lNt(e,t){var n=sNt[t];return n.test(e)}mI.mentionServices=["twitter","instagram","soundcloud","tiktok","youtube"]});var rie=Hi(N5=>{"use strict";Object.defineProperty(N5,"__esModule",{value:!0});N5.MentionMatch=void 0;var uNt=(Wm(),Th(Gm)),fNt=ib(),dNt=kC(),hNt=(function(e){uNt.__extends(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:(0,fNt.assertNever)(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})(dNt.AbstractMatch);N5.MentionMatch=hNt});var q1e=Hi(MU=>{"use strict";Object.defineProperty(MU,"__esModule",{value:!0});MU.isPhoneNumberSeparatorChar=yNt;MU.isPhoneNumberControlChar=ANt;MU.isValidPhoneNumber=bNt;var mNt=/[-. ()]/,pNt=/(?:(?:(?:(\+)?\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]+#?)*/,gNt=/(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})/,_Nt=new RegExp("^".concat(pNt.source,"|").concat(gNt.source,"$"));function yNt(e){return e===45||e===46||e===32}function ANt(e){return e===44||e===59}function bNt(e){var t=e.charAt(0)==="+"||mNt.test(e);return t&&_Nt.test(e)}});var oie=Hi(F5=>{"use strict";Object.defineProperty(F5,"__esModule",{value:!0});F5.PhoneMatch=void 0;var xNt=(Wm(),Th(Gm)),TNt=kC(),CNt=(function(e){xNt.__extends(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})(TNt.AbstractMatch);F5.PhoneMatch=CNt});var uie=Hi(U5=>{"use strict";Object.defineProperty(U5,"__esModule",{value:!0});U5.parseMatches=DNt;U5.excludeUnbalancedTrailingBracesAndPunctuation=K1e;var vNt=Qne(),B5=ib(),Po=R5(),pI=G1e(),ENt=eie(),cie=tie(),SNt=nie(),lie=iie(),wNt=rie(),gI=q1e(),INt=oie(),ts=zC(),PNt=(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),X1e(t)&&this.schemeUrlMachinesCount++},e.prototype.removeMachine=function(t){this._stateMachines=this._stateMachines.filter(function(n){return n!==t}),X1e(t)&&this.schemeUrlMachinesCount--},e.prototype.hasSchemeUrlMachine=function(){return this.schemeUrlMachinesCount>0},e})();function DNt(e,t){for(var n=new PNt(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)k5(n,i,r);else{for(var o=n.stateMachines.length-1;o>=0;o--){var a=n.stateMachines[o];switch(a.state){case 11:FNt(n,a,r);break;case 12:BNt(n,a,r);break;case 0:RNt(n,a,r);break;case 1:ONt(n,a,r);break;case 2:MNt(n,a,r);break;case 3:LNt(n,a,r);break;case 4:NNt(n,a,i,r);break;case 5:kNt(n,a,r);break;case 6:zNt(n,a,i,r);break;case 7:UNt(n,a,i,r);break;case 13:VNt(n,a,r);break;case 14:jNt(n,a,r);break;case 8:HNt(n,a,r);break;case 9:GNt(n,a,r);break;case 10:WNt(n,a,r);break;case 15:qNt(n,a,i,r);break;case 16:YNt(n,a,i,r);break;case 17:XNt(n,a,i,r);break;case 18:KNt(n,a,i,r);break;case 19:$Nt(n,a,i,r);break;case 20:JNt(n,a,r);break;case 21:ZNt(n,a,r);break;case 22:VC(n,a,r);break;case 23:QNt(n,a,r);break;case 24:eFt(n,a,r);break;case 25:tFt(n,a,r);break;case 26:nFt(n,a,r);break;case 27:iFt(n,a,r);break;case 28:rFt(n,a,r);break;case 29:oFt(n,a,r);break;case 30:aFt(n,a,r);break;case 31:sFt(n,a,r);break;case 32:lFt(n,a,i,r);break;case 33:uFt(n,a,r);break;case 34:fFt(n,a,r);break;case 35:dFt(n,a,r);break;case 36:hFt(n,a,i,r);break;case 37:cFt(n,a,i,r);break;case 38:mFt(n,a,i,r);break;case 39:pFt(n,a,i,r);break;case 40:gFt(n,a,r);break;case 41:_Ft(n,a,r);break;default:(0,B5.assertNever)(a.state)}}if(!n.hasSchemeUrlMachine()&&n.charIdx>0&&(0,Po.isSchemeStartChar)(r)){var s=n.text.charCodeAt(n.charIdx-1);(0,Po.isSchemeStartChar)(s)||n.addMachine(z5(n.charIdx,0))}}}for(var c=n.stateMachines.length-1;c>=0;c--)n.stateMachines.forEach(function(u){return va(n,u)});return n.matches}function k5(e,t,n){var i=e.charIdx;if(n===35)e.addMachine(xFt(i,28));else if(n===64)e.addMachine(TFt(i,30));else if(n===47)e.addMachine(sie(i,11));else if(n===43)e.addMachine(aie(i,37));else if(n===40)e.addMachine(aie(i,32));else{if((0,ts.isDigitChar)(n)&&(e.addMachine(aie(i,38)),e.addMachine(AFt(i,13))),(0,pI.isEmailLocalPartStartChar)(n)){var r=t.toLowerCase()==="m"?15:22;e.addMachine(bFt(i,r))}(0,Po.isSchemeStartChar)(n)&&e.addMachine(z5(i,0)),(0,ts.isAlphaNumericOrMarkChar)(n)&&e.addMachine(sie(i,5))}}function RNt(e,t,n){n===58?t.state=2:n===45?t.state=1:(0,Po.isSchemeChar)(n)||e.removeMachine(t)}function ONt(e,t,n){var i=e.charIdx;n===45||(n===47?(e.removeMachine(t),e.addMachine(sie(i,11))):(0,Po.isSchemeChar)(n)?t.state=0:e.removeMachine(t))}function MNt(e,t,n){var i=e.charIdx;n===47?t.state=3:n===46?e.removeMachine(t):(0,Po.isDomainLabelStartChar)(n)?(t.state=5,(0,Po.isSchemeStartChar)(n)&&e.addMachine(z5(i,0))):e.removeMachine(t)}function LNt(e,t,n){n===47?t.state=4:(0,Po.isPathChar)(n)?(t.state=10,t.acceptStateReached=!0):va(e,t)}function NNt(e,t,n,i){i===47?(t.state=10,t.acceptStateReached=!0):(0,Po.isDomainLabelStartChar)(i)?(t.state=5,t.acceptStateReached=!0):e.removeMachine(t)}function FNt(e,t,n){n===47?t.state=12:e.removeMachine(t)}function BNt(e,t,n){(0,Po.isDomainLabelStartChar)(n)?t.state=5:e.removeMachine(t)}function kNt(e,t,n){n===46?t.state=7:n===45?t.state=6:n===58?t.state=8:(0,Po.isUrlSuffixStartChar)(n)?t.state=10:(0,Po.isDomainLabelChar)(n)||va(e,t)}function zNt(e,t,n,i){i===45||(i===46?va(e,t):(0,Po.isDomainLabelStartChar)(i)?t.state=5:va(e,t))}function UNt(e,t,n,i){i===46?va(e,t):(0,Po.isDomainLabelStartChar)(i)?(t.state=5,t.acceptStateReached=!0):va(e,t)}function VNt(e,t,n){n===46?t.state=14:n===58?t.state=8:(0,ts.isDigitChar)(n)||((0,Po.isUrlSuffixStartChar)(n)?t.state=10:(0,ts.isAlphaNumericOrMarkChar)(n)?e.removeMachine(t):va(e,t))}function jNt(e,t,n){(0,ts.isDigitChar)(n)?(t.octetsEncountered++,t.octetsEncountered===4&&(t.acceptStateReached=!0),t.state=13):va(e,t)}function HNt(e,t,n){(0,ts.isDigitChar)(n)?t.state=9:va(e,t)}function GNt(e,t,n){(0,ts.isDigitChar)(n)||((0,Po.isUrlSuffixStartChar)(n)?t.state=10:va(e,t))}function WNt(e,t,n){(0,Po.isPathChar)(n)||va(e,t)}function qNt(e,t,n,i){n.toLowerCase()==="a"?t.state=16:VC(e,t,i)}function YNt(e,t,n,i){n.toLowerCase()==="i"?t.state=17:VC(e,t,i)}function XNt(e,t,n,i){n.toLowerCase()==="l"?t.state=18:VC(e,t,i)}function KNt(e,t,n,i){n.toLowerCase()==="t"?t.state=19:VC(e,t,i)}function $Nt(e,t,n,i){n.toLowerCase()==="o"?t.state=20:VC(e,t,i)}function JNt(e,t,n){n===58?t.state=21:VC(e,t,n)}function ZNt(e,t,n){(0,pI.isEmailLocalPartChar)(n)?t.state=22:e.removeMachine(t)}function VC(e,t,n){n===46?t.state=23:n===64?t.state=24:(0,pI.isEmailLocalPartChar)(n)?t.state=22:e.removeMachine(t)}function QNt(e,t,n){n===46||n===64?e.removeMachine(t):(0,pI.isEmailLocalPartChar)(n)?t.state=22:e.removeMachine(t)}function eFt(e,t,n){(0,Po.isDomainLabelStartChar)(n)?t.state=25:e.removeMachine(t)}function tFt(e,t,n){n===46?t.state=27:n===45?t.state=26:(0,Po.isDomainLabelChar)(n)||va(e,t)}function nFt(e,t,n){n===45||n===46?va(e,t):(0,Po.isDomainLabelChar)(n)?t.state=25:va(e,t)}function iFt(e,t,n){n===46||n===45?va(e,t):(0,Po.isDomainLabelStartChar)(n)?(t.state=25,t.acceptStateReached=!0):va(e,t)}function rFt(e,t,n){(0,cie.isHashtagTextChar)(n)?(t.state=29,t.acceptStateReached=!0):e.removeMachine(t)}function oFt(e,t,n){(0,cie.isHashtagTextChar)(n)||va(e,t)}function aFt(e,t,n){(0,lie.isMentionTextChar)(n)?(t.state=31,t.acceptStateReached=!0):e.removeMachine(t)}function sFt(e,t,n){(0,lie.isMentionTextChar)(n)||((0,ts.isAlphaNumericOrMarkChar)(n)?e.removeMachine(t):va(e,t))}function cFt(e,t,n,i){(0,ts.isDigitChar)(i)?t.state=38:(e.removeMachine(t),k5(e,n,i))}function lFt(e,t,n,i){(0,ts.isDigitChar)(i)?t.state=33:e.removeMachine(t),k5(e,n,i)}function uFt(e,t,n){(0,ts.isDigitChar)(n)?t.state=34:e.removeMachine(t)}function fFt(e,t,n){(0,ts.isDigitChar)(n)?t.state=35:e.removeMachine(t)}function dFt(e,t,n){n===41?t.state=36:e.removeMachine(t)}function hFt(e,t,n,i){(0,ts.isDigitChar)(i)?t.state=38:(0,gI.isPhoneNumberSeparatorChar)(i)?t.state=39:e.removeMachine(t)}function mFt(e,t,n,i){var r=e.charIdx;t.acceptStateReached=!0,(0,gI.isPhoneNumberControlChar)(i)?t.state=40:i===35?t.state=41:(0,ts.isDigitChar)(i)||(i===40?t.state=32:(0,gI.isPhoneNumberSeparatorChar)(i)?t.state=39:(va(e,t),(0,Po.isSchemeStartChar)(i)&&e.addMachine(z5(r,0))))}function pFt(e,t,n,i){(0,ts.isDigitChar)(i)?t.state=38:i===40?t.state=32:(va(e,t),k5(e,n,i))}function gFt(e,t,n){(0,gI.isPhoneNumberControlChar)(n)||(n===35?t.state=41:(0,ts.isDigitChar)(n)?t.state=38:va(e,t))}function _Ft(e,t,n){(0,gI.isPhoneNumberControlChar)(n)?t.state=40:(0,ts.isDigitChar)(n)?e.removeMachine(t):va(e,t)}function va(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=K1e(p),t.type){case 0:{var g=i.charCodeAt(t.startIdx-1);if(g===64)return;switch(t.matchType){case 0:{var m=Po.httpSchemeRe.exec(p);if(m&&(d=d+m.index,p=p.slice(m.index)),!(0,Po.isValidSchemeUrl)(p))return;break}case 1:{if(!(0,Po.isValidTldMatch)(p))return;break}case 2:{if(!(0,Po.isValidIpV4Address)(p))return;break}default:(0,B5.assertNever)(t)}n.push(new vNt.UrlMatch({tagBuilder:o,matchedText:p,offset:d,urlMatchType:yFt(t.matchType),url:p,protocolRelativeMatch:p.slice(0,2)==="//",stripPrefix:a,stripTrailingSlash:s,decodePercentEncoding:c}));break}case 1:{(0,pI.isValidEmail)(p)&&n.push(new ENt.EmailMatch({tagBuilder:o,matchedText:p,offset:d,email:p.replace(pI.mailtoSchemePrefixRe,"")}));break}case 2:{(0,cie.isValidHashtag)(p)&&n.push(new SNt.HashtagMatch({tagBuilder:o,matchedText:p,offset:d,serviceName:u,hashtag:p.slice(1)}));break}case 3:{(0,lie.isValidMention)(p,f)&&n.push(new wNt.MentionMatch({tagBuilder:o,matchedText:p,offset:d,serviceName:f,mention:p.slice(1)}));break}case 4:{if(p=p.replace(/ +$/g,""),(0,gI.isValidPhoneNumber)(p)){var y=p.replace(/[^0-9,;#]/g,"");n.push(new INt.PhoneMatch({tagBuilder:o,matchedText:p,offset:d,number:y,plusSign:p.charAt(0)==="+"}))}break}default:(0,B5.assertNever)(t)}}}function yFt(e){switch(e){case 0:return"scheme";case 1:return"tld";case 2:return"ipV4";default:(0,B5.assertNever)(e)}}var Y1e={")":"(","}":"{","]":"["};function K1e(e){for(var t={"(":0,"{":0,"[":0},n=0;n<e.length;n++){var i=e.charAt(n),r=e.charCodeAt(n);(0,ts.isOpenBraceChar)(r)?t[i]++:(0,ts.isCloseBraceChar)(r)&&t[Y1e[i]]--}for(var o=e.length-1;o>=0;){var i=e.charAt(o),r=e.charCodeAt(o);if((0,ts.isCloseBraceChar)(r)){var a=Y1e[i];if(t[a]<0)t[a]++,o--;else break}else if((0,ts.isUrlSuffixNotAllowedAsFinalChar)(r))o--;else break}return e.slice(0,o+1)}function z5(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:0}}function sie(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:1}}function AFt(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:2,octetsEncountered:1}}function bFt(e,t){return{type:1,startIdx:e,state:t,acceptStateReached:!1}}function xFt(e,t){return{type:2,startIdx:e,state:t,acceptStateReached:!1}}function TFt(e,t){return{type:3,startIdx:e,state:t,acceptStateReached:!1}}function aie(e,t){return{type:4,startIdx:e,state:t,acceptStateReached:!1}}function X1e(e){return e.type===0&&e.matchType===0}});var $1e=Hi(hie=>{"use strict";Object.defineProperty(hie,"__esModule",{value:!0});hie.parseHtml=EFt;var xl=(Wm(),Th(Gm)),fu=zC(),CFt=ib(),y0=(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})(),die=new y0,vFt=(function(){function e(t,n){this.charIdx=0,this.state=0,this.currentDataIdx=0,this.currentTag=die,this.html=t,this.callbacks=n}return e})();function EFt(e,t){for(var n=new vFt(e,t),i=e.length;n.charIdx<i;){var r=e.charAt(n.charIdx),o=e.charCodeAt(n.charIdx);switch(n.state){case 0:SFt(n,r);break;case 1:wFt(n,r,o);break;case 2:PFt(n,r,o);break;case 3:IFt(n,r,o);break;case 4:DFt(n,r,o);break;case 5:RFt(n,r,o);break;case 6:OFt(n,r,o);break;case 7:MFt(n,r,o);break;case 8:LFt(n,r);break;case 9:NFt(n,r);break;case 10:FFt(n,r,o);break;case 11:BFt(n,r,o);break;case 12:kFt(n,r);break;case 13:zFt(n);break;case 14:UFt(n,r);break;case 15:VFt(n,r);break;case 16:jFt(n,r);break;case 17:HFt(n,r);break;case 18:GFt(n,r);break;case 19:WFt(n,r);break;case 20:qFt(n,r);break;default:(0,CFt.assertNever)(n.state)}n.charIdx++}n.currentDataIdx<n.charIdx&&YFt(n)}function SFt(e,t){t==="<"&&A0(e)}function wFt(e,t,n){t==="!"?e.state=13:t==="/"?(e.state=2,e.currentTag=new y0(xl.__assign(xl.__assign({},e.currentTag),{isClosing:!0}))):t==="<"?A0(e):(0,fu.isAsciiLetterChar)(n)?(e.state=3,e.currentTag=new y0(xl.__assign(xl.__assign({},e.currentTag),{isOpening:!0}))):(e.state=0,e.currentTag=die)}function IFt(e,t,n){(0,fu.isWhitespaceChar)(n)?(e.currentTag=new y0(xl.__assign(xl.__assign({},e.currentTag),{name:fie(e)})),e.state=4):t==="<"?A0(e):t==="/"?(e.currentTag=new y0(xl.__assign(xl.__assign({},e.currentTag),{name:fie(e)})),e.state=12):t===">"?(e.currentTag=new y0(xl.__assign(xl.__assign({},e.currentTag),{name:fie(e)})),b0(e)):!(0,fu.isAsciiLetterChar)(n)&&!(0,fu.isDigitChar)(n)&&t!==":"&&gh(e)}function PFt(e,t,n){t===">"?gh(e):(0,fu.isAsciiLetterChar)(n)?e.state=3:gh(e)}function DFt(e,t,n){(0,fu.isWhitespaceChar)(n)||(t==="/"?e.state=12:t===">"?b0(e):t==="<"?A0(e):t==="="||(0,fu.isQuoteChar)(n)||(0,fu.isControlChar)(n)?gh(e):e.state=5)}function RFt(e,t,n){(0,fu.isWhitespaceChar)(n)?e.state=6:t==="/"?e.state=12:t==="="?e.state=7:t===">"?b0(e):t==="<"?A0(e):(0,fu.isQuoteChar)(n)&&gh(e)}function OFt(e,t,n){(0,fu.isWhitespaceChar)(n)||(t==="/"?e.state=12:t==="="?e.state=7:t===">"?b0(e):t==="<"?A0(e):(0,fu.isQuoteChar)(n)?gh(e):e.state=5)}function MFt(e,t,n){(0,fu.isWhitespaceChar)(n)||(t==='"'?e.state=8:t==="'"?e.state=9:/[>=`]/.test(t)?gh(e):t==="<"?A0(e):e.state=10)}function LFt(e,t){t==='"'&&(e.state=11)}function NFt(e,t){t==="'"&&(e.state=11)}function FFt(e,t,n){(0,fu.isWhitespaceChar)(n)?e.state=4:t===">"?b0(e):t==="<"&&A0(e)}function BFt(e,t,n){(0,fu.isWhitespaceChar)(n)?e.state=4:t==="/"?e.state=12:t===">"?b0(e):t==="<"?A0(e):(e.state=4,XFt(e))}function kFt(e,t){t===">"?(e.currentTag=new y0(xl.__assign(xl.__assign({},e.currentTag),{isClosing:!0})),b0(e)):gh(e)}function zFt(e){var t=e.html,n=e.charIdx;t.slice(n,n+2)==="--"?(e.charIdx++,e.currentTag=new y0(xl.__assign(xl.__assign({},e.currentTag),{type:"comment"})),e.state=14):t.slice(n,n+7).toUpperCase()==="DOCTYPE"?(e.charIdx+=6,e.currentTag=new y0(xl.__assign(xl.__assign({},e.currentTag),{type:"doctype"})),e.state=20):gh(e)}function UFt(e,t){t==="-"?e.state=15:t===">"?gh(e):e.state=16}function VFt(e,t){t==="-"?e.state=18:t===">"?gh(e):e.state=16}function jFt(e,t){t==="-"&&(e.state=17)}function HFt(e,t){t==="-"?e.state=18:e.state=16}function GFt(e,t){t===">"?b0(e):t==="!"?e.state=19:t==="-"||(e.state=16)}function WFt(e,t){t==="-"?e.state=17:t===">"?b0(e):e.state=16}function qFt(e,t){t===">"?b0(e):t==="<"&&A0(e)}function gh(e){e.state=0,e.currentTag=die}function A0(e){e.state=1,e.currentTag=new y0({idx:e.charIdx})}function b0(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)),gh(e),e.currentDataIdx=e.charIdx+1}function YFt(e){var t=e.html.slice(e.currentDataIdx,e.charIdx);e.callbacks.onText(t,e.currentDataIdx),e.currentDataIdx=e.charIdx+1}function fie(e){var t=e.currentTag.idx+(e.currentTag.isClosing?2:1);return e.html.slice(t,e.charIdx).toLowerCase()}function XFt(e){e.charIdx--}});var V5=Hi(pie=>{"use strict";Object.defineProperty(pie,"__esModule",{value:!0});var mie=(Wm(),Th(Gm)),KFt=F1e(),qs=ib(),$Ft=Zne(),JFt=w5(),ZFt=uie(),QFt=$1e(),eBt=iie(),tBt=tie(),nBt=(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=iBt(t.urls),this.email=(0,qs.isBoolean)(t.email)?t.email:this.email,this.phone=(0,qs.isBoolean)(t.phone)?t.phone:this.phone,this.hashtag=t.hashtag||this.hashtag,this.mention=t.mention||this.mention,this.newWindow=(0,qs.isBoolean)(t.newWindow)?t.newWindow:this.newWindow,this.stripPrefix=rBt(t.stripPrefix),this.stripTrailingSlash=(0,qs.isBoolean)(t.stripTrailingSlash)?t.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding=(0,qs.isBoolean)(t.decodePercentEncoding)?t.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=t.sanitizeHtml||!1;var n=this.mention;if(n!==!1&&eBt.mentionServices.indexOf(n)===-1)throw new Error("invalid `mention` cfg '".concat(n,"' - see docs"));var i=this.hashtag;if(i!==!1&&tBt.hashtagServices.indexOf(i)===-1)throw new Error("invalid `hashtag` cfg '".concat(i,"' - see docs"));this.truncate=oBt(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(0,QFt.parseHtml)(t,{onOpenTag:function(a){i.indexOf(a)>=0&&r++},onText:function(a,s){if(r===0){var c=/(&nbsp;|&#160;|&lt;|&#60;|&gt;|&#62;|&quot;|&#34;|&#39;)/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,mie.__spreadArray([],mie.__read(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(aBt);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||(0,qs.removeWithPredicate)(t,function(n){return n.getType()==="hashtag"}),this.email||(0,qs.removeWithPredicate)(t,function(n){return n.getType()==="email"}),this.phone||(0,qs.removeWithPredicate)(t,function(n){return n.getType()==="phone"}),this.mention||(0,qs.removeWithPredicate)(t,function(n){return n.getType()==="mention"}),this.urls.schemeMatches||(0,qs.removeWithPredicate)(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="scheme"}),this.urls.tldMatches||(0,qs.removeWithPredicate)(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="tld"}),this.urls.ipV4Matches||(0,qs.removeWithPredicate)(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="ipV4"}),t},e.prototype.parseText=function(t,n){n=n||0;for(var i=(0,ZFt.parseMatches)(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,"&lt;").replace(/>/g,"&gt;"));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 JFt.HtmlTag)return n.toAnchorString();var i=t.buildTag();return i.toAnchorString()},e.prototype.getTagBuilder=function(){var t=this.tagBuilder;return t||(t=this.tagBuilder=new $Ft.AnchorTagBuilder({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),t},e.version=KFt.version,e})();pie.default=nBt;function iBt(e){return e==null&&(e=!0),(0,qs.isBoolean)(e)?{schemeMatches:e,tldMatches:e,ipV4Matches:e}:{schemeMatches:(0,qs.isBoolean)(e.schemeMatches)?e.schemeMatches:!0,tldMatches:(0,qs.isBoolean)(e.tldMatches)?e.tldMatches:!0,ipV4Matches:(0,qs.isBoolean)(e.ipV4Matches)?e.ipV4Matches:!0}}function rBt(e){return e==null&&(e=!0),(0,qs.isBoolean)(e)?{scheme:e,www:e}:{scheme:(0,qs.isBoolean)(e.scheme)?e.scheme:!0,www:(0,qs.isBoolean)(e.www)?e.www:!0}}function oBt(e){return typeof e=="number"?{length:e,location:"end"}:mie.__assign({length:Number.POSITIVE_INFINITY,location:"end"},e)}function aBt(e,t){return e.getOffset()-t.getOffset()}});var Z1e=Hi(J1e=>{"use strict";Object.defineProperty(J1e,"__esModule",{value:!0})});var Q1e=Hi(B_=>{"use strict";Object.defineProperty(B_,"__esModule",{value:!0});var jC=(Wm(),Th(Gm));jC.__exportStar(Z1e(),B_);jC.__exportStar(eie(),B_);jC.__exportStar(nie(),B_);jC.__exportStar(kC(),B_);jC.__exportStar(rie(),B_);jC.__exportStar(oie(),B_);jC.__exportStar(Qne(),B_)});var eRe=Hi(gie=>{"use strict";Object.defineProperty(gie,"__esModule",{value:!0});var sBt=(Wm(),Th(Gm));sBt.__exportStar(uie(),gie)});var _ie=Hi((qm,nRe)=>{"use strict";qm=nRe.exports=V5().default;Object.defineProperty(qm,"__esModule",{value:!0});qm.Autolinker=void 0;var _I=(Wm(),Th(Gm)),tRe=_I.__importDefault(V5());qm.Autolinker=tRe.default;qm.default=tRe.default;_I.__exportStar(V5(),qm);_I.__exportStar(Zne(),qm);_I.__exportStar(w5(),qm);_I.__exportStar(Q1e(),qm);_I.__exportStar(eRe(),qm)});var ELe=Hi((zur,e7)=>{/* 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 P,R;P=new d(f.width*f.height),m&&p&&(R=new Uint8Array(f.width*f.height));for(var O=new Float32Array(x*T),N,_,v=0;v<=b;v++){var S=v!==b?T:f.height%b;if(S!==0)for(var I=0;I<=A;I++){var M=I!==A?x:f.width%A;if(M!==0){var F=v*f.width*T+I*x,V=f.width-M,k=f.pixels.blocks[y],j,B,G;k.encoding<2?(k.encoding===0?j=k.rawData:(u(k.stuffedData,k.bitsPerPixel,k.numValidPixels,k.offset,C,O,f.pixels.maxValue),j=O),B=0):k.encoding===2?G=0:G=k.offset;var W;if(p)for(_=0;_<S;_++){for(F&7&&(W=p[F>>3],W<<=F&7),N=0;N<M;N++)F&7||(W=p[F>>3]),W&128?(R&&(R[F]=1),w=k.encoding<2?j[B++]:G,E=E>w?w:E,P[F++]=w):(R&&(R[F]=0),P[F++]=g),W<<=1;F+=V}else if(k.encoding<2)for(_=0;_<S;_++){for(N=0;N<M;N++)w=j[B++],E=E>w?w:E,P[F++]=w;F+=V}else for(E=E>G?G:E,_=0;_<S;_++){for(N=0;N<M;N++)P[F++]=G;F+=V}if(k.encoding===1&&B!==k.numValidPixels)throw"Block and Mask do not match";y++}}}return{resultPixels:P,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,P=E+(g.width%E>0?1:0),R=w+(g.height%w>0?1:0);g.pixels.blocks=new Array(P*R);for(var O=0,N=0;N<R;N++)for(var _=0;_<P;_++){var v=0,S=f.byteLength-d;y=new DataView(f,d,Math.min(10,S));var I={};g.pixels.blocks[O++]=I;var M=y.getUint8(0);if(v++,I.encoding=M&63,I.encoding>3)throw"Invalid block encoding ("+I.encoding+")";if(I.encoding===2){d++;continue}if(M!==0&&M!==2){if(M>>=6,I.offsetType=M,M===2)I.offset=y.getInt8(1),v++;else if(M===1)I.offset=y.getInt16(1,!0),v+=2;else if(M===0)I.offset=y.getFloat32(1,!0),v+=4;else throw"Invalid block offset type";if(I.encoding===1)if(M=y.getUint8(v),v++,I.bitsPerPixel=M&63,M>>=6,I.numValidPixelsType=M,M===2)I.numValidPixels=y.getUint8(v),v++;else if(M===1)I.numValidPixels=y.getUint16(v,!0),v+=2;else if(M===0)I.numValidPixels=y.getUint32(v,!0),v+=4;else throw"Invalid valid pixel count type"}if(d+=v,I.encoding!==3){var F,V;if(I.encoding===0){var k=(g.pixels.numBytes-1)/4;if(k!==Math.floor(k))throw"uncompressed block has invalid length";F=new ArrayBuffer(k*4),V=new Uint8Array(F),V.set(new Uint8Array(f,d,k*4));var j=new Float32Array(F);I.rawData=j,d+=k*4}else if(I.encoding===1){var B=Math.ceil(I.numValidPixels*I.bitsPerPixel/8),G=Math.ceil(B/4);F=new ArrayBuffer(G*4),V=new Uint8Array(F),V.set(new Uint8Array(f,d,B)),I.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,P=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 O=d-C;E=(w&b)<<O&b,w=f[x++],C=32-O,E+=w>>>C}y[T]=E<P?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,P,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(P=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<P?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 P=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<P?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,P;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):(P=f-T,E=w>>>C&A,w=c[b++],T=32-P,E|=(w&(1<<P)-1)<<f-P,C=P),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):(P=f-T,E=w>>>C&A,w=c[b++],T=32-P,E|=(w&(1<<P)-1)<<f-P,C=P),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=[],P=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<P?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,P=0;for(P=0;P<p;P++)P&7?(w=A[P>>3],w<<=P&7):w=A[P>>3],w&128&&(b[P]=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,P=0,R=0;if(g>1)for(P=0;P<g;P++)for(R=P*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,P=Math.ceil(w/4),R=new ArrayBuffer(P*4),O=new Uint8Array(R);O.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 I=0,M=0,F=new a;for(x=0;x<b.length;x++)b[x]!==void 0&&(I=Math.max(I,b[x].first));I>=f?M=f:M=I,I>=30&&console.log("WARning, large NUM LUT BITS IS "+I);var V=[],k,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(k=[E,T],E<=M)for(j=b[T].second<<M-E,B=1<<M-E,C=0;C<B;C++)V[j|C]=k;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=k[1]);return{decodeLut:V,numBitsLUTQick:M,numBitsLUT:I,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,P=A.numBitsLUT,R=u.headerInfo.imageType===0?128:0,O,N,_,v=u.pixels.resultMask,S,I,M,F,V,k,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(k=0,F=0;F<g;F++)for(V=0;V<m;V++,k++){if(N=0,S=G<<E>>>32-w,I=S,32-E<w&&(S|=T[C+1]>>>64-E-w,I=S),b[I])N=b[I][1],E+=b[I][0];else for(S=G<<E>>>32-P,I=S,32-E<P&&(S|=T[C+1]>>>64-E-P,I=S),O=x,j=0;j<P;j++)if(M=S>>>P-j-1&1,O=M?O.right:O.left,!(O.left||O.right)){N=O.val,E=E+j+1;break}E>=32&&(E-=32,C++,G=T[C]),_=N-R,W?(V>0?_+=B:F>0?_+=q[k-m]:_+=B,_&=255,q[k]=_,B=_):q[k]=_}else for(k=0,F=0;F<g;F++)for(V=0;V<m;V++,k++)if(v[k]){if(N=0,S=G<<E>>>32-w,I=S,32-E<w&&(S|=T[C+1]>>>64-E-w,I=S),b[I])N=b[I][1],E+=b[I][0];else for(S=G<<E>>>32-P,I=S,32-E<P&&(S|=T[C+1]>>>64-E-P,I=S),O=x,j=0;j<P;j++)if(M=S>>>P-j-1&1,O=M?O.right:O.left,!(O.left||O.right)){N=O.val,E=E+j+1;break}E>=32&&(E-=32,C++,G=T[C]),_=N-R,W?(V>0&&v[k-1]?_+=B:F>0&&v[k-m]?_+=q[k-m]:_+=B,_&=255,q[k]=_,B=_):q[k]=_}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 P=2*g.maxZError,R,O,N,_,v,S,I,M,F,V,k=g.numDims>1?g.maxValues[p]:g.zMax;if(C){for(u.counter.lut++,M=A.getUint8(y),F=E,y++,_=Math.ceil((M-1)*E/8),v=Math.ceil(_/4),O=new ArrayBuffer(v*4),N=new Uint8Array(O),u.ptr+=y,N.set(new Uint8Array(c,u.ptr,_)),I=new Uint32Array(O),u.ptr+=_,V=0;M-1>>>V;)V++;_=Math.ceil(w*V/8),v=Math.ceil(_/4),O=new ArrayBuffer(v*4),N=new Uint8Array(O),N.set(new Uint8Array(c,u.ptr,_)),R=new Uint32Array(O),u.ptr+=_,m>=3?S=r.unstuffLUT2(I,E,M-1,d,P,k):S=r.unstuffLUT(I,E,M-1,d,P,k),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),O=new ArrayBuffer(v*4),N=new Uint8Array(O),N.set(new Uint8Array(c,u.ptr,_)),R=new Uint32Array(O),u.ptr+=_,m>=3?d==null?r.originalUnstuff2(R,f,V,w):r.unstuff2(R,f,V,w,!1,d,P,k):d==null?r.originalUnstuff(R,f,V,w):r.unstuff(R,f,V,w,!1,d,P,k))}},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,P=0,R=0,O=0,N=0,_=0,v=0,S=0,I=0,M=0,F=0,V=0,k=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(P=E!==x-1?m:Z,w=0;w<b;w++)for(R=w!==b-1?m:ce,S=E*p*m+w*m,I=p-R,ye=0;ye<Ce;ye++){if(Ce>1&&(Ie=new f(u.pixels.resultPixels.buffer,p*g*ye*A,p*g)),O=c.byteLength-u.ptr,j=new DataView(c,u.ptr,Math.min(10,O)),B={},k=0,N=j.getUint8(0),k++,_=N>>6&255,v=N>>2&15,v!==(w*m>>3&15))throw"integrity issue";if(q=N&3,q>3)throw u.ptr+=k,"Invalid block encoding ("+q+")";if(q===2){u.counter.constant++,u.ptr+=k;continue}else if(q===0){if(u.counter.uncompressed++,u.ptr+=k,M=P*R*A,F=c.byteLength-u.ptr,M=M<F?M:F,G=new ArrayBuffer(M%A===0?M:M+A-M%A),W=new Uint8Array(G),W.set(new Uint8Array(c,u.ptr,M)),Q=new f(G),V=0,ve)for(T=0;T<P;T++){for(C=0;C<R;C++)ve[S]&&(Ie[S]=Q[V++]),S++;S+=I}else for(T=0;T<P;T++){for(C=0;C<R;C++)Ie[S++]=Q[V++];S+=I}u.ptr+=V*A}else if(Ae=o.getDataTypeUsed(y,_),le=o.getOnePixel(B,k,Ae,j),k+=o.getDataTypeSize(Ae),q===3)if(u.ptr+=k,u.counter.constantoffset++,ve)for(T=0;T<P;T++){for(C=0;C<R;C++)ve[S]&&(Ie[S]=le),S++;S+=I}else for(T=0;T<P;T++){for(C=0;C<R;C++)Ie[S++]=le;S+=I}else if(u.ptr+=k,o.decodeBits(c,u,J,le,ye),k=0,ve)for(T=0;T<P;T++){for(C=0;C<R;C++)ve[S]&&(Ie[S]=J[k++]),S++;S+=I}else for(T=0;T<P;T++){for(C=0;C<R;C++)Ie[S++]=J[k++];S+=I}}},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 e7<"u"&&e7.exports?e7.exports=i:this.Lerc=i})()});var vNe=Hi((n8,Gae)=>{/*! NoSleep.min.js v0.12.0 - git.io/vfn01 - Rich Tibbett - MIT license */(function(e,t){typeof n8=="object"&&typeof Gae=="object"?Gae.exports=t():typeof define=="function"&&define.amd?define([],t):typeof n8=="object"?n8.NoSleep=t():e.NoSleep=t()})(n8,(function(){return(function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(i,r,o){n.o(i,r)||Object.defineProperty(i,r,{enumerable:!0,get:o})},n.r=function(i){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},n.t=function(i,r){if(1&r&&(i=n(i)),8&r||4&r&&typeof i=="object"&&i&&i.__esModule)return i;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:i}),2&r&&typeof i!="string")for(var a in i)n.d(o,a,function(s){return i[s]}.bind(null,a));return o},n.n=function(i){var r=i&&i.__esModule?function(){return i.default}:function(){return i};return n.d(r,"a",r),r},n.o=function(i,r){return Object.prototype.hasOwnProperty.call(i,r)},n.p="",n(n.s=0)})([function(e,t,n){"use strict";var i=(function(){function f(d,p){for(var g=0;g<p.length;g++){var m=p[g];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(d,m.key,m)}}return function(d,p,g){return p&&f(d.prototype,p),g&&f(d,g),d}})(),r=n(1),o=r.webm,a=r.mp4,s=function(){return 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},c=function(){return"wakeLock"in navigator},u=(function(){function f(){var d=this;if((function(g,m){if(!(g instanceof m))throw new TypeError("Cannot call a class as a function")})(this,f),this.enabled=!1,c()){this._wakeLock=null;var p=function(){d._wakeLock!==null&&document.visibilityState==="visible"&&d.enable()};document.addEventListener("visibilitychange",p),document.addEventListener("fullscreenchange",p)}else s()?this.noSleepTimer=null:(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("title","No Sleep"),this.noSleepVideo.setAttribute("playsinline",""),this._addSourceToVideo(this.noSleepVideo,"webm",o),this._addSourceToVideo(this.noSleepVideo,"mp4",a),this.noSleepVideo.addEventListener("loadedmetadata",(function(){d.noSleepVideo.duration<=1?d.noSleepVideo.setAttribute("loop",""):d.noSleepVideo.addEventListener("timeupdate",(function(){d.noSleepVideo.currentTime>.5&&(d.noSleepVideo.currentTime=Math.random())}))})))}return i(f,[{key:"_addSourceToVideo",value:function(d,p,g){var m=document.createElement("source");m.src=g,m.type="video/"+p,d.appendChild(m)}},{key:"enable",value:function(){var d=this;return c()?navigator.wakeLock.request("screen").then((function(p){d._wakeLock=p,d.enabled=!0,console.log("Wake Lock active."),d._wakeLock.addEventListener("release",(function(){console.log("Wake Lock released.")}))})).catch((function(p){throw d.enabled=!1,console.error(p.name+", "+p.message),p})):s()?(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((function(){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((function(p){return d.enabled=!0,p})).catch((function(p){throw d.enabled=!1,p}))}},{key:"disable",value:function(){c()?(this._wakeLock&&this._wakeLock.release(),this._wakeLock=null):s()?this.noSleepTimer&&(console.warn(`
NoSleep now disabled for older iOS devices.
`),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause(),this.enabled=!1}},{key:"isEnabled",get:function(){return this.enabled}}]),f})();e.exports=u},function(e,t,n){"use strict";e.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 t8t={};ese(t8t,{AlphaMode:()=>xp,AlphaPipelineStage:()=>qF,AnchorPointDirect:()=>JN,AnchorPointIndirect:()=>ZN,Animation:()=>b4,AnimationViewModel:()=>x4,Appearance:()=>Cr,ApproximateTerrainHeights:()=>wi,ArcGISTiledElevationTerrainProvider:()=>Tq,ArcGisBaseMapType:()=>Tm,ArcGisMapServerImageryProvider:()=>Jg,ArcGisMapService:()=>Of,ArcType:()=>sn,ArticulationStageType:()=>Wc,AssociativeArray:()=>kt,Atmosphere:()=>dT,AtmospherePipelineStage:()=>SF,AttributeCompression:()=>an,AttributeType:()=>Vt,AutoExposure:()=>uz,AutomaticUniforms:()=>Ag,Axis:()=>ki,AxisAlignedBoundingBox:()=>lf,Azure2DImageryProvider:()=>IB,B3dmLoader:()=>mF,B3dmParser:()=>uF,BaseLayerPicker:()=>C4,BaseLayerPickerViewModel:()=>T4,BatchTable:()=>jx,BatchTableHierarchy:()=>AT,BatchTexture:()=>nu,BatchTexturePipelineStage:()=>YF,Billboard:()=>Dr,BillboardCollection:()=>vf,BillboardGraphics:()=>cl,BillboardLoadState:()=>La,BillboardTexture:()=>Pg,BillboardVisualizer:()=>kL,BingMapsGeocoderService:()=>Eq,BingMapsImageryProvider:()=>yB,BingMapsStyle:()=>WS,BlendEquation:()=>Mc,BlendFunction:()=>Wr,BlendOption:()=>Li,BlendingState:()=>Qt,BoundingRectangle:()=>Je,BoundingSphere:()=>se,BoundingSphereState:()=>It,BoundingVolumeSemantics:()=>vA,BoxEmitter:()=>aoe,BoxGeometry:()=>wc,BoxGeometryUpdater:()=>vN,BoxGraphics:()=>Xx,BoxOutlineGeometry:()=>Rh,BrdfLutGenerator:()=>l3,Buffer:()=>Ze,BufferLoader:()=>Mb,BufferPoint:()=>Bc,BufferPointCollection:()=>Gu,BufferPointMaterial:()=>Rm,BufferPolygon:()=>Ko,BufferPolygonCollection:()=>il,BufferPolygonMaterial:()=>bf,BufferPolyline:()=>ms,BufferPolylineCollection:()=>ol,BufferPolylineMaterial:()=>xf,BufferPrimitive:()=>Xo,BufferPrimitiveCollection:()=>$a,BufferPrimitiveMaterial:()=>zl,BufferUsage:()=>Oe,CPUStylingPipelineStage:()=>JF,CallbackPositionProperty:()=>Pk,CallbackProperty:()=>am,Camera:()=>vr,CameraEventAggregator:()=>gz,CameraEventType:()=>nr,CameraFlightPath:()=>f3,Cartesian2:()=>z,Cartesian3:()=>h,Cartesian4:()=>ae,CartesianRectangle:()=>nw,Cartographic:()=>de,CartographicGeocoderService:()=>Pq,CatmullRomSpline:()=>Dq,Cesium3DContentGroup:()=>DT,Cesium3DTile:()=>rh,Cesium3DTileBatchTable:()=>ym,Cesium3DTileColorBlendMode:()=>ku,Cesium3DTileContent:()=>coe,Cesium3DTileContentFactory:()=>VT,Cesium3DTileContentState:()=>to,Cesium3DTileContentType:()=>xs,Cesium3DTileFeature:()=>Qa,Cesium3DTileFeatureTable:()=>_m,Cesium3DTileOptimizationHint:()=>nh,Cesium3DTileOptimizations:()=>pk,Cesium3DTilePass:()=>no,Cesium3DTilePassState:()=>lh,Cesium3DTilePointFeature:()=>r_,Cesium3DTileRefine:()=>po,Cesium3DTileStyle:()=>c_,Cesium3DTileStyleEngine:()=>Ak,Cesium3DTileVectorFeature:()=>kT,Cesium3DTilesInspector:()=>O4,Cesium3DTilesInspectorViewModel:()=>R4,Cesium3DTilesTerrainData:()=>zP,Cesium3DTilesTerrainGeometryProcessor:()=>zv,Cesium3DTilesTerrainProvider:()=>qY,Cesium3DTilesVoxelProvider:()=>loe,Cesium3DTileset:()=>Uo,Cesium3DTilesetBaseTraversal:()=>vk,Cesium3DTilesetCache:()=>gk,Cesium3DTilesetGraphics:()=>tT,Cesium3DTilesetHeatmap:()=>_k,Cesium3DTilesetMetadata:()=>XT,Cesium3DTilesetMostDetailedTraversal:()=>xk,Cesium3DTilesetSkipTraversal:()=>wk,Cesium3DTilesetStatistics:()=>Mm,Cesium3DTilesetTraversal:()=>js,Cesium3DTilesetVisualizer:()=>Ik,CesiumInspector:()=>I4,CesiumInspectorViewModel:()=>w4,CesiumTerrainProvider:()=>Gb,CesiumWidget:()=>EU,Check:()=>Ur,CheckerboardMaterialProperty:()=>$w,CircleEmitter:()=>zV,CircleGeometry:()=>pX,CircleOutlineGeometry:()=>gX,ClassificationModelDrawCommand:()=>m2,ClassificationPipelineStage:()=>XF,ClassificationPrimitive:()=>nS,ClassificationType:()=>Zn,ClearCommand:()=>ui,ClippingPlane:()=>Za,ClippingPlaneCollection:()=>Aa,ClippingPolygon:()=>DS,ClippingPolygonCollection:()=>hm,Clock:()=>Vh,ClockRange:()=>la,ClockStep:()=>Lr,ClockViewModel:()=>_4,CloudCollection:()=>moe,CloudType:()=>HI,Color:()=>U,ColorBlendMode:()=>fl,ColorGeometryInstanceAttribute:()=>Kt,ColorMaterialProperty:()=>Yt,Command:()=>Dae,ComponentDatatype:()=>Y,Composite3DTileContent:()=>I2,CompositeEntityCollection:()=>One,CompositeMaterialProperty:()=>Zw,CompositePositionProperty:()=>hc,CompositeProperty:()=>pl,CompressedTextureBuffer:()=>YP,ComputeCommand:()=>Vl,ComputeEngine:()=>jM,ConditionsExpression:()=>Z2,ConeEmitter:()=>goe,ConstantPositionProperty:()=>Kl,ConstantProperty:()=>hi,ConstantSpline:()=>CD,ContentMetadata:()=>ck,Context:()=>Nx,ContextLimits:()=>Lt,Controller:()=>pae,ControllerHost:()=>m3,CoplanarPolygonGeometry:()=>RD,CoplanarPolygonGeometryLibrary:()=>eg,CoplanarPolygonOutlineGeometry:()=>Sd,CornerType:()=>Zi,CorrelationGroup:()=>QN,CorridorGeometry:()=>ix,CorridorGeometryLibrary:()=>ar,CorridorGeometryUpdater:()=>EN,CorridorGraphics:()=>$x,CorridorOutlineGeometry:()=>kD,Credit:()=>St,CreditDisplay:()=>g3,CubeMap:()=>Jo,CubeMapFace:()=>GM,CubeMapPanorama:()=>DC,CubicRealPolynomial:()=>Db,CullFace:()=>zi,CullingVolume:()=>qa,CumulusCloud:()=>od,CustomDataSource:()=>_N,CustomHeightmapTerrainProvider:()=>FX,CustomShader:()=>h0,CustomShaderMode:()=>$g,CustomShaderPipelineStage:()=>rB,CustomShaderTranslucencyMode:()=>pA,CylinderGeometry:()=>UD,CylinderGeometryLibrary:()=>rx,CylinderGeometryUpdater:()=>SN,CylinderGraphics:()=>Jx,CylinderOutlineGeometry:()=>VD,CzmlDataSource:()=>OU,DataSource:()=>ya,DataSourceClock:()=>jm,DataSourceCollection:()=>iL,DataSourceDisplay:()=>Uk,DebugAppearance:()=>_oe,DebugCameraPrimitive:()=>a0,DebugInspector:()=>wz,DebugModelMatrixPrimitive:()=>VV,DefaultProxy:()=>UX,DepthFunction:()=>lc,DepthPlane:()=>x3,DequantizationPipelineStage:()=>aB,DerivedCommand:()=>Bm,DeveloperError:()=>pe,DeviceOrientationCameraController:()=>T3,DirectionalLight:()=>yoe,DiscardEmptyTileImagePolicy:()=>qS,DiscardMissingTileImagePolicy:()=>gB,DistanceDisplayCondition:()=>jt,DistanceDisplayConditionGeometryInstanceAttribute:()=>Jn,DoubleEndedPriorityQueue:()=>V0,DoublyLinkedList:()=>GD,DracoLoader:()=>G0,DrawCommand:()=>nt,DynamicAtmosphereLightingType:()=>zg,DynamicEnvironmentMapManager:()=>Ug,DynamicGeometryBatch:()=>oT,DynamicGeometryUpdater:()=>Ci,EarthOrientationParameters:()=>yP,EarthOrientationParametersSample:()=>ty,EasingFunction:()=>fa,EdgeDetectionPipelineStage:()=>cB,EdgeDisplayMode:()=>qd,EdgeFramebuffer:()=>P3,EdgeVisibilityPipelineStage:()=>fB,EllipseGeometry:()=>Ml,EllipseGeometryLibrary:()=>wu,EllipseGeometryUpdater:()=>wN,EllipseGraphics:()=>Zx,EllipseOutlineGeometry:()=>df,Ellipsoid:()=>te,EllipsoidGeodesic:()=>ig,EllipsoidGeometry:()=>Rs,EllipsoidGeometryUpdater:()=>PN,EllipsoidGraphics:()=>Qx,EllipsoidOutlineGeometry:()=>pf,EllipsoidPrimitive:()=>r3,EllipsoidRhumbLine:()=>Dc,EllipsoidSurfaceAppearance:()=>Aoe,EllipsoidTangentPlane:()=>Pa,EllipsoidTerrainProvider:()=>Dp,EllipsoidalOccluder:()=>Ih,Empty3DTileContent:()=>Qp,EncodedCartesian3:()=>vn,Entity:()=>qr,EntityCluster:()=>Sf,EntityCollection:()=>Fs,EntityView:()=>jk,EquirectangularPanorama:()=>boe,Event:()=>be,EventHelper:()=>Lo,Expression:()=>Jd,ExpressionNodeType:()=>Rt,ExtrapolationType:()=>gf,FeatureDetection:()=>fn,FeatureIdPipelineStage:()=>mA,Fog:()=>C3,ForEach:()=>ze,FrameRateMonitor:()=>WV,FrameState:()=>v3,Framebuffer:()=>_a,FramebufferManager:()=>oi,Frozen:()=>H,FrustumCommands:()=>R3,FrustumGeometry:()=>sx,FrustumOutlineGeometry:()=>XD,Fullscreen:()=>qo,FullscreenButton:()=>L4,FullscreenButtonViewModel:()=>M4,GaussianSplat3DTileContent:()=>PA,GaussianSplatPrimitive:()=>sk,GaussianSplatRenderResources:()=>nk,GaussianSplatSorter:()=>zT,GaussianSplatTextureGenerator:()=>tk,GeoJsonDataSource:()=>tb,GeoJsonLoader:()=>pF,GeoJsonPrimitive:()=>voe,GeocodeType:()=>By,Geocoder:()=>F4,GeocoderService:()=>SE,GeocoderViewModel:()=>N4,GeographicProjection:()=>Bi,GeographicTilingScheme:()=>Xi,Geometry:()=>xt,Geometry3DTileContent:()=>D2,GeometryAttribute:()=>Me,GeometryAttributes:()=>bn,GeometryFactory:()=>XX,GeometryInstance:()=>Nt,GeometryInstanceAttribute:()=>Kc,GeometryOffsetAttribute:()=>hn,GeometryPipeline:()=>Hn,GeometryPipelineStage:()=>pB,GeometryType:()=>_d,GeometryUpdater:()=>vi,GeometryUpdaterSet:()=>uT,GeometryVisualizer:()=>FN,GetFeatureInfoFormat:()=>Cm,Globe:()=>i3,GlobeDepth:()=>O3,GlobeSurfaceShaderSet:()=>qk,GlobeSurfaceTile:()=>sh,GlobeSurfaceTileProvider:()=>Xk,GlobeTranslucency:()=>Kk,GlobeTranslucencyFramebuffer:()=>M3,GlobeTranslucencyState:()=>E3,GltfBufferViewLoader:()=>jv,GltfDracoLoader:()=>Hv,GltfGpmLoader:()=>tF,GltfGpmLocal:()=>MS,GltfImageLoader:()=>Wv,GltfIndexBufferLoader:()=>qv,GltfJsonLoader:()=>Xv,GltfLoader:()=>Rf,GltfLoaderUtil:()=>Su,GltfMeshPrimitiveGpmLoader:()=>oF,GltfSpzLoader:()=>fD,GltfStructuralMetadataLoader:()=>KN,GltfTextureLoader:()=>Zv,GltfVertexBufferLoader:()=>Qv,Google2DImageryProvider:()=>wB,GoogleEarthEnterpriseImageryProvider:()=>Soe,GoogleEarthEnterpriseMapsProvider:()=>xB,GoogleEarthEnterpriseMetadata:()=>ug,GoogleEarthEnterpriseTerrainData:()=>wE,GoogleEarthEnterpriseTerrainProvider:()=>tK,GoogleEarthEnterpriseTileInformation:()=>$D,GoogleGeocoderService:()=>iK,GoogleMaps:()=>ds,GoogleStreetViewCubeMapPanoramaProvider:()=>woe,GpxDataSource:()=>BU,GregorianDate:()=>M0,GridImageryProvider:()=>Ioe,GridMaterialProperty:()=>eI,GroundGeometryUpdater:()=>ti,GroundPolylineGeometry:()=>lx,GroundPolylinePrimitive:()=>Jh,GroundPrimitive:()=>Yl,GroupMetadata:()=>yw,HeadingPitchRange:()=>Rd,HeadingPitchRoll:()=>Tc,Heap:()=>mP,HeightReference:()=>it,HeightmapEncoding:()=>pd,HeightmapTerrainData:()=>Sc,HeightmapTessellator:()=>Dv,HermitePolynomialApproximation:()=>ZD,HermiteSpline:()=>hy,HilbertOrder:()=>PE,HomeButton:()=>k4,HomeButtonViewModel:()=>B4,HorizontalOrigin:()=>Vi,HybridScreenSpacePanCameraController:()=>bae,I3SBuildingSceneLayerExplorer:()=>zae,I3SBuildingSceneLayerExplorerViewModel:()=>z4,I3SDataProvider:()=>np,I3SDecoder:()=>qV,I3SFeature:()=>YV,I3SField:()=>XV,I3SGeometry:()=>GI,I3SLayer:()=>ov,I3SNode:()=>WI,I3SStatistics:()=>JV,I3SSublayer:()=>QV,I3SSymbology:()=>$V,I3dmLoader:()=>_F,I3dmParser:()=>gF,ITwinData:()=>Ooe,ITwinPlatform:()=>Xa,Iau2000Orientation:()=>e1,Iau2006XysData:()=>AP,Iau2006XysSample:()=>Ib,IauOrientationAxes:()=>t1,IauOrientationParameters:()=>QD,ImageBasedLighting:()=>yT,ImageBasedLightingPipelineStage:()=>IF,ImageMaterialProperty:()=>cA,Imagery:()=>ew,ImageryConfiguration:()=>C2,ImageryCoverage:()=>iw,ImageryFlags:()=>RB,ImageryInput:()=>MB,ImageryLayer:()=>Ta,ImageryLayerCollection:()=>$T,ImageryLayerFeatureInfo:()=>xm,ImageryPipelineStage:()=>LB,ImageryProvider:()=>Mf,ImageryState:()=>jn,Implicit3DTileContent:()=>cw,ImplicitAvailabilityBitstream:()=>Uv,ImplicitMetadataView:()=>Vv,ImplicitSubdivisionScheme:()=>Ra,ImplicitSubtree:()=>$0,ImplicitSubtreeCache:()=>BV,ImplicitSubtreeMetadata:()=>HP,ImplicitTileCoordinates:()=>Tp,ImplicitTileset:()=>Cp,IndexDatatype:()=>Ve,InfoBox:()=>V4,InfoBoxViewModel:()=>U4,InspectorShared:()=>of,InstanceAttributeSemantic:()=>Io,InstancingPipelineStage:()=>jF,InterpolationAlgorithm:()=>yK,InterpolationType:()=>Wh,Intersect:()=>Xt,IntersectionTests:()=>ci,Intersections2D:()=>Oh,Interval:()=>Wo,InvertClassification:()=>Nw,Ion:()=>Bh,IonGeocodeProviderType:()=>dg,IonGeocoderService:()=>ux,IonImageryProvider:()=>iu,IonImageryProviderFactory:()=>ZS,IonResource:()=>ca,IonWorldImageryStyle:()=>Qg,Iso8601:()=>Qe,JobScheduler:()=>S3,JobType:()=>Ic,JsonMetadataTable:()=>Vg,JulianDate:()=>K,KTX2Transcoder:()=>XP,KeyboardEventModifier:()=>Gr,KeyframeNode:()=>Fr,KmlCamera:()=>kU,KmlDataSource:()=>JC,KmlLookAt:()=>vV,KmlTour:()=>EV,KmlTourFlyTo:()=>SV,KmlTourWait:()=>wV,Label:()=>oA,LabelCollection:()=>Hp,LabelGraphics:()=>im,LabelStyle:()=>ho,LabelVisualizer:()=>BN,LagrangePolynomialApproximation:()=>i1,LeapSecond:()=>ur,Light:()=>Moe,LightingModel:()=>Kp,LightingPipelineStage:()=>FB,LinearApproximation:()=>fx,LinearSpline:()=>dy,MVTDataProvider:()=>Uoe,ManagedArray:()=>kl,MapMode2D:()=>au,MapProjection:()=>vK,MapboxImageryProvider:()=>TB,MapboxStyleImageryProvider:()=>Voe,MappedPositions:()=>OB,Material:()=>tr,MaterialAppearance:()=>yr,MaterialPipelineStage:()=>UB,MaterialProperty:()=>mo,Math:()=>D,Matrix2:()=>Ki,Matrix3:()=>$,Matrix4:()=>L,Megatexture:()=>Zz,MeshPrimitiveGpmLocal:()=>rF,MetadataClass:()=>Fh,MetadataClassProperty:()=>yp,MetadataComponentType:()=>Mt,MetadataEntity:()=>qn,MetadataEnum:()=>mD,MetadataEnumValue:()=>hD,MetadataPicking:()=>w3,MetadataPickingPipelineStage:()=>Ff,MetadataPipelineStage:()=>Xd,MetadataSchema:()=>Pl,MetadataSchemaLoader:()=>Ty,MetadataSemantic:()=>Cd,MetadataTable:()=>yd,MetadataTableProperty:()=>qP,MetadataType:()=>gt,MipmapHint:()=>bd,Model:()=>Bf,Model3DTileContent:()=>zf,ModelAlphaOptions:()=>wT,ModelAnimation:()=>AF,ModelAnimationChannel:()=>yF,ModelAnimationCollection:()=>bF,ModelAnimationLoop:()=>zu,ModelAnimationState:()=>Am,ModelArticulation:()=>DF,ModelArticulationStage:()=>PF,ModelClippingPlanesPipelineStage:()=>MF,ModelClippingPolygonsPipelineStage:()=>FF,ModelColorPipelineStage:()=>hA,ModelComponents:()=>xn,ModelDrawCommand:()=>p2,ModelDrawCommands:()=>y2,ModelFeature:()=>xF,ModelFeatureTable:()=>TF,ModelGraphics:()=>Mg,ModelImagery:()=>v2,ModelImageryMapping:()=>vT,ModelLightingOptions:()=>f2,ModelMatrixUpdateStage:()=>HF,ModelNode:()=>BF,ModelPrimitiveImagery:()=>ET,ModelReader:()=>ys,ModelRenderResources:()=>r2,ModelRuntimeNode:()=>WF,ModelRuntimePrimitive:()=>n2,ModelSceneGraph:()=>A2,ModelSilhouettePipelineStage:()=>s2,ModelSkin:()=>i2,ModelSplitterPipelineStage:()=>l2,ModelStatistics:()=>b2,ModelType:()=>zo,ModelUtility:()=>_t,ModelVisualizer:()=>S2,Moon:()=>a3,MorphTargetsPipelineStage:()=>jB,MorphWeightSpline:()=>EK,MortonOrder:()=>Cy,MouseButton:()=>Ys,Multiple3DTileContent:()=>fk,MultisampleFramebuffer:()=>KM,NavigationHelpButton:()=>H4,NavigationHelpButtonViewModel:()=>j4,NearFarScalar:()=>Wt,NeverTileDiscardPolicy:()=>Hoe,NodeRenderResources:()=>u2,NodeStatisticsPipelineStage:()=>GF,NodeTransformationProperty:()=>eT,OIT:()=>N3,Occluder:()=>r1,OffsetGeometryInstanceAttribute:()=>_r,OpenCageGeocoderService:()=>IK,OpenStreetMapImageryProvider:()=>X_,OrderedGroundPrimitiveCollection:()=>BL,OrientedBoundingBox:()=>Jt,OrthographicFrustum:()=>mn,OrthographicOffCenterFrustum:()=>da,Packable:()=>PK,PackableForInterpolation:()=>DK,Panorama:()=>Goe,PanoramaProvider:()=>Woe,Particle:()=>$I,ParticleBurst:()=>Yoe,ParticleEmitter:()=>Xoe,ParticleSystem:()=>Koe,Pass:()=>Pe,PassState:()=>sc,PathGraphics:()=>Lg,PathMode:()=>t0,PathVisualizer:()=>Mk,PeliasGeocoderService:()=>n1,PerInstanceColorAppearance:()=>gn,PerformanceDisplay:()=>T_,PerformanceWatchdog:()=>W4,PerformanceWatchdogViewModel:()=>G4,PerspectiveFrustum:()=>Gi,PerspectiveOffCenterFrustum:()=>Fl,PickDepth:()=>I3,PickDepthFramebuffer:()=>B3,PickFramebuffer:()=>k3,PickId:()=>WM,PickedMetadataInfo:()=>rU,Picking:()=>G3,PickingPipelineStage:()=>HB,PinBuilder:()=>hg,PixelDatatype:()=>ke,PixelFormat:()=>He,PlanarFillIdFramebuffer:()=>D3,Plane:()=>en,PlaneGeometry:()=>c1,PlaneGeometryUpdater:()=>DN,PlaneGraphics:()=>lN,PlaneOutlineGeometry:()=>l1,PntsLoader:()=>T2,PntsParser:()=>PT,PointCloud:()=>CU,PointCloudEyeDomeLighting:()=>Hg,PointCloudShading:()=>qp,PointCloudStylingPipelineStage:()=>WB,PointGraphics:()=>nT,PointPrimitive:()=>_s,PointPrimitiveCollection:()=>rS,PointVisualizer:()=>Nk,PolygonGeometry:()=>mg,PolygonGeometryLibrary:()=>$n,PolygonGeometryUpdater:()=>RN,PolygonGraphics:()=>rm,PolygonHierarchy:()=>Rc,PolygonOutlineGeometry:()=>u1,PolygonPipeline:()=>li,Polyline:()=>Zd,PolylineArrowMaterialProperty:()=>nI,PolylineCollection:()=>Im,PolylineColorAppearance:()=>Ma,PolylineDashMaterialProperty:()=>rI,PolylineGeometry:()=>pg,PolylineGeometryUpdater:()=>Bk,PolylineGlowMaterialProperty:()=>aI,PolylineGraphics:()=>ll,PolylineMaterialAppearance:()=>cc,PolylineOutlineMaterialProperty:()=>JA,PolylinePipeline:()=>Qi,PolylineVisualizer:()=>zk,PolylineVolumeGeometry:()=>m1,PolylineVolumeGeometryLibrary:()=>jh,PolylineVolumeGeometryUpdater:()=>ON,PolylineVolumeGraphics:()=>iT,PolylineVolumeOutlineGeometry:()=>_1,PositionProperty:()=>nm,PositionPropertyArray:()=>M_,PostProcessStage:()=>Mr,PostProcessStageCollection:()=>hz,PostProcessStageComposite:()=>Xu,PostProcessStageLibrary:()=>qf,PostProcessStageSampleMode:()=>Wf,PostProcessStageTextureCache:()=>_C,PpeMetadata:()=>iF,PpeSource:()=>Sae,PpeTexture:()=>nF,Primitive:()=>Nn,PrimitiveCollection:()=>Xl,PrimitiveLoadPlan:()=>gT,PrimitiveOutlineGenerator:()=>pT,PrimitiveOutlinePipelineStage:()=>XB,PrimitivePipeline:()=>Hx,PrimitiveRenderResources:()=>d2,PrimitiveState:()=>Qo,PrimitiveStatisticsPipelineStage:()=>KB,PrimitiveType:()=>Re,ProjectionPicker:()=>Y4,ProjectionPickerViewModel:()=>q4,Property:()=>X,PropertyArray:()=>cI,PropertyAttribute:()=>hT,PropertyAttributeProperty:()=>WN,PropertyBag:()=>Jl,PropertyTable:()=>eu,PropertyTexture:()=>jg,PropertyTextureProperty:()=>GN,ProviderViewModel:()=>ro,Proxy:()=>OK,QuadraticRealPolynomial:()=>Il,QuadtreeOccluders:()=>$k,QuadtreePrimitive:()=>n3,QuadtreeTile:()=>Jk,QuadtreeTileLoadState:()=>Hs,QuadtreeTileProvider:()=>Joe,QuantizedMeshTerrainData:()=>Hb,QuarticRealPolynomial:()=>PP,Quaternion:()=>Fe,QuaternionSpline:()=>y1,Queue:()=>Iy,Ray:()=>dn,Rectangle:()=>ie,RectangleCollisionChecker:()=>_x,RectangleGeometry:()=>yx,RectangleGeometryLibrary:()=>hs,RectangleGeometryUpdater:()=>MN,RectangleGraphics:()=>om,RectangleOutlineGeometry:()=>Ax,ReferenceFrame:()=>Ui,ReferenceProperty:()=>y_,RenderState:()=>je,Renderbuffer:()=>Tf,RenderbufferFormat:()=>Hl,Request:()=>bo,RequestErrorEvent:()=>lp,RequestScheduler:()=>jc,RequestState:()=>yi,RequestType:()=>Ha,Resource:()=>De,ResourceCache:()=>Mi,ResourceCacheKey:()=>Dl,ResourceCacheStatistics:()=>_D,ResourceLoader:()=>Ji,ResourceLoaderState:()=>yt,Rotation:()=>ph,RuntimeError:()=>oe,S2Cell:()=>gg,SDFSettings:()=>Ls,SampledPositionProperty:()=>mc,SampledProperty:()=>Hf,Sampler:()=>zt,ScaledPositionProperty:()=>n0,Scene:()=>aU,SceneFramebuffer:()=>fC,SceneMode:()=>re,SceneMode2DPipelineStage:()=>$B,SceneModePicker:()=>K4,SceneModePickerViewModel:()=>X4,SceneTransforms:()=>sr,SceneTransitioner:()=>pz,ScreenSpaceCameraController:()=>Az,ScreenSpaceElevatorCameraController:()=>f4,ScreenSpaceEventHandler:()=>Ka,ScreenSpaceEventType:()=>cn,ScreenSpaceInputBindings:()=>rp,ScreenSpaceMapCameraController:()=>d4,ScreenSpaceTiltOrbitCameraController:()=>Tae,ScreenSpaceZoomCameraController:()=>vae,SelectedFeatureIdPipelineStage:()=>gA,SelectionIndicator:()=>Z4,SelectionIndicatorViewModel:()=>J4,SensorVolumePortionToDisplay:()=>fI,ShaderBuilder:()=>Cg,ShaderCache:()=>qM,ShaderDestination:()=>he,ShaderFunction:()=>ZM,ShaderProgram:()=>Zt,ShaderSource:()=>Ge,ShaderStruct:()=>JM,ShadowMap:()=>E_,ShadowMapShader:()=>zm,ShadowMode:()=>Rn,ShadowVolumeAppearance:()=>Cf,SharedContext:()=>QM,ShowGeometryInstanceAttribute:()=>Dn,Simon1994PlanetaryPositions:()=>Yy,SimplePolylineGeometry:()=>$K,SingleTileImageryProvider:()=>CB,SkinningPipelineStage:()=>ZB,SkyAtmosphere:()=>lU,SkyBox:()=>mU,SnapFramebuffer:()=>xz,Snapping:()=>Tz,SpatialNode:()=>eU,Spdcf:()=>eF,SpecularEnvironmentCubeMap:()=>gm,SphereEmitter:()=>Qoe,SphereGeometry:()=>w1,SphereOutlineGeometry:()=>_g,Spherical:()=>I1,Spline:()=>xr,SplitDirection:()=>Fo,Splitter:()=>qw,StaticGeometryColorBatch:()=>Gd,StaticGeometryPerMaterialBatch:()=>Wd,StaticGroundGeometryColorBatch:()=>vS,StaticGroundGeometryPerMaterialBatch:()=>NN,StaticGroundPolylinePerMaterialBatch:()=>kk,StaticOutlineGeometryBatch:()=>wS,StencilConstants:()=>qt,StencilFunction:()=>Qn,StencilOperation:()=>Pt,SteppedSpline:()=>P1,Stereographic:()=>Zc,StorageType:()=>uA,StripeMaterialProperty:()=>uI,StripeOrientation:()=>Hm,StructuralMetadata:()=>Bs,StyleCommandsNeeded:()=>bm,StyleExpression:()=>eae,Sun:()=>bU,SunLight:()=>Tg,SunPostProcess:()=>Ez,SupportedImageFormats:()=>$N,SvgPathBindingHandler:()=>p4,Sync:()=>eL,TaskProcessor:()=>Yn,Terrain:()=>s4,TerrainData:()=>xu,TerrainEncoding:()=>uo,TerrainFillMesh:()=>Iw,TerrainMesh:()=>tc,TerrainOffsetProperty:()=>sT,TerrainPicker:()=>LP,TerrainProvider:()=>Vr,TerrainQuantization:()=>Ps,TerrainState:()=>Or,Texture:()=>Ct,Texture3D:()=>tL,TextureAtlas:()=>Bx,TextureCache:()=>YM,TextureMagnificationFilter:()=>ei,TextureManager:()=>Pz,TextureMinificationFilter:()=>Gt,TexturePacker:()=>XE,TextureUniform:()=>Rz,TextureWrap:()=>rn,TileAvailability:()=>Dh,TileBoundingRegion:()=>Vf,TileBoundingS2Cell:()=>hk,TileBoundingSphere:()=>h_,TileBoundingVolume:()=>tae,TileCoordinatesImageryProvider:()=>l4,TileDiscardPolicy:()=>iae,TileEdge:()=>In,TileImagery:()=>tw,TileMapServiceImageryProvider:()=>_A,TileMetadata:()=>lk,TileOrientedBoundingBox:()=>Wu,TileProviderError:()=>Hr,TileReplacementQueue:()=>Zk,TileSelectionResult:()=>fi,TileState:()=>rae,Tileset3DTileContent:()=>O2,TilesetMetadata:()=>mk,TilesetPipelineStage:()=>CF,TilingScheme:()=>QK,TimeConstants:()=>zn,TimeDynamicImagery:()=>CT,TimeDynamicPointCloud:()=>Xw,TimeInterval:()=>Tn,TimeIntervalCollection:()=>ga,TimeIntervalCollectionPositionProperty:()=>A_,TimeIntervalCollectionProperty:()=>L_,TimeStandard:()=>ri,Timeline:()=>t8,TimelineHighlightRange:()=>Q4,TimelineTrack:()=>e8,Tipsify:()=>AD,ToggleButtonViewModel:()=>hb,Tonemapper:()=>w_,TrackingReferenceFrame:()=>yg,Transforms:()=>mt,TranslationRotationScale:()=>Ky,TranslucentTileClassification:()=>U3,TridiagonalSystemSolver:()=>Fv,TrustedServers:()=>xv,TweenCollection:()=>bC,UniformState:()=>XM,UniformType:()=>d0,UrlTemplate3DTilesDataProvider:()=>t4,UrlTemplateImageryProvider:()=>xa,VERSION:()=>e8t,VRButton:()=>r8,VRButtonViewModel:()=>i8,VRTheWorldTerrainProvider:()=>i$,VaryingType:()=>Eae,Vector3DTileBatch:()=>Jp,Vector3DTileClampedPolylines:()=>W2,Vector3DTileContent:()=>q2,Vector3DTileGeometry:()=>i_,Vector3DTilePoints:()=>k2,Vector3DTilePolygons:()=>z2,Vector3DTilePolylines:()=>FT,Vector3DTilePrimitive:()=>MT,VectorGltf3DTileContent:()=>IA,VectorPipeline:()=>tl,VectorProvider:()=>IM,VelocityOrientationProperty:()=>wU,VelocityVectorProperty:()=>b_,VertexArray:()=>Vn,VertexArrayFacade:()=>vg,VertexAttributeSemantic:()=>rt,VertexFormat:()=>Be,VerticalExaggeration:()=>fr,VerticalExaggerationPipelineStage:()=>e2,VerticalOrigin:()=>Gn,VideoSynchronizer:()=>Y$,View:()=>hC,Viewer:()=>qae,ViewportQuad:()=>oae,Visibility:()=>No,Visualizer:()=>Qre,VoxelBoundsCollection:()=>D_,VoxelBoxShape:()=>SC,VoxelCell:()=>Iz,VoxelContent:()=>EC,VoxelCylinderShape:()=>wC,VoxelEllipsoidShape:()=>IC,VoxelInspector:()=>a8,VoxelInspectorViewModel:()=>o8,VoxelMetadataOrder:()=>m0,VoxelPrimitive:()=>YA,VoxelProvider:()=>sae,VoxelRenderResources:()=>Yz,VoxelShape:()=>cae,VoxelShapeType:()=>_c,VoxelTraversal:()=>tU,VulkanConstants:()=>X$,WallGeometry:()=>DM,WallGeometryLibrary:()=>wx,WallGeometryUpdater:()=>LN,WallGraphics:()=>Ng,WallOutlineGeometry:()=>OM,WebGLConstants:()=>ee,WebMapServiceImageryProvider:()=>EB,WebMapTileServiceImageryProvider:()=>SB,WebMercatorProjection:()=>di,WebMercatorTilingScheme:()=>To,WindingOrder:()=>Wa,WireframeIndexGenerator:()=>$E,WireframePipelineStage:()=>t2,_shadersAcesTonemappingStage:()=>W3,_shadersAdditiveBlend:()=>Cz,_shadersAdjustTranslucentFS:()=>Fw,_shadersAllMaterialAppearanceFS:()=>yN,_shadersAllMaterialAppearanceVS:()=>AN,_shadersAmbientOcclusionGenerate:()=>q3,_shadersAmbientOcclusionModulate:()=>Y3,_shadersAspectRampMaterial:()=>uL,_shadersAtmosphereCommon:()=>mm,_shadersAtmosphereStageFS:()=>vF,_shadersAtmosphereStageVS:()=>EF,_shadersBasicMaterialAppearanceFS:()=>bN,_shadersBasicMaterialAppearanceVS:()=>xN,_shadersBillboardCollectionFS:()=>UL,_shadersBillboardCollectionVS:()=>VL,_shadersBlackAndWhite:()=>X3,_shadersBloomComposite:()=>K3,_shadersBrdfLutGeneratorFS:()=>s3,_shadersBrightPass:()=>vz,_shadersBrightness:()=>$3,_shadersBufferPointMaterialFS:()=>X2,_shadersBufferPointMaterialVS:()=>Y2,_shadersBufferPolygonMaterialFS:()=>xM,_shadersBufferPolygonMaterialVS:()=>bM,_shadersBufferPolylineMaterialFS:()=>EM,_shadersBufferPolylineMaterialVS:()=>vM,_shadersBumpMapMaterial:()=>fL,_shadersCPUStylingStageFS:()=>$F,_shadersCPUStylingStageVS:()=>KF,_shadersCheckerboardMaterial:()=>dL,_shadersCloudCollectionFS:()=>RV,_shadersCloudCollectionVS:()=>OV,_shadersCloudNoiseFS:()=>MV,_shadersCloudNoiseVS:()=>LV,_shadersCompareAndPackTranslucentDepth:()=>z3,_shadersCompositeOITFS:()=>L3,_shadersCompositeTranslucentClassification:()=>dC,_shadersComputeIrradianceFS:()=>zN,_shadersComputeRadianceMapFS:()=>UN,_shadersConstantLodStageFS:()=>zB,_shadersConstantLodStageVS:()=>kB,_shadersContrastBias:()=>J3,_shadersConvolveSpecularMapFS:()=>VN,_shadersConvolveSpecularMapVS:()=>jN,_shadersCubeMapPanoramaVS:()=>dU,_shadersCustomShaderStageFS:()=>QF,_shadersCustomShaderStageVS:()=>ZF,_shadersCzmBuiltins:()=>vx,_shadersDepthOfField:()=>Z3,_shadersDepthPlaneFS:()=>_3,_shadersDepthPlaneVS:()=>y3,_shadersDepthView:()=>Q3,_shadersDepthViewPacked:()=>hae,_shadersDotMaterial:()=>hL,_shadersEdgeDetection:()=>ez,_shadersEdgeDetectionStageFS:()=>sB,_shadersEdgeVisibilityStageFS:()=>lB,_shadersEdgeVisibilityStageVS:()=>uB,_shadersElevationBandMaterial:()=>mL,_shadersElevationContourMaterial:()=>pL,_shadersElevationRampMaterial:()=>gL,_shadersEllipsoidFS:()=>Dw,_shadersEllipsoidSurfaceAppearanceFS:()=>jV,_shadersEllipsoidSurfaceAppearanceVS:()=>HV,_shadersEllipsoidVS:()=>Rw,_shadersFXAA:()=>iz,_shadersFXAA3_11:()=>lz,_shadersFadeMaterial:()=>_L,_shadersFeatureIdStageFS:()=>eB,_shadersFeatureIdStageVS:()=>tB,_shadersFilmicTonemapping:()=>tz,_shadersGaussianBlur1D:()=>WA,_shadersGeometryStageFS:()=>dB,_shadersGeometryStageVS:()=>hB,_shadersGlobeFS:()=>Hk,_shadersGlobeVS:()=>Gk,_shadersGridMaterial:()=>yL,_shadersGroundAtmosphere:()=>Ew,_shadersHSBToRGB:()=>OR,_shadersHSLToRGB:()=>MR,_shadersImageBasedLightingStageFS:()=>wF,_shadersInstancingStageCommon:()=>kF,_shadersInstancingStageVS:()=>zF,_shadersIntersectBox:()=>zz,_shadersIntersectCylinder:()=>Uz,_shadersIntersectDepth:()=>Bz,_shadersIntersectEllipsoid:()=>Vz,_shadersIntersectLongitude:()=>jw,_shadersIntersectPlane:()=>kz,_shadersIntersection:()=>vC,_shadersIntersectionUtils:()=>Fz,_shadersLegacyInstancingStageVS:()=>UF,_shadersLensFlare:()=>rz,_shadersLightingStageFS:()=>NB,_shadersMaterialStageFS:()=>BB,_shadersMegatexture:()=>qz,_shadersMetadataStageFS:()=>nB,_shadersMetadataStageVS:()=>iB,_shadersModelClippingPlanesStageFS:()=>OF,_shadersModelClippingPolygonsStageFS:()=>NF,_shadersModelClippingPolygonsStageVS:()=>LF,_shadersModelColorStageFS:()=>RF,_shadersModelFS:()=>_2,_shadersModelSilhouetteStageFS:()=>o2,_shadersModelSilhouetteStageVS:()=>a2,_shadersModelSplitterStageFS:()=>c2,_shadersModelVS:()=>g2,_shadersModifiedReinhardTonemapping:()=>oz,_shadersMorphTargetsStageVS:()=>VB,_shadersNightVision:()=>az,_shadersNormalMapMaterial:()=>AL,_shadersOctree:()=>Wz,_shadersPassThrough:()=>Yu,_shadersPassThroughDepth:()=>VA,_shadersPbrNeutralTonemapping:()=>nz,_shadersPerInstanceColorAppearanceFS:()=>LL,_shadersPerInstanceColorAppearanceVS:()=>NL,_shadersPerInstanceFlatColorAppearanceFS:()=>kx,_shadersPerInstanceFlatColorAppearanceVS:()=>FL,_shadersPointCloudEyeDomeLighting:()=>lF,_shadersPointCloudStylingStageVS:()=>GB,_shadersPointPrimitiveCollectionFS:()=>aA,_shadersPointPrimitiveCollectionVS:()=>YL,_shadersPolygonSignedDistanceFS:()=>kN,_shadersPolylineArrowMaterial:()=>bL,_shadersPolylineColorAppearanceVS:()=>cL,_shadersPolylineCommon:()=>Ul,_shadersPolylineDashMaterial:()=>xL,_shadersPolylineFS:()=>Ux,_shadersPolylineGlowMaterial:()=>TL,_shadersPolylineMaterialAppearanceVS:()=>lL,_shadersPolylineOutlineMaterial:()=>CL,_shadersPolylineShadowVolumeFS:()=>rL,_shadersPolylineShadowVolumeMorphFS:()=>oL,_shadersPolylineShadowVolumeMorphVS:()=>aL,_shadersPolylineShadowVolumeVS:()=>sL,_shadersPolylineVS:()=>M2,_shadersPrimitiveGaussianSplatFS:()=>rk,_shadersPrimitiveGaussianSplatVS:()=>ik,_shadersPrimitiveOutlineStageFS:()=>YB,_shadersPrimitiveOutlineStageVS:()=>qB,_shadersRGBToHSB:()=>LR,_shadersRGBToHSL:()=>NR,_shadersRGBToXYZ:()=>FR,_shadersReinhardTonemapping:()=>sz,_shadersReprojectWebMercatorFS:()=>PB,_shadersReprojectWebMercatorVS:()=>DB,_shadersRimLightingMaterial:()=>vL,_shadersSelectedFeatureIdStageCommon:()=>jS,_shadersShadowVolumeAppearanceFS:()=>eS,_shadersShadowVolumeAppearanceVS:()=>ML,_shadersShadowVolumeFS:()=>tA,_shadersSilhouette:()=>cz,_shadersSkinningStageVS:()=>JB,_shadersSkyAtmosphereCommon:()=>Hw,_shadersSkyAtmosphereFS:()=>sU,_shadersSkyAtmosphereVS:()=>cU,_shadersSkyBoxFS:()=>uU,_shadersSkyBoxVS:()=>fU,_shadersSlopeRampMaterial:()=>EL,_shadersStripeMaterial:()=>SL,_shadersSunFS:()=>pU,_shadersSunTextureFS:()=>gU,_shadersSunVS:()=>_U,_shadersTexturedMaterialAppearanceFS:()=>TN,_shadersTexturedMaterialAppearanceVS:()=>CN,_shadersVector3DTileClampedPolylinesFS:()=>H2,_shadersVector3DTileClampedPolylinesVS:()=>j2,_shadersVector3DTilePolylinesVS:()=>U2,_shadersVectorCommon:()=>Wk,_shadersVectorTileVS:()=>aw,_shadersVerticalExaggerationStageVS:()=>QB,_shadersViewportQuadFS:()=>NV,_shadersViewportQuadVS:()=>Mx,_shadersVoxelFS:()=>Lz,_shadersVoxelUtils:()=>Mz,_shadersVoxelVS:()=>Nz,_shadersWater:()=>IL,_shadersWaterMaskMaterial:()=>wL,_shadersXYZToRGB:()=>BR,_shadersacesTonemapping:()=>kR,_shadersalphaWeight:()=>zR,_shadersantialias:()=>UR,_shadersapplyHSBShift:()=>VR,_shadersapproximateSphericalCoordinates:()=>jR,_shadersapproximateTanh:()=>HR,_shadersbackFacing:()=>GR,_shadersbranchFreeTernary:()=>WR,_shaderscascadeColor:()=>qR,_shaderscascadeDistance:()=>YR,_shaderscascadeMatrix:()=>XR,_shaderscascadeWeights:()=>KR,_shadersclipPolygons:()=>$R,_shaderscolumbusViewMorph:()=>JR,_shaderscomputeAtmosphereColor:()=>ZR,_shaderscomputeGroundAtmosphereScattering:()=>QR,_shaderscomputePosition:()=>eO,_shaderscomputeScattering:()=>tO,_shaderscomputeTextureTransform:()=>nO,_shadersconvertLocalToBoxUv:()=>jz,_shadersconvertLocalToCylinderUv:()=>Hz,_shadersconvertLocalToEllipsoidUv:()=>Gz,_shaderscosineAndSine:()=>iO,_shadersdecodeRGB8:()=>rO,_shadersdecompressTextureCoordinates:()=>oO,_shadersdegreesPerRadian:()=>F1,_shadersdepthClamp:()=>aO,_shadersdepthRange:()=>B1,_shadersdepthRangeStruct:()=>vR,_shaderseastNorthUpToEyeCoordinates:()=>sO,_shadersellipsoidContainsPoint:()=>cO,_shadersellipsoidTextureCoordinates:()=>lO,_shadersepsilon1:()=>k1,_shadersepsilon2:()=>z1,_shadersepsilon3:()=>U1,_shadersepsilon4:()=>V1,_shadersepsilon5:()=>j1,_shadersepsilon6:()=>H1,_shadersepsilon7:()=>G1,_shadersequalsEpsilon:()=>uO,_shaderseyeOffset:()=>fO,_shaderseyeToWindowCoordinates:()=>dO,_shadersfastApproximateAtan:()=>hO,_shadersfog:()=>mO,_shadersgammaCorrect:()=>pO,_shadersgeodeticSurfaceNormal:()=>gO,_shadersgetDefaultMaterial:()=>_O,_shadersgetDynamicAtmosphereLightDirection:()=>yO,_shadersgetLambertDiffuse:()=>AO,_shadersgetSpecular:()=>bO,_shadersgetWaterNoise:()=>xO,_shadershue:()=>TO,_shadersinfinity:()=>W1,_shadersinverseGamma:()=>CO,_shadersisEmpty:()=>vO,_shadersisFull:()=>EO,_shaderslatitudeToWebMercatorFraction:()=>SO,_shaderslineDistance:()=>wO,_shaderslinearToSrgb:()=>IO,_shadersluminance:()=>PO,_shadersmaterial:()=>ER,_shadersmaterialInput:()=>SR,_shadersmaximumComponent:()=>DO,_shadersmetersPerPixel:()=>RO,_shadersmodelMaterial:()=>wR,_shadersmodelToWindowCoordinates:()=>OO,_shadersmodelVertexOutput:()=>IR,_shadersmultiplyWithColorBalance:()=>MO,_shadersnearFarScalar:()=>LO,_shadersoctDecode:()=>NO,_shadersoneOverPi:()=>q1,_shadersoneOverTwoPi:()=>Y1,_shaderspackDepth:()=>FO,_shaderspassCesium3DTile:()=>X1,_shaderspassCesium3DTileClassification:()=>K1,_shaderspassCesium3DTileClassificationIgnoreShow:()=>$1,_shaderspassCesium3DTileEdges:()=>J1,_shaderspassCesium3DTileEdgesDirect:()=>Z1,_shaderspassCesium3DTilePlanarFillId:()=>Q1,_shaderspassClassification:()=>eR,_shaderspassCompute:()=>tR,_shaderspassEnvironment:()=>nR,_shaderspassGaussianSplats:()=>iR,_shaderspassGlobe:()=>rR,_shaderspassOpaque:()=>oR,_shaderspassOverlay:()=>aR,_shaderspassTerrainClassification:()=>sR,_shaderspassTranslucent:()=>cR,_shaderspassVoxels:()=>lR,_shaderspbrLighting:()=>BO,_shaderspbrNeutralTonemapping:()=>kO,_shadersphong:()=>zO,_shaderspi:()=>uR,_shaderspiOverFour:()=>fR,_shaderspiOverSix:()=>dR,_shaderspiOverThree:()=>hR,_shaderspiOverTwo:()=>mR,_shadersplaneDistance:()=>UO,_shaderspointAlongRay:()=>VO,_shadersradiansPerDegree:()=>pR,_shadersray:()=>PR,_shadersrayEllipsoidIntersectionInterval:()=>jO,_shadersraySegment:()=>DR,_shadersraySphereIntersectionInterval:()=>HO,_shadersreadDepth:()=>GO,_shadersreadNonPerspective:()=>WO,_shadersreverseLogDepth:()=>qO,_shadersround:()=>YO,_shaderssaturation:()=>XO,_shaderssceneMode2D:()=>gR,_shaderssceneMode3D:()=>_R,_shaderssceneModeColumbusView:()=>yR,_shaderssceneModeMorphing:()=>AR,_shadersshadowDepthCompare:()=>KO,_shadersshadowParameters:()=>RR,_shadersshadowVisibility:()=>$O,_shaderssignNotZero:()=>JO,_shaderssolarRadius:()=>bR,_shaderssphericalHarmonics:()=>ZO,_shaderssrgbToLinear:()=>QO,_shaderstangentToEyeSpaceMatrix:()=>eM,_shaderstextureCube:()=>tM,_shadersthreePiOver2:()=>xR,_shaderstransformPlane:()=>nM,_shaderstranslateRelativeToEye:()=>iM,_shaderstranslucentPhong:()=>rM,_shaderstranspose:()=>oM,_shaderstwoPi:()=>TR,_shadersunpackClippingExtents:()=>aM,_shadersunpackDepth:()=>sM,_shadersunpackFloat:()=>cM,_shadersunpackTexture:()=>lM,_shadersunpackUint:()=>uM,_shadersvalueTransform:()=>fM,_shadersvertexLogDepth:()=>dM,_shaderswebMercatorMaxLatitude:()=>CR,_shaderswindowToEyeCoordinates:()=>hM,_shaderswriteDepthClamp:()=>mM,_shaderswriteLogDepth:()=>pM,_shaderswriteNonPerspective:()=>gM,addAllToArray:()=>Xn,addBuffer:()=>iD,addDefaults:()=>$P,addExtensionsRequired:()=>eD,addExtensionsUsed:()=>Ad,addPipelineExtras:()=>yy,addToArray:()=>us,appendForwardSlash:()=>uP,arrayRemoveDuplicates:()=>Pr,assert:()=>r$,barycentricCoordinates:()=>Wb,binarySearch:()=>Ar,buildModuleUrl:()=>$t,buildVectorGltfFromMVT:()=>n4,buildVoxelCustomShader:()=>Vw,buildVoxelDrawCommands:()=>Xz,clone:()=>Ye,combine:()=>Ot,computeFlyToLocationForRectangle:()=>tC,createBillboardPointCallback:()=>NT,createColorRamp:()=>MM,createCommand:()=>On,createDefaultImageryProviderViewModels:()=>v4,createDefaultTerrainProviderViewModels:()=>E4,createElevationBandMaterial:()=>lae,createGooglePhotorealistic3DTileset:()=>uae,createGuid:()=>Kn,createMaterialPropertyDescriptor:()=>Qr,createOsmBuildingsAsync:()=>fae,createPropertyDescriptor:()=>me,createRawPropertyDescriptor:()=>$l,createTangentSpaceDebugPrimitive:()=>dae,createTaskProcessorWorker:()=>wae,createUniform:()=>yM,createUniformArray:()=>AM,createVectorTileBuffersFromModelComponents:()=>Q2,createWorldBathymetryAsync:()=>LM,createWorldImageryAsync:()=>e_,createWorldTerrainAsync:()=>Dx,decodeGoogleEarthEnterpriseData:()=>NM,decodeMVT:()=>r4,decodeVectorPolylinePositions:()=>FM,defaultPickWorldPosition:()=>ip,defer:()=>_u,defined:()=>l,demodernizeShader:()=>_M,deprecationWarning:()=>Ds,destroyObject:()=>ue,exportKml:()=>roe,findAccessorMinMax:()=>Ub,findContentMetadata:()=>jT,findGroupMetadata:()=>HT,findMeshoptExtension:()=>_y,findTileMetadata:()=>uk,forEachTextureInMaterial:()=>Yv,formatError:()=>pp,freezeRenderState:()=>d$,getAbsoluteUri:()=>dd,getAccessorByteStride:()=>Eu,getBaseUri:()=>fP,getBinaryAccessor:()=>Yd,getClipAndStyleCode:()=>xU,getClippingFunction:()=>nC,getComponentReader:()=>Y0,getElement:()=>Bn,getExtensionFromUri:()=>L0,getFilenameFromUri:()=>xg,getImageFromTypedArray:()=>BM,getImagePixels:()=>vh,getJsonFromTypedArray:()=>Co,getMagic:()=>Nh,getMeshPrimitives:()=>aF,getMetadataClassProperty:()=>iU,getMetadataProperty:()=>oU,getStringFromTypedArray:()=>Cu,getTimestamp:()=>yn,hasExtension:()=>$i,heightReferenceOnEntityPropertyChanged:()=>Fg,isBitSet:()=>$c,isBlobUri:()=>xb,isCrossOriginUrl:()=>iy,isDataUri:()=>Eh,isLeapYear:()=>Ch,knockout:()=>Ee,knockout_3_5_1:()=>sv,knockout_es5:()=>m4,loadAndExecuteScript:()=>Tb,loadCubeMap:()=>nL,loadImageFromTypedArray:()=>W0,loadKTX2:()=>vu,mergeSort:()=>Up,moveTechniqueRenderStates:()=>QP,moveTechniquesToExtension:()=>tD,numberOfComponentsForType:()=>ff,objectToQuery:()=>Cb,oneTimeWarning:()=>pt,parseBatchTable:()=>qg,parseFeatureMetadataLegacy:()=>XN,parseGlb:()=>zb,parseResponseHeaders:()=>dP,parseStructuralMetadata:()=>YN,pickModel:()=>ow,pointInsideTriangle:()=>nJ,preprocess3DTileContent:()=>d_,processVoxelProperties:()=>Oz,queryToObject:()=>sf,readAccessorPacked:()=>rD,removeExtension:()=>Vb,removeExtensionsRequired:()=>JP,removeExtensionsUsed:()=>kb,removePipelineExtras:()=>ZP,removeUnusedElements:()=>nD,renderBufferPointCollection:()=>J2,renderBufferPolygonCollection:()=>CM,renderBufferPolylineCollection:()=>wM,resizeImageToNextPowerOfTwo:()=>xy,sampleTerrain:()=>kM,sampleTerrainMostDetailed:()=>Rx,scaleToGeodeticSurface:()=>bb,srgbToLinear:()=>Ox,subdivideArray:()=>zM,subscribeAndEvaluate:()=>yc,updateAccessorComponentTypes:()=>oD,updateVersion:()=>aD,usesExtension:()=>Oo,viewerCesium3DTilesInspectorMixin:()=>Yae,viewerCesiumInspectorMixin:()=>Xae,viewerDragDropMixin:()=>$ae,viewerPerformanceWatchdogMixin:()=>Jae,viewerVoxelInspectorMixin:()=>Qae,webGLConstantToGlslType:()=>oJ,wrapFunction:()=>UM,writeTextToCanvas:()=>hx});module.exports=Th(t8t);function UNe(e){return e!=null}var l=UNe;function Ab(e){this.name="DeveloperError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(Ab.prototype=Object.create(Error.prototype),Ab.prototype.constructor=Ab);Ab.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=`
${this.stack.toString()}`),e};Ab.throwInstantiationError=function(){throw new Ab("This function defines an interface and should not be called directly.")};var pe=Ab;var ss={};ss.typeOf={};function VNe(e){return`${e} is required, actual value was undefined`}function dv(e,t,n){return`Expected ${n} to be typeof ${t}, actual typeof was ${e}`}ss.defined=function(e,t){if(!l(t))throw new pe(VNe(e))};ss.typeOf.func=function(e,t){if(typeof t!="function")throw new pe(dv(typeof t,"function",e))};ss.typeOf.string=function(e,t){if(typeof t!="string")throw new pe(dv(typeof t,"string",e))};ss.typeOf.number=function(e,t){if(typeof t!="number")throw new pe(dv(typeof t,"number",e))};ss.typeOf.number.lessThan=function(e,t,n){if(ss.typeOf.number(e,t),t>=n)throw new pe(`Expected ${e} to be less than ${n}, actual value was ${t}`)};ss.typeOf.number.lessThanOrEquals=function(e,t,n){if(ss.typeOf.number(e,t),t>n)throw new pe(`Expected ${e} to be less than or equal to ${n}, actual value was ${t}`)};ss.typeOf.number.greaterThan=function(e,t,n){if(ss.typeOf.number(e,t),t<=n)throw new pe(`Expected ${e} to be greater than ${n}, actual value was ${t}`)};ss.typeOf.number.greaterThanOrEquals=function(e,t,n){if(ss.typeOf.number(e,t),t<n)throw new pe(`Expected ${e} to be greater than or equal to ${n}, actual value was ${t}`)};ss.typeOf.object=function(e,t){if(typeof t!="object")throw new pe(dv(typeof t,"object",e))};ss.typeOf.bool=function(e,t){if(typeof t!="boolean")throw new pe(dv(typeof t,"boolean",e))};ss.typeOf.bigint=function(e,t){if(typeof t!="bigint")throw new pe(dv(typeof t,"bigint",e))};ss.typeOf.number.equals=function(e,t,n,i){if(ss.typeOf.number(e,n),ss.typeOf.number(t,i),n!==i)throw new pe(`${e} must be equal to ${t}, the actual values are ${n} and ${i}`)};var Ur=ss;var U7=Go(c8(),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 l8=[1];ht.factorial=function(e){let t=l8.length;if(e>=t){let n=l8[t-1];for(let i=t;i<=e;i++){let r=n*i;l8.push(r),n=r}}return l8[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 ise=new U7.default;ht.setRandomNumberSeed=function(e){ise=new U7.default(e)};ht.nextRandomNumber=function(){return ise.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 D=ht;var co=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=D.clamp(t.x,n.x,i.x),a=D.clamp(t.y,n.y,i.y),s=D.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,u8),e.magnitude(u8)}static distanceSquared(t,n){return e.subtract(t,n,u8),e.magnitudeSquared(u8)}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,rse),r=e.multiplyByScalar(t,1-i,r),e.add(rse,r,r)}static angleBetween(t,n){e.normalize(t,f8),e.normalize(n,V7);let i=e.dot(f8,V7),r=e.magnitude(e.cross(f8,V7,f8));return Math.atan2(r,i)}static mostOrthogonalAxis(t,n){let i=e.normalize(t,jNe);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)&&D.equalsEpsilon(t.x,n.x,i,r)&&D.equalsEpsilon(t.y,n.y,i,r)&&D.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=D.toRadians(t),n=D.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);fd.x=s*Math.cos(t),fd.y=s*Math.sin(t),fd.z=Math.sin(n),fd=e.normalize(fd,fd),e.multiplyComponents(a,fd,hv);let c=Math.sqrt(e.dot(fd,hv));return hv=e.divideByScalar(hv,c,hv),fd=e.multiplyByScalar(fd,i,fd),l(o)||(o=new e),e.add(hv,fd,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})`}};co.fromCartesian4=co.clone;co.packedLength=3;co.fromArray=co.unpack;var u8=new co,rse=new co,f8=new co,V7=new co,jNe=new co,fd=new co,hv=new co;co._ellipsoidRadiiSquared=new co(6378137*6378137,6378137*6378137,6356752314245179e-9*6356752314245179e-9);co.ZERO=Object.freeze(new co(0,0,0));co.ONE=Object.freeze(new co(1,1,1));co.UNIT_X=Object.freeze(new co(1,0,0));co.UNIT_Y=Object.freeze(new co(0,1,0));co.UNIT_Z=Object.freeze(new co(0,0,1));var h=co;var HNe=new h,GNe=new h;function WNe(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,HNe);if(m<i)return isFinite(y)?h.clone(A,r):void 0;let b=n.x,x=n.y,T=n.z,C=GNe;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,P,R,O,N,_,v,S,I,M,F,V;do{E-=w,O=1/(1+E*b),N=1/(1+E*x),_=1/(1+E*T),v=O*O,S=N*N,I=_*_,M=v*O,F=S*N,V=I*_,P=d*v+p*S+g*I-1,R=d*M*b+p*F*x+g*V*T;let k=-2*R;w=P/k}while(Math.abs(P)>D.EPSILON12);return l(r)?(r.x=o*O,r.y=a*N,r.z=s*_,r):new h(o*O,a*N,s*_)}var bb=WNe;var El=class El{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 El(t,n,i)}static fromDegrees(t,n,i,r){return t=D.toRadians(t),n=D.toRadians(n),El.fromRadians(t,n,i,r)}static fromCartesian(t,n,i){let r=l(n)?n.oneOverRadii:El._ellipsoidOneOverRadii,o=l(n)?n.oneOverRadiiSquared:El._ellipsoidOneOverRadiiSquared,a=l(n)?n._centerToleranceSquared:El._ellipsoidCenterToleranceSquared,s=bb(t,r,o,a,YNe);if(!l(s))return;let c=h.multiplyComponents(s,o,qNe);c=h.normalize(c,c);let u=h.subtract(t,s,XNe),f=Math.atan2(c.y,c.x),d=Math.asin(c.z),p=D.sign(h.dot(u,t))*h.magnitude(u);return l(i)?(i.longitude=f,i.latitude=d,i.height=p,i):new El(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 El(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 El.clone(this,t)}equals(t){return El.equals(this,t)}equalsEpsilon(t,n){return El.equalsEpsilon(this,t,n)}toString(){return`(${this.longitude}, ${this.latitude}, ${this.height})`}};at(El,"_ellipsoidOneOverRadii",new h(1/6378137,1/6378137,1/6356752314245179e-9)),at(El,"_ellipsoidOneOverRadiiSquared",new h(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9))),at(El,"_ellipsoidCenterToleranceSquared",D.EPSILON1);var sP=El;sP.ZERO=Object.freeze(new sP(0,0,0));var qNe=new h,YNe=new h,XNe=new h,de=sP;var oa=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=D.clamp(t.x,n.x,i.x),a=D.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,d8),e.magnitude(d8)}static distanceSquared(t,n){return e.subtract(t,n,d8),e.magnitudeSquared(d8)}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,ose),r=e.multiplyByScalar(t,1-i,r),e.add(ose,r,r)}static angleBetween(t,n){return e.normalize(t,ase),e.normalize(n,sse),D.acosClamped(e.dot(ase,sse))}static mostOrthogonalAxis(t,n){let i=e.normalize(t,KNe);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)&&D.equalsEpsilon(t.x,n.x,i,r)&&D.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})`}};oa.fromCartesian3=oa.clone;oa.fromCartesian4=oa.clone;oa.packedLength=2;oa.fromArray=oa.unpack;var d8=new oa,ose=new oa,ase=new oa,sse=new oa,KNe=new oa;oa.ZERO=Object.freeze(new oa(0,0));oa.ONE=Object.freeze(new oa(1,1));oa.UNIT_X=Object.freeze(new oa(1,0));oa.UNIT_Y=Object.freeze(new oa(0,1));var z=oa;function cse(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=D.EPSILON1,e._radiiSquared.z!==0&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}var Sl=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,cse(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)&&cse(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,D.EPSILON14))return l(n)||(n=new h),n=h.multiplyComponents(t,this._oneOverRadiiSquared,n),h.normalize(n,n)}cartographicToCartesian(t,n){let i=$Ne,r=JNe;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,QNe);if(!l(i))return;let r=this.geodeticSurfaceNormal(i,ZNe),o=h.subtract(t,i,eFe),a=Math.atan2(r.y,r.x),s=Math.asin(r.z),c=D.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 bb(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 z);let i=this.getSurfaceNormalIntersectionWithZAxis(t,0,tFe),r=h.distance(t,i),o=this.minimumRadius*r/this.maximumRadius**2,a=r*o**2;return z.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+=D.TWO_PI;let a=this._radiiSquared,s=a.x,c=a.y,u=a.z,f=s*c;return lse(r,o,function(d){let p=Math.cos(d),g=Math.sin(d);return Math.cos(d)*lse(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)})})}};Sl.WGS84=Object.freeze(new Sl(6378137,6378137,6356752314245179e-9));Sl.UNIT_SPHERE=Object.freeze(new Sl(1,1,1));Sl.MOON=Object.freeze(new Sl(D.LUNAR_RADIUS,D.LUNAR_RADIUS,D.LUNAR_RADIUS));Sl.MARS=Object.freeze(new Sl(3396190,3396190,3376200));Sl._default=Sl.WGS84;Sl.packedLength=h.packedLength;Sl.prototype.geocentricSurfaceNormal=h.normalize;var $Ne=new h,JNe=new h,ZNe=new h,QNe=new h,eFe=new h,tFe=new h,nFe=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],iFe=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function lse(e,t,n){let i=.5*(t+e),r=.5*(t-e),o=0;for(let a=0;a<5;a++){let s=r*nFe[a];o+=iFe[a]*(n(i+s)+n(i-s))}return o*=r,o}var te=Sl;var j7=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)}},Bi=j7;var use={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};Object.freeze(use);var Xt=use;function rFe(e,t){this.start=e??0,this.stop=t??0}var Wo=rFe;var mr=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,oFe),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,aFe),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],H7)),n.y=h.magnitude(h.fromElements(t[3],t[4],t[5],H7)),n.z=h.magnitude(h.fromElements(t[6],t[7],t[8],H7)),n}static getMaximumScale(t){return e.getScale(t,fse),h.maximumComponent(fse)}static setRotation(t,n,i){let r=e.getScale(t,sFe);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,cFe);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=D.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*uFe(c);for(;a<r&&fFe(c)>u;)dFe(c,h8),e.transpose(h8,dse),e.multiply(c,h8,c),e.multiply(dse,c,c),e.multiply(s,h8,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,lFe),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]})`}};mr.packedLength=9;mr.fromArray=mr.unpack;mr.IDENTITY=Object.freeze(new mr(1,0,0,0,1,0,0,0,1));mr.ZERO=Object.freeze(new mr(0,0,0,0,0,0,0,0,0));mr.COLUMN0ROW0=0;mr.COLUMN0ROW1=1;mr.COLUMN0ROW2=2;mr.COLUMN1ROW0=3;mr.COLUMN1ROW1=4;mr.COLUMN1ROW2=5;mr.COLUMN2ROW0=6;mr.COLUMN2ROW1=7;mr.COLUMN2ROW2=8;var oFe=new h,aFe=new h,H7=new h,fse=new h,sFe=new h,cFe=new h,h8=new mr,dse=new mr,lFe=new mr;function uFe(e){let t=0;for(let n=0;n<9;++n){let i=e[n];t+=i*i}return Math.sqrt(t)}var G7=[1,0,0],W7=[2,2,1];function fFe(e){let t=0;for(let n=0;n<3;++n){let i=e[mr.getElementIndex(W7[n],G7[n])];t+=2*i*i}return Math.sqrt(t)}function dFe(e,t){let n=D.EPSILON15,i=0,r=1;for(let u=0;u<3;++u){let f=Math.abs(e[mr.getElementIndex(W7[u],G7[u])]);f>i&&(r=u,i=f)}let o=1,a=0,s=G7[r],c=W7[r];if(Math.abs(e[mr.getElementIndex(c,s)])>n){let u=e[mr.getElementIndex(c,c)],f=e[mr.getElementIndex(s,s)],d=e[mr.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=mr.clone(mr.IDENTITY,t),t[mr.getElementIndex(s,s)]=t[mr.getElementIndex(c,c)]=o,t[mr.getElementIndex(c,s)]=a,t[mr.getElementIndex(s,c)]=-a,t}var $=mr;var ja=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=D.clamp(t.x,n.x,i.x),a=D.clamp(t.y,n.y,i.y),s=D.clamp(t.z,n.z,i.z),c=D.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,m8),e.magnitude(m8)}static distanceSquared(t,n){return e.subtract(t,n,m8),e.magnitudeSquared(m8)}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,hse),r=e.multiplyByScalar(t,1-i,r),e.add(hse,r,r)}static mostOrthogonalAxis(t,n){let i=e.normalize(t,hFe);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)&&D.equalsEpsilon(t.x,n.x,i,r)&&D.equalsEpsilon(t.y,n.y,i,r)&&D.equalsEpsilon(t.z,n.z,i,r)&&D.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),q7[0]=t,mse?(n.x=Uc[0],n.y=Uc[1],n.z=Uc[2],n.w=Uc[3]):(n.x=Uc[3],n.y=Uc[2],n.z=Uc[1],n.w=Uc[0]),n}static unpackFloat(t){return mse?(Uc[0]=t.x,Uc[1]=t.y,Uc[2]=t.z,Uc[3]=t.w):(Uc[0]=t.w,Uc[1]=t.z,Uc[2]=t.y,Uc[3]=t.x),q7[0]}};ja.packedLength=4;ja.fromArray=ja.unpack;var m8=new ja,hse=new ja,hFe=new ja;ja.ZERO=Object.freeze(new ja(0,0,0,0));ja.ONE=Object.freeze(new ja(1,1,1,1));ja.UNIT_X=Object.freeze(new ja(1,0,0,0));ja.UNIT_Y=Object.freeze(new ja(0,1,0,0));ja.UNIT_Z=Object.freeze(new ja(0,0,1,0));ja.UNIT_W=Object.freeze(new ja(0,0,0,1));var q7=new Float32Array(1),Uc=new Uint8Array(q7.buffer),mFe=new Uint32Array([287454020]),pFe=new Uint8Array(mFe.buffer),mse=pFe[0]===68,ae=ja;var Y7={};Y7.EMPTY_OBJECT=Object.freeze({});Y7.EMPTY_ARRAY=Object.freeze([]);var H=Y7;function cP(e){this.name="RuntimeError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(cP.prototype=Object.create(Error.prototype),cP.prototype.constructor=cP);cP.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=`
${this.stack.toString()}`),e};var oe=cP;var lo=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,P=2*(g-d),R=2*(f-m),O=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]=O*a,r[7]=0,r[8]=C*s,r[9]=P*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,mv),h.normalize(h.cross(mv,o,pv),pv),h.normalize(h.cross(pv,mv,lP),lP);let a=pv.x,s=pv.y,c=pv.z,u=mv.x,f=mv.y,d=mv.z,p=lP.x,g=lP.y,m=lP.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,gFe),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,_Fe),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],X7)),n.y=h.magnitude(h.fromElements(t[4],t[5],t[6],X7)),n.z=h.magnitude(h.fromElements(t[8],t[9],t[10],X7)),n}static getMaximumScale(t){return e.getScale(t,pse),h.maximumComponent(pse)}static setRotation(t,n,i){let r=e.getScale(t,yFe);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,AFe);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],P=n[3],R=n[4],O=n[5],N=n[6],_=n[7],v=n[8],S=n[9],I=n[10],M=n[11],F=n[12],V=n[13],k=n[14],j=n[15],B=r*C+c*E+p*w+A*P,G=o*C+u*E+g*w+b*P,W=a*C+f*E+m*w+x*P,Q=s*C+d*E+y*w+T*P,q=r*R+c*O+p*N+A*_,J=o*R+u*O+g*N+b*_,Z=a*R+f*O+m*N+x*_,ce=s*R+d*O+y*N+T*_,Ae=r*v+c*S+p*I+A*M,le=o*v+u*S+g*I+b*M,Ce=a*v+f*S+m*I+x*M,ye=s*v+d*S+y*I+T*M,ve=r*F+c*V+p*k+A*j,Ie=o*F+u*V+g*k+b*j,Le=a*F+f*V+m*k+x*j,$e=s*F+d*V+y*k+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],P=n[9],R=n[10],O=n[12],N=n[13],_=n[14],v=r*A+s*b+f*x,S=o*A+c*b+d*x,I=a*A+u*b+p*x,M=r*T+s*C+f*E,F=o*T+c*C+d*E,V=a*T+u*C+p*E,k=r*w+s*P+f*R,j=o*w+c*P+d*R,B=a*w+u*P+p*R,G=r*O+s*N+f*_+g,W=o*O+c*N+d*_+m,Q=a*O+u*N+p*_+y;return i[0]=v,i[1]=S,i[2]=I,i[3]=0,i[4]=M,i[5]=F,i[6]=V,i[7]=0,i[8]=k,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,P=o*g+c*m+d*y,R=a*g+u*m+p*y,O=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,I=a*T+u*C+p*E;return i[0]=w,i[1]=P,i[2]=R,i[3]=0,i[4]=O,i[5]=N,i[6]=_,i[7]=0,i[8]=v,i[9]=S,i[10]=I,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,P=p*b,R=g*A,O=d*x,N=m*y,_=d*b,v=g*y,S=d*A,I=p*y,M=T*c+w*u+P*f-(C*c+E*u+R*f),F=C*s+O*u+v*f-(T*s+N*u+_*f),V=E*s+N*c+S*f-(w*s+O*c+I*f),k=R*s+_*c+I*u-(P*s+v*c+S*u),j=C*r+E*o+R*a-(T*r+w*o+P*a),B=T*i+N*o+_*a-(C*i+O*o+v*a),G=w*i+O*r+I*a-(E*i+N*r+S*a),W=P*i+v*r+S*o-(R*i+_*r+I*o);T=o*f,C=a*u,E=r*f,w=a*c,P=r*u,R=o*c,O=i*f,N=a*s,_=i*u,v=o*s,S=i*c,I=r*s;let Q=T*A+w*b+P*x-(C*A+E*b+R*x),q=C*y+O*b+v*x-(T*y+N*b+_*x),J=E*y+N*A+S*x-(w*y+O*A+I*x),Z=R*y+_*A+I*b-(P*y+v*A+S*b),ce=E*g+R*m+C*p-(P*m+T*p+w*g),Ae=_*m+T*d+N*g-(O*g+v*m+C*d),le=O*p+I*m+w*d-(S*m+E*d+N*p),Ce=S*g+P*d+v*p-(_*p+I*g+R*d),ye=i*M+r*F+o*V+a*k;if(Math.abs(ye)<D.EPSILON21){if($.equalsEpsilon(e.getMatrix3(t,bFe),xFe,D.EPSILON7)&&ae.equals(e.getRow(t,3,TFe),CFe))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]=M*ye,n[1]=F*ye,n[2]=V*ye,n[3]=k*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,vFe),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]})`}};lo.packedLength=16;lo.fromArray=lo.unpack;lo.IDENTITY=Object.freeze(new lo(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1));lo.ZERO=Object.freeze(new lo(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0));lo.COLUMN0ROW0=0;lo.COLUMN0ROW1=1;lo.COLUMN0ROW2=2;lo.COLUMN0ROW3=3;lo.COLUMN1ROW0=4;lo.COLUMN1ROW1=5;lo.COLUMN1ROW2=6;lo.COLUMN1ROW3=7;lo.COLUMN2ROW0=8;lo.COLUMN2ROW1=9;lo.COLUMN2ROW2=10;lo.COLUMN2ROW3=11;lo.COLUMN3ROW0=12;lo.COLUMN3ROW1=13;lo.COLUMN3ROW2=14;lo.COLUMN3ROW3=15;var mv=new h,pv=new h,lP=new h,gFe=new h,_Fe=new h,X7=new h,pse=new h,yFe=new h,AFe=new h,bFe=new $,xFe=new $,TFe=new ae,CFe=new ae(0,0,0,1),vFe=new lo,L=lo;function EFe(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 Ar=EFe;function SFe(e,t,n,i,r){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=i,this.ut1MinusUtc=r}var ty=SFe;function wFe(e){return e%4===0&&e%100!==0||e%400===0}var Ch=wFe;var gse=[31,28,31,30,31,30,31,31,30,31,30,31];function IFe(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&&Ch(e)?gse[t-1]+1:gse[t-1];if(n>b)throw new pe("Month and Day represents invalid date")}}var M0=IFe;function PFe(e,t){this.julianDate=e,this.offset=t}var ur=PFe;var _se={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(_se);var zn=_se;var yse={UTC:0,TAI:1};Object.freeze(yse);var ri=yse;var Ase=new M0,K7=[31,28,31,30,31,30,31,31,30,31,30,31],$7=29;function Z7(e,t){return _i.compare(e.julianDate,t.julianDate)}var gv=new ur;function p8(e){gv.julianDate=e;let t=_i.leapSeconds,n=Ar(t,gv,Z7);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let i=t[n].offset;n>0&&_i.secondsDifference(t[n].julianDate,e)>i&&(n--,i=t[n].offset),_i.addSeconds(e,i,e)}function bse(e,t){gv.julianDate=e;let n=_i.leapSeconds,i=Ar(n,gv,Z7);if(i<0&&(i=~i),i===0)return _i.addSeconds(e,-n[0].offset,t);if(i>=n.length)return _i.addSeconds(e,-n[i-1].offset,t);let r=_i.secondsDifference(n[i].julianDate,e);if(r===0)return _i.addSeconds(e,-n[i].offset,t);if(!(r<=1))return _i.addSeconds(e,-n[i-1].offset,t)}function ny(e,t,n){let i=t/zn.SECONDS_PER_DAY|0;return e+=i,t-=zn.SECONDS_PER_DAY*i,t<0&&(e--,t+=zn.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function J7(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*zn.SECONDS_PER_HOUR+r*zn.SECONDS_PER_MINUTE+a*zn.SECONDS_PER_MILLISECOND);return f>=43200&&(u-=1),[u,f]}var DFe=/^(\d{4})$/,RFe=/^(\d{4})-(\d{2})$/,OFe=/^(\d{4})-?(\d{3})$/,MFe=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,LFe=/^(\d{4})-?(\d{2})-?(\d{2})$/,Q7=/([Z+\-])?(\d{2})?:?(\d{2})?$/,NFe=/^(\d{2})(\.\d+)?/.source+Q7.source,FFe=/^(\d{2}):?(\d{2})(\.\d+)?/.source+Q7.source,BFe=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+Q7.source;var _i=class e{constructor(t,n,i){this.dayNumber=void 0,this.secondsOfDay=void 0,t=t??0,n=n??0,i=i??ri.UTC;let r=t|0;n=n+(t-r)*zn.SECONDS_PER_DAY,ny(r,n,this),i===ri.UTC&&p8(this)}static fromGregorianDate(t,n){let i=J7(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond);return l(n)?(ny(i[0],i[1],n),p8(n),n):new e(i[0],i[1],ri.UTC)}static fromDate(t,n){let i=J7(t.getUTCFullYear(),t.getUTCMonth()+1,t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds());return l(n)?(ny(i[0],i[1],n),p8(n),n):new e(i[0],i[1],ri.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(LFe),i!==null)r=+i[1],o=+i[2],a=+i[3];else if(i=d.match(RFe),i!==null)r=+i[1],o=+i[2];else if(i=d.match(DFe),i!==null)r=+i[1];else{let x;if(i=d.match(OFe),i!==null)r=+i[1],x=+i[2],m=Ch(r);else if(i=d.match(MFe),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=Ch(r);let y;if(l(p)){i=p.match(BFe),i!==null?(s=+i[1],c=+i[2],u=+i[3],f=+(i[4]||0)*1e3,y=5):(i=p.match(FFe),i!==null?(s=+i[1],c=+i[2],u=+(i[3]||0)*60,y=4):(i=p.match(NFe),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?$7:K7[o-1];a>g;)a-=g,o++,o>12&&(o-=12,r++),g=m&&o===2?$7:K7[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?$7:K7[o-1],a+=g;let b=J7(r,o,a,s,c,u,f);return l(n)?(ny(b[0],b[1],n),p8(n)):n=new e(b[0],b[1],ri.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=bse(t,g8);l(r)||(e.addSeconds(t,-1,g8),r=bse(g8,g8),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/zn.SECONDS_PER_HOUR|0,y=a-m*zn.SECONDS_PER_HOUR,A=y/zn.SECONDS_PER_MINUTE|0;y=y-A*zn.SECONDS_PER_MINUTE;let b=y|0,x=(y-b)/zn.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 M0(g,p,d,m,A,b,x,i)}static toDate(t){let n=e.toGregorianDate(t,Ase),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,Ase),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,ri.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/zn.SECONDS_PER_DAY}static secondsDifference(t,n){return(t.dayNumber-n.dayNumber)*zn.SECONDS_PER_DAY+(t.secondsOfDay-n.secondsOfDay)}static daysDifference(t,n){let i=t.dayNumber-n.dayNumber,r=(t.secondsOfDay-n.secondsOfDay)/zn.SECONDS_PER_DAY;return i+r}static computeTaiMinusUtc(t){gv.julianDate=t;let n=e.leapSeconds,i=Ar(n,gv,Z7);return i<0&&(i=~i,--i,i<0&&(i=0)),n[i].offset}static addSeconds(t,n,i){return ny(t.dayNumber,t.secondsOfDay+n,i)}static addMinutes(t,n,i){let r=t.secondsOfDay+n*zn.SECONDS_PER_MINUTE;return ny(t.dayNumber,r,i)}static addHours(t,n,i){let r=t.secondsOfDay+n*zn.SECONDS_PER_HOUR;return ny(t.dayNumber,r,i)}static addDays(t,n,i){let r=t.dayNumber+n;return ny(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)}},g8=new _i(0,0,ri.TAI);_i.leapSeconds=[new ur(new _i(2441317,43210,ri.TAI),10),new ur(new _i(2441499,43211,ri.TAI),11),new ur(new _i(2441683,43212,ri.TAI),12),new ur(new _i(2442048,43213,ri.TAI),13),new ur(new _i(2442413,43214,ri.TAI),14),new ur(new _i(2442778,43215,ri.TAI),15),new ur(new _i(2443144,43216,ri.TAI),16),new ur(new _i(2443509,43217,ri.TAI),17),new ur(new _i(2443874,43218,ri.TAI),18),new ur(new _i(2444239,43219,ri.TAI),19),new ur(new _i(2444786,43220,ri.TAI),20),new ur(new _i(2445151,43221,ri.TAI),21),new ur(new _i(2445516,43222,ri.TAI),22),new ur(new _i(2446247,43223,ri.TAI),23),new ur(new _i(2447161,43224,ri.TAI),24),new ur(new _i(2447892,43225,ri.TAI),25),new ur(new _i(2448257,43226,ri.TAI),26),new ur(new _i(2448804,43227,ri.TAI),27),new ur(new _i(2449169,43228,ri.TAI),28),new ur(new _i(2449534,43229,ri.TAI),29),new ur(new _i(2450083,43230,ri.TAI),30),new ur(new _i(2450630,43231,ri.TAI),31),new ur(new _i(2451179,43232,ri.TAI),32),new ur(new _i(2453736,43233,ri.TAI),33),new ur(new _i(2454832,43234,ri.TAI),34),new ur(new _i(2456109,43235,ri.TAI),35),new ur(new _i(2457204,43236,ri.TAI),36),new ur(new _i(2457754,43237,ri.TAI),37)];var K=_i;var Vse=Go(af(),1);function kFe(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var uP=kFe;function wse(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=wse(r,t)),n[i]=r}return n}var Ye=wse;function Ise(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]=Ise(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=Ise;function zFe(){let e,t,n=new Promise(function(i,r){e=i,t=r});return{resolve:e,reject:t,promise:n}}var _u=zFe;var Pse=Go(af(),1);function eW(e,t){let n;return typeof document<"u"&&(n=document),eW._implementation(e,t,n)}eW._implementation=function(e,t,n){if(!l(t)){if(typeof n>"u")return e;t=n.baseURI??n.location.href}let i=new Pse.default(e);return i.scheme()!==""?i.toString():i.absoluteTo(t).toString()};var dd=eW;var Dse=Go(af(),1);function UFe(e,t){let n="",i=e.lastIndexOf("/");return i!==-1&&(n=e.substring(0,i+1)),t&&(e=new Dse.default(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}var fP=UFe;var Rse=Go(af(),1);function VFe(e){let t=new Rse.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 L0=VFe;var Ose={};function jFe(e,t,n){l(t)||(t=e.width),l(n)||(n=e.height);let i=Ose[t];l(i)||(i={},Ose[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 vh=jFe;var HFe=/^blob:/i;function GFe(e){return HFe.test(e)}var xb=GFe;var cp;function WFe(e){l(cp)||(cp=document.createElement("a")),cp.href=window.location.href;let t=cp.host,n=cp.protocol;return cp.href=e,cp.href=cp.href,n!==cp.protocol||t!==cp.host}var iy=WFe;var qFe=/^data:/i;function YFe(e){return qFe.test(e)}var Eh=YFe;function XFe(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 Tb=XFe;function KFe(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 Cb=KFe;function $Fe(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 sf=$Fe;var Mse={UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5};Object.freeze(Mse);var yi=Mse;var Lse={TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3};Object.freeze(Lse);var Ha=Lse;function b8(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??Ha.OTHER,this.serverKey=e.serverKey,this.state=yi.UNISSUED,this.deferred=void 0,this.cancelled=!1}b8.prototype.cancel=function(){this.cancelled=!0};b8.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=yi.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new b8(this)};var bo=b8;function JFe(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 dP=JFe;function Nse(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=dP(this.responseHeaders))}Nse.prototype.toString=function(){let e="Request has failed.";return l(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var lp=Nse;var x8=Go(af(),1);function hP(){this._listeners=new Map,this._toRemove=new Map,this._toAdd=new Map,this._invokingListeners=!1,this._listenerCount=0}Object.defineProperties(hP.prototype,{numberOfListeners:{get:function(){return this._listenerCount}}});hP.prototype.addEventListener=function(e,t){let n=this,i=n._invokingListeners?n._toAdd:n._listeners;return nW(this,i,e,t)&&n._listenerCount++,function(){n.removeEventListener(e,t)}};function nW(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)}hP.prototype.removeEventListener=function(e,t){let n=tW(this,this._listeners,e,t),i=tW(this,this._toAdd,e,t),r=n||i;return r&&this._listenerCount--,r};function tW(e,t,n,i){let r=t.get(n);if(!r||!r.has(i))return!1;if(e._invokingListeners){if(!nW(e,e._toRemove,n,i))return!1}else r.delete(i),r.size===0&&t.delete(n);return!0}hP.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)nW(this,this._listeners,e,n);this._toAdd.clear();for(let[e,t]of this._toRemove.entries())for(let n of t)tW(this,this._listeners,e,n);this._toRemove.clear()};var be=hP;function vb(e){this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(vb.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 iW(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}vb.prototype.reserve=function(e){e=e??this._length,this._array.length=e};vb.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?(iW(i,r,e),e=r):o=!1}};vb.prototype.resort=function(){let e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)};vb.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)iW(t,r,a),r=a;else break}let o;return l(i)&&this._length>i&&(o=t[i],this._length=i),o};vb.prototype.pop=function(e){if(e=e??0,this._length===0)return;let t=this._array,n=t[e];return iW(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};var mP=vb;function ZFe(e,t){return e.priority-t.priority}var br={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},Av=20,Vc=new mP({comparator:ZFe});Vc.maximumLength=Av;Vc.reserve(Av);var up=[],N0={},QFe=typeof document<"u"?new x8.default(document.location.href):new x8.default,T8=new be;function xo(){}xo.maximumRequests=50;xo.maximumRequestsPerServer=18;xo.requestsByServer={};xo.throttleRequests=!0;xo.debugShowStatistics=!1;xo.requestCompletedEvent=T8;Object.defineProperties(xo,{statistics:{get:function(){return br}},priorityHeapLength:{get:function(){return Av},set:function(e){if(e<Av)for(;Vc.length>e;){let t=Vc.pop();Eb(t)}Av=e,Vc.maximumLength=e,Vc.reserve(e)}}});function Fse(e){l(e.priorityFunction)&&(e.priority=e.priorityFunction())}xo.serverHasOpenSlots=function(e,t){t=t??1;let n=xo.requestsByServer[e]??xo.maximumRequestsPerServer;return N0[e]+t<=n};xo.heapHasOpenSlots=function(e){return Vc.length+e<=Av};function Bse(e){return e.state===yi.UNISSUED&&(e.state=yi.ISSUED,e.deferred=_u()),e.deferred.promise}function eBe(e){return function(t){if(e.state===yi.CANCELLED)return;let n=e.deferred;--br.numberOfActiveRequests,--N0[e.serverKey],T8.raiseEvent(),e.state=yi.RECEIVED,e.deferred=void 0,n.resolve(t)}}function tBe(e){return function(t){e.state!==yi.CANCELLED&&(++br.numberOfFailedRequests,--br.numberOfActiveRequests,--N0[e.serverKey],T8.raiseEvent(t),e.state=yi.FAILED,e.deferred.reject(t))}}function kse(e){let t=Bse(e);return e.state=yi.ACTIVE,up.push(e),++br.numberOfActiveRequests,++br.numberOfActiveRequestsEver,++N0[e.serverKey],e.requestFunction().then(eBe(e)).catch(tBe(e)),t}function Eb(e){let t=e.state===yi.ACTIVE;if(e.state=yi.CANCELLED,++br.numberOfCancelledRequests,l(e.deferred)){let n=e.deferred;n.promise.catch(()=>{}),e.deferred=void 0,n.reject(new oe(`Request cancelled: "${e.url}"`))}t&&(--br.numberOfActiveRequests,--N0[e.serverKey],++br.numberOfCancelledActiveRequests),l(e.cancelFunction)&&e.cancelFunction()}xo.update=function(){let e,t,n=0,i=up.length;for(e=0;e<i;++e){if(t=up[e],t.cancelled&&Eb(t),t.state!==yi.ACTIVE){++n;continue}n>0&&(up[e-n]=t)}up.length-=n;let r=Vc.internalArray,o=Vc.length;for(e=0;e<o;++e)Fse(r[e]);Vc.resort();let a=Math.max(xo.maximumRequests-up.length,0),s=0;for(;s<a&&Vc.length>0;){if(t=Vc.pop(),t.cancelled){Eb(t);continue}if(t.throttleByServer&&!xo.serverHasOpenSlots(t.serverKey)){Eb(t);continue}kse(t),++s}nBe()};xo.getServerKey=function(e){let t=new x8.default(e);t.scheme()===""&&(t=t.absoluteTo(QFe),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);let i=N0[n];return l(i)||(N0[n]=0),n};xo.request=function(e){if(Eh(e.url)||xb(e.url))return T8.raiseEvent(),e.state=yi.RECEIVED,e.requestFunction();if(++br.numberOfAttemptedRequests,l(e.serverKey)||(e.serverKey=xo.getServerKey(e.url)),xo.throttleRequests&&e.throttleByServer&&!xo.serverHasOpenSlots(e.serverKey))return;if(!xo.throttleRequests||!e.throttle)return kse(e);if(up.length>=xo.maximumRequests)return;Fse(e);let t=Vc.insert(e);if(l(t)){if(t===e)return;Eb(t)}return Bse(e)};function nBe(){xo.debugShowStatistics&&(br.numberOfActiveRequests===0&&br.lastNumberOfActiveRequests>0&&(br.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${br.numberOfAttemptedRequests}`),br.numberOfAttemptedRequests=0),br.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${br.numberOfCancelledRequests}`),br.numberOfCancelledRequests=0),br.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${br.numberOfCancelledActiveRequests}`),br.numberOfCancelledActiveRequests=0),br.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${br.numberOfFailedRequests}`),br.numberOfFailedRequests=0)),br.lastNumberOfActiveRequests=br.numberOfActiveRequests)}xo.clearForSpecs=function(){for(;Vc.length>0;){let t=Vc.pop();Eb(t)}let e=up.length;for(let t=0;t<e;++t)Eb(up[t]);up.length=0,N0={},br.numberOfAttemptedRequests=0,br.numberOfActiveRequests=0,br.numberOfCancelledRequests=0,br.numberOfCancelledActiveRequests=0,br.numberOfFailedRequests=0,br.numberOfActiveRequestsEver=0,br.lastNumberOfActiveRequests=0};xo.numberOfActiveRequestsByServer=function(e){return N0[e]};xo.requestHeap=Vc;var jc=xo;var zse=Go(af(),1);var pP={},bv={};pP.add=function(e,t){let n=`${e.toLowerCase()}:${t}`;l(bv[n])||(bv[n]=!0)};pP.remove=function(e,t){let n=`${e.toLowerCase()}:${t}`;l(bv[n])&&delete bv[n]};function iBe(e){let t=new zse.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}}pP.contains=function(e){let t=iBe(e);return!!(l(t)&&l(bv[t]))};pP.clear=function(){bv={}};var xv=pP;var jse=(function(){try{let e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob",e.responseType==="blob"}catch{return!1}})();function Ut(e){e=e??H.EMPTY_OBJECT,typeof e=="string"&&(e={url:e}),this._url=void 0,this._templateValues=fp(e.templateValues,{}),this._queryParameters=fp(e.queryParameters,{}),this.headers=fp(e.headers,{}),this.request=e.request??new bo,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 fp(e,t){return l(e)?Ye(e):t}Ut.createIfNeeded=function(e){return e instanceof Ut?e.getDerivedResource({request:e.request}):typeof e!="string"?e:new Ut({url:e})};var Tv;Ut.supportsImageBitmapOptions=function(){return l(Tv)?Tv:typeof createImageBitmap!="function"?(Tv=Promise.resolve(!1),Tv):(Tv=Ut.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=vh(t[0]),i=vh(t[1]);return n[1]!==i[1]}).catch(function(){return!1}),Tv)};Object.defineProperties(Ut,{isBlobSupported:{get:function(){return jse}}});Object.defineProperties(Ut.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 L0(this._url)}},isDataUri:{get:function(){return Eh(this._url)}},isBlobUri:{get:function(){return xb(this._url)}},isCrossOriginUrl:{get:function(){return iy(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}});Ut.prototype.toString=function(){return this.getUrlComponent(!0,!0)};Ut.prototype.parseUrl=function(e,t,n,i){let r=new Vse.default(e),o=rBe(r.query());this._queryParameters=t?v8(o,this.queryParameters,n):o,r.search(""),r.fragment(""),l(i)&&r.scheme()===""&&(r=r.absoluteTo(dd(i))),this._url=r.toString()};function rBe(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:sf(e)}function v8(e,t,n){if(!n)return Ot(e,t);let i=Ye(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}Ut.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${oBe(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 oBe(e){let t=Object.keys(e);return t.length===0?"":t.length===1&&!l(e[t[0]])?`?${t[0]}`:`?${Cb(e)}`}Ut.prototype.setQueryParameters=function(e,t){t?this._queryParameters=v8(this._queryParameters,e,!1):this._queryParameters=v8(e,this._queryParameters,!1)};Ut.prototype.appendQueryParameters=function(e){this._queryParameters=v8(e,this._queryParameters,!0)};Ut.prototype.setTemplateValues=function(e,t){t?this._templateValues=Ot(this._templateValues,e):this._templateValues=Ot(e,this._templateValues)};Ut.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};Ut.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})};Ut.prototype.clone=function(e){return l(e)?(e._url=this._url,e._queryParameters=Ye(this._queryParameters),e._templateValues=Ye(this._templateValues),e.headers=Ye(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new Ut({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})};Ut.prototype.getBaseUri=function(e){return fP(this.getUrlComponent(e),e)};Ut.prototype.appendForwardSlash=function(){this._url=uP(this._url)};Ut.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};Ut.fetchArrayBuffer=function(e){return new Ut(e).fetchArrayBuffer()};Ut.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};Ut.fetchBlob=function(e){return new Ut(e).fetchBlob()};Ut.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(rW(this.request),!jse||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 Ut.supportsImageBitmapOptions().then(function(f){return a=f,s=a&&t,o}).then(function(f){if(!l(f))return;if(u=f,s)return Ut.createImageBitmapFromBlob(f,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:r});let d=window.URL.createObjectURL(f);return c=new Ut({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)})};Ut.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=_u();return Ut._Implementations.createImage(o,s,c,n,i,r),c.promise};let a=jc.request(o);if(l(a))return a.catch(function(s){return o.state!==yi.FAILED?Promise.reject(s):t.retryOnError(s).then(function(c){return c?(o.state=yi.UNISSUED,o.deferred=void 0,t._fetchImage({flipY:n,skipColorSpaceConversion:i,preferImageBitmap:r})):Promise.reject(s)})})};Ut.fetchImage=function(e){return new Ut(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})};Ut.prototype.fetchText=function(){return this.fetch({responseType:"text"})};Ut.fetchText=function(e){return new Ut(e).fetchText()};Ut.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)})};Ut.fetchJson=function(e){return new Ut(e).fetchJson()};Ut.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};Ut.fetchXML=function(e){return new Ut(e).fetchXML()};Ut.prototype.fetchJsonp=function(e){e=e??"callback",rW(this.request);let t;do t=`loadJsonp${D.nextRandomNumber().toString().substring(2,8)}`;while(l(window[t]));return Hse(this,e,t)};function Hse(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=_u();return window[n]=function(c){s.resolve(c);try{delete window[n]}catch{window[n]=void 0}},Ut._Implementations.loadAndExecuteScript(o,n,s),s.promise};let a=jc.request(r);if(l(a))return a.catch(function(s){return r.state!==yi.FAILED?Promise.reject(s):e.retryOnError(s).then(function(c){return c?(r.state=yi.UNISSUED,r.deferred=void 0,Hse(e,t,n)):Promise.reject(s)})})}Ut.fetchJsonp=function(e){return new Ut(e).fetchJsonp(e.callbackParameterName)};Ut.prototype._makeRequest=function(e){let t=this;rW(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=_u(),d=Ut._Implementations.loadWithXhr(i,o,c,u,a,f,s);return l(d)&&l(d.abort)&&(n.cancelFunction=function(){d.abort()}),f.promise};let r=jc.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!==yi.FAILED?Promise.reject(o):t.retryOnError(o).then(function(a){return a?(n.state=yi.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(o)})})};function rW(e){if(e.state===yi.ISSUED||e.state===yi.ACTIVE)throw new oe("The Resource is already being fetched.");e.state=yi.UNISSUED,e.deferred=void 0}var aBe=/^data:(.*?)(;base64)?,(.*)$/;function C8(e,t){let n=decodeURIComponent(t);return e?atob(n):n}function Use(e,t){let n=C8(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 sBe(e,t){t=t??"";let n=e[1],i=!!e[2],r=e[3],o,a;switch(t){case"":case"text":return C8(i,r);case"arraybuffer":return Use(i,r);case"blob":return o=Use(i,r),new Blob([o],{type:n});case"document":return a=new DOMParser,a.parseFromString(C8(i,r),n);case"json":return JSON.parse(C8(i,r));default:}}Ut.prototype.fetch=function(e){return e=fp(e,{}),e.method="GET",this._makeRequest(e)};Ut.fetch=function(e){return new Ut(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Ut.prototype.delete=function(e){return e=fp(e,{}),e.method="DELETE",this._makeRequest(e)};Ut.delete=function(e){return new Ut(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})};Ut.prototype.head=function(e){return e=fp(e,{}),e.method="HEAD",this._makeRequest(e)};Ut.head=function(e){return new Ut(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Ut.prototype.options=function(e){return e=fp(e,{}),e.method="OPTIONS",this._makeRequest(e)};Ut.options=function(e){return new Ut(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Ut.prototype.post=function(e,t){return Ur.defined("data",e),t=fp(t,{}),t.method="POST",t.data=e,this._makeRequest(t)};Ut.post=function(e){return new Ut(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Ut.prototype.put=function(e,t){return Ur.defined("data",e),t=fp(t,{}),t.method="PUT",t.data=e,this._makeRequest(t)};Ut.put=function(e){return new Ut(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Ut.prototype.patch=function(e,t){return Ur.defined("data",e),t=fp(t,{}),t.method="PATCH",t.data=e,this._makeRequest(t)};Ut.patch=function(e){return new Ut(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Ut._Implementations={};Ut._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&&(xv.contains(e)?i.crossOrigin="use-credentials":i.crossOrigin=""),i.src=e};Ut._Implementations.createImage=function(e,t,n,i,r,o,a){let s=e.url;Ut.supportsImageBitmapOptions().then(function(c){if(!(c&&o)){Ut._Implementations.loadImageElement(s,t,n);return}let u="blob",f="GET",d=_u(),p=Ut._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 Ut.createImageBitmapFromBlob(g,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:r})}).then(function(g){n.resolve(g)})}).catch(function(c){n.reject(c)})};Ut.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 cBe(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 lp(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 lp)})}var lBe=typeof XMLHttpRequest>"u";Ut._Implementations.loadWithXhr=function(e,t,n,i,r,o,a){let s=aBe.exec(e);if(s!==null){o.resolve(sBe(s,t));return}if(lBe){cBe(e,t,n,i,r,o,a);return}let c=new XMLHttpRequest;if(xv.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 lp(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 lp)},c.send(i),c};Ut._Implementations.loadAndExecuteScript=function(e,t,n){return Tb(e,t).catch(function(i){n.reject(i)})};Ut._DefaultImplementations={};Ut._DefaultImplementations.createImage=Ut._Implementations.createImage;Ut._DefaultImplementations.loadWithXhr=Ut._Implementations.loadWithXhr;Ut._DefaultImplementations.loadAndExecuteScript=Ut._Implementations.loadAndExecuteScript;Ut.DEFAULT=Object.freeze(new Ut({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var De=Ut;function _P(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)?Gse(this,e.data):Gse(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}_P.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 _P({addNewLeapSeconds:t.addNewLeapSeconds,data:i})};_P.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 ty(0,0,0,0,0),t}});_P.prototype.compute=function(e,t){if(!l(this._samples))return;if(l(t)||(t=new ty(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,qse(this,n,this._samples,e,r,o,t),t}let a=Ar(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,qse(this,n,this._samples,e,r,o,t),t};function uBe(e,t){return K.compare(e.julianDate,t)}function Gse(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+zn.MODIFIED_JULIAN_DATE_DIFFERENCE,x=new K(b,A,ri.TAI);if(f.push(x),p){if(A!==d&&l(d)){let T=K.leapSeconds,C=Ar(T,x,uBe);if(C<0){let E=new ur(x,A);T.splice(~C,0,E)}}d=A}}}function Wse(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 gP(e,t,n){return t+e*(n-t)}function qse(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 Wse(e,n,r,s,a),a;if(i.equals(u))return Wse(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=gP(f,n[d+e._xPoleWanderRadiansColumn],n[p+e._xPoleWanderRadiansColumn]),a.yPoleWander=gP(f,n[d+e._yPoleWanderRadiansColumn],n[p+e._yPoleWanderRadiansColumn]),a.xPoleOffset=gP(f,n[d+e._xCelestialPoleOffsetRadiansColumn],n[p+e._xCelestialPoleOffsetRadiansColumn]),a.yPoleOffset=gP(f,n[d+e._yCelestialPoleOffsetRadiansColumn],n[p+e._yCelestialPoleOffsetRadiansColumn]),a.ut1MinusUtc=gP(f,g,m),a}var yP=_P;function Hc(e,t,n){this.heading=e??0,this.pitch=t??0,this.roll=n??0}Hc.fromQuaternion=function(e,t){l(t)||(t=new Hc);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=-D.asinClamped(n),t};Hc.fromDegrees=function(e,t,n,i){return l(i)||(i=new Hc),i.heading=e*D.RADIANS_PER_DEGREE,i.pitch=t*D.RADIANS_PER_DEGREE,i.roll=n*D.RADIANS_PER_DEGREE,i};Hc.clone=function(e,t){if(l(e))return l(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new Hc(e.heading,e.pitch,e.roll)};Hc.equals=function(e,t){return e===t||l(e)&&l(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll};Hc.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&D.equalsEpsilon(e.heading,t.heading,n,i)&&D.equalsEpsilon(e.pitch,t.pitch,n,i)&&D.equalsEpsilon(e.roll,t.roll,n,i)};Hc.prototype.clone=function(e){return Hc.clone(this,e)};Hc.prototype.equals=function(e){return Hc.equals(this,e)};Hc.prototype.equalsEpsilon=function(e,t,n){return Hc.equalsEpsilon(this,e,t,n)};Hc.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var Tc=Hc;var Yse={},Xse=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function fBe(){let e=document.getElementsByTagName("script");for(let t=0,n=e.length;t<n;++t){let i=e[t].getAttribute("src"),r=Xse.exec(i);if(r!==null)return r[1]}}var E8;function Kse(e){return typeof document>"u"?e:(l(E8)||(E8=document.createElement("a")),E8.href=e,E8.href)}var Sb;function $se(){if(l(Sb))return Sb;let e;return typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:l(Yse?.url)?e=dd(".",Yse.url):typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(require.toUrl)?e=dd("..",wb("Core/buildModuleUrl.js")):e=fBe(),Sb=new De({url:Kse(e)}),Sb.appendForwardSlash(),Sb}function dBe(e){return Kse(require.toUrl(`../${e}`))}function Jse(e){return $se().getDerivedResource({url:e}).url}var S8;function wb(e){return l(S8)||(typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(require.toUrl)?S8=dBe:S8=Jse),S8(e)}wb._cesiumScriptRegex=Xse;wb._buildModuleUrlFromBaseUrl=Jse;wb._clearBaseResource=function(){Sb=void 0};wb.setBaseUrl=function(e){Sb=De.DEFAULT.getDerivedResource({url:e})};wb.getCesiumBaseUrl=$se;var $t=wb;function hBe(e,t,n){this.x=e,this.y=t,this.s=n}var Ib=hBe;function w8(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,ri.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 mBe=new K(0,0,ri.TAI);function oW(e,t,n){let i=mBe;return i.dayNumber=t,i.secondsOfDay=n,K.daysDifference(i,e._sampleZeroDateTT)}w8.prototype.preload=function(e,t,n,i){let r=oW(this,e,t),o=oW(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(aW(this,d));return Promise.all(f)};w8.prototype.computeXysRadians=function(e,t,n){let i=oW(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])||(aW(this,a/this._samplesPerXysFile|0),c=!0),l(u[s*3])||(aW(this,s/this._samplesPerXysFile|0),c=!0),c)return;l(n)?(n.x=0,n.y=0,n.s=0):n=new Ib(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};w8.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 pBe(e,t,n){try{let i=await e.fetchJson();n._updateChunkData(t,i)}catch{}}function aW(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=pBe(n,t,e);return e._chunkDownloadsInProgress[t]=r,r}var AP=w8;var ry,aa={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},yu={};Object.defineProperties(yu,{element:{get:function(){if(yu.supportsFullscreen())return document[aa.fullscreenElement]}},changeEventName:{get:function(){if(yu.supportsFullscreen())return aa.fullscreenchange}},errorEventName:{get:function(){if(yu.supportsFullscreen())return aa.fullscreenerror}},enabled:{get:function(){if(yu.supportsFullscreen())return document[aa.fullscreenEnabled]}},fullscreen:{get:function(){if(yu.supportsFullscreen())return yu.element!==null}}});yu.supportsFullscreen=function(){if(l(ry))return ry;ry=!1;let e=document.body;if(typeof e.requestFullscreen=="function")return aa.requestFullscreen="requestFullscreen",aa.exitFullscreen="exitFullscreen",aa.fullscreenEnabled="fullscreenEnabled",aa.fullscreenElement="fullscreenElement",aa.fullscreenchange="fullscreenchange",aa.fullscreenerror="fullscreenerror",ry=!0,ry;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"?(aa.requestFullscreen=n,ry=!0):(n=`${o}RequestFullScreen`,typeof e[n]=="function"&&(aa.requestFullscreen=n,ry=!0)),n=`${o}ExitFullscreen`,typeof document[n]=="function"?aa.exitFullscreen=n:(n=`${o}CancelFullScreen`,typeof document[n]=="function"&&(aa.exitFullscreen=n)),n=`${o}FullscreenEnabled`,document[n]!==void 0?aa.fullscreenEnabled=n:(n=`${o}FullScreenEnabled`,document[n]!==void 0&&(aa.fullscreenEnabled=n)),n=`${o}FullscreenElement`,document[n]!==void 0?aa.fullscreenElement=n:(n=`${o}FullScreenElement`,document[n]!==void 0&&(aa.fullscreenElement=n)),n=`${o}fullscreenchange`,document[`on${n}`]!==void 0&&(o==="ms"&&(n="MSFullscreenChange"),aa.fullscreenchange=n),n=`${o}fullscreenerror`,document[`on${n}`]!==void 0&&(o==="ms"&&(n="MSFullscreenError"),aa.fullscreenerror=n)}return ry};yu.requestFullscreen=function(e,t){yu.supportsFullscreen()&&e[aa.requestFullscreen]({vrDisplay:t})};yu.exitFullscreen=function(){yu.supportsFullscreen()&&document[aa.exitFullscreen]()};yu._names=aa;var qo=yu;var hd;typeof navigator<"u"?hd=navigator:hd={};function bP(e){let t=e.split(".");for(let n=0,i=t.length;n<i;++n)t[n]=parseInt(t[n],10);return t}var I8,Zse;function fW(){if(!l(I8)&&(I8=!1,!L8())){let e=/ Chrome\/([\.0-9]+)/.exec(hd.userAgent);e!==null&&(I8=!0,Zse=bP(e[1]))}return I8}function gBe(){return fW()&&Zse}var P8,Qse;function ece(){if(!l(P8)&&(P8=!1,!fW()&&!L8()&&/ Safari\/[\.0-9]+/.test(hd.userAgent))){let e=/ Version\/([\.0-9]+)/.exec(hd.userAgent);e!==null&&(P8=!0,Qse=bP(e[1]))}return P8}function _Be(){return ece()&&Qse}var D8,uW;function tce(){if(!l(D8)){D8=!1;let e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(hd.userAgent);e!==null&&(D8=!0,uW=bP(e[1]),uW.isNightly=!!e[2])}return D8}function yBe(){return tce()&&uW}var R8,nce;function L8(){if(!l(R8)){R8=!1;let e=/ Edg\/([\.0-9]+)/.exec(hd.userAgent);e!==null&&(R8=!0,nce=bP(e[1]))}return R8}function ABe(){return L8()&&nce}var O8,dW;function N8(){if(!l(O8)){O8=!1;let e=/Firefox\/([\.0-9]+)/.exec(hd.userAgent);e!==null&&(O8=!0,dW=bP(e[1]))}return O8}var sW;function bBe(){return l(sW)||(sW=/Windows/i.test(hd.appVersion)),sW}var cW;function xBe(){return l(cW)||(cW=navigator.platform==="iPhone"||navigator.platform==="iPod"||navigator.platform==="iPad"),cW}function TBe(){return N8()&&dW}var lW;function CBe(){return l(lW)||(lW=!N8()&&typeof PointerEvent<"u"&&(!l(hd.pointerEnabled)||hd.pointerEnabled)),lW}var ice,M8;function rce(){if(!l(M8)){let e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");let t=e.style.imageRendering;M8=l(t)&&t!=="",M8&&(ice=t)}return M8}function vBe(){return rce()?ice:void 0}function wl(){return wl._result}wl._promise=void 0;wl._result=void 0;wl.initialize=function(){return l(wl._promise)||(wl._promise=new Promise(e=>{let t=new Image;t.onload=function(){wl._result=t.width>0&&t.height>0,e(wl._result)},t.onerror=function(){wl._result=!1,e(wl._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),wl._promise};Object.defineProperties(wl,{initialized:{get:function(){return l(wl._result)}}});var Cv=[];typeof ArrayBuffer<"u"&&(Cv.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&Cv.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&Cv.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&Cv.push(BigInt64Array),typeof BigUint64Array<"u"&&Cv.push(BigUint64Array));var md={isChrome:fW,chromeVersion:gBe,isSafari:ece,safariVersion:_Be,isWebkit:tce,webkitVersion:yBe,isEdge:L8,edgeVersion:ABe,isFirefox:N8,firefoxVersion:TBe,isWindows:bBe,isIPadOrIOS:xBe,hardwareConcurrency:hd.hardwareConcurrency??3,supportsPointerEvents:CBe,supportsImageRenderingPixelated:rce,supportsWebP:wl,imageRenderingValue:vBe,typedArrayTypes:Cv};md.supportsBasis=function(e){return md.supportsWebAssembly()&&e.context.supportsBasis};md.supportsFullscreen=function(){return qo.supportsFullscreen()};md.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"};md.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"};md.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"};md.supportsBigInt=function(){return typeof BigInt<"u"};md.supportsWebWorkers=function(){return typeof Worker<"u"};md.supportsWebAssembly=function(){return typeof WebAssembly<"u"};md.supportsWebgl2=function(e){return e.context.webgl2};md.supportsEsmWebWorkers=function(){return!N8()||parseInt(dW)>=114};var fn=md;function st(e,t,n,i){this.x=e??0,this.y=t??0,this.z=n??0,this.w=i??0}var xP=new h;st.fromAxisAngle=function(e,t,n){let i=t/2,r=Math.sin(i);xP=h.normalize(e,xP);let o=xP.x*r,a=xP.y*r,s=xP.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 EBe=[1,2,0],SBe=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=EBe,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=SBe;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 oce=new st,ace=new st,hW=new st,sce=new st;st.fromHeadingPitchRoll=function(e,t){return sce=st.fromAxisAngle(h.UNIT_X,e.roll,oce),hW=st.fromAxisAngle(h.UNIT_Y,-e.pitch,t),t=st.multiply(hW,sce,hW),ace=st.fromAxisAngle(h.UNIT_Z,-e.heading,oce),st.multiply(ace,t,t)};var F8=new h,mW=new h,Sh=new st,cce=new st,B8=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,B8),st.conjugate(B8,B8);for(let r=0,o=n-t+1;r<o;r++){let a=r*3;st.unpack(e,(t+r)*4,Sh),st.multiply(Sh,B8,Sh),Sh.w<0&&st.negate(Sh,Sh),st.computeAxis(Sh,F8);let s=st.computeAngle(Sh);l(i)||(i=[]),i[a]=F8.x*s,i[a+1]=F8.y*s,i[a+2]=F8.z*s}};st.unpackInterpolationResult=function(e,t,n,i,r){l(r)||(r=new st),h.fromArray(e,0,mW);let o=h.magnitude(mW);return st.unpack(t,i*4,cce),o===0?st.clone(st.IDENTITY,Sh):st.fromAxisAngle(mW,o,Sh),st.multiply(Sh,cce,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)<D.EPSILON6||Math.abs(n+1)<D.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)<D.EPSILON6?0:2*Math.acos(e.w)};var pW=new st;st.lerp=function(e,t,n,i){return pW=st.multiplyByScalar(t,n,pW),i=st.multiplyByScalar(e,1-n,i),st.add(pW,i,i)};var lce=new st,gW=new st,_W=new st;st.slerp=function(e,t,n,i){let r=st.dot(e,t),o=t;if(r<0&&(r=-r,o=lce=st.negate(t,lce)),1-r<D.EPSILON6)return st.lerp(e,o,n,i);let a=Math.acos(r);return gW=st.multiplyByScalar(e,Math.sin((1-n)*a),gW),_W=st.multiplyByScalar(o,Math.sin(n*a),_W),i=st.add(gW,_W,i),st.multiplyByScalar(i,1/Math.sin(a),i)};st.log=function(e,t){let n=D.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 wBe=new h,IBe=new h,TP=new st,vv=new st;st.computeInnerQuadrangle=function(e,t,n,i){let r=st.conjugate(t,TP);st.multiply(r,n,vv);let o=st.log(vv,wBe);st.multiply(r,e,vv);let a=st.log(vv,IBe);return h.add(o,a,o),h.multiplyByScalar(o,.25,o),h.negate(o,o),st.exp(o,TP),st.multiply(t,TP,i)};st.squad=function(e,t,n,i,r,o){let a=st.slerp(e,t,r,TP),s=st.slerp(n,i,r,vv);return st.slerp(a,s,2*r*(1-r),o)};var PBe=new st,uce=1.9011074535173003,k8=fn.supportsTypedArrays()?new Float32Array(8):[],z8=fn.supportsTypedArrays()?new Float32Array(8):[],F0=fn.supportsTypedArrays()?new Float32Array(8):[],B0=fn.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){let t=e+1,n=2*t+1;k8[e]=1/(t*n),z8[e]=t/n}k8[7]=uce/136;z8[7]=uce*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]=(k8[g]*c-z8[g])*a,B0[g]=(k8[g]*u-z8[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+B0[0]*(1+B0[1]*(1+B0[2]*(1+B0[3]*(1+B0[4]*(1+B0[5]*(1+B0[6]*(1+B0[7])))))))),p=st.multiplyByScalar(e,d,PBe);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,TP),s=st.fastSlerp(n,i,r,vv);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 Ai={},yW={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"}},Ev={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},AW={},Au={east:new h,north:new h,up:new h,west:new h,south:new h,down:new h},oy=new h,ay=new h,sy=new h;Ai.localFrameToFixedFrameGenerator=function(e,t){if(!yW.hasOwnProperty(e)||!yW[e].hasOwnProperty(t))throw new pe("firstAxis and secondAxis must be east, north, up, west, south or down.");let n=yW[e][t],i,r=e+t;return l(AW[r])?i=AW[r]:(i=function(o,a,s){if(l(s)||(s=new L),h.equalsEpsilon(o,h.ZERO,D.EPSILON14))h.unpack(Ev[e],0,oy),h.unpack(Ev[t],0,ay),h.unpack(Ev[n],0,sy);else if(D.equalsEpsilon(o.x,0,D.EPSILON14)&&D.equalsEpsilon(o.y,0,D.EPSILON14)){let c=D.sign(o.z);h.unpack(Ev[e],0,oy),e!=="east"&&e!=="west"&&h.multiplyByScalar(oy,c,oy),h.unpack(Ev[t],0,ay),t!=="east"&&t!=="west"&&h.multiplyByScalar(ay,c,ay),h.unpack(Ev[n],0,sy),n!=="east"&&n!=="west"&&h.multiplyByScalar(sy,c,sy)}else{a=a??te.default,a.geodeticSurfaceNormal(o,Au.up);let c=Au.up,u=Au.east;u.x=-o.y,u.y=o.x,u.z=0,h.normalize(u,Au.east),h.cross(c,u,Au.north),h.multiplyByScalar(Au.up,-1,Au.down),h.multiplyByScalar(Au.east,-1,Au.west),h.multiplyByScalar(Au.north,-1,Au.south),oy=Au[e],ay=Au[t],sy=Au[n]}return s[0]=oy.x,s[1]=oy.y,s[2]=oy.z,s[3]=0,s[4]=ay.x,s[5]=ay.y,s[6]=ay.z,s[7]=0,s[8]=sy.x,s[9]=sy.y,s[10]=sy.z,s[11]=0,s[12]=o.x,s[13]=o.y,s[14]=o.z,s[15]=1,s},AW[r]=i),i};Ai.eastNorthUpToFixedFrame=Ai.localFrameToFixedFrameGenerator("east","north");Ai.northEastDownToFixedFrame=Ai.localFrameToFixedFrameGenerator("north","east");Ai.northUpEastToFixedFrame=Ai.localFrameToFixedFrameGenerator("north","up");Ai.northWestUpToFixedFrame=Ai.localFrameToFixedFrameGenerator("north","west");var DBe=new Fe,RBe=new h(1,1,1),OBe=new L;Ai.headingPitchRollToFixedFrame=function(e,t,n,i,r){i=i??Ai.eastNorthUpToFixedFrame;let o=Fe.fromHeadingPitchRoll(t,DBe),a=L.fromTranslationQuaternionRotationScale(h.ZERO,o,RBe,OBe);return r=i(e,n,r),L.multiply(r,a,r)};var MBe=new L,LBe=new $;Ai.headingPitchRollQuaternion=function(e,t,n,i,r){let o=Ai.headingPitchRollToFixedFrame(e,t,n,i,MBe),a=L.getMatrix3(o,LBe);return Fe.fromRotationMatrix(a,r)};var NBe=new h(1,1,1),FBe=new h,fce=new L,BBe=new L,kBe=new $,zBe=new Fe;Ai.fixedFrameToHeadingPitchRoll=function(e,t,n,i){t=t??te.default,n=n??Ai.eastNorthUpToFixedFrame,l(i)||(i=new Tc);let r=L.getTranslation(e,FBe);if(h.equals(r,h.ZERO))return i.heading=0,i.pitch=0,i.roll=0,i;let o=L.inverseTransformation(n(r,t,fce),fce),a=L.setScale(e,NBe,BBe);a=L.setTranslation(a,h.ZERO,a),o=L.multiply(o,a,o);let s=Fe.fromRotationMatrix(L.getMatrix3(o,kBe),zBe);return s=Fe.normalize(s,s),Tc.fromQuaternion(s,i)};var UBe=6*3600+2460+50.54841,VBe=8640184812866e-6,jBe=.093104,HBe=-62e-7,GBe=11772758384668e-32,WBe=72921158553e-15,qBe=D.TWO_PI/86400,U8=new K;Ai.computeIcrfToCentralBodyFixedMatrix=function(e,t){let n=Ai.computeIcrfToFixedMatrix(e,t);return l(n)||(n=Ai.computeTemeToPseudoFixedMatrix(e,t)),n};Ai.computeTemeToPseudoFixedMatrix=function(e,t){U8=K.addSeconds(e,-K.computeTaiMinusUtc(e),U8);let n=U8.dayNumber,i=U8.secondsOfDay,r,o=n-2451545;i>=43200?r=(o+.5)/zn.DAYS_PER_JULIAN_CENTURY:r=(o-.5)/zn.DAYS_PER_JULIAN_CENTURY;let s=(UBe+r*(VBe+r*(jBe+r*HBe)))*qBe%D.TWO_PI,c=WBe+GBe*(n-24515455e-1),u=(i+zn.SECONDS_PER_DAY*.5)%zn.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)};Ai.iau2006XysData=new AP;Ai.earthOrientationParameters=yP.NONE;var TW=32.184,YBe=2451545;Ai.preloadIcrfFixed=function(e){let t=e.start.dayNumber,n=e.start.secondsOfDay+TW,i=e.stop.dayNumber,r=e.stop.secondsOfDay+TW;return Ai.iau2006XysData.preload(t,n,i,r)};Ai.computeIcrfToFixedMatrix=function(e,t){l(t)||(t=new $);let n=Ai.computeFixedToIcrfMatrix(e,t);if(l(n))return $.transpose(n,t)};var XBe=32.184,KBe=2451545,V8=new Tc,$Be=new $,JBe=new K;Ai.computeMoonFixedToIcrfMatrix=function(e,t){l(t)||(t=new $);let n=K.addSeconds(e,XBe,JBe),i=K.totalDays(n)-KBe,r=D.toRadians(12.112)-D.toRadians(.052992)*i,o=D.toRadians(24.224)-D.toRadians(.105984)*i,a=D.toRadians(227.645)+D.toRadians(13.012)*i,s=D.toRadians(261.105)+D.toRadians(13.340716)*i,c=D.toRadians(358)+D.toRadians(.9856)*i;return V8.pitch=D.toRadians(180)-D.toRadians(3.878)*Math.sin(r)-D.toRadians(.12)*Math.sin(o)+D.toRadians(.07)*Math.sin(a)-D.toRadians(.017)*Math.sin(s),V8.roll=D.toRadians(66.53-90)+D.toRadians(1.543)*Math.cos(r)+D.toRadians(.24)*Math.cos(o)-D.toRadians(.028)*Math.cos(a)+D.toRadians(.007)*Math.cos(s),V8.heading=D.toRadians(244.375-90)+D.toRadians(13.17635831)*i+D.toRadians(3.558)*Math.sin(r)+D.toRadians(.121)*Math.sin(o)-D.toRadians(.064)*Math.sin(a)+D.toRadians(.016)*Math.sin(s)+D.toRadians(.025)*Math.sin(c),$.fromHeadingPitchRoll(V8,$Be,t)};Ai.computeIcrfToMoonFixedMatrix=function(e,t){l(t)||(t=new $);let n=Ai.computeMoonFixedToIcrfMatrix(e,t);if(l(n))return $.transpose(n,t)};var ZBe=new Ib(0,0,0),QBe=new ty(0,0,0,0,0,0),bW=new $,xW=new $;Ai.computeFixedToIcrfMatrix=function(e,t){l(t)||(t=new $);let n=Ai.earthOrientationParameters.compute(e,QBe);if(!l(n))return;let i=e.dayNumber,r=e.secondsOfDay+TW,o=Ai.iau2006XysData.computeXysRadians(i,r,ZBe);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=bW;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,xW),d=$.multiply(u,f,bW),p=e.dayNumber,g=e.secondsOfDay-K.computeTaiMinusUtc(e)+n.ut1MinusUtc,m=p-2451545,y=g/zn.SECONDS_PER_DAY,A=.779057273264+y+.00273781191135448*(m+y);A=A%1*D.TWO_PI;let b=$.fromRotationZ(A,xW),x=$.multiply(d,b,bW),T=Math.cos(n.xPoleWander),C=Math.cos(n.yPoleWander),E=Math.sin(n.xPoleWander),w=Math.sin(n.yPoleWander),P=i-YBe+r/zn.SECONDS_PER_DAY;P/=36525;let R=-47e-6*P*D.RADIANS_PER_DEGREE/3600,O=Math.cos(R),N=Math.sin(R),_=xW;return _[0]=T*O,_[1]=T*N,_[2]=E,_[3]=-C*N+w*E*O,_[4]=C*O+w*E*N,_[5]=-w*T,_[6]=-w*N-C*E*O,_[7]=w*O-C*E*N,_[8]=C*T,$.multiply(x,_,t)};var e2e=new ae;Ai.pointToWindowCoordinates=function(e,t,n,i){return i=Ai.pointToGLWindowCoordinates(e,t,n,i),i.y=2*t[5]-i.y,i};Ai.pointToGLWindowCoordinates=function(e,t,n,i){l(i)||(i=new z);let r=e2e;return L.multiplyByVector(e,ae.fromElements(n.x,n.y,n.z,1,r),r),ae.multiplyByScalar(r,1/r.w,r),L.multiplyByVector(t,r,r),z.fromCartesian4(r,i)};var t2e=new h,n2e=new h,i2e=new h;Ai.rotationMatrixFromPositionVelocity=function(e,t,n,i){let r=(n??te.default).geodeticSurfaceNormal(e,t2e),o=h.cross(t,r,n2e);h.equalsEpsilon(o,h.ZERO,D.EPSILON6)&&(o=h.clone(h.UNIT_X,o));let a=h.cross(o,t,i2e);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};Ai.SWIZZLE_3D_TO_2D_MATRIX=Object.freeze(new L(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1));var dce=new de,CW=new h,r2e=new h,o2e=new $,vW=new L,hce=new L;Ai.basisTo2D=function(e,t,n){let i=L.getTranslation(t,r2e),r=e.ellipsoid,o;if(h.equals(i,h.ZERO))o=h.clone(h.ZERO,CW);else{let f=r.cartesianToCartographic(i,dce);o=e.project(f,CW),h.fromElements(o.z,o.x,o.y,o)}let a=Ai.eastNorthUpToFixedFrame(i,r,vW),s=L.inverseTransformation(a,hce),c=L.getMatrix3(t,o2e),u=L.multiplyByMatrix3(s,c,n);return L.multiply(Ai.SWIZZLE_3D_TO_2D_MATRIX,u,n),L.setTranslation(n,o,n),n};Ai.ellipsoidTo2DModelMatrix=function(e,t,n){let i=e.ellipsoid,r=Ai.eastNorthUpToFixedFrame(t,i,vW),o=L.inverseTransformation(r,hce),a=i.cartesianToCartographic(t,dce),s=e.project(a,CW);h.fromElements(s.z,s.x,s.y,s);let c=L.fromTranslation(s,vW);return L.multiply(Ai.SWIZZLE_3D_TO_2D_MATRIX,o,n),L.multiply(c,n,n),n};var mt=Ai;var Sv=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+=D.TWO_PI),n-i}static computeHeight(t){return t.north-t.south}static fromDegrees(t,n,i,r,o){return t=D.toRadians(t??0),n=D.toRadians(n??0),i=D.toRadians(i??0),r=D.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+D.TWO_PI;o=Math.min(o,p),a=Math.max(a,p)}return r-i>a-o&&(i=o,r=a,r>D.PI&&(r=r-D.TWO_PI),i>D.PI&&(i=i-D.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+D.TWO_PI;a=Math.min(a,g),s=Math.max(s,g)}return o-r>s-a&&(r=a,o=s,o>D.PI&&(o=o-D.TWO_PI),r>D.PI&&(r=r-D.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,a2e),s=L.multiplyByPointAsVector(a,h.UNIT_X,s2e);h.normalize(s,s);let c=L.multiplyByPointAsVector(a,h.UNIT_Y,c2e);h.normalize(c,c),h.multiplyByScalar(c,o,c),h.multiplyByScalar(s,o,s);let u=h.negate(c,u2e),f=h.negate(s,l2e),d=EW,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+=D.TWO_PI);let o=D.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+=D.TWO_PI:a<s&&r>0&&(a+=D.TWO_PI),r<o&&s<0?s+=D.TWO_PI:a<s&&o<0&&(o+=D.TWO_PI);let c=D.negativePiToPi(Math.max(o,s)),u=D.negativePiToPi(Math.min(r,a));if(c===D.PI&&u<D.PI&&(c=-D.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+=D.TWO_PI:a<s&&r>0&&(a+=D.TWO_PI),r<o&&s<0?s+=D.TWO_PI:a<s&&o<0&&(o+=D.TWO_PI);let c=D.negativePiToPi(Math.min(o,s)),u=D.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+=D.TWO_PI,i<0&&(i+=D.TWO_PI)),(i>o||D.equalsEpsilon(i,o,D.EPSILON14))&&(i<a||D.equalsEpsilon(i,a,D.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=f2e;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*D.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=D.TWO_PI+t.east-t.west;a.west=D.negativePiToPi(t.west+n*c),a.east=D.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}};Sv.packedLength=4;var a2e=new L,s2e=new h,c2e=new h,l2e=new h,u2e=new h,EW=new Array(5);for(let e=0;e<EW.length;++e)EW[e]=new h;var f2e=new de;Sv.MAX_VALUE=Object.freeze(new Sv(-Math.PI,-D.PI_OVER_TWO,Math.PI,D.PI_OVER_TWO));var ie=Sv;var j8=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],OW),r=h.clone(i,SW),o=h.clone(i,wW),a=h.clone(i,IW),s=h.clone(i,PW),c=h.clone(i,DW),u=h.clone(i,RW),f=t.length,d;for(d=1;d<f;d++){h.clone(t[d],i);let O=i.x,N=i.y,_=i.z;O<r.x&&h.clone(i,r),O>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,$s)),g=h.magnitudeSquared(h.subtract(c,o,$s)),m=h.magnitudeSquared(h.subtract(u,a,$s)),y=r,A=s,b=p;g>b&&(b=g,y=o,A=c),m>b&&(y=a,A=u);let x=MW;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,$s)),C=Math.sqrt(T),E=LW;E.x=r.x,E.y=o.y,E.z=a.z;let w=NW;w.x=s.x,w.y=c.y,w.z=u.z;let P=h.midpoint(E,w,FW),R=0;for(d=0;d<f;d++){h.clone(t[d],i);let O=h.magnitude(h.subtract(i,P,$s));O>R&&(R=O);let N=h.magnitudeSquared(h.subtract(i,x,$s));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(P,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;mce._ellipsoid=te.default,n=n??mce,ie.southwest(t,BW),BW.height=i,ie.northeast(t,kW),kW.height=r;let a=n.project(BW,h2e),s=n.project(kW,m2e),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,p2e);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=OW;o.x=t[0]+n.x,o.y=t[1]+n.y,o.z=t[2]+n.z;let a=h.clone(o,SW),s=h.clone(o,wW),c=h.clone(o,IW),u=h.clone(o,PW),f=h.clone(o,DW),d=h.clone(o,RW),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,$s)),y=h.magnitudeSquared(h.subtract(f,s,$s)),A=h.magnitudeSquared(h.subtract(d,c,$s)),b=a,x=u,T=m;y>T&&(T=y,b=s,x=f),A>T&&(b=c,x=d);let C=MW;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,$s)),w=Math.sqrt(E),P=LW;P.x=a.x,P.y=s.y,P.z=c.z;let R=NW;R.x=u.x,R.y=f.y,R.z=d.z;let O=h.midpoint(P,R,FW),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,O,$s));_>N&&(N=_);let v=h.magnitudeSquared(h.subtract(o,C,$s));if(v>E){let S=Math.sqrt(v);w=(w+S)*.5,E=w*w;let I=S-w;C.x=(w*C.x+I*o.x)/S,C.y=(w*C.y+I*o.y)/S,C.z=(w*C.z+I*o.z)/S}}return w<N?(h.clone(C,r.center),r.radius=w):(h.clone(O,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=OW;r.x=t[0]+n[0],r.y=t[1]+n[1],r.z=t[2]+n[2];let o=h.clone(r,SW),a=h.clone(r,wW),s=h.clone(r,IW),c=h.clone(r,PW),u=h.clone(r,DW),f=h.clone(r,RW),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,$s)),m=h.magnitudeSquared(h.subtract(u,a,$s)),y=h.magnitudeSquared(h.subtract(f,s,$s)),A=o,b=c,x=g;m>x&&(x=m,A=a,b=u),y>x&&(A=s,b=f);let T=MW;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,$s)),E=Math.sqrt(C),w=LW;w.x=o.x,w.y=a.y,w.z=s.z;let P=NW;P.x=c.x,P.y=u.y,P.z=f.z;let R=h.midpoint(w,P,FW),O=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,$s));N>O&&(O=N);let _=h.magnitudeSquared(h.subtract(r,T,$s));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<O?(h.clone(T,i.center),i.radius=E):(h.clone(R,i.center),i.radius=O),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,g2e),o=$.getColumn(i,1,_2e),a=$.getColumn(i,2,y2e);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=L.getTranslation(t,A2e),r=L.getScale(t,b2e),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,x2e),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,T2e);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,C2e));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=L.multiplyByPoint(n,t.center,i.center),i.radius=L.getMaximumScale(n)*t.radius,i}static distanceSquaredTo(t,n){let i=h.subtract(t.center,n,v2e),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=L.multiplyByPoint(n,t.center,i.center),i.radius=t.radius,i}static computePlaneDistances(t,n,i,r){l(r)||(r=new Wo);let o=h.subtract(t.center,n,E2e),a=h.dot(i,o);return r.start=a-t.radius,r.stop=a+t.radius,r}static projectTo2D(t,n,i){gce._ellipsoid=te.default,n=n??gce;let r=n.ellipsoid,o=t.center,a=t.radius,s;h.equals(o,h.ZERO)?s=h.clone(h.UNIT_X,pce):s=r.geodeticSurfaceNormal(o,pce);let c=h.cross(h.UNIT_Z,s,S2e);h.normalize(c,c);let u=h.cross(s,c,w2e);h.normalize(u,u),h.multiplyByScalar(s,a,s),h.multiplyByScalar(u,a,u),h.multiplyByScalar(c,a,c);let f=h.negate(u,P2e),d=h.negate(c,I2e),p=_ce,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,D2e);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 d2e*t*t*t}};j8.packedLength=4;var SW=new h,wW=new h,IW=new h,PW=new h,DW=new h,RW=new h,OW=new h,$s=new h,MW=new h,LW=new h,NW=new h,FW=new h,d2e=4/3*D.PI,mce=new Bi,h2e=new h,m2e=new h,BW=new de,kW=new de,p2e=[],g2e=new h,_2e=new h,y2e=new h,A2e=new h,b2e=new h,x2e=new h,T2e=new h,C2e=new h,v2e=new h,E2e=new h,pce=new h,S2e=new h,w2e=new h,I2e=new h,P2e=new h,D2e=new de,_ce=new Array(8);for(let e=0;e<8;++e)_ce[e]=new h;var gce=new Bi,se=j8;var zW=class{constructor(t){t=t??H.EMPTY_OBJECT,this._ellipsoid=t.ellipsoid??te.default,this._rectangle=t.rectangle??ie.MAX_VALUE,this._projection=new Bi(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=D.toDegrees(t.west),r=D.toDegrees(t.south),o=D.toDegrees(t.east),a=D.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=D.toDegrees(o.west),o.south=D.toDegrees(o.south),o.east=D.toDegrees(o.east),o.north=D.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+=D.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 z(f,d)}},Xi=zW;var yce=new h,Ace=new h,bce=new de,UW=new h,R2e=new h,xce=new se,O2e=new Xi,CP=[new de,new de,new de,new de],vP=new z,Ia={};Ia.initialize=function(){let e=Ia._initPromise;return l(e)||(e=De.fetchJson($t("Assets/approximateTerrainHeights.json")).then(function(t){Ia._terrainHeights=t}),Ia._initPromise=e),e};Ia.getMinimumMaximumHeights=function(e,t){t=t??te.default;let n=Tce(e),i=Ia._defaultMinTerrainHeight,r=Ia._defaultMaxTerrainHeight;if(l(n)){let o=`${n.level}-${n.x}-${n.y}`,a=Ia._terrainHeights[o];l(a)&&(i=a[0],r=a[1]),t.cartographicToCartesian(ie.northeast(e,bce),yce),t.cartographicToCartesian(ie.southwest(e,bce),Ace),h.midpoint(Ace,yce,UW);let s=t.scaleToGeodeticSurface(UW,R2e);if(l(s)){let c=h.distance(UW,s);i=Math.min(i,-c)}else i=Ia._defaultMinTerrainHeight}return i=Math.max(Ia._defaultMinTerrainHeight,i),{minimumTerrainHeight:i,maximumTerrainHeight:r}};Ia.getBoundingSphere=function(e,t){t=t??te.default;let n=Tce(e),i=Ia._defaultMaxTerrainHeight;if(l(n)){let o=`${n.level}-${n.x}-${n.y}`,a=Ia._terrainHeights[o];l(a)&&(i=a[1])}let r=se.fromRectangle3D(e,t,0);return se.fromRectangle3D(e,t,i,xce),se.union(r,xce,r)};function Tce(e){de.fromRadians(e.east,e.north,0,CP[0]),de.fromRadians(e.west,e.north,0,CP[1]),de.fromRadians(e.east,e.south,0,CP[2]),de.fromRadians(e.west,e.south,0,CP[3]);let t=0,n=0,i=0,r=0,o=Ia._terrainHeightsMaxLevel,a;for(a=0;a<=o;++a){let s=!1;for(let c=0;c<4;++c){let u=CP[c];if(O2e.positionToTileXY(u,a,vP),c===0)i=vP.x,r=vP.y;else if(i!==vP.x||r!==vP.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}}Ia._terrainHeightsMaxLevel=6;Ia._defaultMaxTerrainHeight=9e3;Ia._defaultMinTerrainHeight=-1e5;Ia._terrainHeights=void 0;Ia._initPromise=void 0;Object.defineProperties(Ia,{initialized:{get:function(){return l(Ia._terrainHeights)}}});var wi=Ia;/*! @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 Cce(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 M2e(e){if(Array.isArray(e))return e}function L2e(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 N2e(){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 F2e(e,t){return M2e(e)||L2e(e,t)||B2e(e,t)||N2e()}function B2e(e,t){if(e){if(typeof e=="string")return Cce(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)?Cce(e,t):void 0}}var kce=Object.entries,vce=Object.setPrototypeOf,k2e=Object.isFrozen,z2e=Object.getPrototypeOf,U2e=Object.getOwnPropertyDescriptor,Cc=Object.freeze,vc=Object.seal,Pv=Object.create,zce=typeof Reflect<"u"&&Reflect,qW=zce.apply,YW=zce.construct;Cc||(Cc=function(t){return t});vc||(vc=function(t){return t});qW||(qW=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)});YW||(YW=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 wv=cs(Array.prototype.forEach),V2e=cs(Array.prototype.lastIndexOf),Ece=cs(Array.prototype.pop),Iv=cs(Array.prototype.push),j2e=cs(Array.prototype.splice),ly=Array.isArray,wP=cs(String.prototype.toLowerCase),VW=cs(String.prototype.toString),Sce=cs(String.prototype.match),EP=cs(String.prototype.replace),wce=cs(String.prototype.indexOf),H2e=cs(String.prototype.trim),G2e=cs(Number.prototype.toString),W2e=cs(Boolean.prototype.toString),Ice=typeof BigInt>"u"?null:cs(BigInt.prototype.toString),Pce=typeof Symbol>"u"?null:cs(Symbol.prototype.toString),Zs=cs(Object.prototype.hasOwnProperty),SP=cs(Object.prototype.toString),Js=cs(RegExp.prototype.test),Pb=q2e(TypeError);function cs(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 qW(e,t,i)}}function q2e(e){return function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return YW(e,n)}}function pr(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:wP;if(vce&&vce(e,null),!ly(t))return e;let i=t.length;for(;i--;){let r=t[i];if(typeof r=="string"){let o=n(r);o!==r&&(k2e(t)||(t[i]=o),r=o)}e[r]=!0}return e}function Y2e(e){for(let t=0;t<e.length;t++)Zs(e,t)||(e[t]=null);return e}function Gc(e){let t=Pv(null);for(let i of kce(e)){var n=F2e(i,2);let r=n[0],o=n[1];Zs(e,r)&&(ly(o)?t[r]=Y2e(o):o&&typeof o=="object"&&o.constructor===Object?t[r]=Gc(o):t[r]=o)}return t}function X2e(e){switch(typeof e){case"string":return e;case"number":return G2e(e);case"boolean":return W2e(e);case"bigint":return Ice?Ice(e):"0";case"symbol":return Pce?Pce(e):"Symbol()";case"undefined":return SP(e);case"function":case"object":{if(e===null)return SP(e);let t=e,n=wh(t,"toString");if(typeof n=="function"){let i=n(t);return typeof i=="string"?i:SP(i)}return SP(e)}default:return SP(e)}}function wh(e,t){for(;e!==null;){let i=U2e(e,t);if(i){if(i.get)return cs(i.get);if(typeof i.value=="function")return cs(i.value)}e=z2e(e)}function n(){return null}return n}function K2e(e){try{return Js(e,""),!0}catch{return!1}}var Dce=Cc(["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"]),jW=Cc(["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"]),HW=Cc(["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"]),$2e=Cc(["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"]),GW=Cc(["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"]),J2e=Cc(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Rce=Cc(["#text"]),Oce=Cc(["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"]),WW=Cc(["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"]),Mce=Cc(["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"]),H8=Cc(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Z2e=vc(/{{[\w\W]*|^[\w\W]*}}/g),Q2e=vc(/<%[\w\W]*|^[\w\W]*%>/g),eke=vc(/\${[\w\W]*/g),tke=vc(/^data-[\-\w.\u00B7-\uFFFF]+$/),nke=vc(/^aria-[\-\w]+$/),Lce=vc(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ike=vc(/^(?:\w+script|data):/i),rke=vc(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),oke=vc(/^html$/i),ake=vc(/^[a-z][.\w]*(-[.\w]+)+$/i),Nce=vc(/<[/\w!]/g),Fce=vc(/<[/\w]/g),ske=vc(/<\/no(script|embed|frames)/i),cke=vc(/\/>/i),cf={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},lke=function(){return typeof window>"u"?null:window},uke=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}},Bce=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},cy=function(t,n,i,r){return Zs(t,n)&&ly(t[n])?pr(r.base?Gc(r.base):{},t[n],r.transform):i};function Uce(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:lke(),t=ft=>Uce(ft);if(t.version="3.4.13",t.removed=[],!e||!e.document||e.document.nodeType!==cf.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=wh(p,"cloneNode"),m=wh(p,"remove"),y=wh(p,"nextSibling"),A=wh(p,"childNodes"),b=wh(p,"parentNode"),x=wh(p,"shadowRoot"),T=wh(p,"attributes"),C=a&&a.prototype?wh(a.prototype,"nodeType"):null,E=a&&a.prototype?wh(a.prototype,"nodeName"):null,w=a&&a.prototype?wh(a.prototype,"ownerDocument"):null;if(typeof o=="function"){let ft=n.createElement("template");ft.content&&ft.content.ownerDocument&&(n=ft.content.ownerDocument)}let P,R="",O,N=!1,_=0,v=function(){if(_>0)throw Pb('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 P.createHTML(ge)}finally{_--}},I=function(ge){v(),_++;try{return P.createScriptURL(ge)}finally{_--}},M=function(){return N||(O=uke(d,r),N=!0),O},F=n,V=F.implementation,k=F.createNodeIterator,j=F.createDocumentFragment,B=F.getElementsByTagName,G=i.importNode,W=Bce();t.isSupported=typeof kce=="function"&&typeof b=="function"&&V&&V.createHTMLDocument!==void 0;let Q=Z2e,q=Q2e,J=eke,Z=tke,ce=nke,Ae=ike,le=rke,Ce=ake,ye=Lce,ve=null,Ie=pr({},[...Dce,...jW,...HW,...GW,...Rce]),Le=null,$e=pr({},[...Oce,...WW,...Mce,...H8]),Xe=Object.seal(Pv(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}})),At=null,Ke=null,we=Object.seal(Pv(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),We=!0,vt=!0,ct=!1,pn=!0,Ht=!1,bt=!0,Dt=!1,Pn=!1,ot=null,dt=null,Si=!1,wn=!1,Ni=!1,dr=!1,Fi=!0,Yi=!1,ai="user-content-",ni=!0,En=!1,ii={},Sr=null,Ea=pr({},["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"]),Va=null,rs=pr({},["audio","video","img","source","image","track"]),os=null,oo=pr({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),gi="http://www.w3.org/1998/Math/MathML",ao="http://www.w3.org/2000/svg",Ri="http://www.w3.org/1999/xhtml",Ho=Ri,Oi=!1,wr=null,Sa=pr({},[gi,ao,Ri],VW),Do=Cc(["mi","mo","mn","ms","mtext"]),sd=pr({},Do),cd=Cc(["annotation-xml"]),bc=pr({},cd),J_=pr({},["title","style","font","a","script"]),Ro=null,ws=["application/xhtml+xml","text/html"],Z_="text/html",si=null,Xs=null,Ks=n.createElement("form"),as=function(ge){return ge instanceof RegExp||ge instanceof Function},wa=function(){let ge=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Xs&&Xs===ge)return;(!ge||typeof ge!="object")&&(ge={}),ge=Gc(ge),Ro=ws.indexOf(ge.PARSER_MEDIA_TYPE)===-1?Z_:ge.PARSER_MEDIA_TYPE,si=Ro==="application/xhtml+xml"?VW:wP,ve=cy(ge,"ALLOWED_TAGS",Ie,{transform:si}),Le=cy(ge,"ALLOWED_ATTR",$e,{transform:si}),wr=cy(ge,"ALLOWED_NAMESPACES",Sa,{transform:VW}),os=cy(ge,"ADD_URI_SAFE_ATTR",oo,{transform:si,base:oo}),Va=cy(ge,"ADD_DATA_URI_TAGS",rs,{transform:si,base:rs}),Sr=cy(ge,"FORBID_CONTENTS",Ea,{transform:si}),At=cy(ge,"FORBID_TAGS",Gc({}),{transform:si}),Ke=cy(ge,"FORBID_ATTR",Gc({}),{transform:si}),ii=Zs(ge,"USE_PROFILES")?ge.USE_PROFILES&&typeof ge.USE_PROFILES=="object"?Gc(ge.USE_PROFILES):ge.USE_PROFILES:!1,We=ge.ALLOW_ARIA_ATTR!==!1,vt=ge.ALLOW_DATA_ATTR!==!1,ct=ge.ALLOW_UNKNOWN_PROTOCOLS||!1,pn=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,Ni=ge.RETURN_DOM_FRAGMENT||!1,dr=ge.RETURN_TRUSTED_TYPE||!1,Si=ge.FORCE_BODY||!1,Fi=ge.SANITIZE_DOM!==!1,Yi=ge.SANITIZE_NAMED_PROPS||!1,ni=ge.KEEP_CONTENT!==!1,En=ge.IN_PLACE||!1,ye=K2e(ge.ALLOWED_URI_REGEXP)?ge.ALLOWED_URI_REGEXP:Lce,Ho=typeof ge.NAMESPACE=="string"?ge.NAMESPACE:Ri,sd=Zs(ge,"MATHML_TEXT_INTEGRATION_POINTS")&&ge.MATHML_TEXT_INTEGRATION_POINTS&&typeof ge.MATHML_TEXT_INTEGRATION_POINTS=="object"?Gc(ge.MATHML_TEXT_INTEGRATION_POINTS):pr({},Do),bc=Zs(ge,"HTML_INTEGRATION_POINTS")&&ge.HTML_INTEGRATION_POINTS&&typeof ge.HTML_INTEGRATION_POINTS=="object"?Gc(ge.HTML_INTEGRATION_POINTS):pr({},cd);let Ne=Zs(ge,"CUSTOM_ELEMENT_HANDLING")&&ge.CUSTOM_ELEMENT_HANDLING&&typeof ge.CUSTOM_ELEMENT_HANDLING=="object"?Gc(ge.CUSTOM_ELEMENT_HANDLING):Pv(null);if(Xe=Pv(null),Zs(Ne,"tagNameCheck")&&as(Ne.tagNameCheck)&&(Xe.tagNameCheck=Ne.tagNameCheck),Zs(Ne,"attributeNameCheck")&&as(Ne.attributeNameCheck)&&(Xe.attributeNameCheck=Ne.attributeNameCheck),Zs(Ne,"allowCustomizedBuiltInElements")&&typeof Ne.allowCustomizedBuiltInElements=="boolean"&&(Xe.allowCustomizedBuiltInElements=Ne.allowCustomizedBuiltInElements),vc(Xe),Ht&&(vt=!1),Ni&&(wn=!0),ii&&(ve=pr({},Rce),Le=Pv(null),ii.html===!0&&(pr(ve,Dce),pr(Le,Oce)),ii.svg===!0&&(pr(ve,jW),pr(Le,WW),pr(Le,H8)),ii.svgFilters===!0&&(pr(ve,HW),pr(Le,WW),pr(Le,H8)),ii.mathMl===!0&&(pr(ve,GW),pr(Le,Mce),pr(Le,H8))),we.tagCheck=null,we.attributeCheck=null,Zs(ge,"ADD_TAGS")&&(typeof ge.ADD_TAGS=="function"?we.tagCheck=ge.ADD_TAGS:ly(ge.ADD_TAGS)&&(ve===Ie&&(ve=Gc(ve)),pr(ve,ge.ADD_TAGS,si))),Zs(ge,"ADD_ATTR")&&(typeof ge.ADD_ATTR=="function"?we.attributeCheck=ge.ADD_ATTR:ly(ge.ADD_ATTR)&&(Le===$e&&(Le=Gc(Le)),pr(Le,ge.ADD_ATTR,si))),Zs(ge,"ADD_URI_SAFE_ATTR")&&ly(ge.ADD_URI_SAFE_ATTR)&&pr(os,ge.ADD_URI_SAFE_ATTR,si),Zs(ge,"FORBID_CONTENTS")&&ly(ge.FORBID_CONTENTS)&&(Sr===Ea&&(Sr=Gc(Sr)),pr(Sr,ge.FORBID_CONTENTS,si)),Zs(ge,"ADD_FORBID_CONTENTS")&&ly(ge.ADD_FORBID_CONTENTS)&&(Sr===Ea&&(Sr=Gc(Sr)),pr(Sr,ge.ADD_FORBID_CONTENTS,si)),ni&&(ve["#text"]=!0),Dt&&pr(ve,["html","head","body"]),ve.table&&(pr(ve,["tbody"]),delete At.tbody),ge.TRUSTED_TYPES_POLICY){if(typeof ge.TRUSTED_TYPES_POLICY.createHTML!="function")throw Pb('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof ge.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Pb('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');let lt=P;P=ge.TRUSTED_TYPES_POLICY;try{R=S("")}catch(nn){throw P=lt,nn}}else ge.TRUSTED_TYPES_POLICY===null?(P=void 0,R=""):(P===void 0&&(P=M()),P&&typeof R=="string"&&(R=S("")));Cc&&Cc(ge),Xs=ge},ld=pr({},[...jW,...HW,...$2e]),_b=pr({},[...GW,...J2e]),F7=function(ge,Ne,lt){return Ne.namespaceURI===Ri?ge==="svg":Ne.namespaceURI===gi?ge==="svg"&&(lt==="annotation-xml"||sd[lt]):!!ld[ge]},nP=function(ge,Ne,lt){return Ne.namespaceURI===Ri?ge==="math":Ne.namespaceURI===ao?ge==="math"&&bc[lt]:!!_b[ge]},B7=function(ge,Ne,lt){return Ne.namespaceURI===ao&&!bc[lt]||Ne.namespaceURI===gi&&!sd[lt]?!1:!_b[ge]&&(J_[ge]||!ld[ge])},k7=function(ge){let Ne=b(ge);(!Ne||!Ne.tagName)&&(Ne={namespaceURI:Ho,tagName:"template"});let lt=wP(ge.tagName),nn=wP(Ne.tagName);return wr[ge.namespaceURI]?ge.namespaceURI===ao?F7(lt,Ne,nn):ge.namespaceURI===gi?nP(lt,Ne,nn):ge.namespaceURI===Ri?B7(lt,Ne,nn):!!(Ro==="application/xhtml+xml"&&wr[ge.namespaceURI]):!1},sp=function(ge){Iv(t.removed,{element:ge});try{b(ge).removeChild(ge)}catch{if(m(ge),!b(ge))throw Pb("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},fv=function(ge){Q_(ge);let Ne=A(ge);if(Ne){let nn=[];wv(Ne,Sn=>{Iv(nn,Sn)}),wv(nn,Sn=>{try{m(Sn)}catch{}})}let lt=T(ge);if(lt)for(let nn=lt.length-1;nn>=0;--nn){let Sn=lt[nn],Mn=Sn&&Sn.name;if(typeof Mn=="string")try{ge.removeAttribute(Mn)}catch{}}},P0=function(ge,Ne){try{Iv(t.removed,{attribute:Ne.getAttributeNode(ge),from:Ne})}catch{Iv(t.removed,{attribute:null,from:Ne})}if(Ne.removeAttribute(ge),ge==="is")if(wn||Ni)try{sp(Ne)}catch{}else try{Ne.setAttribute(ge,"")}catch{}},iP=function(ge){let Ne=T(ge);if(Ne)for(let lt=Ne.length-1;lt>=0;--lt){let nn=Ne[lt],Sn=nn&&nn.name;if(!(typeof Sn!="string"||Le[si(Sn)]))try{ge.removeAttribute(Sn)}catch{}}},Q_=function(ge){let Ne=[ge];for(;Ne.length>0;){let lt=Ne.pop();(C?C(lt):lt.nodeType)===cf.element&&iP(lt);let Sn=A(lt);if(Sn)for(let Mn=Sn.length-1;Mn>=0;--Mn)Ne.push(Sn[Mn])}},rP=function(ge){if(!bt)return;let Ne=[ge];for(;Ne.length>0;){let lt=Ne.pop(),nn=C?C(lt):lt.nodeType;if(nn===cf.processingInstruction||nn===cf.comment&&Js(Fce,lt.data)){try{m(lt)}catch{}continue}if(nn===cf.element){let Mn=lt,hr=si(E?E(lt):lt.nodeName);try{Mn.hasAttribute&&Mn.hasAttribute("patchsrc")&&Mn.removeAttribute("patchsrc"),Mn.hasAttribute&&Mn.hasAttribute("for")&&hr!=="label"&&hr!=="output"&&Mn.removeAttribute("for")}catch{}}let Sn=A(lt);if(Sn)for(let Mn=Sn.length-1;Mn>=0;--Mn)Ne.push(Sn[Mn])}},s8=function(ge){let Ne=null,lt=null;if(Si)ge="<remove></remove>"+ge;else{let Mn=Sce(ge,/^[\r\n\t ]+/);lt=Mn&&Mn[0]}Ro==="application/xhtml+xml"&&Ho===Ri&&(ge='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+ge+"</body></html>");let nn=P?S(ge):ge;if(Ho===Ri)try{Ne=new f().parseFromString(nn,Ro)}catch{}if(!Ne||!Ne.documentElement){Ne=V.createDocument(Ho,"template",null);try{Ne.documentElement.innerHTML=Oi?R:nn}catch{}}let Sn=Ne.body||Ne.documentElement;return ge&&lt&&Sn.insertBefore(n.createTextNode(lt),Sn.childNodes[0]||null),Ho===Ri?B.call(Ne,Dt?"html":"body")[0]:Dt?Ne.documentElement:Sn},oP=function(ge){let Ne=w?w(ge):ge.ownerDocument;return k.call(Ne||ge,ge,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},ey=function(ge){return ge=EP(ge,Q," "),ge=EP(ge,q," "),ge=EP(ge,J," "),ge},ud=function(ge){var Ne;ge.normalize();let lt=w?w(ge):ge.ownerDocument,nn=k.call(lt||ge,ge,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),Sn=nn.nextNode();for(;Sn;)Sn.data=ey(Sn.data),Sn=nn.nextNode();let Mn=(Ne=ge.querySelectorAll)===null||Ne===void 0?void 0:Ne.call(ge,"template");Mn&&wv(Mn,hr=>{R0(hr.content)&&ud(hr.content)})},D0=function(ge){let Ne=E?E(ge):null;return typeof Ne!="string"||si(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)},R0=function(ge){if(!C||typeof ge!="object"||ge===null)return!1;try{return C(ge)===cf.documentFragment}catch{return!1}},yb=function(ge){if(!C||typeof ge!="object"||ge===null)return!1;try{return typeof C(ge)=="number"}catch{return!1}};function Cl(ft,ge,Ne){ft.length!==0&&wv(ft,lt=>{lt.call(t,ge,Ne,Xs)})}let fe=function(ge,Ne){return!!(bt&&ge.hasChildNodes()&&!yb(ge.firstElementChild)&&Js(Nce,ge.textContent)&&Js(Nce,ge.innerHTML)||bt&&ge.namespaceURI===Ri&&Ne==="style"&&yb(ge.firstElementChild)||ge.nodeType===cf.processingInstruction||bt&&ge.nodeType===cf.comment&&Js(Fce,ge.data))},ne=function(ge,Ne,lt){if(!At[Ne]&&ut(Ne)&&(Xe.tagNameCheck instanceof RegExp&&Js(Xe.tagNameCheck,Ne)||Xe.tagNameCheck instanceof Function&&Xe.tagNameCheck(Ne)))return!1;if(ni&&!Sr[Ne]){let nn=b(ge),Sn=A(ge);if(Sn&&nn){let Mn=Sn.length;for(let hr=Mn-1;hr>=0;--hr){let so=ge===lt?g(Sn[hr],!0):Sn[hr];nn.insertBefore(so,y(ge))}}}return sp(ge),!0},xe=function(ge,Ne,lt,nn){return ge.length===0?Ne:Ne===lt||Ne===nn?Gc(Ne):Ne},Se=function(ge,Ne){if(Cl(W.beforeSanitizeElements,ge,null),ge!==Ne&&b(ge)===null)return En&&Q_(ge),!0;if(D0(ge))return sp(ge),!0;let lt=si(E?E(ge):ge.nodeName);if(ve=xe(W.uponSanitizeElement,ve,Ie,ot),Cl(W.uponSanitizeElement,ge,{tagName:lt,allowedTags:ve}),ge!==Ne&&b(ge)===null)return En&&Q_(ge),!0;if(fe(ge,lt))return sp(ge),!0;if(At[lt]||!(we.tagCheck instanceof Function&&we.tagCheck(lt))&&!ve[lt]){let Sn=ne(ge,lt,Ne);return Sn===!1&&Cl(W.afterSanitizeElements,ge,null),Sn}if((C?C(ge):ge.nodeType)===cf.element&&!k7(ge)||(lt==="noscript"||lt==="noembed"||lt==="noframes")&&Js(ske,ge.innerHTML))return sp(ge),!0;if(Ht&&ge.nodeType===cf.text){let Sn=ey(ge.textContent);ge.textContent!==Sn&&(Iv(t.removed,{element:ge.cloneNode()}),ge.textContent=Sn)}return Cl(W.afterSanitizeElements,ge,null),!1},qe=function(ge,Ne,lt){if(Ke[Ne]||bt&&Ne==="patchsrc"||bt&&Ne==="for"&&ge!=="label"&&ge!=="output"||Fi&&(Ne==="id"||Ne==="name")&&(lt in n||lt in Ks))return!1;let nn=Le[Ne]||we.attributeCheck instanceof Function&&we.attributeCheck(Ne,ge);if(!(vt&&Js(Z,Ne))){if(!(We&&Js(ce,Ne))){if(nn){if(!os[Ne]){if(!Js(ye,EP(lt,le,""))){if(!((Ne==="src"||Ne==="xlink:href"||Ne==="href")&&ge!=="script"&&wce(lt,"data:")===0&&Va[ge])){if(!(ct&&!Js(Ae,EP(lt,le,"")))){if(lt)return!1}}}}}else if(!(ut(ge)&&(Xe.tagNameCheck instanceof RegExp&&Js(Xe.tagNameCheck,ge)||Xe.tagNameCheck instanceof Function&&Xe.tagNameCheck(ge))&&(Xe.attributeNameCheck instanceof RegExp&&Js(Xe.attributeNameCheck,Ne)||Xe.attributeNameCheck instanceof Function&&Xe.attributeNameCheck(Ne,ge))||Ne==="is"&&Xe.allowCustomizedBuiltInElements&&(Xe.tagNameCheck instanceof RegExp&&Js(Xe.tagNameCheck,lt)||Xe.tagNameCheck instanceof Function&&Xe.tagNameCheck(lt))))return!1}}return!0},Tt=pr({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),ut=function(ge){return!Tt[wP(ge)]&&Js(Ce,ge)},Et=function(ge,Ne,lt,nn){if(P&&typeof d=="object"&&typeof d.getAttributeType=="function"&&!lt)switch(d.getAttributeType(ge,Ne)){case"TrustedHTML":return S(nn);case"TrustedScriptURL":return I(nn)}return nn},An=function(ge,Ne,lt,nn){try{lt?ge.setAttributeNS(lt,Ne,nn):ge.setAttribute(Ne,nn),D0(ge)?sp(ge):Ece(t.removed)}catch{P0(Ne,ge)}},Wn=function(ge){Cl(W.beforeSanitizeAttributes,ge,null);let Ne=ge.attributes;if(!Ne||D0(ge))return;Le=xe(W.uponSanitizeAttribute,Le,$e,dt);let lt={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Le,forceKeepAttr:void 0},nn=Ne.length,Sn=si(ge.nodeName);for(;nn--;){let Mn=Ne[nn],hr=Mn.name,so=Mn.namespaceURI,xc=Mn.value,gu=si(hr),z7=xc,vl=hr==="value"?z7:H2e(z7);if(lt.attrName=gu,lt.attrValue=vl,lt.keepAttr=!0,lt.forceKeepAttr=void 0,Cl(W.uponSanitizeAttribute,ge,lt),vl=lt.attrValue,Yi&&(gu==="id"||gu==="name")&&wce(vl,ai)!==0&&(P0(hr,ge),vl=ai+vl),bt&&Js(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,vl)){P0(hr,ge);continue}if(gu==="attributename"&&Sce(vl,"href")){P0(hr,ge);continue}if(!lt.forceKeepAttr){if(!lt.keepAttr){P0(hr,ge);continue}if(!pn&&Js(cke,vl)){P0(hr,ge);continue}if(Ht&&(vl=ey(vl)),!qe(Sn,gu,vl)){P0(hr,ge);continue}vl=Et(Sn,gu,so,vl),vl!==z7&&An(ge,hr,so,vl)}}Cl(W.afterSanitizeAttributes,ge,null)},un=function(ge){let Ne=null,lt=oP(ge);for(Cl(W.beforeSanitizeShadowDOM,ge,null);Ne=lt.nextNode();)if(Cl(W.uponSanitizeShadowNode,Ne,null),Se(Ne,ge),Wn(Ne),R0(Ne.content)&&un(Ne.content),(C?C(Ne):Ne.nodeType)===cf.element){let Sn=x(Ne);R0(Sn)&&($r(Sn),un(Sn))}Cl(W.afterSanitizeShadowDOM,ge,null)},$r=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,Mn=(C?C(nn):nn.nodeType)===cf.element,hr=A(nn);if(hr)for(let so=hr.length-1;so>=0;--so)Ne.push({node:hr[so],shadow:null});if(Mn){let so=E?E(nn):null;if(typeof so=="string"&&si(so)==="template"){let xc=nn.content;R0(xc)&&Ne.push({node:xc,shadow:null})}}if(Mn){let so=x(nn);R0(so)&&Ne.push({node:null,shadow:so},{node:so,shadow:null})}}};return t.sanitize=function(ft){let ge=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Ne=null,lt=null,nn=null,Sn=null;if(Oi=!ft,Oi&&(ft="<!-->"),typeof ft!="string"&&!yb(ft)&&(ft=X2e(ft),typeof ft!="string"))throw Pb("dirty is not a string, aborting");if(!t.isSupported)return ft;Pn?(ve=ot,Le=dt):wa(ge),(W.uponSanitizeElement.length>0||W.uponSanitizeAttribute.length>0)&&(ve=Gc(ve)),W.uponSanitizeAttribute.length>0&&(Le=Gc(Le)),t.removed=[];let Mn=En&&typeof ft!="string"&&yb(ft);if(Mn){rP(ft);let xc=E?E(ft):ft.nodeName;if(typeof xc=="string"){let gu=si(xc);if(!ve[gu]||At[gu])throw fv(ft),Pb("root node is forbidden and cannot be sanitized in-place")}if(D0(ft))throw fv(ft),Pb("root node is clobbered and cannot be sanitized in-place");try{$r(ft)}catch(gu){throw fv(ft),gu}}else if(yb(ft))Ne=s8("<!---->"),lt=Ne.ownerDocument.importNode(ft,!0),lt.nodeType===cf.element&&lt.nodeName==="BODY"||lt.nodeName==="HTML"?Ne=lt:Ne.appendChild(lt),$r(lt);else{if(!wn&&!Ht&&!Dt&&ft.indexOf("<")===-1)return P&&dr?S(ft):ft;if(Ne=s8(ft),!Ne)return wn?null:dr?R:""}Ne&&Si&&sp(Ne.firstChild);let hr=Mn?ft:Ne;try{let xc=oP(hr);for(;nn=xc.nextNode();)Se(nn,hr),Wn(nn),R0(nn.content)&&un(nn.content)}catch(xc){throw Mn&&(fv(ft),wv(t.removed,gu=>{gu.element&&Q_(gu.element)})),xc}if(Mn)return wv(t.removed,xc=>{xc.element&&Q_(xc.element)}),Ht&&ud(ft),ft;if(wn){if(Ht&&ud(Ne),Ni)for(Sn=j.call(Ne.ownerDocument);Ne.firstChild;)Sn.appendChild(Ne.firstChild);else Sn=Ne;return(Le.shadowroot||Le.shadowrootmode)&&(Sn=G.call(i,Sn,!0)),Sn}let so=Dt?Ne.outerHTML:Ne.innerHTML;return Dt&&ve["!doctype"]&&Ne.ownerDocument&&Ne.ownerDocument.doctype&&Ne.ownerDocument.doctype.name&&Js(oke,Ne.ownerDocument.doctype.name)&&(so="<!DOCTYPE "+Ne.ownerDocument.doctype.name+`>
`+so),Ht&&(so=ey(so)),P&&dr?S(so):so},t.setConfig=function(){let ft=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};wa(ft),Pn=!0,ot=ve,dt=Le},t.clearConfig=function(){Xs=null,Pn=!1,ot=null,dt=null,P=O,R=""},t.isValidAttribute=function(ft,ge,Ne){Xs||wa({});let lt=si(ft),nn=si(ge);return qe(lt,nn,Ne)},t.addHook=function(ft,ge){typeof ge=="function"&&Zs(W,ft)&&Iv(W[ft],ge)},t.removeHook=function(ft,ge){if(Zs(W,ft)){if(ge!==void 0){let Ne=V2e(W[ft],ge);return Ne===-1?void 0:j2e(W[ft],Ne,1)[0]}return Ece(W[ft])}},t.removeHooks=function(ft){Zs(W,ft)&&(W[ft]=[])},t.removeAllHooks=function(){W=Bce()},t}var Vce=Uce();var fke=0,XW={},KW=class e{constructor(t,n){let i,r=t;l(XW[r])?i=XW[r]:(i=fke++,XW[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=Vce.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)}},St=KW;var jce={NONE:0,LERC:1};Object.freeze(jce);var pd=jce;function Qs(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}Qs.fromCorners=function(e,t,n){return l(n)||(n=new Qs),n.minimum=h.clone(e,n.minimum),n.maximum=h.clone(t,n.maximum),n.center=h.midpoint(e,t,n.center),n};Qs.fromPoints=function(e,t){if(l(t)||(t=new Qs),!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};Qs.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 Qs(e.minimum,e.maximum,e.center)};Qs.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 G8=new h;Qs.intersectPlane=function(e,t){G8=h.subtract(e.maximum,e.minimum,G8);let n=h.multiplyByScalar(G8,.5,G8),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};Qs.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};Qs.prototype.clone=function(e){return Qs.clone(this,e)};Qs.prototype.intersectPlane=function(e){return Qs.intersectPlane(this,e)};Qs.prototype.intersectAxisAlignedBoundingBox=function(e){return Qs.intersectAxisAlignedBoundingBox(this,e)};Qs.prototype.equals=function(e){return Qs.equals(this,e)};var lf=Qs;function dp(e,t){this._ellipsoid=e,this._cameraPosition=new h,this._cameraPositionInScaledSpace=new h,this._distanceToLimbInScaledSpaceSquared=0,l(t)&&(this.cameraPosition=t)}Object.defineProperties(dp.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 Hce=new h;dp.prototype.isPointVisible=function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,Hce);return JW(n,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};dp.prototype.isScaledSpacePointVisible=function(e){return JW(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var dke=new h;dp.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(e,t){let n=this._ellipsoid,i,r;return l(t)&&t<0&&n.minimumRadius>-t?(r=dke,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),JW(e,r,i)};dp.prototype.computeHorizonCullingPoint=function(e,t,n){return qce(this._ellipsoid,e,t,n)};var Gce=te.clone(te.UNIT_SPHERE);dp.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,n,i){let r=Wce(this._ellipsoid,n,Gce);return qce(r,e,t,i)};dp.prototype.computeHorizonCullingPointFromVertices=function(e,t,n,i,r){return Yce(this._ellipsoid,e,t,n,i,r)};dp.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,n,i,r,o){let a=Wce(this._ellipsoid,r,Gce);return Yce(a,e,t,n,i,o)};var hke=[];dp.prototype.computeHorizonCullingPointFromRectangle=function(e,t,n){let i=ie.subsample(e,t,0,hke),r=se.fromPoints(i);if(!(h.magnitude(r.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(r.center,i,n)};var mke=new h;function Wce(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,mke);e=te.fromCartesian3(i,n)}return e}function qce(e,t,n,i){l(i)||(i=new h);let r=$ce(e,t),o=0;for(let a=0,s=n.length;a<s;++a){let c=n[a],u=Xce(e,c,r);if(u<0)return;o=Math.max(o,u)}return Kce(r,o,i)}var W8=new h;function Yce(e,t,n,i,r,o){l(o)||(o=new h),i=i??3,r=r??h.ZERO;let a=$ce(e,t),s=0;for(let c=0,u=n.length;c<u;c+=i){W8.x=n[c]+r.x,W8.y=n[c+1]+r.y,W8.z=n[c+2]+r.z;let f=Xce(e,W8,a);if(f<0)return;s=Math.max(s,f)}return Kce(a,s,o)}function JW(e,t,n){let i=t,r=n,o=h.subtract(e,i,Hce),a=-h.dot(o,i);return!(r<0?a>0:a>r&&a*a/h.magnitudeSquared(o)>r)}var pke=new h,gke=new h;function Xce(e,t,n){let i=e.transformPositionToScaledSpace(t,pke),r=h.magnitudeSquared(i),o=Math.sqrt(r),a=h.divideByScalar(i,o,gke);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 Kce(e,t,n){if(!(t<=0||t===1/0||t!==t))return h.multiplyByScalar(e,t,n)}var $W=new h;function $ce(e,t){return h.equals(t,h.ZERO)?t:(e.transformPositionToScaledSpace(t,$W),h.normalize($W,$W))}var Ih=dp;var ZW={};ZW.computeDiscriminant=function(e,t,n){return t*t-4*e*n};function Jce(e,t,n){let i=e+t;return D.sign(e)!==D.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}ZW.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<D.EPSILON14)return[0,0];if(c>u&&u/c<D.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=Jce(r,-o,D.EPSILON14);if(a<0)return[];let s=-.5*Jce(t,D.sign(t)*Math.sqrt(a),D.EPSILON14);return t>0?[s/e,n/s]:[n/s,s/e]};var Il=ZW;var eq={};eq.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 QW(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),P=Math.sqrt(3)/2,R=Math.abs(Math.atan2(r*w,-T)/3);A=2*Math.sqrt(-x);let O=Math.cos(R);b=A*O;let N=A*(-O/2-P*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),O=Math.cos(R),b=A*O,N=A*(-O/2-P*Math.sin(R));let I=-s,M=b+N<2*a?b+a:N+a,F=I/M,V=v*M,k=-_*M-v*I,j=_*I,B=(a*k-o*j)/(-o*k+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]}eq.computeRealRoots=function(e,t,n,i){let r,o;if(e===0)return Il.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=Il.computeRealRoots(e,0,n),r.Length===0?[0]:[r[0],0,r[1]];return QW(e,0,n,i)}else{if(n===0)return i===0?(o=-t/e,o<0?[o,0,0]:[0,0,o]):QW(e,t,0,i);if(i===0)return r=Il.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 QW(e,t,n,i)};var Db=eq;var tq={};tq.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 Ph(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=Db.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)<D.EPSILON14){let d=Il.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=Il.computeRealRoots(1,d,p),y=Il.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 IP(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=Db.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,P;m===0&&C===0?(w=0,P=0):D.sign(m)===D.sign(C)?(w=m+C,P=d/w):(P=m-C,w=d/P);let R,O;y===0&&E===0?(R=0,O=0):D.sign(y)===D.sign(E)?(R=y+E,O=i/R):(O=y-E,R=i/O);let N=Il.computeRealRoots(1,w,R),_=Il.computeRealRoots(1,P,O);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[]}tq.computeRealRoots=function(e,t,n,i,r){if(Math.abs(e)<D.EPSILON15)return Db.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 Ph(o,a,s,c);case 1:return IP(o,a,s,c);case 2:return IP(o,a,s,c);case 3:return Ph(o,a,s,c);case 4:return Ph(o,a,s,c);case 5:return IP(o,a,s,c);case 6:return Ph(o,a,s,c);case 7:return Ph(o,a,s,c);case 8:return IP(o,a,s,c);case 9:return Ph(o,a,s,c);case 10:return Ph(o,a,s,c);case 11:return IP(o,a,s,c);case 12:return Ph(o,a,s,c);case 13:return Ph(o,a,s,c);case 14:return Ph(o,a,s,c);case 15:return Ph(o,a,s,c);default:return}};var PP=tq;var nq=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)}},dn=nq;var Jr={};Jr.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)<D.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 _ke=new h,yke=new h,ole=new h,Zce=new h,Qce=new h;Jr.rayTriangleParametric=function(e,t,n,i,r){r=r??!1;let o=e.origin,a=e.direction,s=h.subtract(n,t,_ke),c=h.subtract(i,t,yke),u=h.cross(a,c,ole),f=h.dot(s,u),d,p,g,m,y;if(r){if(f<D.EPSILON6||(d=h.subtract(o,t,Zce),g=h.dot(d,u),g<0||g>f)||(p=h.cross(d,s,Qce),m=h.dot(a,p),m<0||g+m>f))return;y=h.dot(c,p)/f}else{if(Math.abs(f)<D.EPSILON6)return;let A=1/f;if(d=h.subtract(o,t,Zce),g=h.dot(d,u)*A,g<0||g>1||(p=h.cross(d,s,Qce),m=h.dot(a,p)*A,m<0||g+m>1))return;y=h.dot(c,p)*A}return y};Jr.rayTriangle=function(e,t,n,i,r,o){let a=Jr.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 Ake=new dn;Jr.lineSegmentTriangle=function(e,t,n,i,r,o,a){let s=Ake;h.clone(e,s.origin),h.subtract(t,e,s.direction),h.normalize(s.direction,s.direction);let c=Jr.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 bke(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 xke={root0:0,root1:0};function ale(e,t,n){l(n)||(n=new Wo);let i=e.origin,r=e.direction,o=t.center,a=t.radius*t.radius,s=h.subtract(i,o,ole),c=h.dot(r,r),u=2*h.dot(r,s),f=h.magnitudeSquared(s)-a,d=bke(c,u,f,xke);if(l(d))return n.start=d.root0,n.stop=d.root1,n}Jr.raySphere=function(e,t,n){if(n=ale(e,t,n),!(!l(n)||n.stop<0))return n.start=Math.max(n.start,0),n};var Tke=new dn;Jr.lineSegmentSphere=function(e,t,n,i){let r=Tke;h.clone(e,r.origin);let o=h.subtract(t,e,r.direction),a=h.magnitude(o);if(h.normalize(o,o),i=ale(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 Cke=new h,vke=new h;Jr.rayEllipsoid=function(e,t){let n=t.oneOverRadii,i=h.multiplyComponents(n,e.origin,Cke),r=h.multiplyComponents(n,e.direction,vke),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 Wo(m,y):{start:y,stop:m}}let g=Math.sqrt(s/c);return new Wo(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 Wo(0,d/c);if(a<0)return c=h.magnitudeSquared(r),new Wo(0,-a/c)};var Eke=new Wo,Ske=new Wo,wke=new Wo;Jr.rayAxisAlignedBoundingBox=function(e,t,n){l(n)||(n=new Wo);let i=iq(e.origin.x,e.direction.x,t.minimum.x,t.maximum.x,Eke),r=iq(e.origin.y,e.direction.y,t.minimum.y,t.maximum.y,Ske),o=iq(e.origin.z,e.direction.z,t.minimum.z,t.maximum.z,wke);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 iq(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 Rb(e,t,n){let i=e+t;return D.sign(e)!==D.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}Jr.quadraticVectorExpression=function(e,t,n,i,r){let o=i*i,a=r*r,s=(e[$.COLUMN1ROW1]-e[$.COLUMN2ROW2])*a,c=r*(i*Rb(e[$.COLUMN1ROW0],e[$.COLUMN0ROW1],D.EPSILON15)+t.y),u=e[$.COLUMN0ROW0]*o+e[$.COLUMN2ROW2]*a+i*t.x+n,f=a*Rb(e[$.COLUMN2ROW1],e[$.COLUMN1ROW2],D.EPSILON15),d=r*(i*Rb(e[$.COLUMN2ROW0],e[$.COLUMN0ROW2])+t.z),p,g=[];if(d===0&&f===0){if(p=Il.computeRealRoots(s,c,u),p.length===0)return g;let R=p[0],O=Math.sqrt(Math.max(1-R*R,0));if(g.push(new h(i,r*R,r*-O)),g.push(new h(i,r*R,r*O)),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=PP.computeRealRoots(x,T,C,E,w);let P=p.length;if(P===0)return g;for(let R=0;R<P;++R){let O=p[R],N=O*O,_=Math.max(1-N,0),v=Math.sqrt(_),S;D.sign(s)===D.sign(u)?S=Rb(s*N+u,c*O,D.EPSILON12):D.sign(u)===D.sign(c*O)?S=Rb(s*N,c*O+u,D.EPSILON12):S=Rb(s*N+c*O,u,D.EPSILON12);let I=Rb(f*O,d,D.EPSILON15),M=S*I;M<0?g.push(new h(i,r*O,r*v)):M>0?g.push(new h(i,r*O,r*-v)):v!==0?(g.push(new h(i,r*O,r*-v)),g.push(new h(i,r*O,r*v)),++R):g.push(new h(i,r*O,r*v))}return g};var rq=new h,ele=new h,tle=new h,q8=new h,Ike=new h,Pke=new $,Dke=new $,Rke=new $,Oke=new $,Mke=new $,nle=new $,ile=new $,rle=new h,Lke=new h,Nke=new de;Jr.grazingAltitudeLocation=function(e,t){let n=e.origin,i=e.direction;if(!h.equals(n,h.ZERO)){let w=t.geodeticSurfaceNormal(n,rq);if(h.dot(i,w)>=0)return n}let r=l(this.rayEllipsoid(e,t)),o=t.transformPositionToScaledSpace(i,rq),a=h.normalize(o,o),s=h.mostOrthogonalAxis(o,q8),c=h.normalize(h.cross(s,a,ele),ele),u=h.normalize(h.cross(a,c,tle),tle),f=Pke;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,Dke),p=$.fromScale(t.radii,Rke),g=$.fromScale(t.oneOverRadii,Oke),m=Mke;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,nle),m,nle),A=$.multiply($.multiply(y,p,ile),f,ile),b=$.multiplyByVector(y,n,Ike),x=Jr.quadraticVectorExpression(A,h.negate(b,rq),0,0,1),T,C,E=x.length;if(E>0){let w=h.clone(h.ZERO,Lke),P=Number.NEGATIVE_INFINITY;for(let O=0;O<E;++O){T=$.multiplyByVector(p,$.multiplyByVector(f,x[O],rle),rle);let N=h.normalize(h.subtract(T,n,q8),q8),_=h.dot(N,i);_>P&&(P=_,w=h.clone(T,w))}let R=t.cartesianToCartographic(w,Nke);return P=D.clamp(P,0,1),C=h.magnitude(h.subtract(w,n,q8))*Math.sqrt(1-P*P),C=r?-C:C,R.height=C,t.cartographicToCartesian(R,new h)}};var Fke=new h;Jr.lineSegmentPlane=function(e,t,n,i){l(i)||(i=new h);let r=h.subtract(t,e,Fke),o=n.normal,a=h.dot(o,r);if(Math.abs(a)<D.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};Jr.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 Jr.lineSegmentPlane(e,t,i,f),Jr.lineSegmentPlane(e,n,i,d),{positions:[e,t,n,f,d],indices:[0,3,4,1,2,4,1,4,3]};if(s)return Jr.lineSegmentPlane(t,n,i,f),Jr.lineSegmentPlane(t,e,i,d),{positions:[e,t,n,f,d],indices:[1,3,4,2,0,4,2,4,3]};if(c)return Jr.lineSegmentPlane(n,e,i,f),Jr.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 Jr.lineSegmentPlane(e,n,i,f),Jr.lineSegmentPlane(t,n,i,d),{positions:[e,t,n,f,d],indices:[0,1,4,0,4,3,2,3,4]}}else return Jr.lineSegmentPlane(n,t,i,f),Jr.lineSegmentPlane(e,t,i,d),{positions:[e,t,n,f,d],indices:[2,0,4,2,4,3,1,3,4]};else return Jr.lineSegmentPlane(t,e,i,f),Jr.lineSegmentPlane(n,e,i,d),{positions:[e,t,n,f,d],indices:[1,2,4,1,4,3,0,3,4]}};var ci=Jr;function Is(e,t){this.normal=h.clone(e),this.distance=t}Is.fromPointNormal=function(e,t,n){let i=-h.dot(t,e);return l(n)?(h.clone(t,n.normal),n.distance=i,n):new Is(t,i)};var Bke=new h;Is.fromCartesian4=function(e,t){let n=h.fromCartesian4(e,Bke),i=e.w;return l(t)?(h.clone(n,t.normal),t.distance=i,t):new Is(n,i)};Is.getPointDistance=function(e,t){return h.dot(e.normal,t)+e.distance};var kke=new h;Is.projectPointOntoPlane=function(e,t,n){l(n)||(n=new h);let i=Is.getPointDistance(e,t),r=h.multiplyByScalar(e.normal,i,kke);return h.subtract(t,r,n)};var zke=new L,Uke=new ae,Vke=new h;Is.transform=function(e,t,n){let i=e.normal,r=e.distance,o=L.inverseTranspose(t,zke),a=ae.fromElements(i.x,i.y,i.z,r,Uke);a=L.multiplyByVector(o,a,a);let s=h.fromCartesian4(a,Vke);return a=ae.divideByScalar(a,h.magnitude(s),a),Is.fromCartesian4(a,n)};Is.clone=function(e,t){return l(t)?(h.clone(e.normal,t.normal),t.distance=e.distance,t):new Is(e.normal,e.distance)};Is.equals=function(e,t){return e.distance===t.distance&&h.equals(e.normal,t.normal)};Is.ORIGIN_XY_PLANE=Object.freeze(new Is(h.UNIT_Z,0));Is.ORIGIN_YZ_PLANE=Object.freeze(new Is(h.UNIT_X,0));Is.ORIGIN_ZX_PLANE=Object.freeze(new Is(h.UNIT_Y,0));var en=Is;var oq=new ae;function hp(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(L.getColumn(n,0,oq)),this._yAxis=h.fromCartesian4(L.getColumn(n,1,oq));let i=h.fromCartesian4(L.getColumn(n,2,oq));this._plane=en.fromPointNormal(e,i)}Object.defineProperties(hp.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 jke=new lf;hp.fromPoints=function(e,t){let n=lf.fromPoints(e,jke);return new hp(n.center,t)};var sle=new dn,Y8=new h;hp.prototype.projectPointOntoPlane=function(e,t){let n=sle;n.origin=e,h.normalize(e,n.direction);let i=ci.rayPlane(n,this._plane,Y8);if(l(i)||(h.negate(n.direction,n.direction),i=ci.rayPlane(n,this._plane,Y8)),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 z(o,a)}};hp.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};hp.prototype.projectPointToNearestOnPlane=function(e,t){l(t)||(t=new z);let n=sle;n.origin=e,h.clone(this._plane.normal,n.direction);let i=ci.rayPlane(n,this._plane,Y8);l(i)||(h.negate(n.direction,n.direction),i=ci.rayPlane(n,this._plane,Y8));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};hp.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 Hke=new h;hp.prototype.projectPointOntoEllipsoid=function(e,t){l(t)||(t=new h);let n=this._ellipsoid,i=this._origin,r=this._xAxis,o=this._yAxis,a=Hke;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};hp.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 Pa=hp;function or(e,t){this.center=h.clone(e??h.ZERO),this.halfAxes=$.clone(t??$.ZERO)}or.packedLength=h.packedLength+$.packedLength;or.pack=function(e,t,n){return n=n??0,h.pack(e.center,t,n),$.pack(e.halfAxes,t,n+h.packedLength),t};or.unpack=function(e,t,n){return t=t??0,l(n)||(n=new or),h.unpack(e,t,n.center),$.unpack(e,t+h.packedLength,n.halfAxes),n};var Gke=new h,Wke=new h,qke=new h,Yke=new h,Xke=new h,Kke=new h,$ke=new $,Jke={unitary:new $,diagonal:new $};or.fromPoints=function(e,t){if(l(t)||(t=new or),!l(e)||e.length===0)return t.halfAxes=$.ZERO,t.center=h.ZERO,t;let n,i=e.length,r=h.clone(e[0],Gke);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,Wke),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=$ke;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,Jke),y=$.clone(m.unitary,t.halfAxes),A=$.getColumn(y,0,Yke),b=$.getColumn(y,1,Xke),x=$.getColumn(y,2,Kke),T=-Number.MAX_VALUE,C=-Number.MAX_VALUE,E=-Number.MAX_VALUE,w=Number.MAX_VALUE,P=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),P=Math.min(h.dot(b,p),P),R=Math.min(h.dot(x,p),R);A=h.multiplyByScalar(A,.5*(w+T),A),b=h.multiplyByScalar(b,.5*(P+C),b),x=h.multiplyByScalar(x,.5*(R+E),x);let O=h.add(A,b,t.center);h.add(O,x,O);let N=qke;return N.x=T-w,N.y=C-P,N.z=E-R,h.multiplyByScalar(N,.5,N),$.multiplyByScale(t.halfAxes,N,t.halfAxes),t};var hle=new h,Zke=new h;function cle(e,t,n,i,r,o,a,s,c,u,f){l(f)||(f=new or);let d=f.halfAxes;$.setColumn(d,0,t,d),$.setColumn(d,1,n,d),$.setColumn(d,2,i,d);let p=hle;p.x=(r+o)/2,p.y=(a+s)/2,p.z=(c+u)/2;let g=Zke;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 lle=new de,Qke=new h,e3e=new de,t3e=new de,n3e=new de,i3e=new de,r3e=new de,o3e=new h,ule=new h,a3e=new h,fle=new h,s3e=new h,c3e=new z,l3e=new z,u3e=new z,f3e=new z,d3e=new z,h3e=new h,m3e=new h,p3e=new h,g3e=new h,_3e=new z,y3e=new h,A3e=new h,b3e=new h,x3e=new en(h.UNIT_X,0);or.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<=D.PI){let P=ie.center(e,lle),R=i.cartographicToCartesian(P,Qke),O=new Pa(R,i);d=O.plane;let N=P.longitude,_=e.south<0&&e.north>0?0:P.latitude,v=de.fromRadians(N,e.north,n,e3e),S=de.fromRadians(e.west,e.north,n,t3e),I=de.fromRadians(e.west,_,n,n3e),M=de.fromRadians(e.west,e.south,n,i3e),F=de.fromRadians(N,e.south,n,r3e),V=i.cartographicToCartesian(v,o3e),k=i.cartographicToCartesian(S,ule),j=i.cartographicToCartesian(I,a3e),B=i.cartographicToCartesian(M,fle),G=i.cartographicToCartesian(F,s3e),W=O.projectPointToNearestOnPlane(V,c3e),Q=O.projectPointToNearestOnPlane(k,l3e),q=O.projectPointToNearestOnPlane(j,u3e),J=O.projectPointToNearestOnPlane(B,f3e),Z=O.projectPointToNearestOnPlane(G,d3e);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=M.height=t,k=i.cartographicToCartesian(S,ule),B=i.cartographicToCartesian(M,fle),u=Math.min(en.getPointDistance(d,k),en.getPointDistance(d,B)),f=n,cle(O.origin,O.xAxis,O.yAxis,O.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,lle).longitude,A=h.fromRadians(y,m,n,i,h3e);A.z=0;let x=Math.abs(A.x)<D.EPSILON10&&Math.abs(A.y)<D.EPSILON10?h.UNIT_X:h.normalize(A,m3e),T=h.UNIT_Z,C=h.cross(x,T,p3e);d=en.fromPointNormal(A,x,x3e);let E=h.fromRadians(y+D.PI_OVER_TWO,m,n,i,g3e);a=h.dot(en.projectPointOntoPlane(d,E,_3e),C),o=-a,c=h.fromRadians(0,e.north,g?t:n,i,y3e).z,s=h.fromRadians(0,e.south,p?t:n,i,A3e).z;let w=h.fromRadians(e.east,m,n,i,b3e);return u=en.getPointDistance(d,w),f=0,cle(A,C,T,x,o,a,s,c,u,f,r)};or.fromTransformation=function(e,t){return l(t)||(t=new or),t.center=L.getTranslation(e,t.center),t.halfAxes=L.getMatrix3(e,t.halfAxes),t.halfAxes=$.multiplyByScalar(t.halfAxes,.5,t.halfAxes),t};or.clone=function(e,t){if(l(e))return l(t)?(h.clone(e.center,t.center),$.clone(e.halfAxes,t.halfAxes),t):new or(e.center,e.halfAxes)};or.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 mle=new h,ple=new h,gle=new h,T3e=new h,dle=new h,C3e=new h;or.distanceSquaredTo=function(e,t){let n=h.subtract(t,e.center,hle),i=e.halfAxes,r=$.getColumn(i,0,mle),o=$.getColumn(i,1,ple),a=$.getColumn(i,2,gle),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,dle),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,D.EPSILON3)&&(C=h.UNIT_X),y=h.cross(m,C,T3e),h.normalize(y,y),A=h.cross(m,y,dle),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=C3e;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 v3e=new h,E3e=new h;or.computePlaneDistances=function(e,t,n,i){l(i)||(i=new Wo);let r=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,a=e.center,s=e.halfAxes,c=$.getColumn(s,0,mle),u=$.getColumn(s,1,ple),f=$.getColumn(s,2,gle),d=h.add(c,u,v3e);h.add(d,f,d),h.add(d,a,d);let p=h.subtract(d,t,E3e),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 S3e=new h,w3e=new h,I3e=new h;or.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,S3e),o=$.getColumn(i,1,w3e),a=$.getColumn(i,2,I3e);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 P3e=new $;or.computeTransformation=function(e,t){l(t)||(t=new L);let n=e.center,i=$.multiplyByUniformScale(e.halfAxes,2,P3e);return L.fromRotationTranslation(i,n,t)};var D3e=new se;or.isOccluded=function(e,t){let n=se.fromOrientedBoundingBox(e,D3e);return!t.isBoundingSphereVisible(n)};or.prototype.intersectPlane=function(e){return or.intersectPlane(this,e)};or.prototype.distanceSquaredTo=function(e){return or.distanceSquaredTo(this,e)};or.prototype.computePlaneDistances=function(e,t,n){return or.computePlaneDistances(this,e,t,n)};or.prototype.computeCorners=function(e){return or.computeCorners(this,e)};or.prototype.computeTransformation=function(e){return or.computeTransformation(this,e)};or.prototype.isOccluded=function(e){return or.isOccluded(this,e)};or.equals=function(e,t){return e===t||l(e)&&l(t)&&h.equals(e.center,t.center)&&$.equals(e.halfAxes,t.halfAxes)};or.prototype.clone=function(e){return or.clone(this,e)};or.prototype.equals=function(e){return or.equals(this,e)};var Jt=or;var _le={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(_le);var ee=_le;var _n={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};_n.getSizeInBytes=function(e){switch(e){case _n.BYTE:return Int8Array.BYTES_PER_ELEMENT;case _n.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case _n.SHORT:return Int16Array.BYTES_PER_ELEMENT;case _n.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case _n.INT:return Int32Array.BYTES_PER_ELEMENT;case _n.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case _n.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case _n.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}};_n.fromTypedArray=function(e){if(e instanceof Int8Array)return _n.BYTE;if(e instanceof Uint8Array)return _n.UNSIGNED_BYTE;if(e instanceof Int16Array)return _n.SHORT;if(e instanceof Uint16Array)return _n.UNSIGNED_SHORT;if(e instanceof Int32Array)return _n.INT;if(e instanceof Uint32Array)return _n.UNSIGNED_INT;if(e instanceof Float32Array)return _n.FLOAT;if(e instanceof Float64Array)return _n.DOUBLE};_n.validate=function(e){return l(e)&&(e===_n.BYTE||e===_n.UNSIGNED_BYTE||e===_n.SHORT||e===_n.UNSIGNED_SHORT||e===_n.INT||e===_n.UNSIGNED_INT||e===_n.FLOAT||e===_n.DOUBLE)};_n.createTypedArray=function(e,t){switch(e){case _n.BYTE:return new Int8Array(t);case _n.UNSIGNED_BYTE:return new Uint8Array(t);case _n.SHORT:return new Int16Array(t);case _n.UNSIGNED_SHORT:return new Uint16Array(t);case _n.INT:return new Int32Array(t);case _n.UNSIGNED_INT:return new Uint32Array(t);case _n.FLOAT:return new Float32Array(t);case _n.DOUBLE:return new Float64Array(t)}};_n.createArrayBufferView=function(e,t,n,i){switch(n=n??0,i=i??(t.byteLength-n)/_n.getSizeInBytes(e),e){case _n.BYTE:return new Int8Array(t,n,i);case _n.UNSIGNED_BYTE:return new Uint8Array(t,n,i);case _n.SHORT:return new Int16Array(t,n,i);case _n.UNSIGNED_SHORT:return new Uint16Array(t,n,i);case _n.INT:return new Int32Array(t,n,i);case _n.UNSIGNED_INT:return new Uint32Array(t,n,i);case _n.FLOAT:return new Float32Array(t,n,i);case _n.DOUBLE:return new Float64Array(t,n,i)}};_n.fromName=function(e){switch(e){case"BYTE":return _n.BYTE;case"UNSIGNED_BYTE":return _n.UNSIGNED_BYTE;case"SHORT":return _n.SHORT;case"UNSIGNED_SHORT":return _n.UNSIGNED_SHORT;case"INT":return _n.INT;case"UNSIGNED_INT":return _n.UNSIGNED_INT;case"FLOAT":return _n.FLOAT;case"DOUBLE":return _n.DOUBLE}};_n.dequantize=function(e,t){switch(t){case _n.BYTE:return Math.max(e/127,-1);case _n.UNSIGNED_BYTE:return e/255;case _n.SHORT:return Math.max(e/32767,-1);case _n.UNSIGNED_SHORT:return e/65535;case _n.INT:return Math.max(e/2147483647,-1);case _n.UNSIGNED_INT:return e/4294967295}};Object.freeze(_n);var Y=_n;var bu=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,R3e),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,O3e),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=z.magnitude(z.fromElements(t[0],t[1],yle)),n.y=z.magnitude(z.fromElements(t[2],t[3],yle)),n}static getMaximumScale(t){return e.getScale(t,Ale),z.maximumComponent(Ale)}static setRotation(t,n,i){let r=e.getScale(t,M3e);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,L3e);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]})`}};bu.packedLength=4;bu.fromArray=bu.unpack;bu.IDENTITY=Object.freeze(new bu(1,0,0,1));bu.ZERO=Object.freeze(new bu(0,0,0,0));bu.COLUMN0ROW0=0;bu.COLUMN0ROW1=1;bu.COLUMN1ROW0=2;bu.COLUMN1ROW1=3;var R3e=new z,O3e=new z,yle=new z,Ale=new z,M3e=new z,L3e=new z,Ki=bu;var gr={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};gr.getMathType=function(e){switch(e){case gr.SCALAR:return Number;case gr.VEC2:return z;case gr.VEC3:return h;case gr.VEC4:return ae;case gr.MAT2:return Ki;case gr.MAT3:return $;case gr.MAT4:return L}};gr.getNumberOfComponents=function(e){switch(e){case gr.SCALAR:return 1;case gr.VEC2:return 2;case gr.VEC3:return 3;case gr.VEC4:case gr.MAT2:return 4;case gr.MAT3:return 9;case gr.MAT4:return 16}};gr.getAttributeLocationCount=function(e){switch(e){case gr.SCALAR:case gr.VEC2:case gr.VEC3:case gr.VEC4:return 1;case gr.MAT2:return 2;case gr.MAT3:return 3;case gr.MAT4:return 4}};gr.getGlslType=function(e){switch(e){case gr.SCALAR:return"float";case gr.VEC2:return"vec2";case gr.VEC3:return"vec3";case gr.VEC4:return"vec4";case gr.MAT2:return"mat2";case gr.MAT3:return"mat3";case gr.MAT4:return"mat4"}};Object.freeze(gr);var Vt=gr;var ble=1/256,N3e=65536,sq=256,Ir={};Ir.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))*D.signNotZero(i),n.y=(1-Math.abs(i))*D.signNotZero(r)}return n.x=D.toSNorm(n.x,t),n.y=D.toSNorm(n.y,t),n};Ir.octEncode=function(e,t){return Ir.octEncodeInRange(e,255,t)};var DP=new z,xle=new Uint8Array(1);function X8(e){return xle[0]=e,xle[0]}Ir.octEncodeToCartesian4=function(e,t){return Ir.octEncodeInRange(e,65535,DP),t.x=X8(DP.x*ble),t.y=X8(DP.x),t.z=X8(DP.y*ble),t.w=X8(DP.y),t};Ir.octDecodeInRange=function(e,t,n,i){if(i.x=D.fromSNorm(e,n),i.y=D.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))*D.signNotZero(r),i.y=(1-Math.abs(r))*D.signNotZero(i.y)}return h.normalize(i,i)};Ir.octDecode=function(e,t,n){return Ir.octDecodeInRange(e,t,255,n)};Ir.octDecodeFromCartesian4=function(e,t){let n=e.x,i=e.y,r=e.z,o=e.w,a=n*sq+i,s=r*sq+o;return Ir.octDecodeInRange(a,s,65535,t)};Ir.octPackFloat=function(e){return 256*e.x+e.y};var cq=new z;Ir.octEncodeFloat=function(e){return Ir.octEncode(e,cq),Ir.octPackFloat(cq)};Ir.octDecodeFloat=function(e,t){let n=e/256,i=Math.floor(n),r=(n-i)*256;return Ir.octDecode(i,r,t)};Ir.octPack=function(e,t,n,i){let r=Ir.octEncodeFloat(e),o=Ir.octEncodeFloat(t),a=Ir.octEncode(n,cq);return i.x=65536*a.x+r,i.y=65536*a.y+o,i};Ir.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;Ir.octDecodeFloat(a,t),Ir.octDecodeFloat(c,n),Ir.octDecode(o,s,i)};Ir.compressTextureCoordinates=function(e){let t=e.x*4095|0,n=e.y*4095|0;return 4096*t+n};Ir.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 aq(e){return e>>1^-(e&1)}Ir.zigZagDeltaDecode=function(e,t,n){let i=e.length,r=0,o=0,a=0;for(let s=0;s<i;++s)r+=aq(e[s]),o+=aq(t[s]),e[s]=r,t[s]=o,l(n)&&(a+=aq(n[s]),n[s]=a)};Ir.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};Ir.encodeRGB8=function(e){return Math.round(D.clamp(e.red*255,0,255))*N3e+Math.round(D.clamp(e.green*255,0,255))*sq+Math.round(D.clamp(e.blue*255,0,255))};Ir.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};Ir.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=Ir;var K8={};K8.getHeight=function(e,t,n){return(e-n)*t+n};var F3e=new de;K8.getPosition=function(e,t,n,i,r){let o=t.cartesianToCartographic(e,F3e);if(!l(o))return h.clone(e,r);let a=K8.getHeight(o.height,n,i);return h.fromRadians(o.longitude,o.latitude,a,t,r)};var fr=K8;var Tle={NONE:0,BITS12:1};Object.freeze(Tle);var Ps=Tle;var RP=new h,B3e=new h,gd=new z,k3e=new L,z3e=new L,U3e=Math.pow(2,12);function Ec(e,t,n,i,r,o,a,s,c,u){let f=Ps.NONE,d,p;if(l(t)&&l(n)&&l(i)&&l(r)){let g=t.minimum,m=t.maximum,y=h.subtract(m,g,B3e),A=i-n;Math.max(h.maximumComponent(y),A)<U3e-1?f=Ps.BITS12:f=Ps.NONE;let x=L.fromScale(y,k3e);x=L.setTranslation(x,g,x);let T=L.fromScale(h.fromElements(1/y.x,1/y.y,1/y.z,RP),z3e);T=L.multiplyByTranslation(T,h.negate(g,RP),T),p=L.clone(r,new L);let C=L.getTranslation(r,RP);C=h.subtract(C,e,RP),p=L.setTranslation(p,C,p),p=L.multiply(p,x,p),d=L.inverseTransformation(r,new L),d=L.multiply(T,d,d),r=L.multiply(r,x,new L)}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()}Ec.prototype.encode=function(e,t,n,i,r,o,a,s){let c=i.x,u=i.y;if(this.quantization===Ps.BITS12){n=L.multiplyByPoint(this.toScaledENU,n,RP),n.x=D.clamp(n.x,0,1),n.y=D.clamp(n.y,0,1),n.z=D.clamp(n.z,0,1);let f=this.maximumHeight-this.minimumHeight,d=D.clamp((r-this.minimumHeight)/f,0,1);z.fromElements(n.x,n.y,gd);let p=an.compressTextureCoordinates(gd);z.fromElements(n.z,d,gd);let g=an.compressTextureCoordinates(gd);z.fromElements(c,u,gd);let m=an.compressTextureCoordinates(gd);if(e[t++]=p,e[t++]=g,e[t++]=m,this.hasWebMercatorT){z.fromElements(a,0,gd);let y=an.compressTextureCoordinates(gd);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 V3e=new h,Cle=new h;Ec.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,V3e),c=n.geodeticSurfaceNormal(s,Cle),u=a*o+this._offsetGeodeticSurfaceNormal;t[u]=c.x,t[u+1]=c.y,t[u+2]=c.z}};Ec.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]}};Ec.prototype.decodePosition=function(e,t,n){if(l(n)||(n=new h),t*=this.stride,this.quantization===Ps.BITS12){let i=an.decompressTextureCoordinates(e[t],gd);n.x=i.x,n.y=i.y;let r=an.decompressTextureCoordinates(e[t+1],gd);return n.z=r.x,L.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)};Ec.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,Cle),s=this.decodeHeight(e,t),c=fr.getHeight(s,i,r)-s;n.x+=a.x*c,n.y+=a.y*c,n.z+=a.z*c}return n};Ec.prototype.decodeTextureCoordinates=function(e,t,n){return l(n)||(n=new z),t*=this.stride,this.quantization===Ps.BITS12?an.decompressTextureCoordinates(e[t+2],n):z.fromElements(e[t+4],e[t+5],n)};Ec.prototype.decodeHeight=function(e,t){return t*=this.stride,this.quantization===Ps.BITS12?an.decompressTextureCoordinates(e[t+1],gd).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight:e[t+3]};Ec.prototype.decodeWebMercatorT=function(e,t){return t*=this.stride,this.quantization===Ps.BITS12?an.decompressTextureCoordinates(e[t+3],gd).x:e[t+6]};Ec.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 z.fromElements(r,o,n)};Ec.prototype.decodeNormal=function(e,t,n){let i=t*this.stride+this._offsetVertexNormal;return an.octDecodeFloat(e[i],n)};Ec.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};Ec.prototype._calculateStrideAndOffsets=function(){let e=0;this.quantization===Ps.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 $8={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},J8={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};Ec.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===Ps.NONE){a($8.position3DAndHeight,4);let s=2;s+=this.hasWebMercatorT?1:0,s+=this.hasVertexNormals?1:0,a($8.textureCoordAndEncodedNormals,s),this.hasGeodeticSurfaceNormals&&a($8.geodeticSurfaceNormal,3)}else{let s=this.hasWebMercatorT||this.hasVertexNormals,c=this.hasWebMercatorT&&this.hasVertexNormals;a(J8.compressed0,s?4:3),c&&a(J8.compressed1,1),this.hasGeodeticSurfaceNormals&&a(J8.geodeticSurfaceNormal,3)}return o};Ec.prototype.getAttributeLocations=function(){return this.quantization===Ps.NONE?$8:J8};Ec.clone=function(e,t){if(l(e))return l(t)||(t=new Ec),t.quantization=e.quantization,t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.center=h.clone(e.center),t.toScaledENU=L.clone(e.toScaledENU),t.fromScaledENU=L.clone(e.fromScaledENU),t.matrix=L.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 uo=Ec;var OP=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 D.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)}};OP.MaximumLatitude=OP.mercatorAngleToGeodeticLatitude(Math.PI);var di=OP;var mp={};mp.DEFAULT_STRUCTURE=Object.freeze({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var lq=new h,j3e=new L,H3e=new h,G3e=new h;mp.computeVertices=function(e){let t=Math.cos,n=Math.sin,i=Math.sqrt,r=Math.atan,o=Math.exp,a=D.PI_OVER_TWO,s=D.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,P=l(w);w=P?w:h.ZERO;let R=e.includeWebMercatorT??!1,O=e.exaggeration??1,N=e.exaggerationRelativeHeight??0,v=O!==1,S=e.structure??mp.DEFAULT_STRUCTURE,I=S.heightScale??mp.DEFAULT_STRUCTURE.heightScale,M=S.heightOffset??mp.DEFAULT_STRUCTURE.heightOffset,F=S.elementsPerHeight??mp.DEFAULT_STRUCTURE.elementsPerHeight,V=S.stride??mp.DEFAULT_STRUCTURE.stride,k=S.elementMultiplier??mp.DEFAULT_STRUCTURE.elementMultiplier,j=S.isBigEndian??mp.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=L.inverseTransformation(Ce,j3e),ve,Ie;R&&(ve=di.geodeticLatitudeToMercatorAngle(T),Ie=1/(di.geodeticLatitudeToMercatorAngle(E)-ve));let Le=H3e;Le.x=Number.POSITIVE_INFINITY,Le.y=Number.POSITIVE_INFINITY,Le.z=Number.POSITIVE_INFINITY;let $e=G3e;$e.x=Number.NEGATIVE_INFINITY,$e.y=Number.NEGATIVE_INFINITY,$e.z=Number.NEGATIVE_INFINITY;let Xe=Number.POSITIVE_INFINITY,At=u*f,Ke=d>0?u*2+f*2:0,we=At+Ke,We=new Array(we),vt=new Array(we),ct=new Array(we),pn=R?new Array(we):[],Ht=v?new Array(we):[],bt=0,Dt=f,Pn=0,ot=u;p&&(--bt,++Dt,--Pn,++ot);let dt=1e-5;for(let ni=bt;ni<Dt;++ni){let En=ni;En<0&&(En=0),En>=f&&(En=f-1);let ii=A.north-Q*En;g?ii=s(ii):ii=a-2*r(o(-ii*y));let Sr=(ii-T)/(E-T);Sr=D.clamp(Sr,0,1);let Ea=ni===bt,Va=ni===Dt-1;d>0&&(Ea?ii+=dt*G:Va&&(ii-=dt*G));let rs=t(ii),os=n(ii),oo=ce*os,gi;R&&(gi=(di.geodeticLatitudeToMercatorAngle(ii)-ve)*Ie);for(let ao=Pn;ao<ot;++ao){let Ri=ao;Ri<0&&(Ri=0),Ri>=u&&(Ri=u-1);let Ho=En*(u*V)+Ri*V,Oi;if(F===1)Oi=c[Ho];else{Oi=0;let as;if(j)for(as=0;as<F;++as)Oi=Oi*k+c[Ho+as];else for(as=F-1;as>=0;--as)Oi=Oi*k+c[Ho+as]}Oi=Oi*I+M,le=Math.max(le,Oi),Ae=Math.min(Ae,Oi);let wr=A.west+W*Ri;g?wr=s(wr):wr=wr*y;let Sa=(wr-x)/(C-x);Sa=D.clamp(Sa,0,1);let Do=En*u+Ri;if(d>0){let as=ao===Pn,wa=ao===ot-1,ld=Ea||Va||as||wa;if((Ea||Va)&&(as||wa))continue;ld&&(Oi-=d,as?(Do=At+(f-En-1),wr-=dt*B):Va?Do=At+f+(u-Ri-1):wa?(Do=At+f+u+En,wr+=dt*B):Ea&&(Do=At+f+u+f+Ri))}let sd=rs*t(wr),cd=rs*n(wr),bc=J*sd,J_=Z*cd,ws=1/i(bc*sd+J_*cd+oo*os),Z_=bc*ws,si=J_*ws,Xs=oo*ws,Ks=new h;Ks.x=Z_+sd*Oi,Ks.y=si+cd*Oi,Ks.z=Xs+os*Oi,L.multiplyByPoint(ye,Ks,lq),h.minimumByComponent(lq,Le,Le),h.maximumByComponent(lq,$e,$e),Xe=Math.min(Xe,Oi),We[Do]=Ks,ct[Do]=new z(Sa,Sr),vt[Do]=Oi,R&&(pn[Do]=gi),v&&(Ht[Do]=m.geodeticSurfaceNormal(Ks))}}let Si=se.fromPoints(We),wn;l(b)&&(wn=Jt.fromRectangle(b,Ae,le,m));let Ni;P&&(Ni=new Ih(m).computeHorizonCullingPointPossiblyUnderEllipsoid(w,We,Ae));let dr=new lf(Le,$e,w),Fi=new uo(w,dr,Xe,le,Ce,!1,R,v,O,N),Yi=new Float32Array(we*Fi.stride),ai=0;for(let ni=0;ni<we;++ni)ai=Fi.encode(Yi,ai,We[ni],ct[ni],vt[ni],void 0,pn[ni],Ht[ni]);return{vertices:Yi,maximumHeight:le,minimumHeight:Ae,encoding:Fi,boundingSphere3D:Si,orientedBoundingBox:wn,occludeePointInScaledSpace:Ni}};var Dv=mp;var vle=Go(af(),1);function W3e(){return!0}function q3e(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=W3e}var ue=q3e;function Ele(){if(!l(ec._canTransferArrayBuffer)){let e=dq("transferTypedArrayTest");e.postMessage=e.webkitPostMessage??e.postMessage;let t=99,n=new Int8Array([t]);try{e.postMessage({array:n},[n.buffer])}catch{return ec._canTransferArrayBuffer=!1,ec._canTransferArrayBuffer}ec._canTransferArrayBuffer=new Promise(i=>{e.onmessage=function(r){let o=r.data.array,a=l(o)&&o[0]===t;i(a),e.terminate(),ec._canTransferArrayBuffer=a}})}return ec._canTransferArrayBuffer}var fq=new be;function uq(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 dq(e){let t=new vle.default(e),n=t.scheme().length!==0&&t.fragment().length===0,i=e.replace(/\.js$/,""),r={},o,a;if(iy(e))a=e;else if(!n){let s=$t(`${ec._workerModulePrefix}/${i}.js`);iy(s)&&(a=s)}if(a){let s=`import "${a}";`;return o=uq(s),r.type="module",new Worker(o,r)}if(!n&&typeof CESIUM_WORKERS<"u"){let s=`
importScripts("${uq(CESIUM_WORKERS)}");
CesiumWorkers["${i}"]();
`;return o=uq(s),new Worker(o,r)}if(o=e,n||(o=$t(`${ec._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 Y3e(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 ec(e,t){this._workerPath=e,this._maximumActiveTasks=t??Number.POSITIVE_INFINITY,this._activeTasks=0,this._nextID=0,this._webAssemblyPromise=void 0}var X3e=(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),fq.raiseEvent(a),i(a)}else fq.raiseEvent(),n(o.result);e.removeEventListener("message",r)}};return r},K3e=[];async function $3e(e,t,n){let i=await Promise.resolve(Ele());l(n)?i||(n.length=0):n=K3e;let r=e._nextID++,o=new Promise((a,s)=>{e._worker.addEventListener("message",X3e(e._worker,r,a,s))});return e._worker.postMessage({id:r,baseUrl:$t.getCesiumBaseUrl().url,parameters:t,canTransferArrayBuffer:i},n),o}async function J3e(e,t,n){++e._activeTasks;try{let i=await $3e(e,t,n);return--e._activeTasks,i}catch(i){throw--e._activeTasks,i}}ec.prototype.scheduleTask=function(e,t){if(l(this._worker)||(this._worker=dq(this._workerPath)),!(this._activeTasks>=this._maximumActiveTasks))return J3e(this,e,t)};ec.prototype.initWebAssemblyModule=async function(e){if(l(this._webAssemblyPromise))return this._webAssemblyPromise;let t=async()=>{let n=this._worker=dq(this._workerPath),i=await Y3e(this,e),r=await Promise.resolve(Ele()),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};ec.prototype.isDestroyed=function(){return!1};ec.prototype.destroy=function(){return l(this._worker)&&this._worker.terminate(),ue(this)};ec.taskCompletedEvent=fq;ec._defaultWorkerModulePrefix="Workers/";ec._workerModulePrefix=ec._defaultWorkerModulePrefix;ec._canTransferArrayBuffer=void 0;var Yn=ec;function uy(){pe.throwInstantiationError()}Object.defineProperties(uy.prototype,{credits:{get:pe.throwInstantiationError},waterMask:{get:pe.throwInstantiationError}});uy.prototype.interpolateHeight=pe.throwInstantiationError;uy.prototype.isChildAvailable=pe.throwInstantiationError;uy.prototype.createMesh=pe.throwInstantiationError;uy.prototype.upsample=pe.throwInstantiationError;uy.prototype.wasCreatedByUpsampling=pe.throwInstantiationError;uy.maximumAsynchronousTasks=5;var xu=uy;var MP={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};MP.getMorphTime=function(e){return e===MP.SCENE3D?1:e===MP.MORPHING?void 0:0};Object.freeze(MP);var re=MP;var Z3e=3,mq=class{constructor(t,n,i){this._vertices=t,this._indices=n,this._encoding=i,this._inverseTransform=new L,this._needsRebuild=!0,this._rootNode=new pq}get needsRebuild(){return this._needsRebuild}set needsRebuild(t){this._needsRebuild=t}rayIntersect(t,n,i,r,o){this._needsRebuild&&tze(this,n);let a=this._inverseTransform,s=eze;s.origin=L.multiplyByPoint(a,t.origin,s.origin),s.direction=L.multiplyByPointAsVector(a,t.direction,s.direction);let c=[];return wle(this._rootNode,s,c),aze(this,c,t,i,r,o)}},Q3e=new Yn("incrementallyBuildTerrainPicker"),pq=class e{constructor(){this.x=0,this.y=0,this.level=0,this.aabb=Sle(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=Sle(n.x,n.y,n.level),this.children[t]=n}},eze=new dn,Z8=[new h,new h,new h];function tze(e,t){L.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 nze=new h,ize=new h;function Sle(e,t,n){let i=1/Math.pow(2,n),r=h.fromElements(e*i-.5,t*i-.5,-.5,nze),o=h.fromElements((e+1)*i-.5,(t+1)*i-.5,.5,ize);return lf.fromCorners(r,o)}function rze(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 oze=new Wo;function wle(e,t,n){let i=ci.rayAxisAlignedBoundingBox(t,e.aabb,oze);if(!l(i))return;if(!e.children.length||e.buildingChildren){n.push({node:e,interval:new Wo(i.start,i.stop)});return}for(let o=0;o<e.children.length;o++)wle(e.children[o],t,n)}function aze(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=sze(e,n,u.node,i,r,o);if(s=Math.min(f,s),s!==Number.MAX_VALUE)break}if(s!==Number.MAX_VALUE)return dn.getPoint(n,s)}function sze(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>=Z3e)&&!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=hq(s,r,o,t,u,c[3*A],Z8[0]),x=hq(s,r,o,t,u,c[3*A+1],Z8[1]),T=hq(s,r,o,t,u,c[3*A+2],Z8[2]),C=ci.rayTriangleParametric(t,b,x,T,i);l(C)&&C<a&&C>=0&&(a=C),p&&rze(g,m,Z8,A,y)}if(p){for(let y=0;y<4;y++)n.addChild(y);lze(e._inverseTransform,n,m,g)}return a}var cze=new de;function hq(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,cze);s=n.project(u,a),s=h.fromElements(s.z,s.x,s.y,a);let f=D.TWO_PI*n.ellipsoid.maximumRadius,d=Math.round((i.origin.y-s.y)/f);return s.y+=d*f,s}async function lze(e,t,n,i){t.buildingChildren=!0;let r=new Float64Array(16);L.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=Q3e.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 LP=mq;function NP(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 L,this._lastPickSceneMode=void 0,this._terrainPicker=new LP(t,n,p)}NP.prototype.getTransform=function(e,t){return this._lastPickSceneMode===e?this._transform:(this._terrainPicker.needsRebuild=!0,!l(e)||e===re.SCENE3D?uze(this,this._transform):_ze(this,t,this._transform))};function uze(e,t){let n=e.encoding.exaggeration,i=e.encoding.exaggerationRelativeHeight,r=fr.getHeight(e.minimumHeight,n,i),o=fr.getHeight(e.maximumHeight,n,i),a=Jt.fromRectangle(e.rectangle,r,o,te.default,e.orientedBoundingBox);return Jt.computeTransformation(a,t),L.getScale(t,gq).z<=D.EPSILON16&&(gq.z=1,L.setScale(t,gq,t)),t}var fze=new h,dze=new h,hze=new de,mze=new de,pze=new h,gze=new h,gq=new h;function _ze(e,t,n){let i=e.encoding.exaggeration,r=e.encoding.exaggerationRelativeHeight,o=fr.getHeight(e.minimumHeight,i,r),a=fr.getHeight(e.maximumHeight,i,r),s=t.project(de.fromRadians(e.rectangle.west,e.rectangle.south,0,hze),fze),c=t.project(de.fromRadians(e.rectangle.east,e.rectangle.north,0,mze),dze),u=a-o,f=h.fromElements(c.x-s.x,c.y-s.y,u>0?u:1,pze),d=h.fromElements(s.x+f.x*.5,s.y+f.y*.5,o+f.z*.5,gze);return L.fromTranslation(d,n),L.setScale(n,f,n),L.multiply(mt.SWIZZLE_3D_TO_2D_MATRIX,n,n),n}NP.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};NP.prototype.updateExaggeration=function(e,t){this._terrainPicker._vertices=this.vertices,this._terrainPicker.needsRebuild=!0,this._lastPickSceneMode=void 0};NP.prototype.updateSceneMode=function(e){this._terrainPicker.needsRebuild=!0,this._lastPickSceneMode=void 0};var tc=NP;var ls={UNSIGNED_BYTE:ee.UNSIGNED_BYTE,UNSIGNED_SHORT:ee.UNSIGNED_SHORT,UNSIGNED_INT:ee.UNSIGNED_INT};ls.getSizeInBytes=function(e){switch(e){case ls.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case ls.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case ls.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}};ls.fromSizeInBytes=function(e){switch(e){case 2:return ls.UNSIGNED_SHORT;case 4:return ls.UNSIGNED_INT;case 1:return ls.UNSIGNED_BYTE}};ls.validate=function(e){return l(e)&&(e===ls.UNSIGNED_BYTE||e===ls.UNSIGNED_SHORT||e===ls.UNSIGNED_INT)};ls.createTypedArray=function(e,t){return e>=D.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)};ls.createTypedArrayFromArrayBuffer=function(e,t,n,i){return e>=D.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)};ls.fromTypedArray=function(e){if(e instanceof Uint8Array)return ls.UNSIGNED_BYTE;if(e instanceof Uint16Array)return ls.UNSIGNED_SHORT;if(e instanceof Uint32Array)return ls.UNSIGNED_INT};Object.freeze(ls);var Ve=ls;function Da(){pe.throwInstantiationError()}Object.defineProperties(Da.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 Ile=[];Da.getRegularGridIndices=function(e,t){let n=Ile[e];l(n)||(Ile[e]=n=[]);let i=n[t];return l(i)||(e*t<D.SIXTY_FOUR_KILOBYTES?i=n[t]=new Uint16Array((e-1)*(t-1)*6):i=n[t]=new Uint32Array((e-1)*(t-1)*6),Ole(e,t,i,0)),i};var Ple=[];Da.getRegularGridIndicesAndEdgeIndices=function(e,t){let n=Ple[e];l(n)||(Ple[e]=n=[]);let i=n[t];if(!l(i)){let r=Da.getRegularGridIndices(e,t),o=Rle(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 Dle=[];Da.getRegularGridAndSkirtIndicesAndEdgeIndices=function(e,t){let n=Dle[e];l(n)||(Dle[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=Rle(e,t),d=f.westIndicesSouthToNorth,p=f.southIndicesEastToWest,g=f.eastIndicesNorthToSouth,m=f.northIndicesWestToEast,y=Ve.createTypedArray(c,u);Ole(e,t,y,0),Da.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};Da.getSkirtVertexCount=function(e,t,n,i){return e.length+t.length+n.length+i.length};Da.getSkirtIndexCount=function(e){return(e-4)*2*3};Da.getSkirtIndexCountWithFilledCorners=function(e){return((e-4)*2+4)*3};Da.addSkirtIndices=function(e,t,n,i,r,o,a){let s=r;a=Q8(e,s,o,a),s+=e.length,a=Q8(t,s,o,a),s+=t.length,a=Q8(n,s,o,a),s+=n.length,Q8(i,s,o,a)};Da.addSkirtIndicesWithFilledCorners=function(e,t,n,i,r,o,a){Da.addSkirtIndices(e,t,n,i,r,o,a);let s=Da.getSkirtVertexCount(e,t,n,i),c=Da.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 Rle(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 Ole(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 Q8(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}Da.heightmapTerrainQuality=.25;Da.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,n){return e.maximumRadius*2*Math.PI*Da.heightmapTerrainQuality/(t*n)};Da.prototype.requestTileGeometry=pe.throwInstantiationError;Da.prototype.getLevelMaximumGeometricError=pe.throwInstantiationError;Da.prototype.getTileDataAvailable=pe.throwInstantiationError;Da.prototype.loadTileDataAvailability=pe.throwInstantiationError;var Vr=Da;function k0(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??pd.NONE;let t=Dv.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===pd.LERC?Float32Array:this._buffer.constructor,this._mesh=void 0}Object.defineProperties(k0.prototype,{credits:{get:function(){}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}}});var Mle="createVerticesFromHeightmap",yze=new Yn(Mle),Aze=new Yn(Mle,xu.maximumAsynchronousTasks);k0.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?Aze:yze).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 Bi,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 tc(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),uo.clone(x.encoding),T.westIndicesSouthToNorth,T.southIndicesEastToWest,T.eastIndicesNorthToSouth,T.northIndicesWestToEast),b._buffer=void 0,b._mesh})};k0.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=Dv.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 Bi,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 tc(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};k0.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===pd.LERC;if(!p&&g)return;let y;if(p){let A=this._mesh.vertices,b=this._mesh.encoding;y=Lle(A,b,f,d,e,i,r,t,n)}else y=bze(this._buffer,s,c,a,u,e,i,r,t,n),y=y*d+f;return y};k0.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 P=0;P<u;++P){let R=D.lerp(A.north,A.south,P/(u-1));for(let O=0;O<c;++O){let N=D.lerp(A.west,A.east,O/(c-1)),_=Lle(g,m,b,x,y,c,u,N,R);_=_<f.lowestEncodedHeight?f.lowestEncodedHeight:_,_=_>f.highestEncodedHeight?f.highestEncodedHeight:_,xze(p,T,C,w,d,E,P*c+O,_)}}return Promise.resolve(new k0({buffer:p,width:c,height:u,childTileMask:0,structure:this._structure,createdByUpsampling:!0}))};k0.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};k0.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};function bze(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=ej(e,t,n,i,r,m*a+p),T=ej(e,t,n,i,r,m*a+g),C=ej(e,t,n,i,r,y*a+p),E=ej(e,t,n,i,r,y*a+g);return Nle(A,b,x,T,C,E)}function Lle(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 Nle(y,A,b,x,T,C)}function Nle(e,t,n,i,r,o){return t<e?n+e*(i-n)+t*(o-i):n+e*(o-r)+t*(r-n)}function ej(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 xze(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 Sc=k0;function Mv(e,t){this._tilingScheme=e,this._maximumLevel=t,this._rootNodes=[]}var Ob=new ie;function Tze(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}Mv.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)Tze(e,g,p,a)||a.push(new Rv(o,void 0,0,g,p));o.tileXYToRectangle(t,n,e,Ob);let s=Ob.west,c=Ob.north;o.tileXYToRectangle(i,r,e,Ob);let u=Ob.east,f=Ob.south,d=new wze(e,s,f,u,c);for(let p=0;p<a.length;++p){let g=a[p];_q(g.extent,d)&&Ize(this._maximumLevel,g,d)}};Mv.prototype.computeMaximumLevelAtPosition=function(e){let t;for(let n=0;n<this._rootNodes.length;++n){let i=this._rootNodes[n];if(Ov(i.extent,e)){t=i;break}}return l(t)?FP(void 0,t,e):-1};var Cze=[],vze=[],Eze=new ie,Sze=new ie;Mv.prototype.computeBestAvailableLevelOverRectangle=function(e){let t=Cze;t.length=0,e.east<e.west?(t.push(ie.fromRadians(-Math.PI,e.south,e.east,e.north,Eze)),t.push(ie.fromRadians(e.west,e.south,Math.PI,e.north,Sze))):t.push(e);let n=vze;n.length=0;let i;for(i=0;i<this._rootNodes.length;++i)BP(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 Fle=new de;Mv.prototype.isTileAvailable=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(t,n,e,Ob);return ie.center(i,Fle),this.computeMaximumLevelAtPosition(Fle)>=e};Mv.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 Rv(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(Rv.prototype,{nw:{get:function(){return this._nw||(this._nw=new Rv(this.tilingScheme,this,this.level+1,this.x*2,this.y*2)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new Rv(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new Rv(this.tilingScheme,this,this.level+1,this.x*2,this.y*2+1)),this._sw}},se:{get:function(){return this._se||(this._se=new Rv(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2+1)),this._se}}});function wze(e,t,n,i,r){this.level=e,this.west=t,this.south=n,this.east=i,this.north=r}function _q(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 Ize(e,t,n){for(;t.level<e;)if(tj(t.nw.extent,n))t=t.nw;else if(tj(t.ne.extent,n))t=t.ne;else if(tj(t.sw.extent,n))t=t.sw;else if(tj(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=Ar(t.rectangles,n.level,Pze);i<0&&(i=~i),t.rectangles.splice(i,0,n)}}function Pze(e,t){return e.level-t}function tj(e,t){return t.west>=e.west&&t.east<=e.east&&t.south>=e.south&&t.north<=e.north}function Ov(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north}function FP(e,t,n){let i=0,r=!1;for(;!r;){let o=t._nw&&Ov(t._nw.extent,n),a=t._ne&&Ov(t._ne.extent,n),s=t._sw&&Ov(t._sw.extent,n),c=t._se&&Ov(t._se.extent,n);if(o+a+s+c>1){o&&(i=Math.max(i,FP(t,t._nw,n))),a&&(i=Math.max(i,FP(t,t._ne,n))),s&&(i=Math.max(i,FP(t,t._sw,n))),c&&(i=Math.max(i,FP(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];Ov(s,n)&&(i=s.level)}t=t.parent}return i}function BP(e,t,n){if(!t)return;let i,r=!1;for(i=0;i<n.length;++i)r=r||_q(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]=Dze(e[a.level],a)}BP(e,t._nw,n),BP(e,t._ne,n),BP(e,t._sw,n),BP(e,t._se,n)}function Dze(e,t){let n=[];for(let i=0;i<e.length;++i){let r=e[i];_q(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 Dh=Mv;function Rze(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 pp=Rze;function nj(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}nj.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 nj(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}": ${pp(i)}`),c};nj.reportSuccess=function(e){l(e)&&(e.timesRetried=-1)};var Hr=nj;var yq=new de,Aq=new de,Ble=new h,kle=new h,bq=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 di(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 z(-r,-r),this._rectangleNortheastInMeters=new z(r,r)}let{x:n,y:i}=this._rectangleSouthwestInMeters;h.fromElements(n,i,0,Ble),this._projection.unproject(Ble,yq),{x:n,y:i}=this._rectangleNortheastInMeters,h.fromElements(n,i,0,kle),this._projection.unproject(kle,Aq),this._rectangle=new ie(yq.longitude,yq.latitude,Aq.longitude,Aq.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 z(y,A)}},To=bq;var Oze=15;function zle(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}zle.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 Mze(e,t){let n=t.copyrightText;l(n)&&(e.credit=new St(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 Xi(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 z(o.xmin,o.ymin),a.rectangleNortheastInMeters=new z(o.xmax,o.ymax),e.tilingScheme=new To(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"?pd.LERC:pd.NONE,e.lodCount=s.lods.length-1,(e.hasAvailability=t.capabilities.indexOf("Tilemap")!==-1)&&(e.tilesAvailable=new Dh(e.tilingScheme,e.lodCount),e.tilesAvailable.addAvailableTileRange(0,0,0,e.tilingScheme.getNumberOfXTilesAtLevel(0),e.tilingScheme.getNumberOfYTilesAtLevel(0)),e.tilesAvailabilityLoaded=new Dh(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 Lze(e,t,n){try{let i=await t.fetchJson();Mze(e,i)}catch(i){let r=`An error occurred while accessing ${t}.`;throw Hr.reportError(void 0,n,l(n)?n._errorEvent:void 0,r),i}}function fy(){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(fy.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}}});fy.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 zle(t);await Lze(r,i);let o=new fy(t);return r.build(o),o._resource=n,o};fy.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(xq(this,n+1,e*2,t*2))){let d=Ule(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 Sc({buffer:d[0],width:u._width,height:u._height,childTileMask:o?f.computeChildMaskForTile(n,e,t):Oze,structure:u._terrainDataStructure,encoding:u._encoding})}).catch(async function(d){if(l(s)&&s.state===yi.CANCELLED){i.cancel();try{await i.deferred?.promise}catch{}return i.state=yi.CANCELLED,Promise.reject(d)}return Promise.reject(d)})};function xq(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}fy.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};fy.prototype.getTileDataAvailable=function(e,t,n){if(!this._hasAvailability)return;let i=xq(this,n,e,t);if(l(i))return i;Ule(this,n,e,t)};fy.prototype.loadTileDataAvailability=function(e,t,n){};function Nze(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 z(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 z(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 z(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 Fze(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 z(0,0)];for(;s.length>0;){let c=s.pop(),u=Nze(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 Ule(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 bo({throttle:!1,throttleByServer:!0,type:Ha.TERRAIN}),d=e._resource.getDerivedResource({url:s,request:u}).fetchJson();return l(d)?(d=d.then(function(p){let g=Fze(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 xq(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 Tq=fy;var Vle={NONE:0,GEODESIC:1,RHUMB:2};Object.freeze(Vle);var sn=Vle;var jle={XTRANSLATE:"xTranslate",YTRANSLATE:"yTranslate",ZTRANSLATE:"zTranslate",XROTATE:"xRotate",YROTATE:"yRotate",ZROTATE:"zRotate",XSCALE:"xScale",YSCALE:"yScale",ZSCALE:"zScale",UNIFORMSCALE:"uniformScale"};Object.freeze(jle);var Wc=jle;var Cq=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)}},kt=Cq;var Hle="https://dev.virtualearth.net/REST/v1/Locations";function vq(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:Hle,queryParameters:n}),this._credit=new St('<img src="http://dev.virtualearth.net/Branding/logo_powered_by.png"/>',!1)}Object.defineProperties(vq.prototype,{url:{get:function(){return Hle}},key:{get:function(){return this._key}},credit:{get:function(){return this._credit}}});vq.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 Eq=vq;function sa(e,t,n,i){this.x=e??0,this.y=t??0,this.width=n??0,this.height=i??0}sa.packedLength=4;sa.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};sa.unpack=function(e,t,n){return t=t??0,l(n)||(n=new sa),n.x=e[t++],n.y=e[t++],n.width=e[t++],n.height=e[t],n};sa.fromPoints=function(e,t){if(l(t)||(t=new sa),!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 Gle=new Bi,Bze=new de,kze=new de;sa.fromRectangle=function(e,t,n){if(l(n)||(n=new sa),!l(e))return n.x=0,n.y=0,n.width=0,n.height=0,n;Gle._ellipsoid=te.default,t=t??Gle;let i=t.project(ie.southwest(e,Bze)),r=t.project(ie.northeast(e,kze));return z.subtract(r,i,r),n.x=i.x,n.y=i.y,n.width=r.x,n.height=r.y,n};sa.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 sa(e.x,e.y,e.width,e.height)};sa.union=function(e,t,n){l(n)||(n=new sa);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};sa.expand=function(e,t,n){n=sa.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};sa.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};sa.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};sa.prototype.clone=function(e){return sa.clone(this,e)};sa.prototype.intersect=function(e){return sa.intersect(this,e)};sa.prototype.equals=function(e){return sa.equals(this,e)};var Je=sa;var Wle={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};Object.freeze(Wle);var _d=Wle;var nc={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};nc.isLines=function(e){return e===nc.LINES||e===nc.LINE_LOOP||e===nc.LINE_STRIP};nc.isTriangles=function(e){return e===nc.TRIANGLES||e===nc.TRIANGLE_STRIP||e===nc.TRIANGLE_FAN};nc.validate=function(e){return e===nc.POINTS||e===nc.LINES||e===nc.LINE_LOOP||e===nc.LINE_STRIP||e===nc.TRIANGLES||e===nc.TRIANGLE_STRIP||e===nc.TRIANGLE_FAN};Object.freeze(nc);var Re=nc;function Sq(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??_d.NONE,this.boundingSphereCV=e.boundingSphereCV,this.offsetAttribute=e.offsetAttribute}Sq.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 zze=new de,Uze=new h,qle=new L,Vze=[new de,new de,new de],jze=[new z,new z,new z],Hze=[new z,new z,new z],Gze=new h,Wze=new Fe,qze=new L,Yze=new Ki;Sq._textureCoordinateRotationPoints=function(e,t,n,i){let r,o=ie.center(i,zze),a=de.toCartesian(o,n,Uze),s=mt.eastNorthUpToFixedFrame(a,n,qle),c=L.inverse(s,qle),u=jze,f=Vze;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=Gze;for(r=0;r<3;r++)de.toCartesian(f[r],n,d),d=L.multiplyByPointAsVector(c,d,d),u[r].x=d.x,u[r].y=d.y;let p=Fe.fromAxisAngle(h.UNIT_Z,-t,Wze),g=$.fromQuaternion(p,qze),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=L.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=Ki.fromRotation(t,Yze),C=Hze;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,P=u[1].y-E.y;for(r=0;r<3;r++){let v=C[r];Ki.multiplyByVector(T,v,v),v.x=(v.x-E.x)/w,v.y=(v.y-E.y)/P}let R=C[0],O=C[1],N=C[2],_=new Array(6);return z.pack(R,_),z.pack(O,_,2),z.pack(N,_,4),_};var xt=Sq;function Xze(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=Xze;function Kze(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 bn=Kze;var Yle={NONE:0,TOP:1,ALL:2};Object.freeze(Yle);var hn=Yle;function Ga(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}Ga.POSITION_ONLY=Object.freeze(new Ga({position:!0}));Ga.POSITION_AND_NORMAL=Object.freeze(new Ga({position:!0,normal:!0}));Ga.POSITION_NORMAL_AND_ST=Object.freeze(new Ga({position:!0,normal:!0,st:!0}));Ga.POSITION_AND_ST=Object.freeze(new Ga({position:!0,st:!0}));Ga.POSITION_AND_COLOR=Object.freeze(new Ga({position:!0,color:!0}));Ga.ALL=Object.freeze(new Ga({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0}));Ga.DEFAULT=Ga.POSITION_NORMAL_AND_ST;Ga.packedLength=6;Ga.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};Ga.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Ga),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};Ga.clone=function(e,t){if(l(e))return l(t)||(t=new Ga),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=Ga;var $ze=new h;function uf(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"}uf.fromDimensions=function(e){e=e??H.EMPTY_OBJECT;let t=e.dimensions,n=h.multiplyByScalar(t,.5,new h);return new uf({minimum:h.negate(n,new h),maximum:n,vertexFormat:e.vertexFormat,offsetAttribute:e.offsetAttribute})};uf.fromAxisAlignedBoundingBox=function(e){return new uf({minimum:e.minimum,maximum:e.maximum})};uf.packedLength=2*h.packedLength+Be.packedLength+1;uf.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 Kle=new h,$le=new h,Jle=new Be,Xle={minimum:Kle,maximum:$le,vertexFormat:Jle,offsetAttribute:void 0};uf.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,Kle),r=h.unpack(e,t+h.packedLength,$le),o=Be.unpack(e,t+2*h.packedLength,Jle),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):(Xle.offsetAttribute=a===-1?void 0:a,new uf(Xle))};uf.createGeometry=function(e){let t=e._minimum,n=e._maximum,i=e._vertexFormat;if(h.equals(t,n))return;let r=new bn,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,$ze),c=h.magnitude(s)*.5;if(l(e._offsetAttribute)){let u=a.length,f=e._offsetAttribute===hn.NONE?0:1,d=new Uint8Array(u/3).fill(f);r.applyOffset=new Me({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}return new xt({attributes:r,indices:o,primitiveType:Re.TRIANGLES,boundingSphere:new se(h.ZERO,c),offsetAttribute:e._offsetAttribute})};var wq;uf.getUnitBox=function(){return l(wq)||(wq=uf.createGeometry(uf.fromDimensions({dimensions:new h(1,1,1),vertexFormat:Be.POSITION_ONLY}))),wq};var wc=uf;var Jze=new h;function gp(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"}gp.fromDimensions=function(e){e=e??H.EMPTY_OBJECT;let t=e.dimensions,n=h.multiplyByScalar(t,.5,new h);return new gp({minimum:h.negate(n,new h),maximum:n,offsetAttribute:e.offsetAttribute})};gp.fromAxisAlignedBoundingBox=function(e){return new gp({minimum:e.minimum,maximum:e.maximum})};gp.packedLength=2*h.packedLength+1;gp.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 Qle=new h,eue=new h,Zle={minimum:Qle,maximum:eue,offsetAttribute:void 0};gp.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,Qle),r=h.unpack(e,t+h.packedLength,eue),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):(Zle.offsetAttribute=o===-1?void 0:o,new gp(Zle))};gp.createGeometry=function(e){let t=e._min,n=e._max;if(h.equals(t,n))return;let i=new bn,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,Jze),s=h.magnitude(a)*.5;if(l(e._offsetAttribute)){let c=o.length,u=e._offsetAttribute===hn.NONE?0:1,f=new Uint8Array(c/3).fill(u);i.applyOffset=new Me({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}return new xt({attributes:i,indices:r,primitiveType:Re.LINES,boundingSphere:new se(h.ZERO,s),offsetAttribute:e._offsetAttribute})};var Rh=gp;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 Pq=Iq;function Lv(){this.times=void 0,this.points=void 0,pe.throwInstantiationError()}Lv.getPointType=function(e){if(typeof e=="number")return Number;if(e instanceof h)return h;if(e instanceof Fe)return Fe};Lv.prototype.evaluate=pe.throwInstantiationError;Lv.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};Lv.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};Lv.prototype.clampTime=function(e){let t=this.times;return D.clamp(e,t[0],t[t.length-1])};var xr=Lv;function Nv(e){e=e??H.EMPTY_OBJECT;let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=xr.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(Nv.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});Nv.prototype.findTimeInterval=xr.prototype.findTimeInterval;Nv.prototype.wrapTime=xr.prototype.wrapTime;Nv.prototype.clampTime=xr.prototype.clampTime;Nv.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 dy=Nv;var tue={};tue.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 Fv=tue;var nue=[],iue=[],rue=[],oue=[];function Zze(e,t,n){let i=nue,r=rue,o=iue,a=oue;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),Fv.solve(i,o,r,a)}function Qze(e){let t=nue,n=rue,i=iue,r=oue;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),Fv.solve(t,i,n,r)}function Tu(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=xr.getPointType(t[0]),this._inTangents=i,this._outTangents=r,this._lastTimeIndex=0}Object.defineProperties(Tu.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}}});Tu.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 Tu({times:t,points:n,inTangents:o,outTangents:r})};Tu.createNaturalCubic=function(e){e=e??H.EMPTY_OBJECT;let t=e.times,n=e.points;if(n.length<3)return new dy({points:n,times:t});let i=Qze(n),r=i.slice(0,i.length-1),o=i.slice(1,i.length);return new Tu({times:t,points:n,inTangents:o,outTangents:r})};Tu.createClampedCubic=function(e){e=e??H.EMPTY_OBJECT;let t=e.times,n=e.points,i=e.firstTangent,r=e.lastTangent,o=xr.getPointType(n[0]);if(n.length<3)return new dy({points:n,times:t});let a=Zze(n,i,r),s=a.slice(0,a.length-1),c=a.slice(1,a.length);return new Tu({times:t,points:n,inTangents:c,outTangents:s})};Tu.hermiteCoefficientMatrix=new L(2,-3,0,1,-2,3,0,0,1,-2,1,0,1,-1,0,0);Tu.prototype.findTimeInterval=xr.prototype.findTimeInterval;var eUe=new ae,Bv=new h;Tu.prototype.wrapTime=xr.prototype.wrapTime;Tu.prototype.clampTime=xr.prototype.clampTime;Tu.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=eUe;u.z=c,u.y=c*c,u.x=u.y*c,u.w=1;let f=L.multiplyByVector(Tu.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,Bv),d.add(t,Bv,t),d.multiplyByScalar(o[a],f.z,Bv),d.add(t,Bv,t),d.multiplyByScalar(r[a],f.w,Bv),d.add(t,Bv,t))};var hy=Tu;var tUe=new ae,aue=new h,kv=new h;function nUe(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=tUe;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,aue),h.multiplyByScalar(d,.5,d),p=L.multiplyByVector(hy.hermiteCoefficientMatrix,s,s)):o===t.length-2?(c=t[o],u=t[o+1],d=e.lastTangent,f=h.subtract(u,t[o-1],aue),h.multiplyByScalar(f,.5,f),p=L.multiplyByVector(hy.hermiteCoefficientMatrix,s,s)):(c=t[o-1],u=t[o],f=t[o+1],d=t[o+2],p=L.multiplyByVector(my.catmullRomCoefficientMatrix,s,s)),r=h.multiplyByScalar(c,p.x,r),h.multiplyByScalar(u,p.y,kv),h.add(r,kv,r),h.multiplyByScalar(f,p.z,kv),h.add(r,kv,r),h.multiplyByScalar(d,p.w,kv),h.add(r,kv,r)}}var iUe=new h,rUe=new h;function my(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=iUe,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=rUe,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=nUe(this),this._lastTimeIndex=0}Object.defineProperties(my.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}}});my.catmullRomCoefficientMatrix=new L(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0);my.prototype.findTimeInterval=xr.prototype.findTimeInterval;my.prototype.wrapTime=xr.prototype.wrapTime;my.prototype.clampTime=xr.prototype.clampTime;my.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var Dq=my;var IYt=(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 P=new Uint32Array(y);new Uint8Array(P.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]=P[m[R]];return[P,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),P=new Uint8Array(n.exports.memory.buffer);P.set(a(y),w);var R=g(E,m,w,A,b,x,T),O=new Uint8Array(R);return O.set(P.subarray(E,E+R)),C(E-C(0)),O}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),P=new Uint8Array(n.exports.memory.buffer);P.set(a(m),w),g(E,y,A,b,w,T);var R=new Uint8Array(y*A);return R.set(P.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 py=(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,P){var R=b.exports.sbrk,O=C+3&-4,N=R(O*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&&P&&P(N,O,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],P=1;P<d.length;++P)d[P].pending<w.pending&&(w=d[P]);return new Promise(function(R,O){var N=new Uint8Array(T),_=++p;w.pending+=b,w.requests[_]={resolve:R,reject:O},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 RYt=(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,P=w(C*4),R=w(C*E*4),O=new Uint8Array(n.exports.memory.buffer);O.set(a(T),R),x(P,R,C,E*4),O=new Uint8Array(n.exports.memory.buffer);var N=new Uint32Array(C);return new Uint8Array(N.buffer).set(O.subarray(P,P+C*4)),w(P-w(0)),N}function c(x,T,C){var E=n.exports.sbrk,w=E(T.length*4),P=E(C*4),R=new Uint8Array(n.exports.memory.buffer),O=a(T);R.set(O,w);var N=x(P,w,T.length,C);R=new Uint8Array(n.exports.memory.buffer);var _=new Uint32Array(C);new Uint8Array(_.buffer).set(R.subarray(P,P+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,P,R,O,N){var _=n.exports.sbrk,v=_(4),S=_(C*4),I=_(w*P),M=_(C*4),F=new Uint8Array(n.exports.memory.buffer);F.set(a(E),I),F.set(a(T),M);var V=x(S,M,C,I,w,P,R,O,N,v);F=new Uint8Array(n.exports.memory.buffer);var k=new Uint32Array(V);a(k).set(F.subarray(S,S+V*4));var j=new Float32Array(1);return a(j).set(F.subarray(v,v+4)),_(v-_(0)),[k,j[0]]}function d(x,T,C,E,w,P,R,O,N,_,v,S,I){var M=n.exports.sbrk,F=M(4),V=M(C*4),k=M(w*P),j=M(w*O),B=M(N.length*4),G=M(C*4),W=_?M(w):0,Q=new Uint8Array(n.exports.memory.buffer);Q.set(a(E),k),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,k,w,P,j,O,B,N.length,W,v,S,I,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)),M(F-M(0)),[J,Z[0]]}function p(x,T,C,E,w,P,R,O,N,_,v,S,I){var M=n.exports.sbrk,F=M(4),V=M(w*P),k=M(w*O),j=M(N.length*4),B=M(C*4),G=_?M(w):0,W=new Uint8Array(n.exports.memory.buffer);W.set(a(E),V),W.set(a(R),k),W.set(a(N),j),W.set(a(T),B),_&&W.set(a(_),G);var Q=x(B,C,V,w,P,k,O,j,N.length,G,v,S,I,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*P)),a(R).set(W.subarray(k,k+w*O));var q=new Float32Array(1);return a(q).set(W.subarray(F,F+4)),M(F-M(0)),[Q,q[0]]}function g(x,T,C,E){var w=n.exports.sbrk,P=w(C*E),R=new Uint8Array(n.exports.memory.buffer);R.set(a(T),P);var O=x(P,C,E);return w(P-w(0)),O}function m(x,T,C,E,w,P,R,O){var N=n.exports.sbrk,_=N(O*4),v=N(C*E),S=w?N(C*P):0,I=new Uint8Array(n.exports.memory.buffer);I.set(a(T),v),w&&I.set(a(w),S);var M=x(_,v,C,E,S,P,R,O);I=new Uint8Array(n.exports.memory.buffer);var F=new Uint32Array(M);return a(F).set(I.subarray(_,_+M*4)),N(_-N(0)),F}function y(x,T,C,E,w,P,R,O,N){var _=n.exports.sbrk,v=_(4),S=_(C*4),I=_(w*P),M=_(C*4),F=R?_(w):0,V=new Uint8Array(n.exports.memory.buffer);V.set(a(E),I),V.set(a(T),M),R&&V.set(a(R),F);var k=x(S,M,C,I,w,P,F,O,N,v);V=new Uint8Array(n.exports.memory.buffer);var j=new Uint32Array(k);a(j).set(V.subarray(S,S+k*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,P,R){var O=n.exports.sbrk,N=O(C*4),_=O(w*P),v=O(C*4),S=new Uint8Array(n.exports.memory.buffer);S.set(a(E),_),S.set(a(T),v);var I=x(N,v,C,_,w,P,R);S=new Uint8Array(n.exports.memory.buffer);var M=new Uint32Array(I);return a(M).set(S.subarray(N,N+I*4)),O(N-O(0)),M}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,P){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,O=0;O<(P?P.length:0);++O)o(P[O]in b),R|=b[P[O]];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,P,R,O,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(O>=0&&O<=x.length),o(O%3==0),o(N>=0),o(Array.isArray(P)),o(w>=P.length),o(P.length<=32);for(var v=0;v<P.length;++v)o(P[v]>=0);for(var S=0,v=0;v<(_?_.length:0);++v)o(_[v]in b),S|=b[_[v]];var I=x.BYTES_PER_ELEMENT==4?x:new Uint32Array(x),M=d(n.exports.meshopt_simplifyWithAttributes,I,x.length,T,T.length/C,C*4,E,w*4,new Float32Array(P),R,O,N,S);return M[0]=x instanceof Uint32Array?M[0]:new x.constructor(M[0]),M},simplifyWithUpdate:function(x,T,C,E,w,P,R,O,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(O>=0&&O<=x.length),o(O%3==0),o(N>=0),o(Array.isArray(P)),o(w>=P.length),o(P.length<=32);for(var v=0;v<P.length;++v)o(P[v]>=0);for(var S=0,v=0;v<(_?_.length:0);++v)o(_[v]in b),S|=b[_[v]];var I=x.BYTES_PER_ELEMENT==4?x:new Uint32Array(x),M=p(n.exports.meshopt_simplifyWithUpdate,I,x.length,T,T.length/C,C*4,E,w*4,new Float32Array(P),R,O,N,S);if(x!==I)for(var v=0;v<M[0];++v)x[v]=I[v];return M},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,P){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,P||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,P){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(P>=0);var R=x.BYTES_PER_ELEMENT==4?x:new Uint32Array(x),O=y(n.exports.meshopt_simplifySloppy,R,x.length,T,T.length/C,C*4,E,w,P);return O[0]=x instanceof Uint32Array?O[0]:new x.constructor(O[0]),O},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),P=A(n.exports.meshopt_simplifyPrune,w,x.length,T,T.length/C,C*4,E);return P=x instanceof Uint32Array?P:new x.constructor(P),P}}})();var MYt=(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,P,R){var O=n.exports.sbrk,N=n.exports.meshopt_buildMeshletsBound(A.length,C,E),_=O(N*c),v=O(A.length*4),S=O(A.length),I=O(A.byteLength),M=O(b.byteLength),F=new Uint8Array(n.exports.memory.buffer);F.set(a(A),I),F.set(a(b),M);var V=y(_,v,S,I,A.length,M,x,T,C,E,w,P,R);F=new Uint8Array(n.exports.memory.buffer);for(var k=F.subarray(_,_+V*c),j=new Uint32Array(k.buffer,k.byteOffset,k.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 O(_-O(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),P=T(y.triangles.byteLength),R=T(s),O=new Uint8Array(n.exports.memory.buffer);O.set(a(A),E),O.set(a(y.vertices),w),O.set(a(y.triangles),P);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,P+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),P=new Uint8Array(n.exports.memory.buffer);P.set(a(y),E),P.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),P=x?C(x.byteLength):0,R=new Uint8Array(n.exports.memory.buffer);R.set(a(y),w),x&&R.set(a(x),P),n.exports.meshopt_computeSphereBounds(E,w,A,b,P,x?T:0);var O=d(E);return C(E-C(0)),O}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 P=y.BYTES_PER_ELEMENT==4?y:new Uint32Array(y);return f(n.exports.meshopt_buildMeshletsFlex,P,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 NYt=(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),P=T(m.byteLength),R=T(A.byteLength),O=new Uint8Array(n.exports.memory.buffer);u&&O.set(a(u),E),O.set(a(d),w),O.set(a(m),P),O.set(a(A),R),n.exports.meshopt_generateTangents(C,E,f,w,p,g*4,P,y*4,R,b*4,x),O=new Uint8Array(n.exports.memory.buffer);var N=new Float32Array(O.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 _p={X:0,Y:1,Z:2};_p.Y_UP_TO_Z_UP=L.fromRotationTranslation($.fromArray([1,0,0,0,0,1,0,-1,0]));_p.Z_UP_TO_Y_UP=L.fromRotationTranslation($.fromArray([1,0,0,0,0,-1,0,1,0]));_p.X_UP_TO_Z_UP=L.fromRotationTranslation($.fromArray([0,0,1,0,1,0,-1,0,0]));_p.Z_UP_TO_X_UP=L.fromRotationTranslation($.fromArray([0,0,-1,0,1,0,1,0,0]));_p.X_UP_TO_Y_UP=L.fromRotationTranslation($.fromArray([0,1,0,-1,0,0,0,0,1]));_p.Y_UP_TO_X_UP=L.fromRotationTranslation($.fromArray([0,-1,0,1,0,0,0,0,1]));_p.fromName=function(e){return _p[e]};Object.freeze(_p);var ki=_p;var Rq={},oUe={positions:void 0,normals:void 0,indices:void 0,edgeIndicesWest:void 0,edgeIndicesSouth:void 0,edgeIndicesEast:void 0,edgeIndicesNorth:void 0},aUe=new de,sUe=new h,cUe=new L,lUe=new L,uUe=new L,fUe=new h,dUe=new h,hUe=new h,mUe=new h,pUe=new de,gUe=new z,kP=new h,_Ue=new z,yUe=new h,AUe=new h,ij=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?py.ready:Promise.resolve(void 0));let x=y.west,T=y.south,C=y.north,E=y.width,w=y.height,P=ie.center(y,aUe);P.height=.5*(a+s);let R=de.toCartesian(P,m,sUe),O=mt.eastNorthUpToFixedFrame(R,m,cUe),N=L.inverseTransformation(O,lUe),_=L.unpack(o.nodes[0].matrix,0,uUe);_=L.multiply(ki.Y_UP_TO_Z_UP,_,_);let v=ZUe(o,i,oUe),S=Vr.getSkirtVertexCount(v.edgeIndicesWest,v.edgeIndicesSouth,v.edgeIndicesEast,v.edgeIndicesNorth),I=v.positions,M=v.normals,F=v.indices,V=I.length/3,k=V+S,j=F.length,B=Vr.getSkirtIndexCountWithFilledCorners(S),G=k<=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=di.geodeticLatitudeToMercatorAngle(T),Ie=1/(di.geodeticLatitudeToMercatorAngle(C)-ye),Le=h.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,fUe),$e=h.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,dUe),Xe=new uo(d.center,void 0,void 0,void 0,void 0,i,r,f,t,n),At=Xe.stride,Ke=new Float32Array(k*At),we=0;for(let vt=0;vt<V;vt++){let ct=h.unpack(I,vt*3,hUe),pn=L.multiplyByPoint(_,ct,mUe),Ht=de.fromCartesian(pn,m,pUe),{longitude:bt,latitude:Dt,height:Pn}=Ht,ot=(bt-x)/E,dt=(Dt-T)/w;ot=D.clamp(ot,0,1),dt=D.clamp(dt,0,1),Ar(ce,vt,ij)>=0?ot=0:Ar(le,vt,ij)>=0&&(ot=1),Ar(Ae,vt,ij)>=0?dt=0:Ar(Ce,vt,ij)>=0&&(dt=1);let Si=z.fromElements(ot,dt,gUe),wn;if(i){let Yi=h.unpack(M,vt*3,kP);Yi=L.multiplyByPointAsVector(_,Yi,kP),Yi=h.normalize(Yi,kP),wn=an.octEncode(Yi,_Ue)}let Ni;r&&(Ni=(di.geodeticLatitudeToMercatorAngle(Dt)-ye)*Ie);let dr;f&&(dr=m.geodeticSurfaceNormal(pn,yUe)),we=Xe.encode(Ke,we,pn,Si,Pn,wn,Ni,dr);let Fi=L.multiplyByPoint(N,pn,AUe);Le=h.minimumByComponent(Fi,Le,Le),$e=h.maximumByComponent(Fi,$e,$e)}let We=new tc(h.clone(Xe.center,new h),Ke,W,j,V,a,s,y,se.clone(d,new se),h.clone(g,new h),At,Jt.clone(p,new Jt),Xe,Q,q,J,Z);return hue(We,y,m,Le,$e,O,N,c),Promise.resolve(We)};var bUe=new z,xUe=new z,TUe=new Array(6),CUe=new z,vUe=new z,EUe=new z,SUe=new h,wUe=new h,IUe=new h,PUe=new de,DUe=new h,RUe=new de,OUe=new de,sue=new h,MUe=new h,LUe=new h,NUe=new h,FUe=new h,BUe=new h,kUe=new h,zUe=new h,UUe=new L,VUe=new L,cue=new z,jUe=new z,HUe=new h,GUe=new se,WUe=new Jt,qUe=new lf,lue=new h,uue=new z,YUe=new z,fue=new h,XUe=new h;function KUe(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);py.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 $Ue(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);py.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))*D.signNotZero(A),g=(1-Math.abs(A))*D.signNotZero(b)}let y=kP;y.x=p,y.y=g,y.z=m,y=h.normalize(y,kP),f[d*3+0]=y.x,f[d*3+1]=y.y,f[d*3+2]=y.z}return f}function JUe(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 py.decodeIndexBuffer(new Uint8Array(u.buffer),r,a.byteStride,c),u}function rj(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 py.decodeIndexSequence(new Uint8Array(f.buffer),o,d,u),f}function ZUe(e,t,n){return n.positions=KUe(e),n.normals=t?$Ue(e):void 0,n.indices=JUe(e),n.edgeIndicesWest=rj(e,"left"),n.edgeIndicesSouth=rj(e,"bottom"),n.edgeIndicesEast=rj(e,"right"),n.edgeIndicesNorth=rj(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=uo.clone(e.parentEncoding,new uo),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=[],P=[],R=[],O=[],N=[];fVe(t,n,a,s,c,u,f,w,P,R,O,N,T,E,C);let _=ie.center(b,PUe);_.height=.5*(i+r);let v=de.toCartesian(_,x,DUe),S=T.length,I=new uo(v,void 0,void 0,void 0,void 0,d,p,A,g,m),M=I.stride,F=Vr.getSkirtVertexCount(P,R,O,N),V=S+F,k=w.length,j=Vr.getSkirtIndexCountWithFilledCorners(F),B=k+j,G=V<=65535?Uint16Array:Uint32Array,W=new G(B);W.set(w);let Q=new G(P),q=new G(R),J=new G(O),Z=new G(N),ce=new Float32Array(V*M),Ae=0,le=mt.eastNorthUpToFixedFrame(v,x,UUe),Ce=L.inverseTransformation(le,VUe),ye=b.west,ve=b.east,Ie=b.south,Le=b.north,$e=di.geodeticLatitudeToMercatorAngle(Ie),At=1/(di.geodeticLatitudeToMercatorAngle(Le)-$e),Ke=Number.POSITIVE_INFINITY,we=Number.NEGATIVE_INFINITY,We=h.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,kUe),vt=h.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,zUe);for(let Pn=0;Pn<S;Pn++){let ot=T[Pn],dt=s[ot*3+0],Si=s[ot*3+1],wn=s[ot*3+2],Ni=jUe;Ni.x=C[Pn*2+0],Ni.y=C[Pn*2+1];let dr=Ni.x,Fi=Ni.y,Yi=E[Pn*2+0],ai=E[Pn*2+1],ni=1-Yi-ai,En=f.decodeHeight(u,dt),ii=f.decodeHeight(u,Si),Sr=f.decodeHeight(u,wn),Ea=En*Yi+ii*ai+Sr*ni;Ke=Math.min(Ea,Ke),we=Math.max(Ea,we);let Va=D.lerp(ye,ve,dr),rs=D.lerp(Ie,Le,Fi),os=de.fromRadians(Va,rs,Ea,OUe),oo=de.toCartesian(os,x,MUe),gi=L.multiplyByPoint(Ce,oo,NUe);We=h.minimumByComponent(gi,We,We),vt=h.maximumByComponent(gi,vt,vt);let ao;if(d){let Oi=f.decodeNormal(u,dt,SUe),wr=f.decodeNormal(u,Si,wUe),Sa=f.decodeNormal(u,wn,IUe),Do=h.fromElements(Oi.x*Yi+wr.x*ai+Sa.x*ni,Oi.y*Yi+wr.y*ai+Sa.y*ni,Oi.z*Yi+wr.z*ai+Sa.z*ni,lue);Do=h.normalize(Do,lue),ao=an.octEncode(Do,YUe)}let Ri;p&&(Ri=(di.geodeticLatitudeToMercatorAngle(rs)-$e)*At);let Ho;A&&(Ho=x.geodeticSurfaceNormal(oo,XUe)),Ae=I.encode(ce,Ae,oo,Ni,Ea,ao,Ri,Ho)}let ct=Jt.fromRectangle(b,Ke,we,x,WUe),pn=se.fromVertices(ce,I.center,M,GUe),bt=new Ih(x).computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid(I.center,ce,M,I.center,Ke,HUe),Dt=new tc(h.clone(I.center,new h),ce,W,k,S,Ke,we,b,se.clone(pn),h.clone(bt),M,Jt.clone(ct),I,Q,q,J,Z);return hue(Dt,b,x,We,vt,le,Ce,o),Dt};function hue(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,P=e.westIndicesSouthToNorth,R=e.southIndicesEastToWest,O=e.eastIndicesNorthToSouth,N=e.northIndicesWestToEast;Vr.addSkirtIndicesWithFilledCorners(P,R,O,N,b,E,w);let _=0,v=_+P.length,S=v+R.length,I=S+O.length,M=[P,R,O,N],F=[_,v,S,I],V=[-1,0,1,0],k=[0,-1,0,1],j=h.clone(i,FUe),B=h.clone(r,BUe),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=M[Z][J-F[Z]],Ae=c.decodeTextureCoordinates(f,ce,cue),le=1e-4,Ce=Ae.x+V[Z]*le,ye=Ae.y+k[Z]*le,ve=D.lerp(t.west,t.east,Ce),Ie=D.clamp(D.lerp(t.south,t.north,ye),-D.PI_OVER_TWO,+D.PI_OVER_TWO),$e=c.decodeHeight(f,ce)-s,Xe=de.fromRadians(ve,Ie,$e,RUe),At=de.toCartesian(Xe,n,sue),Ke;d&&(Ke=c.getOctEncodedNormal(f,ce,uue));let we;p&&(we=c.decodeWebMercatorT(f,ce));let We;A&&(We=n.geodeticSurfaceNormal(At,fue)),x=c.encode(f,x,At,Ae,$e,Ke,we,We);let vt=L.multiplyByPoint(a,At,LUe);h.minimumByComponent(vt,j,j),h.maximumByComponent(vt,B,B)}let Q=lf.fromCorners(j,B,qUe),q=new uo(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,sue),c.decodeTextureCoordinates(f,le,cue),c.decodeHeight(f,le),c.hasVertexNormals?c.getOctEncodedNormal(f,le,uue):void 0,c.hasWebMercatorT?c.decodeWebMercatorT(f,le):void 0,c.hasGeodeticSurfaceNormals?c.decodeGeodeticSurfaceNormal(f,le,fue):void 0);e.vertices=ce,e.stride=Z,e.encoding=J}return e}var Oq=0,QUe=1,Mq=2,Lq=3,eVe=4,tVe=new h,nVe=[new h,new h,new h,new h,new h,new h],iVe=[new z,new z,new z,new z,new z,new z],rVe=[new h,new h,new h,new h,new h,new h],oVe=[new z,new z,new z,new z,new z,new z];function due(e,t,n,i){switch(n){case Oq:return D.sign(i.x-e.x);case Mq:return D.sign(t.x-i.x);case Lq:return D.sign(i.y-e.y);default:return D.sign(t.y-i.y)}}function aVe(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 Mq:a=(t.x-i.x)/(r.x-i.x),s=t.x,c=i.y+(r.y-i.y)*a;break;case Lq: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 sVe={length:0,coordinates:[new z,new z,new z,new z,new z,new z],barycentricCoordinates:[new h,new h,new h,new h,new h,new h]};function cVe(e,t,n,i,r,o,a,s){let c,u=iVe,f=nVe,d=3,p=oVe;z.clone(r,p[0]),z.clone(o,p[1]),z.clone(a,p[2]);let g=rVe;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)%eVe,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=due(n,i,y,T);for(let w=0;w<c;w++){let P=u[w],R=f[w],O=due(n,i,y,P);if(E*O===-1){let N=aVe(n,i,y,T,P,tVe),{x:_,y:v,z:S}=N,I=1-S,M=C.x*I+R.x*S,F=C.y*I+R.y*S,V=C.z*I+R.z*S;z.fromElements(_,v,p[d]),h.fromElements(M,F,V,g[d]),d++}O>=0&&(z.clone(P,p[d]),h.clone(R,g[d]),d++),T=P,C=R,E=O}if(d===0)break}s.length=d;for(let m=0;m<d;m++)z.clone(p[m],s.coordinates[m]),h.clone(g[m],s.barycentricCoordinates[m]);return s}function lVe(e,t,n,i,r,o,a,s){return cVe(e?t?Lq:Oq:t?Mq:QUe,2,n,i,r,o,a,s)}var uVe=[[],[0],[1],[0,1],[2],[0,2],[1,2],[0,1,2]];function fVe(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=bUe;C.x=A,C.y=x;let E=xUe;E.x=b,E.y=T;let w=0;for(let P=0;P<n;P+=3){let R=i[P+0],O=i[P+1],N=i[P+2],_=a.decodeTextureCoordinates(o,R,CUe),v=a.decodeTextureCoordinates(o,O,vUe),S=a.decodeTextureCoordinates(o,N,EUe),I=lVe(e,t,C,E,_,v,S,sVe),M=I.length;if(M<3)continue;let F=TUe;for(let B=0;B<M;B++){let G=I.barycentricCoordinates[B],W=G.x,Q=G.y,q=G.z,J=Math.ceil(W)|Math.ceil(Q)<<1|Math.ceil(q)<<2,Z=uVe[J],ce,Ae=!1;if(Z.length===1){let le=Z[0],ye=i[P+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[P+le],ve=i[P+Ce],Ie=I.barycentricCoordinates[(B+M-1)%M],Le=Math.ceil(Ie.x)|Math.ceil(Ie.y)<<1|Math.ceil(Ie.z)<<2,$e=J===Le,Xe=Math.min(ye,ve),At=Math.max(ye,ve),Ke=r+2*(Xe*r+At),we=Ke+0,We=Ke+1,vt=y[we],ct=y[We],pn=!$e==(vt===void 0||ct===void 0);if(ce=pn?vt:ct,ce===void 0){Ae=!0,ce=w++;let Ht=pn?we:We;y[Ht]=ce}}else Ae=!0,ce=w++;if(F[B]=ce,Ae){let le=P/3;p.push(le);let Ce=I.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],k=F[1],j=F[2];s.push(V,k,j);for(let B=3;B<M;B++)k=j,j=F[B],s.push(V,k,j)}c.sort(function(P,R){return m[P*2+1]-m[R*2+1]}),u.sort(function(P,R){return m[R*2+0]-m[P*2+0]}),f.sort(function(P,R){return m[R*2+1]-m[P*2+1]}),d.sort(function(P,R){return m[P*2+0]-m[R*2+0]})}var zv=Rq;var oj={};oj.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};oj.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)};oj.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 z),c.x=e+p*(n-e),c.y=t+p*(i-t),c};var Oh=oj;function U0(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(U0.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){return this._waterMask}}});U0.prototype.interpolateHeight=function(e,t,n){let i=this._mesh;return i===void 0?void 0:pue(i,e,t,n)};U0.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 mue="createVerticesFromCesium3DTilesTerrain",dVe=new Yn(mue),hVe=new Yn(mue,xu.maximumAsynchronousTasks);U0.prototype.createMesh=function(e){e=e??H.EMPTY_OBJECT;let n=e.throttle??!0?hVe:dVe,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=uo.clone(g.encoding,new uo),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),P=new x(g.northIndicesBuffer),R=g.indexCountWithoutSkirts,O=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),I=Jt.clone(d._orientedBoundingBox,new Jt),M=new tc(_,y,T,R,b,O,N,c,v,S,m.stride,I,m,C,w,E,P);return d._mesh=M,Promise.resolve(M)})};U0.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=zv.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)})};U0.prototype.upsample=function(e,t,n,i,r,o,a){let s=this._mesh;return s===void 0?void 0:aj(!1,s,this._skirtHeight,this._credits,e,t,n,i,r,o,a)};U0.prototype._upsampleSync=function(e,t,n,i,r,o,a){let s=this._mesh;return s===void 0?void 0:aj(!0,s,this._skirtHeight,this._credits,e,t,n,i,r,o,a)};U0.prototype.wasCreatedByUpsampling=function(){return!1};function z0(e){e=e??H.EMPTY_OBJECT,this._mesh=e.terrainMesh,this._skirtHeight=e.skirtHeight,this._credits=e.credits}z0.prototype.createMesh=function(e){return e=e??H.EMPTY_OBJECT,Promise.resolve(this._mesh)};z0.prototype.upsample=function(e,t,n,i,r,o,a){return aj(!1,this._mesh,this._skirtHeight,this._credits,e,t,n,i,r,o,a)};z0.prototype._upsampleSync=function(e,t,n,i,r,o,a){return aj(!0,this._mesh,this._skirtHeight,this._credits,e,t,n,i,r,o,a)};z0.prototype.interpolateHeight=function(e,t,n){let i=this._mesh;return pue(i,e,t,n)};z0.prototype.wasCreatedByUpsampling=function(){return!0};z0.prototype.isChildAvailable=function(e,t,n,i){return!1};Object.defineProperties(z0.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var mVe=new Yn("upsampleVerticesFromCesium3DTilesTerrain",xu.maximumAsynchronousTasks);function aj(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=zv.upsampleMesh(b),C=new z0({terrainMesh:T,skirtHeight:p,credits:i});return Promise.resolve(C)}let x=mVe.scheduleTask(b);if(x!==void 0)return x.then(function(T){let C=uo.clone(T.encoding,new uo),E=C.stride,w=new Float32Array(T.verticesBuffer),P=w.length/E,R=T.vertexCountWithoutSkirts,O=P<=65535?Uint16Array:Uint32Array,N=new O(T.indicesBuffer),_=new O(T.westIndicesBuffer),v=new O(T.eastIndicesBuffer),S=new O(T.southIndicesBuffer),I=new O(T.northIndicesBuffer),M=T.indexCountWithoutSkirts,F=T.minimumHeight,V=T.maximumHeight,k=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 tc(k,w,N,M,R,F,V,y,j,B,E,G,C,_,S,v,I),Q=new z0({terrainMesh:W,skirtHeight:p,credits:i});return Promise.resolve(Q)})}var pVe=new z,gVe=new z,_Ve=new z,yVe=new h;function pue(e,t,n,i){let r=D.clamp((n-t.west)/t.width,0,1),o=D.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,pVe),m=s.decodeTextureCoordinates(a,d,gVe),y=s.decodeTextureCoordinates(a,p,_Ve),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=Oh.computeBarycentricCoordinates(r,o,g.x,g.y,m.x,m.y,y.x,y.y,yVe);if(C.x>=0&&C.y>=0&&C.z>=0){let E=s.decodeHeight(a,f),w=s.decodeHeight(a,d),P=s.decodeHeight(a,p);return C.x*E+C.y*w+C.z*P}}}return 0}var zP=U0;function Mh(e){this._comparator=e.comparator,this._maximumLength=e.maximumLength,this._array=l(e.maximumLength)?new Array(e.maximumLength):[],this._length=0}Object.defineProperties(Mh.prototype,{length:{get:function(){return this._length}},maximumLength:{get:function(){return this._maximumLength},set:function(e){if(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}}});Mh.prototype.clone=function(){let e=this._maximumLength,t=this._comparator,n=this._array,i=this._length,r=new Mh({comparator:t,maximumLength:e});r._length=i;for(let o=0;o<i;o++)r._array[o]=n[o];return r};Mh.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};Mh.prototype.resort=function(){let e=this._length;for(let t=0;t<e;t++)gue(this,t)};Mh.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++,gue(this,i),t};Mh.prototype.removeMinimum=function(){let e=this._length;if(e===0)return;this._length--;let t=this._array[0];return e>=2&&(this._array[0]=this._array[e-1],_ue(this,0)),this._array[e-1]=void 0,t};Mh.prototype.removeMaximum=function(){let e=this._length;if(e===0)return;this._length--;let t;if(e<=2)t=this._array[e-1];else{let n=Nq(this,1,2)?1:2;t=this._array[n],this._array[n]=this._array[e-1],e>=4&&_ue(this,n)}return this._array[e-1]=void 0,t};Mh.prototype.getMinimum=function(){if(this._length!==0)return this._array[0]};Mh.prototype.getMaximum=function(){let e=this._length;if(e!==0)return e<=2?this._array[e-1]:this._array[Nq(this,1,2)?1:2]};function sj(e,t,n){let i=e._array,r=i[t];i[t]=i[n],i[n]=r}function UP(e,t,n){return e._comparator(e._array[t],e._array[n])<0}function Nq(e,t,n){return e._comparator(e._array[t],e._array[n])>0}function gue(e,t){if(t===0)return;let n=Math.floor(D.log2(t+1))%2===0,i=Math.floor((t-1)/2),r=UP(e,t,i);for(r!==n&&(sj(e,t,i),t=i);t>=3;){let o=Math.floor((t-3)/4);if(UP(e,t,o)!==r)break;sj(e,t,o),t=o}}function _ue(e,t){let n=e._length,i=Math.floor(D.log2(t+1))%2===0,r;for(;(r=2*t+1)<n;){let o=r,a=r+1;if(a<n){UP(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;UP(e,f,o)===i&&(o=f)}}if(UP(e,o,t)===i&&(sj(e,o,t),o!==r&&o!==a)){let s=Math.floor((o-1)/2);Nq(e,o,s)===i&&sj(e,o,s)}t=o}}var V0=Mh;function gy(e,t,n){return t=t??0,n=n??e.byteLength-t,e=e.subarray(t,t+n),gy.decode(e)}gy.decodeWithTextDecoder=function(e){return new TextDecoder("utf-8").decode(e)};gy.decodeWithFromCharCode=function(e){let t="",n=AVe(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 VP(e,t,n){return t<=e&&e<=n}function AVe(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(VP(u,0,127)){a.push(u);continue}if(VP(u,194,223)){i=1,t=u&31;continue}if(VP(u,224,239)){u===224&&(r=160),u===237&&(o=159),i=2,t=u&15;continue}if(VP(u,240,244)){u===240&&(r=144),u===244&&(o=143),i=3,t=u&7;continue}throw new oe("String decoding failed.")}if(!VP(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"?gy.decode=gy.decodeWithTextDecoder:gy.decode=gy.decodeWithFromCharCode;var Cu=gy;function bVe(e,t,n){return JSON.parse(Cu(e,t,n))}var Co=bVe;function xVe(e,t){return l(e)&&l(e.extensions)&&l(e.extensions[t])}var $i=xVe;function Fq(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=TVe(r,t))}this._lengthBits=t,this._availableCount=n,this._constant=i,this._bitstream=r}function TVe(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(Fq.prototype,{lengthBits:{get:function(){return this._lengthBits}},availableCount:{get:function(){return this._availableCount}}});Fq.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 Uv=Fq;function j0(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(j0.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});j0.prototype.hasProperty=function(e){return this._metadataTable.hasProperty(e)};j0.prototype.hasPropertyBySemantic=function(e){return this._metadataTable.hasPropertyBySemantic(e)};j0.prototype.getPropertyIds=function(e){return this._metadataTable.getPropertyIds(e)};j0.prototype.getProperty=function(e){return this._metadataTable.getProperty(this._entityId,e)};j0.prototype.setProperty=function(e,t){return this._metadataTable.setProperty(this._entityId,e,t)};j0.prototype.getPropertyBySemantic=function(e){return this._metadataTable.getPropertyBySemantic(this._entityId,e)};j0.prototype.setPropertyBySemantic=function(e,t){return this._metadataTable.setPropertyBySemantic(this._entityId,e,t)};var Vv=j0;var jP={QUADTREE:"QUADTREE",OCTREE:"OCTREE"};jP.getBranchingFactor=function(e){switch(e){case jP.OCTREE:return 8;case jP.QUADTREE:return 4}};Object.freeze(jP);var Ra=jP;function ic(){}Object.defineProperties(ic.prototype,{class:{get:function(){pe.throwInstantiationError()}}});ic.prototype.hasProperty=function(e){pe.throwInstantiationError()};ic.prototype.hasPropertyBySemantic=function(e){pe.throwInstantiationError()};ic.prototype.getPropertyIds=function(e){pe.throwInstantiationError()};ic.prototype.getProperty=function(e){pe.throwInstantiationError()};ic.prototype.setProperty=function(e,t){pe.throwInstantiationError()};ic.prototype.getPropertyBySemantic=function(e){pe.throwInstantiationError()};ic.prototype.setPropertyBySemantic=function(e,t){pe.throwInstantiationError()};ic.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))};ic.hasPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return!1;let r=i[e];return l(r)};ic.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};ic.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=Ye(i.default,!0),i.unpackVectorAndMatrixTypes(r,o);if(l(r))return r=i.normalize(r),r=i.applyValueTransform(r),i.unpackVectorAndMatrixTypes(r,o)};ic.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};ic.getPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return;let r=i[e];if(l(r))return ic.getProperty(r.id,t,n)};ic.setPropertyBySemantic=function(e,t,n,i){let r=i.propertiesBySemantic;if(!l(r))return!1;let o=i.propertiesBySemantic[e];return l(o)?ic.setProperty(o.id,t,n,i):!1};var qn=ic;function H0(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(H0.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});H0.prototype.hasProperty=function(e){return qn.hasProperty(e,this._properties,this._class)};H0.prototype.hasPropertyBySemantic=function(e){return qn.hasPropertyBySemantic(e,this._properties,this._class)};H0.prototype.getPropertyIds=function(e){return qn.getPropertyIds(this._properties,this._class,e)};H0.prototype.getProperty=function(e){return qn.getProperty(e,this._properties,this._class)};H0.prototype.setProperty=function(e,t){return qn.setProperty(e,t,this._properties,this._class)};H0.prototype.getPropertyBySemantic=function(e){return qn.getPropertyBySemantic(e,this._properties,this._class)};H0.prototype.setPropertyBySemantic=function(e,t){return qn.setPropertyBySemantic(e,t,this._properties,this._class)};var HP=H0;var yue={};function GP(e,t){l(yue[e])||(yue[e]=!0,console.warn(t??e))}GP.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.";GP.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored";GP.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored";GP.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";var pt=GP;var ln={INT8:"INT8",UINT8:"UINT8",INT16:"INT16",UINT16:"UINT16",INT32:"INT32",UINT32:"UINT32",INT64:"INT64",UINT64:"UINT64",FLOAT32:"FLOAT32",FLOAT64:"FLOAT64"},qc={INTEGER:"int",UNSIGNED_INTEGER:"uint",FLOAT:"float"};ln.typeInfo={INT8:{vectorCompatible:!0,size:1,maximumValue:127,minimumValue:-128,category:qc.INTEGER},UINT8:{vectorCompatible:!0,size:1,maximumValue:255,minimumValue:0,category:qc.UNSIGNED_INTEGER},INT16:{vectorCompatible:!0,size:2,maximumValue:32767,minimumValue:-32768,category:qc.INTEGER},UINT16:{vectorCompatible:!0,size:2,maximumValue:65535,minimumValue:0,category:qc.UNSIGNED_INTEGER},INT32:{vectorCompatible:!0,size:4,maximumValue:2147483647,minimumValue:-2147483648,category:qc.INTEGER},UINT32:{vectorCompatible:!0,size:4,maximumValue:4294967295,minimumValue:0,category:qc.UNSIGNED_INTEGER},INT64:{vectorCompatible:!1,size:8,maximumValue:BigInt("9223372036854775807"),minimumValue:BigInt("-9223372036854775808"),category:qc.INTEGER,downcastFunction:e=>ln.clampToLimits(e,ln.INT32)},UINT64:{vectorCompatible:!1,size:8,maximumValue:BigInt("18446744073709551615"),minimumValue:BigInt(0),category:qc.UNSIGNED_INTEGER,downcastFunction:e=>ln.clampToLimits(e,ln.UINT32)},FLOAT32:{vectorCompatible:!0,size:4,maximumValue:34028234663852886e22,minimumValue:-34028234663852886e22,category:qc.FLOAT},FLOAT64:{vectorCompatible:!0,size:8,maximumValue:Number.MAX_VALUE,minimumValue:-Number.MAX_VALUE,category:qc.FLOAT,downcastFunction:e=>Math.fround(e)}};ln.getMinimum=function(e){return ln.typeInfo[e].minimumValue};ln.getMaximum=function(e){return ln.typeInfo[e].maximumValue};ln.isIntegerType=function(e){return ln.typeInfo[e].category!==qc.FLOAT};ln.isUnsignedIntegerType=function(e){return ln.typeInfo[e].category===qc.UNSIGNED_INTEGER};ln.isVectorCompatible=function(e){return ln.typeInfo[e].vectorCompatible};ln.category=function(e){return ln.typeInfo[e].category};ln.gpuComponentType=function(e){switch(e){case ln.INT64:return"INT32";case ln.UINT64:return"UINT32";case ln.FLOAT64:return"FLOAT32";default:return e}};ln.normalize=function(e,t){return Math.max(Number(e)/Number(ln.getMaximum(t)),-1)};ln.unnormalize=function(e,t){let n=ln.getMaximum(t),i=ln.isUnsignedIntegerType(t)?0:-n;return e=D.sign(e)*Math.round(Math.abs(e)*Number(n)),(t===ln.INT64||t===ln.UINT64)&&fn.supportsBigInt()&&(e=BigInt(e)),e>n?n:e<i?i:e};ln.applyValueTransform=function(e,t,n){return n*e+t};ln.unapplyValueTransform=function(e,t,n){return n===0?0:(e-t)/n};ln.getSizeInBytes=function(e){return ln.typeInfo[e].size};ln.clampToLimits=function(e,t){let n=ln.getMinimum(t),i=ln.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))};ln.downcastFunction=function(e){let n=ln.typeInfo[e].downcastFunction;return l(n)?n:i=>i};ln.fromComponentDatatype=function(e){switch(e){case Y.BYTE:return ln.INT8;case Y.UNSIGNED_BYTE:return ln.UINT8;case Y.SHORT:return ln.INT16;case Y.UNSIGNED_SHORT:return ln.UINT16;case Y.INT:return ln.INT32;case Y.UNSIGNED_INT:return ln.UINT32;case Y.FLOAT:return ln.FLOAT32;case Y.DOUBLE:return ln.FLOAT64}};ln.toComponentDatatype=function(e){switch(e){case ln.INT8:return Y.BYTE;case ln.UINT8:return Y.UNSIGNED_BYTE;case ln.INT16:return Y.SHORT;case ln.UINT16:return Y.UNSIGNED_SHORT;case ln.INT32:return Y.INT;case ln.UINT32:return Y.UNSIGNED_INT;case ln.FLOAT32:return Y.FLOAT;case ln.FLOAT64:return Y.DOUBLE}};ln.getDataViewAccessors=function(e,t){return{[ln.UINT8]:{get:e.getUint8.bind(e),set:e.setUint8.bind(e)},[ln.INT8]:{get:e.getInt8.bind(e),set:e.setInt8.bind(e)},[ln.UINT16]:{get:i=>e.getUint16(i,!0),set:(i,r)=>e.setUint16(i,r,!0)},[ln.INT16]:{get:i=>e.getInt16(i,!0),set:(i,r)=>e.setInt16(i,r,!0)},[ln.UINT32]:{get:i=>e.getUint32(i,!0),set:(i,r)=>e.setUint32(i,r,!0)},[ln.INT32]:{get:i=>e.getInt32(i,!0),set:(i,r)=>e.setInt32(i,r,!0)},[ln.FLOAT32]:{get:i=>e.getFloat32(i,!0),set:(i,r)=>e.setFloat32(i,r,!0)},[ln.FLOAT64]:{get:i=>e.getFloat64(i,!0),set:(i,r)=>e.setFloat64(i,r,!0)},[ln.UINT64]:{get:i=>e.getBigUint64(i,!0),set:(i,r)=>e.setBigUint64(i,BigInt(r),!0)},[ln.INT64]:{get:i=>e.getBigInt64(i,!0),set:(i,r)=>e.setBigInt64(i,BigInt(r),!0)}}[t]};Object.freeze(ln);var Mt=ln;var Zr={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4",BOOLEAN:"BOOLEAN",STRING:"STRING",ENUM:"ENUM"};Zr.isVectorType=function(e){switch(e){case Zr.VEC2:case Zr.VEC3:case Zr.VEC4:return!0;default:return!1}};Zr.isMatrixType=function(e){switch(e){case Zr.MAT2:case Zr.MAT3:case Zr.MAT4:return!0;default:return!1}};Zr.getComponentCount=function(e){switch(e){case Zr.SCALAR:case Zr.STRING:case Zr.ENUM:case Zr.BOOLEAN:return 1;case Zr.VEC2:return 2;case Zr.VEC3:return 3;case Zr.VEC4:return 4;case Zr.MAT2:return 4;case Zr.MAT3:return 9;case Zr.MAT4:return 16}};Zr.getMathType=function(e){switch(e){case Zr.VEC2:return z;case Zr.VEC3:return h;case Zr.VEC4:return ae;case Zr.MAT2:return Ki;case Zr.MAT3:return $;case Zr.MAT4:return L;default:return}};Object.freeze(Zr);var gt=Zr;function Yo(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=Ye(e.min,!0),this._max=Ye(e.max,!0),this._normalized=o;let a=Ye(e.offset,!0),s=Ye(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=Ye(e.noData,!0),this._default=Ye(e.default,!0),this._required=e.required??!0,this._extras=Ye(e.extras,!0),this._extensions=Ye(e.extensions,!0)}Yo.fromJson=function(e){e=e??H.EMPTY_OBJECT;let t=e.id,n=e.property,i=CVe(n),r=vVe(n,e.enums),o;return l(i)?i?o=l(n.optional)?!n.optional:!0:o=n.required??!1:o=!1,new Yo({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(Yo.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 CVe(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 vVe(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}}Yo.prototype.normalize=function(e){return this._normalized?Bq(e,this._valueType,Mt.normalize):e};Yo.prototype.unnormalize=function(e){return this._normalized?Bq(e,this._valueType,Mt.unnormalize):e};Yo.prototype.applyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:Yo.valueTransformInPlace(e,this._offset,this._scale,Mt.applyValueTransform)};Yo.prototype.unapplyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:Yo.valueTransformInPlace(e,this._offset,this._scale,Mt.unapplyValueTransform)};Yo.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)};Yo.prototype.handleNoData=function(e){let t=this._noData;if(!l(t))return e;if(!Tue(e,t))return e};function Tue(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(!Tue(e[n],t[n]))return!1;return!0}Yo.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};Yo.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};Yo.prototype.validate=function(e){if(!(!l(e)&&l(this._default)))return this._required&&!l(e)?"required property must have a value":this._isArray?EVe(this,e):Cue(this,e)};function EVe(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=Cue(e,t[i]);if(l(r))return r}}function Cue(e,t){let n=e._type,i=e._componentType,r=e._enumType,o=e._normalized;return gt.isVectorType(n)?SVe(t,n,i):gt.isMatrixType(n)?wVe(t,n,i):n===gt.STRING?IVe(t):n===gt.BOOLEAN?PVe(t):n===gt.ENUM?DVe(t,r):RVe(t,i,o)}function SVe(e,t,n){if(!Mt.isVectorCompatible(n))return`componentType ${n} is incompatible with vector type ${t}`;if(t===gt.VEC2&&!(e instanceof z))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 wVe(e,t,n){if(!Mt.isVectorCompatible(n))return`componentType ${n} is incompatible with matrix type ${t}`;if(t===gt.MAT2&&!(e instanceof Ki))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 L))return`matrix value ${e} must be a Matrix4`}function IVe(e){if(typeof e!="string")return cj(e,gt.STRING)}function PVe(e){if(typeof e!="boolean")return cj(e,gt.BOOLEAN)}function DVe(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 RVe(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"?cj(e,t):isFinite(e)?bue(e,t,n):xue(e,t);case Mt.INT64:case Mt.UINT64:return i!=="number"&&i!=="bigint"?cj(e,t):i==="number"&&!isFinite(e)?xue(e,t):bue(e,t,n)}}function cj(e,t){return`value ${e} does not match type ${t}`}function Aue(e,t,n){let i=`value ${e} is out of range for type ${t}`;return n&&(i+=" (normalized)"),i}function bue(e,t,n){if(n){let i=Mt.isUnsignedIntegerType(t)?0:-1;return e<i||e>1?Aue(e,t,n):void 0}if(e<Mt.getMinimum(t)||e>Mt.getMaximum(t))return Aue(e,t,n)}function xue(e,t){return`value ${e} of type ${t} must be finite`}function Bq(e,t,n){if(!Array.isArray(e))return n(e,t);for(let i=0;i<e.length;i++)e[i]=Bq(e[i],t,n);return e}Yo.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]=Yo.valueTransformInPlace(e[r],t[r],n[r],i);return e};Yo.prototype.cpuBytesPerElement=function(){return vue(this,this.valueType)};Yo.prototype.gpuBytesPerElement=function(){let e=Mt.gpuComponentType(this.valueType);return vue(this,e)};function vue(e,t){let n=e.type,i=gt.getComponentCount(n),r=e.isArray?e.arrayLength:1,o=Mt.getSizeInBytes(t);return i*r*o}Yo.prototype.isGpuCompatible=function(e){let t=this.type;return!(this.isVariableLengthArray||t===gt.STRING||t===gt.BOOLEAN||this.gpuBytesPerElement()>e)};var kq=[void 0,"float","vec2","vec3","vec4"],Eue=[void 0,"int","ivec2","ivec3","ivec4"],OVe=[void 0,"uint","uvec2","uvec3","uvec4"],MVe={[qc.FLOAT]:"uintBitsToFloat",[qc.INTEGER]:"int",[qc.UNSIGNED_INTEGER]:""};Yo.prototype.getGlslTypeWebGL1=function(){let e=gt.getComponentCount(this.type);return this.isArray&&(e=this.arrayLength),this.normalized?kq[e]:Eue[e]};Yo.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?kq[t]:Mt.isUnsignedIntegerType(e)?OVe[t]:Eue[t]};Yo.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=`${kq[a]} ${f} = ${e};`;i.push(y);let A=MVe[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 P="",R="";if(this.normalized){let N=Mt.getMaximum(o);P=` * ${1/Number(N)}`,R="float"}let O=`${p}${w} = ${R}(${A}(${d}))${P};`;i.push(E),i.push(O)}return p};Yo.prototype.unpackTextureInShaderWebGL1=function(e){return this.normalized?e:`${this.getGlslTypeWebGL1()}(255.0 * ${e})`};var yp=Yo;function LVe(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=LVe;function WP(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 zq(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 zq(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 zq(r[T],c,x);p+=C.typedArray.byteLength;let E=n.offset,w=n.scale,P=i.hasValueTransform||l(E)||l(w);E=E??i.offset,w=w??i.scale,E=Sue(E),w=Sue(w);let R,O,N=this;f?R=function(_){return BVe(_,N._values,N._stringOffsets)}:d?(R=function(_){return kVe(_,N._values)},O=function(_,v){zVe(_,N._values,v)}):l(u)?(R=function(_){let v=N._values.get(_);return u.namesByValue[v]},O=function(_,v){let S=u.valuesByName[v];N._values.set(_,S)}):(R=function(_){return N._values.get(_)},O=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=P,this._getValue=R,this._setValue=O,this._unpackedValues=void 0,this._extras=n.extras,this._extensions=n.extensions,this._byteLength=p}Object.defineProperties(WP.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}}});WP.prototype.get=function(e){let t=NVe(this,e);return t=this._classProperty.handleNoData(t),l(t)?(t=this._classProperty.normalize(t),t=YVe(this,t),this._classProperty.unpackVectorAndMatrixTypes(t)):(t=this._classProperty.default,this._classProperty.unpackVectorAndMatrixTypes(t))};WP.prototype.set=function(e,t){let n=this._classProperty;t=n.packVectorAndMatrixTypes(t),t=XVe(this,t),t=n.unnormalize(t),FVe(this,e,t)};WP.prototype.getTypedArray=function(){if(l(this._values))return this._values.typedArray};function Sue(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 NVe(e,t){Iue(e)&&Pue(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?Ye(a,!0):a}return!i&&o===1?e._getValue(t):wue(e,n,t)}function wue(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 FVe(e,t,n){WVe(e,t,n)&&Pue(e);let i=e._classProperty,r=i.isArray,o=i.type,a=gt.getComponentCount(o);if(l(e._unpackedValues)){i.isArray&&(n=Ye(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 BVe(e,t,n){let i=n.get(e),r=n.get(e+1)-i;return Cu(t.typedArray,i,r)}function kVe(e,t){let n=e>>3,i=e%8;return(t.typedArray[n]>>i&1)===1}function zVe(e,t,n){let i=e>>3,r=e%8;n?t.typedArray[i]|=1<<r:t.typedArray[i]&=~(1<<r)}function UVe(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 VVe(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 jVe(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 HVe(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 GVe(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 Iue(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 WVe(e,t,n){if(Iue(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 Pue(e){e._unpackedValues=qVe(e),e._arrayOffsets=void 0,e._stringOffsets=void 0,e._values=void 0}function qVe(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]=wue(e,i,s);return n}function YVe(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:yp.valueTransformInPlace(t,e._offset,e._scale,Mt.applyValueTransform)}function XVe(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:yp.valueTransformInPlace(t,e._offset,e._scale,Mt.unapplyValueTransform)}function zq(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 VVe(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 UVe(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 HVe(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 jVe(s,i)});else{let s=GVe(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 qP=WP;function Lh(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 qP({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(Lh.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}}});Lh.prototype.hasProperty=function(e){return qn.hasProperty(e,this._properties,this._class)};Lh.prototype.hasPropertyBySemantic=function(e){return qn.hasPropertyBySemantic(e,this._properties,this._class)};Lh.prototype.getPropertyIds=function(e){return qn.getPropertyIds(this._properties,this._class,e)};Lh.prototype.getProperty=function(e,t){let n=this._properties[t],i;return l(n)?i=n.get(e):i=KVe(this._class,t),i};Lh.prototype.setProperty=function(e,t,n){let i=this._properties[t];return l(i)?(i.set(e,n),!0):!1};Lh.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)};Lh.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};Lh.prototype.getPropertyTypedArray=function(e){let t=this._properties[e];if(l(t))return t.getTypedArray()};Lh.prototype.getPropertyTypedArrayBySemantic=function(e){let t,n=this._class.propertiesBySemantic;if(l(n)&&(t=n[e]),l(t))return this.getPropertyTypedArray(t.id)};function KVe(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=Ye(r,!0)),r=i.normalize(r),i.unpackVectorAndMatrixTypes(r)}}var yd=Lh;var Uq=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)}},Ji=Uq;var Due={UNLOADED:0,LOADING:1,LOADED:2,PROCESSING:3,READY:4,FAILED:5};Object.freeze(Due);var yt=Due;var lj=class extends Ji{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=yt.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=$Ve(this),this._promise)}static _fetchArrayBuffer(t){return t.fetchArrayBuffer()}unload(){this._typedArray=void 0}};async function $Ve(e){let t=e._resource;e._state=yt.LOADING;try{let n=await lj._fetchArrayBuffer(t);return e.isDestroyed()?void 0:(e._typedArray=new Uint8Array(n),e._state=yt.READY,e)}catch(n){if(e.isDestroyed())return;e._state=yt.FAILED;let i=`Failed to load external buffer: ${t.url}`;throw e.getError(i,n)}}var Mb=lj;function JVe(e){let t=e?.extensions;if(l(t))return t.KHR_meshopt_compression??t.EXT_meshopt_compression}var _y=JVe;var Vq=class extends Ji{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=_y(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=yt.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=yt.LOADING,this._promise=ZVe(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 ZVe(e){try{let t=QVe(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);py.decodeGltfBuffer(a,r,o,e._typedArray,e._meshoptMode,e._meshoptFilter),e._typedArray=a}return e._state=yt.READY,e}catch(t){if(e.isDestroyed())return;throw e.unload(),e._state=yt.FAILED,e.getError("Failed to load buffer view",t)}}function QVe(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 jv=Vq;var Lb=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])}};Lb._maxDecodingConcurrency=Math.max(fn.hardwareConcurrency-1,1);Lb._decoderTaskProcessor=void 0;Lb._taskProcessorReady=!1;Lb._error=void 0;var G0=Lb;var Ln={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 e4e(e){switch(e){case Ln.POSITION:return"positionMC";case Ln.NORMAL:return"normalMC";case Ln.TANGENT:return"tangentMC";case Ln.TEXCOORD:return"texCoord";case Ln.COLOR:return"color";case Ln.JOINTS:return"joints";case Ln.WEIGHTS:return"weights";case Ln.FEATURE_ID:return"featureId";case Ln.SCALE:return"scale";case Ln.ROTATION:return"rotation";case Ln.CUMULATIVE_DISTANCE:return"cumulativeDistance"}}Ln.hasSetIndex=function(e){switch(e){case Ln.POSITION:case Ln.NORMAL:case Ln.TANGENT:case Ln.CUMULATIVE_DISTANCE:return!1;case Ln.TEXCOORD:case Ln.COLOR:case Ln.JOINTS:case Ln.WEIGHTS:case Ln.FEATURE_ID:case Ln.SCALE:case Ln.ROTATION:return!0}};Ln.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"POSITION":return Ln.POSITION;case"NORMAL":return Ln.NORMAL;case"TANGENT":return Ln.TANGENT;case"TEXCOORD":return Ln.TEXCOORD;case"COLOR":return Ln.COLOR;case"JOINTS":return Ln.JOINTS;case"WEIGHTS":return Ln.WEIGHTS;case"_FEATURE_ID":return Ln.FEATURE_ID;case"KHR_gaussian_splatting:SCALE":case"_SCALE":return Ln.SCALE;case"KHR_gaussian_splatting:ROTATION":case"_ROTATION":return Ln.ROTATION;case"BENTLEY_materials_line_style:CUMULATIVE_DISTANCE":return Ln.CUMULATIVE_DISTANCE}};Ln.fromPntsSemantic=function(e){switch(e){case"POSITION":case"POSITION_QUANTIZED":return Ln.POSITION;case"RGBA":case"RGB":case"RGB565":return Ln.COLOR;case"NORMAL":case"NORMAL_OCT16P":return Ln.NORMAL;case"BATCH_ID":return Ln.FEATURE_ID}};Ln.getGlslType=function(e){switch(e){case Ln.POSITION:case Ln.NORMAL:case Ln.TANGENT:return"vec3";case Ln.TEXCOORD:return"vec2";case Ln.COLOR:return"vec4";case Ln.JOINTS:return"ivec4";case Ln.WEIGHTS:return"vec4";case Ln.FEATURE_ID:return"int";case Ln.SCALE:return"vec3";case Ln.ROTATION:return"vec4";case Ln.CUMULATIVE_DISTANCE:return"float";case Ln.OPACITY:return"float"}};Ln.getVariableName=function(e,t){let n=e4e(e);return l(t)&&(n+=`_${t}`),n};Object.freeze(Ln);var rt=Ln;var jq=class extends Ji{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=yt.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=yt.LOADING,this._promise=t4e(this),this._promise)}process(t){if(this._state===yt.READY)return!0;if(this._state!==yt.PROCESSING||(l(this._dracoError)&&Rue(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=i4e(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=G0.decodeBufferView(f);if(!l(d))return!1;this._decodePromise=n4e(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 t4e(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=yt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;Rue(e,n)}}function Rue(e,t){throw e.unload(),e._state=yt.FAILED,e.getError("Failed to load Draco",t)}async function n4e(e,t){try{let n=await t;return e.isDestroyed()?void 0:(e.unload(),e._decodedData={indices:n.indexArray,vertexAttributes:n.attributeData},e._state=yt.READY,e._baseResource)}catch(n){if(e.isDestroyed())return;e._dracoError=n}}var Nb={};Nb[rt.POSITION]="POSITION";Nb[rt.NORMAL]="NORMAL";Nb[rt.COLOR]="COLOR";Nb[rt.TEXCOORD]="TEX_COORD";function i4e(e){for(let t in Nb)if(Nb.hasOwnProperty(t)&&e.startsWith(t))return Nb[t]}var Hv=jq;function r4e(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 W0=r4e;function Gv(e,t,n,i,r){this._format=e,this._datatype=t,this._width=n,this._height=i,this._buffer=r}Object.defineProperties(Gv.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}}});Gv.clone=function(e){if(l(e))return new Gv(e._format,e._datatype,e._width,e._height,e._buffer)};Gv.prototype.clone=function(){return Gv.clone(this)};var YP=Gv;function q0(){}q0._transcodeTaskProcessor=new Yn("transcodeKTX2",Number.POSITIVE_INFINITY);q0._readyPromise=void 0;function o4e(){let e=q0._transcodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then(function(t){if(t)return q0._transcodeTaskProcessor;throw new oe("KTX2 transcoder could not be initialized.")});q0._readyPromise=e}q0.transcode=function(e,t){return l(q0._readyPromise)||o4e(),q0._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 YP(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 XP=q0;var Oue;Mue.setKTX2SupportedFormats=function(e,t,n,i,r,o){Oue={s3tc:e,pvrtc:t,astc:n,etc:i,etc1:r,bc7:o}};function Mue(e){let t;return e instanceof ArrayBuffer||ArrayBuffer.isView(e)?t=Promise.resolve(e):t=De.createIfNeeded(e).fetchArrayBuffer(),t.then(function(n){return XP.transcode(n,Oue)})}var vu=Mue;var KP=class extends Ji{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=yt.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=a4e(this),this._promise):(this._promise=s4e(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 Lue(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 a4e(e){e._state=yt.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 l4e(i);if(e.isDestroyed())return;let o=Lue(r);return e.unload(),e._image=o.image,e._mipLevels=o.mipLevels,e._state=yt.READY,e}catch(n){return e.isDestroyed()?void 0:Nue(e,n,"Failed to load embedded image")}}async function s4e(e){e._state=yt.LOADING;let t=e._baseResource,n=e._uri,i=t.getDerivedResource({url:n});try{let r=await f4e(i);if(e.isDestroyed())return;let o=Lue(r);return e.unload(),e._image=o.image,e._mipLevels=o.mipLevels,e._state=yt.READY,e}catch(r){return e.isDestroyed()?void 0:Nue(e,r,`Failed to load image: ${n}`)}}function Nue(e,t,n){return e.unload(),e._state=yt.FAILED,Promise.reject(e.getError(n,t))}function c4e(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 l4e(e){let t=c4e(e);if(t==="image/ktx2"){let n=new Uint8Array(e);return vu(n)}return KP._loadImageFromTypedArray({uint8Array:e,format:t,flipY:!1,skipColorSpaceConversion:!0})}var u4e=/(^data:image\/ktx2)|(\.ktx2$)/i;function f4e(e){let t=e.getUrlComponent(!1,!0);return u4e.test(t)?vu(e):e.fetchImage({skipColorSpaceConversion:!0,preferImageBitmap:!0})}KP._loadImageFromTypedArray=W0;var Wv=KP;function d4e(e,t){pt(e,t)}var Ds=d4e;function h4e(){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=h4e;var Fb={STREAM_DRAW:ee.STREAM_DRAW,STATIC_DRAW:ee.STATIC_DRAW,DYNAMIC_DRAW:ee.DYNAMIC_DRAW,DYNAMIC_READ:ee.DYNAMIC_READ};Fb.validate=function(e){return e===Fb.STREAM_DRAW||e===Fb.STATIC_DRAW||e===Fb.DYNAMIC_DRAW||e===Fb.DYNAMIC_READ};Object.freeze(Fb);var Oe=Fb;function Yc(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}Yc.createPixelBuffer=function(e){if(!e.context._webgl2)throw new pe("A WebGL 2 context is required to create PixelBuffers.");return new Yc({context:e.context,bufferTarget:ee.PIXEL_PACK_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};Yc.createVertexBuffer=function(e){return new Yc({context:e.context,bufferTarget:ee.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};Yc.createIndexBuffer=function(e){let t=e.context,n=e.indexDatatype,i=Ve.getSizeInBytes(n),r=new Yc({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(Yc.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}});Yc.prototype._getBuffer=function(){return this._buffer};Yc.prototype._bind=function(){let e=this._gl,t=this._bufferTarget;e.bindBuffer(t,this._buffer)};Yc.prototype._unBind=function(){let e=this._gl,t=this._bufferTarget;e.bindBuffer(t,null)};Yc.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)};Yc.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)};Yc.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)};Yc.prototype.isDestroyed=function(){return!1};Yc.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),ue(this)};var Ze=Yc;var Fue={TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3};Object.freeze(Fue);var Ic=Fue;var Hq=class extends Ji{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=yt.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=p4e(this),this._promise):(this._promise=g4e(this),this._promise)}process(t){if(this._state===yt.READY)return!0;if(this._state!==yt.LOADED&&this._state!==yt.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){Wq(this,o)}if(!l(n))return!1;let r;if(this._loadBuffer&&this._asynchronous){let o=m4e;if(o.set(n,i,t.context),!t.jobScheduler.execute(o,Ic.BUFFER))return!1;r=o.buffer}else this._loadBuffer&&(r=Bue(n,i,t.context));return this.unload(),this._buffer=r,this._typedArray=this._loadTypedArray?n:void 0,this._state=yt.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}},Gq=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=Bue(this.typedArray,this.indexDatatype,this.context)}};function Bue(e,t,n){let i=Ze.createIndexBuffer({typedArray:e,context:n,usage:Oe.STATIC_DRAW,indexDatatype:t});return i.vertexArrayDestroyable=!1,i}var m4e=new Gq;async function p4e(e){e._state=yt.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=yt.LOADED,e)}catch(n){if(e.isDestroyed())return;Wq(e,n)}}async function g4e(e){let t=e._gltf,n=e._accessorId,r=t.accessors[n].bufferView;e._state=yt.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=_4e(e,s),e._state=yt.PROCESSING,e}catch(a){if(e.isDestroyed())return;Wq(e,a)}}function _4e(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,Ds("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 Wq(e,t){throw e.unload(),e._state=yt.FAILED,e.getError("Failed to load index buffer",t)}var qv=Hq;function y4e(e,t){return t=t??0,Cu(e,t,Math.min(4,e.length))}var Nh=y4e;function A4e(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 us=A4e;function b4e(e,t){return l(e.extensionsUsed)&&e.extensionsUsed.indexOf(t)>=0}var Oo=b4e;function tn(){}tn.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}}};tn.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}}};tn.topLevel=function(e,t,n){let i=e[t];return l(i)&&!Array.isArray(i)?tn.objectLegacy(i,n):tn.object(i,n)};tn.accessor=function(e,t){return tn.topLevel(e,"accessors",t)};tn.accessorWithSemantic=function(e,t,n){let i={};return tn.mesh(e,function(r){return tn.meshPrimitive(r,function(o){let a=tn.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:tn.meshPrimitiveTarget(o,function(s){return tn.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}})})})})};tn.accessorContainingVertexAttributeData=function(e,t){let n={};return tn.mesh(e,function(i){return tn.meshPrimitive(i,function(r){let o=tn.meshPrimitiveAttribute(r,function(a){if(!l(n[a])){n[a]=!0;let s=t(a);if(l(s))return s}});return l(o)?o:tn.meshPrimitiveTarget(r,function(a){return tn.meshPrimitiveTargetAttribute(a,function(s){if(!l(n[s])){n[s]=!0;let c=t(s);if(l(c))return c}})})})})};tn.accessorContainingIndexData=function(e,t){let n={};return tn.mesh(e,function(i){return tn.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}})})};tn.animation=function(e,t){return tn.topLevel(e,"animations",t)};tn.animationChannel=function(e,t){let n=e.channels;return tn.object(n,t)};tn.animationSampler=function(e,t){let n=e.samplers;return tn.object(n,t)};tn.buffer=function(e,t){return tn.topLevel(e,"buffers",t)};tn.bufferView=function(e,t){return tn.topLevel(e,"bufferViews",t)};tn.camera=function(e,t){return tn.topLevel(e,"cameras",t)};tn.image=function(e,t){return tn.topLevel(e,"images",t)};tn.material=function(e,t){return tn.topLevel(e,"materials",t)};tn.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}};tn.mesh=function(e,t){return tn.topLevel(e,"meshes",t)};tn.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}}};tn.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}};tn.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}}};tn.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}};tn.node=function(e,t){return tn.topLevel(e,"nodes",t)};tn.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=tn.nodeInTree(e,u,n),l(c)))return c}}}};tn.nodeInScene=function(e,t,n){let i=t.nodes;if(l(i))return tn.nodeInTree(e,i,n)};tn.program=function(e,t){return Oo(e,"KHR_techniques_webgl")?tn.object(e.extensions.KHR_techniques_webgl.programs,t):tn.topLevel(e,"programs",t)};tn.sampler=function(e,t){return tn.topLevel(e,"samplers",t)};tn.scene=function(e,t){return tn.topLevel(e,"scenes",t)};tn.shader=function(e,t){return Oo(e,"KHR_techniques_webgl")?tn.object(e.extensions.KHR_techniques_webgl.shaders,t):tn.topLevel(e,"shaders",t)};tn.skin=function(e,t){return tn.topLevel(e,"skins",t)};tn.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}}};tn.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}};tn.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}};tn.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}};tn.technique=function(e,t){return Oo(e,"KHR_techniques_webgl")?tn.object(e.extensions.KHR_techniques_webgl.techniques,t):tn.topLevel(e,"techniques",t)};tn.texture=function(e,t){return tn.topLevel(e,"textures",t)};var ze=tn;function x4e(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 ff=x4e;function T4e(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)*ff(t.type)}var Eu=T4e;function C4e(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=us(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=Eu(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)&&Bb(c)}),Bb(n.emissiveTexture),Bb(n.normalTexture),Bb(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,Bb(a.baseColorTexture),Bb(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,Bb(s.specularGlossinessTexture))}),ze.animation(e,function(n){ze.animationSampler(n,function(i){i.interpolation=i.interpolation??"LINEAR"})});let t=v4e(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 v4e(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 Bb(e){l(e)&&(e.texCoord=e.texCoord??0)}var $P=C4e;function E4e(e){return ze.shader(e,function(t){uj(t)}),ze.buffer(e,function(t){uj(t)}),ze.image(e,function(t){uj(t)}),uj(e),e}function uj(e){e.extras=l(e.extras)?e.extras:{},e.extras._pipeline=l(e.extras._pipeline)?e.extras._pipeline:{}}var yy=E4e;function S4e(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 JP=S4e;function w4e(e,t){let n=e.extensionsUsed;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),JP(e,t),n.length===0&&delete e.extensionsUsed}}var kb=w4e;var I4e=4;function P4e(e){if(Nh(e)!=="glTF")throw new oe("File is not valid binary glTF");let n=kue(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?D4e(e,n):R4e(e,n)}function kue(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*I4e,!0);return r}function D4e(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=Cu(e,o,i),c=JSON.parse(s);yy(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 kb(c,"KHR_binary_glTF"),c}function R4e(e,t){let n=t[2],i=12,r,o;for(;i<n;){let a=kue(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=Cu(u);r=JSON.parse(f),yy(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 zb=P4e;function O4e(e){return ze.shader(e,function(t){fj(t)}),ze.buffer(e,function(t){fj(t)}),ze.image(e,function(t){fj(t)}),fj(e),e}function fj(e){l(e.extras)&&(l(e.extras._pipeline)&&delete e.extras._pipeline,Object.keys(e.extras).length===0&&delete e.extras)}var ZP=O4e;function M4e(e,t){let n=e.extensionsUsed;l(n)||(n=[],e.extensionsUsed=n),us(n,t,!0)}var Ad=M4e;function L4e(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 Y0=L4e;function N4e(e,t){let n=e.bufferViews,i=e.buffers,r=t.bufferView,o=ff(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=Eu(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=Y0(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 Ub=N4e;var F4e=[ee.FUNC_ADD,ee.FUNC_ADD],B4e=[ee.ONE,ee.ZERO,ee.ONE,ee.ZERO];function zue(e,t){let n=e.enable;return l(n)?n.indexOf(t)>-1:!1}var k4e=[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 z4e(e,t){if(!l(e))return t;for(let n=0;n<4;n++)if(k4e.indexOf(e[n])===-1)return t;return e}function U4e(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(zue(a,ee.BLEND)){s.alphaMode="BLEND";let c=a.functions;l(c)&&(l(c.blendEquationSeparate)||l(c.blendFuncSeparate))&&(t[o]={blendEquation:c.blendEquationSeparate??F4e,blendFactors:z4e(c.blendFuncSeparate,B4e)})}zue(a,ee.CULL_FACE)||(s.doubleSided=!0),delete r.states}}),Object.keys(t).length>0&&(l(e.extensions)||(e.extensions={}),Ad(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 QP=U4e;function V4e(e,t){let n=e.extensionsRequired;l(n)||(n=[],e.extensionsRequired=n),us(n,t,!0),Ad(e,t)}var eD=V4e;function j4e(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=us(o.shaders,g,!0);let m=e.shaders[d.vertexShader];p.vertexShader=us(o.shaders,m,!0),u.program=us(o.programs,p),r[s.program]=u.program}i[c]=us(o.techniques,u)}),o.techniques.length>0&&(l(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl=o,Ad(e,"KHR_techniques_webgl"),eD(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 tD=j4e;function H4e(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 Yv=H4e;var Uue=["mesh","node","material","accessor","bufferView","buffer","texture","sampler","image"];function G4e(e,t){return t=t??Uue,Uue.forEach(function(n){t.indexOf(n)>-1&&q4e(e,n)}),e}var W4e={accessor:"accessors",buffer:"buffers",bufferView:"bufferViews",image:"images",node:"nodes",material:"materials",mesh:"meshes",sampler:"samplers",texture:"textures"};function q4e(e,t){let n=W4e[t],i=e[n];if(l(i)){let r=0,o=bp[t](e),a=i.length;for(let s=0;s<a;++s)o[s]||(Ap[t](e,s-r),r++)}}function Ap(){}Ap.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--})})};Ap.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--}})};Ap.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--}),Oo(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--})}),Oo(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(Oo(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--}}}}};Ap.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})};Ap.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)})};Ap.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})})};Ap.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--})})};Ap.sampler=function(e,t){e.samplers.splice(t,1),ze.texture(e,function(i){l(i.sampler)&&i.sampler>t&&--i.sampler})};Ap.texture=function(e,t){if(e.textures.splice(t,1),ze.material(e,function(i){Yv(i,function(r,o){o.index>t&&--o.index})}),Oo(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(Oo(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}}}})}),Oo(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 bp(){}bp.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)})}),Oo(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})}),Oo(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};bp.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};bp.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)}),Oo(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)})}),Oo(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(Oo(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};bp.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};bp.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 Vue(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!Vue(e,r,n)}).length===0}bp.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){Vue(e,i,t)||(t[i]=!0)}),t};bp.material=function(e){let t={};return ze.mesh(e,function(n){ze.meshPrimitive(n,function(i){l(i.material)&&(t[i.material]=!0)})}),t};bp.texture=function(e){let t={};if(ze.material(e,function(n){Yv(n,function(i){t[i]=!0})}),Oo(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(Oo(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)}}}})}),Oo(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};bp.sampler=function(e){let t={};return ze.texture(e,function(n){l(n.sampler)&&(t[n.sampler]=!0)}),t};var nD=G4e;function Y4e(e,t){let n={byteLength:t.length,extras:{_pipeline:{source:t}}},r={buffer:us(e.buffers,n),byteOffset:0,byteLength:t.length};return us(e.bufferViews,r)}var iD=Y4e;function X4e(e,t){let n=Eu(e,t),i=Y.getSizeInBytes(t.componentType),r=ff(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=Y0(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 rD=X4e;function K4e(e){let t;return ze.accessorWithSemantic(e,"JOINTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===ee.BYTE?dj(e,i,Y.UNSIGNED_BYTE):t!==ee.UNSIGNED_BYTE&&t!==ee.UNSIGNED_SHORT&&dj(e,i,Y.UNSIGNED_SHORT)}),ze.accessorWithSemantic(e,"WEIGHTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===ee.BYTE?dj(e,i,Y.UNSIGNED_BYTE):t===ee.SHORT&&dj(e,i,Y.UNSIGNED_SHORT)}),e}function dj(e,t,n){let i=Y.createTypedArray(n,rD(e,t)),r=new Uint8Array(i.buffer);t.bufferView=iD(e,r),t.componentType=n,t.byteOffset=0}var oD=K4e;function $4e(e,t){return kb(e,t),t==="CESIUM_RTC"&&J4e(e),qq(e,t)}function J4e(e){ze.technique(e,function(t){ze.techniqueUniform(t,function(n){n.semantic==="CESIUM_RTC_MODELVIEW"&&(n.semantic="MODELVIEW")})})}function qq(e,t){if(Array.isArray(e)){let n=e.length;for(let i=0;i<n;++i)qq(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)&&qq(e[r],t);return i}}var Vb=$4e;var hj={.8:i8e,"1.0":v8e,"2.0":void 0};function Z4e(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(hj,i)||(l(i)&&(i=i.substring(0,3)),Object.prototype.hasOwnProperty.call(hj,i)||(i="1.0"));let r=hj[i];for(;l(r)&&i!==n;)r(e,t),i=e.asset.version,r=hj[i];return t.keepLegacyExtensions||(w8e(e,t),I8e(e)),e}function Gue(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 Q4e(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 e8e(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 t8e(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,P=b.count,R=ff(b.type),O=b.count*R,N=Y.createArrayBufferView(w,C.buffer,E,O);for(let _=0;_<P;_++){let v=_*R;h.unpack(N,v,a);let S=N[v+3];Fe.fromAxisAngle(a,S,s),Fe.pack(s,N,v)}}}}}}function n8e(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 i8e(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,Gue(e),Q4e(e),e8e(e),t8e(e),n8e(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,Ad(e,"KHR_materials_common")}}function r8e(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 jue(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 o8e(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]=jue(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=us(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=jue(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 a8e(e){ze.animation(e,function(t){ze.animationSampler(t,function(n){delete n.name})})}function s8e(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 c8e(e){let t=e.asset;delete t.profile,delete t.premultipliedAlpha}var l8e={CESIUM_RTC:!0,KHR_materials_common:!0,WEB3D_quantized_attributes:!0};function u8e(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(l8e[r])&&e.extensionsRequired.push(r)}}}function f8e(e){ze.buffer(e,function(t){delete t.type})}function d8e(e){ze.texture(e,function(t){delete t.format,delete t.internalFormat,delete t.target,delete t.type})}function h8e(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 m8e={POSITION:!0,NORMAL:!0,TANGENT:!0},p8e={COLOR:"COLOR",JOINT:"JOINTS",JOINTS:"JOINTS",TEXCOORD:"TEXCOORD",WEIGHT:"WEIGHTS",WEIGHTS:"WEIGHTS"};function g8e(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=p8e[s];l(f)?(u=f+c,t[o]=u):l(m8e[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 _8e(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:Eu(e,t)}function y8e(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 A8e(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=Ye(i,!0);o[s]&&(x.byteStride=g),x.byteOffset+=u,x.byteLength=m+y-u;let T=us(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}}}nD(e,["accessor","bufferView","buffer"])}function b8e(e){ze.accessorWithSemantic(e,"POSITION",function(t){let n=e.accessors[t];if(!l(n.min)||!l(n.max)){let i=Ub(e,n);n.min=i.min,n.max=i.max}})}function Wue(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)||L.fromColumnMajorArray(e.matrix).equals(L.IDENTITY))&&!l(e.extensions)&&!l(e.extras)}function que(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),Wue(n)&&que(e,i))}}),delete e.nodes[t]}function x8e(e){return ze.node(e,function(t,n){Wue(t)&&que(e,n)}),e}function T8e(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=Ub(e,i);i.min=r.min,i.max=r.max}})})}function C8e(e){ze.accessor(e,function(t){if(l(t.min)||l(t.max)){let n=Ub(e,t);l(t.min)&&(t.min=n.min),l(t.max)&&(t.max=n.max)}})}function v8e(e){e.asset=e.asset??{},e.asset.version="2.0",Gue(e),r8e(e),x8e(e),o8e(e),a8e(e),c8e(e),u8e(e),y8e(e),A8e(e),b8e(e),T8e(e),C8e(e),f8e(e),d8e(e),h8e(e),g8e(e),oD(e),_8e(e),QP(e),tD(e),s8e(e)}var E8e=["u_tex","u_diffuse","u_emission","u_diffuse_tex"],S8e=["u_diffuse","u_diffuse_mat"];function Kq(e){e.pbrMetallicRoughness=l(e.pbrMetallicRoughness)?e.pbrMetallicRoughness:{},e.pbrMetallicRoughness.roughnessFactor=1,e.pbrMetallicRoughness.metallicFactor=0}function $q(e){return l(e.index)}function Jq(e){return Array.isArray(e)&&e.length===4}function Yue(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 w8e(e,t){t=t??{};let n=t.baseColorTextureNames??E8e,i=t.baseColorFactorNames??S8e;ze.material(e,function(r){ze.materialValue(r,function(o,a){n.indexOf(a)!==-1&&$q(o)?(Kq(r),r.pbrMetallicRoughness.baseColorTexture=o):i.indexOf(a)!==-1&&Jq(o)&&(Kq(r),r.pbrMetallicRoughness.baseColorFactor=Yue(o))})}),Vb(e,"KHR_techniques_webgl"),Vb(e,"KHR_blend")}function Yq(e,t){l(t)&&(Jq(t)?e.pbrMetallicRoughness.baseColorFactor=Yue(t):$q(t)&&(e.pbrMetallicRoughness.baseColorTexture=t))}function Hue(e,t){l(t)&&(Jq(t)?e.emissiveFactor=t.slice(0,3):$q(t)&&(e.emissiveTexture=t))}function I8e(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;Kq(t),n.technique==="CONSTANT"?(Ad(e,"KHR_materials_unlit"),t.extensions=l(t.extensions)?t.extensions:{},t.extensions.KHR_materials_unlit={},Yq(t,a),Yq(t,r)):(Yq(t,o),Hue(t,r),Hue(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")}),Vb(e,"KHR_materials_common")}var aD=Z4e;var Xue={FRONT:ee.FRONT,BACK:ee.BACK,FRONT_AND_BACK:ee.FRONT_AND_BACK};Object.freeze(Xue);var zi=Xue;function Xc(){}Xc.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};Xc.getNodeTransform=function(e){return l(e.matrix)?e.matrix:L.fromTranslationQuaternionRotationScale(l(e.translation)?e.translation:h.ZERO,l(e.rotation)?e.rotation:Fe.IDENTITY,l(e.scale)?e.scale:h.ONE)};Xc.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}};Xc.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}};Xc.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}};Xc.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};Xc.getAttributeInfo=function(e){let t=e.semantic,n=e.setIndex,i,r=!1;l(t)?(i=rt.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 P8e=new h,D8e=new h;Xc.getPositionMinMax=function(e,t,n){let i=Xc.getAttributeBySemantic(e,"POSITION"),r=i.max,o=i.min;return l(n)&&l(t)&&(o=h.add(o,t,D8e),r=h.add(r,n,P8e)),{min:o,max:r}};Xc.getAxisCorrectionMatrix=function(e,t,n){return n=L.clone(L.IDENTITY,n),e===ki.Y?n=L.clone(ki.Y_UP_TO_Z_UP,n):e===ki.X&&(n=L.clone(ki.X_UP_TO_Z_UP,n)),t===ki.Z&&(n=L.multiplyTransformation(n,ki.Z_UP_TO_X_UP,n)),n};var R8e=new $;Xc.getCullFace=function(e,t){if(!Re.isTriangles(t))return zi.BACK;let n=L.getMatrix3(e,R8e);return $.determinant(n)<0?zi.FRONT:zi.BACK};Xc.sanitizeGlslIdentifier=function(e){let t=e.replaceAll(/[^A-Za-z0-9]+/g,"_");return t=t.replace(/^gl_/,""),/^\d/.test(t)&&(t=`_${t}`),t};Xc.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};Xc.checkSupportedExtensions=function(e){let t=e.length;for(let n=0;n<t;n++){let i=e[n];if(!Xc.supportedExtensions[i])throw new oe(`Unsupported glTF Extension: ${i}`)}};var _t=Xc;var Zq=class extends Ji{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=yt.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=yt.LOADING,l(this._gltfJson)?(this._promise=Kue(this,this._gltfJson),this._promise):l(this._typedArray)?(this._promise=$ue(this,this._typedArray),this._promise):(this._promise=O8e(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 O8e(e){let t;try{let n=await e._fetchGltf();if(e.isDestroyed())return;t=new Uint8Array(n)}catch(n){if(e.isDestroyed())return;Qq(e,n)}return $ue(e,t)}function Qq(e,t){e.unload(),e._state=yt.FAILED;let n=`Failed to load glTF: ${e._gltfResource.url}`;throw e.getError(n,t)}async function M8e(e,t){if(l(t.asset)&&t.asset.version==="2.0"&&!Oo(t,"KHR_techniques_webgl")&&!Oo(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),aD(t)}function L8e(e){let t=[];return ze.buffer(e,function(n){let i=n.uri;!l(n.extras._pipeline.source)&&l(i)&&Eh(i)&&(delete n.uri,t.push(De.fetchArrayBuffer(i).then(function(r){n.extras._pipeline.source=new Uint8Array(r)})))}),Promise.all(t)}function N8e(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 Kue(e,t){try{yy(t),await L8e(t),await M8e(e,t),$P(t),await N8e(e,t),ZP(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=yt.READY,e}catch(n){if(e.isDestroyed())return;Qq(e,n)}}async function $ue(e,t){let n;try{Nh(t)==="glTF"?n=zb(t):n=Co(t)}catch(i){if(e.isDestroyed())return;Qq(e,i)}return Kue(e,n)}var Xv=Zq;var Ii={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};Ii.toWebGLConstant=function(e,t){switch(e){case Ii.UNSIGNED_BYTE:return ee.UNSIGNED_BYTE;case Ii.UNSIGNED_SHORT:return ee.UNSIGNED_SHORT;case Ii.UNSIGNED_INT:return ee.UNSIGNED_INT;case Ii.FLOAT:return ee.FLOAT;case Ii.HALF_FLOAT:return t.webgl2?ee.HALF_FLOAT:ee.HALF_FLOAT_OES;case Ii.UNSIGNED_INT_24_8:return ee.UNSIGNED_INT_24_8;case Ii.UNSIGNED_SHORT_4_4_4_4:return ee.UNSIGNED_SHORT_4_4_4_4;case Ii.UNSIGNED_SHORT_5_5_5_1:return ee.UNSIGNED_SHORT_5_5_5_1;case Ii.UNSIGNED_SHORT_5_6_5:return Ii.UNSIGNED_SHORT_5_6_5}};Ii.isPacked=function(e){return e===Ii.UNSIGNED_INT_24_8||e===Ii.UNSIGNED_SHORT_4_4_4_4||e===Ii.UNSIGNED_SHORT_5_5_5_1||e===Ii.UNSIGNED_SHORT_5_6_5};Ii.sizeInBytes=function(e){switch(e){case Ii.UNSIGNED_BYTE:return 1;case Ii.UNSIGNED_SHORT:case Ii.UNSIGNED_SHORT_4_4_4_4:case Ii.UNSIGNED_SHORT_5_5_5_1:case Ii.UNSIGNED_SHORT_5_6_5:case Ii.HALF_FLOAT:return 2;case Ii.UNSIGNED_INT:case Ii.FLOAT:case Ii.UNSIGNED_INT_24_8:return 4}};Ii.validate=function(e){return e===Ii.UNSIGNED_BYTE||e===Ii.UNSIGNED_SHORT||e===Ii.UNSIGNED_INT||e===Ii.FLOAT||e===Ii.HALF_FLOAT||e===Ii.UNSIGNED_INT_24_8||e===Ii.UNSIGNED_SHORT_4_4_4_4||e===Ii.UNSIGNED_SHORT_5_5_5_1||e===Ii.UNSIGNED_SHORT_5_6_5};Ii.getTypedArrayConstructor=function(e){let t=Ii.sizeInBytes(e);return t===Uint8Array.BYTES_PER_ELEMENT?Uint8Array:t===Uint16Array.BYTES_PER_ELEMENT?Uint16Array:t===Float32Array.BYTES_PER_ELEMENT&&e===Ii.FLOAT?Float32Array:Uint32Array};Object.freeze(Ii);var ke=Ii;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 eY(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 nY[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=eY(f,u,t+1/3),s=eY(f,u,t),c=eY(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+D.nextRandomNumber()*(c-s)}let r=t.green;if(!l(r)){let s=t.minimumGreen??0,c=t.maximumGreen??1;r=s+D.nextRandomNumber()*(c-s)}let o=t.blue;if(!l(o)){let s=t.minimumBlue??0,c=t.maximumBlue??1;o=s+D.nextRandomNumber()*(c-s)}let a=t.alpha;if(!l(a)){let s=t.minimumAlpha??0,c=t.maximumAlpha??1;a=s+D.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=F8e.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=B8e.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=k8e.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=z8e.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,nY[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=D.lerp(t.red,n.red,i),r.green=D.lerp(t.green,n.green,i),r.blue=D.lerp(t.blue,n.blue,i),r.alpha=D.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}},tY,nY,X0;fn.supportsTypedArrays()&&(tY=new ArrayBuffer(4),nY=new Uint32Array(tY),X0=new Uint8Array(tY));var F8e=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,B8e=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,k8e=/^rgba?\s*\(\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i,z8e=/^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 Mo={_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(Mo,{maximumCombinedTextureImageUnits:{get:function(){return Mo._maximumCombinedTextureImageUnits}},maximumCubeMapSize:{get:function(){return Mo._maximumCubeMapSize}},maximumFragmentUniformVectors:{get:function(){return Mo._maximumFragmentUniformVectors}},maximumTextureImageUnits:{get:function(){return Mo._maximumTextureImageUnits}},maximumRenderbufferSize:{get:function(){return Mo._maximumRenderbufferSize}},maximumTextureSize:{get:function(){return Mo._maximumTextureSize}},maximum3DTextureSize:{get:function(){return Mo._maximum3DTextureSize}},maximumVaryingVectors:{get:function(){return Mo._maximumVaryingVectors}},maximumVertexAttributes:{get:function(){return Mo._maximumVertexAttributes}},maximumVertexTextureImageUnits:{get:function(){return Mo._maximumVertexTextureImageUnits}},maximumVertexUniformVectors:{get:function(){return Mo._maximumVertexUniformVectors}},minimumAliasedLineWidth:{get:function(){return Mo._minimumAliasedLineWidth}},maximumAliasedLineWidth:{get:function(){return Mo._maximumAliasedLineWidth}},minimumAliasedPointSize:{get:function(){return Mo._minimumAliasedPointSize}},maximumAliasedPointSize:{get:function(){return Mo._maximumAliasedPointSize}},maximumViewportWidth:{get:function(){return Mo._maximumViewportWidth}},maximumViewportHeight:{get:function(){return Mo._maximumViewportHeight}},maximumTextureFilterAnisotropy:{get:function(){return Mo._maximumTextureFilterAnisotropy}},maximumDrawBuffers:{get:function(){return Mo._maximumDrawBuffers}},maximumColorAttachments:{get:function(){return Mo._maximumColorAttachments}},maximumSamples:{get:function(){return Mo._maximumSamples}},highpFloatSupported:{get:function(){return Mo._highpFloatSupported}},highpIntSupported:{get:function(){return Mo._highpIntSupported}}});var Lt=Mo;var sD={DONT_CARE:ee.DONT_CARE,FASTEST:ee.FASTEST,NICEST:ee.NICEST,validate:function(e){return e===sD.DONT_CARE||e===sD.FASTEST||e===sD.NICEST}};Object.freeze(sD);var bd=sD;var cD={NEAREST:ee.NEAREST,LINEAR:ee.LINEAR};cD.validate=function(e){return e===cD.NEAREST||e===cD.LINEAR};Object.freeze(cD);var ei=cD;var K0={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};K0.validate=function(e){return e===K0.NEAREST||e===K0.LINEAR||e===K0.NEAREST_MIPMAP_NEAREST||e===K0.LINEAR_MIPMAP_NEAREST||e===K0.NEAREST_MIPMAP_LINEAR||e===K0.LINEAR_MIPMAP_LINEAR};Object.freeze(K0);var Gt=K0;var lD={CLAMP_TO_EDGE:ee.CLAMP_TO_EDGE,REPEAT:ee.REPEAT,MIRRORED_REPEAT:ee.MIRRORED_REPEAT,validate:function(e){return e===lD.CLAMP_TO_EDGE||e===lD.REPEAT||e===lD.MIRRORED_REPEAT}};Object.freeze(lD);var rn=lD;function uD(e){e=e??H.EMPTY_OBJECT;let{wrapR:t=rn.CLAMP_TO_EDGE,wrapS:n=rn.CLAMP_TO_EDGE,wrapT:i=rn.CLAMP_TO_EDGE,minificationFilter:r=Gt.LINEAR,magnificationFilter:o=ei.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(uD.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}}});uD.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};uD.NEAREST=Object.freeze(new uD({wrapR:rn.CLAMP_TO_EDGE,wrapS:rn.CLAMP_TO_EDGE,wrapT:rn.CLAMP_TO_EDGE,minificationFilter:Gt.NEAREST,magnificationFilter:ei.NEAREST}));var zt=uD;function xd(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 zt}=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 z(c,u),this._hasMipmap=!1,this._sizeInBytes=m,this._preMultiplyAlpha=f,this._flipY=o,this._initialized=!1,this._sampler=void 0,this._sampler=s,efe(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)?U8e(this,n):Jue(this,n):l(n.framebuffer)?j8e(this,n):Zue(this,n),this._initialized=!0):Que(this),g.bindTexture(this._textureTarget,null)}function U8e(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=mj(c),u=mj(u),i.compressedTexImage2D(r,f+1,o,c,u,0,t.mipLevels[f])}}function Jue(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=mj(g),m=mj(m),i.texImage2D(r,y+1,o,g,m,0,c,ke.toWebGLConstant(u,n),t.mipLevels[y])}}function V8e(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 j8e(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 Zue(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 H8e(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 mj(e){let t=Math.floor(e/2)|0;return Math.max(t,1)}function Que(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)}xd.create=function(e){return new xd(e)};xd.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 xd({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(xd.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){efe(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 efe(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=ei.NEAREST),o.webgl2&&He.isDepthFormat(a)&&(n=Gt.NEAREST,i=ei.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)}xd.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)?Jue(this,i):Zue(this,i),f=!0):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),Que(this)),this._initialized=!0),f||(l(i.arrayBufferView)?V8e(this,i.arrayBufferView,t,n,c,u):H8e(this,i,t,n)),a.bindTexture(s,null)};xd.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};xd.prototype.generateMipmap=function(e){e=e??bd.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)};xd.prototype.isDestroyed=function(){return!1};xd.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),ue(this)};xd.defaultColor=U.WHITE;var Ct=xd;var tfe={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};Object.freeze(tfe);var xp=tfe;var Tr={},iY=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}},rY=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}},oY=class{constructor(){this.indexDatatype=void 0,this.count=void 0,this.buffer=void 0,this.typedArray=void 0}},aY=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}},sY=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}},cY=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}},lY=class{constructor(){this.attributes=[]}},uY=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}},fY=class{constructor(){this.attributes=[],this.featureIds=[],this.transformInWorldSpace=!1}},dY=class{constructor(){this.index=void 0,this.joints=[],this.inverseBindMatrices=[]}},hY=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}},mY=class{constructor(){this.nodes=[]}},G8e={TRANSLATION:"translation",ROTATION:"rotation",SCALE:"scale",WEIGHTS:"weights"},pY=class{constructor(){this.input=[],this.interpolation=void 0,this.output=[]}},gY=class{constructor(){this.node=void 0,this.path=void 0}},_Y=class{constructor(){this.sampler=void 0,this.target=void 0}},yY=class{constructor(){this.name=void 0,this.samplers=[],this.channels=[]}},AY=class{constructor(){this.name=void 0,this.type=void 0,this.minimumValue=void 0,this.maximumValue=void 0,this.initialValue=void 0}},bY=class{constructor(){this.name=void 0,this.stages=[]}},pj=class{constructor(){this.credits=[]}},xY=class{constructor(){this.asset=new pj,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=L.clone(L.IDENTITY),this.extensions={}}},TY=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}},Ay=class Ay{constructor(){this.baseColorTexture=void 0,this.metallicRoughnessTexture=void 0,this.baseColorFactor=ae.clone(Ay.DEFAULT_BASE_COLOR_FACTOR),this.metallicFactor=Ay.DEFAULT_METALLIC_FACTOR,this.roughnessFactor=Ay.DEFAULT_ROUGHNESS_FACTOR}};at(Ay,"DEFAULT_BASE_COLOR_FACTOR",ae.ONE),at(Ay,"DEFAULT_METALLIC_FACTOR",1),at(Ay,"DEFAULT_ROUGHNESS_FACTOR",1);var gj=Ay,by=class by{constructor(){this.diffuseTexture=void 0,this.specularGlossinessTexture=void 0,this.diffuseFactor=ae.clone(by.DEFAULT_DIFFUSE_FACTOR),this.specularFactor=h.clone(by.DEFAULT_SPECULAR_FACTOR),this.glossinessFactor=by.DEFAULT_GLOSSINESS_FACTOR}};at(by,"DEFAULT_DIFFUSE_FACTOR",ae.ONE),at(by,"DEFAULT_SPECULAR_FACTOR",h.ONE),at(by,"DEFAULT_GLOSSINESS_FACTOR",1);var CY=by,Kv=class Kv{constructor(){this.specularFactor=Kv.DEFAULT_SPECULAR_FACTOR,this.specularTexture=void 0,this.specularColorFactor=h.clone(Kv.DEFAULT_SPECULAR_COLOR_FACTOR),this.specularColorTexture=void 0}};at(Kv,"DEFAULT_SPECULAR_FACTOR",1),at(Kv,"DEFAULT_SPECULAR_COLOR_FACTOR",h.ONE);var vY=Kv,$v=class $v{constructor(){this.anisotropyStrength=$v.DEFAULT_ANISOTROPY_STRENGTH,this.anisotropyRotation=$v.DEFAULT_ANISOTROPY_ROTATION,this.anisotropyTexture=void 0}};at($v,"DEFAULT_ANISOTROPY_STRENGTH",0),at($v,"DEFAULT_ANISOTROPY_ROTATION",0);var EY=$v,Jv=class Jv{constructor(){this.clearcoatFactor=Jv.DEFAULT_CLEARCOAT_FACTOR,this.clearcoatTexture=void 0,this.clearcoatRoughnessFactor=Jv.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,this.clearcoatRoughnessTexture=void 0,this.clearcoatNormalTexture=void 0}};at(Jv,"DEFAULT_CLEARCOAT_FACTOR",0),at(Jv,"DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR",0);var SY=Jv,wY=class{constructor(){at(this,"width");at(this,"pattern")}},_j=class _j{constructor(t={}){let{wireframeFill:n=_j.DEFAULT_WIREFRAME_FILL,backgroundFill:i=!1,behind:r=!1}=t;this.wireframeFill=n,this.backgroundFill=i,this.behind=r}};at(_j,"DEFAULT_WIREFRAME_FILL",0);var IY=_j,yj=class yj{constructor(){this.metallicRoughness=new gj,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(yj.DEFAULT_EMISSIVE_FACTOR),this.alphaMode=xp.OPAQUE,this.alphaCutoff=.5,this.doubleSided=!1,this.unlit=!1,this.pointDiameter=void 0,this.planarFill=void 0,this.lineStyle=void 0}};at(yj,"DEFAULT_EMISSIVE_FACTOR",h.ZERO);var PY=yj,DY=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")}};Tr.Quantization=iY;Tr.Attribute=rY;Tr.Indices=oY;Tr.FeatureIdAttribute=aY;Tr.FeatureIdTexture=cY;Tr.FeatureIdImplicitRange=sY;Tr.MorphTarget=lY;Tr.Primitive=uY;Tr.Instances=fY;Tr.Skin=dY;Tr.Node=hY;Tr.Scene=mY;Tr.AnimatedPropertyType=Object.freeze(G8e);Tr.AnimationSampler=pY;Tr.AnimationTarget=gY;Tr.AnimationChannel=_Y;Tr.Animation=yY;Tr.ArticulationStage=AY;Tr.Articulation=bY;Tr.Asset=pj;Tr.Components=xY;Tr.TextureReader=TY;Tr.MetallicRoughness=gj;Tr.SpecularGlossiness=CY;Tr.Specular=vY;Tr.Anisotropy=EY;Tr.Clearcoat=SY;Tr.PlanarFill=IY;Tr.LineStyle=wY;Tr.Material=PY;Tr.Vector=RY;Tr.Polygon=DY;var xn=Tr;var Aj={};Aj.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};Aj.createSampler=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,textureInfo:n,compressedTextureNoMipmap:i=!1}=e,r=rn.REPEAT,o=rn.REPEAT,a=Gt.LINEAR,s=ei.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),rn.validate(r)||(r=rn.REPEAT),rn.validate(o)||(o=rn.REPEAT),Gt.validate(a)||(a=Gt.LINEAR),ei.validate(s)||(s=ei.LINEAR),new zt({wrapS:r,wrapT:o,minificationFilter:a,magnificationFilter:s})};var W8e=new z(1,1);Aj.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)?z.unpack(a.offset):z.ZERO,f=a.rotation??0,d=l(a.scale)?z.unpack(a.scale):W8e;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 xn.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)?z.unpack(c.offset):z.ZERO,minClampDistance:c.minClampDistance??1,maxClampDistance:c.maxClampDistance??4294967296}),s};var Su=Aj;function q8e(e){let t=document.createElement("canvas");return t.width=D.nextPowerOfTwo(e.width),t.height=D.nextPowerOfTwo(e.height),t.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,t.width,t.height),t}var xy=q8e;var OY=class extends Ji{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=Su.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=yt.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=yt.LOADING,this._promise=X8e(this),this._promise)}process(t){if(this._state===yt.READY)return!0;if(this._state!==yt.LOADED&&this._state!==yt.PROCESSING||l(this._texture)||!l(this._image))return!1;this._state=yt.PROCESSING;let n;if(this._asynchronous){let i=Y8e;if(i.set(this._gltf,this._textureInfo,this._cacheKey,this._image,this._mipLevels,t.context),!t.jobScheduler.execute(i,Ic.TEXTURE))return!1;n=i.texture}else n=nfe(this._gltf,this._textureInfo,this._cacheKey,this._image,this._mipLevels,t.context);return this.unload(),this._texture=n,this._state=yt.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}},MY=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=nfe(this.gltf,this.textureInfo,this.textureId,this.image,this.mipLevels,this.context)}};function nfe(e,t,n,i,r,o){let a=i.internalFormat,s=!1;He.isCompressedFormat(a)&&!l(r)&&(s=!0);let c=Su.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===rn.REPEAT||f===rn.MIRRORED_REPEAT||d===rn.REPEAT||d===rn.MIRRORED_REPEAT,y=!D.isPowerOfTwo(i.width)||!D.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=Ct.create({id:n,context:o,source:{arrayBufferView:i.bufferView,mipLevels:r},width:i.width,height:i.height,pixelFormat:i.internalFormat,sampler:c})):(A&&(i=xy(i)),b=Ct.create({id:n,context:o,source:i,sampler:c,flipY:!1,skipColorSpaceConversion:!0})),g&&b.generateMipmap(),b}var Y8e=new MY;async function X8e(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=yt.LOADED,e)}catch(n){if(e.isDestroyed())return;throw e.unload(),e._state=yt.FAILED,e.getError("Failed to load texture",n)}}var Zv=OY;var LY=class extends Ji{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=yt.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=J8e(this),this._promise):K8e(this._draco,this._attributeSemantic)?(this._promise=tje(this),this._promise):(this._promise=ije(this),this._promise)}process(t){if(this._state===yt.READY)return!0;if(this._state!==yt.LOADED&&this._state!==yt.PROCESSING)return!1;if(l(this._dracoLoader)){try{if(!this._dracoLoader.process(t))return!1}catch(r){bj(this,r)}nje(this)}if(l(this._spzLoader)){try{if(!this._spzLoader.process(t))return!1}catch(r){bj(this,r)}eje(this)}let n,i=this._typedArray;if(this._loadBuffer&&this._asynchronous){let r=rje;if(r.set(i,t.context),!t.jobScheduler.execute(r,Ic.BUFFER))return!1;n=r.buffer}else this._loadBuffer&&(n=ife(i,t.context));return this.unload(),this._buffer=n,this._typedArray=this._loadTypedArray?i:void 0,this._state=yt.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 K8e(e,t){return l(e)&&l(e.attributes)&&l(e.attributes[t])}function $8e(e,t,n,i){let o=(1<<e.quantizationBits)-1,a=1/o,s=new xn.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 J8e(e){e._state=yt.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=yt.LOADED,e)}catch{if(e.isDestroyed())return}}function Z8e(e){return`${e.startsWith("KHR_gaussian_splatting:")?"KHR_gaussian_splatting:":"_"}SH_DEGREE_`}function Q8e(e){let t=Z8e(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 eje(e){e._state=yt.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]=D.clamp(i[o*3]*255,0,255),e._typedArray[o*4+1]=D.clamp(i[o*3+1]*255,0,255),e._typedArray[o*4+2]=D.clamp(i[o*3+2]*255,0,255),e._typedArray[o*4+3]=D.clamp(r[o]*255,0,255)}else if(e._attributeSemantic.includes("SH_DEGREE_")){let{l:i,n:r}=Q8e(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 tje(e){e._state=yt.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=yt.LOADED,e)}catch{if(e.isDestroyed())return;bj(e)}}function nje(e){e._state=yt.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=$8e(u,r.data.componentDatatype,r.data.componentsPerAttribute,s)),e._typedArray=new Uint8Array(c.buffer,c.byteOffset,c.byteLength)}async function ije(e){e._state=yt.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=yt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;bj(e,n)}}function bj(e,t){throw e.unload(),e._state=yt.FAILED,e.getError("Failed to load vertex buffer",t)}var NY=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=ife(this.typedArray,this.context)}};function ife(e,t){let n=Ze.createVertexBuffer({typedArray:e,context:t,usage:Oe.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}var rje=new NY,Qv=LY;var rfe={};async function oje(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(()=>uje);var u=fe(rfe.url)}var f="./this.program",d=rfe.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,P,R,O,N,_,v=!1;function S(){var fe=D0.buffer;x=new Int8Array(fe),C=new Int16Array(fe),o.HEAPU8=T=new Uint8Array(fe),E=new Uint16Array(fe),w=new Int32Array(fe),P=new Uint32Array(fe),o.HEAPF32=R=new Float32Array(fe),O=new Float64Array(fe),N=new BigInt64Array(fe),_=new BigUint64Array(fe)}function I(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 M;async function F(fe){return fe}async function V(fe){var ne=M;try{var xe=await F(ne);return await WebAssembly.instantiate(xe,fe)}catch(Se){g(`failed to asynchronously prepare wasm: ${Se}`),I(Se)}}async function k(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(P[fe>>2])}var Z={},ce={},Ae={},le=class extends Error{constructor(fe){super(fe),this.name="InternalError"}},Ce=(fe,ne,xe)=>{function Se(Et){if(Et=xe(Et),Et.length!==fe.length)throw new le("Mismatched type converter count");for(var An=0;An<fe.length;++An)$e(fe[An],Et[An])}fe.forEach(Et=>Ae[Et]=ne);var qe=Array(ne.length),Tt=[],ut=0;for(let[Et,An]of ne.entries())ce.hasOwnProperty(An)?qe[Et]=ce[An]:(Tt.push(An),Z.hasOwnProperty(An)||(Z[An]=[]),Z[An].push(()=>{qe[Et]=ce[An],++ut,ut===Tt.length&&Se(qe)}));Tt.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 Xe=(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=>P[Se>>2];case 8:return xe?Se=>N[Se>>3]:Se=>_[Se>>3];default:throw new TypeError(`invalid integer width (${ne}): ${fe}`)}},At=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 vt(){}var ct=(fe,ne)=>Object.defineProperty(ne,"name",{value:fe}),pn={},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 Pn(fe,ne,xe,Se,qe,Tt,ut,Et){this.name=fe,this.constructor=ne,this.ba=xe,this.Z=Se,this.W=qe,this.va=Tt,this.fa=ut,this.ta=Et,this.Ca=[]}var ot=(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 Si(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 ot(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=ot(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,wr(()=>Se.delete())),fe!==null&&fe.push(this.Z,xe)}break;default:throw new ve("Unsupported sharing policy")}}return xe}function Ni(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 ot(ne.M.P,ne.M.R.N,this.N)}var dr=(fe,ne,xe)=>ne===xe?fe:xe.W===void 0?null:(fe=dr(fe,ne,xe.W),fe===null?null:xe.ta(fe)),Fi={},Yi=(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 Fi[ne]},ai=(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 ni(fe,ne,xe,Se,qe,Tt,ut,Et,An,Wn,un){this.name=fe,this.N=ne,this.ia=xe,this.ga=Se,this.ha=qe,this.Ba=Tt,this.Ha=ut,this.pa=Et,this.ka=An,this.Da=Wn,this.Z=un,qe||ne.W!==void 0?this.S=wn:(this.S=Se?Si:Ni,this.T=null)}var En=(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)},ii=(fe,ne)=>{fe=ye(fe);var xe=R0.get(ne);if(typeof xe!="function")throw new ve(`unknown function pointer with signature ${fe}: ${ne}`);return xe};class Sr extends Error{}var Ea=fe=>{fe=oP(fe);var ne=ye(fe);return ud(fe),ne},Va=(fe,ne)=>{function xe(Tt){qe[Tt]||ce[Tt]||(Ae[Tt]?Ae[Tt].forEach(xe):(Se.push(Tt),qe[Tt]=!0))}var Se=[],qe={};throw ne.forEach(xe),new Sr(`${fe}: `+Se.map(Ea).join([", "]))},rs=(fe,ne)=>{for(var xe=[],Se=0;Se<fe;Se++)xe.push(P[ne+4*Se>>2]);return xe};function os(fe){for(var ne=1;ne<fe.length;++ne)if(fe[ne]!==null&&fe[ne].T===void 0)return!0;return!1}function oo(fe,ne,xe,Se,qe,Tt){var ut=ne.length;if(2>ut)throw new ve("argTypes array size mismatch! Must at least get return value and 'this' types!");var Et=ne[1]!==null&&xe!==null,An=os(ne);xe=!ne[0].oa;var Wn=ne[0],un=ne[1];for(Se=[fe,Ie,Se,qe,q,Wn.O.bind(Wn),un?.S.bind(un)],qe=2;qe<ut;++qe)Wn=ne[qe],Se.push(Wn.S.bind(Wn));if(!An)for(qe=Et?1:2;qe<ne.length;++qe)ne[qe].T!==null&&Se.push(ne[qe].T);for(An=os(ne),qe=ne.length-2,un=[],Wn=["fn"],Et&&Wn.push("thisWired"),ut=0;ut<qe;++ut)un.push(`arg${ut}`),Wn.push(`arg${ut}Wired`);un=un.join(","),Wn=Wn.join(","),un=`return function (${un}) {
`,An&&(un+=`var destructors = [];
`);var $r=An?"destructors":"null",ft="humanName throwBindingError invoker fn runDestructors fromRetWire toClassParamWire".split(" ");for(Et&&(un+=`var thisWired = toClassParamWire(${$r}, this);
`),ut=0;ut<qe;++ut){var ge=`toArg${ut}Wire`;un+=`var arg${ut}Wired = ${ge}(${$r}, arg${ut});
`,ft.push(ge)}if(un+=(xe||Tt?"var rv = ":"")+`invoker(${Wn});
`,An)un+=`runDestructors(destructors);
`;else for(ut=Et?1:2;ut<ne.length;++ut)Tt=ut===1?"thisWired":"arg"+(ut-2)+"Wired",ne[ut].T!==null&&(un+=`${Tt}_dtor(${Tt});
`,ft.push(`${Tt}_dtor`));return xe&&(un+=`var ret = fromRetWire(rv);
return ret;
`),ne=new Function(ft,un+`}
`)(...Se),ct(fe,ne)}var gi=fe=>{fe=fe.trim();let ne=fe.indexOf("(");return ne===-1?fe:fe.slice(0,ne)},ao=[],Ri=[0,1,,1,null,1,!0,1,!1,1],Ho=fe=>{9<fe&&--Ri[fe+1]===0&&(Ri[fe]=void 0,ao.push(fe))},Oi=fe=>{if(!fe)throw new ve(`Cannot use deleted val. handle = ${fe}`);return Ri[fe]},wr=fe=>{switch(fe){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:let ne=ao.pop()||Ri.length;return Ri[ne]=fe,Ri[ne+1]=1,ne}},Sa={name:"emscripten::val",O:fe=>{var ne=Oi(fe);return Ho(fe),ne},S:(fe,ne)=>wr(ne),X:J,T:null},Do=(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(P[Se>>2])};default:throw new TypeError(`invalid integer width (${ne}): ${fe}`)}},sd=(fe,ne)=>{var xe=ce[fe];if(xe===void 0)throw fe=`${ne} has unknown type ${Ea(fe)}`,new ve(fe);return xe},cd=(fe,ne)=>{switch(ne){case 4:return function(xe){return this.O(R[xe>>2])};case 8:return function(xe){return this.O(O[xe>>3])};default:throw new TypeError(`invalid float width (${ne}): ${fe}`)}},bc=(fe,ne,xe)=>{let Se=(qe,Tt)=>{let ut=0;return{next(){if(ut>=qe)return{done:!0};let Et=ut;return ut++,{value:Tt(Et),done:!1}},[Symbol.iterator](){return this}}};fe[Symbol.iterator]||(fe[Symbol.iterator]=function(){let qe=this[ne]();return Se(qe,Tt=>this[xe](Tt))})},J_=Object.assign({optional:!0},Sa),Ro=(fe,ne,xe)=>{var Se=T;if(!(0<xe))return 0;var qe=ne;xe=ne+xe-1;for(var Tt=0;Tt<fe.length;++Tt){var ut=fe.codePointAt(Tt);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,Tt++}}return Se[ne]=0,ne-qe},ws=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},Z_=new TextDecoder,si=(fe,ne,xe,Se)=>{if(xe=ne+xe,Se)return xe;for(;fe[ne]&&!(ne>=xe);)++ne;return ne},Xs=new TextDecoder("utf-16le"),Ks=(fe,ne,xe)=>(fe>>=1,Xs.decode(E.subarray(fe,si(E,fe,ne/2,xe)))),as=(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},wa=fe=>2*fe.length,ld=(fe,ne,xe)=>{var Se="";fe>>=2;for(var qe=0;!(qe>=ne/4);qe++){var Tt=P[fe+qe];if(!Tt&&!xe)break;Se+=String.fromCodePoint(Tt)}return Se},_b=(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 Tt=fe.codePointAt(qe);if(65535<Tt&&qe++,w[ne>>2]=Tt,ne+=4,ne+4>xe)break}return w[ne>>2]=0,ne-Se},F7=fe=>{for(var ne=0,xe=0;xe<fe.length;++xe)65535<fe.codePointAt(xe)&&xe++,ne+=4;return ne},nP=[],B7=fe=>{var ne=nP.length;return nP.push(fe),ne},k7=(fe,ne)=>{for(var xe=Array(fe),Se=0;Se<fe;++Se)xe[Se]=sd(P[ne+4*Se>>2],`parameter ${Se}`);return xe},sp=(fe,ne,xe)=>{var Se=[];return fe=fe(Se,xe),Se.length&&(P[ne>>2]=wr(Se)),fe},fv={},P0=fe=>{var ne=fv[fe];return ne===void 0?ye(fe):ne},iP={},Q_=()=>{var fe;if(!rP){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 iP)iP[xe]===void 0?delete ne[xe]:ne[xe]=iP[xe];var Se=[];for(xe in ne)Se.push(`${xe}=${ne[xe]}`);rP=Se}return rP},rP,s8=[null,[],[]];if((()=>{let fe=vt.prototype;Object.assign(fe,{isAliasOf:function(xe){if(!(this instanceof vt&&xe instanceof vt))return!1;var Se=this.M.R.N,qe=this.M.P;xe.M=xe.M;var Tt=xe.M.R.N;for(xe=xe.M.P;Se.W;)qe=Se.fa(qe),Se=Se.W;for(;Tt.W;)xe=Tt.fa(xe),Tt=Tt.W;return Se===Tt&&qe===xe},clone:function(){if(this.M.P||At(this),this.M.ea)return this.M.count.value+=1,this;var xe=We,Se=Object,qe=Se.create,Tt=Object.getPrototypeOf(this),ut=this.M;return xe=xe(qe.call(Se,Tt,{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||At(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||At(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(ni.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?ai(this.N.ba,{R:this.Ba,P:xe,Y:this,V:fe}):ai(this.N.ba,{R:this,P:fe})}var xe=this.wa(fe);if(!xe)return this.ma(fe),null;var Se=Yi(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=pn[Se],!Se)return ne.call(this);Se=this.ga?Se.sa:Se.pointerType;var qe=dr(xe,this.N,Se.N);return qe===null?ne.call(this):this.ha?ai(Se.N.ba,{R:Se,P:qe,Y:this,V:fe}):ai(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 oP,ey,ud,D0,R0,yb={y:()=>I(""),r:fe=>{var ne=Q[fe];delete Q[fe];var xe=ne.ka,Se=ne.Z,qe=ne.na,Tt=qe.map(ut=>ut.za).concat(qe.map(ut=>ut.Fa));Ce([fe],Tt,ut=>{var Et={},An,Wn;for([An,Wn]of qe.entries()){let un=ut[An],$r=Wn.xa,ft=Wn.ya,ge=ut[An+qe.length],Ne=Wn.Ea,lt=Wn.Ga;Et[Wn.ua]={read:nn=>un.O($r(ft,nn)),write:(nn,Sn)=>{var Mn=[];Ne(lt,nn,ge.S(Mn,Sn)),q(Mn)},optional:un.optional}}return[{name:ne.name,O:un=>{var $r={},ft;for(ft in Et)$r[ft]=Et[ft].read(un);return Se(un),$r},S:(un,$r)=>{for(var ft in Et)if(!(ft in $r||Et[ft].optional))throw new TypeError(`Missing field: "${ft}"`);var ge=xe();for(ft in Et)Et[ft].write(ge,$r[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 Tt=ut=>ut;if(Se){let ut=8*xe;Tt=Et=>BigInt.asUintN(ut,Et),qe=Tt(qe)}$e(fe,{name:ne,O:Tt,S:(ut,Et)=>(typeof Et=="number"&&(Et=BigInt(Et)),Et),X:Xe(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,Tt){return Tt?xe:Se},X:function(qe){return this.O(T[qe])},T:null})},k:(fe,ne,xe,Se,qe,Tt,ut,Et,An,Wn,un,$r,ft)=>{un=ye(un),Tt=ii(qe,Tt),Et&&(Et=ii(ut,Et)),Wn&&(Wn=ii(An,Wn)),ft=ii($r,ft);var ge=Dt(un);bt(ge,function(){Va(`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=vt.prototype;Ne=ct(un,function(...so){if(Object.getPrototypeOf(this)!==Sn)throw new ve(`Use 'new' to construct ${un}`);if(Mn.aa===void 0)throw new ve(`${un} has no accessible constructor`);var xc=Mn.aa[so.length];if(xc===void 0)throw new ve(`Tried to invoke ctor of ${un} with invalid number of parameters (${so.length}) - expected (${Object.keys(Mn.aa).toString()}) parameters instead!`);return xc.apply(this,so)});var Sn=Object.create(nn,{constructor:{value:Ne}});Ne.prototype=Sn;var Mn=new Pn(un,Ne,Sn,ft,lt,Tt,Et,Wn);if(Mn.W){var hr;(hr=Mn.W).la??(hr.la=[]),Mn.W.la.push(Mn)}return lt=new ni(un,Mn,!0,!1,!1),hr=new ni(un+"*",Mn,!1,!1,!1),nn=new ni(un+" const*",Mn,!1,!0,!1),pn[fe]={pointerType:hr,sa:nn},En(ge,Ne),[lt,hr,nn]})},g:(fe,ne,xe,Se,qe,Tt)=>{var ut=rs(ne,xe);qe=ii(Se,qe),Ce([],[fe],Et=>{Et=Et[0];var An=`constructor ${Et.name}`;if(Et.N.aa===void 0&&(Et.N.aa=[]),Et.N.aa[ne-1]!==void 0)throw new ve(`Cannot register multiple constructors with identical number of parameters (${ne-1}) for class '${Et.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return Et.N.aa[ne-1]=()=>{Va(`Cannot construct ${Et.name} due to unbound types`,ut)},Ce([],ut,Wn=>(Wn.splice(1,0,null),Et.N.aa[ne-1]=oo(An,Wn,null,qe,Tt),[])),[]})},b:(fe,ne,xe,Se,qe,Tt,ut,Et,An)=>{var Wn=rs(xe,Se);ne=ye(ne),ne=gi(ne),Tt=ii(qe,Tt),Ce([],[fe],un=>{function $r(){Va(`Cannot call ${ft} due to unbound types`,Wn)}un=un[0];var ft=`${un.name}.${ne}`;ne.startsWith("@@")&&(ne=Symbol[ne.substring(2)]),Et&&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?($r.$=xe-2,$r.className=un.name,ge[ne]=$r):(Ht(ge,ne,ft),ge[ne].U[xe-2]=$r),Ce([],Wn,lt=>(lt=oo(ft,lt,un,Tt,ut,An),ge[ne].U===void 0?(lt.$=xe-2,ge[ne]=lt):ge[ne].U[xe-2]=lt,[])),[]})},A:fe=>$e(fe,Sa),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(Et){return this.constructor.values[Et]},S:(Et,An)=>An.value,X:Do(ne,xe,Se),T:null}),bt(ne,ut);break;case"number":var Tt={};$e(fe,{name:ne,ja:Tt,valueType:qe,O:Et=>Et,S:(Et,An)=>An,X:Do(ne,xe,Se),T:null}),bt(ne,Tt),delete o[ne].$;break;case"string":Tt={},$e(fe,{name:ne,ra:{},qa:{},ja:Tt,valueType:qe,O:function(Et){return this.qa[Et]},S:function(Et,An){return this.ra[An]},X:Do(ne,xe,Se),T:null}),bt(ne,Tt),delete o[ne].$}},d:(fe,ne,xe)=>{var Se=sd(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:cd(ne,xe),T:null})},m:(fe,ne,xe,Se,qe,Tt,ut)=>{var Et=rs(ne,xe);fe=ye(fe),fe=gi(fe),qe=ii(Se,qe),bt(fe,function(){Va(`Cannot call ${fe} due to unbound types`,Et)},ne-1),Ce([],Et,An=>(An=[An[0],null].concat(An.slice(1)),En(fe,oo(fe,An,null,qe,Tt,ut),ne-1),[]))},c:(fe,ne,xe,Se,qe)=>{ne=ye(ne);let Tt=Et=>Et;if(Se===0){var ut=32-8*xe;Tt=Et=>Et<<ut>>>ut,qe=Tt(qe)}$e(fe,{name:ne,O:Tt,S:(Et,An)=>An,X:Xe(ne,xe,Se!==0),T:null})},j:(fe,ne,xe,Se)=>{xe=ye(xe),Se=ye(Se),Ce([],[fe,ne],qe=>(bc(qe[0].N.ba,xe,Se),[]))},a:(fe,ne,xe)=>{function Se(Tt){return new qe(x.buffer,P[Tt+4>>2],P[Tt>>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,J_)},B:(fe,ne)=>{ne=ye(ne),$e(fe,{name:ne,O(xe){var Se=(Se=xe+4)?Z_.decode(T.subarray(Se,si(T,Se,P[xe>>2],!0))):"";return ud(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 Tt=qe?ws(Se):Se.length,ut=ey(4+Tt+1),Et=ut+4;return P[ut>>2]=Tt,qe?Ro(Se,Et,Tt+1):T.set(Se,Et),xe!==null&&xe.push(ud,ut),ut},X:J,T(xe){ud(xe)}})},f:(fe,ne,xe)=>{if(xe=ye(xe),ne===2)var Se=Ks,qe=as,Tt=wa;else Se=ld,qe=_b,Tt=F7;$e(fe,{name:xe,O:ut=>{var Et=Se(ut+4,P[ut>>2]*ne,!0);return ud(ut),Et},S:(ut,Et)=>{if(typeof Et!="string")throw new ve(`Cannot pass non-string to C++ string type ${xe}`);var An=Tt(Et),Wn=ey(4+An+ne);return P[Wn>>2]=An/ne,qe(Et,Wn+4,An+ne),ut!==null&&ut.push(ud,Wn),Wn},X:J,T(ut){ud(ut)}})},i:(fe,ne,xe,Se,qe,Tt)=>{Q[fe]={name:ye(ne),ka:ii(xe,Se),Z:ii(qe,Tt),na:[]}},e:(fe,ne,xe,Se,qe,Tt,ut,Et,An,Wn)=>{Q[fe].na.push({ua:ye(ne),za:xe,xa:ii(Se,qe),ya:Tt,Fa:ut,Ea:ii(Et,An),Ga:Wn})},D:(fe,ne)=>{ne=ye(ne),$e(fe,{oa:!0,name:ne,O:()=>{},S:()=>{}})},q:(fe,ne,xe)=>{var[Se,...qe]=k7(fe,ne);ne=Se.S.bind(Se);var Tt=qe.map(An=>An.X.bind(An));fe--;var ut={toValue:Oi};switch(fe=Tt.map((An,Wn)=>{var un=`argFromPtr${Wn}`;return ut[un]=An,`${un}(args${Wn?"+"+8*Wn:""})`}),xe){case 0:var Et="toValue(handle)";break;case 2:Et="new (toValue(handle))";break;case 3:Et="";break;case 1:ut.getStringOrSymbol=P0,Et="toValue(handle)[getStringOrSymbol(methodName)]"}return Et+=`(${fe})`,Se.oa||(ut.toReturnWire=ne,ut.emval_returnValue=sp,Et=`return emval_returnValue(toReturnWire, destructorsRef, ${Et})`),Et=`return function (handle, methodName, destructorsRef, args) {
${Et}
}`,xe=new Function(Object.keys(ut),Et)(...Object.values(ut)),Et=`methodCaller<(${qe.map(An=>An.name)}) => ${Se.name}>`,B7(ct(Et,xe))},F:Ho,p:(fe,ne,xe,Se,qe)=>nP[fe](ne,xe,Se,qe),E:fe=>{var ne=Oi(fe);q(ne),Ho(fe)},t:(fe,ne,xe,Se)=>{var qe=new Date().getFullYear(),Tt=new Date(qe,0,1).getTimezoneOffset();qe=new Date(qe,6,1).getTimezoneOffset(),P[fe>>2]=60*Math.max(Tt,qe),w[ne>>2]=+(Tt!=qe),ne=ut=>{var Et=Math.abs(ut);return`UTC${0<=ut?"-":"+"}${String(Math.floor(Et/60)).padStart(2,"0")}${String(Et%60).padStart(2,"0")}`},fe=ne(Tt),ne=ne(qe),qe<Tt?(Ro(fe,xe,17),Ro(ne,Se,17)):(Ro(fe,Se,17),Ro(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))-D0.buffer.byteLength+65535)/65536|0;try{D0.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 Q_()){var Tt=ne+xe;P[fe+Se>>2]=Tt,xe+=Ro(qe,Tt,1/0)+1,Se+=4}return 0},v:(fe,ne)=>{var xe=Q_();P[fe>>2]=xe.length,fe=0;for(var Se of xe)fe+=ws(Se)+1;return P[ne>>2]=fe,0},w:()=>52,x:function(){return 70},l:(fe,ne,xe,Se)=>{for(var qe=0,Tt=0;Tt<xe;Tt++){var ut=P[ne>>2],Et=P[ne+4>>2];ne+=8;for(var An=0;An<Et;An++){var Wn=fe,un=T[ut+An],$r=s8[Wn];un===0||un===10?(Wn=Wn===1?p:g,un=si($r,0),un=Z_.decode($r.buffer?$r.subarray(0,un):new Uint8Array($r.slice(0,un))),Wn(un),$r.length=0):$r.push(un)}qe+=Et}return P[Se>>2]=qe,0}},Cl;return Cl=await(async function(){function fe(xe){return xe=Cl=xe.exports,oP=xe.J,ey=o._malloc=xe.K,ud=o._free=xe.L,D0=xe.G,R0=xe.I,S(),Cl}var ne={a:yb};return o.instantiateWasm?new Promise(xe=>{o.instantiateWasm(ne,(Se,qe)=>{xe(fe(Se))})}):(M??(M=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 k(ne)).instance))})(),(function(){function fe(){var ne;if(o.calledRun=!0,!m){if(v=!0,Cl.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 eE=(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},aje=e=>1/(1+Math.exp(-e)),sje=e=>t=>t*e+.5,cje=(e,t,n)=>{let i=n?.colorScaleFactor??.282;return{numPoints:t.numPoints,shDegree:t.shDegree,antialiased:t.antialiased,positions:eE(e,t.positions),scales:eE(e,t.scales,Math.exp),rotations:eE(e,t.rotations),alphas:eE(e,t.alphas,aje),colors:eE(e,t.colors,sje(i)),sh:eE(e,t.sh)}},lje=(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))},ofe=async(e,t)=>{var n;let i=await oje(),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=cje(i,s,t);return lje(i,s),c}catch(a){throw a}finally{o!==null&&i._free(o)}};var uje=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var fje=[0,9,24,45],dje=14,hje=1.6*1024*1024*1024;function mje(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 pje(e,t){let n=dje+(fje[t]??0);return e*n*Float32Array.BYTES_PER_ELEMENT*2}var FY=class extends Ji{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=yt.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=yt.LOADING,this._promise=gje(this),this._promise)}process(t){if(this._state===yt.READY)return!0;if(this._state!==yt.PROCESSING||(l(this._spzError)&&BY(this,this._spzError),!l(this._bufferViewTypedArray))||l(this._decodePromise))return!1;let n=mje(this._gltf,this._primitive);if(l(n)){let r=pje(n.numPoints,n.shDegree);if(r>hje){let o=Math.round(r/1048576);return BY(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=ofe(this._bufferViewTypedArray,{unpackOptions:{coordinateSystem:"UNSPECIFIED"}});if(!l(i))return!1;this._decodePromise=_je(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 gje(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=yt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;BY(e,n)}}function BY(e,t){throw e.unload(),e._state=yt.FAILED,e.getError("Failed to load SPZ",t)}async function _je(e,t){try{let n=await t;return e.isDestroyed()?void 0:(e.unload(),e._decodedData={gcloud:n},e._state=yt.READY,e._baseResource)}catch(n){if(e.isDestroyed())return;e._spzError=n}}var fD=FY;function dD(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=Ye(e.extras,!0),this._extensions=Ye(e.extensions,!0)}dD.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=yp.fromJson({id:r,property:n.properties[r],enums:e.enums});i[r]=o}return new dD({id:t,name:n.name,description:n.description,properties:i,extras:n.extras,extensions:n.extensions})};Object.defineProperties(dD.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}}});dD.BATCH_TABLE_CLASS_NAME="_batchTable";var Fh=dD;function xj(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=Ye(e.extras,!0),this._extensions=Ye(e.extensions,!0)}xj.fromJson=function(e){return new xj({value:e.value,name:e.name,description:e.description,extras:e.extras,extensions:e.extensions})};Object.defineProperties(xj.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 hD=xj;function Tj(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=Ye(e.extras,!0),this._extensions=Ye(e.extensions,!0)}Tj.fromJson=function(e){e=e??H.EMPTY_OBJECT;let t=e.id,n=e.enum,i=n.values.map(function(r){return hD.fromJson(r)});return new Tj({id:t,values:i,valueType:Mt[n.valueType],name:n.name,description:n.description,extras:n.extras,extensions:n.extensions})};Object.defineProperties(Tj.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 mD=Tj;function Cj(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=Ye(e.extras,!0),this._extensions=Ye(e.extensions,!0)}Cj.fromJson=function(e){let t={};if(l(e.enums))for(let i in e.enums)e.enums.hasOwnProperty(i)&&(t[i]=mD.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]=Fh.fromJson({id:i,class:e.classes[i],enums:t}));return new Cj({id:e.id,name:e.name,description:e.description,version:e.version,classes:n,enums:t,extras:e.extras,extensions:e.extensions})};Object.defineProperties(Cj.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 Pl=Cj;var kY=class extends Ji{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.schema,i=t.resource,r=t.cacheKey;this._schema=l(n)?Pl.fromJson(n):void 0,this._resource=i,this._cacheKey=r,this._state=yt.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=yje(this),this._promise)}unload(){this._schema=void 0}};async function yje(e){let t=e._resource;e._state=yt.LOADING;try{let n=await t.fetchJson();return e.isDestroyed()?void 0:(e._schema=Pl.fromJson(n),e._state=yt.READY,e)}catch(n){if(e.isDestroyed())return;e._state=yt.FAILED;let i=`Failed to load schema: ${t.url}`;throw e.getError(i,n)}}var Ty=kY;var Td={};function tE(e){return dd(e.url)}function pD(e){let{byteOffset:t,byteLength:n}=e,i=_y(e);return l(i)&&(t=i.byteOffset??0,n=i.byteLength),`${t}-${t+n}`}function Aje(e,t){let n=t.byteOffset+e.byteOffset,{componentType:i,type:r,count:o}=e;return`${n}-${i}-${r}-${o}`}function afe(e,t){return`${tE(e)}-buffer-id-${t}`}function nE(e,t,n,i){if(l(e.uri)){let r=i.getDerivedResource({url:e.uri});return tE(r)}return afe(n,t)}function zY(e,t,n,i){let r=t.bufferView,o=e.bufferViews[r],a=o.buffer,s=e.buffers[a],c=nE(s,a,n,i),u=pD(o);return`${c}-range-${u}`}function sfe(e,t,n,i){let r=t.bufferView,o=e.bufferViews[r],a=o.buffer,s=e.buffers[a],c=nE(s,a,n,i),u=pD(o);return`${c}-range-${u}`}function cfe(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 tE(p)}let s=e.bufferViews[o],c=s.buffer,u=e.buffers[c],f=nE(u,c,n,i),d=pD(s);return`${f}-range-${d}`}function bje(e,t){let n=Su.createSampler({gltf:e,textureInfo:t});return`${n.wrapS}-${n.wrapT}-${n.minificationFilter}-${n.magnificationFilter}`}Td.getSchemaCacheKey=function(e){let{schema:t,resource:n}=e;return l(t)?`embedded-schema:${JSON.stringify(t)}`:`external-schema:${tE(n)}`};Td.getExternalBufferCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{resource:t}=e;return`external-buffer:${tE(t)}`};Td.getEmbeddedBufferCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{parentResource:t,bufferId:n}=e;return`embedded-buffer:${afe(t,n)}`};Td.getGltfCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltfResource:t}=e;return`gltf:${tE(t)}`};Td.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=_y(o);l(c)&&(a=c.buffer);let u=nE(s,a,i,r),f=pD(o);return`buffer-view:${u}-range-${f}`};Td.getDracoCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,draco:n,gltfResource:i,baseResource:r}=e;return`draco:${zY(t,n,i,r)}`};Td.getSpzCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,spz:n,gltfResource:i,baseResource:r}=e;return`spz:${sfe(t,n,i,r)}`};Td.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:${sfe(t,s,n,i)}-spz-${c}${p}`;if(l(a))return`vertex-buffer:${zY(t,a,n,i)}-draco-${c}${p}`;let g=t.bufferViews[o],m=g.buffer,y=t.buffers[m],A=nE(y,m,n,i),b=pD(g);return`vertex-buffer:${A}-range-${b}${p}`};Td.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:${zY(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=nE(m,g,i,r),A=Aje(f,p);return`index-buffer:${y}-accessor-${A}${u}`};Td.getImageCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,imageId:n,gltfResource:i,baseResource:r}=e;return`image:${cfe(t,n,i,r)}`};Td.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=Su.getImageIdFromTexture({gltf:t,textureId:s,supportedImageFormats:o}),u=cfe(t,c,i,r),f=bje(t,n);return`texture:${u}-sampler-${f}-context-${a.context.id}`};var Dl=Td;function gD(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}}gD.prototype.clear=function(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}};gD.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};gD.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};gD.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 _D=gD;function Fn(){}Fn.cacheEntries={};Fn.statistics=new _D;function xje(e){this.referenceCount=1,this.resourceLoader=e,this._statisticsPromise=void 0}Fn.get=function(e){let t=Fn.cacheEntries[e];if(l(t))return++t.referenceCount,t.resourceLoader};Fn.add=function(e){let t=e.cacheKey;return Fn.cacheEntries[t]=new xje(e),e};Fn.unload=function(e){let t=e.cacheKey,n=Fn.cacheEntries[t];--n.referenceCount,n.referenceCount===0&&(Fn.statistics.removeLoader(e),e.destroy(),delete Fn.cacheEntries[t])};Fn.getSchemaLoader=function(e){e=e??H.EMPTY_OBJECT;let{schema:t,resource:n}=e,i=Dl.getSchemaCacheKey({schema:t,resource:n}),r=Fn.get(i);return l(r)?r:(r=new Ty({schema:t,resource:n,cacheKey:i}),Fn.add(r))};Fn.getEmbeddedBufferLoader=function(e){e=e??H.EMPTY_OBJECT;let{parentResource:t,bufferId:n,typedArray:i}=e,r=Dl.getEmbeddedBufferCacheKey({parentResource:t,bufferId:n}),o=Fn.get(r);return l(o)?o:(o=new Mb({typedArray:i,cacheKey:r}),Fn.add(o))};Fn.getExternalBufferLoader=function(e){e=e??H.EMPTY_OBJECT;let{resource:t}=e,n=Dl.getExternalBufferCacheKey({resource:t}),i=Fn.get(n);return l(i)?i:(i=new Mb({resource:t,cacheKey:n}),Fn.add(i))};Fn.getGltfJsonLoader=function(e){e=e??H.EMPTY_OBJECT;let{gltfResource:t,baseResource:n,typedArray:i,gltfJson:r}=e,o=Dl.getGltfCacheKey({gltfResource:t}),a=Fn.get(o);return l(a)?a:(a=new Xv({resourceCache:Fn,gltfResource:t,baseResource:n,typedArray:i,gltfJson:r,cacheKey:o}),Fn.add(a))};Fn.getBufferViewLoader=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,bufferViewId:n,gltfResource:i,baseResource:r}=e,o=Dl.getBufferViewCacheKey({gltf:t,bufferViewId:n,gltfResource:i,baseResource:r}),a=Fn.get(o);return l(a)?a:(a=new jv({resourceCache:Fn,gltf:t,bufferViewId:n,gltfResource:i,baseResource:r,cacheKey:o}),Fn.add(a))};Fn.getDracoLoader=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,primitive:n,draco:i,gltfResource:r,baseResource:o}=e,a=Dl.getDracoCacheKey({gltf:t,draco:i,gltfResource:r,baseResource:o}),s=Fn.get(a);return l(s)?s:(s=new Hv({resourceCache:Fn,gltf:t,primitive:n,draco:i,gltfResource:r,baseResource:o,cacheKey:a}),Fn.add(s))};Fn.getSpzLoader=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,primitive:n,spz:i,gltfResource:r,baseResource:o}=e,a=Dl.getSpzCacheKey({gltf:t,spz:i,gltfResource:r,baseResource:o}),s=Fn.get(a);return l(s)?s:(s=new fD({resourceCache:Fn,gltf:t,primitive:n,spz:i,gltfResource:r,baseResource:o,cacheKey:a}),Fn.add(s))};Fn.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=Dl.getVertexBufferCacheKey({gltf:t,gltfResource:n,baseResource:i,frameState:r,bufferViewId:o,draco:s,spz:c,attributeSemantic:u,dequantize:p,loadBuffer:g,loadTypedArray:m}),A=Fn.get(y);return l(A)?A:(A=new Qv({resourceCache:Fn,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}),Fn.add(A))};Fn.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=Dl.getIndexBufferCacheKey({gltf:t,accessorId:n,gltfResource:i,baseResource:r,frameState:o,draco:s,loadBuffer:u,loadTypedArray:f}),p=Fn.get(d);return l(p)?p:(p=new qv({resourceCache:Fn,gltf:t,accessorId:n,gltfResource:i,baseResource:r,primitive:a,draco:s,cacheKey:d,asynchronous:c,loadBuffer:u,loadTypedArray:f}),Fn.add(p))};Fn.getImageLoader=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,imageId:n,gltfResource:i,baseResource:r}=e,o=Dl.getImageCacheKey({gltf:t,imageId:n,gltfResource:i,baseResource:r}),a=Fn.get(o);return l(a)?a:(a=new Wv({resourceCache:Fn,gltf:t,imageId:n,gltfResource:i,baseResource:r,cacheKey:o}),Fn.add(a))};Fn.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=Dl.getTextureCacheKey({gltf:t,textureInfo:n,gltfResource:i,baseResource:r,supportedImageFormats:o,frameState:a}),u=Fn.get(c);return l(u)?u:(u=new Zv({resourceCache:Fn,gltf:t,textureInfo:n,gltfResource:i,baseResource:r,supportedImageFormats:o,cacheKey:c,asynchronous:s}),Fn.add(u))};Fn.clearForSpecs=function(){let e=[Qv,qv,Hv,Zv,Wv,jv,Mb,Ty,Xv],t,n=Fn.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])}Fn.statistics.clear()};var Mi=Fn;function rc(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(rc.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}}});rc.prototype.tileIsAvailableAtIndex=function(e){return this._tileAvailability.getBit(e)};rc.prototype.tileIsAvailableAtCoordinates=function(e){let t=this.getTileIndex(e);return this.tileIsAvailableAtIndex(t)};rc.prototype.contentIsAvailableAtIndex=function(e,t){return t=t??0,this._contentAvailabilityBitstreams[t].getBit(e)};rc.prototype.contentIsAvailableAtCoordinates=function(e,t){let n=this.getTileIndex(e);return this.contentIsAvailableAtIndex(n,t)};rc.prototype.childSubtreeIsAvailableAtIndex=function(e){return this._childSubtreeAvailability.getBit(e)};rc.prototype.childSubtreeIsAvailableAtCoordinates=function(e){let t=this.getChildSubtreeIndex(e);return this.childSubtreeIsAvailableAtIndex(t)};rc.prototype.getLevelOffset=function(e){let t=this._branchingFactor;return(Math.pow(t,e)-1)/(t-1)};rc.prototype.getParentMortonIndex=function(e){let t=2;return this._subdivisionScheme===Ra.OCTREE&&(t=3),e>>t};rc.fromSubtreeJson=async function(e,t,n,i,r){let o=new rc(e,i,r),a;l(t)?a={json:t,binary:void 0}:a=Tje(n);let s=a.json;o._subtreeJson=s;let c;if($i(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 HP({subtreeMetadata:p,class:T})}o._metadata=f,o._tilePropertyTableJson=c,o._contentPropertyTableJsons=u;let g={constant:0};s.contentAvailabilityHeaders=[],$i(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=Cje(s.buffers),y=vje(s.bufferViews,m);Eje(s,y),l(c)&&lfe(c,y);for(let x=0;x<u.length;x++){let T=u[x];lfe(T,y)}let A=await Sje(o,m,a.binary),b=Ije(y,A);return Pje(o,s,i,b),l(c)&&(Dje(o,i,b),Oje(o)),Rje(o,i,b),Mje(o),o._ready=!0,o};function Tje(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=Co(e,i,r);i+=r;let s=e.subarray(i,i+o);return{json:a,binary:s}}function Cje(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 vje(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 Eje(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 lfe(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 Sje(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=wje(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 wje(e,t){let i=e._resource.getDerivedResource({url:t.uri}),r=Mi.getExternalBufferLoader({resource:i});e._bufferLoader=r;try{await r.load()}catch(o){if(r.isDestroyed())return;throw o}return r.typedArray}function Ije(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 Pje(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=$i(t,"3DTILES_metadata"),u=l(e._tilePropertyTableJson),f=c||u;e._tileAvailability=UY(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=UY(t.contentAvailabilityHeaders[p],i,a,f);e._contentAvailabilityBitstreams.push(g)}e._childSubtreeAvailability=UY(t.childSubtreeAvailability,i,s)}function UY(e,t,n,i){if(l(e.constant))return new Uv({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 Uv({bitstream:r,lengthBits:n,availableCount:e.availableCount,computeAvailableCountEnabled:i})}function Dje(e,t,n){let i=e._tilePropertyTableJson,r=e._tileAvailability.availableCount,o=t.metadataSchema,a=i.class,s=o.classes[a];e._tileMetadataTable=new yd({class:s,count:r,properties:i.properties,bufferViews:n})}function Rje(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 yd({class:p,count:f,properties:c.properties,bufferViews:n});a.push(g)}}function ufe(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 Oje(e){let t=ufe(e._tileAvailability);e._tileJumpBuffer=t}function Mje(e){let t=e._contentJumpBuffers,n=e._contentAvailabilityBitstreams;for(let i=0;i<n.length;i++){let r=n[i],o=ufe(r);t.push(o)}}rc.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};rc.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 Lje(e,t){if(!l(e._tileMetadataTable))return;let n=e.getTileIndex(t);if(e._tileAvailability.getBit(n))return e._tileJumpBuffer[n]}function Nje(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]}rc.prototype.getTileMetadataView=function(e){let t=Lje(this,e);if(!l(t))return;let n=this._tileMetadataTable;return new Vv({class:n.class,metadataTable:n,entityId:t,propertyTableJson:this._tilePropertyTableJson})};rc.prototype.getContentMetadataView=function(e,t){let n=Nje(this,e,t);if(!l(n))return;let i=this._contentMetadataTables[t],r=this._contentPropertyTableJsons[t];return new Vv({class:i.class,metadataTable:i,entityId:n,contentIndex:t,propertyTableJson:r})};rc.prototype.isDestroyed=function(){return!1};rc.prototype.destroy=function(){return l(this._bufferLoader)&&Mi.unload(this._bufferLoader),ue(this)};var $0=rc;var yD={};function ffe(e){return e=(e^e<<8)&16711935,e=(e^e<<4)&252645135,e=(e^e<<2)&858993459,e=(e^e<<1)&1431655765,e}function VY(e){return e=(e^e<<16)&50331903,e=(e^e<<8)&50393103,e=(e^e<<4)&51130563,e=(e^e<<2)&153391689,e}function dfe(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 jY(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}yD.encode2D=function(e,t){return(ffe(e)|ffe(t)<<1)>>>0};yD.decode2D=function(e,t){return l(t)||(t=new Array(2)),t[0]=dfe(e),t[1]=dfe(e>>1),t};yD.encode3D=function(e,t,n){return VY(e)|VY(t)<<1|VY(n)<<2};yD.decode3D=function(e,t){return l(t)||(t=new Array(3)),t[0]=jY(e),t[1]=jY(e>>1),t[2]=jY(e>>2),t};var Cy=yD;function fo(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===Ra.OCTREE&&(this.z=e.z)}Object.defineProperties(fo.prototype,{childIndex:{get:function(){let e=0;return e|=this.x&1,e|=(this.y&1)<<1,this.subdivisionScheme===Ra.OCTREE&&(e|=(this.z&1)<<2),e}},mortonIndex:{get:function(){return this.subdivisionScheme===Ra.OCTREE?Cy.encode3D(this.x,this.y,this.z):Cy.encode2D(this.x,this.y)}},tileIndex:{get:function(){let e=this.subdivisionScheme===Ra.OCTREE?((1<<3*this.level)-1)/7:((1<<2*this.level)-1)/3,t=this.mortonIndex;return e+t}}});fo.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===Ra.OCTREE){let r=(this.z<<e.level)+e.z;return new fo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:r})}return new fo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};fo.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===Ra.OCTREE){let o=Math.floor(this.z/t);return new fo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:r,z:o})}return new fo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:r})};fo.prototype.getOffsetCoordinates=function(e){let t=e.level-this.level,n=1<<t,i=e.x%n,r=e.y%n;if(this.subdivisionScheme===Ra.OCTREE){let o=e.z%n;return new fo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:r,z:o})}return new fo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:r})};fo.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===Ra.OCTREE){let r=2*this.z+Math.floor(e/4)%2;return new fo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:r})}return new fo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};fo.prototype.getSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels)};fo.prototype.getParentSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels+this.subtreeLevels)};fo.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===Ra.OCTREE){let a=e.z>>t,s=this.z===a;return r&&o&&s}return r&&o};fo.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===Ra.OCTREE?this.z===e.z:!0)};fo.prototype.isImplicitTilesetRoot=function(){return this.level===0};fo.prototype.isSubtreeRoot=function(){return this.level%this.subtreeLevels===0};fo.prototype.isBottomOfSubtree=function(){return this.level%this.subtreeLevels===this.subtreeLevels-1};fo.prototype.getTemplateValues=function(){let e={level:this.level,x:this.x,y:this.y};return this.subdivisionScheme===Ra.OCTREE&&(e.z=this.z),e};var hfe=[0,0,0];fo.fromMortonIndex=function(e,t,n,i){let r;return e===Ra.OCTREE?(r=Cy.decode3D(i,hfe),new fo({subdivisionScheme:e,subtreeLevels:t,level:n,x:r[0],y:r[1],z:r[2]})):(r=Cy.decode2D(i,hfe),new fo({subdivisionScheme:e,subtreeLevels:t,level:n,x:r[0],y:r[1]}))};fo.fromTileIndex=function(e,t,n){let i,r,o;return e===Ra.OCTREE?(i=Math.floor(D.log2(7*n+1)/3),r=((1<<3*i)-1)/7,o=n-r):(i=Math.floor(D.log2(3*n+1)/2),r=((1<<2*i)-1)/3,o=n-r),fo.fromMortonIndex(e,t,i,o)};var Tp=fo;var GY=Go(af(),1);var HY,mfe="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJkYjZkM2MyOS1mODRiLTRlMGQtYTYzMy0xNWYyYmNiZjE1NGUiLCJpZCI6MjU5LCJzdWIiOiJDZXNpdW1KUyIsImlzcyI6Imh0dHBzOi8vYXBpLmNlc2l1bS5jb20iLCJhdWQiOiIxLjE0NCBSZWxlYXNlIC0gRGVsZXRlIG9uIE9jdG9iZXIgMSwgMjAyNiIsImlhdCI6MTc4NDk1ODg5MH0.x3Ra1-m0GEx7jwv8wnz-bAt4SSG3_ZCC9zU_MwzfjA4",vj={};vj.defaultAccessToken=mfe;vj.defaultServer=new De({url:"https://api.cesium.com/"});vj.getDefaultTokenCredit=function(e){if(e===mfe){if(!l(HY)){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>`;HY=new St(t,!0)}return HY}};var Bh=vj;function Rl(e,t){let n,i=e.externalType,r=l(i);if(!r)n={url:e.url,retryAttempts:1,retryCallback:Fje};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 GY.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)&&(Rl.prototype=Object.create(De.prototype),Rl.prototype.constructor=Rl);Rl.fromAssetId=function(e,t){let n=Rl._createEndpointResource(e,t);return n.fetchJson().then(function(i){return new Rl(i,n)})};Object.defineProperties(Rl.prototype,{credits:{get:function(){return l(this._ionRoot)?this._ionRoot.credits:l(this._credits)?this._credits:(this._credits=Rl.getCreditsFromEndpoint(this._ionEndpoint,this._ionEndpointResource),this._credits)}}});Rl.getCreditsFromEndpoint=function(e,t){let n=e.attributions.map(St.getIonCredit),i=Bh.getDefaultTokenCredit(t.queryParameters.access_token);return l(i)&&n.push(St.clone(i)),n};Rl.prototype.clone=function(e){let t=this._ionRoot??this;return l(e)||(e=new Rl(t._ionEndpoint,t._ionEndpointResource)),e=De.prototype.clone.call(this,e),e._ionRoot=t,e._isExternal=this._isExternal,e};Rl.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)};Rl.prototype._makeRequest=function(e){return this._isExternal||new GY.default(this.url).authority()!==this._ionEndpointDomain?De.prototype._makeRequest.call(this,e):(e.headers=pfe(e.headers),e.headers.Authorization=`Bearer ${this._ionEndpoint.accessToken}`,De.prototype._makeRequest.call(this,e))};Rl._createEndpointResource=function(e,t){t=t??H.EMPTY_OBJECT;let n=t.server??Bh.defaultServer,i=t.accessToken??Bh.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=pfe(r.headers),n.getDerivedResource(r)};function pfe(e={}){return e["X-Cesium-Client"]="CesiumJS",typeof CESIUM_VERSION<"u"&&(e["X-Cesium-Client-Version"]=CESIUM_VERSION),e}function Fje(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 ca=Rl;function Bje(e,t,n){let i=$i(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)&&!$i(r,"3DTILES_bounding_volume_S2")&&!$i(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=kje(t);for(let a=0;a<o.length;a++){let s=o[a];this.contentHeaders.push(Ye(s,!0));let c=new De({url:s.uri});this.contentUriTemplates.push(c)}this.contentCount=this.contentHeaders.length,this.tileHeader=zje(t),this.subdivisionScheme=Ra[i.subdivisionScheme],this.branchingFactor=Ra.getBranchingFactor(this.subdivisionScheme),this.subtreeLevels=i.subtreeLevels,l(i.availableLevels)?this.availableLevels=i.availableLevels:this.availableLevels=i.maximumLevel+1}function kje(e){if($i(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 zje(e){let t=Ye(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 Cp=Bje;var gfe={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(gfe);var Cd=gfe;function vp(e){e=e??H.EMPTY_OBJECT;let t=e.credit;typeof t=="string"&&(t=new St(t)),this._credit=t,this._tileCredits=void 0,this._errorEvent=new be,this._ellipsoid=e.ellipsoid??te.WGS84,this._tilingScheme=new Xi({ellipsoid:this._ellipsoid}),this._subtreeCache=new jb({provider:this}),this._tileset0=void 0,this._tileset1=void 0,this._resource=void 0,this._requestVertexNormals=e.requestVertexNormals??!1,this._requestWaterMask=e.requestWaterMask??!1}vp.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 vp(t);r._tileCredits=n.credits,r._resource=n;let o=i.root.children,a=o[0],s=o[1],c=i.schema,u=Pl.fromJson(c);return r._tileset0=new Cp(n,a,u),r._tileset1=new Cp(n,s,u),r};vp.fromIonAssetId=async function(e,t){let n=await ca.fromAssetId(e);return vp.fromUrl(n,t)};var Uje=new Array(3);vp.prototype.requestTileGeometry=async function(e,t,n,i){let r=yfe(n,e),o=r===0?this._tileset0:this._tileset1,a=Afe(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 $0.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=>zb(new Uint8Array(x))),b=Uje;b[0]=p,b[1]=A,b[2]=f?A.then(x=>Vje(x,m)):void 0;try{let x=await Promise.all(b),T=x[0],C=x[1],E=x[2],w=T.getTileMetadataView(a),P=w.getPropertyBySemantic(Cd.TILE_MINIMUM_HEIGHT),R=w.getPropertyBySemantic(Cd.TILE_MAXIMUM_HEIGHT),O=w.getPropertyBySemantic(Cd.TILE_BOUNDING_SPHERE),N=se.unpack(O,0,new se),_=w.getPropertyBySemantic(Cd.TILE_HORIZON_OCCLUSION_POINT),S=d._tilingScheme.tileXYToRectangle(e,t,n,new ie),I=d._ellipsoid,M=Jt.fromRectangle(S,P,R,I,new Jt),F=d.getLevelMaximumGeometricError(n)*5,V=Ej(o,T,a,0,0),k=Ej(o,T,a,1,0),j=Ej(o,T,a,0,1),B=Ej(o,T,a,1,1),G=(V?1:0)|(k?2:0)|(j?4:0)|(B?8:0),W=new zP({gltf:C,minimumHeight:P,maximumHeight:R,boundingSphere:N,orientedBoundingBox:M,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}};vp.prototype.getTileDataAvailable=function(e,t,n){let i=this._subtreeCache,r=yfe(n,e),o=r===0?this._tileset0:this._tileset1,a=Afe(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 yfe(e,t){let n=1<<e;return t/n|0}function Afe(e,t,n,i){let r=1<<t,o=t,a=n%r,s=r-i-1,{subdivisionScheme:c,subtreeLevels:u}=e;return new Tp({subdivisionScheme:c,subtreeLevels:u,level:o,x:a,y:s})}async function Vje(e,t){let n=e.extensions?.EXT_structural_metadata;if(!l(n)||!l(n.propertyTextures))return;let i=new Ty({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=Mi.getBufferViewLoader({gltf:e,bufferViewId:f,gltfResource:t,baseResource:t});return await d.load(),await W0({uint8Array:new Uint8Array(d.typedArray),format:"image/png",flipY:!1,skipColorSpaceConversion:!0})}function Ej(e,t,n,i,r){let o=n.isBottomOfSubtree(),s=WY(e,1,i,r),c=n.getDescendantCoordinates(s);return o?t.childSubtreeIsAvailableAtCoordinates(c):t.tileIsAvailableAtCoordinates(c)}function WY(e,t,n,i){let{subdivisionScheme:r,subtreeLevels:o}=e;return new Tp({subdivisionScheme:r,subtreeLevels:o,level:t,x:n,y:i})}vp.prototype.loadTileDataAvailability=function(e,t,n){};vp.prototype.getLevelMaximumGeometricError=function(e){let t=this._ellipsoid;return Vr.getEstimatedLevelZeroGeometricErrorForAHeightmap(t,64,2)/(1<<e)};Object.defineProperties(vp.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 jje(e,t,n){this.rootId=e,this.subtree=t,this.stamp=n}function jb(e){this._maximumSubtreeCount=e.maximumSubtreeCount??0,this._subtreeRequestCounter=0,this._queue=new V0({comparator:jb.comparator}),this._provider=e.provider}jb.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};jb.prototype.addSubtree=function(e,t){let n=new jje(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()};jb.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}};jb.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=WY(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=-D.PI,m=+D.PI,y=D.lerp(g,m,r/2),A=D.lerp(g,m,(r+1)/2),b=-D.PI*.5,x=+D.PI*.5,T=0,C=0,E=!0;for(;E;){let P=1/(1<<p),R=(A-y)*P,O=y+f*R,N=(x-b)*P,_=b+d*N;T=(t-O)/R,C=(n-_)/N;let v=_fe(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 P=0;P<a;P++){let R=_fe(o,u,T,C,P);if(c.tileIsAvailableAtCoordinates(R))w=R;else break}return w};function _fe(e,t,n,i,r){let o=1<<r,a=D.clamp(n*o|0,0,o-1),s=D.clamp(i*o|0,0,o-1),c=WY(e,r,a,s);return t.getDescendantCoordinates(c)}jb.prototype.computeMaximumLevelAtPosition=function(e){let t=this._computeMaximumImplicitTileCoordinatesAtPosition(e);return t===void 0?0:t.level};var qY=vp;function vy(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=wj(e.westIndices,r,t),this._southIndices=wj(e.southIndices,o,t),this._eastIndices=wj(e.eastIndices,r,t),this._northIndices=wj(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(vy.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 Sj=[];function wj(e,t,n){Sj.length=e.length;let i=!1;for(let r=0,o=e.length;r<o;++r)Sj[r]=e[r],i=i||r>0&&t(e[r-1],e[r])>0;return i?(Sj.sort(t),Ve.createTypedArray(n,Sj)):e}var bfe="createVerticesFromQuantizedTerrainMesh",Hje=new Yn(bfe),Gje=new Yn(bfe,xu.maximumAsynchronousTasks);vy.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?Gje:Hje).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,P=h.clone(g.occludeePointInScaledSpace)??p._horizonOcclusionPoint,R=g.vertexStride,O=uo.clone(g.encoding);return p._mesh=new tc(x,b,A,g.indexCountWithoutSkirts,m,T,C,u,E,P,R,w,O,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 Wje=new Yn("upsampleQuantizedTerrainMesh",xu.maximumAsynchronousTasks);vy.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=Wje.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 vy({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 YY=32767,xfe=new h;vy.prototype.interpolateHeight=function(e,t,n){let i=D.clamp((t-e.west)/e.width,0,1);i*=YY;let r=D.clamp((n-e.south)/e.height,0,1);return r*=YY,l(this._mesh)?Kje(this,i,r):$je(this,i,r)};function Tfe(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 qje=new z,Yje=new z,Xje=new z;function Kje(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,qje),g=o.decodeTextureCoordinates(r,f,Yje),m=o.decodeTextureCoordinates(r,d,Xje);if(Tfe(t,n,p.x,p.y,g.x,g.y,m.x,m.y)){let y=Oh.computeBarycentricCoordinates(t,n,p.x,p.y,g.x,g.y,m.x,m.y,xfe);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 $je(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(Tfe(t,n,p,y,g,A,m,b)){let x=Oh.computeBarycentricCoordinates(t,n,p,y,g,A,m,b,xfe);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 D.lerp(e._minimumHeight,e._maximumHeight,T/YY)}}}}vy.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};vy.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var Hb=vy;function Jje(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 vfe(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=[]}vfe.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 Efe(e,t,n){if(!t.format){let y="The tile format is not specified in the layer.json file.";throw e.previousError=Hr.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=Hr.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=Hr.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 Xi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else if(t.projection==="EPSG:3857")e.tilingScheme=new To({numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else{let y=`The projection "${t.projection}" is invalid or not supported.`;throw e.previousError=Hr.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=Hr.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 Dh(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 Dh(e.tilingScheme,u),g=new Dh(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 Jje({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 $Y(e),!0):(console.log("A layer.json can't have a parentUrl if it does't have an available array."),!0):!0}function Zje(e,t,n){let i=`An error occurred while accessing ${e.layerJsonResource.url}.`;if(l(t)&&(i+=`
${t.message}`),e.previousError=Hr.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,i),e.previousError.retry)return $Y(e,n);throw new oe(i)}async function Qje(e,t,n){await Efe(e,t,n);let i=e.overallAvailability.length;if(i>0){let r=e.availability=new Dh(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 St(e.attribution);e.tileCredits.push(r)}return!0}async function $Y(e,t){try{let n=await e.layerJsonResource.fetchJson();return Qje(e,n,t)}catch(n){return l(n)&&n.statusCode===404?(await Efe(e,{tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]},t),!0):Zje(e,n,t)}}function kh(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 St(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 XY={OCT_VERTEX_NORMALS:1,WATER_MASK:2,METADATA:4};function Cfe(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 e6e(e,t,n,i,r){let o=new Uint16Array(t,0,e._heightmapWidth*e._heightmapWidth);return new Sc({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 t6e(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 P=b.getUint32(s,!0);s+=Uint32Array.BYTES_PER_ELEMENT;let R=new Uint16Array(t,s,P*3);s+=P*g,P>64*1024&&(y=Uint32Array.BYTES_PER_ELEMENT,A=y*m);let O=R.subarray(0,P),N=R.subarray(P,2*P),_=R.subarray(P*2,3*P);an.zigZagDeltaDecode(O,N,_),s%y!==0&&(s+=y-s%y);let v=b.getUint32(s,!0);s+=Uint32Array.BYTES_PER_ELEMENT;let S=Ve.createTypedArrayFromArrayBuffer(P,t,s,v*m);s+=v*A;let I=0,M=S.length;for(let le=0;le<M;++le){let Ce=S[le];S[le]=I-Ce,Ce===0&&++I}let F=b.getUint32(s,!0);s+=Uint32Array.BYTES_PER_ELEMENT;let V=Ve.createTypedArrayFromArrayBuffer(P,t,s,F);s+=F*y;let k=b.getUint32(s,!0);s+=Uint32Array.BYTES_PER_ELEMENT;let j=Ve.createTypedArrayFromArrayBuffer(P,t,s,k);s+=k*y;let B=b.getUint32(s,!0);s+=Uint32Array.BYTES_PER_ELEMENT;let G=Ve.createTypedArrayFromArrayBuffer(P,t,s,B);s+=B*y;let W=b.getUint32(s,!0);s+=Uint32Array.BYTES_PER_ELEMENT;let Q=Ve.createTypedArrayFromArrayBuffer(P,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===XY.OCT_VERTEX_NORMALS&&e._requestVertexNormals)q=new Uint8Array(t,s,P*2);else if(le===XY.WATER_MASK&&e._requestWaterMask)J=new Uint8Array(t,s,Ce);else if(le===XY.METADATA&&e._requestMetadata){let ye=b.getUint32(s,!0);if(ye>0){let Ie=Co(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,Xe=Ie[Le],At=e._tilingScheme.getNumberOfYTilesAtLevel($e);for(let Ke=0;Ke<Xe.length;++Ke){let we=Xe[Ke],We=At-we.endY-1,vt=At-we.startY-1;e.availability.addAvailableTileRange($e,we.startX,We,we.endX,vt),o.availability.addAvailableTileRange($e,we.startX,We,we.endX,vt)}}}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 Hb({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})}kh.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=JY(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)})):Sfe(this,e,t,n,o,i)};function Sfe(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=Cfe(void 0)):u=Cfe(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)?e6e(e,m,i,t,n):t6e(e,m,i,t,n,r):Promise.reject(new oe("Mesh buffer doesn't exist."))})}Object.defineProperties(kh.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}}});kh.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};kh.fromIonAssetId=async function(e,t){let n=await ca.fromAssetId(e);return kh.fromUrl(n,t)};kh.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 vfe(t);i.lastResource=n,i.layerJsonResource=i.lastResource.getDerivedResource({url:"layer.json"}),await $Y(i);let r=new kh(t);return i.build(r),r};kh.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(JY(this,e,t,n,i[o],o===0).result)return;return!1};kh.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=JY(this,e,t,n,i[o],o===0);if(l(a.promise))return a.promise}};function KY(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 JY(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=KY(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 bo({throttle:!1,throttleByServer:!0,type:Ha.TERRAIN});d=Sfe(e,f.x,f.y,f.level,r,p),l(d)&&(r.availabilityPromiseCache[a]=d,d.then(s))}return{result:!0,promise:d}}f=KY(r,f.x,f.y,f.level)}return{result:!1}}kh._getAvailabilityTile=KY;var Gb=kh;var QY={},Ij=new h,wfe=new h,Ife=new Fe,Pfe=new $;function iE(e,t,n,i,r,o,a,s,c,u){let f=e+t;h.multiplyByScalar(i,Math.cos(f),Ij),h.multiplyByScalar(n,Math.sin(f),wfe),h.add(Ij,wfe,Ij);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(Ij,m,Ife),$.fromQuaternion(Ife,Pfe),$.multiplyByVector(Pfe,c,u),h.normalize(u,u),h.multiplyByScalar(u,s,u),u}var Dfe=new h,Rfe=new h,ZY=new h,n6e=new h;QY.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,Dfe);i.scaleToGeodeticSurface(g,g);let m=h.clone(g,Rfe),y=i.geodeticSurfaceNormal(g,n6e),A=h.multiplyByScalar(y,r,ZY);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 i6e=new h,r6e=new h,o6e=new h;QY.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,i6e),g=h.cross(h.UNIT_Z,a,r6e);g=h.normalize(g,g);let m=h.cross(p,g,o6e),y=1+Math.ceil(D.PI_OVER_TWO/s),A=D.PI_OVER_TWO/(y-1),b=D.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=Dfe,w=Rfe,P=y*4*3,R=P-1,O=0,N=n?new Array(P):void 0,_,v,S,I,M;for(b=D.PI_OVER_TWO,E=iE(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=D.PI_OVER_TWO-A,_=1;_<y+1;++_){if(E=iE(b,o,m,g,c,f,u,d,p,E),w=iE(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)I=v/(S-1),M=h.lerp(E,w,I,ZY),T[C++]=M.x,T[C++]=M.y,T[C++]=M.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[O++]=w.x,N[O++]=w.y,N[O++]=w.z),b=D.PI_OVER_TWO-(_+1)*A}for(_=y;_>1;--_){if(b=D.PI_OVER_TWO-(_-1)*A,E=iE(-b,o,m,g,c,f,u,d,p,E),w=iE(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)I=v/(S-1),M=h.lerp(E,w,I,ZY),T[C++]=M.x,T[C++]=M.y,T[C++]=M.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[O++]=w.x,N[O++]=w.y,N[O++]=w.z)}b=D.PI_OVER_TWO,E=iE(-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 wu=QY;function a6e(e){e=e??H.EMPTY_OBJECT,this.geometry=e.geometry,this.modelMatrix=L.clone(e.modelMatrix??L.IDENTITY),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=e.attributes??{},this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}var Nt=a6e;var Ofe=new h,Mfe=new h,Lfe=new h;function s6e(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,D.EPSILON14))return h.clone(h.UNIT_X,r);if(h.equalsEpsilon(e,n,D.EPSILON14))return h.clone(h.UNIT_Y,r);if(h.equalsEpsilon(e,i,D.EPSILON14))return h.clone(h.UNIT_Z,r);o=h.subtract(n,t,Ofe),a=h.subtract(i,t,Mfe),s=h.subtract(e,t,Lfe),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(z.equalsEpsilon(e,t,D.EPSILON14))return h.clone(h.UNIT_X,r);if(z.equalsEpsilon(e,n,D.EPSILON14))return h.clone(h.UNIT_Y,r);if(z.equalsEpsilon(e,i,D.EPSILON14))return h.clone(h.UNIT_Z,r);o=z.subtract(n,t,Ofe),a=z.subtract(i,t,Mfe),s=z.subtract(e,t,Lfe),c=z.dot(o,o),u=z.dot(o,a),f=z.dot(o,s),d=z.dot(a,a),p=z.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 Wb=s6e;function Ep(){this.high=h.clone(h.ZERO),this.low=h.clone(h.ZERO)}Ep.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 J0={high:0,low:0};Ep.fromCartesian=function(e,t){l(t)||(t=new Ep);let n=t.high,i=t.low;return Ep.encode(e.x,J0),n.x=J0.high,i.x=J0.low,Ep.encode(e.y,J0),n.y=J0.high,i.y=J0.low,Ep.encode(e.z,J0),n.z=J0.high,i.z=J0.low,t};var eX=new Ep;Ep.writeElements=function(e,t,n){Ep.fromCartesian(e,eX);let i=eX.high,r=eX.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 vn=Ep;var tX={};tX.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)};tX.tipsify=function(e){e=e??H.EMPTY_OBJECT;let t=e.indices,n=e.maximumIndex,i=e.cacheSize??24,r;function o(_,v,S,I){for(;v.length>=1;){let M=v[v.length-1];if(v.splice(v.length-1,1),_[M].numLiveTriangles>0)return M}for(;r<I;){if(_[r].numLiveTriangles>0)return++r,r-1;++r}return-1}function a(_,v,S,I,M,F,V){let k=-1,j,B=-1,G=0;for(;G<S.length;){let W=S[G];I[W].numLiveTriangles&&(j=0,M-I[W].timeStamp+2*I[W].numLiveTriangles<=v&&(j=M-I[W].timeStamp),(j>B||B===-1)&&(B=j,k=W)),++G}return k===-1?o(I,F,_,V):k}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=[],P=s/3,R=[];for(g=0;g<P;g++)R[g]=!1;let O,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)O=t[u],b.push(O),x.push(O),w[E]=O,++E,T=p[O],--T.numLiveTriangles,A-T.timeStamp>i&&(T.timeStamp=A,++A),++u}y=a(t,i,b,p,A,x,c)}return w};var AD=tX;var Ol={};function Nj(e,t,n,i,r){e[t++]=n,e[t++]=i,e[t++]=i,e[t++]=r,e[t++]=r,e[t]=n}function c6e(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)Nj(i,r,e[o],e[o+1],e[o+2]);return i}function l6e(e){let t=e.length;if(t>=3){let n=(t-2)*6,i=Ve.createTypedArray(t,n);Nj(i,0,e[0],e[1],e[2]);let r=6;for(let o=3;o<t;++o,r+=6)Nj(i,r,e[o-1],e[o],e[o-2]);return i}return new Uint16Array}function u6e(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)Nj(i,o,r,e[a],e[a+1]);return i}return new Uint16Array}Ol.toWireframe=function(e){let t=e.indices;if(l(t)){switch(e.primitiveType){case Re.TRIANGLES:e.indices=c6e(t);break;case Re.TRIANGLE_STRIP:e.indices=l6e(t);break;case Re.TRIANGLE_FAN:e.indices=u6e(t);break}e.primitiveType=Re.LINES}return e};Ol.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 xt({attributes:{position:new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:a})},primitiveType:Re.LINES,boundingSphere:c})};Ol.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};Ol.reorderForPreVertexCache=function(e){let t=xt.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};Ol.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=AD.tipsify({indices:n,maximumIndex:r,cacheSize:t})}return e};function Nfe(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 f6e(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])}}Ol.fitToUnsignedShortIndices=function(e){let t=[],n=xt.computeNumberOfVertices(e);if(l(e.indices)&&n>=D.SIXTY_FOUR_KILOBYTES){let i=[],r=[],o=0,a=Nfe(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,f6e(a,e.attributes,p)),r.push(g)}o+u>=D.SIXTY_FOUR_KILOBYTES&&(t.push(new xt({attributes:a,indices:r,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),i=[],r=[],o=0,a=Nfe(e.attributes))}r.length!==0&&t.push(new xt({attributes:a,indices:r,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var Ffe=new h,d6e=new de;Ol.projectTo2D=function(e,t,n,i,r){let o=e.attributes[t];r=l(r)?r:new Bi;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,Ffe),p=a.cartesianToCartographic(d,d6e),g=r.project(p,Ffe);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 nX={high:0,low:0};Ol.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)vn.encode(o[f],nX),s[f]=nX.high,c[f]=nX.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 Uh=new h;function iX(e,t){if(l(t)){let n=t.values,i=n.length;for(let r=0;r<i;r+=3)h.unpack(n,r,Uh),L.multiplyByPoint(e,Uh,Uh),h.pack(Uh,n,r)}}function rX(e,t){if(l(t)){let n=t.values,i=n.length;for(let r=0;r<i;r+=3)h.unpack(n,r,Uh),$.multiplyByVector(e,Uh,Uh),Uh=h.normalize(Uh,Uh),h.pack(Uh,n,r)}}var Pj=new L,Dj=new $;Ol.transformToWorldCoordinates=function(e){let t=e.modelMatrix;if(L.equals(t,L.IDENTITY))return e;let n=e.geometry.attributes;iX(t,n.position),iX(t,n.prevPosition),iX(t,n.nextPosition),(l(n.normal)||l(n.tangent)||l(n.bitangent))&&(L.inverse(t,Pj),L.transpose(Pj,Pj),L.getMatrix3(Pj,Dj),rX(Dj,n.normal),rX(Dj,n.tangent),rX(Dj,n.bitangent));let i=e.geometry.boundingSphere;return l(i)&&(e.geometry.boundingSphere=se.transform(i,t,i)),e.modelMatrix=L.clone(L.IDENTITY),e};function h6e(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 m6e=new h;function oX(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=h6e(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=xt.computeNumberOfVertices(new xt({attributes:f,primitiveType:Re.POINTS})),C=Ve.createTypedArray(T,x),E=0,w=0;for(r=0;r<n;++r){let P=e[r][t].indices,R=P.length;for(a=0;a<R;++a)C[E++]=w+P[a];w+=xt.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,m6e))+b.radius;x>A&&(A=x)}return new xt({attributes:f,indices:m,primitiveType:u,boundingSphere:l(y)?new se(y,A):void 0})}Ol.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(oX(t,"geometry")),n.length>0&&(r.push(oX(n,"westHemisphereGeometry")),r.push(oX(n,"eastHemisphereGeometry"))),r};var vd=new h,bD=new h,rE=new h,oE=new h;Ol.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;bD.x=i[b],bD.y=i[b+1],bD.z=i[b+2],rE.x=i[x],rE.y=i[x+1],rE.z=i[x+2],oE.x=i[T],oE.y=i[T+1],oE.z=i[T+2],a[m].count++,a[y].count++,a[A].count++,h.subtract(rE,bD,rE),h.subtract(oE,bD,oE),s[f]=h.cross(rE,oE,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,vd),p.count>0){for(f=0;f<p.count;f++)h.add(vd,s[c[p.indexOffset+f]],vd);h.equalsEpsilon(h.ZERO,vd,D.EPSILON10)&&h.clone(s[c[p.indexOffset]],vd)}h.equalsEpsilon(h.ZERO,vd,D.EPSILON10)&&(vd.z=1),h.normalize(vd,vd),g[m]=vd.x,g[m+1]=vd.y,g[m+2]=vd.z}return e.attributes.normal=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:g}),e};var p6e=new h,Bfe=new h,g6e=new h;Ol.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],P=i[f+2],R=o[x],O=o[x+1],N=o[T+1]-O,_=o[C+1]-O,v=1/((o[T]-R)*_-(o[C]-R)*N),S=(_*(i[d]-E)-N*(i[p]-E))*v,I=(_*(i[d+1]-w)-N*(i[p+1]-w))*v,M=(_*(i[d+2]-P)-N*(i[p+2]-P))*v;c[f]+=S,c[f+1]+=I,c[f+2]+=M,c[d]+=S,c[d+1]+=I,c[d+2]+=M,c[p]+=S,c[p+1]+=I,c[p+2]+=M}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,p6e),A=h.fromArray(c,f,g6e),b=h.dot(y,A);h.multiplyByScalar(y,b,Bfe),h.normalize(h.subtract(A,Bfe,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 xD=new z,zh=new h,kfe=new h,zfe=new h,Rj=new z;Ol.compressVertices=function(e){let t=e.attributes.extrudeDirection,n,i;if(l(t)){let w=t.values;i=w.length/3;let P=new Float32Array(i*2),R=0;for(n=0;n<i;++n){if(h.fromArray(w,n*3,zh),h.equals(zh,h.ZERO)){R+=2;continue}Rj=an.octEncodeInRange(zh,65535,Rj),P[R++]=Rj.x,P[R++]=Rj.y}return e.attributes.compressedAttributes=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:P}),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&&(z.fromArray(g,n*2,xD),C[E++]=an.compressTextureCoordinates(xD));let w=n*3;a&&l(m)&&l(y)?(h.fromArray(p,w,zh),h.fromArray(m,w,kfe),h.fromArray(y,w,zfe),an.octPack(zh,kfe,zfe,xD),C[E++]=xD.x,C[E++]=xD.y):(a&&(h.fromArray(p,w,zh),C[E++]=an.octEncodeFloat(zh)),f&&(h.fromArray(m,w,zh),C[E++]=an.octEncodeFloat(zh)),d&&(h.fromArray(y,w,zh),C[E++]=an.octEncodeFloat(zh)))}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 _6e(e){if(l(e.indices))return e;let t=xt.computeNumberOfVertices(e),n=Ve.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function y6e(e){let t=xt.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 A6e(e){let t=xt.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 b6e(e){if(l(e.indices))return e;let t=xt.computeNumberOfVertices(e),n=Ve.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function x6e(e){let t=xt.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 T6e(e){let t=xt.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 C6e(e){switch(e.primitiveType){case Re.TRIANGLE_FAN:return y6e(e);case Re.TRIANGLE_STRIP:return A6e(e);case Re.TRIANGLES:return _6e(e);case Re.LINE_STRIP:return x6e(e);case Re.LINE_LOOP:return T6e(e);case Re.LINES:return b6e(e)}return e}function Ey(e,t){Math.abs(e.y)<D.EPSILON6&&(t?e.y=-D.EPSILON6:e.y=D.EPSILON6)}function v6e(e,t,n){if(e.y!==0&&t.y!==0&&n.y!==0){Ey(e,e.y<0),Ey(t,t.y<0),Ey(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=D.sign(e.y):a=D.sign(n.y):r>o?a=D.sign(t.y):a=D.sign(n.y);let s=a<0;Ey(e,s),Ey(t,s),Ey(n,s)}var Ufe=new h;function Ed(e,t,n,i){h.add(e,h.multiplyByScalar(h.subtract(t,e,Ufe),e.y/(e.y-t.y),Ufe),n),h.clone(n,i),Ey(n,!0),Ey(i,!1)}var qb=new h,Yb=new h,Xb=new h,Kb=new h,aX={positions:new Array(7),indices:new Array(9)};function E6e(e,t,n){if(e.x>=0||t.x>=0||n.x>=0)return;v6e(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=aX.indices;a===1?(s[1]=3,s[2]=4,s[5]=6,s[7]=6,s[8]=5,i?(Ed(e,t,qb,Xb),Ed(e,n,Yb,Kb),s[0]=0,s[3]=1,s[4]=2,s[6]=1):r?(Ed(t,n,qb,Xb),Ed(t,e,Yb,Kb),s[0]=1,s[3]=2,s[4]=0,s[6]=2):o&&(Ed(n,e,qb,Xb),Ed(n,t,Yb,Kb),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||(Ed(n,e,qb,Xb),Ed(n,t,Yb,Kb),s[0]=0,s[1]=1,s[3]=0,s[6]=2):(Ed(t,n,qb,Xb),Ed(t,e,Yb,Kb),s[0]=2,s[1]=0,s[3]=2,s[6]=1):(Ed(e,t,qb,Xb),Ed(e,n,Yb,Kb),s[0]=1,s[1]=2,s[3]=1,s[6]=0));let c=aX.positions;return c[0]=e,c[1]=t,c[2]=n,c.length=3,(a===1||a===2)&&(c[3]=qb,c[4]=Yb,c[5]=Xb,c[6]=Kb,c.length=7),aX}function Vfe(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=xt.computeNumberOfVertices(e);return e.indices=Ve.createTypedArray(i,e.indices),t&&(e.boundingSphere=se.fromVertices(n.position.values)),e}function sE(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 xt({attributes:n,indices:[],primitiveType:e.primitiveType})}function uX(e,t,n){let i=l(e.geometry.boundingSphere);t=Vfe(t,i),n=Vfe(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 fX(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 S6e=fX(ae,4),Lj=fX(h,3),Yfe=fX(z,2),w6e=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>D.EPSILON6?1:0},TD=new h,sX=new h,cX=new h,I6e=new h;function Oj(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,TD),b=h.fromArray(r,t*3,sX),x=h.fromArray(r,n*3,cX),T=Wb(i,A,b,x,I6e);if(l(T)){if(l(o)&&Lj(e,t,n,T,o,d.normal.values,y,!0),l(u)){let C=h.fromArray(u,e*3,TD),E=h.fromArray(u,t*3,sX),w=h.fromArray(u,n*3,cX);h.multiplyByScalar(C,T.x,C),h.multiplyByScalar(E,T.y,E),h.multiplyByScalar(w,T.z,w);let P;!h.equals(C,h.ZERO)||!h.equals(E,h.ZERO)||!h.equals(w,h.ZERO)?(P=h.add(C,E,C),h.add(P,w,P),h.normalize(P,P)):(P=TD,P.x=0,P.y=0,P.z=0),h.pack(P,d.extrudeDirection.values,y*3)}if(l(f)&&w6e(e,t,n,T,f,d.applyOffset.values,y),l(a)&&Lj(e,t,n,T,a,d.tangent.values,y,!0),l(s)&&Lj(e,t,n,T,s,d.bitangent.values,y,!0),l(c)&&Yfe(e,t,n,T,c,d.st.values,y),g>0)for(let C=0;C<g;C++){let E=p[C];P6e(e,t,n,T,y,m[E],d[E])}}}function P6e(e,t,n,i,r,o,a){let s=o.componentsPerAttribute,c=o.values,u=a.values;switch(s){case 4:S6e(e,t,n,i,c,u,r,!1);break;case 3:Lj(e,t,n,i,c,u,r,!1);break;case 2:Yfe(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 Sp(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 D6e={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function jfe(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 P in n)n.hasOwnProperty(P)&&!D6e[P]&&l(n[P])&&d.push(P);let p=d.length,g=sE(t),m=sE(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 P=f[T],R=f[T+1],O=f[T+2],N=h.fromArray(i,P*3),_=h.fromArray(i,R*3),v=h.fromArray(i,O*3),S=E6e(N,_,v);if(l(S)&&S.positions.length>3){let I=S.positions,M=S.indices,F=M.length;for(let V=0;V<F;++V){let k=M[V],j=I[k];j.y<0?(y=m.attributes,A=m.indices,b=C):(y=g.attributes,A=g.indices,b=E),x=Sp(y,A,b,f,k<3?T+k:-1,j),Oj(P,R,O,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=Sp(y,A,b,f,T,N),Oj(P,R,O,N,i,r,a,o,s,c,u,y,d,p,n,x),x=Sp(y,A,b,f,T+1,_),Oj(P,R,O,_,i,r,a,o,s,c,u,y,d,p,n,x),x=Sp(y,A,b,f,T+2,v),Oj(P,R,O,v,i,r,a,o,s,c,u,y,d,p,n,x)}uX(e,m,g)}var Xfe=en.fromPointNormal(h.ZERO,h.UNIT_Y),R6e=new h,O6e=new h;function aE(e,t,n,i,r,o,a){if(!l(a))return;let s=h.fromArray(i,e*3,TD);h.equalsEpsilon(s,n,D.EPSILON10)?o.applyOffset.values[r]=a[e]:o.applyOffset.values[r]=a[t]}function Hfe(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=sE(t),s=sE(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,TD),y=h.fromArray(i,g*3,sX),A;Math.abs(m.y)<D.EPSILON6&&(m.y<0?m.y=-D.EPSILON6:m.y=D.EPSILON6),Math.abs(y.y)<D.EPSILON6&&(y.y<0?y.y=-D.EPSILON6:y.y=D.EPSILON6);let b=a.attributes,x=a.indices,T=d,C=s.attributes,E=s.indices,w=f,P=ci.lineSegmentPlane(m,y,Xfe,cX);if(l(P)){let R=h.multiplyByScalar(h.UNIT_Y,5*D.EPSILON9,R6e);m.y<0&&(h.negate(R,R),b=s.attributes,x=s.indices,T=f,C=a.attributes,E=a.indices,w=d);let O=h.add(P,R,O6e);A=Sp(b,x,T,o,c,m),aE(p,g,m,i,A,b,r),A=Sp(b,x,T,o,-1,O),aE(p,g,O,i,A,b,r),h.negate(R,R),h.add(P,R,O),A=Sp(C,E,w,o,-1,O),aE(p,g,O,i,A,C,r),A=Sp(C,E,w,o,c+1,y),aE(p,g,y,i,A,C,r)}else{let R,O,N;m.y<0?(R=s.attributes,O=s.indices,N=f):(R=a.attributes,O=a.indices,N=d),A=Sp(R,O,N,o,c,m),aE(p,g,m,i,A,R,r),A=Sp(R,O,N,o,c+1,y),aE(p,g,y,i,A,R,r)}}uX(e,s,a)}var Gfe=new z,M6e=new z,Kfe=new h,$fe=new h,lX=new h,L6e=new h,N6e=new h,F6e=new h,Wfe=new ae;function qfe(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,Kfe);if(s.x>0)continue;let c=h.unpack(i,a,$fe);(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,lX);(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 B6e=5*D.EPSILON9,Mj=D.EPSILON6;function k6e(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=sE(t),f=sE(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,Kfe),T=h.fromArray(i,b*3,$fe);if(Math.abs(x.y)<Mj)for(x.y=Mj*(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)<Mj)for(T.y=Mj*(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,P=f.indices,R=ci.lineSegmentPlane(x,T,Xfe,L6e);if(l(R)){m=!0;let O=h.multiplyByScalar(h.UNIT_Y,B6e,N6e);x.y<0&&(h.negate(O,O),C=f.attributes,E=f.indices,w=u.attributes,P=u.indices);let N=h.add(R,O,F6e);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(O,O),h.add(R,O,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 _=z.fromArray(a,A*2,Gfe),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,lX));if(S/=h.magnitudeSquared(h.subtract(T,x,lX)),l(c)){let I=ae.fromArray(c,A*4,Wfe),M=ae.fromArray(c,b*4,Wfe),F=D.lerp(I.x,M.x,S),V=D.lerp(I.y,M.y,S),k=D.lerp(I.z,M.z,S),j=D.lerp(I.w,M.w,S);for(p=A*4;p<A*4+8;++p)C.color.values.push(c[p]);for(C.color.values.push(F,V,k,j),C.color.values.push(F,V,k,j),w.color.values.push(F,V,k,j),w.color.values.push(F,V,k,j),p=b*4;p<b*4+8;++p)w.color.values.push(c[p])}if(l(s)){let I=z.fromArray(s,A*2,Gfe),M=z.fromArray(s,(d+3)*2,M6e),F=D.lerp(I.x,M.x,S);for(p=A*2;p<A*2+4;++p)C.st.values.push(s[p]);for(C.st.values.push(F,I.y),C.st.values.push(F,M.y),w.st.values.push(F,I.y),w.st.values.push(F,M.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,P.push(g,g+2,g+1),P.push(g+1,g+2,g+3)}else{let O,N;for(x.y<0?(O=f.attributes,N=f.indices):(O=u.attributes,N=u.indices),O.position.values.push(x.x,x.y,x.z),O.position.values.push(x.x,x.y,x.z),O.position.values.push(T.x,T.y,T.z),O.position.values.push(T.x,T.y,T.z),p=d*3;p<d*3+12;++p)O.prevPosition.values.push(r[p]),O.nextPosition.values.push(o[p]);for(p=d*2;p<d*2+8;++p)O.expandAndWidth.values.push(a[p]),l(s)&&O.st.values.push(s[p]);if(l(c))for(p=d*4;p<d*4+16;++p)O.color.values.push(c[p]);g=O.position.values.length/3-4,N.push(g,g+2,g+1),N.push(g+1,g+2,g+3)}}m&&(qfe(f),qfe(u)),uX(e,f,u)}Ol.splitLongitude=function(e){let t=e.geometry,n=t.boundingSphere;if(l(n)&&(n.center.x-n.radius>0||se.intersectPlane(n,en.ORIGIN_ZX_PLANE)!==Xt.INTERSECTING))return e;if(t.geometryType!==_d.NONE)switch(t.geometryType){case _d.POLYLINES:k6e(e);break;case _d.TRIANGLES:jfe(e);break;case _d.LINES:Hfe(e);break}else C6e(t),t.primitiveType===Re.TRIANGLES?jfe(e):t.primitiveType===Re.LINES&&Hfe(e);return e};var Hn=Ol;var cE=new h,dX=new h,hX=new h,Jfe=new h,fs=new z,Zfe=new $,z6e=new $,mX=new Fe,Qfe=new h,ede=new h,tde=new h,kj=new de,nde=new h,ide=new z,rde=new z;function ode(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=Qfe,x=ede,T=tde,C=new Bi(s),E=C.project(s.cartesianToCartographic(r,kj),nde),w=s.scaleToGeodeticSurface(r,cE);s.geodeticSurfaceNormal(w,w);let P=Zfe,R=z6e;if(c!==0){let M=Fe.fromAxisAngle(w,c,mX);P=$.fromQuaternion(M,P),M=Fe.fromAxisAngle(w,-c,mX),R=$.fromQuaternion(M,R)}else P=$.clone($.IDENTITY,P),R=$.clone($.IDENTITY,R);let O=z.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,ide),N=z.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,rde),_=e.length,v=n?_:0,S=v/3*2;for(let M=0;M<_;M+=3){let F=M+1,V=M+2,k=h.fromArray(e,M,cE);if(i.st){let j=$.multiplyByVector(P,k,dX),B=C.project(s.cartesianToCartographic(j,kj),hX);h.subtract(B,E,B),fs.x=(B.x+o)/(2*o),fs.y=(B.y+a)/(2*a),O.x=Math.min(fs.x,O.x),O.y=Math.min(fs.y,O.y),N.x=Math.max(fs.x,N.x),N.y=Math.max(fs.y,N.y),n&&(d[A+S]=fs.x,d[A+1+S]=fs.y),d[A++]=fs.x,d[A++]=fs.y}(i.normal||i.tangent||i.bitangent||f)&&(b=s.geodeticSurfaceNormal(k,b),f&&(y[M+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[M]=b.x,p[F]=b.y,p[V]=b.z,n&&(p[M+v]=-b.x,p[F+v]=-b.y,p[V+v]=-b.z)),i.tangent&&(g[M]=x.x,g[F]=x.y,g[V]=x.z,n&&(g[M+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[M]=T.x,m[F]=T.y,m[V]=T.z,n&&(m[M+v]=T.x,m[F+v]=T.y,m[V+v]=T.z))))}if(i.st){_=d.length;for(let M=0;M<_;M+=2)d[M]=(d[M]-O.x)/(N.x-O.x),d[M+1]=(d[M+1]-O.y)/(N.y-O.y)}let I=new bn;if(i.position){let M=wu.raisePositionsToHeight(e,t,n);I.position=new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:M})}if(i.st&&(I.st=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:d})),i.normal&&(I.normal=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:p})),i.tangent&&(I.tangent=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:g})),i.bitangent&&(I.bitangent=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:m})),f&&(I.extrudeDirection=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:y})),n&&l(t.offsetAttribute)){let M=new Uint8Array(u);if(t.offsetAttribute===hn.TOP)M=M.fill(1,0,u/2);else{let F=t.offsetAttribute===hn.NONE?0:1;M=M.fill(F)}I.applyOffset=new Me({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:M})}return I}function ade(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 $b=new h;function U6e(e){let t=e.center;$b=h.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,$b),e.height,$b),$b=h.add(t,$b,$b);let n=new se($b,e.semiMajorAxis),i=wu.computeEllipsePositions(e,!0,!1),r=i.positions,o=i.numPts,a=ode(r,e,!1),s=ade(o);return s=Ve.createTypedArray(r.length/3,s),{boundingSphere:n,attributes:a,indices:s}}function V6e(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=Qfe,C=ede,E=tde,w=new Bi(a),P=w.project(a.cartesianToCartographic(i,kj),nde),R=a.scaleToGeodeticSurface(i,cE);a.geodeticSurfaceNormal(R,R);let O=Fe.fromAxisAngle(R,u,mX),N=$.fromQuaternion(O,Zfe),_=z.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,ide),v=z.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,rde),S=e.length,I=S/3*2;for(let F=0;F<S;F+=3){let V=F+1,k=F+2,j=h.fromArray(e,F,cE),B;if(n.st){let W=$.multiplyByVector(N,j,dX),Q=w.project(a.cartesianToCartographic(W,kj),hX);h.subtract(Q,P,Q),fs.x=(Q.x+r)/(2*r),fs.y=(Q.y+o)/(2*o),_.x=Math.min(fs.x,_.x),_.y=Math.min(fs.y,_.y),v.x=Math.max(fs.x,v.x),v.y=Math.max(fs.y,v.y),p[x+I]=fs.x,p[x+1+I]=fs.y,p[x++]=fs.x,p[x++]=fs.y}j=a.scaleToGeodeticSurface(j,j),B=h.clone(j,dX),T=a.geodeticSurfaceNormal(j,T),A&&(b[F+S]=-T.x,b[V+S]=-T.y,b[k+S]=-T.z);let G=h.multiplyByScalar(T,s,Jfe);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[k+S]=B.z,d[F]=j.x,d[V]=j.y,d[k]=j.z),n.normal||n.tangent||n.bitangent){E=h.clone(T,E);let W=h.fromArray(e,(F+3)%S,Jfe);h.subtract(W,j,W);let Q=h.subtract(B,j,hX);T=h.normalize(h.cross(Q,W,T),T),n.normal&&(g[F]=T.x,g[V]=T.y,g[k]=T.z,g[F+S]=T.x,g[V+S]=T.y,g[k+S]=T.z),n.tangent&&(C=h.normalize(h.cross(E,T,C),C),m[F]=C.x,m[V]=C.y,m[k]=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[k]=E.z,y[F+S]=E.x,y[V+S]=E.y,y[k+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 M=new bn;if(n.position&&(M.position=new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:d})),n.st&&(M.st=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:p})),n.normal&&(M.normal=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:g})),n.tangent&&(M.tangent=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:m})),n.bitangent&&(M.bitangent=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:y})),A&&(M.extrudeDirection=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:b})),l(t.offsetAttribute)){let F=new Uint8Array(f);if(t.offsetAttribute===hn.TOP)F=F.fill(1,0,f/2);else{let V=t.offsetAttribute===hn.NONE?0:1;F=F.fill(V)}M.applyOffset=new Me({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:F})}return M}function j6e(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 Fj=new se,Bj=new se;function H6e(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,r=h.multiplyByScalar(n.geodeticSurfaceNormal(t,cE),e.height,cE);Fj.center=h.add(t,r,Fj.center),Fj.radius=i,r=h.multiplyByScalar(n.geodeticSurfaceNormal(t,r),e.extrudedHeight,r),Bj.center=h.add(t,r,Bj.center),Bj.radius=i;let o=wu.computeEllipsePositions(e,!0,!0),a=o.positions,s=o.numPts,c=o.outerPositions,u=se.union(Fj,Bj),f=ode(a,e,!0),d=ade(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 xt({attributes:f,indices:m,primitiveType:Re.TRIANGLES}),A=V6e(c,e);d=j6e(c);let b=Ve.createTypedArray(c.length*2/3,d),x=new xt({attributes:A,indices:b,primitiveType:Re.TRIANGLES}),T=Hn.combineInstances([new Nt({geometry:y}),new Nt({geometry:x})]);return{boundingSphere:u,attributes:T[0].attributes,indices:T[0].indices}}function sde(e,t,n,i,r,o,a){let c=wu.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>D.PI&&(d.north=d.north>0?D.PI_OVER_TWO-D.EPSILON7:d.north,d.south=d.south<0?D.EPSILON7-D.PI_OVER_TWO:d.south,d.east=D.PI,d.west=-D.PI),d}function Ip(e){e=e??H.EMPTY_OBJECT;let t=e.center,n=e.ellipsoid??te.default,i=e.semiMajorAxis,r=e.semiMinorAxis,o=e.granularity??D.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}Ip.packedLength=h.packedLength+te.packedLength+Be.packedLength+9;Ip.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 cde=new h,lde=new te,ude=new Be,wp={center:cde,ellipsoid:lde,vertexFormat:ude,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};Ip.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,cde);t+=h.packedLength;let r=te.unpack(e,t,lde);t+=te.packedLength;let o=Be.unpack(e,t,ude);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):(wp.height=f,wp.extrudedHeight=p,wp.granularity=d,wp.stRotation=u,wp.rotation=c,wp.semiMajorAxis=a,wp.semiMinorAxis=s,wp.shadowVolume=g,wp.offsetAttribute=m===-1?void 0:m,new Ip(wp))};Ip.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??D.RADIANS_PER_DEGREE,s=e.rotation??0;return sde(n,r,o,s,a,i,t)};Ip.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!D.equalsEpsilon(t,n,0,D.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=H6e(r);else if(o=U6e(r),l(e._offsetAttribute)){let a=o.attributes.position.values.length,s=e._offsetAttribute===hn.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 xt({attributes:o.attributes,indices:o.indices,primitiveType:Re.TRIANGLES,boundingSphere:o.boundingSphere,offsetAttribute:e._offsetAttribute})};Ip.createShadowVolume=function(e,t,n){let i=e._granularity,r=e._ellipsoid,o=t(i,r),a=n(i,r);return new Ip({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 G6e(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let i=wu.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 xt._textureCoordinateRotationPoints(o,t,a,s)}Object.defineProperties(Ip.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=sde(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=G6e(this)),this._textureCoordinateRotationPoints}}});var Ml=Ip;function Z0(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 Ml(n),this._workerName="createCircleGeometry"}Z0.packedLength=Ml.packedLength;Z0.pack=function(e,t,n){return Ml.pack(e._ellipseGeometry,t,n)};var fde=new Ml({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};Z0.unpack=function(e,t,n){let i=Ml.unpack(e,t,fde);return Pc.center=h.clone(i._center,Pc.center),Pc.ellipsoid=te.clone(i._ellipsoid,Pc.ellipsoid),Pc.ellipsoid=te.clone(i._ellipsoid,fde._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 Ml(Pc),n):(Pc.radius=i._semiMajorAxis,new Z0(Pc))};Z0.createGeometry=function(e){return Ml.createGeometry(e._ellipseGeometry)};Z0.createShadowVolume=function(e,t,n){let i=e._ellipseGeometry._granularity,r=e._ellipseGeometry._ellipsoid,o=t(i,r),a=n(i,r);return new Z0({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(Z0.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}},textureCoordinateRotationPoints:{get:function(){return this._ellipseGeometry.textureCoordinateRotationPoints}}});var pX=Z0;var dde=new h,Jb=new h;function W6e(e){let t=e.center;Jb=h.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,Jb),e.height,Jb),Jb=h.add(t,Jb,Jb);let n=new se(Jb,e.semiMajorAxis),i=wu.computeEllipsePositions(e,!1,!0).outerPositions,r=new bn({position:new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:wu.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 zj=new se,Uj=new se;function q6e(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,r=h.multiplyByScalar(n.geodeticSurfaceNormal(t,dde),e.height,dde);zj.center=h.add(t,r,zj.center),zj.radius=i,r=h.multiplyByScalar(n.geodeticSurfaceNormal(t,r),e.extrudedHeight,r),Uj.center=h.add(t,r,Uj.center),Uj.radius=i;let o=wu.computeEllipsePositions(e,!1,!0).outerPositions,a=new bn({position:new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:wu.raisePositionsToHeight(o,e,!0)})});o=a.position.values;let s=se.union(zj,Uj),c=o.length/3;if(l(e.offsetAttribute)){let m=new Uint8Array(c);if(e.offsetAttribute===hn.TOP)m=m.fill(1,0,c/2);else{let y=e.offsetAttribute===hn.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=D.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 lE(e){e=e??H.EMPTY_OBJECT;let t=e.center,n=e.ellipsoid??te.default,i=e.semiMajorAxis,r=e.semiMinorAxis,o=e.granularity??D.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"}lE.packedLength=h.packedLength+te.packedLength+8;lE.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 hde=new h,mde=new te,Q0={center:hde,ellipsoid:mde,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};lE.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,hde);t+=h.packedLength;let r=te.unpack(e,t,mde);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):(Q0.height=c,Q0.extrudedHeight=f,Q0.granularity=u,Q0.rotation=s,Q0.semiMajorAxis=o,Q0.semiMinorAxis=a,Q0.numberOfVerticalLines=d,Q0.offsetAttribute=p===-1?void 0:p,new lE(Q0))};lE.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!D.equalsEpsilon(t,n,0,D.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=q6e(r);else if(o=W6e(r),l(e._offsetAttribute)){let a=o.attributes.position.values.length,s=e._offsetAttribute===hn.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 xt({attributes:o.attributes,indices:o.indices,primitiveType:Re.LINES,boundingSphere:o.boundingSphere,offsetAttribute:e._offsetAttribute})};var df=lE;function uE(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 df(n),this._workerName="createCircleOutlineGeometry"}uE.packedLength=df.packedLength;uE.pack=function(e,t,n){return df.pack(e._ellipseGeometry,t,n)};var Y6e=new df({center:new h,semiMajorAxis:1,semiMinorAxis:1}),hf={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};uE.unpack=function(e,t,n){let i=df.unpack(e,t,Y6e);return hf.center=h.clone(i._center,hf.center),hf.ellipsoid=te.clone(i._ellipsoid,hf.ellipsoid),hf.height=i._height,hf.extrudedHeight=i._extrudedHeight,hf.granularity=i._granularity,hf.numberOfVerticalLines=i._numberOfVerticalLines,l(n)?(hf.semiMajorAxis=i._semiMajorAxis,hf.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new df(hf),n):(hf.radius=i._semiMajorAxis,new uE(hf))};uE.createGeometry=function(e){return df.createGeometry(e._ellipseGeometry)};var gX=uE;var pde={UNBOUNDED:0,CLAMPED:1,LOOP_STOP:2};Object.freeze(pde);var la=pde;var gde={TICK_DEPENDENT:0,SYSTEM_CLOCK_MULTIPLIER:1,SYSTEM_CLOCK:2};Object.freeze(gde);var Lr=gde;var _X;typeof performance<"u"&&typeof performance.now=="function"&&isFinite(performance.now())?_X=function(){return performance.now()}:_X=function(){return Date.now()};var yn=_X;function yX(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??la.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=yn(),this.currentTime=t,this.multiplier=e.multiplier??1,this.shouldAnimate=e.shouldAnimate??!1,this.clockStep=e.clockStep??Lr.SYSTEM_CLOCK_MULTIPLIER}Object.defineProperties(yX.prototype,{currentTime:{get:function(){return this._currentTime},set:function(e){K.equals(this._currentTime,e)||(this._clockStep===Lr.SYSTEM_CLOCK&&(this._clockStep=Lr.SYSTEM_CLOCK_MULTIPLIER),this._currentTime=e)}},multiplier:{get:function(){return this._multiplier},set:function(e){this._multiplier!==e&&(this._clockStep===Lr.SYSTEM_CLOCK&&(this._clockStep=Lr.SYSTEM_CLOCK_MULTIPLIER),this._multiplier=e)}},clockStep:{get:function(){return this._clockStep},set:function(e){e===Lr.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===Lr.SYSTEM_CLOCK&&(this._clockStep=Lr.SYSTEM_CLOCK_MULTIPLIER),this._shouldAnimate=e)}}});yX.prototype.tick=function(){let e=yn(),t=K.clone(this._currentTime);if(this.canAnimate&&this._shouldAnimate){let n=this._clockStep;if(n===Lr.SYSTEM_CLOCK)t=K.now(t);else{let i=this._multiplier;if(n===Lr.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===la.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===la.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 Vh=yX;function fE(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(fE.prototype,{componentDatatype:{get:function(){return Y.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}});fE.fromColor=function(e){return new fE(e.red,e.green,e.blue,e.alpha)};fE.toValue=function(e,t){return l(t)?e.toBytes(t):new Uint8Array(e.toBytes())};fE.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=fE;function dE(e){this._value=e,this._valueType=xr.getPointType(e)}Object.defineProperties(dE.prototype,{value:{get:function(){return this._value}}});dE.prototype.findTimeInterval=function(e){};dE.prototype.wrapTime=function(e){return 0};dE.prototype.clampTime=function(e){return 0};dE.prototype.evaluate=function(e,t){let n=this._value,i=this._valueType;return i===Number?n:i.clone(n,t)};var CD=dE;var _de=D.EPSILON10;function X6e(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,_de)?(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],_de)&&(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=X6e;var vD={},K6e=new h,yde=new h,Ade=new h,bde=new h,xde=new Jt;vD.validOutline=function(e){let n=Jt.fromPoints(e,xde).halfAxes,i=$.getColumn(n,0,yde),r=$.getColumn(n,1,Ade),o=$.getColumn(n,2,bde),a=h.magnitude(i),s=h.magnitude(r),c=h.magnitude(o);return!(a===0&&(s===0||c===0)||s===0&&c===0)};vD.computeProjectTo2DArguments=function(e,t,n,i){let r=Jt.fromPoints(e,xde),o=r.halfAxes,a=$.getColumn(o,0,yde),s=$.getColumn(o,1,Ade),c=$.getColumn(o,2,bde),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 Tde(e,t,n,i,r){let o=h.subtract(e,t,K6e),a=h.dot(n,o),s=h.dot(i,o);return z.fromElements(a,s,r)}vD.createProjectPointsTo2DFunction=function(e,t,n){return function(i){let r=new Array(i.length);for(let o=0;o<i.length;o++)r[o]=Tde(i[o],e,t,n);return r}};vD.createProjectPointTo2DFunction=function(e,t,n){return function(i,r){return Tde(i,e,t,n,r)}};var eg=vD;function bX(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 $6e(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),P=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*P+(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 hE(e,t){if(e===0)return Math.log(Math.tan(.5*(D.PI_OVER_TWO+t)));let n=e*Math.sin(t);return Math.log(Math.tan(.5*(D.PI_OVER_TWO+t)))-e/2*Math.log((1+n)/(1-n))}function J6e(e,t,n,i,r){let o=hE(e._ellipticity,n),a=hE(e._ellipticity,r);return Math.atan2(D.negativePiToPi(i-t),a-o)}function Z6e(e,t,n,i,r,o,a){let s=e._heading,c=o-i,u;if(D.equalsEpsilon(Math.abs(s),D.PI_OVER_TWO,D.EPSILON8))if(t===n)u=t*Math.cos(r)*D.negativePiToPi(c);else{let f=Math.sin(r);u=t*Math.cos(r)*D.negativePiToPi(c)/Math.sqrt(1-e._ellipticitySquared*f*f)}else{let f=bX(e._ellipticity,t,r);u=(bX(e._ellipticity,t,a)-f)/Math.cos(s)}return Math.abs(u)}var Q6e=new h,AX=new h;function Cde(e,t,n,i){let r=h.normalize(i.cartographicToCartesian(t,AX),Q6e),o=h.normalize(i.cartographicToCartesian(n,AX),AX),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=J6e(e,t.longitude,t.latitude,n.longitude,n.latitude),e._distance=Z6e(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude)}function vde(e,t,n,i,r,o){if(n===0)return de.clone(e,o);let a=r*r,s,c,u;if(Math.abs(D.PI_OVER_TWO-Math.abs(t))>D.EPSILON8){let f=bX(r,i,e.latitude),d=n*Math.cos(t),p=f+d;if(c=$6e(p,r,i),Math.abs(t)<D.EPSILON10)s=D.negativePiToPi(e.longitude);else{let g=hE(r,e.latitude),m=hE(r,c);u=Math.tan(t)*(m-g),s=D.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=D.negativePiToPi(e.longitude+u):s=D.negativePiToPi(e.longitude-u)}return l(o)?(o.longitude=s,o.latitude=c,o.height=0,o):new de(s,c,0)}function tg(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)&&Cde(this,e,t,i)}Object.defineProperties(tg.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}}});tg.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=D.negativePiToPi(t);let d=vde(e,t,n,o.maximumRadius,f);return!l(r)||l(i)&&!i.equals(r.ellipsoid)?new tg(e,d,o):(r.setEndPoints(e,d),r)};tg.prototype.setEndPoints=function(e,t){Cde(this,e,t,this._ellipsoid)};tg.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(e*this._distance,t)};tg.prototype.interpolateUsingSurfaceDistance=function(e,t){return vde(this._start,this._heading,e,this._ellipsoid.maximumRadius,this._ellipticity,t)};tg.prototype.findIntersectionWithLongitude=function(e,t){let n=this._ellipticity,i=this._heading,r=Math.abs(i),o=this._start;if(e=D.negativePiToPi(e),D.equalsEpsilon(Math.abs(e),Math.PI,D.EPSILON14)&&(e=D.sign(o.longitude)*Math.PI),l(t)||(t=new de),Math.abs(D.PI_OVER_TWO-r)<=D.EPSILON8)return t.longitude=e,t.latitude=o.latitude,t.height=0,t;if(D.equalsEpsilon(Math.abs(D.PI_OVER_TWO-r),D.PI_OVER_TWO,D.EPSILON8))return D.equalsEpsilon(e,o.longitude,D.EPSILON12)?void 0:(t.longitude=e,t.latitude=D.PI_OVER_TWO*D.sign(D.PI_OVER_TWO-i),t.height=0,t);let a=o.latitude,s=n*Math.sin(a),c=Math.tan(.5*(D.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))-D.PI_OVER_TWO}while(!D.equalsEpsilon(f,d,D.EPSILON12));return t.longitude=e,t.latitude=f,t.height=0,t};tg.prototype.findIntersectionWithLatitude=function(e,t){let n=this._ellipticity,i=this._heading,r=this._start;if(D.equalsEpsilon(Math.abs(i),D.PI_OVER_TWO,D.EPSILON8))return;let o=hE(n,r.latitude),a=hE(n,e),s=Math.tan(i)*(a-o),c=D.negativePiToPi(r.longitude+s);return l(t)?(t.longitude=c,t.latitude=e,t.height=0,t):new de(c,e,0)};var Dc=tg;function eHe(e,t){this.positions=l(e)?e:[],this.holes=l(t)?t:[]}var Rc=eHe;function CX(e,t,n=2){let i=t&&t.length,r=i?t[0]*n:e.length,o=Sde(e,0,r,n,!0),a=[];if(!o||o.next===o.prev)return a;let s,c,u;if(i&&(o=oHe(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 SD(o,a,n,s,c,u,0),a}function Sde(e,t,n,i,r){let o;if(r===gHe(e,t,n,i)>0)for(let a=t;a<n;a+=i)o=Ede(a/i|0,e[a],e[a+1],o);else for(let a=n-i;a>=t;a-=i)o=Ede(a/i|0,e[a],e[a+1],o);return o&&mE(o,o.next)&&(ID(o),o=o.next),o}function Zb(e,t){if(!e)return e;t||(t=e);let n=e,i;do if(i=!1,!n.steiner&&(mE(n,n.next)||ua(n.prev,n,n.next)===0)){if(ID(n),n=t=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==t);return t}function SD(e,t,n,i,r,o,a){if(!e)return;!a&&o&&uHe(e,i,r,o);let s=e;for(;e.prev!==e.next;){let c=e.prev,u=e.next;if(o?nHe(e,i,r,o):tHe(e)){t.push(c.i,e.i,u.i),ID(e),e=u.next,s=u.next;continue}if(e=u,e===s){a?a===1?(e=iHe(Zb(e),t),SD(e,t,n,i,r,o,2)):a===2&&rHe(e,t,n,i,r,o):SD(Zb(e),t,n,i,r,o,1);break}}}function tHe(e){let t=e.prev,n=e,i=e.next;if(ua(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&&ED(r,s,o,c,a,u,m.x,m.y)&&ua(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function nHe(e,t,n,i){let r=e.prev,o=e,a=e.next;if(ua(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=xX(g,m,t,n,i),x=xX(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&&ED(s,f,c,d,u,p,T.x,T.y)&&ua(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&&ED(s,f,c,d,u,p,C.x,C.y)&&ua(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&&ED(s,f,c,d,u,p,T.x,T.y)&&ua(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&&ED(s,f,c,d,u,p,C.x,C.y)&&ua(C.prev,C,C.next)>=0)return!1;C=C.nextZ}return!0}function iHe(e,t){let n=e;do{let i=n.prev,r=n.next.next;!mE(i,r)&&Ide(i,n,n.next,r)&&wD(i,r)&&wD(r,i)&&(t.push(i.i,n.i,r.i),ID(n),ID(n.next),n=e=r),n=n.next}while(n!==e);return Zb(n)}function rHe(e,t,n,i,r,o){let a=e;do{let s=a.next.next;for(;s!==a.prev;){if(a.i!==s.i&&hHe(a,s)){let c=Pde(a,s);a=Zb(a,a.next),c=Zb(c,c.next),SD(a,t,n,i,r,o,0),SD(c,t,n,i,r,o,0);return}s=s.next}a=a.next}while(a!==e)}function oHe(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=Sde(e,s,c,i,!1);u===u.next&&(u.steiner=!0),r.push(dHe(u))}r.sort(aHe);for(let o=0;o<r.length;o++)n=sHe(r[o],n);return n}function aHe(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 sHe(e,t){let n=cHe(e,t);if(!n)return t;let i=Pde(n,e);return Zb(i,i.next),Zb(n,n.next)}function cHe(e,t){let n=t,i=e.x,r=e.y,o=-1/0,a;if(mE(e,n))return n;do{if(mE(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&&wde(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);wD(n,e)&&(d<f||d===f&&(n.x>a.x||n.x===a.x&&lHe(a,n)))&&(a=n,f=d)}n=n.next}while(n!==s);return a}function lHe(e,t){return ua(e.prev,e,t.prev)<0&&ua(t.next,e,e.next)<0}function uHe(e,t,n,i){let r=e;do r.z===0&&(r.z=xX(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,fHe(r)}function fHe(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 xX(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 dHe(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 wde(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 ED(e,t,n,i,r,o,a,s){return!(e===a&&t===s)&&wde(e,t,n,i,r,o,a,s)}function hHe(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!mHe(e,t)&&(wD(e,t)&&wD(t,e)&&pHe(e,t)&&(ua(e.prev,e,t.prev)||ua(e,t.prev,t))||mE(e,t)&&ua(e.prev,e,e.next)>0&&ua(t.prev,t,t.next)>0)}function ua(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function mE(e,t){return e.x===t.x&&e.y===t.y}function Ide(e,t,n,i){let r=jj(ua(e,t,n)),o=jj(ua(e,t,i)),a=jj(ua(n,i,e)),s=jj(ua(n,i,t));return!!(r!==o&&a!==s||r===0&&Vj(e,n,t)||o===0&&Vj(e,i,t)||a===0&&Vj(n,e,i)||s===0&&Vj(n,t,i))}function Vj(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 jj(e){return e>0?1:e<0?-1:0}function mHe(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&&Ide(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function wD(e,t){return ua(e.prev,e,e.next)<0?ua(e,t,e.next)>=0&&ua(e,e.prev,t)>=0:ua(e,t,e.prev)<0||ua(e,e.next,t)<0}function pHe(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 Pde(e,t){let n=TX(e.i,e.x,e.y),i=TX(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 Ede(e,t,n,i){let r=TX(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 ID(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 TX(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function gHe(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 PD={CLOCKWISE:ee.CW,COUNTER_CLOCKWISE:ee.CCW};PD.validate=function(e){return e===PD.CLOCKWISE||e===PD.COUNTER_CLOCKWISE};Object.freeze(PD);var Wa=PD;var _He=new h,yHe=new h,Sy={};Sy.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};Sy.computeWindingOrder2D=function(e){return Sy.computeArea2D(e)>0?Wa.COUNTER_CLOCKWISE:Wa.CLOCKWISE};Sy.triangulate=function(e,t){let n=z.packArray(e);return CX(n,t,2)};var Mde=new h,Lde=new h,Nde=new h,Dde=new h,Rde=new h,Ode=new h,ng=new h,Fde=new z,Bde=new z,kde=new z,pE=new z;Sy.computeSubdivision=function(e,t,n,i,r){r=r??D.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=D.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,Mde),P=h.fromArray(u,C*3,Lde),R=h.fromArray(u,T*3,Nde),O,N,_;o&&(O=z.fromArray(f,E*2,Fde),N=z.fromArray(f,C*2,Bde),_=z.fromArray(f,T*2,kde));let v=h.multiplyByScalar(h.normalize(w,Dde),y,Dde),S=h.multiplyByScalar(h.normalize(P,Rde),y,Rde),I=h.multiplyByScalar(h.normalize(R,Ode),y,Ode),M=h.magnitudeSquared(h.subtract(v,S,ng)),F=h.magnitudeSquared(h.subtract(S,I,ng)),V=h.magnitudeSquared(h.subtract(I,v,ng)),k=Math.max(M,F,V),j,B,G;k>b?M===k?(j=`${Math.min(E,C)} ${Math.max(E,C)}`,s=m[j],l(s)||(B=h.add(w,P,ng),h.multiplyByScalar(B,.5,B),u.push(B.x,B.y,B.z),s=u.length/3-1,m[j]=s,o&&(G=z.add(O,N,pE),z.multiplyByScalar(G,.5,G),f.push(G.x,G.y))),a.push(E,s,T),a.push(s,C,T)):F===k?(j=`${Math.min(C,T)} ${Math.max(C,T)}`,s=m[j],l(s)||(B=h.add(P,R,ng),h.multiplyByScalar(B,.5,B),u.push(B.x,B.y,B.z),s=u.length/3-1,m[j]=s,o&&(G=z.add(N,_,pE),z.multiplyByScalar(G,.5,G),f.push(G.x,G.y))),a.push(C,s,E),a.push(s,T,E)):V===k&&(j=`${Math.min(T,E)} ${Math.max(T,E)}`,s=m[j],l(s)||(B=h.add(R,w,ng),h.multiplyByScalar(B,.5,B),u.push(B.x,B.y,B.z),s=u.length/3-1,m[j]=s,o&&(G=z.add(_,O,pE),z.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 xt(x)};var AHe=new de,bHe=new de,xHe=new de,vX=new de;Sy.computeRhumbLineSubdivision=function(e,t,n,i,r){r=r??D.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=D.chordLength(r,y),b=new Dc(void 0,void 0,e),x=new Dc(void 0,void 0,e),T=new Dc(void 0,void 0,e);for(;a.length>0;){let E=a.pop(),w=a.pop(),P=a.pop(),R=h.fromArray(u,P*3,Mde),O=h.fromArray(u,w*3,Lde),N=h.fromArray(u,E*3,Nde),_,v,S;o&&(_=z.fromArray(f,P*2,Fde),v=z.fromArray(f,w*2,Bde),S=z.fromArray(f,E*2,kde));let I=e.cartesianToCartographic(R,AHe),M=e.cartesianToCartographic(O,bHe),F=e.cartesianToCartographic(N,xHe);b.setEndPoints(I,M);let V=b.surfaceDistance;x.setEndPoints(M,F);let k=x.surfaceDistance;T.setEndPoints(F,I);let j=T.surfaceDistance,B=Math.max(V,k,j),G,W,Q,q,J;B>A?V===B?(G=`${Math.min(P,w)} ${Math.max(P,w)}`,s=m[G],l(s)||(W=b.interpolateUsingFraction(.5,vX),Q=(I.height+M.height)*.5,q=h.fromRadians(W.longitude,W.latitude,Q,e,ng),u.push(q.x,q.y,q.z),s=u.length/3-1,m[G]=s,o&&(J=z.add(_,v,pE),z.multiplyByScalar(J,.5,J),f.push(J.x,J.y))),a.push(P,s,E),a.push(s,w,E)):k===B?(G=`${Math.min(w,E)} ${Math.max(w,E)}`,s=m[G],l(s)||(W=x.interpolateUsingFraction(.5,vX),Q=(M.height+F.height)*.5,q=h.fromRadians(W.longitude,W.latitude,Q,e,ng),u.push(q.x,q.y,q.z),s=u.length/3-1,m[G]=s,o&&(J=z.add(v,S,pE),z.multiplyByScalar(J,.5,J),f.push(J.x,J.y))),a.push(w,s,P),a.push(s,E,P)):j===B&&(G=`${Math.min(E,P)} ${Math.max(E,P)}`,s=m[G],l(s)||(W=T.interpolateUsingFraction(.5,vX),Q=(F.height+I.height)*.5,q=h.fromRadians(W.longitude,W.latitude,Q,e,ng),u.push(q.x,q.y,q.z),s=u.length/3-1,m[G]=s,o&&(J=z.add(S,_,pE),z.multiplyByScalar(J,.5,J),f.push(J.x,J.y))),a.push(E,s,w),a.push(s,P,w)):(g.push(P),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 xt(C)};Sy.scaleToGeodeticHeight=function(e,t,n,i){n=n??te.default;let r=_He,o=yHe;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=Sy;function wy(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(wy.prototype,{length:{get:function(){return this._length}}});wy.prototype.enqueue=function(e){this._array.push(e),this._length++};wy.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};wy.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};wy.prototype.contains=function(e){return this._array.indexOf(e)!==-1};wy.prototype.clear=function(){this._array.length=this._offset=this._length=0};wy.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)};var Iy=wy;var vo={};vo.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};vo.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};vo.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]=vo.unpackPolygonHierarchy(e,t,n),t=a[s].startingIndex,delete a[s].startingIndex;return{positions:o,holes:a,startingIndex:t}};var Qb=new z;function Vde(e,t,n,i){return z.subtract(t,e,Qb),z.multiplyByScalar(Qb,n/i,Qb),z.add(e,Qb,Qb),[Qb.x,Qb.y]}var Py=new h;function THe(e,t,n,i){return h.subtract(t,e,Py),h.multiplyByScalar(Py,n/i,Py),h.add(e,Py,Py),[Py.x,Py.y,Py.z]}vo.subdivideLineCount=function(e,t,n){let r=h.distance(e,t)/n,o=Math.max(0,Math.ceil(D.log2(r)));return Math.pow(2,o)};var Gj=new de,Wj=new de,CHe=new de,vHe=new h,Hj=new Dc;vo.subdivideRhumbLineCount=function(e,t,n,i){let r=e.cartesianToCartographic(t,Gj),o=e.cartesianToCartographic(n,Wj),s=new Dc(r,o,e).surfaceDistance/i,c=Math.max(0,Math.ceil(D.log2(s)));return Math.pow(2,c)};vo.subdivideTexcoordLine=function(e,t,n,i,r,o){let a=vo.subdivideLineCount(n,i,r),s=z.distance(e,t),c=s/a,u=o;u.length=a*2;let f=0;for(let d=0;d<a;d++){let p=Vde(e,t,d*c,s);u[f++]=p[0],u[f++]=p[1]}return u};vo.subdivideLine=function(e,t,n,i){let r=vo.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=THe(e,t,u*a,o);s[c++]=f[0],s[c++]=f[1],s[c++]=f[2]}return s};vo.subdivideTexcoordRhumbLine=function(e,t,n,i,r,o,a){let s=n.cartesianToCartographic(i,Gj),c=n.cartesianToCartographic(r,Wj);Hj.setEndPoints(s,c);let u=Hj.surfaceDistance/o,f=Math.max(0,Math.ceil(D.log2(u))),d=Math.pow(2,f),p=z.distance(e,t),g=p/d,m=a;m.length=d*2;let y=0;for(let A=0;A<d;A++){let b=Vde(e,t,A*g,p);m[y++]=b[0],m[y++]=b[1]}return m};vo.subdivideRhumbLine=function(e,t,n,i,r){let o=e.cartesianToCartographic(t,Gj),a=e.cartesianToCartographic(n,Wj),s=new Dc(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(D.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,CHe),A=e.cartographicToCartesian(y,vHe);p[g++]=A.x,p[g++]=A.y,p[g++]=A.z}return p};var EHe=new h,SHe=new h,wHe=new h,IHe=new h;vo.scaleToGeodeticHeightExtruded=function(e,t,n,i,r){i=i??te.default;let o=EHe,a=SHe,s=wHe,c=IHe;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};vo.polygonOutlinesFromHierarchy=function(e,t,n){let i=[],r=new Iy;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 PHe=new de;function DHe(e,t,n){let i=n.cartesianToCartographic(e,Gj),r=n.cartesianToCartographic(t,Wj);if(Math.sign(i.latitude)===Math.sign(r.latitude))return;Hj.setEndPoints(i,r);let o=Hj.findIntersectionWithLatitude(0,PHe);if(!l(o))return;let a=Math.min(i.longitude,r.longitude),s=Math.max(i.longitude,r.longitude);if(Math.abs(s-a)>D.PI){let c=a;a=s,s=c}if(!(o.longitude<a||o.longitude>s))return n.cartographicToCartesian(o)}function RHe(e,t,n,i){if(i===sn.RHUMB)return DHe(e,t,n);let r=ci.lineSegmentPlane(e,t,en.ORIGIN_XY_PLANE);if(l(r))return n.scaleToGeodeticSurface(r,r)}var OHe=new de;function MHe(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=D.sign(r.z),s=D.sign(o.z);let f=d=>t.cartesianToCartographic(d,OHe).longitude;if(a===0)i.push({position:u,type:a,visited:!1,next:s,theta:f(r)});else if(s!==0){if(c=RHe(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 jde(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=jde(e,t+1,n,i,0,d,!a);return t}vo.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=MHe(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=jde(i,r,a,s,1,0,c)}return i};vo.polygonsFromHierarchy=function(e,t,n,i,r,o){let a=[],s=[],c=new Iy;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===Wa.CLOCKWISE&&(y.reverse(),d=d.slice().reverse()),u){u=!1;let w=[d];if(w=o(w,w),w.length>1){for(let P of w)c.enqueue(new Rc(P,p));continue}}let x=d.slice(),T=l(p)?p.length:0,C=[],E;for(g=0;g<T;g++){let w=p[g],P=w.positions;if(i)for(m=P.length,E=0;E<m;++E)r.scaleToGeodeticSurface(P[E],P[E]);if(t||(P=Pr(P,h.equalsEpsilon,!0)),P.length<3)continue;let R=n(P);if(!l(R))continue;b=li.computeWindingOrder2D(R),b===Wa.CLOCKWISE&&(R.reverse(),P=P.slice().reverse()),C.push(P),A.push(x.length),x=x.concat(P),y=y.concat(R);let O=0;for(l(w.holes)&&(O=w.holes.length),E=0;E<O;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 LHe=new z,NHe=new h,FHe=new Fe,BHe=new $;vo.computeBoundingRectangle=function(e,t,n,i,r){let o=Fe.fromAxisAngle(e,i,FHe),a=$.fromQuaternion(o,BHe),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],NHe);$.multiplyByVector(a,g,g);let m=t(g,LHe);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};vo.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:z.packArray(f)}));let y=new xt(m);return o.normal?Hn.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 zde=[],Ude=[],kHe=new h,zHe=new h;vo.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=D.chordLength(i,n.maximumRadius),O=0;if(o===sn.GEODESIC)for(c=0;c<y;c++)O+=vo.subdivideLineCount(e[c],e[(c+1)%y],R);else if(o===sn.RHUMB)for(c=0;c<y;c++)O+=vo.subdivideRhumbLineCount(n,e[c],e[(c+1)%y],R);for(s=(O+y)*3,a=new Array(s*2),x&&(m=(O+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=vo.subdivideLine(u,f,R,Ude),x&&(_=vo.subdivideTexcoordLine(d,p,u,f,R,zde))):o===sn.RHUMB&&(N=vo.subdivideRhumbLine(n,u,f,R,Ude),x&&(_=vo.subdivideTexcoordRhumbLine(d,p,n,u,f,R,zde)));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 I=0;I<S;++I,++b)g[b]=_[I],g[b+m]=_[I];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,O=R+1,N=R+y,_=N+1;u=h.fromArray(a,R*3,kHe),f=h.fromArray(a,O*3,zHe),!h.equalsEpsilon(u,f,D.EPSILON10,D.EPSILON10)&&(C[E++]=R,C[E++]=N,C[E++]=O,C[E++]=O,C[E++]=N,C[E++]=_)}let w={attributes:new bn({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 xt(w)};var $n=vo;var UHe=new h,VHe=new Je,jHe=new z,HHe=new z,GHe=new h,WHe=new h,qHe=new h,DD=new h,YHe=new h,XHe=new h,Hde=new Fe,KHe=new $,$He=new $,JHe=new h;function ZHe(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=KHe;if(i!==0){let _=Fe.fromAxisAngle(a,i,Hde);if(p=$.fromQuaternion(_,p),t.tangent||t.bitangent){_=Fe.fromAxisAngle(a,-i,Hde);let v=$.fromQuaternion(_,$He);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=HHe;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,P=0,R=0,O=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[O++]=r.positions[_].x,C[O++]=r.positions[_].y;else{let S=$.multiplyByVector(p,v,UHe),I=o(S,jHe);z.subtract(I,g,I);let M=D.clamp(I.x/n.width,0,1),F=D.clamp(I.y/n.height,0,1);C[O++]=M,C[O++]=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[P++]=c.x,T[P++]=c.y,T[P++]=c.z)}let N=new bn;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 xt({attributes:N,indices:d,primitiveType:Re.TRIANGLES})}function ex(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,z):1)+2}ex.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 ex(t)};ex.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,z):t[n++]=-1,t[n]=e.packedLength,t};var QHe=te.clone(te.UNIT_SPHERE),eGe=new Be,tGe={polygonHierarchy:{}};ex.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,QHe);t+=te.packedLength;let o=Be.unpack(e,t,eGe);t+=Be.packedLength;let a=e[t++],s=e[t]===-1?void 0:$n.unpackPolygonHierarchy(e,t,z);l(s)?(t=s.startingIndex,delete s.startingIndex):t++;let c=e[t];return l(n)||(n=new ex(tGe)),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};ex.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=GHe,c=WHe,u=qHe,f=YHe,d=XHe;if(!eg.computeProjectTo2DArguments(a,DD,f,d))return;if(s=h.cross(f,d,s),s=h.normalize(s,s),!h.equalsEpsilon(DD,h.ZERO,D.EPSILON6)){let O=e._ellipsoid.geodeticSurfaceNormal(DD,JHe);h.dot(s,O)<0&&(s=h.negate(s,s),f=h.negate(f,f))}let g=eg.createProjectPointsTo2DFunction(DD,f,d),m=eg.createProjectPointTo2DFunction(DD,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(O){return O},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,VHe),w=[];for(let O=0;O<b.length;O++){let N=new Nt({geometry:ZHe(b[O],t,E,i,o?T[O]:void 0,m,s,c,u)});w.push(N)}let P=Hn.combineInstances(w)[0];P.attributes.position.values=new Float64Array(P.attributes.position.values),P.indices=Ve.createTypedArray(P.attributes.position.values.length/3,P.indices);let R=P.attributes;return t.position||delete R.position,new xt({attributes:R,indices:P.indices,primitiveType:P.primitiveType,boundingSphere:C})};var RD=ex;function nGe(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 bn({position:new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:n})});return new xt({attributes:a,indices:i,primitiveType:Re.LINES})}function tx(e){e=e??H.EMPTY_OBJECT;let t=e.polygonHierarchy;this._polygonHierarchy=t,this._workerName="createCoplanarPolygonOutlineGeometry",this.packedLength=$n.computeHierarchyPackedLength(t,h)+1}tx.fromPositions=function(e){e=e??H.EMPTY_OBJECT;let t={polygonHierarchy:{positions:e.positions}};return new tx(t)};tx.pack=function(e,t,n){return n=n??0,n=$n.packPolygonHierarchy(e._polygonHierarchy,t,n,h),t[n]=e.packedLength,t};var iGe={polygonHierarchy:{}};tx.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 tx(iGe)),n._polygonHierarchy=i,n.packedLength=r,n};tx.createGeometry=function(e){let t=e._polygonHierarchy,n=t.positions;if(n=Pr(n,h.equalsEpsilon,!0),n.length<3||!eg.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 Nt({geometry:nGe(r[c])});o.push(u)}let a=Hn.combineInstances(o)[0],s=se.fromPoints(t.positions);return new xt({attributes:a.attributes,indices:a.indices,primitiveType:a.primitiveType,boundingSphere:s})};var Sd=tx;var Gde={ROUNDED:0,MITERED:1,BEVELED:2};Object.freeze(Gde);var Zi=Gde;function rGe(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,P=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=P}function oGe(e,t){return e*t*(4+e*(4-3*t))/16}function Wde(e,t,n,i,r,o,a){let s=oGe(e,n);return(1-s)*e*t*(i+s*r*(a+s*o*(2*a*a-1)))}function aGe(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,P,R,O,N,_;do{E=Math.cos(T),w=Math.sin(T);let B=A-x*E;O=Math.sqrt(g*g*w*w+B*B),R=b+y*E,P=Math.atan2(O,R);let G;O===0?(G=0,N=1):(G=y*w/O,N=1-G*G),C=T,_=R-2*b/N,isFinite(_)||(_=0),T=c+Wde(s,G,N,P,O,R,_)}while(Math.abs(T-C)>D.EPSILON12);let v=N*(t*t-n*n)/(n*n),S=1+v*(4096+v*(v*(320-175*v)-768))/16384,I=v*(256+v*(v*(74-47*v)-128))/1024,M=_*_,F=I*O*(_+I*(R*(2*M-1)-I*_*(4*O*O-3)*(4*M-3)/6)/4),V=n*S*(P-F),k=Math.atan2(g*w,A-x*E),j=Math.atan2(d*w,A*E-x);e._distance=V,e._startHeading=k,e._endHeading=j,e._uSquared=v}var sGe=new h,EX=new h;function qde(e,t,n,i){let r=h.normalize(i.cartographicToCartesian(t,EX),sGe),o=h.normalize(i.cartographicToCartesian(n,EX),EX);aGe(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,rGe(e)}function OD(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)&&qde(this,e,t,i)}Object.defineProperties(OD.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}}});OD.prototype.setEndPoints=function(e,t){qde(this,e,t,this._ellipsoid)};OD.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)};OD.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),P=n.cosineU*w,R=n.sineU*E,N=Math.atan2(E*n.sineHeading,P-R*n.cosineHeading)-Wde(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 ig=OD;var Ll={};Ll.numberOfPoints=function(e,t,n){let i=h.distance(e,t);return Math.ceil(i/n)};Ll.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 cGe=new de;Ll.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,cGe).height}return i};var lGe=new L,uGe=new h,Yde=new h,fGe=new en(h.UNIT_X,0),Xde=new h,dGe=new en(h.UNIT_X,0),hGe=new h,mGe=new h,wX=[];function $de(e,t,n){let i=wX;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 Yj=new de,qj=new de,Dy=new h,IX=new h,pGe=new h,SX=new ig,MD=new Dc;function gGe(e,t,n,i,r,o,a,s){let c=i.scaleToGeodeticSurface(e,IX),u=i.scaleToGeodeticSurface(t,pGe),f=Ll.numberOfPoints(e,t,n),d=i.cartesianToCartographic(c,Yj),p=i.cartesianToCartographic(u,qj),g=$de(f,r,o);SX.setEndPoints(d,p);let m=SX.surfaceDistance/f,y=s;d.height=r;let A=i.cartographicToCartesian(d,Dy);h.pack(A,a,y),y+=3;for(let b=1;b<f;b++){let x=SX.interpolateUsingSurfaceDistance(b*m,qj);x.height=g[b],A=i.cartographicToCartesian(x,Dy),h.pack(A,a,y),y+=3}return y}function _Ge(e,t,n,i,r,o,a,s){let c=i.cartesianToCartographic(e,Yj),u=i.cartesianToCartographic(t,qj),f=Ll.numberOfPointsRhumbLine(c,u,n);c.height=0,u.height=0;let d=$de(f,r,o);MD.ellipsoid.equals(i)||(MD=new Dc(void 0,void 0,i)),MD.setEndPoints(c,u);let p=MD.surfaceDistance/f,g=s;c.height=r;let m=i.cartographicToCartesian(c,Dy);h.pack(m,a,g),g+=3;for(let y=1;y<f;y++){let A=MD.interpolateUsingSurfaceDistance(y*p,qj);A.height=d[y],m=i.cartographicToCartesian(A,Dy),h.pack(m,a,g),g+=3}return g}Ll.wrapLongitude=function(e,t){let n=[],i=[];if(l(e)&&e.length>0){t=t??L.IDENTITY;let r=L.inverseTransformation(t,lGe),o=L.multiplyByPoint(r,h.ZERO,uGe),a=h.normalize(L.multiplyByPointAsVector(r,h.UNIT_Y,Yde),Yde),s=en.fromPointNormal(o,a,fGe),c=h.normalize(L.multiplyByPointAsVector(r,h.UNIT_X,Xde),Xde),u=en.fromPointNormal(o,c,dGe),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(en.getPointDistance(u,d)<0||en.getPointDistance(u,m)<0){let y=ci.lineSegmentPlane(d,m,s,hGe);if(l(y)){let A=h.multiplyByScalar(a,5e-9,mGe);en.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}};Ll.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],IX);if(r=o?r[0]:r,r!==0){let A=i.geodeticSurfaceNormal(y,Dy);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??D.RADIANS_PER_DEGREE;a=D.chordLength(y,i.maximumRadius)}let s=0,c;for(c=0;c<n-1;c++)s+=Ll.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=gGe(y,A,a,i,b,x,f,d)}wX.length=0;let p=t[n-1],g=i.cartesianToCartographic(p,Yj);g.height=o?r[n-1]:r;let m=i.cartographicToCartesian(g,Dy);return h.pack(m,f,u-3),f};var Kde=new de,yGe=new de;Ll.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],IX);if(r=o?r[0]:r,r!==0){let x=i.geodeticSurfaceNormal(b,Dy);h.multiplyByScalar(x,r,x),h.add(b,x,b)}return[b.x,b.y,b.z]}let a=e.granularity??D.RADIANS_PER_DEGREE,s=0,c,u=i.cartesianToCartographic(t[0],Kde),f;for(c=0;c<n-1;c++)f=i.cartesianToCartographic(t[c+1],yGe),s+=Ll.numberOfPointsRhumbLine(u,f,a),u=de.clone(f,Kde);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=_Ge(b,x,a,i,T,C,p,g)}wX.length=0;let m=t[n-1],y=i.cartesianToCartographic(m,Yj);y.height=o?r[n-1]:r;let A=i.cartographicToCartesian(y,Dy);return h.pack(A,p,d-3),p};Ll.generateCartesianArc=function(e){let t=Ll.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};Ll.generateCartesianRhumbArc=function(e){let t=Ll.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 Qi=Ll;var oc=[new h,new h],AGe=new h,bGe=new h,xGe=new h,TGe=new h,CGe=new h,vGe=new h,EGe=new h,SGe=new h,wGe=new h,gE=new h,Xj=new h,LD={},PX=new de;function IGe(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++){let r=e[i];PX=t.cartesianToCartographic(r,PX),n[i]=PX.height,e[i]=t.scaleToGeodeticSurface(r,r)}return n}function DX(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 Kj=new h,$j=new h;function PGe(e,t,n,i){let r=new Pa(n,i),o=r.projectPointOntoPlane(h.add(n,e,Kj),Kj),a=r.projectPointOntoPlane(h.add(n,t,$j),$j),s=z.angleBetween(o,a);return a.x*o.y-a.y*o.x>=0?-s:s}var DGe=new h(-1,0,0),nx=new L,RGe=new L,RX=new $,OGe=$.IDENTITY.clone(),MGe=new h,LGe=new ae,Jde=new h;function rg(e,t,n,i,r,o,a,s){let c=MGe,u=LGe;nx=mt.eastNorthUpToFixedFrame(e,r,nx),c=L.multiplyByPointAsVector(nx,DGe,c),c=h.normalize(c,c);let f=PGe(c,t,e,r);RX=$.fromRotationZ(f,RX),Jde.z=o,nx=L.multiplyTransformation(nx,L.fromRotationTranslation(RX,Jde,RGe),nx);let d=OGe;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=L.multiplyByPoint(nx,u,u),i.push(u.x,u.y,u.z);return i}var NGe=new h;function OX(e,t,n,i,r,o,a){for(let s=0;s<e.length;s+=3){let c=h.fromArray(e,s,NGe);i=rg(c,t,n,i,r,o[s/3],a,1)}return i}function FGe(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 Zde(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 Qde=new Fe,ehe=new h,the=new $;function nhe(e,t,n,i,r,o,a,s,c,u){let f=h.angleBetween(h.subtract(t,e,gE),h.subtract(n,e,Xj)),d=i===Zi.BEVELED?0:Math.ceil(f/D.toRadians(5)),p;r?p=$.fromQuaternion(Fe.fromAxisAngle(h.negate(e,gE),f/(d+1),Qde),the):p=$.fromQuaternion(Fe.fromAxisAngle(e,f/(d+1),Qde),the);let g,m;if(t=h.clone(t,ehe),d>0){let y=u?2:1;for(let A=0;A<d;A++)t=$.multiplyByVector(p,t,t),g=h.subtract(t,e,gE),g=h.normalize(g,g),r||(g=h.negate(g,g)),m=o.scaleToGeodeticSurface(t,Xj),a=rg(m,g,s,a,o,c,1,y)}else g=h.subtract(t,e,gE),g=h.normalize(g,g),r||(g=h.negate(g,g)),m=o.scaleToGeodeticSurface(t,Xj),a=rg(m,g,s,a,o,c,1,1),n=h.clone(n,ehe),g=h.subtract(n,e,gE),g=h.normalize(g,g),r||(g=h.negate(g,g)),m=o.scaleToGeodeticSurface(n,Xj),a=rg(m,g,s,a,o,c,1,1);return a}LD.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];z.equals(o,a)||n.push(a)}return n};LD.angleIsGreaterThanPi=function(e,t,n,i){let r=new Pa(n,i),o=r.projectPointOntoPlane(h.add(n,e,Kj),Kj),a=r.projectPointOntoPlane(h.add(n,t,$j),$j);return a.x*o.y-a.y*o.x>=0};var BGe=new h,kGe=new h;LD.computePositions=function(e,t,n,i,r){let o=i._ellipsoid,a=IGe(e,o),s=i._granularity,c=i._cornerType,u=r?FGe(t,n):Zde(t,n),f=r?Zde(t,n):void 0,d=n.height/2,p=n.width/2,g=e.length,m=[],y=r?[]:void 0,A=AGe,b=bGe,x=xGe,T=TGe,C=CGe,E=vGe,w=EGe,P=SGe,R=wGe,O=e[0],N=e[1];T=o.geodeticSurfaceNormal(O,T),A=h.subtract(N,O,A),A=h.normalize(A,A),P=h.cross(T,A,P),P=h.normalize(P,P);let _=a[0],v=a[1];r&&(y=rg(O,P,f,y,o,_+d,1,1)),R=h.clone(O,R),O=N,b=h.negate(A,b);let S,I;for(let V=1;V<g-1;V++){let k=r?2:1;if(N=e[V+1],O.equals(N)){pt("Positions are too close and are considered equivalent with rounding error.");continue}A=h.subtract(N,O,A),A=h.normalize(A,A),T=o.geodeticSurfaceNormal(O,T);let j=h.multiplyByScalar(T,h.dot(A,T),BGe);h.subtract(A,j,j),h.normalize(j,j);let B=h.multiplyByScalar(T,h.dot(b,T),kGe);if(h.subtract(b,B,B),h.normalize(B,B),!D.equalsEpsilon(Math.abs(h.dot(j,B)),1,D.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,gE))),Q=LD.angleIsGreaterThanPi(A,b,O,o);Q?(C=h.add(O,h.multiplyByScalar(x,W*p,x),C),E=h.add(C,h.multiplyByScalar(P,p,E),E),oc[0]=h.clone(R,oc[0]),oc[1]=h.clone(E,oc[1]),S=DX(oc,_+d,v+d,s),I=Qi.generateArc({positions:oc,granularity:s,ellipsoid:o}),m=OX(I,P,u,m,o,S,1),P=h.cross(T,A,P),P=h.normalize(P,P),w=h.add(C,h.multiplyByScalar(P,p,w),w),c===Zi.ROUNDED||c===Zi.BEVELED?nhe(C,E,w,c,Q,o,m,u,v+d,r):(x=h.negate(x,x),m=rg(O,x,u,m,o,v+d,W,k)),R=h.clone(w,R)):(C=h.add(O,h.multiplyByScalar(x,W*p,x),C),E=h.add(C,h.multiplyByScalar(P,-p,E),E),oc[0]=h.clone(R,oc[0]),oc[1]=h.clone(E,oc[1]),S=DX(oc,_+d,v+d,s),I=Qi.generateArc({positions:oc,granularity:s,ellipsoid:o}),m=OX(I,P,u,m,o,S,1),P=h.cross(T,A,P),P=h.normalize(P,P),w=h.add(C,h.multiplyByScalar(P,-p,w),w),c===Zi.ROUNDED||c===Zi.BEVELED?nhe(C,E,w,c,Q,o,m,u,v+d,r):m=rg(O,x,u,m,o,v+d,W,k),R=h.clone(w,R)),b=h.negate(A,b)}else m=rg(R,P,u,m,o,_+d,1,1),R=O;_=v,v=a[V+1],O=N}oc[0]=h.clone(R,oc[0]),oc[1]=h.clone(O,oc[1]),S=DX(oc,_+d,v+d,s),I=Qi.generateArc({positions:oc,granularity:s,ellipsoid:o}),m=OX(I,P,u,m,o,S,1),r&&(y=rg(O,P,f,y,o,v+d,1,1)),g=m.length;let M=r?g+y.length:g,F=new Float64Array(M);return F.set(m),r&&F.set(y,g),F};var jh=LD;var LX={},_E=new h,she=new h,zGe=new h,ihe=new h,Nl=[new h,new h],che=new h,lhe=new h,uhe=new h,UGe=new h,VGe=new h,jGe=new h,HGe=new h,GGe=new h,WGe=new h,qGe=new h,rhe=new Fe,ohe=new $;function Jj(e,t,n,i,r){let o=h.angleBetween(h.subtract(t,e,_E),h.subtract(n,e,she)),a=i===Zi.BEVELED?1:Math.ceil(o/D.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,_E),o/a,rhe),ohe):u=$.fromQuaternion(Fe.fromAxisAngle(e,o/a,rhe),ohe);let f=0;t=h.clone(t,_E);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 YGe(e){let t=che,n=lhe,i=uhe,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=Jj(t,n,i,Zi.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=Jj(t,n,i,Zi.ROUNDED,!1);return[o,c]}function ahe(e,t,n,i){let r=_E;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 MX(e,t,n,i){let r=new Array(e.length),o=new Array(e.length),a=h.multiplyByScalar(t,n,_E),s=h.negate(a,she),c=0,u=e.length-1;for(let f=0;f<e.length;f+=3){let d=h.fromArray(e,f,zGe),p=h.add(d,s,ihe);r[c++]=p.x,r[c++]=p.y,r[c++]=p.z;let g=h.add(d,a,ihe);o[u--]=g.z,o[u--]=g.y,o[u--]=g.x}return i.push(r,o),i}LX.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 XGe=new h,KGe=new h;LX.computePositions=function(e){let t=e.granularity,n=e.positions,i=e.ellipsoid,r=e.width/2,o=e.cornerType,a=e.saveAttributes,s=che,c=lhe,u=uhe,f=UGe,d=VGe,p=jGe,g=HGe,m=GGe,y=WGe,A=qGe,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,P=[],R,O=n.length;for(R=1;R<O-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),XGe);h.subtract(c,_,_),h.normalize(_,_);let v=h.multiplyByScalar(s,h.dot(u,s),KGe);if(h.subtract(u,v,v),h.normalize(v,v),!D.equalsEpsilon(Math.abs(h.dot(_,v)),1,D.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 I=r/Math.max(.25,h.magnitude(h.cross(d,u,_E))),M=jh.angleIsGreaterThanPi(c,u,C,i);d=h.multiplyByScalar(d,I,d),M?(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),Nl[0]=h.clone(g,Nl[0]),Nl[1]=h.clone(A,Nl[1]),w=Qi.generateArc({positions:Nl,granularity:t,ellipsoid:i}),b=MX(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===Zi.ROUNDED||o===Zi.BEVELED?P.push({leftPositions:Jj(m,p,y,o,M)}):P.push({leftPositions:ahe(C,h.negate(d,d),y,M)})):(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),Nl[0]=h.clone(g,Nl[0]),Nl[1]=h.clone(A,Nl[1]),w=Qi.generateArc({positions:Nl,granularity:t,ellipsoid:i}),b=MX(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===Zi.ROUNDED||o===Zi.BEVELED?P.push({rightPositions:Jj(y,p,m,o,M)}):P.push({rightPositions:ahe(C,d,m,M)})),u=h.negate(c,u)}C=E}s=i.geodeticSurfaceNormal(C,s),Nl[0]=h.clone(g,Nl[0]),Nl[1]=h.clone(C,Nl[1]),w=Qi.generateArc({positions:Nl,granularity:t,ellipsoid:i}),b=MX(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===Zi.ROUNDED&&(N=YGe(b)),{positions:b,corners:P,lefts:x,normals:T,endPositions:N}};var ar=LX;var hhe=new h,mhe=new h,Zj=new h,Qj=new h,$Ge=new h,phe=new h,Ry=new h,yE=new h;function ghe(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,Ry),Ry);o.normal&&ar.addAttribute(a,t,i,r),o.tangent&&ar.addAttribute(s,u,i,r),o.bitangent&&ar.addAttribute(c,n,i,r)}function _he(e,t,n){let i=e.positions,r=e.corners,o=e.endPositions,a=e.lefts,s=e.normals,c=new bn,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,P=A-1,R,O,N,_,v=hhe,S=mhe,I,M,F=y/2,V=Ve.createTypedArray(A/3,p),k=0;if(m){M=Zj,I=Qj;let J=o[0];for(v=h.fromArray(s,0,v),S=h.fromArray(a,0,S),d=0;d<F;d++)M=h.fromArray(J,(F-1-d)*3,M),I=h.fromArray(J,(F+d)*3,I),ar.addAttribute(b,I,w),ar.addAttribute(b,M,void 0,P),Hh(E,v,S,w,P,t),O=w/3,_=O+1,R=(P-2)/3,N=R-1,V[k++]=R,V[k++]=O,V[k++]=N,V[k++]=N,V[k++]=O,V[k++]=_,w+=3,P-=3}let j=0,B=0,G=i[j++],W=i[j++];b.set(G,w),b.set(W,P-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,Ry),Ry),q=n.geodeticSurfaceNormal(h.fromArray(W,g-d,yE),yE),v=h.normalize(h.add(Q,q,v),v),Hh(E,v,S,w,P,t),O=w/3,_=O+1,R=(P-2)/3,N=R-1,V[k++]=R,V[k++]=O,V[k++]=N,V[k++]=N,V[k++]=O,V[k++]=_,w+=3,P-=3;for(Q=n.geodeticSurfaceNormal(h.fromArray(G,g,Ry),Ry),q=n.geodeticSurfaceNormal(h.fromArray(W,g,yE),yE),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=phe,ve=Zj,Ie=Qj;if(v=h.fromArray(s,B,v),l(ce)){for(Hh(E,v,S,void 0,P,t),P-=3,le=_,Ce=N,J=0;J<ce.length/3;J++)ye=h.fromArray(ce,J*3,ye),V[k++]=le,V[k++]=Ce-J-1,V[k++]=Ce-J,ar.addAttribute(b,ye,void 0,P),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,P,t),P-=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[k++]=le,V[k++]=Ce+J,V[k++]=Ce+J+1,ar.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,P,t),P-=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,P-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,Ry),Ry),q=n.geodeticSurfaceNormal(h.fromArray(W,g-J,yE),yE),v=h.normalize(h.add(Q,q,v),v),Hh(E,v,S,w,P,t),_=w/3,O=_-1,N=(P-2)/3,R=N+1,V[k++]=R,V[k++]=O,V[k++]=N,V[k++]=N,V[k++]=O,V[k++]=_,w+=3,P-=3;w-=3,P+=3}if(v=h.fromArray(s,s.length-3,v),Hh(E,v,S,w,P,t),m){w+=3,P-=3,M=Zj,I=Qj;let J=o[1];for(d=0;d<F;d++)M=h.fromArray(J,(y-d-1)*3,M),I=h.fromArray(J,d*3,I),ar.addAttribute(b,M,void 0,P),ar.addAttribute(b,I,w),Hh(E,v,S,w,P,t),_=w/3,O=_-1,N=(P-2)/3,R=N+1,V[k++]=R,V[k++]=O,V[k++]=N,V[k++]=N,V[k++]=O,V[k++]=_,w+=3,P-=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=D.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=D.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=D.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=D.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 JGe(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=hhe,m=mhe,y=Zj,A=Qj,b=$Ge,x=phe,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&&(ar.addAttribute(f,A,C),ar.addAttribute(f,A,C+3),ar.addAttribute(f,A,T),ar.addAttribute(f,A,T+3)),(t.tangent||t.bitangent)&&(x=h.fromArray(i,u,x),t.bitangent&&(ar.addAttribute(p,x,C),ar.addAttribute(p,x,C+3),ar.addAttribute(p,x,T),ar.addAttribute(p,x,T+3)),t.tangent&&(b=h.normalize(h.cross(x,A,b),b),ar.addAttribute(d,b,C),ar.addAttribute(d,b,C+3),ar.addAttribute(d,b,T),ar.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 NX(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 ZGe(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=ar.computePositions(e),o=_he(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=NX(f,0,m),g=li.scaleToGeodeticHeight(g,s,i),m=NX(g,d*2,m),p.set(f),p.set(g,d),p.set(m,d*2),c.position.values=p,c=JGe(c,t);let y,A=d/3;if(e.shadowVolume){let O=c.normal.values;d=O.length;let N=new Float32Array(d*6);for(y=0;y<d;y++)O[y]=-O[y];N.set(O,d),N=NX(O,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 O=new Uint8Array(A*6);if(e.offsetAttribute===hn.TOP)O=O.fill(1,0,A).fill(1,A*2,A*4);else{let N=e.offsetAttribute===hn.NONE?0:1;O=O.fill(N)}c.applyOffset=new Me({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:O})}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 O=u[y],N=u[y+1],_=u[y+2];T[C++]=_+A,T[C++]=N+A,T[C++]=O+A}let E,w,P,R;for(y=0;y<x;y+=2)E=y+x,w=E+x,P=E+1,R=w+1,T[C++]=E,T[C++]=w,T[C++]=P,T[C++]=P,T[C++]=w,T[C++]=R;return{attributes:c,indices:T}}var fhe=new h,ND=new h,Id=new de;function dhe(e,t,n,i,r,o){let a=h.subtract(t,e,fhe);h.normalize(a,a);let s=n.geodeticSurfaceNormal(e,ND),c=h.cross(a,s,fhe);h.multiplyByScalar(c,i,c);let u=r.latitude,f=r.longitude,d=o.latitude,p=o.longitude;h.add(e,c,ND),n.cartesianToCartographic(ND,Id);let g=Id.latitude,m=Id.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,ND),n.cartesianToCartographic(ND,Id),g=Id.latitude,m=Id.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 wd=new h,FD=new h,Iu=new de,Pu=new de;function yhe(e,t,n,i,r){e=ghe(e,t);let o=Pr(e,h.equalsEpsilon),a=o.length;if(a<2||n<=0)return new ie;let s=n*.5;Iu.latitude=Number.POSITIVE_INFINITY,Iu.longitude=Number.POSITIVE_INFINITY,Pu.latitude=Number.NEGATIVE_INFINITY,Pu.longitude=Number.NEGATIVE_INFINITY;let c,u;if(i===Zi.ROUNDED){let p=o[0];h.subtract(p,o[1],wd),h.normalize(wd,wd),h.multiplyByScalar(wd,s,wd),h.add(p,wd,FD),t.cartesianToCartographic(FD,Id),c=Id.latitude,u=Id.longitude,Iu.latitude=Math.min(Iu.latitude,c),Iu.longitude=Math.min(Iu.longitude,u),Pu.latitude=Math.max(Pu.latitude,c),Pu.longitude=Math.max(Pu.longitude,u)}for(let p=0;p<a-1;++p)dhe(o[p],o[p+1],t,s,Iu,Pu);let f=o[a-1];h.subtract(f,o[a-2],wd),h.normalize(wd,wd),h.multiplyByScalar(wd,s,wd),h.add(f,wd,FD),dhe(f,FD,t,s,Iu,Pu),i===Zi.ROUNDED&&(t.cartesianToCartographic(FD,Id),c=Id.latitude,u=Id.longitude,Iu.latitude=Math.min(Iu.latitude,c),Iu.longitude=Math.min(Iu.longitude,u),Pu.latitude=Math.max(Pu.latitude,c),Pu.longitude=Math.max(Pu.longitude,u));let d=l(r)?r:new ie;return d.north=Pu.latitude,d.south=Iu.latitude,d.east=Pu.longitude,d.west=Iu.longitude,d}function ag(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??Zi.ROUNDED,this._granularity=e.granularity??D.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}ag.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 Ahe=te.clone(te.UNIT_SPHERE),bhe=new Be,og={positions:void 0,ellipsoid:Ahe,vertexFormat:bhe,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0,offsetAttribute:void 0};ag.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,Ahe);t+=te.packedLength;let a=Be.unpack(e,t,bhe);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):(og.positions=r,og.width=s,og.height=c,og.extrudedHeight=u,og.cornerType=f,og.granularity=d,og.shadowVolume=p,og.offsetAttribute=g===-1?void 0:g,new ag(og))};ag.computeRectangle=function(e,t){e=e??H.EMPTY_OBJECT;let n=e.positions,i=e.width,r=e.ellipsoid??te.default,o=e.cornerType??Zi.ROUNDED;return yhe(n,r,i,o,t)};ag.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=ghe(t,i);let r=Pr(t,h.equalsEpsilon);if(r.length<2||n<=0)return;let o=e._height,a=e._extrudedHeight,s=!D.equalsEpsilon(o,a,0,D.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=ZGe(u,c);else{let g=ar.computePositions(u);if(f=_he(g,c,i),f.attributes.position.values=li.scaleToGeodeticHeight(f.attributes.position.values,o,i),l(e._offsetAttribute)){let m=e._offsetAttribute===hn.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 xt({attributes:d,indices:f.indices,primitiveType:Re.TRIANGLES,boundingSphere:p,offsetAttribute:e._offsetAttribute})};ag.createShadowVolume=function(e,t,n){let i=e._granularity,r=e._ellipsoid,o=t(i,r),a=n(i,r);return new ag({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(ag.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=yhe(this._positions,this._ellipsoid,this._width,this._cornerType)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return[0,0,0,1,1,0]}}});var ix=ag;var xhe=new h,The=new h,QGe=new h;function e5e(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function Che(e,t){let n=[],i=e.positions,r=e.corners,o=e.endPositions,a=new bn,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 M=r[f].leftPositions;l(M)?(p=M.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,P,R,O=m/2,N=Ve.createTypedArray(y/3,d+4),_=0;if(N[_++]=b/3,N[_++]=(x-2)/3,g){n.push(b/3),R=xhe,P=The;let M=o[0];for(f=0;f<O;f++)R=h.fromArray(M,(O-1-f)*3,R),P=h.fromArray(M,(O+f)*3,P),ar.addAttribute(A,P,b),ar.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++],I=i[v++];for(A.set(S,b),A.set(I,x-I.length+1),p=I.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 M;s=r[f];let F=s.leftPositions,V=s.rightPositions,k,j=QGe;if(l(F)){for(x-=3,k=E,n.push(w),M=0;M<F.length/3;M++)j=h.fromArray(F,M*3,j),N[_++]=k-M-1,N[_++]=k-M,ar.addAttribute(A,j,void 0,x),x-=3;n.push(k-Math.floor(F.length/6)),t===Zi.BEVELED&&n.push((x-2)/3+1),b+=3}else{for(b+=3,k=w,n.push(E),M=0;M<V.length/3;M++)j=h.fromArray(V,M*3,j),N[_++]=k+M,N[_++]=k+M+1,ar.addAttribute(A,j,b),b+=3;n.push(k+Math.floor(V.length/6)),t===Zi.BEVELED&&n.push(b/3-1),x-=3}for(S=i[v++],I=i[v++],S.splice(0,3),I.splice(I.length-3,3),A.set(S,b),A.set(I,x-I.length+1),M=0;M<I.length;M+=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=xhe,P=The;let M=o[1];for(f=0;f<O;f++)R=h.fromArray(M,(m-f-1)*3,R),P=h.fromArray(M,f*3,P),ar.addAttribute(A,R,void 0,x),ar.addAttribute(A,P,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 t5e(e){let t=e.ellipsoid,n=ar.computePositions(e),i=Che(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===hn.TOP)T=T.fill(1,0,f);else{let C=e.offsetAttribute===hn.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 BD(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??Zi.ROUNDED,this._granularity=e.granularity??D.RADIANS_PER_DEGREE,this._offsetAttribute=e.offsetAttribute,this._workerName="createCorridorOutlineGeometry",this.packedLength=1+t.length*h.packedLength+te.packedLength+6}BD.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 vhe=te.clone(te.UNIT_SPHERE),Oy={positions:void 0,ellipsoid:vhe,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,offsetAttribute:void 0};BD.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,vhe);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):(Oy.positions=r,Oy.width=a,Oy.height=s,Oy.extrudedHeight=c,Oy.cornerType=u,Oy.granularity=f,Oy.offsetAttribute=d===-1?void 0:d,new BD(Oy))};BD.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=e5e(t,i);let r=Pr(t,h.equalsEpsilon);if(r.length<2||n<=0)return;let o=e._height,a=e._extrudedHeight,s=!D.equalsEpsilon(o,a,0,D.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=t5e(c);else{let p=ar.computePositions(c);if(u=Che(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===hn.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 xt({attributes:f,indices:u.indices,primitiveType:Re.LINES,boundingSphere:d,offsetAttribute:e._offsetAttribute})};var kD=BD;function Pd(e){this.planes=e??[]}var zD=[new h,new h,new h];h.clone(h.UNIT_X,zD[0]);h.clone(h.UNIT_Y,zD[1]);h.clone(h.UNIT_Z,zD[2]);var My=new h,n5e=new h,Ehe=new en(new h(1,0,0),0);Pd.fromBoundingSphere=function(e,t){l(t)||(t=new Pd);let n=zD.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=zD[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,My),h.add(r,My,My),u.x=c.x,u.y=c.y,u.z=c.z,u.w=-h.dot(c,My),h.multiplyByScalar(c,o,My),h.add(r,My,My),f.x=-c.x,f.y=-c.y,f.z=-c.z,f.w=-h.dot(h.negate(c,n5e),My),a+=2}return t};Pd.prototype.computeVisibility=function(e){let t=this.planes,n=!1;for(let i=0,r=t.length;i<r;++i){let o=e.intersectPlane(en.fromCartesian4(t[i],Ehe));if(o===Xt.OUTSIDE)return Xt.OUTSIDE;o===Xt.INTERSECTING&&(n=!0)}return n?Xt.INTERSECTING:Xt.INSIDE};Pd.prototype.computeVisibilityWithPlaneMask=function(e,t){if(t===Pd.MASK_OUTSIDE||t===Pd.MASK_INSIDE)return t;let n=Pd.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(en.fromCartesian4(i[r],Ehe));if(s===Xt.OUTSIDE)return Pd.MASK_OUTSIDE;s===Xt.INTERSECTING&&(n|=a)}return n};Pd.MASK_OUTSIDE=4294967295;Pd.MASK_INSIDE=0;Pd.MASK_INDETERMINATE=2147483647;var qa=Pd;function AE(e){e=e??H.EMPTY_OBJECT,this._callback=e.callback,this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new Xi({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 St(n)),this._credit=n}Object.defineProperties(AE.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}}});AE.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 Sc({buffer:c,width:o,height:a})})};AE.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};AE.prototype.getTileDataAvailable=function(e,t,n){};AE.prototype.loadTileDataAvailability=function(e,t,n){};var FX=AE;var She={};She.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*D.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 rx=She;var BX=new z,i5e=new h,r5e=new h,o5e=new h,a5e=new h;function sg(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"}sg.packedLength=Be.packedLength+5;sg.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 whe=new Be,bE={vertexFormat:whe,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};sg.unpack=function(e,t,n){t=t??0;let i=Be.unpack(e,t,whe);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):(bE.length=r,bE.topRadius=o,bE.bottomRadius=a,bE.slices=s,bE.offsetAttribute=c===-1?void 0:c,new sg(bE))};sg.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=rx.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 P=r.tangent||r.bitangent,R=0,O=0,N=0,_=Math.atan2(i-n,t),v=i5e;v.z=Math.sin(_);let S=Math.cos(_),I=o5e,M=r5e;for(m=0;m<o;m++){let F=m/o*D.TWO_PI,V=S*Math.cos(F),k=S*Math.sin(F);y&&(v.x=V,v.y=k,P&&(I=h.normalize(h.cross(h.UNIT_Z,v,I),I)),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[O++]=I.x,p[O++]=I.y,p[O++]=I.z,p[O++]=I.x,p[O++]=I.y,p[O++]=I.z),r.bitangent&&(M=h.normalize(h.cross(v,I,M),M),g[N++]=M.x,g[N++]=M.y,g[N++]=M.z,g[N++]=M.x,g[N++]=M.y,g[N++]=M.z))}for(m=0;m<o;m++)r.normal&&(d[R++]=0,d[R++]=0,d[R++]=-1),r.tangent&&(p[O++]=1,p[O++]=0,p[O++]=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[O++]=1,p[O++]=0,p[O++]=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 P=Math.max(n,i);for(m=0;m<c;m++){let R=h.fromArray(u,m*3,a5e);f[C++]=(R.x+P)/(2*P),f[C++]=(R.y+P)/(2*P)}}let E=new bn;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})),BX.x=t*.5,BX.y=Math.max(i,n);let w=new se(h.ZERO,z.magnitude(BX));if(l(e._offsetAttribute)){t=u.length;let P=e._offsetAttribute===hn.NONE?0:1,R=new Uint8Array(t/3).fill(P);E.applyOffset=new Me({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:R})}return new xt({attributes:E,indices:b,primitiveType:Re.TRIANGLES,boundingSphere:w,offsetAttribute:e._offsetAttribute})};var kX;sg.getUnitCylinder=function(){return l(kX)||(kX=sg.createGeometry(new sg({topRadius:1,bottomRadius:1,length:1,vertexFormat:Be.POSITION_ONLY}))),kX};var UD=sg;var zX=new z;function xE(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"}xE.packedLength=6;xE.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 ox={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};xE.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):(ox.length=i,ox.topRadius=r,ox.bottomRadius=o,ox.slices=a,ox.numberOfVerticalLines=s,ox.offsetAttribute=c===-1?void 0:c,new xE(ox))};xE.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=rx.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 bn;g.position=new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:s}),zX.x=t*.5,zX.y=Math.max(i,n);let m=new se(h.ZERO,z.magnitude(zX));if(l(e._offsetAttribute)){t=s.length;let y=e._offsetAttribute===hn.NONE?0:1,A=new Uint8Array(t/3).fill(y);g.applyOffset=new Me({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:A})}return new xt({attributes:g,indices:f,primitiveType:Re.LINES,boundingSphere:m,offsetAttribute:e._offsetAttribute})};var VD=xE;function Ihe(e){this.proxy=e}Ihe.prototype.getURL=function(e){let t=this.proxy.indexOf("?")===-1?"?":"";return this.proxy+t+encodeURIComponent(e)};var UX=Ihe;function mf(e,t){e=e??0,this._near=e,t=t??Number.MAX_VALUE,this._far=t}Object.defineProperties(mf.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}}});mf.packedLength=2;mf.pack=function(e,t,n){return n=n??0,t[n++]=e.near,t[n]=e.far,t};mf.unpack=function(e,t,n){return t=t??0,l(n)||(n=new mf),n.near=e[t++],n.far=e[t],n};mf.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.far===t.far};mf.clone=function(e,t){if(l(e))return l(t)||(t=new mf),t.near=e.near,t.far=e.far,t};mf.prototype.clone=function(e){return mf.clone(this,e)};mf.prototype.equals=function(e){return mf.equals(this,e)};var jt=mf;function jD(e,t){e=e??0,t=t??Number.MAX_VALUE,this.value=new Float32Array([e,t])}Object.defineProperties(jD.prototype,{componentDatatype:{get:function(){return Y.FLOAT}},componentsPerAttribute:{get:function(){return 2}},normalize:{get:function(){return!1}}});jD.fromDistanceDisplayCondition=function(e){return new jD(e.near,e.far)};jD.toValue=function(e,t){return l(t)?(t[0]=e.near,t[1]=e.far,t):new Float32Array([e.near,e.far])};var Jn=jD;function HD(){this.head=void 0,this.tail=void 0,this._length=0}Object.defineProperties(HD.prototype,{length:{get:function(){return this._length}}});function s5e(e,t,n){this.item=e,this.previous=t,this.next=n}HD.prototype.add=function(e){let t=new s5e(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 Phe(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}HD.prototype.remove=function(e){l(e)&&(Phe(this,e),--this._length)};HD.prototype.splice=function(e,t){if(e===t)return;Phe(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 GD=HD;var er=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-er.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?er.Bounce.In(e*2)*.5:er.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}}}}),WD=function(){return performance.now()},c5e=(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=WD()),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})(),TE={Linear:function(e,t){var n=e.length-1,i=n*t,r=Math.floor(i),o=TE.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=TE.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=TE.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=TE.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}}},Dhe=(function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e})(),VX=new c5e,Rhe=(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=er.Linear.None,this._interpolationFunction=TE.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=Dhe.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=VX,VX.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=WD()),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=WD()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this)},e.prototype.resume=function(t){return t===void 0&&(t=WD()),!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=er.Linear.None),this._easingFunction=t,this},e.prototype.interpolation=function(t){return t===void 0&&(t=TE.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=WD()),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 Jun=Dhe.nextId,Pp=VX,Zun=Pp.getAll.bind(Pp),Qun=Pp.removeAll.bind(Pp),efn=Pp.add.bind(Pp),tfn=Pp.remove.bind(Pp),nfn=Pp.update.bind(Pp);var l5e={LINEAR_NONE:er.Linear.None,QUADRATIC_IN:er.Quadratic.In,QUADRATIC_OUT:er.Quadratic.Out,QUADRATIC_IN_OUT:er.Quadratic.InOut,CUBIC_IN:er.Cubic.In,CUBIC_OUT:er.Cubic.Out,CUBIC_IN_OUT:er.Cubic.InOut,QUARTIC_IN:er.Quartic.In,QUARTIC_OUT:er.Quartic.Out,QUARTIC_IN_OUT:er.Quartic.InOut,QUINTIC_IN:er.Quintic.In,QUINTIC_OUT:er.Quintic.Out,QUINTIC_IN_OUT:er.Quintic.InOut,SINUSOIDAL_IN:er.Sinusoidal.In,SINUSOIDAL_OUT:er.Sinusoidal.Out,SINUSOIDAL_IN_OUT:er.Sinusoidal.InOut,EXPONENTIAL_IN:er.Exponential.In,EXPONENTIAL_OUT:er.Exponential.Out,EXPONENTIAL_IN_OUT:er.Exponential.InOut,CIRCULAR_IN:er.Circular.In,CIRCULAR_OUT:er.Circular.Out,CIRCULAR_IN_OUT:er.Circular.InOut,ELASTIC_IN:er.Elastic.In,ELASTIC_OUT:er.Elastic.Out,ELASTIC_IN_OUT:er.Elastic.InOut,BACK_IN:er.Back.In,BACK_OUT:er.Back.Out,BACK_IN_OUT:er.Back.InOut,BOUNCE_IN:er.Bounce.In,BOUNCE_OUT:er.Bounce.Out,BOUNCE_IN_OUT:er.Bounce.InOut},fa=Object.freeze(l5e);var u5e=new h,f5e=new h,d5e=new h,h5e=new h,m5e=new h,p5e=new h(1,1,1),Ohe=Math.cos,Mhe=Math.sin;function cg(e){e=e??H.EMPTY_OBJECT;let t=e.radii??p5e,n=e.innerRadii??t,i=e.minimumClock??0,r=e.maximumClock??D.TWO_PI,o=e.minimumCone??0,a=e.maximumCone??D.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"}cg.packedLength=2*h.packedLength+Be.packedLength+7;cg.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 Lhe=new h,Nhe=new h,Fhe=new Be,Ly={radii:Lhe,innerRadii:Nhe,vertexFormat:Fhe,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};cg.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,Lhe);t+=h.packedLength;let r=h.unpack(e,t,Nhe);t+=h.packedLength;let o=Be.unpack(e,t,Fhe);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):(Ly.minimumClock=a,Ly.maximumClock=s,Ly.minimumCone=c,Ly.maximumCone=u,Ly.stackPartitions=f,Ly.slicePartitions=d,Ly.offsetAttribute=p===-1?void 0:p,new cg(Ly))};cg.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)/D.TWO_PI),u=Math.round(u*Math.abs(a-o)/D.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)%D.TWO_PI?(w=!0,b+=(u-1)*2+1):b+=1);let P=A*y*x,R=new Float64Array(P*3),O=new Array(P).fill(!1),N=new Array(P).fill(!1),_=c*u*x,v=6*(_+b+1-(c+u)*x),S=Ve.createTypedArray(_,v),I=s.normal?new Float32Array(P*3):void 0,M=s.tangent?new Float32Array(P*3):void 0,F=s.bitangent?new Float32Array(P*3):void 0,V=s.st?new Float32Array(P*2):void 0,k=new Array(y),j=new Array(y);for(f=0;f<y;f++)k[f]=Mhe(g[f]),j[f]=Ohe(g[f]);let B=new Array(A),G=new Array(A);for(d=0;d<A;d++)G[d]=Ohe(m[d]),B[d]=Mhe(m[d]);for(f=0;f<y;f++)for(d=0;d<A;d++)R[p++]=t.x*k[f]*G[d],R[p++]=t.y*k[f]*B[d],R[p++]=t.z*j[f];let W=P/2;if(T)for(f=0;f<y;f++)for(d=0;d<A;d++)R[p++]=n.x*k[f]*G[d],R[p++]=n.y*k[f]*B[d],R[p++]=n.z*j[f],O[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 Xe=y*A;for(f=1;f<y-2;f++)for(Q=Xe+f*A,q=Xe+(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 bn;s.position&&(ce.position=new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:R}));let Ae=0,le=0,Ce=0,ye=0,ve=P/2,Ie,Le=te.fromCartesian3(t),$e=te.fromCartesian3(n);if(s.st||s.normal||s.tangent||s.bitangent){for(f=0;f<P;f++){Ie=O[f]?$e:Le;let Xe=h.fromArray(R,f*3,u5e),At=Ie.geodeticSurfaceNormal(Xe,f5e);if(N[f]&&h.negate(At,At),s.st){let Ke=z.negate(At,m5e);V[Ae++]=Math.atan2(Ke.y,Ke.x)/D.TWO_PI+.5,V[Ae++]=Math.asin(At.z)/Math.PI+.5}if(s.normal&&(I[le++]=At.x,I[le++]=At.y,I[le++]=At.z),s.tangent||s.bitangent){let Ke=d5e,we=0,We;if(O[f]&&(we=ve),!C&&f>=we&&f<we+A*2?We=h.UNIT_X:We=h.UNIT_Z,h.cross(We,At,Ke),h.normalize(Ke,Ke),s.tangent&&(M[Ce++]=Ke.x,M[Ce++]=Ke.y,M[Ce++]=Ke.z),s.bitangent){let vt=h.cross(At,Ke,h5e);h.normalize(vt,vt),F[ye++]=vt.x,F[ye++]=vt.y,F[ye++]=vt.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:I})),s.tangent&&(ce.tangent=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:M})),s.bitangent&&(ce.bitangent=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:F}))}if(l(e._offsetAttribute)){let Xe=R.length,At=e._offsetAttribute===hn.NONE?0:1,Ke=new Uint8Array(Xe/3).fill(At);ce.applyOffset=new Me({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:Ke})}return new xt({attributes:ce,indices:S,primitiveType:Re.TRIANGLES,boundingSphere:se.fromEllipsoid(Le),offsetAttribute:e._offsetAttribute})};var jX;cg.getUnitEllipsoid=function(){return l(jX)||(jX=cg.createGeometry(new cg({radii:new h(1,1,1),vertexFormat:Be.POSITION_ONLY}))),jX};var Rs=cg;var g5e=new h(1,1,1),e6=Math.cos,t6=Math.sin;function CE(e){e=e??H.EMPTY_OBJECT;let t=e.radii??g5e,n=e.innerRadii??t,i=e.minimumClock??0,r=e.maximumClock??D.TWO_PI,o=e.minimumCone??0,a=e.maximumCone??D.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"}CE.packedLength=2*h.packedLength+8;CE.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 Bhe=new h,khe=new h,lg={radii:Bhe,innerRadii:khe,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};CE.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,Bhe);t+=h.packedLength;let r=h.unpack(e,t,khe);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):(lg.minimumClock=o,lg.maximumClock=a,lg.minimumCone=s,lg.maximumCone=c,lg.stackPartitions=u,lg.slicePartitions=f,lg.subdivisions=d,lg.offsetAttribute=p===-1?void 0:p,new CE(lg))};CE.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)/D.TWO_PI),f=Math.round(f*Math.abs(a-o)/D.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,P,R=0,O=new Array(f),N=new Array(f);for(C=0;C<f;C++)P=o+C*(a-o)/(f-1),O[C]=t6(P),N[C]=e6(P);let _=new Array(s),v=new Array(s);for(C=0;C<s;C++)w=i+C*(r-i)/(s-1),_[C]=t6(w),v[C]=e6(w);for(C=0;C<f;C++)for(E=0;E<s;E++)b[R++]=t.x*O[C]*v[E],b[R++]=t.y*O[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*O[C]*v[E],b[R++]=n.y*O[C]*_[E],b[R++]=n.z*N[C];for(O.length=s,N.length=s,C=0;C<s;C++)P=o+C*(a-o)/(s-1),O[C]=t6(P),N[C]=e6(P);for(_.length=u,v.length=u,C=0;C<u;C++)w=i+C*(r-i)/(u-1),_[C]=t6(w),v[C]=e6(w);for(C=0;C<s;C++)for(E=0;E<u;E++)b[R++]=t.x*O[C]*v[E],b[R++]=t.y*O[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*O[C]*v[E],b[R++]=n.y*O[C]*_[E],b[R++]=n.z*N[C];for(R=0,C=0;C<f*p;C++){let M=C*s;for(E=0;E<s-1;E++)T[R++]=M+E,T[R++]=M+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 M=f*s*p,F=M+s*u;if(m)for(C=0;C<u;C++)T[R++]=M+C,T[R++]=F+C;if(y)for(M+=s*u-u,F+=s*u-u,C=0;C<u;C++)T[R++]=M+C,T[R++]=F+C}let I=new bn({position:new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:b})});if(l(e._offsetAttribute)){let M=b.length,F=e._offsetAttribute===hn.NONE?0:1,V=new Uint8Array(M/3).fill(F);I.applyOffset=new Me({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:V})}return new xt({attributes:I,indices:T,primitiveType:Re.LINES,boundingSphere:se.fromEllipsoid(c),offsetAttribute:e._offsetAttribute})};var pf=CE;function vE(e){e=e??H.EMPTY_OBJECT,this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new Xi({ellipsoid:e.ellipsoid??te.default})),this._levelZeroMaximumGeometricError=Vr.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,64,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new be}Object.defineProperties(vE.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(){}}});vE.prototype.requestTileGeometry=function(e,t,n,i){return Promise.resolve(new Sc({buffer:new Uint8Array(256),width:16,height:16}))};vE.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};vE.prototype.getTileDataAvailable=function(e,t,n){};vE.prototype.loadTileDataAvailability=function(e,t,n){};var Dp=vE;function HX(){this._removalFunctions=[]}HX.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)}};HX.prototype.removeAll=function(){let e=this._removalFunctions;for(let t=0,n=e.length;t<n;++t)e[t]();e.length=0};var Lo=HX;var zhe={NONE:0,HOLD:1,EXTRAPOLATE:2};Object.freeze(zhe);var gf=zhe;function Rp(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 qa,this._orthographicMatrix=new L}function Uhe(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=L.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix))}Object.defineProperties(Rp.prototype,{projectionMatrix:{get:function(){return Uhe(this),this._orthographicMatrix}}});var _5e=new h,y5e=new h,A5e=new h,GX=new h;Rp.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,_5e);h.normalize(f,f);let d=y5e;h.multiplyByScalar(t,c,d),h.add(e,d,d);let p=A5e;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,GX),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,GX),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,GX),p),this._cullingVolume};Rp.prototype.getPixelDimensions=function(e,t,n,i,r){Uhe(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};Rp.prototype.clone=function(e){return l(e)||(e=new Rp),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};Rp.prototype.equals=function(e){return l(e)&&e instanceof Rp&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};Rp.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof Rp&&D.equalsEpsilon(this.right,e.right,t,n)&&D.equalsEpsilon(this.left,e.left,t,n)&&D.equalsEpsilon(this.top,e.top,t,n)&&D.equalsEpsilon(this.bottom,e.bottom,t,n)&&D.equalsEpsilon(this.near,e.near,t,n)&&D.equalsEpsilon(this.far,e.far,t,n)};var da=Rp;function Du(e){e=e??H.EMPTY_OBJECT,this._offCenterFrustum=new da,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}Du.packedLength=4;Du.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};Du.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Du),n.width=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t],n};function Ny(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(Du.prototype,{projectionMatrix:{get:function(){return Ny(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return Ny(this),this._offCenterFrustum}}});Du.prototype.computeCullingVolume=function(e,t,n){return Ny(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};Du.prototype.getPixelDimensions=function(e,t,n,i,r){return Ny(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,r)};Du.prototype.clone=function(e){return l(e)||(e=new Du),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};Du.prototype.equals=function(e){return!l(e)||!(e instanceof Du)?!1:(Ny(this),Ny(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};Du.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof Du)?!1:(Ny(this),Ny(e),D.equalsEpsilon(this.width,e.width,t,n)&&D.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var mn=Du;function Op(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 qa,this._perspectiveMatrix=new L,this._infinitePerspective=new L}function WX(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=L.computePerspectiveOffCenter(r,i,n,t,o,a,e._perspectiveMatrix),e._infinitePerspective=L.computeInfinitePerspectiveOffCenter(r,i,n,t,o,e._infinitePerspective))}Object.defineProperties(Op.prototype,{projectionMatrix:{get:function(){return WX(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return WX(this),this._infinitePerspective}}});var b5e=new h,x5e=new h,T5e=new h,C5e=new h;Op.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,b5e),d=x5e;h.multiplyByScalar(t,c,d),h.add(e,d,d);let p=T5e;h.multiplyByScalar(t,u,p),h.add(e,p,p);let g=C5e;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};Op.prototype.getPixelDimensions=function(e,t,n,i,r){WX(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};Op.prototype.clone=function(e){return l(e)||(e=new Op),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};Op.prototype.equals=function(e){return l(e)&&e instanceof Op&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};Op.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof Op&&D.equalsEpsilon(this.right,e.right,t,n)&&D.equalsEpsilon(this.left,e.left,t,n)&&D.equalsEpsilon(this.top,e.top,t,n)&&D.equalsEpsilon(this.bottom,e.bottom,t,n)&&D.equalsEpsilon(this.near,e.near,t,n)&&D.equalsEpsilon(this.far,e.far,t,n)};var Fl=Op;function Ru(e){e=e??H.EMPTY_OBJECT,this._offCenterFrustum=new Fl,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}Ru.packedLength=6;Ru.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};Ru.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Ru),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 Gh(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(Ru.prototype,{projectionMatrix:{get:function(){return Gh(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return Gh(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return Gh(this),this._fovy}},sseDenominator:{get:function(){return Gh(this),this._sseDenominator}},offCenterFrustum:{get:function(){return Gh(this),this._offCenterFrustum}}});Ru.prototype.computeCullingVolume=function(e,t,n){return Gh(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};Ru.prototype.getPixelDimensions=function(e,t,n,i,r){return Gh(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,r)};Ru.prototype.clone=function(e){return l(e)||(e=new Ru),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};Ru.prototype.equals=function(e){return!l(e)||!(e instanceof Ru)?!1:(Gh(this),Gh(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};Ru.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof Ru)?!1:(Gh(this),Gh(e),D.equalsEpsilon(this.fov,e.fov,t,n)&&D.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var Gi=Ru;var n6=0,v5e=1;function ax(e){let t=e.frustum,n=e.orientation,i=e.origin,r=e.vertexFormat??Be.DEFAULT,o=e._drawNearPlane??!0,a,s;t instanceof Gi?(a=n6,s=Gi.packedLength):t instanceof mn&&(a=v5e,s=mn.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}ax.pack=function(e,t,n){n=n??0;let i=e._frustumType,r=e._frustum;return t[n++]=i,i===n6?(Gi.pack(r,t,n),n+=Gi.packedLength):(mn.pack(r,t,n),n+=mn.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 E5e=new Gi,S5e=new mn,w5e=new Fe,I5e=new h,P5e=new Be;ax.unpack=function(e,t,n){t=t??0;let i=e[t++],r;i===n6?(r=Gi.unpack(e,t,E5e),t+=Gi.packedLength):(r=mn.unpack(e,t,S5e),t+=mn.packedLength);let o=h.unpack(e,t,I5e);t+=h.packedLength;let a=Fe.unpack(e,t,w5e);t+=Fe.packedLength;let s=Be.unpack(e,t,P5e);t+=Be.packedLength;let c=e[t]===1;if(!l(n))return new ax({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 EE(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 D5e=new $,R5e=new L,qX=new L,Vhe=new h,jhe=new h,Hhe=new h,O5e=new h,M5e=new h,L5e=new h,Fy=new Array(3),qD=new Array(4);qD[0]=new ae(-1,-1,1,1);qD[1]=new ae(1,-1,1,1);qD[2]=new ae(1,1,1,1);qD[3]=new ae(-1,1,1,1);var Ghe=new Array(4);for(let e=0;e<4;++e)Ghe[e]=new ae;ax._computeNearFarPlanes=function(e,t,n,i,r,o,a,s){let c=$.fromQuaternion(t,D5e),u=o??Vhe,f=a??jhe,d=s??Hhe;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=L.computeView(e,d,f,u,R5e),g,m,y=i.projectionMatrix;if(n===n6){let A=L.multiply(y,p,qX);m=L.inverse(A,qX)}else g=L.inverseTransformation(p,qX);l(m)?(Fy[0]=i.near,Fy[1]=i.far):(Fy[0]=0,Fy[1]=i.near,Fy[2]=i.far);for(let A=0;A<2;++A)for(let b=0;b<4;++b){let x=ae.clone(qD[b],Ghe[b]);if(l(m)){x=L.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,Fy[A]/C,x),h.add(x,e,x)}else{let T=i.offCenterFrustum;l(T)&&(i=T);let C=Fy[A],E=Fy[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,L.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}};ax.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);ax._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 bn({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=Vhe,b=jhe,x=Hhe,T=h.negate(A,O5e),C=h.negate(b,M5e),E=h.negate(x,L5e);u=0,o&&(EE(u,p,g,m,y,E,A,b),u+=12),EE(u,p,g,m,y,x,T,b),u+=12,EE(u,p,g,m,y,T,E,b),u+=12,EE(u,p,g,m,y,C,E,T),u+=12,EE(u,p,g,m,y,A,x,b),u+=12,EE(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 xt({attributes:f,indices:d,primitiveType:Re.TRIANGLES,boundingSphere:se.fromVertices(c)})};var sx=ax;var YX=0,N5e=1;function YD(e){let t=e.frustum,n=e.orientation,i=e.origin,r=e._drawNearPlane??!0,o,a;t instanceof Gi?(o=YX,a=Gi.packedLength):t instanceof mn&&(o=N5e,a=mn.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}YD.pack=function(e,t,n){n=n??0;let i=e._frustumType,r=e._frustum;return t[n++]=i,i===YX?(Gi.pack(r,t,n),n+=Gi.packedLength):(mn.pack(r,t,n),n+=mn.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 F5e=new Gi,B5e=new mn,k5e=new Fe,z5e=new h;YD.unpack=function(e,t,n){t=t??0;let i=e[t++],r;i===YX?(r=Gi.unpack(e,t,F5e),t+=Gi.packedLength):(r=mn.unpack(e,t,B5e),t+=mn.packedLength);let o=h.unpack(e,t,z5e);t+=h.packedLength;let a=Fe.unpack(e,t,k5e);t+=Fe.packedLength;let s=e[t]===1;if(!l(n))return new YD({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};YD.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,r=e._orientation,o=e._drawNearPlane,a=new Float64Array(24);sx._computeNearFarPlanes(i,r,t,n,a);let s=new bn({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 xt({attributes:s,indices:d,primitiveType:Re.LINES,boundingSphere:se.fromVertices(a)})};var XD=YD;var Whe={SEARCH:0,AUTOCOMPLETE:1};Object.freeze(Whe);var By=Whe;function i6(){pe.throwInstantiationError()}Object.defineProperties(i6.prototype,{credit:{get:pe.throwInstantiationError}});i6.getCreditsFromResult=function(e){if(l(e.attributions))return e.attributions.map(St.getIonCredit)};i6.prototype.geocode=pe.throwInstantiationError;var SE=i6;function qhe(){pe.throwInstantiationError()}qhe.createGeometry=function(e){pe.throwInstantiationError()};var XX=qhe;function U5e(e){e=e??H.EMPTY_OBJECT,this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=e.normalize??!1,this.value=e.value}var Kc=U5e;var q5e=Go(KX(),1);function V5e(e,t){return(e&t)!==0}var $c=V5e;var j5e=[1,2,4,8],Yhe=15,H5e=16,G5e=64,W5e=128;function Mp(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}Mp.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 Mp(e._bits,e.cnodeVersion,e.imageryVersion,e.terrainVersion,e.imageryProvider,e.terrainProvider),t.ancestorHasTerrain=e.ancestorHasTerrain,t.terrainState=e.terrainState,t};Mp.prototype.setParent=function(e){this.ancestorHasTerrain=e.ancestorHasTerrain||this.hasTerrain()};Mp.prototype.hasSubtree=function(){return $c(this._bits,H5e)};Mp.prototype.hasImagery=function(){return $c(this._bits,G5e)};Mp.prototype.hasTerrain=function(){return $c(this._bits,W5e)};Mp.prototype.hasChildren=function(){return $c(this._bits,Yhe)};Mp.prototype.hasChild=function(e){return $c(this._bits,j5e[e])};Mp.prototype.getChildBitmask=function(){return this._bits&Yhe};var $D=Mp;function Y5e(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 X5e=Y5e(`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 _f(e){this.imageryPresent=!0,this.protoImagery=void 0,this.terrainPresent=!0,this.negativeAltitudeExponentBias=32,this.negativeAltitudeThreshold=D.EPSILON12,this.providers={},this.key=void 0,this._resource=void 0,this._quadPacketVersion=1,this._tileInfo={},this._subtreePromises={}}Object.defineProperties(_f.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},resource:{get:function(){return this._resource}}});_f.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 _f;i._resource=n;try{await K5e(i),await i.getQuadTreePacket("",i._quadPacketVersion)}catch(r){let o=`An error occurred while accessing ${Khe(i,"",1).url}: ${r}`;throw new oe(o)}return i};_f.tileXYToQuadKey=function(e,t,n){let i="";for(let r=n;r>=0;--r){let o=1<<r,a=0;$c(t,o)?$c(e,o)&&(a|=1):(a|=2,$c(e,o)||(a|=1)),i+=a}return i};_f.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];$c(a,2)?$c(a,1)||(t|=o):(n|=o,$c(a,1)&&(t|=o))}return{x:t,y:n,level:i}};_f.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 Xhe=new Yn("decodeGoogleEarthEnterprisePacket");_f.prototype.getQuadTreePacket=function(e,t,n){t=t??1,e=e??"";let r=Khe(this,e,t,n).fetchArrayBuffer();if(!l(r))return;let o=this._tileInfo,a=this.key;return r.then(function(s){return Xhe.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=$D.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}})})};_f.prototype.populateSubtree=function(e,t,n,i){let r=_f.tileXYToQuadKey(e,t,n);return ZX(this,r,i)};function ZX(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 bo({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),ZX(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 bo({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),ZX(e,t,a)}).finally(function(){delete s[r]})}_f.prototype.getTileInformation=function(e,t,n){let i=_f.tileXYToQuadKey(e,t,n);return this._tileInfo[i]};_f.prototype.getTileInformationFromQuadKey=function(e){return this._tileInfo[e]};function Khe(e,t,n,i){return e._resource.getDerivedResource({url:`flatfile?q2-0${t}-q.${n.toString()}`,request:i})}var $X,JX;function K5e(e){let t=e._resource.getDerivedResource({url:"dbRoot.v5",queryParameters:{output:"proto"}});if(!l(JX)){let n=$t("ThirdParty/google-earth-dbroot-parser.js"),i=window.cesiumGoogleEarthDbRootParser;JX=Tb(n).then(function(){$X=window.cesiumGoogleEarthDbRootParser(q5e),l(i)?window.cesiumGoogleEarthDbRootParser=i:delete window.cesiumGoogleEarthDbRootParser})}return JX.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 Xhe.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 St(u.value))}}).catch(function(){console.log(`Failed to retrieve ${t.url}. Using defaults.`),e.key=X5e})}var ug=_f;function cx(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(cx.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var Zhe="createVerticesFromGoogleEarthEnterpriseBuffer",$5e=new Yn(Zhe),J5e=new Yn(Zhe,xu.maximumAsynchronousTasks),$he=new ie,r6=new ie;cx.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,$he),t.tileXYToRectangle(n,i,r,r6);let u=c.cartographicToCartesian(ie.center(r6)),d=40075.16/(1<<r);this._skirtHeight=Math.min(d*8,1e3);let g=(s?J5e:$5e).scheduleTask({buffer:this._buffer,nativeRectangle:$he,rectangle:r6,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 tc(u,new Float32Array(y.vertices),new Uint16Array(y.indices),y.indexCountWithoutSkirts,y.vertexCountWithoutSkirts,y.minimumHeight,y.maximumHeight,r6,se.clone(y.boundingSphere3D),h.clone(y.occludeePointInScaledSpace),y.numberOfAttributes,Jt.clone(y.orientedBoundingBox),uo.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})};cx.prototype.interpolateHeight=function(e,t,n){let i=D.clamp((t-e.west)/e.width,0,1),r=D.clamp((n-e.south)/e.height,0,1);return l(this._mesh)?n9e(this,i,r):o9e(this,i,r,e)};var Z5e=new Yn("upsampleQuantizedTerrainMesh",xu.maximumAsynchronousTasks);cx.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=Z5e.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 Hb({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})})};cx.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};cx.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var Q5e=new z,e9e=new z,t9e=new z,Qhe=new h;function n9e(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,Q5e),g=o.decodeTextureCoordinates(r,f,e9e),m=o.decodeTextureCoordinates(r,d,t9e),y=Oh.computeBarycentricCoordinates(t,n,p.x,p.y,g.x,g.y,m.x,m.y,Qhe);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 i9e=Uint16Array.BYTES_PER_ELEMENT,Jhe=Uint32Array.BYTES_PER_ELEMENT,QX=Int32Array.BYTES_PER_ELEMENT,r9e=Float32Array.BYTES_PER_ELEMENT,eK=Float64Array.BYTES_PER_ELEMENT;function o9e(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+=Jhe;u+=Jhe,u+=2*eK;let f=D.toRadians(c.getFloat64(u,!0)*180);u+=eK;let d=D.toRadians(c.getFloat64(u,!0)*180);u+=eK;let p=i.width/f/2,g=i.height/d/2,m=c.getInt32(u,!0);u+=QX;let y=c.getInt32(u,!0)*3;u+=QX,u+=QX;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+=r9e;let C=new Array(y);for(T=0;T<y;++T)C[T]=c.getUint16(u,!0),u+=i9e;for(T=0;T<y;T+=3){let E=C[T],w=C[T+1],P=C[T+2],R=A[E],O=A[w],N=A[P],_=b[E],v=b[w],S=b[P],I=Oh.computeBarycentricCoordinates(t,n,R,_,O,v,N,S,Qhe);if(I.x>=-1e-15&&I.y>=-1e-15&&I.z>=-1e-15)return I.x*x[E]+I.y*x[w]+I.z*x[P]}}var wE=cx;var Dd={UNKNOWN:0,NONE:1,SELF:2,PARENT:3},o6=new K;function a6(){this._terrainCache={},this._lastTidy=K.now()}a6.prototype.add=function(e,t){this._terrainCache[e]={buffer:t,timestamp:K.now()}};a6.prototype.get=function(e){let n=this._terrainCache[e];if(l(n))return delete this._terrainCache[e],n.buffer};a6.prototype.tidy=function(){if(K.now(o6),K.secondsDifference(o6,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(o6,o.timestamp)>10&&delete e[r]}K.clone(o6,this._lastTidy)}};function ky(e){e=e??H.EMPTY_OBJECT,this._tilingScheme=new Xi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ie(-D.PI,-D.PI,D.PI,D.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new St(t)),this._credit=t,this._levelZeroMaximumGeometricError=40075.16,this._terrainCache=new a6,this._terrainPromises={},this._terrainRequests={},this._errorEvent=new be}Object.defineProperties(ky.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(){}}});ky.fromMetadata=function(e,t){if(!e.terrainPresent)throw new oe(`The server ${e.url} doesn't have terrain`);let n=new ky(t);return n._metadata=e,n};var a9e=new Yn("decodeGoogleEarthEnterprisePacket");function eme(e,t,n){let i=t.getChildBitmask();if(t.terrainState===Dd.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}ky.prototype.requestTileGeometry=function(e,t,n,i){let r=ug.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=Dd.UNKNOWN);let u=o.get(r);if(l(u)){let b=a.providers[s.terrainProvider];return Promise.resolve(new wE({buffer:u,childTileMask:eme(r,s,a),credits:l(b)?[b]:void 0,negativeAltitudeExponentBias:a.negativeAltitudeExponentBias,negativeElevationThreshold:a.negativeAltitudeThreshold}))}if(o.tidy(),s.ancestorHasTerrain){if(c===Dd.NONE)return Promise.reject(new oe("Terrain tile doesn't exist"))}else return Promise.resolve(new Sc({buffer:new Uint8Array(256),width:16,height:16}));let f,d=r,p=-1;switch(c){case Dd.SELF:p=s.terrainVersion;break;case Dd.PARENT:d=d.substring(0,d.length-1),f=a.getTileInformationFromQuadKey(d),p=f.terrainVersion;break;case Dd.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=s9e(this,d,p,A).fetchArrayBuffer();if(!l(b))return;y=b.then(function(x){return l(x)?a9e.scheduleTask({buffer:x,type:"Terrain",key:a.key},[x]).then(function(T){let C=a.getTileInformationFromQuadKey(d);C.terrainState=Dd.SELF,o.add(d,T[0]);let E=C.terrainProvider,w=T.length-1;for(let P=0;P<w;++P){let R=d+P.toString(),O=a.getTileInformationFromQuadKey(R);l(O)&&(o.add(R,T[P+1]),O.terrainState=Dd.PARENT,O.terrainProvider===0&&(O.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 wE({buffer:b,childTileMask:eme(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===yi.CANCELLED?(i.state=A.state,Promise.reject(b)):(s.terrainState=Dd.NONE,Promise.reject(b))})};ky.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};ky.prototype.getTileDataAvailable=function(e,t,n){let i=this._metadata,r=ug.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===Dd.NONE)return!1;if((!l(a)||a===Dd.UNKNOWN)&&(o.terrainState=Dd.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 bo({throttle:!1,throttleByServer:!0,type:Ha.TERRAIN});i.populateSubtree(e,t,n,a)}return!1};ky.prototype.loadTileDataAvailability=function(e,t,n){};function s9e(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 tK=ky;var c9e="https://maps.googleapis.com/maps/api/geocode/json",tme='<img alt="Google" src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align:-5px">';function nK(e){e=e??H.EMPTY_OBJECT;let t=e.key;this._resource=new De({url:c9e,queryParameters:{key:t}}),this._credit=new St(tme,!0)}Object.defineProperties(nK.prototype,{credit:{get:function(){return this._credit}}});nK.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:tme,collapsible:!1}}})};var iK=nK;var IE={};IE.defaultApiKey=void 0;IE.mapTilesApiEndpoint=new De({url:"https://tile.googleapis.com/"});IE.defaultStreetViewStaticApiKey=void 0;IE.streetViewStaticApiEndpoint=new De({url:"https://maps.googleapis.com/maps/api/streetview"});IE.getDefaultCredit=function(){return new St('<img alt="Google" src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align:-6px">',!0)};var ds=IE;var fK=[Bi,di],l9e=fK.length,xme=Math.cos(D.toRadians(30)),nme=Math.cos(D.toRadians(150)),Tme=0,Cme=1e3;function Uy(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(Uy.prototype,{packedLength:{get:function(){return 1+this._positions.length*3+1+1+1+te.packedLength+1+1}}});Uy.setProjectionAndEllipsoid=function(e,t){let n=0;for(let i=0;i<l9e;i++)if(t instanceof fK[i]){n=i;break}e._projectionIndex=n,e._ellipsoid=t.ellipsoid};var u9e=new h,ime=new h,rme=new h;function uK(e,t,n,i,r){let o=Bl(i,e,0,u9e),a=Bl(i,e,n,ime),s=Bl(i,t,0,rme),c=fg(a,o,ime),u=fg(s,o,rme);return h.cross(u,c,r),h.normalize(r,r)}var f9e=new de,d9e=new h,h9e=new h,m9e=new h;function rK(e,t,n,i,r,o,a,s,c,u,f){if(r===0)return;let d;o===sn.GEODESIC?d=new ig(e,t,a):o===sn.RHUMB&&(d=new Dc(e,t,a));let p=d.surfaceDistance;if(p<r)return;let g=uK(e,t,i,a,m9e),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,f9e),E=Bl(a,C,n,d9e),w=Bl(a,C,i,h9e);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 oK=new de;function Bl(e,t,n,i){return de.clone(t,oK),oK.height=n,de.toCartesian(oK,e,i)}Uy.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};Uy.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 Uy({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 fg(e,t,n){return h.subtract(e,t,n),h.normalize(n,n),n}function ome(e,t,n,i){return i=fg(e,t,i),i=h.cross(i,n,i),i=h.normalize(i,i),i=h.cross(n,i,i),i}var p9e=new h,g9e=new h,_9e=new h,vme=new h,y9e=0,A9e=-1;function aK(e,t,n,i,r){let o=fg(n,t,vme),a=ome(e,t,o,p9e),s=ome(i,t,o,g9e);if(D.equalsEpsilon(h.dot(a,s),A9e,D.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,_9e);return h.dot(s,c)<y9e&&(r=h.negate(r,r)),r}var u6=en.fromPointNormal(h.ZERO,h.UNIT_Y),b9e=new h,x9e=new h,T9e=new h,C9e=new h,v9e=new h,s6=new h,c6=new de,ame=new de,sme=new de;Uy.createGeometry=function(e){let t=!e._scene3DOnly,n=e.loop,i=e._ellipsoid,r=e.granularity,o=e.arcType,a=new fK[e._projectionIndex](i),s=Tme,c=Cme,u,f,d=e._positions,p=d.length;p===2&&(n=!1);let g,m,y,A,b=new Dc(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,u6,s6),l(x)&&!h.equalsEpsilon(x,g,D.EPSILON7)&&!h.equalsEpsilon(x,m,D.EPSILON7)&&(e.arcType===sn.GEODESIC?E.push(h.clone(x)):e.arcType===sn.RHUMB&&(C=i.cartesianToCartographic(x,c6).longitude,y=i.cartesianToCartographic(g,c6),A=i.cartesianToCartographic(m,ame),b.setEndPoints(y,A),T=b.findIntersectionWithLongitude(C,sme),x=i.cartographicToCartesian(T,s6),l(x)&&!h.equalsEpsilon(x,g,D.EPSILON7)&&!h.equalsEpsilon(x,m,D.EPSILON7)&&E.push(h.clone(x)))),E.push(m);n&&(g=d[p-1],m=d[0],x=ci.lineSegmentPlane(g,m,u6,s6),l(x)&&!h.equalsEpsilon(x,g,D.EPSILON7)&&!h.equalsEpsilon(x,m,D.EPSILON7)&&(e.arcType===sn.GEODESIC?E.push(h.clone(x)):e.arcType===sn.RHUMB&&(C=i.cartesianToCartographic(x,c6).longitude,y=i.cartesianToCartographic(g,c6),A=i.cartesianToCartographic(m,ame),b.setEndPoints(y,A),T=b.findIntersectionWithLongitude(C,sme),x=i.cartographicToCartesian(T,s6),l(x)&&!h.equalsEpsilon(x,g,D.EPSILON7)&&!h.equalsEpsilon(x,m,D.EPSILON7)&&E.push(h.clone(x)))));let w=E.length,P=new Array(w);for(f=0;f<w;f++){let W=de.fromCartesian(E[f],i);W.height=0,P[f]=W}if(P=Pr(P,de.equalsEpsilon),w=P.length,w<2)return;let R=[],O=[],N=[],_=[],v=b9e,S=x9e,I=T9e,M=C9e,F=v9e,V=P[0],k=P[1],j=P[w-1];for(v=Bl(i,j,s,v),M=Bl(i,k,s,M),S=Bl(i,V,s,S),I=Bl(i,V,c,I),n?F=aK(v,S,I,M,F):F=uK(V,k,c,i,F),h.pack(F,O,0),h.pack(S,N,0),h.pack(I,_,0),R.push(V.latitude),R.push(V.longitude),rK(V,k,s,c,r,o,i,O,N,_,R),f=1;f<w-1;++f){v=h.clone(S,v),S=h.clone(M,S);let W=P[f];Bl(i,W,c,I),Bl(i,P[f+1],s,M),aK(v,S,I,M,F),u=O.length,h.pack(F,O,u),h.pack(S,N,u),h.pack(I,_,u),R.push(W.latitude),R.push(W.longitude),rK(P[f],P[f+1],s,c,r,o,i,O,N,_,R)}let B=P[w-1],G=P[w-2];if(S=Bl(i,B,s,S),I=Bl(i,B,c,I),n){let W=P[0];v=Bl(i,G,s,v),M=Bl(i,W,s,M),F=aK(v,S,I,M,F)}else F=uK(G,B,c,i,F);if(u=O.length,h.pack(F,O,u),h.pack(S,N,u),h.pack(I,_,u),R.push(B.latitude),R.push(B.longitude),n){for(rK(B,V,s,c,r,o,i,O,N,_,R),u=O.length,f=0;f<3;++f)O[u+f]=O[f],N[u+f]=N[f],_[u+f]=_[f];R.push(V.latitude),R.push(V.longitude)}return $9e(n,a,N,_,O,R,t)};var E9e=new h,S9e=new $,w9e=new Fe;function cme(e,t,n,i){let r=fg(n,t,E9e),o=h.dot(r,e);if(o>xme||o<nme){let a=fg(i,n,vme),s=o<nme?D.PI_OVER_TWO:-D.PI_OVER_TWO,c=Fe.fromAxisAngle(a,s,w9e),u=$.fromQuaternion(c,S9e);return $.multiplyByVector(u,e,e),!0}return!1}var lme=new de,I9e=new h,ume=new h;function JD(e,t,n,i,r){let o=de.toCartesian(t,e._ellipsoid,I9e),a=h.add(o,n,ume),s=!1,c=e._ellipsoid,u=c.cartesianToCartographic(a,lme);Math.abs(t.longitude-u.longitude)>D.PI_OVER_TWO&&(s=!0,a=h.subtract(o,n,ume),u=c.cartesianToCartographic(a,lme)),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 P9e=new h,fme=new h;function dme(e,t,n,i,r,o){let a=h.subtract(t,e,P9e);h.normalize(a,a);let s=n-Tme,c=h.multiplyByScalar(a,s,fme);h.add(e,c,r);let u=i-Cme;c=h.multiplyByScalar(a,u,fme),h.add(t,c,o)}var D9e=new h;function l6(e,t){let n=en.getPointDistance(u6,e),i=en.getPointDistance(u6,t),r=D9e;D.equalsEpsilon(n,0,D.EPSILON2)?(r=fg(t,e,r),h.multiplyByScalar(r,D.EPSILON2,r),h.add(e,r,e)):D.equalsEpsilon(i,0,D.EPSILON2)&&(r=fg(e,t,r),h.multiplyByScalar(r,D.EPSILON2,r),h.add(t,r,t))}function R9e(e,t){let n=Math.abs(e.longitude),i=Math.abs(t.longitude);if(D.equalsEpsilon(n,D.PI,D.EPSILON11)){let r=D.sign(t.longitude);return e.longitude=r*(n-D.EPSILON11),1}else if(D.equalsEpsilon(i,D.PI,D.EPSILON11)){let r=D.sign(e.longitude);return t.longitude=r*(i-D.EPSILON11),2}return 0}var Eme=new de,Sme=new de,hme=new h,sK=new h,mme=new h,pme=new h,O9e=new h,gme=new h,M9e=[Eme,Sme],L9e=new ie,N9e=new h,F9e=new h,B9e=new h,k9e=new h,z9e=new h,U9e=new h,cK=new h,lK=new h,V9e=new h,j9e=new h,H9e=new h,_me=new h,G9e=new h,W9e=new h,q9e=new vn,Y9e=new vn,yme=new h,X9e=new h,Ame=new h,K9e=[new se,new se],wme=[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],bme=wme.length;function $9e(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,P,R;a&&(E=new Float32Array(p),w=new Float32Array(p),P=new Float32Array(p),R=new Float32Array(d*2));let O=o.length/2,N=0,_=Eme;_.height=0;let v=Sme;v.height=0;let S=hme,I=sK;if(a)for(c=0,s=1;s<O;s++)_.latitude=o[c],_.longitude=o[c+1],v.latitude=o[c+2],v.longitude=o[c+3],S=t.project(_,S),I=t.project(v,I),N+=h.distance(S,I),c+=2;let M=i.length/3;I=h.unpack(i,0,I);let F=0;for(c=3,s=1;s<M;s++)S=h.clone(I,S),I=h.unpack(i,c,I),F+=h.distance(S,I),c+=3;let V;c=3;let k=0,j=0,B=0,G=0,W=!1,Q=h.unpack(n,0,pme),q=h.unpack(i,0,sK),J=h.unpack(r,0,gme);if(e){let Ie=h.unpack(n,n.length-6,mme);cme(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,mme),Le=h.clone(q,hme),$e=h.clone(J,O9e);W&&($e=h.negate($e,$e)),Q=h.unpack(n,c,pme),q=h.unpack(i,c,sK),J=h.unpack(r,c,gme),W=cme(J,Ie,Q,q),_.latitude=o[k],_.longitude=o[k+1],v.latitude=o[k+2],v.longitude=o[k+3];let Xe,At,Ke,we;if(a){let gi=R9e(_,v);Xe=t.project(_,z9e),At=t.project(v,U9e);let ao=fg(At,Xe,yme);ao.y=Math.abs(ao.y),Ke=cK,we=lK,gi===0||h.dot(ao,h.UNIT_Y)>xme?(Ke=JD(t,_,$e,Xe,cK),we=JD(t,v,J,At,lK)):gi===1?(we=JD(t,v,J,At,lK),Ke.x=0,Ke.y=D.sign(_.longitude-Math.abs(v.longitude)),Ke.z=0):(Ke=JD(t,_,$e,Xe,cK),we.x=0,we.y=D.sign(_.longitude-v.longitude),we.z=0)}let We=h.distance(Le,q),vt=vn.fromCartesian(Ie,q9e),ct=h.subtract(Q,Ie,V9e),pn=h.normalize(ct,_me),Ht=h.subtract(Le,Ie,j9e);Ht=h.normalize(Ht,Ht);let bt=h.cross(pn,Ht,_me);bt=h.normalize(bt,bt);let Dt=h.cross(Ht,$e,G9e);Dt=h.normalize(Dt,Dt);let Pn=h.subtract(q,Q,H9e);Pn=h.normalize(Pn,Pn);let ot=h.cross(J,Pn,W9e);ot=h.normalize(ot,ot);let dt=We/F,Si=Z/F,wn=0,Ni,dr,Fi,Yi=0,ai=0;if(a){wn=h.distance(Xe,At),Ni=vn.fromCartesian(Xe,Y9e),dr=h.subtract(At,Xe,yme),Fi=h.normalize(dr,X9e);let gi=Fi.x;Fi.x=Fi.y,Fi.y=-gi,Yi=wn/N,ai=ce/N}for(V=0;V<8;V++){let gi=G+V*4,ao=j+V*2,Ri=gi+3,Ho=V<4?1:-1,Oi=V===2||V===3||V===6||V===7?1:-1;h.pack(vt.high,A,gi),A[Ri]=ct.x,h.pack(vt.low,b,gi),b[Ri]=ct.y,h.pack(Dt,x,gi),x[Ri]=ct.z,h.pack(ot,T,gi),T[Ri]=dt*Ho,h.pack(bt,C,gi);let wr=Si*Oi;wr===0&&Oi<0&&(wr=9),C[Ri]=wr,a&&(E[gi]=Ni.high.x,E[gi+1]=Ni.high.y,E[gi+2]=Ni.low.x,E[gi+3]=Ni.low.y,P[gi]=-Ke.y,P[gi+1]=Ke.x,P[gi+2]=we.y,P[gi+3]=-we.x,w[gi]=dr.x,w[gi+1]=dr.y,w[gi+2]=Fi.x,w[gi+3]=Fi.y,R[ao]=Yi*Ho,wr=ai*Oi,wr===0&&Oi<0&&(wr=9),R[ao+1]=wr)}let ni=B9e,En=k9e,ii=N9e,Sr=F9e,Ea=ie.fromCartographicArray(M9e,L9e),Va=wi.getMinimumMaximumHeights(Ea,u),rs=Va.minimumTerrainHeight,os=Va.maximumTerrainHeight;Ae+=Math.abs(rs),Ae+=Math.abs(os),dme(Ie,Le,rs,os,ni,ii),dme(Q,q,rs,os,En,Sr);let oo=h.multiplyByScalar(bt,D.EPSILON5,Ame);h.add(ni,oo,ni),h.add(En,oo,En),h.add(ii,oo,ii),h.add(Sr,oo,Sr),l6(ni,En),l6(ii,Sr),h.pack(ni,y,B),h.pack(En,y,B+3),h.pack(Sr,y,B+6),h.pack(ii,y,B+9),oo=h.multiplyByScalar(bt,-2*D.EPSILON5,Ame),h.add(ni,oo,ni),h.add(En,oo,En),h.add(ii,oo,ii),h.add(Sr,oo,Sr),l6(ni,En),l6(ii,Sr),h.pack(ni,y,B+12),h.pack(En,y,B+15),h.pack(Sr,y,B+18),h.pack(ii,y,B+21),k+=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<bme;V++)m[c+V]=wme[V]+le;le+=8,c+=bme}let Ce=K9e;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:zy(A),startLoAndForwardOffsetY:zy(b),startNormalAndForwardOffsetZ:zy(x),endNormalAndTextureCoordinateNormalizationX:zy(T),rightNormalAndTextureCoordinateNormalizationY:zy(C)};return a&&(ve.startHiLo2D=zy(E),ve.offsetAndRight2D=zy(w),ve.startEndNormals2D=zy(P),ve.texcoordNormalization2D=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:2,normalize:!1,values:R})),new xt({attributes:ve,indices:m,boundingSphere:ye})}function zy(e){return new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}Uy._projectNormal=JD;var lx=Uy;function dK(e,t,n){this.heading=e??0,this.pitch=t??0,this.range=n??0}dK.clone=function(e,t){if(l(e))return l(t)||(t=new dK),t.heading=e.heading,t.pitch=e.pitch,t.range=e.range,t};var Rd=dK;var J9e=D.factorial;function hK(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+=hK(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 Z9e=[],mK=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/J9e(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=hK(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=Z9e,m=Q9e(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=hK(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),P=g[w+C];s[E+x*r]+=P*T}}return s}};function Q9e(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/D.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 ZD=mK;var pK={};pK.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),Ime(i,r,o,a);return c};pK.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)),Ime(a,i,r,o),i.x+=a*r,i.y+=a*o,s/=BigInt(4);return[i.x,i.y]};function Ime(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 PE=pK;var Ya={};Ya.ExportStatus=Object.freeze({NotStarted:"NotStarted",InProgress:"InProgress",Complete:"Complete",Invalid:"Invalid"});Ya.ExportType=Object.freeze({IMODEL:"IMODEL",CESIUM:"CESIUM","3DTILES":"3DTILES"});Ya.RealityDataType=Object.freeze({Cesium3DTiles:"Cesium3DTiles",PNTS:"PNTS",RealityMesh3DTiles:"RealityMesh3DTiles",Terrain3DTiles:"Terrain3DTiles",GaussianSplat3DTiles:"GS_3DT",KML:"KML",GeoJSON:"GeoJSON",Unstructured:"Unstructured"});Ya.defaultAccessToken=void 0;Ya.defaultShareKey=void 0;Ya._getAuthorizationHeader=function(){return l(Ya.defaultShareKey)?`Basic ${Ya.defaultShareKey}`:`Bearer ${Ya.defaultAccessToken}`};Ya.apiEndpoint=new De({url:"https://api.bentley.com"});Ya.getExports=async function(e,t){let n=new De({url:`${Ya.apiEndpoint}mesh-export`,headers:{Authorization:Ya._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json",Prefer:"return=representation"},queryParameters:{iModelId:e,exportType:Ya.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}`)}};Ya.getRealityDataMetadata=async function(e,t){let n=new De({url:`${Ya.apiEndpoint}reality-management/reality-data/${t}`,headers:{Authorization:Ya._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}`)}};Ya.getRealityDataURL=async function(e,t,n){let i=new De({url:`${Ya.apiEndpoint}reality-management/reality-data/${t}/readaccess`,headers:{Authorization:Ya._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 Xa=Ya;function e7e(e,t,n,i){this.rightAscension=e,this.declination=t,this.rotation=n,this.rotationRate=i}var QD=e7e;var jme={},t7e=32.184,n7e=2451545,Pme=-.0529921,Dme=-.1059842,Rme=13.0120009,Ome=13.3407154,Mme=.9856003,Lme=26.4057084,Nme=13.064993,Fme=.3287146,Bme=1.7484877,kme=-.1589763,zme=.0036096,Ume=.1643573,Vme=12.9590088,gK=new K;jme.ComputeMoon=function(e,t){l(e)||(e=K.now()),gK=K.addSeconds(e,t7e,gK);let n=K.totalDays(gK)-n7e,i=n/zn.DAYS_PER_JULIAN_CENTURY,r=(125.045+Pme*n)*D.RADIANS_PER_DEGREE,o=(250.089+Dme*n)*D.RADIANS_PER_DEGREE,a=(260.008+Rme*n)*D.RADIANS_PER_DEGREE,s=(176.625+Ome*n)*D.RADIANS_PER_DEGREE,c=(357.529+Mme*n)*D.RADIANS_PER_DEGREE,u=(311.589+Lme*n)*D.RADIANS_PER_DEGREE,f=(134.963+Nme*n)*D.RADIANS_PER_DEGREE,d=(276.617+Fme*n)*D.RADIANS_PER_DEGREE,p=(34.226+Bme*n)*D.RADIANS_PER_DEGREE,g=(15.134+kme*n)*D.RADIANS_PER_DEGREE,m=(119.743+zme*n)*D.RADIANS_PER_DEGREE,y=(239.961+Ume*n)*D.RADIANS_PER_DEGREE,A=(25.053+Vme*n)*D.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),P=Math.sin(f),R=Math.sin(d),O=Math.sin(p),N=Math.sin(g),_=Math.sin(m),v=Math.sin(y),S=Math.sin(A),I=Math.cos(r),M=Math.cos(o),F=Math.cos(a),V=Math.cos(s),k=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)*D.RADIANS_PER_DEGREE,Ae=(66.5392+.013*i+1.5419*I+.0239*M-.0278*F+.0068*V-.0029*j+9e-4*B+8e-4*Q-9e-4*Z)*D.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*P-.0046*R+.0028*O+.0052*N+.004*_+.0019*v-.0044*S)*D.RADIANS_PER_DEGREE,Ce=(13.17635815-14e-13*(2*n)+3.561*I*Pme+.1208*M*Dme-.0642*F*Rme+.0158*V*Ome+.0252*k*Mme-.0066*j*Lme-.0047*B*Nme-.0046*G*Fme+.0028*W*Bme+.0052*Q*kme+.004*q*zme+.0019*J*Ume-.0044*Z*Vme)/86400*D.RADIANS_PER_DEGREE;return l(t)||(t=new QD),t.rightAscension=ce,t.declination=Ae,t.rotation=le,t.rotationRate=Ce,t};var e1=jme;function Hme(e){(!l(e)||typeof e!="function")&&(e=e1.ComputeMoon),this._computeFunction=e}var i7e=new h,r7e=new h,o7e=new h;function a7e(e,t,n){let i=i7e;i.x=Math.cos(e+D.PI_OVER_TWO),i.y=Math.sin(e+D.PI_OVER_TWO),i.z=0;let r=Math.cos(t),o=o7e;o.x=r*Math.cos(e),o.y=r*Math.sin(e),o.z=Math.sin(t);let a=h.cross(o,i,r7e);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 s7e=new $,c7e=new Fe;Hme.prototype.evaluate=function(e,t){l(e)||(e=K.now());let n=this._computeFunction(e),i=a7e(n.rightAscension,n.declination,t),r=D.zeroToTwoPi(n.rotation),o=Fe.fromAxisAngle(h.UNIT_Z,r,c7e),a=$.fromQuaternion(Fe.conjugate(o,o),s7e);return $.multiply(a,i,i)};var t1=Hme;var _K=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()}},yK=_K;var Gme={STEP:0,LINEAR:1,CUBICSPLINE:2};Object.freeze(Gme);var Wh=Gme;var Wme={GOOGLE:"GOOGLE",BING:"BING",DEFAULT:"DEFAULT"};Object.freeze(Wme);var dg=Wme;function AK(e){this._url=De.createIfNeeded(e),this._url.appendForwardSlash()}Object.defineProperties(AK.prototype,{url:{get:function(){return this._url}},credit:{get:function(){}}});AK.prototype.geocode=async function(e,t){return this._url.getDerivedResource({url:t===By.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 n1=AK;function l7e(e){if(!Object.values(dg).some(t=>t===e))throw new pe(`Invalid geocodeProviderType: "${e}"`)}var qme=Object.freeze({[dg.GOOGLE]:"google",[dg.BING]:"bing",[dg.DEFAULT]:void 0});function u7e(e){return qme[e]}function f7e(e){return Object.entries(qme).find(t=>t[1]===e)[0]}function bK(e){e=e??H.EMPTY_OBJECT;let t=e.geocodeProviderType??dg.DEFAULT,n=e.accessToken??Bh.defaultAccessToken,i=De.createIfNeeded(e.server??Bh.defaultServer);i.appendForwardSlash();let r=Bh.getDefaultTokenCredit(n);l(r)&&e.scene.frameState.creditDisplay.addStaticCredit(St.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 n1(o),this.geocodeProviderType=t}Object.defineProperties(bK.prototype,{credit:{get:function(){}},geocodeProviderType:{get:function(){return f7e(this._pelias.url.queryParameters.geocoder)},set:function(e){l7e(e);let t={...this._pelias.url.queryParameters,geocoder:u7e(e)};l(t.geocoder)||delete t.geocoder,this._pelias.url.setQueryParameters(t)}}});bK.prototype.geocode=async function(e,t){return this._pelias.geocode(e,t)};var ux=bK;function Eo(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(Eo.prototype,{isEmpty:{get:function(){let e=K.compare(this.stop,this.start);return e<0||e===0&&(!this.isStartIncluded||!this.isStopIncluded)}}});var DE={start:void 0,stop:void 0,isStartIncluded:void 0,isStopIncluded:void 0,data:void 0};Eo.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):(DE.start=i,DE.stop=r,DE.isStartIncluded=o,DE.isStopIncluded=a,DE.data=s,new Eo(DE))};Eo.toIso8601=function(e,t){return`${K.toIso8601(e.start,t)}/${K.toIso8601(e.stop,t)}`};Eo.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 Eo(e)};Eo.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)))};Eo.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)))};Eo.intersect=function(e,t,n,i){if(!l(t))return Eo.clone(Eo.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 Eo.clone(Eo.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 Eo),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};Eo.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};Eo.prototype.clone=function(e){return Eo.clone(this,e)};Eo.prototype.equals=function(e,t){return Eo.equals(this,e,t)};Eo.prototype.equalsEpsilon=function(e,t,n){return Eo.equalsEpsilon(this,e,t,n)};Eo.prototype.toString=function(){return Eo.toIso8601(this)};Eo.EMPTY=Object.freeze(new Eo({start:new K,stop:new K,isStartIncluded:!1,isStopIncluded:!1}));var Tn=Eo;var Yme=Object.freeze(K.fromIso8601("0000-01-01T00:00:00Z")),Xme=Object.freeze(K.fromIso8601("9999-12-31T24:00:00Z")),d7e=Object.freeze(new Tn({start:Yme,stop:Xme})),h7e={MINIMUM_VALUE:Yme,MAXIMUM_VALUE:Xme,MAXIMUM_INTERVAL:d7e},Qe=h7e;var Kme={SHIFT:0,CTRL:1,ALT:2};Object.freeze(Kme);var Gr=Kme;var xK=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}},i1=xK;var TK=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}},fx=TK;function Lp(e){e=e??0,this._array=new Array(e),this._length=e}Object.defineProperties(Lp.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}}});Lp.prototype.get=function(e){return this._array[e]};Lp.prototype.set=function(e,t){e>=this._length&&(this.length=e+1),this._array[e]=t};Lp.prototype.peek=function(){return this._array[this._length-1]};Lp.prototype.push=function(e){let t=this.length++;this._array[t]=e};Lp.prototype.pop=function(){if(this._length===0)return;let e=this._array[this._length-1];return--this.length,e};Lp.prototype.reserve=function(e){e>this._array.length&&(this._array.length=e)};Lp.prototype.resize=function(e){this.length=e};Lp.prototype.trim=function(e){e=e??this._length,this._array.length=e};var kl=Lp;var CK=class{constructor(){at(this,"ellipsoid")}project(t,n){pe.throwInstantiationError()}unproject(t,n){pe.throwInstantiationError()}},vK=CK;function RE(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(RE.prototype,{times:{get:function(){return this._times}},weights:{get:function(){return this._weights}}});RE.prototype.findTimeInterval=xr.prototype.findTimeInterval;RE.prototype.wrapTime=xr.prototype.wrapTime;RE.prototype.clampTime=xr.prototype.clampTime;RE.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 EK=RE;function Od(e,t,n,i){this.near=e??0,this.nearValue=t??0,this.far=n??1,this.farValue=i??0}Od.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 Od(e.near,e.nearValue,e.far,e.farValue)};Od.packedLength=4;Od.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};Od.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Od),n.near=e[t++],n.nearValue=e[t++],n.far=e[t++],n.farValue=e[t],n};Od.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};Od.prototype.clone=function(e){return Od.clone(this,e)};Od.prototype.equals=function(e){return Od.equals(this,e)};var Wt=Od;var $me={NONE:-1,PARTIAL:0,FULL:1};Object.freeze($me);var No=$me;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 f6=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,f6),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,f6);let s=r*r*n;a=h.add(e,h.multiplyByScalar(o,s,f6),f6)}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 Zme=new h;Jc.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){let t=h.subtract(e,this._occluderPosition,Zme),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 m7e=new h;Jc.prototype.isBoundingSphereVisible=function(e){let t=h.clone(e.center,m7e),n=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){let i=h.subtract(t,this._occluderPosition,Zme),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 p7e=new h;Jc.prototype.computeVisibility=function(e){let t=h.clone(e.center),n=e.radius;if(n>this._occluderRadius)return No.FULL;if(this._horizonDistance!==Number.MAX_VALUE){let i=h.subtract(t,this._occluderPosition,p7e),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?No.NONE:(r=this._occluderRadius+n,r=o-r*r,r>0?(r=Math.sqrt(r)+this._horizonDistance,a<r*r+n*n?No.FULL:No.PARTIAL):(i=h.subtract(t,this._horizonPlanePosition,i),h.dot(i,this._horizonPlaneNormal)>-n?No.PARTIAL:No.FULL))}}return No.NONE};var d6=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,d6),d6),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,d6),d6)};var g7e=[];Jc.computeOccludeePointFromRectangle=function(e,t){t=t??te.default;let n=ie.subsample(e,t,0,g7e),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 _7e=new h;Jc._anyRotationVector=function(e,t,n){let i=h.abs(t,_7e),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 y7e=new h;Jc._rotationVector=function(e,t,n,i,r){let o=h.subtract(i,e,y7e);if(o=h.normalize(o,o),h.dot(t,o)<.9999999847691291){let a=h.cross(t,o,o);if(h.magnitude(a)>D.EPSILON13)return h.normalize(a,new h)}return r};var SK=new h,A7e=new h,h6=new h,Jme=new h;Jc._horizonToPlaneNormalDotProduct=function(e,t,n,i,r){let o=h.clone(r,SK),a=h.clone(e.center,A7e),s=e.radius,c=h.subtract(a,o,h6),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,Jme),Jme),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,SK);C=h.normalize(C,C);let E=h.multiplyByScalar(C,x,SK);T=h.normalize(h.subtract(h.add(b,E,h6),a,h6),h6);let w=h.dot(t,T);T=h.normalize(h.subtract(h.subtract(b,E,T),a,T),T);let P=h.dot(t,T);return w<P?w:P};var r1=Jc;function o1(e,t,n){e=e??0,t=t??0,n=n??0,this.value=new Float32Array([e,t,n])}Object.defineProperties(o1.prototype,{componentDatatype:{get:function(){return Y.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}});o1.fromCartesian3=function(e){return new o1(e.x,e.y,e.z)};o1.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 _r=o1;function wK(e,t,n){e=De.createIfNeeded(e),e.appendForwardSlash(),e.setQueryParameters({key:t}),this._url=e,this._params=n??{},this._credit=new St('Geodata copyright <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors',!1)}Object.defineProperties(wK.prototype,{url:{get:function(){return this._url}},params:{get:function(){return this._params}},credit:{get:function(){return this._credit}}});wK.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 IK=wK;var b7e={packedLength:void 0,pack:pe.throwInstantiationError,unpack:pe.throwInstantiationError},PK=b7e;var x7e={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:pe.throwInstantiationError,unpackInterpolationResult:pe.throwInstantiationError},DK=x7e;function T7e(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 dx;function C7e(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(dx)||(l(f.imageSmoothingEnabled)?dx="imageSmoothingEnabled":l(f.mozImageSmoothingEnabled)?dx="mozImageSmoothingEnabled":l(f.webkitImageSmoothingEnabled)?dx="webkitImageSmoothingEnabled":l(f.msImageSmoothingEnabled)&&(dx="msImageSmoothingEnabled")),f.font=n,f.lineJoin="round",f.lineWidth=o,f[dx]=!1,u.style.visibility="hidden",document.body.appendChild(u);let d=T7e(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[dx]=!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 hx=C7e;function s1(){this._cache={}}s1.prototype.fromColor=function(e,t){return m6(void 0,void 0,e,t,this._cache)};s1.prototype.fromUrl=function(e,t,n){return m6(e,void 0,t,n,this._cache)};s1.prototype.fromMakiIconId=function(e,t,n){return m6($t(`Assets/Textures/maki/${encodeURIComponent(e)}.png`),void 0,t,n,this._cache)};s1.prototype.fromText=function(e,t,n){return m6(void 0,e,t,n,this._cache)};var v7e=new U;function E7e(e,t,n){e.save(),e.scale(n/24,n/24),e.fillStyle=t.toCssColorString(),e.strokeStyle=t.brighten(.6,v7e).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 Qme(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 a1=new Array(4);function m6(e,t,n,i,r){a1[0]=e,a1[1]=t,a1[2]=n,a1[3]=i;let o=JSON.stringify(a1),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(E7e(c,n,i),l(e)){let f=De.createIfNeeded(e).fetchImage().then(function(d){return Qme(c,d,i),r[o]=s,s});return r[o]=f,f}else if(l(t)){let u=hx(t,{font:`bold ${i}px sans-serif`});Qme(c,u,i)}return r[o]=s,s}var hg=s1;function OE(e){e=e??H.EMPTY_OBJECT;let t=e.vertexFormat??Be.DEFAULT;this._vertexFormat=t,this._workerName="createPlaneGeometry"}OE.packedLength=Be.packedLength;OE.pack=function(e,t,n){return n=n??0,Be.pack(e._vertexFormat,t,n),t};var epe=new Be,S7e={vertexFormat:epe};OE.unpack=function(e,t,n){t=t??0;let i=Be.unpack(e,t,epe);return l(n)?(n._vertexFormat=Be.clone(i,n._vertexFormat),n):new OE(S7e)};var p6=new h(-.5,-.5,0),g6=new h(.5,.5,0);OE.createGeometry=function(e){let t=e._vertexFormat,n=new bn,i,r;if(t.position){if(r=new Float64Array(12),r[0]=p6.x,r[1]=p6.y,r[2]=0,r[3]=g6.x,r[4]=p6.y,r[5]=0,r[6]=g6.x,r[7]=g6.y,r[8]=0,r[9]=p6.x,r[10]=g6.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 xt({attributes:n,indices:i,primitiveType:Re.TRIANGLES,boundingSphere:new se(h.ZERO,Math.sqrt(2))})};var c1=OE;function ME(){this._workerName="createPlaneOutlineGeometry"}ME.packedLength=0;ME.pack=function(e,t){return t};ME.unpack=function(e,t,n){return l(n)?n:new ME};var Vy=new h(-.5,-.5,0),_6=new h(.5,.5,0);ME.createGeometry=function(){let e=new bn,t=new Uint16Array(8),n=new Float64Array(12);return n[0]=Vy.x,n[1]=Vy.y,n[2]=Vy.z,n[3]=_6.x,n[4]=Vy.y,n[5]=Vy.z,n[6]=_6.x,n[7]=_6.y,n[8]=Vy.z,n[9]=Vy.x,n[10]=_6.y,n[11]=Vy.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 xt({attributes:e,indices:t,primitiveType:Re.LINES,boundingSphere:new se(h.ZERO,Math.sqrt(2))})};var l1=ME;function ha(e,t){this.position=e,l(this.position)||(this.position=new z),this.tangentPlane=t,l(this.tangentPlane)||(this.tangentPlane=ha.NORTH_POLE_TANGENT_PLANE)}Object.defineProperties(ha.prototype,{ellipsoid:{get:function(){return this.tangentPlane.ellipsoid}},x:{get:function(){return this.position.x}},y:{get:function(){return this.position.y}},conformalLatitude:{get:function(){let e=z.magnitude(this.position),t=2*this.ellipsoid.maximumRadius;return this.tangentPlane.plane.normal.z*(D.PI_OVER_TWO-2*Math.atan2(e,t))}},longitude:{get:function(){let e=D.PI_OVER_TWO+Math.atan2(this.y,this.x);return e>Math.PI&&(e-=D.TWO_PI),e}}});var LE=new de,w7e=new h;ha.prototype.getLatitude=function(e){l(e)||(e=te.default),LE.latitude=this.conformalLatitude,LE.longitude=this.longitude,LE.height=0;let t=this.ellipsoid.cartographicToCartesian(LE,w7e);return e.cartesianToCartographic(t,LE),LE.latitude};var I7e=new dn,P7e=new h,D7e=new h;ha.fromCartesian=function(e,t){let n=D.signNotZero(e.z),i=ha.NORTH_POLE_TANGENT_PLANE,r=ha.SOUTH_POLE;n<0&&(i=ha.SOUTH_POLE_TANGENT_PLANE,r=ha.NORTH_POLE);let o=I7e;o.origin=i.ellipsoid.scaleToGeocentricSurface(e,o.origin),o.direction=h.subtract(o.origin,r,P7e),h.normalize(o.direction,o.direction);let a=ci.rayPlane(o,i.plane,D7e),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 z(c,u),t.tangentPlane=i,t):new ha(new z(c,u),i)};ha.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]=ha.fromCartesian(e[i],t[i]);return t};ha.clone=function(e,t){if(l(e))return l(t)?(t.position=e.position,t.tangentPlane=e.tangentPlane,t):new ha(e.position,e.tangentPlane)};ha.HALF_UNIT_SPHERE=Object.freeze(new te(.5,.5,.5));ha.NORTH_POLE=Object.freeze(new h(0,0,.5));ha.SOUTH_POLE=Object.freeze(new h(0,0,-.5));ha.NORTH_POLE_TANGENT_PLANE=Object.freeze(new Pa(ha.NORTH_POLE,ha.HALF_UNIT_SPHERE));ha.SOUTH_POLE_TANGENT_PLANE=Object.freeze(new Pa(ha.SOUTH_POLE,ha.HALF_UNIT_SPHERE));var Zc=ha;var R7e=new de,tpe=new de;function O7e(e,t,n,i){let o=i.cartesianToCartographic(e,R7e).height,a=i.cartesianToCartographic(t,tpe);a.height=o,i.cartographicToCartesian(a,t);let s=i.cartesianToCartographic(n,tpe);s.height=o-100,i.cartographicToCartesian(s,n)}var npe=new Je,M7e=new h,L7e=new h,N7e=new h,F7e=new h,B7e=new h,k7e=new h,y6=new h,Np=new h,NE=new h,z7e=new z,U7e=new z,V7e=new h,ipe=new Fe,j7e=new $,H7e=new $;function RK(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=z7e;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,P=0,R=L7e,O=N7e,N=F7e,_=!0,v=j7e,S=H7e;if(m!==0){let F=Fe.fromAxisAngle(d,m,ipe);v=$.fromQuaternion(F,v),F=Fe.fromAxisAngle(d,-m,ipe),S=$.fromQuaternion(F,S)}else v=$.clone($.IDENTITY,v),S=$.clone($.IDENTITY,S);let I=0,M=0;c&&u&&(I=a/2,M=a/3,a/=2);for(let F=0;F<a;F+=3){let V=h.fromArray(r,F,V7e);if(t.st&&!l(o)){let k=$.multiplyByVector(v,V,M7e);k=g.scaleToGeodeticSurface(k,k);let j=p([k],U7e)[0];z.subtract(j,A,j);let B=D.clamp(j.x/f.width,0,1),G=D.clamp(j.y/f.height,0,1);u&&(b[w+M]=B,b[w+1+M]=G),c&&(b[w]=B,b[w+1]=G),w+=2}if(t.normal||t.tangent||t.bitangent||i){let k=P+1,j=P+2;if(s){if(F+3<a){let B=h.fromArray(r,F+3,B7e);if(_){let G=h.fromArray(r,F+a,k7e);y&&O7e(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,D.EPSILON10)&&(_=!0)}(t.tangent||t.bitangent)&&(N=g.geodeticSurfaceNormal(V,N),t.tangent&&(O=h.normalize(h.cross(N,R,O),O)))}else R=g.geodeticSurfaceNormal(V,R),(t.tangent||t.bitangent)&&(y&&(y6=h.fromArray(x,P,y6),Np=h.cross(h.UNIT_Z,y6,Np),Np=h.normalize($.multiplyByVector(S,Np,Np),Np),t.bitangent&&(NE=h.normalize(h.cross(y6,Np,NE),NE))),O=h.cross(h.UNIT_Z,R,O),O=h.normalize($.multiplyByVector(S,O,O),O),t.bitangent&&(N=h.normalize(h.cross(R,O,N),N)));t.normal&&(e.wall?(x[P+I]=R.x,x[k+I]=R.y,x[j+I]=R.z):u&&(x[P+I]=-R.x,x[k+I]=-R.y,x[j+I]=-R.z),(c&&!y||s)&&(x[P]=R.x,x[k]=R.y,x[j]=R.z)),i&&(s&&(R=g.geodeticSurfaceNormal(V,R)),E[P+I]=-R.x,E[k+I]=-R.y,E[j+I]=-R.z),t.tangent&&(e.wall?(T[P+I]=O.x,T[k+I]=O.y,T[j+I]=O.z):u&&(T[P+I]=-O.x,T[k+I]=-O.y,T[j+I]=-O.z),c&&(y?(T[P]=Np.x,T[k]=Np.y,T[j]=Np.z):(T[P]=O.x,T[k]=O.y,T[j]=O.z))),t.bitangent&&(u&&(C[P+I]=N.x,C[k+I]=N.y,C[j+I]=N.z),c&&(y?(C[P]=NE.x,C[k]=NE.y,C[j]=NE.z):(C[P]=N.x,C[k]=N.y,C[j]=N.z))),P+=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===hn.TOP)c&&u||s?d=d.fill(1,0,f/2):c&&(d=d.fill(1));else{let p=e.offsetAttribute===hn.NONE?0:1;d=d.fill(p)}n.attributes.applyOffset=new Me({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}return n}var rpe=[];function G7e(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 P=T.concat(T);E=P.length/3,w=Ve.createTypedArray(E,C.length*2),w.set(C);let R=C.length,O=E/2;for(d=0;d<R;d+=3){let N=w[d]+O,_=w[d+1]+O,v=w[d+2]+O;w[d+R]=v,w[d+1+R]=_,w[d+2+R]=N}if(x.attributes.position.values=P,o&&c.normal){let N=x.attributes.normal.values;x.attributes.normal.values=new Float32Array(P.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 Nt({geometry:x})}let p=r.outerRing,g=Pa.fromPoints(p,e),m=g.projectPointsOntoPlane(p,rpe),y=li.computeWindingOrder2D(m);y===Wa.CLOCKWISE&&(p=p.slice().reverse());let A=$n.computeWallGeometry(p,n,e,i,o,u);f.walls.push(new Nt({geometry:A}));let b=r.holes;for(d=0;d<b.length;d++){let x=b[d];m=g.projectPointsOntoPlane(x,rpe),y=li.computeWindingOrder2D(m),y===Wa.COUNTER_CLOCKWISE&&(x=x.slice().reverse()),A=$n.computeWallGeometry(x,n,e,i,o,u),f.walls.push(new Nt({geometry:A}))}return f}function Ld(e){let t=e.polygonHierarchy,n=e.vertexFormat??Be.DEFAULT,i=e.ellipsoid??te.default,r=e.granularity??D.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,z):1)+12}Ld.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 Ld(t)};Ld.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,z):t[n++]=-1,t[n]=e.packedLength,t};var W7e=te.clone(te.UNIT_SPHERE),q7e=new Be,Y7e={polygonHierarchy:{}};Ld.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,W7e);t+=te.packedLength;let o=Be.unpack(e,t,q7e);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,z);l(b)?(t=b.startingIndex,delete b.startingIndex):t++;let x=e[t];return l(n)||(n=new Ld(Y7e)),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 X7e=new z,K7e=new z,$7e=new Zc;function ope(e,t,n,i,r,o){let a=e.longitude,s=a>=0?a:a+D.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=z.subtract(t.position,e.position,X7e),g=z.dot(t.position,p)/z.dot(p,p);if(g>0&&g<1){let m=z.add(t.position,z.multiplyByScalar(p,-g,p),K7e),y=Zc.clone(t,$7e);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*=z.angleBetween(t.position,e.position)),u>=0&&(r.northAngle+=d),u<=0&&(r.southAngle+=d)}var ape=new Zc,J7e=new Zc,Md={northAngle:0,southAngle:0,westOverIdl:0,eastOverIdl:0};Ld.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,Md.northAngle=0,Md.southAngle=0,Md.westOverIdl=Number.POSITIVE_INFINITY,Md.eastOverIdl=Number.NEGATIVE_INFINITY;let r=e.length,o=Zc.fromCartesian(e[0],J7e);for(let a=1;a<r;a++){let s=Zc.fromCartesian(e[a],ape);ope(s,o,t,n,Md,i),o=Zc.clone(s,o)}return ope(Zc.fromCartesian(e[0],ape),o,t,n,Md,i),i.east-i.west>Md.eastOverIdl-Md.westOverIdl&&(i.west=Md.westOverIdl,i.east=Md.eastOverIdl,i.east>D.PI&&(i.east=i.east-D.TWO_PI),i.west>D.PI&&(i.west=i.west-D.TWO_PI)),D.equalsEpsilon(Math.abs(Md.northAngle),D.TWO_PI,D.EPSILON10)&&(i.north=D.PI_OVER_TWO,i.east=D.PI,i.west=-D.PI),D.equalsEpsilon(Math.abs(Md.southAngle),D.TWO_PI,D.EPSILON10)&&(i.south=-D.PI_OVER_TWO,i.east=D.PI,i.west=-D.PI),i};var Z7e=new Zc;function Q7e(e,t,n){return e.height>=D.PI||e.width>=D.PI?Zc.fromCartesian(t[0],Z7e).tangentPlane:Pa.fromPoints(t,n)}var spe=new de;function eWe(e,t,n){return(i,r)=>{if(e.height>=D.PI||e.width>=D.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],spe);r[a]=new z(s.longitude/D.PI,s.latitude/D.PI_OVER_TWO)}return r.length=i.length,r}return Zc.fromCartesianArray(i,r)}return Pa.fromPoints(t,n).projectPointsOntoPlane(i,r)}}function tWe(e,t,n){if(e.height>=D.PI||e.width>=D.PI)return(r,o)=>{if(e.south<0&&e.north>0){let a=n.cartesianToCartographic(r,spe);return l(o)||(o=new z),o.x=a.longitude/D.PI,o.y=a.latitude/D.PI_OVER_TWO,o}return Zc.fromCartesian(r,o)};let i=Pa.fromPoints(t,n);return(r,o)=>i.projectPointsOntoPlane(r,o)}function nWe(e,t,n,i){return(r,o)=>!i&&(e.height>=D.PI_OVER_TWO||e.width>=2*D.PI_OVER_THREE)?$n.splitPolygonsOnEquator(r,t,n,o):r}function iWe(e,t,n,i){if(t.height>=D.PI||t.width>=D.PI)return Je.fromRectangle(t,void 0,npe);let r=e,o=Pa.fromPoints(r,n);return $n.computeBoundingRectangle(o.plane.normal,o.projectPointOntoPlane.bind(o),r,i,npe)}Ld.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,eWe(g,p,n),!a,n,nWe(g,n,u,a)),y=m.hierarchy,A=m.polygons,b=function(I){return I},x=d?$n.polygonsFromHierarchy(f,!0,b,!1,n).polygons:void 0;if(y.length===0)return;let T=y[0].outerRing,C=iWe(T,g,n,r),E=[],w=e._height,P=e._extrudedHeight,R=e._perPositionHeightExtrude||!D.equalsEpsilon(w,P,0,D.EPSILON2),O={perPositionHeight:a,vertexFormat:t,geometry:void 0,rotationAxis:Q7e(g,T,n).plane.normal,projectTo2d:tWe(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(O.extrude=!0,O.top=s,O.bottom=c,O.shadowVolume=e._shadowVolume,O.offsetAttribute=e._offsetAttribute,N=0;N<A.length;N++){let I=G7e(n,A[N],d?x[N]:void 0,i,y[N],a,s,c,t,u),M;s&&c?(M=I.topAndBottom,O.geometry=$n.scaleToGeodeticHeightExtruded(M.geometry,w,P,n,a)):s?(M=I.topAndBottom,M.geometry.attributes.position.values=li.scaleToGeodeticHeight(M.geometry.attributes.position.values,w,n,!a),O.geometry=M.geometry):c&&(M=I.topAndBottom,M.geometry.attributes.position.values=li.scaleToGeodeticHeight(M.geometry.attributes.position.values,P,n,!0),O.geometry=M.geometry),(s||c)&&(O.wall=!1,M.geometry=RK(O),E.push(M));let F=I.walls;O.wall=!0;for(let V=0;V<F.length;V++){let k=F[V];O.geometry=$n.scaleToGeodeticHeightExtruded(k.geometry,w,P,n,a),k.geometry=RK(O),E.push(k)}}else for(N=0;N<A.length;N++){let I=new Nt({geometry:$n.createGeometryFromPositions(n,A[N],d?x[N]:void 0,i,a,t,u)});if(I.geometry.attributes.position.values=li.scaleToGeodeticHeight(I.geometry.attributes.position.values,w,n,!a),O.geometry=I.geometry,I.geometry=RK(O),l(e._offsetAttribute)){let M=I.geometry.attributes.position.values.length,F=e._offsetAttribute===hn.NONE?0:1,V=new Uint8Array(M/3).fill(F);I.geometry.attributes.applyOffset=new Me({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:V})}E.push(I)}let _=Hn.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 xt({attributes:v,indices:_.indices,primitiveType:_.primitiveType,boundingSphere:S,offsetAttribute:e._offsetAttribute})};Ld.createShadowVolume=function(e,t,n){let i=e._granularity,r=e._ellipsoid,o=t(i,r),a=n(i,r);return new Ld({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 rWe(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 xt._textureCoordinateRotationPoints(i,t,n,r)}Object.defineProperties(Ld.prototype,{rectangle:{get:function(){if(!l(this._rectangle)){let e=this._polygonHierarchy.positions;this._rectangle=Ld.computeRectangleFromPositions(e,this._ellipsoid,this._arcType)}return this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=rWe(this)),this._textureCoordinateRotationPoints}}});var mg=Ld;var cpe=[],A6=[];function oWe(e,t,n,i,r){let a=Pa.fromPoints(t,e).projectPointsOntoPlane(t,cpe);li.computeWindingOrder2D(a)===Wa.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,A6):r===sn.RHUMB&&(y=$n.subdivideRhumbLine(e,t[u],t[(u+1)%f],n,A6));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 Nt({geometry:new xt({attributes:new bn({position:new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:c})}),indices:g,primitiveType:Re.LINES})})}function aWe(e,t,n,i,r){let a=Pa.fromPoints(t,e).projectPointsOntoPlane(t,cpe);li.computeWindingOrder2D(a)===Wa.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,A6):r===sn.RHUMB&&(b=$n.subdivideRhumbLine(e,t[u],t[(u+1)%f],n,A6));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 Nt({geometry:new xt({attributes:new bn({position:new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:c})}),indices:y,primitiveType:Re.LINES})})}function mx(e){let t=e.polygonHierarchy,n=e.ellipsoid??te.default,i=e.granularity??D.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}mx.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 sWe=te.clone(te.UNIT_SPHERE),cWe={polygonHierarchy:{}};mx.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,sWe);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 mx(cWe)),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};mx.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 mx(t)};mx.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=D.chordLength(n,t.maximumRadius),f=e._height,d=e._extrudedHeight,p=e._perPositionHeightExtrude||!D.equalsEpsilon(f,d,0,D.EPSILON2),g,m;if(p)for(m=0;m<a.length;m++){if(s=aWe(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===hn.TOP?x=x.fill(1,0,b/2):(g=e._offsetAttribute===hn.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=oWe(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===hn.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=Hn.combineInstances(c)[0],A=se.fromVertices(y.attributes.position.values);return new xt({attributes:y.attributes,indices:y.indices,primitiveType:y.primitiveType,boundingSphere:A,offsetAttribute:e._offsetAttribute})};var u1=mx;var hpe=[];function lWe(e,t,n,i,r){let o=hpe;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 f1(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??D.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}f1.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 mpe=te.clone(te.UNIT_SPHERE),ppe=new Be,px={positions:void 0,colors:void 0,ellipsoid:mpe,vertexFormat:ppe,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};f1.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,mpe);t+=te.packedLength;let c=Be.unpack(e,t,ppe);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):(px.positions=o,px.colors=a,px.width=u,px.colorsPerVertex=f,px.arcType=d,px.granularity=p,new f1(px))};var lpe=new h,upe=new h,fpe=new h,dpe=new h;f1.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 M=0,F=d[0];i=i.filter(function(V,k){let j;return r?j=k===F||k===0&&F===1:j=k+1===F,j?(M++,F=d[M],!1):!0})}let g=p.length;if(g<2||t<=0)return;if(o===sn.GEODESIC||o===sn.RHUMB){let M,F;o===sn.GEODESIC?(M=D.chordLength(a,s.maximumRadius),F=Qi.numberOfPoints):(M=a,F=Qi.numberOfPointsRhumbLine);let V=Qi.extractHeights(p,s);if(l(i)){let k=1;for(c=0;c<g-1;++c)k+=F(p[c],p[c+1],M);let j=new Array(k),B=0;for(c=0;c<g-1;++c){let G=p[c],W=p[c+1],Q=i[c],q=F(G,W,M);if(r&&c<k){let J=i[c+1],Z=lWe(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,hpe.length=0}o===sn.GEODESIC?p=Qi.generateCartesianArc({positions:p,minDistance:M,ellipsoid:s,height:V}):p=Qi.generateCartesianRhumbArc({positions:p,granularity:M,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,P=0,R=0,O;for(u=0;u<g;++u){u===0?(O=lpe,h.subtract(p[0],p[1],O),h.add(p[0],O,O)):O=p[u-1],h.clone(O,fpe),h.clone(p[u],upe),u===g-1?(O=lpe,h.subtract(p[g-1],p[g-2],O),h.add(p[g-1],O,O)):O=p[u+1],h.clone(O,dpe);let M,F;l(C)&&(u!==0&&!r?M=i[u-1]:M=i[u],u!==g-1&&(F=i[u]));let V=u===0?2:0,k=u===g-1?2:4;for(f=V;f<k;++f){h.pack(upe,y,E),h.pack(fpe,A,E),h.pack(dpe,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[P++]=u/(g-1),T[P++]=Math.max(x[w-2],0)),l(C)){let B=f<2?M: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 bn;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,I=g-1;for(u=0;u<I;++u)_[S++]=v,_[S++]=v+2,_[S++]=v+1,_[S++]=v+1,_[S++]=v+2,_[S++]=v+3,v+=4;return new xt({attributes:N,indices:_,primitiveType:Re.TRIANGLES,boundingSphere:se.fromPoints(p),geometryType:_d.POLYLINES})};var pg=f1;function uWe(e,t,n,i){let r=new bn;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),P=1/n.height,R=n.height/2,O,N,_=0;for(d=0;d<s;d++){for(O=d*w,N=P*(t[0].y+R),E[_++]=O,E[_++]=N,p=1;p<o;p++)N=P*(t[p].y+R),E[_++]=O,E[_++]=N,E[_++]=O,E[_++]=N;N=P*(t[0].y+R),E[_++]=O,E[_++]=N}for(p=0;p<o;p++)O=0,N=P*(t[p].y+R),E[_++]=O,E[_++]=N;for(p=0;p<o;p++)O=(s-1)*w,N=P*(t[p].y+R),E[_++]=O,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,P=c[d+2]+T;f[x++]=E,f[x++]=w,f[x++]=P,f[x++]=P+o,f[x++]=w+o,f[x++]=E+o}let C=new xt({attributes:r,indices:f,boundingSphere:se.fromVertices(e),primitiveType:Re.TRIANGLES});if(i.normal&&(C=Hn.computeNormal(C)),i.tangent||i.bitangent){try{C=Hn.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 h1(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??Zi.ROUNDED,this._vertexFormat=Be.clone(e.vertexFormat??Be.DEFAULT),this._granularity=e.granularity??D.RADIANS_PER_DEGREE,this._workerName="createPolylineVolumeGeometry";let i=1+t.length*h.packedLength;i+=1+n.length*z.packedLength,this.packedLength=i+te.packedLength+Be.packedLength+2}h1.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+=z.packedLength)z.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 gpe=te.clone(te.UNIT_SPHERE),_pe=new Be,d1={polylinePositions:void 0,shapePositions:void 0,ellipsoid:gpe,vertexFormat:_pe,cornerType:void 0,granularity:void 0};h1.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+=z.packedLength)a[i]=z.unpack(e,t);let s=te.unpack(e,t,gpe);t+=te.packedLength;let c=Be.unpack(e,t,_pe);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):(d1.polylinePositions=o,d1.shapePositions=a,d1.cornerType=u,d1.granularity=f,new h1(d1))};var fWe=new Je;h1.createGeometry=function(e){let t=e._positions,n=Pr(t,h.equalsEpsilon),i=e._shape;if(i=jh.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;li.computeWindingOrder2D(i)===Wa.CLOCKWISE&&i.reverse();let r=Je.fromPoints(i,fWe),o=jh.computePositions(n,i,r,e,!0);return uWe(o,i,r,e._vertexFormat)};var m1=h1;function dWe(e,t){let n=new bn;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 xt({attributes:n,indices:Ve.createTypedArray(r,s),boundingSphere:se.fromVertices(e),primitiveType:Re.LINES})}function g1(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??Zi.ROUNDED,this._granularity=e.granularity??D.RADIANS_PER_DEGREE,this._workerName="createPolylineVolumeOutlineGeometry";let i=1+t.length*h.packedLength;i+=1+n.length*z.packedLength,this.packedLength=i+te.packedLength+2}g1.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+=z.packedLength)z.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 ype=te.clone(te.UNIT_SPHERE),p1={polylinePositions:void 0,shapePositions:void 0,ellipsoid:ype,height:void 0,cornerType:void 0,granularity:void 0};g1.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+=z.packedLength)a[i]=z.unpack(e,t);let s=te.unpack(e,t,ype);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):(p1.polylinePositions=o,p1.shapePositions=a,p1.cornerType=c,p1.granularity=u,new g1(p1))};var hWe=new Je;g1.createGeometry=function(e){let t=e._positions,n=Pr(t,h.equalsEpsilon),i=e._shape;if(i=jh.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;li.computeWindingOrder2D(i)===Wa.CLOCKWISE&&i.reverse();let r=Je.fromPoints(i,hWe),o=jh.computePositions(n,i,r,e,!1);return dWe(o,i)};var _1=g1;function Ape(){pe.throwInstantiationError()}Ape.prototype.getURL=pe.throwInstantiationError;var OK=Ape;function mWe(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 FE(e){e=e??H.EMPTY_OBJECT;let t=e.points,n=e.times;this._times=n,this._points=t,this._evaluateFunction=mWe(this),this._lastTimeIndex=0}Object.defineProperties(FE.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});FE.prototype.findTimeInterval=xr.prototype.findTimeInterval;FE.prototype.wrapTime=xr.prototype.wrapTime;FE.prototype.clampTime=xr.prototype.clampTime;FE.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var y1=FE;function b6(e,t,n=0,i=e.length-1,r=pWe){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));b6(e,t,g,m,r)}let o=e[t],a=n,s=i;for(A1(e,n,t),r(e[i],o)>0&&A1(e,n,i);a<s;){for(A1(e,a,s),a++,s--;r(e[a],o)<0;)a++;for(;r(e[s],o)>0;)s--}r(e[n],o)===0?A1(e,n,s):(s++,A1(e,s,i)),s<=t&&(n=s+1),t<=s&&(i=s-1)}}function A1(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function pWe(e,t){return e<t?-1:e>t?1:0}var T1=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(!T6(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;T6(t,c)&&(n.leaf?i.push(s):LK(t,c)?this._all(s,i):o.push(s))}n=o.pop()}return i}collides(t){let n=this.data;if(!T6(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(T6(t,a)){if(n.leaf||LK(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=kE([]),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=gWe(t,i.children,n);if(f!==-1)return i.children.splice(f,1),o.push(i),this._condense(o),this}!u&&!i.leaf&&LK(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=kE(t.slice(n,i+1)),BE(s,this.toBBox),s;r||(r=Math.ceil(Math.log(o)/Math.log(a)),a=Math.ceil(o/Math.pow(a,r-1))),s=kE([]),s.leaf=!1,s.height=r;let c=Math.ceil(o/a),u=c*Math.ceil(Math.sqrt(a));bpe(t,n,i,u,this.compareMinX);for(let f=n;f<=i;f+=u){let d=Math.min(f+u-1,i);bpe(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 BE(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=MK(u),d=AWe(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),x1(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=kE(i.children.splice(a,i.children.length-a));s.height=i.height,s.leaf=i.leaf,BE(i,this.toBBox),BE(s,this.toBBox),n?t[n-1].children.push(s):this._splitRoot(i,s)}_splitRoot(t,n){this.data=kE([t,n]),this.data.height=t.height+1,this.data.leaf=!1,BE(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=b1(t,0,s,this.toBBox),u=b1(t,s,i,this.toBBox),f=bWe(c,u),d=MK(c)+MK(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:_We,o=t.leaf?this.compareMinY:yWe,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=b1(t,0,n,o),s=b1(t,i-n,i,o),c=x6(a)+x6(s);for(let u=n;u<i-n;u++){let f=t.children[u];x1(a,t.leaf?o(f):f),c+=x6(a)}for(let u=i-n-1;u>=n;u--){let f=t.children[u];x1(s,t.leaf?o(f):f),c+=x6(s)}return c}_adjustParentBBoxes(t,n,i){for(let r=i;r>=0;r--)x1(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():BE(t[n],this.toBBox)}};function gWe(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 BE(e,t){b1(e,0,e.children.length,t,e)}function b1(e,t,n,i,r){r||(r=kE(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];x1(r,e.leaf?i(a):a)}return r}function x1(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 _We(e,t){return e.minX-t.minX}function yWe(e,t){return e.minY-t.minY}function MK(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function x6(e){return e.maxX-e.minX+(e.maxY-e.minY)}function AWe(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 bWe(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 LK(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function T6(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function kE(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function bpe(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;b6(e,a,t,n,r),o.push(t,a,a,n)}}function C6(){this._tree=new T1}function gx(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.id=""}gx.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};C6.prototype.insert=function(e,t){let n=gx.fromRectangleAndId(e,t,new gx);this._tree.insert(n)};function xWe(e,t){return e.id===t.id}var TWe=new gx;C6.prototype.remove=function(e,t){let n=gx.fromRectangleAndId(e,t,TWe);this._tree.remove(n,xWe)};var CWe=new gx;C6.prototype.collides=function(e){let t=gx.fromRectangleAndId("",e,CWe);return this._tree.collides(t)};var _x=C6;var xpe=Math.cos,Tpe=Math.sin,vWe=Math.sqrt,NK={};NK.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=xpe(f),p=Tpe(f),g=s.z*p,m=c.longitude+i*e.granYSin+r*e.granXCos,y=d*xpe(m),A=d*Tpe(m),b=s.x*y,x=s.y*A,T=vWe(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 EWe=new Ki,Nd=new h,SWe=new de,v6=new h,C1=new Bi;function Cpe(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;C1._ellipsoid=te.default,Nd=C1.project(e,Nd),Nd=h.subtract(Nd,v6,Nd);let g=Ki.fromRotation(t,EWe);Nd=Ki.multiplyByVector(g,Nd,Nd),Nd=h.add(Nd,v6,Nd),e=C1.unproject(Nd,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,P=C+a*d+o*u,R=Math.max(C,E,w,P),O=Math.min(C,E,w,P);return{north:x,south:T,east:R,west:O,granYCos:c,granYSin:d,granXCos:u,granXSin:p,nwCorner:e}}NK.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===D.PI_OVER_TWO&&(d=!0),f===-D.PI_OVER_TWO&&(p=!0);let g,m=u-f;c>s?g=D.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,SWe);(n!==0||i!==0)&&(C.longitude<T.longitude&&(C.longitude+=D.TWO_PI),C1._ellipsoid=te.default,v6=C1.project(C,v6));let E=x,w=b,P=0,R=0,O=ie.clone(e,r),N={granYCos:E,granYSin:P,granXCos:w,granXSin:R,nwCorner:T,boundingRectangle:O,width:y,height:A,northCap:d,southCap:p};if(n!==0){let _=Cpe(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,O.north=u,O.south=f,O.east=s,O.west=c}if(i!==0){n=n-i;let _=ie.northwest(O,a),v=Cpe(_,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 hs=NK;var FK=new h,Spe=new h,wpe=new h,Ipe=new h,Ppe=new ie,wWe=new z,IWe=new se,PWe=new se;function Dpe(e,t){let n=new xt({attributes:new bn,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 DWe(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=Ipe,f=wpe,d=Spe;if(t.normal||t.tangent||t.bitangent)for(let p=0;p<r;p+=3){let g=h.fromArray(e,p,FK),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 Dpe(t,{positions:e,normals:o,tangents:a,bitangents:s})}var BK=new h,Rpe=new h;function RWe(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=Ipe,p=wpe,g=Spe;if(t.normal||t.tangent||t.bitangent)for(let m=0;m<i;m+=6){let y=h.fromArray(e,m,FK),A=h.fromArray(e,(m+6)%i,BK);if(f){let b=h.fromArray(e,(m+3)%i,Rpe);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,D.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 Dpe(t,{positions:e,normals:r,tangents:o,bitangents:a})}function Ope(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=FK,b=wWe,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)hs.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&&(hs.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&&(hs.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=DWe(p,n,i,t.tangentRotationMatrix),P=6*(o-1)*(f-1);a&&(P+=3*(o-1)),s&&(P+=3*(o-1));let R=Ve.createTypedArray(d,P),O=0,N=0,_;for(_=0;_<f-1;++_){for(let v=0;v<o-1;++v){let S=O,I=S+o,M=I+1,F=S+1;R[N++]=S,R[N++]=I,R[N++]=F,R[N++]=F,R[N++]=I,R[N++]=M,++O}++O}if(a||s){let v=d-1,S=d-1;a&&s&&(v=d-2);let I,M;if(O=0,a)for(_=0;_<o-1;_++)I=O,M=I+1,R[N++]=v,R[N++]=I,R[N++]=M,++O;if(s)for(O=(f-1)*o,_=0;_<o-1;_++)I=O,M=I+1,R[N++]=I,R[N++]=S,R[N++]=M,++O}return w.indices=R,n.st&&(w.attributes.st=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:g})),w}function zE(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 UE(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 kK=new Be;function OWe(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,kK);we.normal=!0,e._vertexFormat=we}let d=Ope(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 P,R=l(i);if(R){let we=g/3*2,We=new Uint8Array(we);i===hn.TOP?We=We.fill(1,0,we/2):(P=i===hn.NONE?0:1,We=We.fill(P)),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 O=d.indices,N=O.length,_=g/3,v=Ve.createTypedArray(m/3,N*2);for(v.set(O),f=0;f<N;f+=3)v[f+N]=O[f+2]+_,v[f+1+N]=O[f+1]+_,v[f+2+N]=O[f]+_;d.indices=v;let S=t.northCap,I=t.southCap,M=c,F=2,V=0,k=4,j=4;S&&(F-=1,M-=1,V+=1,k-=2,j-=1),I&&(F-=1,M-=1,V+=1,k-=2,j-=1),V+=F*u+2*M-k;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===hn.TOP;R&&!J&&(P=i===hn.ALL?1:0,Q=Q.fill(P));let Z=0,ce=0,Ae=0,le=0,Ce=u*M,ye;for(f=0;f<Ce;f+=u)ye=f*3,G=zE(G,Z,ye,p,A),Z+=6,r.st&&(q=UE(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(I){let we=S?Ce+1:Ce;for(ye=we*3,f=0;f<2;f++)G=zE(G,Z,ye,p,A),Z+=6,r.st&&(q=UE(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=zE(G,Z,ye,p,A),Z+=6,r.st&&(q=UE(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=zE(G,Z,ye,p,A),Z+=6,r.st&&(q=UE(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=zE(G,Z,ye,p,A),Z+=6,r.st&&(q=UE(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=zE(G,Z,ye,p,A),Z+=6,r.st&&(q=UE(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=RWe(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,Xe,At;g=G.length/3;let Ke=0;for(f=0;f<g-1;f+=2){Le=f,At=(Le+2)%g;let we=h.fromArray(G,Le*3,BK),We=h.fromArray(G,At*3,Rpe);h.equalsEpsilon(we,We,D.EPSILON10)||($e=(Le+1)%g,Xe=($e+2)%g,Ie[Ke++]=Le,Ie[Ke++]=$e,Ie[Ke++]=At,Ie[Ke++]=At,Ie[Ke++]=$e,Ie[Ke++]=Xe)}return ve.indices=Ie,ve=Hn.combineInstances([new Nt({geometry:d}),new Nt({geometry:ve})]),ve[0]}var MWe=[new h,new h,new h,new h],Mpe=new de,LWe=new de;function zK(e,t,n,i,r){if(n===0)return ie.clone(e,r);let o=hs.computeOptions(e,t,n,0,Ppe,Mpe),a=o.height,s=o.width,c=MWe;return hs.computePosition(o,i,!1,0,0,c[0]),hs.computePosition(o,i,!1,0,s-1,c[1]),hs.computePosition(o,i,!1,a-1,0,c[2]),hs.computePosition(o,i,!1,a-1,s-1,c[3]),ie.fromCartesianArray(c,i,r)}function Fp(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??D.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}Fp.packedLength=ie.packedLength+te.packedLength+Be.packedLength+7;Fp.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 Lpe=new ie,Npe=te.clone(te.UNIT_SPHERE),jy={rectangle:Lpe,ellipsoid:Npe,vertexFormat:kK,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};Fp.unpack=function(e,t,n){t=t??0;let i=ie.unpack(e,t,Lpe);t+=ie.packedLength;let r=te.unpack(e,t,Npe);t+=te.packedLength;let o=Be.unpack(e,t,kK);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):(jy.granularity=a,jy.height=s,jy.rotation=c,jy.stRotation=u,jy.extrudedHeight=f,jy.shadowVolume=d,jy.offsetAttribute=p===-1?void 0:p,new Fp(jy))};Fp.computeRectangle=function(e,t){e=e??H.EMPTY_OBJECT;let n=e.rectangle,i=e.granularity??D.RADIANS_PER_DEGREE,r=e.ellipsoid??te.default,o=e.rotation??0;return zK(n,i,o,r,t)};var NWe=new $,vpe=new Fe,FWe=new de;Fp.createGeometry=function(e){if(D.equalsEpsilon(e._rectangle.north,e._rectangle.south,D.EPSILON10)||D.equalsEpsilon(e._rectangle.east,e._rectangle.west,D.EPSILON10))return;let t=e._rectangle,n=e._ellipsoid,i=e._rotation,r=e._stRotation,o=e._vertexFormat,a=hs.computeOptions(t,e._granularity,i,r,Ppe,Mpe,LWe),s=NWe;if(r!==0||i!==0){let g=ie.center(t,FWe),m=n.geodeticSurfaceNormalCartographic(g,BK);Fe.fromAxisAngle(m,-r,vpe),$.fromQuaternion(vpe,s)}else $.clone($.IDENTITY,s);let c=e._surfaceHeight,u=e._extrudedHeight,f=!D.equalsEpsilon(c,u,0,D.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=OWe(e,a);let g=se.fromRectangle3D(t,n,c,PWe),m=se.fromRectangle3D(t,n,u,IWe);p=se.union(g,m)}else{if(d=Ope(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===hn.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 xt({attributes:d.attributes,indices:d.indices,primitiveType:d.primitiveType,boundingSphere:p,offsetAttribute:e._offsetAttribute})};Fp.createShadowVolume=function(e,t,n){let i=e._granularity,r=e._ellipsoid,o=t(i,r),a=n(i,r);return new Fp({rectangle:e._rectangle,rotation:e._rotation,ellipsoid:r,stRotation:e._stRotation,granularity:i,extrudedHeight:a,height:o,vertexFormat:Be.POSITION_ONLY,shadowVolume:!0})};var Epe=new ie,BWe=[new z,new z,new z],kWe=new Ki,zWe=new de;function UWe(e){if(e._stRotation===0)return[0,0,0,1,1,0];let t=ie.clone(e._rectangle,Epe),n=e._granularity,i=e._ellipsoid,r=e._rotation-e._stRotation,o=zK(t,n,r,i,Epe),a=BWe;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=Ki.fromRotation(e._stRotation,kWe),u=ie.center(s,zWe);for(let m=0;m<3;++m){let y=a[m];y.x-=u.longitude,y.y-=u.latitude,Ki.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 z.pack(f,g),z.pack(d,g,2),z.pack(p,g,4),g}Object.defineProperties(Fp.prototype,{rectangle:{get:function(){return l(this._rotatedRectangle)||(this._rotatedRectangle=zK(this._rectangle,this._granularity,this._rotation,this._ellipsoid)),this._rotatedRectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=UWe(this)),this._textureCoordinateRotationPoints}}});var yx=Fp;var VWe=new se,jWe=new se,HWe=new h,GWe=new ie;function Fpe(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=HWe;if(o)hs.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++)hs.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++)hs.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--)hs.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--)hs.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 xt({attributes:new bn,primitiveType:Re.LINES});return T.attributes.position=new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:d}),T.indices=b,T}function WWe(e,t){let n=e._surfaceHeight,i=e._extrudedHeight,r=e._ellipsoid,o=Fpe(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 jE(e){e=e??H.EMPTY_OBJECT;let t=e.rectangle,n=e.granularity??D.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"}jE.packedLength=ie.packedLength+te.packedLength+5;jE.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 Bpe=new ie,kpe=te.clone(te.UNIT_SPHERE),VE={rectangle:Bpe,ellipsoid:kpe,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0,offsetAttribute:void 0};jE.unpack=function(e,t,n){t=t??0;let i=ie.unpack(e,t,Bpe);t+=ie.packedLength;let r=te.unpack(e,t,kpe);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):(VE.granularity=o,VE.height=a,VE.rotation=s,VE.extrudedHeight=c,VE.offsetAttribute=u===-1?void 0:u,new jE(VE))};var qWe=new de;jE.createGeometry=function(e){let t=e._rectangle,n=e._ellipsoid,i=hs.computeOptions(t,e._granularity,e._rotation,0,GWe,qWe),r,o;if(D.equalsEpsilon(t.north,t.south,D.EPSILON10)||D.equalsEpsilon(t.east,t.west,D.EPSILON10))return;let a=e._surfaceHeight,s=e._extrudedHeight,c=!D.equalsEpsilon(a,s,0,D.EPSILON2),u;if(c){if(r=WWe(e,i),l(e._offsetAttribute)){let p=r.attributes.position.values.length/3,g=new Uint8Array(p);e._offsetAttribute===hn.TOP?g=g.fill(1,0,p/2):(u=e._offsetAttribute===hn.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,jWe),d=se.fromRectangle3D(t,n,s,VWe);o=se.union(f,d)}else{if(r=Fpe(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===hn.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 xt({attributes:r.attributes,indices:r.indices,primitiveType:Re.LINES,boundingSphere:o,offsetAttribute:e._offsetAttribute})};var Ax=jE;var zpe={FIXED:0,INERTIAL:1};Object.freeze(zpe);var Ui=zpe;var bx=30,YWe=1<<bx,XWe=1<<bx+1>>>0,UK=2*bx+1,Hy=4,jpe=[],Hpe=[],KWe=[[0,1,3,2],[0,2,3,1],[3,2,0,1],[3,1,0,2]],Gy=1,HE=2,E6=[Gy,0,0,Gy|HE];function Oa(e){if(!fn.supportsBigInt())throw new oe("S2 required BigInt support");this._cellId=e,this._level=Oa.getLevel(e)}Oa.fromToken=function(e){return new Oa(Oa.getIdFromToken(e))};Oa.isValidId=function(e){return!(e<=0||e>>BigInt(UK)>5||!(e&~e+BigInt(1)&BigInt("0x1555555555555555")))};Oa.isValidToken=function(e){return/^[0-9a-fA-F]{1,16}$/.test(e)?Oa.isValidId(Oa.getIdFromToken(e)):!1};Oa.getIdFromToken=function(e){return BigInt("0x"+e+"0".repeat(16-e.length))};Oa.getTokenFromId=function(e){let t=Math.floor(oqe(e)/4),n=e.toString(16).replace(/0*$/,"");return Array(17-t-n.length).join("0")+n};Oa.getLevel=function(e){let t=0;for(;e!==BigInt(0)&&!(e&BigInt(1));)t++,e=e>>BigInt(1);return bx-(t>>1)};Oa.prototype.getChild=function(e){let t=qpe(this._cellId)>>BigInt(2),n=this._cellId+BigInt(2*e+1-4)*t;return new Oa(n)};Oa.prototype.getParent=function(){let e=qpe(this._cellId)<<BigInt(2);return new Oa(this._cellId&~e+BigInt(1)|e)};Oa.prototype.getParentAtLevel=function(e){let t=iqe(e);return new Oa(this._cellId&-t|t)};Oa.prototype.getCenter=function(e){e=e??te.WGS84;let t=$We(this._cellId,this._level);t=h.normalize(t,t);let n=de.fromCartesian(t,te.UNIT_SPHERE);return de.toCartesian(n,e,new h)};Oa.prototype.getVertex=function(e,t){t=t??te.WGS84;let n=JWe(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)};Oa.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(UK-2*n).join("0"),s=BigInt(`0b${i}${o}${r}1${a}`);return new Oa(s)};function $We(e,t){let n=ZWe(e,t);return QWe(n[0],n[1],n[2])}function JWe(e,t,n){let i=Gpe(e,t),r=eqe([i[1],i[2]],t),o=n>>1&1;return Wpe(i[0],r[0][o^n&1],r[1][o])}function ZWe(e,t){let n=Gpe(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 Gpe(e){jpe.length===0&&nqe();let t=Number(e>>BigInt(UK)),n=t&Gy,i=(1<<Hy)-1,r=0,o=0;for(let a=7;a>=0;a--){let c=(1<<2*(a===7?bx-7*Hy:Hy))-1;n+=Number(e>>BigInt(a*2*Hy+1)&BigInt(c))<<2,n=Hpe[n];let u=a*Hy;r+=n>>Hy+2<<u,o+=(n>>2&i)<<u,n&=Gy|HE}return[t,r,o]}function QWe(e,t,n){let i=Upe(t),r=Upe(n),o=S6(i),a=S6(r);return Wpe(e,o,a)}function Wpe(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 S6(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function Upe(e){return 1/XWe*e}function eqe(e,t){let n=[[],[]],i=tqe(t);for(let r=0;r<2;++r){let o=e[r]&-i,a=o+i;n[r][0]=S6(Vpe(o)),n[r][1]=S6(Vpe(a))}return n}function tqe(e){return 1<<bx-e>>>0}function Vpe(e){return 1/YWe*e}function Wy(e,t,n,i,r,o){if(e===Hy){let a=(t<<Hy)+n;jpe[(a<<2)+i]=(r<<2)+o,Hpe[(r<<2)+i]=(a<<2)+o}else{e++,t<<=1,n<<=1,r<<=2;let a=KWe[o];Wy(e,t+(a[0]>>1),n+(a[0]&1),i,r,o^E6[0]),Wy(e,t+(a[1]>>1),n+(a[1]&1),i,r+1,o^E6[1]),Wy(e,t+(a[2]>>1),n+(a[2]&1),i,r+2,o^E6[2]),Wy(e,t+(a[3]>>1),n+(a[3]&1),i,r+3,o^E6[3])}}function nqe(){Wy(0,0,0,0,0,0),Wy(0,0,0,Gy,0,Gy),Wy(0,0,0,HE,0,HE),Wy(0,0,0,Gy|HE,0,Gy|HE)}function qpe(e){return e&~e+BigInt(1)}function iqe(e){return BigInt(1)<<BigInt(2*(bx-e))}var rqe=[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 oqe(e){return rqe[(-e&e)%BigInt(67)]}var gg=Oa;var Ype={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(Ype);var cn=Ype;function qy(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 qK(e,t){if(!l(t))return`${e}`;let n=Array.isArray(t)?t.toSorted():[t];return`${e}+${n.join("+")}`}function xx(e){let t=[];if(e.shiftKey&&t.push(Gr.SHIFT),e.ctrlKey&&t.push(Gr.CTRL),e.altKey&&t.push(Gr.ALT),t.length)return t}var ma={LEFT:0,MIDDLE:1,RIGHT:2};function yf(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 aqe(e){let t=e._element,n=l(t.disableRootEvents)?t:document;fn.supportsPointerEvents()?(yf(e,"pointerdown",t,dqe),yf(e,"pointerup",t,i0e),yf(e,"pointermove",t,hqe),yf(e,"pointercancel",t,i0e)):(yf(e,"mousedown",t,r0e),yf(e,"mouseup",n,o0e),yf(e,"mousemove",n,a0e),yf(e,"touchstart",t,uqe),yf(e,"touchend",n,Zpe),yf(e,"touchmove",n,fqe),yf(e,"touchcancel",n,Zpe)),yf(e,"dblclick",t,cqe);let i;"onwheel"in t?i="wheel":document.onmousewheel!==void 0?i="mousewheel":i="DOMMouseScroll",yf(e,i,t,lqe)}function sqe(e){let t=e._removalFunctions;for(let n=0;n<t.length;++n)t[n]()}var Xpe={position:new z};function YK(e){e._lastSeenTouchEvent=yn()}function XK(e){return yn()-e._lastSeenTouchEvent>qh.mouseEmulationIgnoreMilliseconds}function WK(e,t,n){let i=e.x-t.x,r=e.y-t.y;return Math.sqrt(i*i+r*r)<n}function r0e(e,t){if(!XK(e))return;let n=t.button;e._buttonDown[n]=!0;let i;if(n===ma.LEFT)i=cn.LEFT_DOWN;else if(n===ma.MIDDLE)i=cn.MIDDLE_DOWN;else if(n===ma.RIGHT)i=cn.RIGHT_DOWN;else return;let r=qy(e,t,e._primaryPosition);z.clone(r,e._primaryStartPosition),z.clone(r,e._primaryPreviousPosition);let o=xx(t),a=e.getInputAction(i,o);l(a)&&(z.clone(r,Xpe.position),a(Xpe),t.preventDefault())}var Kpe={position:new z},$pe={position:new z};function VK(e,t,n,i){let r=xx(i),o=e.getInputAction(t,r),a=e.getInputAction(n,r);if(l(o)||l(a)){let s=qy(e,i,e._primaryPosition);if(l(o)&&(z.clone(s,Kpe.position),o(Kpe)),l(a)){let c=e._primaryStartPosition;WK(c,s,e._clickPixelTolerance)&&(z.clone(s,$pe.position),a($pe))}}}function o0e(e,t){if(!XK(e))return;let n=t.button;n!==ma.LEFT&&n!==ma.MIDDLE&&n!==ma.RIGHT||(e._buttonDown[ma.LEFT]&&(VK(e,cn.LEFT_UP,cn.LEFT_CLICK,t),e._buttonDown[ma.LEFT]=!1),e._buttonDown[ma.MIDDLE]&&(VK(e,cn.MIDDLE_UP,cn.MIDDLE_CLICK,t),e._buttonDown[ma.MIDDLE]=!1),e._buttonDown[ma.RIGHT]&&(VK(e,cn.RIGHT_UP,cn.RIGHT_CLICK,t),e._buttonDown[ma.RIGHT]=!1))}var jK={startPosition:new z,endPosition:new z};function a0e(e,t){if(!XK(e))return;let n=xx(t),i=qy(e,t,e._primaryPosition),r=e._primaryPreviousPosition,o=e.getInputAction(cn.MOUSE_MOVE,n);l(o)&&(z.clone(r,jK.startPosition),z.clone(i,jK.endPosition),o(jK)),z.clone(i,r),(e._buttonDown[ma.LEFT]||e._buttonDown[ma.MIDDLE]||e._buttonDown[ma.RIGHT])&&t.preventDefault()}var Jpe={position:new z};function cqe(e,t){let n=t.button,i;if(n===ma.LEFT)i=cn.LEFT_DOUBLE_CLICK;else return;let r=xx(t),o=e.getInputAction(i,r);l(o)&&(qy(e,t,Jpe.position),o(Jpe))}function lqe(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=xx(t),r=e.getInputAction(cn.WHEEL,i);l(r)&&(r(n),t.preventDefault())}function uqe(e,t){YK(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,qy(e,o,new z));w6(e,t);let c=e._previousPositions;for(i=0;i<r;++i)o=n[i],a=o.identifier,c.set(a,z.clone(s.get(a)))}function Zpe(e,t){YK(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);w6(e,t);let c=e._previousPositions;for(i=0;i<r;++i)o=n[i],a=o.identifier,c.remove(a)}var Qpe={position:new z},HK={position1:new z,position2:new z},e0e={position:new z},t0e={position:new z},n0e={position:new z};function w6(e,t){let n=xx(t),i=e._positions,r=i.length,o,a,s=e._isPinching;if(r!==1&&e._buttonDown[ma.LEFT]){if(e._buttonDown[ma.LEFT]=!1,l(e._touchHoldTimer)&&(clearTimeout(e._touchHoldTimer),e._touchHoldTimer=void 0),o=e.getInputAction(cn.LEFT_UP,n),l(o)&&(z.clone(e._primaryPosition,e0e.position),o(e0e)),r===0&&!e._isTouchHolding&&(a=e.getInputAction(cn.LEFT_CLICK,n),l(a))){let c=e._primaryStartPosition,u=e._previousPositions.values[0];WK(c,u,e._clickPixelTolerance)&&(z.clone(e._primaryPosition,t0e.position),a(t0e))}e._isTouchHolding=!1}if(r===0&&s&&(e._isPinching=!1,o=e.getInputAction(cn.PINCH_END,n),l(o)&&o()),r===1&&!s){let c=i.values[0];z.clone(c,e._primaryPosition),z.clone(c,e._primaryStartPosition),z.clone(c,e._primaryPreviousPosition),e._buttonDown[ma.LEFT]=!0,o=e.getInputAction(cn.LEFT_DOWN,n),l(o)&&(z.clone(c,Qpe.position),o(Qpe)),e._touchHoldTimer=setTimeout(function(){if(!e.isDestroyed()&&(e._touchHoldTimer=void 0,e._isTouchHolding=!0,a=e.getInputAction(cn.RIGHT_CLICK,n),l(a))){let u=e._primaryStartPosition,f=e._previousPositions.values[0];WK(u,f,e._holdPixelTolerance)&&(z.clone(e._primaryPosition,n0e.position),a(n0e))}},qh.touchHoldDelayMilliseconds),t.preventDefault()}r===2&&!s&&(e._isPinching=!0,o=e.getInputAction(cn.PINCH_START,n),l(o)&&(z.clone(i.values[0],HK.position1),z.clone(i.values[1],HK.position2),o(HK),t.preventDefault()))}function fqe(e,t){YK(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)&&qy(e,o,u)}s0e(e,t);let c=e._previousPositions;for(i=0;i<r;++i)o=n[i],a=o.identifier,z.clone(s.get(a),c.get(a))}var GK={startPosition:new z,endPosition:new z},v1={distance:{startPosition:new z,endPosition:new z},angleAndHeight:{startPosition:new z,endPosition:new z}};function s0e(e,t){let n=xx(t),i=e._positions,r=e._previousPositions,o=i.length,a;if(o===1&&e._buttonDown[ma.LEFT]){let s=i.values[0];z.clone(s,e._primaryPosition);let c=e._primaryPreviousPosition;a=e.getInputAction(cn.MOUSE_MOVE,n),l(a)&&(z.clone(c,GK.startPosition),z.clone(s,GK.endPosition),a(GK)),z.clone(s,c),t.preventDefault()}else if(o===2&&e._isPinching&&(a=e.getInputAction(cn.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);z.fromElements(0,A,v1.distance.startPosition),z.fromElements(0,g,v1.distance.endPosition),z.fromElements(C,x,v1.angleAndHeight.startPosition),z.fromElements(T,b,v1.angleAndHeight.endPosition),a(v1)}}function dqe(e,t){if(t.target.setPointerCapture(t.pointerId),t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.set(i,qy(e,t,new z)),w6(e,t),e._previousPositions.set(i,z.clone(n.get(i)))}else r0e(e,t)}function i0e(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.remove(i),w6(e,t),e._previousPositions.remove(i)}else o0e(e,t)}function hqe(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId,r=n.get(i);if(!l(r))return;qy(e,t,r),s0e(e,t);let o=e._previousPositions;z.clone(n.get(i),o.get(i))}else a0e(e,t)}function qh(e){this._inputEvents={},this._buttonDown={[ma.LEFT]:!1,[ma.MIDDLE]:!1,[ma.RIGHT]:!1},this._isPinching=!1,this._isTouchHolding=!1,this._lastSeenTouchEvent=-qh.mouseEmulationIgnoreMilliseconds,this._primaryStartPosition=new z,this._primaryPosition=new z,this._primaryPreviousPosition=new z,this._positions=new kt,this._previousPositions=new kt,this._removalFunctions=[],this._touchHoldTimer=void 0,this._clickPixelTolerance=5,this._holdPixelTolerance=25,this._element=e??document,aqe(this)}qh.prototype.setInputAction=function(e,t,n){let i=qK(t,n);this._inputEvents[i]=e};qh.prototype.getInputAction=function(e,t){let n=qK(e,t);return this._inputEvents[n]};qh.prototype.removeInputAction=function(e,t){let n=qK(e,t);delete this._inputEvents[n]};qh.prototype.isDestroyed=function(){return!1};qh.prototype.destroy=function(){return sqe(this),ue(this)};qh.mouseEmulationIgnoreMilliseconds=800;qh.touchHoldDelayMilliseconds=1500;var Ka=qh;function I6(e){e=e??!0,this.value=I6.toValue(e)}Object.defineProperties(I6.prototype,{componentDatatype:{get:function(){return Y.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 1}},normalize:{get:function(){return!1}}});I6.toValue=function(e,t){return l(t)?(t[0]=e,t):new Uint8Array([e])};var Dn=I6;var KK={};function mqe(e){let t=6.239996+.0172019696544*e;return .001657*Math.sin(t+.01671*Math.sin(t))}var pqe=32.184,gqe=2451545;function S0e(e,t){t=K.addSeconds(e,pqe,t);let n=K.totalDays(t)-gqe;return t=K.addSeconds(t,mqe(n),t),t}var P6=new K(2451545,0,ri.TAI),_qe=1e3,Fd=D.RADIANS_PER_DEGREE,Af=D.RADIANS_PER_ARCSECOND,Oc=14959787e4,c0e=new $;function w0e(e,t,n,i,r,o,a){n<0&&(n=-n,r+=D.PI);let s=e*(1-t),c=i-r,u=r,f=Aqe(o-i,t),d=yqe(t,0);vqe(c,n,u,c0e);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(c0e,a,a)}function yqe(e,t){return e<=t?"Circular":e<1-t?"Elliptical":e<=1+t?"Parabolic":"Hyperbolic"}function Aqe(e,t){let n=Tqe(e,t);return Cqe(n,t)}var bqe=50,xqe=D.EPSILON8;function Tqe(e,t){let n=Math.floor(e/D.TWO_PI);e-=n*D.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<bqe&&Math.abs(r-i)>xqe;++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*D.TWO_PI,r}function Cqe(e,t){let n=Math.floor(e/D.TWO_PI);e-=n*D.TWO_PI;let i=Math.cos(e)-t,r=Math.sin(e)*Math.sqrt(1-t*t),o=Math.atan2(r,i);return o=D.zeroToTwoPi(o),e<0&&(o-=D.TWO_PI),o+=n*D.TWO_PI,o}function vqe(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 Eqe=1.0000010178*Oc,Sqe=100.46645683*Fd,wqe=129597742283429e-5*Af,l0e=16002,u0e=21863,f0e=32004,d0e=10931,h0e=14529,m0e=16368,p0e=15318,g0e=32794,Iqe=64*1e-7*Oc,Pqe=-152*1e-7*Oc,Dqe=62*1e-7*Oc,Rqe=-8*1e-7*Oc,Oqe=32*1e-7*Oc,Mqe=-41*1e-7*Oc,Lqe=19*1e-7*Oc,Nqe=-11*1e-7*Oc,Fqe=-150*1e-7*Oc,Bqe=-46*1e-7*Oc,kqe=68*1e-7*Oc,zqe=54*1e-7*Oc,Uqe=14*1e-7*Oc,Vqe=24*1e-7*Oc,jqe=-28*1e-7*Oc,Hqe=22*1e-7*Oc,_0e=10,y0e=16002,A0e=21863,b0e=10931,x0e=1473,T0e=32004,C0e=4387,v0e=73,Gqe=-325*1e-7,Wqe=-322*1e-7,qqe=-79*1e-7,Yqe=232*1e-7,Xqe=-52*1e-7,Kqe=97*1e-7,$qe=55*1e-7,Jqe=-41*1e-7,Zqe=-105*1e-7,Qqe=-137*1e-7,eYe=258*1e-7,tYe=35*1e-7,nYe=-116*1e-7,iYe=-88*1e-7,rYe=-112*1e-7,oYe=-80*1e-7,GE=new K(0,0,ri.TAI);function aYe(e,t){S0e(e,GE);let i=(GE.dayNumber-P6.dayNumber+(GE.secondsOfDay-P6.secondsOfDay)/zn.SECONDS_PER_DAY)/(zn.DAYS_PER_JULIAN_CENTURY*10),r=.3595362*i,o=Eqe+Iqe*Math.cos(l0e*r)+Fqe*Math.sin(l0e*r)+Pqe*Math.cos(u0e*r)+Bqe*Math.sin(u0e*r)+Dqe*Math.cos(f0e*r)+kqe*Math.sin(f0e*r)+Rqe*Math.cos(d0e*r)+zqe*Math.sin(d0e*r)+Oqe*Math.cos(h0e*r)+Uqe*Math.sin(h0e*r)+Mqe*Math.cos(m0e*r)+Vqe*Math.sin(m0e*r)+Lqe*Math.cos(p0e*r)+jqe*Math.sin(p0e*r)+Nqe*Math.cos(g0e*r)+Hqe*Math.sin(g0e*r),a=Sqe+wqe*i+Gqe*Math.cos(_0e*r)+Zqe*Math.sin(_0e*r)+Wqe*Math.cos(y0e*r)+Qqe*Math.sin(y0e*r)+qqe*Math.cos(A0e*r)+eYe*Math.sin(A0e*r)+Yqe*Math.cos(b0e*r)+tYe*Math.sin(b0e*r)+Xqe*Math.cos(x0e*r)+nYe*Math.sin(x0e*r)+Kqe*Math.cos(T0e*r)+iYe*Math.sin(T0e*r)+$qe*Math.cos(C0e*r)+rYe*Math.sin(C0e*r)+Jqe*Math.cos(v0e*r)+oYe*Math.sin(v0e*r),s=.0167086342-.0004203654*i,c=102.93734808*Fd+11612.3529*Af*i,u=469.97289*Af*i,f=174.87317577*Fd-8679.27034*Af*i;return w0e(o,s,u,c,f,a,t)}function I0e(e,t){S0e(e,GE);let i=(GE.dayNumber-P6.dayNumber+(GE.secondsOfDay-P6.secondsOfDay)/zn.SECONDS_PER_DAY)/zn.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*Fd,f=-8e-5*i+.02966*r-42e-6*o-13e-8*a,d=83.35324312*Fd,p=146434202669e-4*i-38.2702*r-.045047*o+21301e-8*a,g=125.04455501*Fd,m=-69679193631e-4*i+6.3602*r+.007625*o-3586e-8*a,y=218.31664563*Fd,A=17325593434847e-4*i-6.391*r+.006588*o-3169e-8*a,b=297.85019547*Fd+Af*(1602961601209e-3*i-6.3706*r+.006593*o-3169e-8*a),x=93.27209062*Fd+Af*(17395272628478e-4*i-12.7512*r-.001037*o+417e-8*a),T=134.96340251*Fd+Af*(17179159232178e-4*i+31.8792*r+.051635*o-2447e-7*a),C=357.52910918*Fd+Af*(1295965810481e-4*i-.5532*r+136e-6*o-1149e-8*a),E=310.17137918*Fd-Af*(6967051436e-3*i+6.2068*r+.007618*o-3219e-8*a),w=2*b,P=4*b,R=6*b,O=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-O)-.001383*Math.cos(T)+.001356*Math.cos(w+T)-.001147*Math.cos(P-N)-914e-6*Math.cos(P-O)+869e-6*Math.cos(w-C-T)-627e-6*Math.cos(w)-394e-6*Math.cos(P-_)+282e-6*Math.cos(w-C-O)-279e-6*Math.cos(b-T)-236e-6*Math.cos(O)+231e-6*Math.cos(P)+229e-6*Math.cos(R-_)-201e-6*Math.cos(O-v),f+=486.26*Math.cos(w-v)-40.13*Math.cos(w)+37.51*Math.cos(v)+25.73*Math.cos(O-v)+19.97*Math.cos(w-C-v),p+=-55609*Math.sin(w-T)-34711*Math.sin(w-O)-9792*Math.sin(T)+9385*Math.sin(P-N)+7505*Math.sin(P-O)+5318*Math.sin(w+T)+3484*Math.sin(P-_)-3417*Math.sin(w-C-T)-2530*Math.sin(R-_)-2376*Math.sin(w)-2075*Math.sin(w-N)-1883*Math.sin(O)-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(O-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,I=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(I)*o+4e-5*Math.cos(S)*o;let M=2.116*Math.sin(E)*i-.111*Math.sin(w-v-E)*i-.0015*Math.sin(E)*r;p+=M,A+=M,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(I)*o-9e-4*Math.sin(S)*o,s*=_qe;let F=u+f*Af,V=d+p*Af,k=y+A*Af,j=g+m*Af;return w0e(s,c,F,V,j,k,t)}var E0e=.012300034,sYe=E0e/(E0e+1)*-1;function cYe(e,t){return t=I0e(e,t),h.multiplyByScalar(t,sYe,t)}var P0e=new $(1.0000000000000002,5619723173785822e-31,4690511510146299e-34,-5154129427414611e-31,.9174820620691819,-.39777715593191376,-223970096136568e-30,.39777715593191376,.9174820620691819),E1=new h;KK.computeSunPositionInEarthInertialFrame=function(e,t){return l(e)||(e=K.now()),l(t)||(t=new h),E1=aYe(e,E1),t=h.negate(E1,t),cYe(e,E1),h.subtract(t,E1,t),$.multiplyByVector(P0e,t,t),t};KK.computeMoonPositionInEarthInertialFrame=function(e,t){return l(e)||(e=K.now()),t=I0e(e,t),$.multiplyByVector(P0e,t,t),t};var Yy=KK;function lYe(e,t,n,i,r,o,a){let s=Qi.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 S1(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??D.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}S1.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};S1.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 S1({positions:o,colors:a,ellipsoid:s,colorsPerVertex:c,arcType:u,granularity:f})};var D6=new Array(2),R6=new Array(2),uYe={positions:D6,height:R6,ellipsoid:void 0,minDistance:void 0,granularity:void 0};S1.createGeometry=function(e){let t=e._positions,n=e._colors,i=e._colorsPerVertex,r=e._arcType,o=e._granularity,a=e._ellipsoid,s=D.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=D.chordLength(o,a.maximumRadius),E=Qi.numberOfPoints,w=Qi.generateArc):(C=o,E=Qi.numberOfPointsRhumbLine,w=Qi.generateRhumbArc);let P=Qi.extractHeights(t,a),R=uYe;if(r===sn.GEODESIC?R.minDistance=s:R.granularity=o,R.ellipsoid=a,c){let O=0;for(u=0;u<f-1;u++)O+=E(t[u],t[u+1],C)+1;d=new Float64Array(O*3),g=new Uint8Array(O*4),R.positions=D6,R.height=R6;let N=0;for(u=0;u<f-1;++u){D6[0]=t[u],D6[1]=t[u+1],R6[0]=P[u],R6[1]=P[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=P,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=lYe(N,_,v,S,s,g,y)}let O=n[f-1];g[y++]=U.floatToByte(O.red),g[y++]=U.floatToByte(O.green),g[y++]=U.floatToByte(O.blue),g[y]=U.floatToByte(O.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 bn;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 xt({attributes:A,indices:x,primitiveType:Re.LINES,boundingSphere:se.fromPoints(t)})};var $K=S1;function WE(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 Rs(i),this._workerName="createSphereGeometry"}WE.packedLength=Rs.packedLength;WE.pack=function(e,t,n){return Rs.pack(e._ellipsoidGeometry,t,n)};var fYe=new Rs,Xy={radius:void 0,radii:new h,vertexFormat:new Be,stackPartitions:void 0,slicePartitions:void 0};WE.unpack=function(e,t,n){let i=Rs.unpack(e,t,fYe);return Xy.vertexFormat=Be.clone(i._vertexFormat,Xy.vertexFormat),Xy.stackPartitions=i._stackPartitions,Xy.slicePartitions=i._slicePartitions,l(n)?(h.clone(i._radii,Xy.radii),n._ellipsoidGeometry=new Rs(Xy),n):(Xy.radius=i._radii.x,new WE(Xy))};WE.createGeometry=function(e){return Rs.createGeometry(e._ellipsoidGeometry)};var w1=WE;function qE(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 pf(i),this._workerName="createSphereOutlineGeometry"}qE.packedLength=pf.packedLength;qE.pack=function(e,t,n){return pf.pack(e._ellipsoidGeometry,t,n)};var dYe=new pf,Tx={radius:void 0,radii:new h,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};qE.unpack=function(e,t,n){let i=pf.unpack(e,t,dYe);return Tx.stackPartitions=i._stackPartitions,Tx.slicePartitions=i._slicePartitions,Tx.subdivisions=i._subdivisions,l(n)?(h.clone(i._radii,Tx.radii),n._ellipsoidGeometry=new pf(Tx),n):(Tx.radius=i._radii.x,new qE(Tx))};qE.createGeometry=function(e){return pf.createGeometry(e._ellipsoidGeometry)};var _g=qE;function Qc(e,t,n){this.clock=e??0,this.cone=t??0,this.magnitude=n??1}Qc.fromCartesian3=function(e,t){let n=e.x,i=e.y,r=e.z,o=n*n+i*i;return l(t)||(t=new Qc),t.clock=Math.atan2(i,n),t.cone=Math.atan2(Math.sqrt(o),r),t.magnitude=Math.sqrt(o+r*r),t};Qc.clone=function(e,t){if(l(e))return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=e.magnitude,t):new Qc(e.clock,e.cone,e.magnitude)};Qc.normalize=function(e,t){return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=1,t):new Qc(e.clock,e.cone,1)};Qc.equals=function(e,t){return e===t||l(e)&&l(t)&&e.clock===t.clock&&e.cone===t.cone&&e.magnitude===t.magnitude};Qc.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};Qc.prototype.equals=function(e){return Qc.equals(this,e)};Qc.prototype.clone=function(e){return Qc.clone(this,e)};Qc.prototype.equalsEpsilon=function(e,t){return Qc.equalsEpsilon(this,e,t)};Qc.prototype.toString=function(){return`(${this.clock}, ${this.cone}, ${this.magnitude})`};var I1=Qc;function YE(e){e=e??H.EMPTY_OBJECT;let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=xr.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(YE.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});YE.prototype.findTimeInterval=xr.prototype.findTimeInterval;YE.prototype.wrapTime=xr.prototype.wrapTime;YE.prototype.clampTime=xr.prototype.clampTime;YE.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 P1=YE;function D1({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 JK({width:e,height:t,borderPadding:n}){this._width=e,this._height=t,this._borderPadding=n,this._root=new D1({x:n,y:n,width:e-2*n,height:t-2*n})}JK.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};JK.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 D1({x:i.x,y:i.y,width:t,height:o});let f=a-c;return f>0&&(e.childNode2=new D1({x:i.x+t+c,y:i.y,width:f,height:o})),this._findNode(e.childNode1,{width:t,height:n})}e.childNode1=new D1({x:i.x,y:i.y,width:r,height:n});let u=s-c;return u>0&&(e.childNode2=new D1({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 XE=JK;var hYe={WEST:0,NORTH:1,EAST:2,SOUTH:3,NORTHWEST:4,NORTHEAST:5,SOUTHWEST:6,SOUTHEAST:7},In=hYe;var ZK=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()}},QK=ZK;function n$(e,t){return K.compare(e.start,t.start)}function pa(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(pa.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}}});pa.prototype.equals=function(e,t){if(this===e)return!0;if(!(e instanceof pa))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(!Tn.equals(n[o],i[o],t))return!1;return!0};pa.prototype.get=function(e){return this._intervals[e]};pa.prototype.removeAll=function(){this._intervals.length>0&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))};pa.prototype.findIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t]:void 0};pa.prototype.findDataForIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0};pa.prototype.contains=function(e){return this.indexOf(e)>=0};var e$=new Tn;pa.prototype.indexOf=function(e){let t=this._intervals;e$.start=e,e$.stop=e;let n=Ar(t,e$,n$);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&&Tn.contains(t[n-1],e)?n-1:~n)};pa.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]}};pa.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=Ar(n,e,n$);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 Tn({start:n[i-1].start,stop:e.stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:e.isStopIncluded,data:e.data}):e=new Tn({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 Tn({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 Tn({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 Tn({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 Tn({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)};pa.prototype.removeInterval=function(e){if(e.isEmpty)return!1;let t=this._intervals,n=Ar(t,e,n$);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 Tn({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 Tn({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 Tn({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 Tn({start:t[n].start,stop:t[n].stop,isStartIncluded:!0,isStopIncluded:t[n].isStopIncluded,data:t[n].data})):t[n]=new Tn({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 Tn({start:e.stop,stop:t[n].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[n].isStopIncluded,data:t[n].data})),i&&this._changedEvent.raiseEvent(this),i};pa.prototype.intersect=function(e,t,n){let i=new pa,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=Tn.intersect(c,u,new Tn,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};pa.fromJulianDateArray=function(e,t){l(t)||(t=new pa);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 Tn({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 Tn({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 Tn({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 el=new M0,R1=[0,31,28,31,30,31,30,31,31,30,31,30,31];function t$(e,t,n){l(n)||(n=new K),K.toGregorianDate(e,el);let i=el.millisecond+t.millisecond,r=el.second+t.second,o=el.minute+t.minute,a=el.hour+t.hour,s=el.day+t.day,c=el.month+t.month,u=el.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),R1[2]=Ch(u)?29:28;s>R1[c]||c>=13;)s>R1[c]&&(s-=R1[c],++c),c>=13&&(--c,u+=Math.floor(c/12),c=c%12,++c),R1[2]=Ch(u)?29:28;return el.millisecond=i,el.second=r,el.minute=o,el.hour=a,el.day=s,el.month=c,el.year=u,K.fromGregorianDate(el,n)}var mYe=new K,pYe=/P(?:([\d.,]+)Y)?(?:([\d.,]+)M)?(?:([\d.,]+)W)?(?:([\d.,]+)D)?(?:T(?:([\d.,]+)H)?(?:([\d.,]+)M)?(?:([\d.,]+)S)?)?/;function D0e(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(pYe);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,mYe),t);return t.year||t.month||t.day||t.hour||t.minute||t.second||t.millisecond}var O1=new M0;pa.fromIso8601=function(e,t){let n=e.iso8601.split("/"),i=K.fromIso8601(n[0]),r=K.fromIso8601(n[1]),o=[];if(!D0e(n[2],O1))o.push(i,r);else{let a=K.clone(i);for(o.push(a);K.compare(a,r)<0;)a=t$(a,O1),K.compare(r,a)<=0&&K.clone(r,a),o.push(a)}return pa.fromJulianDateArray({julianDates:o,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};pa.fromIso8601DateArray=function(e,t){return pa.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)};pa.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)(D0e(i[u],O1)||u===0)&&(r&&l(s)?a=t$(s,O1):a=t$(n,O1),o.push(a),s=a);return pa.fromJulianDateArray({julianDates:o,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};var ga=pa;var R0e={AUTODETECT:0,ENU:1,INERTIAL:2,VELOCITY:3};Object.freeze(R0e);var yg=R0e;var gYe=new h(1,1,1),_Ye=h.ZERO,yYe=Fe.IDENTITY;function O0e(e,t,n){this.translation=h.clone(e??_Ye),this.rotation=Fe.clone(t??yYe),this.scale=h.clone(n??gYe)}O0e.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 Ky=O0e;function AYe(e,t){this.rectangle=e,this.maxLevel=t}function M0e(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=[]}M0e.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 bYe(e,t){let n=t.getElementsByTagName("SRS")[0].textContent;if(n==="EPSG:4326")e.tilingScheme=new Xi({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=D.toRadians(parseFloat(a.getAttribute("minx"))),c=D.toRadians(parseFloat(a.getAttribute("miny"))),u=D.toRadians(parseFloat(a.getAttribute("maxx"))),f=D.toRadians(parseFloat(a.getAttribute("maxy"))),d=parseInt(a.getAttribute("maxlevel"),10);e.rectangles.push(new AYe(new ie(s,c,u,f),d))}}function xYe(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i=`${i}: ${t.message}`),Hr.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new oe(i)}async function TYe(e,t,n){try{let i=await t.fetchXML();bYe(e,i)}catch(i){xYe(t,i,n)}}function $y(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 St(t)),this._credit=t,this._tilingScheme=void 0,this._rectangles=[]}Object.defineProperties($y.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(){}}});$y.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT;let n=new M0e(t),i=De.createIfNeeded(e);await TYe(n,i);let r=new $y(t);return n.build(r),r._resource=i,r};$y.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 Sc({buffer:vh(c),width:s._heightmapWidth,height:s._heightmapHeight,childTileMask:CYe(s,e,t,n),structure:s._terrainDataStructure})})};$y.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};var L0e=new ie;function CYe(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,L0e);l(d)&&(O6(r,f,t*2,n*2,i+1)&&(s|=4),O6(r,f,t*2+1,n*2,i+1)&&(s|=8),O6(r,f,t*2,n*2+1,i+1)&&(s|=1),O6(r,f,t*2+1,n*2+1,i+1)&&(s|=2))}return s}function O6(e,t,n,i,r){let o=e.tileXYToRectangle(n,i,r);return l(ie.intersection(o,t,L0e))}$y.prototype.getTileDataAvailable=function(e,t,n){};$y.prototype.loadTileDataAvailability=function(e,t,n){};var i$=$y;function vYe(e,t){if(!e)throw new pe(t)}var r$=vYe;var Yh=class Yh{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(Yh.Layout.FEATURE_ID_U32)}set featureId(t){this._setUint32(Yh.Layout.FEATURE_ID_U32,t)}get show(){return this._getUint8(Yh.Layout.SHOW_U8)===1}set show(t){this._setUint8(Yh.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(Yh.Layout.DIRTY_U8)===1}set _dirty(t){this._collection._primitiveView.setUint8(this._byteOffset+Yh.Layout.DIRTY_U8,t?1:0),t&&this._collection._makeDirty(this._index)}get _pickId(){return this._getUint32(Yh.Layout.PICK_ID_U32)}set _pickId(t){this._setUint32(Yh.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(Yh,"Layout",{FEATURE_ID_U32:0,SHOW_U8:4,DIRTY_U8:5,PICK_ID_U32:8,__BYTE_LENGTH:12});var o$=Yh,Xo=o$;var N0e={OPAQUE:0,TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};Object.freeze(N0e);var Li=N0e;var M1=class M1{constructor(t=H.EMPTY_OBJECT){at(this,"_renderContext",null);this.show=t.show??!0,this._blendOption=t.blendOption??Li.TRANSLUCENT,this._modelMatrix=L.clone(t.modelMatrix??L.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??M1.DEFAULT_CAPACITY,this._primitiveView=null,this._positionCount=0,this._positionCountMax=t.vertexCountMax??M1.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(M1,"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 M6=M1;M6.DEFAULT_CAPACITY=1024;var $a=M6;var{ERR_CAPACITY:Txn,ERR_RESIZE:Cxn,ERR_OUT_OF_RANGE:vxn}=$a.Error,Bd=class Bd extends Xo{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(Bd.Layout.POSITION_OFFSET_U32)}get vertexCount(){return this._getUint32(Bd.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(Bd.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(Bd.Layout.HOLE_OFFSET_U32)}get holeCount(){return this._getUint32(Bd.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(Bd.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(Bd.Layout.TRIANGLE_OFFSET_U32)}get triangleCount(){return this._getUint32(Bd.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(Bd.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(Bd,"Layout",{...Xo.Layout,POSITION_OFFSET_U32:Xo.Layout.__BYTE_LENGTH,POSITION_COUNT_U32:Xo.Layout.__BYTE_LENGTH+4,HOLE_OFFSET_U32:Xo.Layout.__BYTE_LENGTH+8,HOLE_COUNT_U32:Xo.Layout.__BYTE_LENGTH+12,TRIANGLE_OFFSET_U32:Xo.Layout.__BYTE_LENGTH+16,TRIANGLE_COUNT_U32:Xo.Layout.__BYTE_LENGTH+20,__BYTE_LENGTH:Xo.Layout.__BYTE_LENGTH+24});var a$=Bd,Ko=a$;var L1=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(L1,"Layout",{COLOR_U32:0,OUTLINE_COLOR_U32:4,OUTLINE_WIDTH_U8:8,__BYTE_LENGTH:12}),at(L1,"DEFAULT_MATERIAL");var zl=L1;var L6=class L6 extends zl{constructor(t=H.EMPTY_OBJECT){super(t)}};at(L6,"DEFAULT_MATERIAL",Object.freeze(new L6));var s$=L6,bf=s$;var{ERR_RESIZE:kxn,ERR_CAPACITY:zxn}=$a.Error,KE=class KE extends Xo{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(KE.Layout.POSITION_OFFSET_U32)}get vertexCount(){return this._getUint32(KE.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(KE.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(KE,"Layout",{...Xo.Layout,POSITION_OFFSET_U32:Xo.Layout.__BYTE_LENGTH,POSITION_COUNT_U32:Xo.Layout.__BYTE_LENGTH+4,__BYTE_LENGTH:Xo.Layout.__BYTE_LENGTH+8});var c$=KE,ms=c$;var N1=class N1 extends zl{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(N1,"Layout",{...zl.Layout,WIDTH_U8:zl.Layout.__BYTE_LENGTH,__BYTE_LENGTH:zl.Layout.__BYTE_LENGTH+4}),at(N1,"DEFAULT_MATERIAL",Object.freeze(new N1));var l$=N1,xf=l$;var F0e=16,EYe=.35,B0e=new ms,SYe=new xf,k0e=new Ko,wYe=new bf,IYe=new h,PYe=new h,DYe=new de,RYe=new z,OYe=new z,f$=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=H0e(t,a),u=new Uint8Array(r),f=new Uint8Array(r*4);for(let d=0;d<r;d++){let g=t.get(d,B0e).getMaterial(SYe);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,B0e);if(!u.show)continue;let f=u.vertexCount,d=u.vertexOffset;for(let p=0;p+1<f;p++){let g=z.fromArray(s,(d+p)*2,RYe),m=z.fromArray(s,(d+p+1)*2,OYe);MYe(g,m,i,o),LYe(g,m,D.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/F0e))),o=new Array(r*r);for(let y=0;y<o.length;y++)o[y]=[];let a=0,s=EYe/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=Jy(Math.floor(b*r),r),w=Jy(Math.floor(x*r),r),P=Jy(Math.floor(T*r),r),R=Jy(Math.floor(C*r),r);for(let O=P;O<=R;O++)for(let N=E;N<=w;N++)o[O*r+N].push(y),a++}let[c,u]=N6(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=H0e(t,a),u=new Uint8Array(r),f=new Uint8Array(r*4);for(let d=0;d<r;d++){let g=t.get(d,k0e).getMaterial(wYe);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,k0e);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=NYe(s,f+m,A,i,o),x=V0e(b,A,-D.EPSILON3,1+D.EPSILON3,-D.EPSILON3,1+D.EPSILON3,U0e);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/F0e))),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 P=Jy(Math.floor(T*o),o),R=Jy(Math.floor(E*o),o),O=Jy(Math.floor(C*o),o),N=Jy(Math.floor(w*o),o);for(let _=O;_<=N;_++)for(let v=P;v<=R;v++){let S=V0e(A,x,v/o-D.EPSILON5,(v+1)/o+D.EPSILON5,_/o-D.EPSILON5,(_+1)/o+D.EPSILON5,U0e),I=S.vertexCount;if(I<3)continue;let M=S.positions,F=a[_*o+v];for(let V=0;V<I;V++){let k=(V+1)%I,j=M[V*2],B=M[V*2+1],G=M[k*2],W=M[k*2+1];B!==W&&(F.push(j,B,G,W,b),s++)}}}let[c,u]=N6(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]=N6(n.primitiveCount),o=new Uint8Array(i*r);o.set(G0e(n.widths)),n.widthTexture=new Ct({context:t,pixelFormat:He.RED,pixelDatatype:ke.UNSIGNED_BYTE,source:{width:i,height:r,arrayBufferView:o},sampler:zt.NEAREST,flipY:!1});let a=new Uint8Array(i*r*4);a.set(G0e(n.colors)),n.colorTexture=new Ct({context:t,pixelFormat:He.RGBA,pixelDatatype:ke.UNSIGNED_BYTE,source:{width:i,height:r,arrayBufferView:a},sampler:zt.NEAREST,flipY:!1})}static packPolylineTextures(t,n){n.polylineSegmentTexture=new Ct({context:t,pixelFormat:He.RGBA,pixelDatatype:ke.FLOAT,source:{width:n.polylineSegmentTextureWidth,height:n.polylineSegmentTextureHeight,arrayBufferView:n.polylineSegmentTexels},sampler:zt.NEAREST,flipY:!1}),n.polylineSegmentPrimitiveIndicesTexture=new Ct({context:t,pixelFormat:He.RED,pixelDatatype:ke.FLOAT,source:{width:n.polylineSegmentTextureWidth,height:n.polylineSegmentTextureHeight,arrayBufferView:n.polylineSegmentPrimitiveIndicesTexels},sampler:zt.NEAREST,flipY:!1}),n.polylineGridCellIndicesTexture=j0e(t,n.polylineGridCellIndices)}static packPolygonTextures(t,n){n.polygonEdgeTexture=new Ct({context:t,pixelFormat:He.RGBA,pixelDatatype:ke.FLOAT,source:{width:n.polygonEdgeTextureWidth,height:n.polygonEdgeTextureHeight,arrayBufferView:n.polygonEdgeTexels},sampler:zt.NEAREST,flipY:!1}),n.polygonEdgePrimitiveIndicesTexture=new Ct({context:t,pixelFormat:He.RED,pixelDatatype:ke.FLOAT,source:{width:n.polygonEdgeTextureWidth,height:n.polygonEdgeTextureHeight,arrayBufferView:n.polygonEdgePrimitiveIndicesTexels},sampler:zt.NEAREST,flipY:!1}),n.polygonGridCellIndicesTexture=j0e(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 MYe(e,t,n,i){let r=e.x,o=t.x;o=r+D.negativePiToPi(o-r);let a=n.west+i*.5,s=a+D.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 LYe(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 Jy(e,t){return Math.max(0,Math.min(t-1,e))}var u$=new Float64Array(512),z0e=new Float64Array(512),U0e={positions:new Float64Array(512),vertexCount:0};function NYe(e,t,n,i,r){u$.length<n*2&&(u$=new Float64Array(n*4));let o=u$,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+D.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+D.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 V0e(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?z0e:a.positions;y.length<g&&(y=new Float64Array(g*2),m?z0e=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],P=d*((f===0?E:w)-p)>=0;if(P!==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++}P&&(y[A*2]=E,y[A*2+1]=w,A++),b=E,x=w,T=P}if(A===0)return a.vertexCount=0,a;s=y,c=A}return a.vertexCount=c,a}function N6(e){let t=D.nextPowerOfTwo(Math.max(1,Math.ceil(Math.sqrt(e)))),n=D.nextPowerOfTwo(Math.max(1,Math.ceil(e/t)));return[t,n]}function j0e(e,t){let[n,i]=N6(t.length),r=new Float32Array(n*i);return r.set(t),new Ct({context:e,pixelFormat:He.RED,pixelDatatype:ke.FLOAT,source:{width:n,height:i,arrayBufferView:r},sampler:zt.NEAREST,flipY:!1})}function H0e(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,IYe),s=L.multiplyByPoint(r,a,PYe),c=t.cartesianToCartographic(s,DYe);n[o*2]=c.longitude,n[o*2+1]=c.latitude}return n}function G0e(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=f$;function FYe(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 q0e(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 Xh(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)FYe(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),q0e(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 W0e(e){return e.values.length/e.componentsPerAttribute}function BYe(e){return Y.getSizeInBytes(e.componentDatatype)*e.componentsPerAttribute}function kYe(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=W0e(e[r[0]]),t=1;t<a;++t){let u=W0e(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+=BYe(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}}}Xh.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=kYe(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)&&(xt.computeNumberOfVertices(n)>=D.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 Xh({context:t,attributes:f,indexBuffer:p})};Object.defineProperties(Xh.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}});Xh.prototype.getAttribute=function(e){return this._attributes[e]};function zYe(e){let t=e._context,n=e._hasInstancedAttributes;if(!n&&!t._previousDrawInstanced)return;t._previousDrawInstanced=n;let i=t._vertexAttribDivisors,r=e._attributes,o=Lt.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 UYe(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)}}Xh.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)};Xh.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)};Xh.prototype._bind=function(){l(this._vao)?(this._context.glBindVertexArray(this._vao),this._context.instancedArrays&&zYe(this),this._hasConstantAttributes&&UYe(this,this._gl)):q0e(this._gl,this._attributes,this._indexBuffer)};Xh.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)}};Xh.prototype.isDestroyed=function(){return!1};Xh.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=Xh;function Y0e(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]=Y0e(e[t]));return Object.freeze(e)}var d$=Y0e;function kp(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??Wa.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 VYe=0,Bp={};kp.fromCache=function(e){let t=JSON.stringify(e),n=Bp[t];if(l(n))return++n.referenceCount,n.state;let i=new kp(e),r=JSON.stringify(i);return n=Bp[r],l(n)||(i.id=VYe++,n={referenceCount:0,state:i},Bp[r]=n),++n.referenceCount,Bp[t]={referenceCount:1,state:n.state},n.state};kp.removeFromCache=function(e){let t=new kp(e),n=JSON.stringify(t),i=Bp[n],r=JSON.stringify(e),o=Bp[r];l(o)&&(--o.referenceCount,o.referenceCount===0&&(delete Bp[r],l(i)&&--i.referenceCount)),l(i)&&i.referenceCount===0&&delete Bp[n]};kp.getCache=function(){return Bp};kp.clearCache=function(){Bp={}};function Cx(e,t,n){n?e.enable(t):e.disable(t)}function X0e(e,t){e.frontFace(t.frontFace)}function K0e(e,t){let n=t.cull,i=n.enabled;Cx(e,e.CULL_FACE,i),i&&e.cullFace(n.face)}function $0e(e,t){e.lineWidth(t.lineWidth)}function J0e(e,t){let n=t.polygonOffset,i=n.enabled;Cx(e,e.POLYGON_OFFSET_FILL,i),i&&e.polygonOffset(n.factor,n.units)}function Z0e(e,t,n){let i=t.scissorTest,r=l(n.scissorTest)?n.scissorTest.enabled:i.enabled;if(Cx(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 Q0e(e,t){let n=t.depthRange;e.depthRange(n.near,n.far)}function ege(e,t){let n=t.depthTest,i=n.enabled;Cx(e,e.DEPTH_TEST,i),i&&e.depthFunc(n.func)}function tge(e,t){let n=t.colorMask;e.colorMask(n.red,n.green,n.blue,n.alpha)}function nge(e,t){e.depthMask(t.depthMask)}function ige(e,t){e.stencilMask(t.stencilMask)}function jYe(e,t){e.blendColor(t.red,t.green,t.blue,t.alpha)}function rge(e,t,n){let i=t.blending,r=l(n.blendingEnabled)?n.blendingEnabled:i.enabled;Cx(e,e.BLEND,r),r&&(jYe(e,i.color),e.blendEquationSeparate(i.equationRgb,i.equationAlpha),e.blendFuncSeparate(i.functionSourceRgb,i.functionDestinationRgb,i.functionSourceAlpha,i.functionDestinationAlpha))}function oge(e,t){let n=t.stencilTest,i=n.enabled;if(Cx(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 age(e,t){let n=t.sampleCoverage,i=n.enabled;Cx(e,e.SAMPLE_COVERAGE,i),i&&e.sampleCoverage(n.value,n.invert)}var HYe=new Je;function sge(e,t,n){let i=t.viewport??n.viewport;l(i)||(i=HYe,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)}kp.apply=function(e,t,n){X0e(e,t),K0e(e,t),$0e(e,t),J0e(e,t),Q0e(e,t),ege(e,t),tge(e,t),nge(e,t),ige(e,t),oge(e,t),age(e,t),Z0e(e,t,n),rge(e,t,n),sge(e,t,n)};function GYe(e,t){let n=[];return e.frontFace!==t.frontFace&&n.push(X0e),(e.cull.enabled!==t.cull.enabled||e.cull.face!==t.cull.face)&&n.push(K0e),e.lineWidth!==t.lineWidth&&n.push($0e),(e.polygonOffset.enabled!==t.polygonOffset.enabled||e.polygonOffset.factor!==t.polygonOffset.factor||e.polygonOffset.units!==t.polygonOffset.units)&&n.push(J0e),(e.depthRange.near!==t.depthRange.near||e.depthRange.far!==t.depthRange.far)&&n.push(Q0e),(e.depthTest.enabled!==t.depthTest.enabled||e.depthTest.func!==t.depthTest.func)&&n.push(ege),(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(tge),e.depthMask!==t.depthMask&&n.push(nge),e.stencilMask!==t.stencilMask&&n.push(ige),(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(oge),(e.sampleCoverage.enabled!==t.sampleCoverage.enabled||e.sampleCoverage.value!==t.sampleCoverage.value||e.sampleCoverage.invert!==t.sampleCoverage.invert)&&n.push(age),n}kp.partialApply=function(e,t,n,i,r,o){if(t!==n){let f=n._applyFunctions[t.id];l(f)||(f=GYe(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)&&Z0e(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)&&rge(e,n,r),(t!==n||i!==r||i.context!==r.context)&&sge(e,n,r)};kp.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=kp;var cge={ADD:ee.FUNC_ADD,SUBTRACT:ee.FUNC_SUBTRACT,REVERSE_SUBTRACT:ee.FUNC_REVERSE_SUBTRACT,MIN:ee.MIN,MAX:ee.MAX};Object.freeze(cge);var Mc=cge;var lge={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(lge);var Wr=lge;var uge={DISABLED:Object.freeze({enabled:!1}),ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Mc.ADD,equationAlpha:Mc.ADD,functionSourceRgb:Wr.SOURCE_ALPHA,functionSourceAlpha:Wr.ONE,functionDestinationRgb:Wr.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:Wr.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Mc.ADD,equationAlpha:Mc.ADD,functionSourceRgb:Wr.ONE,functionSourceAlpha:Wr.ONE,functionDestinationRgb:Wr.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:Wr.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:Object.freeze({enabled:!0,equationRgb:Mc.ADD,equationAlpha:Mc.ADD,functionSourceRgb:Wr.SOURCE_ALPHA,functionSourceAlpha:Wr.ONE,functionDestinationRgb:Wr.ONE,functionDestinationAlpha:Wr.ONE})};Object.freeze(uge);var Qt=uge;var F1=`/**
* 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 B1=`/**
* 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 k1=`/**
* 0.1
*
* @name czm_epsilon1
* @glslConstant
*/
const float czm_epsilon1 = 0.1;
`;var z1=`/**
* 0.01
*
* @name czm_epsilon2
* @glslConstant
*/
const float czm_epsilon2 = 0.01;
`;var U1=`/**
* 0.001
*
* @name czm_epsilon3
* @glslConstant
*/
const float czm_epsilon3 = 0.001;
`;var V1=`/**
* 0.0001
*
* @name czm_epsilon4
* @glslConstant
*/
const float czm_epsilon4 = 0.0001;
`;var j1=`/**
* 0.00001
*
* @name czm_epsilon5
* @glslConstant
*/
const float czm_epsilon5 = 0.00001;
`;var H1=`/**
* 0.000001
*
* @name czm_epsilon6
* @glslConstant
*/
const float czm_epsilon6 = 0.000001;
`;var G1=`/**
* 0.0000001
*
* @name czm_epsilon7
* @glslConstant
*/
const float czm_epsilon7 = 0.0000001;
`;var W1=`/**
* 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 q1=`/**
* 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 Y1=`/**
* 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 X1=`/**
* The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE}
*
* @name czm_passCesium3DTile
* @glslConstant
*
* @see czm_pass
*/
const float czm_passCesium3DTile = 6.0;
`;var K1=`/**
* 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 $1=`/**
* 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 J1=`/**
* 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 Z1=`/**
* 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 Q1=`/**
* 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 eR=`/**
* The automatic GLSL constant for {@link Pass#CLASSIFICATION}
*
* @name czm_passClassification
* @glslConstant
*
* @see czm_pass
*/
const float czm_passClassification = 8.0;
`;var tR=`/**
* The automatic GLSL constant for {@link Pass#COMPUTE}
*
* @name czm_passCompute
* @glslConstant
*
* @see czm_pass
*/
const float czm_passCompute = 1.0;
`;var nR=`/**
* The automatic GLSL constant for {@link Pass#ENVIRONMENT}
*
* @name czm_passEnvironment
* @glslConstant
*
* @see czm_pass
*/
const float czm_passEnvironment = 0.0;
`;var iR=`/**
* The automatic GLSL constant for {@link Pass#GAUSSIAN_SPLATS}
*
* @name czm_passGaussianSplats
* @glslConstant
*
* @see czm_pass
*/
const float czm_passGaussianSplats = 12.0;
`;var rR=`/**
* The automatic GLSL constant for {@link Pass#GLOBE}
*
* @name czm_passGlobe
* @glslConstant
*
* @see czm_pass
*/
const float czm_passGlobe = 2.0;
`;var oR=`/**
* The automatic GLSL constant for {@link Pass#OPAQUE}
*
* @name czm_passOpaque
* @glslConstant
*
* @see czm_pass
*/
const float czm_passOpaque = 9.0;
`;var aR=`/**
* The automatic GLSL constant for {@link Pass#OVERLAY}
*
* @name czm_passOverlay
* @glslConstant
*
* @see czm_pass
*/
const float czm_passOverlay = 13.0;
`;var sR=`/**
* The automatic GLSL constant for {@link Pass#TERRAIN_CLASSIFICATION}
*
* @name czm_passTerrainClassification
* @glslConstant
*
* @see czm_pass
*/
const float czm_passTerrainClassification = 3.0;
`;var cR=`/**
* The automatic GLSL constant for {@link Pass#TRANSLUCENT}
*
* @name czm_passTranslucent
* @glslConstant
*
* @see czm_pass
*/
const float czm_passTranslucent = 10.0;
`;var lR=`/**
* The automatic GLSL constant for {@link Pass#VOXELS}
*
* @name czm_passVoxels
* @glslConstant
*
* @see czm_pass
*/
const float czm_passVoxels = 11.0;
`;var uR=`/**
* 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 fR=`/**
* 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 dR=`/**
* 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 hR=`/**
* 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 mR=`/**
* 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 pR=`/**
* 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 gR=`/**
* 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 _R=`/**
* 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 yR=`/**
* 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 AR=`/**
* 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 bR=`/**
* 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 xR=`/**
* 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 TR=`/**
* 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 CR=`/**
* 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 vR=`/**
* @name czm_depthRangeStruct
* @glslStruct
*/
struct czm_depthRangeStruct
{
float near;
float far;
};
`;var ER=`/**
* 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 SR=`/**
* 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 wR=`/**
* 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 IR=`/**
* 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 PR=`/**
* DOC_TBA
*
* @name czm_ray
* @glslStruct
*/
struct czm_ray
{
vec3 origin;
vec3 direction;
};
`;var DR=`/**
* 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 RR=`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 OR=`/**
* 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 MR=`/**
* 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 LR=`/**
* 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 NR=`/**
* 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 FR=`/**
* 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 BR=`/**
* 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 kR=`// 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 zR=`/**
* @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 UR=`/**
* 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 VR=`/**
* 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 jR=`/**
* 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 HR=`/**
* 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 GR=`/**
* 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 WR=`/**
* 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 qR=`
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 YR=`
uniform vec4 shadowMap_cascadeDistances;
float czm_cascadeDistance(vec4 weights)
{
return dot(shadowMap_cascadeDistances, weights);
}
`;var XR=`
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 KR=`
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 $R=`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 JR=`/**
* 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 ZR=`/**
* 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 QR=`/**
* 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 eO=`/**
* 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 tO=`/**
* 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 nO=`/**
* 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 iO=`/**
* @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 rO=`/**
* 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 oO=`/**
* 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 aO=`// 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 sO=`/**
* 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 cO=`/**
* 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 lO=`/**
* 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 uO=`/**
* 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 fO=`/**
* 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 dO=`/**
* 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 hO=`/**
* 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 mO=`/**
* 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 pO=`/**
* 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 gO=`/**
* 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 _O=`/**
* 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 yO=`/**
* 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 AO=`/**
* 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 bO=`/**
* 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 xO=`/**
* @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 TO=`/**
* 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 CO=`/**
* 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 vO=`/**
* 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 EO=`/**
* 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 SO=`/**
* 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 wO=`/**
* 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 IO=`/**
* 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 PO=`/**
* 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 DO=`/**
* 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 RO=`/**
* 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 OO=`/**
* 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 MO=`/**
* 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 LO=`/**
* 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 NO=` /**
* 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 FO=`/**
* 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 BO=`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 kO=`// 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 zO=`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 UO=`/**
* 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 VO=`/**
* 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 jO=`/**
* 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 HO=`/**
* 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 GO=`float czm_readDepth(sampler2D depthTexture, vec2 texCoords)
{
return czm_reverseLogDepth(texture(depthTexture, texCoords).r);
}
`;var WO=`/**
* 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 qO=`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 YO=`/**
* 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 XO=`/**
* 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 KO=`
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 $O=`
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 JO=`/**
* 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 ZO=`/**
* 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 QO=`/**
* 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 eM=`/**
* 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 tM=`/**
* 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 nM=`/**
* 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 iM=`/**
* 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 rM=`/**
* @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 oM=`/**
* 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 aM=`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 sM=`/**
* 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 cM=`/**
* 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 lM=`/**
* 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 uM=`/**
* 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 fM=`/**
* 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 dM=`#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 hM=`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 mM=`// 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 pM=`#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 gM=`/**
* 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 vx={czm_degreesPerRadian:F1,czm_depthRange:B1,czm_epsilon1:k1,czm_epsilon2:z1,czm_epsilon3:U1,czm_epsilon4:V1,czm_epsilon5:j1,czm_epsilon6:H1,czm_epsilon7:G1,czm_infinity:W1,czm_oneOverPi:q1,czm_oneOverTwoPi:Y1,czm_passCesium3DTile:X1,czm_passCesium3DTileClassification:K1,czm_passCesium3DTileClassificationIgnoreShow:$1,czm_passCesium3DTileEdges:J1,czm_passCesium3DTileEdgesDirect:Z1,czm_passCesium3DTilePlanarFillId:Q1,czm_passClassification:eR,czm_passCompute:tR,czm_passEnvironment:nR,czm_passGaussianSplats:iR,czm_passGlobe:rR,czm_passOpaque:oR,czm_passOverlay:aR,czm_passTerrainClassification:sR,czm_passTranslucent:cR,czm_passVoxels:lR,czm_pi:uR,czm_piOverFour:fR,czm_piOverSix:dR,czm_piOverThree:hR,czm_piOverTwo:mR,czm_radiansPerDegree:pR,czm_sceneMode2D:gR,czm_sceneMode3D:_R,czm_sceneModeColumbusView:yR,czm_sceneModeMorphing:AR,czm_solarRadius:bR,czm_threePiOver2:xR,czm_twoPi:TR,czm_webMercatorMaxLatitude:CR,czm_depthRangeStruct:vR,czm_material:ER,czm_materialInput:SR,czm_modelMaterial:wR,czm_modelVertexOutput:IR,czm_ray:PR,czm_raySegment:DR,czm_shadowParameters:RR,czm_HSBToRGB:OR,czm_HSLToRGB:MR,czm_RGBToHSB:LR,czm_RGBToHSL:NR,czm_RGBToXYZ:FR,czm_XYZToRGB:BR,czm_acesTonemapping:kR,czm_alphaWeight:zR,czm_antialias:UR,czm_applyHSBShift:VR,czm_approximateSphericalCoordinates:jR,czm_approximateTanh:HR,czm_backFacing:GR,czm_branchFreeTernary:WR,czm_cascadeColor:qR,czm_cascadeDistance:YR,czm_cascadeMatrix:XR,czm_cascadeWeights:KR,czm_clipPolygons:$R,czm_columbusViewMorph:JR,czm_computeAtmosphereColor:ZR,czm_computeGroundAtmosphereScattering:QR,czm_computePosition:eO,czm_computeScattering:tO,czm_computeTextureTransform:nO,czm_cosineAndSine:iO,czm_decodeRGB8:rO,czm_decompressTextureCoordinates:oO,czm_depthClamp:aO,czm_eastNorthUpToEyeCoordinates:sO,czm_ellipsoidContainsPoint:cO,czm_ellipsoidTextureCoordinates:lO,czm_equalsEpsilon:uO,czm_eyeOffset:fO,czm_eyeToWindowCoordinates:dO,czm_fastApproximateAtan:hO,czm_fog:mO,czm_gammaCorrect:pO,czm_geodeticSurfaceNormal:gO,czm_getDefaultMaterial:_O,czm_getDynamicAtmosphereLightDirection:yO,czm_getLambertDiffuse:AO,czm_getSpecular:bO,czm_getWaterNoise:xO,czm_hue:TO,czm_inverseGamma:CO,czm_isEmpty:vO,czm_isFull:EO,czm_latitudeToWebMercatorFraction:SO,czm_lineDistance:wO,czm_linearToSrgb:IO,czm_luminance:PO,czm_maximumComponent:DO,czm_metersPerPixel:RO,czm_modelToWindowCoordinates:OO,czm_multiplyWithColorBalance:MO,czm_nearFarScalar:LO,czm_octDecode:NO,czm_packDepth:FO,czm_pbrLighting:BO,czm_pbrNeutralTonemapping:kO,czm_phong:zO,czm_planeDistance:UO,czm_pointAlongRay:VO,czm_rayEllipsoidIntersectionInterval:jO,czm_raySphereIntersectionInterval:HO,czm_readDepth:GO,czm_readNonPerspective:WO,czm_reverseLogDepth:qO,czm_round:YO,czm_saturation:XO,czm_shadowDepthCompare:KO,czm_shadowVisibility:$O,czm_signNotZero:JO,czm_sphericalHarmonics:ZO,czm_srgbToLinear:QO,czm_tangentToEyeSpaceMatrix:eM,czm_textureCube:tM,czm_transformPlane:nM,czm_translateRelativeToEye:iM,czm_translucentPhong:rM,czm_transpose:oM,czm_unpackClippingExtents:aM,czm_unpackDepth:sM,czm_unpackFloat:cM,czm_unpackTexture:lM,czm_unpackUint:uM,czm_valueTransform:fM,czm_vertexLogDepth:dM,czm_windowToEyeCoordinates:hM,czm_writeDepthClamp:mM,czm_writeLogDepth:pM,czm_writeNonPerspective:gM};var WYe=new h;function Ft(e){this._size=e.size,this._datatype=e.datatype,this.getValue=e.getValue}var ac={};ac[ee.FLOAT]="float";ac[ee.FLOAT_VEC2]="vec2";ac[ee.FLOAT_VEC3]="vec3";ac[ee.FLOAT_VEC4]="vec4";ac[ee.INT]="int";ac[ee.INT_VEC2]="ivec2";ac[ee.INT_VEC3]="ivec3";ac[ee.INT_VEC4]="ivec4";ac[ee.BOOL]="bool";ac[ee.BOOL_VEC2]="bvec2";ac[ee.BOOL_VEC3]="bvec3";ac[ee.BOOL_VEC4]="bvec4";ac[ee.FLOAT_MAT2]="mat2";ac[ee.FLOAT_MAT3]="mat3";ac[ee.FLOAT_MAT4]="mat4";ac[ee.SAMPLER_2D]="sampler2D";ac[ee.SAMPLER_CUBE]="samplerCube";Ft.prototype.getDeclaration=function(e){let t=`uniform ${ac[this._datatype]} ${e}`,n=this._size;return n===1?t+=";":t+=`[${n.toString()}];`,t};var qYe={czm_viewport:new Ft({size:1,datatype:ee.FLOAT_VEC4,getValue:function(e){return e.viewportCartesian4}}),czm_viewportOrthographic:new Ft({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.viewportOrthographic}}),czm_viewportTransformation:new Ft({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.viewportTransformation}}),czm_globeDepthTexture:new Ft({size:1,datatype:ee.SAMPLER_2D,getValue:function(e){return e.globeDepthTexture}}),czm_edgeIdTexture:new Ft({size:1,datatype:ee.SAMPLER_2D,getValue:function(e){return e.edgeIdTexture}}),czm_edgeColorTexture:new Ft({size:1,datatype:ee.SAMPLER_2D,getValue:function(e){return e.edgeColorTexture}}),czm_edgeDepthTexture:new Ft({size:1,datatype:ee.SAMPLER_2D,getValue:function(e){return e.edgeDepthTexture}}),czm_planarFillIdTexture:new Ft({size:1,datatype:ee.SAMPLER_2D,getValue:function(e){return e.planarFillIdTexture}}),czm_model:new Ft({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.model}}),czm_inverseModel:new Ft({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.inverseModel}}),czm_view:new Ft({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.view}}),czm_view3D:new Ft({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.view3D}}),czm_viewRotation:new Ft({size:1,datatype:ee.FLOAT_MAT3,getValue:function(e){return e.viewRotation}}),czm_viewRotation3D:new Ft({size:1,datatype:ee.FLOAT_MAT3,getValue:function(e){return e.viewRotation3D}}),czm_inverseView:new Ft({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.inverseView}}),czm_inverseView3D:new Ft({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.inverseView3D}}),czm_inverseViewRotation:new Ft({size:1,datatype:ee.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation}}),czm_inverseViewRotation3D:new Ft({size:1,datatype:ee.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation3D}}),czm_projection:new Ft({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.projection}}),czm_inverseProjection:new Ft({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.inverseProjection}}),czm_infiniteProjection:new Ft({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.infiniteProjection}}),czm_modelView:new Ft({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.modelView}}),czm_modelView3D:new Ft({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.modelView3D}}),czm_modelViewRelativeToEye:new Ft({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.modelViewRelativeToEye}}),czm_inverseModelView:new Ft({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.inverseModelView}}),czm_inverseModelView3D:new Ft({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.inverseModelView3D}}),czm_viewProjection:new Ft({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.viewProjection}}),czm_inverseViewProjection:new Ft({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.inverseViewProjection}}),czm_modelViewProjection:new Ft({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.modelViewProjection}}),czm_inverseModelViewProjection:new Ft({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.inverseModelViewProjection}}),czm_modelViewProjectionRelativeToEye:new Ft({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.modelViewProjectionRelativeToEye}}),czm_modelViewInfiniteProjection:new Ft({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.modelViewInfiniteProjection}}),czm_orthographicIn3D:new Ft({size:1,datatype:ee.FLOAT,getValue:function(e){return e.orthographicIn3D?1:0}}),czm_normal:new Ft({size:1,datatype:ee.FLOAT_MAT3,getValue:function(e){return e.normal}}),czm_normal3D:new Ft({size:1,datatype:ee.FLOAT_MAT3,getValue:function(e){return e.normal3D}}),czm_inverseNormal:new Ft({size:1,datatype:ee.FLOAT_MAT3,getValue:function(e){return e.inverseNormal}}),czm_inverseNormal3D:new Ft({size:1,datatype:ee.FLOAT_MAT3,getValue:function(e){return e.inverseNormal3D}}),czm_eyeHeight:new Ft({size:1,datatype:ee.FLOAT,getValue:function(e){return e.eyeHeight}}),czm_eyeHeight2D:new Ft({size:1,datatype:ee.FLOAT_VEC2,getValue:function(e){return e.eyeHeight2D}}),czm_eyeEllipsoidNormalEC:new Ft({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.eyeEllipsoidNormalEC}}),czm_eyeEllipsoidCurvature:new Ft({size:1,datatype:ee.FLOAT_VEC2,getValue:function(e){return e.eyeEllipsoidCurvature}}),czm_modelToEnu:new Ft({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.modelToEnu}}),czm_enuToModel:new Ft({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.enuToModel}}),czm_entireFrustum:new Ft({size:1,datatype:ee.FLOAT_VEC2,getValue:function(e){return e.entireFrustum}}),czm_currentFrustum:new Ft({size:1,datatype:ee.FLOAT_VEC2,getValue:function(e){return e.currentFrustum}}),czm_frustumPlanes:new Ft({size:1,datatype:ee.FLOAT_VEC4,getValue:function(e){return e.frustumPlanes}}),czm_farDepthFromNearPlusOne:new Ft({size:1,datatype:ee.FLOAT,getValue:function(e){return e.farDepthFromNearPlusOne}}),czm_log2FarDepthFromNearPlusOne:new Ft({size:1,datatype:ee.FLOAT,getValue:function(e){return e.log2FarDepthFromNearPlusOne}}),czm_oneOverLog2FarDepthFromNearPlusOne:new Ft({size:1,datatype:ee.FLOAT,getValue:function(e){return e.oneOverLog2FarDepthFromNearPlusOne}}),czm_sunPositionWC:new Ft({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.sunPositionWC}}),czm_sunPositionColumbusView:new Ft({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.sunPositionColumbusView}}),czm_sunDirectionEC:new Ft({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.sunDirectionEC}}),czm_sunDirectionWC:new Ft({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.sunDirectionWC}}),czm_moonDirectionEC:new Ft({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.moonDirectionEC}}),czm_lightDirectionEC:new Ft({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.lightDirectionEC}}),czm_lightDirectionWC:new Ft({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.lightDirectionWC}}),czm_lightColor:new Ft({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.lightColor}}),czm_lightColorHdr:new Ft({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.lightColorHdr}}),czm_encodedCameraPositionMCHigh:new Ft({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCHigh}}),czm_encodedCameraPositionMCLow:new Ft({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCLow}}),czm_viewerPositionWC:new Ft({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return L.getTranslation(e.inverseView,WYe)}}),czm_frameNumber:new Ft({size:1,datatype:ee.FLOAT,getValue:function(e){return e.frameState.frameNumber}}),czm_morphTime:new Ft({size:1,datatype:ee.FLOAT,getValue:function(e){return e.frameState.morphTime}}),czm_sceneMode:new Ft({size:1,datatype:ee.FLOAT,getValue:function(e){return e.frameState.mode}}),czm_pass:new Ft({size:1,datatype:ee.FLOAT,getValue:function(e){return e.pass}}),czm_backgroundColor:new Ft({size:1,datatype:ee.FLOAT_VEC4,getValue:function(e){return e.backgroundColor}}),czm_brdfLut:new Ft({size:1,datatype:ee.SAMPLER_2D,getValue:function(e){return e.brdfLut}}),czm_environmentMap:new Ft({size:1,datatype:ee.SAMPLER_CUBE,getValue:function(e){return e.environmentMap}}),czm_specularEnvironmentMaps:new Ft({size:1,datatype:ee.SAMPLER_CUBE,getValue:function(e){return e.specularEnvironmentMaps}}),czm_specularEnvironmentMapsMaximumLOD:new Ft({size:1,datatype:ee.FLOAT,getValue:function(e){return e.specularEnvironmentMapsMaximumLOD}}),czm_sphericalHarmonicCoefficients:new Ft({size:9,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.sphericalHarmonicCoefficients}}),czm_temeToPseudoFixed:new Ft({size:1,datatype:ee.FLOAT_MAT3,getValue:function(e){return e.temeToPseudoFixedMatrix}}),czm_pixelRatio:new Ft({size:1,datatype:ee.FLOAT,getValue:function(e){return e.pixelRatio}}),czm_fogDensity:new Ft({size:1,datatype:ee.FLOAT,getValue:function(e){return e.fogDensity}}),czm_fogVisualDensityScalar:new Ft({size:1,datatype:ee.FLOAT,getValue:function(e){return e.fogVisualDensityScalar}}),czm_fogMinimumBrightness:new Ft({size:1,datatype:ee.FLOAT,getValue:function(e){return e.fogMinimumBrightness}}),czm_atmosphereHsbShift:new Ft({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.atmosphereHsbShift}}),czm_atmosphereLightIntensity:new Ft({size:1,datatype:ee.FLOAT,getValue:function(e){return e.atmosphereLightIntensity}}),czm_atmosphereRayleighCoefficient:new Ft({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.atmosphereRayleighCoefficient}}),czm_atmosphereRayleighScaleHeight:new Ft({size:1,datatype:ee.FLOAT,getValue:function(e){return e.atmosphereRayleighScaleHeight}}),czm_atmosphereMieCoefficient:new Ft({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.atmosphereMieCoefficient}}),czm_atmosphereMieScaleHeight:new Ft({size:1,datatype:ee.FLOAT,getValue:function(e){return e.atmosphereMieScaleHeight}}),czm_atmosphereMieAnisotropy:new Ft({size:1,datatype:ee.FLOAT,getValue:function(e){return e.atmosphereMieAnisotropy}}),czm_atmosphereDynamicLighting:new Ft({size:1,datatype:ee.FLOAT,getValue:function(e){return e.atmosphereDynamicLighting}}),czm_splitPosition:new Ft({size:1,datatype:ee.FLOAT,getValue:function(e){return e.splitPosition}}),czm_geometricToleranceOverMeter:new Ft({size:1,datatype:ee.FLOAT,getValue:function(e){return e.geometricToleranceOverMeter}}),czm_minimumDisableDepthTestDistance:new Ft({size:1,datatype:ee.FLOAT,getValue:function(e){return e.minimumDisableDepthTestDistance}}),czm_invertClassificationColor:new Ft({size:1,datatype:ee.FLOAT_VEC4,getValue:function(e){return e.invertClassificationColor}}),czm_gamma:new Ft({size:1,datatype:ee.FLOAT,getValue:function(e){return e.gamma}}),czm_ellipsoidRadii:new Ft({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.radii}}),czm_ellipsoidInverseRadii:new Ft({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.oneOverRadii}})},Ag=qYe;function YYe(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 _M=YYe;function fge(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 dge(e,t,n){let i;for(let r=0;r<n.length;++r)n[r].name===e&&(i=n[r]);return l(i)||(t=fge(t),i={name:e,glslSource:t,dependsOn:[],requiredBy:[],evaluated:!1},n.push(i)),i}function hge(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&&Os._czmBuiltinsAndUniforms.hasOwnProperty(i)){let r=dge(i,Os._czmBuiltinsAndUniforms[i],t);e.dependsOn.push(r),r.requiredBy.push(e),hge(r,t)}}))}function XYe(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 KYe(e){let t=[],n=dge("main",e,t);hge(n,t),XYe(t);let i="";for(let r=t.length-1;r>=0;--r)i=`${i+t[r].glslSource}
`;return i.replace(n.glslSource,"")}function mge(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=fge(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=Os.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=KYe(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=_M(c,t),c}function Os(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}Os.prototype.clone=function(){return new Os({sources:this.sources,defines:this.defines,pickColorQualifier:this.pickColorQualifier,includeBuiltIns:this.includeBuiltIns})};Os.replaceMain=function(e,t){return t=`void ${t}()`,e.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g,t)};Os.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}`};Os.prototype.createCombinedVertexShader=function(e){return mge(this,!1,e)};Os.prototype.createCombinedFragmentShader=function(e){return mge(this,!0,e)};Os._czmBuiltinsAndUniforms={};for(let e in vx)vx.hasOwnProperty(e)&&(Os._czmBuiltinsAndUniforms[e]=vx[e]);for(let e in Ag)if(Ag.hasOwnProperty(e)){let t=Ag[e];typeof t.getDeclaration=="function"&&(Os._czmBuiltinsAndUniforms[e]=t.getDeclaration(e))}Os.createPickVertexShaderSource=function(e){return`${Os.replaceMain(e,"czm_old_main")}
in vec4 pickColor;
out vec4 czm_pickColor;
void main()
{
czm_old_main();
czm_pickColor = pickColor;
}`};Os.createPickFragmentShaderSource=function(e,t){let n=Os.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 $Ye(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 pge(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 gge(e,t){let n=t.length;for(let i=0;i<n;++i){let r=t[i];if(pge(e,r))return r}}var JYe=["v_normalEC","v_normal"];Os.findNormalVarying=function(e){return pge(e,"#ifdef HAS_NORMALS")?$Ye(e,"HAS_NORMALS")?"v_normalEC":void 0:gge(e,JYe)};var ZYe=["v_positionEC"];Os.findPositionVarying=function(e){return gge(e,ZYe)};var Ge=Os;function QYe(e,t,n,i){switch(t.type){case e.FLOAT:return new h$(e,t,n,i);case e.FLOAT_VEC2:return new m$(e,t,n,i);case e.FLOAT_VEC3:return new p$(e,t,n,i);case e.FLOAT_VEC4:return new g$(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_3D:case e.SAMPLER_CUBE:return new F6(e,t,n,i);case e.UNSIGNED_INT_SAMPLER_2D:return new F6(e,t,n,i);case e.INT:case e.BOOL:return new _$(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new y$(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new A$(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new b$(e,t,n,i);case e.FLOAT_MAT2:return new x$(e,t,n,i);case e.FLOAT_MAT3:return new T$(e,t,n,i);case e.FLOAT_MAT4:return new C$(e,t,n,i);default:throw new oe(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}var h$=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))}},m$=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=new z,this._gl=t,this._location=r}set(){let t=this.value;z.equals(t,this._value)||(z.clone(t,this._value),this._gl.uniform2f(this._location,t.x,t.y))}},p$=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)))}},g$=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)))}},F6=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}},_$=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))}},y$=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=new z,this._gl=t,this._location=r}set(){let t=this.value;z.equals(t,this._value)||(z.clone(t,this._value),this._gl.uniform2i(this._location,t.x,t.y))}},A$=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))}},b$=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))}},eXe=new Float32Array(4),x$=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=new Ki,this._gl=t,this._location=r}set(){if(!Ki.equalsArray(this.value,this._value,0)){Ki.clone(this.value,this._value);let t=Ki.toArray(this.value,eXe);this._gl.uniformMatrix2fv(this._location,!1,t)}}},tXe=new Float32Array(9),T$=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,tXe);this._gl.uniformMatrix3fv(this._location,!1,t)}}},nXe=new Float32Array(16),C$=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=new L,this._gl=t,this._location=r}set(){if(!L.equalsArray(this.value,this._value,0)){L.clone(this.value,this._value);let t=L.toArray(this.value,nXe);this._gl.uniformMatrix4fv(this._location,!1,t)}}},yM=QYe;function iXe(e,t,n,i){switch(t.type){case e.FLOAT:return new v$(e,t,n,i);case e.FLOAT_VEC2:return new E$(e,t,n,i);case e.FLOAT_VEC3:return new S$(e,t,n,i);case e.FLOAT_VEC4:return new w$(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_3D:case e.SAMPLER_CUBE:return new I$(e,t,n,i);case e.INT:case e.BOOL:return new P$(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new D$(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new R$(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new O$(e,t,n,i);case e.FLOAT_MAT2:return new M$(e,t,n,i);case e.FLOAT_MAT3:return new L$(e,t,n,i);case e.FLOAT_MAT4:return new N$(e,t,n,i);default:throw new oe(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}var v$=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)}},E$=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];z.equalsArray(s,i,o)||(z.pack(s,i,o),r=!0),o+=2}r&&this._gl.uniform2fv(this._location,i)}},S$=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)}},w$=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)}},I$=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}},P$=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)}},D$=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];z.equalsArray(s,i,o)||(z.pack(s,i,o),r=!0),o+=2}r&&this._gl.uniform2iv(this._location,i)}},R$=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)}},O$=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)}},M$=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];Ki.equalsArray(s,i,o)||(Ki.pack(s,i,o),r=!0),o+=4}r&&this._gl.uniformMatrix2fv(this._location,!1,i)}},L$=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)}},N$=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];L.equalsArray(s,i,o)||(L.pack(s,i,o),r=!0),o+=16}r&&this._gl.uniformMatrix4fv(this._location,!1,i)}},AM=iXe;var rXe=0;function bg(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=oXe(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=rXe++}bg.fromCache=function(e){return e=e??H.EMPTY_OBJECT,e.context.shaderCache.getShaderProgram(e)};bg.replaceCache=function(e){return e=e??H.EMPTY_OBJECT,e.context.shaderCache.replaceShaderProgram(e)};Object.defineProperties(bg.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},vertexAttributes:{get:function(){return B6(this),this._vertexAttributes}},numberOfVertexAttributes:{get:function(){return B6(this),this._numberOfVertexAttributes}},allUniforms:{get:function(){return B6(this),this._uniformsByName}}});function _ge(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 oXe(e,t){let n={};if(!Lt.highpFloatSupported||!Lt.highpIntSupported){let i,r,o,a,s=_ge(e),c=_ge(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 zp="[Cesium WebGL] ";function aXe(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(`${zp}Vertex shader compile log: ${c}`),c=e.getShaderInfoLog(o),l(c)&&c.length>0&&console.log(`${zp}Fragment shader compile log: ${c}`),c=e.getProgramInfoLog(a),l(c)&&c.length>0&&console.log(`${zp}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(`${zp}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(`${zp}Vertex shader compile log: ${c}`),console.error(`${zp} Vertex shader source:
${n}`),u=`Vertex shader failed to compile. Compile log: ${c}`):(c=e.getShaderInfoLog(o),console.error(`${zp}Fragment shader compile log: ${c}`),console.error(`${zp} 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(`${zp}${g} shader translation failed.`);return}console.error(`${zp}Translated ${g} shaderSource:
${m}`)}}function sXe(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 cXe(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=yM(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=AM(e,s,u,d),n[u]=f,i.push(f),f._setSampler&&r.push(f)}}}return{uniformsByName:n,uniforms:i,samplerUniforms:r}}function lXe(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=Ag[a];l(c)?n.push({uniform:o,automaticUniform:c}):i.push(o)}return{automaticUniforms:n,manualUniforms:i}}function uXe(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 B6(e){l(e._program)||yge(e)}function yge(e){let t=e._program,n=e._gl,i=aXe(n,e,e._debugShaders),r=n.getProgramParameter(i,n.ACTIVE_ATTRIBUTES),o=cXe(n,i),a=lXe(e,o.uniformsByName);e._program=i,e._numberOfVertexAttributes=r,e._vertexAttributes=sXe(n,i,r),e._uniformsByName=o.uniformsByName,e._uniforms=o.uniforms,e._automaticUniforms=a.automaticUniforms,e._manualUniforms=a.manualUniforms,e.maximumTextureUnitIndex=uXe(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{yge(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)}})}bg.prototype._bind=function(){B6(this),this._gl.useProgram(this._program)};bg.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)}};bg.prototype.isDestroyed=function(){return!1};bg.prototype.destroy=function(){this._cachedShader.cache.releaseShaderProgram(this)};bg.prototype.finalDestroy=function(){return this._gl.deleteProgram(this._program),ue(this)};var Zt=bg;var $o={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},F$=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 nl(this,$o.CULL)}set cull(t){nl(this,$o.CULL)!==t&&(Zy(this,$o.CULL,t),this.dirty=!0)}get occlude(){return nl(this,$o.OCCLUDE)}set occlude(t){nl(this,$o.OCCLUDE)!==t&&(Zy(this,$o.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 nl(this,$o.CAST_SHADOWS)}set castShadows(t){nl(this,$o.CAST_SHADOWS)!==t&&(Zy(this,$o.CAST_SHADOWS,t),this.dirty=!0)}get receiveShadows(){return nl(this,$o.RECEIVE_SHADOWS)}set receiveShadows(t){nl(this,$o.RECEIVE_SHADOWS)!==t&&(Zy(this,$o.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 nl(this,$o.EXECUTE_IN_CLOSEST_FRUSTUM)}set executeInClosestFrustum(t){nl(this,$o.EXECUTE_IN_CLOSEST_FRUSTUM)!==t&&(Zy(this,$o.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 nl(this,$o.DEBUG_SHOW_BOUNDING_VOLUME)}set debugShowBoundingVolume(t){nl(this,$o.DEBUG_SHOW_BOUNDING_VOLUME)!==t&&(Zy(this,$o.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 nl(this,$o.PICK_ONLY)}set pickOnly(t){nl(this,$o.PICK_ONLY)!==t&&(Zy(this,$o.PICK_ONLY,t),this.dirty=!0)}get depthForTranslucentClassification(){return nl(this,$o.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)}set depthForTranslucentClassification(t){nl(this,$o.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)!==t&&(Zy(this,$o.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 nl(e,t){return(e._flags&t)===t}function Zy(e,t,n){n?e._flags|=t:e._flags&=~t}var nt=F$;var Age={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(Age);var Pe=Age;var bM=`#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 xM=`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 B$={positionHigh:0,positionLow:1,pickColor:2,showColorAlpha:3},bge={position:0,pickColor:1,showColorAlpha:2},ps=new Ko,k$=new bf,TM=new U,xge=new h,z$=new vn;function fXe(e,t,n){let i=t.context;n=n||{destroy:hXe};let r=e._positionDatatype===Y.DOUBLE,o=r?B$:bge;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,ps),!ps._dirty)continue;let x=ps.triangleOffset,T=ps.vertexOffset,C=ps.getTriangles();for(let R=0,O=ps.triangleCount;R<O;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=ps.show,w=r?ps.getPositions():null;ps.getMaterial(k$);let P=an.encodeRGB8(k$.color);U.fromRgba(ps._pickId,TM);for(let R=0,O=ps.vertexCount;R<O;R++)r&&(h.fromArray(w,R*3,xge),vn.fromCartesian(xge,z$),h.pack(z$.high,d,T*3),h.pack(z$.low,p,T*3)),m[T*4]=U.floatToByte(TM.red),m[T*4+1]=U.floatToByte(TM.green),m[T*4+2]=U.floatToByte(TM.blue),m[T*4+3]=U.floatToByte(TM.alpha),y[T*3]=E?1:0,y[T*3+1]=P,y[T*3+2]=k$.color.alpha,T++;ps._dirty=!1}}if(l(n.vertexArray)){if(e._dirtyCount>0){let{indexOffset:c,indexCount:u,vertexOffset:f,vertexCount:d}=dXe(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:B$.positionHigh,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:Ze.createVertexBuffer({typedArray:c.positionHigh,context:i,usage:Oe.STATIC_DRAW})},{index:B$.positionLow,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:Ze.createVertexBuffer({typedArray:c.positionLow,context:i,usage:Oe.STATIC_DRAW})}]:[{index:bge.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===Li.OPAQUE?Qt.DISABLED:Qt.ALPHA_BLEND,depthTest:{enabled:!0}})),l(n.shaderProgram)||(n.shaderProgram=Zt.fromCache({context:i,vertexShaderSource:new Ge({sources:[bM],defines:r?["USE_FLOAT64"]:[]}),fragmentShaderSource:new Ge({sources:[xM]}),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===Li.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 dXe(e){let{_dirtyOffset:t,_dirtyCount:n}=e;e.get(t,ps);let i=ps.vertexOffset,r=ps.triangleOffset*3;e.get(t+n-1,ps);let o=ps.vertexOffset+ps.vertexCount-i,a=(ps.triangleOffset+ps.triangleCount)*3-r;return{indexOffset:r,indexCount:a,vertexOffset:i,vertexCount:o}}function hXe(){let e=this;l(e.vertexArray)&&e.vertexArray.destroy(),l(e.shaderProgram)&&e.shaderProgram.destroy(),l(e.renderState)&&je.removeFromCache(e.renderState)}var CM=fXe;var{ERR_CAPACITY:CPn}=$a.Error,U$=class e extends $a{constructor(t=H.EMPTY_OBJECT){super(t),this._holeCount=0,this._holeCountMax=t.holeCountMax??$a.DEFAULT_CAPACITY,this._holeIndexView=null,this._triangleCount=0,this._triangleCountMax=t.triangleCountMax??$a.DEFAULT_CAPACITY,this._triangleIndexView=null,this._allocateHoleIndexBuffer(),this._allocateTriangleIndexBuffer()}_getCollectionClass(){return e}_getPrimitiveClass(){return Ko}_getMaterialClass(){return bf}_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 Ko){super.add(t,n);let i=this._positionCount;n._setUint32(Ko.Layout.POSITION_OFFSET_U32,i),n._setUint32(Ko.Layout.POSITION_COUNT_U32,0);let r=this._holeCount;n._setUint32(Ko.Layout.HOLE_OFFSET_U32,r),n._setUint32(Ko.Layout.HOLE_COUNT_U32,0);let o=this._triangleCount;return n._setUint32(Ko.Layout.TRIANGLE_OFFSET_U32,o),n._setUint32(Ko.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=CM(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}},il=U$;var vM=`#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 EM=`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 Ul=`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 Ex={positionHigh:0,positionLow:1,prevPositionHigh:2,prevPositionLow:3,nextPositionHigh:4,nextPositionLow:5,pickColor:6,showColorWidthAndTexCoord:7,alpha:8},k6={position:0,prevPosition:1,nextPosition:2,pickColor:3,showColorWidthAndTexCoord:4,alpha:5},rl=new ms,z6=new xf,SM=new U,Tge=new h,Cge=new h,vge=new h,V$=new vn,j$=new vn,H$=new vn;function mXe(e,t,n){let i=t.context;n=n||{destroy:_Xe};let r=e._positionDatatype===Y.DOUBLE,o=r?Ex:k6;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 P=c,R=c+u;P<R;P++){if(e.get(P,rl),!rl._dirty)continue;rl.getMaterial(z6);let O=an.encodeRGB8(z6.color),N=z6.color.alpha;U.fromRgba(rl._pickId,SM);let _=rl.show,v=rl.vertexOffset*2,S=(rl.vertexOffset-P)*6,I=e._positionView,M=rl.vertexOffset*3;for(let F=0,V=rl.vertexCount;F<V;F++){let k=F===0,j=F===V-1,B=I[M+F*3],G=I[M+F*3+1],W=I[M+F*3+2],Q,q,J,Z,ce,Ae;k?(Z=I[M+3],ce=I[M+3+1],Ae=I[M+3+2],Q=2*B-Z,q=2*G-ce,J=2*W-Ae):j?(Q=I[M+(F-1)*3],q=I[M+(F-1)*3+1],J=I[M+(F-1)*3+2],Z=2*B-Q,ce=2*G-q,Ae=2*W-J):(Q=I[M+(F-1)*3],q=I[M+(F-1)*3+1],J=I[M+(F-1)*3+2],Z=I[M+(F+1)*3],ce=I[M+(F+1)*3+1],Ae=I[M+(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,Tge),h.fromElements(Q,q,J,Cge),h.fromElements(Z,ce,Ae,vge),vn.fromCartesian(Tge,V$),vn.fromCartesian(Cge,j$),vn.fromCartesian(vge,H$));for(let le=0;le<2;le++)r?(h.pack(V$.high,b,v*3),h.pack(V$.low,x,v*3),h.pack(j$.high,T,v*3),h.pack(j$.low,C,v*3),h.pack(H$.high,E,v*3),h.pack(H$.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(SM.red),d[v*4+1]=U.floatToByte(SM.green),d[v*4+2]=U.floatToByte(SM.blue),d[v*4+3]=U.floatToByte(SM.alpha),p[v*4]=_?1:0,p[v*4+1]=O,p[v*4+2]=z6.width,p[v*4+3]=F/(V-1),g[v]=N*255,v++}rl._dirty=!1}}if(l(n.vertexArray)){if(e._dirtyCount>0){let{indexOffset:c,indexCount:u,vertexOffset:f,vertexCount:d}=gXe(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:Ex.positionHigh,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:Ze.createVertexBuffer({typedArray:c.positionHigh,context:i,usage:Oe.STATIC_DRAW})},{index:Ex.positionLow,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:Ze.createVertexBuffer({typedArray:c.positionLow,context:i,usage:Oe.STATIC_DRAW})},{index:Ex.prevPositionHigh,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:Ze.createVertexBuffer({typedArray:c.prevPositionHigh,context:i,usage:Oe.STATIC_DRAW})},{index:Ex.prevPositionLow,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:Ze.createVertexBuffer({typedArray:c.prevPositionLow,context:i,usage:Oe.STATIC_DRAW})},{index:Ex.nextPositionHigh,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:Ze.createVertexBuffer({typedArray:c.nextPositionHigh,context:i,usage:Oe.STATIC_DRAW})},{index:Ex.nextPositionLow,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:Ze.createVertexBuffer({typedArray:c.nextPositionLow,context:i,usage:Oe.STATIC_DRAW})}]:[{index:k6.position,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:Ze.createVertexBuffer({typedArray:c.position,context:i,usage:Oe.STATIC_DRAW})},{index:k6.prevPosition,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:Ze.createVertexBuffer({typedArray:c.prevPosition,context:i,usage:Oe.STATIC_DRAW})},{index:k6.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===Li.OPAQUE?Qt.DISABLED:Qt.ALPHA_BLEND,depthTest:{enabled:!0}})),l(n.shaderProgram)||(n.shaderProgram=Zt.fromCache({context:i,vertexShaderSource:new Ge({sources:[Ul,vM],defines:r?["USE_FLOAT64"]:[]}),fragmentShaderSource:new Ge({sources:[EM]}),attributeLocations:o}));let a=pXe(e);l(n.command)||(n.command=new nt({vertexArray:n.vertexArray,renderState:n.renderState,shaderProgram:n.shaderProgram,primitiveType:Re.TRIANGLES,pass:e._blendOption===Li.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 pXe(e){return(e.vertexCount-e.primitiveCount)*6}function gXe(e){let{_dirtyOffset:t,_dirtyCount:n}=e;e.get(t,rl);let i=rl.vertexOffset*2,o=(rl.vertexOffset-t)*6;e.get(t+n-1,rl);let a=(rl.vertexOffset+rl.vertexCount)*2-i,c=(a/2-n)*6;return{indexOffset:o,indexCount:c,vertexOffset:i,vertexCount:a}}function _Xe(){let e=this;l(e.vertexArray)&&e.vertexArray.destroy(),l(e.shaderProgram)&&e.shaderProgram.destroy(),l(e.renderState)&&je.removeFromCache(e.renderState)}var wM=mXe;var G$=class e extends $a{_getCollectionClass(){return e}_getPrimitiveClass(){return ms}_getMaterialClass(){return xf}static _cloneEmpty(t){return new e({primitiveCountMax:t.primitiveCountMax,vertexCountMax:t.vertexCountMax,positionDatatype:t.positionDatatype,positionNormalized:t.positionNormalized})}add(t,n=new ms){super.add(t,n);let i=this._positionCount;return n._setUint32(ms.Layout.POSITION_OFFSET_U32,i),n._setUint32(ms.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=wM(this,t,this._renderContext))}},ol=G$;var yXe=new ie,AXe=new ie,Ege=new ie,q$=new Map;q$.set(ol,{packCollectionData:tl.packPolylineCollectionData,packTilePrimitives:tl.packPolylineSegments});q$.set(il,{packCollectionData:tl.packPolygonCollectionData,packTilePrimitives:tl.packPolygonRings});var W$=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=q$.get(f.constructor);if(!l(d))continue;let p=ie.fromBoundingSphere(f.boundingVolume,o.ellipsoid,AXe);if(!!!ie.intersection(a,p,Ege))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 bXe(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 bXe(e,t,n,i,r){if(i.length===0)return!1;let o=r.tileXYToRectangle(e,t,n,yXe);for(let a=0;a<i.length;a++)if(ie.intersection(o,i[a],Ege))return!0;return!1}var IM=W$;function Sx(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(Sx.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(Sx.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=xXe(this),e.addEventListener("seeked",this._seekFunction,!1)),this._element=e,this._seeking=!1,this._firstTickAfterSeek=!1)}}});Sx.prototype.destroy=function(){return this.element=void 0,this.clock=void 0,ue(this)};Sx.prototype.isDestroyed=function(){return!1};Sx.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};Sx.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 xXe(e){return function(){e._seeking=!1,e._firstTickAfterSeek=!0}}var Y$=Sx;var Sge={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(Sge);var X$=Sge;var wge={};function TXe(e,t){return D.equalsEpsilon(e.latitude,t.latitude,D.EPSILON10)&&D.equalsEpsilon(e.longitude,t.longitude,D.EPSILON10)}var CXe=new de,vXe=new de;function EXe(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,CXe);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,vXe);a&&(x.height=n[A]),m=m&&x.height===0,TXe(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 SXe=new Array(2),wXe=new Array(2),IXe={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};wge.computePositions=function(e,t,n,i,r,o){let a=EXe(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=D.chordLength(r,e.maximumRadius),p=IXe;if(p.minDistance=d,p.ellipsoid=e,o){let g=0,m;for(m=0;m<s-1;m++)g+=Qi.numberOfPoints(t[m],t[m+1],d)+1;u=new Float64Array(g*3),f=new Float64Array(g*3);let y=SXe,A=wXe;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=Qi.generateArc(p);u.set(x,b),A[0]=i[m],A[1]=i[m+1],f.set(Qi.generateArc(p),b),b+=x.length}}else p.positions=t,p.height=n,u=new Float64Array(Qi.generateArc(p)),p.height=i,f=new Float64Array(Qi.generateArc(p));return{bottomPositions:f,topPositions:u,numCorners:c}};var wx=wge;var K$=new h,U6=new h,PXe=new h,Ige=new h,DXe=new h,RXe=new h,OXe=new h;function Ix(e){e=e??H.EMPTY_OBJECT;let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,r=e.vertexFormat??Be.DEFAULT,o=e.granularity??D.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}Ix.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 Pge=te.clone(te.UNIT_SPHERE),Dge=new Be,PM={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:Pge,vertexFormat:Dge,granularity:void 0};Ix.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,Pge);t+=te.packedLength;let u=Be.unpack(e,t,Dge);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):(PM.positions=o,PM.minimumHeights=a,PM.maximumHeights=s,PM.granularity=f,new Ix(PM))};Ix.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 Ix(c)};Ix.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,r=e._vertexFormat,o=e._granularity,a=e._ellipsoid,s=wx.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,P=OXe,R=RXe,O=DXe,N=!0;d/=3;let _,v=0,S=1/(d-f-1);for(_=0;_<d;++_){let k=_*3,j=h.fromArray(u,k,K$),B=h.fromArray(c,k,U6);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,Ige),W=h.subtract(j,a.geodeticSurfaceNormal(j,U6),U6);if(_+1<d&&(G=h.fromArray(u,k+3,Ige)),N){let Q=h.subtract(G,j,PXe),q=h.subtract(W,j,K$);P=h.normalize(h.cross(q,Q,P),P),N=!1}h.equalsEpsilon(j,G,D.EPSILON10)?N=!0:(v+=S,r.tangent&&(R=h.normalize(h.subtract(G,j,R),R)),r.bitangent&&(O=h.normalize(h.cross(P,R,O),O))),r.normal&&(m[T++]=P.x,m[T++]=P.y,m[T++]=P.z,m[T++]=P.x,m[T++]=P.y,m[T++]=P.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++]=O.x,A[C++]=O.y,A[C++]=O.z,A[C++]=O.x,A[C++]=O.y,A[C++]=O.z)}}let I=new bn;r.position&&(I.position=new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:g})),r.normal&&(I.normal=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:m})),r.tangent&&(I.tangent=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:y})),r.bitangent&&(I.bitangent=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:A})),r.st&&(I.st=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:b}));let M=p/3;p-=6*(f+1);let F=Ve.createTypedArray(M,p),V=0;for(_=0;_<M-2;_+=2){let k=_,j=_+2,B=h.fromArray(g,k*3,K$),G=h.fromArray(g,j*3,U6);if(h.equalsEpsilon(B,G,D.EPSILON10))continue;let W=_+1,Q=_+3;F[V++]=W,F[V++]=k,F[V++]=Q,F[V++]=Q,F[V++]=k,F[V++]=j}return new xt({attributes:I,indices:F,primitiveType:Re.TRIANGLES,boundingSphere:se.fromVertices(g)})};var DM=Ix;var Rge=new h,Oge=new h;function Px(e){e=e??H.EMPTY_OBJECT;let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,r=e.granularity??D.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}Px.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 Mge=te.clone(te.UNIT_SPHERE),RM={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:Mge,granularity:void 0};Px.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,Mge);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):(RM.positions=o,RM.minimumHeights=a,RM.maximumHeights=s,RM.granularity=u,new Px(RM))};Px.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 Px(c)};Px.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,r=e._granularity,o=e._ellipsoid,a=wx.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,Rge),C=h.fromArray(s,x,Oge);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 bn({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,Rge),E=h.fromArray(d,T*3,Oge);if(h.equalsEpsilon(C,E,D.EPSILON10))continue;let w=g+1,P=g+3;A[b++]=w,A[b++]=x,A[b++]=w,A[b++]=P,A[b++]=x,A[b++]=T}return A[b++]=y-2,A[b]=y-1,new xt({attributes:m,indices:A,primitiveType:Re.LINES,boundingSphere:se.fromVertices(d)})};var OM=Px;var $$={};function MXe(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 LXe(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 NXe(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 FXe(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 BXe(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 kXe(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}$$.createWireframeIndices=function(e,t,n){let i=l(n);if(e===Re.TRIANGLES)return i?LXe(t,n):MXe(t);if(e===Re.TRIANGLE_STRIP)return i?FXe(t,n):NXe(t);if(e===Re.TRIANGLE_FAN)return i?kXe(t,n):BXe(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 $E=$$;function zXe(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 MM=zXe;function UXe(e){return e=e??H.EMPTY_OBJECT,Gb.fromIonAssetId(2426648,{requestVertexNormals:e.requestVertexNormals??!1})}var LM=UXe;function VXe(e){return e=e??H.EMPTY_OBJECT,Gb.fromIonAssetId(1,{requestVertexNormals:e.requestVertexNormals??!1,requestWaterMask:e.requestWaterMask??!1,ellipsoid:te.WGS84})}var Dx=VXe;var jXe=1953029805,HXe=2917034100;function J$(e,t){if(J$.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===jXe||r===HXe)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++}J$.passThroughDataForTesting=!1;var NM=J$;var Z$=32767,GXe=new de,WXe=new h;function qXe(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=D.lerp(t.west,t.east,d/Z$),y=D.lerp(t.south,t.north,p/Z$),A=D.lerp(n,i,g/Z$),b=de.fromRadians(m,y,A,GXe),x=r.cartographicToCartesian(b,WXe);h.pack(x,u,f*3)}return u}var FM=qXe;var Lge=Go(af(),1);function YXe(e){let t=new Lge.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),n}var xg=YXe;function XXe(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 BM=XXe;var Q$=[],eJ=[];function KXe(e,t,n,i,r,o){let a=r-i+1,s=o-r,c=Q$,u=eJ,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 tJ(e,t,n,i,r){if(i>=r)return;let o=Math.floor((i+r)*.5);tJ(e,t,n,i,o),tJ(e,t,n,o+1,r),KXe(e,t,n,i,o,r)}function $Xe(e,t,n){let i=e.length,r=Math.ceil(i*.5);Q$.length=r,eJ.length=r,tJ(e,t,n,0,i-1),Q$.length=0,eJ.length=0}var Up=$Xe;var JXe=new h;function ZXe(e,t,n,i){let r=Wb(e,t,n,i,JXe);return l(r)?r.x>0&&r.y>0&&r.z>0:!1}var nJ=ZXe;async function QXe(e,t,n,i){return l(i)||(i=!1),nKe(e,t,n,i)}function eKe(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(Fge(i)):o=r.then(Fge(i)).catch(iKe(i)),e.shift(),t.push(o),!0}function tKe(e){return new Promise(function(t){setTimeout(t,e)})}function iJ(e,t,n){return e.length?eKe(e,t,n)?iJ(e,t,n):tKe(100).then(()=>iJ(e,t,n)):Promise.resolve()}function nKe(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 iJ(a,c,i).then(function(){return Promise.all(c).then(function(){return n})})}function Nge(e,t,n){let i=t.interpolateHeight(n,e.longitude,e.latitude);return i===void 0?!1:(e.height=i,!0)}function Fge(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(!Nge(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];Nge(a,i,n)}}):Promise.resolve()}}function iKe(e){let t=e.positions;return function(){for(let n=0;n<t.length;++n){let i=t[n];i.height=void 0}}}var kM=QXe;var rJ=new z;async function Bge(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,rJ);let p=e.loadTileDataAvailability(rJ.x,rJ.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 kM(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 Bge(e,s,n),t}var Rx=Bge;function rKe(e){return e<=.04045?e*.07739938080495357:Math.pow((e+.055)*.9478672985781991,2.4)}var Ox=rKe;function oKe(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 zM=oKe;function aKe(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 oJ=aKe;function sKe(e,t,n){return function(){n.apply(e,arguments),t.apply(e,arguments)}}var UM=sKe;function V6(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}V6.ALL=Object.freeze(new V6({color:new U(0,0,0,0),depth:1,stencil:0}));V6.prototype.execute=function(e,t){e.clear(this,t)};var ui=V6;function kge(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}kge.prototype.execute=function(e){e.execute(this)};var Vl=kge;var Mx=`in vec4 position;
in vec2 textureCoordinates;
out vec2 v_textureCoordinates;
void main()
{
gl_Position = position;
v_textureCoordinates = textureCoordinates;
}
`;function aJ(e,t,n){let i=e._gl;i.framebufferTexture2D(i.FRAMEBUFFER,t,n._target,n._texture,0)}function j6(e,t,n){let i=e._gl;i.framebufferRenderbuffer(i.FRAMEBUFFER,t,i.RENDERBUFFER,n._getRenderbuffer())}function Kh(e){e=e??H.EMPTY_OBJECT;let t=e.context,n=t._gl,i=Lt.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;aJ(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;j6(this,c,s),this._activeColorAttachments[a]=c,this._colorRenderbuffers[a]=s}}if(l(e.depthTexture)){let r=e.depthTexture;aJ(this,this._gl.DEPTH_ATTACHMENT,r),this._depthTexture=r}if(l(e.depthRenderbuffer)){let r=e.depthRenderbuffer;j6(this,this._gl.DEPTH_ATTACHMENT,r),this._depthRenderbuffer=r}if(l(e.stencilRenderbuffer)){let r=e.stencilRenderbuffer;j6(this,this._gl.STENCIL_ATTACHMENT,r),this._stencilRenderbuffer=r}if(l(e.depthStencilTexture)){let r=e.depthStencilTexture;aJ(this,this._gl.DEPTH_STENCIL_ATTACHMENT,r),this._depthStencilTexture=r}if(l(e.depthStencilRenderbuffer)){let r=e.depthStencilRenderbuffer;j6(this,this._gl.DEPTH_STENCIL_ATTACHMENT,r),this._depthStencilRenderbuffer=r}this._unBind(),t._currentFramebuffer=void 0}Object.defineProperties(Kh.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)}}});Kh.prototype._bind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,this._framebuffer)};Kh.prototype._unBind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,null)};Kh.prototype.bindDraw=function(){let e=this._gl;e.bindFramebuffer(e.DRAW_FRAMEBUFFER,this._framebuffer)};Kh.prototype.bindRead=function(){let e=this._gl;e.bindFramebuffer(e.READ_FRAMEBUFFER,this._framebuffer)};Kh.prototype._getActiveColorAttachments=function(){return this._activeColorAttachments};Kh.prototype.getColorTexture=function(e){return this._colorTextures[e]};Kh.prototype.getColorRenderbuffer=function(e){return this._colorRenderbuffers[e]};Kh.prototype.isDestroyed=function(){return!1};Kh.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 _a=Kh;function H6(e){this._context=e}var VM,cKe=new nt({primitiveType:Re.TRIANGLES}),lKe=new ui({color:new U(0,0,0,0)});function uKe(e,t){return new _a({context:e,colorTextures:[t],destroyAttachments:!1})}function fKe(e,t){return Zt.fromCache({context:e,vertexShaderSource:Mx,fragmentShaderSource:t,attributeLocations:{position:0,textureCoordinates:1}})}function dKe(e,t){return(!l(VM)||VM.viewport.width!==e||VM.viewport.height!==t)&&(VM=je.fromCache({viewport:new Je(0,0,e,t)})),VM}H6.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:fKe(r,e.fragmentShaderSource),s=uKe(r,t),c=dKe(n,i),u=e.uniformMap,f=lKe;f.framebuffer=s,f.renderState=c,f.execute(r);let d=cKe;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)};H6.prototype.isDestroyed=function(){return!1};H6.prototype.destroy=function(){return ue(this)};var jM=H6;function HM(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(HM.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}});HM.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)};HM.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};HM.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 GM=HM;function So(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 zt}=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 GM(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,zge(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 So.faceNames())sJ(this[T],n?.[T],0);m.bindTexture(y,null)}So.prototype.copyFace=function(e,t,n,i){let r=e.context,o=new _a({context:r,colorTextures:[t],destroyAttachments:!1});o._bind(),this[n].copyMipmapFromFramebuffer(0,0,t.width,t.height,i??0),o._unBind(),o.destroy()};So.FaceName=Object.freeze({POSITIVEX:"positiveX",NEGATIVEX:"negativeX",POSITIVEY:"positiveY",NEGATIVEY:"negativeY",POSITIVEZ:"positiveZ",NEGATIVEZ:"negativeZ"});function*hKe(){yield So.FaceName.POSITIVEX,yield So.FaceName.NEGATIVEX,yield So.FaceName.POSITIVEY,yield So.FaceName.NEGATIVEY,yield So.FaceName.POSITIVEZ,yield So.FaceName.NEGATIVEZ}So.faceNames=function(){return hKe()};function sJ(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))}So.loadFace=sJ;Object.defineProperties(So.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){zge(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}}});So.getDirection=function(e,t){switch(e){case So.FaceName.POSITIVEX:return h.clone(h.UNIT_X,t);case So.FaceName.NEGATIVEX:return h.negate(h.UNIT_X,t);case So.FaceName.POSITIVEY:return h.clone(h.UNIT_Y,t);case So.FaceName.NEGATIVEY:return h.negate(h.UNIT_Y,t);case So.FaceName.POSITIVEZ:return h.clone(h.UNIT_Z,t);case So.FaceName.NEGATIVEZ:return h.negate(h.UNIT_Z,t)}};function zge(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=ei.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)}So.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 So.faceNames())sJ(this[c],a[c],s)}n.bindTexture(r,null),this._hasMipmap=!0};So.prototype.generateMipmap=function(e){e=e??bd.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)};So.createVertexArray=function(e){let t=wc.createGeometry(wc.fromDimensions({dimensions:new h(2,2,2),vertexFormat:Be.POSITION_ONLY})),n=this._attributeLocations=Hn.createAttributeLocations(t);return Vn.fromGeometry({context:e,geometry:t,attributeLocations:n,bufferUsage:Oe.STATIC_DRAW})};So.prototype.isDestroyed=function(){return!1};So.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 Jo=So;function mKe(e){this.context=e,this.framebuffer=void 0,this.blendingEnabled=void 0,this.scissorTest=void 0,this.viewport=void 0}var sc=mKe;var cJ=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)}},WM=cJ;function $h(e){this._context=e,this._shaders={},this._numberOfShaders=0,this._shadersToRelease={}}Object.defineProperties($h.prototype,{numberOfShaders:{get:function(){return this._numberOfShaders}}});$h.prototype.replaceShaderProgram=function(e){return l(e.shaderProgram)&&e.shaderProgram.destroy(),this.getShaderProgram(e)};function pKe(e){let t=Object.keys(e).sort();return JSON.stringify(e,t)}$h.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)?pKe(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};$h.prototype.replaceDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,r=t+i.keyword,o=this._shaders[r];if(l(o)){lJ(this,o);let a=i.derivedKeywords.indexOf(t);a>-1&&i.derivedKeywords.splice(a,1)}return this.createDerivedShaderProgram(e,t,n)};$h.prototype.getDerivedShaderProgram=function(e,t){let n=e._cachedShader,i=t+n.keyword,r=this._shaders[i];if(l(r))return r.shaderProgram};$h.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 lJ(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];lJ(e,a)}delete e._shaders[t.keyword],t.shaderProgram.finalDestroy()}$h.prototype.destroyReleasedShaderPrograms=function(){let e=this._shadersToRelease;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];lJ(this,n),--this._numberOfShaders}this._shadersToRelease={}};$h.prototype.releaseShaderProgram=function(e){if(l(e)){let t=e._cachedShader;t&&--t.count===0&&(this._shadersToRelease[t.keyword]=t)}};$h.prototype.isDestroyed=function(){return!1};$h.prototype.destroy=function(){let e=this._shaders;for(let t in e)e.hasOwnProperty(t)&&e[t].shaderProgram.finalDestroy();return ue(this)};var qM=$h;function Lx(){this._textures={},this._numberOfTextures=0,this._texturesToRelease={}}Object.defineProperties(Lx.prototype,{numberOfTextures:{get:function(){return this._numberOfTextures}}});Lx.prototype.getTexture=function(e){let t=this._textures[e];if(l(t))return delete this._texturesToRelease[e],++t.count,t.texture};Lx.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};Lx.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={}};Lx.prototype.isDestroyed=function(){return!1};Lx.prototype.destroy=function(){let e=this._textures;for(let t in e)e.hasOwnProperty(t)&&e[t].texture.finalDestroy();return ue(this)};var YM=Lx;function gKe(e){e=e??H.EMPTY_OBJECT,this.color=U.clone(e.color??U.WHITE),this.intensity=e.intensity??2}var Tg=gKe;function JE(){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=L.clone(L.IDENTITY),this._viewportTransformation=L.clone(L.IDENTITY),this._model=L.clone(L.IDENTITY),this._view=L.clone(L.IDENTITY),this._inverseView=L.clone(L.IDENTITY),this._projection=L.clone(L.IDENTITY),this._infiniteProjection=L.clone(L.IDENTITY),this._entireFrustum=new z,this._currentFrustum=new z,this._frustumPlanes=new ae,this._farDepthFromNearPlusOne=void 0,this._log2FarDepthFromNearPlusOne=void 0,this._oneOverLog2FarDepthFromNearPlusOne=void 0,this._frameState=void 0,this._temeToPseudoFixed=$.clone(L.IDENTITY),this._view3DDirty=!0,this._view3D=new L,this._inverseView3DDirty=!0,this._inverseView3D=new L,this._inverseModelDirty=!0,this._inverseModel=new L,this._inverseTransposeModelDirty=!0,this._inverseTransposeModel=new $,this._viewRotation=new $,this._inverseViewRotation=new $,this._viewRotation3D=new $,this._inverseViewRotation3D=new $,this._inverseProjectionDirty=!0,this._inverseProjection=new L,this._modelViewDirty=!0,this._modelView=new L,this._modelView3DDirty=!0,this._modelView3D=new L,this._modelViewRelativeToEyeDirty=!0,this._modelViewRelativeToEye=new L,this._inverseModelViewDirty=!0,this._inverseModelView=new L,this._inverseModelView3DDirty=!0,this._inverseModelView3D=new L,this._viewProjectionDirty=!0,this._viewProjection=new L,this._inverseViewProjectionDirty=!0,this._inverseViewProjection=new L,this._modelViewProjectionDirty=!0,this._modelViewProjection=new L,this._inverseModelViewProjectionDirty=!0,this._inverseModelViewProjection=new L,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewProjectionRelativeToEye=new L,this._modelViewInfiniteProjectionDirty=!0,this._modelViewInfiniteProjection=new L,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 vn,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 z,this._eyeEllipsoidNormalEC=new h,this._eyeEllipsoidCurvature=new z,this._modelToEnu=new L,this._enuToModel=new L,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(JE.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 Vge(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return Vge(this),this._viewportTransformation}},model:{get:function(){return this._model},set:function(e){L.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,L.inverse(this._model,this._inverseModel)),this._inverseModel}},inverseTransposeModel:{get:function(){let e=this._inverseTransposeModel;return this._inverseTransposeModelDirty&&(this._inverseTransposeModelDirty=!1,L.getMatrix3(this.inverseModel,e),$.transpose(e,e)),e}},view:{get:function(){return this._view}},view3D:{get:function(){return fJ(this),this._view3D}},viewRotation:{get:function(){return fJ(this),this._viewRotation}},viewRotation3D:{get:function(){return fJ(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return Gge(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return Gge(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return wKe(this),this._inverseProjection}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return IKe(this),this._modelView}},modelView3D:{get:function(){return PKe(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return NKe(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return DKe(this),this._inverseModelView}},inverseModelView3D:{get:function(){return RKe(this),this._inverseModelView3D}},viewProjection:{get:function(){return OKe(this),this._viewProjection}},inverseViewProjection:{get:function(){return MKe(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return LKe(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return FKe(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return BKe(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return kKe(this),this._modelViewInfiniteProjection}},normal:{get:function(){return zKe(this),this._normal}},normal3D:{get:function(){return UKe(this),this._normal3D}},inverseNormal:{get:function(){return VKe(this),this._inverseNormal}},inverseNormal3D:{get:function(){return jKe(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 Hge(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return Hge(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 _Ke(e,t){L.clone(t,e._view),L.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 yKe(e,t){L.clone(t,e._inverseView),L.getMatrix3(t,e._inverseViewRotation)}function AKe(e,t){L.clone(t,e._projection),e._inverseProjectionDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function bKe(e,t){L.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}var Uge=new h,xKe=new L;function TKe(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,Uge)):(e._eyeHeight=-n.maximumRadius,h.magnitude(t.positionWC)>0&&(e._eyeEllipsoidNormalEC=h.normalize(t.positionWC,e._eyeEllipsoidNormalEC)),i=n.scaleToGeodeticSurface(t.positionWC,Uge)),e._encodedCameraPositionMCDirty=!0,!l(i))return;e._eyeEllipsoidNormalEC=$.multiplyByVector(e._viewRotation,e._eyeEllipsoidNormalEC,e._eyeEllipsoidNormalEC);let o=mt.eastNorthUpToFixedFrame(i,n,xKe);e._enuToModel=L.multiplyTransformation(e.inverseModel,o,e._enuToModel),e._modelToEnu=L.inverseTransformation(e._enuToModel,e._modelToEnu),D.equalsEpsilon(n._radii.x,n._radii.y,D.EPSILON15)&&(e._eyeEllipsoidCurvature=n.getLocalCurvature(i,e._eyeEllipsoidCurvature))}var uJ=new $,CKe=new de;function vKe(e,t){mt.computeIcrfToCentralBodyFixedMatrix(t.time,uJ);let n=Yy.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);$.multiplyByVector(uJ,n,n),h.normalize(n,e._sunDirectionWC),n=$.multiplyByVector(e.viewRotation3D,n,e._sunDirectionEC),h.normalize(n,n),n=Yy.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),$.multiplyByVector(uJ,n,n),$.multiplyByVector(e.viewRotation3D,n,n),h.normalize(n,n);let i=t.mapProjection,o=i.ellipsoid.cartesianToCartographic(e._sunPositionWC,CKe);i.project(o,e._sunPositionColumbusView)}JE.prototype.updateCamera=function(e){_Ke(this,e.viewMatrix),yKe(this,e.inverseViewMatrix),TKe(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 mn};JE.prototype.updateFrustum=function(e){AKe(this,e.projectionMatrix),l(e.infiniteProjectionMatrix)&&bKe(this,e.infiniteProjectionMatrix),this._currentFrustum.x=e.near,this._currentFrustum.y=e.far,this._farDepthFromNearPlusOne=e.far-e.near+1,this._log2FarDepthFromNearPlusOne=D.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};JE.prototype.updatePass=function(e){this._pass=e};var EKe=[],SKe=new Tg;JE.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),vKe(this,e);let n=e.light??SKe;n instanceof Tg?(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??EKe,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 Vge(e){if(e._viewportDirty){let t=e._viewport;L.computeOrthographicOffCenter(t.x,t.x+t.width,t.y,t.y+t.height,0,1,e._viewportOrthographicMatrix),L.computeViewportTransformation(t,0,1,e._viewportTransformation),e._viewportDirty=!1}}function wKe(e){e._inverseProjectionDirty&&(e._inverseProjectionDirty=!1,e._mode!==re.SCENE2D&&e._mode!==re.MORPHING&&!e._orthographicIn3D?L.inverse(e._projection,e._inverseProjection):L.clone(L.ZERO,e._inverseProjection))}function IKe(e){e._modelViewDirty&&(e._modelViewDirty=!1,L.multiplyTransformation(e._view,e._model,e._modelView))}function PKe(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,L.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function DKe(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,L.inverse(e.modelView,e._inverseModelView))}function RKe(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,L.inverse(e.modelView3D,e._inverseModelView3D))}function OKe(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,L.multiply(e._projection,e._view,e._viewProjection))}function MKe(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,L.inverse(e.viewProjection,e._inverseViewProjection))}function LKe(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,L.multiply(e._projection,e.modelView,e._modelViewProjection))}function NKe(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 FKe(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,L.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function BKe(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,L.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function kKe(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,L.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function zKe(e){if(e._normalDirty){e._normalDirty=!1;let t=e._normal;L.getMatrix3(e.inverseModelView,t),$.transpose(t,t)}}function UKe(e){if(e._normal3DDirty){e._normal3DDirty=!1;let t=e._normal3D;L.getMatrix3(e.inverseModelView3D,t),$.transpose(t,t)}}function VKe(e){if(e._inverseNormalDirty){e._inverseNormalDirty=!1;let t=e._inverseNormal;L.getMatrix3(e.modelView,t),$.transpose(t,t)}}function jKe(e){if(e._inverseNormal3DDirty){e._inverseNormal3DDirty=!1;let t=e._inverseNormal3D;L.getMatrix3(e.modelView3D,t),$.transpose(t,t)}}var jge=new h;function Hge(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,L.multiplyByPoint(e.inverseModel,e._cameraPosition,jge),vn.fromCartesian(jge,e._encodedCameraPositionMC))}var HKe=new h,GKe=new h,WKe=new h,qKe=new h,YKe=new de,XKe=new h,KKe=new L;function $Ke(e,t,n,i,r,o,a,s){let c=HKe;c.x=e.y,c.y=e.z,c.z=e.x;let u=GKe;u.x=n.y,u.y=n.z,u.z=n.x;let f=WKe;f.x=i.y,f.y=i.z,f.z=i.x;let d=qKe;d.x=t.y,d.y=t.z,d.z=t.x,o===re.SCENE2D&&(c.z=r*.5);let p=a.unproject(c,YKe);p.longitude=D.clamp(p.longitude,-Math.PI,Math.PI),p.latitude=D.clamp(p.latitude,-D.PI_OVER_TWO,D.PI_OVER_TWO);let g=a.ellipsoid,m=g.cartographicToCartesian(p,XKe),y=mt.eastNorthUpToFixedFrame(m,g,KKe);return L.multiplyByPointAsVector(y,u,u),L.multiplyByPointAsVector(y,f,f),L.multiplyByPointAsVector(y,d,d),l(s)||(s=new L),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 fJ(e){e._view3DDirty&&(e._mode===re.SCENE3D?L.clone(e._view,e._view3D):$Ke(e._cameraPosition,e._cameraDirection,e._cameraRight,e._cameraUp,e._frustum2DWidth,e._mode,e._mapProjection,e._view3D),L.getMatrix3(e._view3D,e._viewRotation3D),e._view3DDirty=!1)}function Gge(e){e._inverseView3DDirty&&(L.inverseTransformation(e.view3D,e._inverseView3D),L.getMatrix3(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}var XM=JE;function Ou(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):JKe(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 qM(this),this._textureCache=new YM;let u=a;this._stencilBits=u.getParameter(u.STENCIL_BITS),Lt._maximumCombinedTextureImageUnits=u.getParameter(u.MAX_COMBINED_TEXTURE_IMAGE_UNITS),Lt._maximumCubeMapSize=u.getParameter(u.MAX_CUBE_MAP_TEXTURE_SIZE),Lt._maximumFragmentUniformVectors=u.getParameter(u.MAX_FRAGMENT_UNIFORM_VECTORS),Lt._maximumTextureImageUnits=u.getParameter(u.MAX_TEXTURE_IMAGE_UNITS),Lt._maximumRenderbufferSize=u.getParameter(u.MAX_RENDERBUFFER_SIZE),Lt._maximumTextureSize=u.getParameter(u.MAX_TEXTURE_SIZE),Lt._maximum3DTextureSize=u.getParameter(u.MAX_3D_TEXTURE_SIZE),Lt._maximumVaryingVectors=u.getParameter(u.MAX_VARYING_VECTORS),Lt._maximumVertexAttributes=u.getParameter(u.MAX_VERTEX_ATTRIBS),Lt._maximumVertexTextureImageUnits=u.getParameter(u.MAX_VERTEX_TEXTURE_IMAGE_UNITS),Lt._maximumVertexUniformVectors=u.getParameter(u.MAX_VERTEX_UNIFORM_VECTORS),Lt._maximumSamples=this._webgl2?u.getParameter(u.MAX_SAMPLES):0;let f=u.getParameter(u.ALIASED_LINE_WIDTH_RANGE);Lt._minimumAliasedLineWidth=f[0],Lt._maximumAliasedLineWidth=f[1];let d=u.getParameter(u.ALIASED_POINT_SIZE_RANGE);Lt._minimumAliasedPointSize=d[0],Lt._maximumAliasedPointSize=d[1];let p=u.getParameter(u.MAX_VIEWPORT_DIMS);Lt._maximumViewportWidth=p[0],Lt._maximumViewportHeight=p[1];let g=u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.HIGH_FLOAT);Lt._highpFloatSupported=g.precision!==0;let m=u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.HIGH_INT);Lt._highpIntSupported=m.rangeMax!==0,this._antialias=u.getContextAttributes().antialias,this._standardDerivatives=!!Zo(u,["OES_standard_derivatives"]),this._blendMinmax=!!Zo(u,["EXT_blend_minmax"]),this._elementIndexUint=!!Zo(u,["OES_element_index_uint"]),this._depthTexture=!!Zo(u,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._fragDepth=!!Zo(u,["EXT_frag_depth"]),this._debugShaders=Zo(u,["WEBGL_debug_shaders"]),this._textureFloat=!!Zo(u,["OES_texture_float"]),this._textureHalfFloat=!!Zo(u,["OES_texture_half_float"]),this._textureFloatLinear=!!Zo(u,["OES_texture_float_linear"]),this._textureHalfFloatLinear=!!Zo(u,["OES_texture_half_float_linear"]),this._supportsTextureLod=!!Zo(u,["EXT_shader_texture_lod"]),this._colorBufferFloat=!!Zo(u,["EXT_color_buffer_float","WEBGL_color_buffer_float"]),this._floatBlend=!!Zo(u,["EXT_float_blend"]),this._colorBufferHalfFloat=!!Zo(u,["EXT_color_buffer_half_float"]),this._s3tc=!!Zo(u,["WEBGL_compressed_texture_s3tc","MOZ_WEBGL_compressed_texture_s3tc","WEBKIT_WEBGL_compressed_texture_s3tc"]),this._pvrtc=!!Zo(u,["WEBGL_compressed_texture_pvrtc","WEBKIT_WEBGL_compressed_texture_pvrtc"]),this._astc=!!Zo(u,["WEBGL_compressed_texture_astc"]),this._etc=!!Zo(u,["WEBG_compressed_texture_etc"]),this._etc1=!!Zo(u,["WEBGL_compressed_texture_etc1"]),this._bc7=!!Zo(u,["EXT_texture_compression_bptc"]),vu.setKTX2SupportedFormats(this._s3tc,this._pvrtc,this._astc,this._etc,this._etc1,this._bc7);let y=o?Zo(u,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;this._textureFilterAnisotropic=y,Lt._maximumTextureFilterAnisotropy=l(y)?u.getParameter(y.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1;let A,b,x,T,C,E,w,P,R,O;if(c){let S=this;A=function(){return S._gl.createVertexArray()},b=function(I){S._gl.bindVertexArray(I)},x=function(I){S._gl.deleteVertexArray(I)},T=function(I,M,F,V,k){u.drawElementsInstanced(I,M,F,V,k)},C=function(I,M,F,V){u.drawArraysInstanced(I,M,F,V)},E=function(I,M){u.vertexAttribDivisor(I,M)},w=function(I){u.drawBuffers(I)}}else P=Zo(u,["OES_vertex_array_object"]),l(P)&&(A=function(){return P.createVertexArrayOES()},b=function(S){P.bindVertexArrayOES(S)},x=function(S){P.deleteVertexArrayOES(S)}),R=Zo(u,["ANGLE_instanced_arrays"]),l(R)&&(T=function(S,I,M,F,V){R.drawElementsInstancedANGLE(S,I,M,F,V)},C=function(S,I,M,F){R.drawArraysInstancedANGLE(S,I,M,F)},E=function(S,I){R.vertexAttribDivisorANGLE(S,I)}),O=Zo(u,["WEBGL_draw_buffers"]),l(O)&&(w=function(S){O.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=!!P,this._instancedArrays=!!R,this._drawBuffers=!!O,Lt._maximumDrawBuffers=this.drawBuffers?u.getParameter(ee.MAX_DRAW_BUFFERS):1,Lt._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 XM,_=new sc(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<Lt._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 JKe(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 ZKe(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 QKe(e,t,n,i){let r=`${ZKe(e,i)}: ${t.name}(`;for(let o=0;o<n.length;++o)o!==0&&(r+=", "),r+=n[o];return r+=");",r}function e$e(e,t,n){let i=e.getError();if(i!==e.NO_ERROR)throw new oe(QKe(e,t,n,i))}function t$e(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 n$e(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,t$e(e,r,t))}return i}function Zo(e,t){let n=t.length;for(let i=0;i<n;++i){let r=e.getExtension(t[i]);if(r)return r}}var i$e={};Object.defineProperties(Ou.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=n$e(this._originalGLContext,e?e$e:void 0)}},defaultTexture:{get:function(){if(this._defaultTexture===void 0){let e=Ct.defaultColor;this._defaultTexture=new Ct({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 Ct({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 Ct({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 Jo({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 i$e}}});function Wge(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 dJ;typeof WebGLRenderingContext<"u"&&(dJ=[ee.BACK]);function G6(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;let n=dJ;if(l(t))t._bind(),n=t._getActiveColorAttachments();else{let i=e._gl;i.bindFramebuffer(i.FRAMEBUFFER,null)}e.drawBuffers&&e.glDrawBuffers(n)}}var r$e=new ui;Ou.prototype.clear=function(e,t){e=e??r$e,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;Wge(this,s,t,!0);let c=e.framebuffer??t.framebuffer;G6(this,c),n.clear(i)};function o$e(e,t,n,i,r){G6(e,t),Wge(e,r,n,!1),i._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,i.maximumTextureUnitIndex)}function a$e(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??L.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()}Ou.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,o$e(this,r,t,n,o),a$e(this,e,n,i)};Ou.prototype.beginFrame=function(){};Ou.prototype.endFrame=function(){let e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null);let t=dJ;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)};Ou.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 G6(this,a),u._bind(),t.readPixels(n,i,r,o,c,ke.toWebGLConstant(s,this),0),u._unBind(),u};Ou.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 G6(this,a),t.readPixels(n,i,r,o,He.RGBA,ke.toWebGLConstant(s,this),u),u};var qge={position:0,textureCoordinates:1};Ou.prototype.getViewportQuadVertexArray=function(){let e=this.cache.viewportQuad_vertexArray;if(!l(e)){let t=new xt({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:qge,bufferUsage:Oe.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=e}return e};Ou.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:Mx,fragmentShaderSource:e,attributeLocations:qge}),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer,pass:t.pass})};Ou.prototype.getObjectByPickColor=function(e){return this._pickObjects.get(e)};Ou.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 WM(this._pickObjects,t,U.fromRgba(t))};Ou.prototype.isDestroyed=function(){return!1};Ou.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 Nx=Ou;function ZE(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 _a({context:t,colorRenderbuffers:r,depthStencilRenderbuffer:a,destroyAttachments:c}),this._colorFramebuffer=new _a({context:t,colorTextures:o,depthStencilTexture:s,destroyAttachments:c})}ZE.prototype.getRenderFramebuffer=function(){return this._renderFramebuffer};ZE.prototype.getColorFramebuffer=function(){return this._colorFramebuffer};ZE.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)};ZE.prototype.isDestroyed=function(){return!1};ZE.prototype.destroy=function(){return this._renderFramebuffer.destroy(),this._colorFramebuffer.destroy(),ue(this)};var KM=ZE;var jl={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===jl.RGBA4||e===jl.RGBA8||e===jl.RGBA16F||e===jl.RGBA32F||e===jl.RGB5_A1||e===jl.RGB565||e===jl.DEPTH_COMPONENT16||e===jl.STENCIL_INDEX8||e===jl.DEPTH_STENCIL||e===jl.DEPTH24_STENCIL8},getColorFormat:function(e){return e===ee.FLOAT?jl.RGBA32F:e===ee.HALF_FLOAT_OES?jl.RGBA16F:jl.RGBA8}};Object.freeze(jl);var Hl=jl;function $M(e){e=e??H.EMPTY_OBJECT;let t=e.context,n=t._gl,i=Lt.maximumRenderbufferSize,r=e.format??Hl.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($M.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});$M.prototype._getRenderbuffer=function(){return this._renderbuffer};$M.prototype.isDestroyed=function(){return!1};$M.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),ue(this)};var Tf=$M;function gs(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(gs.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}}});gs.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])};gs.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 Ct({context:e,width:t,height:n,pixelFormat:o,pixelDatatype:r,sampler:zt.NEAREST}),this._numSamples>1){let s=Hl.getColorFormat(r);this._colorRenderbuffers[a]=new Tf({context:e,width:t,height:n,format:s,numSamples:this._numSamples})}}this._depthStencil&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?(this._depthStencilTexture=new Ct({context:e,width:t,height:n,pixelFormat:He.DEPTH_STENCIL,pixelDatatype:ke.UNSIGNED_INT_24_8,sampler:zt.NEAREST}),this._numSamples>1&&(this._depthStencilRenderbuffer=new Tf({context:e,width:t,height:n,format:Hl.DEPTH24_STENCIL8,numSamples:this._numSamples}))):this._depthStencilRenderbuffer=new Tf({context:e,width:t,height:n,format:Hl.DEPTH_STENCIL})),this._depth&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?this._depthTexture=new Ct({context:e,width:t,height:n,pixelFormat:He.DEPTH_COMPONENT,pixelDatatype:ke.UNSIGNED_INT,sampler:zt.NEAREST}):this._depthRenderbuffer=new Tf({context:e,width:t,height:n,format:Hl.DEPTH_COMPONENT16})),this._numSamples>1?this._multisampleFramebuffer=new KM({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 _a({context:e,colorTextures:this._colorTextures,depthTexture:this._depthTexture,depthRenderbuffer:this._depthRenderbuffer,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1})}};gs.prototype.getColorTexture=function(e){return e=e??0,this._colorTextures[e]};gs.prototype.setColorTexture=function(e,t){t=t??0,this._attachmentsDirty=e!==this._colorTextures[t],this._colorTextures[t]=e};gs.prototype.getColorRenderbuffer=function(e){return e=e??0,this._colorRenderbuffers[e]};gs.prototype.setColorRenderbuffer=function(e,t){t=t??0,this._attachmentsDirty=e!==this._colorRenderbuffers[t],this._colorRenderbuffers[t]=e};gs.prototype.getDepthRenderbuffer=function(){return this._depthRenderbuffer};gs.prototype.setDepthRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthRenderbuffer,this._depthRenderbuffer=e};gs.prototype.getDepthTexture=function(){return this._depthTexture};gs.prototype.setDepthTexture=function(e){this._attachmentsDirty=e!==this._depthTexture,this._depthTexture=e};gs.prototype.getDepthStencilRenderbuffer=function(){return this._depthStencilRenderbuffer};gs.prototype.setDepthStencilRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthStencilRenderbuffer,this._depthStencilRenderbuffer=e};gs.prototype.getDepthStencilTexture=function(){return this._depthStencilTexture};gs.prototype.setDepthStencilTexture=function(e){this._attachmentsDirty=e!==this._depthStencilTexture,this._depthStencilTexture=e};gs.prototype.prepareTextures=function(e,t){this._numSamples>1&&this._multisampleFramebuffer.blitFramebuffers(e,t)};gs.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this.framebuffer,t.execute(e,n),t.framebuffer=i};gs.prototype.destroyFramebuffer=function(){this._framebuffer=this._framebuffer&&this._framebuffer.destroy(),this._multisampleFramebuffer=this._multisampleFramebuffer&&this._multisampleFramebuffer.destroy()};gs.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 oi=gs;var Qy={NONE:0,VERTEX:1,FRAGMENT:2,BOTH:3};Qy.includesVertexShader=function(e){return(e&Qy.VERTEX)!==0};Qy.includesFragmentShader=function(e){return(e&Qy.FRAGMENT)!==0};Qy.union=function(...e){let t=0;for(let n=0;n<e.length;n++)t|=e[n];return t};Qy.intersection=function(...e){let t=e[0];for(let n=1;n<e.length;n++)t&=e[n];return t};Object.freeze(Qy);var he=Qy;function hJ(e){this.name=e,this.fields=[]}hJ.prototype.addField=function(e,t){let n=` ${e} ${t};`;this.fields.push(n)};hJ.prototype.generateGlslLines=function(){let e=this.fields;return e.length===0&&(e=[" float _empty;"]),[].concat(`struct ${this.name}`,"{",e,"};")};var JM=hJ;function mJ(e){this.signature=e,this.body=[]}mJ.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}`)};mJ.prototype.generateGlslLines=function(){return[].concat(this.signature,"{",this.body,"}")};var ZM=mJ;function Gl(){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(Gl.prototype,{attributeLocations:{get:function(){return this._attributeLocations}}});Gl.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)};Gl.prototype.addStruct=function(e,t,n){this._structs[e]=new JM(t),he.includesVertexShader(n)&&this._vertexShaderParts.structIds.push(e),he.includesFragmentShader(n)&&this._fragmentShaderParts.structIds.push(e)};Gl.prototype.addStructField=function(e,t,n){this._structs[e].addField(t,n)};Gl.prototype.addFunction=function(e,t,n){this._functions[e]=new ZM(t),he.includesVertexShader(n)&&this._vertexShaderParts.functionIds.push(e),he.includesFragmentShader(n)&&this._fragmentShaderParts.functionIds.push(e)};Gl.prototype.addFunctionLines=function(e,t){this._functions[e].addLines(t)};Gl.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)};Gl.prototype.setPositionAttribute=function(e,t){return this._positionAttributeLine=`in ${e} ${t};`,this._attributeLocations[t]=0,0};Gl.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+=c$e(e),i};Gl.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}`)};Gl.prototype.addVertexLines=function(e){let t=this._vertexShaderParts.shaderLines;Array.isArray(e)?Xn(t,e):t.push(e)};Gl.prototype.addFragmentLines=function(e){let t=this._fragmentShaderParts.shaderLines;Array.isArray(e)?Xn(t,e):t.push(e)};Gl.prototype.buildShaderProgram=function(e){let t=l(this._positionAttributeLine)?[this._positionAttributeLine]:[],n=s$e(this),i=l$e(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})};Gl.prototype.clone=function(){return Ye(this,!0)};function s$e(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 c$e(e){switch(e){case"mat2":return 2;case"mat3":return 3;case"mat4":return 4;default:return 1}}function l$e(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 Cg=Gl;function W6(e){this._autoDestroy=e?.autoDestroy??!0,this._canvas=document.createElement("canvas"),this._context=new Nx(this._canvas,Ye(e?.contextOptions)),this._canvases=[]}W6.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)}}})};W6.prototype.destroy=function(){this._context.destroy(),ue(this)};W6.prototype.isDestroyed=function(){return!1};var QM=W6;function Fx(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}Fx.create=function(e){return new Fx(e)};Fx.prototype.getStatus=function(){return this._gl.getSyncParameter(this._sync,ee.SYNC_STATUS)};Fx.prototype.isDestroyed=function(){return!1};Fx.prototype.destroy=function(){return this._gl.deleteSync(this._sync),ue(this)};Fx.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 eL=Fx;function eA(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 zt}=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,Kge(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");Yge(this,n),this._initialized=!0}else Xge(this);m.bindTexture(this._textureTarget,null)}function Yge(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=pJ(y),A=pJ(A),b=pJ(b),i.texSubImage3D(r,x+1,0,0,0,y,A,b,u,ke.toWebGLConstant(f,n),t.mipLevels[x])}}eA.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?(Yge(this,t),d=!0):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),Xge(this)),this._initialized=!0),d||u$e(this,t.arrayBufferView,n,i,r,c,u,f),a.bindTexture(s,null)};function u$e(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 pJ(e){let t=Math.floor(e/2)|0;return Math.max(t,1)}function Xge(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)}eA.create=function(e){return new eA(e)};Object.defineProperties(eA.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){Kge(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 Kge(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=ei.NEAREST),He.isDepthFormat(a)&&(n=Gt.NEAREST,i=ei.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)}eA.prototype.generateMipmap=function(e){e=e??bd.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)};eA.prototype.isDestroyed=function(){return!1};eA.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),ue(this)};var tL=eA;var $ge=16;function Wl(e){e=e??H.EMPTY_OBJECT;let t=e.borderWidthInPixels??1,n=e.initialSize??new z($ge,$ge);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 Ct({context:e,height:n,width:t,pixelFormat:r,sampler:o}),s=e._gl,c=a._textureTarget,u=this._texture,f=new _a({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 Jge({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=D.nextPowerOfTwo(Math.max(f,a)),s=D.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 XE({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 Jge({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 Jge({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 Ct({context:e,width:t,height:n,pixelFormat:i,sampler:r}),this._texturePacker=new XE({height:n,width:t,borderPadding:o})}return this._processImageQueue(e)};async function f$e(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 f$e(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 Bx=Wl;function Ms(e,t,n,i){let r=Ms._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=Ms._vertexSizeInBytes(s),p=s[0].usage,g={vertexSizeInBytes:d,vertexBuffer:void 0,usage:p,needsCommit:!1,arrayBuffer:void 0,arrayViews:Ms._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)}Ms._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};Ms._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};Ms._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};Ms.prototype.resize=function(e){this._size=e;let t=this._allBuffers;this.writers=[];for(let n=0,i=t.length;n<i;++n){let r=t[n];Ms._resize(r,this._size),Ms._appendWriters(this.writers,r)}gJ(this)};Ms._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 d$e=[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}}];Ms._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]=d$e[o.componentsPerAttribute-1](t,o.view,o.vertexSizeInComponentType)}};Ms.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=h$e(this,i)||t;if(t||!l(this.va)){gJ(this);let a=this.va=[],s=D.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);Ms._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 h$e(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}Ms._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})}};Ms.prototype.subCommit=function(e,t){let n=this._allBuffers;for(let i=0,r=n.length;i<r;++i)m$e(n[i],e,t)};function m$e(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)}}Ms.prototype.endSubCommits=function(){let e=this._allBuffers;for(let t=0,n=e.length;t<n;++t)e[t].needsCommit=!1};function gJ(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}Ms.prototype.isDestroyed=function(){return!1};Ms.prototype.destroy=function(){let e=this._allBuffers;for(let t=0,n=e.length;t<n;++t){let i=e[t];i.vertexBuffer=i.vertexBuffer&&i.vertexBuffer.destroy()}return gJ(this),ue(this)};var vg=Ms;function p$e(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 Jo({context:e,source:{positiveX:o[0],negativeX:o[1],positiveY:o[2],negativeY:o[3],positiveZ:o[4],negativeZ:o[5]}})})}var nL=p$e;var g$e=Object.freeze({DONE:0,PENDING:1,FAILED:2}),It=g$e;function ql(){this._dataSources=[],this._dataSourceAdded=new be,this._dataSourceRemoved=new be,this._dataSourceMoved=new be}Object.defineProperties(ql.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}}});ql.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})};ql.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};ql.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=[]};ql.prototype.contains=function(e){return this.indexOf(e)!==-1};ql.prototype.indexOf=function(e){return this._dataSources.indexOf(e)};ql.prototype.get=function(e){return this._dataSources[e]};ql.prototype.getByName=function(e){return this._dataSources.filter(function(t){return t.name===e})};function q6(e,t){return e.indexOf(t)}function Zge(e,t,n){let i=e._dataSources,r=i.length-1;if(t=D.clamp(t,0,r),n=D.clamp(n,0,r),t===n)return;let o=i[t];i[t]=i[n],i[n]=o,e.dataSourceMoved.raiseEvent(o,n,t)}ql.prototype.raise=function(e){let t=q6(this._dataSources,e);Zge(this,t,t+1)};ql.prototype.lower=function(e){let t=q6(this._dataSources,e);Zge(this,t,t-1)};ql.prototype.raiseToTop=function(e){let t=q6(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))};ql.prototype.lowerToBottom=function(e){let t=q6(this._dataSources,e);t!==0&&(this._dataSources.splice(t,1),this._dataSources.splice(0,0,e),this.dataSourceMoved.raiseEvent(e,0,t))};ql.prototype.isDestroyed=function(){return!1};ql.prototype.destroy=function(){return this.removeAll(!0),ue(this)};var iL=ql;var rL=`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 oL=`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 aL=`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 sL=`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 _J={TERRAIN:0,CESIUM_3D_TILE:1,BOTH:2};_J.NUMBER_OF_CLASSIFICATION_TYPES=3;Object.freeze(_J);var Zn=_J;var kx=`in vec4 v_color;
void main()
{
out_FragColor = czm_gammaCorrect(v_color);
}
`;var cL=`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 QE(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(QE.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}}});QE.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(`
`)};QE.prototype.isTranslucent=function(){return l(this.material)&&this.material.isTranslucent()||!l(this.material)&&this.translucent};QE.prototype.getRenderState=function(){let e=this.isTranslucent(),t=Ye(this.renderState,!1);return e?(t.depthMask=!1,t.blending=Qt.ALPHA_BLEND):t.depthMask=!0,t};QE.getDefaultRenderState=function(e,t,n){let i={depthTest:{enabled:!0}};return e&&(i.depthMask=!1,i.blending=Qt.ALPHA_BLEND),t&&(i.cull={enabled:!0,face:zi.BACK}),l(n)&&(i=Ot(n,i,!0)),i};var Cr=QE;var _$e=`#define CLIP_POLYLINE
${Ul}
${cL}`,y$e=kx;function zx(e){e=e??H.EMPTY_OBJECT;let t=e.translucent??!0,n=!1,i=zx.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??_$e,this._fragmentShaderSource=e.fragmentShaderSource??y$e,this._renderState=Cr.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(zx.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}}});zx.VERTEX_FORMAT=Be.POSITION_ONLY;zx.prototype.getFragmentShaderSource=Cr.prototype.getFragmentShaderSource;zx.prototype.isTranslucent=Cr.prototype.isTranslucent;zx.prototype.getRenderState=Cr.prototype.getRenderState;var Ma=zx;var lL=`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 Ux=`#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 uL=`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 fL=`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 dL=`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 hL=`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 mL=`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 pL=`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 gL=`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 _L=`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 yL=`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 AL=`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 bL=`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 xL=`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 TL=`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 CL=`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 vL=`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 EL=`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 SL=`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 wL=`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 IL=`// 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??ei.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,A$e(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(t_e(i,n),await Promise.all(n),n.length=0,l(i._initializationError))throw i._initializationError;return i};function t_e(e,t){t.push(...e._initializationPromises);let n=e.materials;for(let i in n)if(n.hasOwnProperty(i)){let r=n[i];t_e(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 zt({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter}),p;l(u.internalFormat)?p=new Ct({context:e,pixelFormat:u.internalFormat,width:u.width,height:u.height,source:{arrayBufferView:u.bufferView,mipLevels:f},sampler:d}):p=new Ct({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 Jo({context:e,source:{positiveX:u[0],negativeX:u[1],positiveY:u[2],negativeY:u[3],positiveZ:u[4],negativeZ:u[5]},sampler:new zt({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 A$e(e,t){e=e??H.EMPTY_OBJECT,t._strict=e.strict??!1,t._count=e.count??0,t._template=Ye(e.fabric??H.EMPTY_OBJECT),t.fabric=Ye(e.fabric??H.EMPTY_OBJECT),t._template.uniforms=Ye(t._template.uniforms??H.EMPTY_OBJECT),t._template.materials=Ye(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=Ye(i.fabric,!0);t._template=Ot(t._template,o,!0),n=i.translucent}C$e(t),E$e(t),P$e(t),R$e(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 yJ(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 Qge(e,t){}function b$e(e,t){}var x$e=["type","materials","uniforms","components","source"],T$e=["diffuse","specular","shininess","normal","emission","alpha"];function C$e(e){let t=e._template,n=t.uniforms,i=t.materials,r=t.components;yJ(t,x$e,Qge,!0),yJ(r,T$e,Qge,!0);let o=[];for(let a in i)i.hasOwnProperty(a)&&o.push(a);yJ(n,o,b$e,!1)}function v$e(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 E$e(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&&v$e(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 e_e={mat2:Ki,mat3:$,mat4:L},S$e=/\.ktx2$/i;function w$e(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 zt({minificationFilter:n._minificationFilter,magnificationFilter:n._magnificationFilter});c=new Ct({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 Ct&&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}n_e(n,e)}}}function n_e(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 S$e.test(r.url)?s=vu(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 I$e(e){return function(t,n){let i=t.uniforms[e];if(i instanceof Jo){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),i_e(t,e)}}function i_e(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 P$e(e){let t=e._template.uniforms;for(let n in t)t.hasOwnProperty(n)&&r_e(e,n)}function r_e(e,t){let n=e._strict,i=e._template.uniforms,r=i[t],o=D$e(r),a;if(o==="channels")a=PL(e,t,r,!1);else{if(o==="sampler2D"){let u=`${t}Dimensions`;O$e(e,u)>0&&(i[u]={type:"ivec3",x:1,y:1},r_e(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=PL(e,t,c),e.uniforms[t]=r,o==="sampler2D")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(w$e(t)),e._initializationPromises.push(n_e(e,t));else if(o==="samplerCube")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(I$e(t)),e._initializationPromises.push(i_e(e,t));else if(o.indexOf("mat")!==-1){let u=new e_e[o];e._uniforms[c]=function(){return e_e[o].fromColumnMajorArray(e.uniforms[t],u)}}else e._uniforms[c]=function(){return e.uniforms[t]}}}function D$e(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 R$e(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++}`;PL(r,o,a),e.shaderSource=r.shaderSource+e.shaderSource;let s=`${a}(materialInput)`,c=PL(e,i,s)}}function PL(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 O$e(e,t,n){return PL(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 z(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 z(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 z(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 z(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 z(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 z(1,1)},source:fL},translucent:!1});et.NormalMapType="NormalMap";et._materialCache.addMaterial(et.NormalMapType,{fabric:{type:et.NormalMapType,uniforms:{image:et.DefaultImageId,channels:"rgb",strength:.8,repeat:new z(1,1)},source:AL},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 z(8,8),lineThickness:new z(1,1),lineOffset:new z(0,0)},source:yL},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:SL},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 z(5,5)},source:dL},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 z(5,5)},source:hL},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:IL},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:vL},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 z(.5,.5)},source:_L},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:bL},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:xL},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:TL},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:CL},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:pL},translucent:!1});et.ElevationRampType="ElevationRamp";et._materialCache.addMaterial(et.ElevationRampType,{fabric:{type:et.ElevationRampType,uniforms:{image:et.DefaultImageId,minimumHeight:0,maximumHeight:1e4},source:gL},translucent:!1});et.SlopeRampMaterialType="SlopeRamp";et._materialCache.addMaterial(et.SlopeRampMaterialType,{fabric:{type:et.SlopeRampMaterialType,uniforms:{image:et.DefaultImageId},source:EL},translucent:!1});et.AspectRampMaterialType="AspectRamp";et._materialCache.addMaterial(et.AspectRampMaterialType,{fabric:{type:et.AspectRampMaterialType,uniforms:{image:et.DefaultImageId},source:uL},translucent:!1});et.ElevationBandType="ElevationBand";et._materialCache.addMaterial(et.ElevationBandType,{fabric:{type:et.ElevationBandType,uniforms:{heights:et.DefaultImageId,colors:et.DefaultImageId},source:mL},translucent:!0});et.WaterMaskType="WaterMask";et._materialCache.addMaterial(et.WaterMaskType,{fabric:{type:et.WaterMaskType,source:wL,uniforms:{waterColor:new U(1,1,1,1),landColor:new U(0,0,0,0)}},translucent:!1});var tr=et;var M$e=`#define CLIP_POLYLINE
${Ul}
${lL}`,L$e=Ux;function Vx(e){e=e??H.EMPTY_OBJECT;let t=e.translucent??!0,n=!1,i=Vx.VERTEX_FORMAT;this.material=l(e.material)?e.material:tr.fromType(tr.ColorType),this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??M$e,this._fragmentShaderSource=e.fragmentShaderSource??L$e,this._renderState=Cr.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(Vx.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}}});Vx.VERTEX_FORMAT=Be.POSITION_AND_ST;Vx.prototype.getFragmentShaderSource=Cr.prototype.getFragmentShaderSource;Vx.prototype.isTranslucent=Cr.prototype.isTranslucent;Vx.prototype.getRenderState=Cr.prototype.getRenderState;var cc=Vx;function Eg(e,t,n){if(this._attributes=t,this._numberOfInstances=n,t.length===0)return;let i=N$e(t),r=e.floatingPointTexture,o=i===ke.FLOAT&&!r,a=F$e(t,o),s=B$e(a,t,o),c=Math.floor(Lt.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 z(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(Eg.prototype,{attributes:{get:function(){return this._attributes}},numberOfInstances:{get:function(){return this._numberOfInstances}}});function N$e(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 a_e(e,t){let n=e[t].componentsPerAttribute;return n===2?z:n===3?h:n===4?ae:Number}function F$e(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 B$e(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 DL=new ae;function k$e(e,t,n){let i=ae.unpack(e,t,DL),r=ae.unpackFloat(i);i=ae.unpack(e,t+4,DL);let o=ae.unpackFloat(i);i=ae.unpack(e,t+8,DL);let a=ae.unpackFloat(i);i=ae.unpack(e,t+12,DL);let s=ae.unpackFloat(i);return ae.fromElements(r,o,a,s,n)}function z$e(e,t,n){let i=ae.packFloat(e.x,DL);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 o_e=new ae;Eg.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=k$e(this._batchValues,a,o_e):s=ae.unpack(this._batchValues,a,o_e);let c=a_e(i,t);return l(c.fromCartesian4)?c.fromCartesian4(s,n):l(c.clone)?c.clone(s,n):s.x};var U$e=[void 0,void 0,new z,new h,new ae],V$e=new ae;Eg.prototype.setBatchedAttribute=function(e,t,n){let i=this._attributes,r=U$e[i[t].componentsPerAttribute],o=this.getBatchedAttribute(e,t,r),a=a_e(this._attributes,t);if(l(a.equals)?a.equals(o,n):o===n)return;let c=V$e;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?z$e(c,this._batchValues,d):ae.pack(c,this._batchValues,d),this._batchValuesDirty=!0};function j$e(e,t){let n=e._textureDimensions;e._texture=new Ct({context:t,pixelFormat:He.RGBA,pixelDatatype:e._pixelDatatype,width:n.x,height:n.y,sampler:zt.NEAREST,flipY:!1})}function H$e(e){let t=e._textureDimensions;e._texture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}Eg.prototype.update=function(e){l(this._texture)&&!this._batchValuesDirty||this._attributes.length===0||(this._batchValuesDirty=!1,l(this._texture)||j$e(this,e.context),H$e(this))};Eg.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 G$e(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 W$e(e){return e===1?"float":`vec${e}`}function q$e(e){return e===1?".x":e===2?".xy":e===3?".xyz":""}function Y$e(e,t){let i=e._attributes[t],r=i.componentsPerAttribute,o=i.functionName,a=W$e(r),s=q$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}Eg.prototype.getVertexShaderCallback=function(){let e=this._attributes;if(e.length===0)return function(i){return i};let t=`uniform highp sampler2D batchTexture;
`;t+=`${G$e(this)}
`;let n=e.length;for(let i=0;i<n;++i)t+=Y$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}`}};Eg.prototype.isDestroyed=function(){return!1};Eg.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),ue(this)};var jx=Eg;var s_e={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(s_e);var lc=s_e;function X$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(!L.equals(a,e[o].modelMatrix)){i=!0;break}}if(i)for(o=0;o<r;++o)l(e[o].geometry)&&Hn.transformToWorldCoordinates(e[o]);else L.multiplyTransformation(t,e[0].modelMatrix,t)}function AJ(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 K$e(e){let t=e.length;for(let n=0;n<t;++n){let i=e[n];l(i.geometry)?AJ(i.geometry,n):l(i.westHemisphereGeometry)&&l(i.eastHemisphereGeometry)&&(AJ(i.westHemisphereGeometry,n),AJ(i.eastHemisphereGeometry,n))}}function $$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(X$e(t,s,r),!r)for(c=0;c<d;++c)l(t[c].geometry)&&Hn.splitLongitude(t[c]);if(K$e(t),o)for(c=0;c<d;++c){let g=t[c];l(g.geometry)?(Hn.reorderForPostVertexCache(g.geometry),Hn.reorderForPreVertexCache(g.geometry)):l(g.westHemisphereGeometry)&&l(g.eastHemisphereGeometry)&&(Hn.reorderForPostVertexCache(g.westHemisphereGeometry),Hn.reorderForPreVertexCache(g.westHemisphereGeometry),Hn.reorderForPostVertexCache(g.eastHemisphereGeometry),Hn.reorderForPreVertexCache(g.eastHemisphereGeometry))}let p=Hn.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&&Hn.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`;Hn.projectTo2D(u,m,y,A,n),l(u.boundingSphere)&&m==="position"&&(u.boundingSphereCV=se.fromVertices(u.attributes.position2D.values)),Hn.encodeAttribute(u,y,`${y}High`,`${y}Low`),Hn.encodeAttribute(u,A,`${A}High`,`${A}Low`)}a&&Hn.compressVertices(u)}if(!i){let g=[];for(d=p.length,c=0;c<d;++c)u=p[c],g=g.concat(Hn.fitToUnsignedShortIndices(u));p=g}return p}function bJ(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 J$e(e,t){let n=[];return bJ(e,"geometry",t,n),bJ(e,"westHemisphereGeometry",t,n),bJ(e,"eastHemisphereGeometry",t,n),n}var Sg={};Sg.combineGeometry=function(e){let t,n,i=e.instances,r=i.length,o,a,s=!1;r>0&&(t=$$e(e),t.length>0&&(n=Hn.createAttributeLocations(t[0]),e.createPickOffsets&&(o=J$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 Z$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 Q$e(e,t){let n=e.length;for(let i=0;i<n;++i)Z$e(e[i],t)}function eJe(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}Sg.packCreateGeometryResults=function(e,t){let n=new Float64Array(eJe(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}};Sg.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 bn,T=n[a++];for(i=0;i<T;i++){let E=t[n[a++]],w=n[a++];b=n[a++];let P=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:P,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 xt({primitiveType:c,geometryType:u,boundingSphere:d,boundingSphereCV:p,indices:C,attributes:x,offsetAttribute:f})}return r};function tJe(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(L.pack(a.modelMatrix,i,r),r+=L.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 nJe(e){let t=e,n=new Array(t[0]),i=0,r=1;for(;r<t.length;){let o=L.unpack(t,r),a;r+=L.packedLength,l(t[r])&&(a={offset:new _r(t[r],t[r+1],t[r+2])}),r+=3,n[i++]={modelMatrix:o,attributes:a}}return n}Sg.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:tJe(e.instances,t),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof Bi,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}};Sg.unpackCombineGeometryParameters=function(e){let t=nJe(e.packedInstances),n=e.createGeometryResults,i=n.length,r=0;for(let s=0;s<i;s++){let c=Sg.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 Bi(o):new di(o);return{instances:t,ellipsoid:o,projection:a,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:L.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}};function c_e(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 l_e(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}Sg.packCombineGeometryResults=function(e,t){l(e.geometries)&&Q$e(e.geometries,t);let n=c_e(e.boundingSpheres),i=c_e(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}};Sg.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:l_e(e.boundingSpheres),boundingSpheresCV:l_e(e.boundingSpheresCV)}};var Hx=Sg;var u_e={READY:0,CREATING:1,CREATED:2,COMBINING:3,COMBINED:4,COMPLETE:5,FAILED:6};Object.freeze(u_e);var Qo=u_e;var Mu={DISABLED:0,ENABLED:1,CAST_ONLY:2,RECEIVE_ONLY:3};Mu.NUMBER_OF_SHADOW_MODES=4;Mu.castShadows=function(e){return e===Mu.ENABLED||e===Mu.CAST_ONLY};Mu.receiveShadows=function(e){return e===Mu.ENABLED||e===Mu.RECEIVE_ONLY};Mu.fromCastReceive=function(e,t){return e&&t?Mu.ENABLED:e?Mu.CAST_ONLY:t?Mu.RECEIVE_ONLY:Mu.DISABLED};Object.freeze(Mu);var Rn=Mu;function ea(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=L.clone(e.modelMatrix??L.IDENTITY),this._modelMatrix=new L,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=Qo.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(ea.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 iJe(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 rJe=new z,oJe=new h,A_e=new ae;function b_e(e){let t=e.length;if(t===1)return e[0];if(t===2)return z.unpack(e,0,rJe);if(t===3)return h.unpack(e,0,oJe);if(t===4)return ae.unpack(e,0,A_e)}function aJe(e,t){let n=e.geometryInstances,i=Array.isArray(n)?n:[n],r=i.length;if(r===0)return;let o=iJe(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 jx(t,s,r);for(g=0;g<r;++g){let x=i[g];p=x.attributes;for(let P=0;P<a;++P){m=o[P],y=p[m];let R=b_e(y.value),O=c[m];b.setBatchedAttribute(g,O,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=A_e;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 sJe(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 cJe(e){let t=e.attributes,n=new bn;for(let r in t)t.hasOwnProperty(r)&&l(t[r])&&(n[r]=sJe(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 xt({attributes:n,indices:i,primitiveType:e.primitiveType,boundingSphere:se.clone(e.boundingSphere)})}function lJe(e,t){return{geometry:t,attributes:e.attributes,modelMatrix:L.clone(e.modelMatrix),pickPrimitive:e.pickPrimitive,id:e.id}}var uJe=/in\s+vec(?:3|4)\s+(.*)3DHigh;/g;ea._modifyShaderPosition=function(e,t,n){let i,r="",o="",a="";for(;(i=uJe.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(`
`)};ea._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};ea._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 f_e(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 d_e(e){return`in vec4 v_pickColor;
${e}`}ea._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};ea._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};ea._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 h_e(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 fJe(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 dJe(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 m_e(e,t){let n=e.vertexAttributes}function hJe(e,t){return function(){return e[t]}}var xJ=Math.max(fn.hardwareConcurrency-1,1),Y6,mJe=new Yn("combineGeometry");function pJe(e,t){let n,i,r,o,a=e._instanceIds;if(e._state===Qo.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(Y6))for(Y6=new Array(xJ),r=0;r<xJ;r++)Y6[r]=new Yn("createGeometry");let f;for(u=zM(u,xJ),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(Y6[r].scheduleTask({subTasks:u[r]},m))}e._state=Qo.CREATING,Promise.all(c).then(function(d){e._createGeometryResults=d,e._state=Qo.CREATED}).catch(function(d){OL(e,t,Qo.FAILED,d)})}else if(e._state===Qo.CREATED){let s=[];n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let c=t.scene3DOnly,u=t.mapProjection,f=mJe.scheduleTask(Hx.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=Qo.COMBINING,Promise.resolve(f).then(function(d){let p=Hx.unpackCombineGeometryResults(d);e._geometries=p.geometries,e._attributeLocations=p.attributeLocations,e.modelMatrix=L.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=Qo.COMBINED):OL(e,t,Qo.FAILED,void 0)}).catch(function(d){OL(e,t,Qo.FAILED,d)})}}function gJe(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=cJe(p):g=p.constructor.createGeometry(p),r[c++]=lJe(a,g),o.push(a.id)}r.length=c;let u=t.scene3DOnly,f=t.mapProjection,d=Hx.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=L.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=Qo.COMBINED):OL(e,t,Qo.FAILED,void 0)}function _Je(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),v_e(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,en.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])}ea._updateBoundingVolumes(e,t,e.modelMatrix,!0),e._recomputeBoundingSpheres=!1}var p_e=new vn,x_e=new de,T_e=new h,C_e=new se;function yJe(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,C_e));let b=y.center,x=y.radius,T=vn.fromCartesian(b,p_e);if(d.setBatchedAttribute(m,r,T.high),d.setBatchedAttribute(m,o,T.low),!t.scene3DOnly){let C=f.cartesianToCartographic(b,x_e),E=u.project(C,T_e);T=vn.fromCartesian(E,p_e),d.setBatchedAttribute(m,a,T.high),d.setBatchedAttribute(m,s,T.low)}d.setBatchedAttribute(m,c,x)}e._batchTableBoundingSpheresUpdated=!0}var TJ=new h,AJe=new h;function g_e(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,C_e));let g=f.center;g=o.scaleToGeodeticSurface(g,AJe);let m=o.cartesianToCartographic(g,x_e),y=r.project(m,T_e),A=h.add(d,g,TJ);m=o.cartesianToCartographic(A,m);let b=r.project(m,TJ),x=h.subtract(b,y,TJ),T=x.x;x.x=x.z,x.z=x.y,x.y=T,a.setBatchedAttribute(u,i,x)}e._batchTableOffsetsUpdated=!0}function bJe(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,OL(e,t,Qo.COMPLETE,void 0)}function xJe(e,t,n,i){let r=n.getRenderState(),o;i?(o=Ye(r,!1),o.cull={enabled:!0,face:zi.BACK},e._frontFaceRS=je.fromCache(o),o.cull.face=zi.FRONT,e._backFaceRS=je.fromCache(o)):(e._frontFaceRS=je.fromCache(r),e._backFaceRS=e._frontFaceRS),o=Ye(r,!1),l(e._depthFailAppearance)&&(o.depthTest.enabled=!1),l(e._depthFailAppearance)&&(r=e._depthFailAppearance.getRenderState(),o=Ye(r,!1),o.depthTest.func=lc.GREATER,i?(o.cull={enabled:!0,face:zi.BACK},e._frontFaceDepthFailRS=je.fromCache(o),o.cull.face=zi.FRONT,e._backFaceDepthFailRS=je.fromCache(o)):(e._frontFaceDepthFailRS=je.fromCache(o),e._backFaceDepthFailRS=e._frontFaceRS))}function TJe(e,t,n){let i=t.context,r=e._attributeLocations,o=e._batchTable.getVertexShaderCallback()(n.vertexShaderSource);o=ea._appendOffsetToShader(e,o),o=ea._appendShowToShader(e,o),o=ea._appendDistanceDisplayConditionToShader(e,o,t.scene3DOnly),o=f_e(o),o=ea._updateColorAttribute(e,o,!1),o=h_e(e,o),o=ea._modifyShaderPosition(e,o,t.scene3DOnly);let a=n.getFragmentShaderSource();a=d_e(a),e._sp=Zt.replaceCache({context:i,shaderProgram:e._sp,vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:r}),m_e(e._sp,r),l(e._depthFailAppearance)&&(o=e._batchTable.getVertexShaderCallback()(e._depthFailAppearance.vertexShaderSource),o=ea._appendShowToShader(e,o),o=ea._appendDistanceDisplayConditionToShader(e,o,t.scene3DOnly),o=f_e(o),o=ea._updateColorAttribute(e,o,!0),o=h_e(e,o),o=ea._modifyShaderPosition(e,o,t.scene3DOnly),o=fJe(o),a=e._depthFailAppearance.getFragmentShaderSource(),a=d_e(a),a=dJe(a),e._spDepthFail=Zt.replaceCache({context:i,shaderProgram:e._spDepthFail,vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:r}),m_e(e._spDepthFail,r))}var RL=new L,__e=new h;function y_e(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]=hJe(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 L.multiply(c,e._modelMatrix,RL),L.multiplyByPoint(RL,e.rtcCenter,__e),L.setTranslation(RL,__e,RL),RL}),s}function CJe(e,t,n,i,r,o,a,s){let c=y_e(e,t,n,s),u;l(e._depthFailAppearance)&&(u=y_e(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}}ea._updateBoundingVolumes=function(e,t,n,i){let r,o,a;if(i||!L.equals(n,e._modelMatrix))for(L.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 vJe(e,t,n,i,r,o,a,s){ea._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)}}}ea.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===Qo.FAILED)return;let t=e.context;if(l(this._batchTable)||aJe(this,t),this._batchTable.attributes.length>0){if(Lt.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!==Qo.COMPLETE&&this._state!==Qo.COMBINED&&(this.asynchronous?pJe(this,e):gJe(this,e)),this._state===Qo.COMBINED&&(yJe(this,e),g_e(this,e),bJe(this,e)),!this.show||this._state!==Qo.COMPLETE)return;this._batchTableOffsetsUpdated||g_e(this,e),this._recomputeBoundingSpheres&&_Je(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??xJe)(this,t,n,u),o&&(this._createShaderProgramFunction??TJe)(this,e,n),(r||o)&&(this._createCommandsFunction??CJe)(this,n,i,c,u,this._colorCommands,this._pickCommands,e),(this._updateAndQueueCommandsFunction??vJe)(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,u)};var EJe=new se,SJe=new se;function v_e(e,t,n){if(n===hn.TOP){let i=se.clone(e,EJe),r=se.clone(e,SJe);r.center=h.add(r.center,t,r.center),e=se.union(i,r,e)}else n===hn.ALL&&(e.center=h.add(e.center,t,e.center));return e}function wJe(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 IJe(e,t,n,i,r){return function(o){let a=b_e(o);e.setBatchedAttribute(t,n,a),r==="offset"&&(i._recomputeBoundingSpheres=!0,i._batchTableOffsetsUpdated=!1)}}var PJe=new h;function DJe(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)&&v_e(i,h.fromArray(o.get(),0,PJe),e._offsetInstanceExtend[n]),l(r)&&(i=se.transform(i,r))}return i}},t.boundingSphereCV={get:function(){return e._instanceBoundingSpheresCV[n]}}}function RJe(e,t,n){t.pickId={get:function(){return e._pickIds[n]}}}ea.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:wJe(a,n,f),set:IJe(a,n,f,this,u)}}return DJe(this,c,n),RJe(this,c,n),Object.defineProperties(t,c),this._lastPerInstanceAttributeIndex=n,this._perInstanceAttributeCache.set(e,t),t};ea.prototype.isDestroyed=function(){return!1};ea.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 OL(e,t,n,i){e._error=i,e._state=n,t.afterRender.push(function(){return e._ready=e._state===Qo.COMPLETE||e._state===Qo.FAILED,!0})}var Nn=ea;var E_e={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(E_e);var Qn=E_e;var S_e={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(S_e);var Pt=S_e;var X6={CESIUM_3D_TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15};X6.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:X6.CESIUM_3D_TILE_MASK,mask:X6.CESIUM_3D_TILE_MASK}};var qt=Object.freeze(X6);function wg(e){e=e??H.EMPTY_OBJECT,this.geometryInstances=e.geometryInstances,this._hasPerInstanceColors=!0;let t=e.appearance;l(t)||(t=new cc),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=w_e(!1),this._renderState3DTiles=w_e(!0),this._renderStateMorph=je.fromCache({cull:{enabled:!0,face:zi.FRONT},depthTest:{enabled:!0},blending:Qt.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}Object.defineProperties(wg.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}}});wg.initializeTerrainHeights=function(){return wi.initialize()};function OJe(e,t,n){let i=t.context,r=e._primitive,o=r._attributeLocations,a=r._batchTable.getVertexShaderCallback()(sL);a=Nn._appendShowToShader(r,a),a=Nn._appendDistanceDisplayConditionToShader(r,a),a=Nn._modifyShaderPosition(e,a,t.scene3DOnly);let s=r._batchTable.getVertexShaderCallback()(aL);s=Nn._appendShowToShader(r,s),s=Nn._appendDistanceDisplayConditionToShader(r,s),s=Nn._modifyShaderPosition(e,s,t.scene3DOnly);let c=r._batchTable.getVertexShaderCallback()(rL),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 ${wi._defaultMaxTerrainHeight.toFixed(1)}`]),sources:[s]});c=r._batchTable.getVertexShaderCallback()(oL);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 w_e(e){return je.fromCache({cull:{enabled:!0},blending:Qt.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 MJe(e,t,n,i,r,o){let a=e._primitive,s=a._va.length;r.length=s,o.length=s;let u=t instanceof Ma?{}: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 I_e(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 LJe(e,t,n,i,r,o,a){let s=e._primitive;Nn._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],I_e(e,g,t,r,o,b,a)),p&&(g=n[A].derivedCommands.tileset,I_e(e,g,t,r,o,b,a))}}}wg.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!wi.initialized){wg.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 Kc({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,value:[c.geometry.width]})),c.geometry._scene3DOnly=e.scene3DOnly,lx.setProjectionAndEllipsoid(c.geometry,e.mapProjection),a[t]=new Nt({geometry:c.geometry,attributes:s,id:c.id,pickPrimitive:n})}i.geometryInstances=a,i.appearance=this.appearance,i._createShaderProgramFunction=function(c,u,f){OJe(n,u,f)},i._createCommandsFunction=function(c,u,f,d,p,g,m){MJe(n,u,f,d,g,m)},i._updateAndQueueCommandsFunction=function(c,u,f,d,p,g,m,y){LJe(n,u,f,d,p,g,m)},this._primitive=new Nn(i)}if(this.appearance instanceof Ma&&!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))})};wg.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};wg.isSupported=function(e){return e.frameState.context.depthTexture};wg.prototype.isDestroyed=function(){return!1};wg.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 Jh=wg;var ML=`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 tA=`#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 LL=`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 NL=`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 FL=`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 Ig(e){e=e??H.EMPTY_OBJECT;let t=e.translucent??!0,n=e.closed??!1,i=e.flat??!1,r=i?FL:NL,o=i?kx:LL,a=i?Ig.FLAT_VERTEX_FORMAT:Ig.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??r,this._fragmentShaderSource=e.fragmentShaderSource??o,this._renderState=Cr.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=a,this._flat=i,this._faceForward=e.faceForward??!n}Object.defineProperties(Ig.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}}});Ig.VERTEX_FORMAT=Be.POSITION_AND_NORMAL;Ig.FLAT_VERTEX_FORMAT=Be.POSITION_ONLY;Ig.prototype.getFragmentShaderSource=Cr.prototype.getFragmentShaderSource;Ig.prototype.isTranslucent=Cr.prototype.isTranslucent;Ig.prototype.getRenderState=Cr.prototype.getRenderState;var gn=Ig;var eS=`#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 kd(e,t,n){this._projectionExtentDefines={eastMostYhighDefine:"",eastMostYlowDefine:"",westMostYhighDefine:"",westMostYlowDefine:""};let i=new CJ;i.requiresTextureCoordinates=e,i.requiresEC=!n.flat;let r=new CJ;if(r.requiresTextureCoordinates=e,n instanceof gn)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}kd.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 gn&&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 gn||(r=t.material.shaderSource),new Ge({defines:i,sources:[r,eS]})};kd.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:[eS],pickColorQualifier:"in"})};kd.prototype.createVertexShader=function(e,t,n,i){return F_e(this._colorShaderDependencies,this._planarExtents,n,e,t,this._appearance,i,this._projectionExtentDefines)};kd.prototype.createPickVertexShader=function(e,t,n,i){return F_e(this._pickShaderDependencies,this._planarExtents,n,e,t,void 0,i,this._projectionExtentDefines)};var P_e=new h,D_e=new de,R_e={high:0,low:0};function F_e(e,t,n,i,r,o,a,s){let c=i.slice();if(s.eastMostYhighDefine===""){let u=D_e;u.longitude=D.PI,u.latitude=0,u.height=0;let f=a.project(u,P_e),d=vn.encode(f.x,R_e);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=D_e;p.longitude=-D.PI,p.latitude=0,p.height=0;let g=a.project(p,P_e);d=vn.encode(g.x,R_e),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 gn&&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 CJ(){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(CJ.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 O_e(e,t,n){return Math.abs((t.y-e.y)*n.x-(t.x-e.x)*n.y+t.x*e.y-t.y*e.x)/z.distance(t,e)}var NJe=[new z,new z,new z,new z];function B_e(e,t){let n=NJe,i=z.unpack(t,0,n[0]),r=z.unpack(t,2,n[1]),o=z.unpack(t,4,n[2]);e.uMaxVmax=new Kc({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,value:[r.x,r.y,o.x,o.y]});let a=1/O_e(i,r,o),s=1/O_e(i,o,r);e.uvMinAndExtents=new Kc({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,value:[i.x,i.y,a,s]})}var k_e=new de,z_e=new h,FJe=new h,BJe=new h,K6={high:0,low:0};function U_e(e,t,n){let i=k_e;i.height=0,i.longitude=e.west,i.latitude=e.south;let r=t.project(i,z_e);i.latitude=e.north;let o=t.project(i,FJe);i.longitude=e.east,i.latitude=e.south;let a=t.project(i,BJe),s=[0,0,0,0],c=[0,0,0,0],u=vn.encode(r.x,K6);s[0]=u.high,c[0]=u.low,u=vn.encode(r.y,K6),s[1]=u.high,c[1]=u.low,u=vn.encode(o.y,K6),s[2]=u.high,c[2]=u.low,u=vn.encode(a.x,K6),s[3]=u.high,c[3]=u.low,n.planes2D_HIGH=new Kc({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,value:s}),n.planes2D_LOW=new Kc({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,value:c})}var kJe=new L,zJe=new L,M_e=new h,UJe=new de,VJe=[new de,new de,new de,new de,new de,new de,new de,new de];function jJe(e,t,n,i,r,o){let a=ie.center(e,UJe);a.height=n;let s=de.toCartesian(a,t,M_e),c=mt.eastNorthUpToFixedFrame(s,t,kJe),u=L.inverse(c,zJe),f=e.west,d=e.east,p=e.north,g=e.south,m=VJe;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 O=de.toCartesian(m[R],t,M_e);L.multiplyByPoint(u,O,O),O.z=0,b=Math.min(b,O.x),x=Math.max(x,O.x),T=Math.min(T,O.y),C=Math.max(C,O.y)}let E=i;E.x=b,E.y=T,E.z=0,L.multiplyByPoint(c,E,E);let w=r;w.x=x,w.y=T,w.z=0,L.multiplyByPoint(c,w,w),h.subtract(w,E,r);let P=o;P.x=b,P.y=C,P.z=0,L.multiplyByPoint(c,P,P),h.subtract(P,E,o)}var HJe=new h,GJe=new h,WJe=new vn;kd.getPlanarTextureCoordinateAttributes=function(e,t,n,i,r){let o=z_e,a=HJe,s=GJe;jJe(e,n,r??0,o,a,s);let c={};B_e(c,t);let u=vn.fromCartesian(o,WJe);return c.southWest_HIGH=new Kc({componentDatatype:Y.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(u.high,[0,0,0])}),c.southWest_LOW=new Kc({componentDatatype:Y.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(u.low,[0,0,0])}),c.eastward=new Kc({componentDatatype:Y.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(a,[0,0,0])}),c.northward=new Kc({componentDatatype:Y.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(s,[0,0,0])}),U_e(e,i,c),c};var qJe=new h;function L_e(e,t,n,i){let r=k_e;r.latitude=e,r.longitude=t,r.height=0;let o=de.toCartesian(r,n,qJe),a=Math.sqrt(o.x*o.x+o.y*o.y),s=D.fastApproximateAtan2(a,o.z),c=D.fastApproximateAtan2(o.x,o.y);return i.x=s,i.y=c,i}var N_e=new z;kd.getSphericalExtentGeometryInstanceAttributes=function(e,t,n,i){let r=L_e(e.south,e.west,n,N_e),o=r.x,a=r.y,s=L_e(e.north,e.east,n,N_e),c=s.x,u=s.y,f=0;a>u&&(f=D.PI-a,a=-D.PI,u+=f),o-=D.EPSILON5,a-=D.EPSILON5,c+=D.EPSILON5,u+=D.EPSILON5;let d=1/(u-a),p=1/(c-o),g={sphericalExtents:new Kc({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,value:[o,a,p,d]}),longitudeRotation:new Kc({componentDatatype:Y.FLOAT,componentsPerAttribute:1,normalize:!1,value:[f]})};return B_e(g,t),U_e(e,i,g),g};kd.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)};kd.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 YJe(e){return Math.max(e.width,e.height)>kd.MAX_WIDTH_FOR_PLANAR_EXTENTS}kd.shouldUseSphericalCoordinates=function(e){return YJe(e)};kd.MAX_WIDTH_FOR_PLANAR_EXTENTS=D.toRadians(1);var Cf=kd;function Gx(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(Gx.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}}});Gx.isSupported=function(e){return e.context.stencilBuffer};function tS(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:lc.LESS_OR_EQUAL},depthMask:!1}}function EJ(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:Qt.PRE_MULTIPLIED_ALPHA_BLEND}}var XJe={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 KJe(e,t,n,i){if(l(e._rsStencilDepthPass))return;let r=!e.debugShowShadowVolume;e._rsStencilDepthPass=je.fromCache(tS(r,!1)),e._rsStencilDepthPass3DTiles=je.fromCache(tS(r,!0)),e._rsColorPass=je.fromCache(EJ(r,!1)),e._rsPickPass=je.fromCache(XJe)}function $Je(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 JJe(e,t){let n=t.context,i=e._primitive,r=ML;r=e._primitive._batchTable.getVertexShaderCallback()(r),r=Nn._appendDistanceDisplayConditionToShader(i,r),r=Nn._modifyShaderPosition(e,r,t.scene3DOnly),r=Nn._updateColorAttribute(i,r);let o=e._hasPlanarExtentsAttributes,a=o||e._hasSphericalExtentsAttribute;e._extruded&&(r=$Je(i,r));let s=e._extruded?"EXTRUDED_GEOMETRY":"",c=new Ge({defines:[s],sources:[r]}),u=new Ge({sources:[tA]}),f=e._primitive._attributeLocations,d=new Cf(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=Nn._appendShowToShader(i,m),m=Nn._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=Nn._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 ZJe(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 QJe(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 eZe(e,t,n,i,r,o,a){ZJe(e,o),QJe(e,a)}function V_e(e,t){return Math.floor(e%t/2)}function vJ(e,t,n,i,r,o){e.modelMatrix=n,e.boundingVolume=r,e.cull=i,e.debugShowBoundingVolume=o,t.commandList.push(e)}function j_e(e,t,n,i,r){e.modelMatrix=n,e.boundingVolume=r,e.cull=i,t.commandList.push(e)}function tZe(e,t,n,i,r,o,a,s){let c=e._primitive;Nn._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[V_e(m,b)],d&&(A=n[m],vJ(A,t,r,o,y,a)),p&&(A=n[m].derivedCommands.tileset,vJ(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],vJ(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[V_e(m,b)];y=u[T.index],d&&(A=i[m],j_e(A,t,r,o,y)),p&&(A=i[m].derivedCommands.tileset,j_e(A,t,r,o,y))}}}Gx.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=Cf.hasAttributesForSphericalExtents(c),g=Cf.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 gn({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 Nt({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){KJe(n,A)},i._createShaderProgramFunction=function(y,A,b){JJe(n,A)},i._createCommandsFunction=function(y,A,b,x,T,C,E){eZe(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){tZe(n,A,b,x,T,C,E,w)},this._primitive=new Nn(i)}this.debugShowShadowVolume&&!this._debugShowShadowVolume&&this._ready?(this._debugShowShadowVolume=!0,this._rsStencilDepthPass=je.fromCache(tS(!1,!1)),this._rsStencilDepthPass3DTiles=je.fromCache(tS(!1,!0)),this._rsColorPass=je.fromCache(EJ(!1))):!this.debugShowShadowVolume&&this._debugShowShadowVolume&&(this._debugShowShadowVolume=!1,this._rsStencilDepthPass=je.fromCache(tS(!0,!1)),this._rsStencilDepthPass3DTiles=je.fromCache(tS(!0,!0)),this._rsColorPass=je.fromCache(EJ(!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))})};Gx.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};Gx.prototype.isDestroyed=function(){return!1};Gx.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 nS=Gx;var nZe={u_globeMinimumAltitude:function(){return 55e3}};function Lu(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 gn({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=wi._defaultMaxTerrainHeight,this._minTerrainHeight=wi._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:nZe}}Object.defineProperties(Lu.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}}});Lu.isSupported=nS.isSupported;function H_e(e){return function(t,n){let i=n.maximumRadius,r=i/Math.cos(t*.5)-i;return e._maxHeight+r}}function G_e(e){return function(t,n){return e._minHeight}}var iZe=new h,rZe=new h,oZe=new h,aZe=new de,sZe=new ie;function $6(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,iZe),g=h.unpack(r,d,rZe),m=h.add(p,g,oZe),y=n.cartesianToCartographic(m,aZe),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=sZe;return f.north=c,f.south=a,f.east=u,f.west=s,f}function cZe(e,t,n){let i=wi.getMinimumMaximumHeights(t,n);e._minTerrainHeight=i.minimumTerrainHeight,e._maxTerrainHeight=i.maximumTerrainHeight}function lZe(e,t,n){let i=t.mapProjection.ellipsoid,r=$6(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 SJ(e,t){return Math.floor(e%t/2)}function wJ(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 W_e(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 uZe(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[SJ(m,b)],f&&(A=n[m],wJ(e,A,t,r,o,y,a)),d&&(A=n[m].derivedCommands.tileset,wJ(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],wJ(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[SJ(m,b)],!e._useFragmentCulling){let T=x[SJ(m,b)];y=c[T.index]}f&&(A=i[m],W_e(e,A,t,r,o,y)),d&&(A=i[m].derivedCommands.tileset,W_e(e,A,t,r,o,y))}}}Lu.initializeTerrainHeights=function(){return wi.initialize()};Lu.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!wi.initialized){Lu.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=$6(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=wi.getBoundingSphere(y,i);this._boundingSpheresKeys.push(A),this._boundingSpheres.push(b)}a=o.constructor,!l(a)||l(a.createShadowVolume)}cZe(this,d,i);let p=e.verticalExaggeration,g=e.verticalExaggerationRelativeHeight;this._minHeight=fr.getHeight(this._minTerrainHeight,p,g),this._maxHeight=fr.getHeight(this._maxTerrainHeight,p,g);let m=Lu._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=$6(e,o),Cf.shouldUseSphericalCoordinates(d)){A=!1;break}for(f=0;f<c;++f){r=s[f],o=r.geometry,a=o.constructor;let b=$6(e,o),x=o.textureCoordinateRotationPoints;A?y=Cf.getPlanarTextureCoordinateAttributes(b,x,i,e.mapProjection,this._maxHeight):y=Cf.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 Nt({geometry:a.createShadowVolume(o,G_e(this),H_e(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 Nt({geometry:a.createShadowVolume(o,G_e(this),H_e(this)),attributes:r.attributes,id:r.id});n.geometryInstances=u,n.appearance=this.appearance,n._createBoundingVolumeFunction=function(y,A){lZe(t,y,A)},n._updateAndQueueCommandsFunction=function(y,A,b,x,T,C,E,w){uZe(t,A,b,x,T,C,E,w)},this._primitive=new nS(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))})};Lu.prototype.getBoundingSphere=function(e){let t=this._boundingSpheresKeys.indexOf(e);if(t!==-1)return this._boundingSpheres[t]};Lu.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};Lu.prototype.isDestroyed=function(){return!1};Lu.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};Lu._supportsMaterials=function(e){return e.depthTexture};Lu.supportsMaterials=function(e){return Lu._supportsMaterials(e.frameState.context)};var Yl=Lu;function uc(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(uc.prototype,{length:{get:function(){return this._primitives.length}},primitiveAdded:{get:function(){return this._primitiveAdded}},primitiveRemoved:{get:function(){return this._primitiveRemoved}}});uc.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};uc.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};uc.prototype.removeAndDestroy=function(e){let t=this.remove(e);return t&&!this.destroyPrimitives&&e.destroy(),t};uc.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=[]};uc.prototype.contains=function(e){return!!(l(e)&&e._external&&e._external._composites&&e._external._composites[this._guid])};function J6(e,t){return e._primitives.indexOf(t)}uc.prototype.raise=function(e){if(l(e)){let t=J6(this,e),n=this._primitives;if(t!==n.length-1){let i=n[t];n[t]=n[t+1],n[t+1]=i}}};uc.prototype.raiseToTop=function(e){if(l(e)){let t=J6(this,e),n=this._primitives;t!==n.length-1&&(n.splice(t,1),n.push(e))}};uc.prototype.lower=function(e){if(l(e)){let t=J6(this,e),n=this._primitives;if(t!==0){let i=n[t];n[t]=n[t-1],n[t-1]=i}}};uc.prototype.lowerToBottom=function(e){if(l(e)){let t=J6(this,e),n=this._primitives;t!==0&&(n.splice(t,1),n.unshift(e))}};uc.prototype.get=function(e){return this._primitives[e]};uc.prototype.update=function(e){if(!this.show)return;let t=this._primitives;for(let n=0;n<t.length;++n)t[n].update(e)};uc.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)}};uc.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)}};uc.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)}};uc.prototype.isDestroyed=function(){return!1};uc.prototype.destroy=function(){return this.removeAll(),ue(this)};var Xl=uc;function Vp(){this._length=0,this._collections={},this._collectionsArray=[],this.show=!0}Object.defineProperties(Vp.prototype,{length:{get:function(){return this._length}}});Vp.prototype.add=function(e,t){t=t??0;let n=this._collections[t];if(!l(n)){n=new Xl({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};Vp.prototype.set=function(e,t){return t===e._zIndex||(this.remove(e,!0),this.add(e,t)),e};Vp.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};Vp.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};Vp.prototype.contains=function(e){if(!l(e))return!1;let t=this._collections[e._zIndex];return l(t)&&t.contains(e)};Vp.prototype.update=function(e){if(!this.show)return;let t=this._collectionsArray;for(let n=0;n<t.length;n++)t[n].update(e)};Vp.prototype.isDestroyed=function(){return!1};Vp.prototype.destroy=function(){return this.removeAll(),ue(this)};var BL=Vp;var nA={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(nA);var it=nA;function Nu(e){return e===nA.CLAMP_TO_GROUND||e===nA.CLAMP_TO_3D_TILE||e===nA.CLAMP_TO_TERRAIN}function iS(e){return e===nA.RELATIVE_TO_GROUND||e===nA.RELATIVE_TO_3D_TILE||e===nA.RELATIVE_TO_TERRAIN}var q_e={CENTER:0,LEFT:1,RIGHT:-1};Object.freeze(q_e);var Vi=q_e;var Y_e={CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1};Object.freeze(Y_e);var Gn=Y_e;function Zh(){pe.throwInstantiationError()}Object.defineProperties(Zh.prototype,{isConstant:{get:pe.throwInstantiationError},definitionChanged:{get:pe.throwInstantiationError}});Zh.prototype.getValue=pe.throwInstantiationError;Zh.prototype.equals=pe.throwInstantiationError;Zh.equals=function(e,t){return e===t||l(e)&&e.equals(t)};Zh.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(!Zh.equals(e[i],t[i]))return!1;return!0};Zh.isConstant=function(e){return!l(e)||e.isConstant};Zh.getValueOrUndefined=function(e,t,n){return l(e)?e.getValue(t,n):void 0};Zh.getValueOrDefault=function(e,t,n,i){return l(e)?e.getValue(t,i)??n:n};Zh.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=Zh;var X_e={LEFT:-1,NONE:0,RIGHT:1};Object.freeze(X_e);var Fo=X_e;var fZe=U.WHITE,dZe=h.ZERO,hZe=it.NONE,mZe=z.ZERO,pZe=1,gZe=0,_Ze=h.ZERO,yZe=Vi.CENTER,AZe=Gn.CENTER,bZe=!1,xZe=Fo.NONE,TZe=new h,CZe=new U,vZe=new h,EZe=new z,SZe=new Wt,wZe=new Wt,IZe=new Wt,PZe=new Je,DZe=new jt;function K_e(e){this.entity=e,this.billboard=void 0,this.textureValue=void 0}function iA(e,t){t.collectionChanged.addEventListener(iA.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new kt,this._onCollectionChanged(t,t.values,[],[])}iA.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,TZe),c=X.getValueOrUndefined(s._image,e),f=l(d)&&l(c)),!f){IJ(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,fZe,CZe),u.eyeOffset=X.getValueOrDefault(s._eyeOffset,e,dZe,vZe),u.heightReference=X.getValueOrDefault(s._heightReference,e,hZe),u.pixelOffset=X.getValueOrDefault(s._pixelOffset,e,mZe,EZe),u.scale=X.getValueOrDefault(s._scale,e,pZe),u.rotation=X.getValueOrDefault(s._rotation,e,gZe),u.alignedAxis=X.getValueOrDefault(s._alignedAxis,e,_Ze),u.horizontalOrigin=X.getValueOrDefault(s._horizontalOrigin,e,yZe),u.verticalOrigin=X.getValueOrDefault(s._verticalOrigin,e,AZe),u.width=X.getValueOrUndefined(s._width,e),u.height=X.getValueOrUndefined(s._height,e),u.scaleByDistance=X.getValueOrUndefined(s._scaleByDistance,e,SZe),u.translucencyByDistance=X.getValueOrUndefined(s._translucencyByDistance,e,wZe),u.pixelOffsetScaleByDistance=X.getValueOrUndefined(s._pixelOffsetScaleByDistance,e,IZe),u.sizeInMeters=X.getValueOrDefault(s._sizeInMeters,e,bZe),u.distanceDisplayCondition=X.getValueOrUndefined(s._distanceDisplayCondition,e,DZe),u.disableDepthTestDistance=X.getValueOrUndefined(s._disableDepthTestDistance,e),u.splitDirection=X.getValueOrDefault(s._splitDirection,e,xZe),o.textureValue!==c&&(u.image=c,o.textureValue=c);let p=X.getValueOrUndefined(s._imageSubRegion,e,PZe);l(p)&&u.setImageSubRegion(u.image,p)}return!0};iA.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};iA.prototype.isDestroyed=function(){return!1};iA.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(iA.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeBillboard(e[t]);return ue(this)};iA.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 K_e(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 K_e(o)):(IJ(a.get(o.id),o,s),a.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],IJ(a.get(o.id),o,s),a.remove(o.id)};function IJ(e,t,n){l(e)&&(e.billboard=void 0,n.removeBillboard(t))}var kL=iA;function Z6(){pe.throwInstantiationError()}Object.defineProperties(Z6.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}});Z6.prototype.update=function(e){pe.throwInstantiationError()};Z6.setLoading=function(e,t){e._isLoading!==t&&(t?e._entityCollection.suspendEvents():e._entityCollection.resumeEvents(),e._isLoading=t,e._loading.raiseEvent(e,t))};var ya=Z6;var RZe=Object.freeze({NONE:0,LOADING:2,LOADED:3,ERROR:4,FAILED:5}),La=RZe;function Qh(e){this._billboardCollection=e,this._id=void 0,this._loadState=La.NONE,this._loadError=void 0,this._index=-1,this._width=void 0,this._height=void 0,this._hasSubregion=!1,this.dirty=!1}Object.defineProperties(Qh.prototype,{loadError:{get:function(){return this._loadError}},loadState:{get:function(){return this._loadState}},ready:{get:function(){return this._loadState===La.LOADED}},hasImage:{get:function(){return this._loadState!==La.NONE}},id:{get:function(){return this._id}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});Qh.prototype.unload=async function(){this._loadState!==La.NONE&&(this._id=void 0,this._loadError=void 0,this._loadState=La.NONE,this._index=-1,this._width=void 0,this._height=void 0,this.dirty=!0)};Qh.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===La.LOADING||t.loadState===La.LOADED){Qh.clone(a,this);return}l(a)||(a=new Qh(r),o.set(e,a)),a._id=this._id=e,a._loadState=this._loadState=La.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=La.ERROR,a._loadError=f,this._id!==e)return;this._loadState=La.ERROR,this._loadError=f;return}if(!l(s)||s===-1){if(a._loadState=La.FAILED,a._index=-1,this._id!==e)return;this._loadState=La.FAILED,this._index=-1;return}a._index=s,a._loadState=La.LOADED;let u=c.rectangles[s];a._width=u.width,a._height=u.height,this._id===e&&(this._index=s,this._loadState=La.LOADED,this._width=u.width,this._height=u.height,this.dirty=!0)};Qh.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)};Qh.prototype.loadImageSubRegion=async function(e,t,n){let i;try{this._loadState=La.LOADING,i=await n}catch(r){this._loadState=La.ERROR,this._loadError=r;return}this._id===e&&(this._loadState=La.LOADED,this.setImageSubRegion(i,t))};Qh.prototype.setImageSubRegion=function(e,t){if(this._index!==e){if(!l(e)||e===-1){this._loadState=La.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}};Qh.prototype.computeTextureCoordinates=function(e){return this._billboardCollection.textureAtlas.computeTextureCoordinates(this._index,e)};Qh.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 Pg=Qh;var Lc={},OZe=new ae(0,0,0,1),al=new ae,MZe=new Je,PJ=new z,DJ=new z;Lc.worldToWindowCoordinates=function(e,t,n){return Lc.worldWithEyeOffsetToWindowCoordinates(e,t,h.ZERO,n)};var $_e=new ae,J_e=new h;function zL(e,t,n,i){let r=n.viewMatrix,o=L.multiplyByVector(r,ae.fromElements(e.x,e.y,e.z,1,$_e),$_e),a=h.multiplyComponents(t,h.normalize(o,J_e),J_e);return o.x+=t.x+a.x,o.y+=t.y+a.y,o.z+=a.z,L.multiplyByVector(n.frustum.projectionMatrix,o,i)}var LZe=new de(Math.PI,D.PI_OVER_TWO),NZe=new h,FZe=new h;Lc.worldWithEyeOffsetToWindowCoordinates=function(e,t,n,i){let r=e.frameState,o=Lc.computeActualEllipsoidPosition(r,t,OZe);if(!l(o))return;let a=e.canvas,s=MZe;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=LZe,p=f.project(d,NZe),g=h.clone(c.position,FZe),m=c.frustum.clone(),y=L.computeViewportTransformation(s,0,1,new L),A=c.frustum.projectionMatrix,b=c.positionWC.y,x=h.fromElements(D.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,al=zL(o,n,c,al),Lc.clipToGLWindowCoordinates(s,al,PJ),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,al=zL(o,n,c,al),Lc.clipToGLWindowCoordinates(s,al,DJ)}else{s.x+=T.x,s.width-=T.x,c.frustum.left=-p.x-b,al=zL(o,n,c,al),Lc.clipToGLWindowCoordinates(s,al,PJ),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,al=zL(o,n,c,al),Lc.clipToGLWindowCoordinates(s,al,DJ)}h.clone(g,c.position),c.frustum=m.clone(),i=z.clone(PJ,i),(i.x<0||i.x>a.clientWidth)&&(i.x=DJ.x)}}if(r.mode!==re.SCENE2D||u){if(al=zL(o,n,c,al),al.z<0&&!(c.frustum instanceof mn)&&!(c.frustum instanceof da))return;i=Lc.clipToGLWindowCoordinates(s,al,i)}return i.y=a.clientHeight-i.y,i};Lc.worldToDrawingBufferCoordinates=function(e,t,n){if(n=Lc.worldToWindowCoordinates(e,t,n),!!l(n))return Lc.transformWindowToDrawingBuffer(e,n,n)};var Dg=new h,BZe=new de;Lc.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,BZe);if(!l(o))return;if(r.project(o,Dg),i===re.COLUMBUS_VIEW)return h.fromElements(Dg.z,Dg.x,Dg.y,n);if(i===re.SCENE2D)return h.fromElements(0,Dg.x,Dg.y,n);let a=e.morphTime;return h.fromElements(D.lerp(Dg.z,t.x,a),D.lerp(Dg.x,t.y,a),D.lerp(Dg.y,t.z,a),n)};var Z_e=new h,Q_e=new h,eye=new L;Lc.clipToGLWindowCoordinates=function(e,t,n){return h.divideByScalar(t,t.w,Z_e),L.computeViewportTransformation(e,0,1,eye),L.multiplyByPoint(eye,Z_e,Q_e),z.fromCartesian3(Q_e,n)};Lc.transformWindowToDrawingBuffer=function(e,t,n){let i=e.canvas,r=e.drawingBufferWidth/i.clientWidth,o=e.drawingBufferHeight/i.clientHeight;return z.fromElements(t.x*r,t.y*o,n)};var kZe=new ae,tye=new ae;Lc.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,kZe);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=L.multiplyByVector(o.inverseViewProjection,f,tye);let g=1/d.w;h.multiplyByScalar(d,g,d)}else{let g=p.offCenterFrustum;l(g)&&(p=g),d=tye,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=L.multiplyByVector(o.inverseView,d,d)}return h.fromCartesian4(d,i)};var sr=Lc;function Pi(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=z.clone(e.pixelOffset??z.ZERO),this._translate=new z(0,0),this._eyeOffset=h.clone(e.eyeOffset??h.ZERO),this._heightReference=e.heightReference??it.NONE,this._verticalOrigin=e.verticalOrigin??Gn.CENTER,this._horizontalOrigin=e.horizontalOrigin??Vi.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 Pg(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??Fo.NONE,this._positionFromParent=!1}var nye=Pi.SHOW_INDEX=0,eH=Pi.POSITION_INDEX=1,cye=Pi.PIXEL_OFFSET_INDEX=2,zZe=Pi.EYE_OFFSET_INDEX=3,UZe=Pi.HORIZONTAL_ORIGIN_INDEX=4,VZe=Pi.VERTICAL_ORIGIN_INDEX=5,jZe=Pi.SCALE_INDEX=6,iye=Pi.IMAGE_INDEX_INDEX=7,rye=Pi.COLOR_INDEX=8,HZe=Pi.ROTATION_INDEX=9,GZe=Pi.ALIGNED_AXIS_INDEX=10,WZe=Pi.SCALE_BY_DISTANCE_INDEX=11,qZe=Pi.TRANSLUCENCY_BY_DISTANCE_INDEX=12,YZe=Pi.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,XZe=Pi.DISTANCE_DISPLAY_CONDITION=14,KZe=Pi.DISABLE_DEPTH_DISTANCE=15;Pi.TEXTURE_COORDINATE_BOUNDS=16;var oye=Pi.SDF_INDEX=17,$Ze=Pi.SPLIT_DIRECTION_INDEX=18;Pi.NUMBER_OF_PROPERTIES=19;function wo(e,t){let n=e._billboardCollection;l(n)&&(n._updateBillboard(e,t),e._dirty=!0)}Object.defineProperties(Pi.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,wo(this,nye))}},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(),wo(this,eH))}},heightReference:{get:function(){return this._heightReference},set:function(e){let t=this._heightReference;e!==t&&(this._heightReference=e,this._updateClamping(),wo(this,eH))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;z.equals(t,e)||(z.clone(e,t),wo(this,cye))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;Wt.equals(t,e)||(this._scaleByDistance=Wt.clone(e,t),wo(this,WZe))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;Wt.equals(t,e)||(this._translucencyByDistance=Wt.clone(e,t),wo(this,qZe))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){let t=this._pixelOffsetScaleByDistance;Wt.equals(t,e)||(this._pixelOffsetScaleByDistance=Wt.clone(e,t),wo(this,YZe))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;h.equals(t,e)||(h.clone(e,t),wo(this,zZe))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,wo(this,UZe))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin!==e&&(this._verticalOrigin=e,wo(this,VZe))}},scale:{get:function(){return this._scale},set:function(e){this._scale!==e&&(this._scale=e,wo(this,jZe))}},color:{get:function(){return this._color},set:function(e){let t=this._color;U.equals(t,e)||(U.clone(e,t),wo(this,rye))}},rotation:{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,wo(this,HZe))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){let t=this._alignedAxis;h.equals(t,e)||(h.clone(e,t),wo(this,GZe))}},width:{get:function(){return this._width??this._imageTexture.width},set:function(e){this._width!==e&&(this._width=e,wo(this,iye))}},height:{get:function(){return this._height??this._imageTexture.height},set:function(e){this._height!==e&&(this._height=e,wo(this,iye))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters!==e&&(this._sizeInMeters=e,wo(this,rye))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){jt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=jt.clone(e,this._distanceDisplayCondition),wo(this,XZe))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,wo(this,KZe))}},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),wo(this,eH)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,wo(this,nye))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;U.equals(t,e)||(U.clone(e,t),wo(this,oye))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,wo(this,oye))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,wo(this,$Ze))}}});Pi.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId};Pi.prototype._updateClamping=function(){Pi._updateClamping(this._billboardCollection,this)};var tH=new de;Pi._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);iS(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,tH);let c=n.getHeight(a,t._heightReference);l(c)&&(tH.height=c),s(tH)};Pi.prototype.computeTextureCoordinates=function(e){return this._imageTexture.computeTextureCoordinates(e)};Pi.prototype.setImage=function(e,t){this._computeImageTextureProperties(e,t),this._imageTexture.loadImage(this._imageId,t,this._imageWidth,this._imageHeight)};Pi.prototype.setImageTexture=function(e){Pg.clone(e,this._imageTexture)};var aye=512;Pi.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&&JZe(n)&&(this._imageWidth=Math.min(this._width,aye),this._imageHeight=Math.min(this._height,aye))};function JZe(e){return l(e)?Eh(e)?e.startsWith("data:image/svg+xml"):L0(e)==="svg":!1}Pi.prototype.setImageSubRegion=function(e,t){this._imageTexture.addImageSubRegion(e,t)};Pi.prototype._setTranslate=function(e){let t=this._translate;z.equals(t,e)||(z.clone(e,t),wo(this,cye))};Pi.prototype._getActualPosition=function(){return l(this._clampedPosition)?this._clampedPosition:this._actualPosition};Pi.prototype._setActualPosition=function(e){l(this._clampedPosition)||h.clone(e,this._actualPosition),wo(this,eH)};var sye=new ae;Pi._computeActualPosition=function(e,t,n,i){return l(e._clampedPosition)?(n.mode!==e._mode&&e._updateClamping(),e._clampedPosition):n.mode===re.SCENE3D?t:(L.multiplyByPoint(i,t,sye),sr.computeActualEllipsoidPosition(n,sye))};var lye=new h;Pi._computeScreenSpacePosition=function(e,t,n,i,r,o){let a=L.multiplyByPoint(e,t,lye),s=sr.worldWithEyeOffsetToWindowCoordinates(r,a,n,o);if(l(s))return z.add(s,i,s),s};var Q6=new z(0,0);Pi.prototype.computeScreenSpacePosition=function(e,t){let n=this._billboardCollection;l(t)||(t=new z),z.clone(this._pixelOffset,Q6),z.add(Q6,this._translate,Q6);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,tH);r=s.cartographicToCartesian(c,lye),i=L.IDENTITY}return Pi._computeScreenSpacePosition(i,r,this._eyeOffset,Q6,e,t)};Pi.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===Vi.RIGHT?a-=i:e.horizontalOrigin===Vi.CENTER&&(a-=i*.5);let s=t.y;return e.verticalOrigin===Gn.BOTTOM||e.verticalOrigin===Gn.BASELINE?s-=r:e.verticalOrigin===Gn.CENTER&&(s-=r*.5),l(n)||(n=new Je),n.x=a,n.y=s,n.width=i,n.height=r,n};Pi.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)&&z.equals(this._pixelOffset,e._pixelOffset)&&z.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};Pi.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=Pi;var UL=`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 VL=`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 ZZe={FONT_SIZE:48,PADDING:10,RADIUS:8,CUTOFF:.25},Ls=Object.freeze(ZZe);var QZe=Dr.SHOW_INDEX,jL=Dr.POSITION_INDEX,fye=Dr.PIXEL_OFFSET_INDEX,dye=Dr.EYE_OFFSET_INDEX,eQe=Dr.HORIZONTAL_ORIGIN_INDEX,tQe=Dr.VERTICAL_ORIGIN_INDEX,nQe=Dr.SCALE_INDEX,Wx=Dr.IMAGE_INDEX_INDEX,hye=Dr.COLOR_INDEX,iQe=Dr.ROTATION_INDEX,rQe=Dr.ALIGNED_AXIS_INDEX,mye=Dr.SCALE_BY_DISTANCE_INDEX,pye=Dr.TRANSLUCENCY_BY_DISTANCE_INDEX,gye=Dr.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,_ye=Dr.DISTANCE_DISPLAY_CONDITION,oQe=Dr.DISABLE_DEPTH_DISTANCE,aQe=Dr.TEXTURE_COORDINATE_BOUNDS,yye=Dr.SDF_INDEX,Aye=Dr.SPLIT_DIRECTION_INDEX,FJ=Dr.NUMBER_OF_PROPERTIES,Nr={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 Ud(e){e=e??H.EMPTY_OBJECT,this._scene=e.scene,this._batchTable=e.batchTable;let t=e.textureAtlas;l(t)||(t=new Bx),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(FJ),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=L.clone(e.modelMatrix??L.IDENTITY),this._modelMatrix=L.clone(L.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowTextureAtlas=e.debugShowTextureAtlas??!1,this.blendOption=e.blendOption??Li.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(Ud.prototype,{length:{get:function(){return BJ(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 bye(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Ud.prototype.add=function(e){let t=new Dr(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,t};Ud.prototype.remove=function(e){return this.contains(e)?(this._billboards[e._index]=void 0,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};Ud.prototype.removeAll=function(){bye(this._billboards),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0};function BJ(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}}Ud.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]};Ud.prototype.contains=function(e){return l(e)&&e._billboardCollection===this};Ud.prototype.get=function(e){return BJ(this),this._billboards[e]};function uye(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 sQe(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}Ud.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<FJ;++i){let r=n[i]===0?Oe.STATIC_DRAW:Oe.STREAM_DRAW;t=t||e[i]!==r,e[i]=r}return t};function cQe(e,t,n,i,r){let o=[{index:Nr.positionHighAndScale,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[jL]},{index:Nr.positionLowAndRotation,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[jL]},{index:Nr.compressedAttribute0,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[fye]},{index:Nr.compressedAttribute1,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[pye]},{index:Nr.compressedAttribute2,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[hye]},{index:Nr.eyeOffset,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[dye]},{index:Nr.scaleByDistance,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[mye]},{index:Nr.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[gye]},{index:Nr.compressedAttribute3,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[_ye]},{index:Nr.textureCoordinateBoundsOrLabelTranslate,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[aQe]},{index:Nr.splitDirection,componentsPerAttribute:1,componentDatatype:Y.FLOAT,usage:n[Aye]},{index:Nr.direction,componentsPerAttribute:2,componentDatatype:Y.FLOAT,vertexBuffer:sQe(e)}];return l(i)&&o.push({index:Nr.a_batchId,componentsPerAttribute:1,componentDatatype:Y.FLOAT,bufferUsage:Oe.STATIC_DRAW}),r&&o.push({index:Nr.sdf,componentsPerAttribute:2,componentDatatype:Y.FLOAT,usage:n[yye]}),new vg(e,o,t,!0)}var RJ=new vn;function xye(e,t,n,i){let r=n[Nr.positionHighAndScale],o=n[Nr.positionLowAndRotation],a=i._getActualPosition();e._mode===re.SCENE3D&&(se.expand(e._baseVolume,a,e._baseVolume),e._boundingVolumeDirty=!0),vn.fromCartesian(a,RJ);let s=i.scale,c=i.rotation;c!==0&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,s);let u=RJ.high,f=RJ.low;r(i._index,u.x,u.y,u.z,s),o(i._index,f.x,f.y,f.z,c)}var rA=new z,zd=32768,kJ=65536,OJ=4096,qx=256,lQe=128,uQe=32,fQe=8,nH=4,dQe=1/256,Tye=new Je;function Cye(e,t,n,i){let r=n[Nr.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===Gn.BASELINE&&(p=Gn.BOTTOM),e._allHorizontalCenter=e._allHorizontalCenter&&d===Vi.CENTER,e._allVerticalCenter=e._allVerticalCenter&&p===Gn.CENTER;let m=0,y=0;if(i.ready){let P=i.computeTextureCoordinates(Tye);m=P.x,y=P.y}let A=Math.floor(D.clamp(a,-zd,zd)+zd)*lQe;A+=(d+1)*uQe,A+=(p+1)*fQe,A+=(g?1:0)*nH;let b=Math.floor(D.clamp(s,-zd,zd)+zd)*qx,x=Math.floor(D.clamp(u*nH,-zd,zd)+zd)*qx,T=(D.clamp(f*nH,-zd,zd)+zd)*dQe,C=Math.floor(T),E=Math.floor((T-C)*qx);b+=C,x+=E,rA.x=m,rA.y=y;let w=an.compressTextureCoordinates(rA);r(i._index,A,b,x,w)}function vye(e,t,n,i){let r=n[Nr.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=D.clamp(d,0,kJ),g=0;Math.abs(h.magnitudeSquared(o)-1)<D.EPSILON6&&(g=an.octEncodeFloat(o)),s=D.clamp(s,0,1),s=s===1?255:s*255|0,p=p*qx+s,u=D.clamp(u,0,1),u=u===1?255:u*255|0,g=g*qx+u,r(i._index,p,g,a,c)}function LJ(e,t,n,i){let r=n[Nr.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)<D.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)*kJ+U.floatToByte(a.alpha)*qx+(s*2+f),A=d*nH+p;r(i._index,g,m,y,A)}function NJ(e,t,n,i){let r=n[Nr.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)),rA.x=0,rA.y=0,i.ready){let c=i.computeTextureCoordinates(Tye);rA.x=c.width,rA.y=c.height}let s=an.compressTextureCoordinates(rA);r(i._index,o.x,o.y,a,s)}function Eye(e,t,n,i){let r=n[Nr.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 Sye(e,t,n,i){let r=n[Nr.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 wye(e,t,n,i){let r=n[Nr.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=Nu(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(D.clamp(d,0,OJ)),g=Math.floor(D.clamp(f,0,OJ)),m=p*OJ+g;r(i._index,o,a,c,m)}function Iye(e,t,n,i){if(Nu(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[Nr.textureCoordinateBoundsOrLabelTranslate],o=0,a=0;l(i._labelTranslate)&&(o=i._labelTranslate.x,a=i._labelTranslate.y),r(i._index,o,a,0,0)}function hQe(e,t,n,i){if(!l(e._batchTable))return;let r=n[Nr.a_batchId],o=i._batchIndex;r(i._index,o)}function Pye(e,t,n,i){if(!e._sdf)return;let r=n[Nr.sdf],o=i.outlineColor,a=i.outlineWidth,s=an.encodeRGB8(o),c=a/Ls.RADIUS,u=U.floatToByte(o.alpha)*kJ+U.floatToByte(c)*qx;r(i._index,s,u)}function Dye(e,t,n,i){let r=n[Nr.splitDirection],o=0,a=i.splitDirection;l(a)&&(o=a),r(i._index,o)}function mQe(e,t,n,i){xye(e,t,n,i),Cye(e,t,n,i),vye(e,t,n,i),LJ(e,t,n,i),NJ(e,t,n,i),Eye(e,t,n,i),Sye(e,t,n,i),wye(e,t,n,i),Iye(e,t,n,i),hQe(e,t,n,i),Pye(e,t,n,i),Dye(e,t,n,i)}function MJ(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 pQe(e,t){let n=t.mode,i=e._billboards,r=e._billboardsToUpdate,o=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==re.SCENE3D&&!L.equals(o,e.modelMatrix)?(e._mode=n,L.clone(e.modelMatrix,o),e._createVertexArray=!0,(n===re.SCENE3D||n===re.SCENE2D||n===re.COLUMBUS_VIEW)&&MJ(e,i,i.length,t,o,!0)):n===re.MORPHING?MJ(e,i,i.length,t,o,!0):(n===re.SCENE2D||n===re.COLUMBUS_VIEW)&&MJ(e,r,e._billboardsToUpdateIndex,t,o,!1)}function gQe(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 _Qe(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 yQe=[];Ud.prototype.update=function(e){if(BJ(this),!this.show)return;let t=e.context;if(!t.instancedArrays||!(Lt.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 P=0;P<i;++P){let R=n[P];l(R.loadError)&&(console.error(`Error loading image for billboard: ${R.loadError}`),R.image=void 0),R.textureDirty&&this._updateBillboard(R,Wx),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;pQe(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 P=0;P<FJ;++P)c[P]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),i>0){this._vaf=cQe(t,i,this._buffersUsage,this._batchTable,this._sdf),d=this._vaf.writers;for(let P=0;P<i;++P){let R=this._billboards[P];R._dirty=!1,R.textureDirty=!1,mQe(this,e,d,R)}this._vaf.commit(uye(t))}this._billboardsToUpdateIndex=0}else if(s>0){let P=yQe;P.length=0,(c[jL]||c[iQe]||c[nQe])&&P.push(xye),(c[Wx]||c[fye]||c[eQe]||c[tQe]||c[QZe])&&(P.push(Cye),P.push(NJ)),(c[Wx]||c[rQe]||c[pye])&&(P.push(vye),P.push(LJ)),(c[Wx]||c[hye])&&P.push(LJ),(c[Wx]||c[dye])&&P.push(NJ),c[mye]&&P.push(Eye),c[gye]&&P.push(Sye),(c[_ye]||c[oQe]||c[Wx]||c[jL])&&P.push(wye),(c[Wx]||c[jL])&&P.push(Iye),c[yye]&&P.push(Pye),c[Aye]&&P.push(Dye);let R=P.length;if(d=this._vaf.writers,s/i>.1){for(let O=0;O<s;++O){let N=a[O];N._dirty=!1,N.textureDirty=!1;for(let _=0;_<R;++_)P[_](this,e,d,N)}this._vaf.commit(uye(t))}else{for(let O=0;O<s;++O){let N=a[O];N._dirty=!1,N.textureDirty=!1;for(let _=0;_<R;++_)P[_](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=L.IDENTITY;e.mode===re.SCENE3D?(y=this.modelMatrix,m=se.clone(this._baseVolumeWC,this._boundingVolume)):m=se.clone(this._baseVolume2D,this._boundingVolume),gQe(this,e,m);let A=this._blendOption!==this.blendOption;if(this._blendOption=this.blendOption,A){this._blendOption===Li.OPAQUE||this._blendOption===Li.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=je.fromCache({depthTest:{enabled:!0,func:ee.LESS},depthMask:!0}):this._rsOpaque=void 0;let P=this._blendOption===Li.TRANSLUCENT;this._blendOption===Li.TRANSLUCENT||this._blendOption===Li.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=je.fromCache({depthTest:{enabled:!0,func:P?ee.LEQUAL:ee.LESS},depthMask:P,blending:Qt.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=VL,x=UL,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 P=1-Ls.CUTOFF;this._sdf&&T.defines.push("SDF");let R=l(this._batchTable)?"VECTOR_TILE":"";this._blendOption===Li.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 ${P}`)),this._sp=Zt.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:T,fragmentShaderSource:C,attributeLocations:Nr}),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 ${P}`)),this._spTranslucent=Zt.replaceCache({context:t,shaderProgram:this._spTranslucent,vertexShaderSource:T,fragmentShaderSource:C,attributeLocations:Nr})),this._blendOption===Li.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 ${P}`)),this._sp=Zt.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:T,fragmentShaderSource:C,attributeLocations:Nr})),this._blendOption===Li.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 ${P}`)),this._spTranslucent=Zt.replaceCache({context:t,shaderProgram:this._spTranslucent,vertexShaderSource:T,fragmentShaderSource:C,attributeLocations:Nr})),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 P=this._colorCommands,R=this._blendOption===Li.OPAQUE,O=this._blendOption===Li.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",P.length=_;let I=O?_*2:_;for(let M=0;M<I;++M){let F=P[M];l(F)||(F=P[M]=new nt);let V=R||O&&M%2===0;F.pass=V||!O?Pe.OPAQUE:Pe.TRANSLUCENT,F.owner=this;let k=O?Math.floor(M/2):M;F.boundingVolume=m,F.modelMatrix=y,F.count=N[k].indicesCount,F.shaderProgram=V?this._sp:this._spTranslucent,F.uniformMap=v,F.vertexArray=N[k].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=_Qe(this,e.context)),w.push(this.debugCommand))}this._allBillboardsReady=r};Ud.prototype.isDestroyed=function(){return!1};Ud.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(),bye(this._billboards),ue(this)};var vf=Ud;var Rye={FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2};Object.freeze(Rye);var ho=Rye;var Oye={},Mye=0,AQe=256,bQe=new U(.165,.165,.165,.8),xQe=new z(7,5),Ja=Object.freeze({LTR:0,RTL:1,WEAK:2,BRACKETS:3});function Yx(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function HL(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}function GL(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)}function Nye(e){let t=Oye[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(GL(n,"line-height"));isNaN(i)&&(i=void 0),t={family:GL(n,"font-family"),size:GL(n,"font-size").replace("px",""),style:GL(n,"font-style"),weight:GL(n,"font-weight"),lineHeight:i},document.body.removeChild(n),Mye<AQe&&(Oye[e._font]=t,Mye++)}e._fontFamily=t.family,e._fontSize=t.size,e._fontStyle=t.style,e._fontWeight=t.weight,e._lineHeight=t.lineHeight}function em(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??bQe),this._backgroundPadding=z.clone(e.backgroundPadding??xQe),this._style=e.style??ho.FILL,this._verticalOrigin=e.verticalOrigin??Gn.BASELINE,this._horizontalOrigin=e.horizontalOrigin??Vi.LEFT,this._pixelOffset=z.clone(e.pixelOffset??z.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,Nye(this),this._updateClamping()}Object.defineProperties(em.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),HL(this),this._updateClamping()}}},text:{get:function(){return this._text},set:function(e){if(this._text!==e){this._text=e;let t=em.filterUnsupportedCharacters(e);this._renderedText=em.enableRightToLeftDetection?wQe(t):t,Yx(this)}}},font:{get:function(){return this._font},set:function(e){this._font!==e&&(this._font=e,Yx(this),Nye(this))}},fillColor:{get:function(){return this._fillColor},set:function(e){let t=this._fillColor;U.equals(t,e)||(U.clone(e,t),Yx(this))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;U.equals(t,e)||(U.clone(e,t),Yx(this))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Yx(this))}},showBackground:{get:function(){return this._showBackground},set:function(e){this._showBackground!==e&&(this._showBackground=e,Yx(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;z.equals(t,e)||(z.clone(e,t),HL(this))}},style:{get:function(){return this._style},set:function(e){this._style!==e&&(this._style=e,Yx(this))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;if(!z.equals(t,e)){z.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,HL(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),HL(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),HL(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}}});em.prototype._updateClamping=function(){Dr._updateClamping(this._labelCollection,this)};em.prototype.computeScreenSpacePosition=function(e,t){l(t)||(t=new z);let i=this._labelCollection.modelMatrix,r=l(this._actualClampedPosition)?this._actualClampedPosition:this._position;return Dr._computeScreenSpacePosition(i,r,this._eyeOffset,this._pixelOffset,e,t)};em.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===Gn.BOTTOM||e.verticalOrigin===Gn.BASELINE?r-=a:e.verticalOrigin===Gn.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===Gn.BOTTOM||e.verticalOrigin===Gn.BASELINE?b-=T:e.verticalOrigin===Gn.CENTER&&(b-=T*.5),e._verticalOrigin===Gn.TOP?b+=Ls.PADDING*s:(e._verticalOrigin===Gn.BOTTOM||e._verticalOrigin===Gn.BASELINE)&&(b-=Ls.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};em.filterUnsupportedCharacters=function(e){let t=new RegExp(/[\u0000-\u0008\u000E-\u001F\u00ad\u202a-\u206f\u200b-\u200f]/,"g");return e.replace(t,"")};em.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)&&z.equals(this._backgroundPadding,e._backgroundPadding)&&z.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};em.prototype.isDestroyed=function(){return!1};em.enableRightToLeftDetection=!1;function TQe(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 CQe(e){return e.split("").reverse().join("")}function WL(e,t,n){return e.slice(0,t)+n+e.slice(t)}function vQe(e){switch(e){case"(":return")";case")":return"(";case"[":return"]";case"]":return"[";case"{":return"}";case"}":return"{";case"<":return">";case">":return"<"}}var EQe="\u05D0-\u05EA",SQe="\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF",Lye=new RegExp(`[${EQe}${SQe}]`);function wQe(e){let t=e.split(`
`),n="";for(let i=0;i<t.length;i++){let r=t[i],o=Lye.test(r.charAt(0)),a=TQe(r,Lye),s=0,c="";for(let u=0;u<a.length;++u){let f=a[u],d=f.Type===Ja.BRACKETS?vQe(f.Word):CQe(f.Word);o?f.Type===Ja.RTL?(c=d+c,s=0):f.Type===Ja.LTR?(c=WL(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=WL(c,s,f.Word),s+=f.Word.length):c=WL(c,0,d)):f.Type===Ja.RTL?c=WL(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=WL(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 oA=em;var Hye=Go(zye(),1);var Gye=Go(Uye(),1);function DQe(){this.dimensions=void 0,this.billboardTexture=void 0,this.billboard=void 0}var RQe=1.2,Vye="ID_WHITE_PIXEL",zJ=new z(4,4),OQe=new Je(1,1,1,1);function MQe(e,t){let n=t._backgroundBillboardTexture;if(!n.hasImage){let r=document.createElement("canvas");r.width=zJ.x,r.height=zJ.y;let o=r.getContext("2d");o.fillStyle="#fff",o.fillRect(0,0,r.width,r.height),n.loadImage(Vye,r),n.addImageSubRegion(Vye,OQe)}let i=e.add({collection:t});return i.setImageTexture(n),i._positionFromParent=!0,i._labelTranslate=new z,i}var Rg={};function LQe(e,t,n,i,r,o){return Rg.font=t,Rg.fillColor=n,Rg.strokeColor=i,Rg.strokeWidth=r,Rg.padding=Ls.PADDING,Rg.fill=o===ho.FILL||o===ho.FILL_AND_OUTLINE,Rg.stroke=o===ho.OUTLINE||o===ho.FILL_AND_OUTLINE,Rg.backgroundColor=U.BLACK,hx(e,Rg)}function UJ(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 NQe=new Gye.default,FQe=/\s/;function BQe(e,t){let n=t._renderedText,i=NQe.splitGraphemes(n),r=i.length,o=t._glyphs,a=o.length;if(t._relativeSize=t._fontSize/Ls.FONT_SIZE,r<a)for(let p=r;p<a;++p)UJ(e,o[p]);o.length=r;let s=t._backgroundBillboard,c=e._backgroundBillboardCollection;t._showBackground&&!l(s)&&(s=MQe(c,e),t._backgroundBillboard=s),kQe(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 Pg(u),f.set(y,b);let E=`${t._fontStyle} ${t._fontWeight} ${Ls.FONT_SIZE}px ${t._fontFamily}`,w=LQe(g,E,U.WHITE,U.WHITE,0,ho.FILL);if(A=w.dimensions,d[y]=A,w.width>0&&w.height>0&&!FQe.test(g)){let P=(0,Hye.default)(w,{cutoff:Ls.CUTOFF,radius:Ls.RADIUS}),R=w.getContext("2d"),O=w.width,N=w.height,_=R.getImageData(0,0,O,N);for(let v=0;v<O;v++)for(let S=0;S<N;S++){let I=S*O+v,M=P[I]*255,F=I*4;_.data[F+0]=M,_.data[F+1]=M,_.data[F+2]=M,_.data[F+3]=M}R.putImageData(_,0,0),b.loadImage(y,w)}}let x=o[p];if(l(x)||(x=new DQe,x.dimensions=A,x.billboardTexture=b,o[p]=x),x.billboardTexture.id!==y&&(x.billboardTexture=b,x.dimensions=A),!b.hasImage){UJ(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 z,T._labelTranslate=new z,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=Vi.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===ho.FILL_AND_OUTLINE?(T.color=t._fillColor,T.outlineWidth=t.outlineWidth):t.style===ho.FILL?(T.color=t._fillColor,T.outlineWidth=0):t.style===ho.OUTLINE&&(T.color=U.TRANSPARENT,T.outlineWidth=t.outlineWidth)}t._repositionAllGlyphs=!0}function kQe(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=Vi.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 jye(e,t,n){return t===Vi.CENTER?-e/2:t===Vi.RIGHT?-(e+n.x):n.x}var Bo=new z,zQe=new z;function UQe(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=z.clone(l(f)?e._backgroundPadding:z.ZERO,zQe);d.x/=e._relativeSize,d.y/=e._relativeSize;for(let O=0;O<u;++O){if(n.charAt(O)===`
`){o.push(i),++c,i=0;continue}let _=t[O].dimensions;l(_)&&(s=Math.max(s,_.height-_.descent),a=Math.max(a,_.descent),i+=_.width-_.minx,O<u-1&&(i+=t[O+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=jye(b,m,d),T=(l(e._lineHeight)?e._lineHeight:RQe*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),Bo.x=x*g,Bo.y=0;let P=!0,R=0;for(let O=0;O<u;++O){if(n.charAt(O)===`
`){++A,R+=T,b=o[A],x=jye(b,m,d),Bo.x=x*g,P=!0;continue}let N=t[O],_=N.dimensions;if(l(_)&&(y===Gn.TOP?(Bo.y=_.height-s-d.y,Bo.y+=Ls.PADDING):y===Gn.CENTER?Bo.y=(C+_.height-s)/2:y===Gn.BASELINE?(Bo.y=C,Bo.y-=Ls.PADDING):(Bo.y=C+a+d.y,Bo.y-=Ls.PADDING),Bo.y=(Bo.y-_.descent-R)*g,P&&(Bo.x-=Ls.PADDING*g,P=!1),l(N.billboard)&&(N.billboard._setTranslate(Bo),N.billboard._labelDimensions.x=E,N.billboard._labelDimensions.y=w,N.billboard._labelHorizontalOrigin=m,Nu(e.heightReference)&&(N.billboard._labelTranslate=z.clone(Bo,N.billboard._labelTranslate))),O<u-1)){let v=t[O+1];Bo.x+=(_.width-_.minx+v.dimensions.minx)*g}}l(f)&&n.split(`
`).join("").length>0&&(m===Vi.CENTER?x=-r/2-d.x:m===Vi.RIGHT?x=-(r+d.x*2):x=0,Bo.x=x*g,y===Gn.TOP?Bo.y=p-s-a:y===Gn.CENTER?Bo.y=(p-s)/2-a:y===Gn.BASELINE?Bo.y=-d.y-a:Bo.y=0,Bo.y=Bo.y*g,f.width=E,f.height=w,f._setTranslate(Bo),f._labelTranslate=z.clone(Bo,f._labelTranslate))}function Wye(e,t){let n=t._glyphs;for(let i=0,r=n.length;i<r;++i)UJ(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 jp(e){e=e??H.EMPTY_OBJECT,this._scene=e.scene,this._batchTable=e.batchTable;let t=new vf({scene:this._scene,textureAtlas:new Bx({initialSize:zJ}),coarseDepthTestDistance:e.coarseDepthTestDistance,threePointDepthTestDistance:e.threePointDepthTestDistance});this._backgroundBillboardCollection=t,this._backgroundBillboardTexture=new Pg(t),this._glyphBillboardCollection=new vf({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=L.clone(e.modelMatrix??L.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.blendOption=e.blendOption??Li.OPAQUE_AND_TRANSLUCENT}Object.defineProperties(jp.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}}});jp.prototype.add=function(e){let t=new oA(e,this);return this._labels.push(t),this._labelsToUpdate.push(t),t};jp.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),Wye(this,e),!0}return!1};jp.prototype.removeAll=function(){let e=this._labels;for(let t=0,n=e.length;t<n;++t)Wye(this,e[t]);e.length=0};jp.prototype.contains=function(e){return l(e)&&e._labelCollection===this};jp.prototype.get=function(e){return this._labels[e]};jp.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&&(BQe(this,a),a._rebindAllGlyphs=!1),a._repositionAllGlyphs&&(UQe(a),a._repositionAllGlyphs=!1);let c=a._glyphs.length-s;this._totalGlyphCount+=c}let r=n.length>0?Li.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)};jp.prototype.isDestroyed=function(){return!1};jp.prototype.destroy=function(){return this.removeAll(),this._glyphBillboardCollection=this._glyphBillboardCollection.destroy(),this._backgroundBillboardCollection=this._backgroundBillboardCollection.destroy(),ue(this)};var Hp=jp;function ta(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??Fo.NONE}var qye=ta.SHOW_INDEX=0,Kye=ta.POSITION_INDEX=1,VQe=ta.COLOR_INDEX=2,jQe=ta.OUTLINE_COLOR_INDEX=3,HQe=ta.OUTLINE_WIDTH_INDEX=4,GQe=ta.PIXEL_SIZE_INDEX=5,WQe=ta.SCALE_BY_DISTANCE_INDEX=6,qQe=ta.TRANSLUCENCY_BY_DISTANCE_INDEX=7,YQe=ta.DISTANCE_DISPLAY_CONDITION_INDEX=8,XQe=ta.DISABLE_DEPTH_DISTANCE_INDEX=9,KQe=ta.SPLIT_DIRECTION_INDEX=10;ta.NUMBER_OF_PROPERTIES=11;function Ef(e,t){let n=e._pointPrimitiveCollection;l(n)&&(n._updatePointPrimitive(e,t),e._dirty=!0)}Object.defineProperties(ta.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,Ef(this,qye))}},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),Ef(this,Kye))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;Wt.equals(t,e)||(this._scaleByDistance=Wt.clone(e,t),Ef(this,WQe))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;Wt.equals(t,e)||(this._translucencyByDistance=Wt.clone(e,t),Ef(this,qQe))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){this._pixelSize!==e&&(this._pixelSize=e,Ef(this,GQe))}},color:{get:function(){return this._color},set:function(e){let t=this._color;U.equals(t,e)||(U.clone(e,t),Ef(this,VQe))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;U.equals(t,e)||(U.clone(e,t),Ef(this,jQe))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Ef(this,HQe))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){jt.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=jt.clone(e,this._distanceDisplayCondition),Ef(this,YQe))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,Ef(this,XQe))}},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,Ef(this,qye))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,Ef(this,KQe))}}});ta.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId};ta.prototype._getActualPosition=function(){return this._actualPosition};ta.prototype._setActualPosition=function(e){h.clone(e,this._actualPosition),Ef(this,Kye)};var Yye=new ae;ta._computeActualPosition=function(e,t,n){return t.mode===re.SCENE3D?e:(L.multiplyByPoint(n,e,Yye),sr.computeActualEllipsoidPosition(t,Yye))};var Xye=new ae;ta._computeScreenSpacePosition=function(e,t,n,i){let r=L.multiplyByVector(e,ae.fromElements(t.x,t.y,t.z,1,Xye),Xye);return sr.worldToWindowCoordinates(n,r,i)};ta.prototype.computeScreenSpacePosition=function(e,t){let n=this._pointPrimitiveCollection;l(t)||(t=new z);let i=n.modelMatrix,r=ta._computeScreenSpacePosition(i,this._actualPosition,e,t);if(l(r))return r.y=e.canvas.clientHeight-r.y,r};ta.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};ta.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};ta.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0};var _s=ta;var aA=`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 YL=`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 $Qe=_s.SHOW_INDEX,HJ=_s.POSITION_INDEX,$ye=_s.COLOR_INDEX,JQe=_s.OUTLINE_COLOR_INDEX,ZQe=_s.OUTLINE_WIDTH_INDEX,QQe=_s.PIXEL_SIZE_INDEX,Jye=_s.SCALE_BY_DISTANCE_INDEX,Zye=_s.TRANSLUCENCY_BY_DISTANCE_INDEX,Qye=_s.DISTANCE_DISPLAY_CONDITION_INDEX,eet=_s.DISABLE_DEPTH_DISTANCE_INDEX,tet=_s.SPLIT_DIRECTION_INDEX,GJ=_s.NUMBER_OF_PROPERTIES,sl={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayConditionAndDisableDepthAndSplitDirection:5};function Vd(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(GJ),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=L.clone(e.modelMatrix??L.IDENTITY),this._modelMatrix=L.clone(L.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.blendOption=e.blendOption??Li.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(Vd.prototype,{length:{get:function(){return WJ(this),this._pointPrimitives.length}}});function eAe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Vd.prototype.add=function(e){let t=new _s(e,this);return t._index=this._pointPrimitives.length,this._pointPrimitives.push(t),this._createVertexArray=!0,t};Vd.prototype.remove=function(e){return this.contains(e)?(this._pointPrimitives[e._index]=null,this._pointPrimitivesRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};Vd.prototype.removeAll=function(){eAe(this._pointPrimitives),this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!0};function WJ(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}}Vd.prototype._updatePointPrimitive=function(e,t){e._dirty||(this._pointPrimitivesToUpdate[this._pointPrimitivesToUpdateIndex++]=e),++this._propertiesChanged[t]};Vd.prototype.contains=function(e){return l(e)&&e._pointPrimitiveCollection===this};Vd.prototype.get=function(e){return WJ(this),this._pointPrimitives[e]};Vd.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<GJ;++i){let r=n[i]===0?Oe.STATIC_DRAW:Oe.STREAM_DRAW;t=t||e[i]!==r,e[i]=r}return t};function net(e,t,n){return new vg(e,[{index:sl.positionHighAndSize,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[HJ]},{index:sl.positionLowAndShow,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[HJ]},{index:sl.compressedAttribute0,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[$ye]},{index:sl.compressedAttribute1,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[Zye]},{index:sl.scaleByDistance,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[Jye]},{index:sl.distanceDisplayConditionAndDisableDepthAndSplitDirection,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[Qye]}],t)}var VJ=new vn,rH=new U;function tAe(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),vn.fromCartesian(o,VJ);let a=i.pixelSize,s=i.outlineWidth;e._maxPixelSize=Math.max(e._maxPixelSize,a+s);let c=n[sl.positionHighAndSize],u=VJ.high;c(r,u.x,u.y,u.z,a);let f=n[sl.positionLowAndOutline],d=VJ.low;f(r,d.x,d.y,d.z,s)}var iet=256;function nAe(e,t,n,i){let r=i._index,o=i.color,a=i.outlineColor,s=i.getPickId(t).color;rH.red=o.alpha,rH.green=a.alpha,rH.blue=s.alpha;let c=n[sl.compressedAttribute0];c(r,an.encodeRGB8(o),an.encodeRGB8(a),an.encodeRGB8(s),an.encodeRGB8(rH))}function iAe(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=D.clamp(a,0,1),a=a===1?255:a*255|0;let d=(f?1:0)*iet+a;c=D.clamp(c,0,1),c=c===1?255:c*255|0;let p=c,g=n[sl.compressedAttribute1];g(r,d,p,o,s)}function rAe(e,t,n,i){let r=i._index,o=n[sl.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 oAe(e,t,n,i){let r=i._index,o=n[sl.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 ret(e,t,n,i){tAe(e,t,n,i),nAe(e,t,n,i),iAe(e,t,n,i),rAe(e,t,n,i),oAe(e,t,n,i)}function jJ(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=_s._computeActualPosition(f,i,r);l(d)&&(u._setActualPosition(d),o?s.push(d):se.expand(a,d,a))}o&&se.fromPoints(s,a)}function oet(e,t){let n=t.mode,i=e._pointPrimitives,r=e._pointPrimitivesToUpdate,o=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==re.SCENE3D&&!L.equals(o,e.modelMatrix)?(e._mode=n,L.clone(e.modelMatrix,o),e._createVertexArray=!0,(n===re.SCENE3D||n===re.SCENE2D||n===re.COLUMBUS_VIEW)&&jJ(e,i,i.length,t,o,!0)):n===re.MORPHING?jJ(e,i,i.length,t,o,!0):(n===re.SCENE2D||n===re.COLUMBUS_VIEW)&&jJ(e,r,e._pointPrimitivesToUpdateIndex,t,o,!1)}function aet(e,t,n){let r=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*e._maxPixelSize;n.radius+=r}var set=[];Vd.prototype.update=function(e){if(WJ(this),!this.show)return;this._maxTotalPointSize=Lt.maximumAliasedPointSize,oet(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<GJ;++E)o[E]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=net(c,n,this._buffersUsage),s=this._vaf.writers;for(let E=0;E<n;++E){let w=this._pointPrimitives[E];w._dirty=!1,ret(this,c,s,w)}this._vaf.commit()}this._pointPrimitivesToUpdateIndex=0}else if(r>0){let E=set;E.length=0,(o[HJ]||o[ZQe]||o[QQe])&&E.push(tAe),(o[$ye]||o[JQe])&&E.push(nAe),(o[$Qe]||o[Zye])&&E.push(iAe),o[Jye]&&E.push(rAe),(o[Qye]||o[eet]||o[tet])&&E.push(oAe);let w=E.length;if(s=this._vaf.writers,r/n>.1){for(let P=0;P<r;++P){let R=i[P];R._dirty=!1;for(let O=0;O<w;++O)E[O](this,c,s,R)}this._vaf.commit()}else{for(let P=0;P<r;++P){let R=i[P];R._dirty=!1;for(let O=0;O<w;++O)E[O](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=L.IDENTITY;e.mode===re.SCENE3D?(p=this.modelMatrix,d=se.clone(this._baseVolumeWC,this._boundingVolume)):d=se.clone(this._baseVolume2D,this._boundingVolume),aet(this,e,d);let g=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,g&&(this._blendOption===Li.OPAQUE||this._blendOption===Li.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=je.fromCache({depthTest:{enabled:!0,func:ee.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===Li.TRANSLUCENT||this._blendOption===Li.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=je.fromCache({depthTest:{enabled:!0,func:ee.LEQUAL},depthMask:!1,blending:Qt.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:[YL]}),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===Li.OPAQUE_AND_TRANSLUCENT&&(y=new Ge({defines:["OPAQUE"],sources:[aA]}),this._sp=Zt.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:sl}),y=new Ge({defines:["TRANSLUCENT"],sources:[aA]}),this._spTranslucent=Zt.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:sl})),this._blendOption===Li.OPAQUE&&(y=new Ge({sources:[aA]}),this._sp=Zt.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:sl})),this._blendOption===Li.TRANSLUCENT&&(y=new Ge({sources:[aA]}),this._spTranslucent=Zt.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:sl})),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===Li.OPAQUE,P=this._blendOption===Li.OPAQUE_AND_TRANSLUCENT;A=this._vaf.va,b=A.length,E.length=b;let R=P?b*2:b;for(T=0;T<R;++T){let O=w||P&&T%2===0;x=E[T],l(x)||(x=E[T]=new nt),x.primitiveType=Re.POINTS,x.pass=O||!P?Pe.OPAQUE:Pe.TRANSLUCENT,x.owner=this;let N=P?Math.floor(T/2):T;x.boundingVolume=d,x.modelMatrix=p,x.shaderProgram=O?this._sp:this._spTranslucent,x.uniformMap=this._uniforms,x.vertexArray=A[N].va,x.renderState=O?this._rsOpaque:this._rsTranslucent,x.debugShowBoundingVolume=this.debugShowBoundingVolume,x.pickId="v_pickColor",C.push(x)}}};Vd.prototype.isDestroyed=function(){return!1};Vd.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(),eAe(this._pointPrimitives),ue(this)};var rS=Vd;var aAe=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],qJ=1,XL=8,na=new Uint32Array(96),$L=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!==qJ)throw new Error(`Got v${r} data when expected v${qJ}.`);let o=aAe[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=aAe.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,XL,t),this.coords=new i(o,XL+c+u,t*2),this._pos=t*2,this._finished=!0;else{let f=this.data=new r(XL+s+c+u);this.ids=new this.IndexArrayType(f,XL,t),this.coords=new i(f,XL+c+u,t*2),this._pos=0,this._finished=!1,new Uint8Array(f,0,2).set([219,(qJ<<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 XJ(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;na[0]=0,na[1]=o.length-1,na[2]=0;let c=3,u=[];for(;c>0;){let f=na[--c],d=na[--c],p=na[--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)&&(na[c++]=p,na[c++]=g-1,na[c++]=1-f),(f===0?i>=m:r>=y)&&(na[c++]=g+1,na[c++]=d,na[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;na[0]=0,na[1]=o.length-1,na[2]=0;let c=3,u=0,f=i*i;for(;c>0;){let d=na[--c],p=na[--c],g=na[--c];if(p-g<=s){for(let b=g;b<=p;b++)sAe(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];sAe(y,A,t,n)<=f&&(r[u++]=o[m]),(d===0?t-i<=y:n-i<=A)&&(na[c++]=g,na[c++]=m-1,na[c++]=1-d),(d===0?t+i>=y:n+i>=A)&&(na[c++]=m+1,na[c++]=p,na[c++]=1-d)}return u}};function XJ(e,t,n,i,r,o){if(r-i<=n)return;let a=i+r>>1;cAe(e,t,a,i,r,o),XJ(e,t,n,i,a-1,1-o),XJ(e,t,n,a+1,r,1-o)}function cAe(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));cAe(e,t,n,m,y,o)}let a=t[2*n+o],s=i,c=r;for(KL(e,t,i,n),t[2*r+o]>a&&KL(e,t,i,r);s<c;){for(KL(e,t,s,c),s++,c--;t[2*s+o]<a;)s++;for(;t[2*c+o]>a;)c--}t[2*i+o]===a?KL(e,t,i,c):(c++,KL(e,t,c,r)),c<=n&&(i=c+1),n<=c&&(r=c-1)}}function KL(e,t,n,i){YJ(e,n,i),YJ(t,2*n,2*i),YJ(t,2*n+1,2*i+1)}function YJ(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function sAe(e,t,n,i){let r=e-n,o=t-i;return r*r+o*o}function tm(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 lAe(e,t){e.x-=t,e.y-=t,e.width+=t*2,e.height+=t*2}var cet=new Je;function uAe(e,t,n,i,r){if(l(e._labelCollection)&&i._clusterLabels?r=oA.getScreenSpaceBoundingBox(e,t,r):l(e._billboardCollection)&&i._clusterBillboards?r=Dr.getScreenSpaceBoundingBox(e,t,r):l(e._pointPrimitiveCollection)&&i._clusterPoints&&(r=_s.getScreenSpaceBoundingBox(e,t,r)),lAe(r,n),i._clusterLabels&&!l(e._labelCollection)&&l(e.id)&&dAe(i,e.id.id)&&l(e.id._label)){let o=i._collectionIndicesByEntity[e.id.id].labelIndex,a=i._labelCollection.get(o),s=oA.getScreenSpaceBoundingBox(a,t,cet);lAe(s,n),r=Je.union(r,s,r)}return r}function uet(e,t){if(e.clusterShow=!0,!l(e._labelCollection)&&l(e.id)&&dAe(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 fAe(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 dAe(e,t){return l(e)&&l(e._collectionIndicesByEntity[t])&&l(e._collectionIndicesByEntity[t].labelIndex)}function KJ(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 fet=new Je,det=new Je,het=new Je;function met(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 Hp({scene:n}),l(s)?s.removeAll():s=e._clusterBillboardCollection=new vf({scene:n}),l(c)?c.removeAll():c=e._clusterPointCollection=new rS;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 Ih(y,A),x=[];e._clusterLabels&&KJ(i,x,n,b,e),e._clusterBillboards&&KJ(r,x,n,b,e),e._clusterPoints&&KJ(o,x,n,b,e);let T,C,E,w,P,R,O,N,_,v,S,I;if(x.length>0){let M=new $L(x.length,64,Float64Array);for(let F=0;F<x.length;++F)M.add(x[F].coord.x,x[F].coord.y);if(M.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(L.IDENTITY,F.position,h.ZERO,z.ZERO,n);if(!l(V))continue;let k=1-m/g,j=F.width=F.width*k,B=F.height=F.height*k;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(P=M.range(G,W,Q,q),R=P.length,v=0,_=[],C=0;C<R;++C)O=P[C],N=x[O],N.clustered||(++v,S=N.collection,I=N.index,_.push(S.get(I).id));if(v>=f)for(fAe(F.position,v,_,e),p.push(F),C=0;C<R;++C)x[P[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,I=F.index;let V=S.get(I);w=uAe(V,F.coord,u,e,fet);let k=Je.clone(w,det);P=M.range(w.x,w.y,w.x+w.width,w.y+w.height),R=P.length;let j=h.clone(V.position);for(v=1,_=[V.id],C=0;C<R;++C)if(O=P[C],N=x[O],!N.clustered){let B=N.collection.get(N.index),G=uAe(B,N.coord,u,e,het);h.add(B.position,j,j),Je.union(k,G,k),++v,_.push(B.id)}if(v>=f){let B=h.multiplyByScalar(j,1/v,j);for(fAe(B,v,_,e),p.push({position:B,width:k.width,height:k.height,minimumWidth:w.width,minimumHeight:w.height}),C=0;C<R;++C)x[P[C]].clustered=!0}else uet(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}}tm.prototype._initialize=function(e){this._scene=e;let t=met(this);this._cluster=t,this._removeEventListener=e.camera.changed.addEventListener(t)};Object.defineProperties(tm.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 JJ(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 ZJ(e,t){let n=e._collectionIndicesByEntity[t];!l(n.billboardIndex)&&!l(n.labelIndex)&&!l(n.pointIndex)&&delete e._collectionIndicesByEntity[t]}tm.prototype.getLabel=JJ("_labelCollection",Hp,"_unusedLabelIndices","labelIndex");tm.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,ZJ(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};tm.prototype.getBillboard=JJ("_billboardCollection",vf,"_unusedBillboardIndices","billboardIndex");tm.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,ZJ(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};tm.prototype.getPoint=JJ("_pointCollection",rS,"_unusedPointIndices","pointIndex");tm.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,ZJ(this,e.id);let i=this._pointCollection.get(n);i.show=!1,i.id=void 0,this._unusedPointIndices.push(n),this._clusterDirty=!0};function $J(e){if(!l(e))return;let t=e.length;for(let n=0;n<t;++n)e.get(n).clusterShow=!0}function pet(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,$J(e._labelCollection),$J(e._billboardCollection),$J(e._pointCollection))}tm.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,pet(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)};tm.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 Sf=tm;function sA(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new be,this.setValue(e)}Object.defineProperties(sA.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}});sA.prototype.getValue=function(e,t){return this._hasClone?this._value.clone(t):this._value};sA.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))}};sA.prototype.equals=function(e){return this===e||e instanceof sA&&(!this._hasEquals&&this._value===e._value||this._hasEquals&&this._value.equals(e._value))};sA.prototype.valueOf=function(){return this._value};sA.prototype.toString=function(){return String(this._value)};var hi=sA;function get(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 _et(e){return new hi(e)}function yet(e,t,n){return get(e,`_${e.toString()}`,`_${e.toString()}Subscription`,t??!1,n??_et)}var me=yet;function JL(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(JL.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")});JL.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 JL(this)};JL.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 cl=JL;function oS(e){this._definitionChanged=new be,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(oS.prototype,{isConstant:{get:function(){return X.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:me("color")});oS.prototype.getType=function(e){return"Color"};var Aet=new K;oS.prototype.getValue=function(e,t){return l(e)||(e=K.now(Aet)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,U.WHITE,t.color),t};oS.prototype.equals=function(e){return this===e||e instanceof oS&&X.equals(this._color,e._color)};var Yt=oS;var bet=new z(1,1),xet=!1,Tet=U.WHITE;function aS(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(aS.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")});aS.prototype.getType=function(e){return"Image"};var Cet=new K;aS.prototype.getValue=function(e,t){return l(e)||(e=K.now(Cet)),l(t)||(t={}),t.image=X.getValueOrUndefined(this._image,e),t.repeat=X.getValueOrClonedDefault(this._repeat,e,bet,t.repeat),t.color=X.getValueOrClonedDefault(this._color,e,Tet,t.color),X.getValueOrDefault(this._transparent,e,xet)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t};aS.prototype.equals=function(e){return this===e||e instanceof aS&&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 cA=aS;function vet(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 cA;return t.image=e,t}}function Eet(e,t){return me(e,t,vet)}var Qr=Eet;function ZL(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(ZL.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),dimensions:me("dimensions"),heightReference:me("heightReference"),fill:me("fill"),material:Qr("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});ZL.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 ZL(this)};ZL.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 Xx=ZL;function sS(){pe.throwInstantiationError()}Object.defineProperties(sS.prototype,{isConstant:{get:pe.throwInstantiationError},definitionChanged:{get:pe.throwInstantiationError},referenceFrame:{get:pe.throwInstantiationError}});sS.prototype.getValue=pe.throwInstantiationError;sS.prototype.getValueInReferenceFrame=pe.throwInstantiationError;sS.prototype.equals=pe.throwInstantiationError;var hAe=new $;sS.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,hAe);if(n===Ui.INERTIAL)return $.multiplyByVector(o,t,r);if(n===Ui.FIXED)return $.multiplyByVector($.transpose(o,hAe),t,r)};var nm=sS;function Kx(e,t){this._definitionChanged=new be,this._value=h.clone(e),this._referenceFrame=t??Ui.FIXED}Object.defineProperties(Kx.prototype,{isConstant:{get:function(){return!l(this._value)||this._referenceFrame===Ui.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var wet=new K;Kx.prototype.getValue=function(e,t){return l(e)||(e=K.now(wet)),this.getValueInReferenceFrame(e,Ui.FIXED,t)};Kx.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)};Kx.prototype.getValueInReferenceFrame=function(e,t,n){return nm.convertToReferenceFrame(e,this._value,this._referenceFrame,t,n)};Kx.prototype.equals=function(e){return this===e||e instanceof Kx&&h.equals(this._value,e._value)&&this._referenceFrame===e._referenceFrame};var Kl=Kx;function QL(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(QL.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:Qr("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition"),classificationType:me("classificationType"),zIndex:me("zIndex")});QL.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 QL(this)};QL.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 $x=QL;function Iet(e){return e}function Pet(e,t){return me(e,t,Iet)}var $l=Pet;function eN(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(eN.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:Qr("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),numberOfVerticalLines:me("numberOfVerticalLines"),slices:me("slices"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});eN.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 eN(this)};eN.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 Jx=eN;function tN(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(tN.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:Qr("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")});tN.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 tN(this)};tN.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 Zx=tN;function nN(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(nN.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:Qr("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")});nN.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 nN(this)};nN.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 Qx=nN;function iN(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(iN.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")});iN.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 iN(this)};iN.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 im=iN;var QJ=new Ky;function rN(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(rN.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 Det=new K;rN.prototype.getValue=function(e,t){return l(e)||(e=K.now(Det)),l(t)||(t=new Ky),t.translation=X.getValueOrClonedDefault(this._translation,e,QJ.translation,t.translation),t.rotation=X.getValueOrClonedDefault(this._rotation,e,QJ.rotation,t.rotation),t.scale=X.getValueOrClonedDefault(this._scale,e,QJ.scale,t.scale),t};rN.prototype.equals=function(e){return this===e||e instanceof rN&&X.equals(this._translation,e._translation)&&X.equals(this._rotation,e._rotation)&&X.equals(this._scale,e._scale)};var eT=rN;function Og(e,t){this._propertyNames=[],this._definitionChanged=new be,l(e)&&this.merge(e,t)}Object.defineProperties(Og.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}}});Og.prototype.hasProperty=function(e){return this._propertyNames.indexOf(e)!==-1};function Ret(e){return new hi(e)}Og.prototype.addProperty=function(e,t,n){this._propertyNames.push(e),Object.defineProperty(this,e,me(e,!0,n??Ret)),l(t)&&(this[e]=t),this._definitionChanged.raiseEvent(this)};Og.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e],this._definitionChanged.raiseEvent(this)};var Oet=new K;Og.prototype.getValue=function(e,t){l(e)||(e=K.now(Oet)),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};Og.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 Met(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}Og.prototype.equals=function(e){return this===e||e instanceof Og&&Met(this,e)};var Jl=Og;function mAe(e){return new eT(e)}function Let(e){return new Jl(e,mAe)}function Net(e){return new Jl(e)}function Fet(e){return new Jl(e)}function oN(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(oN.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,Fet),lightColor:me("lightColor"),distanceDisplayCondition:me("distanceDisplayCondition"),nodeTransformations:me("nodeTransformations",void 0,Let),articulations:me("articulations",void 0,Net),clippingPlanes:me("clippingPlanes"),customShader:me("customShader")});oN.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 oN(this)};oN.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 Jl(t,mAe)}let n=e.articulations;if(l(n)){let i=this.articulations;l(i)?i.merge(n):this.articulations=new Jl(n)}};var Mg=oN;function aN(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(aN.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),uri:me("uri"),maximumScreenSpaceError:me("maximumScreenSpaceError")});aN.prototype.clone=function(e){return l(e)?(e.show=this.show,e.uri=this.uri,e.maximumScreenSpaceError=this.maximumScreenSpaceError,e):new aN(this)};aN.prototype.merge=function(e){this.show=this.show??e.show,this.uri=this.uri??e.uri,this.maximumScreenSpaceError=this.maximumScreenSpaceError??e.maximumScreenSpaceError};var tT=aN;function sN(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(sN.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),leadTime:me("leadTime"),trailTime:me("trailTime"),width:me("width"),resolution:me("resolution"),material:Qr("material"),distanceDisplayCondition:me("distanceDisplayCondition"),relativeTo:me("relativeTo"),materialMode:me("materialMode")});sN.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 sN(this)};sN.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 Lg=sN;function cN(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(cN.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),plane:me("plane"),dimensions:me("dimensions"),fill:me("fill"),material:Qr("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});cN.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 cN(this)};cN.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 lN=cN;function uN(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(uN.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")});uN.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 uN(this)};uN.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 nT=uN;function Bet(e){return Array.isArray(e)&&(e=new Rc(e)),new hi(e)}function fN(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(fN.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),hierarchy:me("hierarchy",void 0,Bet),height:me("height"),heightReference:me("heightReference"),extrudedHeight:me("extrudedHeight"),extrudedHeightReference:me("extrudedHeightReference"),stRotation:me("stRotation"),granularity:me("granularity"),fill:me("fill"),material:Qr("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")});fN.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 fN(this)};fN.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 rm=fN;function dN(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(dN.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),positions:me("positions"),width:me("width"),granularity:me("granularity"),material:Qr("material"),depthFailMaterial:Qr("depthFailMaterial"),arcType:me("arcType"),clampToGround:me("clampToGround"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition"),classificationType:me("classificationType"),zIndex:me("zIndex")});dN.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 dN(this)};dN.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 ll=dN;function hN(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(hN.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:Qr("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});hN.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 hN(this)};hN.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 iT=hN;function mN(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(mN.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:Qr("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition"),classificationType:me("classificationType"),zIndex:me("zIndex")});mN.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 mN(this)};mN.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 om=mN;function pN(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(pN.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:Qr("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});pN.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 pN(this)};pN.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 Ng=pN;var ket=new de,eZ=[];function zet(e){return new Kl(e)}function Uet(e){return me(e,void 0,zet)}function Ns(e,t){return me(e,void 0,function(n){return n instanceof t?n:new t(n)})}function jd(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??yg.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",...eZ],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 tZ(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)&&tZ(o,o._children,n)}e._definitionChanged.raiseEvent(e,"isShowing",n,!n)}Object.defineProperties(jd.prototype,{availability:$l("availability"),id:{get:function(){return this._id}},definitionChanged:{get:function(){return this._definitionChanged}},name:$l("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&&tZ(this,this._children,n),this._definitionChanged.raiseEvent(this,"show",e,!e)}},trackingReferenceFrame:$l("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&&tZ(this,this._children,i),this._definitionChanged.raiseEvent(this,"parent",e,t)}},propertyNames:{get:function(){return this._propertyNames}},billboard:Ns("billboard",cl),box:Ns("box",Xx),corridor:Ns("corridor",$x),cylinder:Ns("cylinder",Jx),description:me("description"),ellipse:Ns("ellipse",Zx),ellipsoid:Ns("ellipsoid",Qx),label:Ns("label",im),model:Ns("model",Mg),tileset:Ns("tileset",tT),orientation:me("orientation"),path:Ns("path",Lg),plane:Ns("plane",lN),point:Ns("point",nT),polygon:Ns("polygon",rm),polyline:Ns("polyline",ll),polylineVolume:Ns("polylineVolume",iT),properties:Ns("properties",Jl),position:Uet("position"),rectangle:Ns("rectangle",om),viewFrom:me("viewFrom"),wall:Ns("wall",Ng)});jd.registerEntityType=function(e,t){Object.defineProperties(jd.prototype,{[e]:Ns(e,t)}),eZ.includes(e)||eZ.push(e)};jd.prototype.isAvailable=function(e){let t=this._availability;return!l(t)||t.contains(e)};jd.prototype.addProperty=function(e){this._propertyNames.push(e),Object.defineProperty(this,e,$l(e,!0))};jd.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e]};jd.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 pAe=new $,gAe=new h,_Ae=new Fe;jd.prototype.computeModelMatrix=function(e,t){let n=X.getValueOrUndefined(this._position,e,gAe);if(!l(n))return;let i=X.getValueOrUndefined(this._orientation,e,_Ae);return l(i)?t=L.fromRotationTranslation($.fromQuaternion(i,pAe),n,t):t=mt.eastNorthUpToFixedFrame(n,void 0,t),t};jd.prototype.computeModelMatrixForHeightReference=function(e,t,n,i,r){let o=X.getValueOrDefault(t,e,it.NONE),a=X.getValueOrUndefined(this._position,e,gAe);if(o===it.NONE||!l(a)||h.equalsEpsilon(a,h.ZERO,D.EPSILON8))return this.computeModelMatrix(e,r);let s=i.cartesianToCartographic(a,ket);Nu(o)?s.height=n:s.height+=n,a=i.cartographicToCartesian(s,a);let c=X.getValueOrUndefined(this._orientation,e,_Ae);return l(c)?r=L.fromRotationTranslation($.fromQuaternion(c,pAe),a,r):r=mt.eastNorthUpToFixedFrame(a,void 0,r),r};jd.supportsMaterialsforEntitiesOnTerrain=function(e){return Yl.supportsMaterials(e)};jd.supportsPolylinesOnTerrain=function(e){return Jh.isSupported(e)};var qr=jd;var yAe={id:void 0};function gN(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 ul(e){this._owner=e,this._entities=new kt,this._addedEntities=new kt,this._removedEntities=new kt,this._changedEntities=new kt,this._suspendCount=0,this._collectionChanged=new be,this._id=Kn(),this._show=!0,this._firing=!1,this._refire=!1}ul.prototype.suspendEvents=function(){this._suspendCount++};ul.prototype.resumeEvents=function(){this._suspendCount--,gN(this)};Object.defineProperties(ul.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}}});ul.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 Tn({start:e,stop:t})};ul.prototype.add=function(e){e instanceof qr||(e=new qr(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(ul.prototype._onEntityDefinitionChanged,this),gN(this),e};ul.prototype.remove=function(e){return l(e)?this.removeById(e.id):!1};ul.prototype.contains=function(e){return this._entities.get(e.id)===e};ul.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(ul.prototype._onEntityDefinitionChanged,this),gN(this),!0):!1};ul.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(ul.prototype._onEntityDefinitionChanged,this),r.set(s,a))}e.removeAll(),i.removeAll(),this._changedEntities.removeAll(),gN(this)};ul.prototype.getById=function(e){return this._entities.get(e)};ul.prototype.getOrCreateEntity=function(e){let t=this._entities.get(e);return l(t)||(yAe.id=e,t=new qr(yAe),this.add(t)),t};ul.prototype._onEntityDefinitionChanged=function(e){let t=e.id;this._addedEntities.contains(t)||this._changedEntities.set(t,e),gN(this)};var Fs=ul;function nZ(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 Fs(this),this._entityCluster=new Sf}Object.defineProperties(nZ.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){ya.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}}});nZ.prototype.update=function(e){return!0};var _N=nZ;var yN=`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 AN=`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 bN=`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 xN=`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 TN=`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 CN=`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 rT(e){e=e??H.EMPTY_OBJECT;let t=e.translucent??!0,n=e.closed??!1,i=e.materialSupport??rT.MaterialSupport.TEXTURED;this.material=l(e.material)?e.material:tr.fromType(tr.ColorType),this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??i.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource??i.fragmentShaderSource,this._renderState=Cr.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(rT.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}}});rT.prototype.getFragmentShaderSource=Cr.prototype.getFragmentShaderSource;rT.prototype.isTranslucent=Cr.prototype.isTranslucent;rT.prototype.getRenderState=Cr.prototype.getRenderState;rT.MaterialSupport={BASIC:Object.freeze({vertexFormat:Be.POSITION_AND_NORMAL,vertexShaderSource:xN,fragmentShaderSource:bN}),TEXTURED:Object.freeze({vertexFormat:Be.POSITION_NORMAL_AND_ST,vertexShaderSource:CN,fragmentShaderSource:TN}),ALL:Object.freeze({vertexFormat:Be.ALL,vertexShaderSource:AN,fragmentShaderSource:yN})};var yr=rT;function cS(e,t){this._primitives=e,this._orderedGroundPrimitives=t,this._dynamicUpdaters=new kt}cS.prototype.add=function(e,t){this._dynamicUpdaters.set(t.id,t.createDynamicUpdater(this._primitives,this._orderedGroundPrimitives))};cS.prototype.remove=function(e){let t=e.id,n=this._dynamicUpdaters.get(t);l(n)&&(this._dynamicUpdaters.remove(t),n.destroy())};cS.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};cS.prototype.removeAllPrimitives=function(){let e=this._dynamicUpdaters.values;for(let t=0,n=e.length;t<n;t++)e[t].destroy();this._dynamicUpdaters.removeAll()};cS.prototype.getBoundingSphere=function(e,t){return e=this._dynamicUpdaters.get(e.id),l(e)&&l(e.getBoundingSphere)?e.getBoundingSphere(t):It.FAILED};var oT=cS;function lS(){pe.throwInstantiationError()}Object.defineProperties(lS.prototype,{isConstant:{get:pe.throwInstantiationError},definitionChanged:{get:pe.throwInstantiationError}});lS.prototype.getType=pe.throwInstantiationError;lS.prototype.getValue=pe.throwInstantiationError;lS.prototype.equals=pe.throwInstantiationError;var Vet=new K;lS.getValue=function(e,t,n){let i;return l(e)||(e=K.now(Vet)),l(t)&&(i=t.getType(e),l(i))?((!l(n)||n.type!==i)&&(n=tr.fromType(i)),t.getValue(e,n.uniforms),n):((!l(n)||n.type!==tr.ColorType)&&(n=tr.fromType(tr.ColorType)),U.clone(U.WHITE,n.uniforms.color),n)};var mo=lS;function aT(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}aT.prototype._isHidden=function(e,t,n){return!e.isShowing||!e.isAvailable(n)||!X.getValueOrDefault(t.show,n,!0)};aT.prototype._setOptions=pe.throwInstantiationError;aT.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 gn({closed:p,flat:n&&!t._supportsMaterialsforEntitiesOnTerrain});else{let g=mo.getValue(e,u,this._material);this._material=g,d=new yr({material:g,translucent:g.isTranslucent(),closed:p})}if(n)c.vertexFormat=gn.VERTEX_FORMAT,this._primitive=r.add(new Yl({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 Nn({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 Nn({geometryInstances:u,appearance:new gn({flat:!0,translucent:u.attributes.color.value[3]!==255,renderState:{lineWidth:t._scene.clampLineWidth(f)}}),asynchronous:!1,shadows:s}))}};aT.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};aT.prototype.isDestroyed=function(){return!1};aT.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 Ci=aT;var jet=new Yt(U.WHITE),Het=new hi(!0),Get=new hi(!0),Wet=new hi(!1),qet=new hi(U.BLACK),Yet=new hi(Rn.DISABLED),Xet=new hi(new jt),Ket=new hi(Zn.BOTH);function Zl(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=qr.supportsMaterialsforEntitiesOnTerrain(e.scene)}Object.defineProperties(Zl.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}}});Zl.prototype.isOutlineVisible=function(e){let t=this._entity;return(this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e))??!1};Zl.prototype.isFilled=function(e){let t=this._entity;return(this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e))??!1};Zl.prototype.createFillGeometryInstance=pe.throwInstantiationError;Zl.prototype.createOutlineGeometryInstance=pe.throwInstantiationError;Zl.prototype.isDestroyed=function(){return!1};Zl.prototype.destroy=function(){ue(this)};Zl.prototype._isHidden=function(e,t){let n=t.show;return l(n)&&n.isConstant&&!n.getValue(Qe.MINIMUM_VALUE)};Zl.prototype._isOnTerrain=function(e,t){return!1};Zl.prototype._getIsClosed=function(e){return!0};Zl.prototype._isDynamic=pe.throwInstantiationError;Zl.prototype._setStaticOptions=pe.throwInstantiationError;Zl.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??jet,this._fillProperty=o??Get,this._showProperty=u??Het,this._showOutlineProperty=r.outline??Wet,this._outlineColorProperty=c?r.outlineColor??qet:void 0,this._shadowsProperty=r.shadows??Yet,this._distanceDisplayConditionProperty=r.distanceDisplayCondition??Xet,this._classificationTypeProperty=r.classificationType??Ket,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)}};Zl.prototype.createDynamicUpdater=function(e,t){return new this.constructor.DynamicGeometryUpdater(this,e,t)};var vi=Zl;function uS(e,t){this._callback=void 0,this._isConstant=void 0,this._definitionChanged=new be,this.setCallback(e,t)}Object.defineProperties(uS.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}}});var $et=new K;uS.prototype.getValue=function(e,t){return l(e)||(e=K.now($et)),this._callback(e,t)};uS.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};uS.prototype.equals=function(e){return this===e||e instanceof uS&&this._callback===e._callback&&this._isConstant===e._isConstant};var am=uS;var AAe=new h;function fS(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,AAe);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(fS.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}});fS.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 Jet=new K;fS.prototype.getValue=function(e,t){l(e)||(e=K.now(Jet));let n=X.getValueOrDefault(this._heightReference,e,it.NONE),i=X.getValueOrDefault(this._extrudedHeightReference,e,it.NONE);if(n===it.NONE&&!iS(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,AAe);if(!l(o)||h.equals(o,h.ZERO)||!l(r.globe))return h.clone(h.ZERO,t);if(h.equalsEpsilon(this._position,o,D.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)};fS.prototype.isDestroyed=function(){return!1};fS.prototype.destroy=function(){return l(this._removeEventListener)&&this._removeEventListener(),l(this._removeModeListener)&&this._removeModeListener(),l(this._removeCallbackFunc)&&this._removeCallbackFunc(),ue(this)};var sT=fS;function Zet(e,t,n,i){if(vi.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 am(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new sT(this._scene,a,o)}}var Fg=Zet;var bAe=h.ZERO,xAe=new h,Qet=new h,TAe=new U;function ett(e){this.id=e,this.vertexFormat=void 0,this.dimensions=void 0,this.offsetAttribute=void 0}function wf(e,t){vi.call(this,{entity:e,scene:t,geometryOptions:new ett(e),geometryPropertyName:"box",observedPropertyNames:["availability","position","orientation","box"]}),this._onEntityPropertyChanged(e,"box",e.box,void 0)}l(Object.create)&&(wf.prototype=Object.create(vi.prototype),wf.prototype.constructor=wf);Object.defineProperties(wf.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});wf.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,TAe)),l(s)||(s=U.WHITE),a.color=Kt.fromColor(s)}return l(this._options.offsetAttribute)&&(a.offset=_r.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,bAe,xAe))),new Nt({id:t,geometry:wc.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:a})};wf.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,TAe),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=_r.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,bAe,xAe))),new Nt({id:t,geometry:Rh.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:o})};wf.prototype._computeCenter=function(e,t){return X.getValueOrUndefined(this._entity.position,e,t)};wf.prototype._isHidden=function(e,t){return!l(t.dimensions)||!l(e.position)||vi.prototype._isHidden.call(this,e,t)};wf.prototype._isDynamic=function(e,t){return!e.position.isConstant||!X.isConstant(e.orientation)||!t.dimensions.isConstant||!X.isConstant(t.outlineWidth)};wf.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?gn.VERTEX_FORMAT:yr.MaterialSupport.TEXTURED.vertexFormat,i.dimensions=t.dimensions.getValue(Qe.MINIMUM_VALUE,i.dimensions),i.offsetAttribute=n!==it.NONE?hn.ALL:void 0};wf.prototype._onEntityPropertyChanged=Fg;wf.DynamicGeometryUpdater=dS;function dS(e,t,n){Ci.call(this,e,t,n)}l(Object.create)&&(dS.prototype=Object.create(Ci.prototype),dS.prototype.constructor=dS);dS.prototype._isHidden=function(e,t,n){let i=X.getValueOrUndefined(e.position,n,Qet),r=this._options.dimensions;return!l(i)||!l(r)||Ci.prototype._isHidden.call(this,e,t,n)};dS.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?hn.ALL:void 0};var vN=wf;var ttt=new hi(0);function Ql(e){vi.call(this,e),this._zIndex=0,this._terrainOffsetProperty=void 0}l(Object.create)&&(Ql.prototype=Object.create(vi.prototype),Ql.prototype.constructor=Ql);Object.defineProperties(Ql.prototype,{zIndex:{get:function(){return this._zIndex}},terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Ql.prototype._isOnTerrain=function(e,t){return this._fillEnabled&&!l(t.height)&&!l(t.extrudedHeight)&&Yl.isSupported(this._scene)};Ql.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight;return t===0||l(n)&&n!==t};Ql.prototype._computeCenter=pe.throwInstantiationError;Ql.prototype._onEntityPropertyChanged=function(e,t,n,i){if(vi.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??ttt,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 am(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new sT(this._scene,s,o,a)}};Ql.prototype.destroy=function(){l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0),vi.prototype.destroy.call(this)};Ql.getGeometryHeight=function(e,t){if(!l(e)){t!==it.NONE&&pt(pt.geometryHeightReference);return}return Nu(t)?0:e};Ql.getGeometryExtrudedHeight=function(e,t){if(!l(e)){t!==it.NONE&&pt(pt.geometryExtrudedHeightReference);return}return Nu(t)?Ql.CLAMP_TO_GROUND:e};Ql.CLAMP_TO_GROUND="clamp";Ql.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 hn.ALL;if(r===1)return hn.TOP};var ti=Ql;var CAe=new U,vAe=h.ZERO,EAe=new h,SAe=new ie;function ntt(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 sm(e,t){ti.call(this,{entity:e,scene:t,geometryOptions:new ntt(e),geometryPropertyName:"corridor",observedPropertyNames:["availability","corridor"]}),this._onEntityPropertyChanged(e,"corridor",e.corridor,void 0)}l(Object.create)&&(sm.prototype=Object.create(ti.prototype),sm.prototype.constructor=sm);sm.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,CAe)),l(r)||(r=U.WHITE),i.color=Kt.fromColor(r)}return l(this._options.offsetAttribute)&&(i.offset=_r.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,vAe,EAe))),new Nt({id:t,geometry:new ix(this._options),attributes:i})};sm.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,CAe),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=_r.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,vAe,EAe))),new Nt({id:t,geometry:new kD(this._options),attributes:r})};sm.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)};sm.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.width)||vi.prototype._isHidden.call(this,e,t)};sm.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)};sm.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?gn.VERTEX_FORMAT:yr.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=ti.computeGeometryOffsetAttribute(n,i,r,o),a.height=ti.getGeometryHeight(n,i),r=ti.getGeometryExtrudedHeight(r,o),r===ti.CLAMP_TO_GROUND&&(r=wi.getMinimumMaximumHeights(ix.computeRectangle(a,SAe)).minimumTerrainHeight),a.extrudedHeight=r};sm.DynamicGeometryUpdater=hS;function hS(e,t,n){Ci.call(this,e,t,n)}l(Object.create)&&(hS.prototype=Object.create(Ci.prototype),hS.prototype.constructor=hS);hS.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.positions)||!l(i.width)||Ci.prototype._isHidden.call(this,e,t,n)};hS.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=ti.computeGeometryOffsetAttribute(r,o,a,s),i.height=ti.getGeometryHeight(r,o),a=ti.getGeometryExtrudedHeight(a,s),a===ti.CLAMP_TO_GROUND&&(a=wi.getMinimumMaximumHeights(ix.computeRectangle(i,SAe)).minimumTerrainHeight),i.extrudedHeight=a};var EN=sm;var wAe=h.ZERO,IAe=new h,itt=new h,PAe=new U;function rtt(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 If(e,t){vi.call(this,{entity:e,scene:t,geometryOptions:new rtt(e),geometryPropertyName:"cylinder",observedPropertyNames:["availability","position","orientation","cylinder"]}),this._onEntityPropertyChanged(e,"cylinder",e.cylinder,void 0)}l(Object.create)&&(If.prototype=Object.create(vi.prototype),If.prototype.constructor=If);Object.defineProperties(If.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});If.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,PAe)),l(s)||(s=U.WHITE),a.color=Kt.fromColor(s)}return l(this._options.offsetAttribute)&&(a.offset=_r.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,wAe,IAe))),new Nt({id:t,geometry:new UD(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:a})};If.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,PAe),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=_r.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,wAe,IAe))),new Nt({id:t,geometry:new VD(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:o})};If.prototype._computeCenter=function(e,t){return X.getValueOrUndefined(this._entity.position,e,t)};If.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.length)||!l(t.topRadius)||!l(t.bottomRadius)||vi.prototype._isHidden.call(this,e,t)};If.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)};If.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?gn.VERTEX_FORMAT:yr.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?hn.ALL:void 0};If.prototype._onEntityPropertyChanged=Fg;If.DynamicGeometryUpdater=mS;function mS(e,t,n){Ci.call(this,e,t,n)}l(Object.create)&&(mS.prototype=Object.create(Ci.prototype),mS.prototype.constructor=mS);mS.prototype._isHidden=function(e,t,n){let i=this._options,r=X.getValueOrUndefined(e.position,n,itt);return!l(r)||!l(i.length)||!l(i.topRadius)||!l(i.bottomRadius)||Ci.prototype._isHidden.call(this,e,t,n)};mS.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?hn.ALL:void 0};var SN=If;var DAe=new U,RAe=h.ZERO,OAe=new h,MAe=new ie;function ott(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 cm(e,t){ti.call(this,{entity:e,scene:t,geometryOptions:new ott(e),geometryPropertyName:"ellipse",observedPropertyNames:["availability","position","ellipse"]}),this._onEntityPropertyChanged(e,"ellipse",e.ellipse,void 0)}l(Object.create)&&(cm.prototype=Object.create(ti.prototype),cm.prototype.constructor=cm);cm.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,DAe)),l(r)||(r=U.WHITE),i.color=Kt.fromColor(r)}return l(this._options.offsetAttribute)&&(i.offset=_r.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,RAe,OAe))),new Nt({id:t,geometry:new Ml(this._options),attributes:i})};cm.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,DAe),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=_r.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,RAe,OAe))),new Nt({id:t,geometry:new df(this._options),attributes:o})};cm.prototype._computeCenter=function(e,t){return X.getValueOrUndefined(this._entity.position,e,t)};cm.prototype._isHidden=function(e,t){let n=e.position;return!l(n)||!l(t.semiMajorAxis)||!l(t.semiMinorAxis)||vi.prototype._isHidden.call(this,e,t)};cm.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)};cm.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?gn.VERTEX_FORMAT:yr.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=ti.computeGeometryOffsetAttribute(n,i,r,o),a.height=ti.getGeometryHeight(n,i),r=ti.getGeometryExtrudedHeight(r,o),r===ti.CLAMP_TO_GROUND&&(r=wi.getMinimumMaximumHeights(Ml.computeRectangle(a,MAe)).minimumTerrainHeight),a.extrudedHeight=r};cm.DynamicGeometryUpdater=pS;function pS(e,t,n){Ci.call(this,e,t,n)}l(Object.create)&&(pS.prototype=Object.create(Ci.prototype),pS.prototype.constructor=pS);pS.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.center)||!l(i.semiMajorAxis)||!l(i.semiMinorAxis)||Ci.prototype._isHidden.call(this,e,t,n)};pS.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=ti.computeGeometryOffsetAttribute(r,o,a,s),i.height=ti.getGeometryHeight(r,o),a=ti.getGeometryExtrudedHeight(a,s),a===ti.CLAMP_TO_GROUND&&(a=wi.getMinimumMaximumHeights(Ml.computeRectangle(i,MAe)).minimumTerrainHeight),i.extrudedHeight=a};var wN=cm;var att=new Yt(U.WHITE),iZ=h.ZERO,rZ=new h,stt=new h,ctt=new h,oZ=new U,ltt=new h(1,1,1);function utt(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 Pf(e,t){vi.call(this,{entity:e,scene:t,geometryOptions:new utt(e),geometryPropertyName:"ellipsoid",observedPropertyNames:["availability","position","orientation","ellipsoid"]}),this._onEntityPropertyChanged(e,"ellipsoid",e.ellipsoid,void 0)}l(Object.create)&&(Pf.prototype=Object.create(vi.prototype),Pf.prototype.constructor=Pf);Object.defineProperties(Pf.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Pf.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,oZ)),l(f)||(f=U.WHITE),o=Kt.fromColor(f),u.color=o}return l(this._options.offsetAttribute)&&(u.offset=_r.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,iZ,rZ))),new Nt({id:i,geometry:new Rs(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:u})};Pf.prototype.createOutlineGeometryInstance=function(e,t,n){let i=this._entity,r=i.isAvailable(e),o=X.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,oZ),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=_r.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,iZ,rZ))),new Nt({id:i,geometry:new pf(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:s})};Pf.prototype._computeCenter=function(e,t){return X.getValueOrUndefined(this._entity.position,e,t)};Pf.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.radii)||vi.prototype._isHidden.call(this,e,t)};Pf.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)};Pf.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?gn.VERTEX_FORMAT:yr.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?hn.ALL:void 0};Pf.prototype._onEntityPropertyChanged=Fg;Pf.DynamicGeometryUpdater=IN;function IN(e,t,n){Ci.call(this,e,t,n),this._scene=e._scene,this._modelMatrix=new L,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)&&(IN.prototype=Object.create(Ci.prototype),IN.prototype.constructor=IN);IN.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,stt),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,oZ),c=mo.getValue(e,n.material??att,this._material),u=X.getValueOrUndefined(n.innerRadii,e,ctt),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?hn.ALL:void 0,C=this._scene.mode,E=C===re.SCENE3D&&x===it.NONE,w=this._options,P=this._geometryUpdater.shadowsProperty.getValue(e),O=this._geometryUpdater.distanceDisplayConditionProperty.getValue(e),N=X.getValueOrDefault(this._geometryUpdater.terrainOffsetProperty,e,iZ,rZ);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?ltt: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 yr({material:c,translucent:c.isTranslucent(),closed:!0});w.vertexFormat=S.vertexFormat;let I=this._geometryUpdater.createFillGeometryInstance(e,E,this._modelMatrix);this._primitive=v.add(new Nn({geometryInstances:I,appearance:S,asynchronous:!1,shadows:P}));let M=this._geometryUpdater.createOutlineGeometryInstance(e,E,this._modelMatrix);this._outlinePrimitive=v.add(new Nn({geometryInstances:M,appearance:new gn({flat:!0,translucent:M.attributes.color.value[3]!==255,renderState:{lineWidth:this._geometryUpdater._scene.clampLineWidth(b)}}),asynchronous:!1,shadows:P})),this._lastShow=o,this._lastOutlineShow=a,this._lastOutlineColor=U.clone(s,this._lastOutlineColor),this._lastDistanceDisplayCondition=O,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 I=this._attributes;l(I)||(I=v.getGeometryInstanceAttributes(t),this._attributes=I),o!==this._lastShow&&(I.show=Dn.toValue(o,I.show),this._lastShow=o);let M=this._outlineAttributes;l(M)||(M=S.getGeometryInstanceAttributes(t),this._outlineAttributes=M),a!==this._lastOutlineShow&&(M.show=Dn.toValue(a,M.show),this._lastOutlineShow=a),U.equals(s,this._lastOutlineColor)||(M.color=Kt.toValue(s,M.color),U.clone(s,this._lastOutlineColor)),jt.equals(O,this._lastDistanceDisplayCondition)||(I.distanceDisplayCondition=Jn.toValue(O,I.distanceDisplayCondition),M.distanceDisplayCondition=Jn.toValue(O,M.distanceDisplayCondition),jt.clone(O,this._lastDistanceDisplayCondition)),h.equals(N,this._lastOffset)||(I.offset=_r.toValue(N,I.offset),M.offset=_r.toValue(N,I.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=L.multiplyByScale(r,i,r),this._primitive.modelMatrix=r,this._outlinePrimitive.modelMatrix=r)};var PN=Pf;var ftt=new h,LAe=new U;function dtt(e){this.id=e,this.vertexFormat=void 0,this.plane=void 0,this.dimensions=void 0}function Hd(e,t){vi.call(this,{entity:e,scene:t,geometryOptions:new dtt(e),geometryPropertyName:"plane",observedPropertyNames:["availability","position","orientation","plane"]}),this._onEntityPropertyChanged(e,"plane",e.plane,void 0)}l(Object.create)&&(Hd.prototype=Object.create(vi.prototype),Hd.prototype.constructor=Hd);Hd.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,LAe)),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=aZ(d,p,f,f),new Nt({id:t,geometry:new c1(this._options),modelMatrix:f,attributes:i})};Hd.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,LAe),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=aZ(c,u,s,s),new Nt({id:t,geometry:new l1,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)}})};Hd.prototype._isHidden=function(e,t){return!l(t.plane)||!l(t.dimensions)||!l(e.position)||vi.prototype._isHidden.call(this,e,t)};Hd.prototype._getIsClosed=function(e){return!1};Hd.prototype._isDynamic=function(e,t){return!e.position.isConstant||!X.isConstant(e.orientation)||!t.plane.isConstant||!t.dimensions.isConstant||!X.isConstant(t.outlineWidth)};Hd.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Yt,i=this._options;i.vertexFormat=n?gn.VERTEX_FORMAT:yr.MaterialSupport.TEXTURED.vertexFormat,i.plane=t.plane.getValue(Qe.MINIMUM_VALUE,i.plane),i.dimensions=t.dimensions.getValue(Qe.MINIMUM_VALUE,i.dimensions)};Hd.DynamicGeometryUpdater=gS;function gS(e,t,n){Ci.call(this,e,t,n)}l(Object.create)&&(gS.prototype=Object.create(Ci.prototype),gS.prototype.constructor=gS);gS.prototype._isHidden=function(e,t,n){let i=this._options,r=X.getValueOrUndefined(e.position,n,ftt);return!l(r)||!l(i.plane)||!l(i.dimensions)||Ci.prototype._isHidden.call(this,e,t,n)};gS.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 htt=new h,mtt=new h,ptt=new h,gtt=new h,_tt=new $,ytt=new $,Att=new L;function aZ(e,t,n,i){let r=e.normal,o=e.distance,a=h.multiplyByScalar(r,-o,ptt),s=h.clone(h.UNIT_Z,mtt);D.equalsEpsilon(Math.abs(h.dot(s,r)),1,D.EPSILON8)&&(s=h.clone(h.UNIT_Y,s));let c=h.cross(s,r,htt);s=h.cross(r,c,s),h.normalize(c,c),h.normalize(s,s);let u=_tt;$.setColumn(u,0,c,u),$.setColumn(u,1,s,u),$.setColumn(u,2,r,u);let f=h.fromElements(t.x,t.y,1,gtt),d=$.multiplyByScale(u,f,ytt),p=L.fromRotationTranslation(d,a,Att);return L.multiplyTransformation(n,p,i)}Hd.createPrimitiveMatrix=aZ;var DN=Hd;var NAe="Entity polygons cannot have both height and perPositionHeight. height will be ignored",FAe="heightReference is not supported for entity polygons with perPositionHeight. heightReference will be ignored",BAe=new U,kAe=h.ZERO,zAe=new h,UAe=new ie,btt=[],xtt=new z;function Ttt(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 Df(e,t){ti.call(this,{entity:e,scene:t,geometryOptions:new Ttt(e),geometryPropertyName:"polygon",observedPropertyNames:["availability","polygon"]}),this._onEntityPropertyChanged(e,"polygon",e.polygon,void 0)}l(Object.create)&&(Df.prototype=Object.create(ti.prototype),Df.prototype.constructor=Df);Df.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,BAe)),l(a)||(a=U.WHITE),r.color=Kt.fromColor(a)}l(i.offsetAttribute)&&(r.offset=_r.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,kAe,zAe)));let o;return i.perPositionHeight&&!l(i.extrudedHeight)?o=new RD(i):o=new mg(i),new Nt({id:t,geometry:o,attributes:r})};Df.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,r=X.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,BAe),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=_r.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,kAe,zAe)));let s;return i.perPositionHeight&&!l(i.extrudedHeight)?s=new Sd(i):s=new u1(i),new Nt({id:t,geometry:s,attributes:a})};Df.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=Pa.fromPoints(i,r),a=o.projectPointsOntoPlane(i,btt),s=a.length,c=0,u=s-1,f=new z;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=z.add(g,m,xtt);A=z.multiplyByScalar(A,y,A),f=z.add(f,A,f),c+=y}let d=1/(c*3);return f=z.multiplyByScalar(f,d,f),o.projectPointOntoEllipsoid(f,t)};Df.prototype._isHidden=function(e,t){return!l(t.hierarchy)||vi.prototype._isHidden.call(this,e,t)};Df.prototype._isOnTerrain=function(e,t){let n=ti.prototype._isOnTerrain.call(this,e,t),i=t.perPositionHeight,r=l(i)&&(i.isConstant?i.getValue(Qe.MINIMUM_VALUE):!0);return n&&!r};Df.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)};Df.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Yt,i=this._options;i.vertexFormat=n?gn.VERTEX_FORMAT:yr.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=ti.getGeometryHeight(o,a);let f;if(u?(l(o)&&(o=void 0,pt(NAe)),a!==it.NONE&&u&&(o=void 0,pt(FAe))):(l(s)&&!l(o)&&(o=0),f=ti.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=ti.getGeometryExtrudedHeight(s,c),s===ti.CLAMP_TO_GROUND){let d=mg.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,UAe);s=wi.getMinimumMaximumHeights(d).minimumTerrainHeight}i.extrudedHeight=s};Df.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)};Df.DynamicGeometryUpdater=_S;function _S(e,t,n){Ci.call(this,e,t,n)}l(Object.create)&&(_S.prototype=Object.create(Ci.prototype),_S.prototype.constructor=_S);_S.prototype._isHidden=function(e,t,n){return!l(this._options.polygonHierarchy)||Ci.prototype._isHidden.call(this,e,t,n)};_S.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=ti.getGeometryHeight(r,a);let u;if(c?(l(r)&&(r=void 0,pt(NAe)),o!==it.NONE&&c&&(r=void 0,pt(FAe))):(l(s)&&!l(r)&&(r=0),u=ti.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=ti.getGeometryExtrudedHeight(s,a),s===ti.CLAMP_TO_GROUND){let f=mg.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,UAe);s=wi.getMinimumMaximumHeights(f).minimumTerrainHeight}i.extrudedHeight=s};var RN=Df;var VAe=new U;function Ctt(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 Gp(e,t){vi.call(this,{entity:e,scene:t,geometryOptions:new Ctt(e),geometryPropertyName:"polylineVolume",observedPropertyNames:["availability","polylineVolume"]}),this._onEntityPropertyChanged(e,"polylineVolume",e.polylineVolume,void 0)}l(Object.create)&&(Gp.prototype=Object.create(vi.prototype),Gp.prototype.constructor=Gp);Gp.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,VAe)),l(c)||(c=U.WHITE),r=Kt.fromColor(c),i={show:o,distanceDisplayCondition:s,color:r}}else i={show:o,distanceDisplayCondition:s};return new Nt({id:t,geometry:new m1(this._options),attributes:i})};Gp.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,VAe),r=this._distanceDisplayConditionProperty.getValue(e);return new Nt({id:t,geometry:new _1(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)}})};Gp.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.shape)||vi.prototype._isHidden.call(this,e,t)};Gp.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!t.shape.isConstant||!X.isConstant(t.granularity)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.cornerType)};Gp.prototype._setStaticOptions=function(e,t){let n=t.granularity,i=t.cornerType,r=this._options,o=this._materialProperty instanceof Yt;r.vertexFormat=o?gn.VERTEX_FORMAT:yr.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};Gp.DynamicGeometryUpdater=yS;function yS(e,t,n){Ci.call(this,e,t,n)}l(Object.create)&&(yS.prototype=Object.create(Ci.prototype),yS.prototype.constructor=yS);yS.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.polylinePositions)||!l(i.shapePositions)||Ci.prototype._isHidden.call(this,e,t,n)};yS.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 ON=Gp;var jAe=new U,HAe=h.ZERO,GAe=new h,WAe=new ie,vtt=new ie,Ett=new de;function Stt(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 lm(e,t){ti.call(this,{entity:e,scene:t,geometryOptions:new Stt(e),geometryPropertyName:"rectangle",observedPropertyNames:["availability","rectangle"]}),this._onEntityPropertyChanged(e,"rectangle",e.rectangle,void 0)}l(Object.create)&&(lm.prototype=Object.create(ti.prototype),lm.prototype.constructor=lm);lm.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,jAe)),l(r)||(r=U.WHITE),i.color=Kt.fromColor(r)}return l(this._options.offsetAttribute)&&(i.offset=_r.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,HAe,GAe))),new Nt({id:t,geometry:new yx(this._options),attributes:i})};lm.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,jAe),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=_r.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,HAe,GAe))),new Nt({id:t,geometry:new Ax(this._options),attributes:o})};lm.prototype._computeCenter=function(e,t){let n=X.getValueOrUndefined(this._entity.rectangle.coordinates,e,vtt);if(!l(n))return;let i=ie.center(n,Ett);return de.toCartesian(i,te.default,t)};lm.prototype._isHidden=function(e,t){return!l(t.coordinates)||vi.prototype._isHidden.call(this,e,t)};lm.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)};lm.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?gn.VERTEX_FORMAT:yr.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=ti.computeGeometryOffsetAttribute(i,r,o,a),s.height=ti.getGeometryHeight(i,r),o=ti.getGeometryExtrudedHeight(o,a),o===ti.CLAMP_TO_GROUND&&(o=wi.getMinimumMaximumHeights(yx.computeRectangle(s,WAe)).minimumTerrainHeight),s.extrudedHeight=o};lm.DynamicGeometryUpdater=AS;function AS(e,t,n){Ci.call(this,e,t,n)}l(Object.create)&&(AS.prototype=Object.create(Ci.prototype),AS.prototype.constructor=AS);AS.prototype._isHidden=function(e,t,n){return!l(this._options.rectangle)||Ci.prototype._isHidden.call(this,e,t,n)};AS.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=ti.computeGeometryOffsetAttribute(r,o,a,s),i.height=ti.getGeometryHeight(r,o),a=ti.getGeometryExtrudedHeight(a,s),a===ti.CLAMP_TO_GROUND&&(a=wi.getMinimumMaximumHeights(yx.computeRectangle(i,WAe)).minimumTerrainHeight),i.extrudedHeight=a};var MN=lm;var qAe=new U;function wtt(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 um(e,t){vi.call(this,{entity:e,scene:t,geometryOptions:new wtt(e),geometryPropertyName:"wall",observedPropertyNames:["availability","wall"]}),this._onEntityPropertyChanged(e,"wall",e.wall,void 0)}l(Object.create)&&(um.prototype=Object.create(vi.prototype),um.prototype.constructor=um);um.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,qAe)),l(c)||(c=U.WHITE),r=Kt.fromColor(c),i={show:o,distanceDisplayCondition:s,color:r}}else i={show:o,distanceDisplayCondition:s};return new Nt({id:t,geometry:new DM(this._options),attributes:i})};um.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,qAe),r=this._distanceDisplayConditionProperty.getValue(e);return new Nt({id:t,geometry:new OM(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)}})};um.prototype._isHidden=function(e,t){return!l(t.positions)||vi.prototype._isHidden.call(this,e,t)};um.prototype._getIsClosed=function(e){return!1};um.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)};um.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?gn.VERTEX_FORMAT:yr.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};um.DynamicGeometryUpdater=bS;function bS(e,t,n){Ci.call(this,e,t,n)}l(Object.create)&&(bS.prototype=Object.create(Ci.prototype),bS.prototype.constructor=bS);bS.prototype._isHidden=function(e,t,n){return!l(this._options.positions)||Ci.prototype._isHidden.call(this,e,t,n)};bS.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 LN=um;var cT=[vN,SN,EN,wN,PN,DN,RN,ON,MN,LN];function lT(e,t){this.entity=e,this.scene=t;let n=new Array(cT.length),i=new be,r=new Lo;for(let o=0;o<n.length;o++){let a=new cT[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(lT.prototype._onEntityPropertyChanged,this)}lT.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)};lT.prototype.forEach=function(e){let t=this.updaters;for(let n=0;n<t.length;n++)e(t[n])};lT.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)};lT.registerUpdater=function(e){cT.includes(e)||cT.push(e)};lT.unregisterUpdater=function(e){if(cT.includes(e)){let t=cT.indexOf(e);cT.splice(t,1)}};var uT=lT;var YAe=new U,Itt=new jt,Ptt=new jt,Dtt=h.ZERO,Rtt=new h;function fm(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 kt,this.updaters=new kt,this.updatersWithAttributes=new kt,this.attributes=new kt,this.subscriptions=new kt,this.showsUpdated=new kt,this.itemsToRemove=[],this.invalidated=!1;let s;l(r)&&(s=r.definitionChanged.addEventListener(fm.prototype.onMaterialChanged,this)),this.removeMaterialSubscription=s}fm.prototype.onMaterialChanged=function(){this.invalidated=!0};fm.prototype.isMaterial=function(e){let t=this.depthFailMaterialProperty,n=e.depthFailMaterialProperty;return n===t?!0:l(t)?t.equals(n):!1};fm.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)}))}};fm.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};fm.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=mo.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 Nn({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=mo.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,YAe);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,YAe);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,Ptt,Itt);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,Dtt,Rtt);h.equals(A,d._lastOffset)||(d._lastOffset=h.clone(A,d._lastOffset),d.offset=_r.toValue(A,d.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};fm.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()};fm.prototype.contains=function(e){return this.updaters.contains(e.id)};fm.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)};fm.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 xS(e,t,n,i,r){this._solidItems=[],this._translucentItems=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=r}xS.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 fm(this._primitives,i,this._appearanceType,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);a.add(t,r),n.push(a)};function XAe(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}xS.prototype.remove=function(e){XAe(this._solidItems,e)||XAe(this._translucentItems,e)};function KAe(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 oH(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}xS.prototype.update=function(e){let t=oH(this,this._solidItems,e,!0);t=oH(this,this._translucentItems,e,t)&&t;let n=KAe(this,this._solidItems,e),i=KAe(this,this._translucentItems,e);return(n||i)&&(t=oH(this,this._solidItems,e,t)&&t,t=oH(this,this._translucentItems,e,t)&&t),t};function $Ae(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}xS.prototype.getBoundingSphere=function(e,t){let n=$Ae(this._solidItems,e,t);return n===It.FAILED?$Ae(this._translucentItems,e,t):n};function JAe(e){let t=e.length;for(let n=0;n<t;n++)e[n].destroy();e.length=0}xS.prototype.removeAllPrimitives=function(){JAe(this._solidItems),JAe(this._translucentItems)};var Gd=xS;var Ott=new jt,Mtt=new jt,Ltt=h.ZERO,Ntt=new h;function dm(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 kt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new kt,this.material=void 0,this.depthFailMaterial=void 0,this.updatersWithAttributes=new kt,this.attributes=new kt,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(dm.prototype.onMaterialChanged,this),this.subscriptions=new kt,this.showsUpdated=new kt}dm.prototype.onMaterialChanged=function(){this.invalidated=!0};dm.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};dm.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};dm.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 Ftt=new U;dm.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=mo.getValue(e,this.materialProperty,this.material);let s;if(l(this.depthFailMaterialProperty)){this.depthFailMaterial=mo.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 Nn({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=mo.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material,l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Yt)&&(this.depthFailMaterial=mo.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,Ftt);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,Mtt,Ott);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,Ltt,Ntt);h.equals(A,d._lastOffset)||(d._lastOffset=h.clone(A,d._lastOffset),d.offset=_r.toValue(A,d.offset))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};dm.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()};dm.prototype.contains=function(e){return this.updaters.contains(e.id)};dm.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)};dm.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 TS(e,t,n,i,r){this._items=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=r}TS.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 dm(this._primitives,this._appearanceType,t.fillMaterialProperty,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);r.add(e,t),n.push(r)};TS.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}}};TS.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};TS.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};TS.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 Wd=TS;var Btt=new U,ktt=new jt,ztt=new jt;function Bg(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 kt,this.updaters=new kt,this.updatersWithAttributes=new kt,this.attributes=new kt,this.subscriptions=new kt,this.showsUpdated=new kt,this.itemsToRemove=[],this.isDirty=!1,this.rectangleCollisionCheck=new _x}Bg.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};Bg.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)}))}};Bg.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};Bg.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 Yl({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,Btt);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,ztt,ktt);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};Bg.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()};Bg.prototype.contains=function(e){return this.updaters.contains(e.id)};Bg.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};Bg.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 CS(e,t){this._batches=[],this._primitives=e,this._classificationType=t}CS.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 Bg(this._primitives,this._classificationType,n.attributes.color.value,r),i.push(o)),o.add(t,n),o};CS.prototype.remove=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;++i)if(t[i].remove(e))return};CS.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};CS.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};CS.prototype.removeAllPrimitives=function(){let e=this._batches,t=e.length;for(let n=0;n<t;++n)e[n].removeAllPrimitives()};var vS=CS;var Utt=new jt,Vtt=new jt;function Wp(e,t,n,i,r,o){this.primitives=e,this.classificationType=t,this.appearanceType=n,this.materialProperty=i,this.updaters=new kt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new kt,this.material=void 0,this.updatersWithAttributes=new kt,this.attributes=new kt,this.subscriptions=new kt,this.showsUpdated=new kt,this.usingSphericalTextureCoordinates=r,this.zIndex=o,this.rectangleCollisionCheck=new _x}Wp.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};Wp.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)};Wp.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};Wp.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};Wp.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=mo.getValue(e,this.materialProperty,this.material);let s=this.appearanceType;n=new Yl({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=mo.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,Vtt,Utt);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};Wp.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()};Wp.prototype.contains=function(e){return this.updaters.contains(e.id)};Wp.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)};Wp.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 ES(e,t,n){this._items=[],this._primitives=e,this._classificationType=t,this._appearanceType=n}ES.prototype.add=function(e,t){let n=this._items,i=n.length,r=t.createFillGeometryInstance(e),o=Cf.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 Wp(this._primitives,this._classificationType,this._appearanceType,t.fillMaterialProperty,o,a);s.add(e,t,r),n.push(s)};ES.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0&&!t[i].remove(e);i--);};ES.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};ES.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};ES.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 NN=ES;var jtt=new U,Htt=new jt,Gtt=new jt,Wtt=h.ZERO,qtt=new h;function kg(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 kt,this.updaters=new kt,this.updatersWithAttributes=new kt,this.attributes=new kt,this.itemsToRemove=[],this.subscriptions=new kt,this.showsUpdated=new kt}kg.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)}))}};kg.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};kg.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 Nn({show:!1,asynchronous:!0,geometryInstances:a.slice(),appearance:new gn({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,jtt);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,Gtt,Htt);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,Wtt,qtt);h.equals(A,d._lastOffset)||(d._lastOffset=h.clone(A,d._lastOffset),d.offset=_r.toValue(A,d.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};kg.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()};kg.prototype.contains=function(e){return this.updaters.contains(e.id)};kg.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)};kg.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 SS(e,t,n){this._primitives=e,this._scene=t,this._shadows=n,this._solidBatches=new kt,this._translucentBatches=new kt}SS.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 kg(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 kg(this._primitives,!0,i,this._shadows),r.set(i,o)),o.add(t,n))};SS.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};SS.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};SS.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};SS.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 wS=SS;var Ytt=[];function Fu(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 kt,this._removedObjects=new kt,this._changedObjects=new kt;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=qr.supportsMaterialsforEntitiesOnTerrain(e);this._supportsMaterialsforEntitiesOnTerrain=o;let a;for(a=0;a<r;++a)this._outlineBatches[a]=new wS(n,e,a,!1),this._outlineBatches[r+a]=new wS(n,e,a,!0),this._closedColorBatches[a]=new Gd(n,gn,void 0,!0,a,!0),this._closedColorBatches[r+a]=new Gd(n,gn,void 0,!0,a,!1),this._closedMaterialBatches[a]=new Wd(n,yr,void 0,!0,a,!0),this._closedMaterialBatches[r+a]=new Wd(n,yr,void 0,!0,a,!1),this._openColorBatches[a]=new Gd(n,gn,void 0,!1,a,!0),this._openColorBatches[r+a]=new Gd(n,gn,void 0,!1,a,!1),this._openMaterialBatches[a]=new Wd(n,yr,void 0,!1,a,!0),this._openMaterialBatches[r+a]=new Wd(n,yr,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 NN(i,a,yr)),c[a]=new vS(i,a);else for(a=0;a<s;++a)c[a]=new vS(i,a);this._groundColorBatches=c,this._groundMaterialBatches=u,this._dynamicBatch=new oT(n,i),this._batches=this._outlineBatches.concat(this._closedColorBatches,this._closedMaterialBatches,this._openColorBatches,this._openMaterialBatches,this._groundColorBatches,this._groundMaterialBatches,this._dynamicBatch),this._subscriptions=new kt,this._updaterSets=new kt,this._entityCollection=t,t.collectionChanged.addEventListener(Fu.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,Ytt)}Fu.registerUpdater=function(e){uT.registerUpdater(e)};Fu.unregisterUpdater=function(e){uT.unregisterUpdater(e)};Fu.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 uT(c,this._scene),this._updaterSets.set(u,f),f.forEach(function(y){d._insertUpdaterIntoBatch(e,y)}),this._subscriptions.set(u,f.geometryChanged.addEventListener(Fu._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 Xtt=[],Ktt=new se;Fu.prototype.getBoundingSphere=function(e,t){let n=Xtt,i=Ktt,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)};Fu.prototype.isDestroyed=function(){return!1};Fu.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Fu.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)};Fu.prototype._removeUpdater=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;i++)t[i].remove(e)};Fu.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)};Fu._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)};Fu.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 FN=Fu;var $tt=1,Jtt="30px sans-serif",Ztt=ho.FILL,Qtt=U.WHITE,ent=U.BLACK,tnt=1,nnt=!1,int=new U(.165,.165,.165,.8),rnt=new z(7,5),ont=z.ZERO,ant=h.ZERO,snt=it.NONE,cnt=Vi.CENTER,lnt=Gn.CENTER,unt=new h,fnt=new U,dnt=new U,hnt=new U,mnt=new z,pnt=new h,gnt=new z,_nt=new Wt,ynt=new Wt,Ant=new Wt,bnt=new jt;function ZAe(e){this.entity=e,this.label=void 0,this.index=void 0}function lA(e,t){t.collectionChanged.addEventListener(lA.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new kt,this._onCollectionChanged(t,t.values,[],[])}lA.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,unt),c=X.getValueOrUndefined(s._text,e),f=l(d)&&l(c)),!f){sZ(o,a,n);continue}X.isConstant(a._position)||(n._clusterDirty=!0);let p=!1,g=X.getValueOrDefault(s._heightReference,e,snt);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,$tt),u.font=X.getValueOrDefault(s._font,e,Jtt),u.style=X.getValueOrDefault(s._style,e,Ztt),u.fillColor=X.getValueOrDefault(s._fillColor,e,Qtt,fnt),u.outlineColor=X.getValueOrDefault(s._outlineColor,e,ent,dnt),u.outlineWidth=X.getValueOrDefault(s._outlineWidth,e,tnt),u.showBackground=X.getValueOrDefault(s._showBackground,e,nnt),u.backgroundColor=X.getValueOrDefault(s._backgroundColor,e,int,hnt),u.backgroundPadding=X.getValueOrDefault(s._backgroundPadding,e,rnt,mnt),u.pixelOffset=X.getValueOrDefault(s._pixelOffset,e,ont,gnt),u.eyeOffset=X.getValueOrDefault(s._eyeOffset,e,ant,pnt),u.heightReference=g,u.horizontalOrigin=X.getValueOrDefault(s._horizontalOrigin,e,cnt),u.verticalOrigin=X.getValueOrDefault(s._verticalOrigin,e,lnt),u.translucencyByDistance=X.getValueOrUndefined(s._translucencyByDistance,e,_nt),u.pixelOffsetScaleByDistance=X.getValueOrUndefined(s._pixelOffsetScaleByDistance,e,ynt),u.scaleByDistance=X.getValueOrUndefined(s._scaleByDistance,e,Ant),u.distanceDisplayCondition=X.getValueOrUndefined(s._distanceDisplayCondition,e,bnt),u.disableDepthTestDistance=X.getValueOrUndefined(s._disableDepthTestDistance,e),p&&u._updateClamping()}return!0};lA.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};lA.prototype.isDestroyed=function(){return!1};lA.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(lA.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeLabel(e[t]);return ue(this)};lA.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 ZAe(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 ZAe(o)):(sZ(a.get(o.id),o,s),a.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],sZ(a.get(o.id),o,s),a.remove(o.id)};function sZ(e,t,n){l(e)&&(e.label=void 0,n.removeLabel(t))}var BN=lA;var IS={HIGHLIGHT:0,REPLACE:1,MIX:2};IS.getColorBlend=function(e,t){if(e===IS.HIGHLIGHT)return 0;if(e===IS.REPLACE)return 1;if(e===IS.MIX)return D.clamp(t,D.EPSILON4,1)};Object.freeze(IS);var fl=IS;function PS(e,t){this._distance=t,this._normal=new QAe(e,this),this.onChangeCallback=void 0,this.index=-1}Object.defineProperties(PS.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)}}});PS.fromPlane=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance):t=new PS(e.normal,e.distance),t};PS.clone=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance,t):new PS(e.normal,e.distance)};function QAe(e,t){this._clippingPlane=t,this._cartesian3=h.clone(e)}Object.defineProperties(QAe.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 Za=PS;function dl(e){e=e??H.EMPTY_OBJECT,this._planes=[],this._dirtyIndex=-1,this._multipleDirtyPlanes=!1,this._enabled=e.enabled??!0,this.modelMatrix=L.clone(e.modelMatrix??L.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?rbe:obe,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 rbe(e){return e===Xt.OUTSIDE}function obe(e){return e===Xt.INSIDE}Object.defineProperties(dl.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?rbe:obe)}},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 ebe(e,t){e._multipleDirtyPlanes=e._multipleDirtyPlanes||e._dirtyIndex!==-1&&e._dirtyIndex!==t,e._dirtyIndex=t}dl.prototype.add=function(e){let t=this._planes.length,n=this;e.onChangeCallback=function(i){ebe(n,i)},e.index=t,ebe(this,t),this._planes.push(e),this.planeAdded.raiseEvent(e,t)};dl.prototype.get=function(e){return this._planes[e]};function abe(e,t){let n=e.length;for(let i=0;i<n;++i)if(en.equals(e[i],t))return i;return-1}dl.prototype.contains=function(e){return abe(this._planes,e)!==-1};dl.prototype.remove=function(e){let t=this._planes,n=abe(t,e);if(n===-1)return!1;e instanceof Za&&(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 Za&&(o.index=r)}return this._multipleDirtyPlanes=!0,t.length=i,this.planeRemoved.raiseEvent(e,n),!0};dl.prototype.removeAll=function(){let e=this._planes,t=e.length;for(let n=0;n<t;++n){let i=e[n];i instanceof Za&&(i.onChangeCallback=void 0,i.index=-1),this.planeRemoved.raiseEvent(i,n)}this._multipleDirtyPlanes=!0,this._planes=[]};var xnt=new ae,Tnt=new ae;function tbe(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,Tnt);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,xnt);i[o+4]=u.x,i[o+5]=u.y,i[o+6]=u.z,i[o+7]=u.w,o+=8}}function nbe(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 sbe(e,t){let n=Lt.maximumTextureSize;return t.x=Math.min(e,n),t.y=Math.ceil(e/t.x),t}var Cnt=new z;dl.prototype.update=function(e){let t=this._clippingPlanesTexture,n=e.context,i=dl.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=sbe(r,Cnt);a.y*=2,i?(t=new Ct({context:n,width:a.x,height:a.y,pixelFormat:He.RGBA,pixelDatatype:ke.FLOAT,sampler:zt.NEAREST,flipY:!1}),this._float32View=new Float32Array(a.x*a.y*4)):(t=new Ct({context:n,width:a.x,height:a.y,pixelFormat:He.RGBA,pixelDatatype:ke.UNSIGNED_BYTE,sampler:zt.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?(nbe(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._float32View}})):(tbe(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),nbe(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),tbe(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 vnt=new L,ibe=new en(h.UNIT_X,0);dl.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._planes,i=n.length,r=this.modelMatrix;l(t)&&(r=L.multiply(t,r,vnt));let o=Xt.INSIDE;!this.unionClippingRegions&&i>0&&(o=Xt.OUTSIDE);for(let a=0;a<i;++a){let s=n[a];en.transform(s,r,ibe);let c=e.intersectPlane(ibe);if(c===Xt.INTERSECTING)o=c;else if(this._testIntersection(c))return c}return o};dl.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};dl.useFloatTexture=function(e){return e.floatingPointTexture};dl.getTextureResolution=function(e,t,n){let i=e.texture;if(l(i))return n.x=i.width,n.y=i.height,n;let r=dl.useFloatTexture(t)?e.length:e.length*2,o=sbe(r,n);return o.y*=2,o};dl.prototype.isDestroyed=function(){return!1};dl.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),ue(this)};var Aa=dl;function fT(e){this._ellipsoid=e.ellipsoid??te.default,this._positions=lbe(e.positions),this._cachedPositions=void 0,this._cachedRectangle=void 0}function lbe(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 Ent(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(fT.prototype,{length:{get:function(){return this._positions.length}},positions:{get:function(){return this._positions}},ellipsoid:{get:function(){return this._ellipsoid}}});fT.clone=function(e,t){return l(t)?(t._ellipsoid=e.ellipsoid,t._positions.length=0,t._positions.push(...e.positions),t):new fT({positions:e.positions,ellipsoid:e.ellipsoid})};fT.equals=function(e,t){return e.ellipsoid.equals(t.ellipsoid)&&e.positions===t.positions};fT.prototype.computeRectangle=function(e){if(Ent(this._positions,this._cachedPositions))return ie.clone(this._cachedRectangle,e);let t=mg.computeRectangleFromPositions(this.positions,this.ellipsoid,void 0,e);return this._cachedPositions=lbe(this._positions),this._cachedRectangle=ie.clone(t),t};var Snt=new ie,cbe=new h;fT.prototype.computeSphericalExtents=function(e){l(e)||(e=new ie);let t=this.computeRectangle(Snt),n=de.toCartesian(ie.southwest(t),this.ellipsoid,cbe),i=Math.sqrt(n.x*n.x+n.y*n.y),r=D.fastApproximateAtan2(i,n.z),o=D.fastApproximateAtan2(n.x,n.y);return e.south=r,e.west=o,n=de.toCartesian(ie.northeast(t),this.ellipsoid,cbe),i=Math.sqrt(n.x*n.x+n.y*n.y),r=D.fastApproximateAtan2(i,n.z),o=D.fastApproximateAtan2(n.x,n.y),e.north=r,e.east=o,e};var DS=fT;var kN=`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 Na(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(Na.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}}});Na.prototype.add=function(e){let t=this._polygons.length;return this._polygons.push(e),this.polygonAdded.raiseEvent(e,t),e};Na.prototype.get=function(e){return this._polygons[e]};Na.prototype.contains=function(e){return this._polygons.some(t=>DS.equals(t,e))};Na.prototype.remove=function(e){let t=this._polygons,n=t.findIndex(i=>DS.equals(i,e));return n===-1?!1:(t.splice(n,1),this.polygonRemoved.raiseEvent(e,n),!0)};function wnt(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 Int(e,t){let i=[],r=e.length;for(let s=0;s<r;++s){let c=wnt(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}}Na.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 Pnt(e){let t=e._float32View,n=e._extentsFloat32View,i=e._polygons,r=i.map(f=>f.computeSphericalExtents()),{extentsList:o,extentsIndexByPolygon:a}=Int(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=D.fastApproximateAtan2(A,y.z),x=D.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 cZ=new z;Na.prototype.update=function(e){let t=e.context;if(!Na.isSupported(e))throw new oe("ClippingPolygonCollections are only supported for WebGL 2.");this.debugShowDistanceTexture&&l(this._signedDistanceTexture)&&(l(this.debugCommand)||(this.debugCommand=Dnt(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=Na.getTextureResolution(i,this.pixelsNeededForPolygonPositions,cZ);i=new Ct({context:t,width:a.x,height:a.y,pixelFormat:He.RG,pixelDatatype:ke.FLOAT,sampler:zt.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=Na.getTextureResolution(r,this.pixelsNeededForExtents,cZ);r=new Ct({context:t,width:a.x,height:a.y,pixelFormat:He.RGBA,pixelDatatype:ke.FLOAT,sampler:zt.NEAREST,flipY:!1}),this._extentsFloat32View=new Float32Array(a.x*a.y*4),this._extentsTexture=r}if(Pnt(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=Na.getClippingDistanceTextureResolution(this,cZ);o=new Ct({context:t,width:a.x,height:a.y,pixelFormat:t.webgl2?He.RED:He.LUMINANCE,pixelDatatype:ke.FLOAT,sampler:new zt({wrapS:rn.CLAMP_TO_EDGE,wrapT:rn.CLAMP_TO_EDGE,minificationFilter:Gt.LINEAR,magnificationFilter:ei.LINEAR}),flipY:!1}),this._signedDistanceTexture=o}this._signedDistanceComputeCommand=Rnt(this)};function Dnt(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}Na.prototype.queueCommands=function(e){l(this._signedDistanceComputeCommand)&&e.commandList.push(this._signedDistanceComputeCommand)};function Rnt(e){let t=e._polygonsTexture,n=e._extentsTexture;return new Vl({fragmentShaderSource:kN,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 ube=new ie,Ont=new ie,Mnt=new ie;Na.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,ube)}l(o)||(o=ie.fromBoundingSphere(e.boundingSphere,t,ube));for(let a=0;a<i;++a){let c=n[a].computeRectangle(Mnt),u=ie.simpleIntersection(o,c,Ont);if(l(u))return Xt.INTERSECTING}return r};Na.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};Na.isSupported=function(e){return e?.context.webgl2};Na.getTextureResolution=function(e,t,n){if(l(e))return n.x=e.width,n.y=e.height,n;let i=Lt.maximumTextureSize;return n.x=Math.min(t,i),n.y=Math.ceil(t/n.x),n.y*=2,n};Na.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(Lt.maximumTextureSize,r),t.y=Math.min(Lt.maximumTextureSize,r),t};Na.getClippingExtentsTextureResolution=function(e,t){let n=e.extentsTexture;return l(n)?(t.x=n.width,t.y=n.height,t):Na.getTextureResolution(n,e.pixelsNeededForExtents,t)};Na.prototype.isDestroyed=function(){return!1};Na.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 hm=Na;var RS={NONE:0,SCENE_LIGHT:1,SUNLIGHT:2};RS.fromGlobeFlags=function(e){return e.enableLighting&&e.dynamicAtmosphereLighting?e.dynamicAtmosphereLightingFromSun?RS.SUNLIGHT:RS.SCENE_LIGHT:RS.NONE};Object.freeze(RS);var zg=RS;function fbe(){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=zg.NONE}fbe.requiresColorCorrect=function(e){return!(D.equalsEpsilon(e.hueShift,0,D.EPSILON7)&&D.equalsEpsilon(e.saturationShift,0,D.EPSILON7)&&D.equalsEpsilon(e.brightnessShift,0,D.EPSILON7))};var dT=fbe;var mm=`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 zN=`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 UN=`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 VN=`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 jN=`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 bi(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(Lt.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=bi.DEFAULT_SPHERICAL_HARMONIC_COEFFICIENTS.slice(),this._lastTime=new K;let i=Math.max(Math.pow(2,t-1),1);this._textureDimensions=new z(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??bi.AVERAGE_EARTH_GROUND_COLOR,this.groundAlbedo=e.groundAlbedo??.31}Object.defineProperties(bi.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}}});bi._maximumComputeCommandCount=8;bi._activeComputeCommandCount=0;bi._nextFrameCommandQueue=[];bi._queueCommand=(e,t)=>{if(bi._activeComputeCommandCount>=bi._maximumComputeCommandCount){bi._nextFrameCommandQueue.push(e);return}t.commandList.push(e),bi._activeComputeCommandCount++};bi._updateCommandQueue=e=>{if(bi._maximumComputeCommandCount=Math.log2(Lt.maximumCubeMapSize),bi._nextFrameCommandQueue.length>0&&bi._activeComputeCommandCount<bi._maximumComputeCommandCount){let t=bi._nextFrameCommandQueue.shift();for(;l(t)&&bi._activeComputeCommandCount<bi._maximumComputeCommandCount;){if(t.owner.isDestroyed()||t.canceled){t=bi._nextFrameCommandQueue.shift();continue}e.commandList.push(t),bi._activeComputeCommandCount++,t=bi._nextFrameCommandQueue.shift()}l(t)&&bi._nextFrameCommandQueue.push(t)}};bi.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};bi.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 Lnt=new h,Nnt=new h;function Fnt(e,t){let n=e._position,i=t.atmosphere,r=t.mapProjection.ellipsoid,o=r.scaleToGeodeticSurface(n,Nnt),a=1.025,s=Lnt,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 dbe=new h,Bnt=new L,knt=new ae,znt=new U;function Unt(e,t){let n=t.context,i=e._textureDimensions;if(l(e._radianceCubeMap)||(e._radianceCubeMap=new Jo({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:[mm,UN]}),e._radianceMapFS=r),dT.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,Bnt),u=knt;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 Jo.faceNames()){let p=e._radianceMapTextures[f];l(p)&&!p.isDestroyed()&&p.destroy(),p=new Ct({context:n,width:i.x,height:i.y,pixelDatatype:ke.UNSIGNED_BYTE,pixelFormat:He.RGBA}),e._radianceMapTextures[f]=p;let g=f,m=new Vl({fragmentShaderSource:r,outputTexture:p,uniformMap:{u_radiiAndDynamicAtmosphereColor:()=>a,u_enuToFixedFrame:()=>c,u_faceDirection:()=>Jo.getDirection(d,dbe),u_positionWC:()=>o,u_brightnessSaturationGammaIntensity:()=>u,u_groundColor:()=>e.groundColor.withAlpha(e.groundAlbedo,znt)},owner:e});m.postExecute=()=>{if(e.isDestroyed()||m.canceled){bi._activeComputeCommandCount--;return}let y=e._radianceMapComputeCommands;y[g]=void 0;let A=new _a({context:n,colorTextures:[e._radianceMapTextures[g]]});A._bind(),e._radianceCubeMap[d].copyFromFramebuffer(),A._unBind(),A.destroy(),bi._activeComputeCommandCount--,y.some(l)||(e._convolutionsCommandsDirty=!0,e._shouldRegenerateShaders=!0)},e._radianceMapComputeCommands[f]=m,bi._queueCommand(m,t),f++}e._radianceCommandsDirty=!1}}function Vnt(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 zt({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){bi._activeComputeCommandCount--;return}let b=e._convolutionComputeCommands;b[g]=void 0,n.copyFace(t,m,y,A),c++,bi._activeComputeCommandCount--,m.destroy(),e._specularMapTextures[g]=void 0,u()},d=0;for(let p=1;p<i;++p){for(let g of Jo.faceNames()){l(e._specularMapTextures[d])&&e._specularMapTextures[d].destroy();let m=e._specularMapTextures[d]=new Ct({context:s,width:o,height:a,pixelDatatype:ke.UNSIGNED_BYTE,pixelFormat:He.RGBA}),y=e._va;l(y)||(y=Jo.createVertexArray(s,g),e._va=y);let A=e._convolveSP;l(A)||(A=Zt.fromCache({context:s,vertexShaderSource:jN,fragmentShaderSource:VN,attributeLocations:{positions:0}}),e._convolveSP=A);let b=new Vl({shaderProgram:A,vertexArray:y,outputTexture:m,persists:!0,owner:e,uniformMap:{u_roughness:()=>p/(i-1),u_radianceTexture:()=>n??s.defaultTexture,u_faceDirection:()=>Jo.getDirection(g,dbe)}});b.postExecute=f(b,d,m,g,p),e._convolutionComputeCommands[d]=b,bi._queueCommand(b,t),++d}o/=2,a/=2}u()}var hbe=new z(3,3);function jnt(e,t){let n=t.context,i=hbe,r=e._irradianceMapTexture;l(r)&&!r.isDestroyed()&&r.destroy(),r=new Ct({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:[zN]}),e._irradianceMapFS=o);let a=new Vl({fragmentShaderSource:o,outputTexture:r,owner:e,uniformMap:{u_radianceMap:()=>e._radianceCubeMap??n.defaultTexture}});a.postExecute=()=>{if(e.isDestroyed()||a.canceled){bi._activeComputeCommandCount--;return}e._irradianceTextureDirty=!1,e._irradianceComputeCommand=void 0,e._sphericalHarmonicCoefficientsDirty=!0,e._irradianceMapFS=void 0,bi._activeComputeCommandCount--},e._irradianceComputeCommand=a,bi._queueCommand(a,t),e._irradianceTextureDirty=!0}function Hnt(e,t){let n=t.context;if(!l(e._irradianceMapTexture))return;let i=new _a({context:n,colorTextures:[e._irradianceMapTexture],destroyAttachments:!1}),r=hbe,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}bi.prototype.update=function(e){let t=e.mode;if(!(bi.isDynamicUpdateSupported(e)&&this._mipmapLevels>=1)||!this.enabled||!this.shouldUpdate||!l(this._position)||t===re.MORPHING){this._shouldRegenerateShaders=!1;return}bi._updateCommandQueue(e);let i=e.atmosphere.dynamicLighting,r=Fnt(this,e)||i===zg.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&&(Unt(this,e),this._radianceMapDirty=!1),this._convolutionsCommandsDirty&&(Vnt(this,e),this._convolutionsCommandsDirty=!1),this._irradianceCommandDirty&&(jnt(this,e),this._irradianceCommandDirty=!1),this._irradianceTextureDirty){this._shouldRegenerateShaders=!1;return}if(this._sphericalHarmonicCoefficientsDirty){Hnt(this,e),this._sphericalHarmonicCoefficientsDirty=!1;return}this._shouldRegenerateShaders=!1};bi.prototype.isDestroyed=function(){return!1};bi.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)};bi.isDynamicUpdateSupported=function(e){let t=e.context;return t.halfFloatingPointTexture||t.colorBufferFloat};bi.AVERAGE_EARTH_GROUND_COLOR=Object.freeze(U.fromCssColorString("#717145"));bi.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 Ug=bi;var mbe={SURFACES_ONLY:0,SURFACES_AND_EDGES:1,EDGES_ONLY:2};Object.freeze(mbe);var qd=mbe;var pbe={};function HN(e){this._count=e.count,this._properties=Ye(e.properties,!0)}HN.prototype.hasProperty=function(e){return qn.hasProperty(e,this._properties,pbe)};HN.prototype.getPropertyIds=function(e){return qn.getPropertyIds(this._properties,pbe,e)};HN.prototype.getProperty=function(e,t){let n=this._properties[t];if(l(n))return Ye(n[e],!0)};HN.prototype.setProperty=function(e,t,n){let i=this._properties[t];l(i)||(i=new Array(this._count),this._properties[t]=i),i[e]=Ye(n,!0)};var Vg=HN;function Nc(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(Nc.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}}});Nc.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))};Nc.prototype.hasPropertyBySemantic=function(e,t){return l(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(t):!1};Nc.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))};Nc.prototype.propertyExistsBySemantic=function(e){return l(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(e):!1};var lZ=[];Nc.prototype.getPropertyIds=function(e,t){if(t=l(t)?t:[],t.length=0,l(this._metadataTable)){let n=this._metadataTable.getPropertyIds(lZ);Xn(t,n)}if(l(this._batchTableHierarchy)){let n=this._batchTableHierarchy.getPropertyIds(e,lZ);Xn(t,n)}if(l(this._jsonMetadataTable)){let n=this._jsonMetadataTable.getPropertyIds(lZ);Xn(t,n)}return t};Nc.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};Nc.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 Vg({count:this._count,properties:{}})),this._jsonMetadataTable.setProperty(e,t,n))};Nc.prototype.getPropertyBySemantic=function(e,t){if(l(this._metadataTable))return this._metadataTable.getPropertyBySemantic(e,t)};Nc.prototype.setPropertyBySemantic=function(e,t,n){return l(this._metadataTable)?this._metadataTable.setPropertyBySemantic(e,t,n):!1};Nc.prototype.getPropertyTypedArray=function(e){if(l(this._metadataTable))return this._metadataTable.getPropertyTypedArray(e)};Nc.prototype.getPropertyTypedArrayBySemantic=function(e){if(l(this._metadataTable))return this._metadataTable.getPropertyTypedArrayBySemantic(e)};Nc.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return l(n)?n.isClass(e,t):!1};Nc.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};Nc.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(l(t))return t.getClassName(e)};Nc.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),ue(this)};var eu=Nc;function gbe(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=Su.createModelTextureReader({textureInfo:o,channels:Gnt(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(gbe.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 Gnt(e){return e.map(function(t){return"rgba".charAt(t)}).join("")}var GN=gbe;function uZ(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 GN({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(uZ.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}}});uZ.prototype.getProperty=function(e){return this._properties[e]};var jg=uZ;function _be(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(_be.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 WN=_be;function fZ(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 WN({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(fZ.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}}});fZ.prototype.getProperty=function(e){return this._properties[e]};var hT=fZ;function OS(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(OS.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}}});OS.prototype.getPropertyTable=function(e){return this._propertyTables[e]};OS.prototype.getPropertyTexture=function(e){return this._propertyTextures[e]};OS.prototype.getPropertyAttribute=function(e){return this._propertyAttributes[e]};OS.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 Bs=OS;function Wnt(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=qnt(s,e.bufferViews,c,e.context),f=new yd({count:s.count,properties:s.properties,class:c,bufferViews:e.bufferViews});i.push(new eu({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 jg({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 hT({id:a,name:s.name,class:n.classes[s.class],propertyAttribute:s}))}return new Bs({schema:n,propertyTables:i,propertyTextures:r,propertyAttributes:o,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}var qN=4;function qnt(e,t,n,i){let r=e.properties;if(!l(r))return;let o=e.count,a;try{a=Ynt(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>Lt.maximumTextureSize||s>Lt.maximumTextureSize){pt("PropertyTableTextureExceedsMaximumSize",`Cannot create a texture for the property table "${e.name}" because it exceeds the maximum texture size of ${Lt.maximumTextureSize}.`);return}let c=Knt(a,o),u=new zt({wrapS:rn.CLAMP_TO_EDGE,wrapT:rn.CLAMP_TO_EDGE,minificationFilter:Gt.NEAREST,magnificationFilter:ei.NEAREST});return Ct.create({context:i,pixelFormat:He.RGBA,pixelDatatype:ke.UNSIGNED_BYTE,sampler:u,flipY:!1,source:{width:o,height:s,arrayBufferView:c}})}function Ynt(e,t,n,i){let r=[],o=n.properties;for(let[a,s]of Object.entries(o)){if(!s.isGpuCompatible(qN))continue;let c=e[a],u=l(c)?t[c.values]:Xnt(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 Xnt(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 Knt(e,t){let n=e.length,i=new Uint8Array(n*t*qN),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*qN,u=s.valueType,f=Mt.gpuComponentType(u);if(u!==f){Jnt(a,r,c);continue}$nt(a,i,c)}return i}function $nt(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*qN;t.set(i.subarray(s,s+r),c)}}function Jnt(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*qN,A=f.get(m);d.set(y,p(A))}}var YN=Wnt;function Znt(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 yd({count:c.count,properties:c.properties,class:u,bufferViews:e.bufferViews});r.push(new eu({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 jg({id:s,propertyTexture:Qnt(c),class:n.classes[c.class],textures:e.textures}))}return new Bs({schema:n,propertyTables:r,propertyTextures:a,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}function Qnt(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:eit(r.channels),extras:r.extras,extensions:r.extensions};t.properties[i]=Ot(r.texture,o,!0)}return t}function eit(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 XN=Znt;var dZ=class extends Ji{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=yt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get structuralMetadata(){return this._structuralMetadata}load(){return l(this._promise)?this._promise:(this._state=yt.LOADING,this._promise=tit(this),this._promise)}process(t){if(this._state===yt.READY)return!0;if(this._state!==yt.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=YN({extension:this._extension,schema:o,bufferViews:a,textures:s,context:t.context}):this._structuralMetadata=XN({extension:this._extensionLegacy,schema:o,bufferViews:a,textures:s}),ybe(this),this._state=yt.READY,!0}unload(){ybe(this),hit(this),l(this._schemaLoader)&&Mi.unload(this._schemaLoader),this._schemaLoader=void 0,l(this._structuralMetadata)&&this._structuralMetadata.destroy(),this._structuralMetadata=void 0}};async function tit(e){try{let t=ait(e),n=fit(e),i=dit(e);return await Promise.all([t,n,i]),e.isDestroyed()?void 0:(e._gltf=void 0,e._state=yt.LOADED,e)}catch(t){if(e.isDestroyed())return;throw e.unload(),e._state=yt.FAILED,e.getError("Failed to load structural metadata",t)}}function nit(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 iit(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 rit(e){let t=e.propertyTables,n={};if(l(t))for(let i=0;i<t.length;i++){let r=t[i];nit(r.properties,n)}return n}function oit(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)&&iit(o,n)}}return n}async function ait(e){let t;l(e._extension)?t=rit(e._extension):t=oit(e._extensionLegacy);let n=[];for(let i in t)if(t.hasOwnProperty(i)){let r=Mi.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 sit(e){let t={},n=e.propertyTextures;if(l(n))for(let i=0;i<n.length;i++){let o=n[i].properties;l(o)&&cit(o,t)}return t}function cit(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];t[i.index]=i}}function lit(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)&&uit(o,t)}}return t}function uit(e,t){for(let n in e)if(e.hasOwnProperty(n)){let r=e[n].texture;t[r.index]=r}}function fit(e){let t;l(e._extension)?t=sit(e._extension):t=lit(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=Mi.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 dit(e){let t=e._extension??e._extensionLegacy,n;if(l(t.schemaUri)){let i=e._baseResource.getDerivedResource({url:t.schemaUri});n=Mi.getSchemaLoader({resource:i})}else n=Mi.getSchemaLoader({schema:t.schema});if(e._schemaLoader=n,await n.load(),!n.isDestroyed())return n.schema}function ybe(e){let t=e._bufferViewLoaders,n=t.length;for(let i=0;i<n;++i)Mi.unload(t[i]);e._bufferViewLoaders.length=0,e._bufferViewIds.length=0}function hit(e){let t=e._textureLoaders,n=t.length;for(let i=0;i<n;++i)Mi.unload(t[i]);e._textureLoaders.length=0,e._textureIds.length=0}var KN=dZ;var mT={TRANSLATION:"TRANSLATION",ROTATION:"ROTATION",SCALE:"SCALE",FEATURE_ID:"_FEATURE_ID"};mT.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"TRANSLATION":return mT.TRANSLATION;case"ROTATION":return mT.ROTATION;case"SCALE":return mT.SCALE;case"_FEATURE_ID":return mT.FEATURE_ID}};Object.freeze(mT);var Io=mT;var mit=65534,pit=255;function aH(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 xbe(n,i),this._outlineCoordinatesTypedArray=void 0,this._extraVertices=[],git(this)}Object.defineProperties(aH.prototype,{updatedTriangleIndices:{get:function(){return this._triangleIndices}},outlineCoordinates:{get:function(){return this._outlineCoordinatesTypedArray}}});function git(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=Abe(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>mit&&(t instanceof Uint16Array||t instanceof Uint8Array)?t=new Uint32Array(t):A>pit&&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=Abe(i,c,u,f,p,g,m)}}e._triangleIndices=t,e._outlineCoordinatesTypedArray=new Float32Array(i)}function Abe(e,t,n,i,r,o,a){let s=a?1:0,c=r?1:0,u=0,f=hZ(e,t,s,c,u);if(f===0)return t;let d=0,p=r?1:0,g=o?1:0,m=hZ(e,n,d,p,g);if(m===0)return n;let y=a?1:0,A=0,b=o?1:0,x=hZ(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=mZ(f),_=mZ(m),v=mZ(x);return N<_&&N<v?t:_<v?n:i}let P=t*3;e[P+C]=s,e[P+E]=c,e[P+w]=u;let R=n*3;e[R+C]=d,e[R+E]=p,e[R+w]=g;let O=i*3;e[O+C]=y,e[O+E]=A,e[O+w]=b}function hZ(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 mZ(e){return(e&1)+(e>>1&1)+(e>>2&1)+(e>>3&1)+(e>>4&1)+(e>>5&1)}aH.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};aH.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,Lt.maximumTextureSize),i=n,r=bbe(i),o=[];for(;i>1;)i>>=1,o.push(bbe(i));let a=new Ct({context:e,source:{arrayBufferView:r,mipLevels:o},width:n,height:1,pixelFormat:He.LUMINANCE,sampler:new zt({wrapS:rn.CLAMP_TO_EDGE,wrapT:rn.CLAMP_TO_EDGE,minificationFilter:Gt.LINEAR_MIPMAP_LINEAR,magnificationFilter:ei.LINEAR})});return t.outlineTexture=a,a};function bbe(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 xbe(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)}}xbe.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 pT=aH;function Tbe(e){this.attribute=e,this.loadBuffer=!1,this.loadTypedArray=!1}function _it(e){this.indices=e,this.loadBuffer=!1,this.loadTypedArray=!1}function sH(e){this.primitive=e,this.attributePlans=[],this.indicesPlan=void 0,this.needsOutlines=!1,this.outlineIndices=void 0,this.needsGaussianSplats=!1}sH.prototype.postProcess=function(e){this.needsOutlines&&(yit(this),xit(this,e)),this.needsGaussianSplats&&bit(this,e)};function yit(e){let t=e.primitive,n=t.indices,i=t.attributes[0].count,r=new pT({triangleIndices:n.typedArray,outlineIndices:e.outlineIndices,originalVertexCount:i});n.typedArray=r.updatedTriangleIndices,n.indexDatatype=Ve.fromTypedArray(n.typedArray);let o=Ait(r.outlineCoordinates),a=new Tbe(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 Ait(e){let t=new xn.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 bit(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 xit(e,t){Tit(e.attributePlans,t),l(e.indicesPlan)&&Cit(e.indicesPlan,t)}function Tit(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 Cit(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)}sH.AttributeLoadPlan=Tbe;sH.IndicesLoadPlan=_it;var gT=sH;function vit(e){e=e??H.EMPTY_OBJECT,this.webp=e.webp??!1,this.basis=e.basis??!1}var $N=vit;function Cbe(e){this._position=e.position,this._adjustmentParams=e.adjustmentParams}Object.defineProperties(Cbe.prototype,{position:{get:function(){return this._position}},adjustmentParams:{get:function(){return this._adjustmentParams}}});var JN=Cbe;function vbe(e){this._position=e.position,this._adjustmentParams=e.adjustmentParams,this._covarianceMatrix=e.covarianceMatrix}Object.defineProperties(vbe.prototype,{position:{get:function(){return this._position}},adjustmentParams:{get:function(){return this._adjustmentParams}},covarianceMatrix:{get:function(){return this._covarianceMatrix}}});var ZN=vbe;function Ebe(e){this._groupFlags=e.groupFlags,this._rotationThetas=e.rotationThetas,this._params=e.params}Object.defineProperties(Ebe.prototype,{groupFlags:{get:function(){return this._groupFlags}},rotationThetas:{get:function(){return this._rotationThetas}},params:{get:function(){return this._params}}});var QN=Ebe;var Sbe={Direct:"Direct",Indirect:"Indirect"};Object.freeze(Sbe);var uA=Sbe;function wbe(e){this._storageType=e.storageType,this._anchorPointsIndirect=e.anchorPointsIndirect,this._anchorPointsDirect=e.anchorPointsDirect,this._intraTileCorrelationGroups=e.intraTileCorrelationGroups,this._covarianceDirect=e.covarianceDirect}Object.defineProperties(wbe.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 MS=wbe;function Ibe(e){this._A=e.A,this._alpha=e.alpha,this._beta=e.beta,this._T=e.T}Object.defineProperties(Ibe.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 eF=Ibe;function LS(){}function Pbe(e){return new $(e[0],e[1],e[3],e[1],e[2],e[4],e[3],e[4],e[5])}function Eit(e){let t=h.fromArray(e.position,0,new h),n=h.fromArray(e.adjustmentParams,0,new h);return new JN({position:t,adjustmentParams:n})}function Sit(e){let t=h.fromArray(e.position,0,new h),n=h.fromArray(e.adjustmentParams,0,new h),i=Pbe(e.covarianceMatrix);return new ZN({position:t,adjustmentParams:n,covarianceMatrix:i})}function wit(e){let t=e.groupFlags,n=h.fromArray(e.rotationThetas,0,new h),i=[];for(let o of e.params){let a=new eF({A:o.A,alpha:o.alpha,beta:o.beta,T:o.T});i.push(a)}return new QN({groupFlags:t,rotationThetas:n,params:i})}LS.load=function(e){let t=e.storageType;if(t===uA.Direct)return LS.loadDirect(e);if(t===uA.Indirect)return LS.loadIndirect(e);throw new oe(`Invalid storage type in NGA_gpm_local - expected 'Direct' or 'Indirect', but found ${t}`)};LS.loadDirect=function(e){let t=[],n=e.anchorPointsDirect;for(let o of n){let a=Eit(o);t.push(a)}let i=Pbe(e.covarianceDirectUpperTriangle);return new MS({storageType:uA.Direct,anchorPointsDirect:t,covarianceDirect:i})};LS.loadIndirect=function(e){let t=[],n=e.anchorPointsIndirect;for(let a of n){let s=Sit(a);t.push(s)}let i=e.intraTileCorrelationGroups,r=[];for(let a of i){let s=wit(a);r.push(s)}return new MS({storageType:uA.Indirect,anchorPointsIndirect:t,intraTileCorrelationGroups:r})};var tF=LS;function Dbe(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(Dbe.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 nF=Dbe;function Rbe(e){this._min=e.min,this._max=e.max,this._source=e.source}Object.defineProperties(Rbe.prototype,{min:{get:function(){return this._min}},max:{get:function(){return this._max}},source:{get:function(){return this._source}}});var iF=Rbe;function Obe(e){this._ppeTextures=e}Object.defineProperties(Obe.prototype,{ppeTextures:{get:function(){return this._ppeTextures}}});var rF=Obe;function ia(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=yt.UNLOADED,this._promise=void 0}l(Object.create)&&(ia.prototype=Object.create(Ji.prototype),ia.prototype.constructor=ia);Object.defineProperties(ia.prototype,{cacheKey:{get:function(){return this._cacheKey}},meshPrimitiveGpmLocal:{get:function(){return this._meshPrimitiveGpmLocal}},structuralMetadata:{get:function(){return this._structuralMetadata}}});ia.prototype._loadResources=async function(){try{return await this._loadTextures(),this.isDestroyed()?void 0:(this._gltf=void 0,this._state=yt.LOADED,this)}catch(e){if(this.isDestroyed())return;throw this.unload(),this._state=yt.FAILED,this.getError("Failed to load GPM data",e)}};ia.prototype.load=function(){return l(this._promise)?this._promise:(this._state=yt.LOADING,this._promise=this._loadResources(this),this._promise)};function Iit(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}ia.prototype._loadTextures=function(){let e;l(this._extension)&&(e=Iit(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=Mi.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)};ia.ppeTexturesMetadataSchemaCache=new Map;ia._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}}}};ia._obtainPpeTexturesMetadataSchema=function(e){let n=ia._collectPpeTexturePropertyIdentifiers(e).toString(),i=ia.ppeTexturesMetadataSchemaCache.get(n);if(l(i))return i;let o={id:`PPE_TEXTURE_SCHEMA_${ia.ppeTexturesMetadataSchemaCache.size}`,classes:{}},a=e.ppeTextures;for(let s=0;s<a.length;s++){let c=a[s],u=`ppeTexture_${s}`,f=ia._createPpeTextureClassJson(c,s);o.classes[u]=f}return i=Pl.fromJson(o),ia.ppeTexturesMetadataSchemaCache.set(n,i),i};ia._collectPpeTexturePropertyIdentifiers=function(e){let t=[],n=e.ppeTextures;for(let i=0;i<n.length;i++){let r=n[i],o=ia._createPpeTextureClassJson(r,i),a=JSON.stringify(o);t.push(a)}return t};ia._convertToStructuralMetadata=function(e,t){let n=[],i=ia._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 jg({id:a,name:s.name,propertyTexture:p,class:d,textures:t}))}return new Bs({schema:i,propertyTables:[],propertyTextures:n,propertyAttributes:[]})};ia.prototype.process=function(e){if(this._state===yt.READY)return!0;if(this._state!==yt.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 iF({min:d.min,max:d.max,source:d.source}),g=new nF({traits:p,noData:f.noData,offset:f.offset,scale:f.scale,index:f.index,texCoord:f.texCoord});o.push(g)}}let s=new rF(o);this._meshPrimitiveGpmLocal=s;let c=ia._convertToStructuralMetadata(s,r);return this._structuralMetadata=c,this._state=yt.READY,!0};ia.prototype._unloadTextures=function(){let e=this._textureLoaders,t=e.length;for(let n=0;n<t;++n)Mi.unload(e[n]);this._textureLoaders.length=0,this._textureIds.length=0};ia.prototype.unload=function(){this._unloadTextures(),this._gltf=void 0,this._extension=void 0,this._structuralMetadata=void 0};var oF=ia;function Pit(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 aF=Pit;var{Attribute:Dit,Indices:Rit,FeatureIdAttribute:Lbe,FeatureIdTexture:Nbe,FeatureIdImplicitRange:Fbe,MorphTarget:Oit,Primitive:Mit,Instances:Lit,Skin:Nit,Node:Fit,AnimatedPropertyType:Bit,AnimationSampler:kit,AnimationTarget:zit,AnimationChannel:Uit,Animation:Vit,ArticulationStage:jit,Articulation:Hit,Asset:Git,Scene:Wit,Components:qit,MetallicRoughness:Yit,SpecularGlossiness:Xit,Specular:Kit,Anisotropy:pZ,Clearcoat:gZ,PlanarFill:$it,LineStyle:Jit,Material:Zit,Vector:Qit,Polygon:ert}=xn,eo={NOT_LOADED:0,LOADING:1,LOADED:2,PROCESSING:3,POST_PROCESSING:4,PROCESSED:5,READY:6,FAILED:7,UNLOADED:8},_Z=class extends Ji{constructor(t){super(),t=t??H.EMPTY_OBJECT;let{gltfResource:n,typedArray:i,releaseGltfJson:r=!1,asynchronous:o=!0,incrementallyLoadTextures:a=!0,upAxis:s=ki.Y,forwardAxis:c=ki.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=eo.NOT_LOADED,this._textureState=eo.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=trt(this),this._promise)}_process(t){return this._state===eo.READY?!0:(this._state===eo.PROCESSING&&irt(this,t),this._resourcesLoaded&&this._state===eo.POST_PROCESSING&&(rrt(this,t.context),this._state=eo.PROCESSED),this._resourcesLoaded&&this._state===eo.PROCESSED?(Mbe(this),this._typedArray=void 0,this._state=eo.READY,!0):!1)}_processTextures(t){if(this._textureState===eo.READY)return!0;if(this._textureState!==eo.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=eo.READY,this._texturesLoaded=!0,!0):!1}process(t){if(this._state===eo.LOADED&&!l(this._loadResourcesPromise)&&(this._loadResourcesPromise=nrt(this,t).then(()=>{this._resourcesLoaded=!0}).catch(o=>{this._processError=o})),l(this._processError)){this._state=eo.FAILED;let o=this._processError;this._processError=void 0,cH(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===eo.FAILED)return!1;let i=!1;try{i=this._process(t)}catch(o){this._state=eo.FAILED,cH(this,o)}let r=!1;try{r=this._processTextures(t)}catch(o){this._textureState=eo.FAILED,cH(this,o)}return this._incrementallyLoadTextures?i:i&&r}isUnloaded(){return this._state===eo.UNLOADED}unload(){l(this._gltfJsonLoader)&&!this._gltfJsonLoader.isDestroyed()&&Mi.unload(this._gltfJsonLoader),this._gltfJsonLoader=void 0,pot(this),Mbe(this),got(this),_ot(this),yot(this),Aot(this),this._components=void 0,this._typedArray=void 0,this._state=eo.UNLOADED}};async function trt(e){e._state=eo.LOADING,e._textureState=eo.LOADING;try{let t=Mi.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=eo.LOADED,e._textureState=eo.LOADED,e)}catch(t){if(e.isDestroyed())return;e._state=eo.FAILED,e._textureState=eo.FAILED,cH(e,t)}}async function nrt(e,t){fn.supportsWebP.initialized||await fn.supportsWebP.initialize(),e._supportedImageFormats=new $N({webp:fn.supportsWebP(),basis:t.context.supportsBasis});let n=mot(e,t);return e._state=eo.PROCESSING,e._textureState=eo.PROCESSING,l(e._gltfJsonLoader)&&e._releaseGltfJson&&(Mi.unload(e._gltfJsonLoader),e._gltfJsonLoader=void 0),n}function cH(e,t){throw e.unload(),e.getError("Failed to load glTF",t)}function irt(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=eo.POST_PROCESSING)}function rrt(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)&&ort(e,r)}}function ort(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 art(e,t,n,i,r,o,a,s,c){let u=e.gltfJson,d=u.accessors[t].bufferView;return Mi.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 srt(e,t,n,i,r,o,a){return Mi.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 Bbe(e,t){let n=Mi.getBufferViewLoader({gltf:e.gltfJson,bufferViewId:t,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoaders.push(n),n}function yZ(e,t,n){let i=t.byteOffset,r=Eu(e,t),o=t.count,a=ff(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=Y0(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 crt(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 lrt(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 urt(e,t,n,i,r){let{gltfJson:o}=e;if(await t.load(),e.isDestroyed())return;let a=yZ(o,n,t.typedArray);i=i??!1,lrt(n,a,r,i)}function sF(e,t,n){let i=new Array(t.count),r=t.bufferView;if(l(r)){let o=Bbe(e,r),a=urt(e,o,t,n,i);return e._loaderPromises.push(a),i}return crt(t,i)}function pm(e,t){let n=Y.createTypedArray(t.componentType,t.count*Vt.getNumberOfComponents(t.type));if(!l(t.bufferView))return n;let i=Bbe(e,t.bufferView),{gltfJson:r}=e,o=i.load().then(()=>{if(e.isDestroyed())return;let a=yZ(r,t,i.typedArray);n.set(a)});return e._loaderPromises.push(o),n}function Bu(e,t){if(l(t))return e===Number?t[0]:e.unpack(t)}function frt(e){return e===Number?0:new e}function drt(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 hrt={VEC2:new z(-1,-1),VEC3:new h(-1,-1,-1),VEC4:new ae(-1,-1,-1,-1)};function mrt(e,t){let n=drt(e.componentDatatype),i=hrt[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 prt(e,t,n){let i=e.decodeMatrix,r=Bu(n,e.decodedMin),o=Bu(n,e.decodedMax);l(r)&&l(o)&&(t.min=r,t.max=o);let a=new xn.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 z(i[6],i[7]),a.quantizedVolumeStepSize=new z(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 grt(e,t,n,i,r){let o=e.accessors[t],a=Vt.getMathType(o.type),s=o.normalized??!1,c=new Dit;c.name=n,c.semantic=i,c.setIndex=r,c.constant=frt(a),c.componentDatatype=o.componentType,c.normalized=s,c.count=o.count,c.type=o.type,c.min=Bu(a,o.min),c.max=Bu(a,o.max),c.byteOffset=o.byteOffset,c.byteStride=Eu(e,o),$i(o,"WEB3D_quantized_attributes")&&prt(o.extensions.WEB3D_quantized_attributes,c,a);let u=c.semantic===rt.POSITION||c.semantic===rt.NORMAL||c.semantic===rt.TANGENT||c.semantic===rt.TEXCOORD||c.semantic===rt.FEATURE_ID||c.semantic===rt.SCALE||c.semantic===rt.ROTATION;return e.extensionsRequired?.includes("KHR_mesh_quantization")&&s&&u&&mrt(c,a),c}function kbe(e){let n=/^\w+_(\d+)$/.exec(e);if(n!==null)return parseInt(n[1])}var _rt={gltfSemantic:void 0,renamedSemantic:void 0,modelSemantic:void 0};function AZ(e,t,n){let i=n;e._renameBatchIdSemantic&&(n==="_BATCHID"||n==="BATCHID")&&(i="_FEATURE_ID_0");let r=t.fromGltfSemantic(i),o=_rt;return o.gltfSemantic=n,o.renamedSemantic=i,o.modelSemantic=r,o}function yrt(e){let t=e===rt.POSITION,n=e===rt.FEATURE_ID,i=e===rt.TEXCOORD;return t||n||i}function Art(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 brt(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===rt.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 xrt(e,t,n,i,r,o){if(r&&(n.buffer=i.buffer),o){let a=i.typedArray;n.typedArray=yZ(e,t,a),r||(n.byteOffset=0,n.byteStride=void 0)}}function zbe(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)?kbe(g):void 0,b=grt(u,t,p,m,y);if(!l(r)&&!l(d)&&!l(o))return b;let x=art(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])?Art(b,x,a,s):l(o)?brt(b,x,a,s):xrt(u,f,b,x,a,s)},b}function Ube(e,t,n,i,r,o,a,s,c){let u=n.modelSemantic,f=u===rt.POSITION,d=u===rt.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=zbe(e,t,n,i,r,o,s?!1:A,s?!0:b,c),E=new gT.AttributeLoadPlan(C);return E.loadBuffer=A,E.loadTypedArray=b,E}function Trt(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=AZ(e,Io,i),u=c.modelSemantic,f=u===Io.TRANSLATION||u===Io.ROTATION||u===Io.SCALE,d=u===Io.TRANSLATION,p=e._loadAttributesAsTypedArray||a&&f||!r.context.instancedArrays,g=e._enablePick&&!r.context.webgl2,m=!p,y=e._loadAttributesFor2D&&!r.scene3DOnly;return zbe(e,t,c,void 0,void 0,void 0,m,p||d&&(!s||y||g),r)}function Crt(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 Rit;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=srt(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 P=new gT.IndicesLoadPlan(d);return P.loadBuffer=A,P.loadTypedArray=b,P}function tu(e,t,n,i){let r=e.gltfJson,o=Su.getImageIdFromTexture({gltf:r,textureId:t.index,supportedImageFormats:e._supportedImageFormats});if(!l(o))return;let a=Mi.getTextureLoader({gltf:r,textureInfo:t,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:n,asynchronous:e._asynchronous}),s=Su.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=eo.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 vrt(e,t,n){let{diffuseTexture:i,specularGlossinessTexture:r,diffuseFactor:o,specularFactor:a,glossinessFactor:s}=t,c=new Xit;return l(i)&&(c.diffuseTexture=tu(e,i,n)),l(r)&&(c.specularGlossinessTexture=tu(e,r,n)),c.diffuseFactor=Bu(ae,o),c.specularFactor=Bu(h,a),c.glossinessFactor=s,c}function Ert(e,t,n){let{baseColorTexture:i,metallicRoughnessTexture:r,baseColorFactor:o,metallicFactor:a,roughnessFactor:s}=t,c=new Yit;return l(i)&&(c.baseColorTexture=tu(e,i,n)),l(r)&&(c.metallicRoughnessTexture=tu(e,r,n)),c.baseColorFactor=Bu(ae,o),c.metallicFactor=a,c.roughnessFactor=s,c}function Srt(e,t,n){let{specularFactor:i,specularTexture:r,specularColorFactor:o,specularColorTexture:a}=t,s=new Kit;return l(r)&&(s.specularTexture=tu(e,r,n)),l(a)&&(s.specularColorTexture=tu(e,a,n)),s.specularFactor=i,s.specularColorFactor=Bu(h,o),s}function wrt(e,t,n){let{anisotropyStrength:i=pZ.DEFAULT_ANISOTROPY_STRENGTH,anisotropyRotation:r=pZ.DEFAULT_ANISOTROPY_ROTATION,anisotropyTexture:o}=t,a=new pZ;return l(o)&&(a.anisotropyTexture=tu(e,o,n)),a.anisotropyStrength=i,a.anisotropyRotation=r,a}function Irt(e,t,n){let{clearcoatFactor:i=gZ.DEFAULT_CLEARCOAT_FACTOR,clearcoatTexture:r,clearcoatRoughnessFactor:o=gZ.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,clearcoatRoughnessTexture:a,clearcoatNormalTexture:s}=t,c=new gZ;return l(r)&&(c.clearcoatTexture=tu(e,r,n)),l(a)&&(c.clearcoatRoughnessTexture=tu(e,a,n)),l(s)&&(c.clearcoatNormalTexture=tu(e,s,n)),c.clearcoatFactor=i,c.clearcoatRoughnessFactor=o,c}function Prt(e){return new $it(e)}function Drt(e){if(!l(e))return;let t=new Jit;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 Rrt(e,t,n){let i=new Zit,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=vrt(e,o,n):(l(u)&&(i.metallicRoughness=Ert(e,u,n)),l(a)&&!i.unlit&&(i.specular=Srt(e,a,n)),l(s)&&!i.unlit&&(i.anisotropy=wrt(e,s,n)),l(c)&&!i.unlit&&(i.clearcoat=Irt(e,c,n))),l(t.emissiveTexture)&&(i.emissiveTexture=tu(e,t.emissiveTexture,n)),l(t.normalTexture)&&!e._loadForClassification&&(i.normalTexture=tu(e,t.normalTexture,n)),l(t.occlusionTexture)&&(i.occlusionTexture=tu(e,t.occlusionTexture,n)),i.emissiveFactor=Bu(h,t.emissiveFactor),i.alphaMode=t.alphaMode,i.alphaCutoff=t.alphaCutoff,i.doubleSided=t.doubleSided,l(f)&&(i.planarFill=Prt(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=Drt(r.BENTLEY_materials_line_style),i}function Vbe(e,t){let n=new Lbe;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 jbe(e,t,n,i){let r=new Lbe,o=e.featureIds;return r.featureCount=n,r.propertyTableId=t,r.setIndex=kbe(o.attribute),r.positionalLabel=i,r}function Hbe(e,t){let n=new Fbe;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 Gbe(e,t,n,i){let r=new Fbe,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 Ort(e,t,n,i){let r=new Nbe;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=tu(e,o,n,zt.NEAREST);let s=(l(o.channels)?o.channels:[0]).map(function(c){return"rgba".charAt(c)}).join("");return r.textureReader.channels=s,r}function Mrt(e,t,n,i,r,o){let a=new Nbe,s=t.featureIds,c=s.texture;return a.featureCount=r,a.propertyTableId=n,a.textureReader=tu(e,c,i,zt.NEAREST),a.textureReader.channels=s.channels,a.positionalLabel=o,a}function Lrt(e,t,n,i,r){let o=new Oit,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=AZ(e,rt,f),g=Ube(e,d,p,a,s,c,u,n,r);o.attributes.push(g.attribute),i.attributePlans.push(g)}return o}function Nrt(e){let i=e?.KHR_gaussian_splatting?.extensions?.KHR_gaussian_splatting_compression_spz_2;if(l(i))return i}function Wbe(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=Bu(ae,r.baseColorFactor);return l(o)?o:new ae(1,1,1,1)}function Frt(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 Brt(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=pm(e,s),u=Frt(s.componentType),f=l(o.material)?o.material:n;i[r]={indices:c,restartIndex:u,componentType:s.componentType,materialColor:Wbe(e,f)}}return i}function krt(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=pm(e,r)}if(n.materialColor=Wbe(e,t.material),l(t.silhouetteNormals)){let r=e.gltfJson.accessors[t.silhouetteNormals];l(r)&&(n.silhouetteNormals=pm(e,r))}return l(t.lineStrings)&&(n.lineStrings=Brt(e,t.lineStrings,t.material)),n}function zrt(e,t,n,i){let r=new Mit,o=new gT(r);e._primitiveLoadPlans.push(o);let a=t.material;l(a)&&(r.material=Rrt(e,e.gltfJson.materials[a],i));let s=t.extensions??H.EMPTY_OBJECT,c=s.EXT_mesh_polygon;l(c)&&(r.polygon=Vrt(e,t,c));let u=s.CESIUM_mesh_vector;l(u)&&(r.vector=jrt(e,u));let f=!1,d=s.CESIUM_primitive_outline;e._loadPrimitiveOutline&&l(d)&&(f=!0,o.needsOutlines=!0,o.outlineIndices=Urt(e,d,o)),r.edgeVisibility=krt(e,s.EXT_mesh_primitive_edge_visibility);let p=Nrt(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 O in A){if(!A.hasOwnProperty(O))continue;let N=A[O],_=AZ(e,rt,O),v=_.modelSemantic;if(g&&!yrt(v))continue;v===rt.FEATURE_ID&&(y=!0);let S=Ube(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 O=0;O<b.length;++O)r.morphTargets.push(Lrt(e,b[O],f,o,i));let x=t.indices;if(l(x)){let O=Crt(e,x,t,y,f,i);l(O)&&(o.indicesPlan=O,r.indices=O.indices)}let T=s.EXT_structural_metadata,C=s.EXT_mesh_features,E=s.EXT_feature_metadata,w=l(E),P=s.NGA_gpm_local;l(C)?Hrt(e,r,C,i):w&&Grt(e,r,E,i),l(T)?Wrt(r,T):w&&qrt(e,r,E),l(P)&&Yrt(r,P);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 Urt(e,t){let n=t.indices,i=e.gltfJson.accessors[n];return sF(e,i,!1)}function Vrt(e,t,n){let i=new ert,r=e.gltfJson.accessors;return i.count=n.count,t.mode===Re.LINE_LOOP?(i.loopIndices=pm(e,r[t.indices]),i.loopIndicesOffsets=pm(e,r[n.indicesOffsets]),i.triangleIndices=pm(e,r[n.triangleIndices]),i.triangleIndicesOffsets=pm(e,r[n.triangleIndicesOffsets])):t.mode===Re.TRIANGLES&&(i.loopIndices=pm(e,r[n.loopIndices]),i.loopIndicesOffsets=pm(e,r[n.loopIndicesOffsets]),i.triangleIndices=pm(e,r[t.indices]),i.triangleIndicesOffsets=pm(e,r[n.indicesOffsets])),i}function jrt(e,t){if(!l(t))return;let n=new Qit;n.vector=t.vector,n.count=t.count;let i=e.gltfJson.accessors;function r(o,a){if(l(o))return sF(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 Hrt(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=Ort(e,a,i,s):l(a.attribute)?c=Vbe(a,s):c=Hbe(a,s),t.featureIds.push(c)}}function Grt(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=jbe(u,d,p,g):m=Gbe(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=Mrt(e,u,d,i,p,g);t.featureIds.push(m)}}function Wrt(e,t){if(!l(t))return;let{propertyTextures:n,propertyAttributes:i}=t;l(n)&&(e.propertyTextureIds=n),l(i)&&(e.propertyAttributeIds=i)}function qrt(e,t,n){l(n.featureTextures)&&(t.propertyTextureIds=n.featureTextures.map(function(i){return e._sortedFeatureTextureIds.indexOf(i)}))}function Yrt(e,t){let n=t.ppeTextures??[];for(let i=0;i<n.length;i++)e.propertyTextureIds.push(i)}function Xrt(e,t,n){let i=t.EXT_mesh_gpu_instancing,r=new Lit,o=i.attributes;if(l(o))for(let u in o){if(!o.hasOwnProperty(u))continue;let f=o[u];r.attributes.push(Trt(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)?Krt(r,s):l(c)&&$rt(e.gltfJson,r,c,e._sortedPropertyTableIds),r}function Krt(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=Vbe(r,o):a=Hbe(r,o),e.featureIds.push(a)}}function $rt(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=jbe(s,u,f,d):p=Gbe(s,u,f,d),t.featureIds.push(p)}}function Jrt(e,t,n){let i=new Fit;i.name=t.name,i.matrix=Bu(L,t.matrix),i.translation=Bu(h,t.translation),i.rotation=Bu(Fe,t.rotation),i.scale=Bu(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=Xrt(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=aF(u);for(let g=0;g<f.length;++g)i.primitives.push(zrt(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 Zrt(e,t){let n=e.gltfJson.nodes;if(!l(n))return[];let i=n.map(function(r,o){let a=Jrt(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 Qrt(e,t,n){let i=new Nit,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=sF(e,a)}else i.inverseBindMatrices=new Array(r.length).fill(L.IDENTITY);return i}function eot(e,t){let n=e.gltfJson.skins;if(e._loadForClassification||!l(n))return[];let i=n.map(function(o,a){let s=Qrt(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 tot(e,t,n,i){let r=new KN({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 not(e,t,n,i){let r=new oF({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 iot(e,t){let n=new kit,i=e.gltfJson.accessors,r=i[t.input];n.input=sF(e,r);let o=t.interpolation;n.interpolation=Wh[o]??Wh.LINEAR;let a=i[t.output];return n.output=sF(e,a,!0),n}function rot(e,t){let n=new zit,i=e.node;if(!l(i))return;n.node=t[i];let r=e.path.toUpperCase();return n.path=Bit[r],n}function oot(e,t,n){let i=new Uit,r=e.sampler;return i.sampler=t[r],i.target=rot(e.target,n),i}function aot(e,t,n){let i=new Vit;i.name=t.name;let r=t.samplers.map(function(a,s){let c=iot(e,a);return c.index=s,c}),o=t.channels.map(function(a){return oot(a,r,n)});return i.samplers=r,i.channels=o,i}function sot(e,t){let n=e.gltfJson.animations;return e._loadForClassification||!l(n)?[]:n.map(function(r,o){let a=aot(e,r,t);return a.index=o,a})}function cot(e){let t=new jit;t.name=e.name;let n=e.type.toUpperCase();return t.type=Wc[n],t.minimumValue=e.minimumValue,t.maximumValue=e.maximumValue,t.initialValue=e.initialValue,t}function lot(e){let t=new Hit;return t.name=e.name,t.stages=e.stages.map(cot),t}function uot(e){let n=(e.extensions??H.EMPTY_OBJECT).AGI_articulations?.articulations;return l(n)?n.map(lot):[]}function fot(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 dot(e,t){let n=new Wit,i=fot(e);return n.nodes=i.map(function(r){return t[r]}),n}var hot=new h;function mot(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=Zrt(e,t),c=eot(e,s),u=sot(e,s),f=uot(n),d=dot(n,s),p=new qit,g=new Git,m=n.asset.copyright;if(l(m)){let x=m.split(";").map(function(T){return new St(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,hot);p.transform=L.fromTranslation(x,p.transform)}if(e._components=p,l(r)||l(o)){let x=tot(e,r,o,t);e._loaderPromises.push(x)}let y=i.NGA_gpm_local;if(l(y)){let x=tF.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 P=not(e,n,w,t);e._loaderPromises.push(P)}}}}let b=[];return Xn(b,e._loaderPromises),e._incrementallyLoadTextures||Xn(b,e._texturesPromises),Promise.all(b)}function pot(e){let t=e._textureLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Mi.unload(t[n]);e._textureLoaders.length=0}function Mbe(e){let t=e._bufferViewLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Mi.unload(t[n]);e._bufferViewLoaders.length=0}function got(e){let t=e._geometryLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Mi.unload(t[n]);e._geometryLoaders.length=0}function _ot(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 yot(e){l(e._structuralMetadataLoader)&&!e._structuralMetadataLoader.isDestroyed()&&(e._structuralMetadataLoader.destroy(),e._structuralMetadataLoader=void 0)}function Aot(e){l(e._meshPrimitiveGpmLoader)&&!e._meshPrimitiveGpmLoader.isDestroyed()&&(e._meshPrimitiveGpmLoader.destroy(),e._meshPrimitiveGpmLoader=void 0)}var Rf=_Z;function _T(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(_T.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}}});_T.isSupported=function(e){return(e.colorBufferHalfFloat&&e.halfFloatingPointTexture||e.floatingPointTexture&&e.colorBufferFloat)&&e.supportsTextureLod};function bZ(e){e._cubeMapBuffers=void 0}_T.prototype.update=function(e){let{context:t}=e;if(!_T.isSupported(t))return;if(l(this._texture)){bZ(this);return}if(!l(this._texture)&&!this._loading){let f=t.textureCache.getTexture(this._url);l(f)&&(bZ(this),this._texture=f,this._maximumMipmapLevel=this._texture.maximumMipmapLevel,this._ready=!0)}let n=this._cubeMapBuffers;if(!l(n)&&!this._loading){let f=this;vu(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(Jo.FaceName).forEach(d=>{f[d]=void 0});for(let d=o;d<s;d++)n.push(f)}let c=new zt({minificationFilter:Gt.LINEAR_MIPMAP_LINEAR}),u=new Jo({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};_T.prototype.isDestroyed=function(){return!1};_T.prototype.destroy=function(){return bZ(this),this._texture=this._texture&&this._texture.destroy(),ue(this)};var gm=_T;function cF(e){e=e??H.EMPTY_OBJECT;let t=l(e.imageBasedLightingFactor)?z.clone(e.imageBasedLightingFactor):new z(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=z.clone(t),this._previousSphericalHarmonicCoefficients=n,this._removeErrorListener=void 0}Object.defineProperties(cF.prototype,{imageBasedLightingFactor:{get:function(){return this._imageBasedLightingFactor},set:function(e){this._previousImageBasedLightingFactor=z.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor),this._imageBasedLightingFactor=z.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 bot(e,t){if(gm.isSupported(t)){if(e._specularEnvironmentCubeMap=e._specularEnvironmentCubeMap&&e._specularEnvironmentCubeMap.destroy(),l(e._specularEnvironmentMaps)){let n=new gm(e._specularEnvironmentMaps);e._specularEnvironmentCubeMap=n,e._removeErrorListener=n.errorEvent.addEventListener(i=>{console.error(`Error loading specularEnvironmentMaps: ${i}`)})}e._shouldRegenerateShaders=!0}}cF.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;z.equals(n,i)||(this._shouldRegenerateShaders=n.x>0&&i.x===0||n.x===0&&i.x>0,this._shouldRegenerateShaders=this._shouldRegenerateShaders||n.y>0&&i.y===0||n.y===0&&i.y>0,this._previousImageBasedLightingFactor=z.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor)),this._previousSphericalHarmonicCoefficients!==this._sphericalHarmonicCoefficients&&(this._shouldRegenerateShaders=this._shouldRegenerateShaders||l(this._previousSphericalHarmonicCoefficients)!==l(this._sphericalHarmonicCoefficients),this._previousSphericalHarmonicCoefficients=this._sphericalHarmonicCoefficients),this._shouldRegenerateShaders=this._shouldRegenerateShaders||this._previousSpecularEnvironmentMapLoaded!==this._specularEnvironmentMapLoaded,this._previousSpecularEnvironmentMapLoaded=this._specularEnvironmentMapLoaded,this._specularEnvironmentCubeMapDirty&&(bot(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)};cF.prototype.isDestroyed=function(){return!1};cF.prototype.destroy=function(){return this._specularEnvironmentCubeMap=this._specularEnvironmentCubeMap&&this._specularEnvironmentCubeMap.destroy(),this._removeErrorListener=this._removeErrorListener&&this._removeErrorListener(),ue(this)};var yT=cF;var lF=`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 NS(){this._framebuffer=new oi({colorAttachmentsLength:2,depth:!0,supportsDepthTexture:!0}),this._drawCommand=void 0,this._clearCommand=void 0,this._strength=1,this._radius=1}Object.defineProperties(NS.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 xot(e){e._framebuffer.destroy(),e._drawCommand=void 0,e._clearCommand=void 0}var xZ=new z;function Tot(e,t){let n=new Ge({defines:["LOG_DEPTH_WRITE"],sources:[lF]}),i={u_pointCloud_colorGBuffer:function(){return e.colorGBuffer},u_pointCloud_depthGBuffer:function(){return e.depthGBuffer},u_distanceAndEdlStrength:function(){return xZ.x=e._radius,xZ.y=e._strength,xZ}},r=je.fromCache({blending:Qt.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 Cot(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i),Tot(e,t)}function qbe(e){return e.drawBuffers&&e.fragmentDepth}NS.isSupported=qbe;function vot(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}NS.prototype.update=function(e,t,n,i){if(!qbe(e.context))return;this._strength=n.eyeDomeLightingStrength,this._radius=n.eyeDomeLightingRadius*e.pixelRatio,Cot(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=vot(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)};NS.prototype.isDestroyed=function(){return!1};NS.prototype.destroy=function(){return xot(this),ue(this)};var Hg=NS;function Ybe(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}Ybe.isSupported=function(e){return Hg.isSupported(e.context)};var qp=Ybe;var FS={};FS._deprecationWarning=Ds;var Gg=Uint32Array.BYTES_PER_ELEMENT;FS.parse=function(e,t){let n=t??0;t=n;let i=new Uint8Array(e),r=new DataView(e);t+=Gg;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+=Gg;let a=r.getUint32(t,!0);t+=Gg;let s=r.getUint32(t,!0);t+=Gg;let c=r.getUint32(t,!0);t+=Gg;let u=r.getUint32(t,!0);t+=Gg;let f=r.getUint32(t,!0);t+=Gg;let d;u>=570425344?(t-=Gg*2,d=s,u=c,f=0,s=0,c=0,FS._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-=Gg,d=u,u=s,f=c,s=0,c=0,FS._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=Co(i,t,s),t+=s);let g=new Uint8Array(e,t,c);t+=c;let m,y;u>0&&(m=Co(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):(FS._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 uF=FS;function fF(e,t){this.json=e,this.buffer=t,this._cachedTypedArrays={},this.featuresLength=0}function Xbe(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 Eot(e,t,n,i){let r=e._cachedTypedArrays,o=r[t];return l(o)||(o=Y.createTypedArray(n,i),r[t]=o),o}fF.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,Xbe(this,e,t,n,1,i.byteOffset)):i};fF.prototype.hasProperty=function(e){return l(this.json[e])};fF.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)),Xbe(this,e,t,n,this.featuresLength,i.byteOffset)):Eot(this,e,t,i)};fF.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 _m=fF;var Sot={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},wot={SCALAR:void 0,VEC2:z,VEC3:h,VEC4:ae,MAT2:Ki,MAT3:$,MAT4:L};function Iot(e){let t=e.componentType,n;typeof t=="string"?n=Y.fromName(t):n=t;let i=Sot[e.type],r=wot[e.type];return{componentsPerAttribute:i,classType:r,createArrayBufferView:function(o,a,s){return Y.createArrayBufferView(n,o,a,i*s)}}}var Yd=Iot;function hl(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,Lt.maximumTextureSize),o=Math.ceil(t/Lt.maximumTextureSize),a=1/r,s=a*.5,c=1/o,u=c*.5;n=new z(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(hl.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}}});hl.DEFAULT_COLOR_VALUE=U.WHITE;hl.DEFAULT_SHOW_VALUE=!0;function Kbe(e){let t=e._textureDimensions;return t.x*t.y*4}function $be(e){if(!l(e._batchValues)){let t=Kbe(e),n=new Uint8Array(t).fill(255);e._batchValues=n}return e._batchValues}function Jbe(e){if(!l(e._showAlphaProperties)){let t=2*e._featuresLength,n=new Uint8Array(t).fill(255);e._showAlphaProperties=n}return e._showAlphaProperties}hl.prototype.setShow=function(e,t){if(t&&!l(this._showAlphaProperties))return;let n=Jbe(this),i=e*2,r=t?255:0;if(n[i]!==r){n[i]=r;let o=$be(this),a=e*4+3;o[a]=t?n[i+1]:0,this._batchValuesDirty=!0}};hl.prototype.setAllShow=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setShow(n,e)};hl.prototype.getShow=function(e){if(!l(this._showAlphaProperties))return!0;let t=e*2;return this._showAlphaProperties[t]===255};var Pot=new Array(4);hl.prototype.setColor=function(e,t){if(U.equals(t,hl.DEFAULT_COLOR_VALUE)&&!l(this._batchValues))return;let n=t.toBytes(Pot),i=n[3],r=$be(this),o=e*4,a=Jbe(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)}};hl.prototype.setAllColor=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setColor(n,e)};hl.prototype.getColor=function(e,t){if(!l(this._batchValues))return U.clone(hl.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)};hl.prototype.getPickColor=function(e){return this._pickIds[e]};function Zbe(e,t,n){let i=e._textureDimensions;return new Ct({context:t,pixelFormat:He.RGBA,pixelDatatype:ke.UNSIGNED_BYTE,source:{width:i.x,height:i.y,arrayBufferView:n},flipY:!1,sampler:zt.NEAREST})}function Dot(e,t){let n=e._featuresLength;if(!l(e._pickTexture)&&n>0){let i=e._pickIds,r=Kbe(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=Zbe(e,t,o),l(s)&&(s.batchTableByteLength+=e._pickTexture.sizeInBytes)}}function Rot(e){let t=e._textureDimensions;e._batchTexture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}hl.prototype.update=function(e,t){let n=t.context;this._defaultTexture=n.defaultTexture;let i=t.passes;(i.pick||i.postProcess)&&Dot(this,n),this._batchValuesDirty&&(this._batchValuesDirty=!1,l(this._batchTexture)||(this._batchTexture=Zbe(this,n,this._batchValues),l(this._statistics)&&(this._statistics.batchTableByteLength+=this._batchTexture.sizeInBytes)),Rot(this))};hl.prototype.isDestroyed=function(){return!1};hl.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 nu=hl;var Qbe={HIGHLIGHT:0,REPLACE:1,MIX:2};Object.freeze(Qbe);var ku=Qbe;var TZ=nu.DEFAULT_COLOR_VALUE,CZ=nu.DEFAULT_SHOW_VALUE;function jr(e,t,n,i,r){this.featuresLength=t;let o;l(n)&&(o=n.extensions),this._extensions=o??{};let a=Oot(n);this._properties=a,this._batchTableHierarchy=Mot(this,n,i);let s=txe(t,a,i);this._binaryPropertiesByteLength=Lot(s),this._batchTableBinaryProperties=s,this._content=e,this._batchTexture=new nu({featuresLength:t,colorChangedCallback:r,owner:e,statistics:e.tileset.statistics})}jr._deprecationWarning=Ds;Object.defineProperties(jr.prototype,{batchTableByteLength:{get:function(){let e=this._binaryPropertiesByteLength;return l(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e+=this._batchTexture.byteLength,e}}});function Oot(e){let t={};if(!l(e))return t;for(let n in e)e.hasOwnProperty(n)&&n!=="HIERARCHY"&&n!=="extensions"&&n!=="extras"&&(t[n]=Ye(e[n],!0));return t}function Mot(e,t,n){if(!l(t))return;let i=e._extensions["3DTILES_batch_table_hierarchy"],r=t.HIERARCHY;if(l(r)&&(jr._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 AT({extension:i,binaryBody:n})}function txe(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=Yd(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 Lot(e){if(!l(e))return 0;let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}jr.getBinaryProperties=function(e,t,n){return txe(e,t,n)};jr.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};jr.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};jr.prototype.getShow=function(e){return this._batchTexture.getShow(e)};jr.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};jr.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};jr.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};jr.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};var Not=new U;jr.prototype.applyStyle=function(e){if(!l(e)){this.setAllColor(TZ),this.setAllShow(CZ);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,Not)??TZ:TZ,a=l(e.show)?e.show.evaluate(r)??CZ:CZ;this.setColor(i,o),this.setShow(i,a)}};function Fot(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}function Bot(e,t,n){let i=e.typedArray,r=e.componentCount;r===1?i[t]=n:e.type.pack(n,i,t*r)}jr.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return l(n)?n.isClass(e,t):!1};jr.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};jr.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(l(t))return t.getClassName(e)};jr.prototype.hasProperty=function(e,t){return l(this._properties[t])||l(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)};jr.prototype.hasPropertyBySemantic=function(){return!1};jr.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};jr.prototype.getPropertyBySemantic=function(e,t){};jr.prototype.getProperty=function(e,t){if(l(this._batchTableBinaryProperties)){let i=this._batchTableBinaryProperties[t];if(l(i))return Fot(i,e)}let n=this._properties[t];if(l(n))return Ye(n[e],!0);if(l(this._batchTableHierarchy)){let i=this._batchTableHierarchy.getProperty(e,t);if(l(i))return i}};jr.prototype.setProperty=function(e,t,n){let i=this.featuresLength;if(l(this._batchTableBinaryProperties)){let o=this._batchTableBinaryProperties[t];if(l(o)){Bot(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]=Ye(n,!0)};function kot(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));
}
`}jr.prototype.getVertexShaderCallback=function(e,t,n){if(this.featuresLength===0)return;let i=this;return function(r){let o=nxe(r,n,!1),a;return Lt.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}
${kot(i)}${a}`}};function exe(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 zot(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 nxe(e,t,n){if(!l(t))return exe(e,n);let i=new RegExp(`(uniform|attribute|in)\\s+(vec[34]|sampler2D)\\s+${t};`),r=e.match(i);if(!l(r))return exe(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=zot(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}jr.prototype.getFragmentShaderCallback=function(e,t,n){if(this.featuresLength!==0)return function(i){return i=nxe(i,t,!0),Lt.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 Uot(e){let t=e._content.tileset,n=t.colorBlendMode,i=t.colorBlendAmount;if(n===ku.HIGHLIGHT)return 0;if(n===ku.REPLACE)return 1;if(n===ku.MIX)return D.clamp(i,D.EPSILON4,1)}jr.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 Uot(e)},tile_pickTexture:function(){return e._batchTexture.pickTexture}})}};jr.prototype.getPickId=function(){return"texture(tile_pickTexture, tile_featureSt)"};var fA={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};jr.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=Vot(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=jot(f),f.dirty=!1);let p=d.originalCommand;c!==fA.ALL_OPAQUE&&f.pass!==Pe.TRANSLUCENT&&(l(d.translucent)||(d.translucent=Hot(p))),c!==fA.ALL_TRANSLUCENT&&f.pass!==Pe.TRANSLUCENT&&(l(d.opaque)||(d.opaque=Got(p)),s&&(o||(l(d.zback)||(d.zback=qot(e.context,p)),a._backfaceCommands.push(d.zback)),(!l(d.stencil)||r._selectionDepth!==Xot(d.stencil))&&(f.renderState.depthMask?d.stencil=Yot(p,r._selectionDepth):d.stencil=d.opaque)));let g=s?d.stencil:d.opaque,m=d.translucent;f.pass!==Pe.TRANSLUCENT?(c===fA.ALL_OPAQUE&&(n[u]=g),c===fA.ALL_TRANSLUCENT&&(n[u]=m),c===fA.OPAQUE_AND_TRANSLUCENT&&(n[u]=g,n.push(m))):n[u]=p}};function Vot(e){let t=e._batchTexture.translucentFeaturesLength;return t===0?fA.ALL_OPAQUE:t===e.featuresLength?fA.ALL_TRANSLUCENT:fA.OPAQUE_AND_TRANSLUCENT}function jot(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 Hot(e){let t=nt.shallowClone(e);return t.pass=Pe.TRANSLUCENT,t.renderState=Kot(e.renderState),t}function Got(e){let t=nt.shallowClone(e);return t.renderState=$ot(e.renderState),t}function Wot(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 qot(e,t){let n=nt.shallowClone(t),i=Ye(n.renderState,!0);i.cull.enabled=!0,i.cull.face=zi.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=Ye(t.uniformMap);let r=new z(5,5);return n.uniformMap.u_polygonOffset=function(){return r},n.shaderProgram=Wot(e,t.shaderProgram),n}function Yot(e,t){let n=nt.shallowClone(e),i=Ye(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 Xot(e){return(e.renderState.stencilTest.reference&qt.SKIP_LOD_MASK)>>>qt.SKIP_LOD_BIT_SHIFT}function Kot(e){let t=Ye(e,!0);return t.cull.enabled=!1,t.depthTest.enabled=!0,t.depthMask=!1,t.blending=Qt.ALPHA_BLEND,t.stencilTest=qt.setCesium3DTileBit(),t.stencilMask=qt.CESIUM_3D_TILE_MASK,je.fromCache(t)}function $ot(e){let t=Ye(e,!0);return t.stencilTest=qt.setCesium3DTileBit(),t.stencilMask=qt.CESIUM_3D_TILE_MASK,je.fromCache(t)}jr.prototype.update=function(e,t){this._batchTexture.update(e,t)};jr.prototype.isDestroyed=function(){return!1};jr.prototype.destroy=function(){return this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),ue(this)};var ym=jr;function Wg(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,Jot(this,e.extension,e.binaryBody)}Object.defineProperties(Wg.prototype,{byteLength:{get:function(){return this._byteLength}}});function Jot(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=Yd(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=Yd(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=Yd(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=ym.getBinaryProperties(b,x,n);p+=Zot(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 Zot(e){let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}var Qot=[],eat=[],tat=0;function nat(e,t,n){let i=e._classIds,r=e._parentCounts,o=e._parentIds,a=e._parentIndexes,s=i.length,c=Qot;c.length=Math.max(c.length,s);let u=++tat,f=eat;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 iat(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 dF(e,t,n){let i=e._parentCounts,r=e._parentIds;if(l(r)){if(l(i))return nat(e,t,n)}else return n(e,t);return iat(e,t,n)}Wg.prototype.hasProperty=function(e,t){let n=dF(this,e,function(i,r){let o=i._classIds[r],a=i._classes[o].instances;if(l(a[t]))return!0});return l(n)};Wg.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};Wg.prototype.getPropertyIds=function(e,t){return t=l(t)?t:[],t.length=0,dF(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};Wg.prototype.getProperty=function(e,t){return dF(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)?rat(s,a):Ye(s[a],!0)})};function rat(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}Wg.prototype.setProperty=function(e,t,n){let i=dF(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)?oat(u,c,n):u[c]=Ye(n,!0),!0});return l(i)};function oat(e,t,n){let i=e.typedArray,r=e.componentCount;r===1?i[t]=n:e.type.pack(n,i,t*r)}Wg.prototype.isClass=function(e,t){let n=dF(this,e,function(i,r){let o=i._classIds[r];if(i._classes[o].name===t)return!0});return l(n)};Wg.prototype.getClassName=function(e){let t=this._classIds[e];return this._classes[t].name};var AT=Wg;function hF(e){let t=e.count,n=e.batchTable,i=e.binaryBody,r=e.parseAsPropertyAttributes??!1,o=e.customAttributeOutput,a=aat(n),s;l(a.jsonProperties)&&(s=new Vg({count:t,properties:a.jsonProperties}));let c;l(a.hierarchy)&&(c=new AT({extension:a.hierarchy,binaryBody:i}));let u=Fh.BATCH_TABLE_CLASS_NAME,f=a.binaryProperties,d,p,g;if(r){let A=cat(t,u,f,i,o);g=A.transcodedSchema,p=[new hT({propertyAttribute:A.propertyAttributeJson,class:A.transcodedClass})]}else{let A=sat(t,u,f,i);g=A.transcodedSchema;let b=A.featureTableJson;d=new yd({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 eu({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 Bs(y)}function aat(e){let t=e.HIERARCHY,n=e.extras,i=e.extensions,r;l(t)?(hF._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 sat(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=Yd(p);o[d]={bufferView:s},r[d]=ixe(p),a[s]=g.createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e),s++}let c={classes:{}};c.classes[t]={properties:r};let u=Pl.fromJson(c);return{featureTableJson:{class:t,count:e,properties:o},bufferViewsTypedArrays:a,transcodedSchema:u,transcodedClass:u.classes[t]}}function cat(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=ixe(p);m.name=d,o[g]=m;let y=g.toUpperCase();y.startsWith("_")||(y=`_${y}`);let A=p.typedArray;l(A)||(A=Yd(p).createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e));let b=new xn.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)&&(hF._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=Pl.fromJson(c);return{class:t,propertyAttributeJson:{properties:a},transcodedSchema:u,transcodedClass:u.classes[t]}}function ixe(e){let t=lat(e.componentType);return{type:e.type,componentType:t}}function lat(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"}}hF._deprecationWarning=Ds;hF._oneTimeWarning=pt;var qg=hF;var bT={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,FAILED:4},uat=xn.FeatureIdAttribute,vZ=class extends Ji{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??ki.Y,f=t.forwardAxis??ki.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=bT.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=L.IDENTITY}get texturesLoaded(){return this._gltfLoader?.texturesLoaded}get cacheKey(){}get components(){return this._components}load(){if(l(this._promise))return this._promise;let t=uF.parse(this._arrayBuffer,this._byteOffset),n=t.featureTableJson,i=t.featureTableBinary,r=t.batchTableJson,o=t.batchTableBinary,a=new _m(n,i),s=a.getGlobalProperty("BATCH_LENGTH");this._batchLength=s;let c=a.getGlobalProperty("RTC_CENTER",Y.FLOAT,3);l(c)&&(this._transform=L.fromTranslation(h.fromArray(c))),this._batchTable={json:r,binary:o};let u=new Rf({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=bT.LOADING;let f=this;return this._promise=u.load().then(function(){if(!f.isDestroyed())return f._state=bT.PROCESSING,f}).catch(function(d){if(!f.isDestroyed())return fat(f,d)}),this._promise}process(t){if(this._state===bT.READY)return!0;if(this._state!==bT.PROCESSING||!this._gltfLoader.process(t))return!1;let i=this._gltfLoader.components;return i.transform=L.multiplyTransformation(this._transform,i.transform,i.transform),dat(this,i),this._components=i,this._arrayBuffer=void 0,this._state=bT.READY,!0}unload(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),this._components=void 0,this._arrayBuffer=void 0}};function fat(e,t){return e.unload(),e._state=bT.FAILED,t=e.getError("Failed to load b3dm",t),Promise.reject(t)}function dat(e,t){let n=e._batchTable,i=e._batchLength;if(i===0)return;let r;if(l(n.json))r=qg({count:i,batchTable:n.json,binaryBody:n.binary});else{let s=new eu({name:Fh.BATCH_TABLE_CLASS_NAME,count:i});r=new Bs({schema:{},propertyTables:[s]})}let o=t.scene.nodes,a=o.length;for(let s=0;s<a;s++)rxe(o[s]);t.structuralMetadata=r}function rxe(e){let t=e.children.length;for(let i=0;i<t;i++)rxe(e.children[i]);let n=e.primitives.length;for(let i=0;i<n;i++){let r=e.primitives[i],o=_t.getAttributeBySemantic(r,rt.FEATURE_ID);if(l(o)){o.setIndex=0;let a=new uat;a.propertyTableId=0,a.setIndex=0,a.positionalLabel="featureId_0",r.featureIds.push(a)}}}var mF=vZ;var EZ=class extends Ji{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=Eat(this._geoJson,t),this._geoJson=void 0),!0}unload(){this._components=void 0}};function hat(){this.lines=void 0,this.points=void 0,this.properties=void 0}function mat(){this.features=[]}function SZ(e){let t=e[0],n=e[1],i=e[2]??0;return new h(t,n,i)}function wZ(e){let t=e.length,n=new Array(t);for(let r=0;r<t;r++)n[r]=SZ(e[r]);return[n]}function pat(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=wZ(e[i])[0];return n}function oxe(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=wZ(e[i])[0];return n}function gat(e){let t=e.length,n=[];for(let i=0;i<t;i++){let r=oxe(e[i]);Xn(n,r)}return n}function _at(e){return[SZ(e)]}function yat(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=SZ(e[i]);return n}var Aat={LineString:wZ,MultiLineString:pat,MultiPolygon:gat,Polygon:oxe,MultiPoint:yat,Point:_at},bat={LineString:Re.LINES,MultiLineString:Re.LINES,MultiPolygon:Re.LINES,Polygon:Re.LINES,MultiPoint:Re.POINTS,Point:Re.POINTS};function axe(e,t){if(!l(e.geometry))return;let n=e.geometry.type,i=Aat[n],r=bat[n],o=e.geometry.coordinates;if(!l(i)||!l(o))return;let a=new hat;r===Re.LINES?a.lines=i(o):r===Re.POINTS&&(a.points=i(o)),a.properties=e.properties,t.features.push(a)}function xat(e,t){let n=e.features,i=n.length;for(let r=0;r<i;r++)axe(n[r],t)}var Tat={FeatureCollection:xat,Feature:axe},lH=new h;function Cat(e,t,n){let i=0,r=0,o=e.length;for(let O=0;O<o;O++){let N=e[O];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 O=0;O<o;O++){let N=e[O];if(!l(N.lines))continue;let _=N.lines.length;for(let v=0;v<_;v++){let S=N.lines[v],I=S.length;for(let M=0;M<I;M++){let F=S[M],V=h.fromDegrees(F.x,F.y,F.z,te.WGS84,lH),k=L.multiplyByPoint(t,V,lH);h.minimumByComponent(f,k,f),h.maximumByComponent(d,k,d),h.pack(k,a,p*3),s[p]=O,M<I-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 xn.Attribute;b.semantic=rt.POSITION,b.componentDatatype=Y.FLOAT,b.type=Vt.VEC3,b.count=i,b.min=f,b.max=d,b.buffer=m;let x=new xn.Attribute;x.semantic=rt.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 xn.Material;C.unlit=!0;let E=new xn.Indices;E.indexDatatype=u,E.count=c.length,E.buffer=A;let w=new xn.FeatureIdAttribute;w.featureCount=o,w.propertyTableId=0,w.setIndex=0,w.positionalLabel="featureId_0";let P=[w],R=new xn.Primitive;return R.attributes=T,R.indices=E,R.featureIds=P,R.primitiveType=Re.LINES,R.material=C,R}function vat(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 P=C.points[w],R=h.fromDegrees(P.x,P.y,P.z,te.WGS84,lH),O=L.multiplyByPoint(t,R,lH);h.minimumByComponent(s,O,s),h.maximumByComponent(c,O,c),h.pack(O,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 xn.Attribute;p.semantic=rt.POSITION,p.componentDatatype=Y.FLOAT,p.type=Vt.VEC3,p.count=i,p.min=s,p.max=c,p.buffer=f;let g=new xn.Attribute;g.semantic=rt.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 xn.Material;y.unlit=!0;let A=new xn.FeatureIdAttribute;A.featureCount=r,A.propertyTableId=0,A.setIndex=0,A.positionalLabel="featureId_0";let b=[A],x=new xn.Primitive;return x.attributes=m,x.featureIds=b,x.primitiveType=Re.POINTS,x.material=y,x}function Eat(e,t){let n=new mat,i=Tat[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 O=0;O<o;O++){let _=r[O].properties??H.EMPTY_OBJECT;for(let v in _)_.hasOwnProperty(v)&&(l(a[v])||(a[v]=new Array(o)))}for(let O=0;O<o;O++){let N=r[O];for(let _ in a)if(a.hasOwnProperty(_)){let v=N.properties[_]??"";a[_][O]=v}}let s=new Vg({count:o,properties:a}),u=[new eu({id:0,count:o,jsonMetadataTable:s})],f=Pl.fromJson({}),d=new Bs({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 O=0;O<o;O++){let N=r[O];if(l(N.lines)){m=!0;let _=N.lines.length;for(let v=0;v<_;v++){let S=N.lines[v],I=S.length;for(let M=0;M<I;M++)h.minimumByComponent(p,S[M],p),h.maximumByComponent(g,S[M],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 L),T=L.inverseTransformation(x,new L),C=[];m&&C.push(Cat(r,T,t)),y&&C.push(vat(r,T,t));let E=new xn.Node;E.index=0,E.primitives=C;let w=[E],P=new xn.Scene;P.nodes=w;let R=new xn.Components;return R.scene=P,R.nodes=w,R.transform=x,R.structuralMetadata=d,R}var pF=EZ;var uH={};uH._deprecationWarning=Ds;var dA=Uint32Array.BYTES_PER_ELEMENT;uH.parse=function(e,t){let n=t??0;t=n;let i=new Uint8Array(e),r=new DataView(e);t+=dA;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+=dA;let a=r.getUint32(t,!0);t+=dA;let s=r.getUint32(t,!0);if(s===0)throw new oe("featureTableJsonByteLength is zero, the feature table must be defined.");t+=dA;let c=r.getUint32(t,!0);t+=dA;let u=r.getUint32(t,!0);t+=dA;let f=r.getUint32(t,!0);t+=dA;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+=dA;let p=Co(i,t,s);t+=s;let g=new Uint8Array(e,t,c);t+=c;let m,y;u>0&&(m=Co(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):(uH._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 gF=uH;var Yg={NOT_LOADED:0,LOADING:1,PROCESSING:2,POST_PROCESSING:3,READY:4,FAILED:5,UNLOADED:6},fH=xn.Attribute,Sat=xn.FeatureIdAttribute,cxe=xn.Instances,IZ=class extends Ji{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??ki.Y,f=t.forwardAxis??ki.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=Yg.NOT_LOADED,this._promise=void 0,this._gltfLoader=void 0,this._buffers=[],this._components=void 0,this._transform=L.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=gF.parse(this._arrayBuffer,this._byteOffset),n=t.featureTableJson,i=t.featureTableBinary,r=t.batchTableJson,o=t.batchTableBinary,a=t.gltfFormat,s=new _m(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=L.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=Cu(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 Rf(f);return this._gltfLoader=d,this._state=Yg.LOADING,this._promise=d.load().then(()=>{if(!this.isDestroyed())return this._state=Yg.PROCESSING,this}).catch(p=>{if(!this.isDestroyed())throw wat(this,p)}),this._promise}process(t){if(this._state===Yg.READY)return!0;let n=this._gltfLoader,i=!1;if(this._state===Yg.PROCESSING&&(i=n.process(t)),!i)return!1;let r=n.components;return r.transform=L.multiplyTransformation(this._transform,r.transform,r.transform),Dat(this,r,t),Iat(this,r),this._components=r,this._arrayBuffer=void 0,this._state=Yg.READY,!0}isUnloaded(){return this._state===Yg.UNLOADED}unload(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),Nat(this),this._components=void 0,this._arrayBuffer=void 0,this._state=Yg.UNLOADED}};function wat(e,t){return e.unload(),e._state=Yg.FAILED,e.getError("Failed to load i3dm",t)}function Iat(e,t){let n=e._batchTable,i=e._instancesLength;if(i===0)return;let r;if(l(n.json))r=qg({count:i,batchTable:n.json,binaryBody:n.binary});else{let o=new eu({name:Fh.BATCH_TABLE_CLASS_NAME,count:i});r=new Bs({schema:{},propertyTables:[o]})}t.structuralMetadata=r}var dH=new h,PZ=new Array(4),Pat=new L;function Dat(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=Oat(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,P=new Array(3),R=new L;if(!l(a)||h.equals(h.unpack(a),h.ZERO)){let k=se.fromPoints(m);for(i=0;i<m.length;i++)h.subtract(m[i],k.center,dH),f[3*i+0]=dH.x,f[3*i+1]=dH.y,f[3*i+2]=dH.z;let j=L.fromTranslation(k.center,Pat);t.transform=L.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&&(Mat(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&&(Lat(r,i,w),h.pack(w,P,0),p[3*i+0]=P[0],p[3*i+1]=P[1],p[3*i+2]=P[2]);let k=r.getProperty("BATCH_ID",Y.UNSIGNED_SHORT,1,i);l(k)||(k=i),g[i]=k}let O=new cxe;O.transformInWorldSpace=!0;let N=e._buffers,_=new fH;if(_.name="Instance Translation",_.semantic=Io.TRANSLATION,_.componentDatatype=Y.FLOAT,_.type=Vt.VEC3,_.count=o,_.typedArray=f,!c){let k=Ze.createVertexBuffer({context:n.context,typedArray:f,usage:Oe.STATIC_DRAW});k.vertexArrayDestroyable=!1,N.push(k),_.buffer=k}if(O.attributes.push(_),c){let k=new fH;k.name="Instance Rotation",k.semantic=Io.ROTATION,k.componentDatatype=Y.FLOAT,k.type=Vt.VEC4,k.count=o,k.typedArray=d,O.attributes.push(k)}if(u){let k=new fH;if(k.name="Instance Scale",k.semantic=Io.SCALE,k.componentDatatype=Y.FLOAT,k.type=Vt.VEC3,k.count=o,c)k.typedArray=p;else{let j=Ze.createVertexBuffer({context:n.context,typedArray:p,usage:Oe.STATIC_DRAW});j.vertexArrayDestroyable=!1,N.push(j),k.buffer=j}O.attributes.push(k)}let v=new fH;v.name="Instance Feature ID",v.setIndex=0,v.semantic=Io.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,O.attributes.push(v);let I=new Sat;I.propertyTableId=0,I.setIndex=0,I.positionalLabel="instanceFeatureId_0",O.featureIds.push(I);let M=t.nodes,F=M.length,V=!1;for(i=0;i<F;i++){let k=M[i];k.primitives.length>0&&(k.instances=V?Rat(O):O,V=!0)}}function Rat(e){let t=new cxe;t.transformInWorldSpace=e.transformInWorldSpace;let n=e.attributes,i=n.length;for(let r=0;r<i;r++){let o=Ye(n[r],!1);t.attributes.push(o)}return t.featureIds=e.featureIds,t}function Oat(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 sxe=new Array(4);function Mat(e,t,n,i,r,o,a,s,c,u){let f=e.getProperty("NORMAL_UP",Y.FLOAT,3,n,PZ),d=e.getProperty("NORMAL_RIGHT",Y.FLOAT,3,n,sxe),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,PZ),m=e.getProperty("NORMAL_RIGHT_OCT32P",Y.UNSIGNED_SHORT,2,n,sxe);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),L.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 Lat(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,PZ);l(r)&&(n.x*=r[0],n.y*=r[1],n.z*=r[2])}function Nat(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 _F=IZ;var lxe={NONE:0,REPEAT:1,MIRRORED_REPEAT:2};Object.freeze(lxe);var zu=lxe;var uxe={STOPPED:0,ANIMATING:1};Object.freeze(uxe);var Am=uxe;var BS=xn.AnimatedPropertyType;function DZ(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,Uat(this)}Object.defineProperties(DZ.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 Fat(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 hy({times:e,points:n,inTangents:i,outTangents:r})}function fxe(e,t,n,i){if(e.length===1&&t.length===1)return new CD(t[0]);switch(n){case Wh.STEP:return new P1({times:e,points:t});case Wh.CUBICSPLINE:return Fat(e,t);case Wh.LINEAR:return i===BS.ROTATION?new y1({times:e,points:t}):new dy({times:e,points:t})}}function Bat(e,t,n,i,r){let o=[];if(i===BS.WEIGHTS){let s=t.length/r,c,u;for(c=0;c<r;c++){let f=new Array(s),d=c;if(n===Wh.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(fxe(e,f,n,i))}}else o.push(fxe(e,t,n,i));return o}var kat=new h,zat=new Fe;function Uat(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=Bat(i,r,o,s,u);e._splines=f,e._path=s}DZ.prototype.animate=function(e){let t=this._splines,n=this._path,i=this._runtimeAnimation.model,r=this._runtimeNode;if(n===BS.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===BS.TRANSLATION||n===BS.SCALE?r[n]=o.evaluate(a,kat):n===BS.ROTATION&&(r[n]=o.evaluate(a,zat))}}};var yF=DZ;function RZ(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??zu.NONE,this._animationTime=n.animationTime,this._prevAnimationDelta=void 0,this.start=new be,this.update=new be,this.stop=new be,this._state=Am.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,Vat(this)}Object.defineProperties(RZ.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 Vat(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 yF({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}RZ.prototype.animate=function(e){let t=this._runtimeChannels,n=t.length;for(let i=0;i<n;i++)t[i].animate(e)};var AF=RZ;function Xg(e){this.animationAdded=new be,this.animationRemoved=new be,this.animateWhilePaused=!1,this._model=e,this._runtimeAnimations=[],this._previousTime=void 0}Object.defineProperties(Xg.prototype,{length:{get:function(){return this._runtimeAnimations.length}},model:{get:function(){return this._model}}});function OZ(e,t,n){let i=e._model,r=new AF(i,t,n);return e._runtimeAnimations.push(r),e.animationAdded.raiseEvent(i,r),r}Xg.prototype.add=function(e){e=e??H.EMPTY_OBJECT;let n=this._model.sceneGraph.components.animations,i=e.index;if(l(i))return OZ(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 OZ(this,n[i],e)};Xg.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=OZ(this,n[o],e);i.push(a)}return i};Xg.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};Xg.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])};Xg.prototype.contains=function(e){return l(e)?this._runtimeAnimations.indexOf(e)!==-1:!1};Xg.prototype.get=function(e){return this._runtimeAnimations[e]};var hH=[];function jat(e,t,n){return function(){e.animationRemoved.raiseEvent(t,n)}}Xg.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===zu.REPEAT||s.loop===zu.MIRRORED_REPEAT,y=(d||m&&!l(s.startTime))&&(g<=1||m)&&!p;if(g===s._prevAnimationDelta){let A=s._state===Am.STOPPED;if(y!==A)continue}if(s._prevAnimationDelta=g,y||s._state===Am.ANIMATING){if(y&&s._state===Am.STOPPED&&(s._state=Am.ANIMATING,s.start.numberOfListeners>0&&e.afterRender.push(s._raiseStartEvent)),s.loop===zu.REPEAT)g=g-Math.floor(g);else if(s.loop===zu.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=D.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=Am.STOPPED,s.stop.numberOfListeners>0&&e.afterRender.push(s._raiseStopEvent),s.removeOnStop&&hH.push(s))}}n=hH.length;for(let a=0;a<n;++a){let s=hH[a];t.splice(t.indexOf(s),1),e.afterRender.push(jat(this,o,s))}return hH.length=0,i};var bF=Xg;var MZ=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)}},Qa=MZ;function xT(e){this._model=e.model,this._featureTable=e.featureTable,this._featureId=e.featureId,this._color=void 0}Object.defineProperties(xT.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}}});xT.prototype.hasProperty=function(e){return this._featureTable.hasProperty(this._featureId,e)};xT.prototype.getProperty=function(e){return this._featureTable.getProperty(this._featureId,e)};xT.prototype.getPropertyInherited=function(e){return this._featureTable.hasPropertyBySemantic(this._featureId,e)?this._featureTable.getPropertyBySemantic(this._featureId,e):this._featureTable.getProperty(this._featureId,e)};xT.prototype.getPropertyIds=function(e){return this._featureTable.getPropertyIds(e)};xT.prototype.setProperty=function(e,t){return this._featureTable.setProperty(this._featureId,e,t)};var xF=xT;var kS={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};kS.getStyleCommandsNeeded=function(e,t){return t===0?kS.ALL_OPAQUE:t===e?kS.ALL_TRANSLUCENT:kS.OPAQUE_AND_TRANSLUCENT};Object.freeze(kS);var bm=kS;var Kg={GLTF:"GLTF",TILE_GLTF:"TILE_GLTF",TILE_B3DM:"B3DM",TILE_I3DM:"I3DM",TILE_PNTS:"PNTS",TILE_GEOJSON:"TILE_GEOJSON"};Kg.is3DTiles=function(e){switch(e){case Kg.TILE_GLTF:case Kg.TILE_B3DM:case Kg.TILE_I3DM:case Kg.TILE_PNTS:case Kg.TILE_GEOJSON:return!0;case Kg.GLTF:return!1}};Object.freeze(Kg);var zo=Kg;function ba(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=bm.ALL_OPAQUE,Hat(this)}Object.defineProperties(ba.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 Hat(e){let t=e._model,n=zo.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 Qa(a,r)}else for(r=0;r<i;r++)o[r]=new xF({model:t,featureId:r,featureTable:e});e._features=o,e._featuresLength=i,e._batchTexture=new nu({featuresLength:i,owner:e,statistics:n?t.content.tileset.statistics:void 0})}ba.prototype.update=function(e){this._styleCommandsNeededDirty=!1,this._batchTexture.update(void 0,e);let t=bm.getStyleCommandsNeeded(this._featuresLength,this._batchTexture.translucentFeaturesLength);this._styleCommandsNeeded!==t&&(this._styleCommandsNeededDirty=!0,this._styleCommandsNeeded=t)};ba.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};ba.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};ba.prototype.getShow=function(e){return this._batchTexture.getShow(e)};ba.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};ba.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};ba.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};ba.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};ba.prototype.getFeature=function(e){return this._features[e]};ba.prototype.hasProperty=function(e,t){return this._propertyTable.hasProperty(e,t)};ba.prototype.hasPropertyBySemantic=function(e,t){return this._propertyTable.hasPropertyBySemantic(e,t)};ba.prototype.getProperty=function(e,t){return this._propertyTable.getProperty(e,t)};ba.prototype.getPropertyBySemantic=function(e,t){return this._propertyTable.getPropertyBySemantic(e,t)};ba.prototype.getPropertyIds=function(e){return this._propertyTable.getPropertyIds(e)};ba.prototype.setProperty=function(e,t,n){return this._propertyTable.setProperty(e,t,n)};ba.prototype.isClass=function(e,t){return this._propertyTable.isClass(e,t)};ba.prototype.isExactClass=function(e,t){return this._propertyTable.isExactClass(e,t)};ba.prototype.getExactClassName=function(e){return this._propertyTable.getExactClassName(e)};var Gat=new U;ba.prototype.applyStyle=function(e){if(!l(e)){this.setAllColor(nu.DEFAULT_COLOR_VALUE),this.setAllShow(nu.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,Gat)??nu.DEFAULT_COLOR_VALUE:nu.DEFAULT_COLOR_VALUE,r=l(e.show)?e.show.evaluate(n)??nu.DEFAULT_SHOW_VALUE:nu.DEFAULT_SHOW_VALUE;this.setColor(t,i),this.setShow(t,r)}};ba.prototype.isDestroyed=function(){return!1};ba.prototype.destroy=function(e){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),ue(this)};var TF=ba;var dxe={name:"TilesetPipelineStage"};dxe.process=function(e,t,n){if(t.hasSkipLevelOfDetail(n)){e.shaderBuilder.addDefine("POLYGON_OFFSET",void 0,he.FRAGMENT);let o={u_polygonOffset:function(){return z.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 CF=dxe;var vF=`// 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 EF=`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 hxe={name:"AtmospherePipelineStage"};hxe.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([EF]),i.addFragmentLines([vF]),i.addUniform("bool","u_isInFog",he.FRAGMENT),e.uniformMap.u_isInFog=function(){let r=h.distance(n.camera.positionWC,t.boundingSphere.center);return D.fog(r,n.fog.density)>D.EPSILON3}};var SF=hxe;var wF=`#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 mxe={name:"ImageBasedLightingPipelineStage"},Wat=new z;mxe.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),gm.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(wF);let c={model_iblFactor:function(){return z.multiplyByScalar(i.imageBasedLightingFactor,r?.intensity||1,Wat)},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 IF=mxe;var qat=D.EPSILON16;function NZ(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(NZ.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=D.clamp(e,this.minimumValue,this.maximumValue),D.equalsEpsilon(this._currentValue,e,qat)||(this._currentValue=e,this.runtimeArticulation._dirty=!0)}}});var Yat=new h,LZ=new $;NZ.prototype.applyStageToMatrix=function(e){let t=this.type,n=this.currentValue,i=Yat,r;switch(t){case Wc.XROTATE:r=$.fromRotationX(D.toRadians(n),LZ),e=L.multiplyByMatrix3(e,r,e);break;case Wc.YROTATE:r=$.fromRotationY(D.toRadians(n),LZ),e=L.multiplyByMatrix3(e,r,e);break;case Wc.ZROTATE:r=$.fromRotationZ(D.toRadians(n),LZ),e=L.multiplyByMatrix3(e,r,e);break;case Wc.XTRANSLATE:i.x=n,i.y=0,i.z=0,e=L.multiplyByTranslation(e,i,e);break;case Wc.YTRANSLATE:i.x=0,i.y=n,i.z=0,e=L.multiplyByTranslation(e,i,e);break;case Wc.ZTRANSLATE:i.x=0,i.y=0,i.z=n,e=L.multiplyByTranslation(e,i,e);break;case Wc.XSCALE:i.x=n,i.y=1,i.z=1,e=L.multiplyByScale(e,i,e);break;case Wc.YSCALE:i.x=1,i.y=n,i.z=1,e=L.multiplyByScale(e,i,e);break;case Wc.ZSCALE:i.x=1,i.y=1,i.z=n,e=L.multiplyByScale(e,i,e);break;case Wc.UNIFORMSCALE:e=L.multiplyByUniformScale(e,n,e);break;default:break}return e};var PF=NZ;function mH(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,Xat(this)}Object.defineProperties(mH.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 Xat(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 PF({stage:s,runtimeArticulation:e});r.push(c);let u=s.name;o[u]=c}}mH.prototype.setArticulationStage=function(e,t){let n=this._runtimeStagesByName[e];l(n)&&(n.currentValue=t)};var Kat=new L,$at=new L;mH.prototype.apply=function(){if(!this._dirty)return;this._dirty=!1;let e=L.clone(L.IDENTITY,Kat),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=L.multiplyTransformation(a.originalTransform,e,$at);a.transform=s}};var DF=mH;var RF=`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 zS={name:"ModelColorPipelineStage",COLOR_UNIFORM_NAME:"model_color",COLOR_BLEND_UNIFORM_NAME:"model_colorBlend"};zS.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_COLOR",void 0,he.FRAGMENT),i.addFragmentLines(RF);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",zS.COLOR_UNIFORM_NAME,he.FRAGMENT),r[zS.COLOR_UNIFORM_NAME]=function(){return t.color},i.addUniform("float",zS.COLOR_BLEND_UNIFORM_NAME,he.FRAGMENT),r[zS.COLOR_BLEND_UNIFORM_NAME]=function(){return fl.getColorBlend(t.colorBlendMode,t.colorBlendAmount)},e.uniformMap=Ot(r,e.uniformMap)};var hA=zS;var OF=`#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 pxe={name:"ModelClippingPlanesPipelineStage"},Jat=new z,Zat=new L,Qat=new L;pxe.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),Aa.useFloatTexture(r)&&o.addDefine("USE_CLIPPING_PLANES_FLOAT_TEXTURE",void 0,he.FRAGMENT);let a=Aa.getTextureResolution(i,r,Jat);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(OF);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=L.transpose(r.uniformState.inverseView3D,Zat);return L.multiply(c,t._clippingPlanesMatrix,Qat)}};e.uniformMap=Ot(s,e.uniformMap)};var MF=pxe;var LF=`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 NF=`void modelClippingPolygonsStage()
{
vec2 clippingPosition = v_clippingPosition;
int regionIndex = v_regionIndex;
czm_clipPolygons(model_clippingDistance, CLIPPING_POLYGON_REGIONS_LENGTH, clippingPosition, regionIndex);
}
`;var gxe={name:"ModelClippingPolygonsPipelineStage"};gxe.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(LF),r.addFragmentLines(NF);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 FF=gxe;function _xe(e,t){this._model=e,this._runtimeNode=t}Object.defineProperties(_xe.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 BF=_xe;var kF=`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 zF=`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 UF=`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 pH=new L,est=new L,tst=new L,Axe={name:"InstancingPipelineStage",_getInstanceTransformsAsMatrices:vxe,_transformsToTypedArray:BZ};Axe.process=function(e,t,n){let i=t.instances,r=i.attributes[0].count,o=e.shaderBuilder;o.addDefine("HAS_INSTANCING"),o.addVertexLines(kF);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=[];gst(e,n,i,d,u,f),Ast(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=L.multiplyTransformation(a.modelMatrix,s.components.transform,pH);return u?L.multiplyTransformation(n.context.uniformState.view3D,g,pH):(n.mode!==re.SCENE3D&&(g=mt.basisTo2D(n.mapProjection,g,pH)),L.multiplyTransformation(n.context.uniformState.view,g,pH))},p.u_instance_nodeTransform=function(){return L.multiplyTransformation(s.axisCorrectionMatrix,c.computedTransform,est)},o.addVertexLines(UF)):o.addVertexLines(zF),u){o.addDefine("USE_2D_INSTANCING",void 0,he.VERTEX),o.addUniform("mat4","u_modelView2D",he.VERTEX);let g=n.context,m=L.fromTranslation(c.instancingReferencePoint2D,new L);p.u_modelView2D=function(){return L.multiplyTransformation(g.uniformState.view,m,tst)}}e.uniformMap=Ot(p,e.uniformMap),e.instanceCount=r,Xn(e.attributes,d)};var VF=new L,nst=new h;function ist(e,t,n,i,r){let o=L.multiplyTransformation(t,e,VF);return o=L.multiplyTransformation(o,n,VF),r=mt.basisTo2D(i.mapProjection,o,r),r}function rst(e,t,n,i,r){let o=L.fromTranslation(e,VF),a=L.multiplyTransformation(t,o,VF);a=L.multiplyTransformation(a,n,VF);let s=L.getTranslation(a,nst);return r=sr.computeActualEllipsoidPosition(i,s,r),r}function bxe(e,t,n){let i=e.model,r=i.sceneGraph;e.runtimeNode.node.instances.transformInWorldSpace?(L.multiplyTransformation(i.modelMatrix,r.components.transform,t),L.multiplyTransformation(r.axisCorrectionMatrix,e.runtimeNode.computedTransform,n)):(t=L.clone(r.computedModelMatrix,t),L.multiplyTransformation(t,e.runtimeNode.computedTransform,t),L.clone(L.IDENTITY,n))}var xxe=new L,Txe=new L,ost=new L,ast=new h;function sst(e,t,n,i){let r=xxe,o=Txe;bxe(t,r,o);let s=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let u=0;u<c;u++){let f=e[u],d=ist(f,r,o,n,ost),p=L.getTranslation(d,ast),g=h.subtract(p,s,p);i[u]=L.setTranslation(d,g,i[u])}return i}function cst(e,t,n,i){let r=xxe,o=Txe;bxe(t,r,o);let s=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let u=0;u<c;u++){let f=e[u],d=rst(f,r,o,n,f);i[u]=h.subtract(d,s,i[u])}return i}var lst=new h,ust=new h;function Cxe(e,t){let n=e.runtimeNode,i=e.model.sceneGraph.computedModelMatrix,r=L.multiplyByPoint(i,n.instancingTranslationMin,lst),o=sr.computeActualEllipsoidPosition(t,r,r),a=L.multiplyByPoint(i,n.instancingTranslationMax,ust),s=sr.computeActualEllipsoidPosition(t,a,a);n.instancingReferencePoint2D=h.lerp(o,s,.5,new h)}function BZ(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 fst(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 dst=new h,hst=new Fe,mst=new h;function vxe(e,t,n){let i=new Array(t),r=_t.getAttributeBySemantic(e,Io.TRANSLATION),o=_t.getAttributeBySemantic(e,Io.ROTATION),a=_t.getAttributeBySemantic(e,Io.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],dst);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,hst),T=new h(m[A*3],m[A*3+1],m[A*3+2],mst),C=L.fromTranslationQuaternionRotationScale(b,x,T,new L);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 pst(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 kZ(e,t){let n=Ze.createVertexBuffer({context:t.context,typedArray:e,usage:Oe.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}function gst(e,t,n,i,r,o){let a=_t.getAttributeBySemantic(n,Io.ROTATION);l(a)||o?_st(e,n,i,t,r,o):yst(e,n,i,t,r)}function _st(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=vxe(t,s,e);let A=BZ(d);p=kZ(A,i),c._modelResources.push(p),o&&(u.transformsTypedArray=A),u.instancingTransformsBuffer=p}if(yxe(e,p,n,f),!r)return;let g=Ye(i);g.mode=re.COLUMBUS_VIEW,Cxe(e,g);let m=u.instancingTransformsBuffer2D;if(!l(m)){let A=sst(d,e,g,d),b=BZ(A);m=kZ(b,i),c._modelResources.push(m),u.instancingTransformsBuffer2D=m}yxe(e,m,n,"Transform2D")}function yst(e,t,n,i,r,o){let a=e.shaderBuilder,s=e.runtimeNode,c=_t.getAttributeBySemantic(t,Io.TRANSLATION),u=_t.getAttributeBySemantic(t,Io.SCALE);if(l(u)&&(a.addDefine("HAS_INSTANCE_SCALE"),FZ(e,u.buffer,u.byteOffset,u.byteStride,n,"Scale")),!l(c))return;let f,d=c.typedArray;if(l(d)?f=pst(c,c.count,e):l(s.instancingTranslationMin)||(s.instancingTranslationMin=c.min,s.instancingTranslationMax=c.max),a.addDefine("HAS_INSTANCE_TRANSLATION"),FZ(e,c.buffer,c.byteOffset,c.byteStride,n,"Translation"),!r&&!o)return;let g=Ye(i);g.mode=re.COLUMBUS_VIEW,Cxe(e,g);let m=s.instancingTranslationBuffer2D;if(!l(m)){let x=cst(f,e,g,f),T=fst(x);o&&(s.transformsTypedArray=T),m=kZ(T,i),e.model._modelResources.push(m),s.instancingTranslationBuffer2D=m}if(!r)return;FZ(e,m,0,void 0,n,"Translation2D")}function yxe(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 FZ(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 Ast(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===Io.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 jF=Axe;var zZ={};zZ.name="ModelMatrixUpdateStage";zZ.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;Exe(e,t,r,e.transformToRoot),e._transformDirty=!1}};function bst(e,t,n){e.modelMatrix=L.multiplyTransformation(t,n,e.modelMatrix),e.cullFace=_t.getCullFace(e.modelMatrix,e.primitiveType)}function Exe(e,t,n,i){let r;i=L.multiplyTransformation(i,e.transform,new L),e.updateComputedTransform();let o=e.runtimePrimitives.length;for(r=0;r<o;r++){let s=e.runtimePrimitives[r];bst(s.drawCommand,n,i)}let a=e.children.length;for(r=0;r<a;r++){let s=t._runtimeNodes[e.children[r]];s._transformToRoot=L.clone(i,s._transformToRoot),Exe(s,t,n,i),s._transformDirty=!1}}var HF=zZ;var Sxe={name:"NodeStatisticsPipelineStage",_countInstancingAttributes:wxe,_countGeneratedBuffers:Ixe};Sxe.process=function(e,t,n){let i=e.model.statistics,r=t.instances,o=e.runtimeNode;wxe(i,r),Ixe(i,o)};function wxe(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 Ixe(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 GF=Sxe;function US(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=L.clone(n,this._originalTransform),this._transform=L.clone(n,this._transform),this._transformToRoot=L.clone(i,this._transformToRoot),this._computedTransform=new L,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,xst(this)}Object.defineProperties(US.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=L.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),UZ(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),UZ(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),UZ(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 xst(e){let t=e.transform,n=e.transformToRoot,i=e._computedTransform;e._computedTransform=L.multiply(n,t,i);let r=e.node;l(r.matrix)||(e._transformParameters=new Ky(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 UZ(e,t){e._transformDirty=!0,e._transform=L.fromTranslationRotationScale(t,e._transform)}US.prototype.getChild=function(e){return this.sceneGraph._runtimeNodes[this.children[e]]};US.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(jF),t.push(GF),n.push(HF)};US.prototype.updateComputedTransform=function(){this._computedTransform=L.multiply(this._transformToRoot,this._transform,this._computedTransform)};US.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 L);let o=L.multiplyTransformation(this.transformToRoot,this.transform,t[r]),a=L.inverseTransformation(o,t[r]);t[r]=L.multiplyTransformation(a,n[r],t[r])}};var WF=US;var Pxe={name:"AlphaPipelineStage"};Pxe.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=Qt.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 qF=Pxe;var Dxe={name:"BatchTexturePipelineStage"};Dxe.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 YF=Dxe;var Rxe={name:"ClassificationPipelineStage"};Rxe.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_CLASSIFICATION",void 0,he.BOTH);let r=e.runtimePrimitive;l(r.batchLengths)||Tst(t,r)};function Tst(e,t){let n=_t.getAttributeBySemantic(e,rt.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,rt.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 XF=Rxe;var KF=`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 $F=`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 Oxe={name:"CPUStylingPipelineStage"};Oxe.process=function(e,t,n){let i=e.model,r=e.shaderBuilder;r.addVertexLines(KF),r.addFragmentLines($F),r.addDefine("USE_CPU_STYLING",void 0,he.BOTH),l(i.color)||(r.addUniform("float",hA.COLOR_BLEND_UNIFORM_NAME,he.FRAGMENT),e.uniformMap[hA.COLOR_BLEND_UNIFORM_NAME]=function(){return fl.getColorBlend(i.colorBlendMode,i.colorBlendAmount)}),r.addUniform("bool","model_commandTranslucent",he.BOTH),e.uniformMap.model_commandTranslucent=function(){return e.alphaOptions.pass===Pe.TRANSLUCENT}};var JF=Oxe;var VZ={MODIFY_MATERIAL:"MODIFY_MATERIAL",REPLACE_MATERIAL:"REPLACE_MATERIAL"};VZ.getDefineName=function(e){return`CUSTOM_SHADER_${e}`};Object.freeze(VZ);var $g=VZ;var ZF=`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 QF=`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 eB=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) {
initializeFeatureIds(featureIds, attributes);
initializeFeatureIdAliases(featureIds);
}
`;var tB=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes)
{
initializeFeatureIds(featureIds, attributes);
initializeFeatureIdAliases(featureIds);
setFeatureIdVaryings();
}
`;var cr={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()"};cr.process=function(e,t,n){let i=e.shaderBuilder;Cst(i);let r=e.runtimeNode.node.instances;l(r)&&vst(e,r,n),Est(e,t,n),i.addVertexLines(tB),i.addFragmentLines(eB)};function Cst(e){e.addStruct(cr.STRUCT_ID_FEATURE_IDS_VS,cr.STRUCT_NAME_FEATURE_IDS,he.VERTEX),e.addStruct(cr.STRUCT_ID_FEATURE_IDS_FS,cr.STRUCT_NAME_FEATURE_IDS,he.FRAGMENT),e.addFunction(cr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,cr.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,he.VERTEX),e.addFunction(cr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,cr.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,he.FRAGMENT),e.addFunction(cr.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,cr.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,he.VERTEX),e.addFunction(cr.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,cr.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,he.FRAGMENT),e.addFunction(cr.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,cr.FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS,he.VERTEX)}function vst(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 xn.FeatureIdAttribute?Sst(e,a,s):Mxe(e,a,s,r,1,n);let c=a.label;l(c)&&Lxe(e,s,c,he.BOTH)}}function Est(e,t,n){let i=t.featureIds,o=_t.getAttributeBySemantic(t,rt.POSITION).count;for(let a=0;a<i.length;a++){let s=i[a],c=s.positionalLabel,u=he.BOTH;s instanceof xn.FeatureIdAttribute?wst(e,s,c):s instanceof xn.FeatureIdImplicitRange?Mxe(e,s,c,o,void 0,n):(Ist(e,s,c,a,n),u=he.FRAGMENT);let f=s.label;l(f)&&Lxe(e,c,f,u)}}function Sst(e,t,n){let i=e.shaderBuilder;i.addStructField(cr.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(cr.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(cr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[c]),i.addFunctionLines(cr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[u]),i.addVarying("float",s),i.addFunctionLines(cr.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${s} = ${a};`])}function wst(e,t,n){let i=e.shaderBuilder;i.addStructField(cr.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(cr.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(cr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,a),i.addFunctionLines(cr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,a)}function Mxe(e,t,n,i,r,o){Pst(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(cr.STRUCT_ID_FEATURE_IDS_VS,"int",n),a.addStructField(cr.STRUCT_ID_FEATURE_IDS_FS,"int",n),a.addFunctionLines(cr.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${c} = ${s};`]),a.addFunctionLines(cr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[`featureIds.${n} = int(czm_round(${s}));`]),a.addFunctionLines(cr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[`featureIds.${n} = int(czm_round(${c}));`])}function Ist(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(cr.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(cr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[y])}function Lxe(e,t,n,i){let r=e.shaderBuilder,o=he.includesVertexShader(i);o&&r.addStructField(cr.STRUCT_ID_FEATURE_IDS_VS,"int",n),r.addStructField(cr.STRUCT_ID_FEATURE_IDS_FS,"int",n);let a=[`featureIds.${n} = featureIds.${t};`];o&&r.addFunctionLines(cr.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,a),r.addFunctionLines(cr.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,a)}function Pst(e,t,n,i,r){let o=e.model,a,s;if(l(t.repeat)){let u=Dst(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 Dst(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 mA=cr;var nB=`void metadataStage(
FeatureIds featureIds,
out Metadata metadata,
out MetadataClass metadataClass,
out MetadataStatistics metadataStatistics,
ProcessedAttributes attributes
)
{
initializeMetadata(featureIds, metadata, metadataClass, metadataStatistics, attributes);
}
`;var iB=`void metadataStage(
FeatureIds featureIds,
out Metadata metadata,
out MetadataClass metadataClass,
out MetadataStatistics metadataStatistics,
ProcessedAttributes attributes
)
{
initializeMetadata(featureIds, metadata, metadataClass, metadataStatistics, attributes);
setMetadataVaryings();
}
`;var Ei={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"}]};Ei.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=Kst(r,t),f=Rst(o.propertyAttributes,t,s),d=Mst(o.propertyTextures,s),p=Fst(o.propertyTables,t,e,s,u),g=f.concat(d).concat(p);zst(i,g),jst(i),i.addVertexLines(iB),i.addFragmentLines(nB);for(let m=0;m<f.length;m++){let y=f[m];Hst(e,y)}for(let m=0;m<d.length;m++){let y=d[m];Wst(e,y,c)}for(let m=0;m<p.length;m++){let y=p[m];Yst(e,y,c)}};function Rst(e,t,n){return l(e)?e.flatMap(i=>Ost(i,t,n)):[]}function Ost(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 Mst(e,t){return l(e)?e.flatMap(n=>Lst(n,t)):[]}function Lst(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 Nst=4;function Fst(e,t,n,i,r){if(!l(e))return[];let o=kst(n,t);return e.filter(a=>l(a.class)&&o.has(String(a.id))).flatMap(a=>Bst(a,o,i,r))}function Bst(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(Nst))continue;let y=u[g],A=he.intersection(Zst(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 kst(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 zst(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=Ei.METADATA_CLASS_FIELDS;for(let s of n){let c=`${s}MetadataClass`;a(c,s,r)}let o=Ei.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"?Vst(c):c;e.addStructField(s,p,d)}}}var Ust={int:"float",ivec2:"vec2",ivec3:"vec3",ivec4:"vec4"};function Vst(e){let t=Ust[e];return l(t)?t:e}function jst(e){e.addStruct(Ei.STRUCT_ID_METADATA_VS,Ei.STRUCT_NAME_METADATA,he.VERTEX),e.addStruct(Ei.STRUCT_ID_METADATA_FS,Ei.STRUCT_NAME_METADATA,he.FRAGMENT),e.addStruct(Ei.STRUCT_ID_METADATA_CLASS_VS,Ei.STRUCT_NAME_METADATA_CLASS,he.VERTEX),e.addStruct(Ei.STRUCT_ID_METADATA_CLASS_FS,Ei.STRUCT_NAME_METADATA_CLASS,he.FRAGMENT),e.addStruct(Ei.STRUCT_ID_METADATA_STATISTICS_VS,Ei.STRUCT_NAME_METADATA_STATISTICS,he.VERTEX),e.addStruct(Ei.STRUCT_ID_METADATA_STATISTICS_FS,Ei.STRUCT_NAME_METADATA_STATISTICS,he.FRAGMENT),e.addFunction(Ei.FUNCTION_ID_INITIALIZE_METADATA_VS,Ei.FUNCTION_SIGNATURE_INITIALIZE_METADATA,he.VERTEX),e.addFunction(Ei.FUNCTION_ID_INITIALIZE_METADATA_FS,Ei.FUNCTION_SIGNATURE_INITIALIZE_METADATA,he.FRAGMENT),e.addFunction(Ei.FUNCTION_ID_SET_METADATA_VARYINGS,Ei.FUNCTION_SIGNATURE_SET_METADATA_VARYINGS,he.VERTEX)}function Hst(e,t){Gst(e,t),jZ(e.shaderBuilder,t),HZ(e.shaderBuilder,t)}function Gst(e,t){let{shaderBuilder:n}=e,{metadataVariable:i,property:r,glslType:o}=t,a=GZ({valueExpression:`attributes.${t.variableName}`,renderResources:e,glslType:o,metadataVariable:i,shaderDestination:he.BOTH,property:r});n.addStructField(Ei.STRUCT_ID_METADATA_VS,o,i),n.addStructField(Ei.STRUCT_ID_METADATA_FS,o,i);let s=`metadata.${i} = ${a};`;n.addFunctionLines(Ei.FUNCTION_ID_INITIALIZE_METADATA_VS,[s]),n.addFunctionLines(Ei.FUNCTION_ID_INITIALIZE_METADATA_FS,[s])}function Wst(e,t,n){qst(e,t,n),jZ(e.shaderBuilder,t),HZ(e.shaderBuilder,t)}function qst(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(Ei.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=GZ({valueExpression:T,renderResources:e,glslType:a,metadataVariable:o,shaderDestination:he.FRAGMENT,property:s}),E=`metadata.${o} = ${C};`;m.push(E),i.addFunctionLines(Ei.FUNCTION_ID_INITIALIZE_METADATA_FS,m)}function jZ(e,t){let n=t.classProperty,{metadataVariable:i,glslType:r,shaderDestination:o}=t,a=Nxe(Ei.METADATA_CLASS_FIELDS,n,`metadataClass.${i}`,r),s=`${r}MetadataClass`;e.addStructField(Ei.STRUCT_ID_METADATA_CLASS_FS,s,i),e.addFunctionLines(Ei.FUNCTION_ID_INITIALIZE_METADATA_FS,a),he.includesVertexShader(o)&&(e.addStructField(Ei.STRUCT_ID_METADATA_CLASS_VS,s,i),e.addFunctionLines(Ei.FUNCTION_ID_INITIALIZE_METADATA_VS,a))}function HZ(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=Ei.METADATA_STATISTICS_FIELDS,s=`metadataStatistics.${i}`,c=Nxe(a,n,s,o),u=`${o}MetadataStatistics`;e.addStructField(Ei.STRUCT_ID_METADATA_STATISTICS_FS,u,i),e.addFunctionLines(Ei.FUNCTION_ID_INITIALIZE_METADATA_FS,c),he.includesVertexShader(t.shaderDestination)&&(e.addStructField(Ei.STRUCT_ID_METADATA_STATISTICS_VS,u,i),e.addFunctionLines(Ei.FUNCTION_ID_INITIALIZE_METADATA_VS,c))}function Yst(e,t,n){Xst(e,t,n),jZ(e.shaderBuilder,t),HZ(e.shaderBuilder,t)}function Xst(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(Ei.STRUCT_ID_METADATA_VS,a,o),he.includesFragmentShader(g)&&i.addStructField(Ei.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=GZ({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(Ei.FUNCTION_ID_INITIALIZE_METADATA_VS,p),he.includesFragmentShader(g)&&i.addFunctionLines(Ei.FUNCTION_ID_INITIALIZE_METADATA_FS,p)}function Nxe(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 GZ(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 Kst(e,t){let n=new Set,i=new Set;return $st(e,n,i),Jst(e,t,n,i),{usedInVertex:n,usedInFragment:i}}function $st(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 Jst(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 Zst(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 Xd=Ei;var Fxe={INHERIT:0,OPAQUE:1,TRANSLUCENT:2};Object.freeze(Fxe);var pA=Fxe;var ks={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};ks.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===pA.TRANSLUCENT?o.pass=Pe.TRANSLUCENT:c===pA.OPAQUE&&(o.pass=void 0);let u=act(a,t,e);if(!u.customShaderEnabled)return;if(uct(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=$g.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 Qst(e){let t={};for(let n=0;n<e.length;n++){let i=_t.getAttributeInfo(e[n]);t[i.variableName]=i}return t}var ect={position:"vec3",normal:"vec3",tangent:"vec3",bitangent:"vec3",texCoord:"vec2",color:"vec4",joints:"ivec4",weights:"vec4"},tct={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 Bxe(e){let t=e.replace(/_[0-9]+$/,"");t=t.replace(/(MC|EC)$/,"");let n=ect[t],i=tct[t];if(l(n))return{attributeField:[n,e],value:i}}function nct(e,t,n){if(!l(e.vertexShaderText))return{enabled:!1};let i=e.usedVariablesVertex;if(!Uxe(i.metadataSet,n))return{enabled:!1};let r=i.attributeSet,o=kxe(t,r,!1),a=zxe(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=Bxe(d);if(!l(p))return ks._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 ict(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 rct(e,t,n){if(!l(e.fragmentShaderText))return{enabled:!1};let i=e.usedVariablesFragment;if(!Uxe(i.metadataSet,n))return{enabled:!1};let r=i.attributeSet,o=kxe(t,r,!0),a=zxe(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=Bxe(p);if(!l(g))return ks._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=ict(e);return{enabled:!0,attributeFields:c.concat(f.attributeFields),initializationLines:f.initializationLines.concat(u)}}var oct={positionWC:!0,positionEC:!0};function kxe(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 zxe(e,t,n){let i=[];for(let r in t){if(!t.hasOwnProperty(r)||oct.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 act(e,t,n){let i=Qst(t.attributes),r=fct(t,n.model.structuralMetadata),o=nct(e,i,r),a=rct(e,i,r),c=e.usedVariablesFragment.attributeSet.hasOwnProperty("positionWC")&&a.enabled;return{vertexLines:o,fragmentLines:a,customShaderEnabled:o.enabled||a.enabled,shouldComputePositionWC:c}}function sct(e,t){let n=ks.STRUCT_ID_ATTRIBUTES_VS;e.addStruct(n,ks.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=ks.STRUCT_ID_VERTEX_INPUT,e.addStruct(n,ks.STRUCT_NAME_VERTEX_INPUT,he.VERTEX),e.addStructField(n,ks.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,mA.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,Xd.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,Xd.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,Xd.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let o=ks.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS;e.addFunction(o,ks.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS,he.VERTEX),e.addFunctionLines(o,r)}function cct(e,t){let n=ks.STRUCT_ID_ATTRIBUTES_FS;e.addStruct(n,ks.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=ks.STRUCT_ID_FRAGMENT_INPUT,e.addStruct(n,ks.STRUCT_NAME_FRAGMENT_INPUT,he.FRAGMENT),e.addStructField(n,ks.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,mA.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,Xd.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,Xd.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,Xd.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let o=ks.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS;e.addFunction(o,ks.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS,he.FRAGMENT),e.addFunctionLines(o,r)}var lct=[];function uct(e,t,n){let{vertexLines:i,fragmentLines:r}=n,o=lct;i.enabled&&(sct(e,i),o.length=0,o.push("#line 0",t.vertexShaderText,ZF),e.addVertexLines(o)),r.enabled&&(cct(e,r),o.length=0,o.push("#line 0",t.fragmentShaderText,QF),e.addFragmentLines(o))}function fct(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 Uxe(e,t){for(let n in e)if(e.hasOwnProperty(n)&&!t.has(n))return ks._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 rB=ks;var oB={name:"DequantizationPipelineStage",FUNCTION_ID_DEQUANTIZATION_STAGE_VS:"dequantizationStage",FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS:"void dequantizationStage(inout ProcessedAttributes attributes)"};oB.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(oB.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,oB.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===rt.POSITION,d=c.semantic===rt.TEXCOORD;if(o&&!f&&!d)continue;let p=_t.getAttributeInfo(c);hct(i,p),dct(e,p)}};function dct(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=Vxe(u,0),f=Vxe(f,1)),i[a]=function(){return u},i[s]=function(){return f}}}function Vxe(e,t){return e instanceof ae?e:new ae(e.x,e.y,e.z,t)}function hct(e,t){let n=t.variableName,i=t.attribute.quantization,r;i.octEncoded?r=mct(n,i):r=pct(n),e.addFunctionLines(oB.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,[r])}function mct(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 pct(e){let t=`attributes.${e}`,n=`a_quantized_${e}`,i=`model_quantizedVolumeOffset_${e}`,r=`model_quantizedVolumeStepSize_${e}`;return`${t} = ${i} + ${n} * ${r};`}var aB=oB;var sB=`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 jxe={name:"EdgeDetectionPipelineStage"};jxe.process=function(e){e.shaderBuilder.addFragmentLines([sB])};var cB=jxe;var lB=`// 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 uB=`#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 WZ=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 P=0;P<r;++P)A[E*r+P]=T[P]}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 z;for(let s=0;s<n;s++)z.unpack(t,s*2,a),z.multiplyComponents(a,i,a),z.add(a,r,a),z.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),L.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 L,modelMatrix:new L,computedModelMatrix:new L},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=L.clone(t.computedTransform,r.nodeComputedTransform),s=L.clone(n.computedModelMatrix,r.modelMatrix),c=o.instances;l(c)&&c.transformInWorldSpace&&(s=L.multiplyTransformation(i.modelMatrix,n.components.transform,s),a=L.multiplyTransformation(n.axisCorrectionMatrix,t.computedTransform,a));let u=L.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?(L.multiplyTransformation(g,i,g),L.multiplyTransformation(r,g,g)):L.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,rt.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 L(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,Io.TRANSLATION),o=_t.getAttributeBySemantic(t,Io.ROTATION),a=_t.getAttributeBySemantic(t,Io.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=L.fromTranslationQuaternionRotationScale(m,y,A,new L);i.push(b)}}},ys=WZ;var VS=Object.freeze({HIDDEN:0,SILHOUETTE:1,HARD:2,REPEATED_HARD:3}),Hxe={name:"EdgeVisibilityPipelineStage"};Hxe.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(lB),i.addVertexLines(uB),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=_ct(t);if(!l(p)||!l(p.edgeIndices)||p.edgeIndices.length===0)return;let g=e.runtimePrimitive.primitive,m=yct(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=gct(p.edgeIndices,p.edgeData,t.edgeVisibility),w=Act(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 P=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:P}};function gct(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!==VS.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 _ct(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 P,R;w===0?(P=T,R=C):w===1?(P=C,R=E):(P=E,R=T);let O=Math.floor(y/4),N=y%4*2;if(y++,O>=b.length)break;let v=b[O]>>N&3;if(v===VS.HIDDEN)continue;let S=Math.min(P,R),I=Math.max(P,R),M=`${S},${I}`;if(p.has(M))continue;p.add(M),f.push(P,R);let F=-1;v===VS.SILHOUETTE&&(F=g,g++),d.push({edgeType:v===VS.REPEATED_HARD?VS.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 P=C,R=w;if(C=w,P===R||a>0&&(P<0||P>=a||R<0||R>=a))continue;let O=Math.min(P,R),N=Math.max(P,R),_=`${O},${N}`;p.has(_)||(p.add(_),f.push(P,R),d.push({edgeType:VS.HARD,silhouetteEdgeIndex:-1,color:l(T)?T:void 0}))}}return{edgeIndices:f,edgeData:d,silhouetteEdgeCount:g}}function yct(e){if(!l(e))return;let t=_t.getAttributeBySemantic(e,rt.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=ys.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 Act(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,rt.POSITION),E=l(C.typedArray)?C.typedArray:ys.readAttributeAsTypedArray(C),w=new Float32Array(x*3),P=new Float32Array(x),R=new Float32Array(x*3),O=new Float32Array(x*3),N=new Float32Array(x*3),_=new Float32Array(x),v=l(m),S=v?new Float32Array(x):void 0,I;v&&(I=l(m.typedArray)?m.typedArray:ys.readAttributeAsTypedArray(m));let M=l(c),F=M?new Float32Array(x*4):void 0,V=l(d)?d.colors:void 0,k=l(d)?d.count:0;function j(Ke){if(!M)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(!M)return;let We=Ke*4,vt=l(we.x)?we.x:we[0],ct=l(we.y)?we.y:we[1],pn=l(we.z)?we.z:we[2],Ht=l(we.w)?we.w:l(we[3])?we[3]:1;F[We]=vt,F[We+1]=ct,F[We+2]=pn,F[We+3]=Ht}function G(Ke,we){if(!M)return;if(we>=k){j(Ke);return}let We=we*4,vt=Ke*4;F[vt]=V[We],F[vt+1]=V[We+1],F[vt+2]=V[We+2],F[vt+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,pn=E[we*3],Ht=E[we*3+1],bt=E[we*3+2],Dt=E[We*3],Pn=E[We*3+1],ot=E[We*3+2],dt=Ke*4;w[dt*3]=pn,w[dt*3+1]=Ht,w[dt*3+2]=bt,N[dt*3]=Dt,N[dt*3+1]=Pn,N[dt*3+2]=ot,_[dt]=-1,P[dt]=ct,w[(dt+1)*3]=pn,w[(dt+1)*3+1]=Ht,w[(dt+1)*3+2]=bt,N[(dt+1)*3]=Dt,N[(dt+1)*3+1]=Pn,N[(dt+1)*3+2]=ot,_[dt+1]=1,P[dt+1]=ct,w[(dt+2)*3]=Dt,w[(dt+2)*3+1]=Pn,w[(dt+2)*3+2]=ot,N[(dt+2)*3]=pn,N[(dt+2)*3+1]=Ht,N[(dt+2)*3+2]=bt,_[dt+2]=1,P[dt+2]=ct,w[(dt+3)*3]=Dt,w[(dt+3)*3+1]=Pn,w[(dt+3)*3+2]=ot,N[(dt+3)*3]=pn,N[(dt+3)*3+1]=Ht,N[(dt+3)*3+2]=bt,_[dt+3]=-1,P[dt+3]=ct;let Si=t[Ke].color;if(l(Si))for(let En=0;En<4;En++)B(dt+En,Si);else if(l(V))for(let En=0;En<4;En++)G(dt+En,we);else for(let En=0;En<4;En++)j(dt+En);if(v){let En=I[we],ii=I[We];S[dt]=En,S[dt+1]=En,S[dt+2]=ii,S[dt+3]=ii}let wn=Ke*6,Ni=g[wn],dr=g[wn+1],Fi=g[wn+2],Yi=g[wn+3],ai=g[wn+4],ni=g[wn+5];for(let En=0;En<4;En++)R[(dt+En)*3]=Ni,R[(dt+En)*3+1]=dr,R[(dt+En)*3+2]=Fi,O[(dt+En)*3]=Yi,O[(dt+En)*3+1]=ai,O[(dt+En)*3+2]=ni}let W=Ze.createVertexBuffer({context:i,typedArray:w,usage:Oe.STATIC_DRAW}),Q=Ze.createVertexBuffer({context:i,typedArray:P,usage:Oe.STATIC_DRAW}),q=Ze.createVertexBuffer({context:i,typedArray:R,usage:Oe.STATIC_DRAW}),J=Ze.createVertexBuffer({context:i,typedArray:O,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=M?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}];M&&$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 Xe=n.runtimePrimitive.primitive;if(l(Xe.featureIds)&&Xe.featureIds.length>0){let Ke=Xe.featureIds[0];if(l(Ke.setIndex)){let we=Xe.attributes.find(We=>We.semantic===rt.FEATURE_ID&&We.setIndex===Ke.setIndex);if(l(we)){let We=l(we.typedArray)?we.typedArray:ys.readAttributeAsTypedArray(we),vt=new Float32Array(x);for(let pn=0;pn<A;pn++){let Ht=e[pn*2],bt=Ht<We.length?We[Ht]:0;for(let Dt=0;Dt<4;Dt++)vt[pn*4+Dt]=bt}let ct=Ze.createVertexBuffer({context:i,typedArray:vt,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(Xe.featureIds)&&Xe.featureIds.length>0}}var fB=Hxe;var dB=`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 hB=`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 jS=`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 mB={name:"SelectedFeatureIdPipelineStage",STRUCT_ID_SELECTED_FEATURE:"SelectedFeature",STRUCT_NAME_SELECTED_FEATURE:"SelectedFeature"};mB.process=function(e,t,n){let i=e.shaderBuilder;e.hasPropertyTable=!0;let r=e.model,o=e.runtimeNode.node,a=bct(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),xct(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(jS),i.addFragmentLines(jS)};function Gxe(e){return e instanceof xn.FeatureIdTexture?"HAS_SELECTED_FEATURE_ID_TEXTURE":"HAS_SELECTED_FEATURE_ID_ATTRIBUTE"}function Wxe(e){return e instanceof xn.FeatureIdTexture?he.FRAGMENT:he.BOTH}function bct(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:Wxe(r),featureIdDefine:Gxe(r)}):(r=_t.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),i=r.label??r.positionalLabel,{featureIds:r,variableName:i,shaderDestination:Wxe(r),featureIdDefine:Gxe(r)})}function xct(e){e.addStructField(mB.STRUCT_ID_SELECTED_FEATURE,"int","id"),e.addStructField(mB.STRUCT_ID_SELECTED_FEATURE,"vec2","st"),e.addStructField(mB.STRUCT_ID_SELECTED_FEATURE,"vec4","color")}var gA=mB;var zs={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)"};zs.process=function(e,t,n){let{shaderBuilder:i,model:r}=e;i.addStruct(zs.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"ProcessedAttributes",he.VERTEX),i.addStruct(zs.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"ProcessedAttributes",he.FRAGMENT),i.addStruct(gA.STRUCT_ID_SELECTED_FEATURE,gA.STRUCT_NAME_SELECTED_FEATURE,he.BOTH),i.addFunction(zs.FUNCTION_ID_INITIALIZE_ATTRIBUTES,zs.FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES,he.VERTEX),i.addVarying("vec3","v_positionWC"),i.addVarying("vec3","v_positionEC"),i.addStructField(zs.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionWC"),i.addStructField(zs.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionEC"),i.addFunction(zs.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,zs.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,he.VERTEX),i.addFunction(zs.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,zs.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,he.FRAGMENT),r.type===zo.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===rt.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;Tct(e,f,g,d,o,a,m)}Rct(i,t.attributes),t.primitiveType===Re.POINTS&&i.addDefine("PRIMITIVE_TYPE_POINTS"),i.addVertexLines(hB),i.addFragmentLines(dB)};function Tct(e,t,n,i,r,o,a){let s=e.shaderBuilder,c=_t.getAttributeInfo(t),u=r&&!o;i>1?Ect(e,t,n,i):vct(e,t,n,u),wct(s,c,u),Sct(s,c,a),l(t.semantic)&&Cct(s,t),Ict(s,c,r),Pct(s,c,u),Dct(s,c)}function Cct(e,t){let{semantic:n,setIndex:i}=t;switch(n){case rt.NORMAL:e.addDefine("HAS_NORMALS");break;case rt.TANGENT:e.addDefine("HAS_TANGENTS");break;case rt.FEATURE_ID:e.addDefine(`HAS${n}_${i}`);break;case rt.TEXCOORD:case rt.COLOR:e.addDefine(`HAS_${n}_${i}`)}}function vct(e,t,n,i){let{quantization:r,semantic:o,setIndex:a}=t,{type:s,componentDatatype:c}=l(r)?r:t;o===rt.FEATURE_ID&&a>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=a+1);let u=o===rt.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 Ect(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 Sct(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 wct(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===rt.POSITION;s?e.setPositionAttribute(a,o):e.addAttribute(a,o),s&&n&&e.addAttribute("vec3","a_position2D")}function Ict(e,t,n){let i=zs.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,r=zs.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 Pct(e,t,n){let i=zs.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 Dct(e,t){let{semantic:n,setIndex:i}=t.attribute;if(l(n)&&!l(i))return;let r=zs.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,o=t.variableName,a=`v_${o} = attributes.${o};`;e.addFunctionLines(r,[a]),r=zs.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,a=`attributes.${o} = v_${o};`,e.addFunctionLines(r,[a])}function Rct(e,t){let n=!1,i=!1;for(let r=0;r<t.length;r++){let o=t[r];o.semantic===rt.NORMAL?n=!0:o.semantic===rt.TANGENT&&(i=!0)}!n||!i||(e.addDefine("HAS_BITANGENTS"),e.addVarying("vec3","v_bitangentEC"),e.addStructField(zs.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"vec3","bitangentMC"),e.addStructField(zs.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","bitangentEC"))}var pB=zs;var qZ,qxe="AAPTa7BPWL4PoZRFPJ2CM2YRclg..ub1vMOBXctC7ozMMKNnmx3ZwVTsDJAXo2GLomQ2CZjuOc2HLr1-CryeuRo9ZsV65cuZ9xN1yFKeLTu7Cxld7B97aI28os_NnuC9nvWde_l4G1DTApSHmhrVoZfKgO0bqOrsDfvvSgO-cdkUEvBASNX_4Lb9tB5fEY7lbYaWdOOWBXyZylR9il0-biB248V6HdDT1kgkSwz9esfKialRTLgxJx8AFM9is--UXK0CLvZn6JUU44PZSFuMyAT1_rgxsirsZ",HS={};HS.defaultAccessToken=qxe;HS.defaultWorldImageryServer=new De({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"});HS.defaultWorldHillshadeServer=new De({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"});HS.defaultWorldOceanServer=new De({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer"});HS.getDefaultTokenCredit=function(e){if(e===qxe){if(!l(qZ)){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>';qZ=new St(t,!0)}return qZ}};var Of=HS;function YZ(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=vh(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)}YZ.prototype.isReady=function(){return this._isReady};YZ.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=vh(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 gB=YZ;function XZ(){this.name=void 0,this.description=void 0,this.position=void 0,this.data=void 0,this.imageryLayer=void 0}XZ.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])};XZ.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 xm=XZ;function GS(){pe.throwInstantiationError()}Object.defineProperties(GS.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}});GS.prototype.getTileCredits=function(e,t,n){pe.throwInstantiationError()};GS.prototype.requestImage=function(e,t,n,i){pe.throwInstantiationError()};GS.prototype.pickFeatures=function(e,t,n,i,r){pe.throwInstantiationError()};var Oct=/\.ktx2$/i;GS.loadImage=function(e,t){let n=De.createIfNeeded(t);return Oct.test(n.url)?vu(n):l(e)&&l(e.tileDiscardPolicy)?n.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):n.fetchImage({preferImageBitmap:!0,flipY:!0})};var Mf=GS;var Yxe={SATELLITE:1,OCEANS:2,HILLSHADE:3};Object.freeze(Yxe);var Tm=Yxe;function Xxe(e){this.useTiles=e.usePreCachedTilesIfAvailable??!0;let t=e.ellipsoid;this.tilingScheme=e.tilingScheme??new Xi({ellipsoid:t}),this.rectangle=e.rectangle??this.tilingScheme.rectangle,this.ellipsoid=t;let n=e.credit;typeof n=="string"&&(n=new St(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}Xxe.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 gB({missingImageUrl:Kxe(e,0,0,this.maximumLevel).url,pixelsToCheck:[new z(0,0),new z(200,20),new z(20,200),new z(80,110),new z(160,130)],disableCheckIfAllPixelsAreTransparent:!0}))};function Mct(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 To({ellipsoid:t.ellipsoid});else if(e.tileInfo.spatialReference.wkid===4326)t.tilingScheme=new Xi({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 di,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 St(e.copyrightText)]:t.credit=new St(e.copyrightText))}function Lct(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 Nct(e,t){let n=e.getDerivedResource({queryParameters:{f:"json"}});try{let i=await n.fetchJson();Mct(i,t)}catch(i){Lct(e,i)}}function Yp(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 Xi({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}Yp.fromBasemapType=async function(e,t){t=t??H.EMPTY_OBJECT;let n,i,r;switch(e){case Tm.SATELLITE:{n=t.token??Of.defaultAccessToken,i=De.createIfNeeded(Of.defaultWorldImageryServer),i.appendForwardSlash();let o=Of.getDefaultTokenCredit(n);l(o)&&(r=St.clone(o))}break;case Tm.OCEANS:{n=t.token??Of.defaultAccessToken,i=De.createIfNeeded(Of.defaultWorldOceanServer),i.appendForwardSlash();let o=Of.getDefaultTokenCredit(n);l(o)&&(r=St.clone(o))}break;case Tm.HILLSHADE:{n=t.token??Of.defaultAccessToken,i=De.createIfNeeded(Of.defaultWorldHillshadeServer),i.appendForwardSlash();let o=Of.getDefaultTokenCredit(n);l(o)&&(r=St.clone(o))}break;default:}return Yp.fromUrl(i,{...t,token:n,credit:r,usePreCachedTilesIfAvailable:!0})};function Kxe(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 Bi?(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(Yp.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}}});Yp.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 Yp(t);i._resource=n;let r=new Xxe(t);return(t.usePreCachedTilesIfAvailable??!0)&&await Nct(n,r),r.build(i),i};Yp.prototype.getTileCredits=function(e,t,n){return this._tileCredits};Yp.prototype.requestImage=function(e,t,n,i){return Mf.loadImage(this,Kxe(this,e,t,n,i))};Yp.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 Bi)a=D.toDegrees(i),s=D.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 xm;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 di;b.position=T.unproject(new h(A.geometry.x,A.geometry.y,A.geometry.z))}}g.push(b)}return g})};Yp._metadataCache={};var Jg=Yp;var $xe={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($xe);var WS=$xe;function _B(e){}_B.prototype.isReady=function(){return!0};_B.prototype.shouldDiscardImage=function(e){return _B.EMPTY_IMAGE===e};var gH;Object.defineProperties(_B,{EMPTY_IMAGE:{get:function(){return l(gH)||(gH=new Image,gH.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),gH}}});var qS=_B;function Jxe(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}Jxe.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 St)break;r.credit=new St(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(D.toRadians(u[1]),D.toRadians(u[0]),D.toRadians(u[3]),D.toRadians(u[2]))}}};function Fct(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 Bct(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i+=`: ${t.message}`),Hr.reportError(void 0,n,l(n)?n._errorEvent:void 0,i,void 0,void 0,void 0,t),new oe(i)}async function kct(e,t,n){let i=e.url,r=As._metadataCache[i];l(r)||(r=e.fetchJson(),As._metadataCache[i]=r);try{let o=await r;return Fct(o,t)}catch(o){Bct(e,o,n)}}function As(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??WS.AERIAL,this._mapLayer=e.mapLayer,this._culture=e.culture??"",this._key=e.key,this._tileDiscardPolicy=e.tileDiscardPolicy,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new qS),this._proxy=e.proxy,this._credit=new St(`<a href="https://www.microsoft.com/en-us/maps/bing-maps/product"><img src="${As.logoUrl}" title="Bing Imagery"/></a>`),this._tilingScheme=new To({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(As.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)}}});As.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??WS.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 As(t);s._resource=r;let c=new Jxe(t);return await kct(a,c),c.build(s),s};var zct=new ie;As.prototype.getTileCredits=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(e,t,n,zct);return jct(this._attributionList,n,i)};As.prototype.requestImage=function(e,t,n,i){let r=Mf.loadImage(this,Uct(this,e,t,n,i));if(l(r))return r.catch(function(o){return l(o.blob)&&o.blob.size===0?qS.EMPTY_IMAGE:Promise.reject(o)})};As.prototype.pickFeatures=function(e,t,n,i,r){};As.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};As.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}};As._logoUrl=void 0;Object.defineProperties(As,{logoUrl:{get:function(){return l(As._logoUrl)||(As._logoUrl=$t("Assets/Images/bing_maps_credit.png")),As._logoUrl},set:function(e){As._logoUrl=e}}});function Uct(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:As.tileXYToQuadKey(t,n,i),subdomain:a[s],culture:e._culture},queryParameters:{n:"z"}})}var Vct=new ie;function jct(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,Vct);l(p)&&(c=!0)}}c&&i.push(a.credit)}return i}As._metadataCache={};var yB=As;var Zxe=/{[^}]+}/g,Qxe={x:qct,y:Xct,z:Jct,s:Zct,reverseX:Yct,reverseY:Kct,reverseZ:$ct,westDegrees:Qct,southDegrees:elt,eastDegrees:tlt,northDegrees:nlt,westProjected:ilt,southProjected:rlt,eastProjected:olt,northProjected:alt,width:slt,height:clt},Hct=Ot(Qxe,{i:llt,j:ult,reverseI:flt,reverseJ:dlt,longitudeDegrees:mlt,latitudeDegrees:plt,longitudeProjected:glt,latitudeProjected:_lt,format:Alt});function AB(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 To({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 St(r)),this._credit=r,this._hasAlphaChannel=e.hasAlphaChannel??!0;let o=e.customTags,a=Ot(Qxe,o),s=Ot(Hct,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(AB.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}}});AB.prototype.getTileCredits=function(e,t,n){};AB.prototype.requestImage=function(e,t,n,i){return Mf.loadImage(this,Gct(this,e,t,n,i))};AB.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=Wct(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 _H=!1,Lf=new ie,yH=!1,bB=new ie;function Gct(e,t,n,i,r){_H=!1,yH=!1;let o=e._resource,a=o.getUrlComponent(!0),s=e._tags,c={},u=a.match(Zxe);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 KZ=!1,XS=new z,$Z=!1;function Wct(e,t,n,i,r,o,a){_H=!1,yH=!1,KZ=!1,$Z=!1;let s=e._pickFeaturesResource,c=s.getUrlComponent(!0),u=e._pickFeaturesTags,f={},d=c.match(Zxe);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 KS(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 qct(e,t,n,i){return KS(e,"{x}",t)}function Yct(e,t,n,i){let r=e.tilingScheme.getNumberOfXTilesAtLevel(i)-t-1;return KS(e,"{reverseX}",r)}function Xct(e,t,n,i){return KS(e,"{y}",n)}function Kct(e,t,n,i){let r=e.tilingScheme.getNumberOfYTilesAtLevel(i)-n-1;return KS(e,"{reverseY}",r)}function $ct(e,t,n,i){let r=e.maximumLevel,o=l(r)&&i<r?r-i-1:i;return KS(e,"{reverseZ}",o)}function Jct(e,t,n,i){return KS(e,"{z}",i)}function Zct(e,t,n,i){let r=(t+n+i)%e._subdomains.length;return e._subdomains[r]}function AH(e,t,n,i){_H||(e.tilingScheme.tileXYToRectangle(t,n,i,Lf),Lf.west=D.toDegrees(Lf.west),Lf.south=D.toDegrees(Lf.south),Lf.east=D.toDegrees(Lf.east),Lf.north=D.toDegrees(Lf.north),_H=!0)}function Qct(e,t,n,i){return AH(e,t,n,i),Lf.west}function elt(e,t,n,i){return AH(e,t,n,i),Lf.south}function tlt(e,t,n,i){return AH(e,t,n,i),Lf.east}function nlt(e,t,n,i){return AH(e,t,n,i),Lf.north}function bH(e,t,n,i){yH||(e.tilingScheme.tileXYToNativeRectangle(t,n,i,bB),yH=!0)}function ilt(e,t,n,i){return bH(e,t,n,i),bB.west}function rlt(e,t,n,i){return bH(e,t,n,i),bB.south}function olt(e,t,n,i){return bH(e,t,n,i),bB.east}function alt(e,t,n,i){return bH(e,t,n,i),bB.north}function slt(e,t,n,i){return e.tileWidth}function clt(e,t,n,i){return e.tileHeight}function llt(e,t,n,i,r,o,a){return xH(e,t,n,i,r,o),XS.x}function ult(e,t,n,i,r,o,a){return xH(e,t,n,i,r,o),XS.y}function flt(e,t,n,i,r,o,a){return xH(e,t,n,i,r,o),e.tileWidth-XS.x-1}function dlt(e,t,n,i,r,o,a){return xH(e,t,n,i,r,o),e.tileHeight-XS.y-1}var hlt=new ie,YS=new h;function xH(e,t,n,i,r,o,a){if(KZ)return;JZ(e,t,n,i,r,o);let s=YS,c=e.tilingScheme.tileXYToNativeRectangle(t,n,i,hlt);XS.x=e.tileWidth*(s.x-c.west)/c.width|0,XS.y=e.tileHeight*(c.north-s.y)/c.height|0,KZ=!0}function mlt(e,t,n,i,r,o,a){return D.toDegrees(r)}function plt(e,t,n,i,r,o,a){return D.toDegrees(o)}function glt(e,t,n,i,r,o,a){return JZ(e,t,n,i,r,o),YS.x}function _lt(e,t,n,i,r,o,a){return JZ(e,t,n,i,r,o),YS.y}var ylt=new de;function JZ(e,t,n,i,r,o,a){if(!$Z){if(e.tilingScheme.projection instanceof Bi)YS.x=D.toDegrees(r),YS.y=D.toDegrees(o);else{let s=ylt;s.longitude=r,s.latitude=o,e.tilingScheme.projection.project(s,YS)}$Z=!0}}function Alt(e,t,n,i,r,o,a){return a}var xa=AB;function Kd(e){xa.call(this,e)}Kd._requestMetadata=async function(e,t,n,i){try{let r=await n.fetchXML();return Kd._metadataSuccess(r,e,t,n,i)}catch(r){if(r instanceof lp)return Kd._metadataFailure(e,t);throw r}};Kd.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 Kd._requestMetadata(t,i,r);return new Kd(o)};l(Object.create)&&(Kd.prototype=Object.create(xa.prototype),Kd.prototype.constructor=Kd);function eTe(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 tTe(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}Kd._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 O=g.item(R).childNodes;for(let N=0;N<O.length;N++)a.test(O.item(N).nodeName)&&p.push(O.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)&&Hr.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 Xi({ellipsoid:t.ellipsoid});else if(C==="mercator"||C==="global-mercator")E=new To({ellipsoid:t.ellipsoid});else throw m=`${i.url} specifies an unsupported profile attribute, ${C}.`,l(r)&&Hr.reportError(void 0,r,r.errorEvent,m),new oe(m);let w=ie.clone(t.rectangle);if(!l(w)){let R,O,N,_;t.flipXY??!1?(N=new z(parseFloat(f.getAttribute("miny")),parseFloat(f.getAttribute("minx"))),_=new z(parseFloat(f.getAttribute("maxy")),parseFloat(f.getAttribute("maxx")))):(N=new z(parseFloat(f.getAttribute("minx")),parseFloat(f.getAttribute("miny"))),_=new z(parseFloat(f.getAttribute("maxx")),parseFloat(f.getAttribute("maxy"))));let S=C==="geodetic"||C==="mercator";if(E.projection instanceof Bi||S)R=de.fromDegrees(N.x,N.y),O=de.fromDegrees(_.x,_.y);else{let I=E.projection;R=I.unproject(N),O=I.unproject(_)}w=new ie(R.longitude,R.latitude,O.longitude,O.latitude)}return w=eTe(w,E),x=tTe(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}};Kd._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 To({ellipsoid:e.ellipsoid}),s=e.rectangle??a.rectangle;s=eTe(s,a);let c=tTe(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 _A=Kd;function nTe(e){this.channel=e.channel,this.ellipsoid=e.ellipsoid,this.tilingScheme=void 0,this.version=void 0}nTe.prototype.build=function(e){e._channel=this.channel,e._version=this.version,e._tilingScheme=this.tilingScheme};function blt(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 Xi({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 To({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:t.ellipsoid});else{let r=`Unsupported projection ${n.projection}.`;throw new oe(r)}return!0}function xlt(e,t,n){let i=`An error occurred while accessing ${t.url}.`;throw l(e)&&l(e.message)&&(i+=`: ${e.message}`),Hr.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new oe(i)}async function Tlt(e,t,n){try{let i=await e.fetchText();blt(i,t)}catch(i){xlt(i,e,n)}}function Uu(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 St(`<a href="http://www.google.com/enterprise/mapsearth/products/earthenterprise.html"><img src="${Uu.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(Uu.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}}});Uu.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 nTe(n);a.channel=t,await Tlt(o,a);let s=new Uu(n);return a.build(s),s._resource=r,s._url=e,s._path=i,s};Uu.prototype.getTileCredits=function(e,t,n){};Uu.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 Mf.loadImage(this,r)};Uu.prototype.pickFeatures=function(e,t,n,i,r){};Uu._logoUrl=void 0;Object.defineProperties(Uu,{logoUrl:{get:function(){return l(Uu._logoUrl)||(Uu._logoUrl=$t("Assets/Images/google_earth_credit.png")),Uu._logoUrl},set:function(e){Uu._logoUrl=e}}});var xB=Uu;var Clt=/\/$/,iTe=new St('&copy; <a href="https://www.mapbox.com/about/maps/">Mapbox</a> &copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function $S(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();Clt.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 St(a))):a=iTe,this._resource=i,this._imageryProvider=new xa({url:i,credit:a,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties($S.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}}});$S.prototype.getTileCredits=function(e,t,n){};$S.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};$S.prototype.pickFeatures=function(e,t,n,i,r){return this._imageryProvider.pickFeatures(e,t,n,i,r)};$S._defaultCredit=iTe;var TB=$S;function TT(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 Xi({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 St(i)),this._credit=i;let r=De.createIfNeeded(e.url);this._resource=r,this._tileWidth=e.tileWidth,this._tileHeight=e.tileHeight}Object.defineProperties(TT.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 vlt(e,t,n,i){let r=`Failed to load image ${e.url}`;l(t)&&l(t.message)&&(r+=`: ${t.message}`);let o=Hr.reportError(i,n,l(n)?n._errorEvent:void 0,r,0,0,0,t);if(o.retry)return ZZ(e,n,o);throw l(n)&&(n._hasError=!0),new oe(r)}async function ZZ(e,t,n){try{return await Mf.loadImage(null,e)}catch(i){return vlt(e,i,t,n)}}TT.fromUrl=async function(e,t){let n=De.createIfNeeded(e),i=await ZZ(n);t=t??H.EMPTY_OBJECT;let r=new TT({...t,url:e,tileWidth:i.width,tileHeight:i.height});return r._image=i,r};TT.prototype.getTileCredits=function(e,t,n){};TT.prototype.requestImage=async function(e,t,n,i){if(!this._hasError&&!l(this._image)){let r=await ZZ(this._resource,this);return this._image=r,Hr.reportSuccess(this._errorEvent),r}return this._image};TT.prototype.pickFeatures=function(e,t,n,i,r){};var CB=TT;function Elt(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=Slt:e==="xml"?n=Dlt:(e==="html"||e==="text")&&(n=rTe)),this.callback=n}function Slt(e){let t=[],n=e.features;for(let i=0;i<n.length;++i){let r=n[i],o=new xm;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 QZ="http://www.mapinfo.com/mxp",wlt="http://www.esri.com/wms",Ilt="http://www.opengis.net/wfs",Plt="http://www.opengis.net/gml";function Dlt(e){let t=e.documentElement;if(t.localName==="MultiFeatureCollection"&&t.namespaceURI===QZ)return Rlt(e);if(t.localName==="FeatureInfoResponse"&&t.namespaceURI===wlt)return Olt(e);if(t.localName==="FeatureCollection"&&t.namespaceURI===Ilt)return Mlt(e);if(t.localName==="ServiceExceptionReport")throw new oe(new XMLSerializer().serializeToString(t));return t.localName==="msGMLOutput"?Llt(e):Nlt(e)}function Rlt(e){let t=[],i=e.documentElement.getElementsByTagNameNS(QZ,"Feature");for(let r=0;r<i.length;++r){let o=i[r],a={},s=o.getElementsByTagNameNS(QZ,"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 xm;c.data=o,c.properties=a,c.configureNameFromProperties(a),c.configureDescriptionFromProperties(a),t.push(c)}return t}function Olt(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(TH(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(TH(s,i))}}return n}function Mlt(e){let t=[],i=e.documentElement.getElementsByTagNameNS(Plt,"featureMember");for(let r=0;r<i.length;++r){let o=i[r],a={};eQ(o,a),t.push(TH(o,a))}return t}function Llt(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={};eQ(a,s),t.push(TH(a,s))}}return t}function eQ(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()&&eQ(r,t)&&(t[r.localName]=r.textContent)}return n}function TH(e,t){let n=new xm;return n.data=e,n.properties=t,n.configureNameFromProperties(t),n.configureDescriptionFromProperties(t),n}function Nlt(e){let t=new XMLSerializer().serializeToString(e),n=document.createElement("div"),i=document.createElement("pre");i.textContent=t,n.appendChild(i);let r=new xm;return r.data=e,r.description=n.innerHTML,[r]}var Flt=/<body>\s*<\/body>/im,Blt=/<ServiceExceptionReport([\s\S]*)<\/ServiceExceptionReport>/im,klt=/<title>([\s\S]*)<\/title>/im;function rTe(e){if(Flt.test(e)||Blt.test(e))return;let t,n=klt.exec(e);n&&n.length>1&&(t=n[1]);let i=new xm;return i.name=t,i.description=e,i.data=e,[i]}var Cm=Elt;function vB(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(vB.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)}}});vB.prototype.getFromCache=function(e,t,n,i){let r=oTe(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};vB.prototype.checkApproachingInterval=function(e,t,n,i){let r=oTe(e,t,n),o=this._tilesRequestedForInterval,a=aTe(this),s={key:r,priorityFunction:i.priorityFunction};(!l(a)||!sTe(this,s,a))&&o.push(s),o.length>=512&&o.splice(0,256)};vB.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=aTe(this);if(l(o)){let a=this._tilesRequestedForInterval,s=!0;for(;s&&a.length!==0;){let c=a.pop();s=sTe(this,c,o),s||a.push(c)}}};function oTe(e,t,n){return`${e}-${t}-${n}`}function zlt(e){let t=e.split("-");if(t.length===3)return{x:Number(t[0]),y:Number(t[1]),level:Number(t[2])}}function aTe(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 sTe(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=zlt(a),c=new bo({throttle:!1,throttleByServer:!0,type:Ha.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 CT=vB;var Ult=[3034,3035,3042,3043,3044],Vlt=[4471,4559];function vm(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(vm.DefaultParameters,!0),n.setQueryParameters(vm.GetFeatureInfoDefaultParameters,!0),l(e.parameters)&&t.setQueryParameters(cTe(e.parameters)),l(e.getFeatureInfoParameters)&&n.setQueryParameters(cTe(e.getFeatureInfoParameters));let i=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new CT({clock:e.clock,times:e.times,requestImageFunction:function(a,s,c,u,f){return lTe(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 di?"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&&!Vlt.includes(s)||Ult.includes(s))&&(r.bbox="{southProjected},{westProjected},{northProjected},{eastProjected}")}}else r.srs=e.srs??(e.tilingScheme&&e.tilingScheme.projection instanceof di?"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 xa({url:t,pickFeaturesUrl:n,tilingScheme:e.tilingScheme??new Xi({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??vm.DefaultGetFeatureInfoFormats,enablePickFeatures:e.enablePickFeatures})}function lTe(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 jlt(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(vm.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}}});vm.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)};vm.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=lTe(this,e,t,n,i,a)),l(r)&&l(o)&&o.checkApproachingInterval(e,t,n,i),r};vm.prototype.pickFeatures=function(e,t,n,i,r){let o=this._timeDynamicImagery,a=l(o)?o.currentInterval:void 0;return jlt(this,e,t,n,i,r,a)};vm.DefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"});vm.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"});vm.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new Cm("json","application/json")),Object.freeze(new Cm("xml","text/xml")),Object.freeze(new Cm("text","text/html"))]);function cTe(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var EB=vm;function Nf(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(Nf.DefaultParameters,!0),this._useKvp=!0):(t.setTemplateValues(Nf.DefaultParameters,!0),this._useKvp=!1),this._useKvp){n.setQueryParameters(Nf.GetFeatureInfoDefaultParameters,!0),l(e.getFeatureInfoParameters)&&n.setQueryParameters(uTe(e.getFeatureInfoParameters));let f={infoformat:"{format}",i:"{i}",j:"{j}"};n.setQueryParameters(f,!0)}else n.setTemplateValues(Nf.GetFeatureInfoDefaultParameters,!0),l(e.getFeatureInfoParameters)&&n.setTemplateValues(uTe(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 CT({clock:e.clock,times:e.times,requestImageFunction:function(f,d,p,g,m){return fTe(u,f,d,p,g,m)},reloadFunction:function(){l(u._reload)&&u._reload()}})),this._errorEvent=new be,this._tileProvider=new xa({url:t,pickFeaturesUrl:n,tilingScheme:e.tilingScheme??new To({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??Nf.DefaultGetFeatureInfoFormats,enablePickFeatures:e.enablePickFeatures??(this._useKvp||l(e.getFeatureInfoUrl)),customTags:Glt(this)})}function fTe(e,t,n,i,r,o){let a=e._tileProvider;return dTe(e,a._resource,o),a.requestImage(t,n,i,r)}function Hlt(e,t,n,i,r,o,a){let s=e._tileProvider;return dTe(e,s._pickFeaturesResource,a),s.pickFeatures(t,n,i,r,o)}Object.defineProperties(Nf.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}}});Nf.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)};Nf.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=fTe(this,e,t,n,i,a)),l(r)&&l(o)&&o.checkApproachingInterval(e,t,n,i),r};Nf.prototype.pickFeatures=function(e,t,n,i,r){let o=this._timeDynamicImagery,a=l(o)?o.currentInterval:void 0;return Hlt(this,e,t,n,i,r,a)};Nf.DefaultParameters=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetTile"});Nf.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetFeatureInfo"});Nf.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new Cm("json","application/json")),Object.freeze(new Cm("xml","text/xml")),Object.freeze(new Cm("text","text/html"))]);function dTe(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 Glt(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 uTe(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var SB=Nf;var hTe=/\/$/;function Zg(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 ca?e.url:De.createIfNeeded(e.url??ds.mapTilesApiEndpoint),n=t.getUrlComponent();hTe.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 St(r)));let o=new xa({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(Zg.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}}});Zg.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=mTe(e),i=ca._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},tQ(a,o,i)};Zg.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??ds.mapTilesApiEndpoint,e.key=e.key??ds.defaultApiKey;let t=e.overlayLayerType,n=await qlt(e);return new Zg({...n,...e,credit:e.credit??ds.getDefaultCredit()})};Zg.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};Zg.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])};Zg.prototype.pickFeatures=function(e,t,n,i,r){};Zg.prototype.getViewportCredits=async function(){let e=this._maximumLevel,t=[];for(let r=0;r<e+1;r++)t.push(Wlt(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 St(a);o.push(s)}i.set(r,o)}return this._attributionsByLevel=i,i};async function Wlt(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 mTe(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 qlt(e){let{language:t,region:n,key:i,url:r}=e,o=mTe(e),a=r.url??r;hTe.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 wB=Zg;var Ylt=/\/$/;function JS(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 ca?e.url:De.createIfNeeded(e.url??"https://atlas.microsoft.com/"),i=n.getUrlComponent();Ylt.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 St(o)));let a=new xa({...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(JS.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}}});JS.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};JS.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])};JS.prototype.pickFeatures=function(e,t,n,i,r){};JS.prototype.getViewportCredits=async function(){let e=this._maximumLevel,t=[];for(let r=0;r<e+1;r++)t.push(Xlt(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 St(a);o.push(s)}i.set(r,o)}return this._attributionsByLevel=i,i};async function Xlt(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 IB=JS;var Klt=async(e,t,n)=>_A.fromUrl(new ca(t,n)),$lt=async(e,{options:t})=>Jg.fromUrl(e,t),Jlt=async(e,{options:t})=>yB.fromUrl(e,t),Zlt=async(e,{options:t})=>{let n=t.channel;return delete t.channel,xB.fromUrl(e,n,t)},Qlt=async(e,{options:t})=>new TB({url:e,...t}),eut=async(e,{options:t})=>CB.fromUrl(e,t),tut=async(e,{options:t})=>_A.fromUrl(e,t),nut=async(e,{options:t})=>new xa({url:e,...t}),iut=async(e,{options:t})=>new EB({url:e,...t}),rut=async(e,{options:t})=>new SB({url:e,...t}),tQ=async(e,t,n)=>{delete t.externalType,t.url=e;let i=new ca(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 wB({...t.options,url:i})},out=async(e,t,n)=>{delete t.externalType,t.url=e;let i=new ca(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 IB({...t.options,url:i})},aut={ARCGIS_MAPSERVER:$lt,BING:Jlt,GOOGLE_EARTH:Zlt,MAPBOX:Qlt,SINGLE_TILE:eut,TMS:tut,URL_TEMPLATE:nut,WMS:iut,WMTS:rut,GOOGLE_2D_MAPS:tQ,AZURE_MAPS:out,defaultFactoryCallback:Klt},ZS=Object.freeze(aut);function Xp(){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(Xp.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(){}}});Xp.fromAssetId=async function(e,t){t=t??H.EMPTY_OBJECT;let n=ca._createEndpointResource(e,t),i=e.toString()+t.accessToken+t.server,r=Xp._endpointCache[i];l(r)||(r=n.fetchJson(),Xp._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=ZS.defaultFactoryCallback;o=Ye(o,!0),o.options=o.options??{};let c=o.options?.url;if(delete t.url,l(a)&&(s=ZS[a],!l(s)))throw new oe(`Unrecognized Cesium ion imagery type: ${a}`);let u=await s(c,o,n),f=new Xp(t);return u.errorEvent.addEventListener(function(d){d.provider=f,f._errorEvent.raiseEvent(d)}),f._tileCredits=ca.getCreditsFromEndpoint(o,n),f._imageryProvider=u,f};Xp.prototype.getTileCredits=function(e,t,n){let i=this._imageryProvider.getTileCredits(e,t,n);return l(i)?this._tileCredits.concat(i):this._tileCredits};Xp.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};Xp.prototype.pickFeatures=function(e,t,n,i,r){return this._imageryProvider.pickFeatures(e,t,n,i,r)};Xp._endpointCache={};var iu=Xp;var pTe={AERIAL:2,AERIAL_WITH_LABELS:3,ROAD:4};Object.freeze(pTe);var Qg=pTe;function sut(e){e=e??H.EMPTY_OBJECT;let t=e.style??Qg.AERIAL;return iu.fromAssetId(t)}var e_=sut;var PB=`uniform sampler2D u_texture;
in vec2 v_textureCoordinates;
void main()
{
out_FragColor = texture(u_texture, v_textureCoordinates);
}
`;var DB=`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 gTe={UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7};Object.freeze(gTe);var jn=gTe;function QS(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}QS.createPlaceholder=function(e){let t=new QS(e,0,0,0);return t.addReference(),t.state=jn.PLACEHOLDER,t};QS.prototype.addReference=function(){++this.referenceCount};QS.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};QS.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 ew=QS;function nQ(e,t,n){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=n}nQ.prototype.freeResources=function(){l(this.readyImagery)&&this.readyImagery.releaseReference(),l(this.loadingImagery)&&this.loadingImagery.releaseReference()};nQ.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 tw=nQ;function ji(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??ji.DEFAULT_BRIGHTNESS,this.contrast=t.contrast??e._defaultContrast??ji.DEFAULT_CONTRAST,this.hue=t.hue??e._defaultHue??ji.DEFAULT_HUE,this.saturation=t.saturation??e._defaultSaturation??ji.DEFAULT_SATURATION,this.gamma=t.gamma??e._defaultGamma??ji.DEFAULT_GAMMA,this.splitDirection=t.splitDirection??ji.DEFAULT_SPLIT,this.minificationFilter=t.minificationFilter??e._defaultMinificationFilter??ji.DEFAULT_MINIFICATION_FILTER,this.magnificationFilter=t.magnificationFilter??e._defaultMagnificationFilter??ji.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 tw(ew.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??ji.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD}Object.defineProperties(ji.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}}});ji.DEFAULT_BRIGHTNESS=1;ji.DEFAULT_CONTRAST=1;ji.DEFAULT_HUE=0;ji.DEFAULT_SATURATION=1;ji.DEFAULT_GAMMA=1;ji.DEFAULT_SPLIT=Fo.NONE;ji.DEFAULT_MINIFICATION_FILTER=Gt.LINEAR;ji.DEFAULT_MAGNIFICATION_FILTER=ei.LINEAR;ji.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD=.004;ji.fromProviderAsync=function(e,t){let n=new ji(void 0,t);return dut(n,Promise.resolve(e)),n};ji.fromWorldImagery=function(e){return e=e??H.EMPTY_OBJECT,ji.fromProviderAsync(e_({style:e.style}),e)};ji.prototype.isBaseLayer=function(){return this._isBaseLayer};ji.prototype.isDestroyed=function(){return!1};ji.prototype.destroy=function(){return ue(this)};var ATe=new ie,_Te=new ie,iQ=new ie,bTe=new ie;ji.prototype.getImageryRectangle=function(){let e=this._imageryProvider,t=this._rectangle;return ie.intersection(e.rectangle,t)};ji.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 di&&e.rectangle.north<di.MaximumLatitude&&e.rectangle.south>-di.MaximumLatitude,a=ie.intersection(r.rectangle,this._rectangle,ATe),s=ie.intersection(e.rectangle,a,_Te);if(!l(s)){if(!this.isBaseLayer())return!1;let S=a,I=e.rectangle;s=_Te,I.south>=S.north?s.north=s.south=S.north:I.north<=S.south?s.north=s.south=S.south:(s.south=Math.max(I.south,S.south),s.north=Math.min(I.north,S.north)),I.west>=S.east?s.west=s.east=S.east:I.east<=S.west?s.west=s.east=S.west:(s.west=Math.max(I.west,S.west),s.east=Math.min(I.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=uut(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,bTe),E=g.tileXYToRectangle(m.x,m.y,d),w=ie.intersection(E,a,iQ),P;o?(g.rectangleToNativeRectangle(C,C),g.rectangleToNativeRectangle(E,E),g.rectangleToNativeRectangle(w,w),g.rectangleToNativeRectangle(a,a),P=g.tileXYToNativeRectangle.bind(g),A=C.width/512,b=C.height/512):P=g.tileXYToRectangle.bind(g);let R,O=0,N=1,_;!this.isBaseLayer()&&Math.abs(w.west-C.west)>=A&&(O=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=O,E=P(S,m.y,d),w=ie.simpleIntersection(E,a,iQ),!!l(w)){O=Math.min(1,(w.east-C.west)/C.width),S===y.x&&(this.isBaseLayer()||Math.abs(w.east-C.east)<A)&&(O=1),N=v;for(let I=m.y;I<=y.y;I++){if(_=N,E=P(S,I,d),w=ie.simpleIntersection(E,a,iQ),!l(w))continue;N=Math.max(0,(w.south-C.south)/C.height),I===y.y&&(this.isBaseLayer()||Math.abs(w.south-C.south)<b)&&(N=0);let M=new ae(R,N,O,_),F=this.getImageryFromCache(S,I,d);i.imagery.splice(n,0,new tw(F,M,o)),++n}}return!0};ji.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,ATe),i=c.rectangleToNativeRectangle(i,bTe)}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)};ji.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,Hr.reportSuccess(n._requestImageError)}function r(a){if(e.request.state===yi.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=Hr.reportError(n._requestImageError,t,t.errorEvent,s,e.x,e.y,e.level,a),n._requestImageError.retry&&o()}function o(){let a=new bo({throttle:!1,throttleByServer:!0,type:Ha.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()};ji.prototype._createTextureWebGL=function(e,t){let n=new zt({minificationFilter:this.minificationFilter,magnificationFilter:this.magnificationFilter}),i=t.image;return l(i.internalFormat)?new Ct({context:e,pixelFormat:i.internalFormat,width:i.width,height:i.height,source:{arrayBufferView:i.bufferView},sampler:n}):new Ct({context:e,source:i,pixelFormat:this._imageryProvider.hasAlphaChannel?He.RGBA:He.RGB,sampler:n})};ji.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 di?t.textureWebMercator=r:t.texture=r,t.image=void 0,t.state=jn.TEXTURE_LOADED};function yTe(e,t,n){return`${e}:${t}:${n}`}ji.prototype._finalizeReprojectTexture=function(e,t){let n=this.minificationFilter,i=this.magnificationFilter;if(n===Gt.LINEAR&&i===ei.LINEAR&&!He.isCompressedFormat(t.pixelFormat)&&D.isPowerOfTwo(t.width)&&D.isPowerOfTwo(t.height)){n=Gt.LINEAR_MIPMAP_LINEAR;let o=Lt.maximumTextureFilterAnisotropy,a=Math.min(o,this._maximumAnisotropy??o),s=yTe(n,i,a),c=e.cache.imageryLayerMipmapSamplers;l(c)||(c={},e.cache.imageryLayerMipmapSamplers=c);let u=c[s];l(u)||(u=c[s]=new zt({wrapS:rn.CLAMP_TO_EDGE,wrapT:rn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i,maximumAnisotropy:a})),t.generateMipmap(bd.NICEST),t.sampler=u}else{let o=yTe(n,i,0),a=e.cache.imageryLayerNonMipmapSamplers;l(a)||(a={},e.cache.imageryLayerNonMipmapSamplers=a);let s=a[o];l(s)||(s=a[o]=new zt({wrapS:rn.CLAMP_TO_EDGE,wrapT:rn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i})),t.sampler=s}};ji.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 Bi)&&r.width/i.width>1e-5){let a=this;t.addReference();let s=new Vl({persists:!0,owner:this,preExecute:function(c){lut(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};ji.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};ji.prototype.cancelReprojections=function(){this._reprojectComputeCommands.forEach(function(e){l(e.canceled)&&e.canceled()}),this._reprojectComputeCommands.length=0};ji.prototype.getImageryFromCache=function(e,t,n,i){let r=xTe(e,t,n),o=this._imageryCache[r];return l(o)||(o=new ew(this,e,t,n,i),this._imageryCache[r]=o),o.addReference(),o};ji.prototype.removeImageryFromCache=function(e){let t=xTe(e.x,e.y,e.level);delete this._imageryCache[t]};function xTe(e,t,n){return JSON.stringify([e,t,n])}var CH={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new z,texture:void 0},cut=fn.supportsTypedArrays()?new Float32Array(128):void 0;function lut(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 P=w/63;A[b++]=0,A[b++]=P,A[b++]=1,A[b++]=P}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:[DB]});r.shaderProgram=Zt.fromCache({context:t,vertexShaderSource:E,fragmentShaderSource:PB,attributeLocations:x}),r.sampler=new zt({wrapS:rn.CLAMP_TO_EDGE,wrapT:rn.CLAMP_TO_EDGE,minificationFilter:Gt.LINEAR,magnificationFilter:ei.LINEAR})}n.sampler=r.sampler;let o=n.width,a=n.height;CH.textureDimensions.x=o,CH.textureDimensions.y=a,CH.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 Ct({context:t,width:o,height:a,pixelFormat:n.pixelFormat,pixelDatatype:n.pixelDatatype,preMultiplyAlpha:n.preMultiplyAlpha});D.isPowerOfTwo(o)&&D.isPowerOfTwo(a)&&d.generateMipmap(bd.NICEST);let p=i.south,g=i.north,m=cut,y=0;for(let A=0;A<64;++A){let b=A/63,x=D.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=CH,e.vertexArray=r.vertexArray}function uut(e,t,n){let i=e._imageryProvider,r=i.tilingScheme,o=r.ellipsoid,a=e._imageryProvider.tilingScheme.projection instanceof Bi?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 fut(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function dut(e,t){let n;try{if(n=await Promise.resolve(t),e.isDestroyed())return;e._imageryProvider=n,e._readyEvent.raiseEvent(n)}catch(i){fut(e._errorEvent,i)}}var Ta=ji;var rQ=class{constructor(){this.alpha=!1,this.brightness=!1,this.contrast=!1,this.hue=!1,this.saturation=!1,this.gamma=!1,this.colorToAlpha=!1}},RB=rQ;var oQ=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}},nw=oQ;var hut=new ie,TTe=new ie,mut=new ie,put=new ie,gut=new ie,_ut=new ie,aQ=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,hut),s=r.tilingScheme,c=e._computeImageryRange(t,a,s,o),u=put;s.rectangleToNativeRectangle(t,u);let f=gut;s.rectangleToNativeRectangle(a,f);let d=(g,m,y)=>{let A=s.tileXYToRectangle(g,m,y),b=ie.intersection(A,a,mut);if(!l(b))return;let x=_ut;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 nw;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,TTe);return l(i)?i:e._clampRectangle(t,n,TTe)}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 nw);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}},iw=aQ;var sQ=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=ys.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=>(L.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 z,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:rt.TEXCOORD,setIndex:0,componentDatatype:Y.FLOAT,type:Vt.VEC2,normalized:!1,count:t.length/2,min:void 0,max:void 0,constant:new z(0,0),quantization:void 0,typedArray:t,byteOffset:0,byteStride:void 0}}},vT=sQ;var cQ=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}},OB=cQ;var lQ=class e{constructor(t,n,i){this._model=t,this._runtimeNode=n,this._runtimePrimitive=i,this._mappedPositionsPerEllipsoid=void 0,this._mappedPositionsModelMatrix=new L,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!L.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=vT.createCartographicPositions(r,a,d),g=vT.computeCartographicBoundingRectangle(p),m=new OB(p,o,g,d);s.push(m)}return L.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=vT.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 iw.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 iw._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 L);let r=t.sceneGraph;return L.clone(L.IDENTITY,i),L.multiply(i,t.modelMatrix,i),L.multiply(i,r.components.transform,i),L.multiply(i,r.axisCorrectionMatrix,i),L.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}},ET=lQ;var uQ=class{constructor(t,n,i,r,o){this.imageryLayer=t,this.texture=n,this.textureTranslationAndScale=i,this.textureCoordinateRectangle=r,this.imageryTexCoordAttributeSetIndex=o}},MB=uQ;var yut=!1,Aut=new ie,but=new ie,fQ=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=ET._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 RB;for(let i=0;i<t.length;i++){let r=t[i];n.alpha|=r.alpha!==1,n.brightness|=r.brightness!==Ta.DEFAULT_BRIGHTNESS,n.contrast|=r.contrast!==Ta.DEFAULT_CONTRAST,n.hue|=r.hue!==Ta.DEFAULT_HUE,n.saturation|=r.saturation!==Ta.DEFAULT_SATURATION,n.gamma|=r.gamma!==Ta.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));"]),yut&&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 MB(t,a,s,u,r)}static _computeTextureTranslationAndScale(t,n,i){let r=t.imageryProvider.tilingScheme,o=r.rectangleToNativeRectangle(n,Aut),a=r.rectangleToNativeRectangle(i,but);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}},LB=fQ;var NB=`#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 CTe={UNLIT:0,PBR:1};Object.freeze(CTe);var Kp=CTe;var vTe={name:"LightingPipelineStage"};vTe.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===Kp.PBR?r.addDefine("LIGHTING_PBR",void 0,he.FRAGMENT):r.addDefine("LIGHTING_UNLIT",void 0,he.FRAGMENT),r.addFragmentLines(NB)};var FB=vTe;var BB=`// 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 kB=`#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 zB=`#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:xut,MetallicRoughness:dQ,SpecularGlossiness:hQ,Specular:ETe,Clearcoat:STe}=xn,wTe={name:"MaterialPipelineStage",_processTexture:Vu,_processTextureTransform:ITe};wTe.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;Sut(i,o,a,u,f,d,c,e),l(i.specularGlossiness)?wut(i.specularGlossiness,o,a,u,c,e):(l(i.specular)&&_t.supportedExtensions.KHR_materials_specular&&Iut(i.specular,o,a,u,c),l(i.anisotropy)&&_t.supportedExtensions.KHR_materials_anisotropy&&Dut(i.anisotropy,o,a,u,c),l(i.clearcoat)&&_t.supportedExtensions.KHR_materials_clearcoat&&Rut(i.clearcoat,o,a,u,c),Out(i.metallicRoughness,o,a,u,c,e));let p=_t.getAttributeBySemantic(t,rt.NORMAL),g=l(r.pointCloudShading)&&!r.pointCloudShading.normalShading;l(i.planarFill)&&Tut(i.planarFill,t,e,n);let m=l(i.planarFill)&&i.planarFill.backgroundFill,y=e.lightingOptions;i.unlit||!p||s||g||m?y.lightingModel=Kp.UNLIT:y.lightingModel=Kp.PBR;let A=r.backFaceCulling&&!i.doubleSided;e.renderStateOptions.cull.enabled=A;let b=e.alphaOptions;i.alphaMode===xp.BLEND?b.pass=Pe.TRANSLUCENT:i.alphaMode===xp.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)&&vut(i.lineStyle,t,n,o,a),a.addFragmentLines(BB),i.doubleSided&&a.addDefine("HAS_DOUBLE_SIDED_MATERIAL",void 0,he.BOTH)};function Tut(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 Cut(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(zB);let u=kB.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=L.clone(L.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);L.inverse(g,u),f=!0}}return f?u:L.IDENTITY}}}function vut(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,rt.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 ITe(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 Eut(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 Vu(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)&&ITe(e,t,n,i,r);let{scale:p}=n;l(p)&&p!==1&&Eut(e,t,n,i,r),Cut(e,t,n,i,r,a)}function Sut(e,t,n,i,r,o,a,s){let{emissiveFactor:c,emissiveTexture:u,normalTexture:f,occlusionTexture:d}=e;l(c)&&!h.equals(c,xut.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&&Vu(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),Vu(n,t,g,"u_normalTexture","NORMAL",r,s)}l(d)&&!a&&Vu(n,t,d,"u_occlusionTexture","OCCLUSION",i)}function wut(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&&Vu(n,t,a,"u_diffuseTexture","DIFFUSE",i,o),l(s)&&!ae.equals(s,hQ.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&&Vu(n,t,c,"u_specularGlossinessTexture","SPECULAR_GLOSSINESS",i),l(u)&&!h.equals(u,hQ.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!==hQ.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 Iut(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&&Vu(n,t,o,"u_specularTexture","SPECULAR",i),l(a)&&a!==ETe.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&&Vu(n,t,s,"u_specularColorTexture","SPECULAR_COLOR",i),l(c)&&!h.equals(c,ETe.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 Put=new h;function Dut(e,t,n,i,r){let{anisotropyStrength:o,anisotropyRotation:a,anisotropyTexture:s}=e;n.addDefine("USE_ANISOTROPY",void 0,he.FRAGMENT),l(s)&&!r&&Vu(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,Put)}}function Rut(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!==STe.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&&Vu(n,t,a,"u_clearcoatTexture","CLEARCOAT",i),l(s)&&o!==STe.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&&Vu(n,t,c,"u_clearcoatRoughnessTexture","CLEARCOAT_ROUGHNESS",i),l(u)&&!r&&Vu(n,t,u,"u_clearcoatNormalTexture","CLEARCOAT_NORMAL",i)}function Out(e,t,n,i,r,o){n.addDefine("USE_METALLIC_ROUGHNESS",void 0,he.FRAGMENT);let a=e.baseColorTexture;l(a)&&!r&&Vu(n,t,a,"u_baseColorTexture","BASE_COLOR",i,o);let s=e.baseColorFactor;l(s)&&!ae.equals(s,dQ.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&&Vu(n,t,c,"u_metallicRoughnessTexture","METALLIC_ROUGHNESS",i);let u=e.metallicFactor;l(u)&&u!==dQ.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!==dQ.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 UB=wTe;var ru={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"};ru.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine(ru.METADATA_PICKING_VALUE_TYPE,"float",he.FRAGMENT),i.addDefine(ru.METADATA_PICKING_VALUE_STRING,"0.0",he.FRAGMENT),i.addDefine(ru.METADATA_PICKING_VALUE_COMPONENT_X,"0.0",he.FRAGMENT),i.addDefine(ru.METADATA_PICKING_VALUE_COMPONENT_Y,"0.0",he.FRAGMENT),i.addDefine(ru.METADATA_PICKING_VALUE_COMPONENT_Z,"0.0",he.FRAGMENT),i.addDefine(ru.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",[`${ru.METADATA_PICKING_VALUE_TYPE} value = ${ru.METADATA_PICKING_VALUE_TYPE}(${ru.METADATA_PICKING_VALUE_STRING});`,`metadataValues.x = ${ru.METADATA_PICKING_VALUE_COMPONENT_X};`,`metadataValues.y = ${ru.METADATA_PICKING_VALUE_COMPONENT_Y};`,`metadataValues.z = ${ru.METADATA_PICKING_VALUE_COMPONENT_Z};`,`metadataValues.w = ${ru.METADATA_PICKING_VALUE_COMPONENT_W};`],he.FRAGMENT)};var Ff=ru;var VB=`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 Fc={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)"};Fc.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_MORPH_TARGETS",void 0,he.VERTEX),kut(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!==rt.POSITION&&p!==rt.NORMAL&&p!==rt.TANGENT||(Lut(e,d,e.attributeIndex,s),e.attributeIndex++)}}zut(n);let o=e.runtimeNode.morphWeights.length;n.addUniform("float",`u_morphWeights[${o}]`,he.VERTEX),n.addVertexLines(VB);let a={u_morphWeights:function(){return e.runtimeNode.morphWeights}};e.uniformMap=Ot(a,e.uniformMap)};var Mut={attributeString:void 0,functionId:void 0};function Lut(e,t,n,i){let r=e.shaderBuilder;Nut(e,t,n);let o=Fut(t,Mut);But(r,o,i)}function Nut(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 Fut(e,t){switch(e.semantic){case rt.POSITION:t.attributeString="Position",t.functionId=Fc.FUNCTION_ID_GET_MORPHED_POSITION;break;case rt.NORMAL:t.attributeString="Normal",t.functionId=Fc.FUNCTION_ID_GET_MORPHED_NORMAL;break;case rt.TANGENT:t.attributeString="Tangent",t.functionId=Fc.FUNCTION_ID_GET_MORPHED_TANGENT;break;default:break}return t}function But(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 kut(e){e.addFunction(Fc.FUNCTION_ID_GET_MORPHED_POSITION,Fc.FUNCTION_SIGNATURE_GET_MORPHED_POSITION,he.VERTEX),e.addFunctionLines(Fc.FUNCTION_ID_GET_MORPHED_POSITION,["vec3 morphedPosition = position;"]),e.addFunction(Fc.FUNCTION_ID_GET_MORPHED_NORMAL,Fc.FUNCTION_SIGNATURE_GET_MORPHED_NORMAL,he.VERTEX),e.addFunctionLines(Fc.FUNCTION_ID_GET_MORPHED_NORMAL,["vec3 morphedNormal = normal;"]),e.addFunction(Fc.FUNCTION_ID_GET_MORPHED_TANGENT,Fc.FUNCTION_SIGNATURE_GET_MORPHED_TANGENT,he.VERTEX),e.addFunctionLines(Fc.FUNCTION_ID_GET_MORPHED_TANGENT,["vec3 morphedTangent = tangent;"])}function zut(e){e.addFunctionLines(Fc.FUNCTION_ID_GET_MORPHED_POSITION,["return morphedPosition;"]),e.addFunctionLines(Fc.FUNCTION_ID_GET_MORPHED_NORMAL,["return morphedNormal;"]),e.addFunctionLines(Fc.FUNCTION_ID_GET_MORPHED_TANGENT,["return morphedTangent;"])}var jB=Fc;var PTe={name:"PickingPipelineStage"};function mQ(e){return`vec4(rgba8UnormToUint32(${e}), isEdge ? 1.0 : 0.0, -v_positionEC.z, 0.0)`}PTe.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)Uut(e,t,s,i);else if(l(s))Vut(e,i);else{let c=DTe(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=mQ(e.pickId)}};function DTe(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(zo.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 Uut(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=mQ(e.pickId)}function Vut(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=DTe(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=mQ(e.pickId)}var HB=PTe;var RTe={ADD:0,REPLACE:1};Object.freeze(RTe);var po=RTe;var GB=`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 jut=new ae,MTe={name:"PointCloudStylingPipelineStage"};MTe.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=qut(s),A=Yut(o,y);Xut(i,A);let x=Kut(A).indexOf("normalMC")>=0,T=_t.getAttributeBySemantic(t,rt.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;zo.is3DTiles(r.type)&&(p=!0,d=r.content,g=d.tile.refine===po.ADD),i.addUniform("vec4","model_pointCloudParameters",he.VERTEX),i.addVertexLines(GB);let m=e.uniformMap;m.model_pointCloudParameters=function(){let y=jut,A=1;p&&(A=g?5:d.tileset.memoryAdjustedScreenSpaceError),y.x=f.maximumAttenuation??A,y.x*=n.pixelRatio;let b=Hut(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 mn?C=Number.POSITIVE_INFINITY:C=x.drawingBufferHeight/n.camera.frustum.sseDenominator,y.z=C,p&&(y.w=d.tileset.timeSinceLoad),y}};var OTe=new h;function Hut(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,rt.POSITION),o=r.count,a=e.runtimeNode.transform,s=h.subtract(r.max,r.min,OTe);s=L.multiplyByPointAsVector(a,s,OTe);let c=s.x*s.y*s.z;return D.cbrt(c/o)}var Gut={colorStyleFunction:void 0,showStyleFunction:void 0,pointSizeStyleFunction:void 0,styleTranslucent:!1},Wut={POSITION:"attributes.positionMC",POSITION_ABSOLUTE:"v_positionWC",COLOR:"attributes.color_0",NORMAL:"attributes.normalMC"};function qut(e){let t=Ye(Wut);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 pQ="ProcessedAttributes attributes, Metadata metadata, float tiles3d_tileset_time";function Yut(e,t){let n=Gut,i={translucent:!1};return n.colorStyleFunction=e.getColorShaderFunction(`getColorFromStyle(${pQ})`,t,i),n.showStyleFunction=e.getShowShaderFunction(`getShowFromStyle(${pQ})`,t,i),n.pointSizeStyleFunction=e.getPointSizeShaderFunction(`getPointSizeFromStyle(${pQ})`,t,i),n.styleTranslucent=l(n.colorStyleFunction)&&i.translucent,n}function Xut(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 gQ(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 Kut(e){let t=e.colorStyleFunction,n=e.showStyleFunction,i=e.pointSizeStyleFunction,r=[];return l(t)&&gQ(t,r),l(n)&&gQ(n,r),l(i)&&gQ(i,r),r}var WB=MTe;var qB=`void primitiveOutlineStage() {
v_outlineCoordinates = a_outlineCoordinates;
}
`;var YB=`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 LTe={name:"PrimitiveOutlinePipelineStage"};LTe.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=pT.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(qB),i.addFragmentLines(YB)};var XB=LTe;var NTe={name:"PrimitiveStatisticsPipelineStage",_countGeometry:FTe,_count2DPositions:BTe,_countMorphTargetAttributes:kTe,_countMaterialTextures:zTe,_countFeatureIdTextures:UTe,_countBinaryMetadata:VTe};NTe.process=function(e,t,n){let i=e.model,r=i.statistics;FTe(r,t),BTe(r,e.runtimePrimitive),kTe(r,t),zTe(r,t.material),UTe(r,t.featureIds),VTe(r,i)};function FTe(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+=$ut(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 $ut(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 BTe(e,t){let n=t.positionBuffer2D;l(n)&&e.addBuffer(n,!0)}function kTe(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 zTe(e,t){let n=Jut(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 Jut(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 UTe(e,t){let n=t.length;for(let i=0;i<n;i++){let r=t[i];if(r instanceof xn.FeatureIdTexture){let o=r.textureReader;l(o.texture)&&e.addTexture(o.texture)}}}function VTe(e,t){let n=t.structuralMetadata;l(n)&&(Zut(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 Zut(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 KB=NTe;var Qut=new L,eft=new L,jTe={name:"SceneMode2DPipelineStage"};jTe.process=function(e,t,n){let i=_t.getAttributeBySemantic(t,rt.POSITION),r=e.shaderBuilder,o=e.model,a=o.sceneGraph.computedModelMatrix,s=e.runtimeNode.computedTransform,c=L.multiplyTransformation(a,s,Qut),u=ift(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=aft(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=L.fromTranslation(u.center,new L),g=n.context,m={u_modelView2D:function(){return L.multiplyTransformation(g.uniformState.view,p,eft)}};e.uniformMap=Ot(m,e.uniformMap)};var tft=new h,nft=new h;function ift(e,t,n){let i=L.multiplyByPoint(t,e.positionMin,tft),r=sr.computeActualEllipsoidPosition(n,i,i),o=L.multiplyByPoint(t,e.positionMax,nft),a=sr.computeActualEllipsoidPosition(n,o,o);return se.fromCornerPoints(r,a,new se)}var HTe=new h;function rft(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,HTe),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 oft(e,t,n,i){let r;l(e.quantization)?r=rft(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,HTe);if(isNaN(u.x)||isNaN(u.y)||isNaN(u.z))continue;let f=L.multiplyByPoint(t,u,u),d=sr.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 aft(e,t,n,i){let r=Ye(i);r.mode=re.COLUMBUS_VIEW;let o=n.center,a=oft(e,t,o,r),s=Ze.createVertexBuffer({context:i.context,typedArray:a,usage:Oe.STATIC_DRAW});return s.vertexArrayDestroyable=!1,s}var $B=jTe;var JB=`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 ST={name:"SkinningPipelineStage",FUNCTION_ID_GET_SKINNING_MATRIX:"getSkinningMatrix",FUNCTION_SIGNATURE_GET_SKINNING_MATRIX:"mat4 getSkinningMatrix()"};ST.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_SKINNING",void 0,he.VERTEX),cft(n,t);let i=e.runtimeNode,r=i.computedJointMatrices;n.addUniform("mat4",`u_jointMatrices[${r.length}]`,he.VERTEX),n.addVertexLines(JB);let o={u_jointMatrices:function(){return i.computedJointMatrices}};e.uniformMap=Ot(o,e.uniformMap)};function sft(e){let t=-1,n=e.attributes,i=n.length;for(let r=0;r<i;r++){let o=n[r];(o.semantic===rt.JOINTS||o.semantic===rt.WEIGHTS)&&(t=Math.max(t,o.setIndex))}return t}function cft(e,t){e.addFunction(ST.FUNCTION_ID_GET_SKINNING_MATRIX,ST.FUNCTION_SIGNATURE_GET_SKINNING_MATRIX,he.VERTEX),e.addFunctionLines(ST.FUNCTION_ID_GET_SKINNING_MATRIX,["mat4 skinnedMatrix = mat4(0);"]);let i,r,o=["x","y","z","w"],a=sft(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(ST.FUNCTION_ID_GET_SKINNING_MATRIX,[u])}e.addFunctionLines(ST.FUNCTION_ID_GET_SKINNING_MATRIX,["return skinnedMatrix;"])}var ZB=ST;var QB=`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 GTe={name:"VerticalExaggerationPipelineStage"},lft=new z;GTe.process=function(e,t,n){let{shaderBuilder:i,uniformMap:r}=e;i.addVertexLines(QB),i.addDefine("HAS_VERTICAL_EXAGGERATION",void 0,he.VERTEX),i.addUniform("vec2","u_verticalExaggerationAndRelativeHeight",he.VERTEX),r.u_verticalExaggerationAndRelativeHeight=function(){return z.fromElements(n.verticalExaggeration,n.verticalExaggerationRelativeHeight,lft)}};var e2=GTe;var WTe={name:"WireframePipelineStage"};WTe.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_WIREFRAME",void 0,he.FRAGMENT);let r=e.model,o=uft(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=$E.getWireframeIndicesCount(s,c)};function uft(e,t,n){let r=_t.getAttributeBySemantic(e,rt.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=$E.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 t2=WTe;function qTe(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=[]}qTe.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!==$g.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),P=r._enableShowOutline&&l(n.outlineCoordinates),R=l(n.edgeVisibility),O=fft(r,i,n),N=l(r.classificationType);u&&t.push($B),t.push(pB),x&&t.push(t2),N&&t.push(XF),d&&t.push(jB),p&&t.push(ZB),w&&t.push(WB),b&&t.push(aB),g&&(P?pt("outlines-and-draping","Primitive outlines disable imagery draping"):t.push(LB)),A&&t.push(UB),t.push(mA),t.push(Xd),t.push(Ff),O.hasPropertyTable&&(t.push(gA),t.push(YF),t.push(JF)),f&&t.push(e2),m&&t.push(rB),t.push(FB),r.allowPicking&&t.push(HB),P&&t.push(XB),R&&(e.edgeVisibilityRequested=!0,t.push(fB),t.push(cB)),t.push(qF),t.push(KB)};function fft(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 n2=qTe;function _Q(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=[],dft(this)}Object.defineProperties(_Q.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 dft(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=YTe(f,d,new L);s.push(p)}}function YTe(e,t,n){let i=L.multiplyTransformation(e.transformToRoot,e.transform,n);return n=L.multiplyTransformation(i,t,n),n}_Q.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]=YTe(i,r,e[n])}};var i2=_Q;function hft(){this.pass=void 0,this.alphaCutoff=void 0}var wT=hft;function mft(e){this.shaderBuilder=new Cg,this.model=e,this.uniformMap={},this.alphaOptions=new wT,this.renderStateOptions=je.getState(je.fromCache({depthTest:{enabled:!0,func:lc.LESS_OR_EQUAL}})),this.hasSilhouette=!1,this.hasSkipLevelOfDetail=!1,this.nodeRenderResources=[]}var r2=mft;var o2=`void silhouetteStage(inout vec4 color) {
if(model_silhouettePass) {
color = czm_gammaCorrect(model_silhouetteColor);
}
}`;var a2=`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 vH={name:"ModelSilhouettePipelineStage"};vH.silhouettesLength=0;vH.process=function(e,t,n){l(t._silhouetteId)||(t._silhouetteId=++vH.silhouettesLength);let i=e.shaderBuilder;i.addDefine("HAS_SILHOUETTE",void 0,he.BOTH),i.addVertexLines(a2),i.addFragmentLines(o2),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 s2=vH;var c2=`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 EH={name:"ModelSplitterPipelineStage",SPLIT_DIRECTION_UNIFORM_NAME:"model_splitDirection"};EH.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_SPLITTER",void 0,he.FRAGMENT),i.addFragmentLines(c2);let r={};i.addUniform("float",EH.SPLIT_DIRECTION_UNIFORM_NAME,he.FRAGMENT),r[EH.SPLIT_DIRECTION_UNIFORM_NAME]=function(){return t.splitDirection},e.uniformMap=Ot(r,e.uniformMap)};var l2=EH;function pft(e,t){this.model=e.model,this.shaderBuilder=e.shaderBuilder.clone(),this.uniformMap=Ye(e.uniformMap),this.alphaOptions=Ye(e.alphaOptions),this.renderStateOptions=Ye(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 u2=pft;function gft(e){e=e??H.EMPTY_OBJECT,this.lightingModel=e.lightingModel??Kp.UNLIT}var f2=gft;function _ft(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=Ye(e.uniformMap),this.alphaOptions=Ye(e.alphaOptions),this.renderStateOptions=Ye(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 f2,this.pickId=void 0,this.snapId=void 0}var d2=_ft;function AQ(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=[],xft(this)}function yft(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:lc.LESS_OR_EQUAL},depthMask:!1}}var Aft={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:Qt.PRE_MULTIPLIED_ALPHA_BLEND},bft={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},$Te=[];function xft(e){let t=e._command,n=$Te;if(e._useDebugWireframe){t.pass=Pe.OPAQUE,n.length=0,n.push(t),e._commandListDebugWireframe=h2(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=yQ(t,o),s=XTe(t,o);n.length=0,n.push(a,s),e._commandListTerrain=h2(e,n,e._commandListTerrain),r&&(e._commandListTerrainPicking=KTe(e,n,e._commandListTerrainPicking))}if(e._classifies3DTiles){let o=Pe.CESIUM_3D_TILE_CLASSIFICATION,a=yQ(t,o),s=XTe(t,o);n.length=0,n.push(a,s),e._commandList3DTiles=h2(e,n,e._commandList3DTiles),r&&(e._commandList3DTilesPicking=KTe(e,n,e._commandList3DTilesPicking))}}function h2(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 yQ(e,t){let n=nt.shallowClone(e);n.cull=!1,n.pass=t;let i=t===Pe.TERRAIN_CLASSIFICATION?Qn.ALWAYS:Qn.EQUAL,r=yft(i);return n.renderState=je.fromCache(r),n}function XTe(e,t){let n=nt.shallowClone(e);return n.cull=!1,n.pass=t,n.renderState=je.fromCache(Aft),n}var Tft=[];function KTe(e,t,n){let i=je.fromCache(bft),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=Tft;return c.length=0,c.push(a,s),h2(e,c,n)}Object.defineProperties(AQ.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=L.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}}});AQ.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=yQ(this._command,r),a=$Te;a.length=0,a.push(o),this._commandListIgnoreShow=h2(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 m2=AQ;function rw(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=L.clone(t.modelMatrix),this._boundingVolume=se.clone(t.boundingVolume),this._modelMatrix2D=new L,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,Cft(this)}function $d(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}$d.clone=function(e){return new $d({command:e.command,updateShadows:e.updateShadows,updateBackFaceCulling:e.updateBackFaceCulling,updateCullFace:e.updateCullFace,updateDebugShowBoundingVolume:e.updateDebugShowBoundingVolume,is2D:e.is2D,derivedCommand2D:e.derivedCommand2D})};function Cft(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 $d({command:t,updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0,is2D:!1}),r.push(e._originalCommand),e._needsTranslucentCommand&&(e._translucentCommand=new $d({command:Dft(t),updateShadows:!0,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!0}),r.push(e._translucentCommand)),e._needsSkipLevelOfDetailCommands&&(e._skipLodBackfaceCommand=new $d({command:Bft(t),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:i,updateDebugShowBoundingVolume:!1}),e._skipLodStencilCommand=new $d({command:kft(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),r.push(e._skipLodBackfaceCommand),r.push(e._skipLodStencilCommand)),e._needsSilhouetteCommands&&(e._silhouetteModelCommand=new $d({command:Rft(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),e._silhouetteColorCommand=new $d({command:Oft(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 $d({command:JTe(t,o,s),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),e._edgeSnapCommand=new $d({command:JTe(t,o,c),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),r.push(e._edgeCommand),r.push(e._edgeSnapCommand)}e._needsPlanarFillIdCommand&&(e._planarFillIdCommand=new $d({command:Mft(t),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),r.push(e._planarFillIdCommand))}Object.defineProperties(rw.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=L.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,Eft(this)}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){this._backFaceCulling!==e&&(this._backFaceCulling=e,Sft(this))}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace!==e&&(this._cullFace=e,wft(this))}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolume=e,Ift(this))}}});function vft(e,t){let n=e._modelMatrix;e._modelMatrix2D=L.clone(n,e._modelMatrix2D),e._modelMatrix2D[13]-=D.sign(n[13])*2*D.PI*t.mapProjection.ellipsoid.maximumRadius,e._boundingVolume2D=se.transform(e.runtimePrimitive.boundingSphere,e._modelMatrix2D,e._boundingVolume2D)}function Eft(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 Sft(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=Ye(o.renderState,!0);a.cull.enabled=t,o.renderState=je.fromCache(a)}}}function wft(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=Ye(o.renderState,!0);a.cull.face=t,o.renderState=je.fromCache(a)}}}function Ift(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}}}rw.prototype.pushCommands=function(e,t){let n=SH(this,e);n&&!this._has2DCommands&&(Pft(this),this._has2DCommands=!0,this._modelMatrix2DDirty=!0),this._modelMatrix2DDirty&&(vft(this,e),this._modelMatrix2DDirty=!1);let i=this.model.styleCommandsNeeded;if(!(this._needsTranslucentCommand&&l(i)&&(i!==bm.ALL_OPAQUE&&$p(t,this._translucentCommand,n),i===bm.ALL_TRANSLUCENT))){if(this._needsSkipLevelOfDetailCommands){let{tileset:r,tile:o}=this._model.content;if(r.hasMixedContent){o._finalResolution||$p(r._backfaceCommands,this._skipLodBackfaceCommand,n),Lft(this,o,n),$p(t,this._skipLodStencilCommand,n);return}}if(this._needsSilhouetteCommands){$p(t,this._silhouetteModelCommand,n);return}return this._model.edgeDisplayMode===qd.EDGES_ONLY&&this._needsEdgeCommands||$p(t,this._originalCommand,n),t}};rw.prototype.pushSilhouetteCommands=function(e,t){let n=SH(this,e);return $p(t,this._silhouetteColorCommand,n),t};rw.prototype.pushEdgeCommands=function(e,t){if(!l(this._edgeCommand))return t;let n=this._model.edgeDisplayMode,i=e.passes,r=SH(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),$p(t,a,r),t}if(i.pick){if(n!==qd.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),$p(t,a,r),t}if(n===qd.SURFACES_ONLY)return t;let o=n===qd.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),$p(t,this._edgeCommand,r),t};rw.prototype.pushPlanarFillIdCommands=function(e,t){if(!l(this._planarFillIdCommand))return t;let n=SH(this,e);return $p(t,this._planarFillIdCommand,n),t};function $p(e,t,n){e.push(t.command),n&&e.push(t.derivedCommand2D.command)}function SH(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*D.PI;return r<a&&o>a||r<-a&&o>-a}function t_(e,t){if(!l(t))return;let n=$d.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 Pft(e){t_(e,e._originalCommand),t_(e,e._translucentCommand),t_(e,e._skipLodBackfaceCommand),t_(e,e._skipLodStencilCommand),t_(e,e._silhouetteModelCommand),t_(e,e._silhouetteColorCommand),t_(e,e._edgeCommand),t_(e,e._edgeSnapCommand),t_(e,e._planarFillIdCommand)}function Dft(e){let t=nt.shallowClone(e);t.pass=Pe.TRANSLUCENT;let n=Ye(e.renderState,!0);return n.cull.enabled=!1,n.depthMask=!1,n.blending=Qt.ALPHA_BLEND,t.renderState=je.fromCache(n),t}function Rft(e,t){let n=t._silhouetteId%255,i=nt.shallowClone(e),r=Ye(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 Oft(e,t){let n=t._silhouetteId%255,i=nt.shallowClone(e),r=Ye(e.renderState,!0);r.cull.enabled=!1,(e.pass===Pe.TRANSLUCENT||t.silhouetteColor.alpha<1)&&(i.pass=Pe.TRANSLUCENT,r.depthMask=!1,r.blending=Qt.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=Ye(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 JTe(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=Ye(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 Mft(e){let t=nt.shallowClone(e);t.pass=Pe.CESIUM_3D_TILE_PLANAR_FILL_ID,t.castShadows=!1,t.receiveShadows=!1;let n=Ye(e.renderState,!0);n.blending.enabled=!1,t.renderState=je.fromCache(n);let i=Ye(e.uniformMap);return i.u_isPlanarFillIdPass=function(){return!0},t.uniformMap=i,t}function Lft(e,t,n){let i=e._skipLodStencilCommand,r=i.command,o=t._selectionDepth,a=Nft(r);if(o!==a){let s=Fft(o),c=Ye(r.renderState,!0);c.stencilTest.reference=s,r.renderState=je.fromCache(c),n&&(i.derivedCommand2D.renderState=c)}}function Nft(e){return(e.renderState.stencilTest.reference&qt.SKIP_LOD_MASK)>>>qt.SKIP_LOD_BIT_SHIFT}function Fft(e){return qt.CESIUM_3D_TILE_MASK|e<<qt.SKIP_LOD_BIT_SHIFT}function Bft(e){let t=nt.shallowClone(e),n=Ye(e.renderState,!0);n.cull.enabled=!0,n.cull.face=zi.FRONT,n.colorMask={red:!1,green:!1,blue:!1,alpha:!1},n.polygonOffset={enabled:!0,factor:5,units:5};let i=Ye(t.uniformMap),r=new z(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 kft(e){let t=nt.shallowClone(e),n=Ye(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 p2=rw;var g2=`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 _2=`
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 ZTe(){}ZTe.buildModelDrawCommand=function(e,t){let n=e.shaderBuilder,i=zft(e,n,t),r=Uft(e,i,t),o=e.model;return l(o.classificationType)?new m2({primitiveRenderResources:e,command:r}):new p2({primitiveRenderResources:e,command:r})};function zft(e,t,n){t.addVertexLines(g2),t.addFragmentLines(_2);let i=e.model,r=t.buildShaderProgram(n.context);return i._pipelineResources.push(r),r}function Uft(e,t,n){let i=Vft(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=L.multiplyTransformation(s._computedModelMatrix,e.runtimeNode.computedTransform,new L),f=e.runtimePrimitive.boundingSphere2D;else{let x=c?s._computedModelMatrix:s._computedModelMatrix2D;u=L.multiplyTransformation(x,e.runtimeNode.computedTransform,new L),f=se.transform(e.boundingSphere,u)}let d=Ye(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 Vft(e){let t=e.wireframeIndexBuffer;if(l(t))return t;let n=e.indices;if(l(n))return n.buffer}var y2=ZTe;function ml(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=L.clone(L.IDENTITY),this._computedModelMatrix2D=L.clone(L.IDENTITY),this._axisCorrectionMatrix=_t.getAxisCorrectionMatrix(t.upAxis,t.forwardAxis,new L),this._runtimeArticulations={},jft(this)}Object.defineProperties(ml.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 jft(e){let t=e._components,n=t.scene,r=e._model.modelMatrix;QTe(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 DF({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=L.IDENTITY;for(let x=0;x<d;x++){let T=n.nodes[x],C=eCe(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 i2({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 QTe(e,t){let n=e._components,i=e._model;e._computedModelMatrix=L.multiplyTransformation(t,n.transform,e._computedModelMatrix),e._computedModelMatrix=L.multiplyTransformation(e._computedModelMatrix,e._axisCorrectionMatrix,e._computedModelMatrix),e._computedModelMatrix=L.multiplyByUniformScale(e._computedModelMatrix,i.computedScale,e._computedModelMatrix)}var Hft=new h;function Gft(e,t){let n=e._computedModelMatrix,i=L.getTranslation(n,Hft);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=L.multiply(o,n,e._computedModelMatrix2D)}e._boundingSphere2D=se.transform(e._boundingSphere,e._computedModelMatrix2D,e._boundingSphere2D)}function eCe(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=L.multiplyTransformation(n,r,new L),g=eCe(e,d,p);i.push(g)}let a=new WF({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 n2({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 BF(f,a);f._nodesByName[u]=d}return c}var Wft=new h,qft=new h,Yft=new h,Xft=new h;ml.prototype.buildDrawCommands=function(e){let t=this.buildRenderResources(e);this.computeBoundingVolumes(t),this.createDrawCommands(t,e)};ml.prototype.buildRenderResources=function(e){let t=this._model,n=new r2(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 u2(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 d2(s,u);s.primitiveRenderResources[c]=d;for(let p=0;p<f.length;p++)f[p].process(d,u.primitive,e)}}return n};ml.prototype.computeBoundingVolumes=function(e){let t=this._model,n=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Wft),i=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,qft);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=L.multiplyByPoint(s,f.positionMin,Yft),p=L.multiplyByPoint(s,f.positionMax,Xft);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};ml.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=y2.buildModelDrawCommand(s,t);a.drawCommand=c}}};ml.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(hA),!l(n.classificationType)&&(n.imageBasedLighting.enabled&&t.push(IF),n.isClippingEnabled()&&t.push(MF),n.isClippingPolygonsEnabled()&&t.push(FF),n.hasSilhouette(e)&&t.push(s2),l(n.splitDirection)&&n.splitDirection!==Fo.NONE&&t.push(l2),zo.is3DTiles(n.type)&&t.push(CF),i&&t.push(SF))};ml.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)}}};ml.prototype.updateModelMatrix=function(e,t){QTe(this,e),t.mode!==re.SCENE3D&&Gft(this,t);let n=this._rootNodes;for(let i=0;i<n.length;i++){let r=this._runtimeNodes[n[i]];r._transformDirty=!0}};ml.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 tCe(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);tCe(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 wH(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];tCe(e,c,t,n,i)}}var Kft={backFaceCulling:void 0};ml.prototype.updateBackFaceCulling=function(e){let t=Kft;t.backFaceCulling=e,wH(this,!1,$ft,t)};function $ft(e,t){let n=e.drawCommand;n.backFaceCulling=t.backFaceCulling}var Jft={shadowMode:void 0};ml.prototype.updateShadows=function(e){let t=Jft;t.shadowMode=e,wH(this,!1,Zft,t)};function Zft(e,t){let n=e.drawCommand;n.shadows=t.shadowMode}var Qft={debugShowBoundingVolume:void 0};ml.prototype.updateShowBoundingVolume=function(e){let t=Qft;t.debugShowBoundingVolume=e,wH(this,!1,edt,t)};function edt(e,t){let n=e.drawCommand;n.debugShowBoundingVolume=t.debugShowBoundingVolume}var nCe=[],iCe=[],rCe=[],tdt={frameState:void 0,hasSilhouette:void 0};ml.prototype.pushDrawCommands=function(e){let t=nCe;t.length=0;let n=iCe;n.length=0;let i=rCe;i.length=0;let r=tdt;r.hasSilhouette=this._model.hasSilhouette(e),r.frameState=e,wH(this,!0,ndt,r),Xn(e.commandList,t),Xn(e.commandList,n),Xn(e.commandList,i)};function ndt(e,t){let n=t.frameState,i=t.hasSilhouette,r=n.passes,o=nCe,a=iCe,s=rCe,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)}ml.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)};ml.prototype.applyArticulations=function(){let e=this._runtimeArticulations;for(let t in e)e.hasOwnProperty(t)&&e[t].apply()};var A2=ml;function yA(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdByteLengths={},this._batchTextureIdMap=new kt}Object.defineProperties(yA.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}}});yA.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()};yA.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};yA.prototype.addTexture=function(e){this._textureIdByteLengths.hasOwnProperty(e._id)||(this.texturesByteLength+=e.sizeInBytes,this._textureIdByteLengths[e._id]=e.sizeInBytes)};yA.prototype.getTextureIds=function(){return Object.keys(this._textureIdByteLengths)};yA.prototype.getTextureByteLengthById=function(e){return this._textureIdByteLengths[e]};yA.prototype.addBatchTexture=function(e){this._batchTextureIdMap.contains(e._id)||this._batchTextureIdMap.set(e._id,e)};var b2=yA;var cCe=Go(c8(),1);var oCe={},IT=Uint32Array.BYTES_PER_ELEMENT;oCe.parse=function(e,t){t=t??0;let n=new Uint8Array(e),i=new DataView(e);t+=IT;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+=IT,t+=IT;let o=i.getUint32(t,!0);if(o===0)throw new oe("Feature table must have a byte length greater than zero");t+=IT;let a=i.getUint32(t,!0);t+=IT;let s=i.getUint32(t,!0);t+=IT;let c=i.getUint32(t,!0);t+=IT;let u=Co(n,t,o);t+=o;let f=new Uint8Array(e,t,a);t+=a;let d,p;s>0&&(d=Co(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 _m(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=rdt(g,d);if(A.rtcCenter=y,A.pointsLength=m,!A.hasPositions){let b=odt(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=sdt(g);A.normals=b,A.hasNormals=A.hasNormals||l(b)}if(!A.hasColors){let b=adt(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=cdt(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),idt(A),A};function idt(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 rdt(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 odt(e){let t=e.json,n;if(l(t.POSITION))return n=e.getPropertyArray("POSITION",Y.FLOAT,3),{name:rt.POSITION,semantic:rt.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:rt.POSITION,semantic:rt.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 adt(e){let t=e.json,n;if(l(t.RGBA))return n=e.getPropertyArray("RGBA",Y.UNSIGNED_BYTE,4),{name:rt.COLOR,semantic:rt.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:rt.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:rt.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:rt.COLOR,semantic:rt.COLOR,setIndex:0,constantColor:o,componentDatatype:Y.FLOAT,type:Vt.VEC4,isQuantized:!1,isTranslucent:a}}}function sdt(e){let t=e.json,n;if(l(t.NORMAL))return n=e.getPropertyArray("NORMAL",Y.FLOAT,3),{name:rt.NORMAL,semantic:rt.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:rt.NORMAL,semantic:rt.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 cdt(e){let t=e.json;if(l(t.BATCH_ID)){let n=e.getPropertyArray("BATCH_ID",Y.UNSIGNED_SHORT,1);return{name:rt.FEATURE_ID,semantic:rt.FEATURE_ID,setIndex:0,typedArray:n,componentDatatype:Y.fromTypedArray(n),type:Vt.SCALAR}}}var PT=oCe;var ldt=xn.Components,udt=xn.Scene,fdt=xn.Node,ddt=xn.Primitive,hdt=xn.Attribute,aCe=xn.Quantization,mdt=xn.FeatureIdAttribute,pdt=xn.Material,gdt=xn.MetallicRoughness,bQ=class extends Ji{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=yt.UNLOADED,this._buffers=[],this._components=void 0,this._transform=L.IDENTITY}get cacheKey(){}get components(){return this._components}get transform(){return this._transform}load(){if(l(this._promise))return this._promise;this._parsedContent=PT.parse(this._arrayBuffer,this._byteOffset),this._state=yt.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===yt.READY)return!0;if(this._state===yt.PROCESSING){if(l(this._decodePromise))return!1;this._decodePromise=_dt(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 _dt(e,t){let i=e._parsedContent.draco,r;if(l(i)?r=G0.decodePointCloud(i,t):r=Promise.resolve(),!!l(r))return e._decodePromise=r,r.then(function(o){if(!e.isDestroyed())return l(o)&&ydt(e,i,o),Pdt(e,t),e._state=yt.READY,e}).catch(function(o){e.unload(),e._state=yt.FAILED;let a="Failed to load Draco pnts";e._error=e.getError(a,o)})}function ydt(e,t,n){e._state=yt.READY;let i=e._parsedContent,r;if(l(n.POSITION)){if(r={name:"POSITION",semantic:rt.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:rt.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:rt.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:rt.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:rt.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:Adt(u.componentsPerAttribute),componentType:bdt(u.componentDatatype),typedArray:c.array}}i.batchTableJson=o}function Adt(e){switch(e){case 1:return"SCALAR";case 2:return"VEC2";case 3:return"VEC3";case 4:return"VEC4"}}function bdt(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 x2(e,t,n){let i=t.typedArray,r;if(t.octEncoded&&(r=new aCe,r.octEncoded=t.octEncoded,r.octEncodedZXY=t.octEncodedZXY,r.normalizationRange=t.quantizedRange,r.type=t.quantizedType,r.componentDatatype=t.quantizedComponentDatatype),t.isQuantized){r=new aCe;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 hdt;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===rt.POSITION&&a&&(o.typedArray=i),o}var sCe,IH;function xdt(e){if(!l(IH)){sCe=new cCe.default(0),IH=new Array(e);for(let t=0;t<e;++t)IH[t]=sCe.random()}return IH}var Tdt=new h,Cdt=new h,vdt=new h;function Edt(e){let t=e.typedArray,n=20,i=t.length/3,r=Math.min(i,n),o=xdt(n),a=Number.MAX_VALUE,s=-Number.MAX_VALUE,c=h.fromElements(a,a,a,Tdt),u=h.fromElements(s,s,s,Cdt),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,vdt),h.minimumByComponent(c,p,c),h.maximumByComponent(u,p,u);e.min=h.clone(c),e.max=h.clone(u)}var Sdt={name:rt.COLOR,semantic:rt.COLOR,setIndex:0,constantColor:U.DARKGRAY,componentDatatype:Y.FLOAT,type:Vt.VEC4,isQuantized:!1,isTranslucent:!1};function wdt(e,t,n){let i=[],r,o=t.positions;return l(o)&&(Edt(o),r=x2(e,o,n),r.count=t.pointsLength,i.push(r)),l(t.normals)&&(r=x2(e,t.normals,n),r.count=t.pointsLength,i.push(r)),l(t.colors)?(r=x2(e,t.colors,n),r.count=t.pointsLength,i.push(r)):(r=x2(e,Sdt,n),r.count=t.pointsLength,i.push(r)),l(t.batchIds)&&(r=x2(e,t.batchIds,n),r.count=t.pointsLength,i.push(r)),i}function Idt(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?qg({count:n??i,batchTable:r,binaryBody:o,parseAsPropertyAttributes:a,customAttributeOutput:t}):new Bs({schema:{},propertyTables:[]})}function Pdt(e,t){let n=e._parsedContent,i=new gdt;i.metallicFactor=0,i.roughnessFactor=.9;let r=new pdt;r.metallicRoughness=i;let o=n.colors;l(o)&&o.isTranslucent&&(r.alphaMode=xp.BLEND);let a=!l(n.normals);r.unlit=a;let s=new ddt;if(s.attributes=wdt(e,n,t),s.primitiveType=Re.POINTS,s.material=r,l(n.batchIds)){let g=new mdt;g.propertyTableId=0,g.setIndex=0,g.positionalLabel="featureId_0",s.featureIds.push(g)}let c=new fdt;c.index=0,c.primitives=[s];let u=new udt;u.nodes=[c],u.upAxis=ki.Z,u.forwardAxis=ki.X;let f=new ldt;f.scene=u,f.nodes=[c];let d=[];f.structuralMetadata=Idt(n,d),d.length>0&&Ddt(e,s,d,t),l(n.rtcCenter)&&(f.transform=L.multiplyByTranslation(f.transform,n.rtcCenter,f.transform));let p=n.positions;l(p)&&p.isQuantized&&(f.transform=L.multiplyByTranslation(f.transform,p.quantizedVolumeOffset,f.transform)),e._components=f,e._parsedContent=void 0,e._arrayBuffer=void 0}function Ddt(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 T2=bQ;var lCe=new h,uCe=new h,fCe=new h,Rdt=new h,Odt=new h,Mdt=new h,Ldt=new de,Ndt=new se;function xQ(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 ow(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(ys.forEachPrimitive(e,{mapProjection:c},function(u,f,d,p){if(l(u.boundingSphere)&&d.length===1){let x=se.transform(u.boundingSphere,p,Ndt),T=ci.raySphere(t,x);if(!l(T))return}if(!l(f.indices))return;let g,m,y=_t.getAttributeBySemantic(f,rt.POSITION);l(y)&&(m=Vt.getNumberOfComponents(y.type),g=ys.readAttributeAsTypedArray(y));let A;if(l(f.indices)&&(A=ys.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];xQ(g,T,m,lCe),xQ(g,C,m,uCe),xQ(g,E,m,fCe);for(let w of d){let P=L.multiplyByPoint(w.transform,lCe,Rdt),R=L.multiplyByPoint(w.transform,uCe,Odt),O=L.multiplyByPoint(w.transform,fCe,Mdt);i!==1&&(fr.getPosition(P,o,i,r,P),fr.getPosition(R,o,i,r,R),fr.getPosition(O,o,i,r,O));let N=ci.rayTriangleParametric(t,P,R,O,e.backFaceCulling??!0);l(N)&&N<s&&N>=0&&(s=N)}}}),s!==Number.MAX_VALUE){if(a=dn.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,Ldt);f.cartographicToCartesian(d,a)}return a}}var TQ=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}},C2=TQ;var CQ=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 ET(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 C2(o)}}isDestroyed(){return!1}destroy(){if(!this.isDestroyed())return this._deleteModelPrimitiveImageries(),ue(this)}},v2=CQ;function Rr(e){e=e??H.EMPTY_OBJECT,this._loader=e.loader,this._resource=e.resource,this.type=e.type??zo.GLTF,this.modelMatrix=L.clone(e.modelMatrix??L.IDENTITY),this._modelMatrix=L.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=L.clone(L.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 bF(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??fl.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 qp(e.pointCloudShading);this._pointCloudShading=o,this._attenuation=o.attenuation,this._pointCloudBackFaceCulling=o.backFaceCulling;let a=e.clippingPlanes;l(a)&&a.owner===void 0?Aa.setOwner(a,this,"_clippingPlanes"):this._clippingPlanes=a,this._clippingPlanesState=0;let s=e.clippingPolygons;l(s)&&s.owner===void 0?hm.setOwner(s,this,"_clippingPolygons"):this._clippingPolygons=s,this._clippingPolygonsState=0,this._modelImagery=new v2(this),this._lightColor=h.clone(e.lightColor),this._imageBasedLighting=l(e.imageBasedLighting)?e.imageBasedLighting:new yT,this._shouldDestroyImageBasedLighting=!l(e.imageBasedLighting),this._environmentMapManager=void 0;let c=new Ug(e.environmentMapOptions);Ug.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??qd.SURFACES_ONLY,this._debugWireframe===!0&&this._enableDebugWireframe===!1&&this.type===zo.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 St(u)),this._credits=[],this._credit=u,this._resourceCredits=[],this._gltfCredits=[],this._showCreditsOnScreen=e.showCreditsOnScreen??!1,this._showCreditsOnScreenDirty=!0,this._splitDirection=e.splitDirection??Fo.NONE,this._enableShowOutline=e.enableShowOutline??!0,this.showOutline=e.showOutline??!0,this.outlineColor=e.outlineColor??U.BLACK,this._classificationType=e.classificationType,this._statistics=new b2,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 vQ(e,t){if(e._errorEvent.numberOfListeners>0){e._errorEvent.raiseEvent(t);return}console.log(t)}function Fdt(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 TF({model:e,propertyTable:a});n.push(s)}return n}function Bdt(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 wQ(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(Rr.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){wQ(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=wQ(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 mCe(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===zo.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&&(Aa.setOwner(e,this,"_clippingPlanes"),this.resetDrawCommands())}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){e!==this._clippingPolygons&&(hm.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&&(Ug.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}}});Rr.prototype.getNode=function(e){return this._nodesByName[e]};Rr.prototype.setArticulationStage=function(e,t){this._sceneGraph.setArticulationStage(e,t)};Rr.prototype.applyArticulations=function(){this._sceneGraph.applyArticulations()};Rr.prototype.getExtension=function(e){return this._loader.components.extensions[e]};Rr.prototype.makeStyleDirty=function(){this._styleDirty=!0};Rr.prototype.resetDrawCommands=function(){this._drawCommandsBuilt=!1};var kdt=new L,zdt=new $,Udt=new L;Rr.prototype.update=function(e){let t=!1;try{t=Vdt(this,e)}catch(i){if(!this._loader.incrementallyLoadTextures&&i.name==="TextureError")vQ(this,i);else{let r=_t.getError("model",this._resource,i);vQ(this,r)}}if(jdt(this,e),Hdt(this,e),Gdt(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."));vQ(a),this._rejectLoad=this._rejectLoad&&this._rejectLoad(a)}let r=i.structuralMetadata;l(r)&&r.propertyTableCount>0&&Fdt(this,r);let o=new A2({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(Wdt(this),qdt(this),Ydt(this,e),Xdt(this),Kdt(this,e),$dt(this,e),Jdt(this,e),Zdt(this,e),Qdt(this,e),eht(this,e),tht(this,e),this._defaultTexture=e.context.defaultTexture,nht(this,e),iht(this,e),rht(this),oht(this,e),lht(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)),sht(this),uht(this,e),fht(this),dht(this,e)}};function Vdt(e,t){return!e._resourcesLoaded||e._loader.incrementallyLoadTextures&&!e._texturesLoaded?(t.afterRender.push(()=>!0),e._loader.process(t)):!0}function jdt(e,t){l(e._customShader)&&e._customShader.update(t)}function Hdt(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 Gdt(e,t){e._imageBasedLighting.update(t),e._imageBasedLighting.shouldRegenerateShaders&&e.resetDrawCommands()}function Wdt(e){if(!e._featureTableIdDirty)return;e._featureTableIdDirty=!1;let t=e._sceneGraph.components,n=t.structuralMetadata;l(n)&&n.propertyTableCount>0&&(e.featureTableId=Bdt(t,e),e._styleDirty=!0,e.resetDrawCommands())}function qdt(e){e._styleDirty&&(e.applyStyle(e._style),e._styleDirty=!1)}function Ydt(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&&hCe(e)}function hCe(e){let t=e.featureTables[e.featureTableId];e._styleCommandsNeeded=bm.getStyleCommandsNeeded(t.featuresLength,t.batchTexture.translucentFeaturesLength)}function Xdt(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 Kdt(e,t){e._silhouetteDirty&&(pCe(t)&&e.resetDrawCommands(),e._silhouetteDirty=!1)}function $dt(e,t){let n=e.hasSkipLevelOfDetail(t);n!==e._skipLevelOfDetail&&(e.resetDrawCommands(),e._skipLevelOfDetail=n)}function Jdt(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 Zdt(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 Qdt(e,t){t.mode!==e._sceneMode&&(e._projectTo2D?e.resetDrawCommands():e._updateModelMatrix=!0,e._sceneMode=t.mode)}function eht(e,t){let n=t.fog.enabled&&t.fog.renderable;n!==e._fogRenderable&&(e.resetDrawCommands(),e._fogRenderable=n)}function tht(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 nht(e,t){e._drawCommandsBuilt||(e.destroyPipelineResources(),e._sceneGraph.buildDrawCommands(t),e._drawCommandsBuilt=!0)}function iht(e,t){L.equals(e.modelMatrix,e._modelMatrix)||(e._updateModelMatrix=!0,e._modelMatrix=L.clone(e.modelMatrix,e._modelMatrix))}var AA=new h,EQ=new de;function rht(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;AA.x=i[12],AA.y=i[13],AA.z=i[14];let r=n.cartesianToCartographic(AA);l(e._clampedModelMatrix)||(e._clampedModelMatrix=L.clone(i,new L)),e._removeUpdateHeightCallback=t.updateHeight(r,dCe(e,n,r),e.heightReference);let o=t.getHeight(r,e.heightReference);if(l(o)){let a=dCe(e,n,r);de.clone(r,EQ),EQ.height=o,a(EQ)}e._heightDirty=!1,e._updateModelMatrix=!0}function oht(e,t){if(!e._updateModelMatrix&&e._minimumPixelSize===0)return;let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;mCe(e,n),aht(e,n,t)}function mCe(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 aht(e,t,n){let i=e.scale;if(e.minimumPixelSize!==0&&!e._projectTo2D){let r=n.context,o=Math.max(r.drawingBufferWidth,r.drawingBufferHeight);L.getTranslation(t,AA),e._sceneMode!==re.SCENE3D&&sr.computeActualEllipsoidPosition(n,AA,AA);let a=e._boundingSphere.radius,s=hht(AA,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 sht(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 cht=new $(1,0,0,0,0,1,0,-1,0);function lht(e,t){let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix,i=e.referenceMatrix??n,r=t.context,o=zdt,a=kdt;if(a=L.multiply(r.uniformState.view3D,i,a),o=L.getRotation(a,o),o=$.transpose(o,o),e._iblReferenceFrameMatrix=$.multiply(cht,o,e._iblReferenceFrameMatrix),e.isClippingEnabled()){let s=L.multiply(i,e._clippingPlanes.modelMatrix,Udt);e._clippingPlanesMatrix=L.inverseTranspose(s,e._clippingPlanesMatrix)}}function uht(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 fht(e){if(!e._showCreditsOnScreenDirty)return;e._showCreditsOnScreenDirty=!1,e._credits.length=0;let t=e._showCreditsOnScreen;if(l(e._credit)){let a=St.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=St.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=St.clone(r[a]);s.showOnScreen=s.showOnScreen||t,e._credits.push(s)}}function dht(e,t){let n=pht(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&&(ght(e,t),e._sceneGraph.pushDrawCommands(t))}var SQ=new se;function hht(e,t,n){return SQ.center=e,SQ.radius=t,n.camera.getPixelSize(SQ,n.context.drawingBufferWidth,n.context.drawingBufferHeight)}var PH=new h;function dCe(e,t,n){return function(i){iS(e.heightReference)&&(i.height+=n.height),t.cartographicToCartesian(i,PH);let r=e._clampedModelMatrix;L.clone(e.modelMatrix,r),r[12]=PH.x,r[13]=PH.y,r[14]=PH.z,e._heightDirty=!0}}var mht=new h;function pht(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=L.getTranslation(e.modelMatrix,mht);sr.computeActualEllipsoidPosition(t,a,a),o=h.distanceSquared(a,t.camera.positionWC)}return o>=i&&o<=r}function ght(e,t){let n=t.creditDisplay,i=e._credits,r=i.length;for(let o=0;o<r;o++)n.addCreditToNextFrame(i[o])}Rr.prototype.isTranslucent=function(){let e=this.color;return l(e)&&e.alpha>0&&e.alpha<1};Rr.prototype.isInvisible=function(){let e=this.color;return l(e)&&e.alpha===0};function pCe(e){return e.context.stencilBuffer}Rr.prototype.hasSilhouette=function(e){return pCe(e)&&this._silhouetteSize>0&&this._silhouetteColor.alpha>0&&!l(this._classificationType)};Rr.prototype.hasSkipLevelOfDetail=function(e){if(!zo.is3DTiles(this.type))return!1;let t=e.context.stencilBuffer,n=this._content.tileset;return t&&n.isSkippingLevelOfDetail};Rr.prototype.isClippingEnabled=function(){let e=this._clippingPlanes;return l(e)&&e.enabled&&e.length!==0};Rr.prototype.pick=function(e,t,n,i,r){return ow(this,e,t,n,i,r)};Rr.prototype.isClippingPolygonsEnabled=function(){let e=this._clippingPolygons;return l(e)&&e.enabled&&e.length!==0};Rr.prototype.isDestroyed=function(){return!1};Rr.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)};Rr.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};Rr.prototype.destroyModelResources=function(){let e=this._modelResources;for(let t=0;t<e.length;t++)e[t].destroy();this._modelResources.length=0};Rr.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 Rf(n),s=l(e.content)?zo.TILE_GLTF:zo.GLTF,c=n.gltfResource,u=E2(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 Rr(u),p=d._resource.credits;if(l(p)){let g=p.length;for(let m=0;m<g;m++)d._resourceCredits.push(St.clone(p[m]))}return d};Rr.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 mF(t);try{await n.load();let i=E2(n,zo.TILE_B3DM,e);return new Rr(i)}catch(i){throw n.destroy(),i}};Rr.fromPnts=async function(e){let t={arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,loadAttributesFor2D:e.projectTo2D},n=new T2(t);try{await n.load();let i=E2(n,zo.TILE_PNTS,e);return new Rr(i)}catch(i){throw n.destroy(),i}};Rr.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 _F(t);try{await n.load();let i=E2(n,zo.TILE_I3DM,e);return new Rr(i)}catch(i){throw n.destroy(),i}};Rr.fromGeoJson=async function(e){let t={geoJson:e.geoJson},n=new pF(t),i=E2(n,zo.TILE_GEOJSON,e);return new Rr(i)};var _ht=new U;Rr.prototype.applyColorAndShow=function(e){let t=U.clone(this._color,_ht),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,wQ(t,this._color)&&this.resetDrawCommands()};Rr.prototype.applyStyle=function(e){let t=this.type===zo.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),hCe(this,e)):(this.applyColorAndShow(e),this._styleCommandsNeeded=void 0)};function E2(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 Bf=Rr;var yht=1,Aht=!0,bht=0,xht=!0,Tht=!0,Cht=Rn.ENABLED,vht=it.NONE,Eht=U.RED,Sht=0,wht=U.WHITE,Iht=fl.HIGHLIGHT,Pht=.5,Dht=new z(1,1),gCe={maximumPositionEpsilon:Number.POSITIVE_INFINITY},Rht=new L,Oht=new L,_Ce=new U,yCe=new Array(4),Mht=new h;function bA(e,t){t.collectionChanged.addEventListener(bA.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._modelHash={},this._entitiesToVisualize=new kt,this._onCollectionChanged(t,t.values,[],[])}async function Lht(e,t,n,i,r){let o=e._primitives,a=e._modelHash;try{let s=await Bf.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}}bA.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,Rht),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:{...gCe}},n[a.id]=u;let m=X.getValueOrDefault(s._incrementallyLoadTextures,e,xht),y=X.getValueOrDefault(s._environmentMapOptions,e,gCe,u.environmentMapOptionsScratch);Lht(this,a,c,m,y)}let p=u.modelPrimitive;if(!l(p))continue;p.show=!0,p.scale=X.getValueOrDefault(s._scale,e,yht),p.enableVerticalExaggeration=X.getValueOrDefault(s._enableVerticalExaggeration,e,Aht),p.minimumPixelSize=X.getValueOrDefault(s._minimumPixelSize,e,bht),p.maximumScale=X.getValueOrUndefined(s._maximumScale,e),p.modelMatrix=L.clone(d,p.modelMatrix),p.shadows=X.getValueOrDefault(s._shadows,e,Cht),p.heightReference=X.getValueOrDefault(s._heightReference,e,vht),p.distanceDisplayCondition=X.getValueOrUndefined(s._distanceDisplayCondition,e),p.silhouetteColor=X.getValueOrDefault(s._silhouetteColor,e,Eht,_Ce),p.silhouetteSize=X.getValueOrDefault(s._silhouetteSize,e,Sht),p.color=X.getValueOrDefault(s._color,e,wht,_Ce),p.colorBlendMode=X.getValueOrDefault(s._colorBlendMode,e,Iht),p.colorBlendAmount=X.getValueOrDefault(s._colorBlendAmount,e,Pht),p.clippingPlanes=X.getValueOrUndefined(s._clippingPlanes,e),p.clampAnimations=X.getValueOrDefault(s._clampAnimations,e,Tht),p.imageBasedLighting.imageBasedLightingFactor=X.getValueOrDefault(s._imageBasedLightingFactor,e,Dht);let g=X.getValueOrUndefined(s._lightColor,e);if(l(g)&&(U.pack(g,yCe,0),g=h.unpack(yCe,0,Mht)),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:zu.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 P=p.getNode(E);if(!l(P))continue;let R=L.fromTranslationRotationScale(w,Oht);P.matrix=L.multiply(P.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};bA.prototype.isDestroyed=function(){return!1};bA.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(bA.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._modelHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)IQ(this,e[i],t,n);return ue(this)};var DH=new h,Nht=new de;bA.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;DH.x=s[12],DH.y=s[13],DH.z=s[14];let c=o.cartesianToCartographic(DH,Nht),u=r.getHeight(c,i.heightReference);return l(u)&&(Nu(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};bA.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)?(Fht(o,s),a.set(o.id,o)):(IQ(this,o,s,c),a.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],IQ(this,o,s,c),a.remove(o.id)};function IQ(e,t,n,i){let r=n[t.id];l(r)&&(i.removeAndDestroy(r.modelPrimitive),delete n[t.id])}function Fht(e,t){let n=t[e.id];l(n)&&(n.nodeTransformationsScratch={},n.articulationsScratch={})}var S2=bA;function ACe(e){e=e??H.EMPTY_OBJECT,this._metadata=e.metadata}Object.defineProperties(ACe.prototype,{metadata:{get:function(){return this._metadata}}});var DT=ACe;var PQ=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+=w2;let u=c.getUint32(o,!0);if(u!==1)throw new oe(`Only Composite Tile version 1 is supported. Version ${u} is not.`);o+=w2,o+=w2;let f=c.getUint32(o,!0);o+=w2;let d=i.queryParameters.compositeIndex;l(d)?d=`${d}_`:d="";let p=[];p.length=f;for(let y=0;y<f;++y){let A=Nh(s,o),b=c.getUint32(o+w2*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)}},w2=Uint32Array.BYTES_PER_ELEMENT,I2=PQ;function Bht(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}var Jp=Bht;var aw=`in vec3 position;
in float a_batchId;
uniform mat4 u_modifiedModelViewProjection;
void main()
{
gl_Position = czm_depthClamp(u_modifiedModelViewProjection * vec4(position, 1.0));
}
`;var DQ=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)})}},RQ=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)})}},ju=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)}}},kht=new DQ;Object.assign(ju,{hooks:kht,plugins:new RQ(ju),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"});ju.max_unop_len=ju.getMaxKeyLen(ju.unary_ops);ju.max_binop_len=ju.getMaxKeyLen(ju.binary_ops);var xA=e=>new ju(e).parse(),zht=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(ju).filter(e=>!zht.includes(e)&&xA[e]===void 0).forEach(e=>{xA[e]=ju[e]});xA.Jsep=ju;var Uht="ConditionalExpression",Vht={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:Uht,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 :")}})}};xA.plugins.register(Vht);var bCe={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(bCe);var Rt=bCe;function Em(e,t){this._expression=e,e=emt(e,t),e=nmt(tmt(e)),xA.addBinaryOp("=~",0),xA.addBinaryOp("!~",0);let n;try{n=xA(e)}catch(i){throw new oe(i)}this._runtimeAst=Wi(this,n)}Object.defineProperties(Em.prototype,{expression:{get:function(){return this._expression}}});var Un={arrayIndex:0,arrayArray:[[]],cartesian2Index:0,cartesian3Index:0,cartesian4Index:0,cartesian2Array:[new z],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 z),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++]}};Em.prototype.evaluate=function(e,t){Un.reset();let n=this._runtimeAst.evaluate(e);return t instanceof U&&n instanceof ae?U.fromCartesian4(n,t):n instanceof z||n instanceof h||n instanceof ae?n.clone(t):n};Em.prototype.evaluateColor=function(e,t){Un.reset();let n=this._runtimeAst.evaluate(e);return U.fromCartesian4(n,t)};Em.prototype.getShaderFunction=function(e,t,n,i){let r=this.getShaderExpression(t,n);return r=`${i} ${e}
{
return ${r};
}
`,r};Em.prototype.getShaderExpression=function(e,t){return this._runtimeAst.getShaderExpression(e,t)};Em.prototype.getVariables=function(){let e=[];return this._runtimeAst.getVariables(e),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var jht=["!","-","+"],xCe=["+","-","*","/","%","===","!==",">",">=","<","<=","&&","||","!~","=~"],P2=/\${(.*?)}/g,Hht=/\\/g,Ght="@#%",Wht=/@#%/g,MH=new U,LH={abs:Us(Math.abs),sqrt:Us(Math.sqrt),cos:Us(Math.cos),sin:Us(Math.sin),tan:Us(Math.tan),acos:Us(Math.acos),asin:Us(Math.asin),atan:Us(Math.atan),radians:Us(D.toRadians),degrees:Us(D.toDegrees),sign:Us(D.sign),floor:Us(Math.floor),ceil:Us(Math.ceil),round:Us(Math.round),exp:Us(Math.exp),exp2:Us(Yht),log:Us(Math.log),log2:Us(Xht),fract:Us(qht),length:Kht,normalize:$ht},NH={atan2:RH(Math.atan2,!1),pow:RH(Math.pow,!1),min:RH(Math.min,!0),max:RH(Math.max,!0),distance:Jht,dot:Zht,cross:Qht},LQ={clamp:TCe(D.clamp,!0),mix:TCe(D.lerp,!0)};function qht(e){return e-Math.floor(e)}function Yht(e){return Math.pow(2,e)}function Xht(e){return D.log2(e)}function Us(e){return function(t,n){if(typeof n=="number")return e(n);if(n instanceof z)return z.fromElements(e(n.x),e(n.y),Un.getCartesian2());if(n instanceof h)return h.fromElements(e(n.x),e(n.y),e(n.z),Un.getCartesian3());if(n instanceof ae)return ae.fromElements(e(n.x),e(n.y),e(n.z),e(n.w),Un.getCartesian4());throw new oe(`Function "${t}" requires a vector or number argument. Argument is ${n}.`)}}function RH(e,t){return function(n,i,r){if(t&&typeof r=="number"){if(typeof i=="number")return e(i,r);if(i instanceof z)return z.fromElements(e(i.x,r),e(i.y,r),Un.getCartesian2());if(i instanceof h)return h.fromElements(e(i.x,r),e(i.y,r),e(i.z,r),Un.getCartesian3());if(i instanceof ae)return ae.fromElements(e(i.x,r),e(i.y,r),e(i.z,r),e(i.w,r),Un.getCartesian4())}if(typeof i=="number"&&typeof r=="number")return e(i,r);if(i instanceof z&&r instanceof z)return z.fromElements(e(i.x,r.x),e(i.y,r.y),Un.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),Un.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),Un.getCartesian4());throw new oe(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i} and ${r}.`)}}function TCe(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 z&&r instanceof z)return z.fromElements(e(i.x,r.x,o),e(i.y,r.y,o),Un.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),Un.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),Un.getCartesian4())}if(typeof i=="number"&&typeof r=="number"&&typeof o=="number")return e(i,r,o);if(i instanceof z&&r instanceof z&&o instanceof z)return z.fromElements(e(i.x,r.x,o.x),e(i.y,r.y,o.y),Un.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),Un.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),Un.getCartesian4());throw new oe(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i}, ${r}, and ${o}.`)}}function Kht(e,t){if(typeof t=="number")return Math.abs(t);if(t instanceof z)return z.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 $ht(e,t){if(typeof t=="number")return 1;if(t instanceof z)return z.normalize(t,Un.getCartesian2());if(t instanceof h)return h.normalize(t,Un.getCartesian3());if(t instanceof ae)return ae.normalize(t,Un.getCartesian4());throw new oe(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function Jht(e,t,n){if(typeof t=="number"&&typeof n=="number")return Math.abs(t-n);if(t instanceof z&&n instanceof z)return z.distance(t,n);if(t instanceof 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 Zht(e,t,n){if(typeof t=="number"&&typeof n=="number")return t*n;if(t instanceof z&&n instanceof z)return z.dot(t,n);if(t instanceof 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 Qht(e,t,n){if(t instanceof h&&n instanceof h)return h.cross(t,n,Un.getCartesian3());throw new oe(`Function "${e}" requires vec3 arguments. Arguments are ${t} and ${n}.`)}function Bt(e,t,n,i,r){this._type=e,this._value=t,this._left=n,this._right=i,this._test=r,this.evaluate=void 0,dmt(this)}function emt(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 tmt(e){return e.replace(Hht,Ght)}function MQ(e){return e.replace(Wht,"\\")}function nmt(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 imt(e){let t=typeof e.value;if(e.value===null)return new Bt(Rt.LITERAL_NULL,null);if(t==="boolean")return new Bt(Rt.LITERAL_BOOLEAN,e.value);if(t==="number")return new Bt(Rt.LITERAL_NUMBER,e.value);if(t==="string")return e.value.indexOf("${")>=0?new Bt(Rt.VARIABLE_IN_STRING,e.value):new Bt(Rt.LITERAL_STRING,MQ(e.value))}function rmt(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 Bt(Rt.LITERAL_BOOLEAN,!1):new Bt(Rt.LITERAL_NULL,null):(a=Wi(e,c),s=Wi(e,n[0]),new Bt(Rt.FUNCTION_CALL,r,a,s))}else if(r==="toString")return o=Wi(e,c),new Bt(Rt.FUNCTION_CALL,r,o);throw new oe(`Unexpected function call "${r}".`)}if(r=t.callee.name,r==="color"){if(i===0)return new Bt(Rt.LITERAL_COLOR,r);if(o=Wi(e,n[0]),l(n[1])){let c=Wi(e,n[1]);return new Bt(Rt.LITERAL_COLOR,r,[o,c])}return new Bt(Rt.LITERAL_COLOR,r,[o])}else if(r==="rgb"||r==="hsl"){if(i<3)throw new oe(`${r} requires three arguments.`);return o=[Wi(e,n[0]),Wi(e,n[1]),Wi(e,n[2])],new Bt(Rt.LITERAL_COLOR,r,o)}else if(r==="rgba"||r==="hsla"){if(i<4)throw new oe(`${r} requires four arguments.`);return o=[Wi(e,n[0]),Wi(e,n[1]),Wi(e,n[2]),Wi(e,n[3])],new Bt(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]=Wi(e,n[c]);return new Bt(Rt.LITERAL_VECTOR,r,o)}else{if(r==="isNaN"||r==="isFinite")return i===0?r==="isNaN"?new Bt(Rt.LITERAL_BOOLEAN,!0):new Bt(Rt.LITERAL_BOOLEAN,!1):(o=Wi(e,n[0]),new Bt(Rt.UNARY,r,o));if(r==="isExactClass"||r==="isClass"){if(i<1||i>1)throw new oe(`${r} requires exactly one argument.`);return o=Wi(e,n[0]),new Bt(Rt.UNARY,r,o)}else if(r==="getExactClassName"){if(i>0)throw new oe(`${r} does not take any argument.`);return new Bt(Rt.UNARY,r)}else if(l(LH[r])){if(i!==1)throw new oe(`${r} requires exactly one argument.`);return o=Wi(e,n[0]),new Bt(Rt.UNARY,r,o)}else if(l(NH[r])){if(i!==2)throw new oe(`${r} requires exactly two arguments.`);return a=Wi(e,n[0]),s=Wi(e,n[1]),new Bt(Rt.BINARY,r,a,s)}else if(l(LQ[r])){if(i!==3)throw new oe(`${r} requires exactly three arguments.`);a=Wi(e,n[0]),s=Wi(e,n[1]);let c=Wi(e,n[2]);return new Bt(Rt.TERNARY,r,a,s,c)}else{if(r==="Boolean")return i===0?new Bt(Rt.LITERAL_BOOLEAN,!1):(o=Wi(e,n[0]),new Bt(Rt.UNARY,r,o));if(r==="Number")return i===0?new Bt(Rt.LITERAL_NUMBER,0):(o=Wi(e,n[0]),new Bt(Rt.UNARY,r,o));if(r==="String")return i===0?new Bt(Rt.LITERAL_STRING,""):(o=Wi(e,n[0]),new Bt(Rt.UNARY,r,o));if(r==="regExp")return omt(e,t)}}throw new oe(`Unexpected function call "${r}".`)}function omt(e,t){let n=t.arguments;if(n.length===0)return new Bt(Rt.LITERAL_REGEX,new RegExp);let i=Wi(e,n[0]),r;if(n.length>1){let o=Wi(e,n[1]);if(OQ(i)&&OQ(o)){try{r=new RegExp(MQ(String(i._value)),o._value)}catch(a){throw new oe(a)}return new Bt(Rt.LITERAL_REGEX,r)}return new Bt(Rt.REGEX,i,o)}if(OQ(i)){try{r=new RegExp(MQ(String(i._value)))}catch(o){throw new oe(o)}return new Bt(Rt.LITERAL_REGEX,r)}return new Bt(Rt.REGEX,i)}function amt(e){if(umt(e.name)){let t=fmt(e.name);return t.substr(0,8)==="tiles3d_"?new Bt(Rt.BUILTIN_VARIABLE,t):new Bt(Rt.VARIABLE,t)}else{if(e.name==="NaN")return new Bt(Rt.LITERAL_NUMBER,NaN);if(e.name==="Infinity")return new Bt(Rt.LITERAL_NUMBER,1/0);if(e.name==="undefined")return new Bt(Rt.LITERAL_UNDEFINED,void 0)}throw new oe(`${e.name} is not defined.`)}function smt(e){let t=e.property.name;if(t==="PI")return new Bt(Rt.LITERAL_NUMBER,Math.PI);if(t==="E")return new Bt(Rt.LITERAL_NUMBER,Math.E)}function cmt(e){if(e.property.name==="POSITIVE_INFINITY")return new Bt(Rt.LITERAL_NUMBER,Number.POSITIVE_INFINITY)}function lmt(e,t){if(t.object.name==="Math")return smt(t);if(t.object.name==="Number")return cmt(t);let n,i=Wi(e,t.object);return t.computed?(n=Wi(e,t.property),new Bt(Rt.MEMBER,"brackets",i,n)):(n=new Bt(Rt.LITERAL_STRING,t.property.name),new Bt(Rt.MEMBER,"dot",i,n))}function OQ(e){return e._type>=Rt.LITERAL_NULL}function umt(e){return e.substr(0,4)==="czm_"}function fmt(e){return e.substr(4)}function Wi(e,t){let n,i,r,o;if(t.type==="Literal")n=imt(t);else if(t.type==="CallExpression")n=rmt(e,t);else if(t.type==="Identifier")n=amt(t);else if(t.type==="UnaryExpression"){i=t.operator;let a=Wi(e,t.argument);if(jht.indexOf(i)>-1)n=new Bt(Rt.UNARY,i,a);else throw new oe(`Unexpected operator "${i}".`)}else if(t.type==="BinaryExpression")if(i=t.operator,r=Wi(e,t.left),o=Wi(e,t.right),xCe.indexOf(i)>-1)n=new Bt(Rt.BINARY,i,r,o);else throw new oe(`Unexpected operator "${i}".`);else if(t.type==="LogicalExpression")i=t.operator,r=Wi(e,t.left),o=Wi(e,t.right),xCe.indexOf(i)>-1&&(n=new Bt(Rt.BINARY,i,r,o));else if(t.type==="ConditionalExpression"){let a=Wi(e,t.test);r=Wi(e,t.consequent),o=Wi(e,t.alternate),n=new Bt(Rt.CONDITIONAL,"?",r,o,a)}else if(t.type==="MemberExpression")n=lmt(e,t);else if(t.type==="ArrayExpression"){let a=[];for(let s=0;s<t.elements.length;s++)a[s]=Wi(e,t.elements[s]);n=new Bt(Rt.ARRAY,a)}else throw t.type==="Compound"?new oe("Provide exactly one expression."):new oe("Cannot parse expression.");return n}function dmt(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(LH[e._value])&&(e.evaluate=mmt(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(NH[e._value])&&(e.evaluate=pmt(e._value)):e._type===Rt.TERNARY?e.evaluate=gmt(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=hmt):e.evaluate=e._evaluateLiteral}function hmt(e){return l(e)?e.content.tileset.timeSinceLoad:0}function mmt(e){let t=LH[e];return function(n){let i=this._left.evaluate(n);return t(e,i)}}function pmt(e){let t=NH[e];return function(n){let i=this._left.evaluate(n),r=this._right.evaluate(n);return t(e,i,r)}}function gmt(e){let t=LQ[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 FH(e,t){if(l(e))return e.getPropertyInherited(t)}Bt.prototype._evaluateLiteral=function(){return this._value};Bt.prototype._evaluateLiteralColor=function(e){let t=MH,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,Un.getCartesian4())};Bt.prototype._evaluateLiteralVector=function(e){let t=Un.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 z)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 z.fromArray(t,0,Un.getCartesian2());if(n==="vec3")return h.fromArray(t,0,Un.getCartesian3());if(n==="vec4")return ae.fromArray(t,0,Un.getCartesian4())};Bt.prototype._evaluateLiteralString=function(){return this._value};Bt.prototype._evaluateVariableString=function(e){let t=this._value,n=P2.exec(t);for(;n!==null;){let i=n[0],r=n[1],o=FH(e,r);l(o)||(o=""),t=t.replace(i,o),P2.lastIndex+=o.length-i.length,n=P2.exec(t)}return t};Bt.prototype._evaluateVariable=function(e){return FH(e,this._value)};function RT(e){return e._value==="feature"}Bt.prototype._evaluateMemberDot=function(e){if(RT(this._left))return FH(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof z||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]};Bt.prototype._evaluateMemberBrackets=function(e){if(RT(this._left))return FH(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof z||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]};Bt.prototype._evaluateArray=function(e){let t=[];for(let n=0;n<this._value.length;n++)t[n]=this._value[n].evaluate(e);return t};Bt.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};Bt.prototype._evaluateNegative=function(e){let t=this._left.evaluate(e);if(t instanceof z)return z.negate(t,Un.getCartesian2());if(t instanceof h)return h.negate(t,Un.getCartesian3());if(t instanceof ae)return ae.negate(t,Un.getCartesian4());if(typeof t=="number")return-t;throw new oe(`Operator "-" requires a vector or number argument. Argument is ${t}.`)};Bt.prototype._evaluatePositive=function(e){let t=this._left.evaluate(e);if(!(t instanceof z||t instanceof h||t instanceof ae||typeof t=="number"))throw new oe(`Operator "+" requires a vector or number argument. Argument is ${t}.`);return t};Bt.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};Bt.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};Bt.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};Bt.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};Bt.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};Bt.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};Bt.prototype._evaluatePlus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof z&&t instanceof z)return z.add(t,n,Un.getCartesian2());if(n instanceof h&&t instanceof h)return h.add(t,n,Un.getCartesian3());if(n instanceof ae&&t instanceof ae)return ae.add(t,n,Un.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}.`)};Bt.prototype._evaluateMinus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof z&&t instanceof z)return z.subtract(t,n,Un.getCartesian2());if(n instanceof h&&t instanceof h)return h.subtract(t,n,Un.getCartesian3());if(n instanceof ae&&t instanceof ae)return ae.subtract(t,n,Un.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}.`)};Bt.prototype._evaluateTimes=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof z&&t instanceof z)return z.multiplyComponents(t,n,Un.getCartesian2());if(n instanceof z&&typeof t=="number")return z.multiplyByScalar(n,t,Un.getCartesian2());if(t instanceof z&&typeof n=="number")return z.multiplyByScalar(t,n,Un.getCartesian2());if(n instanceof h&&t instanceof h)return h.multiplyComponents(t,n,Un.getCartesian3());if(n instanceof h&&typeof t=="number")return h.multiplyByScalar(n,t,Un.getCartesian3());if(t instanceof h&&typeof n=="number")return h.multiplyByScalar(t,n,Un.getCartesian3());if(n instanceof ae&&t instanceof ae)return ae.multiplyComponents(t,n,Un.getCartesian4());if(n instanceof ae&&typeof t=="number")return ae.multiplyByScalar(n,t,Un.getCartesian4());if(t instanceof ae&&typeof n=="number")return ae.multiplyByScalar(t,n,Un.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}.`)};Bt.prototype._evaluateDivide=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof z&&t instanceof z)return z.divideComponents(t,n,Un.getCartesian2());if(t instanceof z&&typeof n=="number")return z.divideByScalar(t,n,Un.getCartesian2());if(n instanceof h&&t instanceof h)return h.divideComponents(t,n,Un.getCartesian3());if(t instanceof h&&typeof n=="number")return h.divideByScalar(t,n,Un.getCartesian3());if(n instanceof ae&&t instanceof ae)return ae.divideComponents(t,n,Un.getCartesian4());if(t instanceof ae&&typeof n=="number")return ae.divideByScalar(t,n,Un.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}.`)};Bt.prototype._evaluateMod=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof z&&t instanceof z)return z.fromElements(t.x%n.x,t.y%n.y,Un.getCartesian2());if(n instanceof h&&t instanceof h)return h.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,Un.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,Un.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}.`)};Bt.prototype._evaluateEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof z&&t instanceof z||n instanceof h&&t instanceof h||n instanceof ae&&t instanceof ae?t.equals(n):t===n};Bt.prototype._evaluateNotEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof z&&t instanceof z||n instanceof h&&t instanceof h||n instanceof ae&&t instanceof ae?!t.equals(n):t!==n};Bt.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)};Bt.prototype._evaluateNaN=function(e){return isNaN(this._left.evaluate(e))};Bt.prototype._evaluateIsFinite=function(e){return isFinite(this._left.evaluate(e))};Bt.prototype._evaluateIsExactClass=function(e){return l(e)?e.isExactClass(this._left.evaluate(e)):!1};Bt.prototype._evaluateIsClass=function(e){return l(e)?e.isClass(this._left.evaluate(e)):!1};Bt.prototype._evaluateGetExactClassName=function(e){if(l(e))return e.getExactClassName()};Bt.prototype._evaluateBooleanConversion=function(e){return!!this._left.evaluate(e)};Bt.prototype._evaluateNumberConversion=function(e){return Number(this._left.evaluate(e))};Bt.prototype._evaluateStringConversion=function(e){return String(this._left.evaluate(e))};Bt.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};Bt.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)};Bt.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}.`)};Bt.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}.`)};Bt.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};Bt.prototype._evaluateToString=function(e){let t=this._left.evaluate(e);if(t instanceof RegExp||t instanceof z||t instanceof h||t instanceof ae)return String(t);throw new oe(`Unexpected function call "${this._value}".`)};function CCe(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,MH)}function vCe(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=MH;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 TA(e){return e%1===0?e.toFixed(1):e.toString()}function _mt(e){let t=TA(e.red),n=TA(e.green),i=TA(e.blue);return`vec3(${t}, ${n}, ${i})`}function OH(e){let t=TA(e.red),n=TA(e.green),i=TA(e.blue),r=TA(e.alpha);return`vec4(${t}, ${n}, ${i}, ${r})`}function ECe(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 SCe(e,t){return l(t[e])?t[e]:Em.NULL_SENTINEL}Em.NULL_SENTINEL="czm_infinity";Bt.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=ECe(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=ECe(this._value,e,t,this));let u,f,d;switch(s){case Rt.VARIABLE:return RT(this)?void 0:SCe(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(LH[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(NH[c])?`${c}(${r}, ${o})`:`(${r} ${c} ${o})`;case Rt.TERNARY:if(l(LQ[c]))return`${c}(${r}, ${o}, ${a})`;break;case Rt.CONDITIONAL:return`(${a} ? ${r} : ${o})`;case Rt.MEMBER:return RT(this._left)?SCe(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 Em.NULL_SENTINEL;case Rt.LITERAL_BOOLEAN:return c?"true":"false";case Rt.LITERAL_NUMBER:return TA(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"||RT(n._left)))return c;if(i=U.fromCssColorString(c,MH),l(i))return _mt(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=vCe(this),l(i)?OH(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=vCe(this),l(i)?OH(i):`vec4(${u[0]} / 255.0, ${u[1]} / 255.0, ${u[2]} / 255.0, ${u[3]})`;if(c==="hsl")return i=CCe(this),l(i)?OH(i):`vec4(czm_HSLToRGB(vec3(${u[0]}, ${u[1]}, ${u[2]})), 1.0)`;if(c==="hsla")return i=CCe(this),l(i)?(i.alpha!==1&&(t.translucent=!0),OH(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 Em.NULL_SENTINEL;case Rt.BUILTIN_VARIABLE:if(c==="tiles3d_tileset_time")return c}};Bt.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:RT(this)||e.push(a);break;case Rt.VARIABLE_IN_STRING:for(s=P2.exec(a);s!==null;)e.push(s[1]),s=P2.exec(a);break;case Rt.LITERAL_STRING:l(t)&&t._type===Rt.MEMBER&&RT(t._left)&&e.push(a);break}};var Jd=Em;function n_(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(n_.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}}});var ymt={position:0,a_batchId:1};function Amt(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 bmt(e,t){if(l(e._sp))return;let n=e._batchTable,i=e._attributeLocations??ymt,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)(aw),c=n.getFragmentShaderCallback(!1,void 0,!0)(tA);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:[aw]}),f=new Ge({defines:["VECTOR_TILE"],sources:[tA]}),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 wCe(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:lc.LESS_OR_EQUAL},depthMask:!1}}var xmt={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:Qt.PRE_MULTIPLIED_ALPHA_BLEND},Tmt={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 Cmt(e){l(e._rsStencilDepthPass)||(e._rsStencilDepthPass=je.fromCache(wCe(!1)),e._rsStencilDepthPass3DTiles=je.fromCache(wCe(!0)),e._rsColorPass=je.fromCache(xmt),e._rsPickPass=je.fromCache(Tmt))}var OT=new L,ICe=new h;function vmt(e,t){if(l(e._uniformMap))return;let n={u_modifiedModelViewProjection:function(){let i=t.uniformState.view,r=t.uniformState.projection;return L.clone(i,OT),L.multiplyByPoint(OT,e._center,ICe),L.setTranslation(OT,ICe,OT),L.multiply(r,OT,OT),OT},u_highlightColor:function(){return e._highlightColor}};e._uniformMap=e._batchTable.getUniformMapCallback()(n)}function NQ(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 Emt(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=NQ(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=NQ(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=NQ(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 FQ(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 Smt(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=FQ(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=FQ(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=FQ(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 wmt(e,t){return t.color.toRgba()-e.color.toRgba()}function Imt(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(wmt),t.webgl2?Smt(e,n):Emt(e,n),e._framesSinceLastRebatch=0,e._batchDirty=!1,e._pickCommandsDirty=!0,e._wireframeDirty=!0,!0}function Pmt(e,t){let n=Imt(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??L.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 Dmt(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 Rmt(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??L.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}n_.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 Qa(e,o)}};n_.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function Omt(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 Mmt=new U,Lmt=U.WHITE,Nmt=!0,Fmt=/\$/;n_.prototype.applyStyle=function(e,t){if(!l(e)){Omt(this,t);return}let n=e.color,i=n instanceof Jd&&!Fmt.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,Mmt):Lmt,c.show=l(e.show)?e.show.evaluate(c):Nmt}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}};n_.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 Jp({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 Jp({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 PCe(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 Bmt(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 kmt(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}n_.prototype.update=function(e){let t=e.context;Amt(this,t),bmt(this,t),Cmt(this),vmt(this,t);let n=e.passes;n.render&&(Pmt(this,t),Dmt(this,e),kmt(this),this._debugWireframe?Bmt(e,this._commands):PCe(this,e,this._commands,this._commandsIgnoreShow)),n.pick&&(Rmt(this),PCe(this,e,this._pickCommands))};n_.prototype.isDestroyed=function(){return!1};n_.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 MT=n_;function kf(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(kf.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}}});kf.packedBoxLength=L.packedLength+h.packedLength;kf.packedCylinderLength=L.packedLength+2;kf.packedEllipsoidLength=L.packedLength+h.packedLength;kf.packedSphereLength=h.packedLength+1;function zmt(e){let t=new Float64Array(L.packedLength+h.packedLength),n=0;return h.pack(e._center,t,n),n+=h.packedLength,L.pack(e._modelMatrix,t,n),t}function Umt(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 Jp({color:u,offset:f,count:d,batchIds:g})}return i}var Vmt=new Yn("createVectorTileGeometries",5),jmt=new U;function Hmt(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,jmt);u[A]=b.toRgba()}f=e._packedBuffer=zmt(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=Vmt.scheduleTask(p,d);return l(g)?g.then(function(m){if(e.isDestroyed())return;let y=new Float64Array(m.packedBuffer);Umt(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),Gmt(e),e._ready=!0}).catch(m=>{e.isDestroyed()||(e._error=m)}):void 0}}function Gmt(e){l(e._primitive)||(e._primitive=new MT({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)}kf.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};kf.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};kf.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};kf.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};kf.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=Hmt(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)};kf.prototype.isDestroyed=function(){return!1};kf.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};var i_=kf;var BQ=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,Ymt(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 DCe(this),this._features[t]}applyDebugSettings(t,n){l(this._geometries)&&this._geometries.applyDebugSettings(t,n)}applyStyle(t){DCe(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 Wmt(e){return function(t,n){l(e._geometries)&&e._geometries.updateCommands(t,n)}}function qmt(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 LT=Uint32Array.BYTES_PER_ELEMENT;function Ymt(e,t,n){n=n??0;let i=new Uint8Array(t),r=new DataView(t);n+=LT;let o=r.getUint32(n,!0);if(o!==1)throw new oe(`Only Geometry tile version 1 is supported. Version ${o} is not.`);n+=LT;let a=r.getUint32(n,!0);if(n+=LT,a===0){e._ready=!0;return}let s=r.getUint32(n,!0);if(n+=LT,s===0)throw new oe("Feature table must have a byte length greater than zero");let c=r.getUint32(n,!0);n+=LT;let u=r.getUint32(n,!0);n+=LT;let f=r.getUint32(n,!0);n+=LT;let d=Co(i,n,s);n+=s;let p=new Uint8Array(t,n,c);n+=c;let g,m;u>0&&(g=Co(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 ym(e,T,g,m,Wmt(e));if(e._batchTable=C,T===0)return;let E=e.tile.computedTransform,w;l(d.RTC_CENTER)&&(w=h.unpack(d.RTC_CENTER),L.multiplyByPoint(E,w,w));let P=qmt(d,p);if(y>0||A>0||b>0||x>0){let R,O,N,_;if(y>0){let v=p.byteOffset+d.BOXES.byteOffset;R=new Float32Array(p.buffer,v,i_.packedBoxLength*y)}if(A>0){let v=p.byteOffset+d.CYLINDERS.byteOffset;O=new Float32Array(p.buffer,v,i_.packedCylinderLength*A)}if(b>0){let v=p.byteOffset+d.ELLIPSOIDS.byteOffset;N=new Float32Array(p.buffer,v,i_.packedEllipsoidLength*b)}if(x>0){let v=p.byteOffset+d.SPHERES.byteOffset;_=new Float32Array(p.buffer,v,i_.packedSphereLength*x)}return e._geometries=new i_({boxes:R,boxBatchIds:P.boxes,cylinders:O,cylinderBatchIds:P.cylinders,ellipsoids:N,ellipsoidBatchIds:P.ellipsoids,spheres:_,sphereBatchIds:P.spheres,center:w,modelMatrix:E,batchTable:C,boundingVolume:e.tile.boundingVolume.boundingVolume}),e}return Promise.resolve(e)}function DCe(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 D2=BQ;var CA={};CA.parseAllBoundingVolumeSemantics=function(e,t){return{boundingVolume:CA.parseBoundingVolumeSemantic(e,t),minimumHeight:CA._parseMinimumHeight(e,t),maximumHeight:CA._parseMaximumHeight(e,t)}};CA.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}};CA._parseMinimumHeight=function(e,t){let n=`${e}_MINIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};CA._parseMaximumHeight=function(e,t){let n=`${e}_MAXIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};var vA=CA;var sw=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 $0.fromSubtreeJson(i,r,s,c,u),d=new e(t,n,i);return d._implicitSubtree=f,Xmt(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 Xmt(e,t){let n=e._tile,i=e._implicitCoordinates.childIndex,r=$mt(e,t,n,i),o=e._tileset.statistics;n.children.push(r.rootTile),o.numberOfTilesTotal++;let a=Kmt(e,t,r.bottomRow);for(let s=0;s<a.length;s++){let c=a[s],u=c.tile,f=opt(e,u,c.childIndex);u.children.push(f),o.numberOfTilesTotal++}}function Kmt(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 $mt(e,t,n,i){let a=RCe(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=RCe(e,t,b,x,y);b.children.push(T),s.numberOfTilesTotal++,u.push(T)}c=u,u=[]}return{rootTile:a,bottomRow:c}}function OCe(e,t,n){let i=Cd.TILE_GEOMETRIC_ERROR;return l(e)&&e.hasPropertyBySemantic(i)?e.getPropertyBySemantic(i):t.geometricError/Math.pow(2,n.level)}function RCe(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=vA.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=Qmt(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},O;if(t.contentPropertyTableJsons.length>0){let _=t.getContentMetadataView(s,E);O=vA.parseAllBoundingVolumeSemantics("CONTENT",_)}let N=ept(g,O);l(N)&&(R.boundingVolume=N),m.push(Ot(R,a.contentHeaders[E]))}let y=OCe(c,a,s),A={boundingVolume:g,geometricError:y,refine:a.refine,contents:m},b=!0,x=Ye(a.tileHeader,b);delete x.boundingVolume,delete x.transform,delete x.metadata;let T=Ot(A,x,b),C=BCe(e,a.baseResource,T,n);return C.implicitCoordinates=s,C.implicitSubtree=t,C.metadata=c,C.hasImplicitContentMetadata=p,C}function BH(e,t){return l(e)&&l(t)&&(l(t.minimumHeight)||l(t.maximumHeight))&&($i(e,"3DTILES_bounding_volume_S2")||l(e.region))}function zQ(e,t){l(t)&&($i(e,"3DTILES_bounding_volume_S2")?Zmt(e.extensions["3DTILES_bounding_volume_S2"],t.minimumHeight,t.maximumHeight):l(e.region)&&Jmt(e.region,t.minimumHeight,t.maximumHeight))}function Jmt(e,t,n){l(t)&&(e[4]=t),l(n)&&(e[5]=n)}function Zmt(e,t,n){l(t)&&(e.minimumHeight=t),l(n)&&(e.maximumHeight=n)}function Qmt(e,t,n,i,r,o){let a;return!l(o)||!l(o.boundingVolume)||!BH(o.boundingVolume,o)&&BH(e.boundingVolume,o)?a=MCe(e,t,n,i??!1,r):a=o.boundingVolume,zQ(a,o),a}function ept(e,t){let n;return l(t)&&(n=t.boundingVolume),BH(n,t)?zQ(n,t):BH(e,t)&&(n=Ye(e,!0),zQ(n,t)),n}function MCe(e,t,n,i,r){let o=e.boundingVolume;return $i(o,"3DTILES_bounding_volume_S2")?LCe(i,r,n,t.level,t.x,t.y,t.z):l(o.region)?{region:FCe(o.region,t.level,t.x,t.y,t.z)}:{box:NCe(o.box,t.level,t.x,t.y,t.z)}}function LCe(e,t,n,i,r,o,a){let s=t._boundingVolume;if(e)return{extensions:{"3DTILES_bounding_volume_S2":{token:gg.getTokenFromId(s.s2Cell._cellId),minimumHeight:s.minimumHeight,maximumHeight:s.maximumHeight}}};let c=Number(t._boundingVolume.s2Cell._cellId>>BigInt(61)),u=c%2===0?PE.encode2D(i,r,o):PE.encode2D(i,o,r),f=gg.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:gg.getTokenFromId(f._cellId),minimumHeight:d,maximumHeight:p}}}}var tpt=new h,npt=new h,kQ=new h,ipt=new $;function NCe(e,t,n,i,r){if(t===0)return e;let o=h.unpack(e,0,npt),a=$.unpack(e,3,ipt),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,tpt);l(r)&&(f=-1+(2*r+1)*s,d.z=s);let p=h.fromElements(c,u,f,kQ);p=$.multiplyByVector(a,p,kQ),p=h.add(p,o,kQ);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 rpt=new ie;function FCe(e,t,n,i,r){if(t===0)return e.slice();let o=ie.unpack(e,0,rpt),a=e[4],s=e[5],c=Math.pow(2,-t),u=c*o.width,f=D.negativePiToPi(o.west+n*u),d=D.negativePiToPi(f+u),p=c*o.height,g=D.negativePiToPi(o.south+i*p),m=D.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 opt(e,t,n){let i=e._implicitTileset,r=t.implicitCoordinates.getChildCoordinates(n),o=MCe(i,r,n,!1,t),a=OCe(void 0,i,r),s=i.subtreeUriTemplate.getDerivedResource({templateValues:r.getTemplateValues()}).url,c={boundingVolume:o,geometricError:a,refine:i.refine,contents:[{uri:s}]},u=BCe(e,i.baseResource,c,t);return u.implicitTileset=i,u.implicitCoordinates=r,u}function BCe(e,t,n,i){let r=e._tile.constructor;return new r(e._tileset,t,n,i)}sw._deriveBoundingBox=NCe;sw._deriveBoundingRegion=FCe;sw._deriveBoundingVolumeS2=LCe;var cw=sw;var UQ=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:zu.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=R2(t,n,o,{gltf:r,basePath:i}),c=t.vectorClassificationOnly?void 0:t.classificationType;s.classificationType=c;let u=await Bf.fromGltfAsync(s);return o._model=u,o}static async fromB3dm(t,n,i,r,o){let a=new e(t,n,i),c=R2(t,n,a,{arrayBuffer:r,byteOffset:o,resource:i}),u=t.vectorClassificationOnly?void 0:t.classificationType;c.classificationType=u;let f=await Bf.fromB3dm(c);return a._model=f,a}static async fromI3dm(t,n,i,r,o){let a=new e(t,n,i),c=R2(t,n,a,{arrayBuffer:r,byteOffset:o,resource:i}),u=await Bf.fromI3dm(c);return a._model=u,a}static async fromPnts(t,n,i,r,o){let a=new e(t,n,i),c=R2(t,n,a,{arrayBuffer:r,byteOffset:o,resource:i}),u=await Bf.fromPnts(c);return a._model=u,a}static async fromGeoJson(t,n,i,r){let o=new e(t,n,i),s=R2(t,n,o,{geoJson:r,resource:i}),c=await Bf.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 R2(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 zf=UQ;var VQ=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)}},O2=VQ;function apt(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 NT=apt;var spt=new de,Sm=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),lw(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),lw(this)}get pointSize(){return this._pointSize}set pointSize(t){this._pointSize=t,lw(this)}get pointOutlineColor(){return this._pointOutlineColor}set pointOutlineColor(t){this._pointOutlineColor=U.clone(t,this._pointOutlineColor),lw(this)}get pointOutlineWidth(){return this._pointOutlineWidth}set pointOutlineWidth(t){this._pointOutlineWidth=t,lw(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,spt);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&&lw(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 Qa.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(Sm,"defaultColor",U.WHITE),at(Sm,"defaultPointOutlineColor",U.BLACK),at(Sm,"defaultPointOutlineWidth",0),at(Sm,"defaultPointSize",8);function lw(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??Sm.defaultColor,i=e._pointOutlineColor??Sm.defaultPointOutlineColor,r=e._pointOutlineWidth??Sm.defaultPointOutlineWidth,o=e._pointSize??Sm.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,NT(f,d,p,r,o))}var r_=Sm;var M2=`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 Uf(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=tr.fromType(tr.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=L.clone(t.modelMatrix)),this._modelMatrix=i,this._segments=Qi.wrapLongitude(this._actualPositions,i),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(zCe),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 kCe=Uf.POSITION_INDEX=0,cpt=Uf.SHOW_INDEX=1,lpt=Uf.WIDTH_INDEX=2,upt=Uf.MATERIAL_INDEX=3,L2=Uf.POSITION_SIZE_INDEX=4,fpt=Uf.DISTANCE_DISPLAY_CONDITION=5,zCe=Uf.NUMBER_OF_PROPERTIES=6;function o_(e,t){++e._propertiesChanged[t];let n=e._polylineCollection;l(n)&&(n._updatePolyline(e,t),e._dirty=!0)}Object.defineProperties(Uf.prototype,{show:{get:function(){return this._show},set:function(e){e!==this._show&&(this._show=e,o_(this,cpt))}},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)&&o_(this,L2),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),o_(this,kCe),this.update()}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,o_(this,upt))}},width:{get:function(){return this._width},set:function(e){let t=this._width;e!==t&&(this._width=e,o_(this,lpt))}},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,o_(this,L2)}}},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),o_(this,fpt))}}});Uf.prototype.update=function(){let e=L.IDENTITY;l(this._polylineCollection)&&(e=this._polylineCollection.modelMatrix);let t=this._segments.positions.length,n=this._segments.lengths,i=this._propertiesChanged[kCe]>0||this._propertiesChanged[L2]>0;if((!L.equals(e,this._modelMatrix)||i)&&(this._segments=Qi.wrapLongitude(this._actualPositions,e),this._boundingVolumeWC=se.transform(this._boundingVolume,e,this._boundingVolumeWC)),this._modelMatrix=L.clone(e,this._modelMatrix),this._segments.positions.length!==t)o_(this,L2);else{let r=n.length;for(let o=0;o<r;++o)if(n[o]!==this._segments.lengths[o]){o_(this,L2);break}}};Uf.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._polylineCollection,id:this._id})),this._pickId};Uf.prototype._clean=function(){this._dirty=!1;let e=this._propertiesChanged;for(let t=0;t<zCe-1;++t)e[t]=0};Uf.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._material=this._material&&this._material.destroy(),this._polylineCollection=void 0};var Zd=Uf;var dpt=Zd.SHOW_INDEX,hpt=Zd.WIDTH_INDEX,HQ=Zd.POSITION_INDEX,mpt=Zd.MATERIAL_INDEX,UCe=Zd.POSITION_SIZE_INDEX,ppt=Zd.DISTANCE_DISPLAY_CONDITION,YCe=Zd.NUMBER_OF_PROPERTIES,Hu={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 wm(e){e=e??H.EMPTY_OBJECT,this.show=e.show??!0,this.modelMatrix=L.clone(e.modelMatrix??L.IDENTITY),this._modelMatrix=L.clone(L.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(YCe),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(wm.prototype,{length:{get:function(){return GQ(this),this._polylines.length}}});wm.prototype.add=function(e){let t=new Zd(e,this);return t._index=this._polylines.length,this._polylines.push(t),this._createVertexArray=!0,this._createBatchTable=!0,t};wm.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};wm.prototype.removeAll=function(){WQ(this),ZCe(this),this._polylineBuckets={},this._polylinesRemoved=!1,this._polylines.length=0,this._polylinesToUpdate.length=0,this._createVertexArray=!0};wm.prototype.contains=function(e){return l(e)&&e._polylineCollection===this};wm.prototype.get=function(e){return GQ(this),this._polylines[e]};function gpt(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 jx(t,n,e._polylines.length)}var XCe=new vn,KCe=new ae,$Ce=new z;wm.prototype.update=function(e){if(GQ(this),this._polylines.length===0||!this.show)return;Tpt(this,e);let t=e.context,n=e.mapProjection,i,r=this._propertiesChanged;if(this._createBatchTable){if(Lt.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.");gpt(this,t),this._createBatchTable=!1}if(this._createVertexArray||ypt(this))HCe(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[UCe]||r[mpt])HCe(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[HQ]&&p.writeUpdate(g,i,this._positionBuffer,n);break}g+=f[m].lengthOfPositions}if((r[dpt]||r[hpt])&&this._batchTable.setBatchedAttribute(i._index,0,new z(i._width,i._show)),this._batchTable.attributes.length>2){if(r[HQ]||r[UCe]){let m=e.mode===re.SCENE2D?i._boundingVolume2D:i._boundingVolumeWC,y=vn.fromCartesian(m.center,XCe),A=ae.fromElements(y.low.x,y.low.y,y.low.z,m.radius,KCe);this._batchTable.setBatchedAttribute(i._index,2,y.high),this._batchTable.setBatchedAttribute(i._index,3,A)}if(r[ppt]){let m=$Ce;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<YCe;++c)r[c]=0;let o=L.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:Qt.ALPHA_BLEND,depthMask:!s,depthTest:{enabled:s}})),this._batchTable.update(e),a.render||a.pick){let c=this._colorCommands;_pt(this,e,c,o)}};var N2=new se,VCe=new se;function _pt(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,P=w.length,R,O,N=0,_,v;for(let S=0;S<P;++S){let I=w[S],M=bpt(I._material);if(M!==R){if(l(R)&&N>0){let j=O.isTranslucent();s>=a?(_=new nt({owner:e}),n.push(_)):_=n[s],++s,v=Ot(p(O._uniforms),e._uniformMap),_.boundingVolume=se.clone(N2,_.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(_)}O=I._material,O.update(r),R=M}let F=I._locatorBuckets,V=F.length;for(let j=0;j<V;++j){let B=F[j];B.locator===T&&(N+=B.count)}let k;t.mode===re.SCENE3D?k=I._boundingVolumeWC:t.mode===re.COLUMBUS_VIEW?k=I._boundingVolume2D:t.mode===re.SCENE2D?l(I._boundingVolume2D)&&(k=se.clone(I._boundingVolume2D,VCe),k.center.x=0):l(I._boundingVolumeWC)&&l(I._boundingVolume2D)&&(k=se.union(I._boundingVolumeWC,I._boundingVolume2D,VCe)),c?(c=!1,se.clone(k,N2)):se.union(k,N2,N2)}l(R)&&N>0&&(s>=a?(_=new nt({owner:e}),n.push(_)):_=n[s],++s,v=Ot(p(O._uniforms),e._uniformMap),_.boundingVolume=se.clone(N2,_.boundingVolume),_.modelMatrix=i,_.shaderProgram=E,_.vertexArray=y.va,_.renderState=O.isTranslucent()?e._translucentRS:e._opaqueRS,_.pass=O.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}wm.prototype.isDestroyed=function(){return!1};wm.prototype.destroy=function(){return JCe(this),WQ(this),ZCe(this),this._batchTable=this._batchTable&&this._batchTable.destroy(),ue(this)};function ypt(e){let t=!1,n=e._propertiesChanged,i=e._positionBufferUsage;return n[HQ]?(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 jCe=[0,0,0];function HCe(e,t,n){e._createVertexArray=!1,WQ(e),JCe(e),xpt(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 P;l(b)&&(P=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,O=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),I=Ze.createIndexBuffer({context:t,typedArray:S,usage:Oe.STATIC_DRAW,indexDatatype:Ve.UNSIGNED_SHORT});N+=s[v];let M=6*(v*(R*D.SIXTY_FOUR_KILOBYTES)-N*R),F=R+M,V=R+F,k=R+V,j=R+k,B=R+j,G=v*(O*D.SIXTY_FOUR_KILOBYTES)-N*O,W=[{index:Hu.position3DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:M,strideInBytes:6*R},{index:Hu.position3DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:F,strideInBytes:6*R},{index:Hu.position2DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:M,strideInBytes:6*R},{index:Hu.position2DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:F,strideInBytes:6*R},{index:Hu.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:V,strideInBytes:6*R},{index:Hu.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:k,strideInBytes:6*R},{index:Hu.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:V,strideInBytes:6*R},{index:Hu.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:k,strideInBytes:6*R},{index:Hu.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:j,strideInBytes:6*R},{index:Hu.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:B,strideInBytes:6*R},{index:Hu.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:j,strideInBytes:6*R},{index:Hu.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:B,strideInBytes:6*R},{index:Hu.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:Y.FLOAT,vertexBuffer:e._texCoordExpandAndBatchIndexBuffer,offsetInBytes:G}],Q,q,J,Z;m===re.SCENE3D?(q=e._positionBuffer,Q="vertexBuffer",J=jCe,Z="value"):m===re.SCENE2D||m===re.COLUMBUS_VIEW?(q=jCe,Q="value",J=e._positionBuffer,Z="vertexBuffer"):(q=P,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:I});e._vertexArrays.push({va:ce,buckets:u[v]})}}}function Apt(e,t){return t instanceof Ct?t.id:t}var kH=[];function bpt(e){let t=tr._uniformList[e.type],n=t.length;kH.length=2*n;let i=0;for(let r=0;r<n;++r){let o=t[r];kH[i]=o,kH[i+1]=e._uniforms[o](),i+=2}return`${e.type}:${JSON.stringify(kH,Apt)}`}function xpt(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 Zp(c,t,n)),u.addPolyline(s)}}}function Tpt(e,t){let n=t.mode;(e._mode!==n||!L.equals(e._modelMatrix,e.modelMatrix))&&(e._mode=n,e._modelMatrix=L.clone(e.modelMatrix),e._createVertexArray=!0)}function GQ(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 WQ(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 JCe(e){let t=e._vertexArrays.length;for(let n=0;n<t;++n)e._vertexArrays[n].va.destroy();e._vertexArrays.length=0}wm.prototype._updatePolyline=function(e,t){this._polylinesUpdated=!0,e._dirty||this._polylinesToUpdate.push(e),++this._propertiesChanged[t]};function ZCe(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)t[i].isDestroyed||t[i]._destroy()}function jQ(e,t,n){this.count=e,this.offset=t,this.bucket=n}function Zp(e,t,n){this.polylines=[],this.lengthOfPositions=0,this.material=e,this.shaderProgram=void 0,this.mode=t,this.modelMatrix=n}Zp.prototype.addPolyline=function(e){this.polylines.push(e),e._actualLength=this.getPolylinePositionsLength(e),this.lengthOfPositions+=e._actualLength,e._bucket=this};Zp.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,Ux]}),o=t.getVertexShaderCallback()(M2),a=new Ge({defines:i,sources:[Ul,o]});this.shaderProgram=Zt.fromCache({context:e,vertexShaderSource:a,fragmentShaderSource:r,attributeLocations:Hu})};function QCe(e){return h.dot(h.UNIT_X,e._boundingVolume.center)<0||e._boundingVolume.intersectPlane(en.ORIGIN_ZX_PLANE)===Xt.INTERSECTING}Zp.prototype.getPolylinePositionsLength=function(e){let t;if(this.mode===re.SCENE3D||!QCe(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 bs=new h,Qd=new h,eh=new h,zH=new h,Cpt=new ae,vpt=new z;Zp.prototype.write=function(e,t,n,i,r,o,a,s){let c=this.mode,u=s.ellipsoid.maximumRadius*D.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,P=0,R;for(let V=0;V<C;++V){V===0?g._loop?R=x[C-2]:(R=zH,h.subtract(x[0],x[1],R),h.add(x[0],R,R)):R=x[V-1],h.clone(R,Qd),h.clone(x[V],bs),V===C-1?g._loop?R=x[1]:(R=zH,h.subtract(x[C-1],x[C-2],R),h.add(x[C-1],R,R)):R=x[V+1],h.clone(R,eh);let k=T[w];V===P+k&&(P+=k,++w);let j=V-P===0,B=V===P+T[w]-1;c===re.SCENE2D&&(Qd.z=0,bs.z=0,eh.z=0),(c===re.SCENE2D||c===re.MORPHING)&&(j||B)&&u-Math.abs(bs.x)<1&&((bs.x<0&&Qd.x>0||bs.x>0&&Qd.x<0)&&h.clone(bs,Qd),(bs.x<0&&eh.x>0||bs.x>0&&eh.x<0)&&h.clone(bs,eh));let G=j?2:0,W=B?2:4;for(let Q=G;Q<W;++Q){vn.writeElements(bs,e,n),vn.writeElements(Qd,e,n+6),vn.writeElements(eh,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 O=Cpt;O.x=U.floatToByte(E.red),O.y=U.floatToByte(E.green),O.z=U.floatToByte(E.blue),O.w=U.floatToByte(E.alpha);let N=vpt;N.x=m,N.y=y?1:0;let _=c===re.SCENE2D?g._boundingVolume2D:g._boundingVolumeWC,v=vn.fromCartesian(_.center,XCe),S=v.high,I=ae.fromElements(v.low.x,v.low.y,v.low.z,_.radius,KCe),M=$Ce;M.x=0,M.y=Number.MAX_VALUE;let F=g.distanceDisplayCondition;l(F)&&(M.x=F.near,M.y=F.far),o.setBatchedAttribute(A,0,N),o.setBatchedAttribute(A,1,O),o.attributes.length>2&&(o.setBatchedAttribute(A,2,S),o.setBatchedAttribute(A,3,I),o.setBatchedAttribute(A,4,M))}};var Ept=new h,Spt=new h,wpt=new h,GCe=new h;Zp.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=GCe,h.subtract(s[0],s[1],g),h.add(s[0],g,g)):g=s[p-1],g=L.multiplyByPoint(n,g,Spt);let m=L.multiplyByPoint(n,s[p],Ept),y;p===u-1?a._loop?y=s[1]:(y=GCe,h.subtract(s[u-1],s[u-2],y),h.add(s[u-1],y,y)):y=s[p+1],y=L.multiplyByPoint(n,y,wpt);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)vn.writeElements(m,e,t),vn.writeElements(g,e,t+6),vn.writeElements(y,e,t+12),t+=18}}};var Ipt=new Array(1);Zp.prototype.updateIndices=function(e,t,n,i){let r=n.length-1,o=new jQ(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=Ipt;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>D.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 jQ(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>D.SIXTY_FOUR_KILOBYTES&&(t.push(0),s=[],e.push(s),c=0,o.count=a,i=0,a=0,o=new jQ(0,0,this),n[++r]=[o])}p._clean()}return o.count=a,i};Zp.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 uw={positions:void 0,lengths:void 0},WCe=new Array(1),Ppt=new h,Dpt=new de;Zp.prototype.getSegments=function(e,t){let n=e._actualPositions;if(this.mode===re.SCENE3D)return WCe[0]=n.length,uw.positions=n,uw.lengths=WCe,uw;QCe(e)&&(n=e._segments.positions);let i=t.ellipsoid,r=[],o=this.modelMatrix,a=n.length,s,c=Ppt;for(let u=0;u<a;++u)s=n[u],c=L.multiplyByPoint(o,s,c),r.push(t.project(i.cartesianToCartographic(c,Dpt)));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 uw.positions=r,uw.lengths=e._segments.lengths,uw};var qCe;Zp.prototype.writeUpdate=function(e,t,n,i){let r=this.mode,o=i.ellipsoid.maximumRadius*D.PI,a=t._actualLength;if(a){e+=this.getPolylineStartIndex(t);let s=qCe,c=6*a*3;!l(s)||s.length<c?s=qCe=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=zH,h.subtract(f[0],f[1],y),h.add(f[0],y,y)):y=f[A-1],h.clone(y,Qd),h.clone(f[A],bs),A===a-1?t._loop?y=f[1]:(y=zH,h.subtract(f[a-1],f[a-2],y),h.add(f[a-1],y,y)):y=f[A+1],h.clone(y,eh);let b=d[g];A===m+b&&(m+=b,++g);let x=A-m===0,T=A===m+d[g]-1;r===re.SCENE2D&&(Qd.z=0,bs.z=0,eh.z=0),(r===re.SCENE2D||r===re.MORPHING)&&(x||T)&&o-Math.abs(bs.x)<1&&((bs.x<0&&Qd.x>0||bs.x>0&&Qd.x<0)&&h.clone(bs,Qd),(bs.x<0&&eh.x>0||bs.x>0&&eh.x<0)&&h.clone(bs,eh));let C=x?2:0,E=T?2:4;for(let w=C;w<E;++w)vn.writeElements(bs,s,p),vn.writeElements(Qd,s,p+6),vn.writeElements(eh,s,p+12),p+=18}n.copyFromArrayView(s,18*Float32Array.BYTES_PER_ELEMENT*e)}};var Im=wm;function EA(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 vf({batchTable:e.batchTable,scene:e.scene}),this._labelCollection=new Hp({batchTable:e.batchTable,scene:e.scene}),this._polylineCollection=new Im,this._polylineCollection._useHighlightColor=!0,this._packedBuffer=void 0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(EA.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 Rpt(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 Opt=new Yn("createVectorTilePoints",5),Mpt=new h;function Lpt(e,t){let n=e._positions,i=e._packedBuffer;l(i)||(n=e._positions=n.slice(),e._batchIds=e._batchIds.slice(),i=e._packedBuffer=Rpt(e,t));let r=[n.buffer,i.buffer],o={positions:n.buffer,packedBuffer:i.buffer},a=Opt.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,Mpt),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)})}EA.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 r_(e,c,u,f,d)}};EA.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 Npt(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=r_.defaultPointSize,a.color=r_.defaultColor,a.pointOutlineColor=r_.defaultPointOutlineColor,a.pointOutlineWidth=r_.defaultPointOutlineWidth,a.labelColor=U.WHITE,a.labelOutlineColor=U.WHITE,a.labelOutlineWidth=1,a.font="30px sans-serif",a.labelStyle=ho.FILL,a.labelText=void 0,a.backgroundColor=new U(.165,.165,.165,.8),a.backgroundPadding=new z(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=Vi.CENTER,a.verticalOrigin=Gn.CENTER,a.labelHorizontalOrigin=Vi.RIGHT,a.labelVerticalOrigin=Gn.BASELINE}}var Fpt=new U,Bpt=new U,kpt=new U,zpt=new U,Upt=new U,Vpt=new U,F2=new Wt,B2=new Wt,qQ=new jt;EA.prototype.applyStyle=function(e,t){if(!l(e)){Npt(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,Fpt)),l(e.pointOutlineColor)&&(a.pointOutlineColor=e.pointOutlineColor.evaluateColor(a,Bpt)),l(e.pointOutlineWidth)&&(a.pointOutlineWidth=e.pointOutlineWidth.evaluate(a)),l(e.labelColor)&&(a.labelColor=e.labelColor.evaluateColor(a,kpt)),l(e.labelOutlineColor)&&(a.labelOutlineColor=e.labelOutlineColor.evaluateColor(a,zpt)),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,Upt)),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)?(F2.near=s.x,F2.nearValue=s.y,F2.far=s.z,F2.farValue=s.w,a.scaleByDistance=F2):a.scaleByDistance=void 0}else a.scaleByDistance=void 0;if(l(e.translucencyByDistance)){let s=e.translucencyByDistance.evaluate(a);l(s)?(B2.near=s.x,B2.nearValue=s.y,B2.far=s.z,B2.farValue=s.w,a.translucencyByDistance=B2):a.translucencyByDistance=void 0}else a.translucencyByDistance=void 0;if(l(e.distanceDisplayCondition)){let s=e.distanceDisplayCondition.evaluate(a);l(s)?(qQ.near=s.x,qQ.far=s.y,a.distanceDisplayCondition=qQ):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,Vpt)),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))}};EA.prototype.update=function(e){if(!this._ready&&(l(this._promise)||(this._promise=Lpt(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)};EA.prototype.isDestroyed=function(){return!1};EA.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 k2=EA;function a_(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(a_.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 jpt(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 Hpt(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 Jp({color:c,offset:u,count:f,batchIds:p})}}var Gpt=new Yn("createVectorTilePolygons",5),Wpt=new U;function qpt(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,Wpt);a[y]=A.toRgba()}s=e._packedBuffer=jpt(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=Gpt.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];Hpt(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),Ypt(e),e._ready=!0}).catch(g=>{e.isDestroyed()||(e._error=g)})}function Ypt(e){l(e._primitive)||(e._primitive=new MT({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)}a_.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};a_.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};a_.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};a_.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};a_.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=qpt(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)};a_.prototype.isDestroyed=function(){return!1};a_.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};var z2=a_;var U2=`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 Pm(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(Pm.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function Xpt(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 Kpt=new Yn("createVectorTilePolylines",5),fw={previousPosition:0,currentPosition:1,nextPosition:2,expandAndWidth:3,a_batchId:4};function $pt(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=Xpt(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=Kpt.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),Jpt(e,t),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)})}function Jpt(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:fw.previousPosition,vertexBuffer:u,componentDatatype:Y.FLOAT,componentsPerAttribute:3},{index:fw.currentPosition,vertexBuffer:f,componentDatatype:Y.FLOAT,componentsPerAttribute:3},{index:fw.nextPosition,vertexBuffer:d,componentDatatype:Y.FLOAT,componentsPerAttribute:3},{index:fw.expandAndWidth,vertexBuffer:p,componentDatatype:Y.FLOAT,componentsPerAttribute:2},{index:fw.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 V2=new L,eve=new h;function Zpt(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return L.clone(n,V2),L.multiplyByPoint(V2,e._center,eve),L.setTranslation(V2,eve,V2),V2},u_highlightColor:function(){return e._highlightColor}})}function Qpt(e){if(l(e._rs))return;let t={enabled:!0,factor:-5,units:-5};e._rs=je.fromCache({blending:Qt.ALPHA_BLEND,depthMask:!1,depthTest:{enabled:!0},polygonOffset:t})}var e0t=`uniform vec4 u_highlightColor;
void main()
{
out_FragColor = u_highlightColor;
}
`;function t0t(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(U2),r=n.getFragmentShaderCallback(!1,void 0,!1)(e0t),o=new Ge({defines:["VECTOR_TILE","CLIP_POLYLINE"],sources:[Ul,i]}),a=new Ge({defines:["VECTOR_TILE"],sources:[r]});e._sp=Zt.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:fw})}function n0t(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)}Pm.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};Pm.prototype.getPositions=function(e){return Pm.getPolylinePositions(this,e)};Pm.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 Qa(e,o)}};Pm.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function i0t(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 r0t=new U,o0t=U.WHITE,a0t=!0;Pm.prototype.applyStyle=function(e,t){if(!l(e)){i0t(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,r0t):o0t,a.show=l(e.show)?e.show.evaluate(a):a0t}};Pm.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=$pt(this,t)),l(this._error)){let i=this._error;throw this._error=void 0,i}return}Zpt(this,t),t0t(this,t),Qpt(this);let n=e.passes;(n.render||n.pick)&&n0t(this,e)};Pm.prototype.isDestroyed=function(){return!1};Pm.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),ue(this)};var FT=Pm;var j2=`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 H2=`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 s_(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 z(wi._defaultMinTerrainHeight,wi._defaultMaxTerrainHeight),this._boundingVolume=Jt.fromRectangle(e.rectangle,wi._defaultMinTerrainHeight,wi._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(s_.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function s0t(e,t,n){let i=wi.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 c0t(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 l0t=new Yn("createVectorTileClampedPolylines"),SA={startEllipsoidNormal:0,endEllipsoidNormal:1,startPositionAndHeight:2,endPositionAndHeight:3,startFaceNormalAndVertexCorner:4,endFaceNormalAndHalfWidth:5,a_batchId:6};function u0t(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=c0t(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=l0t.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),f0t(e,t),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)})}function f0t(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:SA.startEllipsoidNormal,vertexBuffer:d,componentDatatype:Y.FLOAT,componentsPerAttribute:3},{index:SA.endEllipsoidNormal,vertexBuffer:p,componentDatatype:Y.FLOAT,componentsPerAttribute:3},{index:SA.startPositionAndHeight,vertexBuffer:g,componentDatatype:Y.FLOAT,componentsPerAttribute:4},{index:SA.endPositionAndHeight,vertexBuffer:m,componentDatatype:Y.FLOAT,componentsPerAttribute:4},{index:SA.startFaceNormalAndVertexCorner,vertexBuffer:y,componentDatatype:Y.FLOAT,componentsPerAttribute:4},{index:SA.endFaceNormalAndHalfWidth,vertexBuffer:A,componentDatatype:Y.FLOAT,componentsPerAttribute:4},{index:SA.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 G2=new L,tve=new h;function d0t(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return L.clone(n,G2),L.multiplyByPoint(G2,e._center,tve),L.setTranslation(G2,tve,G2),G2},u_highlightColor:function(){return e._highlightColor},u_minimumMaximumVectorHeights:function(){return e._minimumMaximumVectorHeights}})}function nve(e){return je.fromCache({cull:{enabled:!0,face:zi.FRONT},blending:Qt.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 h0t(e){l(e._rs)||(e._rs=nve(!1),e._rs3DTiles=nve(!0))}function m0t(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(j2),r=n.getFragmentShaderCallback(!1,void 0,!0)(H2),o=new Ge({defines:["VECTOR_TILE","CLIP_POLYLINE"],sources:[Ul,i]}),a=new Ge({defines:["VECTOR_TILE"],sources:[r]});e._sp=Zt.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:SA})}function p0t(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)}s_.prototype.getPositions=function(e){return FT.getPolylinePositions(this,e)};s_.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 Qa(e,o)}};s_.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function g0t(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 _0t=new U,y0t=U.WHITE,A0t=!0;s_.prototype.applyStyle=function(e,t){if(!l(e)){g0t(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,_0t):y0t,a.show=l(e.show)?e.show.evaluate(a):A0t}};function b0t(e){return wi.initialize().then(function(){s0t(e,e._rectangle,e._ellipsoid)}).catch(t=>{e.isDestroyed()||(e._error=t)})}s_.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=b0t(this).then(u0t(this,t))),l(this._error)){let i=this._error;throw this._error=void 0,i}return}d0t(this,t),m0t(this,t),h0t(this);let n=e.passes;(n.render||n.pick)&&p0t(this,e)};s_.prototype.isDestroyed=function(){return!1};s_.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),ue(this)};var W2=s_;var XQ=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,E0t(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)||YQ(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)||YQ(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)||YQ(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 x0t(e){return function(t,n){l(e._polygons)&&e._polygons.updateCommands(t,n)}}function T0t(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 Dm=Uint32Array.BYTES_PER_ELEMENT;function C0t(e){return new FT(e)}function v0t(e){return new W2(e)}function E0t(e,t,n){n=n??0;let i=new Uint8Array(t),r=new DataView(t);n+=Dm;let o=r.getUint32(n,!0);if(o!==1)throw new oe(`Only Vector tile version 1 is supported. Version ${o} is not.`);n+=Dm;let a=r.getUint32(n,!0);if(n+=Dm,a===0){e._ready=!0;return}let s=r.getUint32(n,!0);if(n+=Dm,s===0)throw new oe("Feature table must have a byte length greater than zero");let c=r.getUint32(n,!0);n+=Dm;let u=r.getUint32(n,!0);n+=Dm;let f=r.getUint32(n,!0);n+=Dm;let d=r.getUint32(n,!0);n+=Dm;let p=r.getUint32(n,!0);n+=Dm;let g=r.getUint32(n,!0);n+=Dm,n+=Dm;let m=Co(i,n,s);n+=s;let y=new Uint8Array(t,n,c);n+=c;let A,b;u>0&&(A=Co(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 ym(e,E,A,b,x0t(e));if(e._batchTable=w,E===0)return;let P=new _m(m,y),R=P.getGlobalProperty("REGION");if(!l(R))throw new oe("Feature table global property: REGION must be defined");let O=ie.unpack(R),N=R[4],_=R[5],v=e._tile.computedTransform,S=P.getGlobalProperty("RTC_CENTER",Y.FLOAT,3);l(S)?(S=h.unpack(S),L.multiplyByPoint(v,S,S)):(S=ie.center(O),S.height=D.lerp(N,_,.5),S=te.WGS84.cartographicToCartesian(S));let I=T0t(m,y);if(n+=(4-n%4)%4,x>0){P.featuresLength=x;let F=P.getPropertyArray("POLYGON_COUNTS",Y.UNSIGNED_INT,1)??P.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=P.getPropertyArray("POLYGON_INDEX_COUNTS",Y.UNSIGNED_INT,1)??P.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 k=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,k);n+=p;let W,Q;l(m.POLYGON_MINIMUM_HEIGHTS)&&l(m.POLYGON_MAXIMUM_HEIGHTS)&&(W=P.getPropertyArray("POLYGON_MINIMUM_HEIGHTS",Y.FLOAT,1),Q=P.getPropertyArray("POLYGON_MAXIMUM_HEIGHTS",Y.FLOAT,1)),e._polygons=new z2({positions:G,counts:F,indexCounts:V,indices:B,minimumHeight:N,maximumHeight:_,polygonMinimumHeights:W,polygonMaximumHeights:Q,center:S,rectangle:O,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:w,batchIds:I.polygons,modelMatrix:v})}let M=e._tileset;if(T>0){P.featuresLength=T;let F=P.getPropertyArray("POLYLINE_COUNTS",Y.UNSIGNED_INT,1)??P.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=P.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 k=F.reduce(function(W,Q){return W+Q*3},0),j=new Uint16Array(t,n,k);n+=g;let B=M.examineVectorLinesFunction;if(l(B)){let W=FM(new Uint16Array(j),O,N,_,te.WGS84);S0t(W,F,I.polylines,w,e.url,B)}let G=C0t;l(M.classificationType)&&(G=v0t),e._polylines=G({positions:j,widths:V,counts:F,batchIds:I.polylines,minimumHeight:N,maximumHeight:_,center:S,rectangle:O,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:w,classificationType:M.classificationType,keepDecodedPositions:M.vectorKeepDecodedPositions})}if(C>0){let F=new Uint16Array(t,n,C*3);e._points=new k2({positions:F,batchIds:I.points,minimumHeight:N,maximumHeight:_,rectangle:O,batchTable:w,heightReference:M.heightReference,scene:M.scene})}}function YQ(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 S0t(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 q2=XQ;var{ERR_CAPACITY:MTi}=$a.Error,w0t=new h,UH=class UH extends Xo{constructor(){super(...arguments);at(this,"_collection",null)}static clone(n,i){return super.clone(n,i),i.setPosition(n.getPosition(w0t)),i}get vertexOffset(){return this._getUint32(UH.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(UH,"Layout",{...Xo.Layout,POSITION_OFFSET_U32:Xo.Layout.__BYTE_LENGTH,__BYTE_LENGTH:Xo.Layout.__BYTE_LENGTH+4});var KQ=UH,Bc=KQ;var Y2=`#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 X2=`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 K2=class K2 extends zl{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(K2,"Layout",{...zl.Layout,SIZE_U8:zl.Layout.__BYTE_LENGTH,__BYTE_LENGTH:zl.Layout.__BYTE_LENGTH+4}),at(K2,"DEFAULT_MATERIAL",Object.freeze(new K2));var $Q=K2,Rm=$Q;var JQ={positionHigh:0,positionLow:1,pickColor:2,showSizeColorAlpha:3,outlineWidthColorAlpha:4},ive={position:0,pickColor:1,showSizeColorAlpha:2,outlineWidthColorAlpha:3},BT=new Bc,Om=new Rm,$2=new U,rve=new h,ZQ=new vn;function I0t(e,t,n){let i=t.context;n=n||{destroy:P0t};let r=e._positionDatatype===Y.DOUBLE,o=r?JQ:ive;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,BT),BT._dirty&&(r&&(BT.getPosition(rve),vn.fromCartesian(rve,ZQ),h.pack(ZQ.high,c,y*3),h.pack(ZQ.low,u,y*3)),BT.getMaterial(Om),U.fromRgba(BT._pickId,$2),f[y*4]=U.floatToByte($2.red),f[y*4+1]=U.floatToByte($2.green),f[y*4+2]=U.floatToByte($2.blue),f[y*4+3]=U.floatToByte($2.alpha),d[y*4]=BT.show?1:0,d[y*4+1]=Om.size,d[y*4+2]=an.encodeRGB8(Om.color),d[y*4+3]=Om.color.alpha,p[y*3]=Om.outlineWidth,p[y*3+1]=an.encodeRGB8(Om.outlineWidth>0?Om.outlineColor:Om.color),p[y*3+2]=Om.outlineWidth>0?Om.outlineColor.alpha:Om.color.alpha,BT._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:JQ.positionHigh,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:Ze.createVertexBuffer({typedArray:s.positionHigh,context:i,usage:Oe.STATIC_DRAW})},{index:JQ.positionLow,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:Ze.createVertexBuffer({typedArray:s.positionLow,context:i,usage:Oe.STATIC_DRAW})}]:[{index:ive.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===Li.OPAQUE?Qt.DISABLED:Qt.ALPHA_BLEND,depthTest:{enabled:!0}})),l(n.shaderProgram)||(n.shaderProgram=Zt.fromCache({context:i,vertexShaderSource:new Ge({sources:[Y2],defines:r?["USE_FLOAT64"]:[]}),fragmentShaderSource:new Ge({sources:[X2]}),attributeLocations:o})),l(n.command)||(n.command=new nt({vertexArray:n.vertexArray,renderState:n.renderState,shaderProgram:n.shaderProgram,primitiveType:Re.POINTS,pass:e._blendOption===Li.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 P0t(){let e=this;l(e.vertexArray)&&e.vertexArray.destroy(),l(e.shaderProgram)&&e.shaderProgram.destroy(),l(e.renderState)&&je.removeFromCache(e.renderState)}var J2=I0t;var QQ=class e extends $a{constructor(t=H.EMPTY_OBJECT){super({...t,vertexCountMax:t.primitiveCountMax})}_getCollectionClass(){return e}_getPrimitiveClass(){return Bc}_getMaterialClass(){return Rm}static _cloneEmpty(t){return new e({primitiveCountMax:t.primitiveCountMax,positionDatatype:t.positionDatatype,positionNormalized:t.positionNormalized})}add(t,n=new Bc){return super.add(t,n),n._setUint32(Bc.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=J2(this,t,this._renderContext))}},Gu=QQ;function dw(e,t){this._conditionsExpression=Ye(e,!0),this._conditions=e.conditions,this._runtimeConditions=void 0,R0t(this,t)}Object.defineProperties(dw.prototype,{conditionsExpression:{get:function(){return this._conditionsExpression}}});function D0t(e,t){this.condition=e,this.expression=t}function R0t(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 D0t(new Jd(s,t),new Jd(c,t)))}e._runtimeConditions=n}dw.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)}};dw.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)}};dw.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};dw.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 Z2=dw;function wA(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,O0t(this,e)}function O0t(e,t){t=Ye(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 Jd(r[o],i))}e._meta=n,e._ready=!0}function go(e,t){let n=(e._style??H.EMPTY_OBJECT).defines;if(l(t)){if(typeof t=="boolean"||typeof t=="number")return new Jd(String(t));if(typeof t=="string")return new Jd(t,n);if(l(t.conditions))return new Z2(t,n)}else return;return t}function _o(e){if(l(e)){if(l(e.expression))return e.expression;if(l(e.conditionsExpression))return Ye(e.conditionsExpression,!0)}else return;return e}Object.defineProperties(wA.prototype,{style:{get:function(){return this._style}},show:{get:function(){return this._show},set:function(e){this._show=go(this,e),this._style.show=_o(this._show),this._showShaderFunctionReady=!1}},color:{get:function(){return this._color},set:function(e){this._color=go(this,e),this._style.color=_o(this._color),this._colorShaderFunctionReady=!1}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=go(this,e),this._style.pointSize=_o(this._pointSize),this._pointSizeShaderFunctionReady=!1}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=go(this,e),this._style.pointOutlineColor=_o(this._pointOutlineColor)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=go(this,e),this._style.pointOutlineWidth=_o(this._pointOutlineWidth)}},labelColor:{get:function(){return this._labelColor},set:function(e){this._labelColor=go(this,e),this._style.labelColor=_o(this._labelColor)}},labelOutlineColor:{get:function(){return this._labelOutlineColor},set:function(e){this._labelOutlineColor=go(this,e),this._style.labelOutlineColor=_o(this._labelOutlineColor)}},labelOutlineWidth:{get:function(){return this._labelOutlineWidth},set:function(e){this._labelOutlineWidth=go(this,e),this._style.labelOutlineWidth=_o(this._labelOutlineWidth)}},font:{get:function(){return this._font},set:function(e){this._font=go(this,e),this._style.font=_o(this._font)}},labelStyle:{get:function(){return this._labelStyle},set:function(e){this._labelStyle=go(this,e),this._style.labelStyle=_o(this._labelStyle)}},labelText:{get:function(){return this._labelText},set:function(e){this._labelText=go(this,e),this._style.labelText=_o(this._labelText)}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){this._backgroundColor=go(this,e),this._style.backgroundColor=_o(this._backgroundColor)}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){this._backgroundPadding=go(this,e),this._style.backgroundPadding=_o(this._backgroundPadding)}},backgroundEnabled:{get:function(){return this._backgroundEnabled},set:function(e){this._backgroundEnabled=go(this,e),this._style.backgroundEnabled=_o(this._backgroundEnabled)}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){this._scaleByDistance=go(this,e),this._style.scaleByDistance=_o(this._scaleByDistance)}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){this._translucencyByDistance=go(this,e),this._style.translucencyByDistance=_o(this._translucencyByDistance)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=go(this,e),this._style.distanceDisplayCondition=_o(this._distanceDisplayCondition)}},heightOffset:{get:function(){return this._heightOffset},set:function(e){this._heightOffset=go(this,e),this._style.heightOffset=_o(this._heightOffset)}},anchorLineEnabled:{get:function(){return this._anchorLineEnabled},set:function(e){this._anchorLineEnabled=go(this,e),this._style.anchorLineEnabled=_o(this._anchorLineEnabled)}},anchorLineColor:{get:function(){return this._anchorLineColor},set:function(e){this._anchorLineColor=go(this,e),this._style.anchorLineColor=_o(this._anchorLineColor)}},image:{get:function(){return this._image},set:function(e){this._image=go(this,e),this._style.image=_o(this._image)}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance=go(this,e),this._style.disableDepthTestDistance=_o(this._disableDepthTestDistance)}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin=go(this,e),this._style.horizontalOrigin=_o(this._horizontalOrigin)}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin=go(this,e),this._style.verticalOrigin=_o(this._verticalOrigin)}},labelHorizontalOrigin:{get:function(){return this._labelHorizontalOrigin},set:function(e){this._labelHorizontalOrigin=go(this,e),this._style.labelHorizontalOrigin=_o(this._labelHorizontalOrigin)}},labelVerticalOrigin:{get:function(){return this._labelVerticalOrigin},set:function(e){this._labelVerticalOrigin=go(this,e),this._style.labelVerticalOrigin=_o(this._labelVerticalOrigin)}},lineWidth:{get:function(){return this._lineWidth},set:function(e){this._lineWidth=go(this,e),this._style.lineWidth=_o(this._lineWidth)}},meta:{get:function(){return this._meta},set:function(e){this._meta=e}}});wA.fromUrl=function(e){return De.createIfNeeded(e).fetchJson(e).then(function(n){return new wA(n)})};wA.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)};wA.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)};wA.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)};wA.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 c_=wA;var ove=new Bc,ave=new ms,sve=new Ko,M0t=new Rm,L0t=new xf,N0t=new bf,eee=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 Qa.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(Gu,ove),yield*this._iteratePrimitivesWith(ol,ave),yield*this._iteratePrimitivesWith(il,sve)}*_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(Gu,ove,M0t)}*_iteratePolylineMaterials(){yield*this._iterateMaterialsWith(ol,ave,L0t)}*_iteratePolygonMaterials(){yield*this._iterateMaterialsWith(il,sve,N0t)}*_iterateMaterialsWith(t,n,i){for(let r of this._iteratePrimitivesWith(t,n))r.getMaterial(i),yield i,r.setMaterial(i)}},kT=eee;var cve=new h,F0t=new Bc,B0t=new ms,uve=new Ko;function k0t(e,t){let n=t.scene.nodes,i={collections:[],collectionLocalMatrices:[],collectionFeatureTableIds:new Map,featuresByTableId:new Map};for(let r=0;r<n.length;r++)fve(e,n[r],L.IDENTITY,i);return i}function VH(e){let t=e.BYTES_PER_ELEMENT*8;return Math.pow(2,t)-1}function z0t(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,rt.POSITION).count,s=e.indices?ys.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:lve(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=lve(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 lve(e){let t=VH(e),n=0;for(let i=0;i<e.length;i++)e[i]===t&&i+1<e.length&&n++;return n+1}function U0t(e,t,n,i,r){let o=_t.getAttributeBySemantic(t,rt.POSITION),a=o.typedArray??(n.positionNormalized?ys.readAttributeAsRawCompactTypedArray(o):ys.readAttributeAsTypedArray(o)),s=t.indices?ys.readIndicesAsTypedArray(t.indices):void 0,c=V0t(e,t,r);n instanceof Gu?j0t(n,i,a,s,c):n instanceof ol?H0t(n,i,a,s,c):n instanceof il&&(l(t.vector)?G0t(n,i,a,s,c,t.vector):W0t(n,i,a,c,t.polygon))}function V0t(e,t,n){let i=e.tileset.featureIdLabel,r=_t.getFeatureIdsByLabel(t.featureIds,i);if(!(r instanceof xn.FeatureIdAttribute))return()=>{};let o=_t.getAttributeBySemantic(t,rt.FEATURE_ID,r.setIndex),a=o.typedArray??ys.readAttributeAsTypedArray(o);for(let s=0;s<a.length;s++){let c=a[s];if(!n.has(c)){let u=new kT(e,c,r.propertyTableId);n.set(c,u)}}return function(c){let u=a[c];if(u!==r.nullFeatureId)return n.get(u)}}function j0t(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,cve);let u=r(c);u&&u.addPrimitiveByCollection(t,a),e.add({position:cve,pickObject:u,featureId:u?.featureId},F0t)}}function H0t(e,t,n,i,r){let o=VH(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=dve(n,p,3),m=r(i[a]);m&&m.addPrimitiveByCollection(t,c),e.add({positions:g,pickObject:m,featureId:m?.featureId},B0t),a=u+1,s=0,c++}}function G0t(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},uve)}}function W0t(e,t,n,i,r){let o=r.loopIndices.constructor,a=new o(r.loopIndices.length),s=VH(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=dve(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},uve)}}function fve(e,t,n,i){let r=_t.getNodeTransform(t),o=L.multiplyTransformation(n,r,new L),a=t.primitives;for(let c=0;c<a.length;c++){let u=a[c],f=u.primitiveType,d,p=z0t(u),g=_t.getAttributeBySemantic(u,rt.POSITION),m=g.normalized??!1,y=g.componentDatatype;f===Re.POINTS?d=new Gu({primitiveCountMax:p.pointPrimitiveCount,allowPicking:!0,positionNormalized:m,positionDatatype:y}):f===Re.LINE_STRIP?d=new ol({primitiveCountMax:p.polylinePrimitiveCount,vertexCountMax:p.polylineVertexCount,allowPicking:!0,positionNormalized:m,positionDatatype:y}):(f===Re.TRIANGLES||f===Re.LINE_LOOP)&&(d=new il({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(L.clone(o)),i.collectionFeatureTableIds.set(d,b),U0t(e,u,d,i.collections.length-1,i.featuresByTableId.get(b))}let s=t.children;for(let c=0;c<s.length;c++)fve(e,s[c],o,i)}function dve(e,t,n,i){let r=VH(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 Q2=k0t;var jH=new Bc,HH=new ms,GH=new Ko,ek=new Rm,tee=new xf,hve=new bf,mve=new L,nee=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=L.clone(L.IDENTITY)}get featuresLength(){return this.batchTables.reduce((t,n)=>t+n.featuresLength,0)}get pointsLength(){return this._collections.filter(t=>t instanceof Gu).reduce((t,n)=>t+n.primitiveCount,0)}get trianglesLength(){return this._collections.reduce((t,n)=>n instanceof il?t+n.triangleCount:n instanceof ol?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 c_({color:i}))}applyStyle(t){let n=o=>o instanceof Gu,i=o=>o instanceof ol,r=o=>o instanceof il;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,jH);let u=this.getFeature(jH.featureId,a);l(t.show)&&(jH.show=t.show.evaluate(u)),l(t.color)&&t.color.evaluate(u,ek.color),l(t.pointSize)&&(ek.size=t.pointSize.evaluate(u)),l(t.pointOutlineWidth)&&(ek.outlineWidth=t.pointOutlineWidth.evaluate(u)),l(t.pointOutlineColor)&&t.pointOutlineColor.evaluate(u,ek.outlineColor),jH.setMaterial(ek)}}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,HH);let u=this.getFeature(HH.featureId,a);l(t.show)&&(HH.show=t.show.evaluate(u)),l(t.color)&&t.color.evaluate(u,tee.color),l(t.lineWidth)&&(tee.width=t.lineWidth.evaluate(u)),HH.setMaterial(tee)}}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,GH);let u=this.getFeature(GH.featureId,a);l(t.show)&&(GH.show=t.show.evaluate(u)),l(t.color)&&t.color.evaluate(u,hve.color),GH.setMaterial(hve)}}}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&&(Y0t(this),this._ready=!0)}L.multiplyTransformation(this._tile.computedTransform,this._modelMatrix,mve);let o=l(r)&&this._tile._selectedFrame===n.frameNumber;for(let a=0;a<this._collections.length;a++){let s=this._collections[a];L.multiplyTransformation(mve,this._collectionLocalMatrices[a],s.modelMatrix),Nu(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=q0t(t,n,o,r),s=await Bf.fromGltfAsync(a);return s.show=!1,o._model=s,o}};function q0t(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 Y0t(e){let t=e._model.sceneGraph.components,n=_t.getAxisCorrectionMatrix(t.upAxis,t.forwardAxis,new L);L.multiplyTransformation(t.transform,n,e._modelMatrix);let i=Q2(e,t);e._collections=i.collections,e._collectionLocalMatrices=i.collectionLocalMatrices,e._collectionFeatureTableIds=i.collectionFeatureTableIds,e._featuresByTableId=i.featuresByTableId}var IA=nee;function fc(){}fc._maxSortingConcurrency=Math.max(fn.hardwareConcurrency-1,1);fc._sorterTaskProcessor=void 0;fc._taskProcessorReady=!1;fc._error=void 0;fc._getSorterTaskProcessor=function(){if(!l(fc._sorterTaskProcessor)){let e=new Yn("gaussianSplatSorter",fc._maxSortingConcurrency);e.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/wasm_splats_bg.wasm"}).then(function(t){t?fc._taskProcessorReady=!0:fc._error=new oe("Gaussian splat sorter could not be initialized.")}).catch(t=>{fc._error=t}),fc._sorterTaskProcessor=e}return fc._sorterTaskProcessor};fc.radixSortIndexes=function(e){let t=fc._getSorterTaskProcessor();if(l(fc._error))throw fc._error;if(fc._taskProcessorReady)return t.scheduleTask(e,[e.primitive.positions.buffer])};var zT=fc;function dc(){}dc._maxSortingConcurrency=Math.max(fn.hardwareConcurrency-1,1);dc._textureTaskProcessor=void 0;dc._taskProcessorReady=!1;dc._error=void 0;dc._getTextureTaskProcessor=function(){if(!l(dc._textureTaskProcessor)){let e=new Yn("gaussianSplatTextureGenerator",dc._maxSortingConcurrency);e.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/wasm_splats_bg.wasm"}).then(function(t){t?dc._taskProcessorReady=!0:dc._error=new oe("Gaussian splat sorter could not be initialized.")}).catch(t=>{dc._error=t}),dc._textureTaskProcessor=e}return dc._textureTaskProcessor};dc.generateFromAttributes=function(e){let t=dc._getTextureTaskProcessor();if(l(dc._error))throw dc._error;if(!dc._taskProcessorReady)return;let{attributes:n}=e;return t.scheduleTask(e,[n.positions.buffer,n.scales.buffer,n.rotations.buffer,n.colors.buffer])};var tk=dc;function X0t(e){let t=new Cg;this.shaderBuilder=t,this.uniformMap={},this.renderStateOptions=je.getState(je.fromCache({depthTest:{enabled:!0,func:lc.LESS_OR_EQUAL}})),this.alphaOptions=new wT,this.hasSkipLevelOfDetail=!1,e._useLogDepth&&t.addDefine("LOG_DEPTH_READ_ONLY",void 0,he.FRAGMENT)}var nk=X0t;var ik=`//
// 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 rk=`//
// 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 UT=new L,bve=new L,ok=new L,xi=new $,ak=new Fe,K0t=new h,$0t=new Fe,J0t=new h,Z0t=1e-12,WH=1e-5,iee=1e-7,Vs={IDLE:0,WAITING:1,SORTING:2,SORTED:3,ERROR:4},Fa={BUILDING:"BUILDING",TEXTURE_PENDING:"TEXTURE_PENDING",TEXTURE_READY:"TEXTURE_READY",SORTING:"SORTING",READY:"READY"},Q0t=2,egt=30,tgt=3,ngt=.008726646259971648,igt=1;function rgt(e,t){let n=e._lastSteadySortFrameNumber>=0?t.frameNumber-e._lastSteadySortFrameNumber:Number.POSITIVE_INFINITY;if(e._lastSteadySortFrameNumber>=0&&n<tgt)return!1;let i=t.camera;return l(i)?!e._hasLastSteadySortCameraPosition||!e._hasLastSteadySortCameraDirection||h.distance(i.positionWC,e._lastSteadySortCameraPosition)>=igt?!0:h.angleBetween(i.directionWC,e._lastSteadySortCameraDirection)>=ngt:!1}function pve(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 ogt(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 gve(e,t){return l(t)&&t.requestId===e._sortRequestId&&t.dataGeneration===e._splatDataGeneration}function ree(e){l(e)&&(l(e.gaussianSplatTexture)&&(e.gaussianSplatTexture.destroy(),e.gaussianSplatTexture=void 0),l(e.sphericalHarmonicsTexture)&&(e.sphericalHarmonicsTexture.destroy(),e.sphericalHarmonicsTexture=void 0))}function _ve(e,t,n){if(!l(t))return;e._retiredTextures.push({texture:t,frameNumber:n})}function agt(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 sgt(e,t){let n=e?.[t];return l(n)?n.buffer:void 0}function cgt(e,t,n,i){let r=e._aggregateScratchBuffers[t];l(r)||(r=[],e._aggregateScratchBuffers[t]=r);let o=sgt(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 lgt(e,t){return e.length===t?e:e.subarray(0,t)}function ugt(e,t,n){if(!l(t.indexes)||t.state!==Fa.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&&_ve(e,o,i);let a=l(r)?r.sphericalHarmonicsTexture:e.sphericalHarmonicsTexture;l(a)&&a!==t.sphericalHarmonicsTexture&&_ve(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=Vs.IDLE,e._dirty=!1}async function fgt(e,t,n,i){try{let r=await i,o=Lt.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=Fa.BUILDING;return}if(!l(n.gaussianSplatTexture))n.gaussianSplatTexture=Ave(t.context,p);else if(n.lastTextureHeight!==p.height||n.lastTextureWidth!==p.width){let g=n.gaussianSplatTexture;n.gaussianSplatTexture=Ave(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=Lt.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=hgt(t.context,{data:T,width:m,height:x}),l(g)&&g.destroy()}}n.state=Fa.TEXTURE_READY}catch(r){console.error("Error generating Gaussian splat texture:",r),n.state=Fa.BUILDING}}async function dgt(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===Fa.SORTING&&(n.snapshot.state=Fa.TEXTURE_READY);return}let c=n.snapshot;c.indexes=r,c.state=Fa.READY,e._pendingSortPromise=void 0,e._pendingSort=void 0,ugt(e,c,t),e._pendingSnapshot=void 0,ou.buildGSplatDrawCommand(e,t)}catch(r){if(!l(n)||n.snapshot!==e._pendingSnapshot)return;e._pendingSortPromise=void 0,e._pendingSort=void 0,n.snapshot.state===Fa.SORTING&&(n.snapshot.state=Fa.TEXTURE_READY),e._sorterState=Vs.ERROR,e._sorterError=r}}async function yve(e,t,n){try{let i=await n,r=gve(e,t),o=t?.expectedCount,a=o,s=i?.length;if(!r||(o!==a||s!==o)){r&&(e._sorterPromise=void 0,e._sorterState=Vs.IDLE);return}e._indexes=i,e._sorterState=Vs.SORTED}catch(i){if(!gve(e,t))return;e._sorterState=Vs.ERROR,e._sorterError=i}}function hgt(e,t){return new Ct({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:zt.NEAREST})}function Ave(e,t){return new Ct({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:zt.NEAREST})}function ou(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 L,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=Fo.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 L,this._rootTransform=void 0,this._axisCorrectionMatrix=_t.getAxisCorrectionMatrix(ki.Y,ki.X,new L),this._shInverseRotation=new $,this._isDestroyed=!1,this._sorterState=Vs.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(ou.prototype,{ready:{get:function(){return this._ready}},isStable:{get:function(){return!this._dirty&&(!l(this._pendingSnapshot)||this._pendingSnapshot.state===Fa.READY)}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,this._dirty=!0)}}});ou.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)};ou.prototype.destroy=function(){if(this._positions=void 0,this._rotations=void 0,this._scales=void 0,this._colors=void 0,this._indexes=void 0,ree(this._pendingSnapshot),ree(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)};ou.prototype.isDestroyed=function(){return this._isDestroyed};ou.prototype.onTileLoad=function(e){this._dirty=!0};ou.prototype.onTileVisible=function(e){};ou.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=L.multiplyTransformation(t,i._axisCorrectionMatrix,UT);L.multiplyTransformation(o,e.content.worldTransform,o);let a=L.inverse(r,bve),s=L.multiplyTransformation(a,o,UT),c=e.content._lastSplatTransform;if(e.content._transformed&&l(c)&&L.equalsEpsilon(s,c,Z0t))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]);xi[0]=s[0]/p,xi[1]=s[1]/p,xi[2]=s[2]/p,xi[3]=s[4]/g,xi[4]=s[5]/g,xi[5]=s[6]/g,xi[6]=s[8]/m,xi[7]=s[9]/m,xi[8]=s[10]/m;let y=xi[0]*xi[3]+xi[1]*xi[4]+xi[2]*xi[5],A=xi[0]*xi[6]+xi[1]*xi[7]+xi[2]*xi[8],b=xi[3]*xi[6]+xi[4]*xi[7]+xi[5]*xi[8],x=Math.abs(p-1)<=iee&&Math.abs(g-1)<=iee&&Math.abs(m-1)<=iee,T=Math.abs(y)<=WH&&Math.abs(A)<=WH&&Math.abs(b)<=WH,C=xi[0]*(xi[4]*xi[8]-xi[5]*xi[7])-xi[3]*(xi[1]*xi[8]-xi[2]*xi[7])+xi[6]*(xi[1]*xi[5]-xi[2]*xi[4]),E=x&&T&&Math.abs(C-1)<=WH;Fe.fromRotationMatrix(xi,ak),Fe.normalize(ak,ak);let w=_t.getAttributeBySemantic(n,rt.POSITION).typedArray,P=_t.getAttributeBySemantic(n,rt.ROTATION).typedArray,R=_t.getAttributeBySemantic(n,rt.SCALE).typedArray,O=K0t,N=$0t,_=J0t;for(let v=0;v<w.length/3;++v)O.x=w[v*3],O.y=w[v*3+1],O.z=w[v*3+2],N.x=P[v*4],N.y=P[v*4+1],N.z=P[v*4+2],N.w=P[v*4+3],_.x=R[v*3],_.y=R[v*3+1],_.z=R[v*3+2],E?(L.multiplyByPoint(s,O,O),Fe.multiply(ak,N,N),Fe.normalize(N,N)):(L.fromTranslationQuaternionRotationScale(O,N,_,ok),L.multiplyTransformation(s,ok,ok),L.getTranslation(ok,O),L.getScale(ok,_),Fe.multiply(ak,N,N),Fe.normalize(N,N)),u[v*3]=O.x,u[v*3+1]=O.y,u[v*3+2]=O.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=L.clone(s,e.content._lastSplatTransform),e.content._transformed=!0};ou.generateSplatTexture=function(e,t,n){if(!l(n)||n.state!==Fa.BUILDING)return;n.state=Fa.TEXTURE_PENDING;let i=tk.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=Fa.BUILDING;return}fgt(e,t,n,i)};ou.buildGSplatDrawCommand=function(e,t){let n=e._tileset,i=new nk(e),{shaderBuilder:r}=i,o=i.renderStateOptions;o.cull.enabled=!1,o.depthMask=!1,o.depthTest.enabled=!0,o.blending=Qt.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(ik),r.addFragmentLines(rk);let u=r.buildShaderProgram(t.context),f=Ye(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 xn.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 xt({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=L.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};ou.prototype.update=function(e){let t=this._tileset;if(agt(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===Vs.IDLE){let r=t._selectedTiles.length!==0&&ogt(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>=Q0t,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>=egt;if(!(this._dirty||this._needsSnapshotRebuild||r||l(this._pendingSnapshot)||l(this._pendingSortPromise)||!l(this._drawCommand))&&L.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=Vs.IDLE,this._pendingSortPromise=void 0,this._pendingSort=void 0,l(this._pendingSnapshot)&&ree(this._pendingSnapshot);let u=t._selectedTiles;this._rootTransform=mt.eastNorthUpToFixedFrame(t.boundingSphere.center);{let C=u[0],E=L.multiplyTransformation(C.computedTransform,this._axisCorrectionMatrix,bve);L.multiplyTransformation(E,C.content.worldTransform??L.IDENTITY,E),L.getRotation(L.inverse(E,E),this._shInverseRotation)}for(let C of u)ou.transformTile(C);let f=u.reduce((C,E)=>C+E.content.pointsLength,0),d=(C,E,w,P)=>{let R,O=0,N=0;for(let _ of u){let v=w(_.content),S=l(P)?P:Vt.getNumberOfComponents(v.type),I=l(v.typedArray)?v.typedArray:v;N+=I.length,l(R)||(R=cgt(this,C,E,f*S))}if(!l(R))return Y.createTypedArray(E,0);for(let _ of u){let v=_.content,S=w(v),I=l(S.typedArray)?S.typedArray:S;R.set(I,O),O+=I.length}return lgt(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,P=0;for(let R of u){let O=R.content.packedSphericalHarmonicsData;R.content.sphericalHarmonicsDegree>0&&(w.set(O,P),P+=O.length)}return P<w.length?w.subarray(0,P):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,rt.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:Fa.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===Fa.BUILDING){ou.generateSplatTexture(this,e,u);return}if(u.state===Fa.TEXTURE_PENDING||u.state===Fa.TEXTURE_READY&&!l(u.gaussianSplatTexture)||!n)return;if(L.clone(i.viewMatrix,this._prevViewMatrix),L.multiply(i.viewMatrix,this._rootTransform,UT),u.state===Fa.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=zT.radixSortIndexes({primitive:{positions:new Float32Array(u.positions),modelView:Float32Array.from(UT),count:u.numSplats},sortType:"Index"});if(!l(p)){this._pendingSortPromise=void 0,this._pendingSort=void 0,u.state=Fa.TEXTURE_READY;return}this._pendingSortPromise=p,u.state=Fa.SORTING;let g=this._pendingSort;dgt(this,e,g,p);return}if(!l(this._pendingSortPromise)){u.state===Fa.SORTING&&(u.state=Fa.TEXTURE_READY);return}return}if(this._numSplats===0||!n)return;if(L.clone(i.viewMatrix,this._prevViewMatrix),L.multiply(i.viewMatrix,this._rootTransform,UT),!l(this._sorterPromise)){if(!rgt(this,e))return;let u=++this._sortRequestId,f=this._splatDataGeneration,d=this._numSplats;this._activeSort={requestId:u,dataGeneration:f,expectedCount:d};let p=zT.radixSortIndexes({primitive:{positions:new Float32Array(this._positions),modelView:Float32Array.from(UT),count:this._numSplats},sortType:"Index"});if(this._sorterPromise=p,l(p)){pve(this,e);let g=this._activeSort;this._sorterState=Vs.SORTING,yve(this,g,p);return}}if(!l(this._sorterPromise)){this._sorterState=Vs.WAITING;return}this._sorterState=Vs.SORTING;return}else if(this._sorterState===Vs.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=zT.radixSortIndexes({primitive:{positions:new Float32Array(this._positions),modelView:Float32Array.from(UT),count:this._numSplats},sortType:"Index"});if(this._sorterPromise=s,l(s)){pve(this,e);let c=this._activeSort;this._sorterState=Vs.SORTING,yve(this,c,s);return}}if(!l(this._sorterPromise)){this._sorterState=Vs.WAITING;return}this._sorterState=Vs.SORTING;return}else{if(this._sorterState===Vs.SORTING)return;if(this._sorterState===Vs.SORTED)ou.buildGSplatDrawCommand(this,e),this._sorterState=Vs.IDLE,this._dirty=!1,this._sorterPromise=void 0,this._activeSort=void 0;else if(this._sorterState===Vs.ERROR)throw this._sorterError}this._dirty=!1}};var sk=ou;var aee=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 sk({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")&&Ds("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:ki.Y,forwardAxis:ki.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 Rf(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,rt.POSITION).typedArray.slice(),this._rotations=_t.getAttributeBySemantic(this.gltfPrimitive,rt.ROTATION).typedArray.slice(),this._scales=_t.getAttributeBySemantic(this.gltfPrimitive,rt.SCALE).typedArray.slice();let{l:r,n:o}=pgt(this.gltfPrimitive.attributes);this._sphericalHarmonicsDegree=r,this._sphericalHarmonicsCoefficientCount=o,this._packedSphericalHarmonicsData=Agt(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 mgt(e){return`${e.startsWith("KHR_gaussian_splatting:")?"KHR_gaussian_splatting:":"_"}SH_DEGREE_`}function pgt(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 xve=new ArrayBuffer(4),ggt=new Float32Array(xve),_gt=new Uint32Array(xve);function oee(e){ggt[0]=e;let t=_gt[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 ygt(e){let t=mgt(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 Agt(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}=ygt(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]=oee(o[u].typedArray[y])|oee(o[u].typedArray[y+1])<<16,r[m+1]=oee(o[u].typedArray[y+2])}}return r}var PA=aee;var Tve={b3dm:function(e,t,n,i,r){return zf.fromB3dm(e,t,n,i,r)},pnts:function(e,t,n,i,r){return zf.fromPnts(e,t,n,i,r)},i3dm:function(e,t,n,i,r){return zf.fromI3dm(e,t,n,i,r)},cmpt:function(e,t,n,i,r){return I2.fromTileType(e,t,n,i,r,Tve)},externalTileset:function(e,t,n,i){return O2.fromJson(e,t,n,i)},geom:function(e,t,n,i,r){return new D2(e,t,n,i,r)},vctr:function(e,t,n,i,r){return new q2(e,t,n,i,r)},subt:function(e,t,n,i,r){return cw.fromSubtreeJson(e,t,n,void 0,i,r)},subtreeJson:function(e,t,n,i){return cw.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 PA.tilesetRequiresGaussianSplattingExt(e)?PA.fromGltf(e,t,n,c):e.hasExtension("3DTILES_content_gltf_vector")||e.isGltfExtensionUsed("CESIUM_mesh_vector")?IA.fromGltf(e,t,n,c):zf.fromGltf(e,t,n,c)},gltf:function(e,t,n,i){return PA.tilesetRequiresGaussianSplattingExt(e)?PA.fromGltf(e,t,n,i):e.hasExtension("3DTILES_content_gltf_vector")||e.isGltfExtensionUsed("CESIUM_mesh_vector")?IA.fromGltf(e,t,n,i):zf.fromGltf(e,t,n,i)},geoJson:function(e,t,n,i){return zf.fromGeoJson(e,t,n,i)}},VT=Tve;var Cve={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5};Object.freeze(Cve);var to=Cve;var th={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"};th.isBinaryFormat=function(e){switch(e){case th.BATCHED_3D_MODEL:case th.INSTANCED_3D_MODEL:case th.COMPOSITE:case th.POINT_CLOUD:case th.VECTOR:case th.GEOMETRY:case th.IMPLICIT_SUBTREE:case th.VOXEL_BINARY:case th.GLTF_BINARY:return!0;default:return!1}};Object.freeze(th);var xs=th;var vve={NOT_COMPUTED:-1,USE_OPTIMIZATION:1,SKIP_OPTIMIZATION:0};Object.freeze(vve);var nh=vve;var Ts={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},l_=new Array(Ts.NUMBER_OF_PASSES);l_[Ts.RENDER]=Object.freeze({pass:Ts.RENDER,isRender:!0,requestTiles:!0,ignoreCommands:!1});l_[Ts.PICK]=Object.freeze({pass:Ts.PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});l_[Ts.SHADOW]=Object.freeze({pass:Ts.SHADOW,isRender:!1,requestTiles:!0,ignoreCommands:!1});l_[Ts.PRELOAD]=Object.freeze({pass:Ts.PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});l_[Ts.PRELOAD_FLIGHT]=Object.freeze({pass:Ts.PRELOAD_FLIGHT,isRender:!1,requestTiles:!0,ignoreCommands:!0});l_[Ts.REQUEST_RENDER_MODE_DEFER_CHECK]=Object.freeze({pass:Ts.REQUEST_RENDER_MODE_DEFER_CHECK,isRender:!1,requestTiles:!0,ignoreCommands:!0});l_[Ts.MOST_DETAILED_PRELOAD]=Object.freeze({pass:Ts.MOST_DETAILED_PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});l_[Ts.MOST_DETAILED_PICK]=Object.freeze({pass:Ts.MOST_DETAILED_PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});Ts.getPassOptions=function(e){return l_[e]};Object.freeze(Ts);var no=Ts;var see=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)}},Qp=see;function u_(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(u_.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});u_.prototype.hasProperty=function(e){return qn.hasProperty(e,this._properties,this._class)};u_.prototype.hasPropertyBySemantic=function(e){return qn.hasPropertyBySemantic(e,this._properties,this._class)};u_.prototype.getPropertyIds=function(e){return qn.getPropertyIds(this._properties,this._class,e)};u_.prototype.getProperty=function(e){return qn.getProperty(e,this._properties,this._class)};u_.prototype.setProperty=function(e,t){return qn.setProperty(e,t,this._properties,this._class)};u_.prototype.getPropertyBySemantic=function(e){return qn.getPropertyBySemantic(e,this._properties,this._class)};u_.prototype.setPropertyBySemantic=function(e,t){return qn.setPropertyBySemantic(e,t,this._properties,this._class)};var ck=u_;function cee(e,t){let n=$i(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){cee._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 ck({content:n,class:r})}}cee._oneTimeWarning=pt;var jT=cee;function bgt(e,t){let n=e.metadataExtension;if(!l(n))return;let i=n.groups,r=$i(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 HT=bgt;function f_(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(f_.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});f_.prototype.hasProperty=function(e){return qn.hasProperty(e,this._properties,this._class)};f_.prototype.hasPropertyBySemantic=function(e){return qn.hasPropertyBySemantic(e,this._properties,this._class)};f_.prototype.getPropertyIds=function(e){return qn.getPropertyIds(this._properties,this._class,e)};f_.prototype.getProperty=function(e){return qn.getProperty(e,this._properties,this._class)};f_.prototype.setProperty=function(e,t){return qn.setProperty(e,t,this._properties,this._class)};f_.prototype.getPropertyBySemantic=function(e){return qn.getPropertyBySemantic(e,this._properties,this._class)};f_.prototype.setPropertyBySemantic=function(e,t){return qn.setPropertyBySemantic(e,t,this._properties,this._class)};var lk=f_;function lee(e,t){let n=$i(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){lee._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 lk({tile:n,class:r})}}lee._oneTimeWarning=pt;var uk=lee;function xgt(e){let t=new Uint8Array(e),n=Nh(t);if(n==="glTF"&&(n="glb"),xs.isBinaryFormat(n))return{contentType:n,binaryPayload:t};let i=Tgt(t);if(l(i.root))return{contentType:xs.EXTERNAL_TILESET,jsonPayload:i};if(l(i.asset))return{contentType:xs.GLTF,jsonPayload:i};if(l(i.tileAvailability))return{contentType:xs.IMPLICIT_SUBTREE_JSON,jsonPayload:i};if(l(i.type))return{contentType:xs.GEOJSON,jsonPayload:i};if(l(i.voxelTable))return{contentType:xs.VOXEL_JSON,jsonPayload:i};throw new oe("Invalid tile content.")}function Tgt(e){let t;try{t=Co(e)}catch{throw new oe("Invalid tile content.")}return t}var d_=xgt;var uee=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=jc.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(!Cgt(this._serverKeys)){this.tileset.statistics.numberOfAttemptedRequests+=this._serverKeys.length;return}let t=this._innerContentHeaders;fee(this,t.length);let n=this._cancelCount;for(let i=0;i<t.length;i++)this._arrayFetchPromises[i]=vgt(this,i,n,this._tile._contentState);return Egt(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 fee(e,t){e._requestsInFlight+=t,e.tileset.statistics.numberOfPendingRequests+=t}function Eve(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 Cgt(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)&&!jc.serverHasOpenSlots(n,t[n]))return!1;return jc.heapHasOpenSlots(e.length)}function vgt(e,t,n,i){let r=e._innerContentResources[t].clone(),o=e.tile,a=function(){return o._priority},s=e._serverKeys[t],c=new bo({throttle:!0,throttleByServer:!0,type:Ha.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===yi.CANCELLED){Eve(e,i);return}return fee(e,-1),f}}).catch(function(f){if(!(n<e._cancelCount)){if(r.request.cancelled||r.request.state===yi.CANCELLED){Eve(e,i);return}fee(e,-1),Sve(e,t,f)}})}async function Egt(e){let t=e._cancelCount,n=await Promise.all(e._arrayFetchPromises);if(t<e._cancelCount)return;let i=n.map((o,a)=>Sgt(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 Sgt(e,t,n){if(l(t))try{let i=d_(t),r=e._tileset,o=e._innerContentResources[n],a=e._tile;i.contentType===xs.EXTERNAL_TILESET&&(e._externalTilesetCount++,a.hasTilesetContent=!0),e._disableSkipLevelOfDetail=e._disableSkipLevelOfDetail||i.contentType===xs.GEOMETRY||i.contentType===xs.VECTOR;let s,c=VT[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=jT(r,u));let f=HT(r,u);return l(f)&&(s.group=new DT({metadata:f})),s}catch(i){Sve(e,n,i)}}function Sve(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 fk=uee;function mw(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;Rgt(this,e.rectangle,t),this._orientedBoundingBox=void 0,this._boundingSphere=void 0,(e.computeBoundingVolumes??!0)&&this.computeBoundingVolumes(t)}Object.defineProperties(mw.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});mw.prototype.computeBoundingVolumes=function(e){this._orientedBoundingBox=Jt.fromRectangle(this.rectangle,this.minimumHeight,this.maximumHeight,e),this._boundingSphere=se.fromOrientedBoundingBox(this._orientedBoundingBox)};var wve=new h,qH=new h,Ive=new h,wgt=new h,Igt=new h,Pgt=new h,Dgt=new h,ih=new de,Pve=new en(h.UNIT_X,0),hw=new dn;function Rgt(e,t,n){n.cartographicToCartesian(ie.southwest(t),e.southwestCornerCartesian),n.cartographicToCartesian(ie.northeast(t),e.northeastCornerCartesian),ih.longitude=t.west,ih.latitude=(t.south+t.north)*.5,ih.height=0;let i=n.cartographicToCartesian(ih,Pgt),r=h.cross(i,h.UNIT_Z,wgt);h.normalize(r,e.westNormal),ih.longitude=t.east;let o=n.cartographicToCartesian(ih,Dgt),a=h.cross(h.UNIT_Z,o,wve);h.normalize(a,e.eastNormal);let s=h.subtract(i,o,wve);h.magnitude(s)===0&&(s=h.clone(r,s));let c=h.normalize(s,Igt),u=t.south,f;if(u>0){ih.longitude=(t.west+t.east)*.5,ih.latitude=u;let y=n.cartographicToCartesian(ih,hw.origin);h.clone(c,hw.direction);let A=en.fromPointNormal(e.southwestCornerCartesian,e.westNormal,Pve);ci.rayPlane(hw,A,e.southwestCornerCartesian),f=n.geodeticSurfaceNormal(y,qH)}else f=n.geodeticSurfaceNormalCartographic(ie.southeast(t),qH);let d=h.cross(f,s,Ive);h.normalize(d,e.southNormal);let p=t.north,g;if(p<0){ih.longitude=(t.west+t.east)*.5,ih.latitude=p;let y=n.cartographicToCartesian(ih,hw.origin);h.negate(c,hw.direction);let A=en.fromPointNormal(e.northeastCornerCartesian,e.eastNormal,Pve);ci.rayPlane(hw,A,e.northeastCornerCartesian),g=n.geodeticSurfaceNormal(y,qH)}else g=n.geodeticSurfaceNormalCartographic(ie.northwest(t),qH);let m=h.cross(s,g,Ive);h.normalize(m,e.northNormal)}var Ogt=new h,Mgt=new h,Lgt=new h(0,-1,0),Ngt=new h(0,0,-1),Dve=new h;function Fgt(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),Ogt),u.z=u.y,u.y=u.x,u.x=0,f=t.mapProjection.project(ie.northeast(e.rectangle),Mgt),f.z=f.y,f.y=f.x,f.x=0,d=Lgt,g=h.UNIT_Y,p=Ngt,m=h.UNIT_Z);let y=h.subtract(i,u,Dve),A=h.dot(y,d),b=h.dot(y,p),x=h.subtract(i,f,Dve),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)}mw.prototype.distanceToCamera=function(e){let t=Fgt(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};mw.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};mw.prototype.createDebugVolume=function(e){let t=L.clone(L.IDENTITY),n=new Ax({rectangle:this.rectangle,height:this.minimumHeight,extrudedHeight:this.maximumHeight}),i=new Nt({geometry:n,id:"outline",modelMatrix:t,attributes:{color:Kt.fromColor(e)}});return new Nn({geometryInstances:i,appearance:new gn({translucent:!1,flat:!0}),asynchronous:!1})};var Vf=mw;var YH=new de;function dk(e){let t=gg.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=Wgt(t,n,i,r);this._boundingPlanes=o;let a=Kgt(o);this._vertices=a,this._edgeNormals=new Array(6),this._edgeNormals[0]=Aee(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]=Aee(o[1],a.slice(4,8)),s=0;s<4;s++)this._edgeNormals[2+s]=Aee(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();YH=r.cartesianToCartographic(c,YH),YH.height=(i+n)/2,this.center=r.cartographicToCartesian(YH,c),this._boundingSphere=se.fromPoints(a)}var Bgt=new h,kgt=new de,zgt=new h,Ugt=new de,Vgt=new h,jgt=new h,Hgt=new h,Ggt=new h;function Wgt(e,t,n,i){let r=new Array(6),o=e.getCenter(),a=i.geodeticSurfaceNormal(o,Bgt),s=i.cartesianToCartographic(o,kgt);s.height=n;let c=i.cartographicToCartesian(s,zgt),u=en.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,Ugt),m.height=t;let A=en.getPointDistance(u,i.cartographicToCartesian(m,Vgt));A<f&&(f=A)}let y=en.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,jgt),x=h.subtract(A,g,Ggt),T=h.cross(x,b,Hgt);T=h.normalize(T,T),r[2+d]=en.fromPointNormal(g,T)}return r}var GT=new h,WT=new h,qT=new h,dee=new h,hee=new h,mee=new h,qgt=new h,Ygt=new h,Xgt=new h,pee=new h,gee=new h,_ee=new h,DA=new h,e0=new $;function Rve(e,t,n){GT=e.normal,WT=t.normal,qT=n.normal,dee=h.multiplyByScalar(e.normal,-e.distance,dee),hee=h.multiplyByScalar(t.normal,-t.distance,hee),mee=h.multiplyByScalar(n.normal,-n.distance,mee),pee=h.multiplyByScalar(h.cross(WT,qT,qgt),h.dot(dee,GT),pee),gee=h.multiplyByScalar(h.cross(qT,GT,Ygt),h.dot(hee,WT),gee),_ee=h.multiplyByScalar(h.cross(GT,WT,Xgt),h.dot(mee,qT),_ee),e0[0]=GT.x,e0[1]=WT.x,e0[2]=qT.x,e0[3]=GT.y,e0[4]=WT.y,e0[5]=qT.y,e0[6]=GT.z,e0[7]=WT.z,e0[8]=qT.z;let i=$.determinant(e0);return DA=h.add(pee,gee,DA),DA=h.add(DA,_ee,DA),new h(DA.x/i,DA.y/i,DA.z/i)}function Kgt(e){let t=new Array(8);for(let n=0;n<4;n++)t[n]=Rve(e[0],e[2+(n+3)%4],e[2+n%4]),t[n+4]=Rve(e[1],e[2+(n+3)%4],e[2+n%4]);return t}var yee=new h,pw=new h;function Aee(e,t){let n=[];for(let i=0;i<4;i++)yee=h.subtract(t[(i+1)%4],t[i],yee),pw=h.cross(e.normal,yee,pw),pw=h.normalize(pw,pw),n[i]=h.clone(pw);return n}Object.defineProperties(dk.prototype,{boundingVolume:{get:function(){return this}},boundingSphere:{get:function(){return this._boundingSphere}}});var bee=new h;dk.prototype.distanceToCamera=function(e){let t=e.camera.positionWC,n=[],i=[],r;en.getPointDistance(this._boundingPlanes[0],t)>0?(n.push(0),i.push(this._planeVertices[0]),r=this._edgeNormals[0]):en.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,en.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=xee(en.projectPointOntoPlane(c,t,bee),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=Ove(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=xee(en.projectPointOntoPlane(c,t,bee),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=xee(en.projectPointOntoPlane(this._boundingPlanes[1],t,bee),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 $gt=new h,Jgt=new h;function Ove(e,t,n){let i=h.subtract(n,t,$gt),r=h.subtract(e,t,Jgt),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 Zgt=new en(h.UNIT_X,0);function xee(e,t,n,i){let r=Number.MAX_VALUE,o,a,s;for(let c=0;c<t.length;c++){let u=en.fromPointNormal(t[c],i[c],Zgt);en.getPointDistance(u,e)<0||(s=Ove(e,t[c],t[(c+1)%4]),o=h.distance(e,s),o<r&&(r=o,a=s))}return l(a)?a:e}dk.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};dk.prototype.createDebugVolume=function(e){let t=L.clone(L.IDENTITY),n=new Sd({polygonHierarchy:{positions:this._planeVertices[0]}}),i=Sd.createGeometry(n),r=new Nt({geometry:i,id:"outline",modelMatrix:t,attributes:{color:Kt.fromColor(e)}}),o=new Sd({polygonHierarchy:{positions:this._planeVertices[1]}}),a=Sd.createGeometry(o),s=new Nt({geometry:a,id:"outline",modelMatrix:t,attributes:{color:Kt.fromColor(e)}}),c=[];for(let u=0;u<4;u++){let f=new Sd({polygonHierarchy:{positions:this._planeVertices[2+u]}}),d=Sd.createGeometry(f);c[u]=new Nt({geometry:d,id:"outline",modelMatrix:t,attributes:{color:Kt.fromColor(e)}})}return new Nn({geometryInstances:[c[0],c[1],c[2],c[3],s,r],appearance:new gn({translucent:!1,flat:!0}),asynchronous:!1})};var hk=dk;function gw(e,t){t===0&&(t=D.EPSILON7),this._boundingSphere=new se(e,t)}Object.defineProperties(gw.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}}});gw.prototype.distanceToCamera=function(e){let t=this._boundingSphere;return Math.max(0,h.distance(t.center,e.camera.positionWC)-t.radius)};gw.prototype.intersectPlane=function(e){return se.intersectPlane(this._boundingSphere,e)};gw.prototype.update=function(e,t){h.clone(e,this._boundingSphere.center),this._boundingSphere.radius=t};gw.prototype.createDebugVolume=function(e){let t=new _g({radius:this.radius}),n=L.fromTranslation(this.center,L.clone(L.IDENTITY)),i=new Nt({geometry:t,id:"outline",modelMatrix:n,attributes:{color:Kt.fromColor(e)}});return new Nn({geometryInstances:i,appearance:new gn({translucent:!1,flat:!0}),asynchronous:!1})};var h_=gw;var Qgt=new h,e_t=new h,t_t=new h,n_t=new h;function YT(e,t,n){n=h.cross(e,t,n);let i=h.magnitude(n);return h.multiplyByScalar(n,D.EPSILON7/i,n)}function Tee(e,t){let n=h.normalize(e,n_t),i=h.equalsEpsilon(n,h.UNIT_X,D.EPSILON6)?h.UNIT_Y:h.UNIT_X;return YT(e,i,t)}function Mve(e){let t=$.getColumn(e,0,Qgt),n=$.getColumn(e,1,e_t),i=$.getColumn(e,2,t_t),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]=D.EPSILON7,e[4]=D.EPSILON7,e[8]=D.EPSILON7,e):(r&&!o&&!a?t=YT(n,i,t):!r&&o&&!a?n=YT(t,i,n):!r&&!o&&a?i=YT(n,t,i):r?o?a||(t=Tee(i,t),n=YT(i,t,n)):(t=Tee(n,t),i=YT(n,t,i)):(n=Tee(t,n),i=YT(n,t,i)),$.setColumn(e,0,t,e),$.setColumn(e,1,n,e),$.setColumn(e,2,i,e),e)}function _w(e,t){t=Mve(t),this._orientedBoundingBox=new Jt(e,t),this._boundingSphere=se.fromOrientedBoundingBox(this._orientedBoundingBox)}Object.defineProperties(_w.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});_w.prototype.distanceToCamera=function(e){return Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC))};_w.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};_w.prototype.update=function(e,t){h.clone(e,this._orientedBoundingBox.center),t=Mve(t),$.clone(t,this._orientedBoundingBox.halfAxes),se.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere)};_w.prototype.createDebugVolume=function(e){let t=new Rh({minimum:new h(-1,-1,-1),maximum:new h(1,1,1)}),n=L.fromRotationTranslation(this.boundingVolume.halfAxes,this.boundingVolume.center),i=new Nt({geometry:t,id:"outline",modelMatrix:n,attributes:{color:Kt.fromColor(e)}});return new Nn({geometryInstances:i,appearance:new gn({translucent:!1,flat:!0}),asynchronous:!1})};var Wu=_w;function yo(e,t,n,i){this._tileset=e,this._header=n;let r=l(n.contents),o=r&&n.contents.length>1||$i(n,"3DTILES_multiple_contents"),a=r&&!o?n.contents[0]:n.content;this._contentHeader=a,this.transform=l(n.transform)?L.unpack(n.transform):L.clone(L.IDENTITY);let s=l(i)?i.computedTransform:e.modelMatrix,c=L.multiply(s,this.transform,new L),u=l(i)?i._initialTransform:L.IDENTITY;this._initialTransform=L.multiply(u,this.transform,new L),this.computedTransform=c,this.metadata=uk(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,yo._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")&&yo._deprecationWarning("lowercase-refine",`This tile uses a lowercase refine "${n.refine}". Instead use "${n.refine.toUpperCase()}".`),p=n.refine.toUpperCase()==="REPLACE"?po.REPLACE:po.ADD):l(i)?p=i.refine:p=po.REPLACE,this.refine=p,this.children=[],this.parent=i;let g,m=!1,y,A,b;if(t=De.createIfNeeded(t),o)y=to.UNLOADED,A=t.clone();else if(l(a)){let E=a.uri;l(a.url)&&(yo._deprecationWarning("contentUrl",'This tileset JSON uses the "content.url" property which has been deprecated. Use "content.uri" instead.'),E=a.url),E===""?(yo._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 Qp(e,this),m=!0,y=to.READY):(y=to.UNLOADED,A=t.getDerivedResource({url:E}),b=jc.getServerKey(A.getUrlComponent()))}else g=new Qp(e,this),m=!0,y=to.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=nh.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}yo._deprecationWarning=Ds;Object.defineProperties(yo.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===to.READY}},contentUnloaded:{get:function(){return this._contentState===to.UNLOADED}},hasUnloadedRenderableContent:{get:function(){return this.hasRenderableContent&&this.contentUnloaded}},contentExpired:{get:function(){return this._contentState===to.EXPIRED}},contentFailed:{get:function(){return this._contentState===to.FAILED}},commandsLength:{get:function(){return this._commandsLength}}});var RA=new h;function i_t(e,t){let{tileset:n,boundingSphere:i}=e,{radius:r,center:o}=i,{camera:a}=t,s=h.multiplyByScalar(a.directionWC,e._centerZDepth,RA),c=h.add(a.positionWC,s,RA),u=h.subtract(c,o,RA);if(h.magnitude(u)>r){let C=h.normalize(u,RA),E=h.multiplyByScalar(C,r,RA),w=h.add(o,E,RA),P=h.subtract(w,a.positionWC,RA),R=h.normalize(P,RA);e._foveatedFactor=1-Math.abs(h.dot(a.directionWC,R))}else e._foveatedFactor=0;let p=e.refine===po.REPLACE,g=n.isSkippingLevelOfDetail;if(p&&!g||!n.foveatedScreenSpaceError||n.foveatedConeSize===1||e._priorityProgressiveResolution&&p&&g||n._pass===no.PRELOAD_FLIGHT||n._pass===no.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=D.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 zve=new K;yo.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 mn){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,D.EPSILON7),m=u.sseDenominator;if(p=a*d/(g*m),i.dynamicScreenSpaceError){let y=i._dynamicScreenSpaceErrorComputedDensity,A=i.dynamicScreenSpaceErrorFactor,b=D.fog(g,y)*A;p-=b}}return p/=e.pixelRatio,p};function r_t(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 o_t(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}yo.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:qa.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!==qa.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._priorityReverseScreenSpaceError=o_t(n,this),this._priorityProgressiveResolution=r_t(n,this),this.priorityDeferred=i_t(this,e),this._updatedVisibilityFrame=n._updatedVisibilityFrame};yo.prototype.updateExpiration=function(){if(l(this.expireDate)&&this.contentReady&&!this.hasEmptyContent&&!this.hasMultipleContents){let e=K.now(zve);K.lessThan(this.expireDate,e)&&(this._contentState=to.EXPIRED,this._expiredContent=this._content)}};function a_t(e){if(!l(e.expireDuration))return;let t=K.now(zve);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 s_t(e){return function(){return e._priority}}yo.prototype.requestContent=function(){if(!this.hasEmptyContent)return this.hasMultipleContents?c_t(this):u_t(this)};function c_t(e){let t=e._content,n=e._tileset;if(!l(t)){let r=$i(e._header,"3DTILES_multiple_contents")?e._header.extensions["3DTILES_multiple_contents"]:e._header;t=new fk(n,e,e._contentResource.clone(),r),e._content=t}let i=t.requestInnerContents();if(l(i))return e._contentState=to.LOADING,i.then(r=>{if(!e.isDestroyed()&&l(r))return e._contentState=to.PROCESSING,t}).catch(r=>{if(!e.isDestroyed())throw e._contentState=to.FAILED,r})}async function l_t(e,t,n,i,r){let o=e._contentState;e._contentState=to.LOADING,++t.statistics.numberOfPendingRequests;let a;try{a=await r}catch(s){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;if(n.cancelled||n.state===yi.CANCELLED){e._contentState=o,++t.statistics.numberOfAttemptedRequests;return}if(Uve(e,s))return i&&(e.expireDate=void 0),e._content=new Qp(t,e),Lve(e),e._contentState=to.PROCESSING,e._content;throw e._contentState=to.FAILED,s}if(e.isDestroyed()){--t.statistics.numberOfPendingRequests;return}if(n.cancelled||n.state===yi.CANCELLED){e._contentState=o,--t.statistics.numberOfPendingRequests,++t.statistics.numberOfAttemptedRequests;return}try{let s=await f_t(e,a);return--t.statistics.numberOfPendingRequests,e.isDestroyed()?void 0:(i&&(e.expireDate=void 0),e._content=s,s instanceof Qp&&Lve(e),e._contentState=to.PROCESSING,s)}catch(s){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;throw e._contentState=to.FAILED,s}}function u_t(e){let t=e._contentResource.clone(),n=e.contentExpired;n&&t.setQueryParameters({expired:e.expireDate.toString()});let i=new bo({throttle:!0,throttleByServer:!0,type:Ha.TILES3D,priorityFunction:s_t(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 l_t(e,r,i,n,o)}function Uve(e,t){let i=e._tileset?._runtimeContentCodec?.missingTilePolicy;return!l(i)||!l(t.statusCode)?!1:i.statusCodes.includes(t.statusCode)}function Lve(e){e.hasEmptyContent=!0,e.hasRenderableContent=!1}yo._isEmptyTile=Uve;async function f_t(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=d_(t);n._disableSkipLevelOfDetail=n._disableSkipLevelOfDetail||r.contentType===xs.GEOMETRY||r.contentType===xs.VECTOR,(r.contentType===xs.IMPLICIT_SUBTREE||r.contentType===xs.IMPLICIT_SUBTREE_JSON)&&(e.hasImplicitContent=!0,e.hasRenderableContent=!1),r.contentType===xs.EXTERNAL_TILESET&&(e.hasTilesetContent=!0,e.hasRenderableContent=!1);let o,a=VT[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=jT(n,s));let c=HT(n,s);return l(c)&&(o.group=new DT({metadata:c})),o}yo.prototype.cancelRequests=function(){this.hasMultipleContents?this._content.cancelRequests():this._request.cancel()};yo.prototype.unloadContent=function(){this.hasRenderableContent&&(this._content=this._content&&this._content.destroy(),this._contentState=to.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 Vve=new se;function vee(e,t){if(t.mode!==re.SCENE3D&&!l(e._boundingVolume2D)){let n=e._boundingVolume.boundingSphere,i=se.projectTo2D(n,t.mapProjection,Vve);e._boundingVolume2D=new h_(i.center,i.radius)}return t.mode!==re.SCENE3D?e._boundingVolume2D:e._boundingVolume}function d_t(e,t){if(t.mode!==re.SCENE3D&&!l(e._contentBoundingVolume2D)){let n=e._contentBoundingVolume.boundingSphere,i=se.projectTo2D(n,t.mapProjection,Vve);e._contentBoundingVolume2D=new h_(i.center,i.radius)}return t.mode!==re.SCENE3D?e._contentBoundingVolume2D:e._contentBoundingVolume}yo.prototype.visibility=function(e,t){let n=e.cullingVolume,i=vee(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 qa.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)};yo.prototype.contentVisibility=function(e){if(!l(this._contentBoundingVolume))return Xt.INSIDE;if(this._visibilityPlaneMask===qa.MASK_INSIDE)return Xt.INSIDE;let t=e.cullingVolume,n=d_t(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)};yo.prototype.distanceToTile=function(e){return vee(this,e).distanceToCamera(e)};var h_t=new h;yo.prototype.distanceToTileCenter=function(e){let n=vee(this,e).boundingVolume,i=h.subtract(n.center,e.camera.positionWC,h_t);return h.dot(e.camera.directionWC,i)};yo.prototype.insideViewerRequestVolume=function(e){let t=this._viewerRequestVolume;return!l(t)||t.distanceToCamera(e)===0};var jve=new $,Hve=new h,m_t=new $,Eee=new h,Gve=new ie,Wve=new Jt,Cee=new L;function p_t(e,t,n){let i=h.fromElements(e[0],e[1],e[2],Eee),r=$.fromArray(e,3,m_t);i=L.multiplyByPoint(t,i,i);let o=L.getMatrix3(t,jve);return r=$.multiply(o,r,r),l(n)?(n.update(i,r),n):new Wu(i,r)}function Nve(e,t,n,i){let r=ie.unpack(e,0,Gve),o=e[4],a=e[5],s=Jt.fromRectangle(r,o,a,te.WGS84,Wve),c=s.center,u=s.halfAxes;t=L.multiplyTransformation(t,L.inverseTransformation(n,Cee),Cee),c=L.multiplyByPoint(t,c,c);let f=L.getMatrix3(t,jve);return u=$.multiply(f,u,u),l(i)&&i instanceof Wu?(i.update(c,u),i):new Wu(c,u)}function g_t(e,t,n,i){if(!L.equalsEpsilon(t,n,D.EPSILON8))return i instanceof Wu?Nve(e,t,n,i):Nve(e,t,n,void 0);let r=ie.unpack(e,0,Gve);return i instanceof Vf?(i.rectangle=ie.clone(r,i.rectangle),i.minimumHeight=e[4],i.maximumHeight=e[5],i.computeBoundingVolumes(te.WGS84),i):new Vf({rectangle:r,minimumHeight:e[4],maximumHeight:e[5]})}function __t(e,t,n){let i=h.fromElements(e[0],e[1],e[2],Eee),r=e[3];i=L.multiplyByPoint(t,i,i);let o=L.getScale(t,Hve),a=h.maximumComponent(o);return r*=a,l(n)?(n.update(i,r),n):new h_(i,r)}yo.prototype.createBoundingVolume=function(e,t,n){let i=this.metadata,r;if(l(i)&&(r=vA.parseBoundingVolumeSemantic("TILE",i)),l(r)&&(e=r),!l(e))throw new oe("boundingVolume must be defined");if($i(e,"3DTILES_bounding_volume_S2"))return new hk(e.extensions["3DTILES_bounding_volume_S2"]);let{box:o,region:a,sphere:s}=e;if(l(o)){let c=p_t(o,t,n);return this._verticalExaggeration!==1&&Fve(c,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c}if(l(a)){let c=g_t(a,t,this._initialTransform,n);return this._verticalExaggeration===1||(c instanceof Wu?Fve(c,this._verticalExaggeration,this._verticalExaggerationRelativeHeight):(c.minimumHeight=fr.getHeight(c.minimumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c.maximumHeight=fr.getHeight(c.maximumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c.computeBoundingVolumes(te.WGS84))),c}if(l(s)){let c=__t(s,t,n);if(this._verticalExaggeration!==1){let u=fr.getPosition(c.center,te.WGS84,this._verticalExaggeration,this._verticalExaggerationRelativeHeight,Eee),f=c.radius*this._verticalExaggeration;c.update(u,f)}return c}throw new oe("boundingVolume must contain a sphere, region, or box")};var y_t=h.unpackArray(new Array(24).fill(0));function Fve(e,t,n){let i=e.boundingVolume.computeCorners(y_t).map(o=>fr.getPosition(o,te.WGS84,t,n,o)),r=Jt.fromPoints(i,Wve);e.update(r.center,r.halfAxes)}yo.prototype.updateTransform=function(e,t){e=e??L.IDENTITY;let n=L.multiplyTransformation(e,this.transform,Cee),i=!L.equals(n,this.computedTransform),r=l(t)&&(this._verticalExaggeration!==t.verticalExaggeration||this._verticalExaggerationRelativeHeight!==t.verticalExaggerationRelativeHeight);if(!i&&!r)return;i&&L.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()};yo.prototype.updateGeometricErrorScale=function(){let e=L.getScale(this.computedTransform,Hve),t=h.maximumComponent(e);if(this.geometricError=this._geometricError*t,!l(this.parent)){let n=this._tileset;n._scaledGeometricError=n._geometricError*t}};function A_t(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 b_t(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=to.FAILED,r}}function x_t(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 T_t(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)}yo.prototype.update=function(e,t,n){let{commandList:i}=t,r=i.length;x_t(this,e),T_t(this,e),A_t(this,e,t,n),b_t(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 Bve=[];yo.prototype.process=function(e,t){!this.contentExpired&&!this.contentReady&&this._content.ready&&(a_t(this),this._selectedFrame=0,this.lastStyleTime=0,K.now(this._loadTimestamp),this._contentState=to.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=Bve;try{this._content.update(e,t)}catch(i){throw this._contentState=to.FAILED,i}Bve.length=0,t.commandList=n};function kve(e,t,n){let i=e*Math.pow(10,t);return parseInt(i)*Math.pow(10,n)}function XH(e,t,n){return Math.max(D.normalize(e,t,n)-D.EPSILON7,0)}yo.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=XH(this._depth,n.depth,i.depth);x=t?1-x:x;let C=!e.isSkippingLevelOfDetail&&this.refine===po.REPLACE?XH(this._priorityHolder._distanceToCamera,n.distance,i.distance):XH(this._priorityReverseScreenSpaceError,n.reverseScreenSpaceError,i.reverseScreenSpaceError),E=kve(C,s,a),w=this._priorityProgressiveResolution?0:p,P=XH(this._priorityHolder._foveatedFactor,n.foveatedFactor,i.foveatedFactor),R=kve(P,u,c),O=this.priorityDeferred?y:0,N=e._pass===no.PRELOAD_FLIGHT?0:b;this._priority=x+E+w+R+O+N};yo.prototype.isDestroyed=function(){return!1};yo.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 rh=yo;function m_(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(m_.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}}});m_.prototype.hasProperty=function(e){return qn.hasProperty(e,this._properties,this._class)};m_.prototype.hasPropertyBySemantic=function(e){return qn.hasPropertyBySemantic(e,this._properties,this._class)};m_.prototype.getPropertyIds=function(e){return qn.getPropertyIds(this._properties,this._class,e)};m_.prototype.getProperty=function(e){return qn.getProperty(e,this._properties,this._class)};m_.prototype.setProperty=function(e,t){return qn.setProperty(e,t,this._properties,this._class)};m_.prototype.getPropertyBySemantic=function(e){return qn.getPropertyBySemantic(e,this._properties,this._class)};m_.prototype.setPropertyBySemantic=function(e,t){return qn.setPropertyBySemantic(e,t,this._properties,this._class)};var yw=m_;function p_(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(p_.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});p_.prototype.hasProperty=function(e){return qn.hasProperty(e,this._properties,this._class)};p_.prototype.hasPropertyBySemantic=function(e){return qn.hasPropertyBySemantic(e,this._properties,this._class)};p_.prototype.getPropertyIds=function(e){return qn.getPropertyIds(this._properties,this._class,e)};p_.prototype.getProperty=function(e){return qn.getProperty(e,this._properties,this._class)};p_.prototype.setProperty=function(e,t){return qn.setProperty(e,t,this._properties,this._class)};p_.prototype.getPropertyBySemantic=function(e){return qn.getPropertyBySemantic(e,this._properties,this._class)};p_.prototype.setPropertyBySemantic=function(e,t){return qn.setPropertyBySemantic(e,t,this._properties,this._class)};var mk=p_;function qve(e){e=e??H.EMPTY_OBJECT;let t=e.metadataJson,n=e.schema,i=t.metadata??t.tileset,r;l(i)&&(r=new mk({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 yw({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 yw({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(qve.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 XT=qve;var Yve={},C_t=new h;Yve.checkChildrenWithinParent=function(e){let t=e.children,n=t.length,i=e.boundingVolume;if(i instanceof Wu||i instanceof Vf){let r=i._orientedBoundingBox;e._optimChildrenWithinParent=nh.USE_OPTIMIZATION;for(let o=0;o<n;++o){let s=t[o].boundingVolume;if(!(s instanceof Wu||s instanceof Vf)){e._optimChildrenWithinParent=nh.SKIP_OPTIMIZATION;break}let c=s._orientedBoundingBox,u=h.subtract(c.center,r.center,C_t),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=nh.SKIP_OPTIMIZATION;break}}}return e._optimChildrenWithinParent===nh.USE_OPTIMIZATION};var pk=Yve;function KT(){this._list=new GD,this._sentinel=this._list.add(),this._trimTiles=!1}KT.prototype.reset=function(){this._list.splice(this._list.tail,this._sentinel)};KT.prototype.touch=function(e){let t=e.cacheNode;l(t)&&this._list.splice(this._sentinel,t)};KT.prototype.add=function(e){l(e.cacheNode)||(e.cacheNode=this._list.add(e))};KT.prototype.unloadTile=function(e,t,n){let i=t.cacheNode;l(i)&&(this._list.remove(i),t.cacheNode=void 0,n(e,t))};KT.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)}};KT.prototype.trim=function(){this._trimTiles=!0};var gk=KT;function KH(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 wee(e,t){let n;return t==="_loadTimestamp"?n=K.toDate(e).getTime():n=e,n}KH.prototype.setReferenceMinimumMaximum=function(e,t,n){this._referenceMinimum[n]=wee(e,n),this._referenceMaximum[n]=wee(t,n)};function v_t(e,t){let n=e.tilePropertyName;if(l(n)){let i=wee(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 See=[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)];KH.prototype.colorize=function(e,t){let n=this.tilePropertyName;if(!l(n)||!e.contentAvailable||e._selectedFrame!==t.frameNumber)return;let i=v_t(this,e),r=this._previousMinimum,o=this._previousMaximum;if(r===Number.MAX_VALUE||o===-Number.MAX_VALUE)return;let a=o-r+D.EPSILON7,c=D.clamp(i-r,0,a)/a,u=See.length-1,f=c*u,d=Math.floor(f),p=Math.ceil(f),g=f-d,m=See[d],y=See[p],A=U.clone(U.WHITE);A.red=D.lerp(m.red,y.red,g),A.green=D.lerp(m.green,y.green,g),A.blue=D.lerp(m.blue,y.blue,g),e._debugColor=A};KH.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 _k=KH;function Aw(){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}Aw.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};Aw.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])}};Aw.prototype.incrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded+=e.featuresLength,this.numberOfPointsLoaded+=e.pointsLength,this.geometryByteLength+=e.geometryByteLength,this.batchTableByteLength+=e.batchTableByteLength,!(e instanceof zf))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])}};Aw.prototype.decrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded-=e.featuresLength,this.numberOfPointsLoaded-=e.pointsLength,this.geometryByteLength-=e.geometryByteLength,this.batchTableByteLength-=e.batchTableByteLength,!(e instanceof zf))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])}};Aw.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 Mm=Aw;function yk(){this._style=void 0,this._styleDirty=!1,this._lastStyleTime=0}Object.defineProperties(yk.prototype,{style:{get:function(){return this._style},set:function(e){e!==this._style&&(this._style=e,this._styleDirty=!0)}}});yk.prototype.makeDirty=function(){this._styleDirty=!0};yk.prototype.resetDirty=function(){this._styleDirty=!1};yk.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 Ak=yk;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||!E_t(e,t))return;let i=t.camera.timeSinceMoved<n.foveatedTimeDelay;e.priorityDeferred&&i||(e._requestedFrame=t.frameNumber,n._requestedTiles.push(e))};function E_t(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){Xve(e,t),e.updateExpiration(),e._wasMinPriorityChild=!1,e._priorityHolder=e,I_t(e),e._shouldSelect=!1,e._finalResolution=!0};function Xve(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];Xve(o,t),e._visible=o._visible;return}if(S_t(e,t)){e._visible=!1;return}let i=e.refine===po.REPLACE,r=e._optimChildrenWithinParent===nh.USE_OPTIMIZATION;if(i&&r&&n&&!w_t(e,t)){++e.tileset._statistics.numberOfTilesCulledWithChildrenUnion,e._visible=!1;return}}function S_t(e,t){let{parent:n,tileset:i}=e;return!l(n)||n.hasTilesetContent||n.hasImplicitContent||n.refine!==po.ADD?!1:e.getScreenSpaceError(t,!0)<=i.memoryAdjustedScreenSpaceError}function w_t(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 I_t(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 js=g_;function Kve(){}var bk={stack:new kl,stackMaximumLength:0};Kve.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}=js,a=bk.stack;for(a.push(i);a.length>0;){bk.stackMaximumLength=Math.max(bk.stackMaximumLength,a.length);let s=a.pop(),c=s.refine===po.ADD,u=s.refine===po.REPLACE,f=P_t(s);f&&D_t(s,a,t),(c||u&&!f)&&(R_t(e,s),r(s,t),O_t(s,t),s.hasRenderableContent&&!s.contentAvailable&&(n=!1)),o(s,t)}return bk.stack.trim(bk.stackMaximumLength),n};function P_t(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:(e.hasEmptyContent,!0)}function D_t(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 R_t(e,t){(t.hasUnloadedRenderableContent||t.contentExpired)&&(t._priority=0,e._requestedTiles.push(t))}function O_t(e,t){e.contentAvailable&&e.contentVisibility(t)!==Xt.OUTSIDE&&e.tileset._selectedTiles.push(e)}var xk=Kve;function $ve(){}var Tk={stack:new kl,stackMaximumLength:0},Ck={stack:new kl,stackMaximumLength:0};$ve.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(js.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;L_t(n,t),Tk.stack.trim(Tk.stackMaximumLength),Ck.stack.trim(Ck.stackMaximumLength);let i=e._requestedTiles;for(let r=0;r<i.length;++r)i[r].updatePriority()};function Iee(e,t){e.contentAvailable&&js.selectTile(e,t)}function M_t(e,t,n){let i=e.refine===po.REPLACE,{tileset:r,children:o}=e,{updateTile:a,loadTile:s,touchTile:c}=js;for(let m=0;m<o.length;++m)a(o[m],n);o.sort(js.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=N_t(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 L_t(e,t){let{tileset:n}=e,{canTraverse:i,loadTile:r,visitTile:o,touchTile:a}=js,s=Tk.stack;for(s.push(e);s.length>0;){Tk.stackMaximumLength=Math.max(Tk.stackMaximumLength,s.length);let c=s.pop(),u=c.parent,f=!l(u)||u._refines;c._refines=i(c)?M_t(c,s,t)&&f:!1;let d=!c._refines&&f;c.hasRenderableContent?c.refine===po.ADD?(Iee(c,t),r(c,t)):c.refine===po.REPLACE&&(r(c,t),d&&Iee(c,t)):(n._emptyTiles.push(c),r(c,t),d&&Iee(c,t)),o(c,t),a(c,t)}}function N_t(e,t){let{canTraverse:n,updateTile:i,loadTile:r,touchTile:o}=js,a=!0,s=Ck.stack;for(s.push(e);s.length>0;){Ck.stackMaximumLength=Math.max(Ck.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 vk=$ve;function Jve(){}var Ek={stack:new kl,stackMaximumLength:0},Sk={stack:new kl,stackMaximumLength:0},__={stack:new kl,stackMaximumLength:0,ancestorStack:new kl,ancestorStackMaximumLength:0},F_t=2;Jve.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(js.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;j_t(n,t),H_t(n,t),Ek.stack.trim(Ek.stackMaximumLength),Sk.stack.trim(Sk.stackMaximumLength),__.stack.trim(__.stackMaximumLength),__.ancestorStack.trim(__.ancestorStackMaximumLength);let i=e._requestedTiles;for(let r=0;r<i.length;++r)i[r].updatePriority()};function B_t(e,t){let{updateTile:n,touchTile:i,selectTile:r}=js,o=Sk.stack;for(o.push(e);o.length>0;){Sk.stackMaximumLength=Math.max(Sk.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<F_t&&o.push(u))}}}function $H(e,t){let n=e.contentAvailable?e:e._ancestorWithContentAvailable;l(n)?n._shouldSelect=!0:B_t(e,t)}function k_t(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 z_t(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 U_t(e,t,n){let{tileset:i,children:r}=e,{updateTile:o,loadTile:a,touchTile:s}=js;for(let u=0;u<r.length;++u)o(r[u],n);r.sort(js.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 V_t(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 j_t(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}=js,c=Ek.stack;for(c.push(e);c.length>0;){Ek.stackMaximumLength=Math.max(Ek.stackMaximumLength,c.length);let u=c.pop();k_t(u,t);let f=u.parent,d=!l(f)||f._refines;u._refines=r(u)?U_t(u,c,t)&&d:!1;let p=!u._refines&&d;u.hasRenderableContent?u.refine===po.ADD?($H(u,t),o(u,t)):u.refine===po.REPLACE&&(V_t(u,i)?(o(u,t),p&&$H(u,t)):p?($H(u,t),o(u,t)):z_t(n,u)&&o(u,t)):(n._emptyTiles.push(u),o(u,t),p&&$H(u,t)),a(u,t),s(u,t)}}function H_t(e,t){let{selectTile:n,canTraverse:i}=js,{stack:r,ancestorStack:o}=__,a;for(r.push(e);r.length>0||o.length>0;){if(__.stackMaximumLength=Math.max(__.stackMaximumLength,r.length),__.ancestorStackMaximumLength=Math.max(__.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===po.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 wk=Jve;function Cs(){this._layers=[],this.layerAdded=new be,this.layerRemoved=new be,this.layerMoved=new be,this.layerShownOrHidden=new be}Object.defineProperties(Cs.prototype,{length:{get:function(){return this._layers.length}}});Cs.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()})};Cs.prototype.addImageryProvider=function(e,t){let n=new Ta(e);return this.add(n,t),n};Cs.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};Cs.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=[]};Cs.prototype.contains=function(e){return this.indexOf(e)!==-1};Cs.prototype.indexOf=function(e){return this._layers.indexOf(e)};Cs.prototype.get=function(e){return this._layers[e]};function JH(e,t){return e.indexOf(t)}function Zve(e,t,n){let i=e._layers;if(t=D.clamp(t,0,i.length-1),n=D.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)}Cs.prototype.raise=function(e){let t=JH(this._layers,e);Zve(this,t,t+1)};Cs.prototype.lower=function(e){let t=JH(this._layers,e);Zve(this,t,t-1)};Cs.prototype.raiseToTop=function(e){let t=JH(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))};Cs.prototype.lowerToBottom=function(e){let t=JH(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 Qve=new ie;function eEe(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=Qve,p=1/1024;d.west=D.lerp(o.rectangle.west,o.rectangle.east,c.textureCoordinateRectangle.x-p),d.east=D.lerp(o.rectangle.west,o.rectangle.east,c.textureCoordinateRectangle.z+p),d.south=D.lerp(o.rectangle.south,o.rectangle.north,c.textureCoordinateRectangle.y-p),d.north=D.lerp(o.rectangle.south,o.rectangle.north,c.textureCoordinateRectangle.w+p),ie.contains(d,t)&&i(u)}}Cs.prototype.pickImageryLayers=function(e,t){let n=t.globe.pick(e,t);if(!l(n))return;let i=t.ellipsoid.cartesianToCartographic(n),r=[];if(eEe(t,i,!1,function(o){r.push(o.imageryLayer)}),r.length!==0)return r};var G_t=new ie,W_t=new ie,Pee=new z,Dee=new z,q_t=new de,Y_t=new de;function X_t(e,t,n,i){let r=n.imageryProvider.tilingScheme,o=r.rectangleToNativeRectangle(e,G_t),a=1/1024,s=W_t;s.west=D.lerp(o.west,o.east,t.minX-a),s.east=D.lerp(o.west,o.east,t.maxX+a),s.south=D.lerp(o.south,o.north,t.minY-a),s.north=D.lerp(o.south,o.north,t.maxY+a),l(i)||(i=new ie);let c=r.projection;if(c instanceof Bi)return i.west=D.toRadians(s.west),i.south=D.toRadians(s.south),i.east=D.toRadians(s.east),i.north=D.toRadians(s.north),i;Pee.x=s.west,Pee.y=s.south,Dee.x=s.east,Dee.y=s.north;let u=c.unproject(Pee,q_t),f=c.unproject(Dee,Y_t);return i.west=u.longitude,i.south=u.latitude,i.east=f.longitude,i.north=f.latitude,i}function K_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=X_t(A,d.textureCoordinateRectangle,g,Qve);ie.contains(b,t)&&n(p)}}}}Cs.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)&&eEe(t,r,!0,function(c){s(c)}),l(i)&&K_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})};Cs.prototype.queueReprojectionCommands=function(e){let t=this._layers;for(let n=0,i=t.length;n<i;++n)t[n].queueReprojectionCommands(e)};Cs.prototype.cancelReprojections=function(){let e=this._layers;for(let t=0,n=e.length;t<n;++t)e[t].cancelReprojections()};Cs.prototype.isDestroyed=function(){return!1};Cs.prototype.destroy=function(){return this.removeAll(!0),ue(this)};Cs.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 $T=Cs;function io(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 gk,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 kl,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 Ak,this._styleApplied=!1,this._modelMatrix=l(e.modelMatrix)?L.clone(e.modelMatrix):L.clone(L.IDENTITY),this._addHeightCallbacks=[],this._statistics=new Mm,this._statisticsLast=new Mm,this._statisticsPerPass=new Array(no.NUMBER_OF_PASSES);for(let r=0;r<no.NUMBER_OF_PASSES;++r)this._statisticsPerPass[r]=new Mm;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 _k(e.debugHeatmapTilePropertyName),this.cullRequestsWhileMoving=e.cullRequestsWhileMoving??!0,this._cullRequestsWhileMoving=!1,this.cullRequestsWhileMovingMultiplier=e.cullRequestsWhileMovingMultiplier??60,this.progressiveResolutionHeightFraction=D.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=L.IDENTITY,this._clippingPlanesOriginMatrix=void 0,this._clippingPlanesOriginMatrixDirty=!0,this._vectorClassificationOnly=e.vectorClassificationOnly??!1,this._vectorKeepDecodedPositions=e.vectorKeepDecodedPositions??!1,this._imageryLayers=new $T(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??D.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=ku.HIGHLIGHT,this.colorBlendAmount=.5,this._pointCloudShading=new qp(e.pointCloudShading),this._pointCloudEyeDomeLighting=new Hg,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)&&Aa.setOwner(e.clippingPlanes,this,"_clippingPlanes"),this._clippingPolygons=void 0,l(e.clippingPolygons)&&hm.setOwner(e.clippingPolygons,this,"_clippingPolygons"),l(e.imageBasedLighting)?(this._imageBasedLighting=e.imageBasedLighting,this._shouldDestroyImageBasedLighting=!1):(this._imageBasedLighting=new yT,this._shouldDestroyImageBasedLighting=!0),this._environmentMapManager=new Ug(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??Fo.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??qd.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(io.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){Aa.setOwner(e,this,"_clippingPlanes")}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){hm.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 Ds("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=L.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&&(L.multiply(this.root.computedTransform,this._initialClippingPlanesOriginMatrix,this._clippingPlanesOriginMatrix),this._clippingPlanesOriginMatrixDirty=!1),this._clippingPlanesOriginMatrix):L.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,cEe(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}}});io.fromIonAssetId=async function(e,t){let n=await ca.fromAssetId(e);return io.fromUrl(n,t)};io.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 io.loadJson(n),o=await $_t(n,r),a=new io(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,cEe(a);let c=l(r.asset.gltfUpAxis)?ki.fromName(r.asset.gltfUpAxis):ki.Y,u=t.modelUpAxis??c,f=t.modelForwardAxis??ki.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,L.IDENTITY).boundingSphere.center,g=a._ellipsoid.cartesianToCartographic(p);return l(g)&&g.height>wi._defaultMinTerrainHeight&&(a._initialClippingPlanesOriginMatrix=mt.eastNorthUpToFixedFrame(p)),a._clippingPlanesOriginMatrix=L.clone(a._initialClippingPlanesOriginMatrix),a};io.loadJson=function(e){return De.createIfNeeded(e).fetchJson()};io.prototype.makeStyleDirty=function(){this._styleEngine.makeDirty()};io.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)&&io.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=tEe(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===po.ADD;let u=c._header.children;if(l(u))for(let f=0;f<u.length;++f){let d=u[f],p=tEe(this,e,d,c);c.children.push(p),p._depth=c._depth+1,s.push(p)}this._cullWithChildrenBounds&&pk.checkChildrenWithinParent(c)}return a};function tEe(e,t,n,i){if(!(l(n.implicitTiling)||$i(n,"3DTILES_implicit_tiling")))return new rh(e,t,n,i);let o=e.schema,a=new Cp(t,n,o),s=new Tp({subdivisionScheme:a.subdivisionScheme,subtreeLevels:a.subtreeLevels,level:0,x:0,y:0,z:0}),c=a.subtreeUriTemplate.getDerivedResource({templateValues:s.getTemplateValues()}).url,f=Ye(n,!0);f.contents=[{uri:c}],delete f.content,delete f.extensions;let d=new rh(e,t,f,i);return d.implicitTileset=a,d.implicitCoordinates=s,d}async function $_t(e,t){let n=$i(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t,i;if(l(n.schemaUri))e=e.getDerivedResource({url:n.schemaUri}),i=Mi.getSchemaLoader({resource:e});else if(l(n.schema))i=Mi.getSchemaLoader({schema:n.schema});else return;await i.load();let r=new XT({schema:i.schema,metadataJson:n});return Mi.unload(i),r}var nEe=new h,J_t=new de,Z_t=new L,Q_t=new h,eyt=new h,tyt=new h,nyt=new h;function iyt(e,t){let n,i,r,o,a,s=t.camera,c=e._root,u=c.contentBoundingVolume;if(u instanceof Vf)n=h.normalize(s.positionWC,nEe),i=s.directionWC,r=s.positionCartographic.height,o=u.minimumHeight,a=u.maximumHeight;else{let y=L.inverseTransformation(c.computedTransform,Z_t),A=t.mapProjection.ellipsoid,b=u.boundingVolume,x=L.multiplyByPoint(y,b.center,Q_t);if(h.magnitude(x)>A.minimumRadius){let T=de.fromCartesian(x,A,J_t);n=h.normalize(s.positionWC,nEe),i=s.directionWC,r=s.positionCartographic.height,o=0,a=T.height*2}else{let T=L.multiplyByPoint(y,s.positionWC,eyt);if(n=h.UNIT_Z,i=L.multiplyByPointAsVector(y,s.directionWC,tyt),i=h.normalize(i,i),r=T.z,u instanceof Wu){let C=$.getColumn(b.halfAxes,2,nyt),E=h.magnitude(C);o=x.z-E,a=x.z+E}else if(u instanceof h_){let C=b.radius;o=x.z-C,a=x.z+C}}}let f=e.dynamicScreenSpaceErrorHeightFalloff,d=o+(a-o)*f,p=a,g=D.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 ryt(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=>{oEe(o,e,t)}),i&&(t.hasTilesetContent||t.hasImplicitContent?yyt(e,t):(n.decrementLoadCounts(t.content),--n.numberOfTilesWithContentReady)),e._requestedTilesInFlight.push(t))}function rEe(e,t){return e._priority-t._priority}io.prototype.postPassesUpdate=function(e){l(this._root)&&(oyt(this,e),byt(this,e),this._cache.unloadTiles(this,sEe),this._styleApplied&&this._styleEngine.resetDirty(),this._styleApplied=!1)};io.prototype.prePassesUpdate=function(e){if(!l(this._root))return;dyt(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&&iyt(this,e),e.newFrame&&this._cache.reset()};function oyt(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!==to.LOADING){++i;continue}else if(a){o.cancelRequests(),++i;continue}i>0&&(n[r-i]=o)}n.length-=i}function ayt(e){let t=e._requestedTiles;t.sort(rEe);for(let n=0;n<t.length;++n)ryt(e,t[n])}function oEe(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 syt(e){let t=e._processingQueue,n=0;for(let i=0;i<t.length;++i){let r=t[i];if(r.isDestroyed()||r._contentState!==to.PROCESSING){++n;continue}n>0&&(t[i-n]=r)}t.length-=n}var cyt=new de,lyt=new de,uyt=new h;function fyt(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,cyt),c=de.fromCartesian(r.center,a,lyt);l(c)&&(s.height=c.height);let u=de.toCartesian(s,a,uyt);h.distance(u,r.center)<=r.radius&&(o.invoked=!0,n.afterRender.push(()=>{l(o.callback)&&o.callback(),o.invoked=!1}))}}function dyt(e,t){syt(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,oEe(f,e,u)}}e.totalMemoryUsageInBytes<i?myt(e):s&&n.length>0&&hyt(e)}function hyt(e){e._memoryAdjustedScreenSpaceError*=1.02;let t=e._processingQueue;for(let n=0;n<t.length;++n)t[n].updatePriority();t.sort(rEe)}function myt(e){e._memoryAdjustedScreenSpaceError=Math.max(e.memoryAdjustedScreenSpaceError/1.02,e.maximumScreenSpaceError)}var ZH=new h,pyt={maximumFractionDigits:3};function iEe(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,pyt):Math.round(t).toLocaleString()}function Ree(e){let{halfAxes:t,radius:n,center:i}=e.boundingVolume.boundingVolume,r=h.clone(i,ZH);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,ZH);o=h.multiplyByScalar(o,.75*n,ZH),r=h.add(o,i,ZH)}return r}function Oee(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: ${iEe(e.content.texturesByteLength)}`,i+=`
Geometry Memory: ${iEe(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 gyt(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:Ree(e.debugPickedTile),s=Oee(e.debugPickedTile,e,a);s.pixelOffset=new z(15,-15)}}else{for(let a=0;a<i;++a){let s=n[a];Oee(s,e,Ree(s))}for(let a=0;a<o;++a){let s=r[a];(s.hasTilesetContent||s.hasImplicitContent)&&Oee(s,e,Ree(s))}}e._tileDebugLabels.update(t)}function _yt(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),fyt(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 Hp),gyt(e,t)):e._tileDebugLabels=e._tileDebugLabels&&e._tileDebugLabels.destroy())}var aEe=[];function yyt(e,t){let n=t,i=aEe;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&&(Ayt(e,t),--e._statistics.numberOfTilesTotal)}n.children=[]}function sEe(e,t){e.tileUnload.raiseEvent(t),e._statistics.decrementLoadCounts(t.content),--e._statistics.numberOfTilesWithContentReady,t.unloadContent()}function Ayt(e,t){e._cache.unloadTile(e,t,sEe),t.destroy()}io.prototype.trimLoadedTiles=function(){this._cache.trim()};function byt(e,t){let n=e._statistics,i=e._statisticsLast,r=n.numberOfPendingRequests,o=n.numberOfTilesProcessing,a=i.numberOfPendingRequests,s=i.numberOfTilesProcessing;Mm.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 xyt(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 Tyt(e,t){t.frameNumber===e._updatedModelMatrixFrame&&l(e._previousModelMatrix)||(e._updatedModelMatrixFrame=t.frameNumber,e._modelMatrixChanged=!L.equals(e.modelMatrix,e._previousModelMatrix),e._modelMatrixChanged&&(e._previousModelMatrix=L.clone(e.modelMatrix,e._previousModelMatrix)))}function Cyt(e,t,n,i){if(t.mode===re.MORPHING||!l(e._root))return!1;let r=e._statistics;r.clear(),++e._updatedVisibilityFrame,xyt(e),Tyt(e,t),e._cullRequestsWhileMoving=e.cullRequestsWhileMoving&&!e._modelMatrixChanged;let o=e.getTraversal(i).selectTiles(e,t);if(i.requestTiles&&ayt(e),_yt(e,t,i),Mm.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 cEe(e){let t=e._credits;l(t)||(t=[]),t.length=0,l(e.resource.credits)&&e.resource.credits.forEach(i=>{t.push(St.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 St(o.html))}}t.forEach(i=>i.showOnScreen=i.showOnScreen||e._showCreditsOnScreen),e._credits=t}io.prototype.getTraversal=function(e){let{pass:t}=e;return t===no.MOST_DETAILED_PRELOAD||t===no.MOST_DETAILED_PICK?xk:this.isSkippingLevelOfDetail?wk:vk};io.prototype.update=function(e){this.updateForPass(e,e.tilesetPassState)};io.prototype.updateForPass=function(e,t){this.imageryLayers._update();let n=t.pass;if(n===no.PRELOAD&&(!this.preloadWhenHidden||this.show)||n===no.PRELOAD_FLIGHT&&(!this.preloadFlightDestinations||!this.show&&!this.preloadWhenHidden)||n===no.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=no.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=Cyt(this,e,d,a)),s&&(c.length=u),e.commandList=i,e.camera=r,e.cullingVolume=o};io.prototype.hasExtension=function(e){return l(this._extensionsUsed)?this._extensionsUsed.indexOf(e)>-1:!1};io.prototype.isDestroyed=function(){return!1};io.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=aEe;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)};io.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};io.checkSupportedExtensions=function(e){for(let t=0;t<e.length;t++)if(!io.supportedExtensions[e[t]])throw new oe(`Unsupported 3D Tiles Extension: ${e[t]}`)};var vyt=new dn,Eyt=new h,Syt=new de;io.prototype.getHeight=function(e,t){let n=t.ellipsoid;l(n)||(n=te.WGS84);let i=vyt,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,Eyt);if(l(o))return n.cartesianToCartographic(o,Syt)?.height};io.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 wyt=new Wo,Iyt=new h;io.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,wyt);!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,Iyt);if(l(f))return s=h.clone(f,n),s}};io.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};io.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 Uo=io;var Pyt=new L;function OA(e,t){t.collectionChanged.addEventListener(OA.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._tilesetHash={},this._entitiesToVisualize=new kt,this._onCollectionChanged(t,t.values,[],[])}OA.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,Pyt),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],Dyt(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};OA.prototype.isDestroyed=function(){return!1};OA.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(OA.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._tilesetHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)Mee(this,e[i],t,n);return ue(this)};OA.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};OA.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):(Mee(this,o,s,c),a.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],Mee(this,o,s,c),a.remove(o.id)};function Mee(e,t,n,i){let r=n[t.id];l(r)&&(l(r.tilesetPrimitive)&&i.removeAndDestroy(r.tilesetPrimitive),delete n[t.id])}async function Dyt(e,t,n,i){t[n.id]={url:e.url,loadFail:!1};try{let r=await Uo.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 Ik=OA;function JT(e,t,n){this._callback=void 0,this._isConstant=void 0,this._referenceFrame=n??Ui.FIXED,this._definitionChanged=new be,this.setCallback(e,t)}Object.defineProperties(JT.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var Ryt=new K;JT.prototype.getValue=function(e,t){return l(e)||(e=K.now(Ryt)),this.getValueInReferenceFrame(e,Ui.FIXED,t)};JT.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};JT.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._callback(e,n);return nm.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};JT.prototype.equals=function(e){return this===e||e instanceof JT&&this._callback===e._callback&&this._isConstant===e._isConstant&&this._referenceFrame===e._referenceFrame};var Pk=JT;function Oyt(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 ZT(){this._eventHelper=new Lo,this._definitionChanged=new be,this._intervals=new ga,this._intervals.changedEvent.addEventListener(ZT.prototype._intervalsChanged,this)}Object.defineProperties(ZT.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var Myt=new K;ZT.prototype.getValue=function(e,t){l(e)||(e=K.now(Myt));let n=this._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};ZT.prototype.equals=function(e){return this===e||e instanceof ZT&&this._intervals.equals(e._intervals,X.equals)};ZT.prototype._intervalsChanged=function(){Oyt(this,this._eventHelper,this._definitionChanged,this._intervals),this._definitionChanged.raiseEvent(this)};var pl=ZT;function MA(e){this._referenceFrame=e??Ui.FIXED,this._definitionChanged=new be,this._composite=new pl,this._composite.definitionChanged.addEventListener(MA.prototype._raiseDefinitionChanged,this)}Object.defineProperties(MA.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 Lyt=new K;MA.prototype.getValue=function(e,t){return l(e)||(e=K.now(Lyt)),this.getValueInReferenceFrame(e,Ui.FIXED,t)};MA.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(i))return i.getValueInReferenceFrame(e,t,n)};MA.prototype.equals=function(e){return this===e||e instanceof MA&&this._referenceFrame===e._referenceFrame&&this._composite.equals(e._composite,X.equals)};MA.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var hc=MA;var lEe={WHOLE:0,PORTIONS:1};Object.freeze(lEe);var t0=lEe;function QT(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(jf.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 jf(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(jf.prototype._onCollectionChanged,this)}Object.defineProperties(jf.prototype,{isConstant:{get:function(){return X.isConstant(QT(this))}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){let e=QT(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 QT(this)}}});jf.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 jf(e,n,i)};var Nyt=new K;jf.prototype.getValue=function(e,t){let n=QT(this);return l(e)||(e=K.now(Nyt)),l(n)?n.getValue(e,t):void 0};jf.prototype.getValueInReferenceFrame=function(e,t,n){let i=QT(this);return l(i)?i.getValueInReferenceFrame(e,t,n):void 0};jf.prototype.getType=function(e){let t=QT(this);return l(t)?t.getType(e):void 0};jf.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};jf.prototype._onTargetEntityDefinitionChanged=function(e,t,n,i){l(this._targetProperty)&&this._targetPropertyNames[0]===t&&(this._targetProperty=void 0,this._definitionChanged.raiseEvent(this))};jf.prototype._onCollectionChanged=function(e,t,n){let i=this._targetEntity;l(i)&&n.indexOf(i)!==-1?(i.definitionChanged.removeEventListener(jf.prototype._onTargetEntityDefinitionChanged,this),this._targetEntity=this._targetProperty=void 0):l(i)||(i=QT(this),l(i)&&this._definitionChanged.raiseEvent(this))};var y_=jf;var uEe={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 fEe(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 dEe(e,t){return e instanceof K?e:typeof e=="string"?K.fromIso8601(e):K.addSeconds(t,e,new K)}var Lee=[],Nee=[];function QH(e,t,n,i,r){let o=0,a,s,c,u,f,d;for(;o<i.length;){f=dEe(i[o],e),c=Ar(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=dEe(i[o],e),!(l(s)&&K.compare(s,f)>=0||l(d)&&K.compare(f,d)>=0));){for(Lee[p++]=f,o=o+1,a=0;a<r;a++)Nee[g++]=i[o],o=o+1;s=f}p>0&&(Nee.length=g,fEe(n,u,Nee),Lee.length=p,fEe(t,c,Lee))}else{for(a=0;a<r;a++)o++,n[c*r+a]=i[o];o++}}}function oh(e,t){let n=e;n===Number&&(n=uEe);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=uEe);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=fx,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=gf.NONE,this._forwardExtrapolationDuration=0,this._backwardExtrapolationType=gf.NONE,this._backwardExtrapolationDuration=0}Object.defineProperties(oh.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 Fyt=new K;oh.prototype.getValue=function(e,t){l(e)||(e=K.now(Fyt));let n=this._times,i=n.length;if(i===0)return;let r,o=this._innerType,a=this._values,s=Ar(n,e,K.compare);if(s<0){if(s=~s,s===0){let C=n[s];if(r=this._backwardExtrapolationDuration,this._backwardExtrapolationType===gf.NONE||r!==0&&K.secondsDifference(C,e)>r)return;if(this._backwardExtrapolationType===gf.HOLD)return o.unpack(a,0,t)}if(s>=i){s=i-1;let C=n[s];if(r=this._forwardExtrapolationDuration,this._forwardExtrapolationType===gf.NONE||r!==0&&K.secondsDifference(e,C)>r)return;if(this._forwardExtrapolationType===gf.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,P=(y+1)*E;for(;w<P;)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)};oh.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))};oh.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)}QH(void 0,this._times,this._values,a,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};oh.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)}QH(void 0,this._times,this._values,s,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};oh.prototype.getSample=function(e){let t=this._times,n=t.length;if(l(n))return e<0&&(e+=n),t[e]};oh.prototype.addSamplesPackedArray=function(e,t){QH(t,this._times,this._values,e,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};oh.prototype.removeSample=function(e){let t=Ar(this._times,e,K.compare);return t<0?!1:(hEe(this,t,1),!0)};function hEe(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)}oh.prototype.removeSamples=function(e){let t=this._times,n=Ar(t,e.start,K.compare);n<0?n=~n:e.isStartIncluded||++n;let i=Ar(t,e.stop,K.compare);i<0?i=~i:e.isStopIncluded&&++i,hEe(this,n,i-n)};oh.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};oh._mergeNewSamples=QH;var Hf=oh;function ah(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 Hf(h,n),this._definitionChanged=new be,this._referenceFrame=e??Ui.FIXED,this._property._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)}Object.defineProperties(ah.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 Byt=new K;ah.prototype.getValue=function(e,t){return l(e)||(e=K.now(Byt)),this.getValueInReferenceFrame(e,Ui.FIXED,t)};ah.prototype.getValueInReferenceFrame=function(e,t,n){if(n=this._property.getValue(e,n),l(n))return nm.convertToReferenceFrame(e,n,this._referenceFrame,t,n)};ah.prototype.setInterpolationOptions=function(e){this._property.setInterpolationOptions(e)};ah.prototype.addSample=function(e,t,n){let i=this._numberOfDerivatives;this._property.addSample(e,t,n)};ah.prototype.addSamples=function(e,t,n){this._property.addSamples(e,t,n)};ah.prototype.addSamplesPackedArray=function(e,t){this._property.addSamplesPackedArray(e,t)};ah.prototype.removeSample=function(e){return this._property.removeSample(e)};ah.prototype.removeSamples=function(e){this._property.removeSamples(e)};ah.prototype.equals=function(e){return this===e||e instanceof ah&&X.equals(this._property,e._property)&&this._referenceFrame===e._referenceFrame};var mc=ah;function LA(e){this._definitionChanged=new be,this._value=void 0,this._removeSubscription=void 0,this.setValue(e)}Object.defineProperties(LA.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:Ui.FIXED}}});var kyt=new K;LA.prototype.getValue=function(e,t){return l(e)||(e=K.now(kyt)),this.getValueInReferenceFrame(e,Ui.FIXED,t)};LA.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))};LA.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};LA.prototype.equals=function(e){return this===e||e instanceof LA&&this._value===e._value};LA.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var n0=LA;function NA(e){this._definitionChanged=new be,this._intervals=new ga,this._intervals.changedEvent.addEventListener(NA.prototype._intervalsChanged,this),this._referenceFrame=e??Ui.FIXED}Object.defineProperties(NA.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 zyt=new K;NA.prototype.getValue=function(e,t){return l(e)||(e=K.now(zyt)),this.getValueInReferenceFrame(e,Ui.FIXED,t)};NA.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._intervals.findDataForIntervalContainingDate(e);if(l(i))return nm.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};NA.prototype.equals=function(e){return this===e||e instanceof NA&&this._intervals.equals(e._intervals,X.equals)&&this._referenceFrame===e._referenceFrame};NA.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var A_=NA;var mEe=new $,pEe=new $,gEe=new $,Uyt=new h,_Ee=new h,Vyt=new h,jyt=new h,eG=new Fe,tG=new L,nG=new $;function Rk(e,t,n,i,r){if(!(!l(t)||!l(n))){if(h.subtract(t,n,r),l(i.orientation))i.orientation.getValue(e,eG)&&(Fe.conjugate(eG,eG),$.fromQuaternion(eG,nG),$.multiplyByVector(nG,r,r));else if(l(kee(e,i.position,tG)))L.inverse(tG,tG),L.getRotation(tG,nG),$.multiplyByVector(nG,r,r);else return;return r}}function kee(e,t,n){let i=t.getValue(e,Uyt);if(l(i)){let r=K.addSeconds(e,.01,new K),o=t.getValue(r,_Ee);if(l(o)&&!h.equalsEpsilon(i,o,D.EPSILON16)){let a=mt.computeFixedToIcrfMatrix(e,mEe),s=mt.computeFixedToIcrfMatrix(r,pEe),c;!l(a)||!l(s)?(c=mt.computeTemeToPseudoFixedMatrix(e,gEe),a=$.transpose(c,mEe),s=mt.computeTemeToPseudoFixedMatrix(r,pEe),$.transpose(s,s)):c=$.transpose(a,gEe);let u=Vyt;h.normalize(i,u),h.normalize(o,o),$.multiplyByVector(a,u,u),$.multiplyByVector(s,o,o);let f=h.cross(u,o,jyt);if(!h.equalsEpsilon(f,h.ZERO,D.EPSILON16)){let d=h.cross(f,u,_Ee);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 L),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 yEe=60,vEe=1,EEe=new Tn,Fee=new Tn,Bee=new Tn;function AEe(e){this.entity=e,this.polyline=void 0,this.segmentPolylines=[],this.index=void 0,this.updater=void 0}var iG=new h;function Hyt(e,t,n,i,r,o,a,s,c){let u,f,d=!1;o instanceof qr&&(u=o,f=u.position,o=Ui.FIXED,d=!0);let p=s,g,m;g=e.getValueInReferenceFrame(t,o,c[p]),d?(m=f.getValueInReferenceFrame(t,o,iG),g=Rk(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,P;for(;A<b;){if(!y&&K.greaterThanOrEquals(x,r)&&(g=e.getValueInReferenceFrame(r,o,c[p]),d?(m=f.getValueInReferenceFrame(r,o,iG),l(g)&&l(m)&&(g=Rk(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,iG),l(g)&&l(m)&&(g=Rk(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],O=K.secondsDifference(R,x);C=O>a,C&&(E=Math.ceil(O/a),w=0,P=O/Math.max(E,2),E=Math.max(E-1,1))}if(C&&w<E){x=K.addSeconds(x,P,new K),w++;continue}}C=!1,A++,x=i[A]}return g=e.getValueInReferenceFrame(n,o,c[p]),d?(m=f.getValueInReferenceFrame(n,o,iG),l(g)&&l(m)&&(g=Rk(n,g,m,u,g),l(g)&&(c[p++]=g))):l(g)&&(c[p++]=g),p}function Gyt(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 Wyt(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 qyt(e,t,n,i,r,o,a,s){Bee.start=t,Bee.stop=n;let c=a,u=e.intervals;for(let f=0;f<u.length;f++){let d=u.get(f);if(!Tn.intersect(d,Bee,EEe).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 Yyt(e,t,n,i,r,o,a,s){let c=e.getValueInReferenceFrame(t,r,s[a]);return l(c)&&(s[a++]=c),a}function Xyt(e,t,n,i,r,o,a,s){Fee.start=t,Fee.stop=n;let c=a,u=e.intervals;for(let f=0;f<u.length;f++){let d=u.get(f);if(!Tn.intersect(d,Fee,EEe).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=SEe(d.data,m,y,i,r,o,c,s)}}return c}function SEe(e,t,n,i,r,o,a,s){for(;e instanceof y_;)e=e.resolvedProperty;if(e instanceof mc){let c=e._property._times;a=Hyt(e,t,n,c,i,r,o,a,s)}else e instanceof Pk?a=Gyt(e,t,n,i,r,o,a,s):e instanceof hc?a=Xyt(e,t,n,i,r,o,a,s):e instanceof A_?a=qyt(e,t,n,i,r,o,a,s):e instanceof Kl||e instanceof n0&&X.isConstant(e)?a=Yyt(e,t,n,i,r,o,a,s):a=Wyt(e,t,n,i,r,o,a,s);return a}function zee(e,t,n,i,r,o,a){l(a)||(a=[]);let s=SEe(e,t,n,i,r,o,0,a);return a.length=s,a}var bEe=new $,xEe=new Fe,TEe=new $,Dk=new Tn,rG=new Tn,eC=new Tn;function Kyt(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 CEe(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=zee(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=mo.getValue(y,u,b.material),b.width=X.getValueOrDefault(i._width,n,vEe),d++}return d}function Ok(e,t){this._unusedIndexes=[],this._polylineCollection=new Im,this._scene=e,this._referenceFrame=t,e.primitives.add(this._polylineCollection)}Ok.prototype.update=function(e){let t=this._referenceFrame;if(t===Ui.INERTIAL){let n=mt.computeIcrfToFixedMatrix(e,bEe);l(n)||(n=mt.computeTemeToPseudoFixedMatrix(e,bEe)),L.fromRotationTranslation(n,h.ZERO,this._polylineCollection.modelMatrix)}else if(t instanceof qr){let n=t.position.getValue(e);l(t.orientation)?l(t.orientation.getValue(e,xEe))&&($.fromQuaternion(xEe,TEe),L.fromRotationTranslation(TEe,n,this._polylineCollection.modelMatrix)):kee(e,t.position,this._polylineCollection.modelMatrix)}};Ok.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,yEe),d=zee(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=mo.getValue(e,i.material,c.material);let p=X.getValueOrUndefined(i.materialMode,e),g=i.material;if(p===t0.PORTIONS&&!g.isConstant){l(c)&&(c.show=!1);let m=f>0?f:yEe,y=g.intervals,A=0;if(l(y)){Dk.start=o,Dk.stop=a,Dk.isStartIncluded=!0,Dk.isStopIncluded=!0;for(let b=0;b<y.length;b++){let x=y.get(b);if(!Tn.intersect(x,Dk,rG))continue;let T=rG.start,C=rG.stop;if(K.greaterThanOrEquals(T,C))continue;let E=Kyt(x.data),w=[K.clone(T),K.clone(C)];for(let P=0;P<E.length;P++){let R=E[P],O=R.intervals;if(l(O))for(let N=0;N<O.length;N++){let _=O.get(N);Tn.intersect(_,rG,eC)&&(K.greaterThan(eC.start,T)&&K.lessThan(eC.start,C)&&w.push(K.clone(eC.start)),K.greaterThan(eC.stop,T)&&K.lessThan(eC.stop,C)&&w.push(K.clone(eC.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=CEe(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=CEe(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,vEe),c.distanceDisplayCondition=X.getValueOrUndefined(i._distanceDisplayCondition,e,c.distanceDisplayCondition)};Ok.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};Ok.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),ue(this)};function i0(e,t){t.collectionChanged.addEventListener(i0.prototype._onCollectionChanged,this),this._scene=e,this._updaters={},this._entityCollection=t,this._items=new kt,this._onCollectionChanged(t,t.values,[],[])}i0.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=Ui.FIXED,p=d.toString();if(this._scene.mode===re.SCENE3D){let m=X.getValueOrUndefined(c.relativeTo,e);l(m)?m==="FIXED"?(d=Ui.FIXED,p=d.toString()):m==="INERTIAL"?(d=Ui.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 Ok(this._scene,d),g.update(e),this._updaters[p]=g),o.updater=g,l(g)&&g.updateObject(e,o))}return!0};i0.prototype.isDestroyed=function(){return!1};i0.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(i0.prototype._onCollectionChanged,this);let e=this._updaters;for(let t in e)e.hasOwnProperty(t)&&e[t].destroy();return ue(this)};i0.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 AEe(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 AEe(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))};i0._subSample=zee;i0._computeVvlhTransform=kee;i0._transformToEntityFrame=Rk;var Mk=i0;var wEe=U.WHITE,IEe=U.BLACK,PEe=0,DEe=1,REe=0,OEe=Fo.NONE,MEe=new U,$yt=new h,LEe=new U,NEe=new Wt,FEe=new Wt,BEe=new jt;function kEe(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 FA(e,t){t.collectionChanged.addEventListener(FA.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new kt,this._onCollectionChanged(t,t.values,[],[])}FA.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,$yt),d=l(p)),!d){Lk(o,a,n);continue}X.isConstant(a._position)||(n._clusterDirty=!0);let g=!1,m=!1;if(f!==it.NONE&&!l(u)?(l(c)&&(Lk(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)&&(Lk(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,NEe),c.translucencyByDistance=X.getValueOrUndefined(s._translucencyByDistance,e,FEe),c.color=X.getValueOrDefault(s._color,e,wEe,MEe),c.outlineColor=X.getValueOrDefault(s._outlineColor,e,IEe,LEe),c.outlineWidth=X.getValueOrDefault(s._outlineWidth,e,PEe),c.pixelSize=X.getValueOrDefault(s._pixelSize,e,DEe),c.distanceDisplayCondition=X.getValueOrUndefined(s._distanceDisplayCondition,e,BEe),c.disableDepthTestDistance=X.getValueOrDefault(s._disableDepthTestDistance,e,REe),c.splitDirection=X.getValueOrDefault(s._splitDirection,e,OEe);else if(l(u)){u.show=!0,u.position=p,u.scaleByDistance=X.getValueOrUndefined(s._scaleByDistance,e,NEe),u.translucencyByDistance=X.getValueOrUndefined(s._translucencyByDistance,e,FEe),u.distanceDisplayCondition=X.getValueOrUndefined(s._distanceDisplayCondition,e,BEe),u.disableDepthTestDistance=X.getValueOrDefault(s._disableDepthTestDistance,e,REe),u.splitDirection=X.getValueOrDefault(s._splitDirection,e,OEe),u.heightReference=f;let y=X.getValueOrDefault(s._color,e,wEe,MEe),A=X.getValueOrDefault(s._outlineColor,e,IEe,LEe),b=Math.round(X.getValueOrDefault(s._outlineWidth,e,PEe)),x=Math.max(1,Math.round(X.getValueOrDefault(s._pixelSize,e,DEe)));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,NT(T,C,E,b,x))}m&&u._updateClamping()}}return!0};FA.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};FA.prototype.isDestroyed=function(){return!1};FA.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(FA.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removePoint(e[t]);return ue(this)};FA.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 kEe(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 kEe(o)):(Lk(a.get(o.id),o,s),a.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],Lk(a.get(o.id),o,s),a.remove(o.id)};function Lk(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 Nk=FA;var Jyt=new hi(0),oG={},zEe=new U,Zyt=new Yt(U.WHITE),Qyt=new hi(!0),eAt=new hi(Rn.DISABLED),tAt=new hi(new jt),nAt=new hi(Zn.BOTH);function iAt(){this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function rAt(){this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function Lm(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(Lm.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 iAt,this._groundGeometryOptions=new rAt,this._id=`polyline-${e.id}`,this._clampToGround=!1,this._supportsPolylinesOnTerrain=qr.supportsPolylinesOnTerrain(t),this._zIndex=0,this._onEntityPropertyChanged(e,"polyline",e.polyline,void 0)}Object.defineProperties(Lm.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}}});Lm.prototype.isOutlineVisible=function(e){return!1};Lm.prototype.isFilled=function(e){let t=this._entity;return(this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e))??!1};Lm.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,zEe)),l(s)||(s=U.WHITE),a.color=Kt.fromColor(s)),this.clampToGround?new Nt({id:t,geometry:new lx(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,zEe)),l(s)||(s=U.WHITE),a.depthFailColor=Kt.fromColor(s)),new Nt({id:t,geometry:new pg(this._geometryOptions),attributes:a}))};Lm.prototype.createOutlineGeometryInstance=function(e){};Lm.prototype.isDestroyed=function(){return!1};Lm.prototype.destroy=function(){this._entitySubscription(),ue(this)};Lm.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??Zyt,u=c instanceof Yt;this._materialProperty=c,this._depthFailMaterialProperty=r.depthFailMaterial,this._showProperty=a??Qyt,this._shadowsProperty=r.shadows??eAt,this._distanceDisplayConditionProperty=r.distanceDisplayCondition??tAt,this._classificationTypeProperty=r.classificationType??nAt,this._fillEnabled=!0,this._zIndex=s??Jyt;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=Ma.VERTEX_FORMAT:A=cc.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)}};Lm.prototype.createDynamicUpdater=function(e,t){return new Fk(e,t,this)};var bw={positions:void 0,granularity:void 0,height:void 0,ellipsoid:void 0};function Fk(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 UEe(e){if(l(e._line))return e._line;let t=e._primitives,n=e._geometryUpdater._scene.id+t._guid,i=oG[n];!l(i)||i.isDestroyed()?(i=new Im,oG[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}Fk.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 Ma;else{let g=mo.getValue(e,d,this._material);p=new cc({material:g,translucent:g.isTranslucent()}),this._material=g}this._groundPolylinePrimitive=a.add(new Jh({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=UEe(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)&&(bw.ellipsoid=f,bw.positions=o,bw.granularity=X.getValueOrUndefined(i._granularity,e),bw.height=Qi.extractHeights(o,f),c===sn.GEODESIC?o=Qi.generateCartesianArc(bw):o=Qi.generateCartesianRhumbArc(bw)),s.show=!0,s.positions=o.slice(),s.material=mo.getValue(e,t.fillMaterialProperty,s.material),s.width=X.getValueOrDefault(i._width,e,1),s.distanceDisplayCondition=X.getValueOrUndefined(i._distanceDisplayCondition,e,s.distanceDisplayCondition)};Fk.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=UEe(this);if(t.show&&t.positions.length>0)return se.fromPoints(t.positions,e),It.DONE}return It.FAILED};Fk.prototype.isDestroyed=function(){return!1};Fk.prototype.destroy=function(){let t=this._geometryUpdater._scene.id+this._primitives._guid,n=oG[t];l(n)&&(n.remove(this._line),n.length===0&&(this._primitives.removeAndDestroy(n),delete oG[t])),l(this._groundPolylinePrimitive)&&this._groundPrimitives.remove(this._groundPolylinePrimitive),ue(this)};var Bk=Lm;var oAt=new U,aAt=new jt,sAt=new jt;function Nm(e,t,n,i,r){let o;n instanceof Yt?o=Ma:o=cc,this.orderedGroundPrimitives=e,this.classificationType=t,this.appearanceType=o,this.materialProperty=n,this.updaters=new kt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new kt,this.material=void 0,this.updatersWithAttributes=new kt,this.attributes=new kt,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(Nm.prototype.onMaterialChanged,this),this.subscriptions=new kt,this.showsUpdated=new kt,this.zIndex=i,this._asynchronous=r}Nm.prototype.onMaterialChanged=function(){this.invalidated=!0};Nm.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)};Nm.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};Nm.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};Nm.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 Jh({show:!1,asynchronous:this._asynchronous,geometryInstances:r.slice(),appearance:new s,classificationType:this.classificationType}),this.appearanceType===cc&&(this.material=mo.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===cc&&(this.material=mo.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,oAt);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,sAt,aAt);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};Nm.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()};Nm.prototype.contains=function(e){return this.updaters.contains(e.id)};Nm.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)};Nm.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 xw(e,t,n){this._items=[],this._orderedGroundPrimitives=e,this._classificationType=t,this._asynchronous=n??!0}xw.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 Nm(this._orderedGroundPrimitives,this._classificationType,t.fillMaterialProperty,o,this._asynchronous);a.add(e,t,r),n.push(a)};xw.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}}};xw.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};xw.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};xw.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 kk=xw;var cAt=[];function VEe(e,t){let n=e._batches,i=n.length;for(let r=0;r<i;r++)n[r].remove(t)}function jEe(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 r0(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 kt,this._removedObjects=new kt,this._changedObjects=new kt;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 Gd(n,Ma,void 0,!1,r),this._materialBatches[r]=new Wd(n,cc,void 0,!1,r),this._colorBatches[r+o]=new Gd(n,Ma,Ma,!1,r),this._materialBatches[r+o]=new Wd(n,cc,Ma,!1,r),this._colorBatches[r+o*2]=new Gd(n,Ma,cc,!1,r),this._materialBatches[r+o*2]=new Wd(n,cc,cc,!1,r);this._dynamicBatch=new oT(n,i);let a=Zn.NUMBER_OF_CLASSIFICATION_TYPES;for(this._groundBatches=new Array(a),r=0;r<a;++r)this._groundBatches[r]=new kk(i,r);this._batches=this._colorBatches.concat(this._materialBatches,this._dynamicBatch,this._groundBatches),this._subscriptions=new kt,this._updaters=new kt,this._entityCollection=t,t.collectionChanged.addEventListener(r0.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,cAt)}r0.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?(VEe(this,f),jEe(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),VEe(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 Bk(c,this._scene),this._updaters.set(u,f),jEe(this,e,f),this._subscriptions.set(u,f.geometryChanged.addEventListener(r0._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 lAt=[],uAt=new se;r0.prototype.getBoundingSphere=function(e,t){let n=lAt,i=uAt,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)};r0.prototype.isDestroyed=function(){return!1};r0.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(r0.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)};r0._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)};r0.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 zk=r0;function qu(e){Yl.initializeTerrainHeights(),Jh.initializeTerrainHeights();let t=e.scene,n=e.dataSourceCollection;this._eventHelper=new Lo,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??qu.defaultVisualizersCallback;let i=!1,r=new Xl,o=new Xl;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 _N;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 Tw=[];qu.registerVisualizer=function(e){Tw.includes(e)||Tw.push(e)};qu.unregisterVisualizer=function(e){if(Tw.includes(e)){let t=Tw.indexOf(e);Tw.splice(t,1)}};qu.defaultVisualizersCallback=function(e,t,n){let i=n.entities;return[new kL(t,i),new FN(e,i,n._primitives,n._groundPrimitives),new BN(t,i),new S2(e,i),new Ik(e,i),new Nk(t,i),new Mk(e,i),new zk(e,i,n._primitives,n._groundPrimitives),...Tw.map(r=>new r(e,i))]};Object.defineProperties(qu.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}}});qu.prototype.isDestroyed=function(){return!1};qu.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)};qu.prototype.update=function(e){if(!wi.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};qu.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 fAt=[],dAt=new se;qu.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=fAt,s=dAt,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)};qu.prototype._onDataSourceAdded=function(e,t){let n=this._scene,i=this._primitives,r=this._groundPrimitives,o=i.add(new Xl),a=r.add(new BL);t._primitives=o,t._groundPrimitives=a;let s=t.clustering;s._initialize(n),o.add(s),t._visualizers=this._visualizersCallback(n,s,t)};qu.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};qu.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 Uk=qu;function Cw(e,t){this._position=void 0,this._subscription=void 0,this._definitionChanged=new be,this._normalize=t??!0,this.position=e}Object.defineProperties(Cw.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 hAt=new h,HEe=new h,GEe=new K,mAt=new K,Uee=1/60;Cw.prototype.getValue=function(e,t){return this._getValue(e,t)};Cw.prototype._getValue=function(e,t,n){l(e)||(e=K.now(mAt)),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,hAt),o=i.getValue(K.addSeconds(e,Uee,GEe),HEe);if(!l(r)||!l(o)&&(o=r,r=i.getValue(K.addSeconds(e,-Uee,GEe),HEe),!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,Uee,t)};Cw.prototype.equals=function(e){return this===e||e instanceof Cw&&X.equals(this._position,e._position)};var b_=Cw;var WEe=new $,qEe=new $,YEe=new $,pAt=new L,aG=new h,XEe=new h,Vee=new h,jee=new h,KEe=new h,$Ee=new h,gAt=new Fe,_At=new h,yAt=new $,vw=new K,AAt=1.25;function bAt(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,vw);let P=r.getValue(vw,aG);if(l(P)||(K.addSeconds(c,-.001,vw),P=r.getValue(vw,aG),g=!0),l(P)){let R=mt.computeFixedToIcrfMatrix(c,WEe),O=mt.computeFixedToIcrfMatrix(vw,qEe),N;!l(R)||!l(O)?(N=mt.computeTemeToPseudoFixedMatrix(c,YEe),R=$.transpose(N,WEe),O=mt.computeTemeToPseudoFixedMatrix(vw,qEe),$.transpose(O,O)):N=$.transpose(R,YEe);let _=$.multiplyByVector(R,d,KEe),v=$.multiplyByVector(O,P,$Ee);h.subtract(_,v,jee);let S=h.magnitude(jee)*1e3,I=D.GRAVITATIONALPARAMETER,M=-I/(S*S-2*I/h.magnitude(_));M<0||M>AAt*u.maximumRadius?(m=XEe,h.normalize(d,m),h.negate(m,m),A=h.clone(h.UNIT_Z,Vee),y=h.cross(A,m,aG),h.magnitude(y)>D.EPSILON7&&(h.normalize(m,m),h.normalize(y,y),A=h.cross(m,y,Vee),h.normalize(A,A),p=!0)):h.equalsEpsilon(d,P,D.EPSILON7)||(A=XEe,h.normalize(_,A),h.normalize(v,v),y=h.cross(A,v,Vee),g&&(y=h.multiplyByScalar(y,-1,y)),h.equalsEpsilon(y,h.ZERO,D.EPSILON7)||(m=h.cross(y,A,aG),$.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,jee),x=h.clone(t.direction,KEe),T=h.clone(t.up,$Ee));let C=pAt,E;l(a)&&(E=a.getValue(c,gAt));let w=o.getValue(c,_At);if(s===yg.INERTIAL&&l(E))L.fromTranslationQuaternionRotationScale(d,E,h.ONE,C);else if(s===yg.VELOCITY&&l(w)){let P=mt.rotationMatrixFromPositionVelocity(d,w,u,yAt);L.fromRotationTranslation(P,d,C)}else s===yg.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 Vk(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 b_(e.position,!0),this._offset3D=new h}Object.defineProperties(Vk,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(e){this._defaultOffset3D=h.clone(e,new h)}}});Vk.defaultOffset3D=new h(-14e3,3500,3500);var sG=new Rd,xAt=new h;Vk.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)){sG.pitch=-D.PI_OVER_FOUR,sG.range=0;let b=s.getValue(e,xAt);if(l(b)){let x=2-1/Math.max(1,h.magnitude(b)/i.maximumRadius);sG.pitch*=x}p.viewBoundingSphere(t,sG),this.boundingSphere=t,g=!1,m=!1}else(!A||!l(y.getValue(e,this._offset3D)))&&h.clone(Vk._defaultOffset3D,this._offset3D)}else!d&&this._mode!==re.SCENE2D&&h.clone(p.position,this._offset3D);this._lastEntity=o,this._mode=r,bAt(this,p,g,m,s,c,u,a,e,i)};var jk=Vk;function TAt(e){return typeof e=="string"&&(e=document.getElementById(e)),e}var Bn=TAt;async function Hee(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 Hee._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}Hee._sampleTerrainMostDetailed=Rx;var tC=Hee;var Hk=`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 Gk=`#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 Ew=`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 Wk=`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 CAt=new z;function vAt(e,t){let n=e.unionClippingRegions,i=e.length,r=Aa.useFloatTexture(t),o=Aa.getTextureResolution(e,t,CAt),a=o.x,s=o.y,c=r?wAt(a,s):IAt(a,s);return c+=`
`,c+=n?EAt(i):SAt(i),c}function EAt(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 SAt(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 wAt(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 IAt(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 nC=vAt;var Gee=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}},Wee=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,P=t.enableFog,R=t.enableClippingPlanes,O=t.clippingPlanes,N=t.enableClippingPolygons,_=t.clippingPolygons,v=t.clippedByBoundaries,S=t.hasImageryLayerCutout,I=t.colorCorrect,M=t.highlightFillTile,F=t.colorToAlpha,V=t.hasGeodeticSurfaceNormals,k=t.hasExaggeration,j=t.showUndergroundColor,B=t.translucent,W=i.vectorData?.show,Q=0,q="",Z=i.renderedMesh.encoding;Z.quantization===Ps.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|+P<<18|Q<<19|+p<<20|+R<<21|+N<<22|Ae<<23|Ce<<24|+I<<25|+M<<26|+F<<27|+V<<28|+k<<29|+j<<30|+B<<31)>>>0)+(d?4294967296:0)+(W?8589934592:0),Le=0;l(O)&&O.length>0&&(Le=R?O.clippingPlanesState:0);let $e=0;l(_)&&_.length>0&&($e=N?_.clippingPolygonsState:0);let Xe=i.surfaceShader;if(l(Xe)&&Xe.numberOfDayTextures===r&&Xe.flags===Ie&&Xe.material===this.material&&Xe.clippingShaderState===Le&&Xe.clippingPolygonShaderState===$e)return Xe.shaderProgram;let At=this._shadersByTexturesFlags[r];if(l(At)||(At=this._shadersByTexturesFlags[r]=[]),Xe=At[Ie],!l(Xe)||Xe.material!==this.material||Xe.clippingShaderState!==Le||Xe.clippingPolygonShaderState!==$e){let Ke=this.baseVertexShaderSource.clone(),we=this.baseFragmentShaderSource.clone();Le!==0&&we.sources.unshift(nC(O,n.context)),$e!==0&&(we.sources.unshift(DAt(n.context)),Ke.sources.unshift(RAt(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"),P&&(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}`)),I&&we.defines.push("COLOR_CORRECT"),M&&we.defines.push("HIGHLIGHT_FILL_TILE"),V&&Ke.defines.push("GEODETIC_SURFACE_NORMALS"),k&&Ke.defines.push("EXAGGERATION"),W&&(Ke.defines.push("HAS_VECTOR_LAYER"),we.defines.push("HAS_VECTOR_LAYER"),we.sources.unshift(Wk));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(PAt(ve)),Ke.sources.push(OAt(w));let vt=Zt.fromCache({context:n.context,vertexShaderSource:Ke,fragmentShaderSource:we,attributeLocations:Z.getAttributeLocations()});Xe=At[Ie]=new Gee(r,Ie,this.material,vt,Le,$e)}return i.surfaceShader=Xe,Xe.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 PAt(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 DAt(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 RAt(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 OAt(e){return e?"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }":"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }"}var qk=Wee;var JEe={START:0,LOADING:1,DONE:2,FAILED:3};Object.freeze(JEe);var Hs=JEe;var ZEe={FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6};Object.freeze(ZEe);var Or=ZEe;var o0=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===Hs.START&&(MAt(t,n,i,r),t.state=Hs.LOADING)}static processStateMachine(t,n,i,r,o,a,s,c){e.initialize(t,i,r,o);let u=t.data;if(t.state===Hs.LOADING&&LAt(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=Hs.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){QEe(this,!0,t,n)}removeGeodeticSurfaceNormals(t){QEe(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 QEe(e,t,n,i){let r=e.renderedMesh,o=r.vertices,a=r.encoding,s=o.length/a.stride,c=uo.clone(a);c.hasGeodeticSurfaceNormals=t,c=uo.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?(o0._freeVertexArray(e.fill.vertexArray),e.fill.vertexArray=o0._createVertexArrayForMesh(i.context,r)):(o0._freeVertexArray(e.vertexArray),e.vertexArray=o0._createVertexArrayForMesh(i.context,r)),o0._freeVertexArray(e.wireframeVertexArray),e.wireframeVertexArray=void 0}function MAt(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 LAt(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||o0.processStateMachine(c,t,n,i,r,o,a,!0)}if(s.terrainState===Or.FAILED&&NAt(s,e,t,n,e.x,e.y,e.level),s.terrainState===Or.UNLOADED&&FAt(s,n,e.x,e.y,e.level),s.terrainState===Or.RECEIVED&&kAt(s,t,n,e.x,e.y,e.level),s.terrainState===Or.TRANSFORMED&&(zAt(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)VAt(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 NAt(e,t,n,i,r,o,a){let s=t.parent;if(!s){t.state=Hs.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 FAt(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===yi.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=Hr.reportError(t._requestError,t,t.errorEvent,u,n,i,r),t._requestError.retry&&s()}function s(){let c=new bo({throttle:!1,throttleByServer:!0,type:Ha.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 BAt={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0,throttle:!0};function kAt(e,t,n,i,r,o){let a=n.tilingScheme,s=BAt;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 zAt(e,t,n,i,r,o,a){e.vertexArray=o0._createVertexArrayForMesh(t,e.mesh),e.terrainState=Or.READY,e.fill=e.fill&&e.fill.destroy(a)}function UAt(e){let t=e.cache.tile_waterMaskData;if(!l(t)){let n=Ct.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 zt({wrapS:rn.CLAMP_TO_EDGE,wrapT:rn.CLAMP_TO_EDGE,minificationFilter:Gt.LINEAR,magnificationFilter:ei.LINEAR});t={allWaterTexture:n,sampler:i,destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function VAt(e,t){let n=t.terrainData.waterMask,i=UAt(e),r,o=n.length;if(n instanceof ImageBitmap)r=Ct.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=Ct.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 sh=o0;var eSe={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>=eSe.RENDERED_AND_KICKED},originalResult:function(e){return e&3},kick:function(e){return e|4}},fi=eSe;function ww(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}ww.prototype.update=function(e,t,n){this.changedThisFrame&&(sSe(e,t,this.tile,n),this.changedThisFrame=!1)};ww.prototype.destroy=function(e){this._destroyVertexArray(e),l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0)};ww.prototype._destroyVertexArray=function(e){l(this.vertexArray)&&(l(e)?e.push(this.vertexArray):sh._freeVertexArray(this.vertexArray),this.vertexArray=void 0)};var jAt=new Iy;ww.updateFillTiles=function(e,t,n,i){let r=e._quadtree,o=r._levelZeroTiles,a=r._lastSelectionFrameNumber,s=jAt;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);vs(e,n,c,u,a,In.EAST,!1,s,i),vs(e,n,c,f,a,In.NORTH,!1,s,i),vs(e,n,c,d,a,In.WEST,!1,s,i),vs(e,n,c,p,a,In.SOUTH,!1,s,i);let g=u.findTileToNorth(o),m=u.findTileToSouth(o),y=d.findTileToNorth(o),A=d.findTileToSouth(o);vs(e,n,c,g,a,In.SOUTHEAST,!1,s,i),vs(e,n,c,y,a,In.SOUTHWEST,!1,s,i),vs(e,n,c,m,a,In.NORTHEAST,!1,s,i),vs(e,n,c,A,a,In.NORTHWEST,!1,s,i),c=s.dequeue()}};function vs(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>=In.NORTHWEST&&f!==void 0)switch(o){case In.NORTHWEST:u=u===f.northwestChild?f:void 0;break;case In.NORTHEAST:u=u===f.northeastChild?f:void 0;break;case In.SOUTHWEST:u=u===f.southwestChild?f:void 0;break;case In.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;HAt(e,t,n,u,o,r,s,c);return}if(fi.originalResult(i._lastSelectionResult)!==fi.CULLED)switch(o){case In.WEST:vs(e,t,n,i.northwestChild,r,o,!0,s,c),vs(e,t,n,i.southwestChild,r,o,!0,s,c);break;case In.EAST:vs(e,t,n,i.southeastChild,r,o,!0,s,c),vs(e,t,n,i.northeastChild,r,o,!0,s,c);break;case In.SOUTH:vs(e,t,n,i.southwestChild,r,o,!0,s,c),vs(e,t,n,i.southeastChild,r,o,!0,s,c);break;case In.NORTH:vs(e,t,n,i.northeastChild,r,o,!0,s,c),vs(e,t,n,i.northwestChild,r,o,!0,s,c);break;case In.NORTHWEST:vs(e,t,n,i.northwestChild,r,o,!0,s,c);break;case In.NORTHEAST:vs(e,t,n,i.northeastChild,r,o,!0,s,c);break;case In.SOUTHWEST:vs(e,t,n,i.southwestChild,r,o,!0,s,c);break;case In.SOUTHEAST:vs(e,t,n,i.southeastChild,r,o,!0,s,c);break;default:throw new pe("Invalid edge")}}}function HAt(e,t,n,i,r,o,a,s){let c=i.data;if(c.fill===void 0)c.fill=new ww(i);else if(c.fill.visitedFrame===o)return;c.fill.enqueuedFrame!==o&&(c.fill.enqueuedFrame=o,c.fill.changedThisFrame=!1,a.enqueue(i)),GAt(e,t,n,i,r,s)}function GAt(e,t,n,i,r,o){let a=i.data.fill,s,c=n.data.fill;l(c)?(c.visitedFrame=t.frameNumber,c.changedThisFrame&&(sSe(e,t,n,o),c.changedThisFrame=!1),s=n.data.fill.mesh):s=n.data.mesh;let u,f;switch(r){case In.WEST:u=a.westMeshes,f=a.westTiles;break;case In.SOUTH:u=a.southMeshes,f=a.southTiles;break;case In.EAST:u=a.eastMeshes,f=a.eastTiles;break;case In.NORTH:u=a.northMeshes,f=a.northTiles;break;case In.NORTHWEST:a.changedThisFrame=a.changedThisFrame||a.northwestMesh!==s,a.northwestMesh=s,a.northwestTile=n;return;case In.NORTHEAST:a.changedThisFrame=a.changedThisFrame||a.northeastMesh!==s,a.northeastMesh=s,a.northeastTile=n;return;case In.SOUTHWEST:a.changedThisFrame=a.changedThisFrame||a.southwestMesh!==s,a.southwestMesh=s,a.southwestTile=n;return;case In.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 In.WEST:for(A=(b.north-b.south)*D.EPSILON5,d=0;d<f.length&&(g=f[d],m=g.rectangle,!D.greaterThan(y.north,m.south,A));++d);for(p=d;p<f.length&&(g=f[p],m=g.rectangle,!D.greaterThanOrEquals(y.south,m.north,A));++p);break;case In.SOUTH:for(A=(b.east-b.west)*D.EPSILON5,d=0;d<f.length&&(g=f[d],m=g.rectangle,!D.lessThan(y.west,m.east,A));++d);for(p=d;p<f.length&&(g=f[p],m=g.rectangle,!D.lessThanOrEquals(y.east,m.west,A));++p);break;case In.EAST:for(A=(b.north-b.south)*D.EPSILON5,d=0;d<f.length&&(g=f[d],m=g.rectangle,!D.lessThan(y.south,m.north,A));++d);for(p=d;p<f.length&&(g=f[p],m=g.rectangle,!D.lessThanOrEquals(y.north,m.south,A));++p);break;case In.NORTH:for(A=(b.east-b.west)*D.EPSILON5,d=0;d<f.length&&(g=f[d],m=g.rectangle,!D.greaterThan(y.east,m.west,A));++d);for(p=d;p<f.length&&(g=f[p],m=g.rectangle,!D.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 iC=new de,WAt=new de,Sw=new h,Kee=new h,qee=new z,Yee=new z,Gf=new z;function mG(){this.height=0,this.encodedNormal=new z}function cG(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 cSe(e,t,n,i,u,c),c}var qAt={minimumHeight:0,maximumHeight:0},YAt=new h,tSe=new mG,nSe=new mG,iSe=new mG,rSe=new mG,XAt=typeof Uint8Array<"u"?new Uint8Array(81):void 0,KAt={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0};function sSe(e,t,n,i){sh.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=uG(o,f,0,1,o.northwestTile,o.northwestMesh,o.northTiles,o.northMeshes,o.westTiles,o.westMeshes,iSe),p=uG(o,f,0,0,o.southwestTile,o.southwestMesh,o.westTiles,o.westMeshes,o.southTiles,o.southMeshes,tSe),g=uG(o,f,1,0,o.southeastTile,o.southeastMesh,o.southTiles,o.southMeshes,o.eastTiles,o.eastMeshes,nSe),m=uG(o,f,1,1,o.northeastTile,o.northeastMesh,o.eastTiles,o.eastMeshes,o.northTiles,o.northMeshes,rSe);d=cG(o,f,0,1,d,p,m,g,iSe),p=cG(o,f,0,0,p,d,g,m,tSe),g=cG(o,f,1,1,g,p,m,d,nSe),m=cG(o,f,1,1,m,g,d,p,rSe);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,P,R=e.getLevelMaximumGeometricError(n.level),O=f.maximumRadius-R,N=Math.acos(O/f.maximumRadius)*4;if(N*=1.5,a.width>N&&C-T<=R){let S=new Sc({width:9,height:9,buffer:XAt,structure:{heightOffset:C}}),I=KAt;I.tilingScheme=n.tilingScheme,I.x=n.x,I.y=n.y,I.level=n.level,I.exaggeration=s,I.exaggerationRelativeHeight=c,o.mesh=S._createMeshSync(I)}else{let S=u,I=ie.center(a,WAt);I.height=E;let M=f.cartographicToCartesian(I,YAt),F=new uo(M,void 0,void 0,void 0,void 0,!0,!0,S,s,c),V=5,k;for(k=o.westMeshes,w=0,P=k.length;w<P;++w)V+=k[w].eastIndicesNorthToSouth.length;for(k=o.southMeshes,w=0,P=k.length;w<P;++w)V+=k[w].northIndicesWestToEast.length;for(k=o.eastMeshes,w=0,P=k.length;w<P;++w)V+=k[w].westIndicesSouthToNorth.length;for(k=o.northMeshes,w=0,P=k.length;w<P;++w)V+=k[w].southIndicesEastToWest.length;let j=qAt;j.minimumHeight=T,j.maximumHeight=C;let B=F.stride,G=new Float32Array(V*B),W=0,Q=W;W=lG(f,a,F,G,W,0,1,d.height,d.encodedNormal,1,j),W=dG(o,f,F,G,W,o.westTiles,o.westMeshes,In.EAST,j);let q=W;W=lG(f,a,F,G,W,0,0,p.height,p.encodedNormal,0,j),W=dG(o,f,F,G,W,o.southTiles,o.southMeshes,In.NORTH,j);let J=W;W=lG(f,a,F,G,W,1,0,g.height,g.encodedNormal,0,j),W=dG(o,f,F,G,W,o.eastTiles,o.eastMeshes,In.WEST,j);let Z=W;W=lG(f,a,F,G,W,1,1,m.height,m.encodedNormal,1,j),W=dG(o,f,F,G,W,o.northTiles,o.northMeshes,In.SOUTH,j),T=j.minimumHeight,C=j.maximumHeight;let ce=Jt.fromRectangle(a,T,C,n.tilingScheme.ellipsoid),Ae=di.geodeticLatitudeToMercatorAngle(a.south),le=1/(di.geodeticLatitudeToMercatorAngle(a.north)-Ae),Ce=(di.geodeticLatitudeToMercatorAngle(I.latitude)-Ae)*le,ye=f.geodeticSurfaceNormalCartographic(iC,Kee),ve=an.octEncode(ye,qee),Ie=W;F.encode(G,W*B,ce.center,z.fromElements(.5,.5,Gf),E,ve,Ce,ye),++W;let Le=W,$e=Le<256?1:2,Xe=(Le-1)*3,At=Xe*$e,Ke=(G.length-Le*B)*Float32Array.BYTES_PER_ELEMENT,we;if(Ke>=At){let bt=Le*B*Float32Array.BYTES_PER_ELEMENT;we=Le<256?new Uint8Array(G.buffer,bt,Xe):new Uint16Array(G.buffer,bt,Xe)}else we=Le<256?new Uint8Array(Xe):new Uint16Array(Xe);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 vt=[];for(w=q;w>=Q;--w)vt.push(w);let ct=[];for(w=J;w>=q;--w)ct.push(w);let pn=[];for(w=Z;w>=J;--w)pn.push(w);let Ht=[];for(Ht.push(0),w=Ie-1;w>=Z;--w)Ht.push(w);o.mesh=new tc(F.center,G,we,Xe,Le,T,C,a,se.fromOrientedBoundingBox(ce),nbt(e,ce.center,a,T,C),F.stride,ce,F,vt,ct,pn,Ht)}let _=t.context;o._destroyVertexArray(i),o.vertexArray=sh._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 lG(e,t,n,i,r,o,a,s,c,u,f){let d=iC;d.longitude=D.lerp(t.west,t.east,o),d.latitude=D.lerp(t.south,t.north,a),d.height=s;let p=e.cartographicToCartesian(d,Sw),g;n.hasGeodeticSurfaceNormals&&(g=e.geodeticSurfaceNormal(p,Kee));let m=Yee;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 hG=new ie;function Yk(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,hG),r.west-=D.TWO_PI,r.east-=D.TWO_PI):e.x===0&&n.x===0&&t.x===t.tilingScheme.getNumberOfXTilesAtLevel(t.level)-1&&(r=ie.clone(e.rectangle,hG),r.west+=D.TWO_PI,r.east+=D.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 $At=new z;function Xee(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 JAt=new z,ZAt=new h;function QAt(e,t,n,i,r,o,a,s,c,u){let f=i.encoding,d=i.vertices,p=Yk(t,n,f.decodeTextureCoordinates(d,r,Gf),Gf),g=Yk(t,n,f.decodeTextureCoordinates(d,o,Yee),Yee),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;iC.longitude=D.lerp(b.west,b.east,a),iC.latitude=D.lerp(b.south,b.north,s),u.height=iC.height=D.lerp(y,A,m);let x;if(f.hasVertexNormals){let T=f.getOctEncodedNormal(d,r,$At),C=f.getOctEncodedNormal(d,o,JAt),E=an.octDecode(T.x,T.y,Sw),w=an.octDecode(C.x,C.y,ZAt);x=h.lerp(E,w,m,Sw),h.normalize(x,x),an.octEncode(x,u.encodedNormal)}else x=e.geodeticSurfaceNormalCartographic(iC,Sw),an.octEncode(x,u.encodedNormal)}function cSe(e,t,n,i,r,o){o.height=r;let a=t.geodeticSurfaceNormalCartographic(iC,Sw);an.octEncode(a,o.encodedNormal)}function uG(e,t,n,i,r,o,a,s,c,u,f){if(aSe(e,t,s,a,!1,n,i,f)||aSe(e,t,u,c,!0,n,i,f))return f;let p;if($ee(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],Xee(o,p,n,i,f),f;let g;if(n===0?i===0?g=fG(e.westMeshes,e.westTiles,In.EAST,e.southMeshes,e.southTiles,In.NORTH,n,i):g=fG(e.northMeshes,e.northTiles,In.SOUTH,e.westMeshes,e.westTiles,In.EAST,n,i):i===0?g=fG(e.southMeshes,e.southTiles,In.NORTH,e.eastMeshes,e.eastTiles,In.WEST,n,i):g=fG(e.eastMeshes,e.eastTiles,In.WEST,e.northMeshes,e.northTiles,In.SOUTH,n,i),l(g))return cSe(e,t,n,i,g,f),f}function fG(e,t,n,i,r,o,a,s){let c=oSe(e,t,!1,n,a,s),u=oSe(i,r,!0,o,a,s);return l(c)&&l(u)?(c+u)*.5:l(c)?c:u}function dG(e,t,n,i,r,o,a,s,c){for(let u=0;u<o.length;++u)r=ebt(e,t,n,i,r,o[u],a[u],s,c);return r}function ebt(e,t,n,i,r,o,a,s,c){let u;s===In.EAST&&e.tile.x===0?(u=ie.clone(o.rectangle,hG),u.west-=D.TWO_PI,u.east-=D.TWO_PI):s===In.WEST&&o.x===0&&(u=ie.clone(o.rectangle,hG),u.west+=D.TWO_PI,u.east+=D.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 In.WEST:g=a.westIndicesSouthToNorth,m=!1;break;case In.NORTH:g=a.northIndicesWestToEast,m=!0;break;case In.EAST:g=a.eastIndicesNorthToSouth,m=!1;break;case In.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=di.geodeticLatitudeToMercatorAngle(f.south),E=1/(di.geodeticLatitudeToMercatorAngle(f.north)-C));for(let w=0;w<g.length;++w){let P=g[w],R=b.decodeTextureCoordinates(x,P,Gf);Yk(y,A,R,R);let O=R.x,N=R.y,_=m?O:N;if(_<0||_>1||Math.abs(O-d)<D.EPSILON5&&Math.abs(N-p)<D.EPSILON5)continue;let v=Math.abs(O)<D.EPSILON5||Math.abs(O-1)<D.EPSILON5,S=Math.abs(N)<D.EPSILON5||Math.abs(N-1)<D.EPSILON5;if(v&&S)continue;let I=b.decodePosition(x,P,Sw),M=b.decodeHeight(x,P),F;b.hasVertexNormals?F=b.getOctEncodedNormal(x,P,qee):(F=qee,F.x=0,F.y=0);let V=N;if(b.hasWebMercatorT){let j=D.lerp(f.south,f.north,N);V=(di.geodeticLatitudeToMercatorAngle(j)-C)*E}let k;n.hasGeodeticSurfaceNormals&&(k=t.geodeticSurfaceNormal(I,Kee)),n.encode(i,r*T,I,R,M,F,V,k),c.minimumHeight=Math.min(c.minimumHeight,M),c.maximumHeight=Math.max(c.maximumHeight,M),++r}return r}function oSe(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(!$ee(d,f))continue;let p;switch(i){case In.WEST:p=f.westIndicesSouthToNorth;break;case In.SOUTH:p=f.southIndicesEastToWest;break;case In.EAST:p=f.eastIndicesNorthToSouth;break;case In.NORTH:p=f.northIndicesWestToEast;break}let g=p[n?0:p.length-1];if(l(g))return f.encoding.decodeHeight(f.vertices,g)}}function $ee(e,t){return l(t)&&(!l(e.data.fill)||!e.data.fill.changedThisFrame)}function aSe(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($ee(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=Yk(g,e.tile,Gf,Gf);if(y.x===o&&y.y===a)return Xee(m,p,o,a,s),!0;if(d=Ar(c,u?o:a,function(A,b){m.encoding.decodeTextureCoordinates(m.vertices,A,Gf);let x=Yk(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 QAt(t,g,e.tile,m,c[d-1],c[d],o,a,u,s),!0}else return Xee(m,c[d],o,a,s),!0}return!1}var tbt=[new h,new h,new h,new h];function nbt(e,t,n,i,r,o){let a=e.quadtree._occluders.ellipsoid,s=a.ellipsoid,c=tbt;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 Iw=ww;var Jee=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){Aa.setOwner(t,this,"_clippingPlanes")}get clippingPolygons(){return this._clippingPolygons}set clippingPolygons(t){hm.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(ibt)}));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(),rbt(this,t);let i=this._vertexArraysToDestroy,r=i.length;for(let o=0;o<r;++o)sh._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:lc.LESS}}),this._blendRenderState=je.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:lc.LESS_OR_EQUAL},blending:Qt.ALPHA_BLEND});let c=Ye(this._renderState,!0);c.cull.enabled=!1,this._disableCullingRenderState=je.fromCache(c),c=Ye(this._blendRenderState,!0),c.cull.enabled=!1,this._disableCullingBlendRenderState=je.fromCache(c)}this._hasFillTilesThisFrame&&this._hasLoadedTilesThisFrame&&Iw.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;Ibt(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)hSe(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),sh.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)!==No.NONE&&i.boundingVolumeSourceTile===n&&(r=!1,sh.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=pSe(this,n);if(n.fog.enabled&&!o&&D.fog(r,n.fog.density)>=1)return No.NONE;let a=t.data,s=a.tileBoundingRegion;if(a.boundingVolumeSourceTile===void 0)return No.PARTIAL;let c=n.cullingVolume,u=s.boundingVolume;l(u)||(u=s.boundingSphere),a.clippedByBoundaries=!1;let f=gG(t.rectangle,this.cartographicLimitRectangle),d=ie.simpleIntersection(f,t.rectangle,mSe);if(!l(d))return No.NONE;if(ie.equals(d,t.rectangle)||(a.clippedByBoundaries=!0),n.mode!==re.SCENE3D&&(u=obt,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 No.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 No.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=No.NONE:y===Xt.INTERSECTING?m=No.PARTIAL:y===Xt.INSIDE&&(m=No.FULL),m===No.NONE)return m;let A=n.mode===re.SCENE3D&&n.camera.frustum instanceof mn;if(n.mode===re.SCENE3D&&!A&&l(i)&&!o){let b=a.occludeePointInScaledSpace;return!l(b)||i.ellipsoid.isScaledSpacePointVisiblePossiblyUnderEllipsoid(b,s.minimumHeight)?m:No.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=cbt;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=lbt;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,ubt),c=h.magnitude(s);return c<D.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){ybt(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]=Abt(p,t,i),s.state=Hs.LOADING)})};if(t.ready){let s=t.imageryProvider;s._reload=a}this._quadtree.forEachLoadedTile(function(s){t._createTileImagerySkeletons(s,i)&&(s.state=Hs.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 ibt(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 rbt(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 hSe(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 obt=new se,mSe=new ie,abt=new ie,sbt=new de;function gG(e,t){if(t.west<t.east)return t;let n=ie.clone(t,abt);return ie.center(e,sbt).longitude>0?n.east=D.PI:n.west=-D.PI,n}function pSe(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 cbt=[],lbt=[],ubt=new h,lSe=new L,pG=new L,fbt=new ae,dbt=new ae,hbt=new ae,mbt=new h,uSe=new h,pbt=new h,gbt=new h,_bt=[new h,new h,new h,new h];function fSe(e,t,n,i,r,o){let a=e.quadtree._occluders.ellipsoid,s=a.ellipsoid,c=_bt;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 ybt(e,t,n){let i=e.data;i===void 0&&(i=e.data=new sh);let r=e.tilingScheme.ellipsoid;i.tileBoundingRegion===void 0&&(i.tileBoundingRegion=new Vf({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=fr.getHeight(o.minimumHeight,p,g),o.maximumHeight=fr.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=fSe(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=fSe(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 Abt(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 bbt=new L,xbt=new L;function dSe(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=L.multiplyByPoint(i,this.properties.rtc,uSe);return L.setTranslation(i,r,lSe),lSe},u_modifiedModelViewProjection:function(){let i=e.context.uniformState.view,r=e.context.uniformState.projection,o=L.multiplyByPoint(i,this.properties.rtc,uSe);return L.setTranslation(i,o,pG),L.multiply(r,pG,pG),pG},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)?L.multiply(e.context.uniformState.view,i.modelMatrix,bbt):L.IDENTITY;return L.inverseTranspose(r,xbt)},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 z(65e5,9e6),nightFadeDistance:new z(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 L,tileRectangle:new ae,verticalExaggerationAndRelativeHeight:new z(1,0),dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsRectangle:[],dayTextureUseWebMercatorT:[],dayTextureAlpha:[],dayTextureNightAlpha:[],dayTextureDayAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayTextureSplit:[],dayTextureCutoutRectangles:[],dayIntensity:0,colorsToAlpha:[],southAndNorthLatitude:new z,southMercatorYAndOneOverHeight:new z,waterMask:void 0,waterMaskTranslationAndScale:new ae,minMaxHeight:new z,scaleAndBias:new L,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 Tbt(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=Cbt(e,r,i),n.wireframeVertexArray.mesh=i}}function Cbt(e,t,n){let r={indices:n.indices,primitiveType:Re.TRIANGLES};Hn.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 gSe,_Se,_G;(function(){let e=new Nt({geometry:Rh.fromDimensions({dimensions:new h(2,2,2)})}),t=new Nt({geometry:new _g({radius:1})}),n=new L,i,r;function o(a){return new Nn({geometryInstances:a,appearance:new gn({translucent:!1,flat:!0}),asynchronous:!1})}gSe=function(a,s){return a===i||(_G(),i=a,n=L.fromRotationTranslation(a.halfAxes,a.center,n),e.modelMatrix=n,e.attributes.color=Kt.fromColor(s),r=o(e)),r},_Se=function(a,s){return a===i||(_G(),i=a,n=L.fromTranslation(a.center,n),n=L.multiplyByUniformScale(n,a.radius,n),t.modelMatrix=n,t.attributes.color=Kt.fromColor(s),r=o(t)),r},_G=function(){l(r)&&(r.destroy(),r=void 0,i=void 0)}})();var vbt=new ae(0,0,0,0),Ebt={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},Sbt=U.TRANSPARENT,wbt=new Wt;function Ibt(e,t,n){let i=t.data;l(i.vertexArray)||(i.fill===void 0&&(i.fill=new Iw(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,Pn=bt.length;Dt<Pn;++Dt)r.addCreditToNextFrame(bt[Dt])}let a=Lt.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??Sbt,A=e.undergroundColorAlphaByDistance??wbt,b=pSe(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,P=E&&l(w),R=e.terrainProvider,O=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,I=e.hueShift,M=e.saturationShift,F=e.brightnessShift,V=!(D.equalsEpsilon(I,0,D.EPSILON7)&&D.equalsEpsilon(M,0,D.EPSILON7)&&D.equalsEpsilon(F,0,D.EPSILON7)),k=!1;if(_){let bt=h.magnitude(n.camera.positionWC),Dt=e.nightFadeOutDistance;k=bt>Dt}C&&--a,P&&--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=fbt,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),pbt),Pn=bt.project(ie.northeast(t.rectangle),gbt);if(ce.x=Dt.x,ce.y=Dt.y,ce.z=Pn.x,ce.w=Pn.y,n.mode!==re.MORPHING&&(B=mbt,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===Ps.BITS12){let ot=1/(Math.pow(2,12)-1)*.5,dt=(ce.z-ce.x)*ot,Si=(ce.w-ce.y)*ot;ce.x-=dt,ce.y-=Si,ce.z+=dt,ce.w+=Si}bt instanceof di&&(Ae=t.rectangle.south,le=t.rectangle.north,Ce=di.geodeticLatitudeToMercatorAngle(Ae),ye=1/(di.geodeticLatitudeToMercatorAngle(le)-Ce),ve=!0)}let Ie=Ebt;Ie.frameState=n,Ie.surfaceTile=i,Ie.hasWaterMask=C,Ie.showReflectiveOcean=E,Ie.showOceanWaves=P,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=k,Ie.hasVertexNormals=O,Ie.useWebMercatorProjection=ve,Ie.clippedByBoundaries=i.clippedByBoundaries,Ie.hasGeodeticSurfaceNormals=Z,Ie.hasExaggeration=J;let Le=i.imagery,$e=0,Xe=Le.length,At=e.showSkirts&&!u&&!d,Ke=e.backFaceCulling&&!u&&!d,we=Ke?e._renderState:e._disableCullingRenderState,We=Ke?e._blendRenderState:e._disableCullingBlendRenderState,vt=we,ct=e._firstPassInitialColor,pn=n.context;if(l(e._debug.boundingSphereTile)||_G(),e._materialUniformMap!==e.materialUniformMap){e._materialUniformMap=e.materialUniformMap;let bt=e._drawCommands.length;for(let Dt=0;Dt<bt;++Dt)e._uniformMaps[Dt]=dSe(n,e)}do{let bt=0,Dt,Pn;if(e._drawCommands.length<=e._usedDrawCommands?(Dt=new nt,Dt.owner=t,Dt.cull=!1,Dt.boundingVolume=new se,Dt.orientedBoundingBox=void 0,Pn=dSe(n,e),e._drawCommands.push(Dt),e._uniformMaps.push(Pn)):(Dt=e._drawCommands[e._usedDrawCommands],Pn=e._uniformMaps[e._usedDrawCommands]),Dt.owner=t,++e._usedDrawCommands,t===e._debug.boundingSphereTile){let Ro=W.boundingVolume,ws=W.boundingSphere;l(Ro)?gSe(Ro,U.RED).update(n):l(ws)&&_Se(ws,U.RED).update(n)}let ot=Pn.properties;ae.clone(ct,ot.initialColor),ot.oceanNormalMap=w,ot.lightingFadeDistance.x=e.lightingFadeOutDistance,ot.lightingFadeDistance.y=e.lightingFadeInDistance,ot.nightFadeDistance.x=e.nightFadeOutDistance,ot.nightFadeDistance.y=e.nightFadeInDistance,ot.atmosphereLightIntensity=e.atmosphereLightIntensity,ot.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,ot.atmosphereMieCoefficient=e.atmosphereMieCoefficient,ot.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,ot.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,ot.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,ot.zoomedOutOceanSpecularIntensity=e.zoomedOutOceanSpecularIntensity;let dt=u?g:p,Si=u?p:g;l(dt)&&(ae.fromElements(dt.near,dt.nearValue,dt.far,dt.farValue,ot.frontFaceAlphaByDistance),ae.fromElements(Si.near,Si.nearValue,Si.far,Si.farValue,ot.backFaceAlphaByDistance)),ae.fromElements(A.near,A.nearValue,A.far,A.farValue,ot.undergroundColorAlphaByDistance),U.clone(y,ot.undergroundColor),ot.lambertDiffuseMultiplier=x,ot.vertexShadowDarkness=T;let wn=!l(i.vertexArray)&&l(e.fillHighlightColor)&&e.fillHighlightColor.alpha>0;wn&&U.clone(e.fillHighlightColor,ot.fillHighlightColor),ot.verticalExaggerationAndRelativeHeight.x=Q,ot.verticalExaggerationAndRelativeHeight.y=q,ot.center3D=j.center,h.clone(B,ot.rtc),ae.clone(ce,ot.tileRectangle),ot.southAndNorthLatitude.x=Ae,ot.southAndNorthLatitude.y=le,ot.southMercatorYAndOneOverHeight.x=Ce,ot.southMercatorYAndOneOverHeight.y=ye;let Ni=dbt,dr=gG(t.rectangle,e.cartographicLimitRectangle),Fi=hbt,Yi=gG(t.rectangle,m);h.fromElements(I,M,F,ot.hsbShift);let ai=t.rectangle,ni=1/ai.width,En=1/ai.height;Ni.x=(dr.west-ai.west)*ni,Ni.y=(dr.south-ai.south)*En,Ni.z=(dr.east-ai.west)*ni,Ni.w=(dr.north-ai.south)*En,ae.clone(Ni,ot.localizedCartographicLimitRectangle),Fi.x=(Yi.west-ai.west)*ni,Fi.y=(Yi.south-ai.south)*En,Fi.z=(Yi.east-ai.west)*ni,Fi.w=(Yi.north-ai.south)*En,ae.clone(Fi,ot.localizedTranslucencyRectangle);let ii=N&&D.fog(t._distance,n.fog.density)>D.EPSILON3;V=V&&(ii||_);let Sr=!1,Ea=!1,Va=!1,rs=!1,os=!1,oo=!1,gi=!1,ao=!1,Ri=!1,Ho=!1;for(;bt<a&&$e<Xe;){let Ro=Le[$e],ws=Ro.readyImagery;if(++$e,!l(ws)||ws.imageryLayer.alpha===0)continue;let Z_=Ro.useWebMercatorT?ws.textureWebMercator:ws.texture,si=ws.imageryLayer;l(Ro.textureTranslationAndScale)||(Ro.textureTranslationAndScale=si._calculateTextureTranslationAndScale(t,Ro)),ot.dayTextures[bt]=Z_,ot.dayTextureTranslationAndScale[bt]=Ro.textureTranslationAndScale,ot.dayTextureTexCoordsRectangle[bt]=Ro.textureCoordinateRectangle,ot.dayTextureUseWebMercatorT[bt]=Ro.useWebMercatorT,ot.dayTextureAlpha[bt]=si.alpha,oo=oo||ot.dayTextureAlpha[bt]!==1,ot.dayTextureNightAlpha[bt]=si.nightAlpha,gi=gi||ot.dayTextureNightAlpha[bt]!==1,ot.dayTextureDayAlpha[bt]=si.dayAlpha,gi=gi||ot.dayTextureDayAlpha[bt]!==1,ot.dayTextureBrightness[bt]=si.brightness,Sr=Sr||ot.dayTextureBrightness[bt]!==Ta.DEFAULT_BRIGHTNESS,ot.dayTextureContrast[bt]=si.contrast,Ea=Ea||ot.dayTextureContrast[bt]!==Ta.DEFAULT_CONTRAST,ot.dayTextureHue[bt]=si.hue,Va=Va||ot.dayTextureHue[bt]!==Ta.DEFAULT_HUE,ot.dayTextureSaturation[bt]=si.saturation,rs=rs||ot.dayTextureSaturation[bt]!==Ta.DEFAULT_SATURATION,ot.dayTextureOneOverGamma[bt]=1/si.gamma,os=os||ot.dayTextureOneOverGamma[bt]!==1/Ta.DEFAULT_GAMMA,ot.dayTextureSplit[bt]=si.splitDirection,ao=ao||ot.dayTextureSplit[bt]!==0;let Xs=ot.dayTextureCutoutRectangles[bt];if(l(Xs)||(Xs=ot.dayTextureCutoutRectangles[bt]=new ae),ae.clone(ae.ZERO,Xs),l(si.cutoutRectangle)){let wa=gG(ai,si.cutoutRectangle),ld=ie.simpleIntersection(wa,ai,mSe);Ri=l(ld)||Ri,Xs.x=(wa.west-ai.west)*ni,Xs.y=(wa.south-ai.south)*En,Xs.z=(wa.east-ai.west)*ni,Xs.w=(wa.north-ai.south)*En}let Ks=ot.colorsToAlpha[bt];l(Ks)||(Ks=ot.colorsToAlpha[bt]=new ae);let as=l(si.colorToAlpha)&&si.colorToAlphaThreshold>0;if(Ho=Ho||as,as){let wa=si.colorToAlpha;Ks.x=wa.red,Ks.y=wa.green,Ks.z=wa.blue,Ks.w=si.colorToAlphaThreshold}else Ks.w=-1;if(l(ws.credits)){let wa=ws.credits;for(let ld=0,_b=wa.length;ld<_b;++ld)r.addCreditToNextFrame(wa[ld])}++bt}ot.dayTextures.length=bt,ot.waterMask=s,ae.clone(c,ot.waterMaskTranslationAndScale),ot.minMaxHeight.x=G.minimumHeight,ot.minMaxHeight.y=G.maximumHeight,L.clone(G.matrix,ot.scaleAndBias);let Oi=e._clippingPlanes,wr=l(Oi)&&Oi.enabled&&t.isClipped;wr&&(ot.clippingPlanesEdgeColor=U.clone(Oi.edgeColor,ot.clippingPlanesEdgeColor),ot.clippingPlanesEdgeWidth=Oi.edgeWidth);let Sa=i.vectorData;l(Sa)&&(ot.vectorSegmentTexture=Sa.polylineSegmentTexture,ot.vectorWidthTexture=Sa.widthTexture,ot.vectorColorTexture=Sa.colorTexture,ot.vectorSegmentPrimitiveIndicesTexture=Sa.polylineSegmentPrimitiveIndicesTexture,ot.vectorGridCellIndicesTexture=Sa.polylineGridCellIndicesTexture,ot.vectorPolygonEdgeTexture=Sa.polygonEdgeTexture,ot.vectorPolygonEdgePrimitiveIndicesTexture=Sa.polygonEdgePrimitiveIndicesTexture,ot.vectorPolygonGridCellIndicesTexture=Sa.polygonGridCellIndicesTexture);let Do=e._clippingPolygons,sd=l(Do)&&Do.enabled&&Do.length>0&&t.isClipped;Ie.numberOfDayTextures=bt,Ie.applyBrightness=Sr,Ie.applyContrast=Ea,Ie.applyHue=Va,Ie.applySaturation=rs,Ie.applyGamma=os,Ie.applyAlpha=oo,Ie.applyDayNightAlpha=gi,Ie.applySplit=ao,Ie.enableFog=ii,Ie.enableClippingPlanes=wr,Ie.clippingPlanes=Oi,Ie.enableClippingPolygons=sd,Ie.clippingPolygons=Do,Ie.hasImageryLayerCutout=Ri,Ie.colorCorrect=V,Ie.highlightFillTile=wn,Ie.colorToAlpha=Ho,Ie.showUndergroundColor=b,Ie.translucent=d;let cd=i.renderedMesh.indices.length;At||(cd=i.renderedMesh.indexCountWithoutSkirts),Dt.shaderProgram=e._surfaceShaderSet.getShaderProgram(Ie),Dt.castShadows=v,Dt.receiveShadows=S,Dt.renderState=vt,Dt.primitiveType=Re.TRIANGLES,Dt.vertexArray=i.vertexArray||i.fill.vertexArray,Dt.count=cd,Dt.uniformMap=Pn,Dt.pass=Pe.GLOBE,e._debug.wireframe&&(Tbt(pn,t),l(i.wireframeVertexArray)&&(Dt.vertexArray=i.wireframeVertexArray,Dt.primitiveType=Re.LINES,Dt.count=cd*2));let bc=Dt.boundingVolume,J_=Dt.orientedBoundingBox;n.mode!==re.SCENE3D?(se.fromRectangleWithHeights2D(t.rectangle,n.mapProjection,W.minimumHeight,W.maximumHeight,bc),h.fromElements(bc.center.z,bc.center.x,bc.center.y,bc.center),n.mode===re.MORPHING&&se.union(W.boundingSphere,bc,bc)):(Dt.boundingVolume=se.clone(W.boundingSphere,bc),Dt.orientedBoundingBox=Jt.clone(W.boundingVolume,J_)),Dt.dirty=!0,d&&f.updateDerivedCommands(Dt,n),hSe(Dt,n),vt=We,ct=vbt}while($e<Xe)}var Xk=Jee;function ySe(){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(ySe.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 Kk=ySe;var Zee=class{constructor(t){this._ellipsoid=new Ih(t.ellipsoid,h.ZERO)}get ellipsoid(){return this._ellipsoid}},$k=Zee;var Qee=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()}},Pbt=1e3,ete=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 Qee(Pbt),this.state=Hs.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 Rbt(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),ASe(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),ASe(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<Hs.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=Hs.START,this.renderable=!1,this.upsampledFromParent=!1;let t=this.data;l(t)&&l(t.freeResources)&&t.freeResources(),yG(this._southwestChild),this._southwestChild=void 0,yG(this._southeastChild),this._southeastChild=void 0,yG(this._northwestChild),this._northwestChild=void 0,yG(this._northeastChild),this._northeastChild=void 0}},Dbt=256;function Rbt(e,t,n,i){let r=n.width/Dbt*i,o=Math.floor(e/r)*r,a=Math.floor(t/r)*r;return`${o.toFixed(10)},${a.toFixed(10)}`}var Obt=new de;function ASe(e,t){let n=e.northwestChild.rectangle,i=ie.southeast(n,Obt),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 yG(e){l(e)&&e.freeResources()}var Jk=ete;function AG(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}AG.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head};AG.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(),bSe(this,t)),t=i}};function bSe(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}AG.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))&&bSe(this,e),e.replacementPrevious=void 0,e.replacementNext=t,t.replacementPrevious=e,this.head=e};var Zk=AG;function ch(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 Zk,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 $k({ellipsoid:n}),this._tileLoadProgressEvent=new be,this._lastTileLoadQueueLength=0,this._lastSelectionFrameNumber=void 0}Object.defineProperties(ch.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}},occluders:{get:function(){return this._occluders}}});ch.prototype.invalidateAllTiles=function(){this._tilesInvalidated=!0};function Mbt(e){let t=e._tileReplacementQueue;t.head=void 0,t.tail=void 0,t.count=0,TSe(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()}ch.prototype.forEachLoadedTile=function(e){let t=this._tileReplacementQueue.head;for(;l(t);)t.state!==Hs.START&&e(t),t=t.replacementNext};ch.prototype.forEachRenderedTile=function(e){let t=this._tilesRenderedThisFrame;for(let n of t)e(n)};ch.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};ch.prototype.update=function(e){l(this._tileProvider.update)&&this._tileProvider.update(e)};function TSe(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}ch.prototype.beginFrame=function(e){e.passes.render&&(this._tilesInvalidated&&(Mbt(this),this._tilesInvalidated=!1),this._tileProvider.initialize(e),TSe(this),!this._debug.suspendLodUpdate&&(this._tileReplacementQueue.markStartOfRenderFrame(),this._tilesRenderedThisFrame.clear()))};ch.prototype.render=function(e){let t=e.passes,n=this._tileProvider;t.render&&(n.beginUpdate(e),Bbt(this,e),Ybt(this,e),n.endUpdate(e)),t.pick&&this._tilesToRender.length>0&&n.updateForPick(e)};function Lbt(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))}ch.prototype.endFrame=function(e){!e.passes.render||e.mode===re.MORPHING||(Hbt(this,e),qbt(this,e),Lbt(this,e))};ch.prototype.isDestroyed=function(){return!1};ch.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var e3,xSe=new de;function Nbt(e,t){let n=ie.center(e.rectangle,xSe),i=n.longitude-e3.longitude,r=n.latitude-e3.latitude;n=ie.center(t.rectangle,xSe);let o=n.longitude-e3.longitude,a=n.latitude-e3.latitude;return i*i+r*r-(o*o+a*a)}var Fbt=new h,Qk=[];function Bbt(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=Jk.createLevelZeroTiles(p);let g=e._levelZeroTiles.length;if(Qk.length<g){Qk=new Array(g);for(let m=0;m<g;++m)Qk[m]===void 0&&(Qk[m]=new t3)}}else return}e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;let o=e._levelZeroTiles,a=o.length>1?e._occluders:void 0;e3=t.camera.positionCartographic,o.sort(Nbt);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=L.getTranslation(u.transform,Fbt);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?kc(e,p,r,t,a,!1,Qk[d]):(x_(e,e._tileLoadQueueHigh,p,t),++n.tilesWaitingForChildren)}e._lastSelectionFrameNumber=t.frameNumber}function x_(e,t,n,i){n.needsLoading&&(e.tileProvider.computeTileLoadPriority!==void 0&&(n._loadPriority=e.tileProvider.computeTileLoadPriority(n,i)),t.push(n))}function t3(){this.allAreRenderable=!0,this.anyWereRenderedLastFrame=!1,this.notYetRenderableCount=0}function CSe(){this.southwest=new t3,this.southeast=new t3,this.northwest=new t3,this.northeast=new t3}CSe.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 nte=new Array(31);for(let e=0;e<nte.length;++e)nte[e]=new CSe;function kbt(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=Vbt(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===Hs.DONE,b=m||y||A;if(b||l(g.canRenderWithoutLosingDetail)&&(b=g.canRenderWithoutLosingDetail(n)),b){a&&x_(e,e._tileLoadQueueMedium,n,t),bG(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&&x_(e,e._tileLoadQueueHigh,n,t)}if(g.canRefine(n)){if(s.upsampledFromParent&&c.upsampledFromParent&&u.upsampledFromParent&&f.upsampledFromParent){bG(e,n),x_(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(zbt(e,s,c,u,f,t,i,r),y!==e._tilesToRender.length){let C=r.allAreRenderable,E=r.anyWereRenderedLastFrame,w=r.notYetRenderableCount,P=!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,bG(e,n),n._lastSelectionResult=fi.RENDERED;let O=p===fi.RENDERED;!O&&w>e.loadingDescendantLimit&&(e._tileLoadQueueLow.length=A,e._tileLoadQueueMedium.length=b,e._tileLoadQueueHigh.length=x,x_(e,e._tileLoadQueueMedium,n,t),r.notYetRenderableCount=n.renderable?0:1,P=!0),r.allAreRenderable=n.renderable,r.anyWereRenderedLastFrame=O,O||e._tileToUpdateHeights.push(n),++o.tilesWaitingForChildren}e.preloadAncestors&&!P&&x_(e,e._tileLoadQueueLow,n,t)}return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=fi.RENDERED,bG(e,n),x_(e,e._tileLoadQueueHigh,n,t),r.allAreRenderable=n.renderable,r.anyWereRenderedLastFrame=p===fi.RENDERED,r.notYetRenderableCount=n.renderable?0:1}function zbt(e,t,n,i,r,o,a,s){let c=o.camera.positionCartographic,u=e._tileProvider,f=e._occluders,d=nte[t.level],p=d.southwest,g=d.southeast,m=d.northwest,y=d.northeast;c.longitude<t.rectangle.east?c.latitude<t.rectangle.north?(kc(e,t,u,o,f,a,p),kc(e,n,u,o,f,a,g),kc(e,i,u,o,f,a,m),kc(e,r,u,o,f,a,y)):(kc(e,i,u,o,f,a,m),kc(e,t,u,o,f,a,p),kc(e,r,u,o,f,a,y),kc(e,n,u,o,f,a,g)):c.latitude<t.rectangle.north?(kc(e,n,u,o,f,a,g),kc(e,t,u,o,f,a,p),kc(e,r,u,o,f,a,y),kc(e,i,u,o,f,a,m)):(kc(e,r,u,o,f,a,y),kc(e,i,u,o,f,a,m),kc(e,n,u,o,f,a,g),kc(e,t,u,o,f,a,p)),d.combine(s)}function Ubt(e,t){let n=t.rectangle;return l(e._cameraPositionCartographic)&&ie.contains(n,e._cameraPositionCartographic)||l(e._cameraReferenceFrameOriginCartographic)&&ie.contains(n,e._cameraReferenceFrameOriginCartographic)}function kc(e,t,n,i,r,o,a){if(n.computeTileVisibility(t,i,r)!==No.NONE)return kbt(e,i,t,o,a);if(++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t),a.allAreRenderable=!0,a.anyWereRenderedLastFrame=!1,a.notYetRenderableCount=0,Ubt(e,t)){(!l(t.data)||!l(t.data.vertexArray))&&x_(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?(x_(e,e._tileLoadQueueLow,t,i),t._lastSelectionResult=fi.CULLED):t._lastSelectionResult=fi.CULLED;t._lastSelectionResultFrame=i.frameNumber}function Vbt(e,t,n){if(t.mode===re.SCENE2D||t.camera.frustum instanceof mn||t.camera.frustum instanceof da)return jbt(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-=D.fog(r,t.fog.density)*t.fog.sse),s/=t.pixelRatio,s}function jbt(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-=D.fog(n._distance,t.fog.density)*t.fog.sse),d/=t.pixelRatio,d}function bG(e,t){e._tilesToRender.push(t),e._tilesRenderedThisFrame.add(t)}function Hbt(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=yn()+e._loadQueueTimeSlice,a=e._tileProvider,s=tte(e,t,a,o,n,!1);s=tte(e,t,a,o,i,s),tte(e,t,a,o,r,s)}function Gbt(e,t){return e._loadPriority-t._loadPriority}function tte(e,t,n,i,r,o){n.computeTileLoadPriority!==void 0&&r.sort(Gbt);for(let a=0,s=r.length;a<s&&(yn()<i||!o);++a){let c=r[a];e._tileReplacementQueue.markTileRendered(c),n.loadTile(t,c),o=!0}return o}var Pw=new dn,xG=new de,BA=new h,Wbt=[];function qbt(e,t){if(!l(e.tileProvider.tilingScheme))return;let n=Wbt;n.length=0;let i=e._tileToUpdateHeights,r=yn(),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,Pw.direction),w=u.getSurfaceNormalIntersectionWithZAxis(A.positionOnEllipsoidSurface,11500,Pw.origin);if(!l(w)){let P=0;l(d.data.tileBoundingRegion)&&(P=d.data.tileBoundingRegion.minimumHeight);let R=Math.min(P,-11500),O=h.multiplyByScalar(E,Math.abs(R)+1,BA);h.subtract(A.positionOnEllipsoidSurface,O,Pw.origin)}}else de.clone(A.positionCartographic,xG),xG.height=-11500,c.project(xG,BA),h.fromElements(BA.z,BA.x,BA.y,BA),h.clone(BA,Pw.origin),h.clone(h.UNIT_X,Pw.direction);T=d.data.pick(Pw,s,c,!1,BA),l(T)&&d.setPositionCacheEntry(A.positionCartographic,e.maximumScreenSpaceError,h.clone(T))}if(l(T)){if(l(A.callback)){let E=u.cartesianToCartographic(T,xG);A.callback(E)}A.level=d.level}}if(yn()>=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 Ybt(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 n3=ch;function Fm(e){e=e??te.default;let t=new Dp({ellipsoid:e}),n=new $T,i=new IM({tilingScheme:t.tilingScheme});this._ellipsoid=e,this._imageryLayerCollection=n,this._surfaceShaderSet=new qk,this._material=void 0,this._surface=new n3({tileProvider:new Xk({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 Kk,rte(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=D.PI_OVER_TWO*e.minimumRadius,this.lightingFadeInDistance=D.PI*e.minimumRadius,this.nightFadeOutDistance=D.PI_OVER_TWO*e.minimumRadius,this.nightFadeInDistance=5*D.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(Fm.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)&&rte(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,rte(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 rte(e){let t=[],n=l(e._material)&&(l(e._material.shaderSource.match(/slope/))||l(e._material.shaderSource.match("normalEC"))),i=[mm,Ew];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(Hk),e._surfaceShaderSet.baseVertexShaderSource=new Ge({sources:[mm,Ew,Gk],defines:t}),e._surfaceShaderSet.baseFragmentShaderSource=new Ge({sources:i,defines:t}),e._surfaceShaderSet.material=e._material}function Xbt(e){return function(t,n){let i=se.distanceSquaredTo(t.pickBoundingSphere,e),r=se.distanceSquaredTo(n.pickBoundingSphere,e);return i-r}}var Kbt=[],$bt={start:0,stop:0};Fm.prototype.pickWorldCoordinates=function(e,t,n,i){n=n??!0;let r=t.mode,o=t.mapProjection,a=Kbt;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,$bt);l(p)&&a.push(f)}a.sort(Xbt(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 Jbt=new de;Fm.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,Jbt);n=this._ellipsoid.cartographicToCartesian(i,n)}return n};var Zbt=new h,vSe=new h,Qbt=new de,ext=new dn;function ite(e,t){return l(e)&&ie.contains(e.rectangle,t)?e:void 0}Fm.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=ite(n._southwestChild,e)||ite(n._southeastChild,e)||ite(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,Zbt),u=ext,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,vSe);h.subtract(c,y,u.origin)}let p=n.data.pick(u,re.SCENE3D,a,!1,vSe);if(l(p))return s.cartesianToCartographic(p,Qbt).height};Fm.prototype.update=function(e){this.show&&e.passes.render&&this._surface.update(e)};Fm.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 Ct({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))};Fm.prototype.render=function(e){this.show&&(l(this._material)&&this._material.update(e.context),this._surface.render(e))};Fm.prototype.endFrame=function(e){this.show&&e.passes.render&&this._surface.endFrame(e)};Fm.prototype.isDestroyed=function(){return!1};Fm.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 i3=Fm;var Dw=`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 Rw=`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 ote={position:0};function TG(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=L.clone(e.modelMatrix??L.IDENTITY),this._modelMatrix=new L,this._computedModelMatrix=new L,this.show=e.show??!0,this.material=e.material??tr.fromType(tr.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 txt(e){let t=e.cache.ellipsoidPrimitive_vertexArray;if(l(t))return t;let n=wc.createGeometry(wc.fromDimensions({dimensions:new h(2,2,2),vertexFormat:Be.POSITION_ONLY}));return t=Vn.fromGeometry({context:e,geometry:n,attributeLocations:ote,bufferUsage:Oe.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=t,t}TG.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:zi.FRONT},depthTest:{enabled:this._depthTestEnabled},depthMask:!n&&t.fragmentDepth,blending:n?Qt.ALPHA_BLEND:void 0})),l(this._va)||(this._va=txt(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}(!L.equals(this.modelMatrix,this._modelMatrix)||!h.equals(this.center,this._center))&&(L.clone(this.modelMatrix,this._modelMatrix),h.clone(this.center,this._center),L.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:[Rw]}),p=new Ge({sources:[this.material.shaderSource,Dw]}),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:ote}),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:[Rw]}),p=new Ge({sources:[this.material.shaderSource,Dw],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:ote}),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)}};TG.prototype.isDestroyed=function(){return!1};TG.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 r3=TG;function o3(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 r3({radii:this.ellipsoid.radii,material:tr.fromType(tr.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new t1}Object.defineProperties(o3.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var CG=new $,nxt=new $,ixt=new h,vG=[];o3.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,CG))||mt.computeTemeToPseudoFixedMatrix(n,CG);let i=this._axes.evaluate(n,nxt);$.transpose(i,i),$.multiply(CG,i,i);let r=Yy.computeMoonPositionInEarthInertialFrame(n,ixt);$.multiplyByVector(CG,r,r),L.fromRotationTranslation(i,r,t.modelMatrix);let o=e.commandList;return e.commandList=vG,vG.length=0,t.update(e),e.commandList=o,vG.length===1?vG[0]:void 0};o3.prototype.isDestroyed=function(){return!1};o3.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),ue(this)};var a3=o3;var s3=`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 c3(){this._colorTexture=void 0,this._drawCommand=void 0}Object.defineProperties(c3.prototype,{colorTexture:{get:function(){return this._colorTexture}}});function rxt(e,t,n){let i=t.createViewportQuadCommand(s3,{framebuffer:n,renderState:je.fromCache({viewport:new Je(0,0,256,256)})});e._drawCommand=i}c3.prototype.update=function(e){if(!l(this._colorTexture)){let t=e.context,n=new Ct({context:t,width:256,height:256,pixelFormat:He.RGBA,pixelDatatype:ke.UNSIGNED_BYTE,sampler:zt.NEAREST});this._colorTexture=n;let i=new _a({context:t,colorTextures:[n],destroyAttachments:!1});rxt(this,t,i),this._drawCommand.execute(t),i.destroy(),this._drawCommand.shaderProgram=this._drawCommand.shaderProgram&&this._drawCommand.shaderProgram.destroy()}};c3.prototype.isDestroyed=function(){return!1};c3.prototype.destroy=function(){return this._colorTexture=this._colorTexture&&this._colorTexture.destroy(),ue(this)};var l3=c3;var ISe={};function oxt(e,t,n){let i,r,o;if(e instanceof Gi){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 Fl)return i=e.near,r=e.top,o=e.right,Math.max(t*i/o,n*i/r);return Math.max(t,n)}var axt=new h,ESe=new h;function PSe(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 D.lerp(e,-D.PI_OVER_TWO,p)}let d=(f-o)/c;return D.lerp(-D.PI_OVER_TWO,t,1-d)}}return function(r){return D.lerp(e,t,r)}}function ste(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,axt),g=h.magnitude(h.multiplyByScalar(u,h.dot(p,u),ESe)),m=h.magnitude(h.multiplyByScalar(f,h.dot(p,f),ESe));o=Math.min(oxt(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 D.lerp(n,i,s)}}function u3(e,t){return D.equalsEpsilon(e,D.TWO_PI,D.EPSILON11)&&(e=0),t>e+Math.PI?e+=D.TWO_PI:t<e-Math.PI&&(e-=D.TWO_PI),e}var DSe=new h;function sxt(e,t,n,i,r,o,a,s){let c=e.camera,u=h.clone(c.position,DSe),f=c.pitch,d=u3(c.heading,i),p=u3(c.roll,o),g=ste(c,n,u.z,n.z,a),m=PSe(f,r,g,s);function y(A){let b=A.time/t;c.setView({orientation:{heading:D.lerp(d,i,b),pitch:m(b),roll:D.lerp(p,o,b)}}),z.lerp(u,n,b,c.position),c.position.z=g(b)}return y}function cxt(e,t){e.longitude<t.longitude?e.longitude+=D.TWO_PI:t.longitude+=D.TWO_PI}function lxt(e,t){let n=e.longitude-t.longitude;n<-D.PI?e.longitude+=D.TWO_PI:n>D.PI&&(t.longitude+=D.TWO_PI)}var uxt=new de,fxt=new de;function dxt(e,t,n,i,r,o,a,s,c,u){let f=e.camera,p=e.mapProjection.ellipsoid,g=de.clone(f.positionCartographic,uxt),m=f.pitch,y=u3(f.heading,i),A=u3(f.roll,o),b=p.cartesianToCartographic(n,fxt);g.longitude=D.zeroToTwoPi(g.longitude),b.longitude=D.zeroToTwoPi(b.longitude);let x=!1;if(l(s)){let w=D.zeroToTwoPi(s),P=Math.min(g.longitude,b.longitude),R=Math.max(g.longitude,b.longitude),O=w>=P&&w<=R;if(l(c)){let N=Math.abs(g.longitude-b.longitude),_=D.TWO_PI-N;(O?N:_)<(O?_:N)*c&&!O&&(x=!0)}else O||(x=!0)}x?cxt(g,b):lxt(g,b);let T=ste(f,n,g.height,b.height,a),C=PSe(m,r,T,u);function E(){let w=g.longitude,P=b.longitude,R=g.latitude,O=b.latitude;return function(_){let v=_.time/t,S=h.fromRadians(D.lerp(w,P,v),D.lerp(R,O,v),T(v),p);f.setView({destination:S,orientation:{heading:D.lerp(y,i,v),pitch:C(v),roll:D.lerp(A,o,v)}})}}return E()}function hxt(e,t,n,i,r,o,a){let s=e.camera,c=h.clone(s.position,DSe),u=u3(s.heading,i),f=s.frustum.right-s.frustum.left,d=ste(s,n,f,n.z,a);function p(g){let m=g.time/t;s.setView({orientation:{heading:D.lerp(u,i,m)}}),z.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 SSe=new de,mxt=new h;function ate(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function wSe(e,t){function n(){typeof t=="function"&&t(),e.enableInputs=!0}return n}ISe.createTween=function(e,t){t=t??H.EMPTY_OBJECT;let n=t.destination,i=e.mode;if(i===re.MORPHING)return ate();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,SSe),n=o.project(SSe,mxt));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??-D.PI_OVER_TWO,b=t.roll??0,x=e.screenSpaceCameraController;x.enableInputs=!1;let T=wSe(x,t.complete),C=wSe(x,t.cancel),E=p.frustum,w=e.mode===re.SCENE2D;if(w=w&&z.equalsEpsilon(p.position,n,D.EPSILON6),w=w&&D.equalsEpsilon(Math.max(E.right-E.left,E.top-E.bottom),n.z,D.EPSILON6),w=w||e.mode!==re.SCENE2D&&h.equalsEpsilon(n,p.position,D.EPSILON10),w=w&&D.equalsEpsilon(D.negativePiToPi(y),D.negativePiToPi(p.heading),D.EPSILON10)&&D.equalsEpsilon(D.negativePiToPi(A),D.negativePiToPi(p.pitch),D.EPSILON10)&&D.equalsEpsilon(D.negativePiToPi(b),D.negativePiToPi(p.roll),D.EPSILON10),w)return ate(T,C);let P=new Array(4);if(P[re.SCENE2D]=hxt,P[re.SCENE3D]=dxt,P[re.COLUMBUS_VIEW]=sxt,m<=0)return ate(function(){P[i](e,1,n,y,A,b,s,c,u,f)({time:1}),typeof T=="function"&&T()},C);let R=P[i](e,m,n,y,A,b,s,c,u,f);if(!l(d)){let O=p.positionCartographic.height,N=i===re.SCENE3D?a.cartesianToCartographic(n).height:n.z;O>N&&O>11500?d=fa.CUBIC_OUT:d=fa.QUINTIC_IN_OUT}return{duration:m,easingFunction:d,startObject:{time:0},stopObject:{time:m},update:R,complete:T,cancel:C}};var f3=ISe;var RSe={ROTATE:0,INFINITE_SCROLL:1};Object.freeze(RSe);var au=RSe;function on(e){this._scene=e,this._transform=L.clone(L.IDENTITY),this._invTransform=L.clone(L.IDENTITY),this._actualTransform=L.clone(L.IDENTITY),this._actualInvTransform=L.clone(L.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 Gi,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=D.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 L,this._invViewMatrix=new L,jSe(this),this._mode=re.SCENE3D,this._modeChanged=!0;let t=e.mapProjection;this._projection=t,this._maxCoord=t.project(new de(Math.PI,D.PI_OVER_TWO)),this._max2Dfrustum=void 0,ewe(this,on.DEFAULT_VIEW_RECTANGLE,this.position,!0);let n=h.magnitude(this.position);n+=n*on.DEFAULT_VIEW_FACTOR,h.normalize(this.position,this.position),h.multiplyByScalar(this.position,n,this.position)}on.TRANSFORM_2D=new L(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);on.TRANSFORM_2D_INVERSE=L.inverseTransformation(on.TRANSFORM_2D,new L);on.DEFAULT_VIEW_RECTANGLE=ie.fromDegrees(-95,-20,-70,90);on.DEFAULT_VIEW_FACTOR=.5;on.DEFAULT_OFFSET=new Rd(0,-D.PI_OVER_FOUR,0);function jSe(e){L.computeView(e._position,e._direction,e._up,e._right,e._viewMatrix),L.multiply(e._viewMatrix,e._actualInvTransform,e._viewMatrix),L.inverseTransformation(e._viewMatrix,e._invViewMatrix)}function pxt(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=yn()):e.timeSinceMoved=Math.max(yn()-e._lastMovedTimestamp,0)/1e3}}on.prototype.canPreloadFlight=function(){return l(this._currentFlight)&&this._mode!==re.SCENE2D};on.prototype._updateCameraChanged=function(){let e=this;if(pxt(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)%D.TWO_PI;i=i>D.PI?D.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)%D.TWO_PI;a=a>D.PI?D.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,P=g.y+y.top,R=Math.max(A,x),O=Math.min(b,T),N=Math.max(C,w),_=Math.min(E,P),v;if(R>=O||N>=E)v=1;else{let S=y;A<x&&b>T&&C<w&&E>P&&(S=m),v=1-(O-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=D.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 gxt(e){mt.basisTo2D(e._projection,e._transform,e._actualTransform)}var _xt=new de,yxt=new h,EG=new h,Axt=new ae,bxt=new ae,xxt=new ae,Txt=new ae,Cxt=new ae;function vxt(e){let t=e._projection,n=t.ellipsoid,i=L.getColumn(e._transform,3,Axt),r=n.cartesianToCartographic(i,_xt),o=t.project(r,yxt),a=bxt;a.x=o.z,a.y=o.x,a.z=o.y,a.w=1;let s=ae.clone(ae.UNIT_X,Cxt),c=ae.add(L.getColumn(e._transform,0,EG),i,EG);n.cartesianToCartographic(c,r),t.project(r,o);let u=xxt;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=Txt;if(h.magnitudeSquared(u)>D.EPSILON10)h.cross(s,u,f);else{let d=ae.add(L.getColumn(e._transform,1,EG),i,EG);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)<D.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),L.setColumn(e._actualTransform,0,u,e._actualTransform),L.setColumn(e._actualTransform,1,f,e._actualTransform),L.setColumn(e._actualTransform,2,s,e._actualTransform),L.setColumn(e._actualTransform,3,a,e._actualTransform)}var cte=new h;function _l(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&&(L.inverseTransformation(e._transform,e._invTransform),e._mode===re.COLUMBUS_VIEW||e._mode===re.SCENE2D?L.equals(L.IDENTITY,e._transform)?L.clone(on.TRANSFORM_2D,e._actualTransform):e._mode===re.COLUMBUS_VIEW?gxt(e):vxt(e):L.clone(e._transform,e._actualTransform),L.inverseTransformation(e._actualTransform,e._actualInvTransform),e._modeChanged=!1);let g=e._actualTransform;if(o||p)if(e._positionWC=L.multiplyByPoint(g,r,e._positionWC),t===re.SCENE3D||t===re.MORPHING)e._positionCartographic=e._projection.ellipsoid.cartesianToCartographic(e._positionWC,e._positionCartographic);else{let m=cte;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,cte));if(Math.abs(1-m)>D.EPSILON2){let y=1/h.magnitudeSquared(c),A=h.dot(c,a)*y,b=h.multiplyByScalar(a,A,cte);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=L.multiplyByPointAsVector(g,a,e._directionWC),h.normalize(e._directionWC,e._directionWC)),(u||p)&&(e._upWC=L.multiplyByPointAsVector(g,c,e._upWC),h.normalize(e._upWC,e._upWC)),(d||p)&&(e._rightWC=L.multiplyByPointAsVector(g,f,e._rightWC),h.normalize(e._rightWC,e._rightWC)),(o||s||u||d||p)&&jSe(e)}function HSe(e,t){let n;return D.equalsEpsilon(Math.abs(e.z),1,D.EPSILON3)?n=Math.atan2(t.y,t.x)-D.PI_OVER_TWO:n=Math.atan2(e.y,e.x)-D.PI_OVER_TWO,D.TWO_PI-D.zeroToTwoPi(n)}function GSe(e){return D.PI_OVER_TWO-D.acosClamped(e.z)}function WSe(e,t,n){let i=0;return D.equalsEpsilon(Math.abs(e.z),1,D.EPSILON3)||(i=Math.atan2(-n.z,t.z),i=D.zeroToTwoPi(i+D.TWO_PI)),i}var IG=new L,PG=new L;Object.defineProperties(on.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return _l(this),this._invTransform}},viewMatrix:{get:function(){return _l(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return _l(this),this._invViewMatrix}},positionCartographic:{get:function(){return _l(this),this._positionCartographic}},positionWC:{get:function(){return _l(this),this._positionWC}},directionWC:{get:function(){return _l(this),this._directionWC}},upWC:{get:function(){return _l(this),this._upWC}},rightWC:{get:function(){return _l(this),this._rightWC}},heading:{get:function(){if(this._mode!==re.MORPHING){let e=this._projection.ellipsoid,t=L.clone(this._transform,IG),n=mt.eastNorthUpToFixedFrame(this.positionWC,e,PG);this._setTransform(n);let i=HSe(this.direction,this.up);return this._setTransform(t),i}}},pitch:{get:function(){if(this._mode!==re.MORPHING){let e=this._projection.ellipsoid,t=L.clone(this._transform,IG),n=mt.eastNorthUpToFixedFrame(this.positionWC,e,PG);this._setTransform(n);let i=GSe(this.direction);return this._setTransform(t),i}}},roll:{get:function(){if(this._mode!==re.MORPHING){let e=this._projection.ellipsoid,t=L.clone(this._transform,IG),n=mt.eastNorthUpToFixedFrame(this.positionWC,e,PG);this._setTransform(n);let i=WSe(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}}});on.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&&KSe(this,this.position)};var Ext=new h,Sxt=new h,wxt=new h;on.prototype._setTransform=function(e){let t=h.clone(this.positionWC,Ext),n=h.clone(this.upWC,Sxt),i=h.clone(this.directionWC,wxt);L.clone(e,this._transform),this._transformChanged=!0,_l(this);let r=this._actualInvTransform;L.multiplyByPoint(r,t,this.position),L.multiplyByPointAsVector(r,i,this.direction),L.multiplyByPointAsVector(r,n,this.up),h.cross(this.direction,this.up,this.right),_l(this)};var Ixt=new z,Pxt=new dn,Dxt=new h,Rxt=new h;function qSe(e){if(!L.equals(L.IDENTITY,e.transform))return h.magnitude(e.position);let t=e._scene,n=t.globe,i=Ixt;i.x=t.drawingBufferWidth/t.pixelRatio/2,i.y=t.drawingBufferHeight/t.pixelRatio/2;let r;if(l(n)){let s=e.getPickRay(i,Pxt);r=n.pickWorldCoordinates(s,t,!0,Dxt)}let o;t.pickPositionSupported&&(o=t.pickPositionWorldCoordinates(i,Rxt));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}on.prototype._adjustOrthographicFrustum=function(e){this.frustum instanceof mn&&(!e&&this._positionCartographic.height<15e4||(this.frustum.width=qSe(this)))};var DG=new h,hte=new L,Oxt=new L,mte=new Fe,pte=new $,YSe=new de;function Mxt(e,t,n){let i=L.clone(e.transform,hte),r=mt.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,Oxt);e._setTransform(r),h.clone(h.ZERO,e.position),n.heading=n.heading-D.PI_OVER_TWO;let o=Fe.fromHeadingPitchRoll(n,mte),a=$.fromQuaternion(o,pte);$.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 Lxt(e,t,n,i){let r=L.clone(e.transform,hte);if(e._setTransform(L.IDENTITY),!h.equals(t,e.positionWC)){if(i){let s=e._projection,c=s.ellipsoid.cartesianToCartographic(t,YSe);t=s.project(c,DG)}h.clone(t,e.position)}n.heading=n.heading-D.PI_OVER_TWO;let o=Fe.fromHeadingPitchRoll(n,mte),a=$.fromQuaternion(o,pte);$.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 Nxt(e,t,n,i){let r=L.clone(e.transform,hte);if(e._setTransform(L.IDENTITY),!h.equals(t,e.positionWC)){if(i){let c=e._projection,u=c.ellipsoid.cartesianToCartographic(t,YSe);t=c.project(u,DG)}z.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===au.ROTATE){n.heading=n.heading-D.PI_OVER_TWO,n.pitch=-D.PI_OVER_TWO,n.roll=0;let o=Fe.fromHeadingPitchRoll(n,mte),a=$.fromQuaternion(o,pte);$.getColumn(a,2,e.up),h.cross(e.direction,e.up,e.right)}e._setTransform(r)}var Fxt=new h,Bxt=new h,kxt=new h;function XSe(e,t,n,i){let r=h.clone(n.direction,Fxt),o=h.clone(n.up,Bxt);if(e._scene.mode===re.SCENE3D){let s=e._projection.ellipsoid,c=mt.eastNorthUpToFixedFrame(t,s,IG),u=L.inverseTransformation(c,PG);L.multiplyByPointAsVector(u,r,r),L.multiplyByPointAsVector(u,o,o)}let a=h.cross(r,o,kxt);return i.heading=HSe(r,o),i.pitch=GSe(r),i.roll=WSe(r,o,a),i}var dte={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},Ow=new Tc;on.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,DG);l(r)&&l(r.west)&&(r=this.getRectangleCameraCoordinates(r,DG),i=!1),l(t.direction)&&(t=XSe(this,r,t,dte.orientation)),Ow.heading=t.heading??0,Ow.pitch=t.pitch??-D.PI_OVER_TWO,Ow.roll=t.roll??0,n===re.SCENE3D?Mxt(this,r,Ow):n===re.SCENE2D?Nxt(this,r,Ow,i):Lxt(this,r,Ow,i)};var zxt=new h;on.prototype.flyHome=function(e){let t=this._mode;if(t===re.MORPHING&&this._scene.completeMorph(),t===re.SCENE2D)this.flyTo({destination:on.DEFAULT_VIEW_RECTANGLE,duration:e,endTransform:L.IDENTITY});else if(t===re.SCENE3D){let n=this.getRectangleCameraCoordinates(on.DEFAULT_VIEW_RECTANGLE),i=h.magnitude(n);i+=i*on.DEFAULT_VIEW_FACTOR,h.normalize(n,n),h.multiplyByScalar(n,i,n),this.flyTo({destination:n,duration:e,endTransform:L.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,zxt).z),roll:0},endTransform:L.IDENTITY,convert:!1})}};on.prototype.worldToCameraCoordinates=function(e,t){return l(t)||(t=new ae),_l(this),L.multiplyByVector(this._actualInvTransform,e,t)};on.prototype.worldToCameraCoordinatesPoint=function(e,t){return l(t)||(t=new h),_l(this),L.multiplyByPoint(this._actualInvTransform,e,t)};on.prototype.worldToCameraCoordinatesVector=function(e,t){return l(t)||(t=new h),_l(this),L.multiplyByPointAsVector(this._actualInvTransform,e,t)};on.prototype.cameraToWorldCoordinates=function(e,t){return l(t)||(t=new ae),_l(this),L.multiplyByVector(this._actualTransform,e,t)};on.prototype.cameraToWorldCoordinatesPoint=function(e,t){return l(t)||(t=new h),_l(this),L.multiplyByPoint(this._actualTransform,e,t)};on.prototype.cameraToWorldCoordinatesVector=function(e,t){return l(t)||(t=new h),_l(this),L.multiplyByPointAsVector(this._actualTransform,e,t)};function KSe(e,t){let n=e._scene.mapMode2D===au.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 OSe=new h;on.prototype.move=function(e,t){let n=this.position;h.multiplyByScalar(e,t,OSe),h.add(n,OSe,n),this._mode===re.SCENE2D&&KSe(this,n),this._adjustOrthographicFrustum(!0)};on.prototype.moveForward=function(e){e=e??this.defaultMoveAmount,this._mode===re.SCENE2D?RG(this,e):this.move(this.direction,e)};on.prototype.moveBackward=function(e){e=e??this.defaultMoveAmount,this._mode===re.SCENE2D?RG(this,-e):this.move(this.direction,-e)};on.prototype.moveUp=function(e){e=e??this.defaultMoveAmount,this.move(this.up,e)};on.prototype.moveDown=function(e){e=e??this.defaultMoveAmount,this.move(this.up,-e)};on.prototype.moveRight=function(e){e=e??this.defaultMoveAmount,this.move(this.right,e)};on.prototype.moveLeft=function(e){e=e??this.defaultMoveAmount,this.move(this.right,-e)};on.prototype.lookLeft=function(e){e=e??this.defaultLookAmount,this._mode!==re.SCENE2D&&this.look(this.up,-e)};on.prototype.lookRight=function(e){e=e??this.defaultLookAmount,this._mode!==re.SCENE2D&&this.look(this.up,e)};on.prototype.lookUp=function(e){e=e??this.defaultLookAmount,this._mode!==re.SCENE2D&&this.look(this.right,-e)};on.prototype.lookDown=function(e){e=e??this.defaultLookAmount,this._mode!==re.SCENE2D&&this.look(this.right,e)};var Uxt=new Fe,Vxt=new $;on.prototype.look=function(e,t){let n=t??this.defaultLookAmount,i=Fe.fromAxisAngle(e,-n,Uxt),r=$.fromQuaternion(i,Vxt),o=this.direction,a=this.up,s=this.right;$.multiplyByVector(r,o,o),$.multiplyByVector(r,a,a),$.multiplyByVector(r,s,s)};on.prototype.twistLeft=function(e){e=e??this.defaultLookAmount,this.look(this.direction,e)};on.prototype.twistRight=function(e){e=e??this.defaultLookAmount,this.look(this.direction,-e)};var jxt=new Fe,Hxt=new $;on.prototype.rotate=function(e,t){let n=t??this.defaultRotateAmount,i=Fe.fromAxisAngle(e,-n,jxt),r=$.fromQuaternion(i,Hxt);$.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)};on.prototype.rotateDown=function(e){e=e??this.defaultRotateAmount,$Se(this,e)};on.prototype.rotateUp=function(e){e=e??this.defaultRotateAmount,$Se(this,-e)};var Gxt=new h,Wxt=new h,qxt=new h,MSe=new h;function $Se(e,t){let n=e.position;if(l(e.constrainedAxis)&&!h.equalsEpsilon(e.position,h.ZERO,D.EPSILON2)){let i=h.normalize(n,Gxt),r=h.equalsEpsilon(i,e.constrainedAxis,D.EPSILON2),o=h.equalsEpsilon(i,h.negate(e.constrainedAxis,MSe),D.EPSILON2);if(!r&&!o){let a=h.normalize(e.constrainedAxis,Wxt),s=h.dot(i,a),c=D.acosClamped(s);t>0&&t>c&&(t=c-D.EPSILON4),s=h.dot(i,h.negate(a,MSe)),c=D.acosClamped(s),t<0&&-t>c&&(t=-c+D.EPSILON4);let u=h.cross(a,i,qxt);e.rotate(u,t)}else(r&&t<0||o&&t>0)&&e.rotate(e.right,t)}else e.rotate(e.right,t)}on.prototype.rotateRight=function(e){e=e??this.defaultRotateAmount,JSe(this,-e)};on.prototype.rotateLeft=function(e){e=e??this.defaultRotateAmount,JSe(this,e)};function JSe(e,t){l(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function RG(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===au.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===au.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 ZSe(e,t){e.move(e.direction,t)}on.prototype.zoomIn=function(e){e=e??this.defaultZoomAmount,this._mode===re.SCENE2D?RG(this,e):ZSe(this,e)};on.prototype.zoomOut=function(e){e=e??this.defaultZoomAmount,this._mode===re.SCENE2D?RG(this,-e):ZSe(this,-e)};on.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 Yxt=new L;on.prototype.lookAt=function(e,t){let i=this._scene.ellipsoid??te.default,r=mt.eastNorthUpToFixedFrame(e,i,Yxt);this.lookAtTransform(r,t)};var Xxt=new h,Kxt=new Fe,$xt=new Fe,Jxt=new $;function QSe(e,t,n,i){t=D.clamp(t,-D.PI_OVER_TWO,D.PI_OVER_TWO),e=D.zeroToTwoPi(e)-D.PI_OVER_TWO;let r=Fe.fromAxisAngle(h.UNIT_Y,-t,Kxt),o=Fe.fromAxisAngle(h.UNIT_Z,-e,$xt),a=Fe.multiply(o,r,o),s=$.fromQuaternion(a,Jxt),c=h.clone(h.UNIT_X,i);return $.multiplyByVector(s,c,c),h.negate(c,c),h.multiplyByScalar(c,n,c),c}on.prototype.lookAtTransform=function(e,t){if(this._setTransform(e),!l(t))return;let n;if(l(t.heading)?n=QSe(t.heading,t.pitch,t.range,Xxt):n=t,this._mode===re.SCENE2D){z.clone(z.ZERO,this.position),h.negate(n,this.up),this.up.z=0,h.magnitudeSquared(this.up)<D.EPSILON10&&h.clone(h.UNIT_Y,this.up),h.normalize(this.up,this.up),this._setTransform(L.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)<D.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 Zxt=new L,LSe=new h,Qxt=new h,NSe=new h;on.prototype.lookAtWorldPosition=function(e,t=te.default){let n=L.clone(this._transform,Zxt);this._setTransform(L.IDENTITY);let i=h.subtract(e,this.positionWC,LSe);h.magnitudeSquared(i)<D.EPSILON8&&(i=h.clone(this.directionWC,LSe)),i=h.normalize(i,this.direction);let r=t.geodeticSurfaceNormal(e,Qxt),o=h.cross(i,r,NSe);h.magnitudeSquared(o)<D.EPSILON8&&(o=h.clone(this.rightWC,NSe)),h.normalize(o,this.right);let a=h.cross(o,i,this.up);h.normalize(a,this.up),this._setTransform(n)};var d3=new de,eTt=new de,tTt=new h,nTt=new h,iTt=new h,rTt=new h,oTt=new h,aTt=new h,sTt=new h,lte=new h,cTt={direction:new h,right:new h,up:new h},FSe;function gl(e,t,n,i){return Math.abs(h.dot(t,n))/i-h.dot(e,n)}function ewe(e,t,n,i){let r=e._projection.ellipsoid,o=i?e:cTt,{north:a,south:s,west:c}=t,{east:u}=t;c>u&&(u+=D.TWO_PI);let f=(c+u)*.5,d;if(s<-D.PI_OVER_TWO+D.RADIANS_PER_DEGREE&&a>D.PI_OVER_TWO-D.RADIANS_PER_DEGREE)d=0;else{let O=d3;O.longitude=f,O.latitude=a,O.height=0;let N=eTt;N.longitude=f,N.latitude=s,N.height=0;let _=FSe;(!l(_)||_.ellipsoid!==r)&&(FSe=_=new ig(void 0,void 0,r)),_.setEndPoints(O,N),d=_.interpolateUsingFraction(.5,d3).latitude}let p=d3;p.longitude=f,p.latitude=d,p.height=0;let g=r.cartographicToCartesian(p,sTt),m=d3;m.longitude=u,m.latitude=a;let y=r.cartographicToCartesian(m,tTt);m.longitude=c;let A=r.cartographicToCartesian(m,iTt);m.longitude=f;let b=r.cartographicToCartesian(m,oTt);m.latitude=s;let x=r.cartographicToCartesian(m,aTt);m.longitude=u;let T=r.cartographicToCartesian(m,rTt);m.longitude=c;let C=r.cartographicToCartesian(m,nTt);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 P=h.cross(w,E,o.up),R;if(e.frustum instanceof mn){let O=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,I=S.right/S.top,M=N*I;O>M?(_=O,v=_/I):(v=N,_=M),R=Math.max(_,v)}else{let O=Math.tan(e.frustum.fovy*.5),N=e.frustum.aspectRatio*O;if(R=Math.max(gl(E,P,A,O),gl(E,P,T,O),gl(E,P,y,O),gl(E,P,C,O),gl(E,P,b,O),gl(E,P,x,O),gl(E,w,A,N),gl(E,w,T,N),gl(E,w,y,N),gl(E,w,C,N),gl(E,w,b,N),gl(E,w,x,N)),s<0&&a>0){let _=d3;_.longitude=c,_.latitude=0,_.height=0;let v=r.cartographicToCartesian(_,lte);h.subtract(v,g,v),R=Math.max(R,gl(E,P,v,O),gl(E,w,v,N)),_.longitude=u,v=r.cartographicToCartesian(_,lte),h.subtract(v,g,v),R=Math.max(R,gl(E,P,v,O),gl(E,w,v,N))}}return h.add(g,h.multiplyByScalar(E,-R,lte),n)}var lTt=new de,uTt=new h,fTt=new h;function dTt(e,t,n){let i=e._projection;t.west>t.east&&(t=ie.MAX_VALUE);let r=e._actualTransform,o=e._actualInvTransform,a=lTt;a.longitude=t.east,a.latitude=t.north;let s=i.project(a,uTt);L.multiplyByPoint(r,s,s),L.multiplyByPoint(o,s,s),a.longitude=t.west,a.latitude=t.south;let c=i.project(a,fTt);if(L.multiplyByPoint(r,c,c),L.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 hTt=new de,mTt=new h,pTt=new h;function gTt(e,t,n){let i=e._projection,r=t.east;t.west>t.east&&(e._scene.mapMode2D===au.INFINITE_SCROLL?r+=D.TWO_PI:(t=ie.MAX_VALUE,r=t.east));let o=hTt;o.longitude=r,o.latitude=t.north;let a=i.project(o,mTt);o.longitude=t.west,o.latitude=t.south;let s=i.project(o,pTt),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}on.prototype.getRectangleCameraCoordinates=function(e,t){let n=this._mode;if(l(t)||(t=new h),n===re.SCENE3D)return ewe(this,e,t);if(n===re.COLUMBUS_VIEW)return dTt(this,e,t);if(n===re.SCENE2D)return gTt(this,e,t)};var _Tt=new dn;function yTt(e,t,n,i){n=n??te.default;let r=e.getPickRay(t,_Tt),o=ci.rayEllipsoid(r,n);if(!o)return;let a=o.start>0?o.start:o.stop;return dn.getPoint(r,a,i)}var ATt=new dn;function bTt(e,t,n,i){let o=e.getPickRay(t,ATt).origin;o=h.fromElements(o.y,o.z,0,o);let a=n.unproject(o);if(!(a.latitude<-D.PI_OVER_TWO||a.latitude>D.PI_OVER_TWO))return n.ellipsoid.cartographicToCartesian(a,i)}var xTt=new dn;function TTt(e,t,n,i){let r=e.getPickRay(t,xTt),o=-r.origin.x/r.direction.x;dn.getPoint(r,o,i);let a=n.unproject(new h(i.y,i.z,0));if(!(a.latitude<-D.PI_OVER_TWO||a.latitude>D.PI_OVER_TWO||a.longitude<-Math.PI||a.longitude>Math.PI))return n.ellipsoid.cartographicToCartesian(a,i)}on.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=yTt(this,e,t,n);else if(this._mode===re.SCENE2D)n=bTt(this,e,this._projection,n);else if(this._mode===re.COLUMBUS_VIEW)n=TTt(this,e,this._projection,n);else return;return n}};var CTt=new h,vTt=new h,ETt=new h;function STt(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,CTt);h.add(d,p,p);let g=h.multiplyByScalar(e.rightWC,u*c*s,vTt),m=h.multiplyByScalar(e.upWC,f*c*a,ETt),y=h.add(p,g,n.direction);return h.add(y,m,y),h.subtract(y,d,y),h.normalize(y,y),n}var SG=new h;function wTt(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,SG),h.add(SG,f,f),h.multiplyByScalar(e.upWC,u,SG),h.add(SG,f,f),h.clone(e.directionWC,n.direction),e._mode===re.SCENE2D&&e._scene.mapMode2D===au.INFINITE_SCROLL){let d=e._maxCoord.x;f.y=D.mod(f.y+d,2*d)-d}return n}on.prototype.getPickRay=function(e,t){l(t)||(t=new dn);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)?STt(this,e,t):wTt(this,e,t)};var ITt=new h,PTt=new h;on.prototype.distanceToBoundingSphere=function(e){let t=h.subtract(this.positionWC,e.center,ITt),n=h.multiplyByScalar(this.directionWC,h.dot(t,this.directionWC),PTt);return Math.max(0,h.magnitude(n)-e.radius)};var DTt=new z;on.prototype.getPixelSize=function(e,t,n){let i=this.distanceToBoundingSphere(e),r=this.frustum.getPixelDimensions(t,n,i,this._scene.pixelRatio,DTt);return Math.max(r.x,r.y)};function RTt(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:fa.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:o,update:s}}var OTt=new h,BSe=new h,MTt=new h,LTt=new h;function NTt(e,t){let n=e.position,i=e.direction,r=e.worldToCameraCoordinatesVector(h.UNIT_X,OTt),o=-h.dot(r,n)/h.dot(r,i),a=h.add(n,h.multiplyByScalar(i,o,BSe),BSe);e.cameraToWorldCoordinatesPoint(a,a),n=e.cameraToWorldCoordinatesPoint(e.position,MTt);let s=Math.tan(e.frustum.fovy*.5),c=e.frustum.aspectRatio*s,u=h.magnitude(h.subtract(n,a,LTt)),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 RTt(e,n,a,m,y,t)}}on.prototype.createCorrectPositionTween=function(e){if(this._mode===re.COLUMBUS_VIEW)return NTt(this,e)};var FTt=new h,Gs={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};on.prototype.cancelFlight=function(){l(this._currentFlight)&&(this._currentFlight.cancelTween(),this._currentFlight=void 0)};on.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=Gs.destination,e.orientation.heading=Gs.heading,e.orientation.pitch=Gs.pitch,e.orientation.roll=Gs.roll,this.setView(e),l(this._currentFlight.complete)&&this._currentFlight.complete(),this._currentFlight=void 0}};on.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,FTt));let r=e.orientation??H.EMPTY_OBJECT;if(l(r.direction)&&(r=XSe(this,t,r,dte.orientation)),l(e.duration)&&e.duration<=0){let f=dte;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;Gs.destination=t,Gs.heading=r.heading,Gs.pitch=r.pitch,Gs.roll=r.roll,Gs.duration=e.duration,Gs.complete=function(){a===o._currentFlight&&(o._currentFlight=void 0),l(e.complete)&&e.complete()},Gs.cancel=e.cancel,Gs.endTransform=e.endTransform,Gs.convert=i?!1:e.convert,Gs.maximumHeight=e.maximumHeight,Gs.pitchAdjustHeight=e.pitchAdjustHeight,Gs.flyOverLongitude=e.flyOverLongitude,Gs.flyOverLongitudeWeight=e.flyOverLongitudeWeight,Gs.easingFunction=e.easingFunction;let s=this._scene,c=f3.createTween(s,Gs);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=on.clone(this)),u.setView({destination:t,orientation:r}),this._scene.preloadFlightCullingVolume=u.frustum.computeCullingVolume(u.positionWC,u.directionWC,u.upWC))};function BTt(e,t){let n=e.frustum,i=Math.tan(n.fovy*.5),r=n.aspectRatio*i;return Math.max(t/r,t/i)}function kTt(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 zTt=100;function twe(e,t,n){n=Rd.clone(l(n)?n:on.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=zTt:e.frustum instanceof mn||e._mode===re.SCENE2D?n.range=kTt(e,a):n.range=BTt(e,a),n.range=D.clamp(n.range,i,r)}return n}on.prototype.viewBoundingSphere=function(e,t){t=twe(this,e,t),this.lookAt(e.center,t)};var UTt=new L,kSe=new h,VTt=new h,jTt=new h,HTt=new h,GTt=new ae,WTt=new Fe,qTt=new $;on.prototype.flyToBoundingSphere=function(e,t){t=t??H.EMPTY_OBJECT;let n=this._mode===re.SCENE2D||this._mode===re.COLUMBUS_VIEW;this._setTransform(L.IDENTITY);let i=twe(this,e,t.offset),r;n?r=h.multiplyByScalar(h.UNIT_Z,i.range,kSe):r=QSe(i.heading,i.pitch,i.range,kSe);let a=this._scene.ellipsoid??te.default,s=mt.eastNorthUpToFixedFrame(e.center,a,UTt);L.multiplyByPoint(s,r,r);let c,u;if(!n){if(c=h.subtract(e.center,r,VTt),h.normalize(c,c),u=L.multiplyByPointAsVector(s,h.UNIT_Z,jTt),1-Math.abs(h.dot(c,u))<D.EPSILON6){let d=Fe.fromAxisAngle(c,i.heading,WTt),p=$.fromQuaternion(d,qTt);h.fromCartesian4(L.getColumn(s,1,GTt),u),$.multiplyByVector(p,u,u)}let f=h.cross(c,u,HTt);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 zSe=new h,USe=new h,ute=new h,VSe=new h,h3=[new h,new h,new h,new h];function YTt(e,t){let n=t.radii,i=e.positionWC,r=h.multiplyComponents(t.oneOverRadii,i,zSe),o=h.magnitude(r),a=h.normalize(r,USe),s,c;h.equalsEpsilon(a,h.UNIT_Z,D.EPSILON10)?(s=new h(0,1,0),c=new h(0,0,1)):(s=h.normalize(h.cross(h.UNIT_Z,a,ute),ute),c=h.normalize(h.cross(a,s,VSe),VSe));let u=Math.sqrt(h.magnitudeSquared(r)-1),f=h.multiplyByScalar(a,1/o,zSe),d=u/o,p=h.multiplyByScalar(s,d,USe),g=h.multiplyByScalar(c,d,ute),m=h.add(f,g,h3[0]);h.subtract(m,p,m),h.multiplyComponents(n,m,m);let y=h.subtract(f,g,h3[1]);h.subtract(y,p,y),h.multiplyComponents(n,y,y);let A=h.subtract(f,g,h3[2]);h.add(A,p,A),h.multiplyComponents(n,A,A);let b=h.add(f,g,h3[3]);return h.add(b,p,b),h.multiplyComponents(n,b,b),h3}var fte=new z,XTt=new h,kA=[new de,new de,new de,new de];function wG(e,t,n,i,r,o){fte.x=e,fte.y=t;let a=i.pickEllipsoid(fte,r,XTt);return l(a)?(kA[n]=r.cartesianToCartographic(a,kA[n]),1):(kA[n]=r.cartesianToCartographic(o[n],kA[n]),0)}on.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=YTt(this,e);if(c+=wG(0,0,0,this,e,u),c+=wG(0,s,1,this,e,u),c+=wG(a,s,2,this,e,u),c+=wG(a,0,3,this,e,u),c<2)return ie.MAX_VALUE;t=ie.fromCartographicArray(kA,t);let f=0,d=kA[3].longitude;for(let p=0;p<4;++p){let g=kA[p].longitude,m=Math.abs(g-d);m>D.PI?f+=D.TWO_PI-m:f+=m,d=g}return D.equalsEpsilon(Math.abs(f),D.TWO_PI,D.EPSILON9)&&(t.west=-D.PI,t.east=D.PI,kA[0].latitude>=0?t.north=D.PI_OVER_TWO:t.south=-D.PI_OVER_TWO),t};on.prototype.switchToPerspectiveFrustum=function(){if(this._mode===re.SCENE2D||this.frustum instanceof Gi)return;let e=this._scene;this.frustum=new Gi,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=D.toRadians(60)};on.prototype.switchToOrthographicFrustum=function(){if(this._mode===re.SCENE2D||this.frustum instanceof mn)return;let e=qSe(this),t=this._scene;this.frustum=new mn,this.frustum.aspectRatio=t.drawingBufferWidth/t.drawingBufferHeight,this.frustum.width=e};on.clone=function(e,t){return l(t)||(t=new on(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),L.clone(e._transform,t.transform),t._transformChanged=!0,t.frustum=e.frustum.clone(),t};var vr=on;function KTt(e){this.pass=e.pass,this.commandList=e.commandList,this.camera=e.camera,this.cullingVolume=e.cullingVolume,this.ready=!1}var lh=KTt;var gte=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))}},m3=gte;var awe=Go(af(),1),nwe=576,$Tt=100,p3="#ffffff",OG="#48b";function swe(e,t){this.credit=e,this.count=t??1}function JTt(e,t){let n=e.length;for(let i=0;i<n;i++){let r=e[i];if(St.equals(r,t))return!0}return!1}function ZTt(e){let t=e._previousCesiumCredit,n=e._currentCesiumCredit;St.equals(n,t)||(l(t)&&e._cesiumCreditContainer.removeChild(t.element),l(n)&&e._cesiumCreditContainer.appendChild(n.element),e._previousCesiumCredit=n)}var cwe="cesium-credit-delimiter";function iwe(e){let t=document.createElement("span");return t.textContent=e,t.className=cwe,t}function rwe(e,t){if(l(t)){let n=document.createElement(t);n._creditId=e._creditId,n.appendChild(e),e=n}return e}function owe(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(iwe(n));else{let f=r[u];f.className!==cwe&&e.replaceChild(iwe(n),f)}}let c=s.element;if(r.length<=o)e.appendChild(rwe(c,i));else{let u=r[o];u._creditId!==s._id&&e.replaceChild(rwe(c,i),u)}}}for(++o;o<r.length;)e.removeChild(r[o])}function QTt(e){let t=e._lightboxCredits,n=e.viewport.clientWidth,i=e.viewport.clientHeight;n!==e._lastViewportWidth&&(n<nwe?(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>=nwe&&i!==e._lastViewportHeight&&(t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`,e._lastViewportHeight=i)}function eCt(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: ${p3};
position: relative;
min-height: ${$Tt}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: ${p3};
}
.cesium-credit-lightbox > ul > li a:hover {
color: ${OG};
}
.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: ${p3};
}
.cesium-credit-lightbox-close:hover {
color: ${OG};
}
.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: ${p3};
}
.cesium-credit-expand-link:hover {
color: ${OG};
}
.cesium-credit-text {
color: ${p3};
}
.cesium-credit-delimiter {
padding: 0 5px;
}
.cesium-credit-textContainer *,
.cesium-credit-logoContainer * {
display: inline;
}
.cesium-credit-textContainer a:hover {
color: ${OG}
}
.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 Vo(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="&times;",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),eCt(e);let g=St.clone(Vo.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 kt,lightboxCredits:new kt},this._defaultCredit=void 0,this.viewport=n,this.container=e}function lwe(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 swe(n,i),o.push(r)),++e._creditDisplayElementPoolIndex,t.set(n.id,r)}}Vo.prototype.addCreditToNextFrame=function(e){if(e.isIon()){l(this._defaultCredit)||(this._defaultCredit=St.clone(uwe())),this._currentCesiumCredit=this._defaultCredit;return}let t;e.showOnScreen?t=this._currentFrameCredits.screenCredits:t=this._currentFrameCredits.lightboxCredits,lwe(this,t,e)};Vo.prototype.addStaticCredit=function(e){let t=this._staticCredits;JTt(t,e)||t.push(e)};Vo.prototype.removeStaticCredit=function(e){let t=this._staticCredits,n=t.indexOf(e);n!==-1&&t.splice(n,1)};Vo.prototype.showLightbox=function(){this._lightbox.style.display="block",this._expanded=!0};Vo.prototype.hideLightbox=function(){this._lightbox.style.display="none",this._expanded=!1};Vo.prototype.update=function(){this._expanded&&QTt(this)};Vo.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()&&St.equals(Vo.cesiumCredit,this._cesiumCredit)||lwe(this,a,o,Number.MAX_VALUE)}St.equals(Vo.cesiumCredit,this._cesiumCredit)||(this._cesiumCredit=St.clone(Vo.cesiumCredit)),this._currentCesiumCredit=this._cesiumCredit};Vo.prototype.endFrame=function(){let e=this._currentFrameCredits.screenCredits.values;owe(this._screenContainer,e,this._delimiter,void 0);let t=this._currentFrameCredits.lightboxCredits.values;this._expandLink.style.display=t.length>0?"inline":"none",owe(this._creditList,t,void 0,"li"),ZTt(this)};Vo.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)};Vo.prototype.isDestroyed=function(){return!1};Vo._cesiumCredit=void 0;Vo._cesiumCreditInitialized=!1;var MG;function uwe(){if(!l(MG)){let e=$t("Assets/Images/ion-credit.png");e.indexOf("http://")!==0&&e.indexOf("https://")!==0&&e.indexOf("data:")!==0&&(e=new awe.default(e).path()),MG=new St(`<a href="https://cesium.com/" target="_blank"><img src="${e}" style="vertical-align: -7px" title="Cesium ion"/></a>`,!0)}return Vo._cesiumCreditInitialized||(Vo._cesiumCredit=MG,Vo._cesiumCreditInitialized=!0),MG}Object.defineProperties(Vo,{cesiumCredit:{get:function(){return uwe(),Vo._cesiumCredit},set:function(e){Vo._cesiumCredit=e,Vo._cesiumCreditInitialized=!0}}});Vo.CreditDisplayElement=swe;var g3=Vo;function LG(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 tCt=new h,nCt=new $,iCt=new Fe,rCt=new Gi,oCt=new Fl,aCt=new mn,sCt=new da,cCt=new U,lCt=[1,1e5];LG.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 Gi?s=rCt:a instanceof Fl?s=oCt:a instanceof mn?s=aCt:s=sCt,s=a.clone(s);let c,u=this._frustumSplits;!l(u)||u.length<=1?(u=lCt,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,tCt);let m=nCt;$.setColumn(m,0,g,m),$.setColumn(m,1,p,m),$.setColumn(m,2,d,m);let y=Fe.fromRotationMatrix(m,iCt);for(t.length=n.length=c,i=0;i<c;++i)s.near=u[i],s.far=u[i+1],t[i]=new Nn({geometryInstances:new Nt({geometry:new sx({origin:f,orientation:y,frustum:s,_drawNearPlane:i===0}),attributes:{color:Kt.fromColor(U.fromAlpha(this._color,.1,cCt))},id:this.id,pickPrimitive:this}),appearance:new gn({translucent:!0,flat:!0}),asynchronous:!1}),n[i]=new Nn({geometryInstances:new Nt({geometry:new XD({origin:f,orientation:y,frustum:s,_drawNearPlane:i===0}),attributes:{color:Kt.fromColor(this._color)},id:this.id,pickPrimitive:this}),appearance:new gn({translucent:!1,flat:!0}),asynchronous:!1})}for(r=t.length,i=0;i<r;++i)n[i].update(e),t[i].update(e)};LG.prototype.isDestroyed=function(){return!1};LG.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 a0=LG;var _3=`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 y3=`in vec4 position;
out vec4 positionEC;
void main()
{
positionEC = czm_modelView * position;
gl_Position = czm_projection * positionEC;
czm_vertexLogDepth();
}
`;function b3(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 A3=fn.supportsTypedArrays()?new Float32Array(12):[],fwe=new h,dwe=new h,_te=new h,hwe=new h,NG=new h;function uCt(e,t){let n=e.radii,i=t.camera,r,o,a;if(i.frustum instanceof mn)r=h.ZERO,o=i.rightWC,a=i.upWC;else{let d=i.positionWC,p=h.multiplyComponents(e.oneOverRadii,d,fwe),g=h.normalize(p,dwe),m=h.normalize(h.cross(h.UNIT_Z,p,_te),_te),y=h.normalize(h.cross(g,m,hwe),hwe),A=h.magnitude(p),b=Math.sqrt(A*A-1);r=h.multiplyByScalar(g,1/A,fwe);let x=b/A;o=h.multiplyByScalar(m,x,dwe),a=h.multiplyByScalar(y,x,_te)}let s=h.add(r,a,NG);h.subtract(s,o,s),h.multiplyComponents(n,s,s),h.pack(s,A3,0);let c=h.subtract(r,a,NG);h.subtract(c,o,c),h.multiplyComponents(n,c,c),h.pack(c,A3,3);let u=h.add(r,a,NG);h.add(u,o,u),h.multiplyComponents(n,u,u),h.pack(u,A3,6);let f=h.subtract(r,a,NG);return h.add(f,o,f),h.multiplyComponents(n,f,f),h.pack(f,A3,9),A3}b3.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:[y3]}),s=new Ge({sources:[_3]});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=uCt(i,e);if(l(this._va))this._va.getAttribute(0).vertexBuffer.copyFromArrayView(o);else{let a=new xt({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}};b3.prototype.execute=function(e,t){this._mode===re.SCENE3D&&this._command.execute(e,t)};b3.prototype.isDestroyed=function(){return!1};b3.prototype.destroy=function(){this._sp=this._sp&&this._sp.destroy(),this._va=this._va&&this._va.destroy()};var x3=b3;function rC(){}var fCt=/\bgl_FragDepth\b/,dCt=/\bdiscard\b/;function hCt(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(fCt.test(o[s])||dCt.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 mCt(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}rC.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=hCt(n,t.shaderProgram),i.depthOnlyCommand.renderState=mCt(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.depthOnlyCommand.shaderProgram=r,i.depthOnlyCommand.renderState=o),i};var pCt=/\s+czm_writeLogDepth\(/,gCt=/\s+czm_vertexLogDepth\(/;function _Ct(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(gCt.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)pCt.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})}rC.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=_Ct(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};function yCt(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 yte(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}rC.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=yCt(n,t.shaderProgram,t.pickId),i.pickCommand.renderState=yte(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.pickCommand.shaderProgram=r,i.pickCommand.renderState=o),i};var ACt=`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 bCt(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=`${ACt}
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})}rC.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=bCt(n,t.shaderProgram,t.snapId),i.snapCommand.renderState=yte(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.snapCommand.shaderProgram=r,i.snapCommand.renderState=o),i};function Mw(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 xCt(e){return e.isArray?e.arrayLength:gt.getComponentCount(e.type)}function mwe(e,t,n){return`((${e} - float(${t})) / float(${n}))`}function pwe(e,t){let n=Mt.getMaximum(t);return`(${e}) / float(${n})`}function TCt(e,t){let n="float(value)";if(t.hasValueTransform){let i=t.offset,r=t.scale;n=mwe(n,i,r)}return e.normalized||(n=pwe(n,e.componentType)),n}function CCt(e,t,n){let r=`float(${`value.${n}`})`;if(t.hasValueTransform){let o=t.offset[n],a=t.scale[n];r=mwe(r,o,a)}return e.normalized||(r=pwe(r,e.componentType)),r}function vCt(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=xCt(u);if(p===1)d[0]=TCt(u,c);else{let A=["x","y","z","w"];for(let b=0;b<p;b++)d[b]=CCt(u,c,A[b])}let g=t.fragmentShaderSource.defines.slice();g.push(Ff.METADATA_PICKING_ENABLED),Mw(g,Ff.METADATA_PICKING_VALUE_TYPE,f),Mw(g,Ff.METADATA_PICKING_VALUE_STRING,`metadata.${o}`),Mw(g,Ff.METADATA_PICKING_VALUE_COMPONENT_X,d[0]),Mw(g,Ff.METADATA_PICKING_VALUE_COMPONENT_Y,d[1]),Mw(g,Ff.METADATA_PICKING_VALUE_COMPONENT_Z,d[2]),Mw(g,Ff.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})}rC.createPickMetadataDerivedCommand=function(e,t,n,i){return l(i)||(i={}),i.pickMetadataCommand=nt.shallowClone(t,i.pickMetadataCommand),i.pickMetadataCommand.shaderProgram=vCt(n,t.shaderProgram,t.pickedMetadataInfo),i.pickMetadataCommand.renderState=yte(e,t.renderState),i.shaderProgramId=t.shaderProgram.id,i};function ECt(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})}rC.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=ECt(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};var Bm=rC;function FG(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=D.toRadians(r),t._beta=D.toRadians(i.beta),t._gamma=D.toRadians(i.gamma)}window.addEventListener("deviceorientation",n,!1),this._removeListener=function(){window.removeEventListener("deviceorientation",n,!1)}}var SCt=new Fe,gwe=new Fe,wCt=new $;function ICt(e,t,n,i){let r=e.direction,o=e.right,a=e.up,s=Fe.fromAxisAngle(r,n,gwe),c=Fe.fromAxisAngle(o,i,SCt),u=Fe.multiply(c,s,c),f=Fe.fromAxisAngle(a,t,gwe);Fe.multiply(f,u,u);let d=$.fromQuaternion(u,wCt);$.multiplyByVector(d,o,o),$.multiplyByVector(d,a,a),$.multiplyByVector(d,r,r)}FG.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;ICt(this._scene.camera,-e,t,n),this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma};FG.prototype.isDestroyed=function(){return!1};FG.prototype.destroy=function(){return this._removeListener(),ue(this)};var T3=FG;function Ate(){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(Ate.prototype,{heightFalloff:{get:function(){return this._heightFalloff},set:function(e){this._heightFalloff=e}}});var PCt=new h;Ate.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,D.EPSILON4),-Math.max(this._heightFalloff,0)),a=h.normalize(n.positionWC,PCt),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 C3=Ate;function DCt(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 v3=DCt;var pc={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},oC=pc.DERIVED_COMMANDS_MAXIMUM_LENGTH,Swe=["opaqueFrontFaceCommand","opaqueBackFaceCommand","depthOnlyFrontFaceCommand","depthOnlyBackFaceCommand","depthOnlyFrontAndBackFaceCommand","translucentFrontFaceCommand","translucentBackFaceCommand","translucentFrontFaceManualDepthTestCommand","translucentBackFaceManualDepthTestCommand","pickFrontFaceCommand","pickBackFaceCommand"];function aC(){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(oC),this._derivedBlendCommandTypes=new Array(oC),this._derivedPickCommandTypes=new Array(oC),this._derivedCommandTypesToUpdate=new Array(oC),this._derivedCommandsLength=0,this._derivedBlendCommandsLength=0,this._derivedPickCommandsLength=0,this._derivedCommandsToUpdateLength=0}Object.defineProperties(aC.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}}});aC.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=_we(t.translucency.enabled,t.translucency.frontFaceAlpha,t.translucency.frontFaceAlphaByDistance,this._frontFaceAlphaByDistance),this._backFaceAlphaByDistance=_we(t.translucency.enabled,t.translucency.backFaceAlpha,t.translucency.backFaceAlphaByDistance,this._backFaceAlphaByDistance),this._frontFaceTranslucent=ywe(t.translucency.enabled,this._frontFaceAlphaByDistance,t),this._backFaceTranslucent=ywe(t.translucency.enabled,this._backFaceAlphaByDistance,t),this._requiresManualDepthTest=LCt(this,e,t),this._sunVisibleThroughGlobe=RCt(this,e),this._environmentVisible=OCt(this,e),this._useDepthPlane=MCt(this,e),this._numberOfTextureUniforms=NCt(this),this._rectangle=ie.clone(t.translucency.rectangle,this._rectangle),FCt(this,e)};function _we(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 ywe(e,t,n){return e&&(n.baseColor.alpha<1||t.nearValue<1||t.farValue<1)}function RCt(e,t){let n=e._frontFaceTranslucent,i=e._backFaceTranslucent;return n&&(t.cameraUnderground||i)}function OCt(e,t){return!t.cameraUnderground||e._frontFaceTranslucent}function MCt(e,t){return!t.cameraUnderground&&!e._frontFaceTranslucent}function LCt(e,t,n){return e._frontFaceTranslucent&&!e._backFaceTranslucent&&!n.depthTestAgainstTerrain&&t.mode!==re.SCENE2D&&t.context.depthTexture}function NCt(e){let t=0;return e._frontFaceTranslucent&&++t,e._requiresManualDepthTest&&++t,t}function FCt(e,t){e._derivedCommandsLength=bte(e,t,!1,!1,e._derivedCommandTypes),e._derivedBlendCommandsLength=bte(e,t,!0,!1,e._derivedBlendCommandTypes),e._derivedPickCommandsLength=bte(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<oC;++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=JCt())}function bte(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?pc.PICK_FRONT_FACE:u?pc.TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:pc.TRANSLUCENT_FRONT_FACE,d=i?pc.PICK_BACK_FACE:u?pc.TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:pc.TRANSLUCENT_BACK_FACE;return t.mode===re.SCENE2D?(r[o++]=pc.DEPTH_ONLY_FRONT_FACE,r[o++]=f,o):(s?(n||(r[o++]=pc.DEPTH_ONLY_FRONT_AND_BACK_FACE),c?(r[o++]=f,r[o++]=d):(r[o++]=d,r[o++]=f)):c?(n||(r[o++]=pc.DEPTH_ONLY_BACK_FACE),r[o++]=pc.OPAQUE_FRONT_FACE,r[o++]=d):(n||(r[o++]=pc.DEPTH_ONLY_FRONT_FACE),r[o++]=pc.OPAQUE_BACK_FACE,r[o++]=f),o)}function uh(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}function Awe(e,t){return e.indexOf(t)>-1}function BCt(e,t){uh(e.defines,"TRANSLUCENT"),uh(t.defines,"TRANSLUCENT")}function kCt(e,t){uh(e.defines,"GROUND_ATMOSPHERE"),uh(t.defines,"GROUND_ATMOSPHERE"),uh(e.defines,"FOG"),uh(t.defines,"FOG"),uh(e.defines,"TRANSLUCENT"),uh(t.defines,"TRANSLUCENT")}function xte(e,t){if(Awe(t.defines,"TILE_LIMIT_RECTANGLE")||Awe(t.defines,"ENABLE_CLIPPING_PLANES"))return;let n=`void main()
{
out_FragColor = vec4(1.0);
}
`;t.sources=[n]}function Tte(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 wwe(e,t){Tte(e,t),uh(e.defines,"GROUND_ATMOSPHERE"),uh(t.defines,"GROUND_ATMOSPHERE"),uh(e.defines,"FOG"),uh(t.defines,"FOG")}function zCt(e,t){Tte(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function UCt(e,t){wwe(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function bwe(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 VCt(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 jCt(e){e.cull.face=zi.BACK,e.cull.enabled=!0}function HCt(e){e.cull.face=zi.FRONT,e.cull.enabled=!0}function GCt(e){e.cull.face=zi.BACK,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function WCt(e){e.cull.face=zi.FRONT,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function qCt(e){e.cull.enabled=!1,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function xwe(e){e.cull.face=zi.BACK,e.cull.enabled=!0,e.depthMask=!1,e.blending=Qt.ALPHA_BLEND}function Twe(e){e.cull.face=zi.FRONT,e.cull.enabled=!0,e.depthMask=!1,e.blending=Qt.ALPHA_BLEND}function YCt(e){e.cull.face=zi.BACK,e.cull.enabled=!0,e.blending.enabled=!1}function XCt(e){e.cull.face=zi.FRONT,e.cull.enabled=!0,e.blending.enabled=!1}function KCt(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 Lw(e){return{u_classificationTexture:function(){return e._globeTranslucencyFramebuffer.classificationTexture}}}function $Ct(e,t,n,i,r){return l(r)?!i&&l(n)?n:Ot(t,r(e),!1):t}function km(e){this.pass=e.pass,this.pickOnly=e.pickOnly,this.getShaderProgramFunction=e.getShaderProgramFunction,this.getRenderStateFunction=e.getRenderStateFunction,this.getUniformMapFunction=e.getUniformMapFunction,this.renderStateCache={}}function JCt(){return[new km({pass:Pe.GLOBE,pickOnly:!1,getShaderProgramFunction:BCt,getRenderStateFunction:jCt,getUniformMapFunction:void 0}),new km({pass:Pe.GLOBE,pickOnly:!1,getShaderProgramFunction:kCt,getRenderStateFunction:HCt,getUniformMapFunction:void 0}),new km({pass:Pe.GLOBE,pickOnly:!1,getShaderProgramFunction:xte,getRenderStateFunction:GCt,getUniformMapFunction:void 0}),new km({pass:Pe.GLOBE,pickOnly:!1,getShaderProgramFunction:xte,getRenderStateFunction:WCt,getUniformMapFunction:void 0}),new km({pass:Pe.GLOBE,pickOnly:!1,getShaderProgramFunction:xte,getRenderStateFunction:qCt,getUniformMapFunction:void 0}),new km({pass:Pe.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:Tte,getRenderStateFunction:xwe,getUniformMapFunction:Lw}),new km({pass:Pe.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:wwe,getRenderStateFunction:Twe,getUniformMapFunction:Lw}),new km({pass:Pe.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:zCt,getRenderStateFunction:xwe,getUniformMapFunction:Lw}),new km({pass:Pe.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:UCt,getRenderStateFunction:Twe,getUniformMapFunction:Lw}),new km({pass:Pe.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:bwe,getRenderStateFunction:YCt,getUniformMapFunction:Lw}),new km({pass:Pe.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:bwe,getRenderStateFunction:XCt,getUniformMapFunction:Lw})]}var Cwe=new Array(oC),vwe=new Array(oC);aC.prototype.updateDerivedCommands=function(e,t){let n=this._derivedCommandTypesToUpdate,i=this._derivedCommandsToUpdateLength;if(i!==0){for(let r=0;r<i;++r)vwe[r]=this._derivedCommandPacks[n[r]],Cwe[r]=Swe[n[r]];ZCt(this,e,i,n,Cwe,vwe,t)}};function ZCt(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,P;l(C)?(E=C.uniformMap,w=C.shaderProgram,P=C.renderState):(E=void 0,w=void 0,P=void 0),C=nt.shallowClone(t,C),s[T]=C;let R=C.derivedCommands.uniformMapDirtyFrame??0,O=C.derivedCommands.shaderProgramDirtyFrame??0,N=C.derivedCommands.renderStateDirtyFrame??0,_=g||R<f,v=m||O<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=$Ct(e,t.uniformMap,E,_,b.getUniformMapFunction),C.shaderProgram=VCt(a.context,t.shaderProgram,w,v,b.getShaderProgramFunction,T),C.renderState=KCt(t.renderState,P,S,b.getRenderStateFunction,b.renderStateCache)}}}aC.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=Swe[r[s]];n.commandList.push(a[c])}};function Iwe(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 Ewe(e,t,n,i,r){for(let o=0;o<t;++o)n(e[o],i,r)}var QCt=[pc.OPAQUE_FRONT_FACE,pc.OPAQUE_BACK_FACE],evt=[pc.DEPTH_ONLY_FRONT_FACE,pc.DEPTH_ONLY_BACK_FACE,pc.DEPTH_ONLY_FRONT_AND_BACK_FACE];aC.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),Iwe(a,s,t,i,r,QCt))};aC.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)&&Ewe(u,f,t,i,r),!d&&!p)return;this._globeTranslucencyFramebuffer=n;let g=a.globeDepthTexture,m=r.framebuffer;if(r.framebuffer=n.classificationFramebuffer,Iwe(s,c,t,i,r,evt),o.depthTexture){let y=n.packDepth(o,r);a.globeDepthTexture=y}Ewe(u,f,t,i,r),a.globeDepthTexture=g,r.framebuffer=m};var E3=aC;var Yu=`uniform sampler2D colorTexture;
in vec2 v_textureCoordinates;
void main()
{
out_FragColor = texture(colorTexture, v_textureCoordinates);
}
`;function s0(){this._numSamples=1,this.previousFramebuffer=void 0,this._previousFramebuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this._fbo=new oi({depthStencil:!0,createDepthAttachments:!1}),this._fboClassified=new oi({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(s0.prototype,{unclassifiedCommand:{get:function(){return this._unclassifiedCommand}}});s0.isTranslucencySupported=function(e){return e.depthTexture&&e.fragmentDepth};var tvt={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:Qt.ALPHA_BLEND},nvt={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:Qt.ALPHA_BLEND},ivt={depthMask:!0,depthTest:{enabled:!0},stencilTest:qt.setCesium3DTileBit(),stencilMask:qt.CESIUM_3D_TILE_MASK,blending:Qt.ALPHA_BLEND},rvt=`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;
}
`,ovt=`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
}
`;s0.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 Ct({context:e,width:a,height:s,pixelFormat:He.DEPTH_STENCIL,pixelDatatype:ke.UNSIGNED_INT_24_8}),t>1&&(this._depthStencilRenderbuffer=new Tf({context:e,width:a,height:s,format:Hl.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(tvt),this._rsClassified=je.fromCache(nvt),this._rsDefault=je.fromCache(ivt)),!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)?ovt:rvt,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(Yu,{renderState:this._rsUnclassified,uniformMap:this._uniformMap,owner:this}))}};s0.prototype.prepareTextures=function(e,t){this._fbo._numSamples>1&&this._fbo.prepareTextures(e,t)};s0.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))};s0.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)};s0.prototype.executeUnclassified=function(e,t){this._unclassifiedCommand.execute(e,t)};s0.prototype.isDestroyed=function(){return!1};s0.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 Nw=s0;function BG(e){this._total=e,this.usedThisFrame=0,this.stolenFromMeThisFrame=0,this.starvedThisFrame=!1,this.starvedLastFrame=!1}Object.defineProperties(BG.prototype,{total:{get:function(){return this._total}}});function zA(e){let t=new Array(Ic.NUMBER_OF_JOB_TYPES);t[Ic.TEXTURE]=new BG(l(e)?e[Ic.TEXTURE]:10),t[Ic.PROGRAM]=new BG(l(e)?e[Ic.PROGRAM]:10),t[Ic.BUFFER]=new BG(l(e)?e[Ic.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}zA.getTimestamp=yn;Object.defineProperties(zA.prototype,{totalBudget:{get:function(){return this._totalBudget}}});zA.prototype.disableThisFrame=function(){this._totalUsedThisFrame=this._totalBudget};zA.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};zA.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=zA.getTimestamp();e.execute();let s=zA.getTimestamp()-a;return this._totalUsedThisFrame+=s,o?o.stolenFromMeThisFrame+=s:i.usedThisFrame+=s,this._executedThisFrame[t]=!0,!0};var S3=zA;function kG(e){e=e??H.EMPTY_OBJECT;let t=Bn(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=yn(),this._lastMsSampleTime=yn(),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(kG.prototype,{throttled:{get:function(){return this._throttled},set:function(e){this._throttled!==e&&(e?this._throttledText.nodeValue="(throttled)":this._throttledText.nodeValue="",this._throttled=e)}}});kG.prototype.update=function(e){let t=yn(),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}};kG.prototype.destroy=function(){return ue(this)};var T_=kG;var gc={};gc.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}`)};gc.decodeRawMetadataValueComponent=function(e,t,n){let i=e.componentType,r=gc.decodeRawMetadataValue(i,t,n);return e.normalized?Mt.normalize(r,i):r};gc.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=gc.decodeRawMetadataValueComponent(e,t,p);f[d]=g}return f}let c=n*s;return gc.decodeRawMetadataValueComponent(e,t,c)};gc.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=gc.decodeRawMetadataValueElement(e,n,a);o[a]=s}return o}return gc.decodeRawMetadataValueElement(e,n,0)};gc.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 z.unpack(n,0,new z);case gt.VEC3:return h.unpack(n,0,new h);case gt.VEC4:return ae.unpack(n,0,new ae);case gt.MAT2:return Ki.unpack(n,0,new Ki);case gt.MAT3:return $.unpack(n,0,new $);case gt.MAT4:return L.unpack(n,0,new L)}throw new oe(`Invalid metadata object type: ${e}`)};gc.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 z.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 Ki.pack(t,Array(4));case gt.MAT3:return $.pack(t,Array(9));case gt.MAT4:return L.pack(t,Array(16))}throw new oe(`Invalid metadata object type: ${e}`)};gc.decodeMetadataValues=function(e,t,n){let i=gc.decodeRawMetadataValues(e,n);if(t.hasValueTransform){let o=gc.convertFromObjectType(e.type,t.offset),a=gc.convertFromObjectType(e.type,t.scale);i=yp.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=gc.convertToObjectType(e.type,c);a[s]=u}return a}return gc.convertToObjectType(e.type,i)};var w3=Object.freeze(gc);function sC(){this._framebuffer=new oi,this._textureToCopy=void 0,this._copyDepthCommand=void 0}Object.defineProperties(sC.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function avt(e,t,n){let{width:i,height:r}=n;e._framebuffer.update(t,i,r)}function svt(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}sC.prototype.update=function(e,t){avt(this,e,t),svt(this,e,t)};var cvt=new ae,lvt=new ae(1,1/255,1/65025,1/16581375);sC.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,cvt);return ae.divideByScalar(r,255,r),ae.dot(r,lvt)};sC.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)};sC.prototype.isDestroyed=function(){return!1};sC.prototype.destroy=function(){return this._framebuffer.destroy(),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=l(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy()),ue(this)};var I3=sC;function UA(){this._framebufferManager=new oi({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(UA.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}}});UA.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};UA.prototype.clear=function(e,t,n){this.getClearCommand(n).execute(e,t)};UA.prototype.getClearCommand=function(e){return this._clearCommand.framebuffer=this._framebuffer,l(e)&&U.clone(e,this._clearCommand.color),this._clearCommand};UA.prototype.getFramebuffer=function(e,t,n,i){return this.update(e,t,!1,n,i),this._framebuffer};UA.prototype.isDestroyed=function(){return!1};UA.prototype.destroy=function(){return this._framebufferManager=this._framebufferManager&&this._framebufferManager.destroy(),this._clearCommand=void 0,ue(this)};var P3=UA;function cC(){this._framebufferManager=new oi({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(cC.prototype,{framebuffer:{get:function(){return this._framebuffer}},idTexture:{get:function(){return this._idTexture}},depthStencilTexture:{get:function(){return this._depthStencilTexture}}});cC.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};cC.prototype.getClearCommand=function(e){return this._clearCommand.framebuffer=this._framebuffer,l(e)&&U.clone(e,this._clearCommand.color),this._clearCommand};cC.prototype.releaseResources=function(){l(this._framebuffer)&&(this._framebufferManager.destroy(),this._framebuffer=void 0,this._idTexture=void 0,this._depthStencilTexture=void 0)};cC.prototype.isDestroyed=function(){return!1};cC.prototype.destroy=function(){return this._framebufferManager=this._framebufferManager&&this._framebufferManager.destroy(),this._clearCommand=void 0,ue(this)};var D3=cC;function uvt(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 R3=uvt;var VA=`uniform highp sampler2D u_depthTexture;
in vec2 v_textureCoordinates;
void main()
{
out_FragColor = czm_packDepth(texture(u_depthTexture, v_textureCoordinates).r);
}
`;function c0(){this._picking=!1,this._snapping=!1,this._numSamples=1,this._tempCopyDepthTexture=void 0,this._pickColorFramebuffer=new oi({depthStencil:!0,supportsDepthTexture:!0}),this._snapColorFramebuffer=new oi({depthStencil:!0,supportsDepthTexture:!0,pixelDatatype:ke.FLOAT,pixelFormat:He.RGBA}),this._outputFramebuffer=new oi({depthStencil:!0,supportsDepthTexture:!0}),this._copyDepthFramebuffer=new oi,this._tempCopyDepthFramebuffer=new oi,this._updateDepthFramebuffer=new oi({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(c0.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 Pwe(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:Qt.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(VA,{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(Yu,{uniformMap:{colorTexture:function(){return e.colorFramebufferManager.getColorTexture()}},owner:e})),e._copyColorCommand.renderState=e._rs,l(e._tempCopyDepthCommand)||(e._tempCopyDepthCommand=t.createViewportQuadCommand(VA,{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(Yu,{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}c0.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),Pwe(this,e,a,s,t),e.uniformState.globeDepthTexture=void 0,this._clearGlobeDepth=o};c0.prototype.prepareColorTextures=function(e,t){!this.picking&&this._numSamples>1&&this._outputFramebuffer.prepareTextures(e,t)};c0.prototype.executeCopyDepth=function(e,t){l(this._copyDepthCommand)&&(this.prepareColorTextures(e),this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._copyDepthFramebuffer.getColorTexture())};c0.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),Pwe(this,e,a,s,t)}this._tempCopyDepthTexture=i,this._tempCopyDepthCommand.execute(e,t),this._updateDepthCommand.execute(e,t)};c0.prototype.executeCopyColor=function(e,t){l(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)};c0.prototype.clear=function(e,t,n){let i=this._clearGlobeColorCommand;l(i)&&(U.clone(n,i.color),this.colorFramebufferManager.clear(e,i,t))};c0.prototype.isDestroyed=function(){return!1};c0.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 O3=c0;function lC(){this._framebuffer=new oi({depthStencil:!0,supportsDepthTexture:!0}),this._packedDepthFramebuffer=new oi,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(lC.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 fvt(e){e._framebuffer.destroy(),e._packedDepthFramebuffer.destroy()}function dvt(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 hvt(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(VA,{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}lC.prototype.updateAndClear=function(e,t,n,i){let r=t.width,o=t.height;dvt(this,n,r,o,e),hvt(this,n,r,o,i),this._useHdr=e};lC.prototype.clearClassification=function(e,t){this._clearCommand.execute(e,t)};lC.prototype.packDepth=function(e,t){return this._packedDepthCommand.execute(e,t),this.packedDepthTexture};lC.prototype.isDestroyed=function(){return!1};lC.prototype.destroy=function(){return fvt(this),ue(this)};var M3=lC;var Fw=`#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 L3=`/**
* 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 C_(e){this._numSamples=1,this._translucentMultipassSupport=!1,this._translucentMRTSupport=!1;let t=e.colorBufferFloat&&e.depthTexture&&e.floatBlend;this._translucentMRTSupport=e.drawBuffers&&t,this._translucentMultipassSupport=!this._translucentMRTSupport&&t,this._opaqueFBO=void 0,this._opaqueTexture=void 0,this._depthStencilTexture=void 0,this._accumulationTexture=void 0,this._translucentFBO=new oi({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._alphaFBO=new oi({createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._adjustTranslucentFBO=new oi({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1}),this._adjustAlphaFBO=new oi({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 Dwe(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function Cte(e){e._translucentFBO.destroy(),e._alphaFBO.destroy(),e._adjustTranslucentFBO.destroy(),e._adjustAlphaFBO.destroy()}function Rwe(e){Dwe(e),Cte(e)}function mvt(e,t,n,i){Dwe(e),e._accumulationTexture=new Ct({context:t,width:n,height:i,pixelFormat:He.RGBA,pixelDatatype:ke.FLOAT}),e._revealageTexture=new Ct({context:t,pixelFormat:He.RGBA,pixelDatatype:ke.FLOAT,width:n,height:i,flipY:!1})}function pvt(e,t){Cte(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)&&(Cte(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)&&(Rwe(e),e._translucentMultipassSupport=!1,i=!1)}return i}C_.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,mvt(this,e,o,a)),(!l(this._translucentFBO.framebuffer)||c||u)&&!pvt(this,e))return;this._useHDR=i;let f=this,d,p;l(this._compositeCommand)||(d=new Ge({sources:[L3]}),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:[Fw]}),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:[Fw]}),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 gvt={enabled:!0,color:new U(0,0,0,0),equationRgb:Mc.ADD,equationAlpha:Mc.ADD,functionSourceRgb:Wr.ONE,functionDestinationRgb:Wr.ONE,functionSourceAlpha:Wr.ZERO,functionDestinationAlpha:Wr.ONE_MINUS_SOURCE_ALPHA},_vt={enabled:!0,color:new U(0,0,0,0),equationRgb:Mc.ADD,equationAlpha:Mc.ADD,functionSourceRgb:Wr.ONE,functionDestinationRgb:Wr.ONE,functionSourceAlpha:Wr.ONE,functionDestinationAlpha:Wr.ONE},yvt={enabled:!0,color:new U(0,0,0,0),equationRgb:Mc.ADD,equationAlpha:Mc.ADD,functionSourceRgb:Wr.ZERO,functionDestinationRgb:Wr.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:Wr.ZERO,functionDestinationAlpha:Wr.ONE_MINUS_SOURCE_ALPHA};function vte(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 Avt(e,t,n){return vte(t,gvt,e._translucentRenderStateCache,n)}function bvt(e,t,n){return vte(t,_vt,e._translucentRenderStateCache,n)}function xvt(e,t,n){return vte(t,yvt,e._alphaRenderStateCache,n)}var Tvt=` 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);
`,Cvt=` 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;
`,vvt=` float ai = czm_out_FragColor.a;
out_FragColor = vec4(ai);
`;function Ete(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 Evt(e,t){return Ete(e,t,"translucentMRT",Tvt)}function Svt(e,t){return Ete(e,t,"translucentMultipass",Cvt)}function wvt(e,t){return Ete(e,t,"alphaMultipass",vvt)}C_.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=Evt(t,e.shaderProgram),n.translucentCommand.renderState=Avt(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=Svt(t,e.shaderProgram),n.translucentCommand.renderState=bvt(this,t,e.renderState),n.alphaCommand.shaderProgram=wvt(t,e.shaderProgram),n.alphaCommand.renderState=xvt(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 Ivt(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 Pvt(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}C_.prototype.executeCommands=function(e,t,n,i,r){if(this._translucentMRTSupport){Pvt(this,e,t,n,i,r);return}Ivt(this,e,t,n,i,r)};C_.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)};C_.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this._opaqueFBO.framebuffer,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};C_.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport};C_.prototype.isDestroyed=function(){return!1};C_.prototype.destroy=function(){return Rwe(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 N3=C_;function F3(){this._framebuffer=new oi({color:!1,depthStencil:!0,supportsDepthTexture:!0}),this._passState=void 0}Object.defineProperties(F3.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function Dvt(e){e._framebuffer.destroy()}function Rvt(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i);let r=new sc(t);r.blendingEnabled=!1,r.scissorTest={enabled:!0,rectangle:new Je},r.viewport=new Je,e._passState=r}F3.prototype.update=function(e,t,n){let i=n.width,r=n.height;this._framebuffer.isDirty(i,r)&&Rvt(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};F3.prototype.isDestroyed=function(){return!1};F3.prototype.destroy=function(){return Dvt(this),ue(this)};var B3=F3;function uC(e){let t=new sc(e);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new Je},t.viewport=new Je,this._context=e,this._fb=new oi({depthStencil:!0}),this._passState=t,this._width=0,this._height=0}function Owe(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]}uC.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};uC.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=eL.create({context:o});try{await f.waitForSignal(g=>t.afterRender.push(g));let d=He.createTypedArray(c,s,i,r);return u.getBufferData(d),Owe(o,d,i,r,n)}catch{throw new oe("Async Picking Request Timeout")}finally{f.destroy(),u.destroy()}};uC.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 Owe(r,o,n,i,t)};uC.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)};uC.prototype.isDestroyed=function(){return!1};uC.prototype.destroy=function(){return this._fb.destroy(),ue(this)};var k3=uC;function v_(){this._numSamples=1,this._colorFramebuffer=new oi({depthStencil:!0,supportsDepthTexture:!0}),this._idFramebuffer=new oi({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 Ovt(e){e._colorFramebuffer.destroy(),e._idFramebuffer.destroy()}Object.defineProperties(v_.prototype,{framebuffer:{get:function(){return this._colorFramebuffer.framebuffer}},idFramebuffer:{get:function(){return this._idFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._colorFramebuffer.getDepthStencilTexture()}}});v_.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)};v_.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)};v_.prototype.getFramebuffer=function(){return this._colorFramebuffer.framebuffer};v_.prototype.getIdFramebuffer=function(){return this._idFramebuffer.framebuffer};v_.prototype.prepareColorTextures=function(e){this._numSamples>1&&this._colorFramebuffer.prepareTextures(e)};v_.prototype.isDestroyed=function(){return!1};v_.prototype.destroy=function(){return Ovt(this),ue(this)};var fC=v_;function jA(){}var Mvt={HAS_CLIPPING_PLANES:!0,ENABLE_CLIPPING_POLYGONS:!0};jA.hasClippingForShadowCast=function(e){let t=e.defines;return l(t)&&t.some(function(n){return Mvt[n]===!0})};jA.getShadowCastShaderKeyword=function(e,t,n,i,r){return`castShadow ${e} ${t} ${n} ${i} ${r}`};jA.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})};jA.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})};jA.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}`};jA.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})};jA.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 zm=jA;function l0(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 L,this._shadowMapTexture=void 0,this._lightDirectionEC=new h,this._lightPositionEC=new ae,this._distance=0,this._lightCamera=e.lightCamera,this._shadowMapCamera=new zG,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 z,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new da:l(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new ae,new ae],this._cascadeMatrices=[new L,new L,new L,new L],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 Lvt(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,wte(this),this._clearCommand=new ui({depth:1,color:new U}),this._clearPassState=new sc(t),this._size=e.size??2048,this.size=this._size}l0.MAXIMUM_DISTANCE=2e4;function Lvt(e){this.camera=new zG,this.passState=new sc(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function Ste(e,t){return je.fromCache({cull:{enabled:!0,face:zi.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 wte(e){let t=!e._usesDepthTexture;e._primitiveRenderState=Ste(t,e._primitiveBias),e._terrainRenderState=Ste(t,e._terrainBias),e._pointRenderState=Ste(t,e._pointBias)}l0.prototype.debugCreateRenderStates=function(){wte(this)};Object.defineProperties(l0.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){Uvt(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 Ite(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 Nvt(e,t){let n=new Tf({context:t,width:e._textureSize.x,height:e._textureSize.y,format:Hl.DEPTH_COMPONENT16}),i=new Ct({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:He.RGBA,pixelDatatype:ke.UNSIGNED_BYTE,sampler:zt.NEAREST}),r=new _a({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 Fvt(e,t){let n=new Ct({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:He.DEPTH_STENCIL,pixelDatatype:ke.UNSIGNED_INT_24_8,sampler:zt.NEAREST}),i=new _a({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 Bvt(e,t){let n=new Tf({context:t,width:e._textureSize.x,height:e._textureSize.y,format:Hl.DEPTH_COMPONENT16}),i=new Jo({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:He.RGBA,pixelDatatype:ke.UNSIGNED_BYTE,sampler:zt.NEAREST}),r=[i.negativeX,i.negativeY,i.negativeZ,i.positiveX,i.positiveY,i.positiveZ];for(let o=0;o<6;++o){let a=new _a({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 Nwe(e,t){e._isPointLight?Bvt(e,t):e._usesDepthTexture?Fvt(e,t):Nvt(e,t)}function kvt(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==ee.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,wte(e),Ite(e),Nwe(e,t))}function zvt(e,t){(!l(e._passes[0].framebuffer)||e._shadowMapTexture.width!==e._textureSize.x)&&(Ite(e),Nwe(e,t),kvt(e,t),Fwe(e,t))}function Fwe(e,t,n){n=n??0,(e._isPointLight||n===0)&&(e._clearCommand.framebuffer=e._passes[n].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function Uvt(e,t){e._size=t;let n=e._passes,i=n.length,r=e._textureSize;if(e._isPointLight){t=Lt.maximumCubeMapSize>=t?t:Lt.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=Lt.maximumTextureSize>=t?t:Lt.maximumTextureSize,r.x=t,r.y=t,n[0].passState.viewport=new Je(0,0,t,t)):i===4&&(t=Lt.maximumTextureSize>=t*2?t:Lt.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 L(f,0,0,c,0,d,0,u,0,0,1,0,0,0,0,1)}}var Vvt=new Je;function jvt(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 Hvt(e,t){let n=t.context,i=t.context.drawingBufferWidth,r=t.context.drawingBufferHeight,o=Math.min(i,r)*.3,a=Vvt;a.x=i-o,a.y=0,a.width=o,a.height=o;let s=e._debugShadowViewCommand;l(s)||(s=jvt(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 u0=new Array(8);u0[0]=new ae(-1,-1,-1,1);u0[1]=new ae(1,-1,-1,1);u0[2]=new ae(1,1,-1,1);u0[3]=new ae(-1,1,-1,1);u0[4]=new ae(-1,-1,1,1);u0[5]=new ae(1,-1,1,1);u0[6]=new ae(1,1,1,1);u0[7]=new ae(-1,1,1,1);var HA=new L,Pte=new Array(8);for(let e=0;e<8;++e)Pte[e]=new ae;function Gvt(e,t){let n=new Nt({geometry:new Rh({minimum:new h(-.5,-.5,-.5),maximum:new h(.5,.5,.5)}),attributes:{color:Kt.fromColor(t)}}),i=new Nt({geometry:new _g({radius:.5}),attributes:{color:Kt.fromColor(t)}});return new Nn({geometryInstances:[n,i],appearance:new gn({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}var Wvt=[U.RED,U.GREEN,U.BLUE,U.MAGENTA],qvt=new h;function Yvt(e,t){Hvt(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 a0({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 a0({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 a0({camera:e._passes[i].camera,color:Wvt[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,qvt),s=L.fromTranslationQuaternionRotationScale(i,r,a,HA);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=Gvt(s,U.YELLOW)}e._debugLightFrustum.update(t)}else(!l(e._debugLightFrustum)||e._needsUpdate)&&(e._debugLightFrustum=new a0({camera:e._shadowMapCamera,color:U.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function zG(){this.viewMatrix=new L,this.inverseViewMatrix=new L,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 L}zG.prototype.clone=function(e){L.clone(e.viewMatrix,this.viewMatrix),L.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 Xvt=new L(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);zG.prototype.getViewProjection=function(){let e=this.viewMatrix,t=this.frustum.projectionMatrix;return L.multiply(t,e,this.viewProjectionMatrix),L.multiply(Xvt,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var Kvt=new Array(5),$vt=new Gi,Jvt=new Array(4),Bwe=new h,kwe=new h;function Zvt(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=Jvt,g=Kvt;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=D.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,P=n.upWC,R=i.frustum.clone($vt),O=n.getViewProjection();for(s=0;s<a;++s){R.near=g[s],R.far=g[s+1];let N=L.multiply(R.projectionMatrix,i.viewMatrix,HA),_=L.inverse(N,HA),v=L.multiply(O,_,HA),S=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Bwe),I=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,kwe);for(let j=0;j<8;++j){let B=ae.clone(u0[j],Pte[j]);L.multiplyByVector(v,B,B),h.divideByScalar(B,B.w,B),h.minimumByComponent(B,S,S),h.maximumByComponent(B,I,I)}S.x=Math.max(S.x,0),S.y=Math.max(S.y,0),S.z=0,I.x=Math.min(I.x,1),I.y=Math.min(I.y,1),I.z=Math.min(I.z,1);let M=e._passes[s],F=M.camera;F.clone(n);let V=F.frustum;V.left=y+S.x*(A-y),V.right=y+I.x*(A-y),V.bottom=b+S.y*(x-b),V.top=b+I.y*(x-b),V.near=T+S.z*(C-T),V.far=T+I.z*(C-T),M.cullingVolume=F.frustum.computeCullingVolume(E,w,P);let k=e._cascadeMatrices[s];L.multiply(F.getViewProjection(),i.inverseViewMatrix,k),L.multiply(M.textureOffsets,k,k)}}var Qvt=new L,eEt=new h,tEt=new h,Mwe=new h;function nEt(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,r=L.multiply(i.frustum.projectionMatrix,i.viewMatrix,HA),o=L.inverse(r,HA),a=n.directionWC,s=i.directionWC;h.equalsEpsilon(a,s,D.EPSILON10)&&(s=i.upWC);let c=h.cross(a,s,eEt);s=h.cross(c,a,tEt),h.normalize(s,s),h.normalize(c,c);let u=h.fromElements(0,0,0,Mwe),f=L.computeView(u,a,s,c,Qvt),d=L.multiply(f,o,HA),p=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Bwe),g=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,kwe);for(let C=0;C<8;++C){let E=ae.clone(u0[C],Pte[C]);L.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=Mwe;m.x=-(.5*(p.x+g.x)),m.y=-(.5*(p.y+g.y)),m.z=-g.z;let y=L.fromTranslation(m,HA);f=L.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,L.clone(f,n.viewMatrix),L.inverse(f,n.inverseViewMatrix),L.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 iEt=[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)],rEt=[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)],oEt=[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 aEt(e,t){let n=new Gi;n.fov=D.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=iEt[i],r.upWC=rEt[i],r.rightWC=oEt[i],L.computeView(r.positionWC,r.directionWC,r.upWC,r.rightWC,r.viewMatrix),L.inverse(r.viewMatrix,r.inverseViewMatrix),r.frustum=n}}var sEt=new h,cEt=new h,zwe=new se,Lwe=zwe.center;function lEt(e,t){let n=e._sceneCamera,i=e._shadowMapCamera,r=zwe;if(e._cascadesEnabled){if(n.frustum.near>=e.maximumDistance){e._outOfView=!0,e._needsUpdate=!1;return}let o=t.mapProjection.ellipsoid.geodeticSurfaceNormal(n.positionWC,sEt),a=h.negate(i.directionWC,cEt),s=h.dot(o,a);if(e.fadingEnabled){let c=D.clamp(s/.1,0,1);e._darkness=D.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,Lwe),Lwe);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 uEt(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;L.multiplyByPointAsVector(n.viewMatrix,o.directionWC,a),h.normalize(a,a),h.negate(a,a),L.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=vr.clone(n,r),n.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=s,e._sceneCamera.frustum.far=c,e._distance=c-s,lEt(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}l0.prototype.update=function(e){if(uEt(this,e),this._needsUpdate)if(zvt(this,e.context),this._isPointLight&&aEt(this,e),this._cascadesEnabled&&(nEt(this,e),this._numberOfCascades>1&&Zvt(this,e)),this._isPointLight)this._shadowMapCullingVolume=qa.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;L.multiply(this._shadowMapCamera.getViewProjection(),t,this._shadowMapMatrix)}this.debugShow&&Yvt(this,e)};l0.prototype.updatePass=function(e,t){Fwe(this,e,t)};var fEt=new z;function Uwe(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=fEt;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 dEt(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&&zm.hasClippingForShadowCast(y),b=zm.getShadowCastShaderKeyword(p,f,g,d,A);if(a=i.shaderCache.getDerivedShaderProgram(u,b),!l(a)){let T=zm.createShadowCastVertexShader(m,p,f),C=zm.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=Ye(s,!1),s.cull=Ye(s.cull,!1),s.cull.enabled=!1,s=je.fromCache(s)),c=Uwe(e,n.uniformMap,f)}return o.shaderProgram=a,o.renderState=s,o.uniformMap=c,o}l0.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=zm.getShadowReceiveShaderKeyword(e[0],t.castShadows,u,f);if(d=i.shaderCache.getDerivedShaderProgram(a,y),!l(d)){let A=zm.createShadowReceiveVertexShader(s,u,f),b=zm.createShadowReceiveFragmentShader(c,e[0],t.castShadows,u,f);d=i.shaderCache.createDerivedShaderProgram(a,y,{vertexShaderSource:A,fragmentShaderSource:b,attributeLocations:a._attributeLocations})}p=Uwe(e[0],t.uniformMap,u)}r.receiveCommand.shaderProgram=d,r.receiveCommand.uniformMap=p,r.receiveShaderProgramId=t.shaderProgram.id,r.receiveShaderCastShadows=t.castShadows}return r};l0.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]=dEt(e[c],n,t,i,a,o[c]);r.castShaderProgramId=t.shaderProgram.id}return r};l0.prototype.isDestroyed=function(){return!1};l0.prototype.destroy=function(){Ite(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 E_=l0;var z3=`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 dC=`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 hEt=!1;function GA(e){this._drawClassificationFBO=new oi({createDepthAttachments:!1}),this._accumulationFBO=new oi({createDepthAttachments:!1}),this._packFBO=new oi,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(GA.prototype,{hasTranslucentDepth:{get:function(){return this._hasTranslucentDepth}}});function Vwe(e){e._textureToComposite=void 0,e._translucentDepthStencilTexture=e._translucentDepthStencilTexture&&!e._translucentDepthStencilTexture.isDestroyed()&&e._translucentDepthStencilTexture.destroy()}function jwe(e){e._drawClassificationFBO.destroy(),e._accumulationFBO.destroy(),e._packFBO.destroy()}function mEt(e,t,n,i){Vwe(e),e._translucentDepthStencilTexture=new Ct({context:t,width:n,height:i,pixelFormat:He.DEPTH_STENCIL,pixelDatatype:ke.UNSIGNED_INT_24_8,sampler:zt.NEAREST})}function pEt(e,t,n,i){jwe(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 gEt(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)&&(mEt(e,t,r,o),pEt(e,t,r,o));let a,s;if(l(e._packDepthCommand)||(a=new Ge({sources:[z3]}),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:[dC]}),s={colorTexture:function(){return e._textureToComposite}},hEt&&(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:[dC]}),s={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._copyCommand=t.createViewportQuadCommand(a,{uniformMap:s,owner:e})),l(e._accumulateCommand)||(a=new Ge({sources:[dC]}),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:Qt.ALPHA_BLEND})),l(e._compositeCommand)&&(e._compositeCommand.renderState=e._rsComp,e._compositeCommand.derivedCommands.pick.renderState=e._rsComp)}GA.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){gEt(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}};GA.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)};GA.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),_Et(this,e,t)};function _Et(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}GA.prototype.isSupported=function(){return this._supported};GA.prototype.isDestroyed=function(){return!1};GA.prototype.destroy=function(){return Vwe(this),jwe(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 U3=GA;function yEt(){this.command=void 0,this.near=void 0,this.far=void 0}function UG(e,t,n){let i=e.context,r;i.depthTexture&&(r=new O3);let o;e._useOIT&&i.depthTexture&&(o=new N3(i));let a=new sc(i);a.viewport=Je.clone(n),this.camera=t,this._cameraClone=vr.clone(t),this._cameraStartFired=!1,this._cameraMovedTime=void 0,this.viewport=n,this.passState=a,this.pickFramebuffer=new k3(i),this.snapFramebuffer=void 0,this.pickDepthFramebuffer=new B3,this.sceneFramebuffer=new fC,this.edgeFramebuffer=new P3,this.planarFillIdFramebuffer=new D3,this.globeDepth=r,this.globeTranslucencyFramebuffer=new M3,this.oit=o,this.translucentTileClassification=new U3(i),this.pickDepths=[],this.frustumCommandsList=[],this.debugFrustumStatistics=void 0,this._commandExtents=[]}var Dte=new h,Rte=new h;function AEt(e,t,n){let i=Math.max(h.maximumComponent(h.abs(e.position,Dte)),h.maximumComponent(h.abs(t.position,Rte))),r=1/Math.max(1,i);return h.multiplyByScalar(e.position,r,Dte),h.multiplyByScalar(t.position,r,Rte),h.equalsEpsilon(Dte,Rte,n)&&h.equalsEpsilon(e.direction,t.direction,n)&&h.equalsEpsilon(e.up,t.up,n)&&h.equalsEpsilon(e.right,t.right,n)&&L.equalsEpsilon(e.transform,t.transform,n)&&e.frustum.equalsEpsilon(t.frustum,n)}UG.prototype.checkForCameraUpdates=function(e){let t=this.camera,n=this._cameraClone;return AEt(t,n,D.EPSILON15)?(this._cameraStartFired&&yn()-this._cameraMovedTime>e.cameraEventWaitTime&&(t.moveEnd.raiseEvent(),this._cameraStartFired=!1),!1):(this._cameraStartFired||(t.moveStart.raiseEvent(),this._cameraStartFired=!0),this._cameraMovedTime=yn(),vr.clone(t,n),!0)};function bEt(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+D.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 R3(g,m)}}function xEt(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 Hwe=new qa,TEt=new Wo;UG.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 O=0;O<f.length;++O)for(let N=0;N<Pe.NUMBER_OF_PASSES;++N)f[O].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=Hwe.planes;for(let O=0;O<5;++O)w[O]=E.planes[O];E=Hwe;for(let O=0;O<i.length;++O){let N=i[O],{pass:_,boundingVolume:v}=N;if(_===Pe.COMPUTE)c.push(N);else if(_===Pe.OVERLAY)u.push(N);else{let S,I;if(l(v)){if(!e.isVisible(E,N,C))continue;let F=v.computePlaneDistances(o,a,TEt);if(S=F.start,I=F.stop,m=Math.min(m,S),y=Math.max(y,I),A&&N.receiveShadows&&S<E_.MAXIMUM_DISTANCE&&!(_===Pe.GLOBE&&S<-100&&I>100)){let V=I-S;_!==Pe.GLOBE&&S<100&&(T=Math.min(T,V)),b=Math.min(b,S),x=Math.max(x,I)}}else N instanceof ui?(S=s.near,I=s.far):(S=s.near,I=s.far,m=Math.min(m,S),y=Math.max(y,I));let M=d[g];l(M)||(M=d[g]=new yEt),M.command=N,M.near=S,M.far=I,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),bEt(this,e,m,y);for(let O=0;O<g;O++)xEt(this,e,d[O]);if(g<p)for(let O=g;O<p;O++){let N=d[O];if(!l(N.command))break;N.command=void 0}let P=f.length,{frustumSplits:R}=t;R.length=P+1;for(let O=0;O<P;++O)R[O]=f[O].near,O===P-1&&(R[O+1]=f[O].far)};UG.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 hC=UG;var Wwe=.1,CEt=new lh({pass:no.MOST_DETAILED_PRELOAD}),vEt=new lh({pass:no.MOST_DETAILED_PICK}),V3=new lh({pass:no.PICK});function Es(e){this._mostDetailedRayPicks=[],this.pickRenderStateCache={},this._pickPositionCache={},this._pickPositionCacheDirty=!1;let t=new Je(0,0,1,1),n=new vr(e);n.frustum=new mn({width:Wwe,aspectRatio:1,near:.1}),this._pickOffscreenView=new hC(e,n,t)}Es.prototype.update=function(){this._pickPositionCacheDirty=!0};Es.prototype.getPickDepth=function(e,t){let n=e.view.pickDepths,i=n[t];return l(i)||(i=new I3,n[t]=i),i};var EEt=new da,SEt=new h,VG=new h,wEt=new z,IEt=new L;function PEt(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=L.clone(o.transform,IEt);o._setTransform(L.IDENTITY);let d=h.clone(o.position,SEt);h.multiplyByScalar(o.right,c,VG),h.add(VG,d,d),h.multiplyByScalar(o.up,u,VG),h.add(VG,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,wEt),g=EEt;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 DEt=new Fl,REt=new z;function OEt(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,REt),y=m.x*n*.5,A=m.y*i*.5,b=DEt;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 jG(e,t,n,i,r){let o=e.camera.frustum;return o instanceof mn||o instanceof da?PEt(e,t,n,i,r):OEt(e,t,n,i,r)}var j3=new Je(0,0,3,3),HG=new z,H3=new U(0,0,0,0);function Ote(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 GG(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=sr.transformWindowToDrawingBuffer(e,t,HG);Ote(a.drawingBufferHeight,g,i,r,n),e.jobScheduler.disableThisFrame(),e.updateFrameState(),s.cullingVolume=jG(e,g,n.width,n.height,u),s.invertClassification=!1,s.passes.pick=!0,s.passes.snap=o?.snap??!1,s.tilesetPassState=V3,a.uniformState.update(s),e.updateEnvironment(),p=d.begin(n,u),e.updateAndExecuteCommands(p,H3),e.resolveFramebuffers(p)}function WG(e){let{context:t}=e;t.endFrame()}Es.prototype.pickAsync=async function(e,t,n,i,r=1){let{context:o,frameState:a,defaultView:s}=e,{pickFramebuffer:c}=s,u=j3;GG(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.")),WG(e),f};Es.prototype.pick=function(e,t,n,i,r=1){let{defaultView:o}=e,{pickFramebuffer:a}=o,s=j3;GG(e,t,s,n,i);let c=a.end(s,r);return WG(e),c};Es.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=sr.transformWindowToDrawingBuffer(e,t,HG),d=Ote(r.drawingBufferHeight,f,n,i,j3);e.jobScheduler.disableThisFrame(),e.updateFrameState(),o.cullingVolume=jG(e,f,d.width,d.height,s),o.invertClassification=!1,o.passes.pickVoxel=!0,o.tilesetPassState=V3,r.uniformState.update(o),e.updateEnvironment(),u=c.begin(d,s),e.updateAndExecuteCommands(u,H3),e.resolveFramebuffers(u);let p=c.readCenterPixel(d);return r.endFrame(),p};Es.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=sr.transformWindowToDrawingBuffer(e,t,HG),f=Ote(i.drawingBufferHeight,u,1,1,j3);e.jobScheduler.disableThisFrame(),e.updateFrameState(),r.cullingVolume=jG(e,u,f.width,f.height,a),r.invertClassification=!1,r.passes.pick=!0,r.tilesetPassState=V3,r.pickingMetadata=!0,r.pickedMetadataInfo=n,i.uniformState.update(r),e.updateEnvironment(),c=s.begin(f,a),e.updateAndExecuteCommands(c,H3);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,w3.decodeMetadataValues(n.classProperty,n.metadataProperty,p)};function MEt(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=jG(e,t,1,1,a),r.tilesetPassState=V3,e.updateEnvironment(),o.renderTranslucentDepthForPick=!0,c=s.update(i,t,a),e.updateAndExecuteCommands(c,H3),e.resolveFramebuffers(c),i.endFrame()}var LEt=new Gi,NEt=new Fl,FEt=new mn,BEt=new da;Es.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=sr.transformWindowToDrawingBuffer(e,t,HG);e.pickTranslucentDepth?MEt(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(LEt):l(a.frustum.infiniteProjectionMatrix)?f=a.frustum.clone(NEt):l(a.frustum.width)?f=a.frustum.clone(FEt):f=a.frustum.clone(BEt);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=sr.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 kEt=new de;Es.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,kEt);r.cartographicToCartesian(o,n)}return n};function zEt(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 Qa&&(d=!0,s.show=!1,o.push(s)),d||(f.show=!1,i.push(f))}}function qwe(e,t){let n=[],i=[],r=[],o=[];l(t)||(t=Number.MAX_VALUE);let a=e(t);for(;l(a)&&a.length>0&&!zEt(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}Es.prototype.drillPick=function(e,t,n,i,r){return qwe(s=>this.pick(e,t,i,r,s).map(u=>({object:u,position:void 0,exclude:!1})),n).map(s=>s.object)};var Gwe=new h,UEt=new h;function VEt(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 Ywe(e,t,n,i){let r=t.direction,o=h.mostOrthogonalAxis(r,Gwe),a=h.cross(r,o,Gwe),s=h.cross(r,a,UEt);return i.position=t.origin,i.direction=r,i.up=s,i.right=a,i.frustum.width=n??Wwe,i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC)}function jEt(e,t,n){let i=t.frameState,{ray:r,width:o,tilesets:a}=n,s=e._pickOffscreenView.camera,c=Ywe(e,r,o,s),u=CEt;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}Es.prototype.updateMostDetailedRayPicks=function(e){let t=this._mostDetailedRayPicks;for(let n=0;n<t.length;++n)jEt(this,e,t[n])&&t.splice(n--,1)};function Xwe(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 Xl&&Xwe(r,t,n))}}function qG(e,t,n,i,r,o){let a=[];if(Xwe(t.primitives,i,a),a.length===0)return Promise.resolve(o());let s=new VEt(n,r,a);return e._mostDetailedRayPicks.push(s),s.promise.then(function(){return o()})}function HEt(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 GEt(e,t,n,i,r,o,a){let{context:s,frameState:c}=t,u=s.uniformState,f=e._pickOffscreenView;t.view=f,Ywe(e,n,r,f.camera);let d=Je.clone(f.viewport,j3),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=vEt:c.tilesetPassState=V3,u.update(c),t.updateEnvironment(),t.updateAndExecuteCommands(p,H3),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,P=E+T*(w-E);g=dn.getPoint(n,P);break}}}if(t.view=t.defaultView,s.endFrame(),l(m)||l(g))return{object:m,position:g,exclude:!l(g)&&o||HEt(m,i)}}function Mte(e,t,n,i,r,o,a,s){return qwe(function(){let u=GEt(e,t,n,r,o,a,s);return u?[u]:void 0},i)}function Bw(e,t,n,i,r,o,a){let s=Mte(e,t,n,1,i,r,o,a);if(s.length>0)return s[0]}function YG(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)})})}Es.prototype.pickFromRay=function(e,t,n,i){return Bw(this,e,t,n,i,!1,!1)};Es.prototype.drillPickFromRay=function(e,t,n,i,r){return Mte(this,e,t,n,i,r,!1,!1)};Es.prototype.pickFromRayMostDetailed=function(e,t,n,i){let r=this;return t=dn.clone(t),n=l(n)?n.slice():n,YG(e,qG(r,e,t,n,i,function(){return Bw(r,e,t,n,i,!1,!0)}))};Es.prototype.drillPickFromRayMostDetailed=function(e,t,n,i,r){let o=this;return t=dn.clone(t),i=l(i)?i.slice():i,YG(e,qG(o,e,t,i,r,function(){return Mte(o,e,t,n,i,r,!1,!0)}))};var WEt=new h,qEt=new h,YEt=new dn,Kwe=new de;function Lte(e,t){let n=e.ellipsoid,i=wi._defaultMaxTerrainHeight,r=n.geodeticSurfaceNormalCartographic(t,qEt),o=de.toCartesian(t,n,WEt),a=YEt;a.origin=o,a.direction=r;let s=new dn;return dn.getPoint(a,i,s.origin),h.negate(r,s.direction),s}function $we(e,t){let n=e.ellipsoid,i=de.fromCartesian(t,n,Kwe);return Lte(e,i)}function Jwe(e,t){let n=e.ellipsoid;return de.fromCartesian(t,n,Kwe).height}function XEt(e,t,n,i,r){let o=Lte(t,n);return qG(e,t,o,i,r,function(){let a=Bw(e,t,o,i,r,!0,!0);if(l(a))return Jwe(t,a.position)})}function KEt(e,t,n,i,r,o){let a=$we(t,n);return qG(e,t,a,i,r,function(){let s=Bw(e,t,a,i,r,!0,!0);if(l(s))return h.clone(s.position,o)})}Es.prototype.sampleHeight=function(e,t,n,i){let r=Lte(e,t),o=Bw(this,e,r,n,i,!0,!1);if(l(o))return Jwe(e,o.position)};Es.prototype.clampToHeight=function(e,t,n,i,r){let o=$we(e,t),a=Bw(this,e,o,n,i,!0,!1);if(l(a))return h.clone(a.position,r)};Es.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]=XEt(this,e,t[a],n,i);return YG(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}))};Es.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]=KEt(this,e,t[a],n,i,t[a]);return YG(e,Promise.all(o).then(function(a){let s=a.length;for(let c=0;c<s;++c)t[c]=a[c];return t}))};Es.prototype.destroy=function(){this._pickOffscreenView=this._pickOffscreenView&&this._pickOffscreenView.destroy()};var G3=Es;var W3=`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 q3=`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 Y3=`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 X3=`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 K3=`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 $3=`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 J3=`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 Z3=`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 Q3=`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 ez=`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 tz=`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 nz=`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 iz=`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 WA=`#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 rz=`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 oz=`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 az=`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 sz=`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 cz=`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 lz=`/**
* @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 mC(){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 oi,this._commands=void 0,this._clearCommand=void 0,this._minMaxLuminance=new z,this.enabled=!0,this._enabled=!0,this.minimumLuminance=.1,this.maximumLuminance=10}Object.defineProperties(mC.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 Zwe(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 $Et(e,t){Zwe(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 oi,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 Qwe(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 JEt(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 ZEt(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 QEt(e,t){Qwe(e);let n=e._framebuffers,i=n.length,r=new Array(i);for(let o=0;o<i;++o)r[o]=t.createViewportQuadCommand(ZEt(o,i),{framebuffer:n[o].framebuffer,uniformMap:JEt(e,o)});e._commands=r}mC.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)};mC.prototype.update=function(e){let t=e.drawingBufferWidth,n=e.drawingBufferHeight;(t!==this._width||n!==this._height)&&(this._width=t,this._height=n,$Et(this,e),QEt(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};mC.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)};mC.prototype.isDestroyed=function(){return!1};mC.prototype.destroy=function(){return Zwe(this),Qwe(this),ue(this)};var uz=mC;var eSt={NEAREST:0,LINEAR:1},Wf=eSt;function pC(e){e=e??H.EMPTY_OBJECT;let{name:t=Kn(),fragmentShader:n,uniforms:i,textureScale:r=1,forcePowerOfTwo:o=!1,sampleMode:a=Wf.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 sc;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(pC.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 tSt=/uniform\s+sampler2D\s+depthTexture/g;pC.prototype._isSupported=function(e){return!tSt.test(this._fragmentShader)||e.depthTexture};function nSt(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 Ct&&!l(e._textureCache.getStageByName(n))&&(e._texturesToRelease.push(s),delete a[n],delete a[`${n}Dimensions`]),o instanceof Ct&&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 iSt(e,t){return function(){let n=e._actualUniforms[t];return typeof n=="function"?n():n}}function rSt(e,t){return function(){let n=e[t]();if(l(n))return n.dimensions}}function oSt(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]=iSt(e,o),n[o]=nSt(e,i,o)):(t[o]=i[o],n[o]=i[o]),r[o]=i[o];let a=t[o]();(typeof a=="string"||a instanceof Ct||a instanceof HTMLImageElement||a instanceof HTMLCanvasElement||a instanceof HTMLVideoElement)&&(t[`${o}Dimensions`]=rSt(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 aSt(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 sSt(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=aSt(n,r)}let i=new Ge({defines:[e._useLogDepth?"LOG_DEPTH":""],sources:[n]});e._command=t.createViewportQuadCommand(i,{uniformMap:e._uniformMap,owner:e})}function cSt(e){let t=e._sampleMode,n,i;t===Wf.LINEAR?(n=Gt.LINEAR,i=ei.LINEAR):(n=Gt.NEAREST,i=ei.NEAREST);let r=e._sampler;(!l(r)||r.minificationFilter!==n||r.magnificationFilter!==i)&&(e._sampler=new zt({wrapS:rn.CLAMP_TO_EDGE,wrapT:rn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i}))}function lSt(e,t){return function(n){e._texturesToCreate.push({name:t,source:n})}}function uSt(e,t){return function(){return e._textureCache.getOutputTexture(t)}}function fSt(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 Ct({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]=uSt(e,u);else if(typeof u=="string"){let d=new De({url:u});a.push(d.fetchImage().then(lSt(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 eIe(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 Ct&&(l(t.getStageByName(n[r]))||o.destroy(),e._dirtyUniforms.push(r))}}function dSt(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 hSt(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 Ct({context:t,pixelFormat:He.RGBA,pixelDatatype:ke.UNSIGNED_BYTE,source:{arrayBufferView:a,width:1,height:1},sampler:zt.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 Ct({context:t,pixelFormat:He.RGBA,pixelDatatype:ke.UNSIGNED_BYTE,source:{arrayBufferView:o,width:i,height:1},sampler:zt.NEAREST})}pC.prototype.update=function(e,t){if(this.enabled!==this._enabled&&!this.enabled&&eIe(this),this._enabled=this.enabled,!this._enabled||(this._logDepthChanged=t!==this._useLogDepth,this._useLogDepth=t,this._selectedDirty=dSt(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,hSt(this,e),oSt(this),fSt(this,e),sSt(this,e),cSt(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};pC.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,zt.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)};pC.prototype.isDestroyed=function(){return!1};pC.prototype.destroy=function(){return eIe(this),ue(this)};var Mr=pC;function gC(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(gC.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}}});gC.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};gC.prototype.get=function(e){return this._stages[e]};function mSt(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}gC.prototype.update=function(e,t){this._selectedDirty=mSt(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)}};gC.prototype.isDestroyed=function(){return!1};gC.prototype.destroy=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return ue(this)};var Xu=gC;var ra={};function Nte(e){let r=`#define USE_STEP_SIZE
${WA}`,o=new Mr({name:`${e}_x_direction`,fragmentShader:r,uniforms:{delta:1,sigma:2,stepSize:1,direction:0},sampleMode:Wf.LINEAR}),a=new Mr({name:`${e}_y_direction`,fragmentShader:r,uniforms:{delta:1,sigma:2,stepSize:1,direction:1},sampleMode:Wf.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 Xu({name:e,stages:[o,a],uniforms:s})}ra.createBlurStage=function(){return Nte("czm_blur")};ra.createDepthOfFieldStage=function(){let e=Nte("czm_depth_of_field_blur"),t=new Mr({name:"czm_depth_of_field_composite",fragmentShader:Z3,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 Xu({name:"czm_depth_of_field",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};ra.isDepthOfFieldSupported=function(e){return e.context.depthTexture};ra.createEdgeDetectionStage=function(){let e=Kn();return new Mr({name:`czm_edge_detection_${e}`,fragmentShader:ez,uniforms:{length:.25,color:U.clone(U.BLACK)}})};ra.isEdgeDetectionSupported=function(e){return e.context.depthTexture};function pSt(e){if(!l(e))return ra.createEdgeDetectionStage();let t=new Xu({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 Xu({name:"czm_edge_detection_composite",stages:[t,a]})}ra.createSilhouetteStage=function(e){let t=pSt(e),n=new Mr({name:"czm_silhouette_color_edges",fragmentShader:cz,uniforms:{silhouetteTexture:t.name}});return new Xu({name:"czm_silhouette",stages:[t,n],inputPreviousStageTexture:!1,uniforms:t.uniforms})};ra.isSilhouetteSupported=function(e){return e.context.depthTexture};ra.createBloomStage=function(){let e=new Mr({name:"czm_bloom_contrast_bias",fragmentShader:J3,uniforms:{contrast:128,brightness:-.3}}),t=Nte("czm_bloom_blur"),n=new Xu({name:"czm_bloom_contrast_bias_blur",stages:[e,t]}),i=new Mr({name:"czm_bloom_generate_composite",fragmentShader:K3,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 Xu({name:"czm_bloom",stages:[n,i],inputPreviousStageTexture:!1,uniforms:r})};ra.createAmbientOcclusionStage=function(){let e=new Mr({name:"czm_ambient_occlusion_generate",fragmentShader:q3,uniforms:{intensity:3,bias:.1,lengthCap:.26,directionCount:8,stepCount:32,randomTexture:void 0}}),t=new Mr({name:"czm_ambient_occlusion_composite",fragmentShader:Y3,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 Xu({name:"czm_ambient_occlusion",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};ra.isAmbientOcclusionSupported=function(e){return e.context.depthTexture};var gSt=`#define FXAA_QUALITY_PRESET 39
${lz}
${iz}`;ra.createFXAAStage=function(){return new Mr({name:"czm_FXAA",fragmentShader:gSt,sampleMode:Wf.LINEAR})};ra.createAcesTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
`:"";return t+=W3,new Mr({name:"czm_aces",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};ra.createFilmicTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
`:"";return t+=tz,new Mr({name:"czm_filmic",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};ra.createPbrNeutralTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
`:"";return t+=nz,new Mr({name:"czm_pbr_neutral",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};ra.createReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
`:"";return t+=sz,new Mr({name:"czm_reinhard",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};ra.createModifiedReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
`:"";return t+=oz,new Mr({name:"czm_modified_reinhard",fragmentShader:t,uniforms:{white:U.WHITE,autoExposure:void 0,exposure:1}})};ra.createAutoExposureStage=function(){return new uz};ra.createBlackAndWhiteStage=function(){return new Mr({name:"czm_black_and_white",fragmentShader:X3,uniforms:{gradations:5}})};ra.createBrightnessStage=function(){return new Mr({name:"czm_brightness",fragmentShader:$3,uniforms:{brightness:.5}})};ra.createNightVisionStage=function(){return new Mr({name:"czm_night_vision",fragmentShader:az})};ra.createDepthViewStage=function(){return new Mr({name:"czm_depth_view",fragmentShader:Q3})};ra.createLensFlareStage=function(){return new Mr({name:"czm_lens_flare",fragmentShader:rz,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 qf=ra;function S_(e){this._collection=e,this._framebuffers=[],this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0,this._updateDependencies=!1}function dz(e){for(;l(e.length);)e=e.get(e.length-1);return e.name}function Fte(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[dz(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[dz(d)]=!0)}}}return i.name}function fz(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=fz(e,t,n,p,r):s=Fte(e,t,n,p,r),a&&(r=s)}let u,f;if(a)for(u=1;u<c;++u)f=dz(i.get(u)),l(n[f])||(n[f]={}),n[f][o]=!0;else for(u=1;u<c;++u){f=dz(i.get(u));let d=n[f];for(let p=0;p<u;++p)d[dz(i.get(p))]=!0}return s}function _St(e,t){let n={};if(l(e.ambientOcclusion)){let i=e.ambientOcclusion,r=e.bloom,o=e._tonemapping,a=e.fxaa,s=fz(e,t,n,i,void 0);s=fz(e,t,n,r,s),s=Fte(e,t,n,o,s),s=fz(e,t,n,e,s),Fte(e,t,n,a,s)}else fz(e,t,n,e,void 0);return n}function ySt(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 oi({pixelFormat:s,pixelDatatype:c}),clear:void 0},p.push(d),d)}function ASt(e,t){let n=_St(e._collection,t);for(let i in n)n.hasOwnProperty(i)&&(e._stageNameToFramebuffer[i]=ySt(e,i,n[i]))}function Bte(e){let t=e._framebuffers,n=t.length;for(let i=0;i<n;++i)t[i].buffer.destroy()}function bSt(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&&(D.isPowerOfTwo(d)||(d=D.nextPowerOfTwo(d)),u=d,f=d),s.buffer.update(t,u,f),s.clear=new ui({color:s.clearColor,framebuffer:s.buffer.framebuffer})}}S_.prototype.updateDependencies=function(){this._updateDependencies=!0};S_.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)&&(Bte(this),this._framebuffers.length=0,this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0),!n&&!s)return;this._framebuffers.length===0&&ASt(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,Bte(this),bSt(this,e))};S_.prototype.clear=function(e){let t=this._framebuffers;for(let n=0;n<t.length;++n)t[n].clear.execute(e)};S_.prototype.getStageByName=function(e){return this._collection.getStageByName(e)};S_.prototype.getOutputTexture=function(e){return this._collection.getOutputTexture(e)};S_.prototype.getFramebuffer=function(e){let t=this._stageNameToFramebuffer[e];if(l(t))return t.buffer.framebuffer};S_.prototype.isDestroyed=function(){return!1};S_.prototype.destroy=function(){return Bte(this),ue(this)};var _C=S_;var tIe={REINHARD:"REINHARD",MODIFIED_REINHARD:"MODIFIED_REINHARD",FILMIC:"FILMIC",ACES:"ACES",PBR_NEUTRAL:"PBR_NEUTRAL"};Object.freeze(tIe);var w_=tIe;var kte=[];function su(){let e=qf.createFXAAStage(),t=qf.createAmbientOcclusionStage(),n=qf.createBloomStage();this._autoExposureEnabled=!1,this._autoExposure=qf.createAutoExposureStage(),this._exposure=1,this._tonemapping=void 0,this._tonemapper=void 0,this.tonemapper=w_.PBR_NEUTRAL;let i=this._tonemapping;e.enabled=!1,t.enabled=!1,n.enabled=!1,i.enabled=!1;let r=new _C(this),o={},a=kte;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(su.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 zte(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 w_.REINHARD:n=qf.createReinhardTonemappingStage(t);break;case w_.MODIFIED_REINHARD:n=qf.createModifiedReinhardTonemappingStage(t);break;case w_.FILMIC:n=qf.createFilmicTonemappingStage(t);break;case w_.PBR_NEUTRAL:n=qf.createPbrNeutralTonemappingStage(t);break;default:n=qf.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 zte(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}su.prototype.add=function(e){let t=this._stageNames,n=kte;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};su.prototype.remove=function(e){if(!this.contains(e))return!1;let t=this._stageNames,n=kte;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};su.prototype.contains=function(e){return l(e)&&l(e._index)&&e._textureCache===this._textureCache};su.prototype.get=function(e){return zte(this),this._stages[e]};su.prototype.removeAll=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)this.remove(e[n]);e.length=0};su.prototype.getStageByName=function(e){return this._stageNames[e]};su.prototype.update=function(e,t,n){zte(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 Ct({context:e,pixelFormat:He.RGB,pixelDatatype:ke.UNSIGNED_BYTE,source:{arrayBufferView:x,width:256,height:256},sampler:new zt({wrapS:rn.REPEAT,wrapT:rn.REPEAT,minificationFilter:Gt.NEAREST,magnificationFilter:ei.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)};su.prototype.clear=function(e){this._textureCache.clear(e),this._autoExposureEnabled&&this._autoExposure.clear(e)};function yC(e){for(;l(e.length);)e=e.get(e.length-1);return e.outputTexture}su.prototype.getOutputTexture=function(e){let t=this.getStageByName(e);if(l(t))return yC(t)};function f0(e,t,n,i,r){if(l(e.execute)){e.execute(t,n,i,r);return}if(e.inputPreviousStageTexture){f0(e.get(0),t,n,i,r);for(let o=1;o<e.length;++o)f0(e.get(o),t,yC(e.get(o-1)),i,r)}else for(let o=0;o<e.length;++o)f0(e.get(o),t,n,i,r)}su.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&&(f0(s,e,A,n,i),A=yC(s)),p&&c.ready&&(f0(c,e,A,n,i),A=yC(c)),g&&u.ready&&f0(u,e,A,n,i),m&&f.ready&&(f0(f,e,A,n,i),A=yC(f));let b=A;if(o>0){f0(r[0],e,A,n,i);for(let x=1;x<o;++x)f0(r[x],e,yC(r[x-1]),n,i);b=yC(r[o-1])}y&&a.ready&&f0(a,e,b,n,i)};su.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(Yu,{uniformMap:{colorTexture:function(){return n.outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};su.prototype.isDestroyed=function(){return!1};su.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 hz=su;function AC(e){this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0,this._morphToOrthographic=!1}AC.prototype.completeMorph=function(){l(this._completeMorph)&&this._completeMorph()};AC.prototype.morphTo2D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;this._previousMode=n.mode,this._morphToOrthographic=n.camera.frustum instanceof mn,!(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(L.IDENTITY),this._previousMode===re.COLUMBUS_VIEW?QSt(this,e):awt(this,e,t),e===0&&l(this._completeMorph)&&this._completeMorph())};var xSt=new h,TSt=new h,CSt=new h,vSt=new h,ESt=new h,SSt=new h,wSt=new h,ISt=new de,PSt=new L,DSt=new Gi,RSt=new mn,OSt={position:void 0,direction:void 0,up:void 0,position2D:void 0,direction2D:void 0,up2D:void 0,frustum:void 0};AC.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(L.IDENTITY);let i=xSt,r=TSt,o=CSt;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,wSt),d=mt.eastNorthUpToFixedFrame(f,t,PSt);L.inverseTransformation(d,d),n.mapProjection.project(t.cartesianToCartographic(i,ISt),i),L.multiplyByPointAsVector(d,r,r),L.multiplyByPointAsVector(d,o,o)}}let a;this._morphToOrthographic?(a=RSt,a.width=n.camera.frustum.right-n.camera.frustum.left,a.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight):(a=DSt,a.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,a.fov=D.toRadians(60));let s=OSt;s.position=i,s.direction=r,s.up=o,s.frustum=a;let c=cwt(s);mz(this,c),this._previousMode===re.SCENE2D?swt(this,e,s,c):(s.position2D=L.multiplyByPoint(vr.TRANSFORM_2D,i,vSt),s.direction2D=L.multiplyByPointAsVector(vr.TRANSFORM_2D,r,ESt),s.up2D=L.multiplyByPointAsVector(vr.TRANSFORM_2D,o,SSt),n._mode=re.MORPHING,dIe(this,e,s,c)),e===0&&l(this._completeMorph)&&this._completeMorph()};var jte={position:new h,direction:new h,up:new h,frustum:void 0},iIe=new Gi;AC.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(L.IDENTITY),this._previousMode===re.SCENE2D)HSt(this,e,t);else{let i;e>0?(i=jte,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=rIe(this,t);let r,o=n.camera;o.frustum instanceof mn?r=o.frustum.clone():(r=iIe,r.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,r.fov=D.toRadians(60)),i.frustum=r;let a=mIe(i);mz(this,a),Vte(this,e,i,a)}e===0&&l(this._completeMorph)&&this._completeMorph()}};AC.prototype.isDestroyed=function(){return!1};AC.prototype.destroy=function(){return XG(this),ue(this)};function mz(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new Ka(e._scene.canvas);let n=function(){e._morphCancelled=!0,e._scene.camera.cancelFlight(),t(e)};e._completeMorph=n,e._morphHandler.setInputAction(n,cn.LEFT_DOWN),e._morphHandler.setInputAction(n,cn.MIDDLE_DOWN),e._morphHandler.setInputAction(n,cn.RIGHT_DOWN),e._morphHandler.setInputAction(n,cn.WHEEL)}}function XG(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 MSt=new de,LSt=new h,NSt=new L;function rIe(e,t){let n=e._scene,i=n.camera,r=jte,o=r.position,a=r.direction,s=r.up,c=n.mapProjection.unproject(i.position,MSt);t.cartographicToCartesian(c,o);let u=t.scaleToGeodeticSurface(o,LSt),f=mt.eastNorthUpToFixedFrame(u,t,NSt);return L.multiplyByPointAsVector(f,i.direction,a),L.multiplyByPointAsVector(f,i.up,s),r}var FSt=new h,BSt=new h,kSt=new h,zSt=new h,USt=new h,VSt=new h;function Vte(e,t,n,i){t*=.5;let r=e._scene,o=r.camera,a=h.clone(o.position,FSt),s=h.clone(o.direction,BSt),c=h.clone(o.up,kSt),u=L.multiplyByPoint(vr.TRANSFORM_2D_INVERSE,n.position,zSt),f=L.multiplyByPointAsVector(vr.TRANSFORM_2D_INVERSE,n.direction,USt),d=L.multiplyByPointAsVector(vr.TRANSFORM_2D_INVERSE,n.up,VSt);function p(m){fh(a,u,m.time,o.position),fh(s,f,m.time,o.direction),fh(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:fa.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){hIe(e,r,0,1,t,i)}});e._currentTweens.push(g)}var jSt=new mn,oIe=new h,aIe=new h,sIe=new h,Hte=new h,cIe=new h,lIe=new h;function HSt(e,t,n){t/=3;let i=e._scene,r=i.camera,o;t>0?(o=jte,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=rIe(e,n));let a;e._morphToOrthographic?(a=jSt,a.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,a.width=r.frustum.right-r.frustum.left):(a=iIe,a.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,a.fov=D.toRadians(60)),o.frustum=a;let s=mIe(o);mz(e,s);let c;e._morphToOrthographic?c=function(){Vte(e,t,o,s)}:c=function(){fIe(e,t,o,function(){Vte(e,t,o,s)})},t>0?(i._mode=re.SCENE2D,r.flyTo({duration:t,destination:h.fromDegrees(0,0,5*n.maximumRadius,n,Hte),complete:function(){i._mode=re.MORPHING,c()}})):c()}function fh(e,t,n,i){return h.lerp(e,t,n,i)}function uIe(e,t,n,i,r){let o=e._scene,a=o.camera;if(a.frustum instanceof mn)return;let s=a.frustum.fov,c=D.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=D.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:fa.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){a.frustum=n.frustum.clone(),r(e)}});e._currentTweens.push(d)}var GSt=new h,WSt=new h,qSt=new h,Ute=new h,YSt=new h,XSt=new h,KSt=new da,$St=new dn,JSt=new h,ZSt={position:void 0,direction:void 0,up:void 0,frustum:void 0};function QSt(e,t){t*=.5;let n=e._scene,i=n.camera,r=h.clone(i.position,GSt),o=h.clone(i.direction,WSt),a=h.clone(i.up,qSt),s=h.negate(h.UNIT_Z,YSt),c=h.clone(h.UNIT_Y,XSt),u=Ute;if(t>0)h.clone(h.ZERO,Ute),u.z=5*n.ellipsoid.maximumRadius;else{h.clone(r,Ute);let A=$St;L.multiplyByPoint(vr.TRANSFORM_2D,r,A.origin),L.multiplyByPointAsVector(vr.TRANSFORM_2D,o,A.direction);let b=n.globe;if(l(b)){let x=b.pickWorldCoordinates(A,n,!0,JSt);l(x)&&(L.multiplyByPoint(vr.TRANSFORM_2D_INVERSE,x,u),u.z+=h.distance(r,u))}}let f=KSt;f.right=u.z*.5,f.left=-f.right,f.top=f.right*(n.drawingBufferHeight/n.drawingBufferWidth),f.bottom=-f.top;let d=ZSt;d.position=u,d.direction=s,d.up=c,d.frustum=f;let p=pIe(d);mz(e,p);function g(A){fh(r,u,A.time,i.position),fh(o,s,A.time,i.direction),fh(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:fa.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){uIe(e,t,d,m,p)}});e._currentTweens.push(y)}var nIe=new de,ewt={position:new h,direction:new h,up:new h,position2D:new h,direction2D:new h,up2D:new h,frustum:new da},twt={position:new h,direction:new h,up:new h,frustum:void 0},nwt=new h,iwt=new dn,rwt=new L,owt=new h;function awt(e,t,n){t*=.5;let i=e._scene,r=i.camera,o=ewt;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,nIe),i.mapProjection.project(nIe,o.position),h.negate(h.UNIT_Z,o.direction),h.clone(h.UNIT_Y,o.up);let d=iwt;h.clone(o.position2D,d.origin);let p=h.clone(r.directionWC,d.direction),g=n.scaleToGeodeticSurface(r.positionWC,owt),m=mt.eastNorthUpToFixedFrame(g,n,rwt);L.inverseTransformation(m,m),L.multiplyByPointAsVector(m,p,p),L.multiplyByPointAsVector(vr.TRANSFORM_2D,p,p);let y=i.globe;if(l(y)){let A=y.pickWorldCoordinates(d,i,!0,nwt);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}L.multiplyByPoint(vr.TRANSFORM_2D,o.position,o.position2D),L.multiplyByPointAsVector(vr.TRANSFORM_2D,o.direction,o.direction2D),L.multiplyByPointAsVector(vr.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=twt;L.multiplyByPoint(vr.TRANSFORM_2D_INVERSE,o.position2D,c.position),h.clone(o.direction,c.direction),h.clone(o.up,c.up),c.frustum=s;let u=pIe(c);mz(e,u);function f(){uIe(e,t,o,a,u)}dIe(e,t,o,f)}function fIe(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=D.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=D.lerp(c,s,p.time),o.position.z=u/Math.tan(o.frustum.fov*.5)}let d=r.tweens.add({duration:t,easingFunction:fa.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){i(e)}});e._currentTweens.push(d)}function swt(e,t,n,i){t*=.5;let r=e._scene,o=r.camera,a=h.clone(n.position,Hte),s=h.clone(n.direction,cIe),c=h.clone(n.up,lIe);r._mode=re.MORPHING;function u(){o.frustum=n.frustum.clone();let f=h.clone(o.position,oIe),d=h.clone(o.direction,aIe),p=h.clone(o.up,sIe);f.z=a.z;function g(y){fh(f,a,y.time,o.position),fh(d,s,y.time,o.direction),fh(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:fa.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){i(e)}});e._currentTweens.push(m)}e._morphToOrthographic?u():fIe(e,0,n,u)}function dIe(e,t,n,i){let r=e._scene,o=r.camera,a=h.clone(o.position,oIe),s=h.clone(o.direction,aIe),c=h.clone(o.up,sIe),u=h.clone(n.position2D,Hte),f=h.clone(n.direction2D,cIe),d=h.clone(n.up2D,lIe);function p(m){fh(a,u,m.time,o.position),fh(s,f,m.time,o.direction),fh(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:fa.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){hIe(e,r,1,0,t,i)}});e._currentTweens.push(g)}function hIe(e,t,n,i,r,o){let a={object:t,property:"morphTime",startValue:n,stopValue:i,duration:r,easingFunction:fa.QUARTIC_OUT};l(o)&&(a.complete=function(){o(e)});let s=t.tweens.addProperty(a);e._currentTweens.push(s)}function mIe(e){return function(t){let n=t._scene;n._mode=re.SCENE3D,n.morphTime=re.getMorphTime(re.SCENE3D),XG(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 pIe(e){return function(t){let n=t._scene;n._mode=re.SCENE2D,n.morphTime=re.getMorphTime(re.SCENE2D),XG(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 cwt(e){return function(t){let n=t._scene;n._mode=re.COLUMBUS_VIEW,n.morphTime=re.getMorphTime(re.COLUMBUS_VIEW),XG(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 pz=AC;var gIe={LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4};Object.freeze(gIe);var nr=gIe;var xIe=[Gr.SHIFT,Gr.CTRL,Gr.ALT,[Gr.SHIFT,Gr.CTRL],[Gr.SHIFT,Gr.ALT],[Gr.CTRL,Gr.ALT],[Gr.SHIFT,Gr.CTRL,Gr.ALT]];function Ws(e,t){if(!l(t))return`${e}`;let n=Array.isArray(t)?t.toSorted():[t];return`${e}+${n.join("+")}`}function lwt(e,t){z.clone(e.distance.startPosition,t.distance.startPosition),z.clone(e.distance.endPosition,t.distance.endPosition),z.clone(e.angleAndHeight.startPosition,t.angleAndHeight.startPosition),z.clone(e.angleAndHeight.endPosition,t.angleAndHeight.endPosition)}function _Ie(e,t,n){let i=Ws(nr.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 z;let u=e._movement[i];l(u)||(u=e._movement[i]={}),u.distance={startPosition:new z,endPosition:new z},u.angleAndHeight={startPosition:new z,endPosition:new z},u.prevAngle=0,e._eventHandler.setInputAction(function(f){e._buttonsDown++,o[i]=!0,s[i]=new Date,z.lerp(f.position1,f.position2,.5,a[i])},cn.PINCH_START,t),e._eventHandler.setInputAction(function(){e._buttonsDown=Math.max(e._buttonsDown-1,0),o[i]=!1,c[i]=new Date},cn.PINCH_END,t),e._eventHandler.setInputAction(function(f){if(o[i]){r[i]?(lwt(f,u),r[i]=!1,u.prevAngle=u.angleAndHeight.startPosition.x):(z.clone(f.distance.endPosition,u.distance.endPosition),z.clone(f.angleAndHeight.endPosition,u.angleAndHeight.endPosition));let 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}},cn.PINCH_MOVE,t)}function yIe(e,t){let n=Ws(nr.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 z,endPosition:new z,valid:!1}),a.startPosition=new z,z.clone(z.ZERO,a.startPosition),a.endPosition=new z,e._eventHandler.setInputAction(function(c){let u=7.5*D.toRadians(c);i[n]=r[n]=new Date,a.endPosition.x=0,a.endPosition.y=u,z.clone(a.endPosition,s.endPosition),s.valid=!0,o[n]=!1},cn.WHEEL,t)}function kw(e,t,n){let i=Ws(n,t),r=e._isDown,o=e._eventStartPosition,a=e._pressTime;r[i]=!1,o[i]=new z;let s=e._lastMovement[i];l(s)||(s=e._lastMovement[i]={startPosition:new z,endPosition:new z,valid:!1});let c,u;n===nr.LEFT_DRAG?(c=cn.LEFT_DOWN,u=cn.LEFT_UP):n===nr.RIGHT_DRAG?(c=cn.RIGHT_DOWN,u=cn.RIGHT_UP):n===nr.MIDDLE_DRAG&&(c=cn.MIDDLE_DOWN,u=cn.MIDDLE_UP),e._eventHandler.setInputAction(function(f){e._buttonsDown++,s.valid=!1,r[i]=!0,a[i]=new Date,z.clone(f.position,o[i])},c,t),e._eventHandler.setInputAction(function(){Gte(Ws(n,void 0),e);for(let f of xIe){let d=Ws(n,f);Gte(d,e)}},u,t)}function Gte(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 AIe(e,t){z.clone(e.startPosition,t.startPosition),z.clone(e.endPosition,t.endPosition)}function uwt(e,t,n){let i=n._isDown,r=!1,o=Ws(e,t);for(let[c,u]of Object.entries(i))c.startsWith(e)&&u&&c!==o&&(r=!0,Gte(c,n));if(!r)return;let a=n._pressTime,s=n._lastMovement[o];l(s)||(s=n._lastMovement[o]={startPosition:new z,endPosition:new z,valid:!1}),n._buttonsDown++,s.valid=!1,i[o]=!0,a[o]=new Date}function bIe(e,t){let n=e._update,i=e._movement,r=e._lastMovement,o=e._isDown;for(let a in nr)if(nr.hasOwnProperty(a)){let s=nr[a];if(l(s)){let c=Ws(s,t);n[c]=!0,l(e._lastMovement[c])||(e._lastMovement[c]={startPosition:new z,endPosition:new z,valid:!1}),l(e._movement[c])||(e._movement[c]={startPosition:new z,endPosition:new z})}}e._eventHandler.setInputAction(function(a){for(let s in nr)if(nr.hasOwnProperty(s)){let c=nr[s];if(l(c)){let u=Ws(c,t);uwt(c,t,e),o[u]&&(n[u]?(AIe(i[u],r[u]),r[u].valid=!0,AIe(a,i[u]),n[u]=!1):z.clone(a.endPosition,i[u].endPosition))}}z.clone(a.endPosition,e._currentMousePosition)},cn.MOUSE_MOVE,t)}function dh(e){this._eventHandler=new Ka(e),this._update={},this._movement={},this._lastMovement={},this._isDown={},this._eventStartPosition={},this._pressTime={},this._releaseTime={},this._buttonsDown=0,this._currentMousePosition=new z,yIe(this,void 0),_Ie(this,void 0,e),kw(this,void 0,nr.LEFT_DRAG),kw(this,void 0,nr.RIGHT_DRAG),kw(this,void 0,nr.MIDDLE_DRAG),bIe(this,void 0);for(let t of xIe)yIe(this,t),_Ie(this,t,e),kw(this,t,nr.LEFT_DRAG),kw(this,t,nr.RIGHT_DRAG),kw(this,t,nr.MIDDLE_DRAG),bIe(this,t)}Object.defineProperties(dh.prototype,{currentMousePosition:{get:function(){return this._currentMousePosition}},anyButtonDown:{get:function(){let e=!this._update[Ws(nr.WHEEL)]||!this._update[Ws(nr.WHEEL,Gr.SHIFT)]||!this._update[Ws(nr.WHEEL,Gr.CTRL)]||!this._update[Ws(nr.WHEEL,Gr.ALT)];return this._buttonsDown>0||e}}});dh.prototype.isMoving=function(e,t){let n=Ws(e,t);return!this._update[n]};dh.prototype.getMovement=function(e,t){let n=Ws(e,t);return this._movement[n]};dh.prototype.getLastMovement=function(e,t){let n=Ws(e,t),i=this._lastMovement[n];if(i.valid)return i};dh.prototype.isButtonDown=function(e,t){let n=Ws(e,t);return this._isDown[n]};dh.prototype.getStartMousePosition=function(e,t){if(e===nr.WHEEL)return this._currentMousePosition;let n=Ws(e,t);return this._eventStartPosition[n]};dh.prototype.getButtonPressTime=function(e,t){let n=Ws(e,t);return this._pressTime[n]};dh.prototype.getButtonReleaseTime=function(e,t){let n=Ws(e,t);return this._releaseTime[n]};dh.prototype.reset=function(){for(let e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)};dh.prototype.isDestroyed=function(){return!1};dh.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),ue(this)};var gz=dh;function KG(e,t,n,i,r,o,a,s,c,u){this._tweens=e,this._tweenjs=t,this._startObject=Ye(n),this._stopObject=Ye(i),this._duration=r,this._delay=o,this._easingFunction=a,this._update=s,this._complete=c,this.cancel=u,this.needsStart=!0}Object.defineProperties(KG.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}}});KG.prototype.cancelTween=function(){this._tweens.remove(this)};function Um(){this._tweens=[]}Object.defineProperties(Um.prototype,{length:{get:function(){return this._tweens.length}}});Um.prototype.add=function(e){if(e=e??H.EMPTY_OBJECT,e.duration===0)return l(e.complete)&&e.complete(),new KG(this);let t=e.duration/zn.SECONDS_PER_MILLISECOND,n=e.delay??0,i=n/zn.SECONDS_PER_MILLISECOND,r=e.easingFunction??fa.LINEAR_NONE,o=e.startObject,a=new Rhe(o);a.to(Ye(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 KG(this,a,e.startObject,e.stopObject,e.duration,n,r,e.update,e.complete,e.cancel);return this._tweens.push(s),s};Um.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})};Um.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})};Um.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})};Um.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};Um.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};Um.prototype.contains=function(e){return l(e)&&this._tweens.indexOf(e)!==-1};Um.prototype.get=function(e){return this._tweens[e]};Um.prototype.update=function(e){let t=this._tweens,n=0;for(e=l(e)?e/zn.SECONDS_PER_MILLISECOND:yn();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 bC=Um;function yz(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=nr.LEFT_DRAG,this.zoomEventTypes=[nr.RIGHT_DRAG,nr.WHEEL,nr.PINCH],this.rotateEventTypes=nr.LEFT_DRAG,this.tiltEventTypes=[nr.MIDDLE_DRAG,nr.PINCH,{eventType:nr.LEFT_DRAG,modifier:Gr.CTRL},{eventType:nr.RIGHT_DRAG,modifier:Gr.CTRL}],this.lookEventTypes={eventType:nr.LEFT_DRAG,modifier:Gr.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 gz(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 bC,this._tween=void 0,this._horizontalRotationAxis=void 0,this._tiltCenterMousePosition=new z(-1,-1),this._tiltCenter=new h,this._rotateMousePosition=new z(-1,-1),this._rotateStartPosition=new h,this._strafeStartPosition=new h,this._strafeMousePosition=new z,this._strafeEndMousePosition=new z,this._zoomMouseStart=new z(-1,-1),this._zoomWorldPosition=new h,this._useZoomWorldPosition=!1,this._panLastMousePosition=new z,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,D.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 fwt(e,t){if(e<0)return 0;let n=(1-t)*25;return Math.exp(-n*e)}function dwt(e){return z.equalsEpsilon(e.startPosition,e.endPosition,D.EPSILON14)}var hwt=.4;function mwt(e,t,n,i,r,o,a){let s=o[a];l(s)||(s=o[a]={startPosition:new z,endPosition:new z,motion:new z,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<hwt){let g=fwt(p,i),m=e.getLastMovement(t,n);if(!l(m)||dwt(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=z.clone(m.startPosition,s.startPosition),s.endPosition=z.multiplyByScalar(s.motion,g,s.endPosition),s.endPosition=z.add(s.startPosition,s.endPosition,s.endPosition),isNaN(s.endPosition.x)||isNaN(s.endPosition.y)||z.distance(s.startPosition,s.endPosition)<.5))return;if(!e.isButtonDown(t,n)){let y=e.getStartMousePosition(t,n);r(o,y,s)}}}function pwt(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 TIe=[];function cu(e,t,n,i,r,o){if(!l(n))return;let a=e._aggregator;Array.isArray(n)||(TIe[0]=n,n=TIe);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),pwt(e,o)):r<1&&mwt(a,f,d,r,i,e,o))}}var $G=new dn,gwt=new h,_wt=new z,ywt=new h,Awt=new z,bwt=new h,xwt=new h,Twt=new h,Cwt=new h,LIe=new h,vwt=new h,Ewt=new h,Swt=new h,wwt=new h,Iwt=new h,Pwt=new h,Dwt=new h,Rwt=new h,Owt=new h,Mwt=new h,xC=new h,CIe=new h,vIe=new h,Wte={orientation:new Tc};function Qte(e,t,n,i,r,o){let a=1;l(o)&&(a=D.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=D.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=Wte.orientation;x.heading=A.heading,x.pitch=A.pitch,x.roll=A.roll;let T=n.inertiaEnabled??z.equals(t,e._zoomMouseStart),C=e._zoomingOnVector,E=e._rotatingZoom,w;if(T||(e._zoomMouseStart=z.clone(t,e._zoomMouseStart),l(e._globe)&&b===re.SCENE2D?(w=A.getPickRay(t,$G).origin,w=h.fromElements(w.y,w.z,w.x)):l(e._globe)&&(w=I_(e,t,gwt)),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 P=b===re.COLUMBUS_VIEW;if(A.positionCartographic.height<2e6&&(E=!0),!T||E){if(b===re.SCENE2D){let R=e._zoomWorldPosition,O=A.position;if(!h.equals(R,O)&&A.positionCartographic.height<e._maxCoord.x*2){let N=A.position.x,_=h.subtract(R,O,ywt);h.normalize(_,_);let v=h.distance(R,O)*m/(A.getMagnitude()*.5);A.move(_,v*.5),(A.position.x<0&&N>0||A.position.x>0&&N<0)&&(w=A.getPickRay(t,$G).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,LIe);if(e._cameraUnderground||e._zoomingUnderground||A.positionCartographic.height<3e3&&Math.abs(h.dot(A.direction,R))<.6)P=!0;else{let O=y.canvas,N=Awt;N.x=O.clientWidth/2,N.y=O.clientHeight/2;let _=I_(e,N,bwt);if(!l(_))P=!0;else if(A.positionCartographic.height<1e6)if(h.dot(A.direction,R)>=-.5)P=!0;else{let v=Ewt;h.clone(A.position,v);let S=e._zoomWorldPosition,I=vwt;if(I=h.normalize(S,I),h.dot(I,R)<0)return;let M=Mwt,F=Iwt;h.clone(A.direction,F),h.add(v,h.multiplyByScalar(F,1e3,xC),M);let V=Pwt,k=Dwt;h.subtract(S,v,V),h.normalize(V,k);let j=h.dot(R,k);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(D.clamp(q/W*Math.sin(B),-1,1)),Z=Math.asin(D.clamp(Q/W*Math.sin(B),-1,1)),ce=J-Z+B,Ae=Swt;h.normalize(v,Ae);let le=wwt;le=h.cross(k,Ae,le),le=h.normalize(le,le),h.normalize(h.cross(Ae,le,xC),F),h.multiplyByScalar(h.normalize(M,xC),h.magnitude(M)-m,M),h.normalize(v,v),h.multiplyByScalar(v,Q,v);let Ce=Rwt;h.multiplyByScalar(h.add(h.multiplyByScalar(Ae,Math.cos(ce)-1,CIe),h.multiplyByScalar(F,Math.sin(ce),vIe),xC),Q,Ce),h.add(v,Ce,v),h.normalize(M,Ae),h.normalize(h.cross(Ae,le,xC),F);let ye=Owt;h.multiplyByScalar(h.add(h.multiplyByScalar(Ae,Math.cos(ce)-1,CIe),h.multiplyByScalar(F,Math.sin(ce),vIe),xC),h.magnitude(M),ye),h.add(M,ye,M),h.clone(v,A.position),h.normalize(h.subtract(M,v,xC),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(Wte);return}else{let v=h.normalize(_,xwt),S=h.normalize(e._zoomWorldPosition,Twt),I=h.dot(S,v);if(I>0&&I<1){let M=D.acosClamped(I),F=h.cross(S,v,Cwt),V=Math.abs(M)>D.toRadians(20)?A.positionCartographic.height*.75:A.positionCartographic.height-m,k=m/V;A.rotate(F,M*k)}}}}e._rotatingZoom=!P}if(!T&&P||C){let R,O=sr.worldToWindowCoordinates(y,e._zoomWorldPosition,_wt);b!==re.COLUMBUS_VIEW&&z.equals(t,e._zoomMouseStart)&&l(O)?R=A.getPickRay(O,$G):R=A.getPickRay(t,$G);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(Wte)}var Lwt=new dn,Nwt=new dn,Fwt=new h;function Bwt(e,t,n){let r=e._scene.camera,o=r.getPickRay(n.startPosition,Lwt).origin,a=r.getPickRay(n.endPosition,Nwt).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,Fwt),c=h.magnitude(s);c>0&&(h.normalize(s,s),r.move(s,c))}function EIe(e,t,n){l(n.distance)&&(n=n.distance);let r=e._scene.camera;Qte(e,t,n,e.zoomFactor,r.getMagnitude())}var kwt=new z,zwt=new z;function SIe(e,t,n){if(l(n.angleAndHeight)){Uwt(e,t,n.angleAndHeight);return}let i=e._scene,r=i.camera,o=i.canvas,a=o.clientWidth,s=o.clientHeight,c=kwt;c.x=2/a*n.startPosition.x-1,c.y=2/s*(s-n.startPosition.y)-1,c=z.normalize(c,c);let u=zwt;u.x=2/a*n.endPosition.x-1,u.y=2/s*(s-n.endPosition.y)-1,u=z.normalize(u,u);let f=D.acosClamped(c.x);c.y<0&&(f=D.TWO_PI-f);let d=D.acosClamped(u.x);u.y<0&&(d=D.TWO_PI-d);let p=d-f;r.twistRight(p)}function Uwt(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 Vwt(e){let t=e._scene.mapMode2D===au.ROTATE;L.equals(L.IDENTITY,e._scene.camera.transform)?(cu(e,e.enableTranslate,e.translateEventTypes,Bwt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),cu(e,e.enableZoom,e.zoomEventTypes,EIe,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&cu(e,e.enableRotate,e.tiltEventTypes,SIe,e.inertiaSpin,"_lastInertiaTiltMovement")):(cu(e,e.enableZoom,e.zoomEventTypes,EIe,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&cu(e,e.enableRotate,e.translateEventTypes,SIe,e.inertiaSpin,"_lastInertiaSpinMovement"))}var NIe=new dn,jwt=new h,Hwt=new h;function I_(e,t,n){let i=e._scene,r=e._globe,o=i.camera,a;if(i.pickPositionSupported&&(a=i.pickPositionWorldCoordinates(t,jwt)),!l(r))return h.clone(a,n);let s=!e._cameraUnderground,c=o.getPickRay(t,NIe),u=r.pickWorldCoordinates(c,i,s,Hwt),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 Gwt=new de;function i5(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,Gwt);l(c)&&(o=c.height)}else o=i.position.z;let a=e._scene.globeHeight??0;return Math.abs(a-o)}var Wwt=new h;function FIe(e,t){let n=t.origin,i=t.direction,r=i5(e),o=h.normalize(n,Wwt),a=Math.abs(h.dot(o,i));return a=Math.max(a,.5)*2,r*a}function BIe(e,t,n,i){let r=h.distance(t.origin,n),o=i5(e),a=D.clamp(o*5,e._minimumUndergroundPickDistance,e._maximumUndergroundPickDistance);return r>a&&(r=Math.min(r,o/5),r=Math.max(r,100)),dn.getPoint(t,r,i)}function kIe(e,t,n,i){let r;return l(n)?(r=h.distance(t.origin,n),r>e._maximumUndergroundPickDistance&&(r=i5(e))):r=i5(e),dn.getPoint(t,r,i)}var qwt=new z;function zIe(e,t){let n=t.endPosition,i=z.subtract(t.endPosition,t.startPosition,qwt),r=e._strafeEndMousePosition;z.add(r,i,r),t.endPosition=r,ene(e,t,e._strafeStartPosition),t.endPosition=n}var wIe=new dn,Ywt=new dn,qte=new h,Xwt=new h,Kwt=new h,$wt=new h,Jwt=new en(h.UNIT_X,0),Zwt=new z,Qwt=new z;function eIt(e,t,n){if(h.equals(t,e._translateMousePosition)||(e._looking=!1),h.equals(t,e._strafeMousePosition)||(e._strafing=!1),e._looking){Xf(e,t,n);return}if(e._strafing){zIe(e,n);return}let r=e._scene.camera,o=e._cameraUnderground,a=z.clone(n.startPosition,Zwt),s=z.clone(n.endPosition,Qwt),c=r.getPickRay(a,wIe),u=h.clone(h.ZERO,$wt),f=h.UNIT_X,d;if(r.position.z<e._minimumPickingTerrainHeight&&(d=I_(e,a,qte),l(d)&&(u.x=d.x)),o||u.x>r.position.z&&l(d)){let T=d;o&&(T=kIe(e,c,d,qte)),z.clone(t,e._strafeMousePosition),z.clone(t,e._strafeEndMousePosition),h.clone(T,e._strafeStartPosition),e._strafing=!0,ene(e,n,e._strafeStartPosition);return}let p=en.fromPointNormal(u,f,Jwt);c=r.getPickRay(a,wIe);let g=ci.rayPlane(c,p,qte),m=r.getPickRay(s,Ywt),y=ci.rayPlane(m,p,Xwt);if(!l(g)||!l(y)){e._looking=!0,Xf(e,t,n),z.clone(t,e._translateMousePosition);return}let A=h.subtract(g,y,Kwt),b=A.x;A.x=A.y,A.y=A.z,A.z=b;let x=h.magnitude(A);x>D.EPSILON6&&(h.normalize(A,A),r.move(A,x))}var UIe=new z,QG=new dn,e5=new h,tIt=new h,VIe=new L,nIt=new L,iIt=new h,rIt=new en(h.UNIT_X,0),Yte=new h,$te=new de,jIe=new L,oIt=new Fe,aIt=new $,t5=new h;function sIt(e,t,n){if(l(n.angleAndHeight)&&(n=n.angleAndHeight),z.equals(t,e._tiltCenterMousePosition)||(e._tiltCVOffMap=!1,e._looking=!1),e._looking){Xf(e,t,n);return}let r=e._scene.camera;e._tiltCVOffMap||!e.onMap()||Math.abs(r.position.z)>e._minimumPickingTerrainHeight?(e._tiltCVOffMap=!0,cIt(e,t,n)):lIt(e,t,n)}function cIt(e,t,n){let i=e._scene,r=i.camera,o=i.canvas,a=UIe;a.x=o.clientWidth/2,a.y=o.clientHeight/2;let s=r.getPickRay(a,QG),c=h.UNIT_X,u=s.origin,f=s.direction,d,p=h.dot(c,f);if(Math.abs(p)>D.EPSILON6&&(d=-h.dot(c,u)/p),!l(d)||d<=0){e._looking=!0,Xf(e,t,n),z.clone(t,e._tiltCenterMousePosition);return}let g=h.multiplyByScalar(f,d,e5);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,$te);y.cartographicToCartesian(A,g);let b=mt.eastNorthUpToFixedFrame(g,y,VIe),x=e._globe,T=e._ellipsoid;e._globe=void 0,e._ellipsoid=te.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let C=L.clone(r.transform,jIe);r._setTransform(b),Yf(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 lIt(e,t,n){let i=e._scene,r=i.camera,o=e._cameraUnderground,a,s,c=h.UNIT_X;if(z.equals(t,e._tiltCenterMousePosition))a=h.clone(e._tiltCenter,e5);else{if(r.position.z<e._minimumPickingTerrainHeight&&(a=I_(e,t,e5)),!l(a)){s=r.getPickRay(t,QG);let _=s.origin,v=s.direction,S,I=h.dot(c,v);if(Math.abs(I)>D.EPSILON6&&(S=-h.dot(c,_)/I),!l(S)||S<=0){e._looking=!0,Xf(e,t,n),z.clone(t,e._tiltCenterMousePosition);return}a=h.multiplyByScalar(v,S,e5),h.add(_,a,a)}o&&(l(s)||(s=r.getPickRay(t,QG)),BIe(e,s,a,a)),z.clone(t,e._tiltCenterMousePosition),h.clone(a,e._tiltCenter)}let u=i.canvas,f=UIe;f.x=u.clientWidth/2,f.y=e._tiltCenterMousePosition.y,s=r.getPickRay(f,QG);let d=h.clone(h.ZERO,iIt);d.x=a.x;let p=en.fromPointNormal(d,c,rIt),g=ci.rayPlane(s,p,tIt),m=r._projection,y=m.ellipsoid;h.fromElements(a.y,a.z,a.x,a);let A=m.unproject(a,$te);y.cartographicToCartesian(A,a);let b=mt.eastNorthUpToFixedFrame(a,y,VIe),x;l(g)?(h.fromElements(g.y,g.z,g.x,g),A=m.unproject(g,$te),y.cartographicToCartesian(A,g),x=mt.eastNorthUpToFixedFrame(g,y,nIt)):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=L.clone(r.transform,jIe);r._setTransform(b);let P=h.cross(h.UNIT_Z,h.normalize(r.position,Yte),Yte),R=h.dot(r.right,P);if(Yf(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,Yf(e,t,n,E,!0,!1),r.constrainedAxis=v}else Yf(e,t,n,E,!0,!1);if(l(r.constrainedAxis)){let _=h.cross(r.direction,r.constrainedAxis,t5);h.equalsEpsilon(_,h.ZERO,D.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 O=C.maximumRadius;e._rotateFactor=1/O,e._rotateRateRangeAdjustment=O;let N=h.clone(r.positionWC,Yte);if(e.enableCollisionDetection&&ine(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 I=Fe.fromAxisAngle(S,v,oIt),M=$.fromQuaternion(I,aIt);$.multiplyByVector(M,r.direction,r.direction),$.multiplyByVector(M,r.up,r.up),h.cross(r.direction,r.up,r.right),h.cross(r.right,r.direction,r.up),r._setTransform(w)}}var HIe=new z,GIe=new dn,WIe=new h;function uIt(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=HIe,s.x=o.clientWidth/2,s.y=o.clientHeight/2);let c=r.getPickRay(s,GIe),u=c.origin,f=c.direction,d=r.position.z,p;d<e._minimumPickingTerrainHeight&&(p=I_(e,s,WIe));let g;if(l(p)&&(g=h.distance(u,p)),a){let m=FIe(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)}Qte(e,t,n,e.zoomFactor,g)}function fIt(e){let n=e._scene.camera;if(!L.equals(L.IDENTITY,n.transform))cu(e,e.enableRotate,e.rotateEventTypes,Yf,e.inertiaSpin,"_lastInertiaSpinMovement"),cu(e,e.enableZoom,e.zoomEventTypes,YIe,e.inertiaZoom,"_lastInertiaZoomMovement");else{let i=e._tweens;if(e._aggregator.anyButtonDown&&i.removeAll(),cu(e,e.enableTilt,e.tiltEventTypes,sIt,e.inertiaSpin,"_lastInertiaTiltMovement"),cu(e,e.enableTranslate,e.translateEventTypes,eIt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),cu(e,e.enableZoom,e.zoomEventTypes,uIt,e.inertiaZoom,"_lastInertiaZoomMovement"),cu(e,e.enableLook,e.lookEventTypes,Xf),!e._aggregator.anyButtonDown&&!i.contains(e._tween)){let r=n.createCorrectPositionTween(e.bounceAnimationTime);l(r)&&(e._tween=i.add(r))}i.update()}}var dIt=new dn,hIt=new en(h.UNIT_X,0),mIt=new h,pIt=new h;function ene(e,t,n){let i=e._scene,r=i.camera,o=r.getPickRay(t.endPosition,dIt),a=h.clone(r.direction,pIt);i.mode===re.COLUMBUS_VIEW&&h.fromElements(a.z,a.x,a.y,a);let s=en.fromPointNormal(n,a,hIt),c=ci.rayPlane(o,s,mIt);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 IIe=new h,qIe=new de,Jte=new h,Zte=new te,gIt=new h,_It=new h,yIt=new h;function AIt(e,t,n){let r=e._scene.camera,o=e._cameraUnderground,a=e._ellipsoid;if(!L.equals(r.transform,L.IDENTITY)){Yf(e,t,n);return}let s,c,u=a.geodeticSurfaceNormal(r.position,gIt);if(z.equals(t,e._rotateMousePosition)){if(e._looking)Xf(e,t,n,u);else if(e._rotating)Yf(e,t,n);else if(e._strafing)zIe(e,n);else{if(h.magnitude(r.position)<h.magnitude(e._rotateStartPosition))return;s=h.magnitude(e._rotateStartPosition),c=Jte,c.x=c.y=c.z=s,a=te.fromCartesian3(c,Zte),Kte(e,t,n,a)}return}e._looking=!1,e._rotating=!1,e._strafing=!1;let f=a.cartesianToCartographic(r.positionWC,qIe).height,d=e._globe;if(l(d)&&f<e._minimumPickingTerrainHeight){let p=I_(e,n.startPosition,yIt);if(l(p)){let g,m=r.getPickRay(n.startPosition,NIe);if(o)g=!0,kIe(e,m,p,p);else{let y=a.geodeticSurfaceNormal(p,_It);Math.abs(h.dot(m.direction,y))<.05?g=!0:g=h.magnitude(r.position)<h.magnitude(p)}g?(z.clone(t,e._strafeEndMousePosition),h.clone(p,e._strafeStartPosition),e._strafing=!0,ene(e,n,e._strafeStartPosition)):(s=h.magnitude(p),c=Jte,c.x=c.y=c.z=s,a=te.fromCartesian3(c,Zte),Kte(e,t,n,a),h.clone(p,e._rotateStartPosition))}else e._looking=!0,Xf(e,t,n,u)}else l(r.pickEllipsoid(n.startPosition,e._ellipsoid,IIe))?(Kte(e,t,n,e._ellipsoid),h.clone(IIe,e._rotateStartPosition)):f>e._minimumTrackBallHeight?(e._rotating=!0,Yf(e,t,n)):(e._looking=!0,Xf(e,t,n,u));z.clone(t,e._rotateMousePosition)}function Yf(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 Xte=ae.clone(ae.UNIT_W),PIe=ae.clone(ae.UNIT_W),JG=new h,zw=new h,ZG=new h,DIe=new h,bIt=new z,xIt=new z,TIt=new z,CIt=new z,vIt=new dn;function Kte(e,t,n,i){let r=e._scene,o=r.camera,a=z.clone(n.startPosition,bIt),s=z.clone(n.endPosition,xIt),c=i.cartesianToCartographic(o.positionWC,qIe).height,u,f;if(!n.inertiaEnabled&&c<e._minimumPickingTerrainHeight&&(u=h.clone(e._panLastWorldPosition,Xte),!l(e._globe)&&!z.equalsEpsilon(a,e._panLastMousePosition)&&(u=I_(e,a,Xte)),!l(e._globe)&&l(u))){let d=h.subtract(u,o.positionWC,zw),p=h.multiplyByScalar(o.directionWC,h.dot(o.directionWC,d),zw),g=h.magnitude(p),m=o.frustum.getPixelDimensions(r.drawingBufferWidth,r.drawingBufferHeight,g,r.pixelRatio,CIt),y=z.subtract(s,a,TIt),A=h.multiplyByScalar(o.rightWC,y.x*m.x,zw),b=h.normalize(o.positionWC,LIe),x=o.getPickRay(s,vIt).direction,T=h.subtract(x,h.projectVector(x,o.rightWC,ZG),ZG),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)),P=-y.y*m.y*2/Math.sqrt(E)*(1-w),R=h.multiplyByScalar(x,P,ZG);w=Math.abs(h.dot(o.upWC,b));let O=h.multiplyByScalar(o.upWC,-y.y*(1-w)*m.y,DIe);f=h.add(u,A,PIe),f=h.add(f,R,f),f=h.add(f,O,f),h.clone(f,e._panLastWorldPosition),z.clone(s,e._panLastMousePosition)}if((!l(u)||!l(f))&&(u=o.pickEllipsoid(a,i,Xte),f=o.pickEllipsoid(s,i,PIe)),!l(u)||!l(f)){e._rotating=!0,Yf(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,JG);h.cross(p,d,p),h.normalize(p,p);let g=h.cross(d,p,zw),m=h.magnitude(u),y=h.dot(d,u),A=Math.acos(y/m),b=h.multiplyByScalar(d,y,ZG);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,DIe);h.subtract(f,E,E),h.normalize(E,E);let w=Math.acos(h.dot(b,p));h.dot(b,g)<0&&(w=D.TWO_PI-w);let P=Math.acos(h.dot(E,p));h.dot(E,g)<0&&(P=D.TWO_PI-P);let R=w-P,O;h.equalsEpsilon(d,o.position,D.EPSILON2)?O=o.right:O=h.cross(d,o.position,JG);let N=h.cross(d,O,JG),_=h.dot(N,h.subtract(u,d,zw)),v=h.dot(N,h.subtract(f,d,zw)),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,JG);if(d<1&&!h.equalsEpsilon(p,h.ZERO,D.EPSILON14)){let g=Math.acos(d);o.rotate(p,g)}}}var EIt=new h,SIt=new de,RIe=0;function YIe(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=HIe,u.x=s.clientWidth/2,u.y=s.clientHeight/2);let f=a.getPickRay(u,GIe),d,p=r.cartesianToCartographic(a.position,SIt).height,g=Math.abs(RIe)<e.minimumPickingTerrainDistanceWithInertia;(i?g:p<e._minimumPickingTerrainHeight)&&(d=I_(e,u,WIe));let y;if(l(d)&&(y=h.distance(f.origin,d)),!l(e._globe)&&l(y)&&a.getMagnitude()<y&&(y=void 0),l(y)&&(RIe=y),c){let b=FIe(e,f,p);l(y)?y=Math.min(y,b):y=b}l(y)||(y=p);let A=h.normalize(a.position,EIt);Qte(e,t,n,e.zoomFactor,y,h.dot(A,a.direction))}var XIe=new z,n5=new dn,_z=new h,wIt=new h,KIe=new L,IIt=new L,$Ie=new L,PIt=new Fe,DIt=new $,tne=new de,nne=new h;function RIt(e,t,n){let r=e._scene.camera;if(!L.equals(r.transform,L.IDENTITY))return;if(l(n.angleAndHeight)&&(n=n.angleAndHeight),z.equals(t,e._tiltCenterMousePosition)||(e._tiltOnEllipsoid=!1,e._looking=!1),e._looking){let s=e._ellipsoid.geodeticSurfaceNormal(r.position,nne);Xf(e,t,n,s);return}let a=e._ellipsoid.cartesianToCartographic(r.position,tne);e._tiltOnEllipsoid||a.height>e._minimumCollisionTerrainHeight?(e._tiltOnEllipsoid=!0,MIt(e,t,n)):LIt(e,t,n)}var OIt=new de;function MIt(e,t,n){let i=e._ellipsoid,r=e._scene,o=r.camera,a=e.minimumZoomDistance*.25,s=i.cartesianToCartographic(o.positionWC,OIt).height;if(s-a-1<D.EPSILON3&&n.endPosition.y-n.startPosition.y<0)return;let c=r.canvas,u=XIe;u.x=c.clientWidth/2,u.y=c.clientHeight/2;let f=o.getPickRay(u,n5),d,p=ci.rayEllipsoid(f,i);if(l(p))d=dn.getPoint(f,p.start,_z);else if(s>e._minimumTrackBallHeight){let x=ci.grazingAltitudeLocation(f,i);if(!l(x))return;let T=i.cartesianToCartographic(x,tne);T.height=0,d=i.cartographicToCartesian(T,_z)}else{e._looking=!0;let x=e._ellipsoid.geodeticSurfaceNormal(o.position,nne);Xf(e,t,n,x),z.clone(t,e._tiltCenterMousePosition);return}let g=mt.eastNorthUpToFixedFrame(d,i,KIe),m=e._globe,y=e._ellipsoid;e._globe=void 0,e._ellipsoid=te.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let A=L.clone(o.transform,$Ie);o._setTransform(g),Yf(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 LIt(e,t,n){let i=e._ellipsoid,r=e._scene,o=r.camera,a=e._cameraUnderground,s,c,u;if(z.equals(t,e._tiltCenterMousePosition))s=h.clone(e._tiltCenter,_z);else{if(s=I_(e,t,_z),!l(s)){if(c=o.getPickRay(t,n5),u=ci.rayEllipsoid(c,i),!l(u)){if(i.cartesianToCartographic(o.position,tne).height<=e._minimumTrackBallHeight){e._looking=!0;let v=e._ellipsoid.geodeticSurfaceNormal(o.position,nne);Xf(e,t,n,v),z.clone(t,e._tiltCenterMousePosition)}return}s=dn.getPoint(c,u.start,_z)}a&&(l(c)||(c=o.getPickRay(t,n5)),BIe(e,c,s,s)),z.clone(t,e._tiltCenterMousePosition),h.clone(s,e._tiltCenter)}let f=r.canvas,d=XIe;d.x=f.clientWidth/2,d.y=e._tiltCenterMousePosition.y,c=o.getPickRay(d,n5);let p=h.magnitude(s),g=h.fromElements(p,p,p,Jte),m=te.fromCartesian3(g,Zte);if(u=ci.rayEllipsoid(c,m),!l(u))return;let y=h.magnitude(c.origin)>p?u.start:u.stop,A=dn.getPoint(c,y,wIt),b=mt.eastNorthUpToFixedFrame(s,i,KIe),x=mt.eastNorthUpToFixedFrame(A,m,IIt),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=L.clone(o.transform,$Ie);o._setTransform(x);let P=h.cross(A,o.positionWC,t5);if(h.dot(o.rightWC,P)<0){let _=n.startPosition.y-n.endPosition.y;(a&&_<0||!a&&_>0)&&(E=void 0);let v=o.constrainedAxis;o.constrainedAxis=void 0,Yf(e,t,n,E,!0,!1),o.constrainedAxis=v}else Yf(e,t,n,E,!0,!1);if(o._setTransform(b),Yf(e,t,n,E,!1,!0),l(o.constrainedAxis)){let _=h.cross(o.direction,o.constrainedAxis,t5);h.equalsEpsilon(_,h.ZERO,D.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 O=C.maximumRadius;e._rotateFactor=1/O,e._rotateRateRangeAdjustment=O;let N=h.clone(o.positionWC,t5);if(e.enableCollisionDetection&&ine(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 I=Fe.fromAxisAngle(S,v,PIt),M=$.fromQuaternion(I,DIt);$.multiplyByVector(M,o.direction,o.direction),$.multiplyByVector(M,o.up,o.up),h.cross(o.direction,o.up,o.right),h.cross(o.right,o.direction,o.up),o._setTransform(w)}}var NIt=new z,FIt=new z,OIe=new dn,MIe=new dn,BIt=new h,kIt=new h;function Xf(e,t,n,i){let o=e._scene.camera,a=NIt;a.x=n.startPosition.x,a.y=0;let s=FIt;s.x=n.endPosition.x,s.y=0;let c=o.getPickRay(a,OIe),u=o.getPickRay(s,MIe),f=0,d,p;o.frustum instanceof mn?(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,OIe),u=o.getPickRay(s,MIe),f=0,o.frustum instanceof mn?(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,BIt),b=h.equalsEpsilon(y,i,D.EPSILON2),x=h.equalsEpsilon(y,A,D.EPSILON2);if(!b&&!x){g=h.dot(y,i);let T=D.acosClamped(g);f>0&&f>T&&(f=T-D.EPSILON4),g=h.dot(y,A),T=D.acosClamped(g),f<0&&-f>T&&(f=-T+D.EPSILON4);let C=h.cross(i,y,kIt);o.look(C,f)}else(b&&f<0||x&&f>0)&&o.look(o.right,-f)}else o.lookUp(f)}function zIt(e){cu(e,e.enableRotate,e.rotateEventTypes,AIt,e.inertiaSpin,"_lastInertiaSpinMovement"),cu(e,e.enableZoom,e.zoomEventTypes,YIe,e.inertiaZoom,"_lastInertiaZoomMovement"),cu(e,e.enableTilt,e.tiltEventTypes,RIt,e.inertiaSpin,"_lastInertiaTiltMovement"),cu(e,e.enableLook,e.lookEventTypes,Xf)}var UIt=new L,VIt=new de;function ine(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;L.equals(r.transform,L.IDENTITY)||(s=L.clone(r.transform,UIt),c=h.magnitude(r.position),r._setTransform(L.IDENTITY));let u=VIt;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)))}yz.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 jIt=new h,HIt=new h;yz.prototype.update=function(){let e=this._scene,{camera:t,globe:n,mode:i}=e;L.equals(t.transform,L.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=fr.getHeight(this.minimumCollisionTerrainHeight,r,o),this._minimumPickingTerrainHeight=fr.getHeight(this.minimumPickingTerrainHeight,r,o),this._minimumTrackBallHeight=fr.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,jIt),c=h.clone(t.directionWC,HIt);if(i===re.SCENE2D?Vwt(this):i===re.COLUMBUS_VIEW?(this._horizontalRotationAxis=h.UNIT_Z,fIt(this)):i===re.SCENE3D&&(this._horizontalRotationAxis=void 0,zIt(this)),this.enableCollisionDetection&&!this._adjustedHeightForTerrain){let u=!h.equals(s,t.positionWC)||!h.equals(c,t.directionWC);ine(this,u)}this._aggregator.reset()};yz.prototype.isDestroyed=function(){return!1};yz.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),ue(this)};var Az=yz;function bz(e){let t=new sc(e);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new Je},t.viewport=new Je,this._context=e,this._fb=new oi({depthStencil:!0,pixelDatatype:ke.FLOAT,pixelFormat:He.RGBA}),this._passState=t}function GIt(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}bz.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};bz.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 GIt(i,r,t,n)};bz.prototype.isDestroyed=function(){return!1};bz.prototype.destroy=function(){return this._fb.destroy(),ue(this)};var xz=bz;var r5={},WIt=new Je(0,0,3,3),qIt=new z,YIt=new dn,XIt=new h,KIt=3,$It=.1;function rne(e){return Math.sqrt(e.x*e.x+e.y*e.y)}function JIe(e){let t=Number.POSITIVE_INFINITY;for(let a of e)!a.isEdge&&rne(a)<=KIt&&(t=Math.min(t,a.depth));let n=t*(1+$It),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)=>rne(s)<rne(a)?s:a)}function ZIe(e,t,n){let i=qIt;i.x=t.x+n.x,i.y=t.y+n.y;let r=e.camera.getPickRay(i,YIt);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,XIt);return h.add(r.origin,s,new h)}r5.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 xz(o));let s=a.snapFramebuffer,c=WIt;GG(e,t,c,i,r,{framebuffer:s,snap:!0});let u=s.end(c);if(WG(e),u.length===0)return;let f=JIe(u);if(!l(f))return;let d=ZIe(e,t,f);if(l(d))return{object:f.object,isEdge:f.isEdge,position:d,screenPosition:new z(t.x+f.x,t.y+f.y)}};r5._selectBestHit=JIe;r5._snapHitToWorld=ZIe;var Tz=r5;var Cz=`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 vz=`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 P_(){this._sceneFramebuffer=new fC;let e=.125,t=new Array(6);t[0]=new Mr({fragmentShader:Yu,textureScale:e,forcePowerOfTwo:!0,sampleMode:Wf.LINEAR});let n=t[1]=new Mr({fragmentShader:vz,uniforms:{avgLuminance:.5,threshold:.25,offset:.1},textureScale:e,forcePowerOfTwo:!0}),i=this;this._delta=1,this._sigma=2,this._blurStep=new z,t[2]=new Mr({fragmentShader:WA,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:WA,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:Yu,sampleMode:Wf.LINEAR}),this._uCenter=new z,this._uRadius=void 0,t[5]=new Mr({fragmentShader:Cz,uniforms:{center:function(){return i._uCenter},radius:function(){return i._uRadius},colorTexture2:function(){return i._sceneFramebuffer.framebuffer.getColorTexture(0)}}}),this._stages=new Xu({stages:t});let r=new _C(this),o=t.length;for(let a=0;a<o;++a)t[a]._textureCache=r;this._textureCache=r,this.length=t.length}P_.prototype.get=function(e){return this._stages.get(e)};P_.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 JIt=new ae,QIe=new z,ZIt=new z,ePe=new L;function QIt(e,t,n){let i=t.uniformState,r=i.sunPositionWC,o=i.view,a=i.viewProjection,s=i.projection,c=L.computeViewportTransformation(n,0,1,ePe),u=L.multiplyByPoint(o,r,JIt),f=mt.pointToGLWindowCoordinates(a,c,r,QIe);u.x+=D.SOLAR_RADIUS;let d=mt.pointToGLWindowCoordinates(s,c,u,u),p=z.magnitude(z.subtract(d,f,d))*30*2,g=ZIt;g.x=p,g.y=p,e._uCenter=z.clone(f,e._uCenter),e._uRadius=Math.max(g.x,g.y)*.15;let m=t.drawingBufferWidth,y=t.drawingBufferHeight,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=L.computeViewportTransformation(C,0,1,ePe),f=mt.pointToGLWindowCoordinates(a,c,r,QIe),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)}P_.prototype.clear=function(e,t,n){this._sceneFramebuffer.clear(e,t,n),this._textureCache.clear(e)};P_.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),QIt(this,t,n),r};P_.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)};P_.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(Yu,{uniformMap:{colorTexture:function(){return n._stages.get(n._stages.length-1).outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};P_.prototype.isDestroyed=function(){return!1};P_.prototype.destroy=function(){return this._textureCache.destroy(),this._stages.destroy(),ue(this)};var Ez=P_;function tPe(){this._cachedShowFrustumsShaders={}}function ePt(e){let t={},n=e.vertexAttributes;for(let i in n)n.hasOwnProperty(i)&&(t[i]=n[i].index);return t}function tPt(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=ePt(i);return Zt.fromCache({context:n,vertexShaderSource:i.vertexShaderSource,fragmentShaderSource:r,attributeLocations:u})}var Sz=new U;function nPt(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?(Sz.red=t.debugOverlappingFrustums&1?1:0,Sz.green=t.debugOverlappingFrustums&2?1:0,Sz.blue=t.debugOverlappingFrustums&4?1:0,Sz.alpha=1,Sz):U.WHITE}),n}var iPt=new nt;tPe.prototype.executeDebugShowFrustumsCommand=function(e,t,n){let i=t.shaderProgram.id,r=this._cachedShowFrustumsShaders[i];l(r)||(r=tPt(e,t.shaderProgram),this._cachedShowFrustumsShaders[i]=r);let o=nt.shallowClone(t,iPt);o.shaderProgram=r,o.uniformMap=nPt(e,t),o.execute(e.context,n)};var wz=tPe;function TC(e,t,n){this._primitive=e,this._tileIndex=t,this._sampleIndex=n,this._metadata={},this._orientedBoundingBox=new Jt}TC.fromKeyframeNode=function(e,t,n,i){let r=new TC(e,t,n),{spatialNode:o,content:a}=i;return r._metadata=rPt(e,a,n),r._orientedBoundingBox=aPt(e,o,n,r._orientedBoundingBox),r};function rPt(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 nPe=new h,oPt=new h;function aPt(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,nPe),d=h.divideComponents(h.subtract(f,e._paddingBefore,nPe),e.dimensions,oPt);return e._shape.computeOrientedBoundingBoxForSample(t,e.dimensions,d,i)}Object.defineProperties(TC.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()}}});TC.prototype.hasProperty=function(e){return l(this._metadata[e])};TC.prototype.getNames=function(){return Object.keys(this._metadata)};TC.prototype.getProperty=function(e){return this._metadata[e]};var Iz=TC;var iPe={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(iPe);var d0=iPe;function Uw(){this._defaultTexture=void 0,this._textures={},this._loadedImages=[],this._lastUpdatedFrame=-1}Uw.prototype.getTexture=function(e){return this._textures[e]};function sPt(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})}Uw.prototype.loadTexture2D=function(e,t){l(t.typedArray)?this._loadedImages.push({id:e,textureUniform:t}):sPt(this,e,t)};function cPt(e,t,n){let{id:i,textureUniform:r,image:o}=t,a=n.webgl2?o5(r,o,n):lPt(r,o,n),s=e._textures[i];l(s)&&s!==n.defaultTexture&&s.destroy(),e._textures[i]=a}function o5(e,t,n){let{typedArray:i,sampler:r}=e,o=l(i)?oPe(e,n):new Ct({context:n,source:t,sampler:r});return rPe(r)&&o.generateMipmap(),o}function lPt(e,t,n){let{typedArray:i,sampler:r}=e,o=rPe(r),a=r.wrapS===rn.REPEAT||r.wrapS===rn.MIRRORED_REPEAT||r.wrapT===rn.REPEAT||r.wrapT===rn.MIRRORED_REPEAT,{width:s,height:c}=l(i)?e:t,u=[s,c].every(D.isPowerOfTwo);if((o||a)&&!u)if(l(i)){if(e.pixelDatatype===ke.UNSIGNED_BYTE){let d=BM(i,s,c),p=xy(d);return o5({sampler:r},p,n)}}else{let d=xy(t);return o5(e,d,n)}else return o5(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."),oPe(e,n)}function rPe(e){return[Gt.NEAREST_MIPMAP_NEAREST,Gt.NEAREST_MIPMAP_LINEAR,Gt.LINEAR_MIPMAP_NEAREST,Gt.LINEAR_MIPMAP_LINEAR].includes(e.minificationFilter)}function oPe(e,t){let{pixelFormat:n,pixelDatatype:i,width:r,height:o,typedArray:a,sampler:s}=e;return new Ct({context:t,pixelFormat:n,pixelDatatype:i,source:{arrayBufferView:a,width:r,height:o},sampler:s,flipY:!1})}Uw.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];cPt(this,r,t)}n.length=0};Uw.prototype.isDestroyed=function(){return!1};Uw.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 Pz=Uw;function Dz(e){e=e??H.EMPTY_OBJECT,this.mode=e.mode??$g.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??pA.INHERIT,this._textureManager=new Pz,this._defaultTexture=void 0,this.uniformMap=uPt(this),this.usedVariablesVertex={attributeSet:{},featureIdSet:{},metadataSet:{}},this.usedVariablesFragment={attributeSet:{},featureIdSet:{},metadataSet:{},materialSet:{}},hPt(this),mPt(this)}function uPt(e){let t=e.uniforms,n={};for(let i in t)if(t.hasOwnProperty(i)){let r=t[i];r.type===d0.SAMPLER_2D?(e._textureManager.loadTexture2D(i,r.value),n[i]=fPt(e,i)):n[i]=dPt(e,i)}return n}function fPt(e,t){return function(){return e._textureManager.getTexture(t)??e._defaultTexture}}function dPt(e,t){return function(){return e.uniforms[t].value}}function CC(e,t,n){let i;for(;(i=t.exec(e))!==null;){let r=i[1];n[r]=!0}}function hPt(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,CC(o,t,r),r=e.usedVariablesVertex.featureIdSet,CC(o,n,r),r=e.usedVariablesVertex.metadataSet,CC(o,i,r));let a=e.fragmentShaderText;if(l(a)){r=e.usedVariablesFragment.attributeSet,CC(a,t,r),r=e.usedVariablesFragment.featureIdSet,CC(a,n,r),r=e.usedVariablesFragment.metadataSet,CC(a,i,r);let s=/material\.(\w+)/g,c=e.usedVariablesFragment.materialSet;CC(a,s,c)}}function aPe(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 yl(e,t,n,i){if(e.hasOwnProperty(t)){let r=`${aPe(t)} is not available in the ${i} shader. Did you mean ${aPe(n)} instead?`;throw new pe(r)}}function mPt(e){let t=e.usedVariablesVertex.attributeSet;yl(t,"position","positionMC","vertex"),yl(t,"normal","normalMC","vertex"),yl(t,"tangent","tangentMC","vertex"),yl(t,"bitangent","bitangentMC","vertex"),yl(t,"positionWC","positionMC","vertex"),yl(t,"positionEC","positionMC","vertex"),yl(t,"normalEC","normalMC","vertex"),yl(t,"tangentEC","tangentMC","vertex"),yl(t,"bitangentEC","bitangentMC","vertex");let n=e.usedVariablesFragment.attributeSet;yl(n,"position","positionEC","fragment"),yl(n,"normal","normalEC","fragment"),yl(n,"tangent","tangentEC","fragment"),yl(n,"bitangent","bitangentEC","fragment"),yl(n,"normalMC","normalEC","fragment"),yl(n,"tangentMC","tangentEC","fragment"),yl(n,"bitangentMC","bitangentEC","fragment")}Dz.prototype.setUniform=function(e,t){let n=this.uniforms[e];n.type===d0.SAMPLER_2D?this._textureManager.loadTexture2D(e,t):l(t.clone)?n.value=t.clone(n.value):n.value=t};Dz.prototype.update=function(e){this._defaultTexture=e.context.defaultTexture,this._textureManager.update(e)};Dz.prototype.isDestroyed=function(){return!1};Dz.prototype.destroy=function(){this._textureManager=this._textureManager&&this._textureManager.destroy(),ue(this)};var h0=Dz;function pPt(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?rn.REPEAT:rn.CLAMP_TO_EDGE;this.sampler=new zt({wrapS:i,wrapT:i,minificationFilter:e.minificationFilter,magnificationFilter:e.magnificationFilter,maximumAnisotropy:e.maximumAnisotropy})}var Rz=pPt;function gPt(e){let{names:t,types:n,componentTypes:i,minimumValues:r,maximumValues:o}=e;for(let a=0;a<t.length;a++){if(!_Pt(r?.[a],o?.[a]))continue;let s=yPt(t[a],n[a],i[a],r[a],o[a]);if(l(s))return s}}function _Pt(e,t){if(!Array.isArray(e)||!Array.isArray(t))return!1;let n=Math.min(...e),i=Math.max(...t);return n<i}function yPt(e,t,n,i,r){if(t===gt.VEC4&&n===Mt.FLOAT32)return APt(e,i,r);if(t===gt.SCALAR&&n===Mt.FLOAT32)return bPt(e,i,r)}function APt(e,t,n){let i=Math.min(...t),r=Math.max(...n);if(!(i<0||r>1))return new h0({fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material)
{
material.diffuse = fsInput.metadata.${e}.rgb;
material.alpha = fsInput.metadata.${e}.a;
}`})}function bPt(e,t,n){let r=MM([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 Rz({typedArray:r,width:128,height:1});return new h0({uniforms:{u_colorMap:{type:d0.SAMPLER_2D,value:o},u_minimumValue:{type:d0.FLOAT,value:t[0]},u_maximumValue:{type:d0.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 Vw=gPt;function xPt(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=a5(r[_]),I=`PropertyStatistics_${v}`,M=`PropertyStatistics_${v}`;n.addStruct(I,M,he.FRAGMENT),n.addStructField(I,S,"min"),n.addStructField(I,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}`,I=v;n.addStructField(f,S,I)}let g="Metadata",m="Metadata",y="metadata";n.addStruct(g,m,he.FRAGMENT);for(let _=0;_<c;_++){let v=a5(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",O="Properties",N="properties";n.addStruct(R,O,he.FRAGMENT);for(let _=0;_<c;_++){let v=a5(r[_]);n.addStructField(R,v,i[_])}{let _="clearProperties";n.addFunction(_,`${O} clearProperties()`,he.FRAGMENT),n.addFunctionLines(_,[`${O} ${N};`]);for(let v=0;v<c;v++){let S=a5(r[v],o[v]);n.addFunctionLines(_,[`${N}.${i[v]} = ${S}(0.0);`])}n.addFunctionLines(_,[`return ${N};`])}{let _="sumProperties";n.addFunction(_,`${O} sumProperties(${O} propertiesA, ${O} propertiesB)`,he.FRAGMENT),n.addFunctionLines(_,[`${O} ${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(_,`${O} scaleProperties(${O} ${N}, float scale)`,he.FRAGMENT),n.addFunctionLines(_,[`${O} scaledProperties = ${N};`]);for(let v=0;v<c;v++)n.addFunctionLines(_,[`scaledProperties.${i[v]} *= scale;`]);n.addFunctionLines(_,["return scaledProperties;"])}{let _="mixProperties";n.addFunction(_,`${O} mixProperties(${O} propertiesA, ${O} propertiesB, float mixFactor)`,he.FRAGMENT),n.addFunctionLines(_,[`${O} ${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 ${O} ${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],I=r[v],M=gt.getComponentCount(I);for(let F=0;F<M;F++){let V=CPt(I,F),k=a[v][F],j=s[v][F];!l(k)||!l(j)||n.addFunctionLines(_,[`${p}.${S}.min${V} = ${sPe(k)};`,`${p}.${S}.max${V} = ${sPe(j)};`])}}}{let _="getPropertiesFromMegatextureAtUv";n.addFunction(_,`${O} getPropertiesFromMegatextureAtUv(vec3 texcoord)`,he.FRAGMENT),n.addFunctionLines(_,[`${O} ${N};`]);for(let v=0;v<c;v++){let S=r[v],I=o[v],M=TPt(S,I);n.addFunctionLines(_,[`properties.${i[v]} = texture(u_megatextureTextures[${v}], texcoord)${M};`])}n.addFunctionLines(_,[`return ${N};`])}}function a5(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 TPt(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 sPe(e){let t=e.toString();return t.indexOf(".")===-1&&(t=`${e}.0`),t}function CPt(e,t){return e===gt.SCALAR?"":`[${t}]`}var Oz=xPt;function Vm(e){let{planes:t,modelMatrix:n=L.IDENTITY,unionClippingRegions:i=!1}=e??H.EMPTY_OBJECT;if(this._planes=[],this.modelMatrix=L.clone(n),this.planeAdded=new be,this.planeRemoved=new be,this._unionClippingRegions=i,this._testIntersection=i?cPe:lPe,this._float32View=void 0,this._clippingPlanesTexture=void 0,l(t))for(let r=0;r<t.length;++r)this.add(t[r])}function cPe(e){return e===Xt.OUTSIDE}function lPe(e){return e===Xt.INSIDE}Object.defineProperties(Vm.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?cPe:lPe)}},texture:{get:function(){return this._clippingPlanesTexture}},clippingPlanesState:{get:function(){return this._unionClippingRegions?this._planes.length:-this._planes.length}}});Vm.prototype.add=function(e){let t=this._planes.length;e.index=t,this._planes.push(e),this.planeAdded.raiseEvent(e,t)};Vm.prototype.get=function(e){return this._planes[e]};function uPe(e,t){for(let n=0;n<e.length;++n)if(en.equals(e[n],t))return n;return-1}Vm.prototype.contains=function(e){return uPe(this._planes,e)!==-1};Vm.prototype.remove=function(e){let t=this._planes,n=uPe(t,e);if(n===-1)return!1;e instanceof Za&&(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 Za&&(o.index=r)}return t.length=i,this.planeRemoved.raiseEvent(e,n),!0};Vm.prototype.removeAll=function(){let e=this._planes;for(let t=0;t<e.length;++t){let n=e[t];n instanceof Za&&(n.onChangeCallback=void 0,n.index=-1),this.planeRemoved.raiseEvent(n,t)}this._planes=[]};var vPt=new en(h.fromElements(1,0,0),0);function EPt(e,t){let n=e._float32View,i=e._planes,r=0;for(let o=0;o<i.length;++o){let{normal:a,distance:s}=wPt(i[o],t,vPt);n[r]=a.x,n[r+1]=a.y,n[r+2]=a.z,n[r+3]=s,r+=4}}var one=new ae,SPt=new h;function wPt(e,t,n){let{normal:i,distance:r}=e,o=ae.fromElements(i.x,i.y,i.z,r,one),a=L.multiplyByVector(t,o,one),s=h.fromCartesian4(a,SPt);return a=ae.divideByScalar(a,h.magnitude(s),one),en.fromCartesian4(a,n)}function fPe(e,t){return t.x=Math.min(e,Lt.maximumTextureSize),t.y=Math.ceil(e/t.x),t}var IPt=new z;Vm.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=fPe(i,IPt);a.y*=2,n=new Ct({context:e.context,width:a.x,height:a.y,pixelFormat:He.RGBA,pixelDatatype:ke.FLOAT,sampler:zt.NEAREST,flipY:!1}),this._float32View=new Float32Array(a.x*a.y*4),this._clippingPlanesTexture=n}let{width:r,height:o}=n;EPt(this,t),n.copyFrom({source:{width:r,height:o,arrayBufferView:this._float32View}})};Vm.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=fPe(r,n);return o.y*=2,o};Vm.prototype.isDestroyed=function(){return!1};Vm.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),ue(this)};var D_=Vm;var Mz=`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 Lz=`// 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 Nz=`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 Fz=`/* 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 Bz=`// 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 kz=`// 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 jw=`// 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 zz=`// 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 Uz=`// 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 Vz=`// 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 vC=`// 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 jz=`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 Hz=`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 Gz=`/* 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 Wz=`// 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 qz=`// 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 dPe={Z_UP:0,Y_UP:1};Object.freeze(dPe);var m0=dPe;function PPt(e){let t=new Cg;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([Nz]),e.provider.metadataOrder===m0.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",Wz,Mz,qz,Fz,kz,Bz]),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([jz,zz,vC]):u==="CYLINDER"?t.addFragmentLines([Hz,jw,Uz,vC]):u==="ELLIPSOID"&&t.addFragmentLines([Gz,jw,Vz,vC]),t.addFragmentLines([Lz]);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 Yz=PPt;var hPe=new z;function DPt(e,t){let n=new Yz(e);Oz(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=Aa.getTextureResolution(r,t,hPe),w=mPe(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=D_.getTextureResolution(a,t,hPe),w=mPe(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:zi.BACK},depthTest:{enabled:!1},depthMask:!1,blending:Qt.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 mPe(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 Xz=DPt;function R_(e){let{loader:t,metadata:n}=e;this._loader=t,this._metadata=n,this._resourcesLoaded=!1,this._ready=!1}Object.defineProperties(R_.prototype,{ready:{get:function(){return this._ready}},metadata:{get:function(){return this._metadata}}});R_.fromMetadataArray=function(e){return new R_({metadata:e})};R_.fromGltf=async function(e){let t=new Rf({gltfResource:e,releaseGltfJson:!1,loadAttributesAsTypedArray:!0});try{await t.load()}catch(n){throw t.destroy(),n}return new R_({loader:t})};R_.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=RPt(o,i,e),this._ready=!0;return}this._resourcesLoaded=n.process(t)}};function RPt(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}R_.prototype.isDestroyed=function(){return!1};R_.prototype.destroy=function(){return this._loader=this._loader&&this._loader.destroy(),ue(this)};var EC=R_;function Al(){this._orientedBoundingBox=new Jt,this._boundingSphere=new se,this._boundTransform=new L,this._shapeTransform=new L,this._minBounds=Al.DefaultMinBounds.clone(),this._maxBounds=Al.DefaultMaxBounds.clone(),this._renderMinBounds=Al.DefaultMinBounds.clone(),this._renderMaxBounds=Al.DefaultMaxBounds.clone();let{DefaultMinBounds:e,DefaultMaxBounds:t}=Al,n=[new Za(h.negate(h.UNIT_X,new h),e.x),new Za(h.negate(h.UNIT_Y,new h),e.y),new Za(h.negate(h.UNIT_Z,new h),e.z),new Za(h.UNIT_X,-t.x),new Za(h.UNIT_Y,-t.y),new Za(h.UNIT_Z,-t.z)];this._renderBoundPlanes=new D_({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(Al.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 OPt=new h,MPt=new h,LPt=new $,NPt=new h,FPt=new h;Al.prototype.update=function(e,t,n,i,r){i=i??t.clone(NPt),r=r??n.clone(FPt),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=L.getScale(e,MPt);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=L.clone(e,this._shapeTransform),this._orientedBoundingBox=cne(o,a,this._shapeTransform,this._orientedBoundingBox),this._boundTransform=L.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(ane(p.x,g.x),ane(p.y,g.y),ane(p.z,g.z),u.boxLocalToShapeUvScale);return this._localToShapeUvTranslate=h.negate(h.multiplyComponents(m,p,this._localToShapeUvTranslate),this._localToShapeUvTranslate),this._shaderMaximumIntersectionsLength=d,!0};function ane(e,t){return D.equalsEpsilon(e,t,D.EPSILON7)?1:1/(t-e)}var BPt=new L;Al.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=L.inverse(this._shapeTransform,BPt),i=L.getMatrix3(n,t.boxEcToXyz),r=e.context.uniformState.inverseViewRotation;$.multiply(i,r,t.boxEcToXyz)};Al.prototype.convertLocalToShapeUvSpace=function(e,t){let{boxLocalToShapeUvScale:n}=this._shaderUniforms,i=this._localToShapeUvTranslate;return h.add(h.multiplyComponents(e,n,t),i,t)};var s5=new h,sne=new h;Al.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,r){let o=this._minBounds,a=this._maxBounds,s=1/Math.pow(2,e),c=h.fromElements(D.lerp(o.x,a.x,s*t),D.lerp(o.y,a.y,s*n),D.lerp(o.z,a.z,s*i),s5),u=h.fromElements(D.lerp(o.x,a.x,s*(t+1)),D.lerp(o.y,a.y,s*(n+1)),D.lerp(o.z,a.z,s*(i+1)),sne);return cne(c,u,this._shapeTransform,r)};var pPe=new h;Al.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let r=1/Math.pow(2,e.level),o=h.divideComponents(h.ONE,t,pPe),a=h.multiplyByScalar(o,r,pPe),s=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,s5),r,s5),c=h.add(s,a,sne),u=this._minBounds,f=this._maxBounds,d=h.fromElements(D.lerp(u.x,f.x,s.x),D.lerp(u.y,f.y,s.y),D.lerp(u.z,f.z,s.z),s5),p=h.fromElements(D.lerp(u.x,f.x,c.x),D.lerp(u.y,f.y,c.y),D.lerp(u.z,f.z,c.z),sne);return cne(d,p,this._shapeTransform,i)};Al.DefaultMinBounds=Object.freeze(new h(-1,-1,-1));Al.DefaultMaxBounds=Object.freeze(new h(1,1,1));var gPe=new h;function cne(e,t,n,i){let r=Al.DefaultMinBounds,o=Al.DefaultMaxBounds;if(h.equals(e,r)&&h.equals(t,o))i.center=L.getTranslation(n,i.center),i.halfAxes=L.getMatrix3(n,i.halfAxes);else{let s=L.getScale(n,gPe),c=h.midpoint(e,t,OPt);i.center=L.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),gPe);let u=L.getRotation(n,LPt);i.halfAxes=$.setScale(u,s,i.halfAxes)}return i}var SC=Al;function Kf(){this._orientedBoundingBox=new Jt,this._boundingSphere=new se,this._boundTransform=new L,this._shapeTransform=new L,this._minBounds=Kf.DefaultMinBounds.clone(),this._maxBounds=Kf.DefaultMaxBounds.clone();let{DefaultMinBounds:e,DefaultMaxBounds:t}=Kf,n=[new Za(h.negate(h.UNIT_Z,new h),e.z),new Za(h.UNIT_Z,-t.z)];this._renderBoundPlanes=new D_({planes:n}),this._localToShapeUvTranslate=new h,this._shaderUniforms={cameraShapePosition:new h,cylinderEcToRadialTangentUp:new $,cylinderRenderRadiusMinMax:new z,cylinderRenderAngleMinMax:new z,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(Kf.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 kPt=new h,zPt=new h,UPt=new h,VPt=new h,jPt=new h,HPt=new L,GPt=new h,_Pe=new z;Kf.prototype.update=function(e,t,n,i,r){i=i??t.clone(zPt),r=r??n.clone(UPt),t=h.clone(t,this._minBounds),n=h.clone(n,this._maxBounds);let{DefaultMinBounds:o,DefaultMaxBounds:a}=Kf,s=a.y-o.y,c=.5*s,u=D.EPSILON10,f=D.EPSILON10;t.x=Math.max(0,t.x),n.x=Math.max(0,n.x),t.y=D.negativePiToPi(t.y),n.y=D.negativePiToPi(n.y),i.y=D.negativePiToPi(i.y),r.y=D.negativePiToPi(r.y);let d=h.maximumByComponent(t,i,VPt),p=h.minimumByComponent(n,r,jPt),g=L.getScale(e,kPt);if(p.x===0||d.x>p.x||d.z>p.z||D.equalsEpsilon(g.x,0,void 0,u)||D.equalsEpsilon(g.y,0,void 0,u)||D.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=L.clone(e,this._shapeTransform),this._orientedBoundingBox=fne(d,p,this._shapeTransform,this._orientedBoundingBox),this._boundTransform=L.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,P=this._shaderUniforms,R=this._shaderDefines;for(let W in R)R.hasOwnProperty(W)&&(R[W]=void 0);let O=0;R.CYLINDER_INTERSECTION_INDEX_RADIUS_MAX=O,O+=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=O,O+=1),P.cylinderRenderRadiusMinMax=z.fromElements(d.x,p.x,P.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,I=0,M=1;S!==0&&(I=1/S,M=-t.z*I),w&&(R.CYLINDER_HAS_RENDER_BOUNDS_ANGLE=!0,R.CYLINDER_INTERSECTION_INDEX_ANGLE=O,T?(R.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF=!0,O+=1):C?(R.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF=!0,O+=2):E&&(R.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO=!0,O+=2),P.cylinderRenderAngleMinMax=z.fromElements(d.y,p.y,P.cylinderRenderAngleMinMax));let F=(t.y-o.y)/s,V=(n.y-o.y)/s,k=1-A/s,j=(V+.5*k)%1;P.cylinderShapeUvAngleRangeOrigin=j;let B=0,G=1;if(A>f){B=s/A;let W=F-j;G=-B*(W-Math.floor(W))}return P.cylinderLocalToShapeUvScale=h.fromElements(_,B,I,P.cylinderLocalToShapeUvScale),this._localToShapeUvTranslate=h.fromElements(v,G,M,this._localToShapeUvTranslate),this._shaderMaximumIntersectionsLength=O,!0};var WPt=new $,qPt=new $,YPt=new L;Kf.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=L.inverse(this._shapeTransform,HPt),i=L.multiplyByPoint(n,e.camera.positionWC,GPt);t.cameraShapePosition=h.fromElements(z.magnitude(i),Math.atan2(i.y,i.x),i.z,t.cameraShapePosition);let r=z.normalize(z.fromCartesian3(i,_Pe),_Pe),o=$.fromRowMajorArray([r.x,r.y,0,-r.y,r.x,0,0,0,1],WPt),a=e.context.uniformState.inverseView,s=L.multiplyTransformation(n,a,YPt),c=L.getMatrix3(s,qPt);t.cylinderEcToRadialTangentUp=$.multiply(o,c,t.cylinderEcToRadialTangentUp)};Kf.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 c5=new h,une=new h;Kf.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,r){let o=this._minBounds,a=this._maxBounds,s=1/Math.pow(2,e),c=h.fromElements(D.lerp(o.x,a.x,t*s),D.lerp(o.y,a.y,n*s),D.lerp(o.z,a.z,i*s),c5),u=h.fromElements(D.lerp(o.x,a.x,(t+1)*s),D.lerp(o.y,a.y,(n+1)*s),D.lerp(o.z,a.z,(i+1)*s),une);return fne(c,u,this._shapeTransform,r)};var yPe=new h;Kf.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let r=1/Math.pow(2,e.level),o=h.divideComponents(h.ONE,t,yPe),a=h.multiplyByScalar(o,r,yPe),s=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,c5),r,c5),c=h.add(s,a,une),u=this._minBounds,f=this._maxBounds,d=h.fromElements(D.lerp(u.x,f.x,s.x),D.lerp(u.y,f.y,s.y),D.lerp(u.z,f.z,s.z),c5),p=h.fromElements(D.lerp(u.x,f.x,c.x),D.lerp(u.y,f.y,c.y),D.lerp(u.z,f.z,c.z),une);return fne(d,p,this._shapeTransform,i)};Kf.DefaultMinBounds=Object.freeze(new h(0,-D.PI,-1));Kf.DefaultMaxBounds=Object.freeze(new h(1,+D.PI,1));var XPt=5,KPt=new Array(XPt),$Pt=new h,JPt=new $,ZPt=new L,QPt=new L,eDt=new L,lne=new L,tDt=new h,nDt=new h,iDt=new h,bPe=new Array(8);for(let e=0;e<8;e++)bPe[e]=new h;function APe(e,t,n){return Math.abs(ae.dot(e,t))<n}function rDt(e){let t=L.getColumn(e,0,tDt),n=L.getColumn(e,1,nDt),i=L.getColumn(e,2,iDt),r=D.EPSILON4;return APe(t,n,r)&&APe(n,i,r)}function oDt(e,t){let n=bPe;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)L.multiplyByPoint(e,n[i],n[i]);return Jt.fromPoints(n,t)}var aDt=new h;function fne(e,t,n,i){let r=e.x,o=t.x,a=e.y,s=t.y<a?t.y+D.TWO_PI:t.y,c=e.z,u=t.z,f=s-a,d=a+f*.5,p=KPt,g=0;p[g++]=a,p[g++]=s,p[g++]=d,f>D.PI&&(p[g++]=d-D.PI_OVER_TWO,p[g++]=d+D.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,k=Math.cos(V),j=Math.sin(V),B=k*r,G=j*r,W=k*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,P=(c+u)*.5,R=h.fromElements(E,w,P,$Pt),O=$.fromRotationZ(d,JPt),N=h.fromElements(x,T,C,aDt),_=L.fromScale(N,eDt),v=L.fromRotation(O,QPt),S=L.fromTranslation(R,ZPt),I=L.multiplyTransformation(v,L.multiplyTransformation(S,_,lne),lne),M=L.multiplyTransformation(n,I,lne);return rDt(M)?Jt.fromTransformation(M,i):oDt(M,i)}var wC=Kf;function hh(){this._orientedBoundingBox=new Jt,this._boundingSphere=new se,this._boundTransform=new L,this._shapeTransform=new L,this._rectangle=new ie,this._minimumHeight=hh.DefaultMinBounds.z,this._maximumHeight=hh.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 z,ellipsoidCurvatureAtLatitude:new z,ellipsoidInverseRadiiSquared:new h,ellipsoidRenderLongitudeMinMax:new z,ellipsoidShapeUvLongitudeRangeOrigin:0,ellipsoidShapeUvLongitudeMinMaxMid:new h,ellipsoidLocalToShapeUvScale:new h,ellipsoidRenderLatitudeSinMinMax:new z,clipMinMaxHeight:new z},this._shaderDefines={ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF:void 0,ELLIPSOID_HAS_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(hh.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 sDt=new h,cDt=new h,lDt=new h,uDt=new h,fDt=new h,dDt=new h,hDt=new h,mDt=new h,xPe=new h,TPe=new h,pDt=new ie;hh.prototype.update=function(e,t,n,i,r){let{DefaultMinBounds:o,DefaultMaxBounds:a}=hh;i=i??o,r=r??a;let s=D.EPSILON10,c=D.EPSILON10,u=D.EPSILON10,f=D.EPSILON3,d=L.getScale(e,mDt),p=h.clone(o,sDt);p.z=-h.minimumComponent(d);let g=h.clamp(t,p,a,cDt),m=h.clamp(n,p,a,lDt),y=h.clamp(i,p,a,uDt),A=h.clamp(r,p,a,fDt),b=h.maximumByComponent(g,y,dDt),x=h.minimumByComponent(m,A,hDt),T=h.add(d,h.fromElements(m.z,m.z,m.z,xPe),xPe),C=h.add(d,h.fromElements(x.z,x.z,x.z,TPe),TPe);if(b.y>x.y||b.y===a.y||x.y===o.y||b.z>x.z||D.equalsEpsilon(C,h.ZERO,void 0,s))return!1;this._rectangle=ie.fromRadians(g.x,g.y,m.x,m.y),this._translation=L.getTranslation(e,this._translation),this._rotation=L.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,pDt);this._orientedBoundingBox=dne(E,b.z,x.z,this._ellipsoid,this._translation,this._rotation,this._orientedBoundingBox),this._shapeTransform=L.fromRotationTranslation(this._rotation,this._translation,this._shapeTransform),this._boundTransform=L.fromRotationTranslation(this._orientedBoundingBox.halfAxes,this._orientedBoundingBox.center,this._boundTransform),this._boundingSphere=se.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere);let w=a.x-o.x,P=.5*w,R=x.x<b.x,O=x.x-b.x+R*w,N=O<=c,_=O>=P-c&&O<w-c,v=O>c&&O<P-c,S=N||_||v,I=m.x<g.x,M=m.x-g.x+I*w,F=M>P+c&&M<w-c,V=M>=P-c&&M<=P+c,k=M<P-c,j=F||V||k,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,Xe=g.y>+f,Ke=Ie||(Le||$e||Xe),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:vt,z:ct}=we.ellipsoidRadii,pn=ct/vt;we.eccentricitySquared=1-pn*pn,we.evoluteScale=z.fromElements((vt*vt-ct*ct)/vt,(ct*ct-vt*vt)/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=z.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=z.fromElements(b.x,x.x,we.ellipsoidRenderLongitudeMinMax));let Pn=0,ot=1;if(j){We.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE=!0;let wn=(g.x-o.x)/w,Ni=(m.x-o.x)/w,dr=1-M/w,Fi=(Ni+.5*dr)%1;if(we.ellipsoidShapeUvLongitudeRangeOrigin=Fi,M>c){Pn=w/M;let Yi=wn-Fi;ot=-Pn*(Yi-Math.floor(Yi))}}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=z.fromElements(Math.sin(b.y),Math.sin(x.y),we.ellipsoidRenderLatitudeSinMinMax));let dt=0,Si=1;return Ke&&(We.ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE=!0,le>u&&(dt=(a.y-o.y)/le,Si=(o.y-g.y)/le)),we.ellipsoidLocalToShapeUvScale=h.fromElements(Pn,dt,Dt,we.ellipsoidLocalToShapeUvScale),this._localToShapeUvTranslate=h.fromElements(ot,Si,0,this._localToShapeUvTranslate),this._shaderMaximumIntersectionsLength=Ht,!0};var gDt=new de,_Dt=new h,yDt=new L,CPe=new $;hh.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=this._ellipsoid,i=e.camera.positionWC,r=n.cartesianToCartographic(i,gDt);h.fromElements(r.longitude,r.latitude,r.height,t.cameraPositionCartographic);let o=h.fromRadians(r.longitude,r.latitude,0,n,_Dt);t.ellipsoidCurvatureAtLatitude=n.getLocalCurvature(o,t.ellipsoidCurvatureAtLatitude);let a=mt.eastNorthUpToFixedFrame(o,n,yDt),s=L.getRotation(a,CPe),c=e.context.uniformState.viewRotation,u=$.multiply(c,s,CPe);t.ellipsoidEcToEastNorthUp=$.transpose(u,t.ellipsoidEcToEastNorthUp)};var DPe=new ie;hh.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,DPe),g=D.lerp(this._minimumHeight,this._maximumHeight,f),m=D.lerp(this._minimumHeight,this._maximumHeight,d);return dne(p,g,m,this._ellipsoid,this._translation,this._rotation,r)};var ADt=new z,bDt=new z,Kz=new z,vPe=new z,EPe=new z,$z=new z;function xDt(e,t,n,i){let r=z.abs(e,ADt),o=z.fromElements(1/t.x,1/t.y,bDt),a=z.fromElements(Math.SQRT1_2,Math.SQRT1_2,Kz),s=z.multiplyComponents(t,a,vPe),c=z.fromElements(n.x*a.x*a.x*a.x,n.y*a.y*a.y*a.y,EPe);for(let u=0;u<3;++u){let f=z.magnitude(z.subtract(s,c,$z)),d=z.normalize(z.subtract(r,c,$z),$z),p=z.multiplyByScalar(d,f,$z);a=z.multiplyComponents(z.add(p,c,Kz),o,Kz),a=z.normalize(z.clamp(a,z.ZERO,z.ONE,Kz),Kz),s=z.multiplyComponents(t,a,vPe),c=z.fromElements(n.x*a.x*a.x*a.x,n.y*a.y*a.y*a.y,EPe)}return h.fromElements(Math.sign(e.x)*s.x,Math.sign(e.y)*s.y,z.magnitude(z.subtract(s,c,$z)),i)}var TDt=new z,SPe=new z,CDt=new h,wPe=new z;hh.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=z.fromElements(u,e.z,SPe),d=xDt(f,z.fromElements(i.x,i.z,TDt),r,CDt),p=z.normalize(z.fromElements(d.x*o.x,d.y*o.z,wPe),wPe),g=Math.atan2(p.y,p.x),m=z.magnitude(f)<z.magnitude(d)?-1:1,y=z.subtract(f,d,SPe),A=m*z.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 IPe=new h,PPe=new h,vDt=new h;hh.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let r=1/Math.pow(2,e.level),o=h.divideComponents(h.ONE,t,IPe),a=h.multiplyByScalar(o,r,IPe),s=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,PPe),r,PPe),c=h.add(s,a,vDt),u=ie.subsection(this._rectangle,s.x,s.y,c.x,c.y,DPe),f=D.lerp(this._minimumHeight,this._maximumHeight,s.z),d=D.lerp(this._minimumHeight,this._maximumHeight,c.z);return dne(u,f,d,this._ellipsoid,this._translation,this._rotation,i)};function dne(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}hh.DefaultMinBounds=Object.freeze(new h(-D.PI,-D.PI_OVER_TWO,-te.WGS84.minimumRadius));hh.DefaultMaxBounds=Object.freeze(new h(D.PI,D.PI_OVER_TWO,10*te.WGS84.maximumRadius));var IC=hh;var Ku={BOX:"BOX",ELLIPSOID:"ELLIPSOID",CYLINDER:"CYLINDER"};Ku.getMinBounds=function(e){switch(e){case Ku.BOX:return SC.DefaultMinBounds;case Ku.ELLIPSOID:return IC.DefaultMinBounds;case Ku.CYLINDER:return wC.DefaultMinBounds}};Ku.getMaxBounds=function(e){switch(e){case Ku.BOX:return SC.DefaultMaxBounds;case Ku.ELLIPSOID:return IC.DefaultMaxBounds;case Ku.CYLINDER:return wC.DefaultMaxBounds}};Ku.getShapeConstructor=function(e){switch(e){case Ku.BOX:return SC;case Ku.ELLIPSOID:return IC;case Ku.CYLINDER:return wC}};Object.freeze(Ku);var _c=Ku;var hne=Object.freeze({UNLOADED:0,RECEIVING:1,PROCESSING:2,LOADED:3,FAILED:4,UNAVAILABLE:5});function Jz(e,t){this.spatialNode=e,this.keyframe=t,this.state=hne.UNLOADED,this.content=void 0,this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1}Jz.prototype.unload=function(){this.content=this.content&&this.content.destroy(),this.spatialNode=void 0,this.state=hne.UNLOADED,this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1};Jz.priorityComparator=function(e,t){return e.priority-t.priority};Jz.searchComparator=function(e,t){return e.keyframe-t.keyframe};Jz.LoadState=hne;var Fr=Jz;function p0(e,t,n,i,r=134217728,o){let a=EDt(i),s=SDt(n),c=n*Mt.getSizeInBytes(i),u=p0.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 tL({context:e,pixelFormat:s,pixelDatatype:a,flipY:!1,width:u.x,height:u.y,depth:u.z,sampler:new zt({wrapR:rn.CLAMP_TO_EDGE,wrapS:rn.CLAMP_TO_EDGE,wrapT:rn.CLAMP_TO_EDGE,minificationFilter:Gt.LINEAR,magnificationFilter:ei.LINEAR})}),this.nodes=new Array(this.maximumTileCount);for(let d=0;d<this.maximumTileCount;d++)this.nodes[d]=new wDt(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(p0.prototype,{nearestSampling:{get:function(){return this._nearestSampling},set:function(e){this._nearestSampling!==e&&(e?this.texture.sampler=zt.NEAREST:this.texture.sampler=new zt({wrapR:rn.CLAMP_TO_EDGE,wrapS:rn.CLAMP_TO_EDGE,wrapT:rn.CLAMP_TO_EDGE,minificationFilter:Gt.LINEAR,magnificationFilter:ei.LINEAR}),this._nearestSampling=e)}}});function EDt(e){if(e===Mt.FLOAT32||e===Mt.FLOAT64)return ke.FLOAT;if(e===Mt.UINT8)return ke.UNSIGNED_BYTE}function SDt(e){switch(e){case 1:return He.RED;case 2:return He.RG;case 3:return He.RGB;case 4:return He.RGBA}}function wDt(e){this.index=e,this.nextNode=void 0,this.previousNode=void 0}p0.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};p0.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--};p0.prototype.isFull=function(){return this.emptyList===void 0};p0.get3DTextureDimension=function(e,t,n,i){let{maximum3DTextureSize:r}=Lt;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=RPe(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}RPe(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 RPe(e){return e.reduce((t,n)=>t*n)}p0.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)};p0.prototype.isDestroyed=function(){return!1};p0.prototype.destroy=function(){return this.texture=this.texture&&this.texture.destroy(),ue(this)};var Zz=p0;function mh(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 IDt=new h;mh.prototype.computeBoundingVolumes=function(e){this.orientedBoundingBox=e.computeOrientedBoundingBoxForTile(this.level,this.x,this.y,this.z,this.orientedBoundingBox);let t=$.getScale(this.orientedBoundingBox.halfAxes,IDt),n=2*h.maximumComponent(t);this.approximateVoxelSize=n/h.minimumComponent(this.dimensions)};mh.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 mh(g,m,y,A,this,e,this.dimensions))};mh.prototype.visibility=function(e,t){let n=this.orientedBoundingBox;return e.cullingVolume.computeVisibilityWithPlaneMask(n,t)};mh.prototype.computeScreenSpaceError=function(e,t){let n=this.orientedBoundingBox,i=Math.sqrt(n.distanceSquaredTo(e));i=Math.max(i,D.EPSILON7);let r=this.approximateVoxelSize,o=t*(r/i);this.screenSpaceError=o};var OPe={keyframe:0};function Qz(e,t){return OPe.keyframe=e,Ar(t,OPe,Fr.searchComparator)}mh.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=PDt(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=MPe(n-t.level,A);b<s&&(s=b,o=g);let x=y.keyframe-r,T=MPe(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:D.clamp((e-u)/(f-u),0,1)};function PDt(e,t){let n=Qz(e,t);return n<0?D.clamp(~n-1,0,t.length-1):n}function MPe(e,t){let n=Math.exp(e*4),i=t>=0?1:-200;return e*n+t*i}mh.prototype.isVisited=function(e){return this.visitedFrameNumber===e};mh.prototype.createKeyframeNode=function(e){let t=Qz(e,this.keyframeNodes);if(t<0){t=~t;let n=new Fr(this,e);this.keyframeNodes.splice(t,0,n)}};mh.prototype.destroyKeyframeNode=function(e,t){let n=e.keyframe,i=Qz(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=Qz(n,this.renderableKeyframeNodes);if(r<0)throw new pe("Renderable keyframe node does not exist.");this.renderableKeyframeNodes.splice(r,1)}e.unload()};mh.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=Qz(e.keyframe,i);if(r>=0)throw new pe("Keyframe already renderable");r=~r,i.splice(r,0,e)};mh.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 eU=mh;function qA(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 Zz(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 eU(0,0,0,0,void 0,d,o),this._priorityQueue=new V0({maximumLength:f,comparator:Fr.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,mne(p,1,n-2,0);let g=9,m=2048,y=Math.floor(m/g),A=Math.ceil(f/y);this.internalNodeTexture=new Ct({context:t,pixelFormat:He.RGBA,pixelDatatype:ke.UNSIGNED_BYTE,flipY:!1,width:m,height:A,sampler:new zt({minificationFilter:Gt.NEAREST,magnificationFilter:ei.NEAREST})}),this.internalNodeTilesPerRow=y,this.internalNodeTexelSizeUv=new z(1/m,1/A),this.leafNodeTexture=void 0,this.leafNodeTilesPerRow=void 0,this.leafNodeTexelSizeUv=new z}qA.prototype.findKeyframeNode=function(e){return this._keyframeNodesInMegatexture.find(function(t){return t.megatextureIndex===e})};function mne(e,t,n,i){if(t>n)return;let r=Math.floor((t+n)/2);e[r]=i,mne(e,t,r-1,i+1),mne(e,r+1,n,i+1)}qA.simultaneousRequestCountMaximum=50;qA.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 Ct({context:o,pixelFormat:He.RGBA,pixelDatatype:ke.UNSIGNED_BYTE,flipY:!1,width:1024,height:C,sampler:new zt({minificationFilter:Gt.NEAREST,magnificationFilter:ei.NEAREST})}),this.leafNodeTexelSizeUv=z.fromElements(1/1024,1/C,this.leafNodeTexelSizeUv),this.leafNodeTilesPerRow=T}else!p&&l(this.leafNodeTexture)&&(this.leafNodeTexture=this.leafNodeTexture.destroy());if(this._keyframeLocation=D.clamp(t,0,s-1),n&&LPe(this,this.rootNode),i)return;this._frameNumber=e.frameNumber;let g=yn();ODt(this,e),MDt(this,e);let m=yn();kDt(this,d,c);let y=yn(),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;BDt(this,e,b,x,T)}};qA.prototype.isRenderable=function(e){return e.isRenderable(this._frameNumber)};qA.prototype.isDestroyed=function(){return!1};qA.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 LPe(e,t){if(t.computeBoundingVolumes(e._primitive._shape),l(t.children))for(let n=0;n<8;n++){let i=t.children[n];LPe(e,i)}}function DDt(e,t){if(e._simultaneousRequestCount>=qA.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)?Fr.LoadState.PROCESSING:Fr.LoadState.UNAVAILABLE}function s(f){e._simultaneousRequestCount--,t.state=Fr.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=Fr.LoadState.RECEIVING,u.then(a).catch(s))}function RDt(e){return e/(1+e)}function ODt(e,t){let n=e._frameNumber,i=e._priorityQueue;i.reset(),NPe(e.rootNode,qa.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 MDt(e,t){let n=e.megatextures[0],i=n.occupiedCount,r=e._keyframeNodesInMegatexture;r.length=i,r.sort(LDt);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===Fr.LoadState.LOADED||f.spatialNode===void 0)&&(f.state===Fr.LoadState.UNLOADED&&DDt(e,f),f.state===Fr.LoadState.PROCESSING)){let{content:d}=f;if(d.update(e._primitive,t),!d.ready)continue;if(!NDt(d.metadata,e)){f.content=void 0,f.state=Fr.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=Fr.LoadState.LOADED,r[p]=f,e._primitive.tileLoad.raiseEvent()}}}function LDt(e,t){return e.highPriorityFrameNumber===t.highPriorityFrameNumber?t.priority-e.priority:t.highPriorityFrameNumber-e.highPriorityFrameNumber}function NDt(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 NPe(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===qa.MASK_OUTSIDE)return;e.visitedFrameNumber=s;let p=n._primitive,g=p._shape,m=p.screenSpaceError,y=n._priorityQueue,A=n._keyframeCount,b=D.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 P=0;P<A;P++)e.createKeyframeNode(P);let{screenSpaceError:T,keyframeNodes:C}=e,E=RDt(T),w=!1;for(let P=0;P<C.length;P++){let R=C[P];R.priority=10*E+FDt(b,R.keyframe,x,n),R.state!==Fr.LoadState.UNAVAILABLE&&R.state!==Fr.LoadState.FAILED&&R.priority!==-Number.MAX_VALUE&&y.insert(R),R.state===Fr.LoadState.LOADED&&(w=!0)}if(T<m||!w){e.children=void 0;return}l(e.children)||e.constructChildNodes(g);for(let P=0;P<8;P++){let R=e.children[P];NPe(R,t,n,i)}}function FDt(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 D.lerp(s,a,.15+.85*a)}function BDt(e,t,n,i,r){let o=e._keyframeCount,a=e.rootNode,s=Object.keys(Fr.LoadState).length,c=new Array(s),u=new Array(s),f=0;for(let w=0;w<s;w++){let P=new Array(o).fill(0);c[w]=P,u[w]=0}function d(w){let P=w.keyframeNodes;for(let R=0;R<P.length;R++){let O=P[R],N=O.keyframe,_=O.state;c[_][N]+=1,u[_]+=1,f++}if(l(w.children))for(let R=0;R<8;R++){let O=w.children[R];d(O)}}d(a),e._primitive.statistics.numberOfTilesWithContentReady=u[Fr.LoadState.LOADED],e._primitive.statistics.visited=f;let p=u[Fr.LoadState.RECEIVING],g=u[Fr.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[Fr.LoadState.LOADED]}`,b=`UNLOADED: ${u[Fr.LoadState.UNLOADED]} | RECEIVING: ${u[Fr.LoadState.RECEIVING]} | PROCESSING: ${u[Fr.LoadState.PROCESSING]} | LOADED: ${u[Fr.LoadState.LOADED]} | FAILED: ${u[Fr.LoadState.FAILED]} | UNAVAILABLE: ${u[Fr.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 l5={INTERNAL:0,LEAF:1,PACKED_LEAF_FROM_PARENT:2};function kDt(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]=l5.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,P=l(w)?w.renderableKeyframeNodePrevious:C,R=zDt(g,i,n),O=E,N=1,_=C.megatextureIndex,v=P.megatextureIndex;f[T+0]=R,f[T+1]=O,f[T+2]=N,f[T+3]=_,f[T+4]=v,u[b]=l5.LEAF<<16|c}else{let T=g.renderableKeyframeNodePrevious,E=g.level-T.spatialNode.level===0?l5.LEAF:l5.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),UDt(u,9,e.internalNodeTilesPerRow,e.internalNodeTexture),a&&VDt(f,2,e.leafNodeTilesPerRow,e.leafNodeTexture)}function zDt(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 D.clamp(a,0,1)}function UDt(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 VDt(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=D.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 tU=qA;function g0(e){e=e??H.EMPTY_OBJECT;let{provider:t=g0.DefaultProvider,modelMatrix:n=L.IDENTITY,customShader:i=Vw(t),clock:r,calculateStatistics:o=!1}=e;this._ready=!1,this._provider=t,this._traversal=void 0,this._statistics=new Mm,this._calculateStatistics=o;let{shape:a,minBounds:s=_c.getMinBounds(a),maxBounds:c=_c.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=jDt(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=L.clone(n),this._modelMatrixOld=L.clone(this._modelMatrix),this._customShader=i??g0.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 L,this._transformPositionWorldToLocal=new L,this._transformPlaneLocalToView=new L,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 Im,this._debugDraw=!1,this._disableRender=!1,this._disableUpdate=!1;let m=_c.getShapeConstructor(a);this._shape=new m,BPe(this),this._shapeVisible=kPe(this),this._uniforms={octreeInternalNodeTexture:void 0,octreeInternalNodeTilesPerRow:0,octreeInternalNodeTexelSizeUv:new z,octreeLeafNodeTexture:void 0,octreeLeafNodeTilesPerRow:0,octreeLeafNodeTexelSizeUv:new z,megatextureTextures:[],megatextureTileCounts:new h,dimensions:this._dimensions,inputDimensions:this._inputDimensions,paddingBefore:this._paddingBefore,paddingAfter:this._paddingAfter,transformPositionViewToLocal:new L,transformDirectionViewToLocal:new $,cameraPositionLocal:new h,cameraDirectionLocal:new h,cameraTileCoordinates:new ae,cameraTileUv:new h,ndcSpaceAxisAlignedBoundingBox:new ae,clippingPlanesTexture:void 0,clippingPlanesMatrix:new L,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]}}HDt(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 jDt(e,t,n,i){let r=h.add(e,t,new h);if(h.add(r,n,r),i===m0.Y_UP){let o=r.y;r.y=r.z,r.z=o}return r}function HDt(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=Ye(r,!0)}Object.defineProperties(g0.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=L.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=D.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){Aa.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=Vw(this._provider);this._customShader=r??g0.DefaultCustomShader}this._shaderDirty=!0}},customShaderCompilationEvent:{get:function(){return this._customShaderCompilationEvent}},statistics:{get:function(){return this._statistics}}});var GDt=new ae,WDt=new ae,qDt=new L,YDt=new L,XDt=new h,KDt=new ae;g0.prototype.update=function(e){let t=this._provider,n=this._uniforms;this._customShader.update(e);let i=e.context;if(!this._ready){n1t(this,t,i),e.afterRender.push(()=>(this._ready=!0,!0));return}let r=BPe(this),o=t1t(this,e);if((r||o)&&(this._shapeVisible=kPe(this),d1t(this)&&(this._shaderDirty=!0)),!this._shapeVisible)return;this._shape.updateViewTransforms(e);let a=h1t(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&&x1t(this,e),this._disableRender))return;this._useLogDepth!==e.useLogDepth&&(this._useLogDepth=e.useLogDepth,this._shaderDirty=!0),m1t(this,e)&&(this._shaderDirty=!0);let f=s.leafNodeTexture;l(f)&&(n.octreeLeafNodeTexture=s.leafNodeTexture,n.octreeLeafNodeTexelSizeUv=z.clone(s.leafNodeTexelSizeUv,n.octreeLeafNodeTexelSizeUv),n.octreeLeafNodeTilesPerRow=s.leafNodeTilesPerRow),this._shaderDirty&&(Xz(this,i),this._shaderDirty=!1);let d=i.uniformState.viewProjection,{orientedBoundingBox:p}=this._shape,g=_1t(p,d,WDt);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=L.multiplyTransformation(this._transformPositionWorldToLocal,y,n.transformPositionViewToLocal);this._transformPlaneLocalToView=L.transpose(A,this._transformPlaneLocalToView);let b=i.uniformState.inverseViewRotation;n.transformDirectionViewToLocal=$.multiply(this._transformDirectionWorldToLocal,b,n.transformDirectionViewToLocal),n.cameraPositionLocal=L.multiplyByPoint(this._transformPositionWorldToLocal,e.camera.positionWC,n.cameraPositionLocal),n.cameraDirectionLocal=$.multiplyByVector(this._transformDirectionWorldToLocal,e.camera.directionWC,n.cameraDirectionLocal);let x=ZDt(this,n.cameraPositionLocal,KDt);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,$Dt(this),JDt(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 $Dt(e){let{megatextures:t}=e._traversal;for(let n=0;n<t.length;++n)t[n].nearestSampling=e._nearestSampling}function JDt(e,t){let n=e._uniforms,{renderBoundPlanes:i}=e._shape;l(i)&&(i.update(t,e._transformPlaneLocalToView),n.renderBoundPlanesTexture=i.texture)}function ZDt(e,t,n){let i=e._shape.convertLocalToShapeUvSpace(t,XDt),r=e._availableLevels,o=2**(r-1);return ae.fromElements(i.x*o,i.y*o,i.z*o,r-1,n)}var QDt=new h,pne=new h,e1t=new de;function t1t(e,t){let{verticalExaggeration:n,verticalExaggerationRelativeHeight:i}=t;return e._verticalExaggeration===n&&e._verticalExaggerationRelativeHeight===i?!1:(e._verticalExaggeration=n,e._verticalExaggerationRelativeHeight=i,!0)}function n1t(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 tU(e,n,r),e.statistics.texturesByteLength=e._traversal.textureMemoryByteLength,f1t(e._traversal,i)}function BPe(e){return nU(e,"_modelMatrix","_modelMatrixOld")+nU(e,"_minBounds","_minBoundsOld")+nU(e,"_maxBounds","_maxBoundsOld")+nU(e,"_minClippingBounds","_minClippingBoundsOld")+nU(e,"_maxClippingBounds","_maxClippingBoundsOld")>0}function nU(e,t,n){let i=e[t],r=e[n],o=!i.equals(r);return o&&i.clone(r),o?1:0}var i1t=new h,r1t=new h,o1t=new h,a1t=new h,s1t=new L,c1t=new L;function kPe(e){let t=e._verticalExaggeration,n=e._verticalExaggerationRelativeHeight,i=h.clone(e._minBounds,i1t),r=h.clone(e._maxBounds,r1t),o=h.clone(e._minClippingBounds,o1t),a=h.clone(e._maxClippingBounds,a1t),s=L.clone(e._modelMatrix,s1t);if(e.shape===_c.ELLIPSOID)i.z=fr.getHeight(e._minBounds.z,t,n),r.z=fr.getHeight(e._maxBounds.z,t,n),o.z=fr.getHeight(e._minClippingBounds.z,t,n),a.z=fr.getHeight(e._maxClippingBounds.z,t,n);else{let m=h.fromElements(1,1,t,QDt);L.multiplyByScale(s,m,s),L.multiplyByTranslation(s,u1t(e),s)}let c=e._provider,u=c.shapeTransform??L.IDENTITY,f=c.globalTransform??L.IDENTITY,d=L.multiplyTransformation(f,s,c1t);L.multiplyTransformation(d,u,d);let p=e._shape;return p.update(d,i,r,o,a)?(e._transformPositionLocalToWorld=L.clone(p.shapeTransform,e._transformPositionLocalToWorld),e._transformPositionWorldToLocal=L.inverse(e._transformPositionLocalToWorld,e._transformPositionWorldToLocal),e._transformDirectionWorldToLocal=L.getMatrix3(e._transformPositionWorldToLocal,e._transformDirectionWorldToLocal),!0):!1}var l1t=new h;function u1t(e){let t=e._verticalExaggeration,n=e._verticalExaggerationRelativeHeight,{shapeTransform:i=L.IDENTITY,globalTransform:r=L.IDENTITY}=e._provider,o=L.getTranslation(i,pne),a=L.multiplyByPoint(e._modelMatrix,o,pne),s=L.multiplyByPoint(r,a,pne),u=te.WGS84.cartesianToCartographic(s,e1t),f=0;l(u)&&(f=u.height);let d=fr.getHeight(f,t,n);return h.fromElements(0,0,(d-f)/t,l1t)}function f1t(e,t){t.octreeInternalNodeTexture=e.internalNodeTexture,t.octreeInternalNodeTexelSizeUv=z.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 d1t(e){let{shaderDefines:t}=e._shape,n=Object.keys(t).some(i=>t[i]!==e._shapeDefinesOld[i]);return n&&(e._shapeDefinesOld=Ye(t,!0)),n}function h1t(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 m1t(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=L.transpose(L.multiplyTransformation(L.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)}g0.prototype.isDestroyed=function(){return!1};g0.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 FPe=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)),p1t=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),g1t=new Array(new ae,new ae,new ae,new ae,new ae,new ae,new ae,new ae);function _1t(e,t,n){let i=L.fromRotationTranslation(e.halfAxes,e.center,qDt),r=L.multiply(t,i,YDt),o=+Number.MAX_VALUE,a=-Number.MAX_VALUE,s=+Number.MAX_VALUE,c=-Number.MAX_VALUE,u,f=g1t,d=FPe.length;for(u=0;u<d;u++)L.multiplyByVector(r,FPe[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=p1t[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,GDt),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=D.clamp(o,-1,1),s=D.clamp(s,-1,1),a=D.clamp(a,-1,1),c=D.clamp(c,-1,1),n=ae.fromElements(o,s,a,c,n),n}var gne=3e7,y1t=new h(gne,0,0),A1t=new h(0,gne,0),b1t=new h(0,0,gne);function x1t(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:tr.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,y1t,U.RED,s),r(h.ZERO,A1t,U.LIME,s),r(h.ZERO,b1t,U.BLUE,s),i.update(t)}g0.DefaultCustomShader=new h0({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 zPe(){this.shape=_c.BOX,this.dimensions=new h(1,1,1),this.names=["data"],this.types=[gt.SCALAR],this.componentTypes=[Mt.FLOAT32],this.maximumTileCount=1}zPe.prototype.requestData=function(e){if((l(e)?e.tileLevel??0:0)>=1)return;let n=new EC({metadata:[new Float32Array(1)]});return Promise.resolve(n)};g0.DefaultProvider=new zPe;var YA=g0;function T1t(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 iU=T1t;function C1t(e,t,n,i,r){this.schemaId=e,this.className=t,this.propertyName=n,this.classProperty=i,this.metadataProperty=r}var rU=C1t;function v1t(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 oU=v1t;var f5=function(e){return function(){e.frameState.afterRender.push(function(){e.requestRender()})}};function mi(e){e=e??H.EMPTY_OBJECT;let t=e.canvas,n=e.creditContainer,i=e.creditViewport,r=e.contextOptions instanceof QM;if(r)this._context=e.contextOptions.createSceneContext(t);else{let u=Ye(e.contextOptions);this._context=new Nx(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 S3,this._frameState=new v3(o,new g3(n,"\u2022",i),this._jobScheduler),this._frameState.scene3DOnly=e.scene3DOnly??!1,this._removeCreditContainer=!a,this._creditContainer=n,this._canvas=t,this._computeEngine=new jM(o),this._ellipsoid=e.ellipsoid??te.default,this._globe=void 0,this._globeTranslucencyState=new E3,this._primitives=new Xl({countReferences:r}),this._groundPrimitives=new Xl({countReferences:r}),this._globeHeight=void 0,this._globeHeightDirty=!0,this._cameraUnderground=!1,this._removeUpdateHeightCallback=void 0,this._logDepthBuffer=mi.defaultLogDepthBuffer&&o.fragmentDepth,this._logDepthBufferDirty=!0,this._tweens=new bC,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._overlayCommandList=[],this._useOIT=e.orderIndependentTranslucency??!0,this._executeOITFunction=void 0,this._depthPlane=new x3(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 pz(this),this._preUpdate=new be,this._postUpdate=new be,this._renderError=new be,this._preRender=new be,this._postRender=new be,this._controllerHost=new m3,this._minimumDisableDepthTestDistance=0,this._debugInspector=new wz,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 Bi(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 dT,this.fog=new C3,this.fog.enabled=te.WGS84.equals(this._ellipsoid),te.WGS84.equals(this._ellipsoid)||(vr.DEFAULT_VIEW_RECTANGLE=ie.fromDegrees(-45,-45,45,45)),this._shadowMapCamera=new vr(this),this.shadowMap=new E_({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 Nw,this.focalLength=void 0,this.eyeSeparation=void 0,this.postProcessStages=new hz,this._brdfLutGenerator=new l3,this._performanceDisplay=void 0,this._debugVolume=void 0,this._screenSpaceCameraController=new Az(this),this._cameraUnderground=!1,this._mapMode2D=e.mapMode2D??au.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=jc.requestCompletedEvent.addEventListener(f5(this)),this._removeTaskProcessorListenerCallback=Yn.taskCompletedEvent.addEventListener(f5(this)),this._removeGlobeCallbacks=[],this._removeTerrainProviderReadyListener=void 0;let s=new Je(0,0,o.drawingBufferWidth,o.drawingBufferHeight),c=new vr(this);this._logDepthBuffer&&(c.frustum.near=.1,c.frustum.far=1e10),this.preloadFlightCamera=new vr(this),this.preloadFlightCullingVolume=void 0,this._picking=new G3(this),this._defaultView=new hC(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 Tg,this._enableEdgeVisibility=!1,this._enablePlanarFillId=!1,WPe(this,0,K.now()),this.updateFrameState(),this.initializeFrame()}mi.defaultLogDepthBuffer=!0;function E1t(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(f5(e))),n.push(t.terrainProviderChanged.addEventListener(f5(e)))),e._removeGlobeCallbacks=n}Object.defineProperties(mi.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 Lt.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return Lt.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 gm.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,E1t(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 vr(this),l(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new T3(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,Lt.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}}});mi.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 S1t(e,t){let n=e.pickedMetadataInfo,i=t.pickedMetadataInfo;return n?.schemaId!==i?.schemaId||n?.className!==i?.className||n?.propertyName!==i?.propertyName}function UPe(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=Bm.createPickDerivedCommand(e,t,r,c.picking)),l(t.snapId)&&i.passes.snap&&(c.snapping=Bm.createSnapDerivedCommand(e,t,r,c.snapping)),i.pickingMetadata&&t.pickMetadataAllowed&&(t.pickedMetadataInfo=i.pickedMetadataInfo,l(t.pickedMetadataInfo)&&(c.pickingMetadata=Bm.createPickMetadataDerivedCommand(e,t,r,c.pickingMetadata))),t.pickOnly||(c.depth=Bm.createDepthOnlyDerivedCommand(e,t,r,c.depth)),c.originalCommand=t,e._hdr&&(c.hdr=Bm.createHdrCommand(t,r,c.hdr),t=c.hdr.command,c=t.derivedCommands),s&&t.receiveShadows&&(c.shadows=E_.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))}mi.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&&S1t(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=E_.createCastDerivedCommand(x,e,a,o,t.shadows)),(u||p)&&(t.logDepth=Bm.createLogDepthCommand(e,o,t.logDepth),UPe(this,t.logDepth.command,a)),(d||m)&&UPe(this,e,a)};var w1t=new lh({pass:no.RENDER}),_ne=new lh({pass:no.PRELOAD}),yne=new lh({pass:no.PRELOAD_FLIGHT}),I1t=new lh({pass:no.REQUEST_RENDER_MODE_DEFER_CHECK}),VPe=new se,Ane;function P1t(e){if(!(e._mode!==re.SCENE3D||!e.globe?.show||e._cameraUnderground||e._globeTranslucencyState.translucent))return VPe.radius=e.ellipsoid.minimumRadius+e.frameState.minimumTerrainHeight,Ane=r1.fromBoundingSphere(VPe,e.camera.positionWC,Ane),Ane}mi.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 WPe(e,t,n){let i=e._frameState;i.frameNumber=t,i.time=K.clone(n,i.time)}mi.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=P1t(this),t.minimumTerrainHeight=0,t.minimumDisableDepthTestDistance=this._minimumDisableDepthTestDistance,t.invertClassification=this.invertClassification,t.useLogDepth=this._logDepthBuffer&&!(this.camera.frustum instanceof mn||this.camera.frustum instanceof da),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),Nw.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};mi.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 u5=new L(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);u5=L.inverseTransformation(u5,u5);function D1t(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=L.multiplyByPoint(u5,s,s);let m=r.mapProjection,y=m.unproject(s);s=m.ellipsoid.cartographicToCartesian(y)}let c,u,{radius:f}=a;l(f)?(c=Rs.createGeometry(new Rs({radii:new h(f,f,f),vertexFormat:gn.FLAT_VERTEX_FORMAT})),u=L.fromTranslation(s)):(c=wc.createGeometry(wc.fromDimensions({dimensions:new h(2,2,2),vertexFormat:gn.FLAT_VERTEX_FORMAT})),u=L.fromRotationTranslation(a.halfAxes,s,new L)),t._debugVolume=new Nn({geometryInstances:new Nt({geometry:Hn.toWireframe(c),modelMatrix:u,attributes:{color:new Kt(1,0,0,1)}}),appearance:new gn({flat:!0,translucent:!1}),asynchronous:!1});let d=r.commandList,p=r.commandList=[];t._debugVolume.update(r),e=p[0],r.useLogDepth&&(e=Bm.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 lu(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)&&D1t(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 jPe(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 qPe(e,t,n){return t.boundingVolume.distanceSquaredTo(n)-e.boundingVolume.distanceSquaredTo(n)}var R1t=new h;function HPe(e,t){let n=h.subtract(e,t,R1t),i=Math.max(0,h.magnitude(n));return i*i}function O1t(e,t,n){let i=e.boundingVolume,r=t.boundingVolume;return HPe(r.center,n)-HPe(i.center,n)}function M1t(e,t,n){return e.boundingVolume.distanceSquaredTo(n)-t.boundingVolume.distanceSquaredTo(n)+D.EPSILON12}function L1t(e,t,n,i,r){Up(i,qPe,e.camera.positionWC),l(r)&&t(r.unclassifiedCommand,e,n);for(let o=0;o<i.length;++o)t(i[o],e,n)}function N1t(e,t,n,i,r){Up(i,M1t,e.camera.positionWC),l(r)&&t(r.unclassifiedCommand,e,n);for(let o=0;o<i.length;++o)t(i[o],e,n)}function F1t(e,t,n){e.context.uniformState.updatePass(Pe.VOXELS);let i=n.commands[Pe.VOXELS];i.length=n.indices[Pe.VOXELS],Up(i,qPe,e.camera.positionWC);for(let r=0;r<i.length;++r)lu(i[r],e,t)}function B1t(e,t,n){e.context.uniformState.updatePass(Pe.GAUSSIAN_SPLATS);let i=n.commands[Pe.GAUSSIAN_SPLATS];i.length=n.indices[Pe.GAUSSIAN_SPLATS],Up(i,O1t,e.camera.positionWC);for(let r=0;r<i.length;++r)lu(i[r],e,t)}var k1t=new Gi,z1t=new Fl,U1t=new mn,V1t=new da;function j1t(e){let{frustum:t}=e;return l(t.fov)?t.clone(k1t):l(t.infiniteProjectionMatrix)?t.clone(z1t):l(t.width)?t.clone(U1t):t.clone(V1t)}function H1t(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?L1t:N1t}function G1t(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=H1t(e);r.uniformState.updatePass(Pe.TRANSLUCENT);let f=n.commands[Pe.TRANSLUCENT];f.length=n.indices[Pe.TRANSLUCENT],u(e,lu,t,f,c)}function W1t(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,lu,t,a,r.depthStencilTexture),i.executeClassificationCommands(e,lu,t,n)}function q1t(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)lu(r[a],e,t);t.framebuffer=i}function Y1t(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)lu(s[d],e,t);t.framebuffer=u}}function X1t(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)lu(i[o],e,t)}function xne(e,t){let{camera:n,context:i,frameState:r}=e,{uniformState:o}=i;o.updateCamera(n),o.planarFillIdTexture=i.defaultTexture;let a=j1t(n);a.near=n.frustum.near,a.far=n.frustum.far;let s=r.passes,c=s.pick||s.pickVoxel;c||K1t(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,P=e._classificationStencilClearCommand,R=e._depthPlane,O=n.position.z;function N(v,S){o.updatePass(S);let I=v.commands[S],M=v.indices[S];for(let F=0;F<M;++F)lu(I[F],e,t);return M}function _(v,S){o.updatePass(S);let I=v.commands[S],M=v.indices[S];for(let F=0;F<M;++F)jPe(I[F],e,t)}for(let v=0;v<T;++v){let S=T-v-1,I=x[S];e.mode===re.SCENE2D?(n.position.z=O-I.near+1,a.far=Math.max(1,I.far-I.near),a.near=1,o.update(r),o.updateFrustum(a)):(a.near=S!==0?I.near*e.opaqueFrustumNearOffset:I.near,a.far=I.far,o.updateFrustum(a)),E.execute(i,t),i.stencilBuffer&&w.execute(i,t),C.translucent?(o.updatePass(Pe.GLOBE),C.executeGlobeCommands(I,lu,A,e,t)):N(I,Pe.GLOBE),p&&y.executeCopyDepth(i,t),f||(C.translucent?(o.updatePass(Pe.TERRAIN_CLASSIFICATION),C.executeGlobeClassificationCommands(I,lu,A,e,t)):N(I,Pe.TERRAIN_CLASSIFICATION)),u&&(E.execute(i,t),d&&R.execute(i,t));let M;if(q1t(e,t,I),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 k=e._view.edgeFramebuffer.idTexture;l(k)?e.context.uniformState.edgeIdTexture=k: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(Y1t(e,t,I),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)M=N(I,Pe.CESIUM_3D_TILE),M>0&&(p&&(y.prepareColorTextures(i,u),y.executeUpdateDepth(i,t,y.depthStencilTexture)),f||(M=N(I,Pe.CESIUM_3D_TILE_CLASSIFICATION)));else{e._invertClassification.clear(i,t);let V=t.framebuffer;t.framebuffer=e._invertClassification._fbo.framebuffer,N(I,Pe.CESIUM_3D_TILE),p&&(e._invertClassification.prepareTextures(i),y.executeUpdateDepth(i,t,e._invertClassification._fbo.getDepthStencilTexture())),M=N(I,Pe.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW),t.framebuffer=V,e._invertClassification.executeClassified(i,t),r.invertClassificationColor.alpha===1&&e._invertClassification.executeUnclassified(i,t),M>0&&i.stencilBuffer&&P.execute(i,t),M=N(I,Pe.CESIUM_3D_TILE_CLASSIFICATION)}if(M>0&&i.stencilBuffer&&w.execute(i,t),F1t(e,t,I),N(I,Pe.OPAQUE),X1t(e,t,I),B1t(e,t,I),S!==0&&e.mode!==re.SCENE2D&&(a.near=I.near,o.updateFrustum(a)),G1t(e,t,I),W1t(e,t,I),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?I.near*e.opaqueFrustumNearOffset:I.near,a.far=I.far,o.updateFrustum(a),C.translucent?(o.updatePass(Pe.GLOBE),C.executeGlobeCommands(I,jPe,A,e,t)):_(I,Pe.GLOBE),u&&(E.framebuffer=t.framebuffer,E.execute(i,t),E.framebuffer=void 0),u&&d&&R.execute(i,t),_(I,Pe.CESIUM_3D_TILE),_(I,Pe.OPAQUE),_(I,Pe.TRANSLUCENT),t.framebuffer=F}}function K1t(e,t){let{context:n,environmentState:i,view:r}=e;if(n.uniformState.updatePass(Pe.ENVIRONMENT),l(i.skyBoxCommand)&&lu(i.skyBoxCommand,e,t),i.isSkyAtmosphereVisible&&lu(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)?lu(o[a],e,t):o.splice(a,1)}}function YPe(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 $1t(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 J1t(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 XPe(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;J1t(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];lu(A,e,d.passState)}}}}var Z1t=new h;mi.prototype.updateAndExecuteCommands=function(e,t){fRt(this,e,t),this._environmentState.useWebVR?Q1t(this,e,t):this._frameState.mode!==re.SCENE2D||this._mapMode2D===au.ROTATE?XA(!0,this,e):cRt(this,e)};function Q1t(e,t){let n=e._view,i=n.camera,o=e._environmentState.renderTranslucentDepthForPick;KPe(e),n.createPotentiallyVisibleSet(e),YPe(e),o||XPe(e);let a=t.viewport;a.x=0,a.y=0,a.width=a.width*.5;let s=vr.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,Z1t);i.frustum.aspectRatio=a.width/a.height;let p=.5*f*c/u;h.add(s.position,d,i.position),i.frustum.xOffset=p,xne(e,t),a.x=a.width,h.subtract(s.position,d,i.position),i.frustum.xOffset=-p,xne(e,t),vr.clone(s,i)}var eRt=new de(Math.PI,D.PI_OVER_TWO),tRt=new h,nRt=new h,iRt=new L,rRt=new L,oRt=new h,aRt=new h,sRt=new Je;function cRt(e,t){let{frameState:n,camera:i}=e,{uniformState:r}=e.context,o=t.viewport,a=Je.clone(o,sRt);t.viewport=a;let s=eRt,c=tRt;e.mapProjection.project(s,c);let f=h.clone(i.position,nRt),d=L.clone(i.transform,rRt),p=i.frustum.clone();i._setTransform(L.IDENTITY);let g=L.computeViewportTransformation(a,0,1,iRt),m=i.frustum.projectionMatrix,y=i.positionWC.y,A=h.fromElements(D.sign(y)*c.x-y,0,-i.positionWC.x,oRt),b=mt.pointToGLWindowCoordinates(m,g,A,aRt);b.x=Math.floor(b.x);let x=a.x,T=a.width;if(y===0||b.x<=x||b.x>=x+T)XA(!0,e,t);else if(Math.abs(x+T*.5-b.x)<1)a.width=b.x-a.x,i.position.x*=D.sign(i.position.x),i.frustum.right=0,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),r.update(n),XA(!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),XA(!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),XA(!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),XA(!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),XA(!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),XA(!1,e,t)}i._setTransform(d),h.clone(f,i.position),i.frustum=p.clone(),t.viewport=o}function XA(e,t,n){let i=t._view,{renderTranslucentDepthForPick:r}=t._environmentState;e||(t.frameState.commandList.length=0),KPe(t),i.createPotentiallyVisibleSet(t),e&&(YPe(t),r||XPe(t)),xne(t,n)}var GPe=new qa;mi.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 mn||!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(zg.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=GPe.planes;for(let A=0;A<5;++A)g[A]=p.planes[A];p=GPe,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 gm(m)):!l(m)&&l(y)&&(y.destroy(),this._specularEnvironmentCubeMap=void 0),l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.update(e)};function lRt(e){let t=e._frameState;e.debugShowFrustumPlanes!==e._debugShowFrustumPlanes&&(e.debugShowFrustumPlanes?e._debugFrustumPlanes=new a0({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 uRt(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 KPe(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,lRt(e),uRt(e),e._globe&&e._globe.render(t)}function fRt(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 Ez: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)}mi.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 dRt(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 hRt(e){if(e.mode===re.MORPHING)return;let t=e.camera.positionCartographic;return e.getHeight(t)}function $Pe(e,t,n){let i=Number.NEGATIVE_INFINITY;if(e instanceof Xl){let r=e.length;for(let o=0;o<r;++o){let a=e.get(o),s=$Pe(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}mi.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=$Pe(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 bne=new de;mi.prototype.updateHeight=function(e,t,n){let i=this._ellipsoid,r=g=>{de.clone(e,bne);let m;l(g)&&(m=g.height),l(m)||(m=this.getHeight(e,n)),l(m)&&(bne.height=m,t(bne))},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 mRt(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}mi.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=hRt(this),this._globeHeightDirty=!1;let e=this.camera.positionCartographic;this._removeUpdateHeightCallback=this.updateHeight(e,t=>{this.isDestroyed()||(this._globeHeight=t.height)})}this._cameraUnderground=mRt(this),this._globeTranslucencyState.update(this),this._screenSpaceCameraController.update(),l(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this.camera.update(this._mode),this.camera._updateCameraChanged()};function pRt(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 T_({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 gRt(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 _Rt(e){e.primitives.postPassesUpdate(e._frameState),jc.update()}var yRt=new U;function ARt(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=w1t;let o=e.backgroundColor??U.BLACK;e._hdr&&(o=U.clone(o,yRt),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 Tg?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,$1t(e,c),l(e.globe)&&(e.globe.endFrame(t),e.globe.tilesLoaded||(e._renderRequested=!0)),n.endFrame()}function PC(e,t){try{t(e)}catch(n){if(e._renderError.raiseEvent(e,n),e.rethrowRenderErrors)throw n}}function bRt(e){return e._picking.updateMostDetailedRayPicks(e)}mi.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=D.incrementWrap(t.frameNumber,15e6,1);WPe(this,r,e),t.newFrame=!0}PC(this,gRt),this.primitives.show&&(PC(this,bRt),PC(this,xRt),PC(this,TRt),i||PC(this,CRt)),this._postUpdate.raiseEvent(this,e),i&&(this._preRender.raiseEvent(this,e),t.creditDisplay.beginFrame(),PC(this,ARt)),pRt(this,i),PC(this,_Rt),dRt(this),i&&(this._postRender.raiseEvent(this,e),t.creditDisplay.endFrame())};mi.prototype.forceRender=function(e){this._renderRequested=!0,this.render(e)};mi.prototype.requestRender=function(){this._renderRequested=!0};mi.prototype.clampLineWidth=function(e){return Math.max(Lt.minimumAliasedLineWidth,Math.min(e,Lt.maximumAliasedLineWidth))};mi.prototype.pick=function(e,t,n){return this._picking.pick(this,e,t,n,1)[0]};mi.prototype.snap=function(e,t){return Tz.snap(this,e,t)};mi.prototype.pickAsync=async function(e,t,n){return(await this._picking.pickAsync(this,e,t,n,1))[0]};mi.prototype.pickVoxel=function(e,t,n){let i=this.pick(e,t,n);if(!l(i))return;let r=i.primitive;if(!(r instanceof YA))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 Iz.fromKeyframeNode(r,a,c,s)};mi.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=iU(a,t,n,i);if(!l(s))return;let c=oU(o,n,i);if(!l(c))return;let u=new rU(t,n,i,s,c);return this._picking.pickMetadata(this,e,u)};mi.prototype.pickMetadataSchema=function(e){let t=this.pick(e);return l(t)?t.detail?.model?.structuralMetadata?.schema:void 0};mi.prototype.pickPositionWorldCoordinates=function(e,t){return this._picking.pickPositionWorldCoordinates(this,e,t)};mi.prototype.pickPosition=function(e,t){return this._picking.pickPosition(this,e,t)};mi.prototype.drillPick=function(e,t,n,i){return this._picking.drillPick(this,e,t,n,i)};function xRt(e){let t=e._frameState;_ne.camera=t.camera,_ne.cullingVolume=t.cullingVolume,e.primitives.updateForPass(t,_ne)}function TRt(e){let t=e._frameState;if(!t.camera.canPreloadFlight())return;yne.camera=e.preloadFlightCamera,yne.cullingVolume=e.preloadFlightCullingVolume,e.primitives.updateForPass(t,yne)}function CRt(e){e.primitives.updateForPass(e._frameState,I1t)}mi.prototype.pickFromRay=function(e,t,n){return this._picking.pickFromRay(this,e,t,n)};mi.prototype.drillPickFromRay=function(e,t,n,i){return this._picking.drillPickFromRay(this,e,t,n,i)};mi.prototype.pickFromRayMostDetailed=function(e,t,n){return this._picking.pickFromRayMostDetailed(this,e,t,n)};mi.prototype.drillPickFromRayMostDetailed=function(e,t,n,i){return this._picking.drillPickFromRayMostDetailed(this,e,t,n,i)};mi.prototype.sampleHeight=function(e,t,n){return this._picking.sampleHeight(this,e,t,n)};mi.prototype.clampToHeight=function(e,t,n,i){return this._picking.clampToHeight(this,e,t,n,i)};mi.prototype.sampleHeightMostDetailed=function(e,t,n){return this._picking.sampleHeightMostDetailed(this,e,t,n)};mi.prototype.clampToHeightMostDetailed=function(e,t,n){return this._picking.clampToHeightMostDetailed(this,e,t,n)};mi.prototype.cartesianToCanvasCoordinates=function(e,t){return sr.worldToWindowCoordinates(this,e,t)};mi.prototype.completeMorph=function(){this._transitioner.completeMorph()};mi.prototype.morphTo2D=function(e){e=e??2,this._transitioner.morphTo2D(e,this._ellipsoid)};mi.prototype.morphToColumbusView=function(e){e=e??2,this._transitioner.morphToColumbusView(e,this._ellipsoid)};mi.prototype.morphTo3D=function(e){e=e??2,this._transitioner.morphTo3D(e,this._ellipsoid)};function vRt(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()})}mi.prototype.setTerrain=function(e){return vRt(this,e),e};mi.prototype.isDestroyed=function(){return!1};mi.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 aU=mi;var Hw=`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 sU=`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 cU=`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 Gw(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=L.fromScale(n),this._modelMatrix=new L,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(Gw.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});Gw.prototype.setDynamicLighting=function(e){this._radiiAndDynamicAtmosphereColor.z=e};var Tne=new L;Gw.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=L.fromRotationTranslation(e.context.uniformState.inverseViewRotation,h.ZERO,Tne),r=L.multiplyTransformation(i,ki.Y_UP_TO_Z_UP,Tne),o=L.multiply(this._scaleMatrix,r,Tne);L.clone(o,this._modelMatrix);let a=e.context,s=ERt(this),c=e.globeTranslucencyState.translucent,u=this.perFragmentAtmosphere||c||!l(t)||!t.show,f=this._command;if(!l(f.vertexArray)){let p=Rs.createGeometry(new Rs({radii:new h(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:Be.POSITION_ONLY}));f.vertexArray=Vn.fromGeometry({context:a,geometry:p,attributeLocations:Hn.createAttributeLocations(p),bufferUsage:Oe.STATIC_DRAW}),f.renderState=je.fromCache({cull:{enabled:!0,face:zi.FRONT},blending:Qt.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:[mm,Hw,cU]}),m=new Ge({defines:p,sources:[mm,Hw,sU]});this._spSkyAtmosphere=Zt.fromCache({context:a,vertexShaderSource:g,fragmentShaderSource:m}),f.shaderProgram=this._spSkyAtmosphere}return f};function ERt(e){return!(D.equalsEpsilon(e.hueShift,0,D.EPSILON7)&&D.equalsEpsilon(e.saturationShift,0,D.EPSILON7)&&D.equalsEpsilon(e.brightnessShift,0,D.EPSILON7))}Gw.prototype.isDestroyed=function(){return!1};Gw.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 lU=Gw;var uU=`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 fU=`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 dU=`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 hU(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:L.clone(L.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 St(t)),this._credit=t}Object.defineProperties(hU.prototype,{transform:{get:function(){return this._transform}},credit:{get:function(){return l(this._credit)?this._credit:void 0}}});hU.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"?nL(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 Jo({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=wc.createGeometry(wc.fromDimensions({dimensions:new h(2,2,2),vertexFormat:Be.POSITION_ONLY})),u=this._attributeLocations=Hn.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:Qt.ALPHA_BLEND}),this._addToPanoramaCommandList=!0}if(!l(s.shaderProgram)||this._useHdr!==t){let c=new Ge({defines:[t?"HDR":""],sources:[uU]});s.shaderProgram=Zt.fromCache({context:o,vertexShaderSource:l(this._transform)?dU:fU,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)}};hU.prototype.isDestroyed=function(){return!1};hU.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 DC=hU;function RC(e){this._sources=e.sources,this._show=e.show??!0,this._panorama=new DC({sources:this._sources,show:this._show,returnCommand:!0})}Object.defineProperties(RC.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}}});RC.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)};RC.prototype.isDestroyed=function(){return!1};RC.prototype.destroy=function(){return this._panorama=this._panorama&&this._panorama.destroy(),ue(this)};function Ww(e){return $t(`Assets/Textures/SkyBox/tycho2t3_80_${e}.jpg`)}RC.createEarthSkyBox=function(){return new RC({sources:{positiveX:Ww("px"),negativeX:Ww("mx"),positiveY:Ww("py"),negativeY:Ww("my"),positiveZ:Ww("pz"),negativeZ:Ww("mz")}})};var mU=RC;var pU=`uniform sampler2D u_texture;
in vec2 v_textureCoordinates;
void main()
{
vec4 color = texture(u_texture, v_textureCoordinates);
out_FragColor = czm_gammaCorrect(color);
}
`;var gU=`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 _U=`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 AU(){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(AU.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var SRt=new z,wRt=new z,IRt=new ae,yU=new ae;AU.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 Ct({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,P={u_radiusTS:function(){return w._radiusTS}};this._commands.computeCommand=new Vl({fragmentShaderSource:gU,outputTexture:this._texture,uniformMap:P,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}),P=[{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:P,indexBuffer:R}),s.shaderProgram=Zt.fromCache({context:r,vertexShaderSource:_U,fragmentShaderSource:pU,attributeLocations:C}),s.renderState=je.fromCache({blending:Qt.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=D.SOLAR_RADIUS+D.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=sr.computeActualEllipsoidPosition(e,c,yU),g=h.magnitude(h.subtract(p,e.camera.position,yU)),m=r.uniformState.projection,y=IRt;y.x=0,y.y=0,y.z=-g,y.w=1;let A=L.multiplyByVector(m,y,yU),b=sr.clipToGLWindowCoordinates(t.viewport,A,SRt);y.x=D.SOLAR_RADIUS;let x=L.multiplyByVector(m,y,yU),T=sr.clipToGLWindowCoordinates(t.viewport,x,wRt);return this._size=z.magnitude(z.subtract(T,b,yU)),this._size=2*this._size*(1+2*this._glowLengthTS),this._size=Math.ceil(this._size),this._commands};AU.prototype.isDestroyed=function(){return!1};AU.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 bU=AU;var QPe=Go(c8(),1);function PRt(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 xU=PRt;var DRt={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}}},qw=DRt;var OC={NEEDS_DECODE:0,DECODING:1,READY:2,FAILED:3};function TU(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=OC.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=L.clone(L.IDENTITY),this._modelMatrix=L.clone(L.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??Fo.NONE,this._splittingEnabled=!1,this._error=void 0,RRt(this,e)}Object.defineProperties(TU.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 RRt(e,t){let n=PT.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=ym.getBinaryProperties(n.pointsLength,n.batchTableJson,n.batchTableBinary)),l(n.draco)){let s=n.draco;e._decodingState=OC.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 ORt=new h,MRt=new h,LRt=new h,JPe,d5;function NRt(e){if(!l(d5)){JPe=new QPe.default(0),d5=new Array(e);for(let t=0;t<e;++t)d5[t]=JPe.random()}return d5}function FRt(e){let n=e.length/3,i=Math.min(n,20),r=NRt(20),o=Number.MAX_VALUE,a=-Number.MAX_VALUE,s=h.fromElements(o,o,o,ORt),c=h.fromElements(a,a,a,MRt);for(let f=0;f<i;++f){let d=Math.floor(r[f]*n),p=h.unpack(e,d*3,LRt);h.minimumByComponent(s,p,s),h.maximumByComponent(c,p,c)}let u=se.fromCornerPoints(s,c);return u.radius+=D.EPSILON2,u}function ZPe(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 BRt=new ae,kRt=new ae,zRt=new U,eDe=0,h5=1,wne=2,tDe=3,URt=4,Cne=new L,VRt=new L;function jRt(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,P,R=[],O={};if(e._styleableShaderAttributes=O,f){let k=URt;for(let j in u)if(u.hasOwnProperty(j)){let B=u[j],G=ZPe(B.typedArray,j);w=B.componentCount,P=Y.fromTypedArray(G);let W=Ze.createVertexBuffer({context:n,typedArray:G,usage:Oe.STATIC_DRAW});e._geometryByteLength+=W.sizeInBytes;let Q={index:k,vertexBuffer:W,componentsPerAttribute:w,componentDatatype:P,normalize:!1,offsetInBytes:0,strideInBytes:0};R.push(Q),O[j]={location:k,componentCount:w},++k}}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=ZPe(c.typedArray,"batchIds"),S=Ze.createVertexBuffer({context:n,typedArray:c.typedArray,usage:Oe.STATIC_DRAW}),e._geometryByteLength+=S.sizeInBytes);let I=[];if(d?P=Y.UNSIGNED_SHORT:p?P=y<=255?Y.UNSIGNED_BYTE:Y.UNSIGNED_SHORT:P=Y.FLOAT,I.push({index:eDe,vertexBuffer:N,componentsPerAttribute:3,componentDatatype:P,normalize:!1,offsetInBytes:0,strideInBytes:0}),e._cull&&(d||p?e._boundingSphere=se.fromCornerPoints(h.ZERO,e._quantizedVolumeScale):e._boundingSphere=FRt(o.typedArray)),T)if(b)I.push({index:h5,vertexBuffer:_,componentsPerAttribute:1,componentDatatype:Y.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0});else{let k=x?4:3;I.push({index:h5,vertexBuffer:_,componentsPerAttribute:k,componentDatatype:Y.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0})}C&&(g?(w=2,P=Y.UNSIGNED_BYTE):m?(w=2,P=A<=255?Y.UNSIGNED_BYTE:Y.UNSIGNED_SHORT):(w=3,P=Y.FLOAT),I.push({index:wne,vertexBuffer:v,componentsPerAttribute:w,componentDatatype:P,normalize:!1,offsetInBytes:0,strideInBytes:0})),E&&I.push({index:tDe,vertexBuffer:S,componentsPerAttribute:1,componentDatatype:Y.fromTypedArray(c.typedArray),normalize:!1,offsetInBytes:0,strideInBytes:0}),f&&(I=I.concat(R));let M=new Vn({context:n,attributes:I}),F={depthTest:{enabled:!0}},V={depthTest:{enabled:!0},depthMask:!1,blending:Qt.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 L,primitiveType:Re.POINTS,vertexArray:M,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 HRt(e,t){let n=t.context,i=e._isQuantized,r=e._isQuantizedDraco,o=e._isOctEncodedDraco,a={u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier:function(){let s=BRt;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 mn?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,zRt);return c.alpha=s.edgeWidth,c},u_clippingPlanesMatrix:function(){let s=e.clippingPlanes;if(!l(s))return L.IDENTITY;let c=e.clippingPlanesOriginMatrix??e._modelMatrix;L.multiply(n.uniformState.view3D,c,Cne);let u=L.multiply(Cne,s.modelMatrix,Cne);return L.inverseTranspose(u,VRt)}};qw.addUniforms(e,a),(i||r||o)&&(a=Ot(a,{u_quantizedVolumeScaleAndOctEncodedRange:function(){let s=kRt;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 vne(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 Ene(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 Sne(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 GRt={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 WRt(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,P,R,O=g,N=Ye(GRt),_={},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),P=n.getShowShaderFunction(`getShowFromStyle${Ce}`,N,le),R=n.getPointSizeShaderFunction(`getPointSizeFromStyle${Ce}`,N,le),l(w)&&le.translucent&&(O=!0)}e._styleTranslucent=O;let S=l(w),I=l(P),M=l(R),F=e.isClipped,V=[],k=[];S&&(vne(w,V),Ene(w,k)),I&&(vne(P,V),Ene(P,k)),M&&(vne(R,V),Ene(R,k));let j=k.indexOf("COLOR")>=0,B=k.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=Sne(T,o.location);Ce.enabled=le}let G=m&&(!S||j);if(m){let le=Sne(T,h5);le.enabled=G}let W=y&&(x||b||B);if(y){let le=Sne(T,wne);le.enabled=W}let Q={a_position:eDe};G&&(Q.a_color=h5),W&&(Q.a_normal=wne),A&&(Q.a_batchId=tDe);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}HRt(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),I&&(Z+=P),M&&(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);
`),I&&(Z+=` float show = float(getShowFromStyle(position, position_absolute, color, normal));
`),M?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;
`),I&&(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+=nC(C,a),ce+=`
`),ce+=`void main()
{
out_FragColor = czm_gammaCorrect(v_color);
`,F&&(ce+=xU("u_clippingPlanes","u_clippingPlanesMatrix","u_clippingPlanesEdgeStyle")),ce+=`}
`,e.splitDirection!==Fo.NONE&&(ce=qw.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 qRt(e,t){if(e._decodingState===OC.READY)return!1;if(e._decodingState===OC.NEEDS_DECODE){let n=e._parsedContent,i=n.draco,r=G0.decodePointCloud(i,t);l(r)&&(e._decodingState=OC.DECODING,r.then(function(o){e._decodingState=OC.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=OC.FAILED,e._error=o}))}return!0}var YRt=new ae,XRt=new h;TU.prototype.update=function(e){let t=e.context;if(l(this._error)){let u=this._error;throw this._error=void 0,u}if(qRt(this,t))return;let i=!1,r=!L.equals(this._modelMatrix,this.modelMatrix);if(this._mode!==e.mode&&(this._mode=e.mode,r=!0),l(this._drawCommand)||(jRt(this,e),r=!0,i=!0,this._ready=!0,this._parsedContent=void 0),r){L.clone(this.modelMatrix,this._modelMatrix);let u=this._drawCommand.modelMatrix;if(L.clone(this._modelMatrix,u),l(this._rtcCenter)&&L.multiplyByTranslation(u,this._rtcCenter,u),l(this._quantizedVolumeOffset)&&L.multiplyByTranslation(u,this._quantizedVolumeOffset,u),e.mode!==re.SCENE3D){let d=e.mapProjection,p=L.getColumn(u,3,YRt);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;L.multiplyByPoint(u,d,d);let p=L.getScale(u,XRt);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!==Fo.NONE;this._splittingEnabled!==o&&(this._splittingEnabled=o,i=!0),i&&WRt(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)};TU.prototype.isDestroyed=function(){return!1};TU.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 CU=TU;function LC(e){e=e??H.EMPTY_OBJECT,this.show=e.show??!0,this.modelMatrix=L.clone(e.modelMatrix??L.IDENTITY),this.shadows=e.shadows??Rn.ENABLED,this.maximumMemoryUsage=e.maximumMemoryUsage??256,this.shading=new qp(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 Hg,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(LC.prototype,{clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){Aa.setOwner(e,this,"_clippingPlanes")}},totalMemoryUsageInBytes:{get:function(){return this._totalMemoryUsageInBytes}},boundingSphere:{get:function(){if(l(this._lastRenderedFrame))return this._lastRenderedFrame.pointCloud.boundingSphere}}});function KRt(e){return`uniform vec4 czm_pickColor;
${e}`}function $Rt(e){return function(t){return Ot(t,{czm_pickColor:function(){return e._pickId.color}})}}function JRt(){return"czm_pickColor"}LC.prototype.makeStyleDirty=function(){this._styleDirty=!0};LC.prototype._getAverageLoadTime=function(){return this._runningLength===0?.05:this._runningAverage};var ZRt=new K;function Pne(e){let t=e._clock,n=t.canAnimate&&t.shouldAnimate,i=t.multiplier;return n?i:0}function MC(e,t){return e._intervals.indexOf(t.start)}function QRt(e,t){let n=e._intervals,i=e._clock,r=Pne(e);if(r===0)return;let o=e._getAverageLoadTime(),a=K.addSeconds(i.currentTime,o*r,ZRt),s=n.indexOf(a),c=MC(e,t);return s===c&&(r>=0?++s:--s),n.get(s)}function eOt(e){let t=e._intervals,i=e._clock.currentTime,r=t.indexOf(i);return t.get(r)}function tOt(e,t,n){let i=Pne(e),r=MC(e,t),o=MC(e,n);return i>=0?r>=o:r<=o}function iDe(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 nOt(e,t,n){let i=MC(e,t),r=e._frames,o=r[i];if(!l(o)){let a=t.data.transform,s=l(a)?L.fromArray(a):void 0,c=t.data.uri;o={pointCloud:void 0,transform:s,timestamp:yn(),sequential:!0,ready:!1,touchedFrameNumber:n.frameNumber,uri:c},r[i]=o,De.fetchArrayBuffer({url:c}).then(function(u){o.pointCloud=new CU({arrayBuffer:u,cull:!0,fragmentShaderLoaded:KRt,uniformMapLoaded:$Rt(e),pickIdLoaded:JRt})}).catch(iDe(e,c))}return o}function iOt(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 rOt(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(rDe(e,t,n,i),r.ready&&(t.ready=!0,e._totalMemoryUsageInBytes+=r.geometryByteLength,o.length=a,t.sequential)){let s=(yn()-t.timestamp)/1e3;iOt(e,s)}}t.touchedFrameNumber=i.frameNumber}var oOt=new L;function aOt(e,t){let n=e.shading;return l(n)&&l(n.baseResolution)?n.baseResolution:l(t.boundingSphere)?D.cbrt(t.boundingSphere.volume()/t.pointsLength):0}function sOt(e){let t=e.shading;return l(t)&&l(t.maximumAttenuation)?t.maximumAttenuation:10}var cOt=new qp;function rDe(e,t,n,i){let r=e.shading??cOt,o=t.pointCloud,a=t.transform??L.IDENTITY;o.modelMatrix=L.multiplyTransformation(e.modelMatrix,a,oOt),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=aOt(e,o),o.geometricErrorScale=r.geometricErrorScale,o.maximumAttenuation=sOt(e);try{o.update(i)}catch(s){iDe(e,t.uri)(s)}t.touchedFrameNumber=i.frameNumber}function Ine(e,t,n,i){let r=nOt(e,t,i);rOt(e,r,n,i)}function lOt(e){return function(t){return t.touchedFrameNumber<e.frameNumber}}function oDe(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 uOt(e,t){let n=MC(e,t),i=e._frames[n];if(l(i)&&i.ready)return i}function nDe(e,t,n,i,r){return l(n)?n.ready?!0:(Ine(e,t,i,r),n.ready):!1}function fOt(e,t,n,i,r){let o,a,s,c=e._intervals,u=e._frames,f=MC(e,n),d=MC(e,t);if(f>=d){for(o=f;o>=d;--o)if(a=c.get(o),s=u[o],nDe(e,a,s,i,r))return a}else for(o=f;o<=d;++o)if(a=c.get(o),s=u[o],nDe(e,a,s,i,r))return a;return t}function dOt(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 Yw={timeSinceLoad:0,isClipped:!1,clippingPlanesDirty:!1};LC.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)&&dOt(this,r,a),Yw.timeSinceLoad=t,Yw.isClipped=o;let s=this.shading,c=this._pointCloudEyeDomeLighting,u=e.commandList,f=u.length,d=this._previousInterval,p=this._nextInterval,g=eOt(this);if(!l(g))return;let m=!1,y=Pne(this),A=y===0;y!==this._clockMultiplier&&(m=!0,this._clockMultiplier=y),(!l(d)||A)&&(d=g),(!l(p)||m||tOt(this,g,p))&&(p=QRt(this,g)),d=fOt(this,d,g,Yw,e);let b=uOt(this,d);l(b)||(Ine(this,d,Yw,e),b=this._lastRenderedFrame),l(b)&&rDe(this,b,Yw,e),l(p)&&Ine(this,p,Yw,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&&oDe(this,lOt(e));let w=u.length-f;l(s)&&s.attenuation&&s.eyeDomeLighting&&w>0&&c.update(e,f,s,this.boundingSphere)};LC.prototype.isDestroyed=function(){return!1};LC.prototype.destroy=function(){return oDe(this),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),ue(this)};var Xw=LC;function cDe(e,t){if(l(t)){let n=t.clock;l(n)&&n.getValue(e)}}function hOt(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 lDe(e){let t=e._useBrowserRecommendedResolution?1:window.devicePixelRatio;return t*=e._resolutionScale,l(e._scene)&&(e._scene.pixelRatio=t),t}function uDe(e){let t=e._canvas,n=t.clientWidth,i=t.clientHeight,r=lDe(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 fDe(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 Br(e,t){e=Bn(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)?Bn(t.creditContainer):n;c.appendChild(s);let u=l(t.creditViewport)?Bn(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 Vh,l(t.shouldAnimate)&&(this._clock.shouldAnimate=t.shouldAnimate),uDe(this);try{let p=t.ellipsoid??te.default,g=new aU({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,lDe(this),fDe(this);let m=t.globe;l(m)||(m=new i3(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=mU.createEarthSkyBox()),y!==!1&&(g.skyBox=y,g.sun=new bU,te.WGS84.equals(p)&&(g.moon=new a3));let A=t.skyAtmosphere;!l(A)&&te.WGS84.equals(p)&&(A=new lU(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=Ta.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 Ka(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,O){x._useDefaultRenderLoop=!1,x._renderLoopRunning=!1,x._showRenderLoopErrors&&x.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,O)},g.renderError.addEventListener(this._onRenderError);let T=t.dataSources,C=!1;l(T)||(T=new iL,C=!0);let E=new Uk({scene:g,dataSourceCollection:T}),w=new Lo;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,Br.prototype._onTick,this),w.add(g.morphStart,Br.prototype._clearTrackedObject,this),w.add(T.dataSourceAdded,Br.prototype._onDataSourceAdded,this),w.add(T.dataSourceRemoved,Br.prototype._onDataSourceRemoved,this),w.add(g.postRender,Br.prototype._postRender,this);let P=T.length;for(let R=0;R<P;R++)this._dataSourceAdded(T,T.get(R));this._dataSourceAdded(void 0,E.defaultDataSource),w.add(T.dataSourceAdded,Br.prototype._dataSourceAdded,this),w.add(T.dataSourceRemoved,Br.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(Br.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&&hOt(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,Dne(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(L.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,cDe(this.clock,e))}}});Br.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=pp(n);u||(typeof n=="string"&&(n=new Error(n)),t=pp({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)};Br.prototype.isDestroyed=function(){return!1};Br.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)};Br.prototype.resize=function(){let e=this._canvas;!this._forceResize&&this._canvasClientWidth===e.clientWidth&&this._canvasClientHeight===e.clientHeight&&this._lastDevicePixelRatio===window.devicePixelRatio||(this._forceResize=!1,uDe(this),fDe(this),this._scene.requestRender())};Br.prototype.render=function(){if(this._canRender){this._scene.initializeFrame();let e=this._clock.tick();this._scene.render(e)}else this._clock.tick()};Br.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(Br.prototype._onEntityCollectionChanged,this)};Br.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(Br.prototype._onEntityCollectionChanged,this),l(this.trackedEntity)&&n.getById(this.trackedEntity.id)===this.trackedEntity&&(this.trackedEntity=void 0)};Br.prototype._updateCanAnimate=function(e){this._clock.canAnimate=e};var mOt=new se;Br.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??mOt)===It.DONE&&i.update(t)}};Br.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)}};Br.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};Br.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&cDe(this.clock,e)};Br.prototype._onDataSourceAdded=function(e,t){this._automaticallyTrackDataSourceClocks&&(this.clockTrackedDataSource=t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,Br.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};Br.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}};Br.prototype.addController=function(e){return this.scene.controllerHost.registerController(e,this.container)};Br.prototype.removeController=function(e){return this.scene.controllerHost.unregisterController(e,this.container)};Br.prototype.zoomTo=function(e,t){return dDe(this,e,{offset:t},!1)};Br.prototype.flyTo=function(e,t){return dDe(this,e,t,!0)};function dDe(e,t,n,i){Dne(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 Ta){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 tC(s,e.scene)}).then(function(s){e._zoomPromise===r&&(e._zoomTarget=s)});return}if(o instanceof Uo||o instanceof Xw||o instanceof YA||o instanceof $a){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 vU(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function Dne(e){let t=e._zoomPromise;l(t)&&(vU(e),e._completeZoom(!1))}Br.prototype._postRender=function(){pOt(this),gOt(this)};var aDe=new se;function pOt(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 Rd(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(L.IDENTITY),e._completeZoom(!0)),vU(e)}if(t instanceof Xw){if(l(t.boundingSphere)){a(t.boundingSphere);return}let f=t.frameChanged.addEventListener(function(d){a(d.boundingSphere),f()});return}if(t instanceof Uo||t instanceof YA){a(t.boundingSphere);return}if(t instanceof $a){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)),vU(e);return}let s=t,c=[];for(let f=0,d=s.length;f<d;f++){let p=e._dataSourceDisplay.getBoundingSphere(s[f],!1,aDe);if(p===It.PENDING)return;p!==It.FAILED&&c.push(se.clone(aDe))}if(c.length===0){Dne(e);return}e.trackedEntity=void 0;let u=se.fromBoundingSpheres(c);e._zoomIsFlight?(vU(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(L.IDENTITY),vU(e),e._completeZoom(!0))}var sDe=new se;function gOt(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,sDe);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?sDe:void 0;e._entityView=new jk(t,r,r.ellipsoid),e._entityView.update(n,s),e._needTrackedEntityUpdate=!1}var EU=Br;var _Ot=U.WHITE,yOt=U.BLACK,AOt=new z(2,2);function Kw(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(Kw.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")});Kw.prototype.getType=function(e){return"Checkerboard"};var bOt=new K;Kw.prototype.getValue=function(e,t){return l(e)||(e=K.now(bOt)),l(t)||(t={}),t.lightColor=X.getValueOrClonedDefault(this._evenColor,e,_Ot,t.lightColor),t.darkColor=X.getValueOrClonedDefault(this._oddColor,e,yOt,t.darkColor),t.repeat=X.getValueOrDefault(this._repeat,e,AOt),t};Kw.prototype.equals=function(e){return this===e||e instanceof Kw&&X.equals(this._evenColor,e._evenColor)&&X.equals(this._oddColor,e._oddColor)&&X.equals(this._repeat,e._repeat)};var $w=Kw;var m5={id:void 0},Jw=new Array(2);function Rne(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 hDe(e,t,n,i){Jw[0]=n,Jw[1]=i.id,t[JSON.stringify(Jw)]=i.definitionChanged.addEventListener(Ca.prototype._onDefinitionChanged,e)}function mDe(e,t,n,i){Jw[0]=n,Jw[1]=i.id;let r=JSON.stringify(Jw);t[r](),t[r]=void 0}function KA(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 Fs(e),p=e._eventHash,g;for(o=0;o<r;o++)for(u=i[o],u.collectionChanged.removeEventListener(Ca.prototype._onCollectionChanged,e),s=u.values,g=u.id,c=s.length-1;c>-1;c--)a=s[c],mDe(e,p,g,a);for(o=n-1;o>=0;o--)for(u=t[o],u.collectionChanged.addEventListener(Ca.prototype._onCollectionChanged,e),s=u.values,g=u.id,c=s.length-1;c>-1;c--){a=s[c],hDe(e,p,g,a);let y=d.getById(a.id);l(y)||(y=f.getById(a.id),l(y)?Rne(y):(m5.id=a.id,y=new qr(m5)),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 Ca(e,t){this._owner=t,this._composite=new Fs(this),this._suspendCount=0,this._collections=l(e)?e.slice():[],this._collectionsCopy=[],this._id=Kn(),this._eventHash={},KA(this),this._shouldRecomposite=!1}Object.defineProperties(Ca.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}}});Ca.prototype.addCollection=function(e,t){l(t)?this._collections.splice(t,0,e):this._collections.push(e),KA(this)};Ca.prototype.removeCollection=function(e){let t=this._collections.indexOf(e);return t!==-1?(this._collections.splice(t,1),KA(this),!0):!1};Ca.prototype.removeAllCollections=function(){this._collections.length=0,KA(this)};Ca.prototype.containsCollection=function(e){return this._collections.indexOf(e)!==-1};Ca.prototype.contains=function(e){return this._composite.contains(e)};Ca.prototype.indexOfCollection=function(e){return this._collections.indexOf(e)};Ca.prototype.getCollection=function(e){return this._collections[e]};Ca.prototype.getCollectionsLength=function(){return this._collections.length};function p5(e,t){return e.indexOf(t)}function pDe(e,t,n){let i=e._collections;if(t=D.clamp(t,0,i.length-1),n=D.clamp(n,0,i.length-1),t===n)return;let r=i[t];i[t]=i[n],i[n]=r,KA(e)}Ca.prototype.raiseCollection=function(e){let t=p5(this._collections,e);pDe(this,t,t+1)};Ca.prototype.lowerCollection=function(e){let t=p5(this._collections,e);pDe(this,t,t-1)};Ca.prototype.raiseCollectionToTop=function(e){let t=p5(this._collections,e);t!==this._collections.length-1&&(this._collections.splice(t,1),this._collections.push(e),KA(this))};Ca.prototype.lowerCollectionToBottom=function(e){let t=p5(this._collections,e);t!==0&&(this._collections.splice(t,1),this._collections.splice(0,0,e),KA(this))};Ca.prototype.suspendEvents=function(){this._suspendCount++,this._composite.suspendEvents()};Ca.prototype.resumeEvents=function(){this._suspendCount--,this._shouldRecomposite&&this._suspendCount===0&&(KA(this),this._shouldRecomposite=!1),this._composite.resumeEvents()};Ca.prototype.computeAvailability=function(){return this._composite.computeAvailability()};Ca.prototype.getById=function(e){return this._composite.getById(e)};Ca.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];mDe(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),Rne(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];hDe(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)?Rne(u):(m5.id=y,u=new qr(m5),o.add(u))),u.merge(c));u=void 0}o.resumeEvents()};Ca.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 One=Ca;function $A(){this._definitionChanged=new be,this._composite=new pl,this._composite.definitionChanged.addEventListener($A.prototype._raiseDefinitionChanged,this)}Object.defineProperties($A.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite._intervals}}});$A.prototype.getType=function(e){let t=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(t))return t.getType(e)};var xOt=new K;$A.prototype.getValue=function(e,t){l(e)||(e=K.now(xOt));let n=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};$A.prototype.equals=function(e){return this===e||e instanceof $A&&this._composite.equals(e._composite,X.equals)};$A.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var Zw=$A;var DU=Go(af(),1);function NC(){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(NC.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},startTime:$l("startTime"),stopTime:$l("stopTime"),currentTime:$l("currentTime"),clockRange:$l("clockRange"),clockStep:$l("clockStep"),multiplier:$l("multiplier")});NC.prototype.clone=function(e){return l(e)||(e=new NC),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};NC.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};NC.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};NC.prototype.getValue=function(e){return l(e)||(e=new Vh),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 jm=NC;var TOt=U.WHITE,COt=.1,vOt=new z(8,8),EOt=new z(0,0),SOt=new z(1,1);function Qw(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(Qw.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")});Qw.prototype.getType=function(e){return"Grid"};var wOt=new K;Qw.prototype.getValue=function(e,t){return l(e)||(e=K.now(wOt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,TOt,t.color),t.cellAlpha=X.getValueOrDefault(this._cellAlpha,e,COt),t.lineCount=X.getValueOrClonedDefault(this._lineCount,e,vOt,t.lineCount),t.lineThickness=X.getValueOrClonedDefault(this._lineThickness,e,SOt,t.lineThickness),t.lineOffset=X.getValueOrClonedDefault(this._lineOffset,e,EOt,t.lineOffset),t};Qw.prototype.equals=function(e){return this===e||e instanceof Qw&&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 eI=Qw;function tI(e){this._definitionChanged=new be,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(tI.prototype,{isConstant:{get:function(){return X.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:me("color")});tI.prototype.getType=function(e){return"PolylineArrow"};var IOt=new K;tI.prototype.getValue=function(e,t){return l(e)||(e=K.now(IOt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,U.WHITE,t.color),t};tI.prototype.equals=function(e){return this===e||e instanceof tI&&X.equals(this._color,e._color)};var nI=tI;var POt=U.WHITE,DOt=U.TRANSPARENT,ROt=16,OOt=255;function iI(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(iI.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")});iI.prototype.getType=function(e){return"PolylineDash"};var MOt=new K;iI.prototype.getValue=function(e,t){return l(e)||(e=K.now(MOt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,POt,t.color),t.gapColor=X.getValueOrClonedDefault(this._gapColor,e,DOt,t.gapColor),t.dashLength=X.getValueOrDefault(this._dashLength,e,ROt,t.dashLength),t.dashPattern=X.getValueOrDefault(this._dashPattern,e,OOt,t.dashPattern),t};iI.prototype.equals=function(e){return this===e||e instanceof iI&&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 rI=iI;var LOt=U.WHITE,NOt=.25,FOt=1;function oI(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(oI.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")});oI.prototype.getType=function(e){return"PolylineGlow"};var BOt=new K;oI.prototype.getValue=function(e,t){return l(e)||(e=K.now(BOt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,LOt,t.color),t.glowPower=X.getValueOrDefault(this._glowPower,e,NOt,t.glowPower),t.taperPower=X.getValueOrDefault(this._taperPower,e,FOt,t.taperPower),t};oI.prototype.equals=function(e){return this===e||e instanceof oI&&X.equals(this._color,e._color)&&X.equals(this._glowPower,e._glowPower)&&X.equals(this._taperPower,e._taperPower)};var aI=oI;var kOt=U.WHITE,zOt=U.BLACK,UOt=1;function sI(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(sI.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")});sI.prototype.getType=function(e){return"PolylineOutline"};var VOt=new K;sI.prototype.getValue=function(e,t){return l(e)||(e=K.now(VOt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,kOt,t.color),t.outlineColor=X.getValueOrClonedDefault(this._outlineColor,e,zOt,t.outlineColor),t.outlineWidth=X.getValueOrDefault(this._outlineWidth,e,UOt),t};sI.prototype.equals=function(e){return this===e||e instanceof sI&&X.equals(this._color,e._color)&&X.equals(this._outlineColor,e._outlineColor)&&X.equals(this._outlineWidth,e._outlineWidth)};var JA=sI;function O_(e,t){this._value=void 0,this._definitionChanged=new be,this._eventHelper=new Lo,this._referenceFrame=t??Ui.FIXED,this.setValue(e)}Object.defineProperties(O_.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 jOt=new K;O_.prototype.getValue=function(e,t){return l(e)||(e=K.now(jOt)),this.getValueInReferenceFrame(e,Ui.FIXED,t)};O_.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};O_.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,O_.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};O_.prototype.equals=function(e){return this===e||e instanceof O_&&this._referenceFrame===e._referenceFrame&&X.arrayEquals(this._value,e._value)};O_.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var M_=O_;function ZA(e){this._value=void 0,this._definitionChanged=new be,this._eventHelper=new Lo,this.setValue(e)}Object.defineProperties(ZA.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 HOt=new K;ZA.prototype.getValue=function(e,t){l(e)||(e=K.now(HOt));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};ZA.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,ZA.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};ZA.prototype.equals=function(e){return this===e||e instanceof ZA&&X.arrayEquals(this._value,e._value)};ZA.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var cI=ZA;var GOt={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-D.TWO_PI,r=s}},unpackInterpolationResult:function(e,t,n,i,r){return r=e[0],r<0?r+D.TWO_PI:r}},ph=GOt;var gDe={HORIZONTAL:0,VERTICAL:1};Object.freeze(gDe);var Hm=gDe;var WOt=Hm.HORIZONTAL,qOt=U.WHITE,YOt=U.BLACK,XOt=0,KOt=1;function lI(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(lI.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")});lI.prototype.getType=function(e){return"Stripe"};var $Ot=new K;lI.prototype.getValue=function(e,t){return l(e)||(e=K.now($Ot)),l(t)||(t={}),t.horizontal=X.getValueOrDefault(this._orientation,e,WOt)===Hm.HORIZONTAL,t.evenColor=X.getValueOrClonedDefault(this._evenColor,e,qOt,t.evenColor),t.oddColor=X.getValueOrClonedDefault(this._oddColor,e,YOt,t.oddColor),t.offset=X.getValueOrDefault(this._offset,e,XOt),t.repeat=X.getValueOrDefault(this._repeat,e,KOt),t};lI.prototype.equals=function(e){return this===e||e instanceof lI&&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 uI=lI;function FC(){this._definitionChanged=new be,this._intervals=new ga,this._intervals.changedEvent.addEventListener(FC.prototype._intervalsChanged,this)}Object.defineProperties(FC.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var JOt=new K;FC.prototype.getValue=function(e,t){l(e)||(e=K.now(JOt));let n=this._intervals.findDataForIntervalContainingDate(e);return l(n)&&typeof n.clone=="function"?n.clone(t):n};FC.prototype.equals=function(e){return this===e||e instanceof FC&&this._intervals.equals(e._intervals,X.equals)};FC.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var L_=FC;function SU(e,t){this._velocityVectorProperty=new b_(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(SU.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 _De=new h,ZOt=new h,yDe=new $,QOt=new K;SU.prototype.getValue=function(e,t){l(e)||(e=K.now(QOt));let n=this._velocityVectorProperty._getValue(e,ZOt,_De);if(l(n))return mt.rotationMatrixFromPositionVelocity(_De,n,this._ellipsoid,yDe),Fe.fromRotationMatrix(yDe,t)};SU.prototype.equals=function(e){return this===e||e instanceof SU&&X.equals(this._velocityVectorProperty,e._velocityVectorProperty)&&(this._ellipsoid===e._ellipsoid||this._ellipsoid.equals(e._ellipsoid))};var wU=SU;var N_={COMPLETE:0,BELOW_ELLIPSOID_HORIZON:1,ABOVE_ELLIPSOID_HORIZON:2};N_.validate=function(e){return e===N_.COMPLETE||e===N_.BELOW_ELLIPSOID_HORIZON||e===N_.ABOVE_ELLIPSOID_HORIZON};N_.toString=function(e){switch(e){case N_.COMPLETE:return"COMPLETE";case N_.BELOW_ELLIPSOID_HORIZON:return"BELOW_ELLIPSOID_HORIZON";case N_.ABOVE_ELLIPSOID_HORIZON:return"ABOVE_ELLIPSOID_HORIZON";default:throw new pe("SensorVolumePortionToDisplay value is not valid and cannot be converted to a String.")}};var fI=N_;function QA(){}QA.packedLength=h.packedLength;QA.unpack=h.unpack;QA.pack=h.pack;var Mne;function IU(e,t){return t[0]==="#"&&(t=Mne+t),y_.fromString(e,t)}function ADe(e,t,n){if(l(n.reference))return IU(t,n.reference);if(l(n.velocityReference)){let i=IU(t,n.velocityReference);switch(e){case h:case QA:return new b_(i,e===QA);case Fe:return new wU(i)}}throw new oe(`${JSON.stringify(n)} is not valid CZML.`)}function eMt(e,t){return new am(function(n,i){return t(e.getValue(n,i))},e.isConstant)}var lr=new h,uu=new I1,bl=new de,BC=new Tn,g5=new Fe;function tMt(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 bDe(e,t){let n=e.uri??e;return l(t)?t.getDerivedResource({url:n}):De.createIfNeeded(n)}function nMt(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[D.toRadians(n[0]),D.toRadians(n[1]),D.toRadians(n[2]),D.toRadians(n[3])];t=new Array(i);for(let r=0;r<i;r+=5)t[r]=n[r],t[r+1]=D.toRadians(n[r+1]),t[r+2]=D.toRadians(n[r+2]),t[r+3]=D.toRadians(n[r+3]),t[r+4]=D.toRadians(n[r+4]);return t}function iMt(e){let t=e.length;if(uu.magnitude=1,t===2)return uu.clock=e[0],uu.cone=e[1],h.fromSpherical(uu,lr),[lr.x,lr.y,lr.z];let n=new Array(t/3*4);for(let i=0,r=0;i<t;i+=3,r+=4)n[r]=e[i],uu.clock=e[i+1],uu.cone=e[i+2],h.fromSpherical(uu,lr),n[r+1]=lr.x,n[r+2]=lr.y,n[r+3]=lr.z;return n}function rMt(e){let t=e.length;if(t===3)return uu.clock=e[0],uu.cone=e[1],uu.magnitude=e[2],h.fromSpherical(uu,lr),[lr.x,lr.y,lr.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],uu.clock=e[i+1],uu.cone=e[i+2],uu.magnitude=e[i+3],h.fromSpherical(uu,lr),n[i+1]=lr.x,n[i+2]=lr.y,n[i+3]=lr.z;return n}function oMt(e){let t=e.length;if(t===3)return bl.longitude=e[0],bl.latitude=e[1],bl.height=e[2],te.default.cartographicToCartesian(bl,lr),[lr.x,lr.y,lr.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],bl.longitude=e[i+1],bl.latitude=e[i+2],bl.height=e[i+3],te.default.cartographicToCartesian(bl,lr),n[i+1]=lr.x,n[i+2]=lr.y,n[i+3]=lr.z;return n}function aMt(e){let t=e.length;if(t===3)return bl.longitude=D.toRadians(e[0]),bl.latitude=D.toRadians(e[1]),bl.height=e[2],te.default.cartographicToCartesian(bl,lr),[lr.x,lr.y,lr.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],bl.longitude=D.toRadians(e[i+1]),bl.latitude=D.toRadians(e[i+2]),bl.height=e[i+3],te.default.cartographicToCartesian(bl,lr),n[i+1]=lr.x,n[i+2]=lr.y,n[i+3]=lr.z;return n}function Lne(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 iMt(r);let o=e.spherical;if(l(o))return rMt(o);let a=e.cartographicRadians;if(l(a))return oMt(a);let s=e.cartographicDegrees;if(l(s))return aMt(s);throw new oe(`${JSON.stringify(e)} is not a valid CZML interval.`)}function xDe(e,t){h.unpack(e,t,lr),h.normalize(lr,lr),h.pack(lr,e,t)}function sMt(e){let t=Lne(e);if(t.length===3)return xDe(t,0),t;for(let n=1;n<t.length;n+=4)xDe(t,n);return t}function TDe(e,t){Fe.unpack(e,t,g5),Fe.normalize(g5,g5),Fe.pack(g5,e,t)}function cMt(e){let t=e.unitQuaternion;if(l(t)){if(t.length===4)return TDe(t,0),t;for(let n=1;n<t.length;n+=5)TDe(t,n)}return t}function CDe(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")?z:e.hasOwnProperty("cartesian")||e.hasOwnProperty("spherical")||e.hasOwnProperty("cartographicRadians")||e.hasOwnProperty("cartographicDegrees")?h:e.hasOwnProperty("unitCartesian")||e.hasOwnProperty("unitSpherical")?QA:e.hasOwnProperty("rgba")||e.hasOwnProperty("rgbaf")?U:e.hasOwnProperty("arcType")?sn:e.hasOwnProperty("classificationType")?Zn:e.hasOwnProperty("colorBlendMode")?fl:e.hasOwnProperty("cornerType")?Zi:e.hasOwnProperty("heightReference")?it:e.hasOwnProperty("horizontalOrigin")?Vi:e.hasOwnProperty("date")?K:e.hasOwnProperty("labelStyle")?ho: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")?t0:e.hasOwnProperty("shadowMode")?Rn:e.hasOwnProperty("string")?String:e.hasOwnProperty("stripeOrientation")?Hm:e.hasOwnProperty("wsen")||e.hasOwnProperty("wsenDegrees")?ie:e.hasOwnProperty("uri")?DU.default:e.hasOwnProperty("verticalOrigin")?Gn:Object}function lMt(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 z:return t.cartesian2;case h:return Lne(t);case QA:return sMt(t);case U:return tMt(t);case Zn:return Zn[t.classificationType??t];case fl:return fl[t.colorBlendMode??t];case Zi:return Zi[t.cornerType??t];case it:return it[t.heightReference??t];case Vi:return Vi[t.horizontalOrigin??t];case Image:return bDe(t,n);case K:return K.fromIso8601(t.date??t);case ho:return ho[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 t0:return t0[t.pathMode??t];case Fe:return cMt(t);case ph:return t.number??t;case fI:return fI[t.portionToDisplay??t];case Rn:return Rn[t.shadowMode??t.shadows??t];case String:return t.string??t;case Hm:return Hm[t.stripeOrientation??t];case ie:return nMt(t);case DU.default:return bDe(t,n);case Gn:return Gn[t.verticalOrigin??t];default:throw new oe(`Unknown CzmlDataSource interval type: ${e}`)}}var uMt={HERMITE:ZD,LAGRANGE:i1,LINEAR:fx};function _5(e,t){let n=e.interpolationAlgorithm,i=e.interpolationDegree;(l(n)||l(i))&&t.setInterpolationOptions({interpolationAlgorithm:uMt[n],interpolationDegree:i});let r=e.forwardExtrapolationType;l(r)&&(t.forwardExtrapolationType=gf[r]);let o=e.forwardExtrapolationDuration;l(o)&&(t.forwardExtrapolationDuration=o);let a=e.backwardExtrapolationType;l(a)&&(t.backwardExtrapolationType=gf[a]);let s=e.backwardExtrapolationDuration;l(s)&&(t.backwardExtrapolationDuration=s)}var vDe={iso8601:void 0};function jo(e){if(l(e))return vDe.iso8601=e,Tn.fromIso8601(vDe)}function Nne(e){let t=Qe.MAXIMUM_INTERVAL.clone();return t.data=e,t}function EDe(e){let t=new pl;return t.intervals.addInterval(Nne(e)),t}function SDe(e){let t=new hc(e.referenceFrame);return t.intervals.addInterval(Nne(e)),t}function y5(e,t,n,i,r,o,a){let s=jo(i.interval);l(r)&&(l(s)?s=Tn.intersect(s,r,BC):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 BDe(t[n],s)}let g=!1;if(d){if(u=lMt(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!==ph;if(!g&&!p){d?t[n]=new hi(m?e.unpack(u,0):u):t[n]=ADe(e,a,i);return}let y=t[n],A,b=i.epoch;if(l(b)&&(A=K.fromIso8601(b)),g&&!p){y instanceof Hf||(t[n]=y=new Hf(e)),y.addSamplesPackedArray(u,A),_5(i,y);return}let x;if(!g&&p){s=s.clone(),d?s.data=m?e.unpack(u,0):u:s.data=ADe(e,a,i),l(y)||(t[n]=y=d?new L_:new pl),d&&y instanceof L_?y.intervals.addInterval(s):y instanceof pl?(d&&(s.data=new hi(s.data)),y.intervals.addInterval(s)):(t[n]=y=EDe(y),d&&(s.data=new hi(s.data)),y.intervals.addInterval(s));return}l(y)||(t[n]=y=new pl),y instanceof pl||(t[n]=y=EDe(y));let T=y.intervals;x=T.findInterval(s),(!l(x)||!(x.data instanceof Hf))&&(x=s.clone(),x.data=new Hf(e),T.addInterval(x)),x.data.addSamplesPackedArray(u,A),_5(i,x.data)}function BDe(e,t){if(e instanceof Hf){e.removeSamples(t);return}else if(e instanceof L_){e.intervals.removeInterval(t);return}else if(e instanceof pl){let n=e.intervals;for(let i=0;i<n.length;++i){let r=Tn.intersect(n.get(i),t,BC);r.isEmpty||BDe(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)y5(e,t,n,i[s],r,o,a);else y5(e,t,n,i,r,o,a)}function wDe(e,t,n,i,r,o){let a=jo(n.interval);l(i)&&(l(a)?a=Tn.intersect(a,i,BC):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 kDe(e[t],a)}let g,m=!1;if(d&&(l(n.referenceFrame)&&(g=Ui[n.referenceFrame]),g=g??Ui.FIXED,u=Lne(n),f=u.length??1,m=f>c),!m&&!p){d?e[t]=new Kl(h.unpack(u),g):e[t]=IU(o,n.reference);return}let y=e[t],A,b=n.epoch;if(l(b)&&(A=K.fromIso8601(b)),m&&!p){(!(y instanceof mc)||l(g)&&y.referenceFrame!==g)&&(e[t]=y=new mc(g,s)),y.addSamplesPackedArray(u,A),_5(n,y);return}let x;if(!m&&p){a=a.clone(),d?a.data=h.unpack(u):a.data=IU(o,n.reference),l(y)||(d?y=new A_(g):y=new hc(g),e[t]=y),d&&y instanceof A_&&l(g)&&y.referenceFrame===g?y.intervals.addInterval(a):y instanceof hc?(d&&(a.data=new Kl(a.data,g)),y.intervals.addInterval(a)):(e[t]=y=SDe(y),d&&(a.data=new Kl(a.data,g)),y.intervals.addInterval(a));return}l(y)?y instanceof hc||(e[t]=y=SDe(y)):e[t]=y=new hc(g);let T=y.intervals;x=T.findInterval(a),(!l(x)||!(x.data instanceof mc)||l(g)&&x.data.referenceFrame!==g)&&(x=a.clone(),x.data=new mc(g,s),T.addInterval(x)),x.data.addSamplesPackedArray(u,A),_5(n,x.data)}function kDe(e,t){if(e instanceof mc){e.removeSamples(t);return}else if(e instanceof A_){e.intervals.removeInterval(t);return}else if(e instanceof hc){let n=e.intervals;for(let i=0;i<n.length;++i){let r=Tn.intersect(n.get(i),t,BC);r.isEmpty||kDe(r.data,t)}n.removeInterval(t);return}}function zDe(e,t,n,i,r,o){if(l(n))if(Array.isArray(n))for(let a=0,s=n.length;a<s;++a)wDe(e,t,n[a],i,r,o);else wDe(e,t,n,i,r,o)}function IDe(e,t,n,i){l(n.references)?A5(e,t,n.references,n.interval,i,cI,pl):(l(n.cartesian2)?n.array=z.unpackArray(n.cartesian2):l(n.cartesian)&&(n.array=z.unpackArray(n.cartesian)),l(n.array)&&Te(Array,e,t,n,void 0,void 0,i))}function PDe(e,t,n,i,r,o){let a=jo(n.interval);l(i)&&(l(a)?a=Tn.intersect(a,i,BC):a=i);let s=e[t],c,u;if(l(a)){s instanceof Zw||(s=new Zw,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 eI||(c=new eI),f=n.grid,Te(U,c,"color",f.color,void 0,r,o),Te(Number,c,"cellAlpha",f.cellAlpha,void 0,r,o),Te(z,c,"lineCount",f.lineCount,void 0,r,o),Te(z,c,"lineThickness",f.lineThickness,void 0,r,o),Te(z,c,"lineOffset",f.lineOffset,void 0,r,o)):l(n.image)?(c instanceof cA||(c=new cA),f=n.image,Te(Image,c,"image",f.image,void 0,r,o),Te(z,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 uI||(c=new uI),f=n.stripe,Te(Hm,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 JA||(c=new JA),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 aI||(c=new aI),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 nI||(c=new nI),f=n.polylineArrow,Te(U,c,"color",f.color,void 0,void 0,o)):l(n.polylineDash)?(c instanceof rI||(c=new rI),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 $w||(c=new $w),f=n.checkerboard,Te(U,c,"evenColor",f.evenColor,void 0,r,o),Te(U,c,"oddColor",f.oddColor,void 0,r,o),Te(z,c,"repeat",f.repeat,void 0,r,o)),l(u)?u.data=c:e[t]=c}function $f(e,t,n,i,r,o){if(l(n))if(Array.isArray(n))for(let a=0,s=n.length;a<s;++a)PDe(e,t,n[a],i,r,o);else PDe(e,t,n,i,r,o)}function fMt(e,t,n,i){let r=t.name;l(r)&&(e.name=t.name)}function dMt(e,t,n,i){let r=t.description;l(r)&&Te(String,e,"description",r,void 0,i,n)}function hMt(e,t,n,i){let r=t.position;l(r)&&zDe(e,"position",r,void 0,i,n)}function mMt(e,t,n,i){let r=t.viewFrom;l(r)&&Te(h,e,"viewFrom",r,void 0,i,n)}function pMt(e,t,n,i){let r=t.orientation;l(r)&&Te(Fe,e,"orientation",r,void 0,i,n)}function gMt(e,t,n,i){let r=t.properties;if(l(r)){l(e.properties)||(e.properties=new Jl);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)y5(CDe(a[s]),e.properties,o,a[s],void 0,i,n);else y5(CDe(a),e.properties,o,a,void 0,i,n)}}}function A5(e,t,n,i,r,o,a){let s=n.map(function(c){return IU(r,c)});if(l(i)){i=jo(i);let c=e[t];if(!(c instanceof a)){let u=new a;u.intervals.addInterval(Nne(c)),e[t]=c=u}i.data=new o(s),c.intervals.addInterval(i)}else e[t]=new o(s)}function DDe(e,t,n,i){let r=n.references;l(r)?A5(e,t,r,n.interval,i,cI,pl):Te(Array,e,t,n,void 0,void 0,i)}function RDe(e,t,n,i){if(l(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;++r)DDe(e,t,n[r],i);else DDe(e,t,n,i)}function ODe(e,t,n,i){let r=n.references;l(r)?A5(e,t,r,n.interval,i,M_,hc):(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 RU(e,t,n,i){if(l(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;++r)ODe(e,t,n[r],i);else ODe(e,t,n,i)}function _Mt(e){return h.unpackArray(e)}function yMt(e){return h.fromRadiansArrayHeights(e,te.default)}function AMt(e){return h.fromDegreesArrayHeights(e,te.default)}function MDe(e,t,n,i){let r=n.references;if(l(r)){let o=r.map(function(a){let s={};return A5(s,"positions",a,n.interval,i,M_,hc),s.positions});e[t]=new M_(o)}else l(n.cartesian)?n.array=n.cartesian.map(_Mt):l(n.cartographicRadians)?n.array=n.cartographicRadians.map(yMt):l(n.cartographicDegrees)&&(n.array=n.cartographicDegrees.map(AMt)),l(n.array)&&Te(Array,e,t,n,void 0,void 0,i)}function bMt(e,t,n,i){if(l(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;++r)MDe(e,t,n[r],i);else MDe(e,t,n,i)}function xMt(e,t,n,i){if(l(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;r++)IDe(e,t,n[r],i);else IDe(e,t,n,i)}function TMt(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 ga),o.addInterval(jo(r[a]));else o=new ga,o.addInterval(jo(r));e.availability=o}function CMt(e,t,n,i,r){l(t)&&Te(QA,e,"alignedAxis",t,n,i,r)}function vMt(e,t,n,i){let r=t.billboard;if(!l(r))return;let o=jo(r.interval),a=e.billboard;l(a)||(e.billboard=a=new cl),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(z,a,"pixelOffset",r.pixelOffset,o,i,n),Te(h,a,"eyeOffset",r.eyeOffset,o,i,n),Te(Vi,a,"horizontalOrigin",r.horizontalOrigin,o,i,n),Te(Gn,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(ph,a,"rotation",r.rotation,o,i,n),CMt(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 EMt(e,t,n,i){let r=t.box;if(!l(r))return;let o=jo(r.interval),a=e.box;l(a)||(e.box=a=new Xx),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),$f(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 SMt(e,t,n,i){let r=t.corridor;if(!l(r))return;let o=jo(r.interval),a=e.corridor;l(a)||(e.corridor=a=new $x),Te(Boolean,a,"show",r.show,o,i,n),RU(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(Zi,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),$f(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 wMt(e,t,n,i){let r=t.cylinder;if(!l(r))return;let o=jo(r.interval),a=e.cylinder;l(a)||(e.cylinder=a=new Jx),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),$f(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 IMt(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 PMt(e,t,n,i){let r=t.ellipse;if(!l(r))return;let o=jo(r.interval),a=e.ellipse;l(a)||(e.ellipse=a=new Zx),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(ph,a,"rotation",r.rotation,o,i,n),Te(ph,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),$f(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 DMt(e,t,n,i){let r=t.ellipsoid;if(!l(r))return;let o=jo(r.interval),a=e.ellipsoid;l(a)||(e.ellipsoid=a=new Qx),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),$f(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 RMt(e,t,n,i){let r=t.label;if(!l(r))return;let o=jo(r.interval),a=e.label;l(a)||(e.label=a=new im),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(ho,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(z,a,"backgroundPadding",r.backgroundPadding,o,i,n),Te(z,a,"pixelOffset",r.pixelOffset,o,i,n),Te(h,a,"eyeOffset",r.eyeOffset,o,i,n),Te(Vi,a,"horizontalOrigin",r.horizontalOrigin,o,i,n),Te(Gn,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 OMt(e,t,n,i){let r=t.model;if(!l(r))return;let o=jo(r.interval),a=e.model;l(a)||(e.model=a=new Mg),Te(Boolean,a,"show",r.show,o,i,n),Te(DU.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(fl,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)LDe(a,u[s],o,i,n);else LDe(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)NDe(a,f[s],o,i,n);else NDe(a,f,o,i,n)}function LDe(e,t,n,i,r){let o=jo(t.interval);l(n)&&(l(o)?o=Tn.intersect(o,n,BC):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 Jl),a.hasProperty(f)||a.addProperty(f);let p=a[f];l(p)||(a[f]=p=new eT),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 NDe(e,t,n,i,r){let o=jo(t.interval);l(n)&&(l(o)?o=Tn.intersect(o,n,BC):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 Jl),a.hasProperty(f)||a.addProperty(f),Te(Number,a,f,d,o,i,r))}}function MMt(e,t,n,i){let r=t.path;if(!l(r))return;let o=jo(r.interval),a=e.path;l(a)||(e.path=a=new Lg),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),$f(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(t0,a,"materialMode",r.materialMode,o,i,n)}function LMt(e,t,n,i){let r=t.point;if(!l(r))return;let o=jo(r.interval),a=e.point;l(a)||(e.point=a=new nT),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 PU(e){this.polygon=e,this._definitionChanged=new be}Object.defineProperties(PU.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}}});PU.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 Rc(r)}))),l(t)?(t.positions=n,t.holes=i,t):new Rc(n,i)};PU.prototype.equals=function(e){return this===e||e instanceof PU&&X.equals(this.polygon._positions,e.polygon._positions)&&X.equals(this.polygon._holes,e.polygon._holes)};function NMt(e,t,n,i){let r=t.polygon;if(!l(r))return;let o=jo(r.interval),a=e.polygon;l(a)||(e.polygon=a=new rm),Te(Boolean,a,"show",r.show,o,i,n),RU(a,"_positions",r.positions,n),bMt(a,"_holes",r.holes,n),(l(a._positions)||l(a._holes))&&(a.hierarchy=new PU(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(ph,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),$f(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 FMt(e){return e?sn.GEODESIC:sn.NONE}function BMt(e,t,n,i){let r=t.polyline;if(!l(r))return;let o=jo(r.interval),a=e.polyline;if(l(a)||(e.polyline=a=new ll),Te(Boolean,a,"show",r.show,o,i,n),RU(a,"positions",r.positions,n),Te(Number,a,"width",r.width,o,i,n),Te(Number,a,"granularity",r.granularity,o,i,n),$f(a,"material",r.material,o,i,n),$f(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=eMt(s.followSurface,FMt)}}function kMt(e,t,n,i){let r=t.polylineVolume;if(!l(r))return;let o=jo(r.interval),a=e.polylineVolume;l(a)||(e.polylineVolume=a=new iT),RU(a,"positions",r.positions,n),xMt(a,"shape",r.shape,n),Te(Boolean,a,"show",r.show,o,i,n),Te(Zi,a,"cornerType",r.cornerType,o,i,n),Te(Boolean,a,"fill",r.fill,o,i,n),$f(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 zMt(e,t,n,i){let r=t.rectangle;if(!l(r))return;let o=jo(r.interval),a=e.rectangle;l(a)||(e.rectangle=a=new om),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(ph,a,"rotation",r.rotation,o,i,n),Te(ph,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),$f(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 UMt(e,t,n,i){let r=t.tileset;if(!l(r))return;let o=jo(r.interval),a=e.tileset;l(a)||(e.tileset=a=new tT),Te(Boolean,a,"show",r.show,o,i,n),Te(DU.default,a,"uri",r.uri,o,i,n),Te(Number,a,"maximumScreenSpaceError",r.maximumScreenSpaceError,o,i,n)}function VMt(e,t,n,i){let r=t.wall;if(!l(r))return;let o=jo(r.interval),a=e.wall;l(a)||(e.wall=a=new Ng),Te(Boolean,a,"show",r.show,o,i,n),RU(a,"positions",r.positions,n),RDe(a,"minimumHeights",r.minimumHeights,n),RDe(a,"maximumHeights",r.maximumHeights,n),Te(Number,a,"granularity",r.granularity,o,i,n),Te(Boolean,a,"fill",r.fill,o,i,n),$f(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 FDe(e,t,n,i,r){let o=e.id;if(l(o)||(o=Kn()),Mne=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")IMt(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)}Mne=void 0}function jMt(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 jm,t.startTime=K.clone(o),t.stopTime=K.clone(a),t.clockRange=la.LOOP_STOP,t.multiplier=c,t.currentTime=K.clone(o),t.clockStep=Lr.SYSTEM_CLOCK_MULTIPLIER,e._clock=t,!0}}return!1}l(e._clock)?t=e._clock.clone():(t=new jm,t.startTime=Qe.MINIMUM_VALUE.clone(),t.stopTime=Qe.MAXIMUM_VALUE.clone(),t.currentTime=Qe.MINIMUM_VALUE.clone(),t.clockRange=la.LOOP_STOP,t.clockStep=Lr.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=1);let i=jo(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=la[n.range]??la.LOOP_STOP),l(n.step)&&(t.clockStep=Lr[n.step]??Lr.SYSTEM_CLOCK_MULTIPLIER),l(n.multiplier)&&(t.multiplier=n.multiplier),t.equals(e._clock)?!1:(e._clock=t.clone(e._clock),!0)}function UDe(e,t,n,i){n=n??H.EMPTY_OBJECT;let r=t,o=n.sourceUri,a=n.credit;if(typeof a=="string"&&(a=new St(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),ya.setLoading(e,!0),Promise.resolve(r).then(function(s){return HMt(e,s,o,i)}).catch(function(s){return ya.setLoading(e,!1),e._error.raiseEvent(e,s),console.log(s),Promise.reject(s)})}function HMt(e,t,n,i){ya.setLoading(e,!0);let r=e._entityCollection;i&&(e._version=void 0,e._documentPacket=new VDe,r.removeAll()),es._processCzml(t,r,n,void 0,e);let o=jMt(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=xg(n.getUrlComponent()),o=!0),ya.setLoading(e,!1),o&&e._changed.raiseEvent(e),e}function VDe(){this.name=void 0,this.clock=void 0}function es(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 VDe,this._version=void 0,this._entityCollection=new Fs(this),this._entityCluster=new Sf,this._credit=void 0,this._resourceCredits=[]}es.load=function(e,t){return new es().load(e,t)};Object.defineProperties(es.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}}});es.updaters=[vMt,EMt,SMt,wMt,PMt,DMt,RMt,OMt,fMt,dMt,MMt,LMt,NMt,BMt,kMt,gMt,zMt,hMt,UMt,mMt,VMt,pMt,TMt];es.registerUpdater=function(e){es.updaters.includes(e)||es.updaters.push(e)};es.unregisterUpdater=function(e){if(es.updaters.includes(e)){let t=es.updaters.indexOf(e);es.updaters.splice(t,1)}};es.prototype.process=function(e,t){return UDe(this,e,t,!1)};es.prototype.load=function(e,t){return UDe(this,e,t,!0)};es.prototype.update=function(e){return!0};es.processPacketData=Te;es.processPositionPacketData=zDe;es.processMaterialPacketData=$f;es._processCzml=function(e,t,n,i,r){if(i=i??es.updaters,Array.isArray(e))for(let o=0,a=e.length;o<a;++o)FDe(e[o],t,i,n,r);else FDe(e,t,i,n,r)};var OU=es;var GDe=Go(HDe(),1);function x5(e){return h.fromDegrees(e[0],e[1],e[2])}var Fne={"urn:ogc:def:crs:OGC:1.3:CRS84":x5,"EPSG:4326":x5,"urn:ogc:def:crs:EPSG::4326":x5},WDe={},qDe={},Bne=48,kne,zne=U.ROYALBLUE,Une=U.YELLOW,Vne=2,jne=U.fromBytes(255,255,0,100),Hne=!1,GMt={small:24,medium:48,large:64},WMt=["title","description","marker-size","marker-symbol","marker-color","stroke","stroke-opacity","stroke-width","fill","fill-opacity"];function YDe(e,t){let n="";for(let i in e)if(e.hasOwnProperty(i)){if(i===t||WMt.indexOf(i)!==-1)continue;let r=e[i];l(r)&&(typeof r=="object"?n+=`<tr><th>${i}</th><td>${YDe(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 qMt(e,t,n){let i;return function(r,o){return l(i)||(i=e(t,n)),i}}function YMt(e,t){return new am(qMt(YDe,e,t),!0)}function T5(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 hi(c):n(o,a))}return r}function Gne(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++)n[i]=t(e[i]);return n}var XDe={Feature:$De,FeatureCollection:XMt,GeometryCollection:JDe,LineString:n1e,MultiLineString:i1e,MultiPoint:e1e,MultiPolygon:a1e,Point:QDe,Polygon:o1e,Topology:s1e},KDe={GeometryCollection:JDe,LineString:n1e,MultiLineString:i1e,MultiPoint:e1e,MultiPolygon:a1e,Point:QDe,Polygon:o1e,Topology:s1e};function $De(e,t,n,i,r){if(t.geometry===null){T5(t,e._entityCollection,r.describe);return}if(!l(t.geometry))throw new oe("feature.geometry is required.");let o=t.geometry.type,a=KDe[o];if(!l(a))throw new oe(`Unknown geometry type: ${o}`);a(e,t,t.geometry,i,r)}function XMt(e,t,n,i,r){let o=t.features;for(let a=0,s=o.length;a<s;a++)$De(e,o[a],void 0,i,r)}function JDe(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=KDe[u];if(!l(f))throw new oe(`Unknown geometry type: ${u}`);f(e,t,c,i,r)}}function ZDe(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=GMt[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 cl;f.verticalOrigin=new hi(Gn.BOTTOM),i.length===2&&r.clampToGround&&(f.heightReference=it.CLAMP_TO_GROUND);let d=T5(t,e._entityCollection,r.describe);d.billboard=f,d.position=new Kl(n(i));let p=Promise.resolve(u).then(function(g){f.image=new hi(g)}).catch(function(){f.image=new hi(e._pinBuilder.fromColor(a,s))});e._promises.push(p)}function QDe(e,t,n,i,r){ZDe(e,t,i,n.coordinates,r)}function e1e(e,t,n,i,r){let o=n.coordinates;for(let a=0;a<o.length;a++)ZDe(e,t,i,o[a],r)}function t1e(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 hi(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=T5(t,e._entityCollection,r.describe),u=new ll;c.polyline=u,u.clampToGround=r.clampToGround,u.material=o,u.width=a,u.positions=new hi(Gne(i,n)),u.arcType=sn.RHUMB}function n1e(e,t,n,i,r){t1e(e,t,i,n.coordinates,r)}function i1e(e,t,n,i,r){let o=n.coordinates;for(let a=0;a<o.length;a++)t1e(e,t,i,o[a],r)}function r1e(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 hi(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 hi(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 rm;u.outline=new hi(!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 Rc(Gne(i[g],n)));let d=i[0];u.hierarchy=new hi(new Rc(Gne(d,n),f)),d[0].length>2?u.perPositionHeight=new hi(!0):r.clampToGround||(u.height=0);let p=T5(t,e._entityCollection,r.describe);p.polygon=u}function o1e(e,t,n,i,r){r1e(e,t,i,n.coordinates,r)}function a1e(e,t,n,i,r){let o=n.coordinates;for(let a=0;a<o.length;a++)r1e(e,t,i,o[a],r)}function s1e(e,t,n,i,r){for(let o in n.objects)if(n.objects.hasOwnProperty(o)){let a=GDe.feature(n,n.objects[o]),s=XDe[a.type];s(e,a,a,i,r)}}function eb(e){this._name=e,this._changed=new be,this._error=new be,this._isLoading=!1,this._loading=new be,this._entityCollection=new Fs(this),this._promises=[],this._pinBuilder=new hg,this._entityCluster=new Sf,this._credit=void 0,this._resourceCredits=[]}eb.load=function(e,t){return new eb().load(e,t)};Object.defineProperties(eb,{markerSize:{get:function(){return Bne},set:function(e){Bne=e}},markerSymbol:{get:function(){return kne},set:function(e){kne=e}},markerColor:{get:function(){return zne},set:function(e){zne=e}},stroke:{get:function(){return Une},set:function(e){Une=e}},strokeWidth:{get:function(){return Vne},set:function(e){Vne=e}},fill:{get:function(){return jne},set:function(e){jne=e}},clampToGround:{get:function(){return Hne},set:function(e){Hne=e}},crsNames:{get:function(){return Fne}},crsLinkHrefs:{get:function(){return WDe}},crsLinkTypes:{get:function(){return qDe}}});Object.defineProperties(eb.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}}});eb.prototype.load=function(e,t){return c1e(this,e,t,!0)};eb.prototype.process=function(e,t){return c1e(this,e,t,!1)};function c1e(e,t,n,i){ya.setLoading(e,!0),n=n??H.EMPTY_OBJECT;let r=n.credit;typeof r=="string"&&(r=new St(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??YMt,markerSize:n.markerSize??Bne,markerSymbol:n.markerSymbol??kne,markerColor:n.markerColor??zne,strokeWidthProperty:new hi(n.strokeWidth??Vne),strokeMaterialProperty:new Yt(n.stroke??Une),fillMaterialProperty:new Yt(n.fill??jne),clampToGround:n.clampToGround??Hne},Promise.resolve(o).then(function(s){return KMt(e,s,n,a,i)}).catch(function(s){throw ya.setLoading(e,!1),e._error.raiseEvent(e,s),s})}eb.prototype.update=function(e){return!0};function KMt(e,t,n,i,r){let o;l(i)&&(o=xg(i)),l(o)&&e._name!==o&&(e._name=o,e._changed.raiseEvent(e));let a=XDe[t.type];if(!l(a))throw new oe(`Unsupported GeoJSON object type: ${t.type}`);let s=t.crs,c=s!==null?x5: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=Fne[u.name],!l(c))throw new oe(`Unknown crs name: ${u.name}`)}else if(s.type==="link"){let f=WDe[u.href];if(l(f)||(f=qDe[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=Fne[`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,ya.setLoading(e,!1),e})})}var tb=eb;var fRe=Go(_ie(),1);var dRe;typeof DOMParser<"u"&&(dRe=new DOMParser);var cBt=new fRe.default({stripPrefix:!1,email:!1,replaceFn:function(e,t){return t.urlMatchType==="scheme"||t.urlMatchType==="www"}}),j5=32,iRe=2414016,rRe=1,oRe=16093e3,aRe=.1,lBt=[null,void 0,"http://www.topografix.com/GPX/1/1"],Xr={gpx:lBt};function uBt(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 yie(e,t){let n=FU(e,"id");return n=l(n)?n:Kn(),t.getOrCreateEntity(n)}function Aie(e){let t=sRe(e,"lon"),n=sRe(e,"lat"),i=LU(e,"ele",Xr.gpx);return h.fromDegrees(t,n,i)}function sRe(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 FU(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function rb(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 bie(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 LU(e,t,n){let i=rb(e,t,n);if(l(i)){let r=parseFloat(i.textContent);return isNaN(r)?void 0:r}}function $u(e,t,n){let i=rb(e,t,n);if(l(i))return i.textContent.trim()}function hRe(e){let t=new cl;return t.width=j5,t.height=j5,t.scaleByDistance=new Wt(iRe,rRe,oRe,aRe),t.pixelOffsetScaleByDistance=new Wt(iRe,rRe,oRe,aRe),t.verticalOrigin=new hi(Gn.BOTTOM),t.image=e,t}function fBt(){let e=new im;return e.translucencyByDistance=new Wt(3e6,1,5e6,0),e.pixelOffset=new z(17,0),e.horizontalOrigin=Vi.LEFT,e.font="16px sans-serif",e.style=ho.FILL_AND_OUTLINE,e}function mRe(e){let t=new ll;return t.width=4,t.material=new JA,t.material.color=l(e)?e:U.RED,t.material.outlineWidth=2,t.material.outlineColor=U.BLACK,t}var cRe={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"}},NU;typeof document<"u"&&(NU=document.createElement("div"));function xie(e,t){let n,i="",r=Object.keys(cRe),o=r.length;for(n=0;n<o;n++){let f=r[n],d=cRe[f];d.value=$u(e,d.tag,Xr.gpx)??"",l(d.value)&&d.value!==""&&(i=`${i}<p>${d.text}: ${d.value}</p>`)}if(!l(i)||i==="")return;i=cBt.link(i),NU.innerHTML=i;let a=NU.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+=`${NU.innerHTML}</div>`,NU.innerHTML="",u}function pRe(e,t,n,i){let r=Aie(t),o=yie(t,n);o.position=r;let a=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",U.RED,j5);o.billboard=hRe(a);let s=$u(t,"name",Xr.gpx);o.name=s,o.label=fBt(),o.label.text=s,o.description=xie(t,o),i.clampToGround&&(o.billboard.heightReference=it.CLAMP_TO_GROUND,o.label.heightReference=it.CLAMP_TO_GROUND)}function dBt(e,t,n,i){let r=yie(t,n);r.description=xie(t,r);let o=bie(t,"rtept",Xr.gpx),a=new Array(o.length);for(let s=0;s<o.length;s++)pRe(e,o[s],n,i),a[s]=Aie(o[s]);r.polyline=mRe(i.routeColor),i.clampToGround&&(r.polyline.clampToGround=!0),r.polyline.positions=a}function hBt(e,t,n,i){let r=yie(t,n);r.description=xie(t,r);let o=bie(t,"trkseg",Xr.gpx),a=[],s=[],c,u=!0,f=new mc;for(let d=0;d<o.length;d++)c=mBt(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,j5);r.billboard=hRe(d),r.position=f,i.clampToGround&&(r.billboard.heightReference=it.CLAMP_TO_GROUND),r.availability=new ga,r.availability.addInterval(new Tn({start:s[0],stop:s[s.length-1]}))}r.polyline=mRe(i.trackColor),r.polyline.positions=a,i.clampToGround&&(r.polyline.clampToGround=!0)}function mBt(e){let t={positions:[],times:[]},n=bie(e,"trkpt",Xr.gpx),i;for(let r=0;r<n.length;r++){let o=Aie(n[r]);t.positions.push(o),i=$u(n[r],"time",Xr.gpx),l(i)&&t.times.push(K.fromIso8601(i))}return t}function pBt(e){let t=rb(e,"metadata",Xr.gpx);if(l(t)){let n={name:$u(t,"name",Xr.gpx),desc:$u(t,"desc",Xr.gpx),author:gBt(t),copyright:yBt(t),link:gRe(t),time:$u(t,"time",Xr.gpx),keywords:$u(t,"keywords",Xr.gpx),bounds:ABt(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 gBt(e){let t=rb(e,"author",Xr.gpx);if(l(t)){let n={name:$u(t,"name",Xr.gpx),email:_Bt(t),link:gRe(t)};if(l(n.name)||l(n.email)||l(n.link))return n}}function _Bt(e){let t=rb(e,"email",Xr.gpx);if(l(t)){let n=$u(t,"id",Xr.gpx),i=$u(t,"domain",Xr.gpx);return`${n}@${i}`}}function gRe(e){let t=rb(e,"link",Xr.gpx);if(l(t)){let n={href:FU(t,"href"),text:$u(t,"text",Xr.gpx),mimeType:$u(t,"type",Xr.gpx)};if(l(n.href)||l(n.text)||l(n.mimeType))return n}}function yBt(e){let t=rb(e,"copyright",Xr.gpx);if(l(t)){let n={author:FU(t,"author"),year:$u(t,"year",Xr.gpx),license:$u(t,"license",Xr.gpx)};if(l(n.author)||l(n.year)||l(n.license))return n}}function ABt(e){let t=rb(e,"bounds",Xr.gpx);if(l(t)){let n={minLat:LU(t,"minlat",Xr.gpx),maxLat:LU(t,"maxlat",Xr.gpx),minLon:LU(t,"minlon",Xr.gpx),maxLon:LU(t,"maxlon",Xr.gpx)};if(l(n.minLat)||l(n.maxLat)||l(n.minLon)||l(n.maxLon))return n}}var lRe={wpt:pRe,rte:dBt,trk:hBt};function bBt(e,t,n,i){let r=Object.keys(lRe),o=r.length;for(let a=0;a<o;a++){let s=r[a],c=lRe[s],u=t.childNodes,f=u.length;for(let d=0;d<f;d++){let p=u[d];p.localName===s&&Xr.gpx.indexOf(p.namespaceURI)!==-1&&c(e,p,n,i)}}}function uRe(e,t,n){let i=e._entityCollection;i.removeAll();let r=t.documentElement,o=FU(r,"version"),a=FU(r,"creator"),s,c=pBt(r);l(c)&&(s=c.name),r.localName==="gpx"?bBt(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 jm,u.startTime=d,u.stopTime=p,u.currentTime=K.clone(d),u.clockRange=la.LOOP_STOP,u.clockStep=Lr.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),xBt(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),ya.setLoading(e,!1),e}function xBt(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 TBt(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?uBt(o).then(function(a){let s,c;try{s=dRe.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 uRe(e,s,i)}):uRe(e,o,i)}).catch(function(o){return e._error.raiseEvent(e,o),console.log(o),Promise.reject(o)})}function yI(){this._changed=new be,this._error=new be,this._loading=new be,this._clock=void 0,this._entityCollection=new Fs(this),this._entityCluster=new Sf,this._name=void 0,this._version=void 0,this._creator=void 0,this._metadata=void 0,this._isLoading=!1,this._pinBuilder=new hg}yI.load=function(e,t){return new yI().load(e,t)};Object.defineProperties(yI.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}}});yI.prototype.update=function(e){return!0};yI.prototype.load=function(e,t){if(!l(e))throw new pe("data is required.");t=t??H.EMPTY_OBJECT,ya.setLoading(this,!0);let n=this._name,i=this;return TBt(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 jm,r.startTime=a,r.stopTime=s,r.currentTime=K.clone(a),r.clockRange=la.LOOP_STOP,r.clockStep=Lr.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),ya.setLoading(i,!1),i}).catch(function(r){return ya.setLoading(i,!1),i._error.raiseEvent(i,r),console.log(r),Promise.reject(r)})};var BU=yI;function CBt(e,t){this.position=e,this.headingPitchRoll=t}var kU=CBt;var BMe=Go(_ie(),1),IV=Go(af(),1);var Tie=new Date(2107,11,31),Cie=new Date(1980,0,1),wt=void 0,HC=1/0,Zf="undefined",Qf="function",_Re="object",qi=new Uint8Array;var vBt=64,yRe=2;try{typeof navigator!=Zf&&navigator.hardwareConcurrency&&(yRe=navigator.hardwareConcurrency)}catch{}var EBt={workerURI:"./core/web-worker-wasm.js",wasmURI:"./core/streams/zlib-wasm/zlib-streams.wasm",chunkSize:64*1024,maxWorkers:yRe,terminateWorkerTimeout:5e3,workerStarvationTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,CompressionStream:typeof CompressionStream!=Zf&&CompressionStream,DecompressionStream:typeof DecompressionStream!=Zf&&DecompressionStream},SBt=["baseURI","wasmURI","workerURI","chunkSize","maxWorkers","terminateWorkerTimeout","workerStarvationTimeout","useCompressionStream","useWebWorkers","CompressionStream","DecompressionStream","CompressionStreamZlib","DecompressionStreamZlib"],ARe=Object.assign({},EBt);function zU(){return ARe}function AI(e){return Math.max(e.chunkSize,vBt)}function x0(e){for(let t of SBt){let n=e[t];n!==wt&&(ARe[t]=n)}}var UU=[[],[],[],[],[],[],[],[]];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;UU[0][e]=t}for(let e=0;e<256;e++)for(let t=1;t<8;t++){let n=UU[t-1][e];UU[t][e]=n>>>8^UU[0][n&255]}var[bRe,wBt,IBt,PBt,DBt,RBt,OBt,MBt]=UU,k_=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=MBt[s&255]^OBt[s>>>8&255]^RBt[s>>>16&255]^DBt[s>>>24&255]^PBt[c&255]^IBt[c>>>8&255]^wBt[c>>>16&255]^bRe[c>>>24&255]}}for(;r<i;r++)n=n>>>8^bRe[(n^t[r])&255];this.crc=n}get(){return~this.crc}};var VU=class extends null{constructor(){let t,n=new k_;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 bI(e){if(typeof TextEncoder==Zf){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 du={concat(e,t){if(e.length===0||t.length===0)return e.concat(t);let n=e[e.length-1],i=du.getPartial(n);return i===32?e.concat(t):du._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+du.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]=du.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=du.getPartial(r);return i.push(du.partial(t+o&31,t+o>32?n:i.pop(),1)),i}},jU={bytes:{fromBits(e){let n=du.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(du.partial(8*(n&3),i)),t}}},xRe={};xRe.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=jU.utf8String.toBits(e));let n=t._buffer=du.concat(t._buffer,e),i=t._length,r=t._length=i+du.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=du.concat(t,[du.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 vie={};vie.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 Eie={};Eie.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=du.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 du.clamp(t,r)}};var ob={importKey(e){return new ob.hmacSha1(jU.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=du;for(t=jU.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)}};ob.hmacSha1=class{constructor(e){let t=this,n=t._hash=xRe.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 LBt=typeof crypto!=Zf&&typeof crypto.getRandomValues==Qf,z_="Invalid password",ab="Invalid signature",U_="zipjs-abort-check-password",NBt="Crypto API not supported";function H5(e){if(LBt)return crypto.getRandomValues(e);throw new Error(NBt)}var xI=16,FBt="raw",vRe={name:"PBKDF2"},BBt={name:"HMAC"},kBt="SHA-1",zBt=Object.assign({hash:BBt},vRe),Sie=Object.assign({iterations:1e3,hash:{name:kBt}},vRe),UBt=["deriveBits"],GU=[8,12,16],HU=[16,24,32],V_=10,VBt=[0,0,0,0],q5=typeof crypto!=Zf,YU=q5&&crypto.subtle,ERe=q5&&typeof YU!=Zf,T0=jU.bytes,jBt=vie.aes,HBt=Eie.ctrGladman,GBt=ob.hmacSha1,TRe=q5&&ERe&&typeof YU.importKey==Qf,CRe=q5&&ERe&&typeof YU.deriveBits==Qf,G5=class extends null{constructor({password:t,rawPassword:n,encryptionStrength:i,checkPasswordOnly:r}){super({start(){SRe(this,t,n,i)},async transform(o,a){let s=this,{password:c,strength:u,resolveReady:f,ready:d}=s;c?(await WBt(s,u,c,_h(o,0,GU[u]+2)),o=_h(o,GU[u]+2),r?a.error(new Error(U_)):f()):await d;let p=new Uint8Array(o.length-V_-(o.length-V_)%xI);a.enqueue(wRe(s,o,p,0,V_,!0))},async flush(o){let{ctr:a,hmac:s,pending:c,ready:u}=this;if(s&&a){await u;let f=_h(c,0,c.length-V_),d=_h(c,c.length-V_),p=qi;if(f.length){let y=qU(T0,f);s.update(y);let A=a.update(y);p=WU(T0,A)}let g=_h(WU(T0,s.digest()),0,V_),m=c.length<V_?1:0;for(let y=0;y<V_;y++)m|=g[y]^d[y];if(m)throw new Error(ab);o.enqueue(p)}}})}},W5=class extends null{constructor({password:t,rawPassword:n,encryptionStrength:i}){let r;super({start(){SRe(this,t,n,i)},async transform(o,a){let s=this,{password:c,strength:u,resolveReady:f,ready:d}=s,p=qi;c?(p=await qBt(s,u,c),f()):await d;let g=new Uint8Array(p.length+o.length-o.length%xI);g.set(p,0),a.enqueue(wRe(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=qi;if(c.length){let d=a.update(qU(T0,c));s.update(d),f=WU(T0,d)}r.signature=WU(T0,s.digest()).slice(0,V_),o.enqueue(wie(f,r.signature))}}}),r=this}};function SRe(e,t,n,i){Object.assign(e,{ready:new Promise(r=>e.resolveReady=r),password:KBt(t,n),strength:i-1,pending:qi})}function wRe(e,t,n,i,r,o){let{ctr:a,hmac:s,pending:c}=e;c.length&&(t=wie(c,t));let u=t.length-r;n=$Bt(n,i+(u-u%xI));let f;for(f=0;f<=u-xI;f+=xI){let d=qU(T0,_h(t,f,f+xI));o&&s.update(d);let p=a.update(d);o||s.update(p),n.set(WU(T0,p),f+i)}return e.pending=_h(t,f),n}async function WBt(e,t,n,i){let r=await IRe(e,t,n,_h(i,0,GU[t])),o=_h(i,GU[t]);if(r[0]!=o[0]||r[1]!=o[1])throw new Error(z_)}async function qBt(e,t,n){let i=H5(new Uint8Array(GU[t])),r=await IRe(e,t,n,i);return wie(i,r)}async function IRe(e,t,n,i){e.password=null;let r=await YBt(FBt,n,zBt,!1,UBt),o=await XBt(Object.assign({salt:i},Sie),r,8*(HU[t]*2+2)),a=new Uint8Array(o),s=qU(T0,_h(a,0,HU[t])),c=qU(T0,_h(a,HU[t],HU[t]*2)),u=_h(a,HU[t]*2);return Object.assign(e,{keys:{key:s,authentication:c,passwordVerification:u},ctr:new HBt(new jBt(s),Array.from(VBt)),hmac:new GBt(c)}),u}async function YBt(e,t,n,i,r){if(TRe)try{return await YU.importKey(e,t,n,i,r)}catch{return TRe=!1,ob.importKey(t)}else return ob.importKey(t)}async function XBt(e,t,n){if(CRe)try{return await YU.deriveBits(e,t,n)}catch{return CRe=!1,ob.pbkdf2(t,e.salt,Sie.iterations,n)}else return ob.pbkdf2(t,e.salt,Sie.iterations,n)}function KBt(e,t){return t===wt?bI(e):t}function wie(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 $Bt(e,t){if(t&&t>e.length){let n=e;e=new Uint8Array(t),e.set(n,0)}return e}function _h(e,t,n){return e.subarray(t,n)}function WU(e,t){return e.fromBits(t)}function qU(e,t){return e.toBits(t)}var XU=12,Y5=class extends null{constructor({password:t,rawPassword:n,passwordVerification:i,checkPasswordOnly:r}){super({start(){ORe(this,t,n,i)},transform(o,a){let s=this;if(s.password||s.rawPassword){let c=PRe(s,o.subarray(0,XU));if(s.password=s.rawPassword=null,(c.at(-1)^s.passwordVerification)!=0)throw new Error(z_);o=o.subarray(XU)}r?a.error(new Error(U_)):a.enqueue(PRe(s,o))}})}},X5=class extends null{constructor({password:t,rawPassword:n,passwordVerification:i}){super({start(){ORe(this,t,n,i)},transform(r,o){let a=this,s,c;if(a.password||a.rawPassword){a.password=a.rawPassword=null;let u=H5(new Uint8Array(XU));u[XU-1]=a.passwordVerification,s=new Uint8Array(r.length+u.length),s.set(DRe(a,u),0),c=XU}else s=new Uint8Array(r.length),c=0;s.set(DRe(a,r),c),o.enqueue(s)}})}};function ORe(e,t,n,i){Object.assign(e,{password:t,rawPassword:n,passwordVerification:i}),JBt(e,t,n)}function PRe(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=MRe(e)^t[i],K5(e,n[i]);return n}function DRe(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=MRe(e)^t[i],K5(e,t[i]);return n}function JBt(e,t,n){let i=[305419896,591751049,878082192];if(Object.assign(e,{keys:i,crcKey0:new k_(i[0]),crcKey2:new k_(i[2])}),n)for(let r=0;r<n.length;r++)K5(e,n[r]);else for(let r=0;r<t.length;r++)K5(e,t.charCodeAt(r))}function K5(e,t){let[,n]=e.keys;e.crcKey0.append([t]);let i=~e.crcKey0.get();n=RRe(Math.imul(RRe(n+LRe(i)),134775813)+1),e.crcKey2.append([n>>>24]);let r=~e.crcKey2.get();e.keys=[i,n,r]}function MRe(e){let t=e.keys[2]|2;return LRe(Math.imul(t,t^1)>>>8)}function LRe(e){return e&255}function RRe(e){return e&4294967295}var TI="Invalid uncompressed size",KU="Invalid compressed data",ZBt="deflate-raw",QBt="deflate64-raw",e2t="gzip",t2t=10,Iie=8,$5=class extends null{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 VU,A=sb(A,g)),o&&(b?(y=new Pie,A=BRe(A,new r(e2t)),A=sb(A,y)):A=FRe(A,s,{level:f,chunkSize:n},r,i,r)),a&&(c?A=sb(A,new X5(t)):(m=new W5(t),A=sb(A,m))),NRe(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})}},Pie=class extends null{constructor(){let t,n=t2t,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<=Iie){let p=new Uint8Array(a);p.set(i),p.set(r,i.length),i=p;return}let s=a-Iie,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(Iie),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}},J5=class extends null{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=sb(m,new Y5(t)):(g=new G5(t),m=sb(m,g))),u&&(m=FRe(m,f,{chunkSize:n,deflate64:d},r,i,r),m=r2t(m)),(!a||o)&&s&&(p=new VU,m=sb(m,p)),NRe(this,m,()=>{if((!a||o)&&s){let y=new DataView(p.value.buffer);if(c!=y.getUint32(0,!1))throw new Error(ab)}})}};function NRe(e,t,n){t=sb(t,new null({flush:n})),Object.defineProperty(e,"readable",{get(){return t}})}function FRe(e,t,n,i,r,o){let a=t&&i?i:r||o,s=n.deflate64?QBt:ZBt,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 BRe(e,c)}function sb(e,t){return e.pipeThrough(t)}function BRe(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 n2t(n,o),await i2t(i,o)}}}async function n2t(e,t){try{await e.abort(t)}catch{}}async function i2t(e,t){try{await e.cancel(t)}catch{}}function r2t(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(KU);throw s.cause=a,s}let{value:r,done:o}=i;o?n.close():n.enqueue(r)},cancel(n){return t.cancel(n)}})}var o2t=64*1024,kRe="message",zRe="start",URe="pull",Die="data",VRe="ack",jRe="close",CI="deflate",e9="inflate";var Z5=class extends null{constructor(t,n){super({});let i=this,{codecType:r}=t,o;r.startsWith(CI)?o=$5:r.startsWith(e9)&&(o=J5),i.outputSize=0;let a=0,s=new o(t,n),c=super.readable,u=new null({transform(d,p){d&&d.length&&(a+=d.length,p.enqueue(d))},flush(){Object.assign(i,{inputSize:a})}}),f=new null({transform(d,p){if(d&&d.length&&(p.enqueue(d),i.outputSize+=d.length,t.outputSize!==wt&&i.outputSize>t.outputSize))throw new Error(TI)},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)}})}},Q5=class extends null{constructor(t){let n;t>=1||(t=o2t),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 HRe={type:"module"},YRe="error",a2t="messageerror",t9,GRe,Rie,WRe,Mie=!0;try{Mie=typeof structuredClone==Qf&&structuredClone(new DOMException("","AbortError")).code!==wt}catch{}var XRe=()=>{};function KRe({initModule:e}){XRe=e}var GC=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 Q5(AI(o))).pipeThrough(new Lie(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)}}}),t9===wt&&(t9=typeof Worker!=Zf),(s&&t9?s2t:$Re)(t,o)}},Lie=class extends null{constructor({onstart:t,onprogress:n,size:i,onend:r}){let o=0;super({async start(){t&&await Oie(t,i)},async transform(a,s){o+=a.length,n&&await Oie(n,o,i),s.enqueue(a)},async flush(){r&&await Oie(r,o)}})}};async function Oie(e,...t){try{await e(...t)}catch{}}function $Re(e,t){return{run:()=>c2t(e,t)}}function s2t(e,t){let{baseURI:n,chunkSize:i}=t,{wasmURI:r}=t;if(!e.interface){typeof r==Qf&&(r=r());let o;try{o=n9(e.workerURI,n,e)}catch{return t9=!1,$Re(e,t)}Object.assign(e,{worker:o,terminated:!1,interface:{run:()=>l2t(e,{chunkSize:i,wasmURI:r,baseURI:n})}})}return e.interface}async function c2t({options:e,readable:t,writable:n,onTaskFinished:i},r){let o;try{if(!e.useCompressionStream)try{await XRe(r)}catch{let u=e.codecType.startsWith(CI)?r.CompressionStreamZlib:r.DecompressionStreamZlib;(!u||u.requiresModule)&&(e.useCompressionStream=!0)}o=new Z5(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 l2t(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}=u2t(e.writable),f;try{f=Nie({type:zRe,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 u2t(e){let t=new AbortController,{writable:n,readable:i}=new null,r=i.pipeTo(e,{preventClose:!0,preventAbort:!0,signal:t.signal});return r.catch(()=>{}),{writable:n,closed:r,abortPipe:()=>t.abort()}}function JRe(e){let{worker:t}=e;if(t)try{t.terminate()}catch{}e.interface=null}function n9(e,t,n,i,r=!0){let o,a,s;if(Rie===wt||GRe!==e){let c=typeof e==Qf;c?a=e(r):a=e;let u=a.startsWith("data:"),f=a.startsWith("blob:");if(u||f){i===wt&&(i=!1),i&&(s=HRe);try{o=new Worker(a,s)}catch(d){if(f)try{URL.revokeObjectURL(a)}catch{}if(c&&f)return n9(e,t,n,i,!1);if(i)throw d;return n9(e,t,n,!0,!1)}}else{i===wt&&(i=!0),i&&(s=HRe);try{a=new URL(a,t)}catch{}try{o=new Worker(a,s)}catch(d){if(i)throw d;return n9(e,t,n,!1,r)}}GRe=e,Rie=a,WRe=s}else o=new Worker(Rie,WRe);return o.addEventListener(kRe,c=>f2t(c,n)),o.addEventListener(YRe,c=>qRe(c,n)),o.addEventListener(a2t,c=>qRe(c,n)),o}function qRe(e,t){e.preventDefault&&e.preventDefault();let{rejectResult:n,writer:i,onTaskFinished:r}=t;JRe(t),n&&(n(e.error||new Error(e.message||YRe)),i&&i.releaseLock(),r())}function Nie(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&&Mie?(o&&s.push(o),a&&s.push(a)):e.readable=e.writable=null,s.length)try{return t.postMessage(e,s),!0}catch{Mie=!1,e.readable=e.writable=null,t.postMessage(e)}else t.postMessage(e)}catch(r){throw n&&n.releaseLock(),r}}async function f2t({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==URe){let{value:y,done:A}=await s.read();g()||Nie({type:Die,value:y,done:A,messageId:r},t)}n==Die&&(await c.ready,await c.write(new Uint8Array(i)),g()||Nie({type:VRe,messageId:r},t)),n==jRe&&m(null,o)}}catch(y){g()||(JRe(t),m(y))}function m(y,A){g()||(y?f(y):u(A),c&&c.releaseLock(),d())}}var WC=[],vI=[],EI,i9;var ZRe=0;async function o9(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===wt;let p=!s&&!c&&!u&&!t.transferStreams;return t.useWebWorkers=!p&&(o||o===wt&&i.useWebWorkers),t.workerURI=t.useWebWorkers&&f?f:wt,n.useCompressionStream=a||a===wt&&i.useCompressionStream,(await g()).run();async function g(){let y=WC.find(A=>!A.busy);if(y)return QRe(y),new GC(y,e,t,m);if(WC.length<d){let A={indexWorker:ZRe};return ZRe++,WC.push(A),new GC(A,e,t,m)}else return new Promise(A=>{vI.push({resolve:A,stream:e,workerOptions:t}),i9=i.workerStarvationTimeout,r9()})}function m(y){if(eOe(),vI.length){let[{resolve:A,stream:b,workerOptions:x}]=vI.splice(0,1);A(new GC(y,b,x,m)),r9()}else y.worker?(QRe(y),m2t(y,t)):WC=WC.filter(A=>A!=y)}}function r9(){!EI&&vI.length&&Number.isFinite(i9)&&i9>=0&&(EI=setTimeout(d2t,i9))}function eOe(){EI&&(clearTimeout(EI),EI=null)}function d2t(){if(EI=null,vI.length){let[{resolve:e,stream:t,workerOptions:n}]=vI.splice(0,1),i=Object.assign({},n,{useWebWorkers:!1,workerURI:wt});e(new GC({},t,i,h2t)),r9()}}function h2t(){eOe(),r9()}function m2t(e,t){let{config:n}=t,{terminateWorkerTimeout:i}=n;Number.isFinite(i)&&i>=0&&(e.terminated?e.terminated=!1:e.terminateTimeout=setTimeout(async()=>{WC=WC.filter(r=>r!=e);try{await e.terminate()}catch{}},i))}function QRe(e){let{terminateTimeout:t}=e;t&&(clearTimeout(t),e.terminateTimeout=null)}var tOe="Writer iterator completed too soon",nOe="Writer not initialized",p2t="text/plain";var g2t="Content-Type";var _2t=64*1024,znr=256*1024,Fie="writable",SI=class{constructor(){this.size=0}init(){this.initialized=!0}},$U=class extends SI{get readable(){return this.createReadable()}createReadable({offset:t=0,size:n,diskNumberStart:i,chunkSize:r=_2t}={}){let o=this,a=0;return new ReadableStream({async pull(s){let c=n===wt?r:Math.min(r,n-a),u=await ns(o,t+a,c,i);s.enqueue(u),a+r>n||n===wt&&!u.length&&c?s.close():a+=r}})}},a9=class extends SI{constructor(){super();let t=this,n=new WritableStream({write(i){if(!t.initialized)throw new Error(nOe);return t.writeUint8Array(i)}});Object.defineProperty(t,Fie,{get(){return n}})}writeUint8Array(){}};var JU=class extends a9{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)}},C0=class extends $U{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)}},wI=class extends SI{constructor(t){super();let n=this,i=new null,r=[];t&&r.push([g2t,t]),Object.defineProperty(n,Fie,{get(){return i.writable}}),n.blob=new Response(i.readable,{headers:r}).blob(),n.blob.catch(()=>{})}getData(){return this.blob}},ZU=class extends C0{constructor(t){super(new Blob([t],{type:p2t}))}},QU=class extends wI{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 s9=class extends $U{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 ed(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 ns(u,c,n);else{let d=f-c;a=new Uint8Array(n);let p=await ns(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=qi;return r.lastDiskNumber=Math.max(s,r.lastDiskNumber),a}},eV=class extends SI{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(tOe);r=p,r.size=0,r.maxSize&&(i.maxSize=r.maxSize),i.availableSize=i.maxSize,await ed(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,Fie,{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()}}},qC=class{constructor(t){return Array.isArray(t)&&(t=new s9(t)),t instanceof ReadableStream&&(t={readable:t}),t}},II=class{constructor(t){return t.writable===wt&&typeof t.next==Qf&&(t=new eV(t)),t instanceof WritableStream&&(t={writable:t}),t.size===wt&&(t.size=0),t instanceof eV||Object.assign(t,{diskNumber:0,diskOffset:0,availableSize:HC,maxSize:HC}),t}};async function ed(e,t){if(e.init&&!e.initialized)await e.init(t);else return Promise.resolve()}function ns(e,t,n,i){return e.readUint8Array(t,n,i)}var iOe="\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(""),y2t=iOe.length==256;function rOe(e){if(y2t){let t="";for(let n=0;n<e.length;n++)t+=iOe[e[n]];return t}else return new TextDecoder().decode(e)}function tV(e,t){return t&&t.trim().toLowerCase()=="cp437"?rOe(e):new TextDecoder(t,{ignoreBOM:!0}).decode(e)}var Bie="filename",kie="rawFilename",nV="comment",zie="rawComment",iV="uncompressedSize",Uie="compressedSize",Vie="offset",jie="diskNumberStart",PI="lastModDate",c9="rawLastModDate",rV="lastAccessDate",oOe="rawLastAccessDate",oV="creationDate",Hie="rawCreationDate",Gie="internalFileAttributes",Wie="externalFileAttributes",qie="msdosAttributesRaw",Yie="msdosAttributes",Xie="msDosCompatible",l9="zip64",Kie="encrypted",$ie="version",Jie="versionMadeBy",Zie="zipCrypto",DI="directory",Qie="executable",ere="compressionMethod",tre="signature",u9="extraField",A2t="extraFieldInfoZip",b2t="extraFieldUnix";var nre="unixMode",ire="setuid",rre="setgid",ore="sticky",x2t="bitFlag",T2t="filenameUTF8",C2t="commentUTF8",v2t="rawExtraField",E2t="extraFieldZip64",S2t="extraFieldUnicodePath",w2t="extraFieldUnicodeComment",I2t="extraFieldAES",P2t="extraFieldNTFS",D2t="extraFieldExtendedTimestamp",R2t=[Bie,kie,iV,Uie,PI,c9,nV,zie,rV,oV,Hie,Vie,jie,Gie,Wie,qie,Yie,Xie,l9,Kie,$ie,Jie,Zie,DI,Qie,ere,tre,u9,b2t,A2t,"uid","gid",nre,ire,rre,ore,x2t,T2t,C2t,v2t,E2t,S2t,w2t,I2t,P2t,D2t],cb=class{constructor(t){R2t.forEach(n=>this[n]=t[n])}};var aOe="filenameEncoding",sOe="commentEncoding",cOe="decodeText",lOe="extractPrependedData",uOe="extractAppendedData",f9="password",d9="rawPassword",h9="passThrough",m9="signal",fOe="checkPasswordOnly",dOe="checkOverlappingEntryOnly",hOe="checkOverlappingEntry",are="checkAmbiguity",mOe="checkSignature",p9="useWebWorkers",g9="useCompressionStream",_9="transferStreams",y9="preventClose",pOe="encryptionStrength",gOe="extendedTimestamp",_Oe="keepOrder",yOe="level",AOe="bufferedWrite",bOe="createTempStream",xOe="dataDescriptorSignature",TOe="useUnicodeFileNames",COe="dataDescriptor",vOe="supportZip64SplitFile",EOe="encodeText",aV="offset",SOe="usdz",wOe="unixExtraFieldType",sre="strictness",IOe="maxAppendedDataSize",sV="strict",POe="balanced",cre="tolerant";var cV="File format is not recognized",UOe="End of central directory not found",VOe="End of Zip64 central directory locator not found",jOe="Central directory header not found",HOe="Local file header not found",GOe="Zip64 extra field not found",WOe="File contains encrypted entry",qOe="Encryption method not supported",ure="Compression method not supported",fre="Split zip file",YOe="Overlapping entry found",XOe="Ambiguous archive",ROe="utf-8",L2t="UTF8",OOe="cp437",MOe=2057,N2t=[[iV,4294967295],[Uie,4294967295],[Vie,4294967295],[jie,65535]],LOe={65535:{getValue:Er,bytes:4},4294967295:{getValue:j_,bytes:8}},XC=class{constructor(t,n={}){Object.assign(this,{reader:new qC(t),options:n,config:zU(),readRanges:new Map})}async*getEntriesGenerator(t={}){let n=this,{reader:i}=n,{config:r}=n;if(await ed(i),(i.size===wt||!i.readUint8Array)&&(i=new C0(await new Response(i.readable).blob()),await ed(i)),i.size<22)throw new Error(cV);let o=JOe(Ba(n,t,sre),Ba(n,t,are)),a=o==sV,s=o!=cre,c=V2t(Ba(n,t,IOe),o),{endOfDirectoryInfo:u,endOfDirectoryReachingEndCount:f}=await H2t(i,s,c);if(!u){let B=await ns(i,0,4),G=Ao(B);throw Er(G)==134695760?new Error(fre):new Error(UOe)}s&&f>1&&td("multiple end of central directory records");let d=Ao(u),p=Er(d,12),g=Er(d,16),m=u.offset,y=ka(d,20),A=m+22+y;i.size-A>c&&td("appended data");let b=ka(d,4),x=i.lastDiskNumber||0,T=ka(d,6),C=ka(d,10),E=0,w,P;if(g==4294967295||p==4294967295||C==65535||T==65535){let B=u.offset>=20?await ns(i,u.offset-20,20):qi,G=Ao(B);if(B.length==20&&Er(G,0)==117853008){g=j_(G,8);let W=await ns(i,g,56,-1),Q=Ao(W),q=u.offset-20-56-(i.lastDiskOffset||0);if((W.length<56||Er(Q,0)!=101075792)&&g!=q&&q>=0){let J=g;g=q,g>J&&(E=g-J),W=await ns(i,g,56,-1),Q=Ao(W)}if(W.length<56||Er(Q,0)!=101075792)throw new Error(VOe);P=!0,b==65535?b=Er(Q,16):a&&b!=Er(Q,16)&&td("mismatched zip64 end of central directory record"),T==65535?T=Er(Q,20):a&&T!=Er(Q,20)&&td("mismatched zip64 end of central directory record"),C==65535?C=j_(Q,32):a&&C!=j_(Q,32)&&td("mismatched zip64 end of central directory record"),p==4294967295?p=j_(Q,40):a&&p!=j_(Q,40)&&td("mismatched zip64 end of central directory record"),g=j_(Q,48)+E}}let R=p,O=u.offset-(P?76:0);if(g>=i.size&&(E=i.size-g-p-22,g=i.size-p-22),x!=b)throw new Error(fre);if(g<0)throw new Error(cV);let N=0,_=await ns(i,g,p,T),v=Ao(_);if(p){if(_.length<4)throw new Error(cV);let B=O-p-(i.lastDiskOffset||0);if(g!=B&&T==b){let W=!(Er(v,N)==33639248);if(!W&&B>=0&&B+4<=i.size){let Q=await ns(i,B,4,T);W=Er(Ao(Q),0)==33639248}if(W){let Q=g;g=B,g>Q&&(E+=g-Q),_=await ns(i,g,p,T),v=Ao(_)}}}let S=O-g-(i.lastDiskOffset||0);if(p!=S&&S>=0&&T==b&&(p=S,_=await ns(i,g,p,T),v=Ao(_)),g<0||g>=i.size)throw new Error(cV);w=g;let I=Ba(n,t,aOe),M=Ba(n,t,sOe),F=a?new Set:wt,V;for(let B=0;B<C;B++){let G=new dre(i,r,n.options);if(N+46>_.length||Er(v,N)!=33639248)throw new Error(jOe);KOe(G,v,N+6);let W=!!G.bitFlag.languageEncodingFlag,Q=N+46,q=Q+G.filenameLength,J=q+G.extraFieldLength,Z=ka(v,N+4),ce=Z>>8==0,Ae=Z>>8==3,le=_.subarray(Q,q),Ce=ka(v,N+32),ye=J+Ce,ve=_.subarray(J,ye),Ie=W,Le=W,$e=Er(v,N+38),Xe=$e&255,At={readOnly:!!(Xe&1),hidden:!!(Xe&2),system:!!(Xe&4),directory:!!(Xe&16),archive:!!(Xe&32)},Ke=Er(v,N+42),we=Ba(n,t,cOe)||tV,We=Ie?ROe:I||OOe,vt=Le?ROe:M||OOe,ct=we(le,We);ct===wt&&(ct=tV(le,We));let pn=we(ve,vt);pn===wt&&(pn=tV(ve,vt)),Object.assign(G,{index:B,versionMadeBy:Z,msDosCompatible:ce,compressedSize:0,uncompressedSize:0,commentLength:Ce,offset:Ke,diskNumberStart:ka(v,N+34),internalFileAttributes:ka(v,N+36),externalFileAttributes:$e,msdosAttributesRaw:Xe,msdosAttributes:At,rawFilename:le,filenameUTF8:Ie,commentUTF8:Le,rawExtraField:_.subarray(q,J),rawComment:ve,filename:ct,comment:pn}),$Oe(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===wt&&(Ht&16877)!=0&&(G.unixMode=Ht);let bt=!!(G.unixMode&2048),Dt=!!(G.unixMode&1024),Pn=!!(G.unixMode&512),ot=G.unixMode!==wt?(G.unixMode&73)!=0:Ae&&(Ht&73)!=0,dt=G.unixMode!==wt&&(G.unixMode&61440)==16384,Si=(Ht&61440)==16384;Object.assign(G,{setuid:bt,setgid:Dt,sticky:Pn,unixExternalUpper:Ht,internalFileAttribute:G.internalFileAttributes,externalFileAttribute:G.externalFileAttributes,executable:ot,directory:dt||Si||ce&&At.directory||G.filename.endsWith("/")&&!G.uncompressedSize,zipCrypto:G.encrypted&&!G.extraFieldAES});let wn=new cb(G);wn.getData=(dr,Fi)=>G.getData(dr,wn,n.readRanges,Fi),wn.arrayBuffer=async dr=>{let Fi=new null,[Yi]=await Promise.all([new Response(Fi.readable).arrayBuffer(),G.getData(Fi,wn,n.readRanges,dr)]);return Yi},N=ye;let{onprogress:Ni}=t;if(Ni)try{await Ni(B+1,C,new cb(G))}catch{}yield wn}a&&N!=R&&td("trailing central directory data"),V&&td("duplicate filename"),a&&(E||C&&w>0)&&td("prepended data");let k=Ba(n,t,lOe),j=Ba(n,t,uOe);return k&&(n.prependedData=w>0?await ns(i,0,w):qi),n.comment=y?await ns(i,m+22,y):qi,j&&(n.appendedData=A<i.size?await ns(i,A,i.size-A):qi),!0}async getEntries(t={}){let n=[];for await(let i of this.getEntriesGenerator(t))n.push(i);return n}async close(){}};var dre=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 ns(a,c,30,u),w=Ao(E),P=Ba(o,r,f9),R=Ba(o,r,d9),O=Ba(o,r,h9);if(P=P&&P.length&&P,R=R&&R.length&&R,f&&f.originalCompressionMethod!=99)throw new Error(ure);if(p!=0&&p!=8&&p!=9&&!O)throw new Error(ure);if(E.length<30||Er(w,0)!=67324752)throw new Error(HOe);KOe(C,w,4);let{extraFieldLength:N,filenameLength:_}=C,v=JOe(Ba(o,r,sre),Ba(o,r,are))==sV,S=qi;if(v&&(_||N)){let ve=await ns(a,c+30,_+N,u);S=ve.subarray(0,_),C.rawExtraField=ve.subarray(_)}else C.rawExtraField=N?await ns(a,c+30+_,N,u):qi;$Oe(o,C,w,4,!0),v&&W2t(o,C,S);let{lastAccessDate:I,creationDate:M}=C;I&&(n.lastAccessDate=I),M&&(n.creationDate=M);let F=o.encrypted&&C.encrypted&&!O,V=F&&!f;if(O||(n.zipCrypto=V),F){if(!V&&f.strength===wt)throw new Error(qOe);if(!P&&!R)throw new Error(WOe)}let k=c+30+_+N,j=x,B=a.createReadable({offset:k,size:j,diskNumberStart:u,chunkSize:AI(g)}),G=Ba(o,r,m9),W=Ba(o,r,fOe),Q=Ba(o,r,hOe),q=Ba(o,r,dOe);q&&(Q=!0);let{onstart:J,onprogress:Z,onend:ce}=r,Ae=p==9,le=Ba(o,r,g9);Ae&&(le=!1);let Ce={options:{codecType:e9,password:P,rawPassword:R,zipCrypto:V,encryptionStrength:f&&f.strength,signed:Ba(o,r,mOe)&&!O,passwordVerification:V&&(T?A>>>8&255:y>>>24&255),outputSize:O?x:b,signature:y,compressed:p!=0&&!O,encrypted:F,useWebWorkers:Ba(o,r,p9),useCompressionStream:le,transferStreams:Ba(o,r,_9),deflate64:Ae,checkPasswordOnly:W},config:g,streamOptions:{signal:G,size:j,onstart:J,onprogress:Z,onend:ce}};Q&&await U2t({reader:a,fileEntry:n,index:s,offset:c,diskNumberStart:u,signature:y,compressedSize:x,uncompressedSize:b,dataOffset:k,dataDescriptor:T||C.bitFlag.dataDescriptor,extraFieldZip64:d||C.extraFieldZip64,readRanges:i});let ye;try{if(!q){W&&(t=new WritableStream),t=new II(t),await ed(t,O?x:b),{writable:ye}=t;let{outputSize:ve}=await o9({readable:B,writable:ye},Ce);if(t.size+=ve,ve!=(O?x:b))throw new Error(TI)}}catch(ve){if(ve.outputSize!==wt&&(t.size+=ve.outputSize),!W||ve.message!=U_)throw ve}finally{!Ba(o,r,y9)&&ye&&!ye.locked&&await ye.getWriter().close()}return W||q?wt:t.getData?t.getData():ye}};function KOe(e,t,n){let i=e.rawBitFlag=ka(t,n+2),r=(i&1)==1,o=Er(t,n+6);Object.assign(e,{encrypted:r,version:ka(t,n),bitFlag:{level:(i&6)>>1,dataDescriptor:(i&8)==8,languageEncodingFlag:(i&2048)==2048},rawLastModDate:o,lastModDate:q2t(o),filenameLength:ka(t,n+22),extraFieldLength:ka(t,n+24)})}function $Oe(e,t,n,i,r){let{rawExtraField:o}=t,a=t.extraField=new Map,s=Ao(new Uint8Array(o)),c=0;try{for(;c<o.length;){let x=ka(s,c),T=ka(s,c+2);a.set(x,{type:x,data:o.slice(c+4,c+4+T)}),c+=4+T}}catch{}let u=ka(n,i+4);Object.assign(t,{signature:Er(n,i+10),compressedSize:Er(n,i+14),uncompressedSize:Er(n,i+18)});let f=a.get(1);f&&(F2t(f,t),t.extraFieldZip64=f);let d=a.get(28789);d&&(NOe(d,Bie,kie,t,e),t.extraFieldUnicodePath=d);let p=a.get(25461);p&&(NOe(p,nV,zie,t,e),t.extraFieldUnicodeComment=p);let g=a.get(39169);g&&g.data.length>=7?(B2t(g,t,u),t.extraFieldAES=g):t.compressionMethod=u;let m=a.get(10);m&&(k2t(m,t),t.extraFieldNTFS=m);let y=a.get(30805);if(y)FOe(y,t,!1),t.extraFieldUnix=y;else{let x=a.get(30837);x&&(FOe(x,t,!0),t.extraFieldInfoZip=x)}let A=a.get(21589);A&&(z2t(A,t,r),t.extraFieldExtendedTimestamp=A);let b=a.get(6534);b&&(t.extraFieldUSDZ=b)}function F2t(e,t){t.zip64=!0;let n=Ao(e.data),i=N2t.filter(([o,a])=>t[o]==a),r=i.reduce((o,[,a])=>o+LOe[a].bytes,0);if(e.data.length<r)throw new Error(GOe);for(let o=0,a=0;o<i.length;o++){let[s,c]=i[o],u=LOe[c];t[s]=e[s]=u.getValue(n,a),a+=u.bytes}}function NOe(e,t,n,i,r){if(e.data.length<5){e.valid=!1;return}let o=Ao(e.data),a=new k_;a.append(r[n]);let s=Ao(new Uint8Array(4));s.setUint32(0,a.get(),!0);let c=Er(o,1);Object.assign(e,{version:lb(o,0),[t]:tV(e.data.subarray(5)),valid:!r.bitFlag.languageEncodingFlag&&c==Er(s,0)}),e.valid&&(i[t]=e[t],i[t+L2t]=!0)}function B2t(e,t,n){let i=Ao(e.data),r=lb(i,4);Object.assign(e,{vendorVersion:lb(i,0),vendorId:lb(i,2),strength:r,originalCompressionMethod:n,compressionMethod:ka(i,5)}),t.compressionMethod=e.compressionMethod}function k2t(e,t){let n=Ao(e.data),i=4,r;try{for(;i<e.data.length&&!r;){let o=ka(n,i),a=ka(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=Ao(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=lre(a),f=lre(s),d=lre(c),p={lastModDate:u,lastAccessDate:f,creationDate:d};Object.assign(e,p),Object.assign(t,p)}}catch{}}function FOe(e,t,n){try{let i=Ao(new Uint8Array(e.data)),r,o;if(n){let a=0,s=lb(i,a++),c=lb(i,a++);r=BOe(e.data.subarray(a,a+c)),a+=c;let u=lb(i,a++);o=BOe(e.data.subarray(a,a+u)),Object.assign(e,{version:s,uid:r,gid:o})}else e.data.length>=4&&(r=ka(i,0),o=ka(i,2),Object.assign(e,{uid:r,gid:o}));r!==wt&&(t.uid=r),o!==wt&&(t.gid=o)}catch{}}function BOe(e){let t=new Uint8Array(4);return t.set(e,0),new DataView(t.buffer,t.byteOffset,4).getUint32(0,!0)}function z2t(e,t,n){if(!e.data.length)return;let i=Ao(e.data),r=lb(i,0),o=[],a=[];n?((r&1)==1&&(o.push(PI),a.push(c9)),(r&2)==2&&(o.push(rV),a.push(oOe)),(r&4)==4&&(o.push(oV),a.push(Hie))):e.data.length>=5&&(o.push(PI),a.push(c9));let s=1;o.forEach((c,u)=>{if(e.data.length>=s+4){let f=Er(i,s);t[c]=e[c]=new Date((f|0)*1e3);let d=a[u];e[d]=f}s+=4})}async function U2t({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 ns(e,c+a,g+4,r);if(y.length==g+4&&Er(Ao(y),0)==134695760){let b=Er(Ao(y),4),x,T;f?(x=j_(Ao(y),8),T=j_(Ao(y),16)):(x=Er(Ao(y),8),T=Er(Ao(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(YOe);throw b.overlappingEntry=A.fileEntry,b}d.set(n,m)}function JOe(e,t){return e===wt?t?sV:POe:e}function V2t(e,t){return e!==wt?e:t==sV?0:t==cre?1/0:65535}var j2t=64,kOe=0,wre=1,x9=2;async function H2t(e,t,n){let{size:i}=e,r=Math.min(i,65557),o={count:j2t},a,s,c=0;for await(let[u,f,d,p,g]of ZOe(e,r)){let m=ka(u,p+20);if(g+22+m==i){let y=await QOe(e,u,f,p,g,i,o);if(y==x9){if(a||(a=hre(d,p,g)),c++,!t||c>1)break}else y==wre&&!s&&(s=hre(d,p,g))}}return a||(a=s),a||(a=await G2t(e,n,o)),{endOfDirectoryInfo:a,endOfDirectoryReachingEndCount:c}}async function G2t(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 ZOe(e,r)){let p=hre(u,f,d);o||(o=p);let g=await QOe(e,s,c,f,d,i,n);if(g==x9)return p;g==wre&&!a&&(a=p)}return a||o}async function*ZOe(e,t){let n=e.size-t,i=await ns(e,n,t),r=Ao(i);for(let o=i.length-22;o>=0;o--)Er(r,o)==101010256&&(yield[r,n,i,o,n+o])}function hre(e,t,n){return{offset:n,buffer:e.slice(t,t+22).buffer}}async function QOe(e,t,n,i,r,o,a){let s=ka(t,i+10),c=Er(t,i+12),u=Er(t,i+16);if(s==65535||c==4294967295||u==4294967295)return await zOe(e,t,n,r-20,o,a)==117853008?x9:kOe;if(!s&&!c)return wre;for(let f of[r-c,u])if(await zOe(e,t,n,f,o,a)==33639248)return x9;return kOe}async function zOe(e,t,n,i,r,o){if(i<0||i+4>r)return wt;if(i>=n)return Er(t,i-n);if(o.count>0){o.count--;let a=await ns(e,i,4);return Er(Ao(a),0)}return wt}function W2t(e,t,n){let{rawFilename:i}=e;(n.length!=i.length||n.some((r,o)=>r!=i[o]))&&td("mismatched local file header (filename)"),(t.rawBitFlag&MOe)!=(e.rawBitFlag&MOe)&&td("mismatched local file header (general purpose bit flag)"),t.compressionMethod!=e.compressionMethod&&td("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)&&td("mismatched local file header (signature or sizes)")}function td(e){let t=new Error(XOe);throw t.reason=e,t}function Ba(e,t,n){return t[n]===wt?e.options[n]:t[n]}function q2t(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 lre(e){return new Date(Number(e/BigInt(1e4)-BigInt(116444736e5)))}function lb(e,t){return e.getUint8(t)}function ka(e,t){return e.getUint16(t,!0)}function Er(e,t){return e.getUint32(t,!0)}function j_(e,t){return Number(e.getBigUint64(t,!0))}function Ao(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}var cMe="File already exists",Ore="Zip file comment exceeds 64KB",lMe="File entry comment exceeds 64KB",uMe="File entry name exceeds 64KB",Mre="Version exceeds 65535",fMe="The strength must equal 1, 2, or 3",dMe="Extra field type exceeds 65535",N9="Extra field data exceeds 64KB",tkt="Compression method not supported",hMe=-2147483648,mMe=2147483647,F9="Zip64 is not supported (set the 'zip64' option to 'true')",pMe="Undefined uncompressed size",gMe="Undefined reader",_Me="Zip file not empty",nkt="Invalid uid (must be integer 0..2^32-1)",ikt="Invalid gid (must be integer 0..2^32-1)",rkt="Invalid UNIX mode (must be integer 0..65535)",okt="Invalid unixExtraFieldType (must be 'infozip' or 'unix')",akt="uid/gid must be 0..65535 for unixExtraFieldType 'unix' (use 'infozip' for larger ids)",skt="Invalid msdosAttributesRaw (must be integer 0..255)",ckt="Invalid msdosAttributes (must be an object with boolean flags)",tMe=new Uint8Array([7,0,2,0,65,69,3,0,0]),Dre="infozip",Rre="unix",Ire=0,nMe=[],yV=class{constructor(t,n={}){t=new II(t);let i=t.availableSize!==wt&&t.availableSize>0&&t.availableSize!==HC&&t.maxSize!==wt&&t.maxSize>0&&t.maxSize!==HC;Object.assign(this,{writer:t,addSplitZipSignature:i,options:n,config:zU(),files:new Map,filenames:new Set,offset:n[aV]===wt?t.size||t.writable.size||0:n[aV],initialOffset:n[aV]===wt?0:n[aV]-(t.size||t.writable.size||0),pendingAddFileCalls:new Set,bufferedWrites:0,lastFileEntry:wt})}async prependZip(t){if(this.filenames.size)throw new Error(_Me);t=new qC(t),await ed(t);let n=new XC(t.readable),i=await n.getEntries();await n.close(),await ed(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:P}=r,{level:R,languageEncodingFlag:O,dataDescriptor:N}=f;x=x||qi,T=T||qi,C=C||qi,E=E||qi,w=w||qi,P=P||qi,r.extraFieldAES&&(b=99);let _=kr(x,T,C,E,w,P),v=A&&p>=4294967295,S=A&&g>=4294967295,I=bMe(R,O,N,d,b)&-7|R<<1,{headerArray:M,headerView:F}=AMe({version:o,bitFlag:I,compressionMethod:b,uncompressedSize:p,compressedSize:g,rawLastModDate:a,rawFilename:u,zip64CompressedSize:S,zip64UncompressedSize:v,extraFieldLength:_}),{signature:V}=r;return V!==wt&&zc(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:P,extendedTimestamp:C.length>0||E.length>0,extraFieldExtendedTimestampFlag:1+(s?2:0)+(c?4:0),headerArray:M,headerView:F}),[r.filename,r]}))}async add(t="",n,i={}){let r=this;i=Object.assign({},i);let{pendingAddFileCalls:o,config:a}=r;Ire<a.maxWorkers?Ire++:await new Promise(u=>nMe.push(u));let s,c;try{if(t=t.trim(),pi(r,i,DI)&&!t.endsWith("/")&&(t+="/"),r.filenames.has(t))throw new Error(cMe);return r.filenames.add(t),c=!0,s=lkt(r,t,n,i),o.add(s),await s}catch(u){throw c&&r.filenames.delete(t),u}finally{o.delete(s);let u=nMe.shift();u?u():Ire--}}remove(t){let{filenames:n,files:i}=this;if(typeof t=="string"&&(t=i.get(t)),t&&t.filename!==wt){let{filename:r}=t;if(n.has(r)&&i.has(r))return n.delete(r),i.delete(r),!0}return!1}async close(t=qi,n={}){let i=this,{pendingAddFileCalls:r,writer:o}=this,{writable:a}=o;if(kr(t)>65535)throw new Error(Ore);for(;r.size;)await Promise.allSettled(Array.from(r));return await bkt(i,t,n),pi(i,n,y9)||await a.getWriter().close(),o.getData?o.getData():a}};async function lkt(e,t,n,i){let r=ukt(e,t,i);({name:t}=r);let o=fkt(e,t,i),{comment:a}=o,s=i[u9];e.files.set(t,wt);let c;try{let u=await dkt(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[tre],offset:e.offset-f,diskNumberStart:d});let p=pkt(i),g=_kt(i),m=kr(p.localHeaderArray,g.dataDescriptorArray);c=await hkt(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 cb(c)}function ukt(e,t,n){t=t.trim();let i=pi(e,n,Xie),r=pi(e,n,Jie,i?20:768),o=pi(e,n,Qie),a=pi(e,n,"uid"),s=pi(e,n,"gid"),c=pi(e,n,nre),u=pi(e,n,wOe),f=pi(e,n,ire),d=pi(e,n,rre),p=pi(e,n,ore);if(a!==wt&&(a<0||a>4294967295))throw new Error(nkt);if(s!==wt&&(s<0||s>4294967295))throw new Error(ikt);if(c!==wt&&(c<0||c>65535))throw new Error(rkt);if(u!==wt&&u!==Dre&&u!==Rre)throw new Error(okt);if(u===Rre&&(a!==wt&&a>65535||s!==wt&&s>65535))throw new Error(akt);u===wt&&(a!==wt||s!==wt)&&(u=Dre);let g=pi(e,n,qie),m=pi(e,n,Yie),y=a!==wt||s!==wt||c!==wt||u,A=g!==wt||m!==wt;if(y?(i=!1,r=r&65535|768):A&&(i=!0,r=r&255),g!==wt&&(g<0||g>255))throw new Error(skt);if(m&&typeof m!==_Re)throw new Error(ckt);if(r>65535)throw new Error(Mre);let b=pi(e,n,Wie,0);!n[DI]&&t.endsWith("/")&&(n[DI]=!0);let x=pi(e,n,DI);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===wt?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}=gkt(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 fkt(e,t,n){let i=pi(e,n,EOe,bI),r=i(t);if(r===wt&&(r=bI(t)),kr(r)>65535)throw new Error(uMe);let o=n[nV]||"",a=i(o);if(a===wt&&(a=bI(o)),kr(a)>65535)throw new Error(lMe);let s=pi(e,n,$ie,20);if(s>65535)throw new Error(Mre);let c=pi(e,n,PI,new Date),u=pi(e,n,rV),f=pi(e,n,oV),d=pi(e,n,Gie,0),p=pi(e,n,h9),g,m;p||(g=pi(e,n,f9),m=pi(e,n,d9));let y=pi(e,n,pOe,3),A=pi(e,n,Zie),b=pi(e,n,gOe,!0),x=pi(e,n,_Oe,!0),T=pi(e,n,p9),C=pi(e,n,_9,!0),E=pi(e,n,AOe),w=pi(e,n,bOe),P=pi(e,n,xOe,!0),R=pi(e,n,m9),O=pi(e,n,TOe,!0),N=pi(e,n,ere);if(!p&&N!==wt&&N!==0&&N!==8)throw new Error(tkt);let _=pi(e,n,yOe),v=pi(e,n,g9),S=pi(e,n,COe);E&&S===wt&&(S=!1),(S===wt||A)&&(S=!0),_!==wt&&_!=6&&(v=!1),!v&&e.config.CompressionStream===wt&&e.config.CompressionStreamZlib===wt&&(_=0);let I=pi(e,n,l9);if(!A&&(g!==wt||m!==wt)&&!(y>=1&&y<=3))throw new Error(fMe);let M=qi,F=n[u9];if(F){let V=0,k=0;F.forEach(B=>V+=4+kr(B)),M=new Uint8Array(V);let j=E0(M);F.forEach((B,G)=>{if(G>65535)throw new Error(dMe);if(kr(B)>65535)throw new Error(N9);H_(j,k,G),H_(j,k+2,kr(B)),bV(M,B,k+4),k+=4+kr(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:P,signal:R,useUnicodeFileNames:O,compressionMethod:N,level:_,useCompressionStream:v,dataDescriptor:S,zip64:I,rawExtraField:M}}}async function dkt(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(gMe);if(m=i[iV],m===wt)throw new Error(pMe)}let y=f===!0,A=pi(e,i,Kie),b=!!t&&(!!(a&&kr(a)||s&&kr(s))||r&&A);t||(d=0,p=0);let x=b?o?12:16+c*4:0;t&&(t=new qC(t),await ed(t),r?(i.uncompressedSize=m,g=sMe(m)+x):t.size===wt?(u=!0,(f||f===wt)&&(f=!0,m=g=4294967296)):(i.uncompressedSize=m=t.size,g=sMe(m)+x));let T=y||m>=4294967295,C=y||g>=4294967295;if(T||C){if(f===!1)throw new Error(F9);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 hkt(e,t,n,i,r){let{files:o,writer:a}=e,{keepOrder:s,dataDescriptor:c,signal:u}=r,{headerInfo:f}=i,d=e.options[SOe],p=e.lastFileEntry,g={},m,y,A,b,x,T,C=0,E;o.set(t,g),e.lastFileEntry=g;try{let O;s&&(O=p&&p.lock,w()),r.bufferedWrite||!s||e.writerLocked||e.bufferedWrites||!c?(m=!0,e.bufferedWrites++,r.createTempStream?E=await r.createTempStream():E=new null(wt,wt,{highWaterMark:HC}),E.size=0,await ed(a)):(E=a,await P()),await ed(E);let{diskOffset:N}=a;if(e.addSplitZipSignature){delete e.addSplitZipSignature;let I=new Uint8Array(4),M=E0(I);zc(M,0,134695760),await Xm(a,I),e.offset+=4}d&&!m&&iMe(i,e.offset-N);let{localHeaderArray:_}=f;m||(await O,await R());let v=a.diskNumber,S=oMe(e,a);if(g.diskNumberStart=v,m||(x=!0,T=a.size,await Xm(E,_)),g=await mkt(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(),O]),await P(),b=!0,T=a.size,await R(),g.diskNumberStart=a.diskNumber,g.offset=oMe(e,a),d){let I=i.metadataSize;iMe(i,e.offset-a.diskOffset),g.size+=i.metadataSize-I}Akt(g,f.localHeaderView,r),await Xm(a,f.localHeaderArray),await vkt(E.readable,a,u,I=>C+=I),a.size+=E.size,b=!1}else g.diskNumberStart=v,g.offset=S;return e.offset+=g.size,g}catch(O){if(b||x){if(e.hasCorruptedEntries=!0,O)try{O.corruptedEntry=!0}catch{}e.offset+=a.size-T,m&&(e.offset+=C)}throw o.delete(t),O}finally{if(m&&e.bufferedWrites--,A&&A(),y&&y(),m&&E&&E.dispose)try{await E.dispose()}catch{}}function w(){g.lock=new Promise(O=>A=O)}async function P(){e.writerLocked=!0;let{lockWriter:O}=e;e.lockWriter=new Promise(N=>y=()=>{e.writerLocked=!1,N()}),await O}async function R(){kr(f.localHeaderArray)>a.availableSize&&(a.availableSize=0,await Xm(a,qi))}}async function mkt(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:P,rawExtraFieldAES:R}=s,{dataDescriptorArray:O}=c,{rawFilename:N,lastAccessDate:_,creationDate:v,password:S,rawPassword:I,level:M,zip64:F,zip64UncompressedSize:V,zip64CompressedSize:k,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:Xe,uid:At,gid:Ke,unixMode:we,setuid:We,setgid:vt,sticky:ct,unixExternalUpper:pn,msdosAttributesRaw:Ht,msdosAttributes:bt,useCompressionStream:Dt,passThrough:Pn}=a,ot={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:P,rawExtraFieldAES:R,rawExtraField:J,extendedTimestamp:Ie,msDosCompatible:Le,internalFileAttributes:$e,externalFileAttributes:Xe,diskNumberStart:n,uid:At,gid:Ke,unixMode:we,setuid:We,setgid:vt,sticky:ct,unixExternalUpper:pn,msdosAttributesRaw:Ht,msdosAttributes:bt},{signature:dt,uncompressedSize:Si}=a,wn=0;Pn||(Si=0);let{writable:Ni}=t;if(e){let dr=e.createReadable?e.createReadable({chunkSize:AI(o)}):e.readable,Fi=e.size,Yi={options:{codecType:CI,level:M,rawPassword:I,password:S,encryptionStrength:ve,zipCrypto:m&&j,passwordVerification:m&&j&&g>>8&255,signed:!Pn,compressed:y&&!Pn,encrypted:m&&!Pn,useWebWorkers:Z,useCompressionStream:Dt,transferStreams:ce},config:o,streamOptions:{signal:ye,size:Fi,onstart:Ae,onprogress:le,onend:Ce}};try{let ai=await o9({readable:dr,writable:Ni},Yi);if(wn=ai.outputSize,t.size+=wn,Pn||(Si=ai.inputSize,dt=ai.signature),!k&&wn>=4294967295||!V&&Si>=4294967295)throw new Error(F9)}catch(ai){throw ai.outputSize!==wt&&(t.size+=ai.outputSize),ai}}return ykt({signature:dt,compressedSize:wn,uncompressedSize:Si,headerInfo:s,dataDescriptorInfo:c},a),B&&await Xm(t,O),Object.assign(ot,{uncompressedSize:Si,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:k}),ot}function pkt(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===wt?o===wt||o>0:C!==0),w,P=m||!E,R=a&&(e.bufferedWrite||!u||!A&&!b||P),O=R||a&&u&&(A||b);if(a&&(A||b)){let q=yh(20);if(q.uint16(1),q.uint16(16),w=q.array,R&&(q.uint64(x),P)){let J=y?s?12:16+p*4:0;q.uint64(m?0:x+J)}}else w=qi;let N;if(y&&!s){let Q=yh(kr(tMe)+2);Q.uint16(39169),Q.bytes(tMe),N=Q.array,N[8]=p}else N=qi;let _,v,S;if(g){let Q=M9(n);if(yMe(Q)){let q=9+(i?4:0)+(r?4:0),J=yh(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(aMe(M9(i))),r&&J.uint32(aMe(M9(r))),v=J.array}else v=qi;try{let q=Pre(n),J=yh(36);J.uint16(10),J.uint16(32),J.skip(4),J.uint16(1),J.uint16(24),J.uint64(q),J.uint64(Pre(i)||q),J.uint64(Pre(r)||q),_=J.array}catch{_=qi}}else _=v=qi;let I;try{let{uid:Q,gid:q,unixExtraFieldType:J}=e;if(J==Dre&&(Q!==wt||q!==wt)){let Z=rMe(Q),ce=rMe(q),Ae=3+Z.length+ce.length,le=yh(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),I=le.array}else if(J==Rre&&(Q!==wt||q!==wt)){let Z=yh(8);Z.uint16(30805),Z.uint16(4),Z.uint16((Q===wt?0:Q)&65535),Z.uint16((q===wt?0:q)&65535),I=Z.array}else I=qi}catch{I=qi}C===wt&&(C=E?8:0),a&&(T=T>45?T:45),y&&!s&&(T=T>51?T:51,N[9]=C,C=99);let M=O?kr(w):0,F=M+kr(N,v,_,I,d);if(F>65535)throw new Error(N9);let{headerArray:V,headerView:k,rawLastModDate:j}=AMe({version:T,bitFlag:bMe(o,c,u,y,C),compressionMethod:C,uncompressedSize:x,lastModDate:n<Cie?Cie:n>Tie?Tie:n,rawFilename:t,zip64CompressedSize:b,zip64UncompressedSize:A,extraFieldLength:F}),B=yh(30+kr(t)+F),G=B.array,W=E0(G);return B.uint32(67324752),B.bytes(V),B.bytes(t),O&&B.bytes(w),B.bytes(N),B.bytes(v),B.bytes(_),B.bytes(I),B.bytes(d),u&&(b||zc(W,18,0),A||zc(W,22,0)),{localHeaderArray:G,localHeaderView:W,headerArray:V,headerView:k,lastModDate:n,rawLastModDate:j,encrypted:y,compressed:E,version:T,compressionMethod:C,extraFieldExtendedTimestampFlag:S,rawExtraFieldZip64:qi,localExtraFieldZip64Length:M,rawExtraFieldExtendedTimestamp:v,rawExtraFieldNTFS:_,rawExtraFieldUnix:I,rawExtraFieldAES:N,extraFieldLength:F}}function iMe(e,t){let{headerInfo:n}=e,{localHeaderArray:i,extraFieldLength:r}=n,o=64-(t+kr(i))%64;o<4&&(o+=64);let a=new Uint8Array(o),s=E0(a);H_(s,0,6534),H_(s,2,o-4);let c=i;n.localHeaderArray=i=new Uint8Array(kr(c)+o),bV(i,c),bV(i,a,kr(c));let u=E0(i);H_(u,28,r+o),n.localHeaderView=u,e.metadataSize+=o}function rMe(e){if(e===wt)return qi;{let t=new Uint8Array(4);E0(t).setUint32(0,e,!0);let i=4;for(;i>1&&t[i-1]===0;)i--;return t.subarray(0,i)}}function gkt(e,t){if(e!==wt)e=e&255;else if(t!==wt){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===wt&&(t={readOnly:!!(e&1),hidden:!!(e&2),system:!!(e&4),directory:!!(e&16),archive:!!(e&32)}),{msdosAttributesRaw:e,msdosAttributes:t}}function _kt({zip64:e,dataDescriptor:t,dataDescriptorSignature:n}){let i=qi,r,o=0,a=e?20:12;return n&&(a+=4),t&&(i=new Uint8Array(a),r=E0(i),n&&(o=4,zc(r,0,134695760))),{dataDescriptorArray:i,dataDescriptorView:r,dataDescriptorOffset:o}}function ykt({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!==wt&&(zc(c,10,e),s&&zc(f,d,e)),o?s&&(AV(f,d+4,BigInt(t)),AV(f,d+12,BigInt(n))):(zc(c,14,t),zc(c,18,n),s&&(zc(f,d+4,t),zc(f,d+8,n)))}function Akt({rawFilename:e,encrypted:t,zip64:n,localExtraFieldZip64Length:i,signature:r,compressedSize:o,uncompressedSize:a,zip64UncompressedSize:s,zip64CompressedSize:c},u,{dataDescriptor:f}){if(f||(t||zc(u,14,r),c||zc(u,18,o),s||zc(u,22,a)),n&&i){let d=30+kr(e)+4;AV(u,d,BigInt(a)),AV(u,d+8,BigInt(o))}}async function bkt(e,t,n){let i=xkt(e.files),{cdStartDiskNumber:r,cdStartDiskOffset:o}=await Tkt(e,i,n);await Ckt(e,t,n,{cdStartDiskNumber:r,cdStartDiskOffset:o,directoryDataLength:i})}function xkt(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),P=yh(w);P.uint16(1),P.uint16(w-4),p&&P.uint64(m),g&&P.uint64(y),A&&P.uint64(n.offset),b&&P.uint32(n.diskNumberStart),x=P.array}else x=qi;n.rawExtraFieldZip64=x,n.zip64Offset=A,n.zip64DiskNumberStart=b;let T,C=M9(d);if(u&&yMe(C)){let w=yh(9);w.uint16(21589),w.uint16(5),w.uint8(f),w.uint32(C),T=w.array}else T=qi;n.rawExtraFieldExtendedTimestamp=T;let E=kr(x,r,a,s,T,c);if(E>65535)throw new Error(N9);t+=46+kr(i,o)+E}return t}async function Tkt(e,t,n){let{files:i,writer:r}=e,o=new Uint8Array(t);await ed(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:P,zip64UncompressedSize:R,zip64CompressedSize:O,zip64DiskNumberStart:N,zip64Offset:_,internalFileAttributes:v,externalFileAttributes:S,diskNumberStart:I,uncompressedSize:M,compressedSize:F}=d,V=kr(m,y,A,b,x,T),k=46+kr(g,C)+V;a+k-s>r.availableSize&&(await Xm(r,o.slice(s,a)),s=a,r.availableSize=0,await Xm(r,qi)),f==0&&(c=r.diskNumber,u=r.diskOffset),R||zc(P,18,M),O||zc(P,14,F),(_||N)&&d.version<45&&H_(P,0,45);let j=yh(k);if(j.uint32(33639248),j.uint16(E),j.bytes(w.subarray(0,24)),j.uint16(V),j.uint16(kr(C)),j.uint16(N?65535:I),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),bV(o,j.array,a),a+=k,n.onprogress)try{await n.onprogress(f+1,i.size,new cb(d))}catch{}}return await Xm(r,s?o.slice(s):o),{cdStartDiskNumber:c,cdStartDiskOffset:u}}async function Ckt(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=pi(e,n,l9);if(f>=4294967295||s>=4294967295||c>=65535||d>=65535){if(p===!1)throw new Error(F9);p=!0}let g=kr(t);if(g>65535)throw new Error(Ore);let m=yh(p?98:22);kr(m.array)+g>r.availableSize&&(r.availableSize=0,await Xm(r,qi)),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),pi(e,n,vOe,!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 Xm(r,m.array),g&&await Xm(r,t)}function yh(e){let t=new Uint8Array(e),n=E0(t),i=0;return{array:t,uint8:r=>{Ekt(n,i,r),i+=1},uint16:r=>{H_(n,i,r),i+=2},uint32:r=>{zc(n,i,r),i+=4},uint64:r=>{AV(n,i,BigInt(r)),i+=8},bytes:r=>{bV(t,r,i),i+=kr(r)},skip:r=>i+=r}}function oMe(e,t){return e.offset-t.diskOffset-(t.diskNumber?e.initialOffset:0)}async function Xm(e,t){let{writable:n}=e,i=n.getWriter();try{await i.ready,e.size+=kr(t),await i.write(t)}finally{i.releaseLock()}}async function vkt(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(kr(o))}}),{preventClose:!0,preventAbort:!0,signal:n})}finally{r.releaseLock()}}function Pre(e){if(e)return(BigInt(e.getTime())+BigInt(116444736e5))*BigInt(1e4)}function M9(e){return Math.floor(e.getTime()/1e3)}function yMe(e){return e>=hMe&&e<=mMe}function aMe(e){return Math.min(mMe,Math.max(hMe,e))}function pi(e,t,n,i){let r=t[n]===wt?e.options[n]:t[n];return r===wt?i:r}function sMe(e){return e+5*(Math.floor(e/16383)+1)}function Ekt(e,t,n){e.setUint8(t,n)}function H_(e,t,n){e.setUint16(t,n,!0)}function zc(e,t,n){e.setUint32(t,n,!0)}function AV(e,t,n){e.setBigUint64(t,n,!0)}function bV(e,t,n){e.set(t,n)}function E0(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function kr(...e){let t=0;return e.forEach(n=>n&&(t+=n.length)),t}function AMe({version:e,bitFlag:t,compressionMethod:n,uncompressedSize:i,compressedSize:r,lastModDate:o,rawLastModDate:a,rawFilename:s,zip64CompressedSize:c,zip64UncompressedSize:u,extraFieldLength:f}){let d=yh(26),p=d.array,g=E0(p);if(d.uint16(e),d.uint16(t),d.uint16(n),a===wt){let m=new Uint32Array(1),y=E0(m);H_(y,0,(o.getHours()<<6|o.getMinutes())<<5|o.getSeconds()/2),H_(y,2,(o.getFullYear()-1980<<4|o.getMonth()+1)<<5|o.getDate()),a=m[0]}return d.uint32(a),d.skip(4),c||r!==wt?d.uint32(c?4294967295:r):d.skip(4),u||i!==wt?d.uint32(u?4294967295:i):d.skip(4),d.uint16(kr(s)),d.uint16(f),{headerArray:p,headerView:g,rawLastModDate:a}}function bMe(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 _ir=1024*1024;var Air=1024*1024;var xir=1024*1024;var Tir=512*1024;var Skt={};try{x0({baseURI:Skt.url})}catch{}var wkt=[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],Ikt=[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],Pkt=[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],Dkt=[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],Rkt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],TV=new Uint8Array(288);TV.fill(8,0,144),TV.fill(9,144,256),TV.fill(7,256,280),TV.fill(8,280,288);var Okt=new Uint8Array(30).fill(5);function xV(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 nd="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function xMe(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+=nd[s>>18&63]+nd[s>>12&63]+nd[s>>6&63]+nd[63&s]}let a=r-o;if(a===1){let s=n[o]<<16;i+=nd[s>>18&63]+nd[s>>12&63]+"=="}else if(a===2){let s=n[o]<<16|n[o+1]<<8;i+=nd[s>>18&63]+nd[s>>12&63]+nd[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(xV(TV),xV(Okt));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=wkt[T]+f(Ikt[T]),E=m(b),w=Pkt[E]+f(Dkt[E]);y(s+C);let P=s-w;for(let R=0;C>R;R++)a[s++]=a[P+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 P=0;x>P;P++)T[Rkt[P]]=f(3);let C=xV(T),E=new Uint8Array(A+b),w=0;for(;w<E.length;){let P=m(C);if(16>P)E[w++]=P;else if(P==16){let R=E[w-1],O=f(2)+3;for(;O--;)E[w++]=R}else w+=P==17?f(3)+3:f(7)+11}return[xV(E.subarray(0,A)),xV(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 P=b[w];if(P>T-C)return x[E+(T-C)];E+=P,C=C+P<<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=nd.indexOf(n[o])<<18|nd.indexOf(n[o+1])<<12|(63&nd.indexOf(n[o+2]))<<6|63&nd.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 za,zI,G_,CV;function TMe(e){if(za=e,{malloc:zI,free:G_,memory:CV}=za,typeof zI!="function"||typeof G_!="function"||!CV)throw za=zI=G_=CV=null,new Error("Invalid WASM module")}function CMe(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 null({start(){try{let s;if(this.out=zI(r),this.in=zI(o),this.inBufferSize=o,!this.out||!this.in)throw new Error("allocation failed");if(this._scratch=new Uint8Array(r),e?(this._process=za.deflate_process,this._last_consumed=za.deflate_last_consumed,this._end=za.deflate_end,this.streamHandle=za.deflate_new(),t==="gzip"?s=za.deflate_init_gzip(this.streamHandle,i):t==="deflate-raw"?s=za.deflate_init_raw(this.streamHandle,i):s=za.deflate_init(this.streamHandle,i)):t==="deflate64-raw"?(this._process=za.inflate9_process,this._last_consumed=za.inflate9_last_consumed,this._end=za.inflate9_end,this.streamHandle=za.inflate9_new(),s=za.inflate9_init_raw(this.streamHandle)):(this._process=za.inflate_process,this._last_consumed=za.inflate_last_consumed,this._end=za.inflate_end,this.streamHandle=za.inflate_new(),t==="deflate-raw"?s=za.inflate_init_raw(this.streamHandle):t==="gzip"?s=za.inflate_init_gzip(this.streamHandle):s=za.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(CV.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&&G_&&(G_(this.in),this.in=0),this.in=zI(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(CV.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&&G_&&G_(s.in),s.in=0,s.out&&G_&&G_(s.out),s.out=0,c}}var UI=class{constructor(t="deflate",n){return CMe(!0,t,n)}},VI=class{constructor(t="deflate",n){return CMe(!1,t,n)}};UI.requiresModule=!0;VI.requiresModule=!0;var vMe=!1;async function EMe(e,{baseURI:t}){if(!vMe){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=Mkt(e);else throw o}let r=await WebAssembly.instantiate(n);TMe(r.instance.exports),vMe=!0}}function Mkt(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 Lre;xMe(x0);KRe({initModule:e=>{if(!Lre){let{wasmURI:t}=e;typeof t==Qf&&(t=t()),Lre=EMe(t,e)}return Lre}});x0({CompressionStreamZlib:UI,DecompressionStreamZlib:VI});function Lkt(e,t){this.position=e,this.headingPitchRange=t}var vV=Lkt;function B9(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=[]}B9.prototype.addPlaylistEntry=function(e){this.playlist.push(e)};B9.prototype.play=function(e,t){this.tourStart.raiseEvent();let n=this;wMe.call(this,e,t,function(i){n.playlistIndex=0,i||SMe(n._activeEntries),n.tourEnd.raiseEvent(i)})};B9.prototype.stop=function(){SMe(this._activeEntries)};function SMe(e){for(let t=e.pop();t!==void 0;t=e.pop())t.stop()}function wMe(e,t,n){let i=this.playlist[this.playlistIndex];if(i){let r=Nkt.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 Nkt(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++,wMe.call(this,e,t,n)}}var EV=B9;function k9(e,t,n){this.type="KmlTourFlyTo",this.blocking=!0,this.activeCamera=null,this.activeCallback=null,this.duration=e,this.view=n,this.flyToMode=t}k9.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)}};k9.prototype.stop=function(){l(this.activeCamera)&&this.activeCamera.cancelFlight(),l(this.activeCallback)&&this.activeCallback(!0)};k9.prototype.getCameraOptions=function(e){let t={duration:this.duration};return l(this.activeCallback)&&(t.complete=this.activeCallback),this.flyToMode==="smooth"&&(t.easingFunction=fa.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 SV=k9;function Nre(e){this.type="KmlTourWait",this.blocking=!0,this.duration=e,this.timeout=null}Nre.prototype.play=function(e){let t=this;this.activeCallback=e,this.timeout=setTimeout(function(){delete t.activeCallback,e(!1)},this.duration*1e3)};Nre.prototype.stop=function(){clearTimeout(this.timeout),l(this.activeCallback)&&this.activeCallback(!0)};var wV=Nre;var kMe={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=L0(t),kMe[t]}},Wre;typeof DOMParser<"u"&&(Wre=new DOMParser);var Fkt=new BMe.default({stripPrefix:!1,email:!1,replaceFn:function(e){return e.urlMatchType==="scheme"||e.urlMatchType==="www"}}),ub=32,IMe=2414016,PMe=1,DMe=16093e3,RMe=.1,OMe=[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"],MMe=["http://www.google.com/kml/ext/2.2"],Bkt=["http://www.w3.org/2005/Atom"],Ue={kml:OMe,gx:MMe,atom:Bkt,kmlgx:OMe.concat(MMe)},qre={Document:XMe,Folder:n3t,Placemark:i3t,NetworkLink:d3t,GroundOverlay:l3t,PhotoOverlay:JMe,ScreenOverlay:c3t,Tour:o3t},Ure=class{constructor(t){this._dataSource=t,this._deferred=_u(),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=W_._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=W_._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=qre[r.localName];if(l(o)&&(Ue.kml.indexOf(r.namespaceURI)!==-1||Ue.gx.indexOf(r.namespaceURI)!==-1)&&(o(n,r,i,this),this._timeoutSet||W_._getTimestamp()>this._started+this._timeThreshold)){this._giveUpTime();return}r=this._nextNode()}this._pop()&&t&&this._process(!0)}};function kkt(e){let t=e.slice(0,Math.min(4,e.size)),n=_u(),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 zkt(e){let t=_u(),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 zMe(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 UMe(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 Ukt(e,t){let n=await e.getData(new QU);n=zMe(n),n=UMe(n),t.kml=Wre.parseFromString(n,"application/xml")}async function Fre(e,t){let n=kMe.detectFromFilename(e.filename)??"application/octet-stream",i=await e.getData(new JU(n));t[e.filename]=i}function id(e,t,n,i){let r=i.keys,o=new IV.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 IV.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 rd(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=Yre(s,i);l(c)&&a.setAttribute(n,c.url)}}function VMe(e,t,n){let i=Ss(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 qr({id:i})),l(r.kml)||(r.addProperty("kml"),r.kml=new Gre),r}function PV(e,t){return e==="absolute"||e==="relativeToGround"||t==="relativeToSeaFloor"}function j9(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 z9(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++]=j9(n[a],t);return r}function fb(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 Ss(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function ir(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 LMe(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 Km(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 Ti(e,t,n){let i=ir(e,t,n);if(l(i)){let r=parseFloat(i.textContent);return isNaN(r)?void 0:r}}function kn(e,t,n){let i=ir(e,t,n);if(l(i))return i.textContent.trim()}function $m(e,t,n){let i=ir(e,t,n);if(l(i)){let r=i.textContent.trim();return r==="1"||/^true$/i.test(r)}}function Yre(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 IV.default(t.getUrlComponent()),a=new IV.default(e);r=n[a.absoluteTo(o)],l(r)&&(i=new De({url:r}))}}return l(i)||(i=t.getDerivedResource({url:e})),i}var Zu={maximumRed:void 0,red:void 0,maximumGreen:void 0,green:void 0,maximumBlue:void 0,blue:void 0};function Vre(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?(Zu.maximumRed=o,Zu.red=void 0):(Zu.maximumRed=void 0,Zu.red=0),r>0?(Zu.maximumGreen=r,Zu.green=void 0):(Zu.maximumGreen=void 0,Zu.green=0),i>0?(Zu.maximumBlue=i,Zu.blue=void 0):(Zu.maximumBlue=void 0,Zu.blue=0),Zu.alpha=n,U.fromRandom(Zu)):new U(o,r,i,n)}function $C(e,t,n){let i=kn(e,t,n);if(l(i))return Vre(i,kn(e,"colorMode",n)==="random")}function Vkt(e){let t=ir(e,"TimeStamp",Ue.kmlgx),n=kn(t,"when",Ue.kmlgx);if(!l(t)||!l(n)||n.length===0)return;let i=K.fromIso8601(n),r=new ga;return r.addInterval(new Tn({start:i,stop:Qe.MAXIMUM_VALUE})),r}function jkt(e){let t=ir(e,"TimeSpan",Ue.kmlgx);if(!l(t))return;let n,i=ir(t,"begin",Ue.kmlgx),r=l(i)?K.fromIso8601(i.textContent):void 0,o=ir(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 ga,n.addInterval(new Tn({start:r,stop:a}))}else l(r)?(n=new ga,n.addInterval(new Tn({start:r,stop:Qe.MAXIMUM_VALUE}))):l(a)&&(n=new ga,n.addInterval(new Tn({start:Qe.MINIMUM_VALUE,stop:a})));return n}function jMe(){let e=new cl;return e.width=ub,e.height=ub,e.scaleByDistance=new Wt(IMe,PMe,DMe,RMe),e.pixelOffsetScaleByDistance=new Wt(IMe,PMe,DMe,RMe),e}function Xre(){let e=new rm;return e.outline=!0,e.outlineColor=U.WHITE,e}function HMe(){let e=new im;return e.translucencyByDistance=new Wt(3e6,1,5e6,0),e.pixelOffset=new z(17,0),e.horizontalOrigin=Vi.LEFT,e.font="16px sans-serif",e.style=ho.FILL_AND_OUTLINE,e}function Kre(e,t,n,i,r){let o=kn(e,"href",Ue.kml);if(!l(o)||o.length===0)return;if(o.indexOf("root://icons/palette-")===0){let s=o.charAt(21),c=Ti(e,"x",Ue.gx)??0,u=Ti(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=Yre(o,n,i);if(r){let s=kn(e,"refreshMode",Ue.kml),c=kn(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=kn(e,"viewBoundScale",Ue.kml)??1,f=c==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",d=kn(e,"viewFormat",Ue.kml)??f,p=kn(e,"httpQuery",Ue.kml);l(d)&&a.setQueryParameters(sf(V9(d))),l(p)&&a.setQueryParameters(sf(V9(p)));let g=t._ellipsoid;return Jre(a,t.camera,t.canvas,u,t._lastCameraView.bbox,g),a}return a}function Hkt(e,t,n,i,r){let o=Ti(t,"scale",Ue.kml),a=Ti(t,"heading",Ue.kml),s=$C(t,"color",Ue.kml),c=ir(t,"Icon",Ue.kml),u=Kre(c,e,i,r,!1);l(c)&&!l(u)&&(u=!1);let f=Ti(c,"x",Ue.gx),d=Ti(c,"y",Ue.gx),p=Ti(c,"w",Ue.gx),g=Ti(c,"h",Ue.gx),m=ir(t,"hotSpot",Ue.kml),y=fb(m,"x"),A=fb(m,"y"),b=Ss(m,"xunits"),x=Ss(m,"yunits"),T=n.billboard;l(T)||(T=jMe(),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=D.toRadians(-a),T.alignedAxis=h.UNIT_Z),o=o??1;let C,E;l(y)&&(b==="pixels"?C=-y*o:b==="insetPixels"?C=(y-ub)*o:b==="fraction"&&(C=-y*ub*o),C+=ub*.5*o),l(A)&&(x==="pixels"?E=A*o:x==="insetPixels"?E=(-A+ub)*o:x==="fraction"&&(E=A*ub*o),E-=ub*.5*o),(l(C)||l(E))&&(T.pixelOffset=new z(C,E))}function U9(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")Hkt(e,s,n,i,r);else if(s.localName==="LabelStyle"){let c=n.label;l(c)||(c=HMe(),n.label=c),c.scale=Ti(s,"scale",Ue.kml)??c.scale,c.fillColor=$C(s,"color",Ue.kml)??c.fillColor,c.text=n.name}else if(s.localName==="LineStyle"){let c=n.polyline;l(c)||(c=new ll,n.polyline=c),c.width=Ti(s,"width",Ue.kml),c.material=$C(s,"color",Ue.kml),l($C(s,"outerColor",Ue.gx))&&pt("kml-gx:outerColor","KML - gx:outerColor is not supported in a LineStyle"),l(Ti(s,"outerWidth",Ue.gx))&&pt("kml-gx:outerWidth","KML - gx:outerWidth is not supported in a LineStyle"),l(Ti(s,"physicalWidth",Ue.gx))&&pt("kml-gx:physicalWidth","KML - gx:physicalWidth is not supported in a LineStyle"),l($m(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=Xre(),n.polygon=c),c.material=$C(s,"color",Ue.kml)??c.material,c.fill=$m(s,"fill",Ue.kml)??c.fill,c.outline=$m(s,"outline",Ue.kml)??c.outline}else if(s.localName==="BalloonStyle"){let c=Vre(kn(s,"bgColor",Ue.kml))??U.WHITE,u=Vre(kn(s,"textColor",Ue.kml))??U.BLACK,f=kn(s,"text",Ue.kml);n.addProperty("balloonStyle"),n.balloonStyle={bgColor:c,textColor:u,text:f}}else if(s.localName==="ListStyle"){let c=kn(s,"listItemType",Ue.kml);(c==="radioFolder"||c==="checkOffOnly")&&pt(`kml-listStyle-${c}`,`KML - Unsupported ListStyle with listItemType: ${c}`)}}}function Gkt(e,t,n,i,r){let o=new qr,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")U9(e,d,o,i,r);else{let p=Km(d,"Pair",Ue.kml);for(let g=0;g<p.length;g++){let m=p[g],y=kn(m,"key",Ue.kml);if(y==="normal"){let A=kn(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=ir(m,"Style",Ue.kml);U9(e,b,o,i,r)}}else pt(`kml-styleMap-${y}`,`KML - Unsupported StyleMap key: ${y}`)}}}let f=kn(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 Wkt(e,t,n){return t.fetchXML().then(function(i){return GMe(e,i,n,t,!0)})}function GMe(e,t,n,i,r,o){let a,s,c,u,f=LMe(t,"Style",Ue.kml);if(l(f)){let y=f.length;for(a=0;a<y;a++)u=f[a],s=Ss(u,"id"),l(s)&&(s=`#${s}`,r&&l(i)&&(s=i.getUrlComponent()+s),l(n.getById(s))||(c=new qr({id:s}),n.add(c),U9(e,u,c,i,o)))}let d=LMe(t,"StyleMap",Ue.kml);if(l(d)){let y=d.length;for(a=0;a<y;a++){let A=d[a];if(s=Ss(A,"id"),l(s)){let b=Km(A,"Pair",Ue.kml);for(let x=0;x<b.length;x++){let T=b[x],C=kn(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=kn(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=ir(T,"Style",Ue.kml),U9(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(Wkt(e,x,n))}}}return p}function $re(e,t,n){let i=new y_(e,t.id,["position"]),r=new n0(t.position);t.polyline=l(n.polyline)?n.polyline.clone():new ll,t.polyline.positions=new M_([i,r])}function WMe(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 qkt(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 n0(e))}function Ykt(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 H9(e,t,n,i){let r=t.label;l(r)||(r=l(n.label)?n.label.clone():HMe(),t.label=r),r.text=t.name;let o=t.billboard;if(l(o)||(o=l(n.billboard)?n.billboard.clone():jMe(),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 z(a*16+1,0):(r.pixelOffset=void 0,r.horizontalOrigin=void 0)}l(i)&&e._clampToGround&&(o.heightReference=i,r.heightReference=i)}function qMe(e,t){let n=e.path;l(n)||(n=new Lg,n.leadTime=0,e.path=n);let i=t.polyline;l(i)&&(n.material=i.material,n.width=i.width)}function Xkt(e,t,n,i,r){let o=kn(n,"coordinates",Ue.kml),a=kn(n,"altitudeMode",Ue.kml),s=kn(n,"altitudeMode",Ue.gx),c=$m(n,"extrude",Ue.kml),u=e._ellipsoid,f=j9(o,u);return i.position=f,H9(e,i,r,WMe(a,s)),c&&PV(a,s)&&$re(t,i,r),!0}function NMe(e,t,n,i,r){let o=ir(n,"coordinates",Ue.kml),a=kn(n,"altitudeMode",Ue.kml),s=kn(n,"altitudeMode",Ue.gx),c=$m(n,"extrude",Ue.kml),u=$m(n,"tessellate",Ue.kml),f=PV(a,s),d=Ti(n,"drawOrder",Ue.gx),p=e._ellipsoid,g=z9(o,p),m=r.polyline;if(f&&c){let y=new Ng;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 ll;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 ll,i.polyline=m,m.positions=Ykt(g,a,s,p),(!u||f)&&(m.arcType=sn.NONE);return!0}function Kkt(e,t,n,i,r){let o=ir(n,"outerBoundaryIs",Ue.kml),a=ir(o,"LinearRing",Ue.kml),s=ir(a,"coordinates",Ue.kml),c=e._ellipsoid,u=z9(s,c),f=$m(n,"extrude",Ue.kml),d=kn(n,"altitudeMode",Ue.kml),p=kn(n,"altitudeMode",Ue.gx),g=PV(d,p),m=l(r.polygon)?r.polygon.clone():Xre(),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 Rc(u),b=Km(n,"innerBoundaryIs",Ue.kml);for(let x=0;x<b.length;x++){a=Km(b[x],"LinearRing",Ue.kml);for(let T=0;T<a.length;T++)s=ir(a[T],"coordinates",Ue.kml),u=z9(s,c),l(u)&&A.holes.push(new Rc(u))}m.hierarchy=A}return!0}function $kt(e,t,n,i,r){let o=kn(n,"altitudeMode",Ue.kml),a=kn(n,"altitudeMode",Ue.gx),s=Km(n,"coord",Ue.gx),c=Km(n,"angles",Ue.gx),u=Km(n,"when",Ue.kml),f=$m(n,"extrude",Ue.kml),d=PV(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=j9(s[b].textContent,p);m.push(x),y.push(K.fromIso8601(u[b].textContent))}let A=new mc;return A.addSamples(y,m),i.position=A,H9(e,i,r,WMe(o,a)),qMe(i,r),i.availability=new ga,u.length>0&&i.availability.addInterval(new Tn({start:y[0],stop:y[y.length-1]})),d&&f&&$re(t,i,r),!0}function FMe(e,t,n,i,r,o,a,s,c){let u=e[0],f=e[e.length-1],d=new mc;d.addSamples(e,t),n.intervals.addInterval(new Tn({start:u,stop:f,isStartIncluded:c,isStopIncluded:c,data:qkt(d,a,s)})),i.addInterval(new Tn({start:u,stop:f,isStartIncluded:c,isStopIncluded:c})),r.intervals.addInterval(new Tn({start:u,stop:f,isStartIncluded:c,isStopIncluded:c,data:o}))}function Jkt(e,t,n,i,r){let o=$m(n,"interpolate",Ue.gx),a=Km(n,"Track",Ue.gx),s,c,u,f=!1,d=new L_,p=new ga,g=new hc,m=e._ellipsoid;for(let y=0,A=a.length;y<A;y++){let b=a[y],x=Km(b,"when",Ue.kml),T=Km(b,"coord",Ue.gx),C=kn(b,"altitudeMode",Ue.kml),E=kn(b,"altitudeMode",Ue.gx),w=PV(C,E),P=$m(b,"extrude",Ue.kml),R=Math.min(T.length,x.length),O=[];s=[];for(let N=0;N<R;N++){let _=j9(T[N].textContent,m);O.push(_),s.push(K.fromIso8601(x[N].textContent))}o&&(l(c)&&FMe([c,s[0]],[u,O[0]],g,p,d,!1,"absolute",void 0,!1),c=s[R-1],u=O[O.length-1]),FMe(s,O,g,p,d,w&&P,C,E,!0),f=f||w&&P}return i.availability=p,i.position=g,H9(e,i,r),qMe(i,r),f&&($re(t,i,r),i.polyline.show=d),!0}var YMe={Point:Xkt,LineString:NMe,LinearRing:NMe,Polygon:Kkt,Track:$kt,MultiTrack:Jkt,MultiGeometry:Zkt,Model:Qkt};function Zkt(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=YMe[f.localName];if(l(d)){let p=VMe(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 Qkt(e,t,n,i,r){return pt("kml-unsupportedGeometry",`KML - Unsupported geometry: ${n.localName}`),!1}function e3t(e,t){let n=ir(e,"ExtendedData",Ue.kml);if(!l(n))return;l(ir(n,"SchemaData",Ue.kml))&&pt("kml-schemaData","KML - SchemaData is unsupported"),l(Ss(n,"xmlns:prefix"))&&pt("kml-extendedData","KML - ExtendedData with xmlns:prefix is unsupported");let i={},r=Km(n,"Data",Ue.kml);if(l(r)){let o=r.length;for(let a=0;a<o;a++){let s=r[a],c=Ss(s,"name");l(c)&&(i[c]={displayName:kn(s,"displayName",Ue.kml),value:kn(s,"value",Ue.kml)})}}t.kml.extendedData=i}var zr;typeof document<"u"&&(zr=document.createElement("div"));function t3t(e,t,n,i,r){let o,a,s,c=t.kml,u=c.extendedData,f=kn(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=Fkt.link(m),zr.innerHTML=m;let A=zr.querySelectorAll("a");for(o=0;o<A.length;o++)A[o].setAttribute("target","_blank");l(i)&&i.keys.length>1&&(id(zr,"a","href",i),id(zr,"link","href",i),id(zr,"area","href",i),id(zr,"img","src",i),id(zr,"iframe","src",i),id(zr,"video","src",i),id(zr,"audio","src",i),id(zr,"source","src",i),id(zr,"track","src",i),id(zr,"input","src",i),id(zr,"embed","src",i),id(zr,"script","src",i),id(zr,"video","poster",i)),rd(zr,"a","href",r),rd(zr,"link","href",r),rd(zr,"area","href",r),rd(zr,"img","src",r),rd(zr,"iframe","src",r),rd(zr,"video","src",r),rd(zr,"audio","src",r),rd(zr,"source","src",r),rd(zr,"track","src",r),rd(zr,"input","src",r),rd(zr,"embed","src",r),rd(zr,"script","src",r),rd(zr,"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+=`${zr.innerHTML}</div>`,zr.innerHTML="",t.description=b}function G9(e,t,n){let i=n.entityCollection,r=n.parentEntity,o=n.sourceResource,a=n.uriResolver,s=VMe(t,i,n.context),c=s.kml,u=Gkt(e,t,n.styleCollection,o,a),f=kn(t,"name",Ue.kml);s.name=f,s.parent=r;let d=jkt(t);l(d)||(d=Vkt(t)),s.availability=d,Zre(s);function p(T){return T?T.show&&p(T.parent):!0}let g=$m(t,"visibility",Ue.kml);s.show=p(r)&&(g??!0);let m=ir(t,"author",Ue.atom),y=c.author;y.name=kn(m,"name",Ue.atom),y.uri=kn(m,"uri",Ue.atom),y.email=kn(m,"email",Ue.atom);let A=ir(t,"link",Ue.atom),b=c.link;b.href=Ss(A,"href"),b.hreflang=Ss(A,"hreflang"),b.rel=Ss(A,"rel"),b.type=Ss(A,"type"),b.title=Ss(A,"title"),b.length=Ss(A,"length"),c.address=kn(t,"address",Ue.kml),c.phoneNumber=kn(t,"phoneNumber",Ue.kml),c.snippet=kn(t,"Snippet",Ue.kml),e3t(t,s),t3t(t,s,u,a,o);let x=e._ellipsoid;return $Me(t,s,x),KMe(t,s,x),l(ir(t,"Region",Ue.kml))&&pt("kml-region","KML - Placemark Regions are unsupported"),{entity:s,styleEntity:u}}function XMe(e,t,n,i){i.addNodes(t.childNodes,n),i.process()}function n3t(e,t,n,i){let r=G9(e,t,n),o=Ye(n);o.parentEntity=r.entity,XMe(e,t,o,i)}function i3t(e,t,n,i){let r=G9(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=YMe[d.localName];l(p)&&(p(e,n.entityCollection,d,o,a,o.id),s=!0)}s||(o.merge(a),H9(e,o,a))}var r3t={FlyTo:s3t,Wait:a3t,SoundCue:Bre,AnimatedUpdate:Bre,TourControl:Bre};function o3t(e,t,n,i){let r=kn(t,"name",Ue.kml),o=Ss(t,"id"),a=new EV(r,o),s=ir(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=r3t[d.localName];p?p(a,d,c):console.log(`Unknown KML Tour playlist entry type ${d.localName}`)}}}e._kmlTours.push(a)}function Bre(e,t){pt(`KML Tour unsupported node ${t.localName}`)}function a3t(e,t){let n=Ti(t,"duration",Ue.gx);e.addPlaylistEntry(new wV(n))}function s3t(e,t,n){let i=Ti(t,"duration",Ue.gx),r=kn(t,"flyToMode",Ue.gx),o={kml:{}};$Me(t,o,n),KMe(t,o,n);let a=o.kml.lookAt||o.kml.camera,s=new SV(i,r,a);e.addPlaylistEntry(s)}function KMe(e,t,n){let i=ir(e,"Camera",Ue.kml);if(l(i)){let r=Ti(i,"longitude",Ue.kml)??0,o=Ti(i,"latitude",Ue.kml)??0,a=Ti(i,"altitude",Ue.kml)??0,s=Ti(i,"heading",Ue.kml)??0,c=Ti(i,"tilt",Ue.kml)??0,u=Ti(i,"roll",Ue.kml)??0,f=h.fromDegrees(r,o,a,n),d=Tc.fromDegrees(s,c-90,u);t.kml.camera=new kU(f,d)}}function $Me(e,t,n){let i=ir(e,"LookAt",Ue.kml);if(l(i)){let r=Ti(i,"longitude",Ue.kml)??0,o=Ti(i,"latitude",Ue.kml)??0,a=Ti(i,"altitude",Ue.kml)??0,s=Ti(i,"heading",Ue.kml),c=Ti(i,"tilt",Ue.kml),u=Ti(i,"range",Ue.kml)??0;c=D.toRadians(c??0),s=D.toRadians(s??0);let f=new Rd(s,c-D.PI_OVER_TWO,u),d=h.fromDegrees(r,o,a,n);t.kml.lookAt=new vV(d,f)}}function c3t(e,t,n,i){let r=n.screenOverlayContainer;if(!l(r))return;let o=n.sourceResource,a=n.uriResolver,s=ir(t,"Icon",Ue.kml),c=Kre(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=ir(t,"screenXY",Ue.kml),p=ir(t,"overlayXY",Ue.kml),g=ir(t,"size",Ue.kml),m,y,A,b,x,T;l(g)&&(m=fb(g,"x"),y=fb(g,"y"),A=Ss(g,"xunits"),b=Ss(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=fb(p,"x"),y=fb(p,"y"),A=Ss(p,"xunits"),b=Ss(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=fb(d,"x"),y=fb(d,"y"),A=Ss(d,"xunits"),b=Ss(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 l3t(e,t,n,i){let o=G9(e,t,n).entity,a,s=!1,c=e._ellipsoid,u=z9(ir(t,"LatLonQuad",Ue.gx),c),f=Ti(t,"drawOrder",Ue.kml);if(l(u))a=Xre(),a.hierarchy=new Rc(u),a.zIndex=f,o.polygon=a,s=!0;else{a=new om,a.zIndex=f,o.rectangle=a;let m=ir(t,"LatLonBox",Ue.kml);if(l(m)){let y=Ti(m,"west",Ue.kml),A=Ti(m,"south",Ue.kml),b=Ti(m,"east",Ue.kml),x=Ti(m,"north",Ue.kml);l(y)&&(y=D.negativePiToPi(D.toRadians(y))),l(A)&&(A=D.clampToLatitudeRange(D.toRadians(A))),l(b)&&(b=D.negativePiToPi(D.toRadians(b))),l(x)&&(x=D.clampToLatitudeRange(D.toRadians(x))),a.coordinates=new ie(y,A,b,x);let T=Ti(m,"rotation",Ue.kml);if(l(T)){let C=D.toRadians(T);a.rotation=C,a.stRotation=C}}}let d=ir(t,"Icon",Ue.kml),p=Kre(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=Ti(d,"x",Ue.gx),y=Ti(d,"y",Ue.gx),A=Ti(d,"w",Ue.gx),b=Ti(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=$C(t,"color",Ue.kml),a.material.transparent=!0}else a.material=$C(t,"color",Ue.kml);let g=kn(t,"altitudeMode",Ue.kml);l(g)?g==="absolute"?(a.height=Ti(t,"altitude",Ue.kml),a.zIndex=void 0):g!=="clampToGround"&&pt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${g}`):(g=kn(t,"altitudeMode",Ue.gx),g==="relativeToSeaFloor"?(pt("kml-altitudeMode-relativeToSeaFloor","KML - altitudeMode relativeToSeaFloor is currently not supported, treating as absolute."),a.height=Ti(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 JMe(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 db={INTERVAL:0,EXPIRE:1,STOP:2};function V9(e){if(!l(e)||e.length===0)return"";let t=e[0];return(t==="&"||t==="?")&&(e=e.substring(1)),e}var u3t=new ie,jI=new de,kre=new z,f3t=new h;function Jre(e,t,n,i,r,o){function a(u){return u<-D.PI_OVER_TWO?-D.PI_OVER_TWO:u>D.PI_OVER_TWO?D.PI_OVER_TWO:u}function s(u){return u>D.PI?u-D.TWO_PI:u<-D.PI?u+D.TWO_PI:u}let c=Cb(e.queryParameters);if(c=c.replace(/%5B/g,"[").replace(/%5D/g,"]"),l(t)&&t._mode!==re.MORPHING){let u,f;if(r=r??u3t,l(n)&&(kre.x=n.clientWidth*.5,kre.y=n.clientHeight*.5,u=t.pickEllipsoid(kre,o,f3t)),l(u)?f=o.cartesianToCartographic(u,jI):(f=ie.center(r,jI),u=o.cartographicToCartesian(f)),l(i)&&!D.equalsEpsilon(i,1,D.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]",D.toDegrees(r.west).toString()),c=c.replace("[bboxSouth]",D.toDegrees(r.south).toString()),c=c.replace("[bboxEast]",D.toDegrees(r.east).toString()),c=c.replace("[bboxNorth]",D.toDegrees(r.north).toString());let d=D.toDegrees(f.longitude).toString(),p=D.toDegrees(f.latitude).toString();c=c.replace("[lookatLon]",d),c=c.replace("[lookatLat]",p),c=c.replace("[lookatTilt]",D.toDegrees(t.pitch).toString()),c=c.replace("[lookatHeading]",D.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,jI),c=c.replace("[cameraLon]",D.toDegrees(jI.longitude).toString()),c=c.replace("[cameraLat]",D.toDegrees(jI.latitude).toString()),c=c.replace("[cameraAlt]",D.toDegrees(jI.height).toString());let g=t.frustum,m=g.aspectRatio,y="",A="";if(l(m)){let b=D.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(sf(c))}function d3t(e,t,n,i){let o=G9(e,t,n).entity,a=n.sourceResource,s=n.uriResolver,c=ir(t,"Link",Ue.kml);if(l(c)||(c=ir(t,"Url",Ue.kml)),l(c)){let u=kn(c,"href",Ue.kml),f,d;if(l(u)){let p=u;if(u=Yre(u,a,n.uriResolver),/^data:/.test(u.getUrlComponent()))/\.kmz/i.test(a.getUrlComponent())||(p=a.getDerivedResource({url:p}));else{if(p=u.clone(),f=kn(c,"viewRefreshMode",Ue.kml),f==="onRegion"){pt("kml-refrehMode-onRegion","KML - Unsupported viewRefreshMode: onRegion");return}d=kn(c,"viewBoundScale",Ue.kml)??1;let A=f==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",b=kn(c,"viewFormat",Ue.kml)??A,x=kn(c,"httpQuery",Ue.kml);l(b)&&u.setQueryParameters(sf(V9(b))),l(x)&&u.setQueryParameters(sf(V9(x)));let T=e._ellipsoid;Jre(u,e.camera,e.canvas,d,e._lastCameraView.bbox,T)}let g={sourceUri:p,uriResolver:s,context:o.id,screenOverlayContainer:n.screenOverlayContainer},m=new Fs,y=Hre(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,Zre(w)),b.add(w)}b.resumeEvents();let T=kn(c,"refreshMode",Ue.kml),C=Ti(c,"refreshInterval",Ue.kml)??0;if(T==="onInterval"&&C>0||T==="onExpire"||f==="onStop"){let E=ir(A,"NetworkLinkControl",Ue.kml),w=l(E),P=K.now(),R={id:Kn(),href:u,cookie:{},lastUpdated:P,updating:!1,entity:o,viewBoundScale:d,needsUpdate:!1,cameraUpdateTime:P},O=0;if(w&&(R.cookie=sf(kn(E,"cookie",Ue.kml)??""),O=Ti(E,"minRefreshPeriod",Ue.kml)??0),T==="onInterval")w&&(C=Math.max(O,C)),R.refreshMode=db.INTERVAL,R.time=C;else if(T==="onExpire"){let N;if(w&&(N=kn(E,"expires",Ue.kml)),l(N))try{let _=K.fromIso8601(N),v=K.secondsDifference(_,P);v>0&&v<O&&K.addSeconds(P,O,_),R.refreshMode=db.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=db.STOP,R.time=Ti(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 h3t(e,t,n,i){let r=qre[t.localName];return l(r)?r(e,t,n,i):JMe(e,t,n,i)}function jre(e,t,n,i,r,o,a){t.removeAll();let s=n.documentElement,c=s.localName==="Document"?s:ir(s,"Document",Ue.kml),u=kn(c,"name",Ue.kml);l(u)||(u=xg(i.getUrlComponent())),l(e._name)||(e._name=u);let f=new W_._DeferredLoading(e),d=new Fs(e);return Promise.all(GMe(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(qre[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(),h3t(e,p,g,f),t.resumeEvents(),f.wait().then(function(){return n.documentElement})})}async function m3t(e,t,n,i,r){let o=$t("ThirdParty/Workers/zip-web-worker.js"),a=$t("ThirdParty/zip-module.wasm");x0({workerURI:o,wasmURI:a});let s=new XC(new C0(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(Fre(d,f)),d=g):u.push(Fre(g,f)))}if(l(d)&&u.push(Ukt(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),jre(e,t,f.kml,i,f,r)}function Hre(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=Bn(s)),Promise.resolve(c).then(function(u){return u instanceof Blob?kkt(u).then(function(f){return f?m3t(e,t,u,r,s):zkt(u).then(function(d){d=zMe(d),d=UMe(d);let p,g;try{p=Wre.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 jre(e,t,p,r,o,s,a)})}):jre(e,t,u,r,o,s,a)}).catch(function(u){return e._error.raiseEvent(e,u),console.log(u),Promise.reject(u)})}var W_=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 Fs(this),this._name=void 0,this._isLoading=!1,this._pinBuilder=new hg,this._networkLinks=new kt,this._entityCluster=new Sf,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 St(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,ya.setLoading(this,!0);let i=this._name;this._name=void 0,this._clampToGround=n.clampToGround??!1;let r=this;return Hre(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 jm,o.startTime=s,o.stopTime=c,o.currentTime=K.clone(s),o.clockRange=la.LOOP_STOP,o.clockStep=Lr.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),ya.setLoading(r,!1),r}).catch(function(o){return ya.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;zre.removeAll();function o(d){let p=d._children,g=p.length;for(let m=0;m<g;++m){let y=p[m];zre.set(y.id,y),o(y)}}let a=!1,s=this._lastCameraView,c=this.camera;l(c)&&!(c.positionWC.equalsEpsilon(s.position,D.EPSILON7)&&c.directionWC.equalsEpsilon(s.direction,D.EPSILON7)&&c.upWC.equalsEpsilon(s.up,D.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 kt,f=!1;return n.values.forEach(function(d){let p=d.entity;if(!zre.contains(p.id)){if(!d.updating){let g=!1;if(d.refreshMode===db.INTERVAL?K.secondsDifference(i,d.lastUpdated)>d.time&&(g=!0):d.refreshMode===db.EXPIRE?K.greaterThan(i,d.time)&&(g=!0):d.refreshMode===db.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 Fs,y=d.href.clone();y.setQueryParameters(d.cookie);let A=r._ellipsoid??te.default;Jre(y,r.camera,r.canvas,d.viewBoundScale,s.bbox,A),Hre(r,m,y,{context:p.id}).then(p3t(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 Zre(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 p3t(e,t,n,i,r){return function(o){if(!i.contains(t.id))return;let a=!1,s=ir(o,"NetworkLinkControl",Ue.kml),c=l(s),u=0;if(c){if(l(ir(s,"Update",Ue.kml))){pt("kml-networkLinkControl-update","KML - NetworkLinkControl updates aren't supported."),t.updating=!1,i.remove(t.id);return}t.cookie=sf(kn(s,"cookie",Ue.kml)??""),u=Ti(s,"minRefreshPeriod",Ue.kml)??0}let f=K.now(),d=t.refreshMode;if(d===db.INTERVAL)l(s)&&(t.time=Math.max(u,t.time));else if(d===db.EXPIRE){let P;if(l(s)&&(P=kn(s,"expires",Ue.kml)),l(P))try{let R=K.fromIso8601(P),O=K.secondsDifference(R,f);O>0&&O<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(P){g.remove(P);let R=P._children,O=R.length;for(let N=0;N<O;++N)y(R[N])}g.suspendEvents();let A=g.values.slice(),b;for(b=0;b<A.length;++b){let P=A[b];P.parent===p&&(P.parent=void 0,y(P))}for(g.resumeEvents(),g.suspendEvents(),b=0;b<m.length;b++){let P=m[b];l(P.parent)||(P.parent=p,Zre(P)),g.add(P)}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 P=e._clock;(P.startTime!==T||P.stopTime!==C)&&(P.startTime=T,P.stopTime=C,e._changed.raiseEvent(e))}t.updating=!1,t.needsUpdate=!1,e._refresh.raiseEvent(e,r.getUrlComponent(!0))}}var zre=new kt,Gre=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}};W_._DeferredLoading=Ure;W_._getTimestamp=yn;var JC=W_;function DV(){pe.throwInstantiationError()}DV.prototype.update=pe.throwInstantiationError;DV.prototype.getBoundingSphere=pe.throwInstantiationError;DV.prototype.isDestroyed=pe.throwInstantiationError;DV.prototype.destroy=pe.throwInstantiationError;var Qre=DV;var eoe=32,g3t="http://www.opengis.net/kml/2.2",Zm="http://www.google.com/kml/ext/2.2",_3t="http://www.w3.org/2000/xmlns/";function W9(e){this._files={},this._promises=[],this._count=0,this._modelCallback=e}var y3t=/^data:image\/([^,;]+)/;W9.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(y3t);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 A3t(e,t){return function(n){e._files[t]=n}}W9.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(A3t(this,o))}return r};Object.defineProperties(W9.prototype,{promise:{get:function(){return Promise.all(this._promises)}},files:{get:function(){return this._files}}});function q9(e){this._time=e}q9.prototype.get=function(e,t,n){let i;return l(e)&&(i=l(e.getValue)?e.getValue(this._time,n):e),i??t};q9.prototype.getColor=function(e,t){let n=this.get(e,t);if(l(n))return QC(n)};q9.prototype.getMaterialType=function(e){if(l(e))return e.getType(this._time)};function toe(){this._ids={},this._styles={},this._count=0}toe.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};toe.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 eLe(){this._ids={}}eLe.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 noe(e){e=e??H.EMPTY_OBJECT;let t=e.entities,n=e.kmz??!1,i=noe._createState(e),r=t.values.filter(function(u){return!l(u.parent)}),o=i.kmlDoc,a=o.documentElement;a.setAttributeNS(_3t,"xmlns:gx",Zm);let s=o.createElement("Document");a.appendChild(s),nLe(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?b3t(f,c.files):{kml:f,externalFiles:c.files}})}async function b3t(e,t){let n=$t("ThirdParty/Workers/zip-web-worker.js"),i=$t("ThirdParty/zip-module.wasm");x0({workerURI:n,wasmURI:i});let r=new wI("application/vnd.google-earth.kmz"),o=new yV(r);await o.add("doc.kml",new ZU(e));let a=Object.keys(t);return await tLe(o,a,t,0),await o.close(),{kmz:await r.getData()}}async function tLe(e,t,n,i){if(t.length===i)return;let r=t[i];return await e.add(r,new C0(n[r])),tLe(e,t,n,i+1)}noe._createState=function(e){let t=e.entities,n=new toe,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 Tn:K.addSeconds(o.stop,-10*a,o.start):o.stop===Qe.MAXIMUM_VALUE&&K.addSeconds(o.start,10*a,o.stop);let s=new W9(e.modelCallback);return{kmlDoc:document.implementation.createDocument(g3t,"kml"),ellipsoid:e.ellipsoid??te.default,idManager:new eLe,styleCache:n,externalFileHandler:s,time:r,valueGetter:new q9(r),sampleDuration:a,defaultAvailability:new ga([o])}};function nLe(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=[],x3t(e,p,u,f),T3t(e,p.polyline,u,f),QMe(e,p.rectangle,u,f,c),QMe(e,p.polygon,u,f,c),S3t(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(Cn(i,"begin",K.toIso8601(m.start))),K.equals(m.stop,Qe.MAXIMUM_VALUE)||g.appendChild(Cn(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(Cn(i,"name",p.name)),x.appendChild(Cn(i,"visibility",p.show)),x.appendChild(Cn(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 P=o.getColor(T.fillColor);l(P)&&(E.appendChild(Cn(i,"color",P)),E.appendChild(Cn(i,"colorMode","normal")));let R=o.get(T.scale);l(R)&&E.appendChild(Cn(i,"scale",R)),f.push(E)}b.appendChild(Cn(i,"name",x)),b.appendChild(Cn(i,"visibility",p.show)),b.appendChild(Cn(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(Cn(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(Cn(i,"name",p.name)),b.appendChild(Cn(i,"visibility",p.show)),b.appendChild(Cn(i,"description",p.description)),t.appendChild(b),nLe(e,b,A)}}}var Qu=new h,hu=new de,Jm=new K;function x3t(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){iLe(e,t,s,n,i);return}a.get(c,void 0,Qu);let u=Cn(r,"coordinates",ZC(Qu,o)),f=r.createElement("Point"),d=r.createElement("altitudeMode");d.appendChild(ev(e,s.heightReference)),f.appendChild(d),f.appendChild(u),n.push(f);let p=s instanceof cl?oLe(e,s):rLe(e,s);i.push(p)}function iLe(e,t,n,i,r){let o=e.kmlDoc,a=e.ellipsoid,s=e.valueGetter,c,u=t.position,f=!0;u instanceof hc?(c=u.intervals,f=!1):c=t.availability??e.defaultAvailability;let d=n instanceof Mg,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 n0?(x=x._value,T.appendChild(ev(e,it.CLAMP_TO_GROUND))):l(n)?T.appendChild(ev(e,n.heightReference)):T.appendChild(ev(e,it.NONE));let C=[],E=[];if(x.isConstant){s.get(x,void 0,Qu);let P=Cn(o,"coordinates",ZC(Qu,a));C.push(K.toIso8601(b.start)),E.push(P),C.push(K.toIso8601(b.stop)),E.push(P)}else if(x instanceof mc)for(m=x._property._times,g=0;g<m.length;++g)C.push(K.toIso8601(m[g])),x.getValueInReferenceFrame(m[g],Ui.FIXED,Qu),E.push(ZC(Qu,a));else if(x instanceof Hf){m=x._times;let P=x._values;for(g=0;g<m.length;++g)C.push(K.toIso8601(m[g])),h.fromArray(P,g*3,Qu),E.push(ZC(Qu,a))}else{let P=e.sampleDuration;b.start.clone(Jm),b.isStartIncluded||K.addSeconds(Jm,P,Jm);let R=b.stop;for(;K.lessThan(Jm,R);)x.getValue(Jm,Qu),C.push(K.toIso8601(Jm)),E.push(ZC(Qu,a)),K.addSeconds(Jm,P,Jm);b.isStopIncluded&&K.equals(Jm,R)&&(x.getValue(Jm,Qu),C.push(K.toIso8601(Jm)),E.push(ZC(Qu,a)))}let w=o.createElementNS(Zm,"Track");w.appendChild(T);for(let P=0;P<C.length;++P){let R=Cn(o,"when",C[P]),O=Cn(o,"coord",E[P],Zm);w.appendChild(R),w.appendChild(O)}d&&w.appendChild(aLe(e,n)),y.push(w)}if(y.length===1)i.push(y[0]);else if(y.length>1){let b=o.createElementNS(Zm,"MultiTrack");for(p=0;p<y.length;++p)b.appendChild(y[p]);i.push(b)}if(l(n)&&!d){let b=n instanceof cl?oLe(e,n):rLe(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(Cn(o,"width",b)),ioe(e,x,T),r.push(T)}}}function rLe(e,t){let n=e.kmlDoc,i=e.valueGetter,r=n.createElement("IconStyle"),o=i.getColor(t.color);l(o)&&(r.appendChild(Cn(n,"color",o)),r.appendChild(Cn(n,"colorMode","normal")));let a=i.get(t.pixelSize);return l(a)&&r.appendChild(Cn(n,"scale",a/eoe)),r}function oLe(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(Cn(n,"href",a));let g=i.get(t.imageSubRegion);l(g)&&(p.appendChild(Cn(n,"x",g.x,Zm)),p.appendChild(Cn(n,"y",g.y,Zm)),p.appendChild(Cn(n,"w",g.width,Zm)),p.appendChild(Cn(n,"h",g.height,Zm))),o.appendChild(p)}let s=i.getColor(t.color);l(s)&&(o.appendChild(Cn(n,"color",s)),o.appendChild(Cn(n,"colorMode","normal")));let c=i.get(t.scale);l(c)&&o.appendChild(Cn(n,"scale",c));let u=i.get(t.pixelOffset);if(l(u)){c=c??1,z.divideByScalar(u,c,u);let p=i.get(t.width,eoe),g=i.get(t.height,eoe),m=i.get(t.horizontalOrigin,Vi.CENTER);m===Vi.CENTER?u.x-=p*.5:m===Vi.RIGHT&&(u.x-=p);let y=i.get(t.verticalOrigin,Gn.CENTER);y===Gn.TOP?u.y+=g:y===Gn.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=D.toDegrees(-f),f===0&&(f=360),o.appendChild(Cn(n,"heading",f))),o}function T3t(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(Cn(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=Cn(r,"coordinates",ZC(p,o));s.appendChild(g);let m=a.get(t.zIndex);u&&l(m)&&s.appendChild(Cn(r,"drawOrder",m,Zm)),n.push(s);let y=r.createElement("LineStyle"),A=a.get(t.width);l(A)&&y.appendChild(Cn(r,"width",A)),ioe(e,t.material,y),i.push(y)}function C3t(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,hu),c.push(`${D.toDegrees(hu.longitude)},${D.toDegrees(hu.latitude)},${o}`);let f=Cn(i,"coordinates",c.join(" ")),d=i.createElement("outerBoundaryIs"),p=i.createElement("LinearRing");return p.appendChild(f),d.appendChild(p),[d]}function ZMe(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,hu),a.push(`${D.toDegrees(hu.longitude)},${D.toDegrees(hu.latitude)},${i?hu.height:n}`);let c=Cn(r,"coordinates",a.join(" ")),u=r.createElement("LinearRing");return u.appendChild(c),u}function v3t(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(ZMe(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(ZMe(e,p[m].positions,o,a)),s.push(y)}}return s}function QMe(e,t,n,i,r){let o=e.kmlDoc,a=e.valueGetter;if(!l(t))return;let s=t instanceof om;if(s&&a.getMaterialType(t.material)==="Image"){E3t(e,t,r);return}let c=o.createElement("Polygon"),u=a.get(t.extrudedHeight,0);u>0&&c.appendChild(Cn(o,"extrude",!0));let f=s?C3t(e,t,u):v3t(e,t,u),d=f.length;for(let A=0;A<d;++A)c.appendChild(f[A]);let p=o.createElement("altitudeMode");p.appendChild(ev(e,t.heightReference)),c.appendChild(p),n.push(c);let g=o.createElement("PolyStyle"),m=a.get(t.fill,!1);m&&g.appendChild(Cn(o,"fill",m)),ioe(e,t.material,g);let y=a.get(t.outline,!1);if(y){g.appendChild(Cn(o,"outline",y));let A=o.createElement("LineStyle"),b=a.get(t.outlineWidth,1);A.appendChild(Cn(o,"width",b));let x=a.getColor(t.outlineColor,U.BLACK);A.appendChild(Cn(o,"color",x)),A.appendChild(Cn(o,"colorMode","normal")),i.push(A)}i.push(g)}function E3t(e,t,n){let i=e.kmlDoc,r=e.valueGetter,o=e.externalFileHandler,a=i.createElement("GroundOverlay"),s=i.createElement("altitudeMode");s.appendChild(ev(e,t.heightReference)),a.appendChild(s);let c=r.get(t.height);l(c)&&a.appendChild(Cn(i,"altitude",c));let u=r.get(t.coordinates),f=i.createElement("LatLonBox");f.appendChild(Cn(i,"north",D.toDegrees(u.north))),f.appendChild(Cn(i,"south",D.toDegrees(u.south))),f.appendChild(Cn(i,"east",D.toDegrees(u.east))),f.appendChild(Cn(i,"west",D.toDegrees(u.west))),a.appendChild(f);let d=r.get(t.material),p=o.texture(d.image),g=i.createElement("Icon");g.appendChild(Cn(i,"href",p)),a.appendChild(g);let m=d.color;l(m)&&a.appendChild(Cn(i,"color",QC(d.color))),n.push(a)}function aLe(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(Cn(n,"x",a)),u.appendChild(Cn(n,"y",a)),u.appendChild(Cn(n,"z",a)),o.appendChild(u)}let s=n.createElement("Link"),c=r.model(t,e.time);return s.appendChild(Cn(n,"href",c)),o.appendChild(s),o}function S3t(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){iLe(e,t,n,i,r);return}let u=aLe(e,n),f=o.createElement("altitudeMode");f.appendChild(ev(e,n.heightReference)),u.appendChild(f),s.get(c,void 0,Qu),de.fromCartesian(Qu,a,hu);let d=o.createElement("Location");d.appendChild(Cn(o,"longitude",D.toDegrees(hu.longitude))),d.appendChild(Cn(o,"latitude",D.toDegrees(hu.latitude))),d.appendChild(Cn(o,"altitude",hu.height)),u.appendChild(d),i.push(u)}function ioe(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=QC(U.WHITE);break;case"Color":case"Grid":case"PolylineGlow":case"PolylineArrow":case"PolylineDash":a=QC(o.color);break;case"PolylineOutline":a=QC(o.color),c=QC(o.outlineColor),u=o.outlineWidth,n.appendChild(Cn(i,"outerColor",c,Zm)),n.appendChild(Cn(i,"outerWidth",u,Zm));break;case"Stripe":a=QC(o.oddColor);break}l(a)&&(n.appendChild(Cn(i,"color",a)),n.appendChild(Cn(i,"colorMode","normal")))}function ev(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 ZC(e,t){Array.isArray(e)||(e=[e]);let n=e.length,i=[];for(let r=0;r<n;++r)de.fromCartesian(e[r],t,hu),i.push(`${D.toDegrees(hu.longitude)},${D.toDegrees(hu.latitude)},${hu.height}`);return i.join(" ")}function Cn(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 QC(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 roe=noe;var RV=`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 OV=`#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 MV=`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 LV=`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 NV=`
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 w3t=new h(1,1,1);function ooe(e){e=e??w3t,this._dimensions=h.clone(e)}Object.defineProperties(ooe.prototype,{dimensions:{get:function(){return this._dimensions},set:function(e){h.clone(e,this._dimensions)}}});var I3t=new h;ooe.prototype.emit=function(e){let t=this._dimensions,n=h.multiplyByScalar(t,.5,I3t),i=D.randomBetween(-n.x,n.x),r=D.randomBetween(-n.y,n.y),o=D.randomBetween(-n.z,n.z);e.position=h.fromElements(i,r,o,e.position),e.velocity=h.normalize(e.position,e.velocity)};var aoe=ooe;var soe=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()}},coe=soe;function FV(e){e=e??H.EMPTY_OBJECT,this._maximumSubtreeCount=e.maximumSubtreeCount??0,this._subtreeRequestCounter=0,this._queue=new V0({comparator:FV.comparator})}FV.prototype.addSubtree=function(e){let t=new P3t(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()};FV.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}};FV.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 P3t(e,t){this.subtree=e,this.stamp=t}var BV=FV;function kV(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=L.IDENTITY.clone(),shapeTransform:f=L.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===_c.ELLIPSOID?m0.Z_UP:m0.Y_UP,this._minimumValues=g,this._maximumValues=m,this._maximumTileCount=y,this._availableLevels=void 0,this._implicitTileset=void 0,this._subtreeCache=new BV}Object.defineProperties(kV.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}}});kV.fromUrl=async function(e){let t=De.createIfNeeded(e),n=await t.fetchJson();R3t(n);let i=k3t(n,t);await i.load();let{root:r}=n,o=$i(n,"3DTILES_metadata")?n.extensions["3DTILES_metadata"]:n,a=new XT({metadataJson:o,schema:i.schema}),s=r.content.extensions["3DTILES_content_voxels"],c=s.class,u=z3t(a,c);Object.assign(u,O3t(r)),l(r.transform)?u.globalTransform=L.unpack(r.transform):u.globalTransform=L.clone(L.IDENTITY),u.dimensions=h.unpack(s.dimensions),u.maximumTileCount=D3t(a),l(s.padding)&&(u.paddingBefore=h.unpack(s.padding.before),u.paddingAfter=h.unpack(s.padding.after));let f=new kV(u),d=new Cp(t,r,i.schema);return f._implicitTileset=d,f._availableLevels=d.availableLevels,Mi.unload(i),f};function D3t(e){if(l(e.tileset))return e.tileset.getPropertyBySemantic(Cd.TILESET_TILE_COUNT)}function R3t(e){let t=e.root;if(!l(t.content))throw new oe("Root must have content");if(!$i(t.content,"3DTILES_content_voxels"))throw new oe("Root tile content must have 3DTILES_content_voxels extension");if(!$i(t,"3DTILES_implicit_tiling")&&!l(t.implicitTiling))throw new oe("Root tile must have implicit tiling");if(!l(e.schema)&&!l(e.schemaUri)&&!$i(e,"3DTILES_metadata"))throw new oe("Tileset must have a metadata schema")}function O3t(e){let t=e.boundingVolume;if(l(t.box))return F3t(t.box);if(l(t.region))return M3t(t.region);if($i(t,"3DTILES_bounding_volume_cylinder"))return B3t(t.extensions["3DTILES_bounding_volume_cylinder"]);throw new oe("Only box, region and 3DTILES_bounding_volume_cylinder are supported in Cesium3DTilesVoxelProvider")}function M3t(e){let t=e[0],n=e[1],i=e[2],r=e[3],o=e[4],a=e[5],s=L.fromScale(te.WGS84.radii),c=new h(t,n,o),u=new h(i,r,a);return{shape:_c.ELLIPSOID,minBounds:c,maxBounds:u,shapeTransform:s}}var L3t=new h,N3t=new $;function F3t(e){let t=Jt.unpack(e),n=$.getScale(t.halfAxes,L3t),i=$.getRotation(t.halfAxes,N3t);return{shape:_c.BOX,minBounds:h.negate(n,new h),maxBounds:h.clone(n),shapeTransform:L.fromRotationTranslation(i,t.center)}}function B3t(e){let{minRadius:t,maxRadius:n,height:i,minAngle:r=-D.PI,maxAngle:o=D.PI,translation:a=[0,0,0],rotation:s=[0,0,0,1]}=e,c=-.5*i+a[2],u=.5*i+a[2],f=L.fromTranslationQuaternionRotationScale(h.unpack(a),Fe.unpack(s),h.ONE);return{shape:_c.CYLINDER,minBounds:h.fromElements(t,r,c),maxBounds:h.fromElements(n,o,u),shapeTransform:f}}function k3t(e,t){let{schemaUri:n,schema:i}=e;return l(n)?Mi.getSchemaLoader({resource:t.getDerivedResource({url:n})}):Mi.getSchemaLoader({schema:i})}function z3t(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=sLe(b,T),E=sLe(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 sLe(e,t){if(!l(e))return;let n=Array.isArray(e)?e:[e];return Array.from({length:t},(i,r)=>n[r])}async function U3t(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=d_(s);return r=await $0.fromSubtreeJson(a,c.jsonPayload,c.binaryPayload,n,t),i.addSubtree(r),r}kV.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 Tp({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 U3t(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 EC.fromGltf(b)};var loe=kV;function uoe(e){e=e??1,this._radius=e??1}Object.defineProperties(uoe.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});uoe.prototype.emit=function(e){let t=D.randomBetween(0,D.TWO_PI),n=D.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 zV=uoe;var Y9={CUMULUS:0};Y9.validate=function(e){return e===Y9.CUMULUS};Object.freeze(Y9);var HI=Y9;function Qm(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 z(this._maximumSize.x,this._maximumSize.y);else{this._scale=z.clone(e.scale??new z(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 V3t=Qm.SHOW_INDEX=0,j3t=Qm.POSITION_INDEX=1,H3t=Qm.SCALE_INDEX=2,G3t=Qm.MAXIMUM_SIZE_INDEX=3,W3t=Qm.SLICE_INDEX=4,q3t=Qm.BRIGHTNESS_INDEX=5,Y3t=Qm.COLOR_INDEX=6;Qm.NUMBER_OF_PROPERTIES=7;function tv(e,t){let n=e._cloudCollection;l(n)&&(n._updateCloud(e,t),e._dirty=!0)}Object.defineProperties(Qm.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,tv(this,V3t))}},position:{get:function(){return this._position},set:function(e){let t=this._position;h.equals(t,e)||(h.clone(e,t),tv(this,j3t))}},scale:{get:function(){return this._scale},set:function(e){let t=this._scale;z.equals(t,e)||(z.clone(e,t),tv(this,H3t))}},maximumSize:{get:function(){return this._maximumSize},set:function(e){let t=this._maximumSize;h.equals(t,e)||(h.clone(e,t),tv(this,G3t))}},color:{get:function(){return this._color},set:function(e){let t=this._color;U.equals(t,e)||(U.clone(e,t),tv(this,Y3t))}},slice:{get:function(){return this._slice},set:function(e){this._slice!==e&&(this._slice=e,tv(this,W3t))}},brightness:{get:function(){return this._brightness},set:function(e){this._brightness!==e&&(this._brightness=e,tv(this,q3t))}}});Qm.prototype._destroy=function(){this._cloudCollection=void 0};var od=Qm;var ad,X9=new h,X3t={positionHighAndScaleX:0,positionLowAndScaleY:1,packedAttribute0:2,packedAttribute1:3,color:4},K3t={direction:0,positionHighAndScaleX:1,positionLowAndScaleY:2,packedAttribute0:3,packedAttribute1:4,color:5},$3t=od.SHOW_INDEX,J3t=od.POSITION_INDEX,Z3t=od.SCALE_INDEX,Q3t=od.MAXIMUM_SIZE_INDEX,ezt=od.SLICE_INDEX,tzt=od.BRIGHTNESS_INDEX,nzt=od.NUMBER_OF_PROPERTIES,izt=od.COLOR_INDEX;function ep(e){e=e??H.EMPTY_OBJECT,this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(nzt),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:cLe(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 cLe(e){return function(){return X9.x=e._textureSliceWidth,X9.y=e._noiseTextureRows,X9.z=1/e._noiseTextureRows,X9}}Object.defineProperties(ep.prototype,{length:{get:function(){return doe(this),this._clouds.length}}});function lLe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}ep.prototype.add=function(e){e=e??H.EMPTY_OBJECT;let t=e.cloudType??HI.CUMULUS,n;return t===HI.CUMULUS&&(n=new od(e,this),n._index=this._clouds.length,this._clouds.push(n),this._createVertexArray=!0),n};ep.prototype.remove=function(e){return this.contains(e)?(this._clouds[e._index]=void 0,this._cloudsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};ep.prototype.removeAll=function(){lLe(this._clouds),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!0};function doe(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}}ep.prototype._updateCloud=function(e,t){e._dirty||(this._cloudsToUpdate[this._cloudsToUpdateIndex++]=e),++this._propertiesChanged[t]};ep.prototype.contains=function(e){return l(e)&&e._cloudCollection===this};ep.prototype.get=function(e){return doe(this),this._clouds[e]};var rzt=new Float32Array([-1,-1,1,-1,1,1,-1,1]),ozt=new Uint16Array([0,1,2,0,2,3]);function azt(e){let t=Ze.createVertexBuffer({context:e,typedArray:rzt,usage:Oe.STATIC_DRAW}),n=Ze.createIndexBuffer({context:e,typedArray:ozt,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 hoe;function szt(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 czt(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 lzt(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 uzt(e,t,n){let i=[{index:ad.positionHighAndScaleX,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:Oe.STATIC_DRAW},{index:ad.positionLowAndScaleY,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:Oe.STATIC_DRAW},{index:ad.packedAttribute0,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:Oe.STATIC_DRAW},{index:ad.packedAttribute1,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:Oe.STATIC_DRAW},{index:ad.color,componentsPerAttribute:4,componentDatatype:Y.UNSIGNED_BYTE,normalize:!0,usage:Oe.STATIC_DRAW}];n&&i.push({index:ad.direction,componentsPerAttribute:2,componentDatatype:Y.FLOAT,vertexBuffer:lzt(e)});let r=n?t:4*t;return new vg(e,i,r,n)}var foe=new vn;function uLe(e,t,n,i){let r,o=n[ad.positionHighAndScaleX],a=n[ad.positionLowAndScaleY],s=i.position;vn.fromCartesian(s,foe);let c=i.scale,u=foe.high,f=foe.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 fLe(e,t,n,i){let r,o=n[ad.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 dLe(e,t,n,i){let r,o=n[ad.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 hLe(e,t,n,i){let r,o=n[ad.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 fzt(e,t,n,i){uLe(e,t,n,i),fLe(e,t,n,i),dLe(e,t,n,i),hLe(e,t,n,i)}function dzt(e,t,n,i){let r=e,o=r._textureSliceWidth,a=r._noiseTextureRows,s=t.context;r._vaNoise=azt(s),r._spNoise=Zt.fromCache({context:s,vertexShaderSource:n,fragmentShaderSource:i,attributeLocations:{position:0}});let c=r.noiseDetail,u=r.noiseOffset;r._noiseTexture=new Ct({context:s,width:o*o/a,height:o*a,pixelDatatype:ke.UNSIGNED_BYTE,pixelFormat:He.RGBA,sampler:new zt({wrapS:rn.REPEAT,wrapT:rn.REPEAT,minificationFilter:Gt.NEAREST,magnificationFilter:ei.NEAREST})});let f=new Vl({vertexArray:r._vaNoise,shaderProgram:r._spNoise,outputTexture:r._noiseTexture,uniformMap:{u_noiseTextureDimensions:cLe(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 hzt(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=uzt(i,o,n._instanced);let a=n._vaf.writers,s;for(s=0;s<o;++s){let c=r[s];fzt(e,t,a,c)}n._vaf.commit(hoe(i))}}var mzt=[];function pzt(e,t){let n=t.context,i=e,o=i._clouds.length,a=i._cloudsToUpdate,s=i._cloudsToUpdateIndex,c=i._propertiesChanged,u=mzt;u.length=0,(c[J3t]||c[Z3t])&&u.push(uLe),(c[$3t]||c[tzt])&&u.push(fLe),(c[Q3t]||c[ezt])&&u.push(dLe),c[izt]&&u.push(hLe);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(hoe(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 gzt(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:ad}),o._rs=je.fromCache({depthTest:{enabled:!0,func:ee.LESS},depthMask:!1,blending:Qt.ALPHA_BLEND}),o._spCreated=!0,o._compiledDebugBillboards=o.debugBillboards,o._compiledDebugEllipsoids=o.debugEllipsoids}function _zt(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)}}}ep.prototype.update=function(e){if(doe(this),!this.show)return;let t=this.debugBillboards||this.debugEllipsoids;this._ready=t?!0:l(this._noiseTexture),!this._ready&&!this._loading&&!t&&dzt(this,e,LV,MV),this._instanced=e.context.instancedArrays,ad=this._instanced?K3t:X3t,hoe=this._instanced?czt:szt;let i=this._clouds.length,r=this._cloudsToUpdate,o=this._cloudsToUpdateIndex;this._createVertexArray?hzt(this,e):o>0&&pzt(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)&&gzt(this,e,OV,RV),_zt(this,e))};ep.prototype.isDestroyed=function(){return!1};ep.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(),lLe(this._clouds),ue(this)};var moe=ep;var yzt=D.toRadians(30);function poe(e){this._angle=e??yzt}Object.defineProperties(poe.prototype,{angle:{get:function(){return this._angle},set:function(e){this._angle=e}}});poe.prototype.emit=function(e){let t=Math.tan(this._angle),n=D.randomBetween(0,D.TWO_PI),i=D.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 goe=poe;function UV(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=Cr.getDefaultRenderState(!1,!1,e.renderState),this._closed=e.closed??!1,this._attributeName=t,this._glslDatatype=i}Object.defineProperties(UV.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}}});UV.prototype.getFragmentShaderSource=Cr.prototype.getFragmentShaderSource;UV.prototype.isTranslucent=Cr.prototype.isTranslucent;UV.prototype.getRenderState=Cr.prototype.getRenderState;var _oe=UV;function K9(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=L.clone(e.modelMatrix??L.IDENTITY),this._modelMatrix=new L,this.id=e.id,this._id=void 0,this._primitive=void 0}K9.prototype.update=function(e){if(this.show){if(!l(this._primitive)||!L.equals(this._modelMatrix,this.modelMatrix)||this._length!==this.length||this._width!==this.width||this._id!==this.id){this._modelMatrix=L.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 Nt({geometry:new pg({positions:[h.ZERO,h.UNIT_X],width:this.width,vertexFormat:Ma.VERTEX_FORMAT,colors:[U.RED,U.RED],arcType:sn.NONE}),modelMatrix:L.multiplyByUniformScale(this.modelMatrix,this.length,new L),id:this.id,pickPrimitive:this}),n=new Nt({geometry:new pg({positions:[h.ZERO,h.UNIT_Y],width:this.width,vertexFormat:Ma.VERTEX_FORMAT,colors:[U.GREEN,U.GREEN],arcType:sn.NONE}),modelMatrix:L.multiplyByUniformScale(this.modelMatrix,this.length,new L),id:this.id,pickPrimitive:this}),i=new Nt({geometry:new pg({positions:[h.ZERO,h.UNIT_Z],width:this.width,vertexFormat:Ma.VERTEX_FORMAT,colors:[U.BLUE,U.BLUE],arcType:sn.NONE}),modelMatrix:L.multiplyByUniformScale(this.modelMatrix,this.length,new L),id:this.id,pickPrimitive:this});this._primitive=new Nn({geometryInstances:[t,n,i],appearance:new Ma,asynchronous:!1})}this._primitive.update(e)}};K9.prototype.isDestroyed=function(){return!1};K9.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};var VV=K9;function Azt(e){this.direction=h.clone(e.direction),this.color=U.clone(e.color??U.WHITE),this.intensity=e.intensity??1}var yoe=Azt;var jV=`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 HV=`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 nv(e){e=e??H.EMPTY_OBJECT;let t=e.translucent??!0,n=e.aboveGround??!1;this.material=l(e.material)?e.material:tr.fromType(tr.ColorType),this.translucent=e.translucent??!0,this._vertexShaderSource=e.vertexShaderSource??HV,this._fragmentShaderSource=e.fragmentShaderSource??jV,this._renderState=Cr.getDefaultRenderState(t,!n,e.renderState),this._closed=!1,this._flat=e.flat??!1,this._faceForward=e.faceForward??n,this._aboveGround=n}Object.defineProperties(nv.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 nv.VERTEX_FORMAT}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}},aboveGround:{get:function(){return this._aboveGround}}});nv.VERTEX_FORMAT=Be.POSITION_AND_ST;nv.prototype.getFragmentShaderSource=Cr.prototype.getFragmentShaderSource;nv.prototype.isTranslucent=Cr.prototype.isTranslucent;nv.prototype.getRenderState=Cr.prototype.getRenderState;var Aoe=nv;var bzt=1e5;function GV(e){e=e??H.EMPTY_OBJECT;let t=e.credit;typeof t=="string"&&(t=new St(t)),this._credit=t,this._radius=l(e.radius)?e.radius:bzt,this._image=e.image,this._transform=l(e.transform)?e.transform:L.IDENTITY,this._repeatHorizontal=l(e.repeatHorizontal)?e.repeatHorizontal:1,this._repeatVertical=l(e.repeatVertical)?e.repeatVertical:1;let n=new w1({radius:this._radius,vertexFormat:Be.ALL}),i=new Nt({geometry:n,modelMatrix:this._transform}),r=new tr({fabric:{type:"Image",uniforms:{image:this._image,repeat:new z(-this._repeatHorizontal,this._repeatVertical)}}});return this._primitive=new Nn({geometryInstances:i,appearance:new yr({material:r,closed:!0,faceForward:!1,flat:!0,translucent:!1,renderState:{cull:{enabled:!1}}}),credit:this._credit}),this}Object.defineProperties(GV.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)}}});GV.prototype.update=function(e){return l(this._credit)&&e.creditDisplay.addCreditToNextFrame(this._credit),this._primitive.update(e)};GV.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};GV.prototype.isDestroyed=function(){return this._primitive.isDestroyed()};var boe=GV;function ef(e){this._scene=e.scene,this.samplingWindow=e.samplingWindow??ef.defaultSettings.samplingWindow,this.quietPeriod=e.quietPeriod??ef.defaultSettings.quietPeriod,this.warmupPeriod=e.warmupPeriod??ef.defaultSettings.warmupPeriod,this.minimumFrameRateDuringWarmup=e.minimumFrameRateDuringWarmup??ef.defaultSettings.minimumFrameRateDuringWarmup,this.minimumFrameRateAfterWarmup=e.minimumFrameRateAfterWarmup??ef.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){xzt(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(){Tzt(t)}this._visibilityChangeRemoveListener=void 0,l(n)&&(document.addEventListener(n,i,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(n,i,!1)})}ef.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8};ef.fromScene=function(e){return(!l(e._frameRateMonitor)||e._frameRateMonitor.isDestroyed())&&(e._frameRateMonitor=new ef({scene:e})),e._frameRateMonitor};Object.defineProperties(ef.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}}});ef.prototype.pause=function(){++this._pauseCount,this._pauseCount===1&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)};ef.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)};ef.prototype.isDestroyed=function(){return!1};ef.prototype.destroy=function(){return this._preUpdateRemoveListener(),l(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),ue(this)};function xzt(e,t){if(e._pauseCount>0)return;let n=yn();if(e._needsQuietPeriod)e._needsQuietPeriod=!1,e._frameTimes.length=0,e._quietPeriodEndTime=n+e.quietPeriod/zn.SECONDS_PER_MILLISECOND,e._warmupPeriodEndTime=e._quietPeriodEndTime+(e.warmupPeriod+e.samplingWindow)/zn.SECONDS_PER_MILLISECOND;else if(n>=e._quietPeriodEndTime){e._frameTimes.push(n);let i=n-e.samplingWindow/zn.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 Tzt(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}var WV=ef;var Toe=class e{constructor(t){t=t??H.EMPTY_OBJECT;let n=Czt(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 Gu(d)}if(n.polylineCount>0){let d={primitiveCountMax:n.polylineCount,vertexCountMax:n.polylineVertexCount,allowPicking:i};this._polylines=new ol(d)}if(n.polygonCount>0){let d={primitiveCountMax:n.polygonCount,vertexCountMax:n.polygonVertexCount,holeCountMax:n.polygonHoleCount,triangleCountMax:n.polygonTriangleCount,allowPicking:i};this._polygons=new il(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:ALe(p.points[y],r,s),pickObject:i?xoe(this,A,this._points,Bc,m):void 0})}for(let y=0;y<p.polylines.length;y++){let A=u++;this._polylines.add({featureId:g,positions:mLe(p.polylines[y],r,a),pickObject:i?xoe(this,A,this._polylines,ms,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:mLe(A.positions,r,a),holes:A.holes,triangles:A.triangles,pickObject:i?xoe(this,b,this._polygons,Ko,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 xoe(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 Czt(e){let t=vzt(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(pLe(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(Nzt(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 vzt(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(Mzt(e.type))return[{type:"Feature",geometry:e,properties:H.EMPTY_OBJECT,id:void 0}];throw new oe(`Unsupported GeoJSON type: ${e.type}`)}}function pLe(e,t){if(!(!l(e)||!l(e.type)))switch(e.type){case"Point":gLe(e.coordinates,t.points);return;case"MultiPoint":Szt(e.coordinates,t.points);return;case"LineString":_Le(e.coordinates,t.polylines);return;case"MultiLineString":wzt(e.coordinates,t.polylines);return;case"Polygon":yLe(e.coordinates,t.polygons);return;case"MultiPolygon":Izt(e.coordinates,t.polygons);return;case"GeometryCollection":Ezt(e.geometries,t);return;default:return}}function Ezt(e,t){if(Array.isArray(e))for(let n=0;n<e.length;n++)pLe(e[n],t)}function gLe(e,t){let n=Coe(e);l(n)&&t.push(n)}function Szt(e,t){for(let n=0;n<e.length;n++)gLe(e[n],t)}function _Le(e,t){let n=Pzt(e);l(n)&&n.length>=2&&t.push(n)}function wzt(e,t){for(let n=0;n<e.length;n++)_Le(e[n],t)}function yLe(e,t){let n=Dzt(e);l(n)&&t.push(n)}function Izt(e,t){for(let n=0;n<e.length;n++)yLe(e[n],t)}function Pzt(e){if(!Array.isArray(e))return;let t=[];for(let n=0;n<e.length;n++){let i=Coe(e[n]);l(i)&&t.push(i)}return t.length>=2?t:void 0}function Dzt(e){if(!Array.isArray(e)||e.length===0)return;let t=[];for(let s=0;s<e.length;s++){let c=Rzt(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 z(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 Rzt(e){if(!Array.isArray(e))return;let t=[];for(let n=0;n<e.length;n++){let i=Coe(e[n]);l(i)&&t.push(i)}if(!(t.length<3))return t.length>1&&Ozt(t[0],t[t.length-1])&&t.pop(),t.length>=3?t:void 0}function Coe(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 Ozt(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function Mzt(e){return e==="Point"||e==="MultiPoint"||e==="LineString"||e==="MultiLineString"||e==="Polygon"||e==="MultiPolygon"||e==="GeometryCollection"}function ALe(e,t,n){return h.fromDegrees(e[0],e[1],e[2]??0,t,n)}var Lzt=new h;function mLe(e,t,n){let i=e.length*3,r=n(i);for(let o=0;o<e.length;o++){let a=ALe(e[o],t,Lzt);r[o*3]=a.x,r[o*3+1]=a.y,r[o*3+2]=a.z}return r.subarray(0,i)}function Nzt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var voe=Toe;var bLe=Go(KX(),1);function Eoe(){this._image=new Image}Eoe.prototype.isReady=function(){return!0};Eoe.prototype.shouldDiscardImage=function(e){return e===this._image};function iv(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 Xi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ie(-D.PI,-D.PI,D.PI,D.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new St(t)),this._credit=t,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=23,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new Eoe),this._errorEvent=new be}Object.defineProperties(iv.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}}});iv.fromMetadata=function(e,t){if(!e.imageryPresent)throw new oe(`The server ${e.url} doesn't have imagery`);let n=new iv(t);return n._metadata=e,n};iv.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]}};iv.prototype.requestImage=function(e,t,n,i){let r=this._tileDiscardPolicy._image,o=this._metadata,a=ug.tileXYToQuadKey(e,t,n),s=o.getTileInformation(e,t,n);if(!l(s)){if(o.isValid(a)){let u=new bo({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=Fzt(this,s,e,t,n,i).fetchArrayBuffer();if(l(c))return c.then(function(u){NM(o.key,u);let f=new Uint8Array(u),d,p=o.protoImagery;if((!l(p)||!p)&&(d=Bzt(f)),!l(d)&&(!l(p)||p)){let g=kzt(f);d=g.imageType,f=g.imageData}return!l(d)||!l(f)?r:W0({uint8Array:f,format:d,flipY:!0})})};iv.prototype.pickFeatures=function(e,t,n,i,r){};function Fzt(e,t,n,i,r,o){let a=ug.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 Bzt(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 kzt(e){let t=bLe.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 Soe=iv;var zzt=600;function S0(e){e=e??H.EMPTY_OBJECT,this._key=l(e.key)?e.key:ds.defaultApiKey,this._baseResource=De.createIfNeeded(e.url??ds.streetViewStaticApiEndpoint),this._metadataResource=this._baseResource.getDerivedResource({url:"streetview/metadata"}),this._tileSize=e.tileSize??zzt}Object.defineProperties(S0.prototype,{});S0.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=ds.getDefaultCredit(),s=h.fromDegrees(D.toDegrees(t.longitude),D.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=L.getMatrix3(y(s,te.default),new $);return new DC({sources:{positiveX:u,negativeX:f,positiveY:d,negativeY:p,positiveZ:g,negativeZ:m},transform:A,credit:a})};S0.prototype.getNearestPanoId=async function(e,t){let i=[D.toDegrees(e.latitude),D.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}};S0.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};S0.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}`)}};S0.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};S0.fromUrl=async function(e){if(e=e??{},e.key=e.key??ds.defaultStreetViewStaticApiKey??ds.defaultApiKey,!l(e.key)&&!l(ds.defaultStreetViewStaticApiKey)&&!l(ds.defaultApiKey))throw new pe("options.key, GoogleMaps.defaultStreetViewStaticApiKey or GoogleMaps.defaultApiKey is required.");return new S0({...e})};S0._parseMetadata=function(e){return{cartographic:de.fromDegrees(e.location.lng,e.location.lat,0)}};var woe=S0;var Uzt=new U(1,1,1,.4),Vzt=new U(0,1,0,.05),jzt=new U(0,.5,0,.2);function rv(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 Xi({ellipsoid:e.ellipsoid}),this._cells=e.cells??8,this._color=e.color??Uzt,this._glowColor=e.glowColor??Vzt,this._glowWidth=e.glowWidth??6,this._backgroundColor=e.backgroundColor??jzt,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(rv.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}}});rv.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()};rv.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};rv.prototype.getTileCredits=function(e,t,n){};rv.prototype.requestImage=function(e,t,n,i){return Promise.resolve(this._canvas)};rv.prototype.pickFeatures=function(e,t,n,i,r){};var Ioe=rv;function tp(){}tp._maxDecodingConcurrency=Math.max(fn.hardwareConcurrency-1,1);tp._decodeTaskProcessor=new Yn("decodeI3S",tp._maxDecodingConcurrency);tp._promise=void 0;async function Hzt(){if(await tp._decodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}))return tp._decodeTaskProcessor;throw new oe("I3S decoder could not be initialized.")}tp.decode=async function(e,t,n,i,r){return l(tp._promise)||(tp._promise=Hzt()),tp._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(-D.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 qV=tp;function Poe(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(Poe.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}}});Poe.prototype.load=async function(){return this._data=await np.loadJson(this._resource),this._data};var YV=Poe;function q_(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(q_.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 $9(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 Gzt(e){return e==="String"?1:$9(e)}async function Wzt(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)}q_.prototype.load=function(){return l(this._loadPromise)?this._loadPromise:(this._loadPromise=Wzt(this).catch(function(e){console.error(e)}),this._loadPromise)};q_.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}};q_.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};q_.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)}}}};q_.prototype._getBodyOffset=function(e){let t=0;return l(this._storageInfo.attributeValues)?t=$9(this._storageInfo.attributeValues.valueType):l(this._storageInfo.objectIds)&&(t=$9(this._storageInfo.objectIds.valueType)),t>0?Math.ceil(e/t)*t:e};q_.prototype._validateHeader=function(e){let t=0;for(let n=0;n<this._storageInfo.header.length;n++){let i=this._storageInfo.header[n];t+=Gzt(i.valueType)}if(e.byteLength<t)throw new oe(`Invalid attribute buffer size (field: ${this.name}, header: ${t}, actual: ${e.byteLength})`)};q_.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=$9(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 XV=q_;function KV(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(KV.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},customAttributes:{get:function(){return this._customAttributes}}});KV.prototype.load=function(){let e=this;return this._dataProvider._loadBinary(this._resource).then(function(t){return e._data=t,t})};var qzt=new h,Yzt=new h,Xzt=new h,Kzt=new h,$zt=new h;function Doe(e,t,n,i){let r=h.subtract(i,n,qzt),o=h.cross(r,h.subtract(e,n,Yzt),Kzt),a=h.cross(r,h.subtract(t,n,Xzt),$zt);return h.dot(o,a)>=0}var Jzt=new h,Zzt=new h,Qzt=new h,eUt=new h,tUt=new h,nUt=new h,iUt=new h,rUt=new h,oUt=new h,aUt=new h;KV.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],Jzt),b=h.fromElements(u[m*3],u[m*3+1],u[m*3+2],Zzt),x=new h(u[y*3],u[y*3+1],u[y*3+2],Qzt);if(!Doe(i,A,b,x)||!Doe(i,b,A,x)||!Doe(i,x,A,b))continue;let T=h.subtract(b,A,eUt),C=h.subtract(x,A,tUt),E=h.cross(T,C,nUt);if(h.magnitude(E)===0)continue;let w=h.normalize(E,iUt),P=h.subtract(i,A,rUt),R=Math.abs(h.dot(P,w));if(R<r){r=R,o=p;let O=h.magnitudeSquared(h.subtract(i,A,P)),N=h.magnitudeSquared(h.subtract(i,b,oUt)),_=h.magnitudeSquared(h.subtract(i,x,aUt));O<N&&O<_?(s=g,c=A,a=O):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 xLe(e){let t=[],n=e.length;for(let i=0;i<n;i++)i<3?t.push(Ox(e[i])):t.push(e[i]);return t}KV.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 P=0;P<w.formats.length;P++){let R=w.formats[P];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=xLe(c.pbrMetallicRoughness.baseColorFactor)),l(c.emissiveFactor)&&(c.emissiveFactor=xLe(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=Ye(c,!0);y.push(R)}let P=y[w.material];l(w.extra)&&w.extra.isTransparent?l(P.alphaMode)||(P.alphaMode="BLEND"):P.alphaMode==="BLEND"&&(P.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 GI=KV;function Tl(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(Tl.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}}});Tl.prototype.load=async function(){let e=this;function t(){if(!e._isRoot){let r=e._create3DTileDefinition();e._tile=new rh(e._layer._tileset,e._dataProvider.resource,r,e._parent._tile),e._tile._i3sNode=e}}if(!l(this._nodeIndex)){let r=await np.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 TLe(e,t){let n=new XV(e,t);return e._fields[t.name]=n,n.load()}Tl.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(TLe(this,i))}return Promise.all(t)};Tl.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 TLe(this,r)}return Promise.resolve()};Tl.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)};Tl.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};Tl.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 Tl(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};Tl.prototype._loadGeometryData=function(){let e=[];if(l(this._data.geometryData))for(let t=0;t<this._data.geometryData.length;t++){let n=new GI(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 GI(this,n);i._geometryDefinitions=t.definition,i._geometryBufferInfo=t.geometryBufferInfo,this._geometryData.push(i),e.push(i.load())}return Promise.all(e)};Tl.prototype._loadFeatureData=function(){let e=[];if(l(this._data.featureData))for(let t=0;t<this._data.featureData.length;t++){let n=new YV(this,this._data.featureData[t].href);this._featureData.push(n),e.push(n.load())}return Promise.all(e)};Tl.prototype._clearGeometryData=function(){this._geometryData=[]};Tl.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+=uUt(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 Tc(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 L(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=L.inverse(p,new L),m=L.clone(p);l(this._parent._globalTransform)&&L.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}};Tl.prototype._loadSymbology=async function(){!l(this._symbologyData)&&l(this._layer._symbology)&&(this._symbologyData=await this._layer._symbology._getSymbology(this))};Tl.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 qV.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 sUt(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 cUt(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 CLe(e,t){let n=e._tile.content.batchTable;if(l(n)&&n.featuresLength>0){n.setAllShow(!0);let i=await sUt(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(!cUt(r,e._fields[a.name],a)){n.setShow(r,!1);break}}}t.show=!0}Tl.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=CLe(this,t);e.push(n)}return Promise.all(e)};rh.prototype._hookedRequestContent=rh.prototype.requestContent;rh.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(()=>{CLe(e._i3sNode,n)})),e._isLoading=!1,t})}};function lUt(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 J9(e,t,n,i){let r=e+t*n;return i[r]}function uUt(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=J9(a,s,n.width,n.buffer),d=J9(c,s,n.width,n.buffer),p=J9(a,u,n.width,n.buffer),g=J9(c,u,n.width,n.buffer),m=lUt(r,o,f,d,p,g);return m=m*n.scale+n.offset,m}Object.defineProperties(rh.prototype,{i3sNode:{get:function(){return this._i3sNode}}});var WI=Tl;function Z9(e){this._layer=e,this._defaultSymbology=void 0,this._valueFields=[],this._uniqueValueHash=void 0,this._classBreaksHash=void 0,this._parseLayerSymbology()}Object.defineProperties(Z9.prototype,{defaultSymbology:{get:function(){return this._defaultSymbology}}});function Roe(e,t){let n=[];for(let i=0;i<e.length;i++){let r=U.byteToFloat(e[i]);i<3?n.push(Ox(r)):n.push(r)}return n.length===3&&(l(t)?n.push(1-t/100):n.push(1)),n}function qI(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=Roe(o.color,o.transparency))):l(a)&&(n.edges={},l(a.color)&&(n.edges.color=Roe(a.color,a.transparency))),!t){let s=r.material;l(s)&&(n.material={colorMixMode:s.colorMixMode},l(s.color)&&(n.material.color=Roe(s.color,s.transparency)))}break}}return n}function fUt(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=qI(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]=qI(r.symbol,t)}return n}}function dUt(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(qI(o.symbol,t)))}return i.symbols.push(void 0),i}}Z9.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=qI(i.symbol,n):i.type==="uniqueValue"?(this._defaultSymbology=qI(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=fUt(i,n)):i.type==="classBreaks"&&(this._defaultSymbology=qI(i.defaultSymbol,n),this._valueFields.push(i.field),this._classBreaksHash=dUt(i,n))}};function vLe(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?vLe(a,t,n,i):a}}function hUt(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 mUt(e,t,n){let i=t[n],r=hUt(e.ranges,i);return e.symbols[r]}Z9.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=>vLe(this._uniqueValueHash,i,0,o):l(this._classBreaksHash)&&(r=o=>mUt(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 $V=Z9;function tf(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(tf.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}}});tf.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 $V(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()};tf.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)}};tf.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]}}};tf.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 WI(this,t,!0)}else this._rootNode=new WI(this,this._data.store.rootNode,!0);return this._rootNode.load(e)};tf.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]})};tf._fetchJson=function(e){return e.fetchJson()};tf.prototype._loadNodePage=function(e){let t=this;if(!l(this._nodePageFetches[e])){let n=this.resource.getDerivedResource({url:`nodepages/${e}/`}),i=tf._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]};tf.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]))};tf.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)?Ye(e):{},e.outlineColor=U.fromCartesian4(ae.fromArray(r))),this._tileset=await Uo.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()})};tf.prototype._updateVisibility=function(){l(this._tileset)&&(this._tileset.show=this._parent.show)};tf.prototype.filterByAttributes=function(e){this._filters=l(e)?Ye(e,!0):[];let t=this._rootNode;return l(t)?t._filterFeatures():Promise.resolve()};var ov=tf;function Q9(e,t){this._dataProvider=e,this._resource=new De({url:t}),this._resource.setQueryParameters(e.resource.queryParameters),this._resource.appendForwardSlash()}Object.defineProperties(Q9.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}}});Q9.prototype.load=async function(){return this._data=await np.loadJson(this._resource),this._data};Q9.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 JV=Q9;function ZV(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(ZV.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}}});ZV._fromData=async function(e,t,n,i){let r=new ZV(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=ZV._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 np.loadJson(r._resource),c=new ov(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 QV=ZV;var wLe=Go(ELe(),1);function is(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(is.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}}});is.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)};is.prototype.isDestroyed=function(){return!1};is.prototype.update=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.update(e)};is.prototype.prePassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.prePassesUpdate(e)};is.prototype.postPassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.postPassesUpdate(e)};is.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 pUt(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 SLe(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=pUt(e,t.id);if(l(t.sublayers)){let r=[];for(let a=0;a<t.sublayers.length;a++){let s=QV._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 JV(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 ov(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.`)}is.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT;let n=De.createIfNeeded(e);n.setQueryParameters({f:"pjson"},!0);let i=await is.loadJson(n),r=new is(t);if(r._resource=n,r._data=i,l(i.layers)){let a=[];for(let s=0;s<i.layers.length;s++){let c=SLe(r,i.layers[s],t);a.push(c)}await Promise.all(a)}else await SLe(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};is._fetchJson=function(e){return e.fetchJson()};is.loadJson=async function(e){let t=await is._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};is.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};is.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 gUt=new z;function _Ut(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=z.fromElements(d,p,gUt),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 di&&(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===pd.LERC){let x=wLe.default.decode(y._buffer);b.buffer=x.pixels[0]}else b.buffer=y._buffer;p.push(b)}return p})}async function yUt(e){let t=e._geoidTiledTerrainProvider;if(l(t))try{let n=await _Ut(t,e._extent);e._geoidDataList=n}catch{console.log("Error retrieving Geoid Terrain tiles - no geoid conversion will be performed.")}}is.prototype.loadGeoidData=async function(){return l(this._geoidDataPromise)?this._geoidDataPromise:(this._geoidDataPromise=yUt(this),this._geoidDataPromise)};is.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};is.prototype.getAttributeNames=function(){let e=[];for(let t=0;t<this._attributeStatistics.length;++t)e.push(...this._attributeStatistics[t].names);return e};is.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[]};is.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 np=is;var e4={};e4.createTilesetFromIModelId=async function({iModelId:e,changesetId:t,tilesetOptions:n}){let{exports:i}=await Xa.getExports(e,t);if(i.length>0&&i.every(c=>c.status===Xa.ExportStatus.Invalid))throw new oe(`All exports for this iModel are Invalid: ${e}`);let r=i.find(c=>c.status===Xa.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 Uo.fromUrl(s,n)};e4.createTilesetForRealityDataId=async function({iTwinId:e,realityDataId:t,type:n,rootDocument:i,tilesetOptions:r}){if(!l(n)||!l(i)){let c=await Xa.getRealityDataMetadata(e,t);i=c.rootDocument,n=c.type}if(![Xa.RealityDataType.Cesium3DTiles,Xa.RealityDataType.PNTS,Xa.RealityDataType.RealityMesh3DTiles,Xa.RealityDataType.Terrain3DTiles,Xa.RealityDataType.GaussianSplat3DTiles].includes(n))throw new oe(`Reality data type is not a mesh type: ${n}`);let a=await Xa.getRealityDataURL(e,t,i),s={maximumScreenSpaceError:4,...r};return Uo.fromUrl(a,s)};e4.createDataSourceForRealityDataId=async function({iTwinId:e,realityDataId:t,type:n,rootDocument:i}){if(!l(n)||!l(i)){let a=await Xa.getRealityDataMetadata(e,t);i=a.rootDocument,n=a.type}if(![Xa.RealityDataType.KML,Xa.RealityDataType.GeoJSON].includes(n))throw new oe(`Reality data type is not a data source type: ${n}`);let o=await Xa.getRealityDataURL(e,t,i);return n===Xa.RealityDataType.GeoJSON?tb.load(o):JC.load(o)};e4.loadGeospatialFeatures=async function({iTwinId:e,collectionId:t,limit:n}){let i=n??1e4,r=`${Xa.apiEndpoint}geospatial-features/itwins/${e}/ogc/collections/${t}/items`,o=new De({url:r,headers:{Authorization:Xa._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{limit:i,client:"CesiumJS"}});return tb.load(o)};var Ooe=e4;function ILe(){}Object.defineProperties(ILe.prototype,{color:{get:pe.throwInstantiationError},intensity:{get:pe.throwInstantiationError}});var Moe=ILe;var AUt=0,bUt=14,xUt=-1e3,TUt=1e4,CUt=2*Math.PI*te.WGS84.maximumRadius,vUt=256,EUt=new ie,SUt=new ie,Loe=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??AUt,this._maxZoom=n.maxZoom??bUt,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=wUt(this._resource,this._createRuntimeTilesetOptions()),n=new Blob([JSON.stringify(t)],{type:"application/json"}),i=URL.createObjectURL(n);this._tilesetJsonUrl=i;try{this._tileset=await Uo.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 wUt(e,t){let n=new To,i=l(t.extent)?ie.clone(t.extent):ie.clone(n.rectangle),r=PUt(n,i,t.minZoom),o={boundingVolume:{region:RLe(i)},geometricError:DLe(0),refine:"REPLACE",children:[]};for(let a=r.minY;a<=r.maxY;a++)for(let s=r.minX;s<=r.maxX;s++){let c=PLe(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 PLe(e,t,n,i,r,o,a){if(!DUt(e,i,o,a,n,EUt,SUt))return;let s=e.tileXYToRectangle(o,a,i,new ie),c={boundingVolume:{region:RLe(s)},geometricError:i<r?DLe(i):0,refine:"REPLACE",content:{uri:IUt(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=PLe(e,t,n,u,r,p,d);l(g)&&f.push(g)}return f.length>0?c.children=f:c.geometricError=0,c}function IUt(e,t,n,i){let o=e.url.replace(/\{z\}/gi,`${t}`).replace(/\{x\}/gi,`${n}`).replace(/\{y\}/gi,`${i}`);return dd(o)}function DLe(e){return CUt/((1<<e)*vUt)}function RLe(e){return[e.west,e.south,e.east,e.north,xUt,TUt]}function PUt(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:D.clamp(Math.min(a.x,s.x),0,i),maxX:D.clamp(Math.max(a.x,s.x),0,i),minY:D.clamp(Math.min(a.y,s.y),0,i),maxY:D.clamp(Math.max(a.y,s.y),0,i)}}function DUt(e,t,n,i,r,o,a){let s=e.tileXYToRectangle(n,i,t,o);return l(ie.intersection(s,r,a))}var t4=Loe;var Noe=0,OLe=new h,t7=new h,RUt=new To;function OUt(e,t,n){let i=t.tileX,r=t.tileY,o=t.tileZ,a=n?.featureIdProperty,s=RUt.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 k=(4-x%4)%4;k>0&&(b.push(new Uint8Array(k)),x+=k)}function C(k,j){T();let B=x;b.push(new Uint8Array(k.buffer,k.byteOffset,k.byteLength)),x+=k.byteLength;let G=y.length;return y.push({buffer:0,byteOffset:B,byteLength:k.byteLength,target:j}),G}function E(k,j){let B=C(k,j.target),G=gt.getComponentCount(j.type),W={bufferView:B,byteOffset:0,componentType:j.componentType,count:k.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(k){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<k.length;J+=3){let Z=k[J],ce=k[J+1],Ae=k[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 P(k,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});k._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(k,j){j=j??4;let B=(j-x%j)%j;B>0&&(b.push(new Uint8Array(B)),x+=B);let G=x;b.push(k),x+=k.byteLength;let W=y.length;return y.push({buffer:0,byteOffset:G,byteLength:k.byteLength}),W}function O(){if(m.size===0)return;let k=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=k.get(Q);l(ce)?ce!==Z&&k.set(Q,"STRING"):k.set(Q,Z)}if(k.size===0)return;let j={};for(let[W,Q]of k)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 k)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 Xe=q.encode($e);J.push(Xe),ce+=Xe.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 k of e.layers){let j=k.extent,B=[],G=[],W=[],Q=[],q=[],J=0,Z=[],ce=[],Ae=[],le=[],Ce=[],ye=[],ve=[],Ie=0;for(let Xe of k.features){let At=l(a)?LUt(Xe,a,g)??d:MUt(Xe,g);if(At!==d&&!m.has(At)){let Ke=Object.assign({},Xe.properties);Ke._layer=k.name??"",m.set(At,Ke)}if(Xe.type==="Point"){let Ke=Xe.geometry;for(let we of Ke)Foe(we,i,r,o,j,Noe,u,B),G.push(At);continue}if(Xe.type==="LineString"){let Ke=Xe.geometry;for(let we of Ke){let We=W.length/3;for(let vt of we)Foe(vt,i,r,o,j,Noe,u,W),Q.push(At);for(let vt=0;vt<we.length;vt++)q.push(We+vt);q.push(p),J++}continue}if(Xe.type==="Polygon"){let Ke=Xe.geometry,we=NUt(Ke);for(let We of we){let vt=[We.outerRing,...We.holes],ct=[],pn=[],Ht=[],bt=0;for(let dt=0;dt<vt.length;dt++){let Si=vt[dt];dt>0&&Ht.push(bt);for(let wn of Si)ct.push(new z(wn.x,wn.y)),Foe(wn,i,r,o,j,Noe,u,pn),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 Pn=Z.length/3,ot=Ae.length;le.push(Pn),Ce.push(ot),ye.push(Ht.length);for(let dt=0;dt<Ht.length;dt++)ve.push(Pn+Ht[dt]);for(let dt=0;dt<pn.length;dt++)Z.push(pn[dt]);for(let dt=0;dt<pn.length/3;dt++)ce.push(At);for(let dt=0;dt<Dt.length;dt++)Ae.push(Dt[dt]+Pn);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 Xe=new Float32Array(B),At=w(Xe),we={POSITION:E(Xe,{type:"VEC3",componentType:Y.FLOAT,target:ee.ARRAY_BUFFER,min:At.min,max:At.max})},We={CESIUM_mesh_vector:{vector:!0,count:Xe.length/3}};P(we,We,G),Le.push({mode:Re.POINTS,attributes:we,extensions:We})}if(W.length>0&&q.length>1){let Xe=new Float32Array(W),At=new Uint32Array(q),Ke=w(Xe),we=E(Xe,{type:"VEC3",componentType:Y.FLOAT,target:ee.ARRAY_BUFFER,min:Ke.min,max:Ke.max}),We=E(At,{type:"SCALAR",componentType:Y.UNSIGNED_INT,target:ee.ELEMENT_ARRAY_BUFFER}),vt={POSITION:we},ct={CESIUM_mesh_vector:{vector:!0,count:J}};P(vt,ct,Q),Le.push({mode:Re.LINE_STRIP,indices:We,attributes:vt,extensions:ct})}if(Z.length>0&&Ae.length>=3){let Xe=new Float32Array(Z),At=new Uint32Array(Ae),Ke=new Uint32Array(le),we=new Uint32Array(Ce),We=ve.length>0,vt=We?new Uint32Array(ye):void 0,ct=We?new Uint32Array(ve):void 0,pn=w(Xe),Ht=E(Xe,{type:"VEC3",componentType:Y.FLOAT,target:ee.ARRAY_BUFFER,min:pn.min,max:pn.max}),bt=E(At,{type:"SCALAR",componentType:Y.UNSIGNED_INT,target:ee.ELEMENT_ARRAY_BUFFER}),Dt=E(Ke,{type:"SCALAR",componentType:Y.UNSIGNED_INT,target:ee.ARRAY_BUFFER}),Pn=E(we,{type:"SCALAR",componentType:Y.UNSIGNED_INT,target:ee.ARRAY_BUFFER}),ot=l(vt)?E(vt,{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,Si={POSITION:Ht},wn={CESIUM_mesh_vector:{vector:!0,count:Ie,polygonAttributeOffsets:Dt,polygonIndicesOffsets:Pn}};We&&(wn.CESIUM_mesh_vector.polygonHoleCounts=ot,wn.CESIUM_mesh_vector.polygonHoleOffsets=dt),P(Si,wn,ce),Le.push({mode:Re.TRIANGLES,indices:bt,attributes:Si,extensions:wn})}if(Le.length===0)continue;let $e=N.length;N.push({primitives:Le}),_.push({name:k.name,mesh:$e,translation:v})}if(_.length===0)return;let S=O(),I=zUt(b,x),M=["CESIUM_mesh_vector"];g.size>0&&M.push("EXT_mesh_features"),l(S)&&M.push("EXT_structural_metadata");let F=_.map((k,j)=>j),V={asset:{version:"2.0"},extensionsUsed:M,scene:0,scenes:[{nodes:F}],nodes:_,meshes:N,accessors:A,bufferViews:y,buffers:[{byteLength:I.byteLength}],extensions:void 0};return l(S)&&(V.extensions={EXT_structural_metadata:S}),kUt(V,I)}function MUt(e,t){let n=t.get(e);return l(n)||(n=t.size,t.set(e,n)),n}function LUt(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 NUt(e){let t=[];for(let n of e){let i=BUt(n);if(i.length<3)continue;FUt(i)<=0?t.push({outerRing:i,holes:[]}):t.length>0&&t[t.length-1].holes.push(i)}return t}function FUt(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 BUt(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 Foe(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,OLe),h.subtract(OLe,a,t7),s.push(t7.x,t7.y,t7.z)}function kUt(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 zUt(e,t){let n=new Uint8Array(t),i=0;for(let r of e)n.set(r,i),i+=r.byteLength;return n}var n4=OUt;var UUt=new TextDecoder,n7={UNKNOWN:0,POINT:1,LINESTRING:2,POLYGON:3},VUt={LAYERS:3},i4={NAME:1,FEATURES:2,KEYS:3,VALUES:4,EXTENT:5},Boe={TAGS:2,TYPE:3,GEOMETRY:4},av={STRING:1,FLOAT:2,DOUBLE:3,INT64:4,UINT64:5,SINT64:6,BOOL:7},jUt=["Unknown","Point","LineString","Polygon"];function HUt(e){let t=new Uint8Array(e),n=[],i=0;for(;i<t.length;){let r=i7(t,i,t.length),o=r.fieldNumber,a=r.wireType;if(i=r.newPos,o===VUt.LAYERS&&a===2){let s=Y_(t,i,t.length);i=s.newPos;let c=nf(i,s.value,t.length,"layer");n.push(GUt(t,i,c)),i=c}else i=r7(t,i,a,t.length)}return{layers:n}}function GUt(e,t,n){let i=t,r="",o=4096,a=[],s=[],c=[];for(;i<n;){let f=i7(e,i,n),d=f.fieldNumber,p=f.wireType;if(i=f.newPos,d===i4.NAME&&p===2){let g=Y_(e,i,n);i=g.newPos;let m=nf(i,g.value,n,"layer name");r=zoe(e,i,g.value),i=m}else if(d===i4.FEATURES&&p===2){let g=Y_(e,i,n);i=g.newPos;let m=nf(i,g.value,n,"feature");c.push({start:i,end:m}),i=m}else if(d===i4.KEYS&&p===2){let g=Y_(e,i,n);i=g.newPos;let m=nf(i,g.value,n,"key");a.push(zoe(e,i,g.value)),i=m}else if(d===i4.VALUES&&p===2){let g=Y_(e,i,n);i=g.newPos;let m=nf(i,g.value,n,"value"),y=YUt(e,i,m);s.push(y),i=m}else if(d===i4.EXTENT&&p===0){let g=YI(e,i,n);o=g.value,i=g.newPos}else i=r7(e,i,p,n)}let u=c.map(({start:f,end:d})=>WUt(e,f,d,a,s));return{name:r,extent:o,features:u}}function WUt(e,t,n,i,r){let o=t,a=n7.UNKNOWN,s=[],c=[];for(;o<n;){let d=i7(e,o,n),p=d.fieldNumber,g=d.wireType;if(o=d.newPos,p===Boe.TYPE&&g===0){let m=YI(e,o,n);a=m.value,o=m.newPos}else if(p===Boe.TAGS&&g===2){let m=Y_(e,o,n);o=m.newPos;let y=nf(o,m.value,n,"feature tags");for(;o<y;){let A=YI(e,o,y);s.push(A.value),o=A.newPos}}else if(p===Boe.GEOMETRY&&g===2){let m=Y_(e,o,n);o=m.newPos;let y=nf(o,m.value,n,"feature geometry");for(;o<y;){let A=YI(e,o,y);c.push(A.value),o=A.newPos}}else o=r7(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=qUt(a,c);return{type:jUt[a]??"Unknown",geometry:f,properties:u}}function qUt(e,t){let n=0,i=0,r=0;if(e===n7.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+=w0(t[n++]),r+=w0(t[n++]),o.push({x:i,y:r})}return o}if(e===n7.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+=w0(t[n++]),r+=w0(t[n++]),a.push({x:i,y:r});else if(c===2)for(let f=0;f<u;f++)i+=w0(t[n++]),r+=w0(t[n++]),a.push({x:i,y:r})}return a!==null&&o.push(a),o}if(e===n7.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+=w0(t[n++]),r+=w0(t[n++]),a.push({x:i,y:r});else if(c===2)for(let f=0;f<u;f++)i+=w0(t[n++]),r+=w0(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 YUt(e,t,n){let i=t;for(;i<n;){let r=i7(e,i,n),o=r.fieldNumber,a=r.wireType;if(i=r.newPos,o===av.STRING&&a===2){let s=Y_(e,i,n);i=s.newPos;let c=nf(i,s.value,n,"string value");return zoe(e,i,c-i)}else{if(o===av.FLOAT&&a===5)return nf(i,4,n,"float value"),new DataView(e.buffer,e.byteOffset+i,4).getFloat32(0,!0);if(o===av.DOUBLE&&a===1)return nf(i,8,n,"double value"),new DataView(e.buffer,e.byteOffset+i,8).getFloat64(0,!0);if(o===av.INT64&&a===0){let s=XI(e,i,n);return koe(s.value)}else if(o===av.UINT64&&a===0){let s=XI(e,i,n);return koe(s.value)}else if(o===av.SINT64&&a===0){let s=XI(e,i,n);return koe(XUt(s.value))}else if(o===av.BOOL&&a===0)return YI(e,i,n).value!==0}i=r7(e,i,a,n)}}function i7(e,t,n){let i=YI(e,t,n);return{fieldNumber:i.value>>>3,wireType:i.value&7,newPos:i.newPos}}function YI(e,t,n){let i=XI(e,t,n,5);if(i.value>0xffffffffn)throw new oe("Invalid MVT uint32 varint.");return{value:Number(i.value),newPos:i.newPos}}function Y_(e,t,n){let i=XI(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 XI(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 zoe(e,t,n){let i=nf(t,n,e.length,"string");return UUt.decode(e.subarray(t,i))}function nf(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 r7(e,t,n,i){if(n===0)return XI(e,t,i).newPos;if(n===1)return nf(t,8,i,"fixed64 field");if(n===2){let r=Y_(e,t,i);return nf(r.newPos,r.value,i,"length-delimited field")}else if(n===5)return nf(t,4,i,"fixed32 field");throw new oe(`Unsupported protobuf wire type: ${n}`)}function w0(e){return e>>>1^-(e&1)}function XUt(e){return e>>1n^-(e&1n)}function koe(e){return e<=BigInt(Number.MAX_SAFE_INTEGER)&&e>=BigInt(Number.MIN_SAFE_INTEGER)?Number(e):e}var r4=HUt;var o7=class extends t4{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=ki.Z,t._modelForwardAxis=ki.X}_createCodec(){let t=this._featureIdProperty;return{contentType:"mvt",missingTilePolicy:{statusCodes:[404,204]},createContent:async(n,i,r,o)=>{let a=r4(o),s=MLe(r.getUrlComponent(!0)),c=n4(a,s,{featureIdProperty:t});if(!l(c)){if(!KUt(a))return new Qp(n,i);throw new oe("Decoded MVT tile did not produce vector glTF content.")}return IA.fromGltf(n,i,r,c)}}}};function MLe(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 KUt(e){let t=e.layers;for(let n=0;n<t.length;n++)if(t[n].features.length>0)return!0;return!1}o7._parseTileCoordinates=MLe;var Uoe=o7;var $Ut=/\/$/,LLe=new St('&copy; <a href="https://www.mapbox.com/about/maps/">Mapbox</a> &copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function KI(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();$Ut.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 St(c))):c=LLe,this._resource=i,this._imageryProvider=new xa({url:i,credit:c,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(KI.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}}});KI.prototype.getTileCredits=function(e,t,n){};KI.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};KI.prototype.pickFeatures=function(e,t,n,i,r){return this._imageryProvider.pickFeatures(e,t,n,i,r)};KI._defaultCredit=LLe;var Voe=KI;function joe(e){}joe.prototype.isReady=function(){return!0};joe.prototype.shouldDiscardImage=function(e){return!1};var Hoe=joe;var JUt=new St("MapQuest, Open Street Map and contributors, CC-BY-SA");function a7(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 To({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??JUt;typeof d=="string"&&(d=new St(d)),xa.call(this,{url:t,credit:d,tilingScheme:n,tileWidth:i,tileHeight:r,minimumLevel:o,maximumLevel:a,rectangle:s})}l(Object.create)&&(a7.prototype=Object.create(xa.prototype),a7.prototype.constructor=a7);var X_=a7;function NLe(){pe.throwInstantiationError()}Object.defineProperties(NLe.prototype,{show:{get:pe.throwInstantiationError,set:pe.throwInstantiationError},transform:{get:pe.throwInstantiationError},credit:{get:pe.throwInstantiationError}});var Goe=NLe;function s7(){pe.throwInstantiationError()}Object.defineProperties(s7.prototype,{});s7.fromUrl=function(e){pe.throwInstantiationError()};s7.prototype.loadPanorama=function(e){pe.throwInstantiationError()};var Woe=s7;var ZUt=new z(1,1);function qoe(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=z.clone(e.imageSize??ZUt),this._age=0,this._normalizedAge=0,this._billboard=void 0}Object.defineProperties(qoe.prototype,{age:{get:function(){return this._age}},normalizedAge:{get:function(){return this._normalizedAge}}});var FLe=new h;qoe.prototype.update=function(e,t){return h.multiplyByScalar(this.velocity,e,FLe),h.add(this.position,FLe,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 $I=qoe;function BLe(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(BLe.prototype,{complete:{get:function(){return this._complete}}});var Yoe=BLe;function kLe(e){}kLe.prototype.emit=function(e){pe.throwInstantiationError()};var Xoe=kLe;var zLe=new z(1,1);function o4(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 zV(.5)),this._emitter=t,this._bursts=e.bursts,this._modelMatrix=L.clone(e.modelMatrix??L.IDENTITY),this._emitterModelMatrix=L.clone(e.emitterModelMatrix??L.IDENTITY),this._matrixDirty=!0,this._combinedMatrix=new L,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=z.clone(e.imageSize??e.minimumImageSize??zLe),this._maximumImageSize=z.clone(e.imageSize??e.maximumImageSize??zLe),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(o4.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||!L.equals(this._modelMatrix,e),L.clone(e,this._modelMatrix)}},emitterModelMatrix:{get:function(){return this._emitterModelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!L.equals(this._emitterModelMatrix,e),L.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 QUt(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 $I;p._billboard=o.add({image:a,show:!1}),u.push(p)}e._particleEstimate=s}function eVt(e){let t=e._particlePool.pop();return l(t)||(t=new $I),t}function tVt(e,t){e._particlePool.push(t)}function nVt(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 iVt(e){l(e._billboard)&&(e._billboard.show=!1)}function ULe(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=D.lerp(t.startColor.red,t.endColor.red,t.normalizedAge),r=D.lerp(t.startColor.green,t.endColor.green,t.normalizedAge),o=D.lerp(t.startColor.blue,t.endColor.blue,t.normalizedAge),a=D.lerp(t.startColor.alpha,t.endColor.alpha,t.normalizedAge);n.color=new U(i,r,o,a),n.scale=D.lerp(t.startScale,t.endScale,t.normalizedAge)}function rVt(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=D.randomBetween(e._minimumParticleLife,e._maximumParticleLife),t.mass=D.randomBetween(e._minimumMass,e._maximumMass),t.imageSize.x=D.randomBetween(e._minimumImageSize.x,e._maximumImageSize.x),t.imageSize.y=D.randomBetween(e._minimumImageSize.y,e._maximumImageSize.y),t._normalizedAge=0,t._age=0;let n=D.randomBetween(e._minimumSpeed,e._maximumSpeed);h.multiplyByScalar(t.velocity,n,t.velocity),e._particles.push(t)}function oVt(e,t){if(e._isComplete)return 0;t=D.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+=D.randomBetween(a.minimum,a.maximum),a._complete=!0)}}return i}var c7=new h;o4.prototype.update=function(e){if(!this.show)return;l(this._billboardCollection)||(this._billboardCollection=new vf),this._updateParticlePool&&(QUt(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)?ULe(this,a):(iVt(a),tVt(this,a),n[o]=n[s-1],--o,--s);n.length=s;let c=oVt(this,t);if(c>0&&l(i)){this._matrixDirty&&(this._combinedMatrix=L.multiply(this.modelMatrix,this.emitterModelMatrix,this._combinedMatrix),this._matrixDirty=!1);let u=this._combinedMatrix;for(o=0;o<c;o++)a=eVt(this),this._emitter.emit(a),h.add(a.position,a.velocity,c7),L.multiplyByPoint(u,c7,c7),a.position=L.multiplyByPoint(u,a.position,a.position),h.subtract(c7,a.position,a.velocity),h.normalize(a.velocity,a.velocity),rVt(this,a),ULe(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=D.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&&nVt(this)};o4.prototype.isDestroyed=function(){return!1};o4.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),ue(this)};var Koe=o4;var $oe=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()}},Joe=$oe;function Zoe(e){e=e??1,this._radius=e??1}Object.defineProperties(Zoe.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});Zoe.prototype.emit=function(e){let t=D.randomBetween(0,D.TWO_PI),n=D.randomBetween(0,D.PI),i=D.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 Qoe=Zoe;function a4(){}a4.prototype.evaluate=function(e,t){pe.throwInstantiationError()};a4.prototype.evaluateColor=function(e,t){pe.throwInstantiationError()};a4.prototype.getShaderFunction=function(e,t,n,i){pe.throwInstantiationError()};a4.prototype.getVariables=function(){pe.throwInstantiationError()};var eae=a4;function JI(e){this._ready=!1,this._provider=void 0,this._errorEvent=new be,this._readyEvent=new be,sVt(this,e)}Object.defineProperties(JI.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}}});JI.fromWorldTerrain=function(e){return new JI(Dx(e))};JI.fromWorldBathymetry=function(e){return new JI(LM(e))};function aVt(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function sVt(e,t){let n;try{n=await Promise.resolve(t),e._provider=n,e._ready=!0,e._readyEvent.raiseEvent(n)}catch(i){aVt(e._errorEvent,i)}}var s4=JI;function ZI(){}ZI.prototype.boundingVolume=void 0;ZI.prototype.boundingSphere=void 0;ZI.prototype.distanceToCamera=function(e){pe.throwInstantiationError()};ZI.prototype.intersectPlane=function(e){pe.throwInstantiationError()};ZI.prototype.createDebugVolume=function(e){pe.throwInstantiationError()};var tae=ZI;function c4(e){e=e??H.EMPTY_OBJECT,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new Xi({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(c4.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}}});c4.prototype.getTileCredits=function(e,t,n){};c4.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)};c4.prototype.pickFeatures=function(e,t,n,i,r){};var l4=c4;function nae(e){pe.throwInstantiationError()}nae.prototype.isReady=pe.throwInstantiationError;nae.prototype.shouldDiscardImage=pe.throwInstantiationError;var iae=nae;var VLe={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3};Object.freeze(VLe);var rae=VLe;function l7(e,t){this.show=!0,l(e)||(e=new Je),this.rectangle=Je.clone(e),l(t)||(t=tr.fromType(tr.ColorType,{color:new U(1,1,1,1)})),this.material=t,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}l7.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:Qt.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,NV]});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)}};l7.prototype.isDestroyed=function(){return!1};l7.prototype.destroy=function(){return l(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),ue(this)};var oae=l7;var aae=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()}},sae=aae;function K_(){pe.throwInstantiationError()}Object.defineProperties(K_.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}});K_.prototype.update=pe.throwInstantiationError;K_.prototype.updateViewTransforms=pe.throwInstantiationError;K_.prototype.convertLocalToShapeUvSpace=pe.throwInstantiationError;K_.prototype.computeOrientedBoundingBoxForTile=pe.throwInstantiationError;K_.prototype.computeOrientedBoundingBoxForSample=pe.throwInstantiationError;K_.DefaultMinBounds=pe.throwInstantiationError;K_.DefaultMaxBounds=pe.throwInstantiationError;var cae=K_;var cVt=new U,lVt=new U,uVt=new U,fVt=new U,jLe=new ae,u4=new Uint8Array(4);function HLe(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 u7(e,t){return{height:e,color:U.clone(t)}}function GLe(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 dVt(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=D.clamp(g.height,rf._minimumHeight,rf._maximumHeight),y=U.clone(g.color,cVt);y.red*=y.alpha,y.green*=y.alpha,y.blue*=y.alpha,c.push(u7(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||Up(c,function(g,m){return D.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,u7(rf._minimumHeight,c[0].color)),p&&c.splice(c.length,0,u7(rf._maximumHeight,c[c.length-1].color)),c=GLe(c),i.push(c)}return i}function hVt(e){let t=dVt(e),n=[],i,r;function o(u,f){n.push(u7(u,f))}function a(u,f,d){let p=U.multiplyByScalar(d,1-f.alpha,fVt);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),P=l(A)&&m.height===A.height,R=!l(y),O=!l(A);C?P?(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)):O?(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?P?(o(m.height,m.color),a(m.height,A.color,b.color)):O?(o(m.height,m.color),o(m.height,b.color)):(R||o(m.height,m.color),a(m.height,m.color,b.color)):w?P?(a(m.height,m.color,b.color),o(m.height,A.color)):R?(o(m.height,b.color),o(m.height,m.color)):O?a(m.height,m.color,b.color):(a(m.height,m.color,b.color),o(m.height,m.color)):P?(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)):O?(a(m.height,m.color,b.color),o(m.height,b.color)):a(m.height,m.color,b.color),f+=P?2:1,d+=C?2:1}else if(l(m)&&l(b)&&l(x)&&m.height<b.height){let C=HLe(m.height,x,b,uVt);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=HLe(b.height,y,m,lVt);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,rf._emptyColor),o(b.height,rf._emptyColor)):(!l(b)&&l(x)&&!l(y)&&(o(x.height,rf._emptyColor),o(m.height,rf._emptyColor)),o(m.height,m.color)),f++):l(b)&&(!l(m)||b.height<m.height)&&(o(b.height,b.color),d++)}}return GLe(n)}function rf(e){let{scene:t,layers:n}=e??H.EMPTY_OBJECT,{context:i}=t,r=hVt(n),o=r.length,a,s,c;if(!rf._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,jLe),ae.pack(jLe,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=Ct.create({context:i,pixelFormat:c,pixelDatatype:s,source:{arrayBufferView:a,width:o,height:1},sampler:new zt({wrapS:rn.CLAMP_TO_EDGE,wrapT:rn.CLAMP_TO_EDGE,minificationFilter:Gt.NEAREST,magnificationFilter:ei.NEAREST})}),d=new Uint8Array(o*4);for(let g=0;g<o;g++)r[g].color.toBytes(u4),d[g*4+0]=u4[0],d[g*4+1]=u4[1],d[g*4+2]=u4[2],d[g*4+3]=u4[3];let p=Ct.create({context:i,pixelFormat:He.RGBA,pixelDatatype:ke.UNSIGNED_BYTE,source:{arrayBufferView:d,width:o,height:1},sampler:new zt({wrapS:rn.CLAMP_TO_EDGE,wrapT:rn.CLAMP_TO_EDGE,minificationFilter:Gt.LINEAR,magnificationFilter:ei.LINEAR})});return tr.fromType("ElevationBand",{heights:f,colors:p})}rf._useFloatTexture=function(e){return e.floatingPointTexture};rf._maximumHeight=5906376425472;rf._minimumHeight=-5906376425472;rf._emptyColor=new U(0,0,0,0);var lae=rf;async function mVt(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??ds.defaultApiKey;if(!l(n))return pVt(t);let i,r=ds.getDefaultCredit();l(r)&&(i=[r]);let o=new De({url:`${ds.mapTilesApiEndpoint}v1/3dtiles/root.json`,queryParameters:{key:n},credits:i});return Uo.fromUrl(o,t)}var WLe={};async function pVt(e){let i=WLe[2275207];l(i)||(i=ca.fromAssetId(2275207),WLe[2275207]=i);let r=await i;return Uo.fromUrl(r,e)}var uae=mVt;async function gVt(e){let t=await Uo.fromIonAssetId(96188,e);e=e??H.EMPTY_OBJECT;let n=e.style;if(!l(n)){let i=(e.defaultColor??U.WHITE).toCssColorString();n=new c_({color:`Boolean(\${feature['cesium#color']}) ? color(\${feature['cesium#color']}) : ${i}`})}return t.style=n,t}var fae=gVt;function _Vt(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=L.clone(e.modelMatrix??L.IDENTITY),o=e.length??1e4;if(l(i.normal)&&t.push(new Nt({geometry:Hn.createLineSegmentsForVectors(n,"normal",o),attributes:{color:new Kt(1,0,0,1)},modelMatrix:r})),l(i.tangent)&&t.push(new Nt({geometry:Hn.createLineSegmentsForVectors(n,"tangent",o),attributes:{color:new Kt(0,1,0,1)},modelMatrix:r})),l(i.bitangent)&&t.push(new Nt({geometry:Hn.createLineSegmentsForVectors(n,"bitangent",o),attributes:{color:new Kt(0,0,1,1)},modelMatrix:r})),t.length>0)return new Nn({asynchronous:!1,geometryInstances:t,appearance:new gn({flat:!0,translucent:!1})})}var dae=_Vt;var hae=`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 mae=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()}},pae=mae;var qLe=new h,yVt=new en(h.UNIT_X,0),AVt=new dn,bVt=new z(1,1,1);function ip(e,t,n,i=bVt){let{camera:r,ellipsoid:o}=e,a=o.scaleToGeodeticSurface(r.positionWC,qLe);if(!l(a))return;let s=h.magnitude(r.positionWC),c=h.magnitude(a),u=s<=c,f=o.geodeticSurfaceNormal(r.positionWC,qLe),d=h.dot(f,r.directionWC),p=d>0;if(u||p){let g=en.fromPointNormal(r.positionWC,f,yVt),{clientHeight:m}=e.canvas,y=i.y*m/(2*Math.tan(r.frustum.fovy*.5));g.distance-=d*y;let A=r.getPickRay(t,AVt);return ci.rayPlane(A,g,n)}return r.pickEllipsoid(t,o,n)}var YLe={LEFT:0,MIDDLE:1,RIGHT:2};Object.freeze(YLe);var Ys=YLe;function xVt(e){if(e===Ys.LEFT)return cn.LEFT_DOWN;if(e===Ys.MIDDLE)return cn.MIDDLE_DOWN;if(e===Ys.RIGHT)return cn.RIGHT_DOWN}function TVt(e){if(e===Ys.LEFT)return cn.LEFT_UP;if(e===Ys.MIDDLE)return cn.MIDDLE_UP;if(e===Ys.RIGHT)return cn.RIGHT_UP}var gae=class{static registerDragInputBindings(t,n,i){let r=new Set,o={isDragging:!1};for(let a of n){o.isDragging=!1;let s=xVt(a.button),c=TVt(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)},cn.MOUSE_MOVE,a);return o}},rp=gae;var _ae=class e{static _getDefaultDragInputs(){return[Object.freeze({button:Ys.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 z,this._panPosition=new z,this.pickWorldPosition=ip,this._ellipsoidNormal=new h,this._ellipsoidSurfacePosition=new h,this._panDirectionX=new h,this._panDirectionY=new h,this._pixelSize=new z,this._panVelocity=new z,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=yn(),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 Ka(t);this._handler=n,this._dragInputState=rp.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=yn(),this._panDelta.x=0,this._panDelta.y=0}update(t){let n=(yn()-this._lastUpdateTime)*zn.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)<=D.EPSILON3&&Math.abs(s)<=D.EPSILON3){this._lastUpdateTime=yn(),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=D.clamp(a,-T,T),this._panVelocity.x=a/n,a*=this.panSpeed*x.x,s=D.clamp(s,-T,T),this._panVelocity.y=s/n,s*=this.panSpeed*x.y,i.move(p,a),i.move(g,s),this._lastUpdateTime=yn(),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}},f4=_ae;var yae=class e{static _getDefaultDragInputs(){return[Object.freeze({button:Ys.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 z,this._panPosition=new z,this.pickWorldPosition=ip,this._ellipsoidNormal=new h,this._ellipsoidSurfacePosition=new h,this._panDirectionX=new h,this._panDirectionY=new h,this._pixelSize=new z,this._panVelocity=new z,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 Ka(t);this._handler=n,this._dragInputState=rp.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=yn(),this._panDelta.x=0,this._panDelta.y=0}update(t){let n=(yn()-this._lastUpdateTime)*zn.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)<=D.EPSILON3&&Math.abs(r)<=D.EPSILON3){this._lastUpdateTime=yn(),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));D.lessThan(y,1,D.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=D.clamp(i,-E,E),this._panVelocity.x=i/n,i*=this.panSpeed*C.x,r=D.clamp(r,-E,E),this._panVelocity.y=r/n,r*=this.panSpeed*C.y,o.move(g,i),o.move(m,r),this._lastUpdateTime=yn(),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}},d4=yae;var Aae=class{constructor(){this._elevatorController=new f4,this._mapController=new d4,this._enabled=!0,this._ellipsoidNormal=new h,this.angleThreshold=D.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)}},bae=Aae;var xae=class e{static _getDefaultDragInputs(){return[Object.freeze({button:Ys.LEFT,modifier:Gr.CTRL}),Object.freeze({button:Ys.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 z,this._screenSpaceDragPosition=new z,this._screenSpaceOrigin=new z,this.pickWorldPosition=ip,this._hasTarget=!1,this._target=new h,this._axis=new h,this.tiltMagnitude=2,this.dampingEnabled=!0,this.tiltAnimationDuration=.0045,this.maximumTiltVelocity=D.PI,this.minimumTiltVelocity=D.EPSILON20,this.orbitMagnitude=2,this.orbitAnimationDuration=.0045,this.maximumOrbitVelocity=D.TWO_PI,this.minimumOrbitVelocity=D.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 L,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=yn(),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 Ka(t);this._handler=n,this._dragInputState=rp.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=yn(),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=L.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=D.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<D.PI_OVER_TWO&&r>0||s>D.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;D.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=(yn()-this._lastUpdateTime)*zn.SECONDS_PER_MILLISECOND,{canvas:i}=t,{clientWidth:r,clientHeight:o}=i;if(n===0||r===0||o===0){this._lastUpdateTime=yn(),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=D.clamp(d,-this.maximumMovementRatio,this.maximumMovementRatio),d*=this.orbitMagnitude*D.TWO_PI,this.orbit(s,a,f,d,n,c)}if(this.tiltEnabled){let d=this._dragDelta.y/o;d=D.clamp(d,-this.maximumMovementRatio,this.maximumMovementRatio),d*=this.tiltMagnitude*D.PI,this.tilt(s,a,f,d,n,c)}}this._lastUpdateTime=yn(),this._dragDelta.x=0,this._dragDelta.y=0}},Tae=xae;var Cae=class e{static _getDefaultDragInputs(){return[Object.freeze({button:Ys.MIDDLE})]}static _getDefaultScrollInputs(){return[cn.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 z,this._scrollDelta=0,this._zoomInputVelocity=0,this._screenSpaceScrollPosition=new z,this._screenSpaceDragPosition=new z,this._screenSpaceOrigin=new z,this.zoomSensitivity=.2,this.pickWorldPosition=ip,this.zoomDistanceRatio=.4,this.inertiaEnabled=!1,this.inertialDecay=6,this.minimumZoomDistance=0,this.maximumZoomDistance=1e5,this.minimumZoomVelocity=D.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=yn(),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 Ka(t);this._handler=n;for(let i of this.scrollInputs)n.setInputAction(this._handleZoom.bind(this),i);n.setInputAction(this._handleZoomPosition.bind(this),cn.MOUSE_MOVE),this._dragInputState=rp.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=yn(),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=(yn()-this._lastUpdateTime)*zn.SECONDS_PER_MILLISECOND,{canvas:r}=t,{clientWidth:o,clientHeight:a}=r;if(i===0||o===0||a===0){this._lastUpdateTime=yn(),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<=D.EPSILON3&&s>=-D.EPSILON3&&this.zoomVelocity<=D.EPSILON3){this._lastUpdateTime=yn(),this._scrollDelta=0,this._dragDelta.x=0,this._dragDelta.y=0,this.zoomVelocity=0;return}this._zoomInputVelocity=D.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=D.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=D.smoothDamp(0,m,this.zoomVelocity,i,void 0,y,this._zoomDampenedResults),c.move(f,this.zoomDistance),this._lastUpdateTime=yn(),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}},vae=Cae;var XLe={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",MAT2:"mat2",MAT3:"mat3",MAT4:"mat4"};Object.freeze(XLe);var Eae=XLe;var KLe={SIGX:"SIGX",SIGY:"SIGY",SIGZ:"SIGZ",VARX:"VARX",VARY:"VARY",VARZ:"VARZ",SIGR:"VARZ"};Object.freeze(KLe);var Sae=KLe;function CVt(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: ${pp(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 wae=CVt;globalThis.CESIUM_VERSION="1.144.0";var h4;typeof ko<"u"&&(h4=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,I=S[C];I.ra||(this.Qb&&this.mb[v]?(S.uc(v,_,this.mb[v]),this.mb[v]=null,--this.Qb):I.I[v]||S.uc(v,_,I.J?{da:_}:S.$c(_)),_.Ja&&_.gd())}var m=typeof a<"u"?a:{};m.b=function(_,v){for(var S=_.split("."),I=m,M=0;M<S.length-1;M++)I=I[S[M]];I[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)M.call(q,Z)&&J(Z,q[Z])}function v(q,J){if(J)for(var Z in J)M.call(J,Z)&&(q[Z]=J[Z]);return q}function S(q,J){return q.__proto__=J,q}function I(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 M=Object.prototype.hasOwnProperty,F={__proto__:[]}instanceof Array,V=typeof Symbol=="function",k={},j={};k[i&&/Firefox\/2/i.test(i.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"],k.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "),_(k,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)M.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"?I(q.className,"baseVal",J,Z):I(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,Xe){var At=n.createElement("input");At.type="hidden",At.name=$e,At.value=Xe,Ie.appendChild(At)}),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 I=S.slice(0);return I.push.apply(I,arguments),v.apply(_,I)}}),m.a.g=new function(){var _=0,v="__ko__"+new Date().getTime(),S={},I,M;return m.a.W?(I=function(F,V){var k=F[v];if(!k||k==="null"||!S[k]){if(!V)return e;k=F[v]="ko"+_++,S[k]={}}return S[k]},M=function(F){var V=F[v];return V?(delete S[V],F[v]=null,!0):!1}):(I=function(F,V){var k=F[v];return!k&&V&&(k=F[v]={}),k},M=function(F){return F[v]?(delete F[v],!0):!1}),{get:function(F,V){var k=I(F,!1);return k&&k[V]},set:function(F,V,k){(F=I(F,k!==e))&&(F[V]=k)},Ub:function(F,V,k){return F=I(F,!0),F[V]||(F[V]=k)},clear:M,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,k){var j=m.a.g.get(V,I);return j===e&&k&&(j=[],m.a.g.set(V,I,j)),j}function v(V){var k=_(V,!1);if(k)for(var k=k.slice(0),j=0;j<k.length;j++)k[j](V);m.a.g.clear(V),m.a.K.cleanExternalData(V),F[V.nodeType]&&S(V.childNodes,!0)}function S(V,k){for(var j=[],B,G=0;G<V.length;G++)if((!k||V[G].nodeType===8)&&(v(j[j.length]=B=V[G]),V[G]!==B))for(;G--&&m.a.A(j,V[G])==-1;);}var I=m.a.g.Z(),M={1:!0,8:!0,9:!0},F={1:!0,9:!0};return{za:function(V,k){if(typeof k!="function")throw Error("Callback must be a function");_(V,!0).push(k)},yb:function(V,k){var j=_(V,!1);j&&(m.a.Pa(j,k),j.length==0&&m.a.g.set(V,I,e))},oa:function(V){return m.u.G(function(){M[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>"],I=[1,"<select multiple='multiple'>","</select>"],M={thead:v,tbody:v,tfoot:v,tr:[2,"<table><tbody>","</tbody></table>"],td:S,th:S,option:I,optgroup:I},F=8>=m.a.W;m.a.ua=function(V,k){var j;if(r){if(r.parseHTML)j=r.parseHTML(V,k)||[];else if((j=r.clean([V],k))&&j[0]){for(var B=j[0];B.parentNode&&B.parentNode.nodeType!==11;)B=B.parentNode;B.parentNode&&B.parentNode.removeChild(B)}}else{(j=k)||(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>]/))&&M[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,k){var j=m.a.ua(V,k);return j.length&&j[0].parentElement||m.a.Yb(j)},m.a.fc=function(V,k){if(m.a.Tb(V),k=m.a.f(k),k!==null&&k!==e)if(typeof k!="string"&&(k=k.toString()),r)r(V).html(k);else for(var j=m.a.ua(k,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,I){if(S){if(S.nodeType==8){var M=m.aa.Uc(S.nodeValue);M!=null&&I.push({ud:S,Kd:M})}else if(S.nodeType==1)for(var M=0,F=S.childNodes,V=F.length;M<V;M++)_(F[M],I)}}var v={};return{Xb:function(S){if(typeof S!="function")throw Error("You can only pass a function to ko.memoization.memoize()");var I=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);return v[I]=S,"<!--[ko_memo:"+I+"]-->"},bd:function(S,I){var M=v[S];if(M===e)throw Error("Couldn't find any memo with ID "+S+". Perhaps it's already been unmemoized.");try{return M.apply(null,I||[]),!0}finally{delete v[S]}},cd:function(S,I){var M=[];_(S,M);for(var F=0,V=M.length;F<V;F++){var k=M[F].ud,j=[k];I&&m.a.Nb(j,I),m.aa.bd(M[F].Kd,j),k.nodeValue="",k.parentNode&&k.parentNode.removeChild(k)}},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(M){for(var k=M,j=0,B;V<M;)if(B=I[V++]){if(V>k){if(5e3<=++j){V=M,m.a.Gc(Error("'Too much recursion' after processing "+j+" task groups."));break}k=M}try{B()}catch(G){m.a.Gc(G)}}}}function v(){_(),V=M=I.length=0}var S,I=[],M=0,F=1,V=0;return t.MutationObserver?S=(function(k){var j=n.createElement("div");return new MutationObserver(k).observe(j,{attributes:!0}),function(){j.classList.toggle("foo")}})(v):S=n&&"onreadystatechange"in n.createElement("script")?function(k){var j=n.createElement("script");j.onreadystatechange=function(){j.onreadystatechange=null,n.documentElement.removeChild(j),j=null,k()},n.documentElement.appendChild(j)}:function(k){setTimeout(k,0)},{scheduler:S,zb:function(k){return M||m.na.scheduler(v),I[M++]=k,F++},cancel:function(k){k=k-(F-M),k>=V&&k<M&&(I[k]=null)},resetForTesting:function(){var k=M-V;return V=M=I.length=0,k},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(I){clearTimeout(S),S=m.a.setTimeout(function(){_(I)},v)}})},rateLimit:function(_,v){var S,I,M;typeof v=="number"?S=v:(S=v.timeout,I=v.method),_.Hb=!1,M=typeof I=="function"?I:I=="notifyWhenChangesStop"?f:u,_.ub(function(F){return M(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 I,M=!1;return function(){if(!M){m.na.cancel(I),I=m.na.zb(S);try{M=!0,_.notifySubscribers(e,"dirty")}finally{M=!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 I=this;S=S||"change";var M=new m.ic(I,v?_.bind(v):_,function(){m.a.Pa(I.U[S],M),I.hb&&I.hb(S)});return I.Qa&&I.Qa(S),I.U[S]||(I.U[S]=[]),I.U[S].push(M),M},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 I=0,M;M=S[I];++I)M.Ib||M.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),I,M,F,V,k;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=M||k&&v.sb(F,V);k=M=I=!1,B&&v.gb(F=V)});v.qc=function(B,G){G&&v.Ja||(k=!G),v.ed=v.U.change.slice(0),v.Ja=I=!0,V=B,j()},v.pc=function(B){I||(F=B,v.gb(B,"beforeChange"))},v.rc=function(){k=!0},v.gd=function(){v.sb(F,v.v(!0))&&(M=!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,I){S!=="dirty"&&(v+=I.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,I){var M=m.Ta[S];typeof M=="function"&&(v=M(v,I)||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(I),I=F}function v(){I=S.pop()}var S=[],I,M=0;return{xc:_,end:v,cc:function(F){if(I){if(!m.Qc(F))throw Error("Only subscribable things can act as dependencies");I.od.call(I.pd,F,F.fd||(F.fd=++M))}},G:function(F,V,k){try{return _(),F.apply(V,k||[])}finally{v()}},qa:function(){if(I)return I.o.qa()},Va:function(){if(I)return I.o.Va()},Ya:function(){if(I)return I.Ya},o:function(){if(I)return I.o}}})(),m.b("computedContext",m.S),m.b("computedContext.getDependenciesCount",m.S.qa),m.b("computedContext.getDependencies",m.S.Va),m.b("computedContext.isInitial",m.S.Ya),m.b("computedContext.registerDependency",m.S.cc),m.b("ignoreDependencies",m.Yd=m.u.G);var 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=[],I=typeof _!="function"||m.O(_)?function(V){return V===_}:_,M=0;M<v.length;M++){var F=v[M];if(I(F)){if(S.length===0&&this.ya(),v[M]!==F)throw Error("Array modified during remove; cannot remove item");S.push(F),v.splice(M,1),M--}}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(I){return 0<=m.a.A(_,I)}):[]},destroy:function(_){var v=this.v(),S=typeof _!="function"||m.O(_)?function(F){return F===_}:_;this.ya();for(var I=v.length-1;0<=I;I--){var M=v[I];S(M)&&(M._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(k){var Q=[].concat(_.v()||[]),q;_.Wa("arrayChange")&&((!M||1<k)&&(M=m.a.Pb(j,Q,_.Ob)),q=M),j=Q,M=null,k=0,q&&q.length&&_.notifySubscribers(q,"arrayChange")}}I?W():(I=!0,V=_.subscribe(function(){++k},null,"spectate"),j=[].concat(_.v()||[]),M=null,F=_.subscribe(W))}if(_.Ob={},v&&typeof v=="object"&&m.a.extend(_.Ob,v),_.Ob.sparse=!0,!_.zc){var I=!1,M=null,F,V,k=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,I=!1,j=e)},_.zc=function(W,Q,q){function J(Ie,Le,$e){return Z[Z.length]={status:Ie,value:Le,index:$e}}if(I&&!k){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}M=Z}}}};var C=m.a.Da("_state");m.o=m.$=function(_,v,S){function I(){if(0<arguments.length){if(typeof M=="function")M.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(I),(F.ka||F.J&&I.Xa())&&I.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 M=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 I[C]=F,I.Nc=typeof M=="function",m.a.Ba||m.a.extend(I,m.T.fn),m.T.fn.qb(I),m.a.Ab(I,E),S.pure?(F.wb=!0,F.J=!0,m.a.extend(I,w)):S.deferEvaluation&&m.a.extend(I,P),m.options.deferUpdates&&m.Ta.deferred(I,!0),F.l&&(F.jc=!0,F.l.nodeType||(F.l=null)),F.J||S.deferEvaluation||I.ha(),F.l&&I.ja()&&m.a.K.za(F.l,F.Rb=function(){I.s()}),I};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,I=!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{I=this.zd(_)}finally{v.rb=!1}return I}},zd:function(_){var v=this[C],I=!1,S=v.wb?e:!v.V,I={qd:this,mb:v.I,Qb:v.V};m.u.xc({pd:I,od:g,o:this,Ya:S}),v.I={},v.V=0;var M=this.yd(v,I);return v.V?I=this.sb(v.X,M):(this.s(),I=!0),I&&(v.J?this.Gb():this.notifySubscribers(v.X,"beforeChange"),v.X=M,this.notifySubscribers(v.X,"spectate"),!v.J&&_&&this.notifySubscribers(v.X),this.rc&&this.rc()),S&&this.notifySubscribers(v.X,"awake"),I},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 I=[];m.a.P(S.I,function(M,F){I[F.Ka]=M}),m.a.D(I,function(M,F){var V=S.I[M],k=v.$c(V.da);k.Ka=F,k.La=V.La,S.I[M]=k}),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,I){I.s&&(v.I[S]={da:I.da,Ka:I.Ka,La:I.La},I.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)}},P={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 _(I,M,F){if(F=F||new S,I=M(I),typeof I!="object"||I===null||I===e||I instanceof RegExp||I instanceof Date||I instanceof String||I instanceof Number||I instanceof Boolean)return I;var V=I instanceof Array?[]:{};return F.save(I,V),v(I,function(k){var j=M(I[k]);switch(typeof j){case"boolean":case"number":case"string":case"function":V[k]=j;break;case"object":case"undefined":var B=F.get(j);V[k]=B!==e?B:_(j,M,F)}}),V}function v(I,M){if(I instanceof Array){for(var F=0;F<I.length;F++)M(F);typeof I.toJSON=="function"&&M("toJSON")}else for(F in I)M(F)}function S(){this.keys=[],this.values=[]}m.ad=function(I){if(arguments.length==0)throw Error("When calling ko.toJS, pass the object you want to convert.");return _(I,function(M){for(var F=0;m.O(M)&&10>F;F++)M=M();return M})},m.toJSON=function(I,M,F){return I=m.ad(I),m.a.hc(I,M,F)},S.prototype={constructor:S,save:function(I,M){var F=m.a.A(this.keys,I);0<=F?this.values[F]=M:(this.keys.push(I),this.values.push(M))},get:function(I){return I=m.a.A(this.keys,I),0<=I?this.values[I]:e}}})(),m.b("toJS",m.ad),m.b("toJSON",m.toJSON),m.Wd=function(_,v,S){function I(M){var F=m.xb(_,S).extend({ma:"always"}),V=F.subscribe(function(k){k&&(V.s(),M(k))});return F.notifySubscribers(F.v()),V}return typeof Promise!="function"||v?I(v.bind(S)):new Promise(I)},m.b("when",m.Wd),(function(){m.w={M:function(_){switch(m.a.R(_)){case"option":return _.__ko__hasDomDataOptionValue__===!0?m.a.g.get(_,m.c.options.$b):7>=m.a.W?_.getAttributeNode("value")&&_.getAttributeNode("value").specified?_.value:_.text:_.value;case"select":return 0<=_.selectedIndex?m.w.M(_.options[_.selectedIndex]):e;default:return _.value}},cb:function(_,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 I=-1,M=0,F=_.options.length,V;M<F;++M)if(V=m.w.M(_.options[M]),V==v||V===""&&v===e){I=M;break}(S||0<=I||v===e&&1<_.size)&&(_.selectedIndex=I,m.a.W===6&&m.a.setTimeout(function(){_.selectedIndex=I},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 _(k){k=m.a.Db(k),k.charCodeAt(0)===123&&(k=k.slice(1,-1)),k+=`
,`;var j=[],B=k.match(I),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(M))&&!F[Z[0]]&&(k=k.substr(k.indexOf(J)+1),B=k.match(I),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,I=RegExp(`"(?:\\\\.|[^"])*"|'(?:\\\\.|[^'])*'|\`(?:\\\\.|[^\`])*\`|/\\*(?:[^*]|\\*+[^*/])*\\*+/|//.*
|/(?:\\\\.|[^/])+/w*|[^\\s:,/][^,"'\`{}()/:[\\]]*[^\\s,"'\`{}()/:[\\]]|[^\\s]`,"g"),M=/[\])"'A-Za-z0-9_$]+$/,F={in:1,return:1,typeof:1},V={};return{Ra:[],wa:V,ac:_,vb:function(k,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 k=="string"?_(k):k;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(k,j){for(var B=0;B<k.length;B++)if(k[B].key==j)return!0;return!1},eb:function(k,j,B,G,W){k&&m.O(k)?!m.Za(k)||W&&k.v()===G||k(G):(k=j.get("_ko_property_writers"))&&k[B]&&k[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(M?B.text:B.nodeValue)}function v(B){return B.nodeType==8&&V.test(M?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 I(B,G){var W=S(B,G);return W?0<W.length?W[W.length-1].nextSibling:B.nextSibling:null}var M=n&&n.createComment("test").text==="<!--test-->",F=M?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,V=M?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,k={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=I(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=(M?B.text:B.nodeValue).match(F))?B[1]:null},Sc:function(B){if(k[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=I(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,I){try{var M=this.nd,F=_+(I&&I.valueAccessors||""),V;if(!(V=M[F])){var k,j="with($context){with($data||{}){return{"+m.m.vb(_,I)+"}}}";k=new Function("$context","$element",j),V=M[F]=k}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 I(le){return le()}function M(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"?M(le.bind(null,Ce,ye)):m.a.Ga(le,S)}function V(le,Ce){return M(this.getBindings.bind(this,le,Ce))}function k(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)]&&k(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(Xe){if(le[Xe]){if(m.a.A(ve,Xe)!==-1)throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+ve.join(", "));Ie(Xe)}}),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,Xe=$e.getBindingAccessors||V,At=m.$(function(){return(Le=Ce?Ce(ye,le):Xe.call($e,le,ye))&&(ye[Q]&&ye[Q](),ye[J]&&ye[J]()),Le},null,{l:le});Le&&At.ja()||(At=null)}var Ke=ye,we;if(Le){var We=function(){return m.a.Ga(At?At():Le,I)},vt=At?function(ct){return function(){return I(At()[ct])}}:function(ct){return Le[ct]};We.get=function(ct){return Le[ct]&&I(vt(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 pn=m.h.childNodes(le);pn.length&&ct(pn,m.Ec(pn[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 pn=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 pn=="function"&&m.u.G(function(){var Dt=pn(le,vt(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,vt(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 vt=Ke?At():At,ct=m.a.f(vt);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,Xe?ct=$e.$data:($e.$rawData=vt,$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,Xe=le===ce,At=Xe?e:le,Ke=typeof At=="function"&&!m.O(At),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||k(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,k){var j=Object.prototype.hasOwnProperty.call(M,V)?M[V]:_,B;j?j.subscribe(k):(j=M[V]=new m.T,j.subscribe(k),S(V,function(G,W){var Q=!(!W||!W.synchronous);F[V]={definition:G,Gd:Q},delete M[V],B||Q?j.notifySubscribers(G):m.na.zb(function(){j.notifySubscribers(G)})}),B=!0)}function S(V,k){I("getConfig",[V],function(j){j?I("loadComponent",[V,j],function(B){k(B,j)}):k(null,null)})}function I(V,k,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,k.concat(function(q){Q?j(null):q!==null?j(q):I(V,k,j,B)}))!==_&&(Q=!0,!G.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else I(V,k,j,B)}else j(null)}var M={},F={};m.j={get:function(V,k){var j=Object.prototype.hasOwnProperty.call(F,V)?F[V]:_;j?j.Gd?m.u.G(function(){k(j.definition)}):m.na.zb(function(){k(j.definition)}):v(V,k)},Bc:function(V){delete F[V]},oc:I},m.j.loaders=[],m.b("components",m.j),m.b("components.get",m.j.get),m.b("components.clearCachedDefinition",m.j.Bc)})(),(function(){function _(j,B,G,W){function Q(){--J===0&&W(q)}var q={},J=2,Z=G.template;G=G.viewModel,Z?M(B,Z,function(ce){m.j.oc("loadTemplate",[j,ce],function(Ae){q.template=Ae,Q()})}):Q(),G?M(B,G,function(ce){m.j.oc("loadViewModel",[j,ce],function(Ae){q[k]=Ae,Q()})}):Q()}function v(j,B,G){if(typeof B=="function")G(function(Q){return new B(Q)});else if(typeof B[k]=="function")G(B[k]);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(I(j.content))return m.a.Ca(j.content.childNodes)}return m.a.Ca(j.childNodes)}function I(j){return t.DocumentFragment?j instanceof DocumentFragment:j&&j.nodeType===11}function M(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);M(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(I(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 k="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,I){var M=S.getAttribute("params");if(M){var M=v.parseBindingsString(M,I,S,{valueAccessors:!0,bindingParams:!0}),M=m.a.Ga(M,function(k){return m.o(k,null,{l:S})}),F=m.a.Ga(M,function(k){var j=k.v();return k.ja()?m.o({read:function(){return m.a.f(k())},write:m.Za(j)&&function(B){k()(B)},l:S}):j});return Object.prototype.hasOwnProperty.call(F,"$raw")||(F.$raw=M),F}return{$raw:{}}}m.j.getComponentNameForNode=function(S){var I=m.a.R(S);if(m.j.tb(I)&&(I.indexOf("-")!=-1||""+S=="[object HTMLUnknownElement]"||8>=m.a.W&&S.tagName===I))return I},m.j.tc=function(S,I,M,F){if(I.nodeType===1){var V=m.j.getComponentNameForNode(I);if(V){if(S=S||{},S.component)throw Error('Cannot use the "component" binding on a custom element matching a component');var k={name:V,params:_(I,M)};S.component=F?function(){return k}:k}}return S};var v=new m.ga;9>m.a.W&&(m.j.register=(function(S){return function(I){return S.apply(this,arguments)}})(m.j.register),n.createDocumentFragment=(function(S){return function(){var I=S(),M=m.j.dd,F;for(F in M);return I}})(n.createDocumentFragment))})(),(function(){function _(I,M,F){if(M=M.template,!M)throw Error("Component '"+I+"' has no template");I=m.a.Ca(M),m.h.va(F,I)}function v(I,M,F){var V=I.createViewModel;return V?V.call(I,M,F):M}var S=0;m.c.component={init:function(I,M,F,V,k){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(I));return m.h.Ea(I),m.a.K.za(I,j),m.o(function(){var q=m.a.f(M()),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(I,k),Ae=G=++S;m.j.get(J,function(le){if(G===Ae){if(j(),!le)throw Error("Unknown component '"+J+"'");_(J,le,I);var Ce=v(le,Z,{element:I,templateNodes:Q});le=ce.createChildContext(Ce,{extend:function(ye){ye.$component=Ce,ye.$componentTemplateNodes=Q}}),Ce&&Ce.koDescendantsComplete&&(W=m.i.subscribe(I,m.i.pa,Ce.koDescendantsComplete,Ce)),B=Ce,m.Oa(le,I)}})},null,{l:I}),{controlsDescendantBindings:!0}}},m.h.ea.component=!0})();var O={class:"className",for:"htmlFor"};m.c.attr={update:function(_,v){var S=m.a.f(v())||{};m.a.P(S,function(I,M){M=m.a.f(M);var F=I.indexOf(":"),F="lookupNamespaceURI"in _&&0<F&&_.lookupNamespaceURI(I.substr(0,F)),V=M===!1||M===null||M===e;V?F?_.removeAttributeNS(F,I):_.removeAttribute(I):M=M.toString(),8>=m.a.W&&I in O?(I=O[I],V?_.removeAttribute(I):_[I]=M):V||(F?_.setAttributeNS(F,I,M):_.setAttribute(I,M)),I==="name"&&m.a.Yc(_,V?"":M)})}},(function(){m.c.checked={after:["value","attr"],init:function(_,v,S){function I(){var q=_.checked,J=F();if(!m.S.Ya()&&(q||!k&&!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 M(){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",k=_.type=="radio";if(V||k){var j=v(),B=V&&m.a.f(j)instanceof Array,G=!(B&&j.push&&j.splice),W=k||B,Q=B?F():e;k&&!_.name&&m.c.uniqueName.init(_,function(){return!0}),m.o(I,null,{l:_}),m.a.B(_,"click",I),m.o(M,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(I,M){M=m.a.f(M),m.a.Eb(_,I,M)}):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,I,M){var F=v()||{};m.a.P(F,function(V){typeof V=="string"&&m.a.B(_,V,function(k){var j,B=v()[V];if(B){try{var G=m.a.la(arguments);I=M.$data,G.unshift(I),j=B.apply(I,G)}finally{j!==!0&&(k.preventDefault?k.preventDefault():k.returnValue=!1)}S.get(V+"Bubble")===!1&&(k.cancelBubble=!0,k.stopPropagation&&k.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,I,M){return m.c.template.update(_,m.c.foreach.Rc(v),S,I,M)}},m.m.Ra.foreach=!1,m.h.ea.foreach=!0,m.c.hasfocus={init:function(_,v,S){function I(V){_.__ko_hasfocusUpdating=!0;var k=_.ownerDocument;if("activeElement"in k){var j;try{j=k.activeElement}catch{j=k.body}V=j===_}k=v(),m.m.eb(k,S,"hasfocus",V,!0),_.__ko_hasfocusLastValue=V,_.__ko_hasfocusUpdating=!1}var M=I.bind(null,!0),F=I.bind(null,!1);m.a.B(_,"focus",M),m.a.B(_,"focusin",M),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,I){m.c[v]={init:function(M,F,V,k,j){var B,G,W={},Q,q,J;if(S){k=V.get("as");var Z=V.get("noChildContext");J=!(k&&Z),W={as:k,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=!I!=!ce,le=!G,Ce;(J||Ae!==B)&&(q&&(j=m.i.Cb(M,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(M),!0)),Ae?(le||m.h.va(M,m.a.Ca(G)),m.Oa(Ce,M)):(m.h.Ea(M),Q||m.i.ma(M,m.i.H)),B=Ae)},null,{l:M}),{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,I,M){return v=M.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 I(){return m.a.jb(_.options,function(Z){return Z.selected})}function M(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,k=_.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(I(),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=M(Z,S.get("optionsValue"),Z),m.w.cb(ce,m.a.f(Ae)),Z=M(Z,S.get("optionsText"),Ae),m.a.Bb(ce,Z)),[ce]},v,j),!B){var J;V?J=Q.length&&I().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(_),k&&20<Math.abs(k-_.scrollTop)&&(_.scrollTop=k)}},m.c.options.$b=m.a.g.Z(),m.c.selectedOptions={init:function(_,v,S){function I(){var V=v(),k=[];m.a.D(_.getElementsByTagName("option"),function(j){j.selected&&k.push(m.w.M(j))}),m.m.eb(V,S,"selectedOptions",k)}function M(){var V=m.a.f(v()),k=_.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=k}if(m.a.R(_)!="select")throw Error("selectedOptions binding applies only to SELECT elements");var F;m.i.subscribe(_,m.i.H,function(){F?I():(m.a.B(_,"change",I),F=m.o(M,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(I,M){if(M=m.a.f(M),(M===null||M===e||M===!1)&&(M=""),r)r(_).css(I,M);else if(/^--/.test(I))_.style.setProperty(I,M);else{I=I.replace(/-(\w)/g,function(V,k){return k.toUpperCase()});var F=_.style[I];_.style[I]=M,M===F||_.style[I]!=F||isNaN(M)||(_.style[I]=M+"px")}})}},m.c.submit={init:function(_,v,S,I,M){if(typeof v()!="function")throw Error("The value for a submit binding must be a function");m.a.B(_,"submit",function(F){var V,k=v();try{V=k.call(M.$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,I,M,F,V;(S=t.opera&&t.opera.version&&parseInt(t.opera.version()))||(V=_(v.match(/Edge\/([^ ]+)$/)))||_(v.match(/Chrome\/([^ ]+)/))||(I=_(v.match(/Version\/([^ ]+) Safari/)))||(M=_(v.match(/Firefox\/([^ ]+)/)))||(F=m.a.W||_(v.match(/MSIE ([^ ]+)/)))||(F=_(v.match(/rv:([^ )]+)/)))}if(8<=F&&10>F)var k=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,k)||(m.a.g.set(q,k,!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>I&&m.a.R(W)==="textarea"?(J("keydown",ce),J("paste",ce),J("cut",ce)):11>S?J("keydown",ce):4>M?(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,I,M){var F;return S.has("as")&&(F={as:S.get("as"),noChildContext:S.get("noChildContext")}),v=M.createChildContext(v,F),m.Oa(v,_),{controlsDescendantBindings:!0}}},m.h.ea.using=!0,m.c.value={init:function(_,v,S){var I=m.a.R(_),M=I=="input";if(!M||_.type!="checkbox"&&_.type!="radio"){var F=[],V=S.get("valueUpdate"),k=!1,j=null;V&&(typeof V=="string"?F=[V]:F=m.a.wc(V),m.a.Pa(F,"change"));var B=function(){j=null,k=!1;var Q=v(),q=m.w.M(_);m.m.eb(Q,S,"value",q)};!m.a.W||!M||_.type!="text"||_.autocomplete=="off"||_.form&&_.form.autocomplete=="off"||m.a.A(F,"propertychange")!=-1||(m.a.B(_,"propertychange",function(){k=!0}),m.a.B(_,"focus",function(){k=!1}),m.a.B(_,"blur",function(){k&&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=M&&_.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)&&(I==="select"?(q=S.get("valueAllowUnset"),m.w.cb(_,Q,q),q||Q===m.w.M(_)||m.u.G(B)):m.w.cb(_,Q))},I==="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()),I=_.style.display!="none";S&&!I?_.style.display="":!S&&I&&(_.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,I,M,F){return m.c.event.init.call(this,v,function(){var V={};return V[_]=S(),V},I,M,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,I){return _=this.makeTemplateSource(_,I),this.renderTemplateSource(_,v,S,I)},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 _(I,M,F,V){I=m.m.ac(I);for(var k=m.m.Ra,j=0;j<I.length;j++){var B=I[j].key;if(Object.prototype.hasOwnProperty.call(k,B)){var G=k[B];if(typeof G=="function"){if(B=G(I[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(I,{valueAccessors:!0})+" } })()},'"+F.toLowerCase()+"')",V.createJavaScriptEvaluatorBlock(F)+M}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(I,M,F){M.isTemplateRewritten(I,F)||M.rewriteTemplate(I,function(V){return m.kc.Ld(V,M)},F)},Ld:function(I,M){return I.replace(v,function(F,V,k,j,B){return _(B,V,k,M)}).replace(S,function(F,V){return _(V,"<!-- ko -->","#comment",M)})},md:function(I,M){return m.aa.Xb(function(F,V){var k=F.nextSibling;k&&k.nodeName.toLowerCase()===M&&m.ib(k,I,V)})}}})(),m.b("__tr_ambtns",m.kc.md),(function(){m.C={},m.C.F=function(S){if(this.F=S){var I=m.a.R(S);this.ab=I==="script"?1:I==="textarea"?2:I=="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 I=arguments[0];S==="innerHTML"?m.a.fc(this.F,I):this.F[S]=I};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 I=m.a.g.get(S,v)||{},M=I.lb||(this.ab===3?S.content:this.ab===4?S:e);if(!M||I.jd){var F=this.text();F&&F!==I.bb&&(M=m.a.Md(F,S.ownerDocument),m.a.g.set(S,v,{lb:M,bb:F,jd:!0}))}return M}I=arguments[0],this.ab!==e&&this.text(""),m.a.g.set(S,v,{lb:I})},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 I(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 M(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=M(j,Z.$data,Z),Z=I(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=M(j,ye,ce);return I(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(),k=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,k)||(W=m.a.Yb(G),m.a.g.set(W,k,!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 I,M,F,V,k;for(I=M=0;(!S||I<S)&&(V=_[M]);++M){for(F=0;k=v[F];++F)if(V.value===k.value){V.moved=k.index,k.moved=V.index,v.splice(F,1),I=F=0;break}I+=F}}},m.a.Pb=(function(){function _(v,S,I,M,F){var V=Math.min,k=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=k(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=[],k=[],q=[],B=G,W=Q;B||W;)Q=j[B][W]-1,W&&Q===j[B][W-1]?k.push(V[V.length]={status:I,value:S[--W],index:W}):B&&Q===j[B-1][W]?q.push(V[V.length]={status:M,value:v[--B],index:B}):(--W,--B,F.sparse||V.push({status:"retained",value:S[W]}));return m.a.Kc(q,k,!F.dontLimitMoves&&10*G),V.reverse()}return function(v,S,I){return I=typeof I=="boolean"?{dontLimitMoves:I}:I||{},v=v||[],S=S||[],v.length<S.length?_(v,S,"added","deleted",I):_(S,v,"deleted","added",I)}})(),m.b("utils.compareArrays",m.a.Pb),(function(){function _(I,M,F,V,k){var j=[],B=m.$(function(){var G=M(F,k,m.a.Ua(j,I))||[];0<j.length&&(m.a.Xc(j,G),V&&m.u.G(V,null,[F,G,k])),j.length=0,m.a.Nb(j,G)},null,{l:I,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(I,M,F,V,k,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,I),J.push(Ie)}function W(ct,pn){if(ct)for(var Ht=0,bt=pn.length;Ht<bt;Ht++)m.a.D(pn[Ht].Y,function(Dt){ct(Dt,Ht,pn[Ht].Aa)})}M=M||[],typeof M.length>"u"&&(M=[M]),V=V||{};var Q=m.a.g.get(I,v),q=!Q,J=[],Z=0,ce=0,Ae=[],le=[],Ce=[],ye=[],ve=[],Ie,Le=0;if(q)m.a.D(M,B);else{if(!j||Q&&Q._countWaitingForRemove){var $e=m.a.Mb(Q,function(ct){return ct.Aa});j=m.a.Pb($e,M,{dontLimitMoves:V.dontLimitMoves,sparse:!0})}for(var $e=0,Xe,At,Ke;Xe=j[$e];$e++)switch(At=Xe.moved,Ke=Xe.index,Xe.status){case"deleted":for(;Z<Ke;)G(Z++);At===e&&(Ie=Q[Z],Ie.$&&(Ie.$.s(),Ie.$=e),m.a.Ua(Ie.Y,I).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++);At!==e?(le.push(J.length),G(At)):B(Xe.value)}for(;ce<M.length;)G(Z++);J._countWaitingForRemove=Le}m.a.g.set(I,v,J),W(V.beforeMove,ye),m.a.D(Ae,V.beforeRemove?m.oa:m.removeNode);var we,We,vt;try{vt=I.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(M=0;Z=Ie.Y[M];we=Z,M++)m.h.Wb(I,Z,we)}for($e=0;Ie=J[$e];$e++){for(Ie.Y||m.a.extend(Ie,_(I,F,Ie.Aa,k,Ie.pb)),M=0;Z=Ie.Y[M];we=Z,M++)m.h.Wb(I,Z,we);!Ie.Ed&&k&&(k(Ie.Aa,Ie.Y,Ie.pb),Ie.Ed=!0,we=Ie.Y[Ie.Y.length-1])}for(vt&&I.ownerDocument.activeElement!=vt&&vt.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,I){return(v=!(9>m.a.W)&&_.nodes?_.nodes():null)?m.a.la(v.cloneNode(!0).childNodes):(_=_.text(),m.a.ua(_,I))},m.ba.Ma=new m.ba,m.gc(m.ba.Ma),m.b("nativeTemplateEngine",m.ba),(function(){m.$a=function(){var 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,I,M,F){if(F=F||n,M=M||{},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=[I.$data],I=r.extend({koBindingContext:I},M.templateOptions),I=r.tmpl(V,S,I),I.appendTo(F.createElement("div")),r.fragments={},I},this.createJavaScriptEvaluatorBlock=function(S){return"{{ko_code ((function() { return "+S+" })()) }}"},this.addTemplate=function(S,I){n.write("<script type='text/html' id='"+S+"'>"+I+"</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 vVt=ko;typeof window<"u"?(ko=window.ko,typeof h4<"u"?window.ko=h4:delete window.ko):(ko=global.ko,typeof h4<"u"?global.ko=h4:delete global.ko);var sv=vVt;/**
* @license
* Knockout ES5 plugin - https://github.com/SteveSanderson/knockout-es5
* Copyright (c) Steve Sanderson
* MIT license
*/var Iae="__knockoutObservables",Pae="__knockoutSubscribable";function $Le(e,t){if(!e)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var n=this,i=JLe(e,!0);return t=t||Object.getOwnPropertyNames(e),t.forEach(function(r){if(!(r===Iae||r===Pae)&&!(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&&SVt(n,s)}}),e}function JLe(e,t){var n=e[Iae];return!n&&t&&(n={},Object.defineProperty(e,Iae,{value:n})),n}function EVt(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),$Le.call(i,e,[t]),e}function SVt(e,t){var n=null;e.computed(function(){n&&(n.dispose(),n=null);var i=t();i instanceof Array&&(n=wVt(e,t,i))})}function wVt(e,t,n){var i=IVt(e,n);return i.subscribe(t)}function IVt(e,t){var n=t[Pae];if(!n){n=new e.subscribable,Object.defineProperty(t,Pae,{value:n});var i={};PVt(t,n,i),DVt(e,t,n,i)}return n}function PVt(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 DVt(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 ZLe(e,t){if(!e)return null;var n=JLe(e,!1);return n&&n[t]||null}function RVt(e,t){var n=ZLe(e,t);n&&n.valueHasMutated()}function OVt(e){e.track=$Le,e.getObservable=ZLe,e.valueHasMutated=RVt,e.defineProperty=EVt}var m4={attachToKo:OVt};var QLe="http://www.w3.org/2000/svg",eNe="cesium-svgPath-svg",MVt={register:function(e){e.bindingHandlers.cesiumSvgPath={init:function(t,n){let i=document.createElementNS(QLe,"svg:svg");i.setAttribute("class",eNe);let r=document.createElementNS(QLe,"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",`${eNe} ${e.unwrap(o.css)}`)},disposeWhenNodeIsRemoved:t}),{controlsDescendantBindings:!0}}},e.virtualElements.allowedBindings.cesiumSvgPath=!0}},p4=MVt;m4.attachToKo(sv);p4.register(sv);var Ee=sv;function g4(e){l(e)||(e=new Vh),this._clock=e,this._eventHelper=new Lo,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(g4.prototype,{clock:{get:function(){return this._clock}}});g4.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};g4.prototype.isDestroyed=function(){return!1};g4.prototype.destroy=function(){this._eventHelper.removeAll(),ue(this)};var _4=g4;function LVt(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,pe.throwInstantiationError()}var Dae=LVt;var QI={};QI.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};QI.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};QI.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};QI.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};QI.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=QI;function tNe(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(tNe.prototype,{command:{get:function(){return this._command}}});var hb=tNe;function NVt(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 On=NVt;function FVt(e,t,n,i,r){return n.call(i,e[t]),Ee.getObservable(e,t).subscribe(n,i,r)}var yc=FVt;var cv="http://www.w3.org/2000/svg",rNe="http://www.w3.org/1999/xlink",f7,y4=U.fromCssColorString("rgba(247,250,255,0.384)"),d7=U.fromCssColorString("rgba(143,191,255,0.216)"),Rae=U.fromCssColorString("rgba(153,197,255,0.098)"),h7=U.fromCssColorString("rgba(255,255,255,0.086)"),BVt=U.fromCssColorString("rgba(255,255,255,0.267)"),kVt=U.fromCssColorString("rgba(255,255,255,0)"),nNe=U.fromCssColorString("rgba(66,67,68,0.3)"),iNe=U.fromCssColorString("rgba(0,0,0,0.5)");function mb(e){return U.fromCssColorString(window.getComputedStyle(e).getPropertyValue("color"))}var A4={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 op(e){let t=document.createElementNS(cv,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(op(e.children[r]))}else n.indexOf("xlink:")===0?t.setAttributeNS(rNe,n.substring(6),e[n]):n==="textContent"?t.textContent=e[n]:t.setAttribute(n,e[n]);return t}function Oae(e,t,n){let i=document.createElementNS(cv,"text");i.setAttribute("x",e),i.setAttribute("y",t),i.setAttribute("class","cesium-animation-svgText");let r=document.createElementNS(cv,"tspan");return r.textContent=n,i.appendChild(r),i}function zVt(e,t,n){e.setAttribute("transform",`translate(100,100) rotate(${n})`),t.setAttribute("transform",`rotate(${n})`)}var m7=new U;function Ua(e,t){let n=t.alpha,i=1-n;return m7.red=e.red*i+t.red*n,m7.green=e.green*i+t.green*n,m7.blue=e.blue*i+t.blue*n,m7.toCssColorString()}function Mae(e,t,n){let i=A4[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 op(r)}function UVt(e,t,n){let i=A4[n],r=A4.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 op(o)}function VVt(e,t){let n=e._viewModel,i=n.shuttleRingDragging;if(!(i&&f7!==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?(f7=e,n.shuttleRingDragging=!0,n.shuttleRingAngle=g):g<m?n.slower():g>m&&n.faster(),t.preventDefault()}else e===f7&&(f7=void 0),n.shuttleRingDragging=!1}function $_(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=[yc(t,"toggled",this.setToggled,this),yc(t,"tooltip",this.setTooltip,this),yc(t.command,"canExecute",this.setEnabled,this)]}$_.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)};$_.prototype.isDestroyed=function(){return!1};$_.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")}};$_.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")))};$_.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e};function eP(e,t){e=Bn(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(cv,"svg:svg");this._svgNode=o,o.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",rNe);let a=document.createElementNS(cv,"g");this._topG=a,this._realtimeSVG=new $_(UVt(3,4,"animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new $_(Mae(44,99,"animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new $_(Mae(124,99,"animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new $_(Mae(84,99,"animation_pathPause"),t.pauseViewModel);let s=document.createElementNS(cv,"g");s.appendChild(this._realtimeSVG.svgElement),s.appendChild(this._playReverseSVG.svgElement),s.appendChild(this._playForwardSVG.svgElement),s.appendChild(this._pauseSVG.svgElement);let c=op({tagName:"circle",class:"cesium-animation-shuttleRingBack",cx:100,cy:100,r:99});this._shuttleRingBackPanel=c;let u=A4.animation_pathSwooshFX,f=A4.animation_pathPointer,d=op({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=op({class:"cesium-animation-shuttleRingPointer",id:"animation_pathPointer",tagName:f.tagName,d:f.d});let p=op({tagName:"g",transform:"translate(100,100)"});this._knobOuter=op({tagName:"circle",class:"cesium-animation-knobOuter",cx:0,cy:0,r:71});let g=61,m=op({tagName:"circle",class:"cesium-animation-knobInner",cx:0,cy:0,r:g});this._knobDate=Oae(0,-24,""),this._knobTime=Oae(0,-7,""),this._knobStatus=Oae(0,-41,"");let y=op({tagName:"circle",class:"cesium-animation-blank",cx:0,cy:0,r:g}),A=document.createElementNS(cv,"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(P){VVt(b,P)}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=[yc(t.pauseViewModel,"toggled",function(P){w!==P&&(w=P,w?b._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):b._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))}),yc(t,"shuttleRingAngle",function(P){zVt(b._shuttleRingPointer,b._knobOuter,P)}),yc(t,"dateLabel",function(P){C.textContent!==P&&(C.textContent=P)}),yc(t,"timeLabel",function(P){T.textContent!==P&&(T.textContent=P)}),yc(t,"multiplierLabel",function(P){E.textContent!==P&&(E.textContent=P)})],this.applyThemeChanges(),this.resize()}Object.defineProperties(eP.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});eP.prototype.isDestroyed=function(){return!1};eP.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)};eP.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};eP.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=mb(this._themeNormal),n=mb(this._themeHover),i=mb(this._themeSelect),r=mb(this._themeDisabled),o=mb(this._themeKnob),a=mb(this._themePointer),s=mb(this._themeSwoosh),c=mb(this._themeSwooshHover),u=op({tagName:"defs",children:[{id:"animation_buttonNormal",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Ua(t,y4)},{tagName:"stop",offset:"12%","stop-color":Ua(t,d7)},{tagName:"stop",offset:"46%","stop-color":Ua(t,Rae)},{tagName:"stop",offset:"81%","stop-color":Ua(t,h7)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Ua(n,y4)},{tagName:"stop",offset:"12%","stop-color":Ua(n,d7)},{tagName:"stop",offset:"46%","stop-color":Ua(n,Rae)},{tagName:"stop",offset:"81%","stop-color":Ua(n,h7)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Ua(i,y4)},{tagName:"stop",offset:"12%","stop-color":Ua(i,d7)},{tagName:"stop",offset:"46%","stop-color":Ua(i,Rae)},{tagName:"stop",offset:"81%","stop-color":Ua(i,h7)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Ua(r,BVt)},{tagName:"stop",offset:"75%","stop-color":Ua(r,kVt)}]},{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":Ua(a,iNe)},{tagName:"stop",offset:"100%","stop-color":Ua(a,iNe)}]},{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":Ua(o,y4)},{tagName:"stop",offset:"60%","stop-color":Ua(o,nNe)},{tagName:"stop",offset:"85%","stop-color":Ua(o,d7)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":Ua(o,nNe)},{tagName:"stop",offset:"60%","stop-color":Ua(o,y4)},{tagName:"stop",offset:"85%","stop-color":Ua(o,h7)}]}]});l(this._defsElement)?this._svgNode.replaceChild(u,this._defsElement):this._svgNode.appendChild(u),this._defsElement=u};var b4=eP;var jVt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],pb=15,tP=105;function oNe(e,t){return e-t}function Lae(e,t){let n=Ar(t,e,oNe);return n<0?~n:n}function HVt(e,t){if(Math.abs(e)<=pb)return e/pb;let n=pb,i=tP,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 GVt(e,t,n){if(n.clockStep===Lr.SYSTEM_CLOCK)return pb;if(Math.abs(e)<=1)return e*pb;let i=t[t.length-1];e>i?e=i:e<-i&&(e=-i);let r=pb,o=tP,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 Ah(e){let t=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=Ah.defaultDateFormatter,this._timeFormatter=Ah.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,Ee.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(Ah.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===Lr.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 GVt(e.multiplier,t._allShuttleRingTicks,e)},set:function(a){a=Math.max(Math.min(a,tP),-tP);let s=t._allShuttleRingTicks,c=t._clockViewModel;if(c.clockStep=Lr.SYSTEM_CLOCK_MULTIPLIER,Math.abs(a)===tP){c.multiplier=a>0?s[s.length-1]:s[0];return}let u=HVt(a,s);if(t.snapToTicks)u=s[Lae(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>pb?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===la.UNBOUNDED)return!0;let c=a.multiplier,u=a.currentTime,f=a.startTime,d;if(s===la.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===la.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=On(function(){let a=t._clockViewModel;a.shouldAnimate?a.shouldAnimate=!1:t._canAnimate&&(a.shouldAnimate=!0)});this._pauseViewModel=new hb(n,{toggled:Ee.computed(function(){return!t._isAnimating}),tooltip:"Pause"});let i=On(function(){let a=t._clockViewModel,s=a.multiplier;s>0&&(a.multiplier=-s),a.shouldAnimate=!0});this._playReverseViewModel=new hb(i,{toggled:Ee.computed(function(){return t._isAnimating&&e.multiplier<0}),tooltip:"Play Reverse"});let r=On(function(){let a=t._clockViewModel,s=a.multiplier;s<0&&(a.multiplier=-s),a.shouldAnimate=!0});this._playForwardViewModel=new hb(r,{toggled:Ee.computed(function(){return t._isAnimating&&e.multiplier>0&&e.clockStep!==Lr.SYSTEM_CLOCK}),tooltip:"Play Forward"});let o=On(function(){t._clockViewModel.clockStep=Lr.SYSTEM_CLOCK},Ee.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new hb(o,{toggled:Ee.computed(function(){return e.clockStep===Lr.SYSTEM_CLOCK}),tooltip:Ee.computed(function(){return t._isSystemTimeAvailable?"Today (real-time)":"Current time not in range"})}),this._slower=On(function(){let a=t._clockViewModel,s=t._allShuttleRingTicks,c=a.multiplier,u=Lae(c,s)-1;u>=0&&(a.multiplier=s[u])}),this._faster=On(function(){let a=t._clockViewModel,s=t._allShuttleRingTicks,c=a.multiplier,u=Lae(c,s)+1;u<s.length&&(a.multiplier=s[u])})}Ah.defaultDateFormatter=function(e,t){let n=K.toGregorianDate(e);return`${jVt[n.month-1]} ${n.day} ${n.year}`};Ah.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];Ah.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`};Ah.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)};Ah.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(oNe);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(Ah.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}}});Ah._maxShuttleRingAngle=tP;Ah._realtimeShuttleRingAngle=pb;var x4=Ah;function aNe(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=Ta.fromProviderAsync(b[p]);y.add(T,0),this._currentImageryLayers.push(T)}}else{this._currentImageryLayers=[];let x=Ta.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 Dp),this._globe.terrainProvider=p;else if(l(p)){let g=!1,m=this._globe.terrainProviderChanged.addEventListener(()=>{g=!0,m()}),A=new s4(p).readyEvent.addEventListener(b=>{g||(this._globe.depthTestAgainstTerrain=!(b instanceof Dp),this._globe.terrainProvider=b,A())})}u(d),this.dropDownVisible=!1}});let f=this;this._toggleDropDown=On(function(){f.dropDownVisible=!f.dropDownVisible}),this.selectedImagery=e.selectedImageryProviderViewModel??n[0],this.selectedTerrain=e.selectedTerrainProviderViewModel}Object.defineProperties(aNe.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}});var T4=aNe;function p7(e,t){e=Bn(e);let n=new T4(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(p7.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});p7.prototype.isDestroyed=function(){return!1};p7.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 C4=p7;function sNe(e){let t=e.creationFunction;l(t.canExecute)||(t=On(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(sNe.prototype,{creationCommand:{get:function(){return this._creationCommand}},category:{get:function(){return this._category}}});var ro=sNe;function WVt(){let e=[],t=devicePixelRatio>=2;return e.push(new ro({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 e_({style:Qg.AERIAL})}})),e.push(new ro({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 e_({style:Qg.AERIAL_WITH_LABELS})}})),e.push(new ro({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 e_({style:Qg.ROAD})}})),e.push(new ro({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 Jg.fromBasemapType(Tm.SATELLITE,{enablePickFeatures:!1})}})),e.push(new ro({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 Jg.fromBasemapType(Tm.HILLSHADE,{enablePickFeatures:!1})}})),e.push(new ro({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 Jg.fromBasemapType(Tm.OCEANS,{enablePickFeatures:!1})}})),e.push(new ro({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 X_({url:"https://tile.openstreetmap.org/"})}})),e.push(new ro({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 X_({url:"https://tiles.stadiamaps.com/tiles/stamen_watercolor/",fileExtension:"jpg",credit:`&copy; <a href="https://stamen.com/" target="_blank">Stamen Design</a>
&copy; <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a>
&copy; <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a>
&copy; <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new ro({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 X_({url:"https://tiles.stadiamaps.com/tiles/stamen_toner/",retinaTiles:t,credit:`&copy; <a href="https://stamen.com/" target="_blank">Stamen Design</a>
&copy; <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a>
&copy; <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a>
&copy; <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new ro({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 X_({url:"https://tiles.stadiamaps.com/tiles/alidade_smooth/",retinaTiles:t,credit:`&copy; <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a>
&copy; <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a>
&copy; <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new ro({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 X_({url:"https://tiles.stadiamaps.com/tiles/alidade_smooth_dark/",retinaTiles:t,credit:`&copy; <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a>
&copy; <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a>
&copy; <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new ro({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 iu.fromAssetId(3954)}})),e.push(new ro({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 iu.fromAssetId(3845)}})),e.push(new ro({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 iu.fromAssetId(3812)}})),e.push(new ro({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 _A.fromUrl($t("Assets/Textures/NaturalEarthII"))}})),e.push(new ro({name:"Google Maps Satellite",iconUrl:$t("Widgets/Images/ImageryProviders/googleSatellite.png"),tooltip:"Imagery from Google Maps",category:"Cesium ion",creationFunction:function(){return iu.fromAssetId(3830182)}})),e.push(new ro({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 iu.fromAssetId(3830183)}})),e.push(new ro({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 iu.fromAssetId(3830184)}})),e.push(new ro({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 iu.fromAssetId(3830186)}})),e.push(new ro({name:"Azure Maps Aerial",iconUrl:$t("Widgets/Images/ImageryProviders/azureAerial.png"),tooltip:"Imagery from Azure Maps",category:"Cesium ion",creationFunction:function(){return iu.fromAssetId(3891168)}})),e.push(new ro({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 iu.fromAssetId(3891169)}})),e}var v4=WVt;function qVt(){let e=[];return e.push(new ro({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 Dp({ellipsoid:te.WGS84})}})),e.push(new ro({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 Dx({requestWaterMask:!0,requestVertexNormals:!0})}})),e}var E4=qVt;function YVt(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>&nbsp;&nbsp;&nbsp;&nbsp;${n[i]} in frustum ${o}`}t+=`<br>Total: ${e.totalCommands}`}return t}function Nae(e,t,n){let i=Math.min(n,t);return i=Math.max(i,e),i}var XVt=new dn,KVt=new h;function S4(e,t){let n=this,i=e.canvas,r=new Ka(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=On(function(){n.dropDownVisible=!n.dropDownVisible}),this._toggleGeneral=On(function(){n.generalVisible=!n.generalVisible}),this._togglePrimitives=On(function(){n.primitivesVisible=!n.primitivesVisible}),this._toggleTerrain=On(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 T_({container:n._performanceContainer}):n._performanceContainer.innerHTML=""}),this._showPrimitiveBoundingSphere=On(function(){return n._primitive.debugShowBoundingVolume=n.primitiveBoundingSphere,n._scene.requestRender(),!0}),this._primitiveBoundingSphereSubscription=Ee.getObservable(this,"primitiveBoundingSphere").subscribe(function(){n._showPrimitiveBoundingSphere()}),this._showPrimitiveReferenceFrame=On(function(){if(n.primitiveReferenceFrame){let u=n._primitive.modelMatrix;n._modelMatrixPrimitive=new VV({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=On(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=On(function(){let u=n.depthFrustum+1;return n.depthFrustum=Nae(1,n._numberOfFrustums,u),n._scene.requestRender(),!0}),this._decrementDepthFrustum=On(function(){let u=n.depthFrustum-1;return n.depthFrustum=Nae(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=On(function(){return n.tileCoordinates&&!l(a)?a=e.imageryLayers.addImageryProvider(new l4({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=On(function(){return n.tileBoundingSphere?o._surface.tileProvider._debug.boundingSphereTile=n._tile:o._surface.tileProvider._debug.boundingSphereTile=void 0,n._scene.requestRender(),!0}),this._doFilterTile=On(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=On(function(){n.pickPrimitiveActive=!n.pickPrimitiveActive}),this._pickPrimitiveActiveSubscription=Ee.getObservable(this,"pickPrimitiveActive").subscribe(function(u){u?r.setInputAction(s,cn.LEFT_CLICK):r.removeInputAction(cn.LEFT_CLICK)});function c(u){let f,d=o.ellipsoid,p=n._scene.camera.getPickRay(u.position,XVt),g=o.pick(p,n._scene,KVt);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=On(function(){n.pickTileActive=!n.pickTileActive}),this._pickTileActiveSubscription=Ee.getObservable(this,"pickTileActive").subscribe(function(u){u?r.setInputAction(c,cn.LEFT_CLICK):r.removeInputAction(cn.LEFT_CLICK)}),this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()})}Object.defineProperties(S4.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 On(function(){e.tile=e.tile.parent})}},selectNW:{get:function(){let e=this;return On(function(){e.tile=e.tile.northwestChild})}},selectNE:{get:function(){let e=this;return On(function(){e.tile=e.tile.northeastChild})}},selectSW:{get:function(){let e=this;return On(function(){e.tile=e.tile.southwestChild})}},selectSE:{get:function(){let e=this;return On(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}}});S4.prototype._update=function(){this.frustums&&(this.frustumStatisticText=YVt(this._scene.debugFrustumStatistics));let e=this._scene.numberOfFrustums;this._numberOfFrustums=e,this.depthFrustum=Nae(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}`};S4.prototype.isDestroyed=function(){return!1};S4.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 w4=S4;function g7(e,t){e=Bn(e);let n=document.createElement("div"),i=new w4(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: "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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"),P=document.createElement("div");P.className="cesium-cesiumInspector-pickSection",w.appendChild(P);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",P.appendChild(E);let O=document.createElement("div");P.appendChild(O);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 I=document.createElement("input");I.type="button",I.value="SE",I.className="cesium-cesiumInspector-pickButton",I.setAttribute("data-bind","click: selectSE");let M=document.createElement("div");M.className="cesium-cesiumInspector-tileText",O.className="cesium-cesiumInspector-frustumStatistics",O.appendChild(M),O.setAttribute("data-bind","visible: hasPickedTile"),M.setAttribute("data-bind","html: tileText");let F=document.createElement("div");F.className="cesium-cesiumInspector-relativeText",F.textContent="Select relative:",O.appendChild(F);let V=document.createElement("table"),k=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),k.appendChild(B),k.appendChild(G),k.appendChild(W);let Q=document.createElement("td"),q=document.createElement("td");q.appendChild(S);let J=document.createElement("td");J.appendChild(I),j.appendChild(Q),j.appendChild(q),j.appendChild(J),V.appendChild(k),V.appendChild(j),O.appendChild(V),P.appendChild(c("Show bounding volume","tileBoundingSphere","hasPickedTile")),P.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(g7.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});g7.prototype.isDestroyed=function(){return!1};g7.prototype.destroy=function(){return Ee.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),ue(this)};var I4=g7;function $Vt(e){return function(t){let n=e._scene.pick(t.position);l(n)&&n.primitive instanceof Uo&&(e.tileset=n.primitive),e.pickActive=!1}}function lNe(e,t){t?e._eventHandler.setInputAction(function(n){let i=e._scene.pick(n.endPosition);l(i)&&i.primitive instanceof Uo&&(e.tileset=i.primitive)},cn.MOUSE_MOVE):(e._eventHandler.removeInputAction(cn.MOUSE_MOVE),e.picking=e.picking)}var JVt={maximumFractionDigits:3};function P4(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,JVt):Math.round(t).toLocaleString()}function D4(e,t){if(!l(e))return"";let n=t?e._statisticsPerPass[no.PICK]:e._statisticsPerPass[no.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>${P4(n.geometryByteLength)}</li><li><strong>Texture Memory (MB): </strong>${P4(n.texturesByteLength)}</li><li><strong>Batch Table Memory (MB): </strong>${P4(n.batchTableByteLength)}</li>`,i+="</ul>"),i}function uNe(){let e=Mi.statistics;return`
<ul class="cesium-cesiumInspector-statistics">
<li><strong>Geometry Memory (MB): </strong>${P4(e.geometryByteLength)}</li>
<li><strong>Texture Memory (MB): </strong>${P4(e.texturesByteLength)}</li>
</ul>
`}var ZVt=[{text:"Highlight",value:ku.HIGHLIGHT},{text:"Replace",value:ku.REPLACE},{text:"Mix",value:ku.MIX}],cNe=new U(1,1,0,.4),QVt=new U,_7=new U;function Ac(e,t){let n=this,i=e.canvas;this._eventHandler=new Ka(i),this._scene=e,this._performanceContainer=t,this._canvas=i,this._performanceDisplay=new T_({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=ku.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 Qa?(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()}},cn.MOUSE_MOVE):(n.feature=void 0,n.tile=void 0,n._eventHandler.removeInputAction(cn.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=$Vt(this),w=Ee.observable();Ee.defineProperty(this,"pickActive",{get:function(){return w()},set:function(B){w(B),B?n._eventHandler.setInputAction(E,cn.LEFT_CLICK):n._eventHandler.removeInputAction(cn.LEFT_CLICK)}});let P=Ee.observable();Ee.defineProperty(this,"pointCloudShading",{get:function(){return P()},set:function(B){P(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 O=Ee.observable();Ee.defineProperty(this,"maximumAttenuation",{get:function(){return O()},set:function(B){B=Number(B),isNaN(B)||(O(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 I=Ee.observable();Ee.defineProperty(this,"skipLevelOfDetail",{get:function(){return I()},set:function(B){I(B),l(n._tileset)&&(n._tileset.skipLevelOfDetail=B)}}),this.skipLevelOfDetail=!0;let M=Ee.observable();Ee.defineProperty(this,"skipScreenSpaceErrorFactor",{get:function(){return M()},set:function(B){B=Number(B),isNaN(B)||(M(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 k=Ee.observable();Ee.defineProperty(this,"immediatelyLoadDesiredLevelOfDetail",{get:function(){return k()},set:function(B){k(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)||lNe(this,!0)}Object.defineProperties(Ac.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 ZVt}},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=D4(e,!1),this._pickStatisticsText=D4(e,!0),this._resourceCacheStatisticsText=uNe(),lNe(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,QVt):U.WHITE:t.color=_7,this._scene.requestRender()),l(e)&&(U.clone(e.color,_7),e.color=cNe,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()&&!Fae(t.content)&&(t.color=_7,this._scene.requestRender()),l(e)&&!Fae(e.content)&&(U.clone(e.color,_7),e.color=cNe,this._scene.requestRender()),this._tile=e}}});function Fae(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(!Fae(t[i]))return!1;return!0}return!1}Ac.prototype.togglePickTileset=function(){this.pickActive=!this.pickActive};Ac.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};Ac.prototype.toggleTileset=function(){this.tilesetVisible=!this.tilesetVisible};Ac.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};Ac.prototype.toggleUpdate=function(){this.updateVisible=!this.updateVisible};Ac.prototype.toggleLogging=function(){this.loggingVisible=!this.loggingVisible};Ac.prototype.toggleStyle=function(){this.styleVisible=!this.styleVisible};Ac.prototype.toggleTileDebugLabels=function(){this.tileDebugLabelsVisible=!this.tileDebugLabelsVisible};Ac.prototype.toggleOptimization=function(){this.optimizationVisible=!this.optimizationVisible};Ac.prototype.trimTilesCache=function(){l(this._tileset)&&this._tileset.trimLoadedTiles()};Ac.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 c_(JSON.parse(this.styleString)),this._shouldStyle=!0,this._scene.requestRender()}catch(t){this._editorError=t.toString()}this.feature=this._feature,this.tile=this._tile}};Ac.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};Ac.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=D4(e,!1),this._pickStatisticsText=D4(e,!0),this._resourceCacheStatisticsText=uNe())};Ac.prototype.isDestroyed=function(){return!1};Ac.prototype.destroy=function(){this._eventHandler.destroy(),this._removePostRenderEvent();let e=this;return this._definedProperties.forEach(function(t){Ee.getObservable(e,t).dispose()}),ue(this)};Ac.getStatistics=D4;var R4=Ac;function y7(e,t){e=Bn(e);let n=document.createElement("div"),i=document.createElement("div");i.setAttribute("data-bind","visible: performance");let r=new R4(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 P=document.createElement("div");P.setAttribute("data-bind","visible: pointCloudShading"),P.appendChild(u("Geometric Error Scale","geometricErrorScale",0,2,.01)),P.appendChild(u("Maximum Attenuation","maximumAttenuation",0,32,1)),P.appendChild(u("Base Resolution","baseResolution",0,1,.01)),P.appendChild(c("Eye Dome Lighting (EDL)","eyeDomeLighting")),p.appendChild(P);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)),P.appendChild(R),g.appendChild(c("Freeze Frame","freezeFrame")),g.appendChild(c("Dynamic Screen Space Error","dynamicScreenSpaceError"));let O=document.createElement("div");O.appendChild(u("Maximum Screen Space Error","maximumScreenSpaceError",0,128,1)),g.appendChild(O);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 I=document.createElement("div");A.appendChild(I),I.appendChild(document.createTextNode("Color Blend Mode: "));let M=document.createElement("select");M.setAttribute("data-bind",'options: colorBlendModes, optionsText: "text", optionsValue: "value", value: colorBlendMode'),I.appendChild(M);let F=document.createElement("textarea");F.setAttribute("data-bind","textInput: styleString, event: { keydown: styleEditorKeyPress }"),I.className="cesium-cesiumInspector-styleEditor",I.appendChild(F);let V=f("Compile (Ctrl+Enter)","compileStyle");I.appendChild(V);let k=document.createElement("div");k.className="cesium-cesiumInspector-error",k.setAttribute("data-bind","text: editorError"),I.appendChild(k),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(y7.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});y7.prototype.isDestroyed=function(){return!1};y7.prototype.destroy=function(){return Ee.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),ue(this)};var O4=y7;function A7(e,t){l(t)||(t=document.body),t=Bn(t);let n=this,i=Ee.observable(qo.fullscreen),r=Ee.observable(qo.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&&qo.enabled)}}),this.tooltip=void 0,Ee.defineProperty(this,"tooltip",function(){return this.isFullscreenEnabled?i()?"Exit full screen":"Full screen":"Full screen unavailable"}),this._command=On(function(){qo.fullscreen?qo.exitFullscreen():qo.requestFullscreen(n._fullscreenElement)},Ee.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=Bn(e)??o.body,this._callback=function(){i(qo.fullscreen)},o.addEventListener(qo.changeEventName,this._callback)}Object.defineProperties(A7.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){this._fullscreenElement=e}},command:{get:function(){return this._command}}});A7.prototype.isDestroyed=function(){return!1};A7.prototype.destroy=function(){document.removeEventListener(qo.changeEventName,this._callback),ue(this)};var M4=A7;var e4t="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",t4t="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 b7(e,t){e=Bn(e);let n=new M4(t,e);n._exitFullScreenPath=t4t,n._enterFullScreenPath=e4t;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(b7.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});b7.prototype.isDestroyed=function(){return!1};b7.prototype.destroy=function(){return this._viewModel.destroy(),Ee.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var L4=b7;var fNe=1e3;function ap(e){l(e.geocoderServices)?this._geocoderServices=e.geocoderServices:this._geocoderServices=[new ux({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=hNe,this._handleArrowUp=dNe;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=On(function(i){if(i=i??By.SEARCH,t._focusTextbox=!1,l(t._selectedSuggestion))return t.activateSuggestion(t._selectedSuggestion),!1;if(t.hideSuggestions(),t.isSearchInProgress)s4t(t);else return o4t(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?dNe(t):o?hNe(t):s&&t._searchCommand(),!0},this.activateSuggestion=function(i){t.hideSuggestions(),t._searchText=i.displayName;let r=i.destination;gNe(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??ap.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(){ap._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(ap.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 dNe(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],ap._adjustSuggestionsScroll(e,n)}function hNe(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],ap._adjustSuggestionsScroll(e,i)}function n4t(e,t){let n=l(t)?t.availability:void 0;return l(n)?Rx(t,[e]).then(function(i){return e=i[0],e.height+=fNe,e}):(e.height+=fNe,Promise.resolve(e))}function i4t(e,t){let n=e._scene,i=n.ellipsoid,r=n.camera,o=n.terrainProvider,a=t,s;return t instanceof ie?D.equalsEpsilon(t.south,t.north,D.EPSILON7)&&D.equalsEpsilon(t.east,t.west,D.EPSILON7)?t=ie.center(t):s=tC(t,n):t=i.cartesianToCartographic(t),l(s)||(s=n4t(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:L.IDENTITY})})}async function r4t(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 o4t(e,t,n){let i=e._searchText;if(pNe(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 r4t(t[r],i,n),l(o)&&o.state==="fulfilled"&&o.value.length>0)break}if(e._wasGeocodeCancelled)return;e._isSearchInProgress=!1,kae(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=mNe(e,SE.getCreditsFromResult(a[0]));l(s)||Bae(e,t[r].credit);return}e._searchText=`${i} (not found)`}function Bae(e,t){l(t)&&!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&(e._scene.frameState.creditDisplay.addStaticCredit(t),e._previousCredits.push(t))}function mNe(e,t){return l(t)&&t.forEach(n=>Bae(e,n)),t}function kae(e){!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&e._previousCredits.forEach(t=>{e._scene.frameState.creditDisplay.removeStaticCredit(t)}),e._previousCredits.length=0}function a4t(e,t){let n=Bn(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 s4t(e){e._isSearchInProgress&&(e._isSearchInProgress=!1,e._wasGeocodeCancelled=!0)}function pNe(e){return/^\s*$/.test(e)}function gNe(e){Ee.getObservable(e,"_suggestions").removeAll()}async function c4t(e){if(!e.autoComplete)return;let t=e._searchText;if(gNe(e),kae(e),!pNe(t))for(let n of e._geocoderServices){let i=await n.geocode(t,By.AUTOCOMPLETE);if(e._suggestions=e._suggestions.concat(i),i.length>0){let r=!0;i.forEach(o=>{let a=SE.getCreditsFromResult(o);r=r&&!l(a),mNe(e,a)}),r&&Bae(e,n.credit)}if(e._suggestions.length>=5)return}}ap.flyToDestination=i4t;ap._updateSearchSuggestions=c4t;ap._adjustSuggestionsScroll=a4t;ap.prototype.isDestroyed=function(){return!1};ap.prototype.destroy=function(){return this._suggestionSubscription.dispose(),kae(this),ue(this)};var N4=ap;var l4t="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",u4t="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 x7(e){let t=Bn(e.container),n=new N4(e);n._startSearchPath=l4t,n._stopSearchPath=u4t;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(x7.prototype,{container:{get:function(){return this._container}},searchSuggestionsContainer:{get:function(){return this._searchSuggestionsContainer}},viewModel:{get:function(){return this._viewModel}}});x7.prototype.isDestroyed=function(){return!1};x7.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 F4=x7;function _Ne(e,t){this._scene=e,this._duration=t;let n=this;this._command=On(function(){n._scene.camera.flyHome(n._duration)}),this.tooltip="View Home",Ee.track(this,["tooltip"])}Object.defineProperties(_Ne.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 B4=_Ne;function T7(e,t,n){e=Bn(e);let i=new B4(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(T7.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});T7.prototype.isDestroyed=function(){return!1};T7.prototype.destroy=function(){return Ee.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var k4=T7;function f4t(e,t){t.currentTarget.parentElement.parentElement.querySelector(`#${e.name}-expander`).classList.toggle("active"),t.currentTarget.textContent=t.currentTarget.textContent==="+"?"-":"+"}function ANe(e,t){Ee.track(e);for(let n=0;n<e.sublayers.length;n++)ANe(e.sublayers[n],t)}function C7(e){return e.modelName==="FullModel"}function bNe(e){return e.modelName==="Overview"}function xNe(e){return bNe(e)||C7(e)}function yNe(e,t){if(xNe(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 d4t(e,t){if(xNe(e)){t.sublayers.forEach(i=>i.visibility=!1),t.sublayers[e.index].visibility=!0;let n=document.getElementById("bsl-wrapper");C7(e)?(t.currentLevel=t.selectedLevel,n.style.display="block"):(t.selectedLevel=t.currentLevel,t.currentLevel="All",n.style.display="none")}}async function h4t(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 m4t(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:f4t,setOptionDisable:function(i,r){Ee.applyBindingsToNode(i,{disable:r.disable},r)},defaultLayer:void 0},this.viewModel.currentLayer.subscribe(function(i){d4t(i,t.viewModel)});let n=e.sublayers;for(let i=0;i<n.length;i++){ANe(n[i],this.viewModel);let r=yNe(n[i],this.viewModel);l(r)&&(bNe(r)||!l(this.viewModel.defaultLayer)&&C7(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=yNe(i,this.viewModel),this.viewModel.currentLayer.subscribe(function(r){e.show=C7(r)})}else this.viewModel.topLayers.length===1&&(this.viewModel.topLayers[0].name="Building layers not found");return h4t(e,this.levels),this.viewModel.currentLevel.subscribe(function(i){i!=="All"?e.filterByAttributes([{name:"BldgLevel",values:[i]}]):e.filterByAttributes()}),this.viewModel}var z4=m4t;function p4t(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 z4(t);Ee.track(r),Ee.applyBindings(r,n),l(r.defaultLayer)&&(r.currentLayer=r.defaultLayer)}var zae=p4t;var g4t="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",_4t="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 Uae(){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?_4t:g4t}}),Ee.defineProperty(this,"_bodyless",{get:function(){return!l(this.description)||this.description.length===0}})}Uae.prototype.maxHeightOffset=function(e){return`${this.maxHeight-e}px`};Object.defineProperties(Uae.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}});var U4=Uae;function v7(e){e=Bn(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="&times;",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 U4;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=yc(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(v7.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}});v7.prototype.isDestroyed=function(){return!1};v7.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 V4=v7;function TNe(){this.showInstructions=!1;let e=this;this._command=On(function(){e.showInstructions=!e.showInstructions}),this._showClick=On(function(){e._touch=!1}),this._showTouch=On(function(){e._touch=!0}),this._touch=!1,this.tooltip="Navigation Instructions",Ee.track(this,["tooltip","showInstructions","_touch"])}Object.defineProperties(TNe.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}});var j4=TNe;function E7(e){let t=Bn(e.container),n=new j4,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(E7.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});E7.prototype.isDestroyed=function(){return!1};E7.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 H4=E7;function Vae(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=On(function(){t.showingLowFrameRateMessage=!1,t.lowFrameRateMessageDismissed=!0});let n=WV.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(Vae.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}});Vae.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),ue(this)};var G4=Vae;function S7(e){let t=Bn(e.container),n=new G4(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="&times;",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(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 W4=S7;function w7(e){this._scene=e,this._orthographic=e.camera.frustum instanceof mn,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=On(function(){t.sceneMode===re.SCENE2D||t._flightInProgress||(t.dropDownVisible=!t.dropDownVisible)}),this._eventHelper=new Lo,this._eventHelper.add(e.morphComplete,function(n,i,r,o){t.sceneMode=r,t._orthographic=r===re.SCENE2D||t._scene.camera.frustum instanceof mn}),this._eventHelper.add(e.preRender,function(){t._flightInProgress=l(e.camera._currentFlight)}),this._switchToPerspective=On(function(){t.sceneMode!==re.SCENE2D&&(t._scene.camera.switchToPerspectiveFrustum(),t._orthographic=!1,t.dropDownVisible=!1)}),this._switchToOrthographic=On(function(){t.sceneMode!==re.SCENE2D&&(t._scene.camera.switchToOrthographicFrustum(),t._orthographic=!0,t.dropDownVisible=!1)}),this._sceneMode=re}Object.defineProperties(w7.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}}});w7.prototype.isDestroyed=function(){return!1};w7.prototype.destroy=function(){this._eventHelper.removeAll(),ue(this)};var q4=w7;var y4t="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",A4t="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 I7(e,t){e=Bn(e);let n=new q4(t);n._perspectivePath=y4t,n._orthographicPath=A4t;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(I7.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});I7.prototype.isDestroyed=function(){return!1};I7.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 Y4=I7;function P7(e,t){this._scene=e;let n=this,i=function(r,o,a,s){n.sceneMode=a,n.dropDownVisible=!1};this._eventHelper=new Lo,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=On(function(){n.dropDownVisible=!n.dropDownVisible}),this._morphTo2D=On(function(){e.morphTo2D(n._duration)}),this._morphTo3D=On(function(){e.morphTo3D(n._duration)}),this._morphToColumbusView=On(function(){e.morphToColumbusView(n._duration)}),this._sceneMode=re}Object.defineProperties(P7.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}}});P7.prototype.isDestroyed=function(){return!1};P7.prototype.destroy=function(){this._eventHelper.removeAll(),ue(this)};var X4=P7;var b4t="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",x4t="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",T4t="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 D7(e,t,n){e=Bn(e);let i=new X4(t,n);i._globePath=b4t,i._flatMapPath=x4t,i._columbusViewPath=T4t;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(D7.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});D7.prototype.isDestroyed=function(){return!1};D7.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 K4=D7;var C4t=new z,R7="-1000px";function $4(e,t,n){this._scene=e,this._screenPositionX=R7,this._screenPositionY=R7,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 sr.worldToWindowCoordinates(e,i,r)}}$4.prototype.update=function(){if(this.showSelection&&l(this.position)){let e=this.computeScreenSpacePosition(this.position,C4t);if(!l(e))this._screenPositionX=R7,this._screenPositionY=R7;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`}}};$4.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:fa.EXPONENTIAL_OUT})};$4.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:fa.EXPONENTIAL_OUT})};Object.defineProperties($4.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}});var J4=$4;function O7(e,t){e=Bn(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 J4(t,this._element,this._container);this._viewModel=c,Ee.applyBindings(this._viewModel,this._element)}Object.defineProperties(O7.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});O7.prototype.isDestroyed=function(){return!1};O7.prototype.destroy=function(){let e=this._container;return Ee.cleanNode(this._element),e.removeChild(this._element),ue(this)};var Z4=O7;function lv(e,t,n){this._color=e,this._height=t,this._base=n??0}lv.prototype.getHeight=function(){return this._height};lv.prototype.getBase=function(){return this._base};lv.prototype.getStartTime=function(){return this._start};lv.prototype.getStopTime=function(){return this._stop};lv.prototype.setRange=function(e,t){this._start=e,this._stop=t};lv.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 Q4=lv;function CNe(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)}CNe.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 e8=CNe;var jae=1e12,bh={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},mu={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},gb=[.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],v4t=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function pu(e,t){e=Bn(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=bh.none,this._touchMode=mu.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=E4t(this),this._onMouseUp=S4t(this),this._onMouseMove=w4t(this),this._onMouseWheel=I4t(this),this._onTouchStart=P4t(this),this._onTouchMove=R4t(this),this._onTouchEnd=D4t(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()}pu.prototype.addEventListener=function(e,t,n){this._topDiv.addEventListener(e,t,n)};pu.prototype.removeEventListener=function(e,t,n){this._topDiv.removeEventListener(e,t,n)};pu.prototype.isDestroyed=function(){return!1};pu.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)};pu.prototype.addHighlightRange=function(e,t,n){let i=new Q4(e,t,n);return this._highlightRanges.push(i),this.resize(),i};pu.prototype.addTrack=function(e,t,n,i){let r=new e8(e,t,n,i);return this._trackList.push(r),this._lastHeight=void 0,this.resize(),r};pu.prototype.zoomTo=function(e,t){if(this._startJulian=e,this._endJulian=t,this._timeBarSecondsSpan=K.secondsDifference(t,e),this._clock&&this._clock.clockRange!==la.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)};pu.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 Hae(e){return e<10?`0${e.toString()}`:e.toString()}pu.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`${v4t[t.month-1]} ${t.day} ${t.year} ${Hae(t.hour)}:${Hae(t.minute)}:${Hae(t.second)}${i}`};pu.prototype.smallestTicInPixels=7;pu.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 P=this._rulerEle.offsetWidth+20;P<30&&(P=180);let R=f;f-=u;let O={startTime:b,startJulian:g,epochJulian:y,duration:d,timeBarWidth:p,getAlpha:E};this._highlightRanges.forEach(function(B){a+=B.render(O)});let N=0,_=0,v=0,S=P/p;S>1&&(S=1),S*=this._timeBarSecondsSpan;let I=-1,M=-1,F=gb.length,V;for(V=0;V<F;++V){let B=gb[V];if(++I,N=B,B>S&&B>f)break;M<0&&p*(B/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(M=I)}if(I>0){for(;I>0;)if(--I,Math.abs(w(N,gb[I]))<1e-5){gb[I]>=f&&(_=gb[I]);break}if(M>=0)for(;M<I;){if(Math.abs(w(_,gb[M]))<1e-5&&gb[M]>=f){v=gb[M];break}++M}}f=R,f>u&&v<1e-5&&Math.abs(f-N)>u&&(v=f,f<=N+u&&(_=0));let k=-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=P);let q=W-(j/2-1);q>k?(k=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),O.y=0,this._trackList.forEach(function(B){B.render(o._context,O),O.y+=B.height})};pu.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)))};pu.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 E4t(e){return function(t){e._mouseMode!==bh.touchOnly&&(t.button===0?(e._mouseMode=bh.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition="-16px 0"),e._onMouseMove(t)):(e._mouseX=t.clientX,t.button===2?e._mouseMode=bh.zoom:e._mouseMode=bh.slide)),t.preventDefault()}}function S4t(e){return function(t){e._mouseMode=bh.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function w4t(e){return function(t){let n;if(e._mouseMode===bh.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===bh.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===bh.zoom&&(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0&&e.zoomFrom(Math.pow(1.01,n)))}}function I4t(e){return function(t){let n=t.wheelDeltaY||t.wheelDelta||-t.detail;jae=Math.max(Math.min(Math.abs(n),jae),1),n/=jae,e.zoomFrom(Math.pow(1.05,-n))}}function P4t(e){return function(t){let n=t.touches.length,i,r,o=e._topDiv.getBoundingClientRect().left;t.preventDefault(),e._mouseMode=bh.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=mu.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition=n===1?"-16px 0":"0 0")):(e._touchMode=mu.singleTap,e._touchState.centerX=t.touches[0].clientX-o)):n===2?(e._touchMode=mu.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=mu.ignore}}function D4t(e){return function(t){let n=t.touches.length,i=e._topDiv.getBoundingClientRect().left;e._touchMode===mu.singleTap?(e._touchMode=mu.scrub,e._onTouchMove(t)):e._touchMode===mu.scrub&&e._onTouchMove(t),e._mouseMode=bh.touchOnly,n!==1?e._touchMode=n>0?mu.ignore:mu.none:e._touchMode===mu.slideZoom&&(e._touchState.centerX=t.touches[0].clientX-i),e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0")}}function R4t(e){return function(t){let n,i,r,o,a,s,c=1,u=e._topDiv.getBoundingClientRect().left;e._touchMode===mu.singleTap&&(e._touchMode=mu.slideZoom),e._mouseMode=bh.touchOnly,e._touchMode===mu.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===mu.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))}}pu.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 t8=pu;var ENe=Go(vNe(),1);function O4t(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 SNe(){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 M4t(e,t,n,i){i()||(n()?(t.useWebVR=!1,e._locked&&(SNe(),e._locked=!1),e._noSleep.disable(),qo.exitFullscreen(),n(!1)):(qo.fullscreen||qo.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=O4t("landscape")),t.useWebVR=!0,n(!0)))}function M7(e,t){let n=this,i=Ee.observable(qo.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&&qo.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 Lo,this._eventHelper.add(e.preRender,function(){o(e.camera.frustum instanceof mn)}),this._locked=!1,this._noSleep=new ENe.default,this._command=On(function(){M4t(n,e,r,o)},Ee.getObservable(this,"isVREnabled")),this._vrElement=Bn(t)??document.body,this._callback=function(){!qo.fullscreen&&r()&&(e.useWebVR=!1,n._locked&&(SNe(),n._locked=!1),n._noSleep.disable(),r(!1))},document.addEventListener(qo.changeEventName,this._callback)}Object.defineProperties(M7.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){this._vrElement=e}},command:{get:function(){return this._command}}});M7.prototype.isDestroyed=function(){return!1};M7.prototype.destroy=function(){this._eventHelper.removeAll(),document.removeEventListener(qo.changeEventName,this._callback),ue(this)};var i8=M7;var L4t="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",N4t="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 L7(e,t,n){e=Bn(e);let i=new i8(t,n);i._exitVRPath=N4t,i._enterVRPath=L4t;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(L7.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});L7.prototype.isDestroyed=function(){return!1};L7.prototype.destroy=function(){return this._viewModel.destroy(),Ee.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var r8=L7;var wNe=new se;function DNe(e){let t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function F4t(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 B4t(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 INe(e,t){let n=e.scene.pick(t.position);if(l(n)){let i=n.id??n.primitive.id;if(i instanceof qr)return i;if(n instanceof Qa||n instanceof kT)return new qr({name:B4t(n),description:F4t(n),feature:n})}return V4t(e,t.position)}var k4t=new K;function Wae(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,D.EPSILON2,k4t)),e.updateFromClock(),e.zoomTo(i,r)}}}var z4t=new h;function U4t(e){let t=e.length;for(let n=0;n<t;++n){let i=e.get(n);if(i instanceof Uo)return i}}function V4t(e,t){let n=e.scene,i=n.camera.getPickRay(t);if(!l(i))return;let r=n.imageryLayers;if(!l(r)){let s=U4t(n.primitives);if(!l(s))return;r=s.imageryLayers}let o=r.pickImageryLayerFeatures(i,n);if(!l(o))return;let a=new qr({id:"Loading...",description:"Loading feature information..."});return o.then(function(s){if(e.selectedEntity!==a)return;if(!l(s)||s.length===0){e.selectedEntity=PNe();return}let c=s[0],u=new qr({id:c.name,description:c.description});if(l(c.position)){let f=e.scene.ellipsoid.cartographicToCartesian(c.position,z4t);u.position=new Kl(f)}e.selectedEntity=u},function(){e.selectedEntity===a&&(e.selectedEntity=PNe())}),a}function PNe(){return new qr({id:"None",description:"No features found."})}function j4t(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 rr(e,t){e=Bn(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 Vh,u=new _4(c),f=!0);let d=new EU(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 Lo;g.add(c.onTick,rr.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 Z4(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 V4(G);let W=y.viewModel;g.add(W.cameraClicked,rr.prototype._onInfoBoxCameraClicked,this),g.add(W.closeClicked,rr.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 ux({scene:p,geocodeProviderType:t.geocoder})]:l(t.geocoder)&&typeof t.geocoder!="boolean"&&(W=Array.isArray(t.geocoder)?t.geocoder:[t.geocoder]),b=new F4({container:G,geocoderServices:W,scene:p}),g.add(b.viewModel.search.beforeExecute,rr.prototype._clearObjects,this)}let x;(!l(t.homeButton)||t.homeButton!==!1)&&(x=new k4(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,rr.prototype._clearTrackedObject,this));let T;!s&&(!l(t.sceneModePicker)||t.sceneModePicker!==!1)&&(T=new K4(A,p));let C;t.projectionPicker&&(C=new Y4(A,p));let E,w;if(n){let G=t.imageryProviderViewModels??v4(),W=t.terrainProviderViewModels??E4();E=new C4(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 P;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{}P=new H4({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 b4(G,new x4(u))}let O;if(!l(t.timeline)||t.timeline!==!1){let G=document.createElement("div");G.className="cesium-viewer-timelineContainer",r.appendChild(G),O=new t8(G,c),O.addEventListener("settime",DNe,!1),O.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 L4(v,t.fullscreenElement),_=yc(N.viewModel,"isFullscreenEnabled",function(G){v.style.display=G?"block":"none",l(O)&&(O.container.style.right=`${v.clientWidth}px`,O.resize())}));let S,I,M;if(t.vrButton){let G=document.createElement("div");G.className="cesium-viewer-vrContainer",r.appendChild(G),S=new r8(G,p,t.fullScreenElement),I=yc(S.viewModel,"isVREnabled",function(W){G.style.display=W?"block":"none",l(N)&&(G.style.right=`${v.clientWidth}px`),l(O)&&(O.container.style.right=`${G.clientWidth}px`,O.resize())}),M=yc(S.viewModel,"isVRMode",function(W){j4t(i,W)})}this._baseLayerPickerDropDown=w,this._fullscreenSubscription=_,this._vrSubscription=I,this._vrModeSubscription=M,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=P,this._animation=R,this._timeline=O,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,rr.prototype._onDataSourceAdded,this),g.add(F.dataSourceRemoved,rr.prototype._onDataSourceRemoved,this),g.add(p.postUpdate,rr.prototype.resize,this);let k=F.length;for(let G=0;G<k;G++)this._dataSourceAdded(F,F.get(G));this._dataSourceAdded(void 0,V.defaultDataSource),g.add(F.dataSourceAdded,rr.prototype._dataSourceAdded,this),g.add(F.dataSourceRemoved,rr.prototype._dataSourceRemoved,this);function j(G){let W=INe(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=INe(i,G)}d.screenSpaceEventHandler.setInputAction(B,cn.LEFT_CLICK),d.screenSpaceEventHandler.setInputAction(j,cn.LEFT_DOUBLE_CLICK),d._canAnimateUpdateCallback=this._updateCanAnimate(this)}Object.defineProperties(rr.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,Wae(this._timeline,e))}}});rr.prototype.extend=function(e,t){e(this,t)};rr.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};rr.prototype.forceResize=function(){this._lastWidth=0,this.resize()};rr.prototype.render=function(){this._cesiumWidget.render()};rr.prototype.isDestroyed=function(){return!1};rr.prototype.destroy=function(){return l(this.screenSpaceEventHandler)&&!this.screenSpaceEventHandler.isDestroyed()&&(this.screenSpaceEventHandler.removeInputAction(cn.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(cn.LEFT_DOUBLE_CLICK)),this._container.removeChild(this._element),this._element.removeChild(this._toolbar),this._eventHelper.removeAll(),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",DNe,!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)};rr.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(rr.prototype._onEntityCollectionChanged,this)};rr.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(rr.prototype._onEntityCollectionChanged,this),l(this.selectedEntity)&&n.getById(this.selectedEntity.id)===this.selectedEntity&&(this.selectedEntity=void 0)};rr.prototype._updateCanAnimate=function(e){return function(t){e._clockViewModel.canAnimate=t}};rr.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,wNe)!==It.FAILED?n=wNe.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=""))};rr.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)}};rr.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)}};rr.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};rr.prototype._onInfoBoxClockClicked=function(e){this.selectedEntity=void 0};rr.prototype._clearObjects=function(){this.trackedEntity=void 0,this.selectedEntity=void 0};rr.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&Wae(this.timeline,e)};rr.prototype._onDataSourceAdded=function(e,t){this._cesiumWidget._automaticallyTrackDataSourceClocks&&t===this.clockTrackedDataSource&&Wae(this._timeline,t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,rr.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};rr.prototype._onDataSourceRemoved=function(e,t){let n=t.entities.id;this._dataSourceChangedListeners[n](),this._dataSourceChangedListeners[n]=void 0};rr.prototype.addController=function(e){return this._cesiumWidget.addController(e)};rr.prototype.removeController=function(e){return this._cesiumWidget.removeController(e)};rr.prototype.zoomTo=function(e,t){return this._cesiumWidget.zoomTo(e,t)};rr.prototype.flyTo=function(e,t){return this._cesiumWidget.flyTo(e,t)};var qae=rr;function H4t(e){let t=document.createElement("div");t.className="cesium-viewer-cesium3DTilesInspectorContainer",e.container.appendChild(t);let n=new O4(t,e.scene);Object.defineProperties(e,{cesium3DTilesInspector:{get:function(){return n}}})}var Yae=H4t;function G4t(e){let t=document.createElement("div");t.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(t);let n=new I4(t,e.scene);Object.defineProperties(e,{cesiumInspector:{get:function(){return n}}})}var Xae=G4t;function W4t(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=Bn(a),Object.defineProperties(e,{dropTarget:{get:function(){return a},set:function(f){RNe(a,u),a=f,Kae(a,u)}},dropEnabled:{get:function(){return n},set:function(f){f!==n&&(f?Kae(a,u):RNe(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){uv(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=q4t(e,m,c,s),y.onerror=Y4t(e,m),y.readAsText(m)}}Kae(a,u),e.destroy=UM(e,e.destroy,function(){e.dropEnabled=!1}),e._handleDrop=u}function uv(e){e.stopPropagation(),e.preventDefault()}function RNe(e,t){let n=e;l(n)&&(n.removeEventListener("drop",t,!1),n.removeEventListener("dragenter",uv,!1),n.removeEventListener("dragover",uv,!1),n.removeEventListener("dragexit",uv,!1))}function Kae(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",uv,!1),e.addEventListener("dragover",uv,!1),e.addEventListener("dragexit",uv,!1)}function q4t(e,t,n,i){let r=e.scene;return function(o){let a=t.name;try{let s;if(/\.czml$/i.test(a))s=OU.load(JSON.parse(o.target.result),{sourceUri:a});else if(/\.geojson$/i.test(a)||/\.json$/i.test(a)||/\.topojson$/i.test(a))s=tb.load(JSON.parse(o.target.result),{sourceUri:a,clampToGround:i});else if(/\.(kml|kmz)$/i.test(a))s=JC.load(t,{sourceUri:a,proxy:n,camera:r.camera,canvas:r.canvas,clampToGround:i,screenOverlayContainer:e.container});else if(/\.gpx$/i.test(a))s=BU.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 Y4t(e,t){return function(n){e.dropError.raiseEvent(e,t.name,n.target.error)}}var $ae=W4t;function X4t(e,t){t=t??H.EMPTY_OBJECT;let n=new W4({scene:e.scene,container:e.bottomContainer,lowFrameRateMessage:t.lowFrameRateMessage});Object.defineProperties(e,{performanceWatchdog:{get:function(){return n}}})}var Jae=X4t;function ONe(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 xh(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=ONe(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===_c.BOX}}),n({name:"shapeIsEllipsoid",getPrimitiveFunction:function(){let r=t._voxelPrimitive.shape;t.shapeIsEllipsoid=r===_c.ELLIPSOID}}),n({name:"shapeIsCylinder",getPrimitiveFunction:function(){let r=t._voxelPrimitive.shape;t.shapeIsCylinder=r===_c.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:-D.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitudeMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingEllipsoidMaxLongitudeMax",initialValue:D.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:-D.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitudeMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingEllipsoidMinLongitudeMax",initialValue:D.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:-D.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitudeMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingEllipsoidMaxLatitudeMax",initialValue:D.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:-D.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitudeMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingEllipsoidMinLatitudeMax",initialValue:D.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:-D.PI,getPrimitiveFunction:function(){t.clippingCylinderMaxAngleMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingCylinderMaxAngleMax",initialValue:D.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:-D.PI}),n({name:"clippingCylinderMinAngleMax",initialValue:D.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&&I0(t)},getPrimitiveFunction:function(){t.translationX=L.getTranslation(t._voxelPrimitive.modelMatrix,new h).x}}),n({name:"translationY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&I0(t)},getPrimitiveFunction:function(){t.translationY=L.getTranslation(t._voxelPrimitive.modelMatrix,new h).y}}),n({name:"translationZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&I0(t)},getPrimitiveFunction:function(){t.translationZ=L.getTranslation(t._voxelPrimitive.modelMatrix,new h).z}}),n({name:"scaleX",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&I0(t)},getPrimitiveFunction:function(){t.scaleX=L.getScale(t._voxelPrimitive.modelMatrix,new h).x}}),n({name:"scaleY",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&I0(t)},getPrimitiveFunction:function(){t.scaleY=L.getScale(t._voxelPrimitive.modelMatrix,new h).y}}),n({name:"scaleZ",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&I0(t)},getPrimitiveFunction:function(){t.scaleZ=L.getScale(t._voxelPrimitive.modelMatrix,new h).z}}),n({name:"angleX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&I0(t)}}),n({name:"angleY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&I0(t)}}),n({name:"angleZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&I0(t)}})}var K4t=new h,$4t=new h,J4t=new Tc,Z4t=new $;function I0(e){let t=h.fromElements(e.translationX,e.translationY,e.translationZ,K4t),n=h.fromElements(e.scaleX,e.scaleY,e.scaleZ,$4t),i=J4t;i.heading=e.angleX,i.pitch=e.angleY,i.roll=e.angleZ;let r=$.fromHeadingPitchRoll(i,Z4t),o=$.multiplyByScale(r,n,r);e._voxelPrimitive.modelMatrix=L.fromRotationTranslation(o,t,e._voxelPrimitive.modelMatrix)}Object.defineProperties(xh.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=ONe(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,I0(t)}}});xh.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};xh.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};xh.prototype.toggleTransform=function(){this.transformVisible=!this.transformVisible};xh.prototype.toggleBounds=function(){this.boundsVisible=!this.boundsVisible};xh.prototype.toggleClipping=function(){this.clippingVisible=!this.clippingVisible};xh.prototype.toggleShader=function(){this.shaderVisible=!this.shaderVisible};xh.prototype.compileShader=function(){l(this._voxelPrimitive)&&(this._voxelPrimitive.customShader=new h0({fragmentShaderText:this.shaderString,uniforms:this._voxelPrimitive.customShader.uniforms}))};xh.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};xh.prototype.isDestroyed=function(){return!1};xh.prototype.destroy=function(){let e=this;return this._definedProperties.forEach(function(t){Ee.getObservable(e,t).dispose()}),ue(this)};var o8=xh;function N7(e,t){e=Bn(e);let n=document.createElement("div"),i=new o8(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=D.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)),Zae("Max X","Min X","Max Y","Min Y","Max Z","Min Z","clippingBoxMaxX","clippingBoxMinX","clippingBoxMaxY","clippingBoxMinY","clippingBoxMaxZ","clippingBoxMinZ","shapeIsBox",p),Zae("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","clippingEllipsoidMaxLongitude","clippingEllipsoidMinLongitude","clippingEllipsoidMaxLatitude","clippingEllipsoidMinLatitude","clippingEllipsoidMaxHeight","clippingEllipsoidMinHeight","shapeIsEllipsoid",p),Zae("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(N7.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});N7.prototype.isDestroyed=function(){return!1};N7.prototype.destroy=function(){return Ee.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),ue(this)};function Zae(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 a8=N7;function Q4t(e){let t=document.createElement("div");t.className="cesium-viewer-voxelInspectorContainer",e.container.appendChild(t);let n=new a8(t,e.scene);Object.defineProperties(e,{voxelInspector:{get:function(){return n}}})}var Qae=Q4t;globalThis.CESIUM_VERSION="1.144.0";var e8t="1.144.0";0&&(module.exports={AlphaMode,AlphaPipelineStage,AnchorPointDirect,AnchorPointIndirect,Animation,AnimationViewModel,Appearance,ApproximateTerrainHeights,ArcGISTiledElevationTerrainProvider,ArcGisBaseMapType,ArcGisMapServerImageryProvider,ArcGisMapService,ArcType,ArticulationStageType,AssociativeArray,Atmosphere,AtmospherePipelineStage,AttributeCompression,AttributeType,AutoExposure,AutomaticUniforms,Axis,AxisAlignedBoundingBox,Azure2DImageryProvider,B3dmLoader,B3dmParser,BaseLayerPicker,BaseLayerPickerViewModel,BatchTable,BatchTableHierarchy,BatchTexture,BatchTexturePipelineStage,Billboard,BillboardCollection,BillboardGraphics,BillboardLoadState,BillboardTexture,BillboardVisualizer,BingMapsGeocoderService,BingMapsImageryProvider,BingMapsStyle,BlendEquation,BlendFunction,BlendOption,BlendingState,BoundingRectangle,BoundingSphere,BoundingSphereState,BoundingVolumeSemantics,BoxEmitter,BoxGeometry,BoxGeometryUpdater,BoxGraphics,BoxOutlineGeometry,BrdfLutGenerator,Buffer,BufferLoader,BufferPoint,BufferPointCollection,BufferPointMaterial,BufferPolygon,BufferPolygonCollection,BufferPolygonMaterial,BufferPolyline,BufferPolylineCollection,BufferPolylineMaterial,BufferPrimitive,BufferPrimitiveCollection,BufferPrimitiveMaterial,BufferUsage,CPUStylingPipelineStage,CallbackPositionProperty,CallbackProperty,Camera,CameraEventAggregator,CameraEventType,CameraFlightPath,Cartesian2,Cartesian3,Cartesian4,CartesianRectangle,Cartographic,CartographicGeocoderService,CatmullRomSpline,Cesium3DContentGroup,Cesium3DTile,Cesium3DTileBatchTable,Cesium3DTileColorBlendMode,Cesium3DTileContent,Cesium3DTileContentFactory,Cesium3DTileContentState,Cesium3DTileContentType,Cesium3DTileFeature,Cesium3DTileFeatureTable,Cesium3DTileOptimizationHint,Cesium3DTileOptimizations,Cesium3DTilePass,Cesium3DTilePassState,Cesium3DTilePointFeature,Cesium3DTileRefine,Cesium3DTileStyle,Cesium3DTileStyleEngine,Cesium3DTileVectorFeature,Cesium3DTilesInspector,Cesium3DTilesInspectorViewModel,Cesium3DTilesTerrainData,Cesium3DTilesTerrainGeometryProcessor,Cesium3DTilesTerrainProvider,Cesium3DTilesVoxelProvider,Cesium3DTileset,Cesium3DTilesetBaseTraversal,Cesium3DTilesetCache,Cesium3DTilesetGraphics,Cesium3DTilesetHeatmap,Cesium3DTilesetMetadata,Cesium3DTilesetMostDetailedTraversal,Cesium3DTilesetSkipTraversal,Cesium3DTilesetStatistics,Cesium3DTilesetTraversal,Cesium3DTilesetVisualizer,CesiumInspector,CesiumInspectorViewModel,CesiumTerrainProvider,CesiumWidget,Check,CheckerboardMaterialProperty,CircleEmitter,CircleGeometry,CircleOutlineGeometry,ClassificationModelDrawCommand,ClassificationPipelineStage,ClassificationPrimitive,ClassificationType,ClearCommand,ClippingPlane,ClippingPlaneCollection,ClippingPolygon,ClippingPolygonCollection,Clock,ClockRange,ClockStep,ClockViewModel,CloudCollection,CloudType,Color,ColorBlendMode,ColorGeometryInstanceAttribute,ColorMaterialProperty,Command,ComponentDatatype,Composite3DTileContent,CompositeEntityCollection,CompositeMaterialProperty,CompositePositionProperty,CompositeProperty,CompressedTextureBuffer,ComputeCommand,ComputeEngine,ConditionsExpression,ConeEmitter,ConstantPositionProperty,ConstantProperty,ConstantSpline,ContentMetadata,Context,ContextLimits,Controller,ControllerHost,CoplanarPolygonGeometry,CoplanarPolygonGeometryLibrary,CoplanarPolygonOutlineGeometry,CornerType,CorrelationGroup,CorridorGeometry,CorridorGeometryLibrary,CorridorGeometryUpdater,CorridorGraphics,CorridorOutlineGeometry,Credit,CreditDisplay,CubeMap,CubeMapFace,CubeMapPanorama,CubicRealPolynomial,CullFace,CullingVolume,CumulusCloud,CustomDataSource,CustomHeightmapTerrainProvider,CustomShader,CustomShaderMode,CustomShaderPipelineStage,CustomShaderTranslucencyMode,CylinderGeometry,CylinderGeometryLibrary,CylinderGeometryUpdater,CylinderGraphics,CylinderOutlineGeometry,CzmlDataSource,DataSource,DataSourceClock,DataSourceCollection,DataSourceDisplay,DebugAppearance,DebugCameraPrimitive,DebugInspector,DebugModelMatrixPrimitive,DefaultProxy,DepthFunction,DepthPlane,DequantizationPipelineStage,DerivedCommand,DeveloperError,DeviceOrientationCameraController,DirectionalLight,DiscardEmptyTileImagePolicy,DiscardMissingTileImagePolicy,DistanceDisplayCondition,DistanceDisplayConditionGeometryInstanceAttribute,DoubleEndedPriorityQueue,DoublyLinkedList,DracoLoader,DrawCommand,DynamicAtmosphereLightingType,DynamicEnvironmentMapManager,DynamicGeometryBatch,DynamicGeometryUpdater,EarthOrientationParameters,EarthOrientationParametersSample,EasingFunction,EdgeDetectionPipelineStage,EdgeDisplayMode,EdgeFramebuffer,EdgeVisibilityPipelineStage,EllipseGeometry,EllipseGeometryLibrary,EllipseGeometryUpdater,EllipseGraphics,EllipseOutlineGeometry,Ellipsoid,EllipsoidGeodesic,EllipsoidGeometry,EllipsoidGeometryUpdater,EllipsoidGraphics,EllipsoidOutlineGeometry,EllipsoidPrimitive,EllipsoidRhumbLine,EllipsoidSurfaceAppearance,EllipsoidTangentPlane,EllipsoidTerrainProvider,EllipsoidalOccluder,Empty3DTileContent,EncodedCartesian3,Entity,EntityCluster,EntityCollection,EntityView,EquirectangularPanorama,Event,EventHelper,Expression,ExpressionNodeType,ExtrapolationType,FeatureDetection,FeatureIdPipelineStage,Fog,ForEach,FrameRateMonitor,FrameState,Framebuffer,FramebufferManager,Frozen,FrustumCommands,FrustumGeometry,FrustumOutlineGeometry,Fullscreen,FullscreenButton,FullscreenButtonViewModel,GaussianSplat3DTileContent,GaussianSplatPrimitive,GaussianSplatRenderResources,GaussianSplatSorter,GaussianSplatTextureGenerator,GeoJsonDataSource,GeoJsonLoader,GeoJsonPrimitive,GeocodeType,Geocoder,GeocoderService,GeocoderViewModel,GeographicProjection,GeographicTilingScheme,Geometry,Geometry3DTileContent,GeometryAttribute,GeometryAttributes,GeometryFactory,GeometryInstance,GeometryInstanceAttribute,GeometryOffsetAttribute,GeometryPipeline,GeometryPipelineStage,GeometryType,GeometryUpdater,GeometryUpdaterSet,GeometryVisualizer,GetFeatureInfoFormat,Globe,GlobeDepth,GlobeSurfaceShaderSet,GlobeSurfaceTile,GlobeSurfaceTileProvider,GlobeTranslucency,GlobeTranslucencyFramebuffer,GlobeTranslucencyState,GltfBufferViewLoader,GltfDracoLoader,GltfGpmLoader,GltfGpmLocal,GltfImageLoader,GltfIndexBufferLoader,GltfJsonLoader,GltfLoader,GltfLoaderUtil,GltfMeshPrimitiveGpmLoader,GltfSpzLoader,GltfStructuralMetadataLoader,GltfTextureLoader,GltfVertexBufferLoader,Google2DImageryProvider,GoogleEarthEnterpriseImageryProvider,GoogleEarthEnterpriseMapsProvider,GoogleEarthEnterpriseMetadata,GoogleEarthEnterpriseTerrainData,GoogleEarthEnterpriseTerrainProvider,GoogleEarthEnterpriseTileInformation,GoogleGeocoderService,GoogleMaps,GoogleStreetViewCubeMapPanoramaProvider,GpxDataSource,GregorianDate,GridImageryProvider,GridMaterialProperty,GroundGeometryUpdater,GroundPolylineGeometry,GroundPolylinePrimitive,GroundPrimitive,GroupMetadata,HeadingPitchRange,HeadingPitchRoll,Heap,HeightReference,HeightmapEncoding,HeightmapTerrainData,HeightmapTessellator,HermitePolynomialApproximation,HermiteSpline,HilbertOrder,HomeButton,HomeButtonViewModel,HorizontalOrigin,HybridScreenSpacePanCameraController,I3SBuildingSceneLayerExplorer,I3SBuildingSceneLayerExplorerViewModel,I3SDataProvider,I3SDecoder,I3SFeature,I3SField,I3SGeometry,I3SLayer,I3SNode,I3SStatistics,I3SSublayer,I3SSymbology,I3dmLoader,I3dmParser,ITwinData,ITwinPlatform,Iau2000Orientation,Iau2006XysData,Iau2006XysSample,IauOrientationAxes,IauOrientationParameters,ImageBasedLighting,ImageBasedLightingPipelineStage,ImageMaterialProperty,Imagery,ImageryConfiguration,ImageryCoverage,ImageryFlags,ImageryInput,ImageryLayer,ImageryLayerCollection,ImageryLayerFeatureInfo,ImageryPipelineStage,ImageryProvider,ImageryState,Implicit3DTileContent,ImplicitAvailabilityBitstream,ImplicitMetadataView,ImplicitSubdivisionScheme,ImplicitSubtree,ImplicitSubtreeCache,ImplicitSubtreeMetadata,ImplicitTileCoordinates,ImplicitTileset,IndexDatatype,InfoBox,InfoBoxViewModel,InspectorShared,InstanceAttributeSemantic,InstancingPipelineStage,InterpolationAlgorithm,InterpolationType,Intersect,IntersectionTests,Intersections2D,Interval,InvertClassification,Ion,IonGeocodeProviderType,IonGeocoderService,IonImageryProvider,IonImageryProviderFactory,IonResource,IonWorldImageryStyle,Iso8601,JobScheduler,JobType,JsonMetadataTable,JulianDate,KTX2Transcoder,KeyboardEventModifier,KeyframeNode,KmlCamera,KmlDataSource,KmlLookAt,KmlTour,KmlTourFlyTo,KmlTourWait,Label,LabelCollection,LabelGraphics,LabelStyle,LabelVisualizer,LagrangePolynomialApproximation,LeapSecond,Light,LightingModel,LightingPipelineStage,LinearApproximation,LinearSpline,MVTDataProvider,ManagedArray,MapMode2D,MapProjection,MapboxImageryProvider,MapboxStyleImageryProvider,MappedPositions,Material,MaterialAppearance,MaterialPipelineStage,MaterialProperty,Math,Matrix2,Matrix3,Matrix4,Megatexture,MeshPrimitiveGpmLocal,MetadataClass,MetadataClassProperty,MetadataComponentType,MetadataEntity,MetadataEnum,MetadataEnumValue,MetadataPicking,MetadataPickingPipelineStage,MetadataPipelineStage,MetadataSchema,MetadataSchemaLoader,MetadataSemantic,MetadataTable,MetadataTableProperty,MetadataType,MipmapHint,Model,Model3DTileContent,ModelAlphaOptions,ModelAnimation,ModelAnimationChannel,ModelAnimationCollection,ModelAnimationLoop,ModelAnimationState,ModelArticulation,ModelArticulationStage,ModelClippingPlanesPipelineStage,ModelClippingPolygonsPipelineStage,ModelColorPipelineStage,ModelComponents,ModelDrawCommand,ModelDrawCommands,ModelFeature,ModelFeatureTable,ModelGraphics,ModelImagery,ModelImageryMapping,ModelLightingOptions,ModelMatrixUpdateStage,ModelNode,ModelPrimitiveImagery,ModelReader,ModelRenderResources,ModelRuntimeNode,ModelRuntimePrimitive,ModelSceneGraph,ModelSilhouettePipelineStage,ModelSkin,ModelSplitterPipelineStage,ModelStatistics,ModelType,ModelUtility,ModelVisualizer,Moon,MorphTargetsPipelineStage,MorphWeightSpline,MortonOrder,MouseButton,Multiple3DTileContent,MultisampleFramebuffer,NavigationHelpButton,NavigationHelpButtonViewModel,NearFarScalar,NeverTileDiscardPolicy,NodeRenderResources,NodeStatisticsPipelineStage,NodeTransformationProperty,OIT,Occluder,OffsetGeometryInstanceAttribute,OpenCageGeocoderService,OpenStreetMapImageryProvider,OrderedGroundPrimitiveCollection,OrientedBoundingBox,OrthographicFrustum,OrthographicOffCenterFrustum,Packable,PackableForInterpolation,Panorama,PanoramaProvider,Particle,ParticleBurst,ParticleEmitter,ParticleSystem,Pass,PassState,PathGraphics,PathMode,PathVisualizer,PeliasGeocoderService,PerInstanceColorAppearance,PerformanceDisplay,PerformanceWatchdog,PerformanceWatchdogViewModel,PerspectiveFrustum,PerspectiveOffCenterFrustum,PickDepth,PickDepthFramebuffer,PickFramebuffer,PickId,PickedMetadataInfo,Picking,PickingPipelineStage,PinBuilder,PixelDatatype,PixelFormat,PlanarFillIdFramebuffer,Plane,PlaneGeometry,PlaneGeometryUpdater,PlaneGraphics,PlaneOutlineGeometry,PntsLoader,PntsParser,PointCloud,PointCloudEyeDomeLighting,PointCloudShading,PointCloudStylingPipelineStage,PointGraphics,PointPrimitive,PointPrimitiveCollection,PointVisualizer,PolygonGeometry,PolygonGeometryLibrary,PolygonGeometryUpdater,PolygonGraphics,PolygonHierarchy,PolygonOutlineGeometry,PolygonPipeline,Polyline,PolylineArrowMaterialProperty,PolylineCollection,PolylineColorAppearance,PolylineDashMaterialProperty,PolylineGeometry,PolylineGeometryUpdater,PolylineGlowMaterialProperty,PolylineGraphics,PolylineMaterialAppearance,PolylineOutlineMaterialProperty,PolylinePipeline,PolylineVisualizer,PolylineVolumeGeometry,PolylineVolumeGeometryLibrary,PolylineVolumeGeometryUpdater,PolylineVolumeGraphics,PolylineVolumeOutlineGeometry,PositionProperty,PositionPropertyArray,PostProcessStage,PostProcessStageCollection,PostProcessStageComposite,PostProcessStageLibrary,PostProcessStageSampleMode,PostProcessStageTextureCache,PpeMetadata,PpeSource,PpeTexture,Primitive,PrimitiveCollection,PrimitiveLoadPlan,PrimitiveOutlineGenerator,PrimitiveOutlinePipelineStage,PrimitivePipeline,PrimitiveRenderResources,PrimitiveState,PrimitiveStatisticsPipelineStage,PrimitiveType,ProjectionPicker,ProjectionPickerViewModel,Property,PropertyArray,PropertyAttribute,PropertyAttributeProperty,PropertyBag,PropertyTable,PropertyTexture,PropertyTextureProperty,ProviderViewModel,Proxy,QuadraticRealPolynomial,QuadtreeOccluders,QuadtreePrimitive,QuadtreeTile,QuadtreeTileLoadState,QuadtreeTileProvider,QuantizedMeshTerrainData,QuarticRealPolynomial,Quaternion,QuaternionSpline,Queue,Ray,Rectangle,RectangleCollisionChecker,RectangleGeometry,RectangleGeometryLibrary,RectangleGeometryUpdater,RectangleGraphics,RectangleOutlineGeometry,ReferenceFrame,ReferenceProperty,RenderState,Renderbuffer,RenderbufferFormat,Request,RequestErrorEvent,RequestScheduler,RequestState,RequestType,Resource,ResourceCache,ResourceCacheKey,ResourceCacheStatistics,ResourceLoader,ResourceLoaderState,Rotation,RuntimeError,S2Cell,SDFSettings,SampledPositionProperty,SampledProperty,Sampler,ScaledPositionProperty,Scene,SceneFramebuffer,SceneMode,SceneMode2DPipelineStage,SceneModePicker,SceneModePickerViewModel,SceneTransforms,SceneTransitioner,ScreenSpaceCameraController,ScreenSpaceElevatorCameraController,ScreenSpaceEventHandler,ScreenSpaceEventType,ScreenSpaceInputBindings,ScreenSpaceMapCameraController,ScreenSpaceTiltOrbitCameraController,ScreenSpaceZoomCameraController,SelectedFeatureIdPipelineStage,SelectionIndicator,SelectionIndicatorViewModel,SensorVolumePortionToDisplay,ShaderBuilder,ShaderCache,ShaderDestination,ShaderFunction,ShaderProgram,ShaderSource,ShaderStruct,ShadowMap,ShadowMapShader,ShadowMode,ShadowVolumeAppearance,SharedContext,ShowGeometryInstanceAttribute,Simon1994PlanetaryPositions,SimplePolylineGeometry,SingleTileImageryProvider,SkinningPipelineStage,SkyAtmosphere,SkyBox,SnapFramebuffer,Snapping,SpatialNode,Spdcf,SpecularEnvironmentCubeMap,SphereEmitter,SphereGeometry,SphereOutlineGeometry,Spherical,Spline,SplitDirection,Splitter,StaticGeometryColorBatch,StaticGeometryPerMaterialBatch,StaticGroundGeometryColorBatch,StaticGroundGeometryPerMaterialBatch,StaticGroundPolylinePerMaterialBatch,StaticOutlineGeometryBatch,StencilConstants,StencilFunction,StencilOperation,SteppedSpline,Stereographic,StorageType,StripeMaterialProperty,StripeOrientation,StructuralMetadata,StyleCommandsNeeded,StyleExpression,Sun,SunLight,SunPostProcess,SupportedImageFormats,SvgPathBindingHandler,Sync,TaskProcessor,Terrain,TerrainData,TerrainEncoding,TerrainFillMesh,TerrainMesh,TerrainOffsetProperty,TerrainPicker,TerrainProvider,TerrainQuantization,TerrainState,Texture,Texture3D,TextureAtlas,TextureCache,TextureMagnificationFilter,TextureManager,TextureMinificationFilter,TexturePacker,TextureUniform,TextureWrap,TileAvailability,TileBoundingRegion,TileBoundingS2Cell,TileBoundingSphere,TileBoundingVolume,TileCoordinatesImageryProvider,TileDiscardPolicy,TileEdge,TileImagery,TileMapServiceImageryProvider,TileMetadata,TileOrientedBoundingBox,TileProviderError,TileReplacementQueue,TileSelectionResult,TileState,Tileset3DTileContent,TilesetMetadata,TilesetPipelineStage,TilingScheme,TimeConstants,TimeDynamicImagery,TimeDynamicPointCloud,TimeInterval,TimeIntervalCollection,TimeIntervalCollectionPositionProperty,TimeIntervalCollectionProperty,TimeStandard,Timeline,TimelineHighlightRange,TimelineTrack,Tipsify,ToggleButtonViewModel,Tonemapper,TrackingReferenceFrame,Transforms,TranslationRotationScale,TranslucentTileClassification,TridiagonalSystemSolver,TrustedServers,TweenCollection,UniformState,UniformType,UrlTemplate3DTilesDataProvider,UrlTemplateImageryProvider,VERSION,VRButton,VRButtonViewModel,VRTheWorldTerrainProvider,VaryingType,Vector3DTileBatch,Vector3DTileClampedPolylines,Vector3DTileContent,Vector3DTileGeometry,Vector3DTilePoints,Vector3DTilePolygons,Vector3DTilePolylines,Vector3DTilePrimitive,VectorGltf3DTileContent,VectorPipeline,VectorProvider,VelocityOrientationProperty,VelocityVectorProperty,VertexArray,VertexArrayFacade,VertexAttributeSemantic,VertexFormat,VerticalExaggeration,VerticalExaggerationPipelineStage,VerticalOrigin,VideoSynchronizer,View,Viewer,ViewportQuad,Visibility,Visualizer,VoxelBoundsCollection,VoxelBoxShape,VoxelCell,VoxelContent,VoxelCylinderShape,VoxelEllipsoidShape,VoxelInspector,VoxelInspectorViewModel,VoxelMetadataOrder,VoxelPrimitive,VoxelProvider,VoxelRenderResources,VoxelShape,VoxelShapeType,VoxelTraversal,VulkanConstants,WallGeometry,WallGeometryLibrary,WallGeometryUpdater,WallGraphics,WallOutlineGeometry,WebGLConstants,WebMapServiceImageryProvider,WebMapTileServiceImageryProvider,WebMercatorProjection,WebMercatorTilingScheme,WindingOrder,WireframeIndexGenerator,WireframePipelineStage,_shadersAcesTonemappingStage,_shadersAdditiveBlend,_shadersAdjustTranslucentFS,_shadersAllMaterialAppearanceFS,_shadersAllMaterialAppearanceVS,_shadersAmbientOcclusionGenerate,_shadersAmbientOcclusionModulate,_shadersAspectRampMaterial,_shadersAtmosphereCommon,_shadersAtmosphereStageFS,_shadersAtmosphereStageVS,_shadersBasicMaterialAppearanceFS,_shadersBasicMaterialAppearanceVS,_shadersBillboardCollectionFS,_shadersBillboardCollectionVS,_shadersBlackAndWhite,_shadersBloomComposite,_shadersBrdfLutGeneratorFS,_shadersBrightPass,_shadersBrightness,_shadersBufferPointMaterialFS,_shadersBufferPointMaterialVS,_shadersBufferPolygonMaterialFS,_shadersBufferPolygonMaterialVS,_shadersBufferPolylineMaterialFS,_shadersBufferPolylineMaterialVS,_shadersBumpMapMaterial,_shadersCPUStylingStageFS,_shadersCPUStylingStageVS,_shadersCheckerboardMaterial,_shadersCloudCollectionFS,_shadersCloudCollectionVS,_shadersCloudNoiseFS,_shadersCloudNoiseVS,_shadersCompareAndPackTranslucentDepth,_shadersCompositeOITFS,_shadersCompositeTranslucentClassification,_shadersComputeIrradianceFS,_shadersComputeRadianceMapFS,_shadersConstantLodStageFS,_shadersConstantLodStageVS,_shadersContrastBias,_shadersConvolveSpecularMapFS,_shadersConvolveSpecularMapVS,_shadersCubeMapPanoramaVS,_shadersCustomShaderStageFS,_shadersCustomShaderStageVS,_shadersCzmBuiltins,_shadersDepthOfField,_shadersDepthPlaneFS,_shadersDepthPlaneVS,_shadersDepthView,_shadersDepthViewPacked,_shadersDotMaterial,_shadersEdgeDetection,_shadersEdgeDetectionStageFS,_shadersEdgeVisibilityStageFS,_shadersEdgeVisibilityStageVS,_shadersElevationBandMaterial,_shadersElevationContourMaterial,_shadersElevationRampMaterial,_shadersEllipsoidFS,_shadersEllipsoidSurfaceAppearanceFS,_shadersEllipsoidSurfaceAppearanceVS,_shadersEllipsoidVS,_shadersFXAA,_shadersFXAA3_11,_shadersFadeMaterial,_shadersFeatureIdStageFS,_shadersFeatureIdStageVS,_shadersFilmicTonemapping,_shadersGaussianBlur1D,_shadersGeometryStageFS,_shadersGeometryStageVS,_shadersGlobeFS,_shadersGlobeVS,_shadersGridMaterial,_shadersGroundAtmosphere,_shadersHSBToRGB,_shadersHSLToRGB,_shadersImageBasedLightingStageFS,_shadersInstancingStageCommon,_shadersInstancingStageVS,_shadersIntersectBox,_shadersIntersectCylinder,_shadersIntersectDepth,_shadersIntersectEllipsoid,_shadersIntersectLongitude,_shadersIntersectPlane,_shadersIntersection,_shadersIntersectionUtils,_shadersLegacyInstancingStageVS,_shadersLensFlare,_shadersLightingStageFS,_shadersMaterialStageFS,_shadersMegatexture,_shadersMetadataStageFS,_shadersMetadataStageVS,_shadersModelClippingPlanesStageFS,_shadersModelClippingPolygonsStageFS,_shadersModelClippingPolygonsStageVS,_shadersModelColorStageFS,_shadersModelFS,_shadersModelSilhouetteStageFS,_shadersModelSilhouetteStageVS,_shadersModelSplitterStageFS,_shadersModelVS,_shadersModifiedReinhardTonemapping,_shadersMorphTargetsStageVS,_shadersNightVision,_shadersNormalMapMaterial,_shadersOctree,_shadersPassThrough,_shadersPassThroughDepth,_shadersPbrNeutralTonemapping,_shadersPerInstanceColorAppearanceFS,_shadersPerInstanceColorAppearanceVS,_shadersPerInstanceFlatColorAppearanceFS,_shadersPerInstanceFlatColorAppearanceVS,_shadersPointCloudEyeDomeLighting,_shadersPointCloudStylingStageVS,_shadersPointPrimitiveCollectionFS,_shadersPointPrimitiveCollectionVS,_shadersPolygonSignedDistanceFS,_shadersPolylineArrowMaterial,_shadersPolylineColorAppearanceVS,_shadersPolylineCommon,_shadersPolylineDashMaterial,_shadersPolylineFS,_shadersPolylineGlowMaterial,_shadersPolylineMaterialAppearanceVS,_shadersPolylineOutlineMaterial,_shadersPolylineShadowVolumeFS,_shadersPolylineShadowVolumeMorphFS,_shadersPolylineShadowVolumeMorphVS,_shadersPolylineShadowVolumeVS,_shadersPolylineVS,_shadersPrimitiveGaussianSplatFS,_shadersPrimitiveGaussianSplatVS,_shadersPrimitiveOutlineStageFS,_shadersPrimitiveOutlineStageVS,_shadersRGBToHSB,_shadersRGBToHSL,_shadersRGBToXYZ,_shadersReinhardTonemapping,_shadersReprojectWebMercatorFS,_shadersReprojectWebMercatorVS,_shadersRimLightingMaterial,_shadersSelectedFeatureIdStageCommon,_shadersShadowVolumeAppearanceFS,_shadersShadowVolumeAppearanceVS,_shadersShadowVolumeFS,_shadersSilhouette,_shadersSkinningStageVS,_shadersSkyAtmosphereCommon,_shadersSkyAtmosphereFS,_shadersSkyAtmosphereVS,_shadersSkyBoxFS,_shadersSkyBoxVS,_shadersSlopeRampMaterial,_shadersStripeMaterial,_shadersSunFS,_shadersSunTextureFS,_shadersSunVS,_shadersTexturedMaterialAppearanceFS,_shadersTexturedMaterialAppearanceVS,_shadersVector3DTileClampedPolylinesFS,_shadersVector3DTileClampedPolylinesVS,_shadersVector3DTilePolylinesVS,_shadersVectorCommon,_shadersVectorTileVS,_shadersVerticalExaggerationStageVS,_shadersViewportQuadFS,_shadersViewportQuadVS,_shadersVoxelFS,_shadersVoxelUtils,_shadersVoxelVS,_shadersWater,_shadersWaterMaskMaterial,_shadersXYZToRGB,_shadersacesTonemapping,_shadersalphaWeight,_shadersantialias,_shadersapplyHSBShift,_shadersapproximateSphericalCoordinates,_shadersapproximateTanh,_shadersbackFacing,_shadersbranchFreeTernary,_shaderscascadeColor,_shaderscascadeDistance,_shaderscascadeMatrix,_shaderscascadeWeights,_shadersclipPolygons,_shaderscolumbusViewMorph,_shaderscomputeAtmosphereColor,_shaderscomputeGroundAtmosphereScattering,_shaderscomputePosition,_shaderscomputeScattering,_shaderscomputeTextureTransform,_shadersconvertLocalToBoxUv,_shadersconvertLocalToCylinderUv,_shadersconvertLocalToEllipsoidUv,_shaderscosineAndSine,_shadersdecodeRGB8,_shadersdecompressTextureCoordinates,_shadersdegreesPerRadian,_shadersdepthClamp,_shadersdepthRange,_shadersdepthRangeStruct,_shaderseastNorthUpToEyeCoordinates,_shadersellipsoidContainsPoint,_shadersellipsoidTextureCoordinates,_shadersepsilon1,_shadersepsilon2,_shadersepsilon3,_shadersepsilon4,_shadersepsilon5,_shadersepsilon6,_shadersepsilon7,_shadersequalsEpsilon,_shaderseyeOffset,_shaderseyeToWindowCoordinates,_shadersfastApproximateAtan,_shadersfog,_shadersgammaCorrect,_shadersgeodeticSurfaceNormal,_shadersgetDefaultMaterial,_shadersgetDynamicAtmosphereLightDirection,_shadersgetLambertDiffuse,_shadersgetSpecular,_shadersgetWaterNoise,_shadershue,_shadersinfinity,_shadersinverseGamma,_shadersisEmpty,_shadersisFull,_shaderslatitudeToWebMercatorFraction,_shaderslineDistance,_shaderslinearToSrgb,_shadersluminance,_shadersmaterial,_shadersmaterialInput,_shadersmaximumComponent,_shadersmetersPerPixel,_shadersmodelMaterial,_shadersmodelToWindowCoordinates,_shadersmodelVertexOutput,_shadersmultiplyWithColorBalance,_shadersnearFarScalar,_shadersoctDecode,_shadersoneOverPi,_shadersoneOverTwoPi,_shaderspackDepth,_shaderspassCesium3DTile,_shaderspassCesium3DTileClassification,_shaderspassCesium3DTileClassificationIgnoreShow,_shaderspassCesium3DTileEdges,_shaderspassCesium3DTileEdgesDirect,_shaderspassCesium3DTilePlanarFillId,_shaderspassClassification,_shaderspassCompute,_shaderspassEnvironment,_shaderspassGaussianSplats,_shaderspassGlobe,_shaderspassOpaque,_shaderspassOverlay,_shaderspassTerrainClassification,_shaderspassTranslucent,_shaderspassVoxels,_shaderspbrLighting,_shaderspbrNeutralTonemapping,_shadersphong,_shaderspi,_shaderspiOverFour,_shaderspiOverSix,_shaderspiOverThree,_shaderspiOverTwo,_shadersplaneDistance,_shaderspointAlongRay,_shadersradiansPerDegree,_shadersray,_shadersrayEllipsoidIntersectionInterval,_shadersraySegment,_shadersraySphereIntersectionInterval,_shadersreadDepth,_shadersreadNonPerspective,_shadersreverseLogDepth,_shadersround,_shaderssaturation,_shaderssceneMode2D,_shaderssceneMode3D,_shaderssceneModeColumbusView,_shaderssceneModeMorphing,_shadersshadowDepthCompare,_shadersshadowParameters,_shadersshadowVisibility,_shaderssignNotZero,_shaderssolarRadius,_shaderssphericalHarmonics,_shaderssrgbToLinear,_shaderstangentToEyeSpaceMatrix,_shaderstextureCube,_shadersthreePiOver2,_shaderstransformPlane,_shaderstranslateRelativeToEye,_shaderstranslucentPhong,_shaderstranspose,_shaderstwoPi,_shadersunpackClippingExtents,_shadersunpackDepth,_shadersunpackFloat,_shadersunpackTexture,_shadersunpackUint,_shadersvalueTransform,_shadersvertexLogDepth,_shaderswebMercatorMaxLatitude,_shaderswindowToEyeCoordinates,_shaderswriteDepthClamp,_shaderswriteLogDepth,_shaderswriteNonPerspective,addAllToArray,addBuffer,addDefaults,addExtensionsRequired,addExtensionsUsed,addPipelineExtras,addToArray,appendForwardSlash,arrayRemoveDuplicates,assert,barycentricCoordinates,binarySearch,buildModuleUrl,buildVectorGltfFromMVT,buildVoxelCustomShader,buildVoxelDrawCommands,clone,combine,computeFlyToLocationForRectangle,createBillboardPointCallback,createColorRamp,createCommand,createDefaultImageryProviderViewModels,createDefaultTerrainProviderViewModels,createElevationBandMaterial,createGooglePhotorealistic3DTileset,createGuid,createMaterialPropertyDescriptor,createOsmBuildingsAsync,createPropertyDescriptor,createRawPropertyDescriptor,createTangentSpaceDebugPrimitive,createTaskProcessorWorker,createUniform,createUniformArray,createVectorTileBuffersFromModelComponents,createWorldBathymetryAsync,createWorldImageryAsync,createWorldTerrainAsync,decodeGoogleEarthEnterpriseData,decodeMVT,decodeVectorPolylinePositions,defaultPickWorldPosition,defer,defined,demodernizeShader,deprecationWarning,destroyObject,exportKml,findAccessorMinMax,findContentMetadata,findGroupMetadata,findMeshoptExtension,findTileMetadata,forEachTextureInMaterial,formatError,freezeRenderState,getAbsoluteUri,getAccessorByteStride,getBaseUri,getBinaryAccessor,getClipAndStyleCode,getClippingFunction,getComponentReader,getElement,getExtensionFromUri,getFilenameFromUri,getImageFromTypedArray,getImagePixels,getJsonFromTypedArray,getMagic,getMeshPrimitives,getMetadataClassProperty,getMetadataProperty,getStringFromTypedArray,getTimestamp,hasExtension,heightReferenceOnEntityPropertyChanged,isBitSet,isBlobUri,isCrossOriginUrl,isDataUri,isLeapYear,knockout,knockout_3_5_1,knockout_es5,loadAndExecuteScript,loadCubeMap,loadImageFromTypedArray,loadKTX2,mergeSort,moveTechniqueRenderStates,moveTechniquesToExtension,numberOfComponentsForType,objectToQuery,oneTimeWarning,parseBatchTable,parseFeatureMetadataLegacy,parseGlb,parseResponseHeaders,parseStructuralMetadata,pickModel,pointInsideTriangle,preprocess3DTileContent,processVoxelProperties,queryToObject,readAccessorPacked,removeExtension,removeExtensionsRequired,removeExtensionsUsed,removePipelineExtras,removeUnusedElements,renderBufferPointCollection,renderBufferPolygonCollection,renderBufferPolylineCollection,resizeImageToNextPowerOfTwo,sampleTerrain,sampleTerrainMostDetailed,scaleToGeodeticSurface,srgbToLinear,subdivideArray,subscribeAndEvaluate,updateAccessorComponentTypes,updateVersion,usesExtension,viewerCesium3DTilesInspectorMixin,viewerCesiumInspectorMixin,viewerDragDropMixin,viewerPerformanceWatchdogMixin,viewerVoxelInspectorMixin,webGLConstantToGlslType,wrapFunction,writeTextToCanvas});