* 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{aasy}from"./chunk-CXNPIJLB.js";import{dasj}from"./chunk-BKSIEBAA.js";import{basd,hasL}from"./chunk-YWRPWWKI.js";import{aasR}from"./chunk-VTVHUB7E.js";import{aass,basW,casT,dasq}from"./chunk-JMSSU44E.js";import{aasw}from"./chunk-4UYSGV57.js";import{aasP}from"./chunk-VLPNAR64.js";import{aasA,basz}from"./chunk-GE5NEIZC.js";import{easl}from"./chunk-35CVRQTC.js";functionx(o,t){z.typeOf.object("ellipsoid",o),this._ellipsoid=o,this._cameraPosition=news,this._cameraPositionInScaledSpace=news,this._distanceToLimbInScaledSpaceSquared=0,l(t)&&(this.cameraPosition=t)}Object.defineProperties(x.prototype,{ellipsoid:{get:function(){returnthis._ellipsoid}},cameraPosition:{get:function(){returnthis._cameraPosition},set:function(o){lete=this._ellipsoid.transformPositionToScaledSpace(o,this._cameraPositionInScaledSpace),a=s.magnitudeSquared(e)-1;s.clone(o,this._cameraPosition),this._cameraPositionInScaledSpace=e,this._distanceToLimbInScaledSpaceSquared=a}}});varU=news;x.prototype.isPointVisible=function(o){lete=this._ellipsoid.transformPositionToScaledSpace(o,U);returnF(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};x.prototype.isScaledSpacePointVisible=function(o){returnF(o,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};varat=news;x.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(o,t){lete=this._ellipsoid,a,i;returnl(t)&&t<0&&e.minimumRadius>-t?(i=at,i.x=this._cameraPosition.x/(e.radii.x+t),i.y=this._cameraPosition.y/(e.radii.y+t),i.z=this._cameraPosition.z/(e.radii.z+t),a=i.x*i.x+i.y*i.y+i.z*i.z-1):(i=this._cameraPositionInScaledSpace,a=this._distanceToLimbInScaledSpaceSquared),F(o,i,a)};x.prototype.computeHorizonCullingPoint=function(o,t,e){returnQ(this._ellipsoid,o,t,e)};varv=q.clone(q.UNIT_SPHERE);x.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(o,t,e,a){leti=Z(this._ellipsoid,e,v);returnQ(i,o,t,a)};x.prototype.computeHorizonCullingPointFromVertices=function(o,t,e,a,i){returnJ(this._ellipsoid,o,t,e,a,i)};x.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(o,t,e,a,i,c){letn=Z(this._ellipsoid,i,v);returnJ(n,o,t,e,a,c)};varnt=[];x.prototype.computeHorizonCullingPointFromRectangle=function(o,t,e){z.typeOf.object("rectangle",o);leta=L.subsample(o,t,0,nt),i=j.fromPoints(a);if(!(s.magnitude(i.center)<.1*t.minimumRadius))returnthis.computeHorizonCullingPoint(i.center,a,e)};varst=news;functionZ(o,t,e){if(l(t)&&t<0&&o.minimumRadius>-t){leta=s.fromElements(o.radii.x+t,o.radii.y+t,o.radii.z+t,st);o=q.fromCartesian3(a,e)}returno}functionQ(o,t,e,a){z.typeOf.object("directionToPoint",t),z.defined("positions",e),l(a)||(a=news);leti=Y(o,t),c=0;for(letn=0,r=e.length;n<r;++n){letm=e[n],h=K(o,m,i);if(h<0)return;c=Math.max(c,h)}returnX(i,c,a)}varM=news;functionJ(o,t,e,a,i,c){z.typeOf.object("directionToPoint",t),z.defined("vertices",e),z.typeOf.number("stride",a),l(c)||(c=news),a=P(a,3),i=P(i,s.ZERO);letn=Y(o,t),r=0;for(letm=0,h=e.length;m<h;m+=a){M.x=e[m]+i.x,M.y=e[m+1]+i.y,M.z=e[m+2]+i.z;letu=K(o,M,n);if(u<0)return;r=Math.max(r,u)}returnX(n,r,c)}functionF(o,t,e){leta=t,i=e,c=s.subtract(o,a,U),n=-s.dot(c,a);return!(i<0?n>0:n>i&&n*n/s.magnitudeSquared(c)>i)}varct=news,rt=news;functionK(o,t,e){leta=o.transformPositionToScaledSpace(t,ct),i=s.magnitudeSquared(a),c=Math.sqrt(i),n=s.divideByScalar(a,c,rt);i=Math.max(1,i),c=Math.max(1,c);letr=s.dot(n,e),m=s.magnitude(s.cross(n,e,n)),h=1/c,u=Math.sqrt(i-1)*h;return1/(r*h-m*u)}functionX(o,t,e){if(!(t<=0||t===1/0||t!==t))returns.multiplyByScalar(o,t,e)}varD=news;functionY(o,t){returns.equals(t,s.ZERO)?t:(o.transformPositionToScaledSpace(t,D),s.normalize(D,D))}varPt=x;varO={};O.getHeight=function(o,t,e){if(!Number.isFinite(t))thrownewA("scale must be a finite number.");if(!Number.isFinite(e))thrownewA("relativeHeight must be a finite number.");return(o-e)*t+e};varmt=newW;O.getPosition=function(o,t,e,a,i){letc=t.cartesianToCartographic(o,mt);if(!l(c))returns.clone(o,i);letn=O.getHeight(c.height,e,a);returns.fromRadians(c.longitude,c.latitude,n,t,i)};var$=O;vardt={NONE:0,BITS12:1},S=Object.freeze(dt);varC=news,lt=news,f=newT,V=newd,ht=newd,pt=Math.pow(2,12);functionp(o,t,e,a,i,c,n,r,m,h){letu=S.NONE,g,N;if(l(t)&&l(e)&&l(a)&&l(i)){letE=t.minimum,I=t.maximum,_=s.subtract(I,E,lt),tt=a-e;Math.max(s.maximumComponent(_),tt)<pt-1?u=S.BITS12:u=S.NONE,g=d.inverseTransformation(i,newd);letot=s.negate(E,C);d.multiply(d.fromTranslation(ot,V),g,g);letb=C;b.x=1/_.x,b.y=1/_.y,b.z=1/_.z,d.multiply(d.fromScale(b,V),g,g),N=d.clone(i),d.setTranslation(N,s.ZERO,N),i=d.clone(i,newd);letet=d.fromTranslation(E,V),it=d.fromScale(_,ht),k=d.multiply(et,it,V);d.multiply(i,k,i),d.multiply(N,k,N)}this.quantization=u,this.minimumHeight=e,this.maximumHeight=a,this.center=s.clone(o),this.toScaledENU=g,this.fromScaledENU=i,this.matrix=N,this.hasVertexNormals=c,this.hasWebMercatorT=P(n,!1),this.hasGeodeticSurfaceNormals=P(r,!1),this.exaggeration=P(m,1),this.exaggerationRelativeHeight=P(h,0),this.stride=0,this._offsetGeodeticSurfaceNormal=0,this._offsetVertexNormal=0,this._calculateStrideAndOffsets()}p.prototype.encode=function(o,t,e,a,i,c,n,r){letm=a.x,h=a.y;if(this.quantization===S.BITS12){e=d.multiplyByPoint(this.toScaledENU,e,C),e.x=w.clamp(e.x,0,1),e.y=w.clamp(e.y,0,1),e.z=w.clamp(e.z,0,1);letu=this.maximumHeight-this.minimumHeight,g=w.clamp((i-this.minimumHeight)/u,0,1);T.fromElements(e.x,e.y,f);letN=y.compressTextureCoordinates(f);T.fromElements(e.z,g,f);letE=y.compressTextureCoordinates(f);T.fromElements(m,h,f);letI=y.compressTextureCoordinates(f);if(o[t++]=N,o[t++]=E,o[t++]=I,this.hasWebMercatorT){T.fromElements(n,0,f);let_=y.compressTextureCoordinates(f);o[t++]=_}}elses.subtract(e,this.center,C),o[t++]=C.x,o[t++]=C.y,o[t++]=C.z,o[t++]=i,o[t++]=m,o[t++]=h,this.hasWebMercatorT&&(o[t++]=n);returnthis.hasVertexNormals&&(o[t++]=y.octPackFloat(c)),this.hasGeodeticSurfaceNormals&&(o[t++]=r.x,o[t++]=r.y,o[t++]=r.z),t};varut=news,B=news;p.prototype.addGeodeticSurfaceNormals=function(o,t,e){if(this.hasGeodeticSurfaceNormals)return;leta=this.stride,i=o.length/a;this.hasGeodeticSurfaceNormals=!0,this._calculateStrideAndOffsets();letc=this.stride;for(letn=0;n<i;n++){for(letu=0;u<a;u++){letg=n*a+u,N=n*c+u;t[N]=o[g]}letr=this.decodePosition(t,n,ut),m=e.geodeticSurfaceNormal(r,B),h=n*c+this._offsetGeodeticSurfaceNormal;t[h]=m.x,t[h+1]=m.y,t[h+2]=m.z}};p.prototype.removeGeodeticSurfaceNormals=function(o,t){if(!this.hasGeodeticSurfaceNormals)return;lete=this.stride,a=o.length/e;this.hasGeodeticSurfaceNormals=!1,this._calculateStrideAndOffsets();leti=this.stride;for(letc=0;c<a;c++)for(letn=0;n<i;n++){letr=c*e+n,m=c*i+n;t[m]=o[r]}};p.prototype.decodePosition=function(o,t,e){if(l(e)||(e=news),t*=this.stride,this.quantization===S.BITS12){leta=y.decompressTextureCoordinates(o[t],f);e.x=a.x,e.y=a.y;leti=y.decompressTextureCoordinates(o[t+1],f);returne.z=i.x,d.multiplyByPoint(this.fromScaledENU,e,e)}returne.x=o[t],e.y=o[t+1],e.z=o[t+2],s.add(e,this.center,e)};p.prototype.getExaggeratedPosition=function(o,t,e){e=this.decodePosition(o,t,e);leta=this.exaggeration,i=this.exaggerationRelativeHeight;if(a!==1&&this.hasGeodeticSurfaceNormals){letn=this.decodeGeodeticSurfaceNormal(o,t,B),r=this.decodeHeight(o,t),m=$.getHeight(r,a,i)-r;e.x+=n.x*m,e.y+=n.y*m,e.z+=n.z*m}returne};p.prototype.decodeTextureCoordinates=function(o,t,e){returnl(e)||(e=newT),t*=this.stride,this.quantization===S.BITS12?y.decompressTextureCoordinates(o[t+2],e):T.fromElements(o[t+4],o[t+5],e)};p.prototype.decodeHeight=function(o,t){returnt*=this.stride,this.quantization===S.BITS12?y.decompressTextureCoordinates(o[t+1],f).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight:o[t+3]};p.prototype.decodeWebMercatorT=function(o,t){returnt*=this.stride,this.quantization===S.BITS12?y.decompressTextureCoordinates(o[t+3],f).x:o[t+6]};p.prototype.getOctEncodedNormal=function(o,t,e){t=t*this.stride+this._offsetVertexNormal;leta=o[t]/256,i=Math.floor(a),c=(a-i)*256;returnT.fromElements(i,c,e)};p.prototype.decodeGeodeticSurfaceNormal=function(o,t,e){returnt=t*this.stride+this._offsetGeodeticSurfaceNormal,e.x=o[t],e.y=o[t+1],e.z=o[t+2],e};p.prototype._calculateStrideAndOffsets=function(){leto=0;switch(this.quantization){caseS.BITS12:o+=3;break;default:o+=6}this.hasWebMercatorT&&(o+=1),this.hasVertexNormals&&(this._offsetVertexNormal=o,o+=1),this.hasGeodeticSurfaceNormals&&(this._offsetGeodeticSurfaceNormal=o,o+=3),this.stride=o};varG={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},H={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};p.prototype.getAttributes=function(o){lett=R.FLOAT,e=R.getSizeInBytes(t),a=this.stride*e,i=0,c=[];functionn(r,m){c.push({index:r,vertexBuffer:o,componentDatatype:t,componentsPerAttribute:m,offsetInBytes:i,strideInBytes:a}),i+=m*e}if(this.quantization===S.NONE){n(G.position3DAndHeight,4);letr=2;r+=this.hasWebMercatorT?1:0,r+=this.hasVertexNormals?1:0,n(G.textureCoordAndEncodedNormals,r),this.hasGeodeticSurfaceNormals&&n(G.geodeticSurfaceNormal,3)}else{letr=this.hasWebMercatorT||this.hasVertexNormals,m=this.hasWebMercatorT&&this.hasVertexNormals;n(H.compressed0,r?4:3),m&&n(H.compressed1,1),this.hasGeodeticSurfaceNormals&&n(H.geodeticSurfaceNormal,3)}returnc};p.prototype.getAttributeLocations=function(){returnthis.quantization===S.NONE?G:H};p.clone=function(o,t){if(l(o))returnl(t)||(t=newp),t.quantization=o.quantization,t.minimumHeight=o.minimumHeight,t.maximumHeight=o.maximumHeight,t.center=s.clone(o.center),t.toScaledENU=d.clone(o.toScaledENU),t.fromScaledENU=d.clone(o.fromScaledENU),t.matrix=d.clone(o.matrix),t.hasVertexNormals=o.hasVertexNormals,t.hasWebMercatorT=o.hasWebMercatorT,t.hasGeodeticSurfaceNormals=o.hasGeodeticSurfaceNormals,t.exaggeration=o.exaggeration,t.exaggerationRelativeHeight=o.exaggerationRelativeHeight,t._calculateStrideAndOffsets(),t};varWt=p;export{Ptasa,Wtasb};
* 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{aasS}from"./chunk-IPMQ7HU7.js";import{aasj}from"./chunk-ZFTFDHK4.js";import{aasD}from"./chunk-NNHN6WUY.js";import{aasV}from"./chunk-T7ERZ2CJ.js";import{basT,casB,dasL}from"./chunk-GSNDLQ4C.js";import{dasO}from"./chunk-BKSIEBAA.js";import{aasx}from"./chunk-VTVHUB7E.js";import{aasc,dasl}from"./chunk-JMSSU44E.js";import{aasE}from"./chunk-4UYSGV57.js";import{aasm}from"./chunk-VLPNAR64.js";import{aas_}from"./chunk-GE5NEIZC.js";import{easd}from"./chunk-35CVRQTC.js";varq=newc,M=newc;functionU(e){lett=e.center;M=c.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,M),e.height,M),M=c.add(t,M,M);leti=newO(M,e.semiMajorAxis),f=S.computeEllipsePositions(e,!1,!0).outerPositions,o=newV({position:newL({componentDatatype:x.DOUBLE,componentsPerAttribute:3,values:S.raisePositionsToHeight(f,e,!1)})}),r=f.length/3,u=D.createTypedArray(r,r*2),h=0;for(letn=0;n<r;++n)u[h++]=n,u[h++]=(n+1)%r;return{boundingSphere:i,attributes:o,indices:u}}varN=newO,P=newO;functionR(e){lett=e.center,i=e.ellipsoid,f=e.semiMajorAxis,o=c.multiplyByScalar(i.geodeticSurfaceNormal(t,q),e.height,q);N.center=c.add(t,o,N.center),N.radius=f,o=c.multiplyByScalar(i.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),P.center=c.add(t,o,P.center),P.radius=f;letr=S.computeEllipsePositions(e,!1,!0).outerPositions,u=newV({position:newL({componentDatatype:x.DOUBLE,componentsPerAttribute:3,values:S.raisePositionsToHeight(r,e,!0)})});r=u.position.values;leth=O.union(N,P),n=r.length/3;if(d(e.offsetAttribute)){letg=newUint8Array(n);if(e.offsetAttribute===j.TOP)g=g.fill(1,0,n/2);else{letH=e.offsetAttribute===j.NONE?0:1;g=g.fill(H)}u.applyOffset=newL({componentDatatype:x.UNSIGNED_BYTE,componentsPerAttribute:1,values:g})}letp=m(e.numberOfVerticalLines,16);p=E.clamp(p,0,n/2);leta=D.createTypedArray(n,n*2+p*2);n/=2;letA=0,s;for(s=0;s<n;++s)a[A++]=s,a[A++]=(s+1)%n,a[A++]=s+n,a[A++]=(s+1)%n+n;letk;if(p>0){letg=Math.min(p,n);k=Math.round(n/g);letH=Math.min(k*p,n);for(s=0;s<H;s+=k)a[A++]=s,a[A++]=s+n}return{boundingSphere:h,attributes:u,indices:a}}functionw(e){e=m(e,m.EMPTY_OBJECT);lett=e.center,i=m(e.ellipsoid,l.default),f=e.semiMajorAxis,o=e.semiMinorAxis,r=m(e.granularity,E.RADIANS_PER_DEGREE);if(!d(t))thrownew_("center is required.");if(!d(f))thrownew_("semiMajorAxis is required.");if(!d(o))thrownew_("semiMinorAxis is required.");if(f<o)thrownew_("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(r<=0)thrownew_("granularity must be greater than zero.");letu=m(e.height,0),h=m(e.extrudedHeight,u);this._center=c.clone(t),this._semiMajorAxis=f,this._semiMinorAxis=o,this._ellipsoid=l.clone(i),this._rotation=m(e.rotation,0),this._height=Math.max(h,u),this._granularity=r,this._extrudedHeight=Math.min(h,u),this._numberOfVerticalLines=Math.max(m(e.numberOfVerticalLines,16),0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}w.packedLength=c.packedLength+l.packedLength+8;w.pack=function(e,t,i){if(!d(e))thrownew_("value is required");if(!d(t))thrownew_("array is required");returni=m(i,0),c.pack(e._center,t,i),i+=c.packedLength,l.pack(e._ellipsoid,t,i),i+=l.packedLength,t[i++]=e._semiMajorAxis,t[i++]=e._semiMinorAxis,t[i++]=e._rotation,t[i++]=e._height,t[i++]=e._granularity,t[i++]=e._extrudedHeight,t[i++]=e._numberOfVerticalLines,t[i]=m(e._offsetAttribute,-1),t};vary=newc,C=newl,b={center:y,ellipsoid:C,semiMajorAxis:void0,semiMinorAxis:void0,rotation:void0,height:void0,granularity:void0,extrudedHeight:void0,numberOfVerticalLines:void0,offsetAttribute:void0};w.unpack=function(e,t,i){if(!d(e))thrownew_("array is required");t=m(t,0);letf=c.unpack(e,t,y);t+=c.packedLength;leto=l.unpack(e,t,C);t+=l.packedLength;letr=e[t++],u=e[t++],h=e[t++],n=e[t++],p=e[t++],a=e[t++],A=e[t++],s=e[t];returnd(i)?(i._center=c.clone(f,i._center),i._ellipsoid=l.clone(o,i._ellipsoid),i._semiMajorAxis=r,i._semiMinorAxis=u,i._rotation=h,i._height=n,i._granularity=p,i._extrudedHeight=a,i._numberOfVerticalLines=A,i._offsetAttribute=s===-1?void0:s,i):(b.height=n,b.extrudedHeight=a,b.granularity=p,b.rotation=h,b.semiMajorAxis=r,b.semiMinorAxis=u,b.numberOfVerticalLines=A,b.offsetAttribute=s===-1?void0:s,neww(b))};w.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;lett=e._height,i=e._extrudedHeight,f=!E.equalsEpsilon(t,i,0,E.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);leto={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines},r;if(f)o.extrudedHeight=i,o.offsetAttribute=e._offsetAttribute,r=R(o);elseif(r=U(o),d(e._offsetAttribute)){letu=r.attributes.position.values.length,h=e._offsetAttribute===j.NONE?0:1,n=newUint8Array(u/3).fill(h);r.attributes.applyOffset=newL({componentDatatype:x.UNSIGNED_BYTE,componentsPerAttribute:1,values:n})}returnnewB({attributes:r.attributes,indices:r.indices,primitiveType:T.LINES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};varie=w;export{ieasa};
* 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{bas_,hasI}from"./chunk-YWRPWWKI.js";import{aasn,basN,dasZ,easA}from"./chunk-JMSSU44E.js";import{aascn}from"./chunk-4UYSGV57.js";import{aasT}from"./chunk-VLPNAR64.js";import{aason,bash}from"./chunk-GE5NEIZC.js";import{easx}from"./chunk-35CVRQTC.js";functionV(e){this._ellipsoid=T(e,Z.default),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(V.prototype,{ellipsoid:{get:function(){returnthis._ellipsoid}}});V.prototype.project=function(e,t){leto=this._semimajorAxis,c=e.longitude*o,r=e.latitude*o,d=e.height;returnx(t)?(t.x=c,t.y=r,t.z=d,t):newn(c,r,d)};V.prototype.unproject=function(e,t){if(!x(e))thrownewon("cartesian is required");leto=this._oneOverSemimajorAxis,c=e.x*o,r=e.y*o,d=e.z;returnx(t)?(t.longitude=c,t.latitude=r,t.height=d,t):newN(c,r,d)};vark=V;varmn={OUTSIDE:-1,INTERSECTING:0,INSIDE:1},U=Object.freeze(mn);functionun(e,t){this.start=T(e,0),this.stop=T(t,0)}varrn=un;functiona(e,t){this.center=n.clone(T(e,n.ZERO)),this.radius=T(t,0)}varF=newn,Y=newn,J=newn,K=newn,Q=newn,$=newn,L=newn,b=newn,H=newn,nn=newn,tn=newn,en=newn,xn=4/3*cn.PI;a.fromPoints=function(e,t){if(x(t)||(t=newa),!x(e)||e.length===0)returnt.center=n.clone(n.ZERO,t.center),t.radius=0,t;leto=n.clone(e[0],L),c=n.clone(o,F),r=n.clone(o,Y),d=n.clone(o,J),f=n.clone(o,K),s=n.clone(o,Q),m=n.clone(o,$),z=e.length,y;for(y=1;y<z;y++){n.clone(e[y],o);letR=o.x,M=o.y,w=o.z;R<c.x&&n.clone(o,c),R>f.x&&n.clone(o,f),M<r.y&&n.clone(o,r),M>s.y&&n.clone(o,s),w<d.z&&n.clone(o,d),w>m.z&&n.clone(o,m)}letu=n.magnitudeSquared(n.subtract(f,c,b)),i=n.magnitudeSquared(n.subtract(s,r,b)),v=n.magnitudeSquared(n.subtract(m,d,b)),C=c,q=f,O=u;i>O&&(O=i,C=r,q=s),v>O&&(O=v,C=d,q=m);letp=H;p.x=(C.x+q.x)*.5,p.y=(C.y+q.y)*.5,p.z=(C.z+q.z)*.5;letS=n.magnitudeSquared(n.subtract(q,p,b)),l=Math.sqrt(S),j=nn;j.x=c.x,j.y=r.y,j.z=d.z;letP=tn;P.x=f.x,P.y=s.y,P.z=m.z;letD=n.midpoint(j,P,en),B=0;for(y=0;y<z;y++){n.clone(e[y],o);letR=n.magnitude(n.subtract(o,D,b));R>B&&(B=R);letM=n.magnitudeSquared(n.subtract(o,p,b));if(M>S){letw=Math.sqrt(M);l=(l+w)*.5,S=l*l;letg=w-l;p.x=(l*p.x+g*o.x)/w,p.y=(l*p.y+g*o.y)/w,p.z=(l*p.z+g*o.z)/w}}returnl<B?(n.clone(p,t.center),t.radius=l):(n.clone(D,t.center),t.radius=B),t};varan=newk,yn=newn,ln=newn,G=newN,X=newN;a.fromRectangle2D=function(e,t,o){returna.fromRectangleWithHeights2D(e,t,0,0,o)};a.fromRectangleWithHeights2D=function(e,t,o,c,r){if(x(r)||(r=newa),!x(e))returnr.center=n.clone(n.ZERO,r.center),r.radius=0,r;an._ellipsoid=Z.default,t=T(t,an),I.southwest(e,G),G.height=o,I.northeast(e,X),X.height=c;letd=t.project(G,yn),f=t.project(X,ln),s=f.x-d.x,m=f.y-d.y,z=f.z-d.z;r.radius=Math.sqrt(s*s+m*m+z*z)*.5;lety=r.center;returny.x=d.x+s*.5,y.y=d.y+m*.5,y.z=d.z+z*.5,r};varpn=[];a.fromRectangle3D=function(e,t,o,c){if(t=T(t,Z.default),o=T(o,0),x(c)||(c=newa),!x(e))returnc.center=n.clone(n.ZERO,c.center),c.radius=0,c;letr=I.subsample(e,t,o,pn);returna.fromPoints(r,c)};a.fromVertices=function(e,t,o,c){if(x(c)||(c=newa),!x(e)||e.length===0)returnc.center=n.clone(n.ZERO,c.center),c.radius=0,c;t=T(t,n.ZERO),o=T(o,3),h.typeOf.number.greaterThanOrEquals("stride",o,3);letr=L;r.x=e[0]+t.x,r.y=e[1]+t.y,r.z=e[2]+t.z;letd=n.clone(r,F),f=n.clone(r,Y),s=n.clone(r,J),m=n.clone(r,K),z=n.clone(r,Q),y=n.clone(r,$),u=e.length,i;for(i=0;i<u;i+=o){letw=e[i]+t.x,g=e[i+1]+t.y,E=e[i+2]+t.z;r.x=w,r.y=g,r.z=E,w<d.x&&n.clone(r,d),w>m.x&&n.clone(r,m),g<f.y&&n.clone(r,f),g>z.y&&n.clone(r,z),E<s.z&&n.clone(r,s),E>y.z&&n.clone(r,y)}letv=n.magnitudeSquared(n.subtract(m,d,b)),C=n.magnitudeSquared(n.subtract(z,f,b)),q=n.magnitudeSquared(n.subtract(y,s,b)),O=d,p=m,S=v;C>S&&(S=C,O=f,p=z),q>S&&(S=q,O=s,p=y);letl=H;l.x=(O.x+p.x)*.5,l.y=(O.y+p.y)*.5,l.z=(O.z+p.z)*.5;letj=n.magnitudeSquared(n.subtract(p,l,b)),P=Math.sqrt(j),D=nn;D.x=d.x,D.y=f.y,D.z=s.z;letB=tn;B.x=m.x,B.y=z.y,B.z=y.z;letR=n.midpoint(D,B,en),M=0;for(i=0;i<u;i+=o){r.x=e[i]+t.x,r.y=e[i+1]+t.y,r.z=e[i+2]+t.z;letw=n.magnitude(n.subtract(r,R,b));w>M&&(M=w);letg=n.magnitudeSquared(n.subtract(r,l,b));if(g>j){letE=Math.sqrt(g);P=(P+E)*.5,j=P*P;letW=E-P;l.x=(P*l.x+W*r.x)/E,l.y=(P*l.y+W*r.y)/E,l.z=(P*l.z+W*r.z)/E}}returnP<M?(n.clone(l,c.center),c.radius=P):(n.clone(R,c.center),c.radius=M),c};a.fromEncodedCartesianVertices=function(e,t,o){if(x(o)||(o=newa),!x(e)||!x(t)||e.length!==t.length||e.length===0)returno.center=n.clone(n.ZERO,o.center),o.radius=0,o;letc=L;c.x=e[0]+t[0],c.y=e[1]+t[1],c.z=e[2]+t[2];letr=n.clone(c,F),d=n.clone(c,Y),f=n.clone(c,J),s=n.clone(c,K),m=n.clone(c,Q),z=n.clone(c,$),y=e.length,u;for(u=0;u<y;u+=3){letM=e[u]+t[u],w=e[u+1]+t[u+1],g=e[u+2]+t[u+2];c.x=M,c.y=w,c.z=g,M<r.x&&n.clone(c,r),M>s.x&&n.clone(c,s),w<d.y&&n.clone(c,d),w>m.y&&n.clone(c,m),g<f.z&&n.clone(c,f),g>z.z&&n.clone(c,z)}leti=n.magnitudeSquared(n.subtract(s,r,b)),v=n.magnitudeSquared(n.subtract(m,d,b)),C=n.magnitudeSquared(n.subtract(z,f,b)),q=r,O=s,p=i;v>p&&(p=v,q=d,O=m),C>p&&(p=C,q=f,O=z);letS=H;S.x=(q.x+O.x)*.5,S.y=(q.y+O.y)*.5,S.z=(q.z+O.z)*.5;letl=n.magnitudeSquared(n.subtract(O,S,b)),j=Math.sqrt(l),P=nn;P.x=r.x,P.y=d.y,P.z=f.z;letD=tn;D.x=s.x,D.y=m.y,D.z=z.z;letB=n.midpoint(P,D,en),R=0;for(u=0;u<y;u+=3){c.x=e[u]+t[u],c.y=e[u+1]+t[u+1],c.z=e[u+2]+t[u+2];letM=n.magnitude(n.subtract(c,B,b));M>R&&(R=M);letw=n.magnitudeSquared(n.subtract(c,S,b));if(w>l){letg=Math.sqrt(w);j=(j+g)*.5,l=j*j;letE=g-j;S.x=(j*S.x+E*c.x)/g,S.y=(j*S.y+E*c.y)/g,S.z=(j*S.z+E*c.z)/g}}returnj<R?(n.clone(S,o.center),o.radius=j):(n.clone(B,o.center),o.radius=R),o};a.fromCornerPoints=function(e,t,o){h.typeOf.object("corner",e),h.typeOf.object("oppositeCorner",t),x(o)||(o=newa);letc=n.midpoint(e,t,o.center);returno.radius=n.distance(c,t),o};a.fromEllipsoid=function(e,t){returnh.typeOf.object("ellipsoid",e),x(t)||(t=newa),n.clone(n.ZERO,t.center),t.radius=e.maximumRadius,t};varhn=newn;a.fromBoundingSpheres=function(e,t){if(x(t)||(t=newa),!x(e)||e.length===0)returnt.center=n.clone(n.ZERO,t.center),t.radius=0,t;leto=e.length;if(o===1)returna.clone(e[0],t);if(o===2)returna.union(e[0],e[1],t);letc=[],r;for(r=0;r<o;r++)c.push(e[r].center);t=a.fromPoints(c,t);letd=t.center,f=t.radius;for(r=0;r<o;r++){lets=e[r];f=Math.max(f,n.distance(d,s.center,hn)+s.radius)}returnt.radius=f,t};varzn=newn,Sn=newn,wn=newn;a.fromOrientedBoundingBox=function(e,t){h.defined("orientedBoundingBox",e),x(t)||(t=newa);leto=e.halfAxes,c=A.getColumn(o,0,zn),r=A.getColumn(o,1,Sn),d=A.getColumn(o,2,wn);returnn.add(c,r,c),n.add(c,d,c),t.center=n.clone(e.center,t.center),t.radius=n.magnitude(c),t};varPn=newn,gn=newn;a.fromTransformation=function(e,t){h.typeOf.object("transformation",e),x(t)||(t=newa);leto=_.getTranslation(e,Pn),c=_.getScale(e,gn),r=.5*n.magnitude(c);returnt.center=n.clone(o,t.center),t.radius=r,t};a.clone=function(e,t){if(x(e))returnx(t)?(t.center=n.clone(e.center,t.center),t.radius=e.radius,t):newa(e.center,e.radius)};a.packedLength=4;a.pack=function(e,t,o){h.typeOf.object("value",e),h.defined("array",t),o=T(o,0);letc=e.center;returnt[o++]=c.x,t[o++]=c.y,t[o++]=c.z,t[o]=e.radius,t};a.unpack=function(e,t,o){h.defined("array",e),t=T(t,0),x(o)||(o=newa);letc=o.center;returnc.x=e[t++],c.y=e[t++],c.z=e[t++],o.radius=e[t],o};varOn=newn,jn=newn;a.union=function(e,t,o){h.typeOf.object("left",e),h.typeOf.object("right",t),x(o)||(o=newa);letc=e.center,r=e.radius,d=t.center,f=t.radius,s=n.subtract(d,c,On),m=n.magnitude(s);if(r>=m+f)returne.clone(o),o;if(f>=m+r)returnt.clone(o),o;letz=(r+m+f)*.5,y=n.multiplyByScalar(s,(-r+z)/m,jn);returnn.add(y,c,y),n.clone(y,o.center),o.radius=z,o};varbn=newn;a.expand=function(e,t,o){h.typeOf.object("sphere",e),h.typeOf.object("point",t),o=a.clone(e,o);letc=n.magnitude(n.subtract(t,o.center,bn));returnc>o.radius&&(o.radius=c),o};a.intersectPlane=function(e,t){h.typeOf.object("sphere",e),h.typeOf.object("plane",t);leto=e.center,c=e.radius,r=t.normal,d=n.dot(r,o)+t.distance;returnd<-c?U.OUTSIDE:d<c?U.INTERSECTING:U.INSIDE};a.transform=function(e,t,o){returnh.typeOf.object("sphere",e),h.typeOf.object("transform",t),x(o)||(o=newa),o.center=_.multiplyByPoint(t,e.center,o.center),o.radius=_.getMaximumScale(t)*e.radius,o};varqn=newn;a.distanceSquaredTo=function(e,t){h.typeOf.object("sphere",e),h.typeOf.object("cartesian",t);leto=n.subtract(e.center,t,qn),c=n.magnitude(o)-e.radius;returnc<=0?0:c*c};a.transformWithoutScale=function(e,t,o){returnh.typeOf.object("sphere",e),h.typeOf.object("transform",t),x(o)||(o=newa),o.center=_.multiplyByPoint(t,e.center,o.center),o.radius=e.radius,o};varMn=newn;a.computePlaneDistances=function(e,t,o,c){h.typeOf.object("sphere",e),h.typeOf.object("position",t),h.typeOf.object("direction",o),x(c)||(c=newrn);letr=n.subtract(e.center,t,Mn),d=n.dot(o,r);returnc.start=d-e.radius,c.stop=d+e.radius,c};vardn=newn,Tn=newn,Cn=newn,Rn=newn,En=newn,Dn=newN,sn=newArray(8);for(lete=0;e<8;++e)sn[e]=newn;varfn=newk;a.projectTo2D=function(e,t,o){h.typeOf.object("sphere",e),fn._ellipsoid=Z.default,t=T(t,fn);letc=t.ellipsoid,r=e.center,d=e.radius,f;n.equals(r,n.ZERO)?f=n.clone(n.UNIT_X,dn):f=c.geodeticSurfaceNormal(r,dn);lets=n.cross(n.UNIT_Z,f,Tn);n.normalize(s,s);letm=n.cross(f,s,Cn);n.normalize(m,m),n.multiplyByScalar(f,d,f),n.multiplyByScalar(m,d,m),n.multiplyByScalar(s,d,s);letz=n.negate(m,En),y=n.negate(s,Rn),u=sn,i=u[0];n.add(f,m,i),n.add(i,s,i),i=u[1],n.add(f,m,i),n.add(i,y,i),i=u[2],n.add(f,z,i),n.add(i,y,i),i=u[3],n.add(f,z,i),n.add(i,s,i),n.negate(f,f),i=u[4],n.add(f,m,i),n.add(i,s,i),i=u[5],n.add(f,m,i),n.add(i,y,i),i=u[6],n.add(f,z,i),n.add(i,y,i),i=u[7],n.add(f,z,i),n.add(i,s,i);letv=u.length;for(letp=0;p<v;++p){letS=u[p];n.add(r,S,S);letl=c.cartesianToCartographic(S,Dn);t.project(l,S)}o=a.fromPoints(u,o),r=o.center;letC=r.x,q=r.y,O=r.z;returnr.x=O,r.y=C,r.z=q,o};a.isOccluded=function(e,t){returnh.typeOf.object("sphere",e),h.typeOf.object("occluder",t),!t.isBoundingSphereVisible(e)};a.equals=function(e,t){returne===t||x(e)&&x(t)&&n.equals(e.center,t.center)&&e.radius===t.radius};a.prototype.intersectPlane=function(e){returna.intersectPlane(this,e)};a.prototype.distanceSquaredTo=function(e){returna.distanceSquaredTo(this,e)};a.prototype.computePlaneDistances=function(e,t,o){returna.computePlaneDistances(this,e,t,o)};a.prototype.isOccluded=function(e){returna.isOccluded(this,e)};a.prototype.equals=function(e){returna.equals(this,e)};a.prototype.clone=function(e){returna.clone(this,e)};a.prototype.volume=function(){lete=this.radius;returnxn*e*e*e};varet=a;export{kasa,Uasb,rnasc,etasd};
* 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{aasw,basz,iasS}from"./chunk-YWRPWWKI.js";import{aasy}from"./chunk-VTVHUB7E.js";import{aasC,casT,easx}from"./chunk-JMSSU44E.js";import{aash}from"./chunk-4UYSGV57.js";import{aasu,basa}from"./chunk-GE5NEIZC.js";import{easb}from"./chunk-35CVRQTC.js";varc={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};c.getMathType=function(e){switch(e){casec.SCALAR:returnNumber;casec.VEC2:returnT;casec.VEC3:returnC;casec.VEC4:returnw;casec.MAT2:returnS;casec.MAT3:returnx;casec.MAT4:returnz;default:thrownewu("attributeType is not a valid value.")}};c.getNumberOfComponents=function(e){switch(e){casec.SCALAR:return1;casec.VEC2:return2;casec.VEC3:return3;casec.VEC4:casec.MAT2:return4;casec.MAT3:return9;casec.MAT4:return16;default:thrownewu("attributeType is not a valid value.")}};c.getAttributeLocationCount=function(e){switch(e){casec.SCALAR:casec.VEC2:casec.VEC3:casec.VEC4:return1;casec.MAT2:return2;casec.MAT3:return3;casec.MAT4:return4;default:thrownewu("attributeType is not a valid value.")}};c.getGlslType=function(e){switch(a.typeOf.string("attributeType",e),e){casec.SCALAR:return"float";casec.VEC2:return"vec2";casec.VEC3:return"vec3";casec.VEC4:return"vec4";casec.MAT2:return"mat2";casec.MAT3:return"mat3";casec.MAT4:return"mat4";default:thrownewu("attributeType is not a valid value.")}};varN=Object.freeze(c);varV=1/256,D=256,r={};r.octEncodeInRange=function(e,t,n){a.defined("vector",e),a.defined("result",n);leto=C.magnitudeSquared(e);if(Math.abs(o-1)>h.EPSILON6)thrownewu("vector must be normalized.");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){leti=n.x,d=n.y;n.x=(1-Math.abs(d))*h.signNotZero(i),n.y=(1-Math.abs(i))*h.signNotZero(d)}returnn.x=h.toSNorm(n.x,t),n.y=h.toSNorm(n.y,t),n};r.octEncode=function(e,t){returnr.octEncodeInRange(e,255,t)};varA=newT,F=newUint8Array(1);functionE(e){returnF[0]=e,F[0]}r.octEncodeToCartesian4=function(e,t){returnr.octEncodeInRange(e,65535,A),t.x=E(A.x*V),t.y=E(A.x),t.z=E(A.y*V),t.w=E(A.y),t};r.octDecodeInRange=function(e,t,n,o){if(a.defined("result",o),e<0||e>n||t<0||t>n)thrownewu(`x and y must be unsigned normalized integers between 0 and ${n}`);if(o.x=h.fromSNorm(e,n),o.y=h.fromSNorm(t,n),o.z=1-(Math.abs(o.x)+Math.abs(o.y)),o.z<0){leti=o.x;o.x=(1-Math.abs(o.y))*h.signNotZero(i),o.y=(1-Math.abs(i))*h.signNotZero(o.y)}returnC.normalize(o,o)};r.octDecode=function(e,t,n){returnr.octDecodeInRange(e,t,255,n)};r.octDecodeFromCartesian4=function(e,t){a.typeOf.object("encoded",e),a.typeOf.object("result",t);letn=e.x,o=e.y,i=e.z,d=e.w;if(n<0||n>255||o<0||o>255||i<0||i>255||d<0||d>255)thrownewu("x, y, z, and w must be unsigned normalized integers between 0 and 255");letf=n*D+o,s=i*D+d;returnr.octDecodeInRange(f,s,65535,t)};r.octPackFloat=function(e){returna.defined("encoded",e),256*e.x+e.y};varl=newT;r.octEncodeFloat=function(e){returnr.octEncode(e,l),r.octPackFloat(l)};r.octDecodeFloat=function(e,t){a.defined("value",e);letn=e/256,o=Math.floor(n),i=(n-o)*256;returnr.octDecode(o,i,t)};r.octPack=function(e,t,n,o){a.defined("v1",e),a.defined("v2",t),a.defined("v3",n),a.defined("result",o);leti=r.octEncodeFloat(e),d=r.octEncodeFloat(t),f=r.octEncode(n,l);returno.x=65536*f.x+i,o.y=65536*f.y+d,o};r.octUnpack=function(e,t,n,o){a.defined("packed",e),a.defined("v1",t),a.defined("v2",n),a.defined("v3",o);leti=e.x/65536,d=Math.floor(i),f=(i-d)*65536;i=e.y/65536;lets=Math.floor(i),m=(i-s)*65536;r.octDecodeFloat(f,t),r.octDecodeFloat(m,n),r.octDecode(d,s,o)};r.compressTextureCoordinates=function(e){a.defined("textureCoordinates",e);lett=e.x*4095|0,n=e.y*4095|0;return4096*t+n};r.decompressTextureCoordinates=function(e,t){a.defined("compressed",e),a.defined("result",t);letn=e/4096,o=Math.floor(n);returnt.x=o/4095,t.y=(e-o*4096)/4095,t};functiong(e){returne>>1^-(e&1)}r.zigZagDeltaDecode=function(e,t,n){a.defined("uBuffer",e),a.defined("vBuffer",t),a.typeOf.number.equals("uBuffer.length","vBuffer.length",e.length,t.length),b(n)&&a.typeOf.number.equals("uBuffer.length","heightBuffer.length",e.length,n.length);leto=e.length,i=0,d=0,f=0;for(lets=0;s<o;++s)i+=g(e[s]),d+=g(t[s]),e[s]=i,t[s]=d,b(n)&&(f+=g(n[s]),n[s]=f)};r.dequantize=function(e,t,n,o){a.defined("typedArray",e),a.defined("componentDatatype",t),a.defined("type",n),a.defined("count",o);leti=N.getNumberOfComponents(n),d;switch(t){casey.BYTE:d=127;break;casey.UNSIGNED_BYTE:d=255;break;casey.SHORT:d=32767;break;casey.UNSIGNED_SHORT:d=65535;break;casey.INT:d=2147483647;break;casey.UNSIGNED_INT:d=4294967295;break;default:thrownewu(`Cannot dequantize component datatype: ${t}`)}letf=newFloat32Array(o*i);for(lets=0;s<o;s++)for(letm=0;m<i;m++){letp=s*i+m;f[p]=Math.max(e[p]/d,-1)}returnf};r.decodeRGB565=function(e,t){a.defined("typedArray",e);letn=e.length*3;b(t)&&a.typeOf.number.equals("result.length","typedArray.length * 3",t.length,n);leto=e.length;b(t)||(t=newFloat32Array(o*3));leti=31,d=63,f=1/31,s=1/63;for(letm=0;m<o;m++){letp=e[m],R=p>>11,I=p>>5&d,O=p&i,M=3*m;t[M]=R*f,t[M+1]=I*s,t[M+2]=O*f}returnt};varW=r;export{Wasa};
* 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{aasp,basP,dasq}from"./chunk-JMSSU44E.js";import{a}from"./chunk-4UYSGV57.js";import{aasT}from"./chunk-VLPNAR64.js";import{aasI,basg}from"./chunk-GE5NEIZC.js";import{easl}from"./chunk-35CVRQTC.js";functiony(n,i,o){if(n===0)returni*o;lett=n*n,e=t*t,c=e*t,r=c*t,h=r*t,s=h*t,d=o,u=Math.sin(2*d),f=Math.sin(4*d),M=Math.sin(6*d),_=Math.sin(8*d),E=Math.sin(10*d),S=Math.sin(12*d);returni*((1-t/4-3*e/64-5*c/256-175*r/16384-441*h/65536-4851*s/1048576)*d-(3*t/8+3*e/32+45*c/1024+105*r/4096+2205*h/131072+6237*s/524288)*u+(15*e/256+45*c/1024+525*r/16384+1575*h/65536+155925*s/8388608)*f-(35*c/3072+175*r/12288+3675*h/262144+13475*s/1048576)*M+(315*r/131072+2205*h/524288+43659*s/8388608)*_-(693*h/1310720+6237*s/5242880)*E+1001*s/8388608*S)}functionz(n,i,o){lett=n/o;if(i===0)returnt;lete=t*t,c=e*t,r=c*t,h=i,s=h*h,d=s*s,u=d*s,f=u*s,M=f*s,_=M*s,E=Math.sin(2*t),S=Math.cos(2*t),W=Math.sin(4*t),V=Math.cos(4*t),C=Math.sin(6*t),N=Math.cos(6*t),R=Math.sin(8*t),b=Math.cos(8*t),x=Math.sin(10*t),U=Math.cos(10*t),H=Math.sin(12*t);returnt+t*s/4+7*t*d/64+15*t*u/256+579*t*f/16384+1515*t*M/65536+16837*t*_/1048576+(3*t*d/16+45*t*u/256-t*(32*e-561)*f/4096-t*(232*e-1677)*M/16384+t*(399985-90560*e+512*r)*_/5242880)*S+(21*t*u/256+483*t*f/4096-t*(224*e-1969)*M/16384-t*(33152*e-112599)*_/1048576)*V+(151*t*f/4096+4681*t*M/65536+1479*t*_/16384-453*c*_/32768)*N+(1097*t*M/65536+42783*t*_/1048576)*b+8011*t*_/1048576*U+(3*s/8+3*d/16+213*u/2048-3*e*u/64+255*f/4096-33*e*f/512+20861*M/524288-33*e*M/512+r*M/1024+28273*_/1048576-471*e*_/8192+9*r*_/4096)*E+(21*d/256+21*u/256+533*f/8192-21*e*f/512+197*M/4096-315*e*M/4096+584039*_/16777216-12517*e*_/131072+7*r*_/2048)*W+(151*u/6144+151*f/4096+5019*M/131072-453*e*M/16384+26965*_/786432-8607*e*_/131072)*C+(1097*f/131072+1097*M/65536+225797*_/10485760-1097*e*_/65536)*R+(8011*M/2621440+8011*_/1048576)*x+293393*_/251658240*H}functionO(n,i){if(n===0)returnMath.log(Math.tan(.5*(a.PI_OVER_TWO+i)));leto=n*Math.sin(i);returnMath.log(Math.tan(.5*(a.PI_OVER_TWO+i)))-n/2*Math.log((1+o)/(1-o))}functionk(n,i,o,t,e){letc=O(n._ellipticity,o),r=O(n._ellipticity,e);returnMath.atan2(a.negativePiToPi(t-i),r-c)}functionA(n,i,o,t,e,c,r){leth=n._heading,s=c-t,d=0;if(a.equalsEpsilon(Math.abs(h),a.PI_OVER_TWO,a.EPSILON8))if(i===o)d=i*Math.cos(e)*a.negativePiToPi(s);else{letu=Math.sin(e);d=i*Math.cos(e)*a.negativePiToPi(s)/Math.sqrt(1-n._ellipticitySquared*u*u)}else{letu=y(n._ellipticity,i,e);d=(y(n._ellipticity,i,r)-u)/Math.cos(h)}returnMath.abs(d)}varB=newp,w=newp;functionD(n,i,o,t){lete=p.normalize(t.cartographicToCartesian(i,w),B),c=p.normalize(t.cartographicToCartesian(o,w),w);g.typeOf.number.greaterThanOrEquals("value",Math.abs(Math.abs(p.angleBetween(e,c))-Math.PI),.0125);letr=t.maximumRadius,h=t.minimumRadius,s=r*r,d=h*h;n._ellipticitySquared=(s-d)/s,n._ellipticity=Math.sqrt(n._ellipticitySquared),n._start=P.clone(i,n._start),n._start.height=0,n._end=P.clone(o,n._end),n._end.height=0,n._heading=k(n,i.longitude,i.latitude,o.longitude,o.latitude),n._distance=A(n,t.maximumRadius,t.minimumRadius,i.longitude,i.latitude,o.longitude,o.latitude)}functionv(n,i,o,t,e,c){if(o===0)returnP.clone(n,c);letr=e*e,h,s,d;if(Math.abs(a.PI_OVER_TWO-Math.abs(i))>a.EPSILON8){letu=y(e,t,n.latitude),f=o*Math.cos(i),M=u+f;if(s=z(M,e,t),Math.abs(i)<a.EPSILON10)h=a.negativePiToPi(n.longitude);else{let_=O(e,n.latitude),E=O(e,s);d=Math.tan(i)*(E-_),h=a.negativePiToPi(n.longitude+d)}}else{s=n.latitude;letu;if(e===0)u=t*Math.cos(n.latitude);else{letf=Math.sin(n.latitude);u=t*Math.cos(n.latitude)/Math.sqrt(1-r*f*f)}d=o/u,i>0?h=a.negativePiToPi(n.longitude+d):h=a.negativePiToPi(n.longitude-d)}returnl(c)?(c.longitude=h,c.latitude=s,c.height=0,c):newP(h,s,0)}functionm(n,i,o){lett=T(o,q.default);this._ellipsoid=t,this._start=newP,this._end=newP,this._heading=void0,this._distance=void0,this._ellipticity=void0,this._ellipticitySquared=void0,l(n)&&l(i)&&D(this,n,i,t)}Object.defineProperties(m.prototype,{ellipsoid:{get:function(){returnthis._ellipsoid}},surfaceDistance:{get:function(){returng.defined("distance",this._distance),this._distance}},start:{get:function(){returnthis._start}},end:{get:function(){returnthis._end}},heading:{get:function(){returng.defined("distance",this._distance),this._heading}}});m.fromStartHeadingDistance=function(n,i,o,t,e){g.defined("start",n),g.defined("heading",i),g.defined("distance",o),g.typeOf.number.greaterThan("distance",o,0);letc=T(t,q.default),r=c.maximumRadius,h=c.minimumRadius,s=r*r,d=h*h,u=Math.sqrt((s-d)/s);i=a.negativePiToPi(i);letf=v(n,i,o,c.maximumRadius,u);return!l(e)||l(t)&&!t.equals(e.ellipsoid)?newm(n,f,c):(e.setEndPoints(n,f),e)};m.prototype.setEndPoints=function(n,i){g.defined("start",n),g.defined("end",i),D(this,n,i,this._ellipsoid)};m.prototype.interpolateUsingFraction=function(n,i){returnthis.interpolateUsingSurfaceDistance(n*this._distance,i)};m.prototype.interpolateUsingSurfaceDistance=function(n,i){if(g.typeOf.number("distance",n),!l(this._distance)||this._distance===0)thrownewI("EllipsoidRhumbLine must have distinct start and end set.");returnv(this._start,this._heading,n,this._ellipsoid.maximumRadius,this._ellipticity,i)};m.prototype.findIntersectionWithLongitude=function(n,i){if(g.typeOf.number("intersectionLongitude",n),!l(this._distance)||this._distance===0)thrownewI("EllipsoidRhumbLine must have distinct start and end set.");leto=this._ellipticity,t=this._heading,e=Math.abs(t),c=this._start;if(n=a.negativePiToPi(n),a.equalsEpsilon(Math.abs(n),Math.PI,a.EPSILON14)&&(n=a.sign(c.longitude)*Math.PI),l(i)||(i=newP),Math.abs(a.PI_OVER_TWO-e)<=a.EPSILON8)returni.longitude=n,i.latitude=c.latitude,i.height=0,i;if(a.equalsEpsilon(Math.abs(a.PI_OVER_TWO-e),a.PI_OVER_TWO,a.EPSILON8))returna.equalsEpsilon(n,c.longitude,a.EPSILON12)?void0:(i.longitude=n,i.latitude=a.PI_OVER_TWO*a.sign(a.PI_OVER_TWO-t),i.height=0,i);letr=c.latitude,h=o*Math.sin(r),s=Math.tan(.5*(a.PI_OVER_TWO+r))*Math.exp((n-c.longitude)/Math.tan(t)),d=(1+h)/(1-h),u=c.latitude,f;do{f=u;letM=o*Math.sin(f),_=(1+M)/(1-M);u=2*Math.atan(s*Math.pow(_/d,o/2))-a.PI_OVER_TWO}while(!a.equalsEpsilon(u,f,a.EPSILON12));returni.longitude=n,i.latitude=u,i.height=0,i};m.prototype.findIntersectionWithLatitude=function(n,i){if(g.typeOf.number("intersectionLatitude",n),!l(this._distance)||this._distance===0)thrownewI("EllipsoidRhumbLine must have distinct start and end set.");leto=this._ellipticity,t=this._heading,e=this._start;if(a.equalsEpsilon(Math.abs(t),a.PI_OVER_TWO,a.EPSILON8))return;letc=O(o,e.latitude),r=O(o,n),h=Math.tan(t)*(r-c),s=a.negativePiToPi(e.longitude+h);returnl(i)?(i.longitude=s,i.latitude=n,i.height=0,i):newP(s,n,0)};var$=m;export{$asa};
* 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{aasl,basd}from"./chunk-YWRPWWKI.js";import{aast}from"./chunk-JMSSU44E.js";import{aass}from"./chunk-4UYSGV57.js";import{aasf,basr}from"./chunk-GE5NEIZC.js";import{easm}from"./chunk-35CVRQTC.js";functiono(e,n){if(r.typeOf.object("normal",e),!s.equalsEpsilon(t.magnitude(e),1,s.EPSILON6))thrownewf("normal must be normalized.");r.typeOf.number("distance",n),this.normal=t.clone(e),this.distance=n}o.fromPointNormal=function(e,n,a){if(r.typeOf.object("point",e),r.typeOf.object("normal",n),!s.equalsEpsilon(t.magnitude(n),1,s.EPSILON6))thrownewf("normal must be normalized.");letc=-t.dot(n,e);returnm(a)?(t.clone(n,a.normal),a.distance=c,a):newo(n,c)};varb=newt;o.fromCartesian4=function(e,n){r.typeOf.object("coefficients",e);leta=t.fromCartesian4(e,b),c=e.w;if(!s.equalsEpsilon(t.magnitude(a),1,s.EPSILON6))thrownewf("normal must be normalized.");returnm(n)?(t.clone(a,n.normal),n.distance=c,n):newo(a,c)};o.getPointDistance=function(e,n){returnr.typeOf.object("plane",e),r.typeOf.object("point",n),t.dot(e.normal,n)+e.distance};vary=newt;o.projectPointOntoPlane=function(e,n,a){r.typeOf.object("plane",e),r.typeOf.object("point",n),m(a)||(a=newt);letc=o.getPointDistance(e,n),p=t.multiplyByScalar(e.normal,c,y);returnt.subtract(n,p,a)};varw=newd,j=newl,N=newt;o.transform=function(e,n,a){r.typeOf.object("plane",e),r.typeOf.object("transform",n);letc=e.normal,p=e.distance,u=d.inverseTranspose(n,w),i=l.fromElements(c.x,c.y,c.z,p,j);i=d.multiplyByVector(u,i,i);letO=t.fromCartesian4(i,N);returni=l.divideByScalar(i,t.magnitude(O),i),o.fromCartesian4(i,a)};o.clone=function(e,n){returnr.typeOf.object("plane",e),m(n)?(t.clone(e.normal,n.normal),n.distance=e.distance,n):newo(e.normal,e.distance)};o.equals=function(e,n){returnr.typeOf.object("left",e),r.typeOf.object("right",n),e.distance===n.distance&&t.equals(e.normal,n.normal)};o.ORIGIN_XY_PLANE=Object.freeze(newo(t.UNIT_Z,0));o.ORIGIN_YZ_PLANE=Object.freeze(newo(t.UNIT_X,0));o.ORIGIN_ZX_PLANE=Object.freeze(newo(t.UNIT_Y,0));varT=o;export{Tasa};
* 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{aasP}from"./chunk-KSZ5EBRB.js";import{aasj,basd}from"./chunk-V3DSE3OK.js";import{aasO}from"./chunk-FMRIJYNG.js";import{aasA,basm,gasu}from"./chunk-YWRPWWKI.js";import{aase,casl,das_}from"./chunk-JMSSU44E.js";import{aasg}from"./chunk-VLPNAR64.js";import{aasy,basp}from"./chunk-GE5NEIZC.js";import{easr}from"./chunk-35CVRQTC.js";varx=newA;functions(n,t){if(p.defined("origin",n),t=g(t,_.default),n=t.scaleToGeodeticSurface(n),!r(n))thrownewy("origin must not be at the center of the ellipsoid.");leto=u.eastNorthUpToFixedFrame(n,t);this._ellipsoid=t,this._origin=n,this._xAxis=e.fromCartesian4(m.getColumn(o,0,x)),this._yAxis=e.fromCartesian4(m.getColumn(o,1,x));leti=e.fromCartesian4(m.getColumn(o,2,x));this._plane=O.fromPointNormal(n,i)}Object.defineProperties(s.prototype,{ellipsoid:{get:function(){returnthis._ellipsoid}},origin:{get:function(){returnthis._origin}},plane:{get:function(){returnthis._plane}},xAxis:{get:function(){returnthis._xAxis}},yAxis:{get:function(){returnthis._yAxis}},zAxis:{get:function(){returnthis._plane.normal}}});varC=newP;s.fromPoints=function(n,t){p.defined("cartesians",n);leto=P.fromPoints(n,C);returnnews(o.center,t)};varw=newj,h=newe;s.prototype.projectPointOntoPlane=function(n,t){p.defined("cartesian",n);leto=w;o.origin=n,e.normalize(n,o.direction);leti=d.rayPlane(o,this._plane,h);if(r(i)||(e.negate(o.direction,o.direction),i=d.rayPlane(o,this._plane,h)),r(i)){letc=e.subtract(i,this._origin,i),a=e.dot(this._xAxis,c),f=e.dot(this._yAxis,c);returnr(t)?(t.x=a,t.y=f,t):newl(a,f)}};s.prototype.projectPointsOntoPlane=function(n,t){p.defined("cartesians",n),r(t)||(t=[]);leto=0,i=n.length;for(letc=0;c<i;c++){leta=this.projectPointOntoPlane(n[c],t[o]);r(a)&&(t[o]=a,o++)}returnt.length=o,t};s.prototype.projectPointToNearestOnPlane=function(n,t){p.defined("cartesian",n),r(t)||(t=newl);leto=w;o.origin=n,e.clone(this._plane.normal,o.direction);leti=d.rayPlane(o,this._plane,h);r(i)||(e.negate(o.direction,o.direction),i=d.rayPlane(o,this._plane,h));letc=e.subtract(i,this._origin,i),a=e.dot(this._xAxis,c),f=e.dot(this._yAxis,c);returnt.x=a,t.y=f,t};s.prototype.projectPointsToNearestOnPlane=function(n,t){p.defined("cartesians",n),r(t)||(t=[]);leto=n.length;t.length=o;for(leti=0;i<o;i++)t[i]=this.projectPointToNearestOnPlane(n[i],t[i]);returnt};varT=newe;s.prototype.projectPointOntoEllipsoid=function(n,t){p.defined("cartesian",n),r(t)||(t=newe);leto=this._ellipsoid,i=this._origin,c=this._xAxis,a=this._yAxis,f=T;returne.multiplyByScalar(c,n.x,f),t=e.add(i,f,t),e.multiplyByScalar(a,n.y,f),e.add(t,f,t),o.scaleToGeocentricSurface(t,t),t};s.prototype.projectPointsOntoEllipsoid=function(n,t){p.defined("cartesians",n);leto=n.length;r(t)?t.length=o:t=newArray(o);for(leti=0;i<o;++i)t[i]=this.projectPointOntoEllipsoid(n[i],t[i]);returnt};varM=s;export{Masa};
${this.stack.toString()}`),t};f.throwInstantiationError=function(){thrownewf("This function defines an interface and should not be called directly.")};varr=f;varn={};n.typeOf={};functionc(t){return`${t} is required, actual value was undefined`}functiona(t,e,o){return`Expected ${o} to be typeof ${e}, actual typeof was ${t}`}n.defined=function(t,e){if(!u(e))thrownewr(c(t))};n.typeOf.func=function(t,e){if(typeofe!="function")thrownewr(a(typeofe,"function",t))};n.typeOf.string=function(t,e){if(typeofe!="string")thrownewr(a(typeofe,"string",t))};n.typeOf.number=function(t,e){if(typeofe!="number")thrownewr(a(typeofe,"number",t))};n.typeOf.number.lessThan=function(t,e,o){if(n.typeOf.number(t,e),e>=o)thrownewr(`Expected ${t} to be less than ${o}, actual value was ${e}`)};n.typeOf.number.lessThanOrEquals=function(t,e,o){if(n.typeOf.number(t,e),e>o)thrownewr(`Expected ${t} to be less than or equal to ${o}, actual value was ${e}`)};n.typeOf.number.greaterThan=function(t,e,o){if(n.typeOf.number(t,e),e<=o)thrownewr(`Expected ${t} to be greater than ${o}, actual value was ${e}`)};n.typeOf.number.greaterThanOrEquals=function(t,e,o){if(n.typeOf.number(t,e),e<o)thrownewr(`Expected ${t} to be greater than or equal to ${o}, actual value was ${e}`)};n.typeOf.object=function(t,e){if(typeofe!="object")thrownewr(a(typeofe,"object",t))};n.typeOf.bool=function(t,e){if(typeofe!="boolean")thrownewr(a(typeofe,"boolean",t))};n.typeOf.bigint=function(t,e){if(typeofe!="bigint")thrownewr(a(typeofe,"bigint",t))};n.typeOf.number.equals=function(t,e,o,i){if(n.typeOf.number(t,o),n.typeOf.number(e,i),o!==i)thrownewr(`${t} must be equal to ${e}, the actual values are ${o} and ${i}`)};varl=n;export{rasa,lasb};
* 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{basl,fasO,gasR,hasG,iasL}from"./chunk-YWRPWWKI.js";import{aasA,bash,casa,easy}from"./chunk-JMSSU44E.js";import{aasc}from"./chunk-ANLJ4KBN.js";import{aass}from"./chunk-VLPNAR64.js";import{aasN,basw}from"./chunk-GE5NEIZC.js";import{easI}from"./chunk-35CVRQTC.js";varU={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3},M=Object.freeze(U);varr={POINTS:c.POINTS,LINES:c.LINES,LINE_LOOP:c.LINE_LOOP,LINE_STRIP:c.LINE_STRIP,TRIANGLES:c.TRIANGLES,TRIANGLE_STRIP:c.TRIANGLE_STRIP,TRIANGLE_FAN:c.TRIANGLE_FAN};r.isLines=function(t){returnt===r.LINES||t===r.LINE_LOOP||t===r.LINE_STRIP};r.isTriangles=function(t){returnt===r.TRIANGLES||t===r.TRIANGLE_STRIP||t===r.TRIANGLE_FAN};r.validate=function(t){returnt===r.POINTS||t===r.LINES||t===r.LINE_LOOP||t===r.LINE_STRIP||t===r.TRIANGLES||t===r.TRIANGLE_STRIP||t===r.TRIANGLE_FAN};varF=Object.freeze(r);function_(t){t=s(t,s.EMPTY_OBJECT),w.typeOf.object("options.attributes",t.attributes),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=s(t.primitiveType,F.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=s(t.geometryType,M.NONE),this.boundingSphereCV=t.boundingSphereCV,this.offsetAttribute=t.offsetAttribute}_.computeNumberOfVertices=function(t){w.typeOf.object("geometry",t);letm=-1;for(letuint.attributes)if(t.attributes.hasOwnProperty(u)&&I(t.attributes[u])&&I(t.attributes[u].values)){leto=t.attributes[u],e=o.values.length/o.componentsPerAttribute;if(m!==e&&m!==-1)thrownewN("All attribute lists must have the same number of attributes.");m=e}returnm};varW=newh,H=newA,V=newl,Z=[newh,newh,newh],K=[newa,newa,newa],$=[newa,newa,newa],tt=newA,et=newO,rt=newl,nt=newL;_._textureCoordinateRotationPoints=function(t,m,u,o){lete,g=G.center(o,W),D=h.toCartesian(g,u,H),Y=R.eastNorthUpToFixedFrame(D,u,V),C=l.inverse(Y,V),b=K,f=Z;f[0].longitude=o.west,f[0].latitude=o.south,f[1].longitude=o.west,f[1].latitude=o.north,f[2].longitude=o.east,f[2].latitude=o.south;letn=tt;for(e=0;e<3;e++)h.toCartesian(f[e],u,n),n=l.multiplyByPointAsVector(C,n,n),b[e].x=n.x,b[e].y=n.y;letB=O.fromAxisAngle(A.UNIT_Z,-m,et),v=y.fromQuaternion(B,rt),j=t.length,T=Number.POSITIVE_INFINITY,p=Number.POSITIVE_INFINITY,d=Number.NEGATIVE_INFINITY,x=Number.NEGATIVE_INFINITY;for(e=0;e<j;e++)n=l.multiplyByPointAsVector(C,t[e],n),n=y.multiplyByVector(v,n,n),T=Math.min(T,n.x),p=Math.min(p,n.y),d=Math.max(d,n.x),x=Math.max(x,n.y);letk=L.fromRotation(m,nt),i=$;i[0].x=T,i[0].y=p,i[1].x=T,i[1].y=x,i[2].x=d,i[2].y=p;letP=b[0],z=b[2].x-P.x,X=b[1].y-P.y;for(e=0;e<3;e++){letE=i[e];L.multiplyByVector(k,E,E),E.x=(E.x-P.x)/z,E.y=(E.y-P.y)/X}letq=i[0],J=i[1],Q=i[2],S=newArray(6);returna.pack(q,S),a.pack(J,S,2),a.pack(Q,S,4),S};varLt=_;functionot(t){if(t=s(t,s.EMPTY_OBJECT),!I(t.componentDatatype))thrownewN("options.componentDatatype is required.");if(!I(t.componentsPerAttribute))thrownewN("options.componentsPerAttribute is required.");if(t.componentsPerAttribute<1||t.componentsPerAttribute>4)thrownewN("options.componentsPerAttribute must be between 1 and 4.");if(!I(t.values))thrownewN("options.values is required.");this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=s(t.normalize,!1),this.values=t.values}varOt=ot;export{Masa,Fasb,Ltasc,Otasd};
* 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{aasW}from"./chunk-ZFTFDHK4.js";import{aasZ}from"./chunk-NNHN6WUY.js";import{aasX}from"./chunk-T7ERZ2CJ.js";import{basK,casQ,dasV}from"./chunk-GSNDLQ4C.js";import{dasH}from"./chunk-BKSIEBAA.js";import{aasU}from"./chunk-VTVHUB7E.js";import{aasr,dasJ}from"./chunk-JMSSU44E.js";import{aasB}from"./chunk-4UYSGV57.js";import{aasu}from"./chunk-VLPNAR64.js";import{aasP}from"./chunk-GE5NEIZC.js";import{easT}from"./chunk-35CVRQTC.js";varii=newr(1,1,1),S=Math.cos,q=Math.sin;functionx(t){t=u(t,u.EMPTY_OBJECT);leto=u(t.radii,ii),n=u(t.innerRadii,o),k=u(t.minimumClock,0),w=u(t.maximumClock,B.TWO_PI),d=u(t.minimumCone,0),l=u(t.maximumCone,B.PI),s=Math.round(u(t.stackPartitions,10)),A=Math.round(u(t.slicePartitions,8)),m=Math.round(u(t.subdivisions,128));if(s<1)thrownewP("options.stackPartitions cannot be less than 1");if(A<0)thrownewP("options.slicePartitions cannot be less than 0");if(m<0)thrownewP("options.subdivisions must be greater than or equal to zero.");if(T(t.offsetAttribute)&&t.offsetAttribute===W.TOP)thrownewP("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._radii=r.clone(o),this._innerRadii=r.clone(n),this._minimumClock=k,this._maximumClock=w,this._minimumCone=d,this._maximumCone=l,this._stackPartitions=s,this._slicePartitions=A,this._subdivisions=m,this._offsetAttribute=t.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}x.packedLength=2*r.packedLength+8;x.pack=function(t,o,n){if(!T(t))thrownewP("value is required");if(!T(o))thrownewP("array is required");returnn=u(n,0),r.pack(t._radii,o,n),n+=r.packedLength,r.pack(t._innerRadii,o,n),n+=r.packedLength,o[n++]=t._minimumClock,o[n++]=t._maximumClock,o[n++]=t._minimumCone,o[n++]=t._maximumCone,o[n++]=t._stackPartitions,o[n++]=t._slicePartitions,o[n++]=t._subdivisions,o[n]=u(t._offsetAttribute,-1),o};var$=newr,G=newr,b={radii:$,innerRadii:G,minimumClock:void0,maximumClock:void0,minimumCone:void0,maximumCone:void0,stackPartitions:void0,slicePartitions:void0,subdivisions:void0,offsetAttribute:void0};x.unpack=function(t,o,n){if(!T(t))thrownewP("array is required");o=u(o,0);letk=r.unpack(t,o,$);o+=r.packedLength;letw=r.unpack(t,o,G);o+=r.packedLength;letd=t[o++],l=t[o++],s=t[o++],A=t[o++],m=t[o++],f=t[o++],E=t[o++],h=t[o];returnT(n)?(n._radii=r.clone(k,n._radii),n._innerRadii=r.clone(w,n._innerRadii),n._minimumClock=d,n._maximumClock=l,n._minimumCone=s,n._maximumCone=A,n._stackPartitions=m,n._slicePartitions=f,n._subdivisions=E,n._offsetAttribute=h===-1?void0:h,n):(b.minimumClock=d,b.maximumClock=l,b.minimumCone=s,b.maximumCone=A,b.stackPartitions=m,b.slicePartitions=f,b.subdivisions=E,b.offsetAttribute=h===-1?void0:h,newx(b))};x.createGeometry=function(t){leto=t._radii;if(o.x<=0||o.y<=0||o.z<=0)return;letn=t._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;letk=t._minimumClock,w=t._maximumClock,d=t._minimumCone,l=t._maximumCone,s=t._subdivisions,A=J.fromCartesian3(o),m=t._slicePartitions+1,f=t._stackPartitions+1;m=Math.round(m*Math.abs(w-k)/B.TWO_PI),f=Math.round(f*Math.abs(l-d)/B.PI),m<2&&(m=2),f<2&&(f=2);letE=0,h=1,L=n.x!==o.x||n.y!==o.y||n.z!==o.z,Y=!1,j=!1;L&&(h=2,d>0&&(Y=!0,E+=m),l<Math.PI&&(j=!0,E+=m));lety=s*h*(f+m),a=newFloat64Array(y*3),g=2*(y+E-(m+f)*h),_=Z.createTypedArray(y,g),i,e,v,z,c=0,C=newArray(f),O=newArray(f);for(i=0;i<f;i++)z=d+i*(l-d)/(f-1),C[i]=q(z),O[i]=S(z);letM=newArray(s),R=newArray(s);for(i=0;i<s;i++)v=k+i*(w-k)/(s-1),M[i]=q(v),R[i]=S(v);for(i=0;i<f;i++)for(e=0;e<s;e++)a[c++]=o.x*C[i]*R[e],a[c++]=o.y*C[i]*M[e],a[c++]=o.z*O[i];if(L)for(i=0;i<f;i++)for(e=0;e<s;e++)a[c++]=n.x*C[i]*R[e],a[c++]=n.y*C[i]*M[e],a[c++]=n.z*O[i];for(C.length=s,O.length=s,i=0;i<s;i++)z=d+i*(l-d)/(s-1),C[i]=q(z),O[i]=S(z);for(M.length=m,R.length=m,i=0;i<m;i++)v=k+i*(w-k)/(m-1),M[i]=q(v),R[i]=S(v);for(i=0;i<s;i++)for(e=0;e<m;e++)a[c++]=o.x*C[i]*R[e],a[c++]=o.y*C[i]*M[e],a[c++]=o.z*O[i];if(L)for(i=0;i<s;i++)for(e=0;e<m;e++)a[c++]=n.x*C[i]*R[e],a[c++]=n.y*C[i]*M[e],a[c++]=n.z*O[i];for(c=0,i=0;i<f*h;i++){letp=i*s;for(e=0;e<s-1;e++)_[c++]=p+e,_[c++]=p+e+1}letD=f*s*h;for(i=0;i<m;i++)for(e=0;e<s-1;e++)_[c++]=D+i+e*m,_[c++]=D+i+(e+1)*m;if(L)for(D=f*s*h+m*s,i=0;i<m;i++)for(e=0;e<s-1;e++)_[c++]=D+i+e*m,_[c++]=D+i+(e+1)*m;if(L){letp=f*s*h,N=p+s*m;if(Y)for(i=0;i<m;i++)_[c++]=p+i,_[c++]=N+i;if(j)for(p+=s*m-m,N+=s*m-m,i=0;i<m;i++)_[c++]=p+i,_[c++]=N+i}letF=newX({position:newV({componentDatatype:U.DOUBLE,componentsPerAttribute:3,values:a})});if(T(t._offsetAttribute)){letp=a.length,N=t._offsetAttribute===W.NONE?0:1,I=newUint8Array(p/3).fill(N);F.applyOffset=newV({componentDatatype:U.UNSIGNED_BYTE,componentsPerAttribute:1,values:I})}returnnewQ({attributes:F,indices:_,primitiveType:K.LINES,boundingSphere:H.fromEllipsoid(A),offsetAttribute:t._offsetAttribute})};varCi=x;export{Ciasa};
* 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{aasz}from"./chunk-BKSIEBAA.js";import{hasI,iasb}from"./chunk-YWRPWWKI.js";import{aasW,basO,dasL}from"./chunk-JMSSU44E.js";import{aasm}from"./chunk-4UYSGV57.js";import{aasv}from"./chunk-GE5NEIZC.js";import{eask}from"./chunk-35CVRQTC.js";varZ=Math.cos,B=Math.sin,p=Math.sqrt,N={};N.computePosition=function(t,M,g,u,G,h,a){lete=M.radiiSquared,i=t.nwCorner,r=t.boundingRectangle,n=i.latitude-t.granYCos*u+G*t.granXSin,d=Z(n),X=B(n),Y=e.z*X,s=i.longitude+u*t.granYSin+G*t.granXCos,S=d*Z(s),f=d*B(s),w=e.x*S,R=e.y*f,_=p(w*S+R*f+Y*X);if(h.x=w/_,h.y=R/_,h.z=Y/_,g){leto=t.stNwCorner;k(o)?(n=o.latitude-t.stGranYCos*u+G*t.stGranXSin,s=o.longitude+u*t.stGranYSin+G*t.stGranXCos,a.x=(s-t.stWest)*t.lonScalar,a.y=(n-t.stSouth)*t.latScalar):(a.x=(s-r.west)*t.lonScalar,a.y=(n-r.south)*t.latScalar)}};varA=newb,l=newW,F=newO,j=newW,y=newz;functionD(t,M,g,u,G,h,a){lete=Math.cos(M),i=u*e,r=g*e,n=Math.sin(M),d=u*n,X=g*n;y._ellipsoid=L.default,l=y.project(t,l),l=W.subtract(l,j,l);letY=b.fromRotation(M,A);l=b.multiplyByVector(Y,l,l),l=W.add(l,j,l),t=y.unproject(l,t),h-=1,a-=1;lets=t.latitude,S=s+h*X,f=s-i*a,w=s-i*a+h*X,R=Math.max(s,S,f,w),_=Math.min(s,S,f,w),o=t.longitude,E=o+h*r,T=o+a*d,V=o+a*d+h*r,q=Math.max(o,E,T,V),x=Math.min(o,E,T,V);return{north:R,south:_,east:q,west:x,granYCos:i,granYSin:d,granXCos:r,granXSin:X,nwCorner:t}}N.computeOptions=function(t,M,g,u,G,h,a){lete=t.east,i=t.west,r=t.north,n=t.south,d=!1,X=!1;r===m.PI_OVER_TWO&&(d=!0),n===-m.PI_OVER_TWO&&(X=!0);letY,s=r-n;i>e?Y=m.TWO_PI-i+e:Y=e-i;letS=Math.ceil(Y/M)+1,f=Math.ceil(s/M)+1,w=Y/(S-1),R=s/(f-1),_=I.northwest(t,h),o=I.center(t,F);(g!==0||u!==0)&&(o.longitude<_.longitude&&(o.longitude+=m.TWO_PI),y._ellipsoid=L.default,j=y.project(o,j));letE=R,T=w,V=0,q=0,x=I.clone(t,G),c={granYCos:E,granYSin:V,granXCos:T,granXSin:q,nwCorner:_,boundingRectangle:x,width:S,height:f,northCap:d,southCap:X};if(g!==0){letC=D(_,g,w,R,o,S,f);if(r=C.north,n=C.south,e=C.east,i=C.west,r<-m.PI_OVER_TWO||r>m.PI_OVER_TWO||n<-m.PI_OVER_TWO||n>m.PI_OVER_TWO)thrownewv("Rotated rectangle is invalid. It crosses over either the north or south pole.");c.granYCos=C.granYCos,c.granYSin=C.granYSin,c.granXCos=C.granXCos,c.granXSin=C.granXSin,x.north=r,x.south=n,x.east=e,x.west=i}if(u!==0){g=g-u;letC=I.northwest(x,a),P=D(C,g,w,R,o,S,f);c.stGranYCos=P.granYCos,c.stGranXCos=P.granXCos,c.stGranYSin=P.granYSin,c.stGranXSin=P.granXSin,c.stNwCorner=C,c.stWest=P.west,c.stSouth=P.south}returnc};varst=N;export{stasa};
* 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{aasE}from"./chunk-74GQJJ7R.js";import{aasQ}from"./chunk-FMRIJYNG.js";import{aasae}from"./chunk-T7ERZ2CJ.js";import{basoe,casre,dasJ}from"./chunk-GSNDLQ4C.js";import{basA,dasie}from"./chunk-BKSIEBAA.js";import{aasb,basF,fasN}from"./chunk-YWRPWWKI.js";import{aasH}from"./chunk-VTVHUB7E.js";import{aasr,easG}from"./chunk-JMSSU44E.js";import{aasP}from"./chunk-4UYSGV57.js";import{aasm}from"./chunk-VLPNAR64.js";import{aasw,basO}from"./chunk-GE5NEIZC.js";import{easa}from"./chunk-35CVRQTC.js";functionT(e){this.planes=m(e,[])}varX=[newr,newr,newr];r.clone(r.UNIT_X,X[0]);r.clone(r.UNIT_Y,X[1]);r.clone(r.UNIT_Z,X[2]);varV=newr,_e=newr,fe=newQ(newr(1,0,0),0);T.fromBoundingSphere=function(e,t){if(!a(e))throwneww("boundingSphere is required.");a(t)||(t=newT);letn=X.length,f=t.planes;f.length=2*n;letp=e.center,d=e.radius,s=0;for(lety=0;y<n;++y){leti=X[y],c=f[s],_=f[s+1];a(c)||(c=f[s]=newb),a(_)||(_=f[s+1]=newb),r.multiplyByScalar(i,-d,V),r.add(p,V,V),c.x=i.x,c.y=i.y,c.z=i.z,c.w=-r.dot(i,V),r.multiplyByScalar(i,d,V),r.add(p,V,V),_.x=-i.x,_.y=-i.y,_.z=-i.z,_.w=-r.dot(r.negate(i,_e),V),s+=2}returnt};T.prototype.computeVisibility=function(e){if(!a(e))throwneww("boundingVolume is required.");lett=this.planes,n=!1;for(letf=0,p=t.length;f<p;++f){letd=e.intersectPlane(Q.fromCartesian4(t[f],fe));if(d===A.OUTSIDE)returnA.OUTSIDE;d===A.INTERSECTING&&(n=!0)}returnn?A.INTERSECTING:A.INSIDE};T.prototype.computeVisibilityWithPlaneMask=function(e,t){if(!a(e))throwneww("boundingVolume is required.");if(!a(t))throwneww("parentPlaneMask is required.");if(t===T.MASK_OUTSIDE||t===T.MASK_INSIDE)returnt;letn=T.MASK_INSIDE,f=this.planes;for(letp=0,d=f.length;p<d;++p){lets=p<31?1<<p:0;if(p<31&&(t&s)===0)continue;lety=e.intersectPlane(Q.fromCartesian4(f[p],fe));if(y===A.OUTSIDE)returnT.MASK_OUTSIDE;y===A.INTERSECTING&&(n|=s)}returnn};T.MASK_OUTSIDE=4294967295;T.MASK_INSIDE=0;T.MASK_INDETERMINATE=2147483647;var$=T;functionk(e){e=m(e,m.EMPTY_OBJECT),this.left=e.left,this._left=void0,this.right=e.right,this._right=void0,this.top=e.top,this._top=void0,this.bottom=e.bottom,this._bottom=void0,this.near=m(e.near,1),this._near=this.near,this.far=m(e.far,5e8),this._far=this.far,this._cullingVolume=new$,this._orthographicMatrix=newF}functionce(e){if(!a(e.right)||!a(e.left)||!a(e.top)||!a(e.bottom)||!a(e.near)||!a(e.far))throwneww("right, left, top, bottom, near, or far parameters are not set.");if(e.top!==e._top||e.bottom!==e._bottom||e.left!==e._left||e.right!==e._right||e.near!==e._near||e.far!==e._far){if(e.left>e.right)throwneww("right must be greater than left.");if(e.bottom>e.top)throwneww("top must be greater than bottom.");if(e.near<=0||e.near>e.far)throwneww("near must be greater than zero and less than 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=F.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix)}}Object.defineProperties(k.prototype,{projectionMatrix:{get:function(){returnce(this),this._orthographicMatrix}}});varme=newr,ye=newr,ge=newr,ee=newr;k.prototype.computeCullingVolume=function(e,t,n){if(!a(e))throwneww("position is required.");if(!a(t))throwneww("direction is required.");if(!a(n))throwneww("up is required.");letf=this._cullingVolume.planes,p=this.top,d=this.bottom,s=this.right,y=this.left,i=this.near,c=this.far,_=r.cross(t,n,me);r.normalize(_,_);letg=ye;r.multiplyByScalar(t,i,g),r.add(e,g,g);letl=ge;r.multiplyByScalar(_,y,l),r.add(g,l,l);leto=f[0];returna(o)||(o=f[0]=newb),o.x=_.x,o.y=_.y,o.z=_.z,o.w=-r.dot(_,l),r.multiplyByScalar(_,s,l),r.add(g,l,l),o=f[1],a(o)||(o=f[1]=newb),o.x=-_.x,o.y=-_.y,o.z=-_.z,o.w=-r.dot(r.negate(_,ee),l),r.multiplyByScalar(n,d,l),r.add(g,l,l),o=f[2],a(o)||(o=f[2]=newb),o.x=n.x,o.y=n.y,o.z=n.z,o.w=-r.dot(n,l),r.multiplyByScalar(n,p,l),r.add(g,l,l),o=f[3],a(o)||(o=f[3]=newb),o.x=-n.x,o.y=-n.y,o.z=-n.z,o.w=-r.dot(r.negate(n,ee),l),o=f[4],a(o)||(o=f[4]=newb),o.x=t.x,o.y=t.y,o.z=t.z,o.w=-r.dot(t,g),r.multiplyByScalar(t,c,l),r.add(e,l,l),o=f[5],a(o)||(o=f[5]=newb),o.x=-t.x,o.y=-t.y,o.z=-t.z,o.w=-r.dot(r.negate(t,ee),l),this._cullingVolume};k.prototype.getPixelDimensions=function(e,t,n,f,p){if(ce(this),!a(e)||!a(t))throwneww("Both drawingBufferWidth and drawingBufferHeight are required.");if(e<=0)throwneww("drawingBufferWidth must be greater than zero.");if(t<=0)throwneww("drawingBufferHeight must be greater than zero.");if(!a(n))throwneww("distance is required.");if(!a(f))throwneww("pixelRatio is required.");if(f<=0)throwneww("pixelRatio must be greater than zero.");if(!a(p))throwneww("A result object is required.");letd=this.right-this.left,s=this.top-this.bottom,y=f*d/e,i=f*s/t;returnp.x=y,p.y=i,p};k.prototype.clone=function(e){returna(e)||(e=newk),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=void0,e._right=void0,e._top=void0,e._bottom=void0,e._near=void0,e._far=void0,e};k.prototype.equals=function(e){returna(e)&&einstanceofk&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};k.prototype.equalsEpsilon=function(e,t,n){returne===this||a(e)&&einstanceofk&&P.equalsEpsilon(this.right,e.right,t,n)&&P.equalsEpsilon(this.left,e.left,t,n)&&P.equalsEpsilon(this.top,e.top,t,n)&&P.equalsEpsilon(this.bottom,e.bottom,t,n)&&P.equalsEpsilon(this.near,e.near,t,n)&&P.equalsEpsilon(this.far,e.far,t,n)};varhe=k;functionz(e){e=m(e,m.EMPTY_OBJECT),this._offCenterFrustum=newhe,this.width=e.width,this._width=void0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void0,this.near=m(e.near,1),this._near=this.near,this.far=m(e.far,5e8),this._far=this.far}z.packedLength=4;z.pack=function(e,t,n){returnO.typeOf.object("value",e),O.defined("array",t),n=m(n,0),t[n++]=e.width,t[n++]=e.aspectRatio,t[n++]=e.near,t[n]=e.far,t};z.unpack=function(e,t,n){returnO.defined("array",e),t=m(t,0),a(n)||(n=newz),n.width=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t],n};functionj(e){if(!a(e.width)||!a(e.aspectRatio)||!a(e.near)||!a(e.far))throwneww("width, aspectRatio, near, or far parameters are not set.");lett=e._offCenterFrustum;if(e.width!==e._width||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far){if(e.aspectRatio<0)throwneww("aspectRatio must be positive.");if(e.near<0||e.near>e.far)throwneww("near must be greater than zero and less than far.");e._aspectRatio=e.aspectRatio,e._width=e.width,e._near=e.near,e._far=e.far;letn=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(z.prototype,{projectionMatrix:{get:function(){returnj(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){returnj(this),this._offCenterFrustum}}});z.prototype.computeCullingVolume=function(e,t,n){returnj(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};z.prototype.getPixelDimensions=function(e,t,n,f,p){returnj(this),this._offCenterFrustum.getPixelDimensions(e,t,n,f,p)};z.prototype.clone=function(e){returna(e)||(e=newz),e.aspectRatio=this.aspectRatio,e.width=this.width,e.near=this.near,e.far=this.far,e._aspectRatio=void0,e._width=void0,e._near=void0,e._far=void0,this._offCenterFrustum.clone(e._offCenterFrustum),e};z.prototype.equals=function(e){return!a(e)||!(einstanceofz)?!1:(j(this),j(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};z.prototype.equalsEpsilon=function(e,t,n){return!a(e)||!(einstanceofz)?!1:(j(this),j(e),P.equalsEpsilon(this.width,e.width,t,n)&&P.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};varB=z;functionS(e){e=m(e,m.EMPTY_OBJECT),this.left=e.left,this._left=void0,this.right=e.right,this._right=void0,this.top=e.top,this._top=void0,this.bottom=e.bottom,this._bottom=void0,this.near=m(e.near,1),this._near=this.near,this.far=m(e.far,5e8),this._far=this.far,this._cullingVolume=new$,this._perspectiveMatrix=newF,this._infinitePerspective=newF}functionte(e){if(!a(e.right)||!a(e.left)||!a(e.top)||!a(e.bottom)||!a(e.near)||!a(e.far))throwneww("right, left, top, bottom, near, or far parameters are not set.");let{top:t,bottom:n,right:f,left:p,near:d,far:s}=e;if(t!==e._top||n!==e._bottom||p!==e._left||f!==e._right||d!==e._near||s!==e._far){if(e.near<=0||e.near>e.far)throwneww("near must be greater than zero and less than far.");e._left=p,e._right=f,e._top=t,e._bottom=n,e._near=d,e._far=s,e._perspectiveMatrix=F.computePerspectiveOffCenter(p,f,n,t,d,s,e._perspectiveMatrix),e._infinitePerspective=F.computeInfinitePerspectiveOffCenter(p,f,n,t,d,e._infinitePerspective)}}Object.defineProperties(S.prototype,{projectionMatrix:{get:function(){returnte(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){returnte(this),this._infinitePerspective}}});varCe=newr,be=newr,Oe=newr,Pe=newr;S.prototype.computeCullingVolume=function(e,t,n){if(!a(e))throwneww("position is required.");if(!a(t))throwneww("direction is required.");if(!a(n))throwneww("up is required.");letf=this._cullingVolume.planes,p=this.top,d=this.bottom,s=this.right,y=this.left,i=this.near,c=this.far,_=r.cross(t,n,Ce),g=be;r.multiplyByScalar(t,i,g),r.add(e,g,g);letl=Oe;r.multiplyByScalar(t,c,l),r.add(e,l,l);leto=Pe;r.multiplyByScalar(_,y,o),r.add(g,o,o),r.subtract(o,e,o),r.normalize(o,o),r.cross(o,n,o),r.normalize(o,o);leth=f[0];returna(h)||(h=f[0]=newb),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),r.multiplyByScalar(_,s,o),r.add(g,o,o),r.subtract(o,e,o),r.cross(n,o,o),r.normalize(o,o),h=f[1],a(h)||(h=f[1]=newb),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),r.multiplyByScalar(n,d,o),r.add(g,o,o),r.subtract(o,e,o),r.cross(_,o,o),r.normalize(o,o),h=f[2],a(h)||(h=f[2]=newb),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),r.multiplyByScalar(n,p,o),r.add(g,o,o),r.subtract(o,e,o),r.cross(o,_,o),r.normalize(o,o),h=f[3],a(h)||(h=f[3]=newb),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),h=f[4],a(h)||(h=f[4]=newb),h.x=t.x,h.y=t.y,h.z=t.z,h.w=-r.dot(t,g),r.negate(t,o),h=f[5],a(h)||(h=f[5]=newb),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,l),this._cullingVolume};S.prototype.getPixelDimensions=function(e,t,n,f,p){if(te(this),!a(e)||!a(t))throwneww("Both drawingBufferWidth and drawingBufferHeight are required.");if(e<=0)throwneww("drawingBufferWidth must be greater than zero.");if(t<=0)throwneww("drawingBufferHeight must be greater than zero.");if(!a(n))throwneww("distance is required.");if(!a(f))throwneww("pixelRatio is required");if(f<=0)throwneww("pixelRatio must be greater than zero.");if(!a(p))throwneww("A result object is required.");letd=1/this.near,s=this.top*d,y=2*f*n*s/t;s=this.right*d;leti=2*f*n*s/e;returnp.x=i,p.y=y,p};S.prototype.clone=function(e){returna(e)||(e=newS),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=void0,e._right=void0,e._top=void0,e._bottom=void0,e._near=void0,e._far=void0,e};S.prototype.equals=function(e){returna(e)&&einstanceofS&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};S.prototype.equalsEpsilon=function(e,t,n){returne===this||a(e)&&einstanceofS&&P.equalsEpsilon(this.right,e.right,t,n)&&P.equalsEpsilon(this.left,e.left,t,n)&&P.equalsEpsilon(this.top,e.top,t,n)&&P.equalsEpsilon(this.bottom,e.bottom,t,n)&&P.equalsEpsilon(this.near,e.near,t,n)&&P.equalsEpsilon(this.far,e.far,t,n)};varpe=S;functionR(e){e=m(e,m.EMPTY_OBJECT),this._offCenterFrustum=newpe,this.fov=e.fov,this._fov=void0,this._fovy=void0,this._sseDenominator=void0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void0,this.near=m(e.near,1),this._near=this.near,this.far=m(e.far,5e8),this._far=this.far,this.xOffset=m(e.xOffset,0),this._xOffset=this.xOffset,this.yOffset=m(e.yOffset,0),this._yOffset=this.yOffset}R.packedLength=6;R.pack=function(e,t,n){returnO.typeOf.object("value",e),O.defined("array",t),n=m(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};R.unpack=function(e,t,n){returnO.defined("array",e),t=m(t,0),a(n)||(n=newR),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};functionq(e){if(!a(e.fov)||!a(e.aspectRatio)||!a(e.near)||!a(e.far))throwneww("fov, aspectRatio, near, or far parameters are not set.");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;if(O.typeOf.number.greaterThanOrEquals("fov",e.fov,0),O.typeOf.number.lessThan("fov",e.fov,Math.PI),O.typeOf.number.greaterThanOrEquals("aspectRatio",e.aspectRatio,0),O.typeOf.number.greaterThanOrEquals("near",e.near,0),e.near>e.far)throwneww("near must be less than far.");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;letn=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(R.prototype,{projectionMatrix:{get:function(){returnq(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){returnq(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){returnq(this),this._fovy}},sseDenominator:{get:function(){returnq(this),this._sseDenominator}},offCenterFrustum:{get:function(){returnq(this),this._offCenterFrustum}}});R.prototype.computeCullingVolume=function(e,t,n){returnq(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};R.prototype.getPixelDimensions=function(e,t,n,f,p){returnq(this),this._offCenterFrustum.getPixelDimensions(e,t,n,f,p)};R.prototype.clone=function(e){returna(e)||(e=newR),e.aspectRatio=this.aspectRatio,e.fov=this.fov,e.near=this.near,e.far=this.far,e._aspectRatio=void0,e._fov=void0,e._near=void0,e._far=void0,this._offCenterFrustum.clone(e._offCenterFrustum),e};R.prototype.equals=function(e){return!a(e)||!(einstanceofR)?!1:(q(this),q(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};R.prototype.equalsEpsilon=function(e,t,n){return!a(e)||!(einstanceofR)?!1:(q(this),q(e),P.equalsEpsilon(this.fov,e.fov,t,n)&&P.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};varL=R;varI=0,Fe=1;functionU(e){O.typeOf.object("options",e),O.typeOf.object("options.frustum",e.frustum),O.typeOf.object("options.origin",e.origin),O.typeOf.object("options.orientation",e.orientation);lett=e.frustum,n=e.orientation,f=e.origin,p=m(e.vertexFormat,E.DEFAULT),d=m(e._drawNearPlane,!0),s,y;tinstanceofL?(s=I,y=L.packedLength):tinstanceofB&&(s=Fe,y=B.packedLength),this._frustumType=s,this._frustum=t.clone(),this._origin=r.clone(f),this._orientation=N.clone(n),this._drawNearPlane=d,this._vertexFormat=p,this._workerName="createFrustumGeometry",this.packedLength=2+y+r.packedLength+N.packedLength+E.packedLength}U.pack=function(e,t,n){O.typeOf.object("value",e),O.defined("array",t),n=m(n,0);letf=e._frustumType,p=e._frustum;returnt[n++]=f,f===I?(L.pack(p,t,n),n+=L.packedLength):(B.pack(p,t,n),n+=B.packedLength),r.pack(e._origin,t,n),n+=r.packedLength,N.pack(e._orientation,t,n),n+=N.packedLength,E.pack(e._vertexFormat,t,n),n+=E.packedLength,t[n]=e._drawNearPlane?1:0,t};varxe=newL,ve=newB,ze=newN,Re=newr,Te=newE;U.unpack=function(e,t,n){O.defined("array",e),t=m(t,0);letf=e[t++],p;f===I?(p=L.unpack(e,t,xe),t+=L.packedLength):(p=B.unpack(e,t,ve),t+=B.packedLength);letd=r.unpack(e,t,Re);t+=r.packedLength;lets=N.unpack(e,t,ze);t+=N.packedLength;lety=E.unpack(e,t,Te);t+=E.packedLength;leti=e[t]===1;if(!a(n))returnnewU({frustum:p,origin:d,orientation:s,vertexFormat:y,_drawNearPlane:i});letc=f===n._frustumType?n._frustum:void0;returnn._frustum=p.clone(c),n._frustumType=f,n._origin=r.clone(d,n._origin),n._orientation=N.clone(s,n._orientation),n._vertexFormat=E.clone(y,n._vertexFormat),n._drawNearPlane=i,n};functionW(e,t,n,f,p,d,s,y){leti=e/3*2;for(letc=0;c<4;++c)a(t)&&(t[e]=d.x,t[e+1]=d.y,t[e+2]=d.z),a(n)&&(n[e]=s.x,n[e+1]=s.y,n[e+2]=s.z),a(f)&&(f[e]=y.x,f[e+1]=y.y,f[e+2]=y.z),e+=3;p[i]=0,p[i+1]=0,p[i+2]=1,p[i+3]=0,p[i+4]=1,p[i+5]=1,p[i+6]=0,p[i+7]=1}varqe=newG,Me=newF,ne=newF,se=newr,le=newr,we=newr,ke=newr,Se=newr,De=newr,u=newArray(3),Z=newArray(4);Z[0]=newb(-1,-1,1,1);Z[1]=newb(1,-1,1,1);Z[2]=newb(1,1,1,1);Z[3]=newb(-1,1,1,1);varde=newArray(4);for(lete=0;e<4;++e)de[e]=newb;U._computeNearFarPlanes=function(e,t,n,f,p,d,s,y){leti=G.fromQuaternion(t,qe),c=m(d,se),_=m(s,le),g=m(y,we);c=G.getColumn(i,0,c),_=G.getColumn(i,1,_),g=G.getColumn(i,2,g),r.normalize(c,c),r.normalize(_,_),r.normalize(g,g),r.negate(c,c);letl=F.computeView(e,g,_,c,Me),o,h,M=f.projectionMatrix;if(n===I){letx=F.multiply(M,l,ne);h=F.inverse(x,ne)}elseo=F.inverseTransformation(l,ne);a(h)?(u[0]=f.near,u[1]=f.far):(u[0]=0,u[1]=f.near,u[2]=f.far);for(letx=0;x<2;++x)for(letv=0;v<4;++v){letC=b.clone(Z[v],de[v]);if(a(h)){C=F.multiplyByVector(h,C,C);letD=1/C.w;r.multiplyByScalar(C,D,C),r.subtract(C,e,C),r.normalize(C,C);letY=r.dot(g,C);r.multiplyByScalar(C,u[x]/Y,C),r.add(C,e,C)}else{letD=f.offCenterFrustum;a(D)&&(f=D);letY=u[x],K=u[x+1];C.x=(C.x*(f.right-f.left)+f.left+f.right)*.5,C.y=(C.y*(f.top-f.bottom)+f.bottom+f.top)*.5,C.z=(C.z*(Y-K)-Y-K)*.5,C.w=1,F.multiplyByVector(o,C,C)}p[12*x+v*3]=C.x,p[12*x+v*3+1]=C.y,p[12*x+v*3+2]=C.z}};U.createGeometry=function(e){lett=e._frustumType,n=e._frustum,f=e._origin,p=e._orientation,d=e._drawNearPlane,s=e._vertexFormat,y=d?6:5,i=newFloat64Array(3*4*6);U._computeNearFarPlanes(f,p,t,n,i);letc=3*4*2;i[c]=i[3*4],i[c+1]=i[3*4+1],i[c+2]=i[3*4+2],i[c+3]=i[0],i[c+4]=i[1],i[c+5]=i[2],i[c+6]=i[3*3],i[c+7]=i[3*3+1],i[c+8]=i[3*3+2],i[c+9]=i[3*7],i[c+10]=i[3*7+1],i[c+11]=i[3*7+2],c+=3*4,i[c]=i[3*5],i[c+1]=i[3*5+1],i[c+2]=i[3*5+2],i[c+3]=i[3],i[c+4]=i[4],i[c+5]=i[5],i[c+6]=i[0],i[c+7]=i[1],i[c+8]=i[2],i[c+9]=i[3*4],i[c+10]=i[3*4+1],i[c+11]=i[3*4+2],c+=3*4,i[c]=i[3],i[c+1]=i[4],i[c+2]=i[5],i[c+3]=i[3*5],i[c+4]=i[3*5+1],i[c+5]=i[3*5+2],i[c+6]=i[3*6],i[c+7]=i[3*6+1],i[c+8]=i[3*6+2],i[c+9]=i[3*2],i[c+10]=i[3*2+1],i[c+11]=i[3*2+2],c+=3*4,i[c]=i[3*2],i[c+1]=i[3*2+1],i[c+2]=i[3*2+2],i[c+3]=i[3*6],i[c+4]=i[3*6+1],i[c+5]=i[3*6+2],i[c+6]=i[3*7],i[c+7]=i[3*7+1],i[c+8]=i[3*7+2],i[c+9]=i[3*3],i[c+10]=i[3*3+1],i[c+11]=i[3*3+2],d||(i=i.subarray(3*4));let_=newae({position:newJ({componentDatatype:H.DOUBLE,componentsPerAttribute:3,values:i})});if(a(s.normal)||a(s.tangent)||a(s.bitangent)||a(s.st)){letl=a(s.normal)?newFloat32Array(12*y):void0,o=a(s.tangent)?newFloat32Array(3*4*y):void0,h=a(s.bitangent)?newFloat32Array(3*4*y):void0,M=a(s.st)?newFloat32Array(2*4*y):void0,x=se,v=le,C=we,D=r.negate(x,ke),Y=r.negate(v,Se),K=r.negate(C,De);c=0,d&&(W(c,l,o,h,M,K,x,v),c+=3*4),W(c,l,o,h,M,C,D,v),c+=3*4,W(c,l,o,h,M,D,K,v),c+=3*4,W(c,l,o,h,M,Y,K,D),c+=3*4,W(c,l,o,h,M,x,C,v),c+=3*4,W(c,l,o,h,M,v,C,D),a(l)&&(_.normal=newJ({componentDatatype:H.FLOAT,componentsPerAttribute:3,values:l})),a(o)&&(_.tangent=newJ({componentDatatype:H.FLOAT,componentsPerAttribute:3,values:o})),a(h)&&(_.bitangent=newJ({componentDatatype:H.FLOAT,componentsPerAttribute:3,values:h})),a(M)&&(_.st=newJ({componentDatatype:H.FLOAT,componentsPerAttribute:2,values:M}))}letg=newUint16Array(6*y);for(letl=0;l<y;++l){leto=l*6,h=l*4;g[o]=h,g[o+1]=h+1,g[o+2]=h+2,g[o+3]=h,g[o+4]=h+2,g[o+5]=h+3}returnnewre({attributes:_,indices:g,primitiveType:oe.TRIANGLES,boundingSphere:ie.fromVertices(i)})};varVt=U;export{Basa,Lasb,Vtasc};
* 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{aas$}from"./chunk-R3AL5FUL.js";import{aasb}from"./chunk-AOALMXNW.js";import{aasU}from"./chunk-NNHN6WUY.js";import{aasE}from"./chunk-T7ERZ2CJ.js";import{casz,dasL}from"./chunk-GSNDLQ4C.js";import{aasD,dasy}from"./chunk-BKSIEBAA.js";import{basG}from"./chunk-YWRPWWKI.js";import{aask}from"./chunk-VTVHUB7E.js";import{dasB}from"./chunk-JMSSU44E.js";import{aasv}from"./chunk-VLPNAR64.js";import{aasF,basI}from"./chunk-GE5NEIZC.js";import{easa}from"./chunk-35CVRQTC.js";functionw(e,n,t){e=v(e,0),n=v(n,0),t=v(t,0),this.value=newFloat32Array([e,n,t])}Object.defineProperties(w.prototype,{componentDatatype:{get:function(){returnk.FLOAT}},componentsPerAttribute:{get:function(){return3}},normalize:{get:function(){return!1}}});w.fromCartesian3=function(e){returnI.defined("offset",e),neww(e.x,e.y,e.z)};w.toValue=function(e,n){returnI.defined("offset",e),a(n)||(n=newFloat32Array([e.x,e.y,e.z])),n[0]=e.x,n[1]=e.y,n[2]=e.z,n};varj=w;functionK(e,n,t){leti=!t,r=e.length,c;if(!i&&r>1){leto=e[0].modelMatrix;for(c=1;c<r;++c)if(!G.equals(o,e[c].modelMatrix)){i=!0;break}}if(i)for(c=0;c<r;++c)a(e[c].geometry)&&b.transformToWorldCoordinates(e[c]);elseG.multiplyTransformation(n,e[0].modelMatrix,n)}functionP(e,n){lett=e.attributes,i=t.position,r=i.values.length/i.componentsPerAttribute;t.batchId=newL({componentDatatype:k.FLOAT,componentsPerAttribute:1,values:newFloat32Array(r)});letc=t.batchId.values;for(leto=0;o<r;++o)c[o]=n}functionN(e){letn=e.length;for(lett=0;t<n;++t){leti=e[t];a(i.geometry)?P(i.geometry,t):a(i.westHemisphereGeometry)&&a(i.eastHemisphereGeometry)&&(P(i.westHemisphereGeometry,t),P(i.eastHemisphereGeometry,t))}}functionQ(e){letn=e.instances,t=e.projection,i=e.elementIndexUintSupported,r=e.scene3DOnly,c=e.vertexCacheOptimize,o=e.compressVertices,g=e.modelMatrix,s,u,m,p=n.length;for(s=0;s<p;++s)if(a(n[s].geometry)){m=n[s].geometry.primitiveType;break}for(s=1;s<p;++s)if(a(n[s].geometry)&&n[s].geometry.primitiveType!==m)thrownewF("All instance geometries must have the same primitiveType.");if(K(n,g,r),!r)for(s=0;s<p;++s)a(n[s].geometry)&&b.splitLongitude(n[s]);if(N(n),c)for(s=0;s<p;++s){letf=n[s];a(f.geometry)?(b.reorderForPostVertexCache(f.geometry),b.reorderForPreVertexCache(f.geometry)):a(f.westHemisphereGeometry)&&a(f.eastHemisphereGeometry)&&(b.reorderForPostVertexCache(f.westHemisphereGeometry),b.reorderForPreVertexCache(f.westHemisphereGeometry),b.reorderForPostVertexCache(f.eastHemisphereGeometry),b.reorderForPreVertexCache(f.eastHemisphereGeometry))}letl=b.combineInstances(n);for(p=l.length,s=0;s<p;++s){u=l[s];letf=u.attributes;if(r)for(letdinf)f.hasOwnProperty(d)&&f[d].componentDatatype===k.DOUBLE&&b.encodeAttribute(u,d,`${d}3DHigh`,`${d}3DLow`);elsefor(letdinf)if(f.hasOwnProperty(d)&&f[d].componentDatatype===k.DOUBLE){leth=`${d}3D`,x=`${d}2D`;b.projectTo2D(u,d,h,x,t),a(u.boundingSphere)&&d==="position"&&(u.boundingSphereCV=y.fromVertices(u.attributes.position2D.values)),b.encodeAttribute(u,h,`${h}High`,`${h}Low`),b.encodeAttribute(u,x,`${x}High`,`${x}Low`)}o&&b.compressVertices(u)}if(!i){letf=[];for(p=l.length,s=0;s<p;++s)u=l[s],f=f.concat(b.fitToUnsignedShortIndices(u));l=f}returnl}functionT(e,n,t,i){letr,c,o,g=i.length-1;if(g>=0){letu=i[g];r=u.offset+u.count,o=u.index,c=t[o].indices.length}elser=0,o=0,c=t[o].indices.length;lets=e.length;for(letu=0;u<s;++u){letp=e[u][n];if(!a(p))continue;letl=p.indices.length;r+l>c&&(r=0,c=t[++o].indices.length),i.push({index:o,offset:r,count:l}),r+=l}}functionX(e,n){lett=[];returnT(e,"geometry",n,t),T(e,"westHemisphereGeometry",n,t),T(e,"eastHemisphereGeometry",n,t),t}varS={};S.combineGeometry=function(e){letn,t,i=e.instances,r=i.length,c,o,g=!1;r>0&&(n=Q(e),n.length>0&&(t=b.createAttributeLocations(n[0]),e.createPickOffsets&&(c=X(i,n))),a(i[0].attributes)&&a(i[0].attributes.offset)&&(o=newArray(r),g=!0));lets=newArray(r),u=newArray(r);for(letm=0;m<r;++m){letp=i[m],l=p.geometry;a(l)&&(s[m]=l.boundingSphere,u[m]=l.boundingSphereCV,g&&(o[m]=p.geometry.offsetAttribute));letf=p.eastHemisphereGeometry,d=p.westHemisphereGeometry;a(f)&&a(d)&&(a(f.boundingSphere)&&a(d.boundingSphere)&&(s[m]=y.union(f.boundingSphere,d.boundingSphere)),a(f.boundingSphereCV)&&a(d.boundingSphereCV)&&(u[m]=y.union(f.boundingSphereCV,d.boundingSphereCV)))}return{geometries:n,modelMatrix:e.modelMatrix,attributeLocations:t,pickOffsets:c,offsetInstanceExtend:o,boundingSpheres:s,boundingSpheresCV:u}};functionY(e,n){lett=e.attributes;for(letiint)if(t.hasOwnProperty(i)){letr=t[i];a(r)&&a(r.values)&&n.push(r.values.buffer)}a(e.indices)&&n.push(e.indices.buffer)}functionZ(e,n){lett=e.length;for(leti=0;i<t;++i)Y(e[i],n)}function_(e){letn=1,t=e.length;for(leti=0;i<t;i++){letr=e[i];if(++n,!a(r))continue;letc=r.attributes;n+=7+2*y.packedLength+(a(r.indices)?r.indices.length:0);for(letoinc)if(c.hasOwnProperty(o)&&a(c[o])){letg=c[o];n+=5+g.values.length}}returnn}S.packCreateGeometryResults=function(e,n){lett=newFloat64Array(_(e)),i=[],r={},c=e.length,o=0;t[o++]=c;for(letg=0;g<c;g++){lets=e[g],u=a(s);if(t[o++]=u?1:0,!u)continue;t[o++]=s.primitiveType,t[o++]=s.geometryType,t[o++]=v(s.offsetAttribute,-1);letm=a(s.boundingSphere)?1:0;t[o++]=m,m&&y.pack(s.boundingSphere,t,o),o+=y.packedLength;letp=a(s.boundingSphereCV)?1:0;t[o++]=p,p&&y.pack(s.boundingSphereCV,t,o),o+=y.packedLength;letl=s.attributes,f=[];for(lethinl)l.hasOwnProperty(h)&&a(l[h])&&(f.push(h),a(r[h])||(r[h]=i.length,i.push(h)));t[o++]=f.length;for(leth=0;h<f.length;h++){letx=f[h],C=l[x];t[o++]=r[x],t[o++]=C.componentDatatype,t[o++]=C.componentsPerAttribute,t[o++]=C.normalize?1:0,t[o++]=C.values.length,t.set(C.values,o),o+=C.values.length}letd=a(s.indices)?s.indices.length:0;t[o++]=d,d>0&&(t.set(s.indices,o),o+=d)}returnn.push(t.buffer),{stringTable:i,packedData:t}};S.unpackCreateGeometryResults=function(e){letn=e.stringTable,t=e.packedData,i,r=newArray(t[0]),c=0,o=1;for(;o<t.length;){if(!(t[o++]===1)){r[c++]=void0;continue}lets=t[o++],u=t[o++],m=t[o++];m===-1&&(m=void0);letp,l;t[o++]===1&&(p=y.unpack(t,o)),o+=y.packedLength,t[o++]===1&&(l=y.unpack(t,o)),o+=y.packedLength;leth,x,C,H=newE,q=t[o++];for(i=0;i<q;i++){letA=n[t[o++]],M=t[o++];C=t[o++];letJ=t[o++]!==0;h=t[o++],x=k.createTypedArray(M,h);for(letO=0;O<h;O++)x[O]=t[o++];H[A]=newL({componentDatatype:M,componentsPerAttribute:C,normalize:J,values:x})}letV;if(h=t[o++],h>0){letA=x.length/C;for(V=U.createTypedArray(A,h),i=0;i<h;i++)V[i]=t[o++]}r[c++]=newz({primitiveType:s,geometryType:u,boundingSphere:p,boundingSphereCV:l,indices:V,attributes:H,offsetAttribute:m})}returnr};functionee(e,n){lett=e.length,i=newFloat64Array(1+t*19),r=0;i[r++]=t;for(letc=0;c<t;c++){leto=e[c];if(G.pack(o.modelMatrix,i,r),r+=G.packedLength,a(o.attributes)&&a(o.attributes.offset)){letg=o.attributes.offset.value;i[r]=g[0],i[r+1]=g[1],i[r+2]=g[2]}r+=3}returnn.push(i.buffer),i}functionte(e){letn=e,t=newArray(n[0]),i=0,r=1;for(;r<n.length;){letc=G.unpack(n,r),o;r+=G.packedLength,a(n[r])&&(o={offset:newj(n[r],n[r+1],n[r+2])}),r+=3,t[i++]={modelMatrix:c,attributes:o}}returnt}S.packCombineGeometryParameters=function(e,n){lett=e.createGeometryResults,i=t.length;for(letr=0;r<i;r++)n.push(t[r].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:ee(e.instances,n),ellipsoid:e.ellipsoid,isGeographic:e.projectioninstanceofD,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}};S.unpackCombineGeometryParameters=function(e){letn=te(e.packedInstances),t=e.createGeometryResults,i=t.length,r=0;for(letg=0;g<i;g++){lets=S.unpackCreateGeometryResults(t[g]),u=s.length;for(letm=0;m<u;m++){letp=s[m],l=n[r];l.geometry=p,++r}}letc=B.clone(e.ellipsoid),o=e.isGeographic?newD(c):new$(c);return{instances:n,ellipsoid:c,projection:o,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:G.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}};functionR(e){letn=e.length,t=1+(y.packedLength+1)*n,i=newFloat32Array(t),r=0;i[r++]=n;for(letc=0;c<n;++c){leto=e[c];a(o)?(i[r++]=1,y.pack(e[c],i,r)):i[r++]=0,r+=y.packedLength}returni}functionW(e){letn=newArray(e[0]),t=0,i=1;for(;i<e.length;)e[i++]===1&&(n[t]=y.unpack(e,i)),++t,i+=y.packedLength;returnn}S.packCombineGeometryResults=function(e,n){a(e.geometries)&&Z(e.geometries,n);lett=R(e.boundingSpheres),i=R(e.boundingSpheresCV);returnn.push(t.buffer,i.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:t,boundingSpheresCV:i}};S.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:W(e.boundingSpheres),boundingSpheresCV:W(e.boundingSpheresCV)}};varGe=S;export{Geasa};