define(["exports","./Matrix3-b6f074fa","./defaultValue-0a909f67","./Math-e97915da","./RuntimeError-06c93819"],(function(t,e,n,a,u){"use strict";function r(t,e,a,u){this.x=n.defaultValue(t,0),this.y=n.defaultValue(e,0),this.z=n.defaultValue(a,0),this.w=n.defaultValue(u,0)}r.fromElements=function(t,e,a,u,i){return n.defined(i)?(i.x=t,i.y=e,i.z=a,i.w=u,i):new r(t,e,a,u)},r.fromColor=function(t,e){return n.defined(e)?(e.x=t.red,e.y=t.green,e.z=t.blue,e.w=t.alpha,e):new r(t.red,t.green,t.blue,t.alpha)},r.clone=function(t,e){if(n.defined(t))return n.defined(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e.w=t.w,e):new r(t.x,t.y,t.z,t.w)},r.packedLength=4,r.pack=function(t,e,a){return a=n.defaultValue(a,0),e[a++]=t.x,e[a++]=t.y,e[a++]=t.z,e[a]=t.w,e},r.unpack=function(t,e,a){return e=n.defaultValue(e,0),n.defined(a)||(a=new r),a.x=t[e++],a.y=t[e++],a.z=t[e++],a.w=t[e],a},r.packArray=function(t,e){const a=t.length,u=4*a;n.defined(e)?(Array.isArray(e)||e.length===u)&&e.length!==u&&(e.length=u):e=new Array(u);for(let n=0;n=0?n.longitude:n.longitude+a.CesiumMath.TWO_PI;i=Math.min(i,l),o=Math.max(o,l)}return r-u>o-i&&(u=i,r=o,r>a.CesiumMath.PI&&(r-=a.CesiumMath.TWO_PI),u>a.CesiumMath.PI&&(u-=a.CesiumMath.TWO_PI)),n.defined(e)?(e.west=u,e.south=s,e.east=r,e.north=c,e):new E(u,s,r,c)},E.fromCartesianArray=function(t,u,r){u=n.defaultValue(u,e.Ellipsoid.WGS84);let i=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=Number.MAX_VALUE,c=-Number.MAX_VALUE,l=Number.MAX_VALUE,f=-Number.MAX_VALUE;for(let e=0,n=t.length;e=0?n.longitude:n.longitude+a.CesiumMath.TWO_PI;s=Math.min(s,r),c=Math.max(c,r)}return o-i>c-s&&(i=s,o=c,o>a.CesiumMath.PI&&(o-=a.CesiumMath.TWO_PI),i>a.CesiumMath.PI&&(i-=a.CesiumMath.TWO_PI)),n.defined(r)?(r.west=i,r.south=l,r.east=o,r.north=f,r):new E(i,l,o,f)},E.clone=function(t,e){if(n.defined(t))return n.defined(e)?(e.west=t.west,e.south=t.south,e.east=t.east,e.north=t.north,e):new E(t.west,t.south,t.east,t.north)},E.equalsEpsilon=function(t,e,a){return a=n.defaultValue(a,0),t===e||n.defined(t)&&n.defined(e)&&Math.abs(t.west-e.west)<=a&&Math.abs(t.south-e.south)<=a&&Math.abs(t.east-e.east)<=a&&Math.abs(t.north-e.north)<=a},E.prototype.clone=function(t){return E.clone(this,t)},E.prototype.equals=function(t){return E.equals(this,t)},E.equals=function(t,e){return t===e||n.defined(t)&&n.defined(e)&&t.west===e.west&&t.south===e.south&&t.east===e.east&&t.north===e.north},E.prototype.equalsEpsilon=function(t,e){return E.equalsEpsilon(this,t,e)},E.validate=function(t){},E.southwest=function(t,a){return n.defined(a)?(a.longitude=t.west,a.latitude=t.south,a.height=0,a):new e.Cartographic(t.west,t.south)},E.northwest=function(t,a){return n.defined(a)?(a.longitude=t.west,a.latitude=t.north,a.height=0,a):new e.Cartographic(t.west,t.north)},E.northeast=function(t,a){return n.defined(a)?(a.longitude=t.east,a.latitude=t.north,a.height=0,a):new e.Cartographic(t.east,t.north)},E.southeast=function(t,a){return n.defined(a)?(a.longitude=t.east,a.latitude=t.south,a.height=0,a):new e.Cartographic(t.east,t.south)},E.center=function(t,u){let r=t.east;const i=t.west;r0?r+=a.CesiumMath.TWO_PI:o0&&(o+=a.CesiumMath.TWO_PI),r=h?void 0:n.defined(u)?(u.west=c,u.south=f,u.east=l,u.north=h,u):new E(c,f,l,h)},E.simpleIntersection=function(t,e,a){const u=Math.max(t.west,e.west),r=Math.max(t.south,e.south),i=Math.min(t.east,e.east),o=Math.min(t.north,e.north);if(!(r>=o||u>=i))return n.defined(a)?(a.west=u,a.south=r,a.east=i,a.north=o,a):new E(u,r,i,o)},E.union=function(t,e,u){n.defined(u)||(u=new E);let r=t.east,i=t.west,o=e.east,s=e.west;r0?r+=a.CesiumMath.TWO_PI:o0&&(o+=a.CesiumMath.TWO_PI),rr||a.CesiumMath.equalsEpsilon(n,r,a.CesiumMath.EPSILON14))&&(n=t.south&&u<=t.north};const I=new e.Cartographic;function U(t,e){this.x=n.defaultValue(t,0),this.y=n.defaultValue(e,0)}E.subsample=function(t,u,r,i){u=n.defaultValue(u,e.Ellipsoid.WGS84),r=n.defaultValue(r,0),n.defined(i)||(i=[]);let o=0;const s=t.north,c=t.south,l=t.east,f=t.west,h=I;h.height=r,h.longitude=f,h.latitude=s,i[o]=u.cartographicToCartesian(h,i[o]),o++,h.longitude=l,i[o]=u.cartographicToCartesian(h,i[o]),o++,h.latitude=c,i[o]=u.cartographicToCartesian(h,i[o]),o++,h.longitude=f,i[o]=u.cartographicToCartesian(h,i[o]),o++,h.latitude=s<0?s:c>0?c:0;for(let e=1;e<8;++e)h.longitude=-Math.PI+e*a.CesiumMath.PI_OVER_TWO,E.contains(t,h)&&(i[o]=u.cartographicToCartesian(h,i[o]),o++);return 0===h.latitude&&(h.longitude=f,i[o]=u.cartographicToCartesian(h,i[o]),o++,h.longitude=l,i[o]=u.cartographicToCartesian(h,i[o]),o++),i.length=o,i},E.subsection=function(t,e,u,r,i,o){if(n.defined(o)||(o=new E),t.west<=t.east){const n=t.east-t.west;o.west=t.west+e*n,o.east=t.west+r*n}else{const n=a.CesiumMath.TWO_PI+t.east-t.west;o.west=a.CesiumMath.negativePiToPi(t.west+e*n),o.east=a.CesiumMath.negativePiToPi(t.west+r*n)}const s=t.north-t.south;return o.south=t.south+u*s,o.north=t.south+i*s,1===e&&(o.west=t.east),1===r&&(o.east=t.east),1===u&&(o.south=t.north),1===i&&(o.north=t.north),o},E.MAX_VALUE=Object.freeze(new E(-Math.PI,-a.CesiumMath.PI_OVER_TWO,Math.PI,a.CesiumMath.PI_OVER_TWO)),U.fromElements=function(t,e,a){return n.defined(a)?(a.x=t,a.y=e,a):new U(t,e)},U.clone=function(t,e){if(n.defined(t))return n.defined(e)?(e.x=t.x,e.y=t.y,e):new U(t.x,t.y)},U.fromCartesian3=U.clone,U.fromCartesian4=U.clone,U.packedLength=2,U.pack=function(t,e,a){return a=n.defaultValue(a,0),e[a++]=t.x,e[a]=t.y,e},U.unpack=function(t,e,a){return e=n.defaultValue(e,0),n.defined(a)||(a=new U),a.x=t[e++],a.y=t[e],a},U.packArray=function(t,e){const a=t.length,u=2*a;n.defined(e)?(Array.isArray(e)||e.length===u)&&e.length!==u&&(e.length=u):e=new Array(u);for(let n=0;n