define(["exports","./GeometryOffsetAttribute-1772960d","./Transforms-d5c6ad6e","./Matrix2-ccd5b911","./ComponentDatatype-93750d1a","./when-4bbc8319","./RuntimeError-346a3079","./GeometryAttribute-c30799b8","./GeometryAttributes-7827a6c2","./IndexDatatype-b7d979a6","./VertexFormat-71718faa"],function(t,$,tt,et,at,it,e,rt,nt,ot,f){"use strict";var mt=new et.Cartesian3,st=new et.Cartesian3,ut=new et.Cartesian3,lt=new et.Cartesian3,ct=new et.Cartesian3,l=new et.Cartesian3(1,1,1),ft=Math.cos,dt=Math.sin;function d(t){t=it.defaultValue(t,it.defaultValue.EMPTY_OBJECT);var e=it.defaultValue(t.radii,l),a=it.defaultValue(t.innerRadii,e),i=it.defaultValue(t.minimumClock,0),r=it.defaultValue(t.maximumClock,at.CesiumMath.TWO_PI),n=it.defaultValue(t.minimumCone,0),o=it.defaultValue(t.maximumCone,at.CesiumMath.PI),m=Math.round(it.defaultValue(t.stackPartitions,64)),s=Math.round(it.defaultValue(t.slicePartitions,64)),u=it.defaultValue(t.vertexFormat,f.VertexFormat.DEFAULT);this._radii=et.Cartesian3.clone(e),this._innerRadii=et.Cartesian3.clone(a),this._minimumClock=i,this._maximumClock=r,this._minimumCone=n,this._maximumCone=o,this._stackPartitions=m,this._slicePartitions=s,this._vertexFormat=f.VertexFormat.clone(u),this._offsetAttribute=t.offsetAttribute,this._workerName="createEllipsoidGeometry"}d.packedLength=2*et.Cartesian3.packedLength+f.VertexFormat.packedLength+7,d.pack=function(t,e,a){return a=it.defaultValue(a,0),et.Cartesian3.pack(t._radii,e,a),a+=et.Cartesian3.packedLength,et.Cartesian3.pack(t._innerRadii,e,a),a+=et.Cartesian3.packedLength,f.VertexFormat.pack(t._vertexFormat,e,a),a+=f.VertexFormat.packedLength,e[a++]=t._minimumClock,e[a++]=t._maximumClock,e[a++]=t._minimumCone,e[a++]=t._maximumCone,e[a++]=t._stackPartitions,e[a++]=t._slicePartitions,e[a]=it.defaultValue(t._offsetAttribute,-1),e};var a,C=new et.Cartesian3,p=new et.Cartesian3,y=new f.VertexFormat,_={radii:C,innerRadii:p,vertexFormat:y,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};d.unpack=function(t,e,a){e=it.defaultValue(e,0);var i=et.Cartesian3.unpack(t,e,C);e+=et.Cartesian3.packedLength;var r=et.Cartesian3.unpack(t,e,p);e+=et.Cartesian3.packedLength;var n=f.VertexFormat.unpack(t,e,y);e+=f.VertexFormat.packedLength;var o=t[e++],m=t[e++],s=t[e++],u=t[e++],l=t[e++],c=t[e++],e=t[e];return it.defined(a)?(a._radii=et.Cartesian3.clone(i,a._radii),a._innerRadii=et.Cartesian3.clone(r,a._innerRadii),a._vertexFormat=f.VertexFormat.clone(n,a._vertexFormat),a._minimumClock=o,a._maximumClock=m,a._minimumCone=s,a._maximumCone=u,a._stackPartitions=l,a._slicePartitions=c,a._offsetAttribute=-1===e?void 0:e,a):(_.minimumClock=o,_.maximumClock=m,_.minimumCone=s,_.maximumCone=u,_.stackPartitions=l,_.slicePartitions=c,_.offsetAttribute=-1===e?void 0:e,new d(_))},d.createGeometry=function(t){var e=t._radii;if(!(e.x<=0||e.y<=0||e.z<=0)){var a=t._innerRadii;if(!(a.x<=0||a.y<=0||a.z<=0)){var i=t._minimumClock,r=t._maximumClock,n=t._minimumCone,o=t._maximumCone,m=t._vertexFormat,s=t._slicePartitions+1,u=t._stackPartitions+1;(s=Math.round(s*Math.abs(r-i)/at.CesiumMath.TWO_PI))<2&&(s=2),(u=Math.round(u*Math.abs(o-n)/at.CesiumMath.PI))<2&&(u=2);var l=0,c=[n],f=[i];for(B=0;B