define(["exports","./GeometryOffsetAttribute-1772960d","./Transforms-d13cc04e","./Matrix2-9aa31791","./ComponentDatatype-93750d1a","./when-4bbc8319","./RuntimeError-346a3079","./GeometryAttribute-43536dc0","./GeometryAttributes-7827a6c2","./IndexDatatype-b7d979a6","./VertexFormat-71718faa"],(function(t,e,a,i,r,n,o,m,s,u,l){"use strict";var f=new i.Cartesian3,c=new i.Cartesian3,d=new i.Cartesian3,C=new i.Cartesian3,p=new i.Cartesian3,y=new i.Cartesian3(1,1,1),_=Math.cos,v=Math.sin;function h(t){t=n.defaultValue(t,n.defaultValue.EMPTY_OBJECT);var e=n.defaultValue(t.radii,y),a=n.defaultValue(t.innerRadii,e),o=n.defaultValue(t.minimumClock,0),m=n.defaultValue(t.maximumClock,r.CesiumMath.TWO_PI),s=n.defaultValue(t.minimumCone,0),u=n.defaultValue(t.maximumCone,r.CesiumMath.PI),f=Math.round(n.defaultValue(t.stackPartitions,64)),c=Math.round(n.defaultValue(t.slicePartitions,64)),d=n.defaultValue(t.vertexFormat,l.VertexFormat.DEFAULT);this._radii=i.Cartesian3.clone(e),this._innerRadii=i.Cartesian3.clone(a),this._minimumClock=o,this._maximumClock=m,this._minimumCone=s,this._maximumCone=u,this._stackPartitions=f,this._slicePartitions=c,this._vertexFormat=l.VertexFormat.clone(d),this._offsetAttribute=t.offsetAttribute,this._workerName="createEllipsoidGeometry"}h.packedLength=2*i.Cartesian3.packedLength+l.VertexFormat.packedLength+7,h.pack=function(t,e,a){return a=n.defaultValue(a,0),i.Cartesian3.pack(t._radii,e,a),a+=i.Cartesian3.packedLength,i.Cartesian3.pack(t._innerRadii,e,a),a+=i.Cartesian3.packedLength,l.VertexFormat.pack(t._vertexFormat,e,a),a+=l.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]=n.defaultValue(t._offsetAttribute,-1),e};var x,A=new i.Cartesian3,b=new i.Cartesian3,k=new l.VertexFormat,w={radii:A,innerRadii:b,vertexFormat:k,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};h.unpack=function(t,e,a){e=n.defaultValue(e,0);var r=i.Cartesian3.unpack(t,e,A);e+=i.Cartesian3.packedLength;var o=i.Cartesian3.unpack(t,e,b);e+=i.Cartesian3.packedLength;var m=l.VertexFormat.unpack(t,e,k);e+=l.VertexFormat.packedLength;var s=t[e++],u=t[e++],f=t[e++],c=t[e++],d=t[e++],C=t[e++],p=t[e];return n.defined(a)?(a._radii=i.Cartesian3.clone(r,a._radii),a._innerRadii=i.Cartesian3.clone(o,a._innerRadii),a._vertexFormat=l.VertexFormat.clone(m,a._vertexFormat),a._minimumClock=s,a._maximumClock=u,a._minimumCone=f,a._maximumCone=c,a._stackPartitions=d,a._slicePartitions=C,a._offsetAttribute=-1===p?void 0:p,a):(w.minimumClock=s,w.maximumClock=u,w.minimumCone=f,w.maximumCone=c,w.stackPartitions=d,w.slicePartitions=C,w.offsetAttribute=-1===p?void 0:p,new h(w))},h.createGeometry=function(t){var o=t._radii;if(!(o.x<=0||o.y<=0||o.z<=0)){var l=t._innerRadii;if(!(l.x<=0||l.y<=0||l.z<=0)){var y,h,x=t._minimumClock,A=t._maximumClock,b=t._minimumCone,k=t._maximumCone,w=t._vertexFormat,F=t._slicePartitions+1,P=t._stackPartitions+1;(F=Math.round(F*Math.abs(A-x)/r.CesiumMath.TWO_PI))<2&&(F=2),(P=Math.round(P*Math.abs(k-b)/r.CesiumMath.PI))<2&&(P=2);var g=0,V=[b],M=[x];for(y=0;y0&&(I=!0,G+=F-1),k0&&y!==T-1&&0!==h&&h!==D-1&&(S[it]=!0),it++;for(g=0,y=1;y=ht&&y