/** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Columbus View (Pat. Pend.) * * Portions licensed separately. * See https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md for full licensing details. */ /** @license mersenne-twister.js - https://gist.github.com/banksean/300494 Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura, All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The names of its contributors may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** @license when.js - https://github.com/cujojs/when MIT License (c) copyright B Cavalier & J Hann * A lightweight CommonJS Promises/A and when() implementation * when is part of the cujo.js family of libraries (http://cujojs.com/) * * Licensed under the MIT License at: * http://www.opensource.org/licenses/mit-license.php * * @version 1.7.1 */ !function(){define("Core/defined",[],function(){"use strict";function t(t){return void 0!==t&&null!==t}return t}),define("Core/DeveloperError",["./defined"],function(t){"use strict";function e(t){this.name="DeveloperError",this.message=t;var e;try{throw new Error}catch(t){e=t.stack}this.stack=e}return t(Object.create)&&(e.prototype=Object.create(Error.prototype),e.prototype.constructor=e),e.prototype.toString=function(){var e=this.name+": "+this.message;return t(this.stack)&&(e+="\n"+this.stack.toString()),e},e.throwInstantiationError=function(){throw new e("This function defines an interface and should not be called directly.")},e}),define("Core/Check",["./defined","./DeveloperError"],function(t,e){"use strict";function n(t){return t+" is required, actual value was undefined"}function r(t,e,n){return"Expected "+n+" to be typeof "+e+", actual typeof was "+t}var i={};return i.typeOf={},i.defined=function(r,i){if(!t(i))throw new e(n(r))},i.typeOf.func=function(t,n){if("function"!=typeof n)throw new e(r(typeof n,"function",t))},i.typeOf.string=function(t,n){if("string"!=typeof n)throw new e(r(typeof n,"string",t))},i.typeOf.number=function(t,n){if("number"!=typeof n)throw new e(r(typeof n,"number",t))},i.typeOf.number.lessThan=function(t,n,r){if(i.typeOf.number(t,n),n>=r)throw new e("Expected "+t+" to be less than "+r+", actual value was "+n)},i.typeOf.number.lessThanOrEquals=function(t,n,r){if(i.typeOf.number(t,n),n>r)throw new e("Expected "+t+" to be less than or equal to "+r+", actual value was "+n)},i.typeOf.number.greaterThan=function(t,n,r){if(i.typeOf.number(t,n),n<=r)throw new e("Expected "+t+" to be greater than "+r+", actual value was "+n)},i.typeOf.number.greaterThanOrEquals=function(t,n,r){if(i.typeOf.number(t,n),n>>0,this.mti=1;this.mti>>30;this.mt[this.mti]=(1812433253*((4294901760&t)>>>16)<<16)+1812433253*(65535&t)+this.mti,this.mt[this.mti]>>>=0}},t.prototype.genrand_int32=function(){var t,e=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n>>1^e[1&t];for(;n>>1^e[1&t];t=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^t>>>1^e[1&t],this.mti=0}return t=this.mt[this.mti++],t^=t>>>11,t^=t<<7&2636928640,t^=t<<15&4022730752,(t^=t>>>18)>>>0},t.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},t}),define("Core/Math",["../ThirdParty/mersenne-twister","./Check","./defaultValue","./defined","./DeveloperError"],function(t,e,n,r,i){"use strict";var o={};o.EPSILON1=.1,o.EPSILON2=.01,o.EPSILON3=.001,o.EPSILON4=1e-4,o.EPSILON5=1e-5,o.EPSILON6=1e-6,o.EPSILON7=1e-7,o.EPSILON8=1e-8,o.EPSILON9=1e-9,o.EPSILON10=1e-10,o.EPSILON11=1e-11,o.EPSILON12=1e-12,o.EPSILON13=1e-13,o.EPSILON14=1e-14,o.EPSILON15=1e-15,o.EPSILON16=1e-16,o.EPSILON17=1e-17,o.EPSILON18=1e-18,o.EPSILON19=1e-19,o.EPSILON20=1e-20,o.EPSILON21=1e-21,o.GRAVITATIONALPARAMETER=3986004418e5,o.SOLAR_RADIUS=6955e5,o.LUNAR_RADIUS=1737400,o.SIXTY_FOUR_KILOBYTES=65536,o.FOUR_GIGABYTES=4294967296,o.sign=n(Math.sign,function(t){return t=+t,0===t||t!==t?t:t>0?1:-1}),o.signNotZero=function(t){return t<0?-1:1},o.toSNorm=function(t,e){return e=n(e,255),Math.round((.5*o.clamp(t,-1,1)+.5)*e)},o.fromSNorm=function(t,e){return e=n(e,255),o.clamp(t,0,e)/e*2-1},o.normalize=function(t,e,n){return n=Math.max(n-e,0),0===n?0:o.clamp((t-e)/n,0,1)},o.sinh=n(Math.sinh,function(t){return(Math.exp(t)-Math.exp(-t))/2}),o.cosh=n(Math.cosh,function(t){return(Math.exp(t)+Math.exp(-t))/2}),o.lerp=function(t,e,n){return(1-n)*t+n*e},o.PI=Math.PI,o.ONE_OVER_PI=1/Math.PI,o.PI_OVER_TWO=Math.PI/2,o.PI_OVER_THREE=Math.PI/3,o.PI_OVER_FOUR=Math.PI/4,o.PI_OVER_SIX=Math.PI/6,o.THREE_PI_OVER_TWO=3*Math.PI/2,o.TWO_PI=2*Math.PI,o.ONE_OVER_TWO_PI=1/(2*Math.PI),o.RADIANS_PER_DEGREE=Math.PI/180,o.DEGREES_PER_RADIAN=180/Math.PI,o.RADIANS_PER_ARCSECOND=o.RADIANS_PER_DEGREE/3600,o.toRadians=function(t){return t*o.RADIANS_PER_DEGREE},o.toDegrees=function(t){return t*o.DEGREES_PER_RADIAN},o.convertLongitudeRange=function(t){var e=o.TWO_PI,n=t-Math.floor(t/e)*e;return n<-Math.PI?n+e:n>=Math.PI?n-e:n},o.clampToLatitudeRange=function(t){return o.clamp(t,-1*o.PI_OVER_TWO,o.PI_OVER_TWO)},o.negativePiToPi=function(t){return o.zeroToTwoPi(t+o.PI)-o.PI},o.zeroToTwoPi=function(t){var e=o.mod(t,o.TWO_PI);return Math.abs(e)o.EPSILON14?o.TWO_PI:e},o.mod=function(t,e){return(t%e+e)%e},o.equalsEpsilon=function(t,e,r,i){i=n(i,r);var o=Math.abs(t-e);return o<=i||o<=r*Math.max(Math.abs(t),Math.abs(e))},o.lessThan=function(t,e,n){return t-e<-n},o.lessThanOrEquals=function(t,e,n){return t-en},o.greaterThanOrEquals=function(t,e,n){return t-e>-n};var a=[1];o.factorial=function(t){var e=a.length;if(t>=e)for(var n=a[e-1],r=e;r<=t;r++){var i=n*r;a.push(i),n=i}return a[t]},o.incrementWrap=function(t,e,r){return r=n(r,0),++t,t>e&&(t=r),t},o.isPowerOfTwo=function(t){return 0!==t&&0==(t&t-1)},o.nextPowerOfTwo=function(t){return--t,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t},o.clamp=function(t,e,n){return tn?n:t};var u=new t;return o.setRandomNumberSeed=function(e){u=new t(e)},o.nextRandomNumber=function(){return u.random()},o.randomBetween=function(t,e){return o.nextRandomNumber()*(e-t)+t},o.acosClamped=function(t){return Math.acos(o.clamp(t,-1,1))},o.asinClamped=function(t){return Math.asin(o.clamp(t,-1,1))},o.chordLength=function(t,e){return 2*e*Math.sin(.5*t)},o.logBase=function(t,e){return Math.log(t)/Math.log(e)},o.cbrt=n(Math.cbrt,function(t){var e=Math.pow(Math.abs(t),1/3);return t<0?-e:e}),o.log2=n(Math.log2,function(t){return Math.log(t)*Math.LOG2E}),o.fog=function(t,e){var n=t*e;return 1-Math.exp(-n*n)},o.fastApproximateAtan=function(t){return t*(-.1784*Math.abs(t)-.0663*t*t+1.0301)},o.fastApproximateAtan2=function(t,e){var n,r,i=Math.abs(t);n=Math.abs(e),r=Math.max(i,n),n=Math.min(i,n);var a=n/r;return i=o.fastApproximateAtan(a),i=Math.abs(e)>Math.abs(t)?o.PI_OVER_TWO-i:i,i=t<0?o.PI-i:i,i=e<0?-i:i},o}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i,o){"use strict";function a(t,n){this.x=e(t,0),this.y=e(n,0)}a.fromElements=function(t,e,r){return n(r)?(r.x=t,r.y=e,r):new a(t,e)},a.clone=function(t,e){if(n(t))return n(e)?(e.x=t.x,e.y=t.y,e):new a(t.x,t.y)},a.fromCartesian3=a.clone,a.fromCartesian4=a.clone,a.packedLength=2,a.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r]=t.y,n},a.unpack=function(t,r,i){return r=e(r,0),n(i)||(i=new a),i.x=t[r++],i.y=t[r],i},a.packArray=function(t,e){var r=t.length;n(e)?e.length=2*r:e=new Array(2*r);for(var i=0;i>1^-(1&t)}var s={};s.octEncodeInRange=function(t,e,n){if(n.x=t.x/(Math.abs(t.x)+Math.abs(t.y)+Math.abs(t.z)),n.y=t.y/(Math.abs(t.x)+Math.abs(t.y)+Math.abs(t.z)),t.z<0){var r=n.x,i=n.y;n.x=(1-Math.abs(i))*o.signNotZero(r),n.y=(1-Math.abs(r))*o.signNotZero(i)}return n.x=o.toSNorm(n.x,e),n.y=o.toSNorm(n.y,e),n},s.octEncode=function(t,e){return s.octEncodeInRange(t,255,e)};var c=new t,h=new Uint8Array(1);s.octEncodeToCartesian4=function(t,e){return s.octEncodeInRange(t,65535,c),e.x=a(c.x*(1/256)),e.y=a(c.x),e.z=a(c.y*(1/256)),e.w=a(c.y),e},s.octDecodeInRange=function(t,n,r,i){if(i.x=o.fromSNorm(t,r),i.y=o.fromSNorm(n,r),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){var a=i.x;i.x=(1-Math.abs(i.y))*o.signNotZero(a),i.y=(1-Math.abs(a))*o.signNotZero(i.y)}return e.normalize(i,i)},s.octDecode=function(t,e,n){return s.octDecodeInRange(t,e,255,n)},s.octDecodeFromCartesian4=function(t,e){var n=t.x,r=t.y,i=t.z,o=t.w,a=256*n+r,u=256*i+o;return s.octDecodeInRange(a,u,65535,e)},s.octPackFloat=function(t){return 256*t.x+t.y};var f=new t;return s.octEncodeFloat=function(t){return s.octEncode(t,f),s.octPackFloat(f)},s.octDecodeFloat=function(t,e){var n=t/256,r=Math.floor(n),i=256*(n-r);return s.octDecode(r,i,e)},s.octPack=function(t,e,n,r){var i=s.octEncodeFloat(t),o=s.octEncodeFloat(e),a=s.octEncode(n,f);return r.x=65536*a.x+i,r.y=65536*a.y+o,r},s.octUnpack=function(t,e,n,r){var i=t.x/65536,o=Math.floor(i),a=65536*(i-o);i=t.y/65536;var u=Math.floor(i),c=65536*(i-u);s.octDecodeFloat(a,e),s.octDecodeFloat(c,n),s.octDecode(o,u,r)},s.compressTextureCoordinates=function(t){return 4096*(4095*t.x|0)+(4095*t.y|0)},s.decompressTextureCoordinates=function(t,e){var n=t/4096,r=Math.floor(n);return e.x=r/4095,e.y=(t-4096*r)/4095,e},s.zigZagDeltaDecode=function(t,e,n){for(var i=t.length,o=0,a=0,s=0,c=0;cr.EPSILON12);return e(c)?(c.x=h*T,c.y=f*I,c.z=l*b,c):new t(h*T,f*I,l*b)}var o=new t,a=new t;return i}),define("Core/Cartographic",["./Cartesian3","./Check","./defaultValue","./defined","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,n,r,i,o,a){"use strict";function u(t,e,r){this.longitude=n(t,0),this.latitude=n(e,0),this.height=n(r,0)}u.fromRadians=function(t,e,i,o){return i=n(i,0),r(o)?(o.longitude=t,o.latitude=e,o.height=i,o):new u(t,e,i)},u.fromDegrees=function(t,e,n,r){return t=o.toRadians(t),e=o.toRadians(e),u.fromRadians(t,e,n,r)};var s=new t,c=new t,h=new t,f=new t(1/6378137,1/6378137,1/6356752.314245179),l=new t(1/40680631590769,1/40680631590769,1/40408299984661.445),d=o.EPSILON1;return u.fromCartesian=function(e,n,i){var m=r(n)?n.oneOverRadii:f,p=r(n)?n.oneOverRadiiSquared:l,y=r(n)?n._centerToleranceSquared:d,g=a(e,m,p,y,c);if(r(g)){var v=t.multiplyComponents(g,p,s);v=t.normalize(v,v);var w=t.subtract(e,g,h),x=Math.atan2(v.y,v.x),M=Math.asin(v.z),_=o.sign(t.dot(w,e))*t.magnitude(w);return r(i)?(i.longitude=x,i.latitude=M,i.height=_,i):new u(x,M,_)}},u.toCartesian=function(e,n,r){return t.fromRadians(e.longitude,e.latitude,e.height,n,r)},u.clone=function(t,e){if(r(t))return r(e)?(e.longitude=t.longitude,e.latitude=t.latitude,e.height=t.height,e):new u(t.longitude,t.latitude,t.height)},u.equals=function(t,e){return t===e||r(t)&&r(e)&&t.longitude===e.longitude&&t.latitude===e.latitude&&t.height===e.height},u.equalsEpsilon=function(t,e,n){return t===e||r(t)&&r(e)&&Math.abs(t.longitude-e.longitude)<=n&&Math.abs(t.latitude-e.latitude)<=n&&Math.abs(t.height-e.height)<=n},u.ZERO=i(new u(0,0,0)),u.prototype.clone=function(t){return u.clone(this,t)},u.prototype.equals=function(t){return u.equals(this,t)},u.prototype.equalsEpsilon=function(t,e){return u.equalsEpsilon(this,t,e)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(t){"use strict";var e=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(t){return!1}}(),n=Object.defineProperties;return e&&t(n)||(n=function(t){return t}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,n,r,i,o,a,u,s,c){"use strict";function h(e,n,i,o){n=r(n,0),i=r(i,0),o=r(o,0),e._radii=new t(n,i,o),e._radiiSquared=new t(n*n,i*i,o*o),e._radiiToTheFourth=new t(n*n*n*n,i*i*i*i,o*o*o*o),e._oneOverRadii=new t(0===n?0:1/n,0===i?0:1/i,0===o?0:1/o),e._oneOverRadiiSquared=new t(0===n?0:1/(n*n),0===i?0:1/(i*i),0===o?0:1/(o*o)),e._minimumRadius=Math.min(n,i,o),e._maximumRadius=Math.max(n,i,o),e._centerToleranceSquared=s.EPSILON1,0!==e._radiiSquared.z&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function f(t,e,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,h(this,t,e,n)}o(f.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}}}),f.clone=function(e,n){if(i(e)){var r=e._radii;return i(n)?(t.clone(r,n._radii),t.clone(e._radiiSquared,n._radiiSquared),t.clone(e._radiiToTheFourth,n._radiiToTheFourth),t.clone(e._oneOverRadii,n._oneOverRadii),t.clone(e._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=e._minimumRadius,n._maximumRadius=e._maximumRadius,n._centerToleranceSquared=e._centerToleranceSquared,n):new f(r.x,r.y,r.z)}},f.fromCartesian3=function(t,e){return i(e)||(e=new f),i(t)?(h(e,t.x,t.y,t.z),e):e},f.WGS84=u(new f(6378137,6378137,6356752.314245179)),f.UNIT_SPHERE=u(new f(1,1,1)),f.MOON=u(new f(s.LUNAR_RADIUS,s.LUNAR_RADIUS,s.LUNAR_RADIUS)),f.prototype.clone=function(t){return f.clone(this,t)},f.packedLength=t.packedLength,f.pack=function(e,n,i){return i=r(i,0),t.pack(e._radii,n,i),n},f.unpack=function(e,n,i){n=r(n,0);var o=t.unpack(e,n);return f.fromCartesian3(o,i)},f.prototype.geocentricSurfaceNormal=t.normalize,f.prototype.geodeticSurfaceNormalCartographic=function(e,n){var r=e.longitude,o=e.latitude,a=Math.cos(o),u=a*Math.cos(r),s=a*Math.sin(r),c=Math.sin(o);return i(n)||(n=new t),n.x=u,n.y=s,n.z=c,t.normalize(n,n)},f.prototype.geodeticSurfaceNormal=function(e,n){return i(n)||(n=new t),n=t.multiplyComponents(e,this._oneOverRadiiSquared,n),t.normalize(n,n)};var l=new t,d=new t;f.prototype.cartographicToCartesian=function(e,n){var r=l,o=d;this.geodeticSurfaceNormalCartographic(e,r),t.multiplyComponents(this._radiiSquared,r,o);var a=Math.sqrt(t.dot(r,o));return t.divideByScalar(o,a,o),t.multiplyByScalar(r,e.height,r),i(n)||(n=new t),t.add(o,r,n)},f.prototype.cartographicArrayToCartesianArray=function(t,e){var n=t.length;i(e)?e.length=n:e=new Array(n);for(var r=0;r=this._radii.z-n))return o},f}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(t,e,n,r,i,o,a,u){"use strict";function s(t,e,r,i){this.west=n(t,0),this.south=n(e,0),this.east=n(r,0),this.north=n(i,0)}i(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(t,e,r){return r=n(r,0),e[r++]=t.west,e[r++]=t.south,e[r++]=t.east,e[r]=t.north,e},s.unpack=function(t,e,i){return e=n(e,0),r(i)||(i=new s),i.west=t[e++],i.south=t[e++],i.east=t[e++],i.north=t[e],i},s.computeWidth=function(t){var e=t.east,n=t.west;return e=0?d.longitude:d.longitude+u.TWO_PI;o=Math.min(o,m),a=Math.max(a,m)}return i-n>a-o&&(n=o,i=a,i>u.PI&&(i-=u.TWO_PI),n>u.PI&&(n-=u.TWO_PI)),r(e)?(e.west=n,e.south=c,e.east=i,e.north=h,e):new s(n,c,i,h)},s.fromCartesianArray=function(t,e,i){e=n(e,o.WGS84);for(var a=Number.MAX_VALUE,c=-Number.MAX_VALUE,h=Number.MAX_VALUE,f=-Number.MAX_VALUE,l=Number.MAX_VALUE,d=-Number.MAX_VALUE,m=0,p=t.length;m=0?y.longitude:y.longitude+u.TWO_PI;h=Math.min(h,g),f=Math.max(f,g)}return c-a>f-h&&(a=h,c=f,c>u.PI&&(c-=u.TWO_PI),a>u.PI&&(a-=u.TWO_PI)),r(i)?(i.west=a,i.south=l,i.east=c,i.north=d,i):new s(a,l,c,d)},s.clone=function(t,e){if(r(t))return r(e)?(e.west=t.west,e.south=t.south,e.east=t.east,e.north=t.north,e):new s(t.west,t.south,t.east,t.north)},s.equalsEpsilon=function(t,e,n){return t===e||r(t)&&r(e)&&Math.abs(t.west-e.west)<=n&&Math.abs(t.south-e.south)<=n&&Math.abs(t.east-e.east)<=n&&Math.abs(t.north-e.north)<=n},s.prototype.clone=function(t){return s.clone(this,t)},s.prototype.equals=function(t){return s.equals(this,t)},s.equals=function(t,e){return t===e||r(t)&&r(e)&&t.west===e.west&&t.south===e.south&&t.east===e.east&&t.north===e.north},s.prototype.equalsEpsilon=function(t,e){return s.equalsEpsilon(this,t,e)},s.validate=function(t){},s.southwest=function(e,n){return r(n)?(n.longitude=e.west,n.latitude=e.south,n.height=0,n):new t(e.west,e.south)},s.northwest=function(e,n){return r(n)?(n.longitude=e.west,n.latitude=e.north,n.height=0,n):new t(e.west,e.north)},s.northeast=function(e,n){return r(n)?(n.longitude=e.east,n.latitude=e.north,n.height=0,n):new t(e.east,e.north)},s.southeast=function(e,n){return r(n)?(n.longitude=e.east,n.latitude=e.south,n.height=0,n):new t(e.east,e.south)},s.center=function(e,n){var i=e.east,o=e.west;i0?i+=u.TWO_PI:a0&&(a+=u.TWO_PI),i=d))return r(n)?(n.west=h,n.south=l,n.east=f,n.north=d,n):new s(h,l,f,d)}},s.simpleIntersection=function(t,e,n){var i=Math.max(t.west,e.west),o=Math.max(t.south,e.south),a=Math.min(t.east,e.east),u=Math.min(t.north,e.north);if(!(o>=u||i>=a))return r(n)?(n.west=i,n.south=o,n.east=a,n.north=u,n):new s(i,o,a,u)},s.union=function(t,e,n){r(n)||(n=new s);var i=t.east,o=t.west,a=e.east,c=e.west;i0?i+=u.TWO_PI:a0&&(a+=u.TWO_PI),ii||u.equalsEpsilon(n,i,u.EPSILON14))&&(n=t.south&&r<=t.north};var c=new t;return s.subsample=function(t,e,i,a){e=n(e,o.WGS84),i=n(i,0),r(a)||(a=[]);var h=0,f=t.north,l=t.south,d=t.east,m=t.west,p=c;p.height=i,p.longitude=m,p.latitude=f,a[h]=e.cartographicToCartesian(p,a[h]),h++,p.longitude=d,a[h]=e.cartographicToCartesian(p,a[h]),h++,p.latitude=l,a[h]=e.cartographicToCartesian(p,a[h]),h++,p.longitude=m,a[h]=e.cartographicToCartesian(p,a[h]),h++,p.latitude=f<0?f:l>0?l:0;for(var y=1;y<8;++y)p.longitude=-Math.PI+y*u.PI_OVER_TWO,s.contains(t,p)&&(a[h]=e.cartographicToCartesian(p,a[h]),h++);return 0===p.latitude&&(p.longitude=m,a[h]=e.cartographicToCartesian(p,a[h]),h++,p.longitude=d,a[h]=e.cartographicToCartesian(p,a[h]),h++),a.length=h,a},s.MAX_VALUE=a(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),function(t){"use strict";t("ThirdParty/when",[],function(){function t(t,n,r,i){return e(t).then(n,r,i)}function e(t){var e,n;return t instanceof r?e=t:u(t)?(n=a(),t.then(function(t){n.resolve(t)},function(t){n.reject(t)},function(t){n.progress(t)}),e=n.promise):e=i(t),e}function n(e){return t(e,o)}function r(t){this.then=t}function i(t){return new r(function(n){try{return e(n?n(t):t)}catch(t){return o(t)}})}function o(t){return new r(function(n,r){try{return r?e(r(t)):o(t)}catch(t){return o(t)}})}function a(){function t(t,e,n){return l(t,e,n)}function n(t){return m(t)}function i(t){return m(o(t))}function u(t){return d(t)}var s,c,h,f,l,d,m;return c=new r(t),s={then:t,resolve:n,reject:i,progress:u,promise:c,resolver:{resolve:n,reject:i,progress:u}},h=[],f=[],l=function(t,e,n){var r,i;return r=a(),i="function"==typeof n?function(t){try{r.progress(n(t))}catch(t){r.progress(t)}}:function(t){r.progress(t)},h.push(function(n){n.then(t,e).then(r.resolve,r.reject,i)}),f.push(i),r.promise},d=function(t){return p(f,t),t},m=function(t){return t=e(t),l=t.then,m=e,d=g,p(h,t),f=h=M,t},s}function u(t){return t&&"function"==typeof t.then}function s(e,n,r,i,o){return y(2,arguments),t(e,function(e){function u(t){p(t)}function s(t){m(t)}var c,h,f,l,d,m,p,y,v,w;if(v=e.length>>>0,c=Math.max(0,Math.min(n,v)),f=[],h=v-c+1,l=[],d=a(),c)for(y=d.progress,p=function(t){l.push(t),--h||(m=p=g,d.reject(l))},m=function(t){f.push(t),--c||(m=p=g,d.resolve(f))},w=0;w>>0,r=[],c=a(),o)for(u=function(e,i){t(e,n).then(function(t){r[i]=t,--o||c.resolve(r)},c.reject)},s=0;s2;return t(e,function(t){return t=i?r:t,n.resolve(t),t},function(t){return n.reject(t),o(t)},n.progress)}function p(t,e){for(var n,r=0;n=t[r++];)n(e)}function y(t,e){for(var n,r=e.length;r>t;)if(null!=(n=e[--r])&&"function"!=typeof n)throw new Error("arg "+r+" must be a function")}function g(){}function v(t){return t}var w,x,M;return t.defer=a,t.resolve=e,t.reject=n,t.join=f,t.all=h,t.map=l,t.reduce=d,t.any=c,t.some=s,t.chain=m,t.isPromise=u,r.prototype={always:function(t,e){return this.then(t,t,e)},otherwise:function(t){return this.then(M,t)},yield:function(t){return this.then(function(){return t})},spread:function(t){return this.then(function(e){return h(e,function(e){return t.apply(M,e)})})}},x=[].slice,w=[].reduce||function(t){var e,n,r,i,o;if(o=0,e=Object(this),i=e.length>>>0,n=arguments,n.length<=1)for(;;){if(o in e){r=e[o++];break}if(++o>=i)throw new TypeError}else r=n[1];for(;o