define(["exports","./RuntimeError-c581ca93","./defaultValue-94c3e563","./ComponentDatatype-4a60b8d6"],(function(e,t,n,r){"use strict";function a(e,t,r){this.x=n.defaultValue(e,0),this.y=n.defaultValue(t,0),this.z=n.defaultValue(r,0)}a.fromSpherical=function(e,r){t.Check.typeOf.object("spherical",e),n.defined(r)||(r=new a);const c=e.clock,o=e.cone,i=n.defaultValue(e.magnitude,1),u=i*Math.sin(o);return r.x=u*Math.cos(c),r.y=u*Math.sin(c),r.z=i*Math.cos(o),r},a.fromElements=function(e,t,r,c){return n.defined(c)?(c.x=e,c.y=t,c.z=r,c):new a(e,t,r)},a.clone=function(e,t){if(n.defined(e))return n.defined(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new a(e.x,e.y,e.z)},a.fromCartesian4=a.clone,a.packedLength=3,a.pack=function(e,r,a){return t.Check.typeOf.object("value",e),t.Check.defined("array",r),a=n.defaultValue(a,0),r[a++]=e.x,r[a++]=e.y,r[a]=e.z,r},a.unpack=function(e,r,c){return t.Check.defined("array",e),r=n.defaultValue(r,0),n.defined(c)||(c=new a),c.x=e[r++],c.y=e[r++],c.z=e[r],c},a.packArray=function(e,r){t.Check.defined("array",e);const c=e.length,o=3*c;if(n.defined(r)){if(!Array.isArray(r)&&r.length!==o)throw new t.DeveloperError("If result is a typed array, it must have exactly array.length * 3 elements");r.length!==o&&(r.length=o)}else r=new Array(o);for(let t=0;tr.CesiumMath.EPSILON12);return n.defined(u)?(u.x=s*T,u.y=f*S,u.z=h*R,u):new a(s*T,f*S,h*R)}function m(e,t,r){this.longitude=n.defaultValue(e,0),this.latitude=n.defaultValue(t,0),this.height=n.defaultValue(r,0)}m.fromRadians=function(e,r,a,c){return t.Check.typeOf.number("longitude",e),t.Check.typeOf.number("latitude",r),a=n.defaultValue(a,0),n.defined(c)?(c.longitude=e,c.latitude=r,c.height=a,c):new m(e,r,a)},m.fromDegrees=function(e,n,a,c){return t.Check.typeOf.number("longitude",e),t.Check.typeOf.number("latitude",n),e=r.CesiumMath.toRadians(e),n=r.CesiumMath.toRadians(n),m.fromRadians(e,n,a,c)};const O=new a,C=new a,b=new a,k=new a(1/6378137,1/6378137,1/6356752.314245179),x=new a(1/40680631590769,1/40680631590769,1/40408299984661.445),g=r.CesiumMath.EPSILON1;function j(e,c,o,i){c=n.defaultValue(c,0),o=n.defaultValue(o,0),i=n.defaultValue(i,0),t.Check.typeOf.number.greaterThanOrEquals("x",c,0),t.Check.typeOf.number.greaterThanOrEquals("y",o,0),t.Check.typeOf.number.greaterThanOrEquals("z",i,0),e._radii=new a(c,o,i),e._radiiSquared=new a(c*c,o*o,i*i),e._radiiToTheFourth=new a(c*c*c*c,o*o*o*o,i*i*i*i),e._oneOverRadii=new a(0===c?0:1/c,0===o?0:1/o,0===i?0:1/i),e._oneOverRadiiSquared=new a(0===c?0:1/(c*c),0===o?0:1/(o*o),0===i?0:1/(i*i)),e._minimumRadius=Math.min(c,o,i),e._maximumRadius=Math.max(c,o,i),e._centerToleranceSquared=r.CesiumMath.EPSILON1,0!==e._radiiSquared.z&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function w(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._squaredXOverSquaredZ=void 0,j(this,e,t,n)}m.fromCartesian=function(e,t,c){const o=n.defined(t)?t.oneOverRadii:k,i=n.defined(t)?t.oneOverRadiiSquared:x,u=n.defined(t)?t._centerToleranceSquared:g,s=d(e,o,i,u,C);if(!n.defined(s))return;let f=a.multiplyComponents(s,i,O);f=a.normalize(f,f);const h=a.subtract(e,s,b),l=Math.atan2(f.y,f.x),y=Math.asin(f.z),p=r.CesiumMath.sign(a.dot(h,e))*a.magnitude(h);return n.defined(c)?(c.longitude=l,c.latitude=y,c.height=p,c):new m(l,y,p)},m.toCartesian=function(e,n,r){return t.Check.defined("cartographic",e),a.fromRadians(e.longitude,e.latitude,e.height,n,r)},m.clone=function(e,t){if(n.defined(e))return n.defined(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new m(e.longitude,e.latitude,e.height)},m.equals=function(e,t){return e===t||n.defined(e)&&n.defined(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},m.equalsEpsilon=function(e,t,r){return r=n.defaultValue(r,0),e===t||n.defined(e)&&n.defined(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},m.ZERO=Object.freeze(new m(0,0,0)),m.prototype.clone=function(e){return m.clone(this,e)},m.prototype.equals=function(e){return m.equals(this,e)},m.prototype.equalsEpsilon=function(e,t){return m.equalsEpsilon(this,e,t)},m.prototype.toString=function(){return`(${this.longitude}, ${this.latitude}, ${this.height})`},Object.defineProperties(w.prototype,{radii:{get:function(){return this._radii}},radiiSquared:{get:function(){return this._radiiSquared}},radiiToTheFourth:{get:function(){return this._radiiToTheFourth}},oneOverRadii:{get:function(){return this._oneOverRadii}},oneOverRadiiSquared:{get:function(){return this._oneOverRadiiSquared}},minimumRadius:{get:function(){return this._minimumRadius}},maximumRadius:{get:function(){return this._maximumRadius}}}),w.clone=function(e,t){if(!n.defined(e))return;const r=e._radii;return n.defined(t)?(a.clone(r,t._radii),a.clone(e._radiiSquared,t._radiiSquared),a.clone(e._radiiToTheFourth,t._radiiToTheFourth),a.clone(e._oneOverRadii,t._oneOverRadii),a.clone(e._oneOverRadiiSquared,t._oneOverRadiiSquared),t._minimumRadius=e._minimumRadius,t._maximumRadius=e._maximumRadius,t._centerToleranceSquared=e._centerToleranceSquared,t):new w(r.x,r.y,r.z)},w.fromCartesian3=function(e,t){return n.defined(t)||(t=new w),n.defined(e)?(j(t,e.x,e.y,e.z),t):t},w.WGS84=Object.freeze(new w(6378137,6378137,6356752.314245179)),w.UNIT_SPHERE=Object.freeze(new w(1,1,1)),w.MOON=Object.freeze(new w(r.CesiumMath.LUNAR_RADIUS,r.CesiumMath.LUNAR_RADIUS,r.CesiumMath.LUNAR_RADIUS)),w.prototype.clone=function(e){return w.clone(this,e)},w.packedLength=a.packedLength,w.pack=function(e,r,c){return t.Check.typeOf.object("value",e),t.Check.defined("array",r),c=n.defaultValue(c,0),a.pack(e._radii,r,c),r},w.unpack=function(e,r,c){t.Check.defined("array",e),r=n.defaultValue(r,0);const o=a.unpack(e,r);return w.fromCartesian3(o,c)},w.prototype.geocentricSurfaceNormal=a.normalize,w.prototype.geodeticSurfaceNormalCartographic=function(e,r){t.Check.typeOf.object("cartographic",e);const c=e.longitude,o=e.latitude,i=Math.cos(o),u=i*Math.cos(c),s=i*Math.sin(c),f=Math.sin(o);return n.defined(r)||(r=new a),r.x=u,r.y=s,r.z=f,a.normalize(r,r)},w.prototype.geodeticSurfaceNormal=function(e,t){if(!a.equalsEpsilon(e,a.ZERO,r.CesiumMath.EPSILON14))return n.defined(t)||(t=new a),t=a.multiplyComponents(e,this._oneOverRadiiSquared,t),a.normalize(t,t)};const M=new a,z=new a;w.prototype.cartographicToCartesian=function(e,t){const r=M,c=z;this.geodeticSurfaceNormalCartographic(e,r),a.multiplyComponents(this._radiiSquared,r,c);const o=Math.sqrt(a.dot(r,c));return a.divideByScalar(c,o,c),a.multiplyByScalar(r,e.height,r),n.defined(t)||(t=new a),a.add(c,r,t)},w.prototype.cartographicArrayToCartesianArray=function(e,r){t.Check.defined("cartographics",e);const a=e.length;n.defined(r)?r.length=a:r=new Array(a);for(let t=0;t=this._radii.z-c))return o};const S=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],R=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function _(e,n,r){t.Check.typeOf.number("a",e),t.Check.typeOf.number("b",n),t.Check.typeOf.func("func",r);const a=.5*(n+e),c=.5*(n-e);let o=0;for(let t=0;t<5;t++){const e=c*S[t];o+=R[t]*(r(a+e)+r(a-e))}return o*=c,o}function V(e,t,r,a,c,o,i,u,s){this[0]=n.defaultValue(e,0),this[1]=n.defaultValue(a,0),this[2]=n.defaultValue(i,0),this[3]=n.defaultValue(t,0),this[4]=n.defaultValue(c,0),this[5]=n.defaultValue(u,0),this[6]=n.defaultValue(r,0),this[7]=n.defaultValue(o,0),this[8]=n.defaultValue(s,0)}w.prototype.surfaceArea=function(e){t.Check.typeOf.object("rectangle",e);const n=e.west;let a=e.east;const c=e.south,o=e.north;while(aa&&(c=r,a=t)}let o=1,i=0;const u=W[c],s=B[c];if(Math.abs(e[V.getElementIndex(s,u)])>n){const t=e[V.getElementIndex(s,s)],n=e[V.getElementIndex(u,u)],r=e[V.getElementIndex(s,u)],a=(t-n)/2/r;let c;c=a<0?-1/(-a+Math.sqrt(1+a*a)):1/(a+Math.sqrt(1+a*a)),o=1/Math.sqrt(1+c*c),i=c*o}return t=V.clone(V.IDENTITY,t),t[V.getElementIndex(u,u)]=t[V.getElementIndex(s,s)]=o,t[V.getElementIndex(s,u)]=i,t[V.getElementIndex(u,s)]=-i,t}const X=new V,Z=new V;V.computeEigenDecomposition=function(e,a){t.Check.typeOf.object("matrix",e);const c=r.CesiumMath.EPSILON20,o=10;let i=0,u=0;n.defined(a)||(a={});const s=a.unitary=V.clone(V.IDENTITY,a.unitary),f=a.diagonal=V.clone(e,a.diagonal),h=c*L(f);while(uh)$(f,X),V.transpose(X,Z),V.multiply(f,X,f),V.multiply(Z,f,f),V.multiply(s,X,s),++i>2&&(++u,i=0);return a},V.abs=function(e,n){return t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n),n[0]=Math.abs(e[0]),n[1]=Math.abs(e[1]),n[2]=Math.abs(e[2]),n[3]=Math.abs(e[3]),n[4]=Math.abs(e[4]),n[5]=Math.abs(e[5]),n[6]=Math.abs(e[6]),n[7]=Math.abs(e[7]),n[8]=Math.abs(e[8]),n},V.determinant=function(e){t.Check.typeOf.object("matrix",e);const n=e[0],r=e[3],a=e[6],c=e[1],o=e[4],i=e[7],u=e[2],s=e[5],f=e[8];return n*(o*f-s*i)+c*(s*a-r*f)+u*(r*i-o*a)},V.inverse=function(e,n){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n);const a=e[0],c=e[1],o=e[2],i=e[3],u=e[4],s=e[5],f=e[6],h=e[7],l=e[8],y=V.determinant(e);if(Math.abs(y)<=r.CesiumMath.EPSILON15)throw new t.DeveloperError("matrix is not invertible");n[0]=u*l-h*s,n[1]=h*o-c*l,n[2]=c*s-u*o,n[3]=f*s-i*l,n[4]=a*l-f*o,n[5]=i*o-a*s,n[6]=i*h-f*u,n[7]=f*c-a*h,n[8]=a*u-i*c;const p=1/y;return V.multiplyByScalar(n,p,n)};const Y=new V;function F(e,t,r,a){this.x=n.defaultValue(e,0),this.y=n.defaultValue(t,0),this.z=n.defaultValue(r,0),this.w=n.defaultValue(a,0)}V.inverseTranspose=function(e,n){return t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n),V.inverse(V.transpose(e,Y),n)},V.equals=function(e,t){return e===t||n.defined(e)&&n.defined(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},V.equalsEpsilon=function(e,t,r){return r=n.defaultValue(r,0),e===t||n.defined(e)&&n.defined(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r},V.IDENTITY=Object.freeze(new V(1,0,0,0,1,0,0,0,1)),V.ZERO=Object.freeze(new V(0,0,0,0,0,0,0,0,0)),V.COLUMN0ROW0=0,V.COLUMN0ROW1=1,V.COLUMN0ROW2=2,V.COLUMN1ROW0=3,V.COLUMN1ROW1=4,V.COLUMN1ROW2=5,V.COLUMN2ROW0=6,V.COLUMN2ROW1=7,V.COLUMN2ROW2=8,Object.defineProperties(V.prototype,{length:{get:function(){return V.packedLength}}}),V.prototype.clone=function(e){return V.clone(this,e)},V.prototype.equals=function(e){return V.equals(this,e)},V.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},V.prototype.equalsEpsilon=function(e,t){return V.equalsEpsilon(this,e,t)},V.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]})\n(${this[1]}, ${this[4]}, ${this[7]})\n(${this[2]}, ${this[5]}, ${this[8]})`},F.fromElements=function(e,t,r,a,c){return n.defined(c)?(c.x=e,c.y=t,c.z=r,c.w=a,c):new F(e,t,r,a)},F.fromColor=function(e,r){return t.Check.typeOf.object("color",e),n.defined(r)?(r.x=e.red,r.y=e.green,r.z=e.blue,r.w=e.alpha,r):new F(e.red,e.green,e.blue,e.alpha)},F.clone=function(e,t){if(n.defined(e))return n.defined(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new F(e.x,e.y,e.z,e.w)},F.packedLength=4,F.pack=function(e,r,a){return t.Check.typeOf.object("value",e),t.Check.defined("array",r),a=n.defaultValue(a,0),r[a++]=e.x,r[a++]=e.y,r[a++]=e.z,r[a]=e.w,r},F.unpack=function(e,r,a){return t.Check.defined("array",e),r=n.defaultValue(r,0),n.defined(a)||(a=new F),a.x=e[r++],a.y=e[r++],a.z=e[r++],a.w=e[r],a},F.packArray=function(e,r){t.Check.defined("array",e);const a=e.length,c=4*a;if(n.defined(r)){if(!Array.isArray(r)&&r.length!==c)throw new t.DeveloperError("If result is a typed array, it must have exactly array.length * 4 elements");r.length!==c&&(r.length=c)}else r=new Array(c);for(let t=0;t=0?n.longitude:n.longitude+r.CesiumMath.TWO_PI;i=Math.min(i,a),u=Math.max(u,a)}return o-c>u-i&&(c=i,o=u,o>r.CesiumMath.PI&&(o-=r.CesiumMath.TWO_PI),c>r.CesiumMath.PI&&(c-=r.CesiumMath.TWO_PI)),n.defined(a)?(a.west=c,a.south=s,a.east=o,a.north=f,a):new Ce(c,s,o,f)},Ce.fromCartesianArray=function(e,a,c){t.Check.defined("cartesians",e),a=n.defaultValue(a,w.WGS84);let o=Number.MAX_VALUE,i=-Number.MAX_VALUE,u=Number.MAX_VALUE,s=-Number.MAX_VALUE,f=Number.MAX_VALUE,h=-Number.MAX_VALUE;for(let t=0,n=e.length;t=0?n.longitude:n.longitude+r.CesiumMath.TWO_PI;u=Math.min(u,c),s=Math.max(s,c)}return i-o>s-u&&(o=u,i=s,i>r.CesiumMath.PI&&(i-=r.CesiumMath.TWO_PI),o>r.CesiumMath.PI&&(o-=r.CesiumMath.TWO_PI)),n.defined(c)?(c.west=o,c.south=f,c.east=i,c.north=h,c):new Ce(o,f,i,h)},Ce.clone=function(e,t){if(n.defined(e))return n.defined(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new Ce(e.west,e.south,e.east,e.north)},Ce.equalsEpsilon=function(e,t,r){return r=n.defaultValue(r,0),e===t||n.defined(e)&&n.defined(t)&&Math.abs(e.west-t.west)<=r&&Math.abs(e.south-t.south)<=r&&Math.abs(e.east-t.east)<=r&&Math.abs(e.north-t.north)<=r},Ce.prototype.clone=function(e){return Ce.clone(this,e)},Ce.prototype.equals=function(e){return Ce.equals(this,e)},Ce.equals=function(e,t){return e===t||n.defined(e)&&n.defined(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},Ce.prototype.equalsEpsilon=function(e,t){return Ce.equalsEpsilon(this,e,t)},Ce.validate=function(e){t.Check.typeOf.object("rectangle",e);const n=e.north;t.Check.typeOf.number.greaterThanOrEquals("north",n,-r.CesiumMath.PI_OVER_TWO),t.Check.typeOf.number.lessThanOrEquals("north",n,r.CesiumMath.PI_OVER_TWO);const a=e.south;t.Check.typeOf.number.greaterThanOrEquals("south",a,-r.CesiumMath.PI_OVER_TWO),t.Check.typeOf.number.lessThanOrEquals("south",a,r.CesiumMath.PI_OVER_TWO);const c=e.west;t.Check.typeOf.number.greaterThanOrEquals("west",c,-Math.PI),t.Check.typeOf.number.lessThanOrEquals("west",c,Math.PI);const o=e.east;t.Check.typeOf.number.greaterThanOrEquals("east",o,-Math.PI),t.Check.typeOf.number.lessThanOrEquals("east",o,Math.PI)},Ce.southwest=function(e,r){return t.Check.typeOf.object("rectangle",e),n.defined(r)?(r.longitude=e.west,r.latitude=e.south,r.height=0,r):new m(e.west,e.south)},Ce.northwest=function(e,r){return t.Check.typeOf.object("rectangle",e),n.defined(r)?(r.longitude=e.west,r.latitude=e.north,r.height=0,r):new m(e.west,e.north)},Ce.northeast=function(e,r){return t.Check.typeOf.object("rectangle",e),n.defined(r)?(r.longitude=e.east,r.latitude=e.north,r.height=0,r):new m(e.east,e.north)},Ce.southeast=function(e,r){return t.Check.typeOf.object("rectangle",e),n.defined(r)?(r.longitude=e.east,r.latitude=e.south,r.height=0,r):new m(e.east,e.south)},Ce.center=function(e,a){t.Check.typeOf.object("rectangle",e);let c=e.east;const o=e.west;c0?o+=r.CesiumMath.TWO_PI:u0&&(u+=r.CesiumMath.TWO_PI),o=y?void 0:n.defined(c)?(c.west=f,c.south=l,c.east=h,c.north=y,c):new Ce(f,l,h,y)},Ce.simpleIntersection=function(e,r,a){t.Check.typeOf.object("rectangle",e),t.Check.typeOf.object("otherRectangle",r);const c=Math.max(e.west,r.west),o=Math.max(e.south,r.south),i=Math.min(e.east,r.east),u=Math.min(e.north,r.north);if(!(o>=u||c>=i))return n.defined(a)?(a.west=c,a.south=o,a.east=i,a.north=u,a):new Ce(c,o,i,u)},Ce.union=function(e,a,c){t.Check.typeOf.object("rectangle",e),t.Check.typeOf.object("otherRectangle",a),n.defined(c)||(c=new Ce);let o=e.east,i=e.west,u=a.east,s=a.west;o0?o+=r.CesiumMath.TWO_PI:u0&&(u+=r.CesiumMath.TWO_PI),oo||r.CesiumMath.equalsEpsilon(a,o,r.CesiumMath.EPSILON14))&&(a=e.south&&c<=e.north};const be=new m;function ke(e,t){this.x=n.defaultValue(e,0),this.y=n.defaultValue(t,0)}Ce.subsample=function(e,a,c,o){t.Check.typeOf.object("rectangle",e),a=n.defaultValue(a,w.WGS84),c=n.defaultValue(c,0),n.defined(o)||(o=[]);let i=0;const u=e.north,s=e.south,f=e.east,h=e.west,l=be;l.height=c,l.longitude=h,l.latitude=u,o[i]=a.cartographicToCartesian(l,o[i]),i++,l.longitude=f,o[i]=a.cartographicToCartesian(l,o[i]),i++,l.latitude=s,o[i]=a.cartographicToCartesian(l,o[i]),i++,l.longitude=h,o[i]=a.cartographicToCartesian(l,o[i]),i++,l.latitude=u<0?u:s>0?s:0;for(let t=1;t<8;++t)l.longitude=-Math.PI+t*r.CesiumMath.PI_OVER_TWO,Ce.contains(e,l)&&(o[i]=a.cartographicToCartesian(l,o[i]),i++);return 0===l.latitude&&(l.longitude=h,o[i]=a.cartographicToCartesian(l,o[i]),i++,l.longitude=f,o[i]=a.cartographicToCartesian(l,o[i]),i++),o.length=i,o},Ce.subsection=function(e,a,c,o,i,u){if(t.Check.typeOf.object("rectangle",e),t.Check.typeOf.number.greaterThanOrEquals("westLerp",a,0),t.Check.typeOf.number.lessThanOrEquals("westLerp",a,1),t.Check.typeOf.number.greaterThanOrEquals("southLerp",c,0),t.Check.typeOf.number.lessThanOrEquals("southLerp",c,1),t.Check.typeOf.number.greaterThanOrEquals("eastLerp",o,0),t.Check.typeOf.number.lessThanOrEquals("eastLerp",o,1),t.Check.typeOf.number.greaterThanOrEquals("northLerp",i,0),t.Check.typeOf.number.lessThanOrEquals("northLerp",i,1),t.Check.typeOf.number.lessThanOrEquals("westLerp",a,o),t.Check.typeOf.number.lessThanOrEquals("southLerp",c,i),n.defined(u)||(u=new Ce),e.west<=e.east){const t=e.east-e.west;u.west=e.west+a*t,u.east=e.west+o*t}else{const t=r.CesiumMath.TWO_PI+e.east-e.west;u.west=r.CesiumMath.negativePiToPi(e.west+a*t),u.east=r.CesiumMath.negativePiToPi(e.west+o*t)}const s=e.north-e.south;return u.south=e.south+c*s,u.north=e.south+i*s,1===a&&(u.west=e.east),1===o&&(u.east=e.east),1===c&&(u.south=e.north),1===i&&(u.north=e.north),u},Ce.MAX_VALUE=Object.freeze(new Ce(-Math.PI,-r.CesiumMath.PI_OVER_TWO,Math.PI,r.CesiumMath.PI_OVER_TWO)),ke.fromElements=function(e,t,r){return n.defined(r)?(r.x=e,r.y=t,r):new ke(e,t)},ke.clone=function(e,t){if(n.defined(e))return n.defined(t)?(t.x=e.x,t.y=e.y,t):new ke(e.x,e.y)},ke.fromCartesian3=ke.clone,ke.fromCartesian4=ke.clone,ke.packedLength=2,ke.pack=function(e,r,a){return t.Check.typeOf.object("value",e),t.Check.defined("array",r),a=n.defaultValue(a,0),r[a++]=e.x,r[a]=e.y,r},ke.unpack=function(e,r,a){return t.Check.defined("array",e),r=n.defaultValue(r,0),n.defined(a)||(a=new ke),a.x=e[r++],a.y=e[r],a},ke.packArray=function(e,r){t.Check.defined("array",e);const a=e.length,c=2*a;if(n.defined(r)){if(!Array.isArray(r)&&r.length!==c)throw new t.DeveloperError("If result is a typed array, it must have exactly array.length * 2 elements");r.length!==c&&(r.length=c)}else r=new Array(c);for(let t=0;t