define(["exports","./GeometryOffsetAttribute-ed56ff58","./BoundingSphere-9a3b5656","./Cartesian2-bd414876","./Cartesian3-e0307675","./Check-741c5f3c","./ComponentDatatype-aaeec80f","./defaultValue-81eec7ed","./EllipseGeometryLibrary-6649af71","./GeographicProjection-c931c7fb","./GeometryAttribute-2b42a913","./GeometryAttributes-32b29525","./GeometryInstance-1b39c9e8","./GeometryPipeline-e7083fea","./IndexDatatype-3f3c99e8","./Math-e73894ab","./Matrix4-4c545f70","./Transforms-5b829630","./Rectangle-cf3e0e3e","./VertexFormat-d50a69ba"],(function(t,e,i,r,n,o,a,s,l,u,c,m,p,y,d,f,A,h,x,g){"use strict";const _=new n.Cartesian3,b=new n.Cartesian3,C=new n.Cartesian3,w=new n.Cartesian3,M=new r.Cartesian2,E=new A.Matrix3,I=new A.Matrix3,T=new h.Quaternion,G=new n.Cartesian3,N=new n.Cartesian3,P=new n.Cartesian3,F=new r.Cartographic,v=new n.Cartesian3,V=new r.Cartesian2,D=new r.Cartesian2;function S(t,i,o){const p=i.vertexFormat,y=i.center,d=i.semiMajorAxis,f=i.semiMinorAxis,x=i.ellipsoid,g=i.stRotation,w=o?t.length/3*2:t.length/3,S=i.shadowVolume,O=p.st?new Float32Array(2*w):void 0,L=p.normal?new Float32Array(3*w):void 0,R=p.tangent?new Float32Array(3*w):void 0,j=p.bitangent?new Float32Array(3*w):void 0,k=S?new Float32Array(3*w):void 0;let z=0,B=G,Y=N,H=P;const U=new u.GeographicProjection(x),Q=U.project(x.cartesianToCartographic(y,F),v),W=x.scaleToGeodeticSurface(y,_);x.geodeticSurfaceNormal(W,W);let J=E,q=I;if(0!==g){let t=h.Quaternion.fromAxisAngle(W,g,T);J=A.Matrix3.fromQuaternion(t,J),t=h.Quaternion.fromAxisAngle(W,-g,T),q=A.Matrix3.fromQuaternion(t,q)}else J=A.Matrix3.clone(A.Matrix3.IDENTITY,J),q=A.Matrix3.clone(A.Matrix3.IDENTITY,q);const Z=r.Cartesian2.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,V),K=r.Cartesian2.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,D);let X=t.length;const $=o?X:0,tt=$/3*2;for(let e=0;e1;--o){for(e[s++]=i++,e[s++]=i,e[s++]=n,r=2*o,a=0;af.CesiumMath.PI&&(p.north=p.north>0?f.CesiumMath.PI_OVER_TWO-f.CesiumMath.EPSILON7:p.north,p.south=p.south<0?f.CesiumMath.EPSILON7-f.CesiumMath.PI_OVER_TWO:p.south,p.east=f.CesiumMath.PI,p.west=-f.CesiumMath.PI),p}function B(t){const e=(t=s.defaultValue(t,s.defaultValue.EMPTY_OBJECT)).center,i=s.defaultValue(t.ellipsoid,r.Ellipsoid.WGS84),o=t.semiMajorAxis,a=t.semiMinorAxis,l=s.defaultValue(t.granularity,f.CesiumMath.RADIANS_PER_DEGREE),u=s.defaultValue(t.vertexFormat,g.VertexFormat.DEFAULT),c=s.defaultValue(t.height,0),m=s.defaultValue(t.extrudedHeight,c);this._center=n.Cartesian3.clone(e),this._semiMajorAxis=o,this._semiMinorAxis=a,this._ellipsoid=r.Ellipsoid.clone(i),this._rotation=s.defaultValue(t.rotation,0),this._stRotation=s.defaultValue(t.stRotation,0),this._height=Math.max(m,c),this._granularity=l,this._vertexFormat=g.VertexFormat.clone(u),this._extrudedHeight=Math.min(m,c),this._shadowVolume=s.defaultValue(t.shadowVolume,!1),this._workerName="createEllipseGeometry",this._offsetAttribute=t.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}B.packedLength=n.Cartesian3.packedLength+r.Ellipsoid.packedLength+g.VertexFormat.packedLength+9,B.pack=function(t,e,i){return i=s.defaultValue(i,0),n.Cartesian3.pack(t._center,e,i),i+=n.Cartesian3.packedLength,r.Ellipsoid.pack(t._ellipsoid,e,i),i+=r.Ellipsoid.packedLength,g.VertexFormat.pack(t._vertexFormat,e,i),i+=g.VertexFormat.packedLength,e[i++]=t._semiMajorAxis,e[i++]=t._semiMinorAxis,e[i++]=t._rotation,e[i++]=t._stRotation,e[i++]=t._height,e[i++]=t._granularity,e[i++]=t._extrudedHeight,e[i++]=t._shadowVolume?1:0,e[i]=s.defaultValue(t._offsetAttribute,-1),e};const Y=new n.Cartesian3,H=new r.Ellipsoid,U=new g.VertexFormat,Q={center:Y,ellipsoid:H,vertexFormat:U,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,stRotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};B.unpack=function(t,e,i){e=s.defaultValue(e,0);const o=n.Cartesian3.unpack(t,e,Y);e+=n.Cartesian3.packedLength;const a=r.Ellipsoid.unpack(t,e,H);e+=r.Ellipsoid.packedLength;const l=g.VertexFormat.unpack(t,e,U);e+=g.VertexFormat.packedLength;const u=t[e++],c=t[e++],m=t[e++],p=t[e++],y=t[e++],d=t[e++],f=t[e++],A=1===t[e++],h=t[e];return s.defined(i)?(i._center=n.Cartesian3.clone(o,i._center),i._ellipsoid=r.Ellipsoid.clone(a,i._ellipsoid),i._vertexFormat=g.VertexFormat.clone(l,i._vertexFormat),i._semiMajorAxis=u,i._semiMinorAxis=c,i._rotation=m,i._stRotation=p,i._height=y,i._granularity=d,i._extrudedHeight=f,i._shadowVolume=A,i._offsetAttribute=-1===h?void 0:h,i):(Q.height=y,Q.extrudedHeight=f,Q.granularity=d,Q.stRotation=p,Q.rotation=m,Q.semiMajorAxis=u,Q.semiMinorAxis=c,Q.shadowVolume=A,Q.offsetAttribute=-1===h?void 0:h,new B(Q))},B.computeRectangle=function(t,e){const i=(t=s.defaultValue(t,s.defaultValue.EMPTY_OBJECT)).center,n=s.defaultValue(t.ellipsoid,r.Ellipsoid.WGS84),o=t.semiMajorAxis,a=t.semiMinorAxis,l=s.defaultValue(t.granularity,f.CesiumMath.RADIANS_PER_DEGREE);return z(i,o,a,s.defaultValue(t.rotation,0),l,n,e)},B.createGeometry=function(t){if(t._semiMajorAxis<=0||t._semiMinorAxis<=0)return;const r=t._height,o=t._extrudedHeight,u=!f.CesiumMath.equalsEpsilon(r,o,0,f.CesiumMath.EPSILON2);t._center=t._ellipsoid.scaleToGeodeticSurface(t._center,t._center);const m={center:t._center,semiMajorAxis:t._semiMajorAxis,semiMinorAxis:t._semiMinorAxis,ellipsoid:t._ellipsoid,rotation:t._rotation,height:r,granularity:t._granularity,vertexFormat:t._vertexFormat,stRotation:t._stRotation};let p;if(u)m.extrudedHeight=o,m.shadowVolume=t._shadowVolume,m.offsetAttribute=t._offsetAttribute,p=k(m);else if(p=function(t){const e=t.center;L=n.Cartesian3.multiplyByScalar(t.ellipsoid.geodeticSurfaceNormal(e,L),t.height,L),L=n.Cartesian3.add(e,L,L);const r=new i.BoundingSphere(L,t.semiMajorAxis),o=l.EllipseGeometryLibrary.computeEllipsePositions(t,!0,!1),a=o.positions,s=o.numPts,u=S(a,t,!1);let c=O(s);return c=d.IndexDatatype.createTypedArray(a.length/3,c),{boundingSphere:r,attributes:u,indices:c}}(m),s.defined(t._offsetAttribute)){const i=p.attributes.position.values.length,r=new Uint8Array(i/3),n=t._offsetAttribute===e.GeometryOffsetAttribute.NONE?0:1;e.arrayFill(r,n),p.attributes.applyOffset=new c.GeometryAttribute({componentDatatype:a.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:r})}return new c.Geometry({attributes:p.attributes,indices:p.indices,primitiveType:c.PrimitiveType.TRIANGLES,boundingSphere:p.boundingSphere,offsetAttribute:t._offsetAttribute})},B.createShadowVolume=function(t,e,i){const r=t._granularity,n=t._ellipsoid,o=e(r,n),a=i(r,n);return new B({center:t._center,semiMajorAxis:t._semiMajorAxis,semiMinorAxis:t._semiMinorAxis,ellipsoid:n,rotation:t._rotation,stRotation:t._stRotation,granularity:r,extrudedHeight:o,height:a,vertexFormat:g.VertexFormat.POSITION_ONLY,shadowVolume:!0})},Object.defineProperties(B.prototype,{rectangle:{get:function(){return s.defined(this._rectangle)||(this._rectangle=z(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return s.defined(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=function(t){const e=-t._stRotation;if(0===e)return[0,0,0,1,1,0];const i=l.EllipseGeometryLibrary.computeEllipsePositions({center:t._center,semiMajorAxis:t._semiMajorAxis,semiMinorAxis:t._semiMinorAxis,rotation:t._rotation,granularity:t._granularity},!1,!0).outerPositions,r=i.length/3,o=new Array(r);for(let t=0;t