/** * @license * Cesium - https://github.com/CesiumGS/cesium * Version 1.142.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. */ import{a}from"./chunk-U4VWQPTS.js";import{a as d}from"./chunk-GZABERXA.js";import{a as g,b as r}from"./chunk-WM6AKY6B.js";import{e as W,f as u}from"./chunk-6K4BWAPV.js";var ve=new a,_e=new a;function Fe(i,t,e,n,o){if(!u(i))throw new g("cartesian is required.");if(!u(t))throw new g("oneOverRadii is required.");if(!u(e))throw new g("oneOverRadiiSquared is required.");if(!u(n))throw new g("centerToleranceSquared is required.");let s=i.x,c=i.y,m=i.z,p=t.x,A=t.y,j=t.z,w=s*s*p*p,q=c*c*A*A,T=m*m*j*j,N=w+q+T,C=Math.sqrt(1/N),E=a.multiplyByScalar(i,C,ve);if(Nd.EPSILON12);return u(o)?(o.x=s*v,o.y=c*_,o.z=m*F,o):new a(s*v,c*_,m*F)}var U=Fe;var h=class h{constructor(t,e,n){this.longitude=t??0,this.latitude=e??0,this.height=n??0}static fromRadians(t,e,n,o){return r.typeOf.number("longitude",t),r.typeOf.number("latitude",e),n=n??0,u(o)?(o.longitude=t,o.latitude=e,o.height=n,o):new h(t,e,n)}static fromDegrees(t,e,n,o){return r.typeOf.number("longitude",t),r.typeOf.number("latitude",e),t=d.toRadians(t),e=d.toRadians(e),h.fromRadians(t,e,n,o)}static fromCartesian(t,e,n){let o=u(e)?e.oneOverRadii:h._ellipsoidOneOverRadii,s=u(e)?e.oneOverRadiiSquared:h._ellipsoidOneOverRadiiSquared,c=u(e)?e._centerToleranceSquared:h._ellipsoidCenterToleranceSquared,m=U(t,o,s,c,Ne);if(!u(m))return;let p=a.multiplyComponents(m,s,Me);p=a.normalize(p,p);let A=a.subtract(t,m,ze),j=Math.atan2(p.y,p.x),w=Math.asin(p.z),q=d.sign(a.dot(A,t))*a.magnitude(A);return u(n)?(n.longitude=j,n.latitude=w,n.height=q,n):new h(j,w,q)}static toCartesian(t,e,n){return r.defined("cartographic",t),a.fromRadians(t.longitude,t.latitude,t.height,e,n)}static clone(t,e){if(u(t))return u(e)?(e.longitude=t.longitude,e.latitude=t.latitude,e.height=t.height,e):new h(t.longitude,t.latitude,t.height)}static equals(t,e){return t===e||u(t)&&u(e)&&t.longitude===e.longitude&&t.latitude===e.latitude&&t.height===e.height}static equalsEpsilon(t,e,n){return n=n??0,t===e||u(t)&&u(e)&&Math.abs(t.longitude-e.longitude)<=n&&Math.abs(t.latitude-e.latitude)<=n&&Math.abs(t.height-e.height)<=n}clone(t){return h.clone(this,t)}equals(t){return h.equals(this,t)}equalsEpsilon(t,e){return h.equalsEpsilon(this,t,e)}toString(){return`(${this.longitude}, ${this.latitude}, ${this.height})`}};W(h,"_ellipsoidOneOverRadii",new a(1/6378137,1/6378137,1/6356752314245179e-9)),W(h,"_ellipsoidOneOverRadiiSquared",new a(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9))),W(h,"_ellipsoidCenterToleranceSquared",d.EPSILON1);var z=h;z.ZERO=Object.freeze(new z(0,0,0));var Me=new a,Ne=new a,ze=new a,P=z;var f=class i{constructor(t,e){this.x=t??0,this.y=e??0}static fromElements(t,e,n){return u(n)?(n.x=t,n.y=e,n):new i(t,e)}static clone(t,e){if(u(t))return u(e)?(e.x=t.x,e.y=t.y,e):new i(t.x,t.y)}static pack(t,e,n){return r.typeOf.object("value",t),r.defined("array",e),n=n??0,e[n++]=t.x,e[n]=t.y,e}static unpack(t,e,n){return r.defined("array",t),e=e??0,u(n)||(n=new i),n.x=t[e++],n.y=t[e],n}static packArray(t,e){r.defined("array",t);let n=t.length,o=n*2;if(!u(e))e=new Array(o);else{if(!Array.isArray(e)&&e.length!==o)throw new g("If result is a typed array, it must have exactly array.length * 2 elements");e.length!==o&&(e.length=o)}for(let s=0;s=this._radii.z-e))return n}getLocalCurvature(t,e){r.typeOf.object("surfacePosition",t),u(e)||(e=new re);let n=this.getSurfaceNormalIntersectionWithZAxis(t,0,Ve),o=a.distance(t,n),s=this.minimumRadius*o/this.maximumRadius**2,c=o*s**2;return re.fromElements(1/o,1/c,e)}surfaceArea(t){r.typeOf.object("rectangle",t);let e=t.west,n=t.east,o=t.south,s=t.north;for(;n{let t=new Image;t.onload=function(){y._result=t.width>0&&t.height>0,i(y._result)},t.onerror=function(){y._result=!1,i(y._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),y._promise};Object.defineProperties(y,{initialized:{get:function(){return u(y._result)}}});var M=[];typeof ArrayBuffer<"u"&&(M.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&M.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&M.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&M.push(BigInt64Array),typeof BigUint64Array<"u"&&M.push(BigUint64Array));var S={isChrome:ce,chromeVersion:De,isSafari:Re,safariVersion:Ze,isWebkit:Ae,webkitVersion:Ge,isEdge:Y,edgeVersion:Xe,isFirefox:Q,firefoxVersion:He,isWindows:Ye,isIPadOrIOS:Qe,hardwareConcurrency:x.hardwareConcurrency??3,supportsPointerEvents:Je,supportsImageRenderingPixelated:Te,supportsWebP:y,imageRenderingValue:Ke,typedArrayTypes:M};S.supportsBasis=function(i){return S.supportsWebAssembly()&&i.context.supportsBasis};S.supportsFullscreen=function(){return Se.supportsFullscreen()};S.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"};S.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"};S.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"};S.supportsBigInt=function(){return typeof BigInt<"u"};S.supportsWebWorkers=function(){return typeof Worker<"u"};S.supportsWebAssembly=function(){return typeof WebAssembly<"u"};S.supportsWebgl2=function(i){return r.defined("scene",i),i.context.webgl2};S.supportsEsmWebWorkers=function(){return!Q()||parseInt(de)>=114};var Mt=S;export{P as a,re as b,At as c,Mt as d};