define(["exports","./Matrix2-c6c16658","./EllipsoidTangentPlane-41514392","./ComponentDatatype-3d0a0aac","./PolylinePipeline-013902ec","./Transforms-f15de320","./when-4bbc8319","./RuntimeError-5b082e8f"],(function(e,a,t,n,r,i,o,s){"use strict";varl=Object.freeze({ROUNDED:0,MITERED:1,BEVELED:2});constc={};functionC(e,a){o.defined(c[e])||(c[e]=!0,console.warn(o.defaultValue(a,e)))}C.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.",C.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored",C.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored",C.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";constu=[newa.Cartesian3,newa.Cartesian3],d=newa.Cartesian3,g=newa.Cartesian3,y=newa.Cartesian3,m=newa.Cartesian3,h=newa.Cartesian3,f=newa.Cartesian3,p=newa.Cartesian3,w=newa.Cartesian3,x=newa.Cartesian3,E=newa.Cartesian3,P=newa.Cartesian3,b={};letM=newa.Cartographic;functionT(e,t,n,r){consti=e[0],o=e[1],s=a.Cartesian3.angleBetween(i,o),l=Math.ceil(s/r),c=newArray(l);letC;if(t===n){for(C=0;C<l;C++)c[C]=t;returnc.push(n),c}constu=(n-t)/l;for(C=1;C<l;C++){conste=t+C*u;c[C]=e}returnc[0]=t,c.push(n),c}constB=newa.Cartesian3,z=newa.Cartesian3;constS=newa.Cartesian3(-1,0,0);letA=newa.Matrix4;constD=newa.Matrix4;letR=newa.Matrix3;constO=a.Matrix3.IDENTITY.clone(),I=newa.Cartesian3,V=newa.Cartesian4,N=newa.Cartesian3;functionv(e,n,r,o,s,l,c,C){letu=I,d=V;A=i.Transforms.eastNorthUpToFixedFrame(e,s,A),u=a.Matrix4.multiplyByPointAsVector(A,S,u),u=a.Cartesian3.normalize(u,u);constg=function(e,n,r,i){consto=newt.EllipsoidTangentPlane(r,i),s=o.projectPointOntoPlane(a.Cartesian3.add(r,e,B),B),l=o.projectPointOntoPlane(a.Cartesian3.add(r,n,z),z),c=a.Cartesian2.angleBetween(s,l);returnl.x*s.y-l.y*s.x>=0?-c:c}(u,n,e,s);R=a.Matrix3.fromRotationZ(g,R),N.z=l,A=a.Matrix4.multiplyTransformation(A,a.Matrix4.fromRotationTranslation(R,N,D),A);consty=O;y[0]=c;for(lete=0;e<C;e++)for(lete=0;e<r.length;e+=3)d=a.Cartesian3.fromArray(r,e,d),d=a.Matrix3.multiplyByVector(y,d,d),d=a.Matrix4.multiplyByPoint(A,d,d),o.push(d.x,d.y,d.z);returno}constG=newa.Cartesian3;functionH(e,t,n,r,i,o,s){for(letl=0;l<e.length;l+=3){r=v(a.Cartesian3.fromArray(e,l,G),t,n,r,i,o[l/3],s,1)}returnr}functionL(e,a){constt=e.length,n=newArray(3*t);letr=0;consti=a.x+a.width/2,o=a.y+a.height/2;for(leta=0;a<t;a++)n[r++]=e[a].x-i,n[r++]=0,n[r++]=e[a].y-o;returnn}constj=newi.Quaternion,Q=newa.Cartesian3,q=newa.Matrix3;functionF(e,t,r,o,s,c,C,u,d,g){consty=a.Cartesian3.angleBetween(a.Cartesian3.subtract(t,e,E),a.Cartesian3.subtract(r,e,P)),m=o===l.BEVELED?0:Math.ceil(y/n.CesiumMath.toRadians(5));leth,f,p;if(h=s?a.Matrix3.fromQuaternion(i.Quaternion.fromAxisAngle(a.Cartesian3.negate(e,E),y/(m+1),j),q):a.Matrix3.fromQuaternion(i.Quaternion.fromAxisAngle(e,y/(m+1),j),q),t=a.Cartesian3.clone(t,Q),m>0){constn=g?2:1;for(letr=0;r<m;r++)t=a.Matrix3.multiplyByVector(h,t,t),f=a.Cartesian3.subtract(t,e,E),f=a.Cartesian3.normalize(f,f),s||(f=a.Cartesian3.negate(f,f)),p=c.scaleToGeodeticSurface(t,P),C=v(p,f,u,C,c,d,1,n)}elsef=a.Cartesian3.subtract(t,e,E),f=a.Cartesian3.normalize(f,f),s||(f=a.Cartesian3.negate(f,f)),p=c.scaleToGeodeticSurface(t,P),C=v(p,f,u,C,c,d,1,1),r=a.Cartesian3.clone(r,Q),f=a.Cartesian3.subtract(r,e,E),f=a.Cartesian3.normalize(f,f),s||(f=a.Cartesian3.negate(f,f)),p=c.scaleToGeodeticSurface(r,P),C=v(p,f,u,C,c,d,1,1);returnC}b.removeDuplicatesFromShape=function(e){constt=e.length,n=[];for(letr=t-1,i=0;i<t;r=i++){constt=e[r],o=e[i];a.Cartesian2.equals(t,o)||n.push(o)}returnn},b.angleIsGreaterThanPi=function(e,n,r,i){consto=newt.EllipsoidTangentPlane(r,i),s=o.projectPointOntoPlane(a.Cartesian3.add(r,e,B),B),l=o.projectPointOntoPlane(a.Cartesian3.add(r,n,z),z);returnl.x*s.y-l.y*s.x>=0};constU=newa.Cartesian3,_=newa.Cartesian3;b.computePositions=function(e,t,i,o,s){constc=o._ellipsoid,P=function(e,a){constt=newArray(e.length);for(letn=0;n<e.length;n++){constr=e[n];M=a.cartesianToCartographic(r,M),t[n]=M.height,e[n]=a.scaleToGeodeticSurface(r,r)}returnt}(e,c),B=o._granularity,z=o._cornerType,S=s?function(e,a){constt=e.length,n=newArray(6*t);letr=0;consti=a.x+a.width/2,o=a.y+a.height/2;lets=e[0];n[r++]=s.x-i,n[r++]=0,n[r++]=s.y-o;for(leta=1;a<t;a++){s=e[a];constt=s.x-i,l=s.y-o;n[r++]=t,n[r++]=0,n[r++]=l,n[r++]=t,n[r++]=0,n[r++]=l}returns=e[0],n[r++]=s.x-i,n[r++]=0,n[r++]=s.y-o,n}(t,i):L(t,i),A=s?L(t,i):void0,D=i.height/2,R=i.width/2;letO=e.length,I=[],V=s?[]:void0,N=d,G=g,j=y,Q=m,q=h,Z=f,W=p,Y=w,k=x,J=e[0],K=e[1];Q=c.geodeticSurfaceNormal(J,Q),N=a.Cartesian3.subtract(K,J,N),N=a.Cartesian3.normalize(N,N),Y=a.Cartesian3.cross(Q,N,Y),Y=a.Cartesian3.normalize(Y,Y);letX,$,ee=P[0],ae=P[1];s&&(V=v(J,Y,A,V,c,ee+D,1,1)),k=a.Cartesian3.clone(J,k),J=K,G=a.Cartesian3.negate(N,G);for(lett=1;t<O-1;t++){consti=s?2:1;if(K=e[t+1],J.equals(K)){C("Positions are too close and are considered equivalent with rounding error.");continue}N=a.Cartesian3.subtract(K,J,N),N=a.Cartesian3.normalize(N,N),j=a.Cartesian3.add(N,G,j),j=a.Cartesian3.normalize(j,j),Q=c.geodeticSurfaceNormal(J,Q);consto=a.Cartesian3.multiplyByScalar(Q,a.Cartesian3.dot(N,Q),U);a.Cartesian3.subtract(N,o,o),a.Cartesian3.normalize(o,o);constd=a.Cartesian3.multiplyByScalar(Q,a.Cartesian3.dot(G,Q),_);a.Cartesian3.subtract(G,d,d),a.Cartesian3.normalize(d,d);if(!n.CesiumMath.equalsEpsilon(Math.abs(a.Cartesian3.dot(o,d)),1,n.CesiumMath.EPSILON7)){j=a.Cartesian3.cross(j,Q,j),j=a.Cartesian3.cross(Q,j,j),j=a.Cartesian3.normalize(j,j);conste=1/Math.max(.25,a.Cartesian3.magnitude(a.Cartesian3.cross(j,G,E))),t=b.angleIsGreaterThanPi(N,G,J,c);t?(q=a.Cartesian3.add(J,a.Cartesian3.multiplyByScalar(j,e*R,j),q),Z=a.Cartesian3.add(q,a.Cartesian3.multiplyByScalar(Y,R,Z),Z),u[0]=a.Cartesian3.clone(k,u[0]),u[1]=a.Cartesian3.clone(Z,u[1]),X=T(u,ee+D,ae+D,B),$=r.PolylinePipeline.generateArc({positions:u,granularity:B,ellipsoid:c}),I=H($,Y,S,I,c,X,1),Y=a.Cartesian3.cross(Q,N,Y),Y=a.Cartesian3.normalize(Y,Y),W=a.Cartesian3.add(q,a.Cartesian3.multiplyByScalar(Y,R,W),W),z===l.ROUNDED||z===l.BEVELED?F(q,Z,W,z,t,c,I,S,ae+D,s):(j=a.Cartesian3.negate(j,j),I=v(J,j,S,I,c,ae+D,e,i)),k=a.Cartesian3.clone(W,k)):(q=a.Cartesian3.add(J,a.Cartesian3.multiplyByScalar(j,e*R,j),q),Z=a.Cartesian3.add(q,a.Cartesian3.multiplyByScalar(Y,-R,Z),Z),u[0]=a.Cartesian3.clone(k,u[0]),u[1]=a.Cartesian3.clone(Z,u[1]),X=T(u,ee+D,ae+D,B),$=r.PolylinePipeline.generateArc({positions:u,granularity:B,ellipsoid:c}),I=H($,Y,S,I,c,X,1),Y=a.Cartesian3.cross(Q,N,Y),Y=a.Cartesian3.normalize(Y,Y),W=a.Cartesian3.add(q,a.Cartesian3.multiplyByScalar(Y,-R,W),W),z===l.ROUNDED||z===l.BEVELED?F(q,Z,W,z,t,c,I,S,ae+D,s):I=v(J,j,S,I,c,ae+D,e,i),k=a.Cartesian3.clone(W,k)),G=a.Cartesian3.negate(N,G)}elseI=v(k,Y,S,I,c,ee+D,1,1),k=J;ee=ae,ae=P[t+1],J=K}u[0]=a.Cartesian3.clone(k,u[0]),u[1]=a.Cartesian3.clone(J,u[1]),X=T(u,ee+D,ae+D,B),$=r.PolylinePipeline.generateArc({positions:u,granularity:B,ellipsoid:c}),I=H($,Y,S,I,c,X,1),s&&(V=v(J,Y,A,V,c,ae+D,1,1)),O=I.length;constte=s?O+V.length:O,ne=newFloat64Array(te);returnne.set(I),s&&ne.set(V,O),ne},e.CornerType=l,e.PolylineVolumeGeometryLibrary=b,e.oneTimeWarning=C}));
define(["exports","./when-4bbc8319"],(function(t,e){"use strict";functionn(t){lete;this.name="DeveloperError",this.message=t;try{thrownewError}catch(t){e=t.stack}this.stack=e}e.defined(Object.create)&&(n.prototype=Object.create(Error.prototype),n.prototype.constructor=n),n.prototype.toString=function(){lett=`${this.name}: ${this.message}`;returne.defined(this.stack)&&(t+=`\n${this.stack.toString()}`),t},n.throwInstantiationError=function(){thrownewn("This function defines an interface and should not be called directly.")};consto={};functionr(t,e,n){return`Expected ${n} to be typeof ${e}, actual typeof was ${t}`}functioni(t){lete;this.name="RuntimeError",this.message=t;try{thrownewError}catch(t){e=t.stack}this.stack=e}o.typeOf={},o.defined=function(t,o){if(!e.defined(o))thrownewn(function(t){return`${t} is required, actual value was undefined`}(t))},o.typeOf.func=function(t,e){if("function"!=typeofe)thrownewn(r(typeofe,"function",t))},o.typeOf.string=function(t,e){if("string"!=typeofe)thrownewn(r(typeofe,"string",t))},o.typeOf.number=function(t,e){if("number"!=typeofe)thrownewn(r(typeofe,"number",t))},o.typeOf.number.lessThan=function(t,e,r){if(o.typeOf.number(t,e),e>=r)thrownewn(`Expected ${t} to be less than ${r}, actual value was ${e}`)},o.typeOf.number.lessThanOrEquals=function(t,e,r){if(o.typeOf.number(t,e),e>r)thrownewn(`Expected ${t} to be less than or equal to ${r}, actual value was ${e}`)},o.typeOf.number.greaterThan=function(t,e,r){if(o.typeOf.number(t,e),e<=r)thrownewn(`Expected ${t} to be greater than ${r}, actual value was ${e}`)},o.typeOf.number.greaterThanOrEquals=function(t,e,r){if(o.typeOf.number(t,e),e<r)thrownewn(`Expected ${t} to be greater than or equal to ${r}, actual value was ${e}`)},o.typeOf.object=function(t,e){if("object"!=typeofe)thrownewn(r(typeofe,"object",t))},o.typeOf.bool=function(t,e){if("boolean"!=typeofe)thrownewn(r(typeofe,"boolean",t))},o.typeOf.bigint=function(t,e){if("bigint"!=typeofe)thrownewn(r(typeofe,"bigint",t))},o.typeOf.number.equals=function(t,e,r,i){if(o.typeOf.number(t,r),o.typeOf.number(e,i),r!==i)thrownewn(`${t} must be equal to ${e}, the actual values are ${r} and ${i}`)},e.defined(Object.create)&&(i.prototype=Object.create(Error.prototype),i.prototype.constructor=i),i.prototype.toString=function(){lett=`${this.name}: ${this.message}`;returne.defined(this.stack)&&(t+=`\n${this.stack.toString()}`),t},t.Check=o,t.DeveloperError=n,t.RuntimeError=i}));