/** * @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. */ import{a as A}from"./chunk-635BMVFD.js";import{j as W}from"./chunk-Y7Z6CVXH.js";import{b as Z}from"./chunk-HHFPYI7Q.js";import{a as v,c as N}from"./chunk-WORPNHJT.js";import{a as t,b as U}from"./chunk-SWCW4GSU.js";import{a as ot}from"./chunk-PZM5FOOW.js";import{a as ct,b as z}from"./chunk-3MNKUQ6L.js";import{f as x}from"./chunk-J4SK6SKL.js";var X=class{constructor(e){this._ellipsoid=e??N.default,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}get ellipsoid(){return this._ellipsoid}project(e,n){let c=this._semimajorAxis,o=e.longitude*c,a=e.latitude*c,i=e.height;return x(n)?(n.x=o,n.y=a,n.z=i,n):new t(o,a,i)}unproject(e,n){if(!x(e))throw new ct("cartesian is required");let c=this._oneOverSemimajorAxis,o=e.x*c,a=e.y*c,i=e.z;return x(n)?(n.longitude=o,n.latitude=a,n.height=i,n):new v(o,a,i)}},F=X;function ft(m,e){this.start=m??0,this.stop=e??0}var at=ft;var k=class m{constructor(e,n){this.center=t.clone(e??t.ZERO),this.radius=n??0}static fromPoints(e,n){if(x(n)||(n=new m),!x(e)||e.length===0)return n.center=t.clone(t.ZERO,n.center),n.radius=0,n;let c=t.clone(e[0],$),o=t.clone(c,Y),a=t.clone(c,G),i=t.clone(c,I),d=t.clone(c,J),s=t.clone(c,K),f=t.clone(c,Q),S=e.length,y;for(y=1;yd.x&&t.clone(c,d),qs.y&&t.clone(c,s),pf.z&&t.clone(c,f)}let u=t.magnitudeSquared(t.subtract(d,o,j)),r=t.magnitudeSquared(t.subtract(s,a,j)),B=t.magnitudeSquared(t.subtract(f,i,j)),T=o,M=d,b=u;r>b&&(b=r,T=a,M=s),B>b&&(T=i,M=f);let h=L;h.x=(T.x+M.x)*.5,h.y=(T.y+M.y)*.5,h.z=(T.z+M.z)*.5;let w=t.magnitudeSquared(t.subtract(M,h,j)),l=Math.sqrt(w),g=H;g.x=o.x,g.y=a.y,g.z=i.z;let P=_;P.x=d.x,P.y=s.y,P.z=f.z;let D=t.midpoint(g,P,tt),E=0;for(y=0;yE&&(E=C);let q=t.magnitudeSquared(t.subtract(c,h,j));if(q>w){let p=Math.sqrt(q);l=(l+p)*.5,w=l*l;let O=p-l;h.x=(l*h.x+O*c.x)/p,h.y=(l*h.y+O*c.y)/p,h.z=(l*h.z+O*c.z)/p}}return lf.x&&t.clone(a,f),OS.y&&t.clone(a,S),Ry.z&&t.clone(a,y)}let B=t.magnitudeSquared(t.subtract(f,i,j)),T=t.magnitudeSquared(t.subtract(S,d,j)),M=t.magnitudeSquared(t.subtract(y,s,j)),b=i,h=f,w=B;T>w&&(w=T,b=d,h=S),M>w&&(b=s,h=y);let l=L;l.x=(b.x+h.x)*.5,l.y=(b.y+h.y)*.5,l.z=(b.z+h.z)*.5;let g=t.magnitudeSquared(t.subtract(h,l,j)),P=Math.sqrt(g),D=H;D.x=i.x,D.y=d.y,D.z=s.z;let E=_;E.x=f.x,E.y=S.y,E.z=y.z;let C=t.midpoint(D,E,tt),q=0;for(r=0;rq&&(q=p);let O=t.magnitudeSquared(t.subtract(a,l,j));if(O>g){let R=Math.sqrt(O);P=(P+R)*.5,g=P*P;let V=R-P;l.x=(P*l.x+V*a.x)/R,l.y=(P*l.y+V*a.y)/R,l.z=(P*l.z+V*a.z)/R}}return Ps.x&&t.clone(o,s),pf.y&&t.clone(o,f),OS.z&&t.clone(o,S)}let r=t.magnitudeSquared(t.subtract(s,a,j)),B=t.magnitudeSquared(t.subtract(f,i,j)),T=t.magnitudeSquared(t.subtract(S,d,j)),M=a,b=s,h=r;B>h&&(h=B,M=i,b=f),T>h&&(M=d,b=S);let w=L;w.x=(M.x+b.x)*.5,w.y=(M.y+b.y)*.5,w.z=(M.z+b.z)*.5;let l=t.magnitudeSquared(t.subtract(b,w,j)),g=Math.sqrt(l),P=H;P.x=a.x,P.y=i.y,P.z=d.z;let D=_;D.x=s.x,D.y=f.y,D.z=S.z;let E=t.midpoint(P,D,tt),C=0;for(u=0;uC&&(C=q);let p=t.magnitudeSquared(t.subtract(o,w,j));if(p>l){let O=Math.sqrt(p);g=(g+O)*.5,l=g*g;let R=O-g;w.x=(g*w.x+R*o.x)/O,w.y=(g*w.y+R*o.y)/O,w.z=(g*w.z+R*o.z)/O}}return g=f+d)return e.clone(c),c;if(d>=f+a)return n.clone(c),c;let S=(a+f+d)*.5,y=t.multiplyByScalar(s,(-a+S)/f,Pt);return t.add(y,o,y),t.clone(y,c.center),c.radius=S,c}static expand(e,n,c){z.typeOf.object("sphere",e),z.typeOf.object("point",n),c=m.clone(e,c);let o=t.magnitude(t.subtract(n,c.center,Ot));return o>c.radius&&(c.radius=o),c}static intersectPlane(e,n){z.typeOf.object("sphere",e),z.typeOf.object("plane",n);let c=e.center,o=e.radius,a=n.normal,i=t.dot(a,c)+n.distance;return i<-o?A.OUTSIDE:i