/** * @license * Cesium - https://github.com/CesiumGS/cesium * Version 1.110.1 * * 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 as Pt}from"./chunk-UBTZOT6V.js";import{a as S}from"./chunk-4H2WV7QE.js";import{a as X}from"./chunk-LEGXNNON.js";import{a as ft}from"./chunk-CE6W255B.js";import{a as It}from"./chunk-54EUFFXI.js";import"./chunk-CAKU43HZ.js";import"./chunk-WNXNCTQK.js";import{a as At}from"./chunk-W6HUVIKD.js";import{a as Tt}from"./chunk-ML5MKDLJ.js";import{a as dt}from"./chunk-HL2OONDA.js";import{a as Q}from"./chunk-FEU4H2YL.js";import{a as J}from"./chunk-BV3RKX5O.js";import"./chunk-XQLAWHTP.js";import{a as _t,b as at}from"./chunk-P2SABSEB.js";import"./chunk-FO3UCCVP.js";import"./chunk-GTKXIG42.js";import{a as bt,b as Et}from"./chunk-EVUMPJJC.js";import"./chunk-BXMC6F3B.js";import{a as ut}from"./chunk-EUSUDYW7.js";import"./chunk-XYZU5ZKW.js";import{c as pt,d as ot}from"./chunk-ADEEKX5Q.js";import{d as Ot,f as mt}from"./chunk-O5E7EBKP.js";import"./chunk-LEJDAZA7.js";import{c as lt,d as b}from"./chunk-GMFQULD7.js";import{a as et}from"./chunk-IS523WNE.js";import{a as h,b as K,c as v,d as U}from"./chunk-4ZQSV4FU.js";import{a as c}from"./chunk-CLQ5X6HS.js";import"./chunk-6Y3U6IMI.js";import"./chunk-7DENS74L.js";import{a as H}from"./chunk-FOJGNIAW.js";import{a as rt,b as G}from"./chunk-UGI536VH.js";import{e as P}from"./chunk-BQUQ5TPM.js";function Dt(t,e){if(!P(t)||!P(e))throw new rt("identifier and message are required.");At(t,e)}var Nt=Dt;function O(t,e){this.position=t,P(this.position)||(this.position=new b),this.tangentPlane=e,P(this.tangentPlane)||(this.tangentPlane=O.NORTH_POLE_TANGENT_PLANE)}Object.defineProperties(O.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 t=b.magnitude(this.position),e=2*this.ellipsoid.maximumRadius;return this.tangentPlane.plane.normal.z*(c.PI_OVER_TWO-2*Math.atan2(t,e))}},longitude:{get:function(){let t=c.PI_OVER_TWO+Math.atan2(this.y,this.x);return t>Math.PI&&(t-=c.TWO_PI),t}}});var st=new K,Vt=new h;O.prototype.getLatitude=function(t){P(t)||(t=v.WGS84),st.latitude=this.conformalLatitude,st.longitude=this.longitude,st.height=0;let e=this.ellipsoid.cartographicToCartesian(st,Vt);return t.cartesianToCartographic(e,st),st.latitude};var Mt=new bt,Bt=new h,jt=new h;O.fromCartesian=function(t,e){G.defined("cartesian",t);let o=c.signNotZero(t.z),n=O.NORTH_POLE_TANGENT_PLANE,i=O.SOUTH_POLE;o<0&&(n=O.SOUTH_POLE_TANGENT_PLANE,i=O.NORTH_POLE);let r=Mt;r.origin=n.ellipsoid.scaleToGeocentricSurface(t,r.origin),r.direction=h.subtract(r.origin,i,Bt),h.normalize(r.direction,r.direction);let a=Et.rayPlane(r,n.plane,jt),f=h.subtract(a,i,a),l=h.dot(n.xAxis,f),u=o*h.dot(n.yAxis,f);return P(e)?(e.position=new b(l,u),e.tangentPlane=n,e):new O(new b(l,u),n)};O.fromCartesianArray=function(t,e){G.defined("cartesians",t);let o=t.length;P(e)?e.length=o:e=new Array(o);for(let n=0;nnt.eastOverIDL-nt.westOverIDL&&(i.west=nt.westOverIDL,i.east=nt.eastOverIDL,i.east>c.PI&&(i.east=i.east-c.TWO_PI),i.west>c.PI&&(i.west=i.west-c.TWO_PI)),i}var ne=new K;function Rt(t,e,o,n){let i=t.surfaceDistance,r=Math.ceil(i*e),a=r>0?i/(r-1):Number.POSITIVE_INFINITY,f=0;for(let l=0;l=0?g:g+c.TWO_PI;n.westOverIDL=Math.min(n.westOverIDL,E),n.eastOverIDL=Math.max(n.eastOverIDL,E)}}var Lt=[];function ie(t,e,o,n,i,r,a,f,l,u){let g={walls:[]},s;if(a||f){let d=S.createGeometryFromPositions(t,e,o,n,r,l,u),A=d.attributes.position.values,N=d.indices,F,w;if(a&&f){let y=A.concat(A);F=y.length/3,w=ut.createTypedArray(F,N.length*2),w.set(N);let T=N.length,m=F/2;for(s=0;s=0?a:a+c.TWO_PI;i.westOverIdl=Math.min(i.westOverIdl,f),i.eastOverIdl=Math.max(i.eastOverIdl,f),r.west=Math.min(r.west,a),r.east=Math.max(r.east,a);let l=t.getLatitude(o),u=l;if(r.south=Math.min(r.south,l),r.north=Math.max(r.north,l),n!==X.RHUMB){let E=b.subtract(e.position,t.position,ce),I=b.dot(e.position,E)/b.dot(E,E);if(I>0&&I<1){let B=b.add(e.position,b.multiplyByScalar(E,-I,E),he),C=k.clone(e,fe);C.position=B;let R=C.getLatitude(o);r.south=Math.min(r.south,R),r.north=Math.max(r.north,R),Math.abs(l)>Math.abs(R)&&(u=R)}}let g=e.x*t.y-t.x*e.y,s=Math.sign(g);s!==0&&(s*=b.angleBetween(e.position,t.position)),u>=0&&(i.northAngle+=s),u<=0&&(i.southAngle+=s)}var St=new k,le=new k,Y={northAngle:0,southAngle:0,westOverIdl:0,eastOverIdl:0};z.computeRectangleFromPositions=function(t,e,o,n){if(G.defined("positions",t),P(n)||(n=new lt),t.length<3)return n;n.west=Number.POSITIVE_INFINITY,n.east=Number.NEGATIVE_INFINITY,n.south=Number.POSITIVE_INFINITY,n.north=Number.NEGATIVE_INFINITY,Y.northAngle=0,Y.southAngle=0,Y.westOverIdl=Number.POSITIVE_INFINITY,Y.eastOverIdl=Number.NEGATIVE_INFINITY;let i=t.length,r=k.fromCartesian(t[0],le);for(let a=1;aY.eastOverIdl-Y.westOverIdl&&(n.west=Y.westOverIdl,n.east=Y.eastOverIdl,n.east>c.PI&&(n.east=n.east-c.TWO_PI),n.west>c.PI&&(n.west=n.west-c.TWO_PI)),c.equalsEpsilon(Math.abs(Y.northAngle),c.TWO_PI,c.EPSILON10)&&(n.north=c.PI_OVER_TWO,n.east=c.PI,n.west=-c.PI),c.equalsEpsilon(Math.abs(Y.southAngle),c.TWO_PI,c.EPSILON10)&&(n.south=-c.PI_OVER_TWO,n.east=c.PI,n.west=-c.PI),n};z.computeRectangle=function(t,e){G.typeOf.object("options",t),G.typeOf.object("options.polygonHierarchy",t.polygonHierarchy),Nt("PolygonGeometry.computeRectangle","PolygonGeometry.computeRectangle was deprecated in CesiumJS 1.110. It will be removed in CesiumJS 1.112. Use PolygonGeometry.computeRectangleFromPositions instead.");let o=H(t.granularity,c.RADIANS_PER_DEGREE),n=H(t.arcType,X.GEODESIC);if(n!==X.GEODESIC&&n!==X.RHUMB)throw new rt("Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB.");let i=t.polygonHierarchy,r=H(t.ellipsoid,v.WGS84);return oe(i.positions,r,n,o,e)};var me=new k;function ue(t,e,o){return t.height>=c.PI||t.width>=c.PI?k.fromCartesian(e[0],me).tangentPlane:J.fromPoints(e,o)}var Ft=new K;function de(t,e){return(o,n)=>{if(t.height>=c.PI||t.width>=c.PI){if(t.south<0&&t.north>0){P(n)||(n=[]);for(let r=0;r=c.PI||t.width>=c.PI)return(i,r)=>{if(t.south<0&&t.north>0){let a=o.cartesianToCartographic(i,Ft);return P(r)||(r=new b),r.x=a.longitude/c.PI,r.y=a.latitude/c.PI_OVER_TWO,r}return k.fromCartesian(i,r)};let n=J.fromPoints(e,o);return(i,r)=>n.projectPointsOntoPlane(i,r)}function pe(t,e,o,n){return(i,r)=>!n&&(t.height>=c.PI_OVER_TWO||t.width>=2*c.PI_OVER_THREE)?S.splitPolygonsOnEquator(i,e,o,r):i}function Pe(t,e,o,n){if(e.height>=c.PI||e.width>=c.PI)return Pt.fromRectangle(e,void 0,Ct);let i=t,r=J.fromPoints(i,o);return S.computeBoundingRectangle(r.plane.normal,r.projectPointOntoPlane.bind(r),i,n,Ct)}z.createGeometry=function(t){let e=t._vertexFormat,o=t._ellipsoid,n=t._granularity,i=t._stRotation,r=t._polygonHierarchy,a=t._perPositionHeight,f=t._closeTop,l=t._closeBottom,u=t._arcType,g=t._textureCoordinates,s=P(g);if(r.positions.length<3)return;let I=t.rectangle,B=S.polygonsFromHierarchy(r,s,de(I,o),!a,o,pe(I,o,u,a)),C=B.hierarchy,R=B.polygons,V=function(p){return p},d=s?S.polygonsFromHierarchy(g,!0,V,!1,o).polygons:void 0;if(C.length===0)return;let A=C[0].outerRing,N=Pe(A,I,o,i),F=[],w=t._height,y=t._extrudedHeight,T=t._perPositionHeightExtrude||!c.equalsEpsilon(w,y,0,c.EPSILON2),m={perPositionHeight:a,vertexFormat:e,geometry:void 0,rotationAxis:ue(I,A,o).plane.normal,projectTo2d:ge(I,A,o),boundingRectangle:N,ellipsoid:o,stRotation:i,textureCoordinates:void 0,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:u},_;if(T)for(m.extrude=!0,m.top=f,m.bottom=l,m.shadowVolume=t._shadowVolume,m.offsetAttribute=t._offsetAttribute,_=0;_